Skip to content

Migrates flow commands to Zod#7373

Open
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz/migrate-flow-to-zod
Open

Migrates flow commands to Zod#7373
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz/migrate-flow-to-zod

Conversation

@waldekmastykarz
Copy link
Copy Markdown
Member

Closes #7304

Summary

Migrates all 13 remaining flow commands from the legacy Options/constructor validation pattern to Zod schema validation.

Commands migrated

  • flow disable, flow enable, flow get, flow export, flow list, flow remove
  • flow owner list, flow owner ensure, flow owner remove
  • flow run cancel, flow run get, flow run list, flow run resubmit

Changes

  • Replaced interface Options extends GlobalOptions + #initOptions/#initValidators/#initTelemetry with exported Zod schemas using z.strictObject() and globalOptionsZod.shape
  • Added get schema() getter and getRefinedSchema() where cross-field validation is needed
  • Used z.uuid() for GUID validation, z.enum() for enum options, .refine() for UPN and ISO datetime validation
  • Updated all 13 test files to use commandOptionsSchema.safeParse() pattern
  • Added accessToken.assertAccessTokenType stub to all test files
  • Removed obsolete "supports specifying" tests

Testing

  • All 15720 tests pass
  • Build passes

Migrates all flow commands to use Zod schema validation,
replacing the old interface-based Options pattern with
exported Zod schemas.

Commands migrated:
- flow disable, enable, get, export, list, remove
- flow owner list, ensure, remove
- flow run cancel, get, list, resubmit

Closes pnp#7304

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate flow commands to Zod

1 participant