@postman/sdk-config 0.10.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +6 -0
  2. package/dist/index.cjs +909 -41
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +3 -3
  5. package/dist/index.d.ts +3 -3
  6. package/dist/index.js +895 -42
  7. package/dist/index.js.map +1 -1
  8. package/dist/sdk-config/index.cjs +861 -41
  9. package/dist/sdk-config/index.cjs.map +1 -1
  10. package/dist/sdk-config/index.d.cts +2 -2
  11. package/dist/sdk-config/index.d.ts +2 -2
  12. package/dist/sdk-config/index.js +854 -42
  13. package/dist/sdk-config/index.js.map +1 -1
  14. package/dist/sdk-config/v1/index.cjs +861 -41
  15. package/dist/sdk-config/v1/index.cjs.map +1 -1
  16. package/dist/sdk-config/v1/index.d.cts +3345 -2632
  17. package/dist/sdk-config/v1/index.d.ts +3345 -2632
  18. package/dist/sdk-config/v1/index.js +854 -42
  19. package/dist/sdk-config/v1/index.js.map +1 -1
  20. package/dist/sdk-config-ir/index.cjs +286 -5
  21. package/dist/sdk-config-ir/index.cjs.map +1 -1
  22. package/dist/sdk-config-ir/index.d.cts +2 -2
  23. package/dist/sdk-config-ir/index.d.ts +2 -2
  24. package/dist/sdk-config-ir/index.js +280 -6
  25. package/dist/sdk-config-ir/index.js.map +1 -1
  26. package/dist/sdk-config-ir/v1/index.cjs +286 -5
  27. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  28. package/dist/sdk-config-ir/v1/index.d.cts +3291 -2958
  29. package/dist/sdk-config-ir/v1/index.d.ts +3291 -2958
  30. package/dist/sdk-config-ir/v1/index.js +280 -6
  31. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  32. package/dist/{typescript-Chge0X4f.d.cts → typescript-Byhn4MqL.d.cts} +145 -1
  33. package/dist/{typescript-Chge0X4f.d.ts → typescript-Byhn4MqL.d.ts} +145 -1
  34. package/package.json +1 -1
  35. package/src/sdk-config/v1/README.md +183 -1
  36. package/src/sdk-config-ir/v1/README.md +107 -31
@@ -125,13 +125,21 @@ var oauthScopeSchema = z.strictObject({
125
125
  name: nonEmptyStringSchema.describe("The OAuth scope value requested from the provider."),
126
126
  description: z.string().optional().describe("A description of the OAuth scope included in generated SDK documentation.")
127
127
  });
