@postman/sdk-config 0.10.1 → 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 +697 -34
- 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 +683 -35
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +649 -34
- 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 +642 -35
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +649 -34
- 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 +642 -35
- 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
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ApiConfig, ApiConfigInput, ApiImportSettings, AuthConfig, AuthScheme, ClientConfig, ClientConfigInput, ClientConfigOverride, CompatibilityConfig, CredentialResolution, DocsConfig, GenerationConfig, LanguageGenerationConfig, LegacyInput, OutputConfig, PublishConfig, PublishRegistry, ReadmeCustomSection, ReadmeEndpoint, ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SdkConfigIrCapability, SdkConfigIrV1, SdkConfigIrV1Input, SerializedSdkConfigIrV1, SourceConfig, SourceSpecConfig, SourceSpecType, TargetConfig, TargetLanguage, UnsupportedField, WebhookSignature, WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema } from './v1/index.cjs';
|
|
2
|
-
export { C as
|
|
1
|
+
export { ApiConfig, ApiConfigInput, ApiImportSettings, AuthConfig, AuthScheme, ClientConfig, ClientConfigInput, ClientConfigOverride, CompatibilityConfig, CredentialResolution, DocsConfig, GenerationConfig, LanguageGenerationConfig, LegacyInput, OutputConfig, PublishConfig, PublishRegistry, ReadmeCustomSection, ReadmeEndpoint, ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SdkConfigIrCapability, SdkConfigIrV1, SdkConfigIrV1Input, SerializedSdkConfigIrV1, SourceConfig, SourceSpecConfig, SourceSpecType, TargetConfig, TargetLanguage, UnsupportedField, WebhookSignature, WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema } from './v1/index.cjs';
|
|
2
|
+
export { C as CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as CliDistributionConfig, b as CliDistributionGithubAppConfig, c as CliDistributionHomebrewConfig, d as CliDistributionScoopConfig, e as CliGenerationConfig, f as CliProfilesConfig, g as CliProfilesProvisionOperation, h as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, i as JsonObject, j as JsonValue, K as KotlinGenerationConfig, M as McpAvailabilityStatus, k as McpGenerationConfig, l as McpToolFilter, P as PackageConfig, m as PhpGenerationConfig, n as PlanModifiers, o as PythonGenerationConfig, R as RubyGenerationConfig, p as RustGenerationConfig, S as SdkConfigIrV1Diagnostic, q as SwiftGenerationConfig, T as TerraformGenerationConfig, r as TypescriptGenerationConfig, s as cliDistributionConfigSchema, t as cliDistributionGithubAppSchema, u as cliDistributionHomebrewSchema, v as cliDistributionScoopSchema, w as cliGenerationConfigSchema, x as composerPackageNameSchema, y as csharpGenerationConfigSchema, z as dependencySchema, A as exactSemverSchema, B as githubActionsSecretNameSchema, E as goGenerationConfigSchema, F as goModulePathSchema, H as javaGenerationConfigSchema, I as jsonObjectSchema, L as jsonValueSchema, N as kotlinGenerationConfigSchema, O as mcpAvailabilityStatuses, Q as mcpGenerationConfigSchema, U as nonEmptyStringSchema, V as packageConfigSchema, W as phpGenerationConfigSchema, X as pythonGenerationConfigSchema, Y as relativePathSchema, Z as rubyGenerationConfigSchema, _ as rustGenerationConfigSchema, $ as swiftGenerationConfigSchema, a0 as terraformGenerationConfigSchema, a1 as typescriptGenerationConfigSchema } from '../typescript-CsAa1VSy.cjs';
|
|
3
3
|
import 'zod';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ApiConfig, ApiConfigInput, ApiImportSettings, AuthConfig, AuthScheme, ClientConfig, ClientConfigInput, ClientConfigOverride, CompatibilityConfig, CredentialResolution, DocsConfig, GenerationConfig, LanguageGenerationConfig, LegacyInput, OutputConfig, PublishConfig, PublishRegistry, ReadmeCustomSection, ReadmeEndpoint, ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SdkConfigIrCapability, SdkConfigIrV1, SdkConfigIrV1Input, SerializedSdkConfigIrV1, SourceConfig, SourceSpecConfig, SourceSpecType, TargetConfig, TargetLanguage, UnsupportedField, WebhookSignature, WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema } from './v1/index.js';
|
|
2
|
-
export { C as
|
|
1
|
+
export { ApiConfig, ApiConfigInput, ApiImportSettings, AuthConfig, AuthScheme, ClientConfig, ClientConfigInput, ClientConfigOverride, CompatibilityConfig, CredentialResolution, DocsConfig, GenerationConfig, LanguageGenerationConfig, LegacyInput, OutputConfig, PublishConfig, PublishRegistry, ReadmeCustomSection, ReadmeEndpoint, ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SdkConfigIrCapability, SdkConfigIrV1, SdkConfigIrV1Input, SerializedSdkConfigIrV1, SourceConfig, SourceSpecConfig, SourceSpecType, TargetConfig, TargetLanguage, UnsupportedField, WebhookSignature, WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema } from './v1/index.js';
|
|
2
|
+
export { C as CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as CliDistributionConfig, b as CliDistributionGithubAppConfig, c as CliDistributionHomebrewConfig, d as CliDistributionScoopConfig, e as CliGenerationConfig, f as CliProfilesConfig, g as CliProfilesProvisionOperation, h as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, i as JsonObject, j as JsonValue, K as KotlinGenerationConfig, M as McpAvailabilityStatus, k as McpGenerationConfig, l as McpToolFilter, P as PackageConfig, m as PhpGenerationConfig, n as PlanModifiers, o as PythonGenerationConfig, R as RubyGenerationConfig, p as RustGenerationConfig, S as SdkConfigIrV1Diagnostic, q as SwiftGenerationConfig, T as TerraformGenerationConfig, r as TypescriptGenerationConfig, s as cliDistributionConfigSchema, t as cliDistributionGithubAppSchema, u as cliDistributionHomebrewSchema, v as cliDistributionScoopSchema, w as cliGenerationConfigSchema, x as composerPackageNameSchema, y as csharpGenerationConfigSchema, z as dependencySchema, A as exactSemverSchema, B as githubActionsSecretNameSchema, E as goGenerationConfigSchema, F as goModulePathSchema, H as javaGenerationConfigSchema, I as jsonObjectSchema, L as jsonValueSchema, N as kotlinGenerationConfigSchema, O as mcpAvailabilityStatuses, Q as mcpGenerationConfigSchema, U as nonEmptyStringSchema, V as packageConfigSchema, W as phpGenerationConfigSchema, X as pythonGenerationConfigSchema, Y as relativePathSchema, Z as rubyGenerationConfigSchema, _ as rustGenerationConfigSchema, $ as swiftGenerationConfigSchema, a0 as terraformGenerationConfigSchema, a1 as typescriptGenerationConfigSchema } from '../typescript-CsAa1VSy.js';
|
|
3
3
|
import 'zod';
|
|
@@ -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."),
|
|
@@ -680,7 +881,10 @@ var packageConfigSchema = z.strictObject({
|
|
|
680
881
|
projectUrls: z.array(projectUrlSchema).optional().describe("Labeled project links for package metadata."),
|
|
681
882
|
extraDependencies: z.array(dependencySchema).optional().describe("Additional runtime dependencies added to the generated package."),
|
|
682
883
|
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.")
|
|
884
|
+
extraPeerDependencies: z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package."),
|
|
885
|
+
extraPeerDependenciesMeta: z.record(nonEmptyStringSchema, jsonObjectSchema).optional().describe(
|
|
886
|
+
"npm peerDependenciesMeta entries keyed by peer dependency name, such as { optional: true }."
|
|
887
|
+
)
|
|
684
888
|
});
|
|
685
889
|
|
|
686
890
|
// src/sdk-config-domain/v1/language/terraform.ts
|
|
@@ -1020,6 +1224,12 @@ var githubOutputSchema = z.strictObject({
|
|
|
1020
1224
|
/** Automatically merge the GitHub publishing PR. Defaults to false. */
|
|
1021
1225
|
autoMerge: z.boolean().default(false).describe("Whether the GitHub publisher automatically merges its pull request.")
|
|
1022
1226
|
});
|
|
1227
|
+
var distributionShape = {
|
|
1228
|
+
/** Valid only for `cli` targets with GitHub delivery; secret names only, never values. */
|
|
1229
|
+
distribution: cliDistributionConfigSchema.optional().describe(
|
|
1230
|
+
"CLI release channels published by the generated release workflow; credentials are GitHub Actions secret names."
|
|
1231
|
+
)
|
|
1232
|
+
};
|
|
1023
1233
|
var credentialResolutionShape = {
|
|
1024
1234
|
/** Where output credential references are resolved. */
|
|
1025
1235
|
credentialResolution: credentialResolutionSchema.default("refs-only").describe("Where output credential references are resolved.")
|
|
@@ -1028,18 +1238,21 @@ var filesOutputSchema = z.strictObject({
|
|
|
1028
1238
|
delivery: z.literal("files").describe("Writes the generated SDK to a directory."),
|
|
1029
1239
|
path: nonEmptyStringSchema.optional().describe("The destination directory for generated files."),
|
|
1030
1240
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1241
|
+
...distributionShape,
|
|
1031
1242
|
...credentialResolutionShape
|
|
1032
1243
|
});
|
|
1033
1244
|
var zipOutputSchema = z.strictObject({
|
|
1034
1245
|
delivery: z.literal("zip").describe("Packages the generated SDK as a ZIP archive."),
|
|
1035
1246
|
fileName: nonEmptyStringSchema.optional().describe("The generated ZIP archive file name."),
|
|
1036
1247
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1248
|
+
...distributionShape,
|
|
1037
1249
|
...credentialResolutionShape
|
|
1038
1250
|
});
|
|
1039
1251
|
var githubDeliverySchema = z.strictObject({
|
|
1040
1252
|
delivery: z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
1041
1253
|
github: githubOutputSchema.describe("GitHub repository delivery settings."),
|
|
1042
1254
|
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
1255
|
+
...distributionShape,
|
|
1043
1256
|
...credentialResolutionShape
|
|
1044
1257
|
});
|
|
1045
1258
|
var outputConfigSchema = z.discriminatedUnion(
|
|
@@ -1159,7 +1372,7 @@ var targetConfigSchema = z.strictObject({
|
|
|
1159
1372
|
// src/sdk-config-ir/v1/sdk-config-ir-v1.ts
|
|
1160
1373
|
var SDK_CONFIG_IR_V1_SCHEMA_VERSION = "sdk-config-ir/v1";
|
|
1161
1374
|
var publishRegistryLanguages = {
|
|
1162
|
-
npm: ["typescript", "mcp"],
|
|
1375
|
+
npm: ["typescript", "mcp", "cli"],
|
|
1163
1376
|
pypi: ["python"],
|
|
1164
1377
|
maven: ["java", "kotlin"],
|
|
1165
1378
|
nuget: ["csharp"],
|
|
@@ -1214,6 +1427,28 @@ function validatePublishingIdentity(packageConfig, registry, context) {
|
|
|
1214
1427
|
});
|
|
1215
1428
|
}
|
|
1216
1429
|
}
|
|
1430
|
+
function validateCliOutput(output, language, context) {
|
|
1431
|
+
if (output.distribution !== void 0 && language !== "cli") {
|
|
1432
|
+
context.addIssue({
|
|
1433
|
+
code: "custom",
|
|
1434
|
+
message: `output.distribution is supported only for target language "cli", not "${language}"`,
|
|
1435
|
+
path: ["output", "distribution"]
|
|
1436
|
+
});
|
|
1437
|
+
} else if (output.distribution !== void 0 && output.delivery !== "github") {
|
|
1438
|
+
context.addIssue({
|
|
1439
|
+
code: "custom",
|
|
1440
|
+
message: CLI_DISTRIBUTION_REQUIRES_GITHUB_DELIVERY_MESSAGE,
|
|
1441
|
+
path: ["output", "distribution"]
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
if (language === "cli" && output.publish && output.delivery !== "github") {
|
|
1445
|
+
context.addIssue({
|
|
1446
|
+
code: "custom",
|
|
1447
|
+
message: CLI_PUBLISH_REQUIRES_GITHUB_DELIVERY_MESSAGE,
|
|
1448
|
+
path: ["output", "publish"]
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1217
1452
|
var sdkConfigIrV1Schema = z.strictObject({
|
|
1218
1453
|
schemaVersion: z.literal(SDK_CONFIG_IR_V1_SCHEMA_VERSION).describe("The version of the normalized SDK Config IR schema."),
|
|
1219
1454
|
source: sourceConfigSchema.describe("Materialized API descriptions consumed by generation."),
|
|
@@ -1275,6 +1510,7 @@ var sdkConfigIrV1Schema = z.strictObject({
|
|
|
1275
1510
|
});
|
|
1276
1511
|
}
|
|
1277
1512
|
}
|
|
1513
|
+
validateCliOutput(output, target.language, context);
|
|
1278
1514
|
if (compatibility?.legacyInput) {
|
|
1279
1515
|
const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
|
|
1280
1516
|
if (compatibility.legacyInput.kind !== expectedKind) {
|
|
@@ -1435,6 +1671,6 @@ function parseSdkConfigIrV1ForConsumption(value) {
|
|
|
1435
1671
|
return parseSdkConfigIrV1(stripUnknownProperties(value, sdkConfigIrV1InputJsonSchema));
|
|
1436
1672
|
}
|
|
1437
1673
|
|
|
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 };
|
|
1674
|
+
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
1675
|
//# sourceMappingURL=index.js.map
|
|
1440
1676
|
//# sourceMappingURL=index.js.map
|