Skip to content

Migrate entra approleassignment and enterpriseapp commands to Zod#7365

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

Migrate entra approleassignment and enterpriseapp commands to Zod#7365
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz/migrate-entra-commands-to-zod

Conversation

@waldekmastykarz
Copy link
Copy Markdown
Member

Summary

Migrates the following commands from legacy options/validators to Zod schemas:

  • entra approleassignment add
  • entra approleassignment list
  • entra approleassignment remove
  • entra enterpriseapp add
  • entra enterpriseapp get
  • entra enterpriseapp list
  • entra enterpriseapp remove

Changes per command

  • Replaced interface Options extends GlobalOptions with export const options = z.strictObject({...globalOptionsZod.shape, ...})
  • Replaced GUID validation (validation.isValidGuid()) with z.uuid()
  • Replaced #initOptions(), #initValidators(), #initOptionSets(), #initTelemetry(), #initTypes() with declarative Zod schema + getRefinedSchema() for option sets
  • Added get schema() method
  • Removed constructors

Test changes

  • Validation tests now use commandOptionsSchema.safeParse() instead of command.validate()
  • Removed redundant "supports specifying" tests
  • Tests are synchronous (no more async for validation)

Closes #7295

Migrates the following commands from legacy options/validators to Zod schemas:
- entra approleassignment add
- entra approleassignment list
- entra approleassignment remove
- entra enterpriseapp add
- entra enterpriseapp get
- entra enterpriseapp list
- entra enterpriseapp remove

Closes pnp#7295

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 entra approleassignment and enterpriseapp commands to Zod

1 participant