128
+ var publicClientIdSchema = nonEmptyStringSchema.refine((value) => value.trim() === value, {
129
+ message: "must not have leading or trailing whitespace"
130
+ }).refine((value) => !value.includes("${"), {
131
+ message: "must be a literal public client ID, not an environment expression"
132
+ });
128
133
  var oauthFlowSchema = z.discriminatedUnion("type", [
129
134
  z.strictObject({
130
135
  type: z.literal("authorization-code").describe("Uses the OAuth authorization code flow."),
131
136
  authorizationUrl: nonEmptyStringSchema.describe("The URL used to authorize the client."),
132
137
  tokenUrl: nonEmptyStringSchema.describe("The URL used to exchange a code for tokens."),
133
138
  refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
134
- scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
139
+ scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow."),
140
+ clientId: publicClientIdSchema.optional().describe(
141
+ "The public, non-secret OAuth client ID that generated interactive login flows, such as CLI browser login with PKCE, send to the authorization and token endpoints. It is embedded verbatim in generated code, so it must never be a client secret."
142
+ )
135
143
  }),
136
144
  z.strictObject({
137
145
  type: z.literal("client-credentials").describe("Uses the OAuth client credentials flow."),
@@ -391,6 +399,91 @@ var compatibilityConfigSchema = z.strictObject({
391
399
  legacyInput: legacyInputSchema.optional().describe("Original producer input retained only for migration debugging."),
392
400
  unsupportedFields: z.array(unsupportedFieldSchema).optional().describe("Legacy fields that could not be represented in normalized configuration.")
393
401
  });
402
+ var GITHUB_ACTIONS_SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]*$/;
403
+ var GITHUB_REPOSITORY_SLUG_PATTERN = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;
404
+ var HOMEBREW_FORMULA_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
405
+ var githubActionsSecretNameSchema = z.string({ error: "must be the name of a GitHub Actions secret" }).regex(GITHUB_ACTIONS_SECRET_NAME_PATTERN, {
406
+ error: "must be the name of a GitHub Actions secret: start with an uppercase letter and contain only A-Z, 0-9, or _. Secret values and ${...} expressions are not accepted."
407
+ }).refine((value) => value !== "GITHUB_TOKEN", {
408
+ error: "GITHUB_TOKEN cannot be used: it is the workflow's built-in token, scoped to the generated repository. Store the credential under a different secret name."
409
+ });
410
+ var githubRepositorySlugSchema = z.string({ error: 'must be a GitHub repository in "<owner>/<repo>" form' }).regex(GITHUB_REPOSITORY_SLUG_PATTERN, {
411
+ error: 'must be a GitHub repository in "<owner>/<repo>" form, for example "acme/homebrew-tap"'
412
+ });
413
+ var homebrewFormulaNameSchema = z.string({ error: "must be a Homebrew formula name" }).regex(HOMEBREW_FORMULA_NAME_PATTERN, {
414
+ error: "must be a Homebrew formula name: start with a lowercase letter and contain only a-z, 0-9, or -"
415
+ });
416
+ var cliDistributionGithubAppSchema = z.strictObject({
417
+ appIdSecretName: githubActionsSecretNameSchema.describe(
418
+ "The name of the GitHub Actions secret holding the GitHub App ID or client ID."
419
+ ),
420
+ privateKeySecretName: githubActionsSecretNameSchema.describe(
421
+ "The name of the GitHub Actions secret holding the GitHub App private key in PEM form."
422
+ )
423
+ });
424
+ var channelTokenSecretNameDescription = "The name of the GitHub Actions secret holding a token with write access to the channel repository. Takes precedence over githubApp for this channel.";
425
+ var cliDistributionHomebrewSchema = z.strictObject({
426
+ tap: githubRepositorySlugSchema.describe(
427
+ 'The Homebrew tap repository in "<owner>/<repo>" form that receives the formula.'
428
+ ),
429
+ formula: homebrewFormulaNameSchema.optional().describe("The Homebrew formula name; the generator defaults it to the CLI binary name."),
430
+ tokenSecretName: githubActionsSecretNameSchema.optional().describe(channelTokenSecretNameDescription)
431
+ });
432
+ var cliDistributionScoopSchema = z.strictObject({
433
+ bucket: githubRepositorySlugSchema.describe(
434
+ 'The Scoop bucket repository in "<owner>/<repo>" form that receives the manifest.'
435
+ ),
436
+ tokenSecretName: githubActionsSecretNameSchema.optional().describe(channelTokenSecretNameDescription)
437
+ });
438
+ var cliDistributionConfigSchema = z.strictObject({
439
+ githubApp: cliDistributionGithubAppSchema.optional().describe(
440
+ "A GitHub App used to mint short-lived tokens for every channel without its own tokenSecretName."
441
+ ),
442
+ homebrew: cliDistributionHomebrewSchema.optional().describe("Publishes a Homebrew formula to a tap repository on each tagged release."),
443
+ scoop: cliDistributionScoopSchema.optional().describe("Publishes a Scoop manifest to a bucket repository on each tagged release.")
444
+ }).superRefine((distribution, context) => {
445
+ if (distribution.homebrew !== void 0 || distribution.scoop !== void 0) {
446
+ return;
447
+ }
448
+ if (distribution.githubApp !== void 0) {
449
+ context.addIssue({
450
+ code: "custom",
451
+ message: "githubApp requires at least one distribution channel: homebrew or scoop",
452
+ path: ["githubApp"]
453
+ });
454
+ return;
455
+ }
456
+ context.addIssue({
457
+ code: "custom",
458
+ message: "distribution must configure at least one channel: homebrew or scoop"
459
+ });
460
+ });
461
+ var CLI_DISTRIBUTION_REQUIRES_GITHUB_DELIVERY_MESSAGE = 'distribution requires output.delivery "github": Homebrew and Scoop publish from a tagged GitHub Release produced by the generated release workflow. Set delivery to "github" or remove distribution.';
462
+ var CLI_PUBLISH_REQUIRES_GITHUB_DELIVERY_MESSAGE = 'package publication for target language "cli" requires output.delivery "github": the CLI generator publishes npm packages only from its generated GitHub workflow.';
463
+ var CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = "CLI_DISTRIBUTION_NON_RELEASE_MODE";
464
+ var nonReleaseGithubModes = /* @__PURE__ */ new Set(["pull-request", "push", "commit"]);
465
+ function cliDistributionModeDiagnostic(output, outputPath) {
466
+ const mode = output?.github?.mode;
467
+ if (output?.distribution === void 0 || mode === void 0 || !nonReleaseGithubModes.has(mode)) {
468
+ return void 0;
469
+ }
470
+ return {
471
+ code: CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE,
472
+ severity: "warning",
473
+ path: [...outputPath, "github", "mode"],
474
+ reason: `GitHub mode "${mode}" does not create a release tag, so Homebrew and Scoop publish only after a semantic-version tag is pushed to the repository.`,
475
+ suggestedAction: 'Use mode "release" or "commit-and-release", or push a version tag after merging generated changes.'
476
+ };
477
+ }
478
+
479
+ // src/sdk-config-ir/v1/diagnostics.ts
480
+ function getSdkConfigIrV1Diagnostics(config) {
481
+ if (config.target.language !== "cli") {
482
+ return [];
483
+ }
484
+ const diagnostic = cliDistributionModeDiagnostic(config.output, ["output"]);
485
+ return diagnostic ? [diagnostic] : [];
486
+ }
394
487
  var httpMethodSchema = z.enum([
395
488
  "GET",
396
489
  "POST",
@@ -444,9 +537,117 @@ var namingConfigSchema = z.strictObject({
444
537
  /** Preserve a word boundary after digits when Fern smart casing is enabled. */
445
538
  smartCasingDigitWordBoundary: z.boolean().optional().describe("Whether smart casing preserves a word boundary after digits.")
446
539
  });
540
+ var ALPHANUMERIC_PATTERN = /[A-Za-z0-9]/;
541
+ var ROOT_GROUP_PATTERN = /^[a-z][a-z0-9_-]*$/;
542
+ var KEBAB_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
543
+ var DOTTED_COMMAND_PATH_PATTERN = /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/;
544
+ var FIELD_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/;
545
+ var RESERVED_USER_AGENT_SUFFIX_FLAGS = /* @__PURE__ */ new Set([
546
+ "params",
547
+ "output",
548
+ "json",
549
+ "format",
550
+ "dry-run",
551
+ "base-url",
552
+ "page-all",
553
+ "page-limit",
554
+ "page-delay",
555
+ "no-pager",
556
+ "no-extract",
557
+ "no-retry",
558
+ "no-stream",
559
+ "quiet",
560
+ "query",
561
+ "help",
562
+ "debug",
563
+ "schema"
564
+ ]);
565
+ var RESERVED_PROFILES_COMMAND_NAMES = /* @__PURE__ */ new Set([
566
+ "auth",
567
+ "completion",
568
+ "man",
569
+ "errors",
570
+ "generate-skills",
571
+ "help"
572
+ ]);
573
+ var binaryNameSchema = nonEmptyStringSchema.regex(ALPHANUMERIC_PATTERN, {
574
+ message: "binaryName must contain at least one ASCII letter or digit"
575
+ });
576
+ var rootGroupSchema = z.string().regex(ROOT_GROUP_PATTERN, {
577
+ message: "rootGroup must start with a lowercase letter and contain only lowercase letters, digits, hyphens, and underscores"
578
+ });
579
+ var userAgentSuffixFlagSchema = z.string().superRefine((value, context) => {
580
+ if (value.startsWith("-")) {
581
+ context.addIssue({
582
+ code: "custom",
583
+ message: 'userAgentSuffixFlag must be the long flag name without the leading "--"'
584
+ });
585
+ } else if (!KEBAB_NAME_PATTERN.test(value)) {
586
+ context.addIssue({
587
+ code: "custom",
588
+ message: "userAgentSuffixFlag must start with a lowercase letter and contain only lowercase letters, digits, and hyphens"
589
+ });
590
+ } else if (RESERVED_USER_AGENT_SUFFIX_FLAGS.has(value)) {
591
+ context.addIssue({
592
+ code: "custom",
593
+ message: `userAgentSuffixFlag "${value}" collides with a built-in global flag`
594
+ });
595
+ }
596
+ });
597
+ var profilesCommandNameSchema = z.string().superRefine((value, context) => {
598
+ if (!KEBAB_NAME_PATTERN.test(value)) {
599
+ context.addIssue({
600
+ code: "custom",
601
+ message: "profiles.commandName must start with a lowercase letter and contain only lowercase letters, digits, and hyphens"
602
+ });
603
+ } else if (RESERVED_PROFILES_COMMAND_NAMES.has(value)) {
604
+ context.addIssue({
605
+ code: "custom",
606
+ message: `profiles.commandName "${value}" collides with a built-in command group`
607
+ });
608
+ }
609
+ });
610
+ function dottedCommandPathSchema(field) {
611
+ return z.string().regex(DOTTED_COMMAND_PATH_PATTERN, {
612
+ message: `${field} must be a dotted command path such as "iam.keys.create"`
613
+ });
614
+ }
615
+ function fieldNameMapSchema(field) {
616
+ const message = `${field} keys and values must be field names containing only [A-Za-z0-9_.-]`;
617
+ return z.record(z.string(), z.string().regex(FIELD_NAME_PATTERN, { message })).superRefine((value, context) => {
618
+ for (const key of Object.keys(value)) {
619
+ if (!FIELD_NAME_PATTERN.test(key)) {
620
+ context.addIssue({ code: "custom", message, path: [key] });
621
+ }
622
+ }
623
+ });
624
+ }
625
+ var profilesProvisionOperationSchema = z.strictObject({
626
+ operation: dottedCommandPathSchema("profiles.provisionOperation.operation").describe(
627
+ "The dotted command path of the operation that mints a profile credential."
628
+ ),
629
+ credential: fieldNameMapSchema("profiles.provisionOperation.credential").refine((value) => Object.keys(value).length > 0, {
630
+ message: "profiles.provisionOperation.credential must map at least one credential field"
631
+ }).describe("Maps each stored credential field to the response field that supplies it."),
632
+ revokeParameters: fieldNameMapSchema("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it.")
633
+ });
634
+ var profilesConfigSchema = z.strictObject({
635
+ enabled: z.boolean().describe("Whether the CLI emits profile commands and the global --profile flag."),
636
+ commandName: profilesCommandNameSchema.optional().describe('The profile command group name. The generator defaults to "profiles".'),
637
+ revokeOperation: dottedCommandPathSchema("profiles.revokeOperation").optional().describe('The dotted command path called by "profiles remove --revoke".'),
638
+ provisionOperation: profilesProvisionOperationSchema.optional().describe('The operation called by "profiles create --provision" and its response mapping.')
639
+ });
447
640
  var cliGenerationConfigSchema = z.strictObject({
448
641
  paginationParameters: z.array(nonEmptyStringSchema).optional().describe("Request parameter names treated as pagination controls by the CLI."),
449
- skills: z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands.")
642
+ skills: z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands."),
643
+ binaryName: binaryNameSchema.optional().describe(
644
+ "The CLI executable name. The generator kebab-cases it and also uses it for the source directory and env-var prefix."
645
+ ),
646
+ customCommands: z.boolean().optional().describe("Whether hand-written command support is generated. The generator defaults to true."),
647
+ rootGroup: rootGroupSchema.optional().describe("A command group that every spec-derived command is nested under."),
648
+ profiles: profilesConfigSchema.optional().describe("Named profile command configuration."),
649
+ splitTypeCrates: z.boolean().optional().describe("Whether generated types are split into one crate per API behind a facade crate."),
650
+ userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.')
450
651
  });
451
652
  var csharpGenerationConfigSchema = z.strictObject({
452
653
  useOptionalWrapper: z.boolean().optional().describe("Whether optional values use an explicit Optional wrapper."),
@@ -495,7 +696,7 @@ var packageScriptSchema = z.strictObject({
495
696
  command: nonEmptyStringSchema.describe("The command executed by the package script.")
496
697
  });
497
698
  var httpClientSchema = z.strictObject({
498
- name: z.enum(["axios", "fetch"]).describe("The HTTP client used by generated TypeScript code.")
699
+ name: z.enum(["axios", "fetch", "node-fetch"]).describe("The HTTP client used by generated TypeScript code.")
499
700
  });
500
701
  var typescriptGenerationConfigSchema = z.strictObject({
501
702
  typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
@@ -511,6 +712,37 @@ var typescriptGenerationConfigSchema = z.strictObject({
511
712
  /** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
512
713
  namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
513
714
  consolidateTypeFiles: z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
715
+ formDataSupport: z.enum(["Node16", "Node18"]).optional().describe(
716
+ "The multipart form-data implementation: Node16 uses the form-data packages, Node18 uses the platform FormData."
717
+ ),
718
+ allowExtraFields: z.boolean().optional().describe(
719
+ "Whether response parsing keeps unrecognized object keys and accepts unrecognized union members and enum values."
720
+ ),
721
+ generateSubpackageExports: z.boolean().optional().describe(
722
+ "Whether the package manifest exports each subpackage client as its own entry point."
723
+ ),
724
+ exportAllRequestsAtRoot: z.boolean().optional().describe("Whether every request type is also exported from the package root."),
725
+ generateEndpointMetadata: z.boolean().optional().describe("Whether generated clients expose metadata for each endpoint."),
726
+ outputEsm: z.boolean().optional().describe(
727
+ "Whether the package is marked as an ES module while still shipping its CommonJS build."
728
+ ),
729
+ neverThrowErrors: z.boolean().optional().describe(
730
+ "Whether client methods return a wrapped response instead of throwing on a non-2xx status."
731
+ ),
732
+ includeOtherInUnionTypes: z.boolean().optional().describe("Whether union types gain a member for variants the SDK does not recognize."),
733
+ includeUtilsOnUnionMembers: z.boolean().optional().describe("Whether helper utilities are generated on each member of a union type."),
734
+ omitFernHeaders: z.boolean().optional().describe("Whether requests omit the SDK identification headers and the User-Agent header."),
735
+ linter: z.enum(["biome", "oxlint", "none"]).optional().describe("The linter configured in the generated project."),
736
+ formatter: z.enum(["prettier", "biome", "oxfmt", "none"]).optional().describe("The formatter configured in the generated project."),
737
+ exports: jsonObjectSchema.optional().describe(
738
+ "package.json exports entries, keyed by subpath, applied over the generated exports. Each subpath replaces the generated one."
739
+ ),
740
+ files: z.array(nonEmptyStringSchema).optional().describe("package.json files entries, listed ahead of the generated ones."),
741
+ engines: z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe("package.json engines version ranges, keyed by engine name such as node."),
742
+ lintStaged: z.record(nonEmptyStringSchema, z.array(nonEmptyStringSchema).min(1)).optional().describe("lint-staged commands to run, keyed by file glob."),
743
+ browser: z.record(nonEmptyStringSchema, z.union([z.boolean(), nonEmptyStringSchema])).optional().describe(
744
+ "package.json browser field: a module or file is excluded (false) or replaced by another path."
745
+ ),
514
746
  allowCustomFetcher: z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
515
747
  useBrandedStringAliases: z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
516
748
  useLegacyExports: z.boolean().optional().describe("Whether the package emits the legacy export layout."),
@@ -657,6 +889,12 @@ var dependencySchema = z.strictObject({
657
889
  }).refine(({ source, version }) => source !== void 0 || version !== void 0, {
658
890
  message: "dependency must define a version or a source"
659
891
  });
892
+ var bugsSchema = z.strictObject({
893
+ url: nonEmptyStringSchema.optional().describe("The issue tracker URL."),
894
+ email: nonEmptyStringSchema.optional().describe("The address for reporting issues.")
895
+ }).refine(({ url, email }) => url !== void 0 || email !== void 0, {
896
+ message: "bugs must define a url or an email"
897
+ });
660
898
  var projectUrlSchema = z.strictObject({
661
899
  label: nonEmptyStringSchema.describe("The label displayed for the project link."),
662
900
  url: nonEmptyStringSchema.describe("The project link URL.")
@@ -671,6 +909,7 @@ var packageConfigSchema = z.strictObject({
671
909
  description: z.string().optional().describe("The package description used in generated metadata."),
672
910
  repository: nonEmptyStringSchema.optional().describe("The source repository for the generated SDK."),
673
911
  homepage: nonEmptyStringSchema.optional().describe("The package homepage URL."),
912
+ bugs: bugsSchema.optional().describe("Where issues with the package are reported."),
674
913
  documentationUrl: nonEmptyStringSchema.optional().describe("The package documentation URL."),
675
914
  authors: z.array(authorSchema).optional().describe("Authors credited in package metadata."),
676
915
  developers: z.array(developerSchema).optional().describe("Developers credited in package metadata."),
@@ -680,7 +919,10 @@ var packageConfigSchema = z.strictObject({
680
919
  projectUrls: z.array(projectUrlSchema).optional().describe("Labeled project links for package metadata."),
681
920
  extraDependencies: z.array(dependencySchema).optional().describe("Additional runtime dependencies added to the generated package."),
682
921
  extraDevDependencies: z.array(dependencySchema).optional().describe("Additional development dependencies added to the generated package."),
683
- extraPeerDependencies: z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package.")
922
+ extraPeerDependencies: z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package."),
923
+ extraPeerDependenciesMeta: z.record(nonEmptyStringSchema, jsonObjectSchema).optional().describe(
924
+ "npm peerDependenciesMeta entries keyed by peer dependency name, such as { optional: true }."
925
+ )
684
926
  });
685
927
 
686
928
  // src/sdk-config-domain/v1/language/terraform.ts
@@ -1020,6 +1262,12 @@ var githubOutputSchema = z.strictObject({
1020
1262
  /** Automatically merge the GitHub publishing PR. Defaults to false. */
1021
1263
  autoMerge: z.boolean().default(false).describe("Whether the GitHub publisher automatically merges its pull request.")
1022
1264
  });
1265
+ var distributionShape = {
1266
+ /** Valid only for `cli` targets with GitHub delivery; secret names only, never values. */
1267
+ distribution: cliDistributionConfigSchema.optional().describe(
1268
+ "CLI release channels published by the generated release workflow; credentials are GitHub Actions secret names."
1269
+ )
1270
+ };
1023
1271
  var credentialResolutionShape = {
1024
1272
  /** Where output credential references are resolved. */
1025
1273
  credentialResolution: credentialResolutionSchema.default("refs-only").describe("Where output credential references are resolved.")
@@ -1028,18 +1276,21 @@ var filesOutputSchema = z.strictObject({
1028
1276
  delivery: z.literal("files").describe("Writes the generated SDK to a directory."),
1029
1277
  path: nonEmptyStringSchema.optional().describe("The destination directory for generated files."),
1030
1278
  publish: publishConfigSchema.optional().describe("Optional package registry publication."),
1279
+ ...distributionShape,
1031
1280
  ...credentialResolutionShape
1032
1281
  });
1033
1282
  var zipOutputSchema = z.strictObject({
1034
1283
  delivery: z.literal("zip").describe("Packages the generated SDK as a ZIP archive."),
1035
1284
  fileName: nonEmptyStringSchema.optional().describe("The generated ZIP archive file name."),
1036
1285
  publish: publishConfigSchema.optional().describe("Optional package registry publication."),
1286
+ ...distributionShape,
1037
1287
  ...credentialResolutionShape
1038
1288
  });
1039
1289
  var githubDeliverySchema = z.strictObject({
1040
1290
  delivery: z.literal("github").describe("Delivers the generated SDK to GitHub."),
1041
1291
  github: githubOutputSchema.describe("GitHub repository delivery settings."),
1042
1292
  publish: publishConfigSchema.optional().describe("Optional package registry publication."),
1293
+ ...distributionShape,
1043
1294
  ...credentialResolutionShape
1044
1295
  });
1045
1296
  var outputConfigSchema = z.discriminatedUnion(
@@ -1159,7 +1410,7 @@ var targetConfigSchema = z.strictObject({
1159
1410
  // src/sdk-config-ir/v1/sdk-config-ir-v1.ts
1160
1411
  var SDK_CONFIG_IR_V1_SCHEMA_VERSION = "sdk-config-ir/v1";
1161
1412
  var publishRegistryLanguages = {
1162
- npm: ["typescript", "mcp"],
1413
+ npm: ["typescript", "mcp", "cli"],
1163
1414
  pypi: ["python"],
1164
1415
  maven: ["java", "kotlin"],
1165
1416
  nuget: ["csharp"],
@@ -1214,6 +1465,28 @@ function validatePublishingIdentity(packageConfig, registry, context) {
1214
1465
  });
1215
1466
  }
1216
1467
  }
1468
+ function validateCliOutput(output, language, context) {
1469
+ if (output.distribution !== void 0 && language !== "cli") {
1470
+ context.addIssue({
1471
+ code: "custom",
1472
+ message: `output.distribution is supported only for target language "cli", not "${language}"`,
1473
+ path: ["output", "distribution"]
1474
+ });
1475
+ } else if (output.distribution !== void 0 && output.delivery !== "github") {
1476
+ context.addIssue({
1477
+ code: "custom",
1478
+ message: CLI_DISTRIBUTION_REQUIRES_GITHUB_DELIVERY_MESSAGE,
1479
+ path: ["output", "distribution"]
1480
+ });
1481
+ }
1482
+ if (language === "cli" && output.publish && output.delivery !== "github") {
1483
+ context.addIssue({
1484
+ code: "custom",
1485
+ message: CLI_PUBLISH_REQUIRES_GITHUB_DELIVERY_MESSAGE,
1486
+ path: ["output", "publish"]
1487
+ });
1488
+ }
1489
+ }
1217
1490
  var sdkConfigIrV1Schema = z.strictObject({
1218
1491
  schemaVersion: z.literal(SDK_CONFIG_IR_V1_SCHEMA_VERSION).describe("The version of the normalized SDK Config IR schema."),
1219
1492
  source: sourceConfigSchema.describe("Materialized API descriptions consumed by generation."),
@@ -1275,6 +1548,7 @@ var sdkConfigIrV1Schema = z.strictObject({
1275
1548
  });
1276
1549
  }
1277
1550
  }
1551
+ validateCliOutput(output, target.language, context);
1278
1552
  if (compatibility?.legacyInput) {
1279
1553
  const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
1280
1554
  if (compatibility.legacyInput.kind !== expectedKind) {
@@ -1435,6 +1709,6 @@ function parseSdkConfigIrV1ForConsumption(value) {
1435
1709
  return parseSdkConfigIrV1(stripUnknownProperties(value, sdkConfigIrV1InputJsonSchema));
1436
1710
  }
1437
1711
 
1438
- export { SDK_CONFIG_IR_V1_SCHEMA_VERSION, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, cliGenerationConfigSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, composerPackageNameSchema, csharpGenerationConfigSchema, dependencySchema, docsConfigSchema, exactSemverSchema, generationConfigSchema, goGenerationConfigSchema, goModulePathSchema, javaGenerationConfigSchema, jsonObjectSchema, jsonValueSchema, kotlinGenerationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, mcpAvailabilityStatuses, mcpGenerationConfigSchema, nonEmptyStringSchema, outputConfigSchema, packageConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, replayConfigSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema, webhookSignatureSchema };
1712
+ export { CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, SDK_CONFIG_IR_V1_SCHEMA_VERSION, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, cliDistributionConfigSchema, cliDistributionGithubAppSchema, cliDistributionHomebrewSchema, cliDistributionScoopSchema, cliGenerationConfigSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, composerPackageNameSchema, csharpGenerationConfigSchema, dependencySchema, docsConfigSchema, exactSemverSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, githubActionsSecretNameSchema, goGenerationConfigSchema, goModulePathSchema, javaGenerationConfigSchema, jsonObjectSchema, jsonValueSchema, kotlinGenerationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, mcpAvailabilityStatuses, mcpGenerationConfigSchema, nonEmptyStringSchema, outputConfigSchema, packageConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, replayConfigSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema, webhookSignatureSchema };
1439
1713
  //# sourceMappingURL=index.js.map
1440
1714
  //# sourceMappingURL=index.js.map