@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.
- package/README.md +6 -0
- package/dist/index.cjs +909 -41
- 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 +895 -42
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +861 -41
- 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 +854 -42
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +861 -41
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +3345 -2632
- package/dist/sdk-config/v1/index.d.ts +3345 -2632
- package/dist/sdk-config/v1/index.js +854 -42
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +286 -5
- 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 +280 -6
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +286 -5
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +3291 -2958
- package/dist/sdk-config-ir/v1/index.d.ts +3291 -2958
- package/dist/sdk-config-ir/v1/index.js +280 -6
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-Chge0X4f.d.cts → typescript-Byhn4MqL.d.cts} +145 -1
- package/dist/{typescript-Chge0X4f.d.ts → typescript-Byhn4MqL.d.ts} +145 -1
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +183 -1
- package/src/sdk-config-ir/v1/README.md +107 -31
|
@@ -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."),
|
|
@@ -501,7 +702,7 @@ var packageScriptSchema = zod.z.strictObject({
|
|
|
501
702
|
command: nonEmptyStringSchema.describe("The command executed by the package script.")
|
|
502
703
|
});
|
|
503
704
|
var httpClientSchema = zod.z.strictObject({
|
|
504
|
-
name: zod.z.enum(["axios", "fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
705
|
+
name: zod.z.enum(["axios", "fetch", "node-fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
505
706
|
});
|
|
506
707
|
var typescriptGenerationConfigSchema = zod.z.strictObject({
|
|
507
708
|
typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
|
|
@@ -517,6 +718,37 @@ var typescriptGenerationConfigSchema = zod.z.strictObject({
|
|
|
517
718
|
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
518
719
|
namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
|
|
519
720
|
consolidateTypeFiles: zod.z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
|
|
721
|
+
formDataSupport: zod.z.enum(["Node16", "Node18"]).optional().describe(
|
|
722
|
+
"The multipart form-data implementation: Node16 uses the form-data packages, Node18 uses the platform FormData."
|
|
723
|
+
),
|
|
724
|
+
allowExtraFields: zod.z.boolean().optional().describe(
|
|
725
|
+
"Whether response parsing keeps unrecognized object keys and accepts unrecognized union members and enum values."
|
|
726
|
+
),
|
|
727
|
+
generateSubpackageExports: zod.z.boolean().optional().describe(
|
|
728
|
+
"Whether the package manifest exports each subpackage client as its own entry point."
|
|
729
|
+
),
|
|
730
|
+
exportAllRequestsAtRoot: zod.z.boolean().optional().describe("Whether every request type is also exported from the package root."),
|
|
731
|
+
generateEndpointMetadata: zod.z.boolean().optional().describe("Whether generated clients expose metadata for each endpoint."),
|
|
732
|
+
outputEsm: zod.z.boolean().optional().describe(
|
|
733
|
+
"Whether the package is marked as an ES module while still shipping its CommonJS build."
|
|
734
|
+
),
|
|
735
|
+
neverThrowErrors: zod.z.boolean().optional().describe(
|
|
736
|
+
"Whether client methods return a wrapped response instead of throwing on a non-2xx status."
|
|
737
|
+
),
|
|
738
|
+
includeOtherInUnionTypes: zod.z.boolean().optional().describe("Whether union types gain a member for variants the SDK does not recognize."),
|
|
739
|
+
includeUtilsOnUnionMembers: zod.z.boolean().optional().describe("Whether helper utilities are generated on each member of a union type."),
|
|
740
|
+
omitFernHeaders: zod.z.boolean().optional().describe("Whether requests omit the SDK identification headers and the User-Agent header."),
|
|
741
|
+
linter: zod.z.enum(["biome", "oxlint", "none"]).optional().describe("The linter configured in the generated project."),
|
|
742
|
+
formatter: zod.z.enum(["prettier", "biome", "oxfmt", "none"]).optional().describe("The formatter configured in the generated project."),
|
|
743
|
+
exports: jsonObjectSchema.optional().describe(
|
|
744
|
+
"package.json exports entries, keyed by subpath, applied over the generated exports. Each subpath replaces the generated one."
|
|
745
|
+
),
|
|
746
|
+
files: zod.z.array(nonEmptyStringSchema).optional().describe("package.json files entries, listed ahead of the generated ones."),
|
|
747
|
+
engines: zod.z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe("package.json engines version ranges, keyed by engine name such as node."),
|
|
748
|
+
lintStaged: zod.z.record(nonEmptyStringSchema, zod.z.array(nonEmptyStringSchema).min(1)).optional().describe("lint-staged commands to run, keyed by file glob."),
|
|
749
|
+
browser: zod.z.record(nonEmptyStringSchema, zod.z.union([zod.z.boolean(), nonEmptyStringSchema])).optional().describe(
|
|
750
|
+
"package.json browser field: a module or file is excluded (false) or replaced by another path."
|
|
751
|
+
),
|
|
520
752
|
allowCustomFetcher: zod.z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
|
|
521
753
|
useBrandedStringAliases: zod.z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
|
|
522
754
|
useLegacyExports: zod.z.boolean().optional().describe("Whether the package emits the legacy export layout."),
|
|
@@ -663,6 +895,12 @@ var dependencySchema = zod.z.strictObject({
|
|
|
663
895
|
}).refine(({ source, version }) => source !== void 0 || version !== void 0, {
|
|
664
896
|
message: "dependency must define a version or a source"
|
|
665
897
|
});
|
|
898
|
+
var bugsSchema = zod.z.strictObject({
|
|
899
|
+
url: nonEmptyStringSchema.optional().describe("The issue tracker URL."),
|
|
900
|
+
email: nonEmptyStringSchema.optional().describe("The address for reporting issues.")
|
|
901
|
+
}).refine(({ url, email }) => url !== void 0 || email !== void 0, {
|
|
902
|
+
message: "bugs must define a url or an email"
|
|
903
|
+
});
|
|
666
904
|
var projectUrlSchema = zod.z.strictObject({
|
|
667
905
|
label: nonEmptyStringSchema.describe("The label displayed for the project link."),
|
|
668
906
|
url: nonEmptyStringSchema.describe("The project link URL.")
|
|
@@ -677,6 +915,7 @@ var packageConfigSchema = zod.z.strictObject({
|
|
|
677
915
|
description: zod.z.string().optional().describe("The package description used in generated metadata."),
|
|
678
916
|
repository: nonEmptyStringSchema.optional().describe("The source repository for the generated SDK."),
|
|
679
917
|
homepage: nonEmptyStringSchema.optional().describe("The package homepage URL."),
|
|
918
|
+
bugs: bugsSchema.optional().describe("Where issues with the package are reported."),
|
|
680
919
|
documentationUrl: nonEmptyStringSchema.optional().describe("The package documentation URL."),
|
|
681
920
|
authors: zod.z.array(authorSchema).optional().describe("Authors credited in package metadata."),
|
|
682
921
|
developers: zod.z.array(developerSchema).optional().describe("Developers credited in package metadata."),
|
|
@@ -686,7 +925,10 @@ var packageConfigSchema = zod.z.strictObject({
|
|
|
686
925
|
projectUrls: zod.z.array(projectUrlSchema).optional().describe("Labeled project links for package metadata."),
|
|
687
926
|
extraDependencies: zod.z.array(dependencySchema).optional().describe("Additional runtime dependencies added to the generated package."),
|
|
688
927
|
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.")
|
|
928
|
+
extraPeerDependencies: zod.z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package."),
|
|
929
|
+
extraPeerDependenciesMeta: zod.z.record(nonEmptyStringSchema, jsonObjectSchema).optional().describe(
|
|
930
|
+
"npm peerDependenciesMeta entries keyed by peer dependency name, such as { optional: true }."
|
|
931
|
+
)
|
|
690
932
|
});
|
|
691
933
|
|
|
692
934
|
// src/sdk-config-domain/v1/language/terraform.ts
|
|
@@ -1026,6 +1268,12 @@ var githubOutputSchema = zod.z.strictObject({
|
|
|
1026
1268
|
/** Automatically merge the GitHub publishing PR. Defaults to false. */
|
|
1027
1269
|
autoMerge: zod.z.boolean().default(false).describe("Whether the GitHub publisher automatically merges its pull request.")
|
|
1028
1270
|
});
|
|
1271
|
+
var distributionShape = {
|
|
1272
|
+
/** Valid only for `cli` targets with GitHub delivery; secret names only, never values. */
|
|
1273
|
+
distribution: cliDistributionConfigSchema.optional().describe(
|
|
1274
|
+
"CLI release channels published by the generated release workflow; credentials are GitHub Actions secret names."
|
|
1275
|
+
)
|
|
1276
|
+
};
|
|
1029
1277
|
var credentialResolutionShape = {
|
|
1030
1278
|
/** Where output credential references are resolved. */
|
|
1031
1279
|
credentialResolution: credentialResolutionSchema.default("refs-only").describe("Where output credential references are resolved.")
|
|
@@ -1034,18 +1282,21 @@ var filesOutputSchema = zod.z.strictObject({
|
|
|
1034
1282
|
delivery: zod.z.literal("files").describe("Writes the generated SDK to a directory."),
|
|
1035
1283
|
path: nonEmptyStringSchema.optional().describe("The destination directory for generated files."),
|
|
1036
1284
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1285
|
+
...distributionShape,
|
|
1037
1286
|
...credentialResolutionShape
|
|
1038
1287
|
});
|
|
1039
1288
|
var zipOutputSchema = zod.z.strictObject({
|
|
1040
1289
|
delivery: zod.z.literal("zip").describe("Packages the generated SDK as a ZIP archive."),
|
|
1041
1290
|
fileName: nonEmptyStringSchema.optional().describe("The generated ZIP archive file name."),
|
|
1042
1291
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1292
|
+
...distributionShape,
|
|
1043
1293
|
...credentialResolutionShape
|
|
1044
1294
|
});
|
|
1045
1295
|
var githubDeliverySchema = zod.z.strictObject({
|
|
1046
1296
|
delivery: zod.z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
1047
1297
|
github: githubOutputSchema.describe("GitHub repository delivery settings."),
|
|
1048
1298
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1299
|
+
...distributionShape,
|
|
1049
1300
|
...credentialResolutionShape
|
|
1050
1301
|
});
|
|
1051
1302
|
var outputConfigSchema = zod.z.discriminatedUnion(
|
|
@@ -1165,7 +1416,7 @@ var targetConfigSchema = zod.z.strictObject({
|
|
|
1165
1416
|
// src/sdk-config-ir/v1/sdk-config-ir-v1.ts
|
|
1166
1417
|
var SDK_CONFIG_IR_V1_SCHEMA_VERSION = "sdk-config-ir/v1";
|
|
1167
1418
|
var publishRegistryLanguages = {
|
|
1168
|
-
npm: ["typescript", "mcp"],
|
|
1419
|
+
npm: ["typescript", "mcp", "cli"],
|
|
1169
1420
|
pypi: ["python"],
|
|
1170
1421
|
maven: ["java", "kotlin"],
|
|
1171
1422
|
nuget: ["csharp"],
|
|
@@ -1220,6 +1471,28 @@ function validatePublishingIdentity(packageConfig, registry, context) {
|
|
|
1220
1471
|
});
|
|
1221
1472
|
}
|
|
1222
1473
|
}
|
|
1474
|
+
function validateCliOutput(output, language, context) {
|
|
1475
|
+
if (output.distribution !== void 0 && language !== "cli") {
|
|
1476
|
+
context.addIssue({
|
|
1477
|
+
code: "custom",
|
|
1478
|
+
message: `output.distribution is supported only for target language "cli", not "${language}"`,
|
|
1479
|
+
path: ["output", "distribution"]
|
|
1480
|
+
});
|
|
1481
|
+
} else if (output.distribution !== void 0 && output.delivery !== "github") {
|
|
1482
|
+
context.addIssue({
|
|
1483
|
+
code: "custom",
|
|
1484
|
+
message: CLI_DISTRIBUTION_REQUIRES_GITHUB_DELIVERY_MESSAGE,
|
|
1485
|
+
path: ["output", "distribution"]
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
if (language === "cli" && output.publish && output.delivery !== "github") {
|
|
1489
|
+
context.addIssue({
|
|
1490
|
+
code: "custom",
|
|
1491
|
+
message: CLI_PUBLISH_REQUIRES_GITHUB_DELIVERY_MESSAGE,
|
|
1492
|
+
path: ["output", "publish"]
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1223
1496
|
var sdkConfigIrV1Schema = zod.z.strictObject({
|
|
1224
1497
|
schemaVersion: zod.z.literal(SDK_CONFIG_IR_V1_SCHEMA_VERSION).describe("The version of the normalized SDK Config IR schema."),
|
|
1225
1498
|
source: sourceConfigSchema.describe("Materialized API descriptions consumed by generation."),
|
|
@@ -1281,6 +1554,7 @@ var sdkConfigIrV1Schema = zod.z.strictObject({
|
|
|
1281
1554
|
});
|
|
1282
1555
|
}
|
|
1283
1556
|
}
|
|
1557
|
+
validateCliOutput(output, target.language, context);
|
|
1284
1558
|
if (compatibility?.legacyInput) {
|
|
1285
1559
|
const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
|
|
1286
1560
|
if (compatibility.legacyInput.kind !== expectedKind) {
|
|
@@ -1441,11 +1715,16 @@ function parseSdkConfigIrV1ForConsumption(value) {
|
|
|
1441
1715
|
return parseSdkConfigIrV1(stripUnknownProperties(value, sdkConfigIrV1InputJsonSchema));
|
|
1442
1716
|
}
|
|
1443
1717
|
|
|
1718
|
+
exports.CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE;
|
|
1444
1719
|
exports.SDK_CONFIG_IR_V1_SCHEMA_VERSION = SDK_CONFIG_IR_V1_SCHEMA_VERSION;
|
|
1445
1720
|
exports.apiConfigSchema = apiConfigSchema;
|
|
1446
1721
|
exports.apiImportSettingsSchema = apiImportSettingsSchema;
|
|
1447
1722
|
exports.authConfigSchema = authConfigSchema;
|
|
1448
1723
|
exports.authSchemeSchema = authSchemeSchema;
|
|
1724
|
+
exports.cliDistributionConfigSchema = cliDistributionConfigSchema;
|
|
1725
|
+
exports.cliDistributionGithubAppSchema = cliDistributionGithubAppSchema;
|
|
1726
|
+
exports.cliDistributionHomebrewSchema = cliDistributionHomebrewSchema;
|
|
1727
|
+
exports.cliDistributionScoopSchema = cliDistributionScoopSchema;
|
|
1449
1728
|
exports.cliGenerationConfigSchema = cliGenerationConfigSchema;
|
|
1450
1729
|
exports.clientConfigOverrideSchema = clientConfigOverrideSchema;
|
|
1451
1730
|
exports.clientConfigSchema = clientConfigSchema;
|
|
@@ -1457,6 +1736,8 @@ exports.dependencySchema = dependencySchema;
|
|
|
1457
1736
|
exports.docsConfigSchema = docsConfigSchema;
|
|
1458
1737
|
exports.exactSemverSchema = exactSemverSchema;
|
|
1459
1738
|
exports.generationConfigSchema = generationConfigSchema;
|
|
1739
|
+
exports.getSdkConfigIrV1Diagnostics = getSdkConfigIrV1Diagnostics;
|
|
1740
|
+
exports.githubActionsSecretNameSchema = githubActionsSecretNameSchema;
|
|
1460
1741
|
exports.goGenerationConfigSchema = goGenerationConfigSchema;
|
|
1461
1742
|
exports.goModulePathSchema = goModulePathSchema;
|
|
1462
1743
|
exports.javaGenerationConfigSchema = javaGenerationConfigSchema;
|