@postman/sdk-config 0.9.0 → 0.11.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.
- package/README.md +6 -0
- package/dist/index.cjs +776 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +762 -45
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +728 -44
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.d.cts +2 -2
- package/dist/sdk-config/index.d.ts +2 -2
- package/dist/sdk-config/index.js +721 -45
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +728 -44
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +2858 -2377
- package/dist/sdk-config/v1/index.d.ts +2858 -2377
- package/dist/sdk-config/v1/index.js +721 -45
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +247 -4
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +2 -2
- package/dist/sdk-config-ir/index.d.ts +2 -2
- package/dist/sdk-config-ir/index.js +241 -5
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +247 -4
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +3109 -2960
- package/dist/sdk-config-ir/v1/index.d.ts +3109 -2960
- package/dist/sdk-config-ir/v1/index.js +241 -5
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-Chge0X4f.d.cts → typescript-CsAa1VSy.d.cts} +81 -1
- package/dist/{typescript-Chge0X4f.d.ts → typescript-CsAa1VSy.d.ts} +81 -1
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +183 -1
- package/src/sdk-config-ir/v1/README.md +29 -1
|
@@ -131,13 +131,21 @@ var oauthScopeSchema = zod.z.strictObject({
|
|
|
131
131
|
name: nonEmptyStringSchema.describe("The OAuth scope value requested from the provider."),
|
|
132
132
|
description: zod.z.string().optional().describe("A description of the OAuth scope included in generated SDK documentation.")
|
|
133
133
|
});
|
|
134
|
+
var publicClientIdSchema = nonEmptyStringSchema.refine((value) => value.trim() === value, {
|
|
135
|
+
message: "must not have leading or trailing whitespace"
|
|
136
|
+
}).refine((value) => !value.includes("${"), {
|
|
137
|
+
message: "must be a literal public client ID, not an environment expression"
|
|
138
|
+
});
|
|
134
139
|
var oauthFlowSchema = zod.z.discriminatedUnion("type", [
|
|
135
140
|
zod.z.strictObject({
|
|
136
141
|
type: zod.z.literal("authorization-code").describe("Uses the OAuth authorization code flow."),
|
|
137
142
|
authorizationUrl: nonEmptyStringSchema.describe("The URL used to authorize the client."),
|
|
138
143
|
tokenUrl: nonEmptyStringSchema.describe("The URL used to exchange a code for tokens."),
|
|
139
144
|
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
140
|
-
scopes: zod.z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
|
|
145
|
+
scopes: zod.z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow."),
|
|
146
|
+
clientId: publicClientIdSchema.optional().describe(
|
|
147
|
+
"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."
|
|
148
|
+
)
|
|
141
149
|
}),
|
|
142
150
|
zod.z.strictObject({
|
|
143
151
|
type: zod.z.literal("client-credentials").describe("Uses the OAuth client credentials flow."),
|
|
@@ -397,6 +405,91 @@ var compatibilityConfigSchema = zod.z.strictObject({
|
|
|
397
405
|
legacyInput: legacyInputSchema.optional().describe("Original producer input retained only for migration debugging."),
|
|
398
406
|
unsupportedFields: zod.z.array(unsupportedFieldSchema).optional().describe("Legacy fields that could not be represented in normalized configuration.")
|
|
399
407
|
});
|
|
408
|
+
var GITHUB_ACTIONS_SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]*$/;
|
|
409
|
+
var GITHUB_REPOSITORY_SLUG_PATTERN = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;
|
|
410
|
+
var HOMEBREW_FORMULA_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
411
|
+
var githubActionsSecretNameSchema = zod.z.string({ error: "must be the name of a GitHub Actions secret" }).regex(GITHUB_ACTIONS_SECRET_NAME_PATTERN, {
|
|
412
|
+
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."
|
|
413
|
+
}).refine((value) => value !== "GITHUB_TOKEN", {
|
|
414
|
+
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."
|
|
415
|
+
});
|
|
416
|
+
var githubRepositorySlugSchema = zod.z.string({ error: 'must be a GitHub repository in "<owner>/<repo>" form' }).regex(GITHUB_REPOSITORY_SLUG_PATTERN, {
|
|
417
|
+
error: 'must be a GitHub repository in "<owner>/<repo>" form, for example "acme/homebrew-tap"'
|
|
418
|
+
});
|
|
419
|
+
var homebrewFormulaNameSchema = zod.z.string({ error: "must be a Homebrew formula name" }).regex(HOMEBREW_FORMULA_NAME_PATTERN, {
|
|
420
|
+
error: "must be a Homebrew formula name: start with a lowercase letter and contain only a-z, 0-9, or -"
|
|
421
|
+
});
|
|
422
|
+
var cliDistributionGithubAppSchema = zod.z.strictObject({
|
|
423
|
+
appIdSecretName: githubActionsSecretNameSchema.describe(
|
|
424
|
+
"The name of the GitHub Actions secret holding the GitHub App ID or client ID."
|
|
425
|
+
),
|
|
426
|
+
privateKeySecretName: githubActionsSecretNameSchema.describe(
|
|
427
|
+
"The name of the GitHub Actions secret holding the GitHub App private key in PEM form."
|
|
428
|
+
)
|
|
429
|
+
});
|
|
430
|
+
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.";
|
|
431
|
+
var cliDistributionHomebrewSchema = zod.z.strictObject({
|
|
432
|
+
tap: githubRepositorySlugSchema.describe(
|
|
433
|
+
'The Homebrew tap repository in "<owner>/<repo>" form that receives the formula.'
|
|
434
|
+
),
|
|
435
|
+
formula: homebrewFormulaNameSchema.optional().describe("The Homebrew formula name; the generator defaults it to the CLI binary name."),
|
|
436
|
+
tokenSecretName: githubActionsSecretNameSchema.optional().describe(channelTokenSecretNameDescription)
|
|
437
|
+
});
|
|
438
|
+
var cliDistributionScoopSchema = zod.z.strictObject({
|
|
439
|
+
bucket: githubRepositorySlugSchema.describe(
|
|
440
|
+
'The Scoop bucket repository in "<owner>/<repo>" form that receives the manifest.'
|
|
441
|
+
),
|
|
442
|
+
tokenSecretName: githubActionsSecretNameSchema.optional().describe(channelTokenSecretNameDescription)
|
|
443
|
+
});
|
|
444
|
+
var cliDistributionConfigSchema = zod.z.strictObject({
|
|
445
|
+
githubApp: cliDistributionGithubAppSchema.optional().describe(
|
|
446
|
+
"A GitHub App used to mint short-lived tokens for every channel without its own tokenSecretName."
|
|
447
|
+
),
|
|
448
|
+
homebrew: cliDistributionHomebrewSchema.optional().describe("Publishes a Homebrew formula to a tap repository on each tagged release."),
|
|
449
|
+
scoop: cliDistributionScoopSchema.optional().describe("Publishes a Scoop manifest to a bucket repository on each tagged release.")
|
|
450
|
+
}).superRefine((distribution, context) => {
|
|
451
|
+
if (distribution.homebrew !== void 0 || distribution.scoop !== void 0) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
if (distribution.githubApp !== void 0) {
|
|
455
|
+
context.addIssue({
|
|
456
|
+
code: "custom",
|
|
457
|
+
message: "githubApp requires at least one distribution channel: homebrew or scoop",
|
|
458
|
+
path: ["githubApp"]
|
|
459
|
+
});
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
context.addIssue({
|
|
463
|
+
code: "custom",
|
|
464
|
+
message: "distribution must configure at least one channel: homebrew or scoop"
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
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.';
|
|
468
|
+
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.';
|
|
469
|
+
var CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = "CLI_DISTRIBUTION_NON_RELEASE_MODE";
|
|
470
|
+
var nonReleaseGithubModes = /* @__PURE__ */ new Set(["pull-request", "push", "commit"]);
|
|
471
|
+
function cliDistributionModeDiagnostic(output, outputPath) {
|
|
472
|
+
const mode = output?.github?.mode;
|
|
473
|
+
if (output?.distribution === void 0 || mode === void 0 || !nonReleaseGithubModes.has(mode)) {
|
|
474
|
+
return void 0;
|
|
475
|
+
}
|
|
476
|
+
return {
|
|
477
|
+
code: CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE,
|
|
478
|
+
severity: "warning",
|
|
479
|
+
path: [...outputPath, "github", "mode"],
|
|
480
|
+
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.`,
|
|
481
|
+
suggestedAction: 'Use mode "release" or "commit-and-release", or push a version tag after merging generated changes.'
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// src/sdk-config-ir/v1/diagnostics.ts
|
|
486
|
+
function getSdkConfigIrV1Diagnostics(config) {
|
|
487
|
+
if (config.target.language !== "cli") {
|
|
488
|
+
return [];
|
|
489
|
+
}
|
|
490
|
+
const diagnostic = cliDistributionModeDiagnostic(config.output, ["output"]);
|
|
491
|
+
return diagnostic ? [diagnostic] : [];
|
|
492
|
+
}
|
|
400
493
|
var httpMethodSchema = zod.z.enum([
|
|
401
494
|
"GET",
|
|
402
495
|
"POST",
|
|
@@ -450,9 +543,117 @@ var namingConfigSchema = zod.z.strictObject({
|
|
|
450
543
|
/** Preserve a word boundary after digits when Fern smart casing is enabled. */
|
|
451
544
|
smartCasingDigitWordBoundary: zod.z.boolean().optional().describe("Whether smart casing preserves a word boundary after digits.")
|
|
452
545
|
});
|
|
546
|
+
var ALPHANUMERIC_PATTERN = /[A-Za-z0-9]/;
|
|
547
|
+
var ROOT_GROUP_PATTERN = /^[a-z][a-z0-9_-]*$/;
|
|
548
|
+
var KEBAB_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
549
|
+
var DOTTED_COMMAND_PATH_PATTERN = /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/;
|
|
550
|
+
var FIELD_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/;
|
|
551
|
+
var RESERVED_USER_AGENT_SUFFIX_FLAGS = /* @__PURE__ */ new Set([
|
|
552
|
+
"params",
|
|
553
|
+
"output",
|
|
554
|
+
"json",
|
|
555
|
+
"format",
|
|
556
|
+
"dry-run",
|
|
557
|
+
"base-url",
|
|
558
|
+
"page-all",
|
|
559
|
+
"page-limit",
|
|
560
|
+
"page-delay",
|
|
561
|
+
"no-pager",
|
|
562
|
+
"no-extract",
|
|
563
|
+
"no-retry",
|
|
564
|
+
"no-stream",
|
|
565
|
+
"quiet",
|
|
566
|
+
"query",
|
|
567
|
+
"help",
|
|
568
|
+
"debug",
|
|
569
|
+
"schema"
|
|
570
|
+
]);
|
|
571
|
+
var RESERVED_PROFILES_COMMAND_NAMES = /* @__PURE__ */ new Set([
|
|
572
|
+
"auth",
|
|
573
|
+
"completion",
|
|
574
|
+
"man",
|
|
575
|
+
"errors",
|
|
576
|
+
"generate-skills",
|
|
577
|
+
"help"
|
|
578
|
+
]);
|
|
579
|
+
var binaryNameSchema = nonEmptyStringSchema.regex(ALPHANUMERIC_PATTERN, {
|
|
580
|
+
message: "binaryName must contain at least one ASCII letter or digit"
|
|
581
|
+
});
|
|
582
|
+
var rootGroupSchema = zod.z.string().regex(ROOT_GROUP_PATTERN, {
|
|
583
|
+
message: "rootGroup must start with a lowercase letter and contain only lowercase letters, digits, hyphens, and underscores"
|
|
584
|
+
});
|
|
585
|
+
var userAgentSuffixFlagSchema = zod.z.string().superRefine((value, context) => {
|
|
586
|
+
if (value.startsWith("-")) {
|
|
587
|
+
context.addIssue({
|
|
588
|
+
code: "custom",
|
|
589
|
+
message: 'userAgentSuffixFlag must be the long flag name without the leading "--"'
|
|
590
|
+
});
|
|
591
|
+
} else if (!KEBAB_NAME_PATTERN.test(value)) {
|
|
592
|
+
context.addIssue({
|
|
593
|
+
code: "custom",
|
|
594
|
+
message: "userAgentSuffixFlag must start with a lowercase letter and contain only lowercase letters, digits, and hyphens"
|
|
595
|
+
});
|
|
596
|
+
} else if (RESERVED_USER_AGENT_SUFFIX_FLAGS.has(value)) {
|
|
597
|
+
context.addIssue({
|
|
598
|
+
code: "custom",
|
|
599
|
+
message: `userAgentSuffixFlag "${value}" collides with a built-in global flag`
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
var profilesCommandNameSchema = zod.z.string().superRefine((value, context) => {
|
|
604
|
+
if (!KEBAB_NAME_PATTERN.test(value)) {
|
|
605
|
+
context.addIssue({
|
|
606
|
+
code: "custom",
|
|
607
|
+
message: "profiles.commandName must start with a lowercase letter and contain only lowercase letters, digits, and hyphens"
|
|
608
|
+
});
|
|
609
|
+
} else if (RESERVED_PROFILES_COMMAND_NAMES.has(value)) {
|
|
610
|
+
context.addIssue({
|
|
611
|
+
code: "custom",
|
|
612
|
+
message: `profiles.commandName "${value}" collides with a built-in command group`
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
function dottedCommandPathSchema(field) {
|
|
617
|
+
return zod.z.string().regex(DOTTED_COMMAND_PATH_PATTERN, {
|
|
618
|
+
message: `${field} must be a dotted command path such as "iam.keys.create"`
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
function fieldNameMapSchema(field) {
|
|
622
|
+
const message = `${field} keys and values must be field names containing only [A-Za-z0-9_.-]`;
|
|
623
|
+
return zod.z.record(zod.z.string(), zod.z.string().regex(FIELD_NAME_PATTERN, { message })).superRefine((value, context) => {
|
|
624
|
+
for (const key of Object.keys(value)) {
|
|
625
|
+
if (!FIELD_NAME_PATTERN.test(key)) {
|
|
626
|
+
context.addIssue({ code: "custom", message, path: [key] });
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
var profilesProvisionOperationSchema = zod.z.strictObject({
|
|
632
|
+
operation: dottedCommandPathSchema("profiles.provisionOperation.operation").describe(
|
|
633
|
+
"The dotted command path of the operation that mints a profile credential."
|
|
634
|
+
),
|
|
635
|
+
credential: fieldNameMapSchema("profiles.provisionOperation.credential").refine((value) => Object.keys(value).length > 0, {
|
|
636
|
+
message: "profiles.provisionOperation.credential must map at least one credential field"
|
|
637
|
+
}).describe("Maps each stored credential field to the response field that supplies it."),
|
|
638
|
+
revokeParameters: fieldNameMapSchema("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it.")
|
|
639
|
+
});
|
|
640
|
+
var profilesConfigSchema = zod.z.strictObject({
|
|
641
|
+
enabled: zod.z.boolean().describe("Whether the CLI emits profile commands and the global --profile flag."),
|
|
642
|
+
commandName: profilesCommandNameSchema.optional().describe('The profile command group name. The generator defaults to "profiles".'),
|
|
643
|
+
revokeOperation: dottedCommandPathSchema("profiles.revokeOperation").optional().describe('The dotted command path called by "profiles remove --revoke".'),
|
|
644
|
+
provisionOperation: profilesProvisionOperationSchema.optional().describe('The operation called by "profiles create --provision" and its response mapping.')
|
|
645
|
+
});
|
|
453
646
|
var cliGenerationConfigSchema = zod.z.strictObject({
|
|
454
647
|
paginationParameters: zod.z.array(nonEmptyStringSchema).optional().describe("Request parameter names treated as pagination controls by the CLI."),
|
|
455
|
-
skills: zod.z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands.")
|
|
648
|
+
skills: zod.z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands."),
|
|
649
|
+
binaryName: binaryNameSchema.optional().describe(
|
|
650
|
+
"The CLI executable name. The generator kebab-cases it and also uses it for the source directory and env-var prefix."
|
|
651
|
+
),
|
|
652
|
+
customCommands: zod.z.boolean().optional().describe("Whether hand-written command support is generated. The generator defaults to true."),
|
|
653
|
+
rootGroup: rootGroupSchema.optional().describe("A command group that every spec-derived command is nested under."),
|
|
654
|
+
profiles: profilesConfigSchema.optional().describe("Named profile command configuration."),
|
|
655
|
+
splitTypeCrates: zod.z.boolean().optional().describe("Whether generated types are split into one crate per API behind a facade crate."),
|
|
656
|
+
userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.')
|
|
456
657
|
});
|
|
457
658
|
var csharpGenerationConfigSchema = zod.z.strictObject({
|
|
458
659
|
useOptionalWrapper: zod.z.boolean().optional().describe("Whether optional values use an explicit Optional wrapper."),
|
|
@@ -686,7 +887,10 @@ var packageConfigSchema = zod.z.strictObject({
|
|
|
686
887
|
projectUrls: zod.z.array(projectUrlSchema).optional().describe("Labeled project links for package metadata."),
|
|
687
888
|
extraDependencies: zod.z.array(dependencySchema).optional().describe("Additional runtime dependencies added to the generated package."),
|
|
688
889
|
extraDevDependencies: zod.z.array(dependencySchema).optional().describe("Additional development dependencies added to the generated package."),
|
|
689
|
-
extraPeerDependencies: zod.z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package.")
|
|
890
|
+
extraPeerDependencies: zod.z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package."),
|
|
891
|
+
extraPeerDependenciesMeta: zod.z.record(nonEmptyStringSchema, jsonObjectSchema).optional().describe(
|
|
892
|
+
"npm peerDependenciesMeta entries keyed by peer dependency name, such as { optional: true }."
|
|
893
|
+
)
|
|
690
894
|
});
|
|
691
895
|
|
|
692
896
|
// src/sdk-config-domain/v1/language/terraform.ts
|
|
@@ -1026,6 +1230,12 @@ var githubOutputSchema = zod.z.strictObject({
|
|
|
1026
1230
|
/** Automatically merge the GitHub publishing PR. Defaults to false. */
|
|
1027
1231
|
autoMerge: zod.z.boolean().default(false).describe("Whether the GitHub publisher automatically merges its pull request.")
|
|
1028
1232
|
});
|
|
1233
|
+
var distributionShape = {
|
|
1234
|
+
/** Valid only for `cli` targets with GitHub delivery; secret names only, never values. */
|
|
1235
|
+
distribution: cliDistributionConfigSchema.optional().describe(
|
|
1236
|
+
"CLI release channels published by the generated release workflow; credentials are GitHub Actions secret names."
|
|
1237
|
+
)
|
|
1238
|
+
};
|
|
1029
1239
|
var credentialResolutionShape = {
|
|
1030
1240
|
/** Where output credential references are resolved. */
|
|
1031
1241
|
credentialResolution: credentialResolutionSchema.default("refs-only").describe("Where output credential references are resolved.")
|
|
@@ -1034,18 +1244,21 @@ var filesOutputSchema = zod.z.strictObject({
|
|
|
1034
1244
|
delivery: zod.z.literal("files").describe("Writes the generated SDK to a directory."),
|
|
1035
1245
|
path: nonEmptyStringSchema.optional().describe("The destination directory for generated files."),
|
|
1036
1246
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1247
|
+
...distributionShape,
|
|
1037
1248
|
...credentialResolutionShape
|
|
1038
1249
|
});
|
|
1039
1250
|
var zipOutputSchema = zod.z.strictObject({
|
|
1040
1251
|
delivery: zod.z.literal("zip").describe("Packages the generated SDK as a ZIP archive."),
|
|
1041
1252
|
fileName: nonEmptyStringSchema.optional().describe("The generated ZIP archive file name."),
|
|
1042
1253
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1254
|
+
...distributionShape,
|
|
1043
1255
|
...credentialResolutionShape
|
|
1044
1256
|
});
|
|
1045
1257
|
var githubDeliverySchema = zod.z.strictObject({
|
|
1046
1258
|
delivery: zod.z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
1047
1259
|
github: githubOutputSchema.describe("GitHub repository delivery settings."),
|
|
1048
1260
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1261
|
+
...distributionShape,
|
|
1049
1262
|
...credentialResolutionShape
|
|
1050
1263
|
});
|
|
1051
1264
|
var outputConfigSchema = zod.z.discriminatedUnion(
|
|
@@ -1165,7 +1378,7 @@ var targetConfigSchema = zod.z.strictObject({
|
|
|
1165
1378
|
// src/sdk-config-ir/v1/sdk-config-ir-v1.ts
|
|
1166
1379
|
var SDK_CONFIG_IR_V1_SCHEMA_VERSION = "sdk-config-ir/v1";
|
|
1167
1380
|
var publishRegistryLanguages = {
|
|
1168
|
-
npm: ["typescript", "mcp"],
|
|
1381
|
+
npm: ["typescript", "mcp", "cli"],
|
|
1169
1382
|
pypi: ["python"],
|
|
1170
1383
|
maven: ["java", "kotlin"],
|
|
1171
1384
|
nuget: ["csharp"],
|
|
@@ -1220,6 +1433,28 @@ function validatePublishingIdentity(packageConfig, registry, context) {
|
|
|
1220
1433
|
});
|
|
1221
1434
|
}
|
|
1222
1435
|
}
|
|
1436
|
+
function validateCliOutput(output, language, context) {
|
|
1437
|
+
if (output.distribution !== void 0 && language !== "cli") {
|
|
1438
|
+
context.addIssue({
|
|
1439
|
+
code: "custom",
|
|
1440
|
+
message: `output.distribution is supported only for target language "cli", not "${language}"`,
|
|
1441
|
+
path: ["output", "distribution"]
|
|
1442
|
+
});
|
|
1443
|
+
} else if (output.distribution !== void 0 && output.delivery !== "github") {
|
|
1444
|
+
context.addIssue({
|
|
1445
|
+
code: "custom",
|
|
1446
|
+
message: CLI_DISTRIBUTION_REQUIRES_GITHUB_DELIVERY_MESSAGE,
|
|
1447
|
+
path: ["output", "distribution"]
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
if (language === "cli" && output.publish && output.delivery !== "github") {
|
|
1451
|
+
context.addIssue({
|
|
1452
|
+
code: "custom",
|
|
1453
|
+
message: CLI_PUBLISH_REQUIRES_GITHUB_DELIVERY_MESSAGE,
|
|
1454
|
+
path: ["output", "publish"]
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1223
1458
|
var sdkConfigIrV1Schema = zod.z.strictObject({
|
|
1224
1459
|
schemaVersion: zod.z.literal(SDK_CONFIG_IR_V1_SCHEMA_VERSION).describe("The version of the normalized SDK Config IR schema."),
|
|
1225
1460
|
source: sourceConfigSchema.describe("Materialized API descriptions consumed by generation."),
|
|
@@ -1281,6 +1516,7 @@ var sdkConfigIrV1Schema = zod.z.strictObject({
|
|
|
1281
1516
|
});
|
|
1282
1517
|
}
|
|
1283
1518
|
}
|
|
1519
|
+
validateCliOutput(output, target.language, context);
|
|
1284
1520
|
if (compatibility?.legacyInput) {
|
|
1285
1521
|
const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
|
|
1286
1522
|
if (compatibility.legacyInput.kind !== expectedKind) {
|
|
@@ -1441,11 +1677,16 @@ function parseSdkConfigIrV1ForConsumption(value) {
|
|
|
1441
1677
|
return parseSdkConfigIrV1(stripUnknownProperties(value, sdkConfigIrV1InputJsonSchema));
|
|
1442
1678
|
}
|
|
1443
1679
|
|
|
1680
|
+
exports.CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE;
|
|
1444
1681
|
exports.SDK_CONFIG_IR_V1_SCHEMA_VERSION = SDK_CONFIG_IR_V1_SCHEMA_VERSION;
|
|
1445
1682
|
exports.apiConfigSchema = apiConfigSchema;
|
|
1446
1683
|
exports.apiImportSettingsSchema = apiImportSettingsSchema;
|
|
1447
1684
|
exports.authConfigSchema = authConfigSchema;
|
|
1448
1685
|
exports.authSchemeSchema = authSchemeSchema;
|
|
1686
|
+
exports.cliDistributionConfigSchema = cliDistributionConfigSchema;
|
|
1687
|
+
exports.cliDistributionGithubAppSchema = cliDistributionGithubAppSchema;
|
|
1688
|
+
exports.cliDistributionHomebrewSchema = cliDistributionHomebrewSchema;
|
|
1689
|
+
exports.cliDistributionScoopSchema = cliDistributionScoopSchema;
|
|
1449
1690
|
exports.cliGenerationConfigSchema = cliGenerationConfigSchema;
|
|
1450
1691
|
exports.clientConfigOverrideSchema = clientConfigOverrideSchema;
|
|
1451
1692
|
exports.clientConfigSchema = clientConfigSchema;
|
|
@@ -1457,6 +1698,8 @@ exports.dependencySchema = dependencySchema;
|
|
|
1457
1698
|
exports.docsConfigSchema = docsConfigSchema;
|
|
1458
1699
|
exports.exactSemverSchema = exactSemverSchema;
|
|
1459
1700
|
exports.generationConfigSchema = generationConfigSchema;
|
|
1701
|
+
exports.getSdkConfigIrV1Diagnostics = getSdkConfigIrV1Diagnostics;
|
|
1702
|
+
exports.githubActionsSecretNameSchema = githubActionsSecretNameSchema;
|
|
1460
1703
|
exports.goGenerationConfigSchema = goGenerationConfigSchema;
|
|
1461
1704
|
exports.goModulePathSchema = goModulePathSchema;
|
|
1462
1705
|
exports.javaGenerationConfigSchema = javaGenerationConfigSchema;
|