feat(migrate): import users from a CSV export - #214
Merged
Merged
Conversation
Adds seamless migrate csv, which maps CSV columns onto the user import contract, validates rows with @seamless-auth/types, sends them in batches of 200 and writes a report of every row's outcome. Dry run by default.
Bccorb
marked this pull request as ready for review
October 5, 2026 23:59
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #208 and fells-code/seamless-auth-api#334. Entra ID follows in #213.
Adds
@seamless-auth/types^0.24.0as a dependency. Merge after fells-code/seamless-auth-api#340 is released: on an auth server withoutPOST /admin/users/import, the command says the instance does not support user import.What it adds
email,externalId/id/employee id,phone/mobile,roles,organizations/department), or named in a--mapfile kept beside the export along with default roles, organization roles and the separatorUserImportRowSchema, so a bad email is reported asinvalidwith its spreadsheet row and never costs the rest of a batchUSER_IMPORT_MAX_ROWS), results mapped back to CSV rows. If a later batch fails, the outcomes of the batches that finished are still written to the reportseamless help migrateStarts on cli#144: this is the first command to use
@seamless-auth/typesinstead ofRecord<string, unknown>.Verification
tsc --noEmit,npm run build, and the suite: 1054 passed, 4 skipped after merging currentmain(25 new tests). Coverage 99.2% linesadminrole, a bad email, an unknown department):--apply: the same counts, both users unverified with their roles, external ids and memberships, plus the per-user and per-batch audit events