@postman/sdk-config 0.18.0 → 0.20.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 +1 -1
- package/dist/index.cjs +237 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +237 -59
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +173 -11
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.d.cts +1 -1
- package/dist/sdk-config/index.d.ts +1 -1
- package/dist/sdk-config/index.js +173 -11
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +173 -11
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +6032 -294
- package/dist/sdk-config/v1/index.d.ts +6032 -294
- package/dist/sdk-config/v1/index.js +173 -11
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +209 -51
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +1 -1
- package/dist/sdk-config-ir/index.d.ts +1 -1
- package/dist/sdk-config-ir/index.js +209 -52
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +209 -51
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +1203 -6
- package/dist/sdk-config-ir/v1/index.d.ts +1203 -6
- package/dist/sdk-config-ir/v1/index.js +209 -52
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-D0YeGxxS.d.cts → typescript-VEqEGvnA.d.cts} +60 -1
- package/dist/{typescript-D0YeGxxS.d.ts → typescript-VEqEGvnA.d.ts} +60 -1
- package/package.json +2 -2
- package/src/sdk-config/v1/README.md +59 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
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, SourceSpecOrigin, 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, sourceSpecOriginSchema, 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
|
|
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 CliOAuthTokenEndpoints, g as CliProfilesConfig, h as CliProfilesProvisionOperation, i as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, j as JsonObject, k as JsonValue, K as KotlinGenerationConfig, M as McpAvailabilityStatus, l as McpGenerationConfig, m as McpToolFilter, P as PackageConfig, n as PhpGenerationConfig, o as PlanModifiers, p as PythonGenerationConfig, R as RubyGenerationConfig, q as RustGenerationConfig, S as SdkConfigIrV1Diagnostic, r as SwiftGenerationConfig, T as TerraformGenerationConfig, s as TypescriptGenerationConfig, t as cliDistributionConfigSchema, u as cliDistributionGithubAppSchema, v as cliDistributionHomebrewSchema, w as cliDistributionScoopSchema, x as cliGenerationConfigSchema, y as composerPackageNameSchema, z as csharpGenerationConfigSchema, A as dependencySchema, B as exactSemverSchema, E as githubActionsSecretNameSchema, F as goGenerationConfigSchema, H as goModulePathSchema, I as javaGenerationConfigSchema, L as jsonObjectSchema, N as jsonValueSchema, O as kotlinGenerationConfigSchema, Q as mcpAvailabilityStatuses, U as mcpGenerationConfigSchema, V as nonEmptyStringSchema, W as oauthTokenEndpointsIssues, X as packageConfigSchema, Y as parentRelativePathSchema, Z as phpGenerationConfigSchema, _ as pythonGenerationConfigSchema, $ as relativePathSchema, a0 as rubyGenerationConfigSchema, a1 as rustGenerationConfigSchema, a2 as swiftGenerationConfigSchema, a3 as terraformGenerationConfigSchema, a4 as typescriptGenerationConfigSchema } from '../typescript-VEqEGvnA.cjs';
|
|
3
3
|
import 'zod';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
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, SourceSpecOrigin, 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, sourceSpecOriginSchema, 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
|
|
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 CliOAuthTokenEndpoints, g as CliProfilesConfig, h as CliProfilesProvisionOperation, i as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, j as JsonObject, k as JsonValue, K as KotlinGenerationConfig, M as McpAvailabilityStatus, l as McpGenerationConfig, m as McpToolFilter, P as PackageConfig, n as PhpGenerationConfig, o as PlanModifiers, p as PythonGenerationConfig, R as RubyGenerationConfig, q as RustGenerationConfig, S as SdkConfigIrV1Diagnostic, r as SwiftGenerationConfig, T as TerraformGenerationConfig, s as TypescriptGenerationConfig, t as cliDistributionConfigSchema, u as cliDistributionGithubAppSchema, v as cliDistributionHomebrewSchema, w as cliDistributionScoopSchema, x as cliGenerationConfigSchema, y as composerPackageNameSchema, z as csharpGenerationConfigSchema, A as dependencySchema, B as exactSemverSchema, E as githubActionsSecretNameSchema, F as goGenerationConfigSchema, H as goModulePathSchema, I as javaGenerationConfigSchema, L as jsonObjectSchema, N as jsonValueSchema, O as kotlinGenerationConfigSchema, Q as mcpAvailabilityStatuses, U as mcpGenerationConfigSchema, V as nonEmptyStringSchema, W as oauthTokenEndpointsIssues, X as packageConfigSchema, Y as parentRelativePathSchema, Z as phpGenerationConfigSchema, _ as pythonGenerationConfigSchema, $ as relativePathSchema, a0 as rubyGenerationConfigSchema, a1 as rustGenerationConfigSchema, a2 as swiftGenerationConfigSchema, a3 as terraformGenerationConfigSchema, a4 as typescriptGenerationConfigSchema } from '../typescript-VEqEGvnA.js';
|
|
3
3
|
import 'zod';
|
|
@@ -134,6 +134,39 @@ var publicClientIdSchema = nonEmptyStringSchema.refine((value) => value.trim() =
|
|
|
134
134
|
}).refine((value) => !value.includes("${"), {
|
|
135
135
|
message: "must be a literal public client ID, not an environment expression"
|
|
136
136
|
});
|
|
137
|
+
var oauthExtraParametersSchema = z.record(z.string().min(1), z.string());
|
|
138
|
+
function parseUrl(value) {
|
|
139
|
+
try {
|
|
140
|
+
return new URL(value);
|
|
141
|
+
} catch {
|
|
142
|
+
return void 0;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
var loopbackRedirectUriSchema = nonEmptyStringSchema.refine(
|
|
146
|
+
(value) => {
|
|
147
|
+
const url = parseUrl(value);
|
|
148
|
+
return url !== void 0 && url.protocol === "http:" && (url.hostname === "127.0.0.1" || url.hostname === "localhost") && url.port !== "";
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
message: "must be an http URL on 127.0.0.1 or localhost that pins a port, such as http://127.0.0.1:8484/callback"
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
function containsControlCharacter(value) {
|
|
155
|
+
return [...value].some((character) => {
|
|
156
|
+
const code = character.charCodeAt(0);
|
|
157
|
+
return code <= 31 || code === 127;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
var hostedPageUrlSchema = nonEmptyStringSchema.refine(
|
|
161
|
+
(value) => {
|
|
162
|
+
const url = parseUrl(value);
|
|
163
|
+
return url !== void 0 && (url.protocol === "http:" || url.protocol === "https:");
|
|
164
|
+
},
|
|
165
|
+
{ message: "must be an absolute http or https URL" }
|
|
166
|
+
).refine((value) => !containsControlCharacter(value), {
|
|
167
|
+
message: "must not contain control characters"
|
|
168
|
+
});
|
|
169
|
+
var redirectPortSchema = z.number().int().min(1).max(65535);
|
|
137
170
|
var oauthFlowSchema = z.discriminatedUnion("type", [
|
|
138
171
|
z.strictObject({
|
|
139
172
|
type: z.literal("authorization-code").describe("Uses the OAuth authorization code flow."),
|
|
@@ -143,7 +176,25 @@ var oauthFlowSchema = z.discriminatedUnion("type", [
|
|
|
143
176
|
scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow."),
|
|
144
177
|
clientId: publicClientIdSchema.optional().describe(
|
|
145
178
|
"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."
|
|
146
|
-
)
|
|
179
|
+
),
|
|
180
|
+
redirectUri: loopbackRedirectUriSchema.optional().describe(
|
|
181
|
+
"The loopback callback of the interactive login, such as http://127.0.0.1:8484/callback. The login binds this exact host, port and path and sends it to the authorization server, so it must match the redirect registered there. Without it the login uses a free port chosen by the operating system."
|
|
182
|
+
),
|
|
183
|
+
redirectUriBackupPorts: z.array(redirectPortSchema).min(1).optional().describe(
|
|
184
|
+
"Ports tried in order when the port of redirectUri is busy. Each reuses the host and path of redirectUri, and every resulting URI must be registered with the authorization server. Requires redirectUri."
|
|
185
|
+
),
|
|
186
|
+
successRedirectUrl: hostedPageUrlSchema.optional().describe(
|
|
187
|
+
"A page the browser is sent to once the login captured the authorization code. Without it the login shows its own page."
|
|
188
|
+
),
|
|
189
|
+
errorRedirectUrl: hostedPageUrlSchema.optional().describe(
|
|
190
|
+
"A page the browser is sent to when the login fails; the error and error_description query parameters are added. Without it the login shows its own page."
|
|
191
|
+
),
|
|
192
|
+
authorizationParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the authorization request, such as audience."),
|
|
193
|
+
tokenParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the authorization code exchange request."),
|
|
194
|
+
refreshParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the token refresh request.")
|
|
195
|
+
}).refine((flow) => flow.redirectUriBackupPorts === void 0 || flow.redirectUri !== void 0, {
|
|
196
|
+
message: "redirectUriBackupPorts requires redirectUri",
|
|
197
|
+
path: ["redirectUriBackupPorts"]
|
|
147
198
|
}),
|
|
148
199
|
z.strictObject({
|
|
149
200
|
type: z.literal("client-credentials").describe("Uses the OAuth client credentials flow."),
|
|
@@ -162,21 +213,47 @@ var oauthFlowSchema = z.discriminatedUnion("type", [
|
|
|
162
213
|
tokenUrl: nonEmptyStringSchema.describe("The URL used to obtain access tokens."),
|
|
163
214
|
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
164
215
|
scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
|
|
216
|
+
}),
|
|
217
|
+
z.strictObject({
|
|
218
|
+
type: z.literal("device-code").describe(
|
|
219
|
+
"Uses the OAuth device authorization flow (RFC 8628) for logins without a browser."
|
|
220
|
+
),
|
|
221
|
+
clientId: publicClientIdSchema.describe(
|
|
222
|
+
"The public, non-secret OAuth client ID sent to the device authorization and token endpoints. It is embedded verbatim in generated code, so it must never be a client secret."
|
|
223
|
+
),
|
|
224
|
+
deviceAuthorizationUrl: nonEmptyStringSchema.describe(
|
|
225
|
+
"The URL that issues the device code, the user code and the verification URL."
|
|
226
|
+
),
|
|
227
|
+
tokenUrl: nonEmptyStringSchema.describe(
|
|
228
|
+
"The URL polled to exchange the device code for tokens once the user approved."
|
|
229
|
+
),
|
|
230
|
+
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
231
|
+
scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow."),
|
|
232
|
+
deviceAuthorizationParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the device authorization request, such as audience."),
|
|
233
|
+
tokenParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the token polling request."),
|
|
234
|
+
refreshParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the token refresh request.")
|
|
165
235
|
})
|
|
166
236
|
]);
|
|
167
|
-
var
|
|
237
|
+
var oauth2AuthObjectSchema = z.strictObject({
|
|
168
238
|
id: nonEmptyStringSchema.describe("A unique identifier for this authentication scheme."),
|
|
169
239
|
type: z.literal("oauth2").describe("Identifies an OAuth 2.0 authentication scheme."),
|
|
170
240
|
flows: z.array(oauthFlowSchema).min(1).describe("The OAuth flows supported by the API."),
|
|
171
241
|
clientId: authVariableSchema.optional().describe("The OAuth client ID parameter exposed by the SDK."),
|
|
172
242
|
clientSecret: authVariableSchema.optional().describe("The OAuth client secret parameter exposed by the SDK."),
|
|
173
243
|
tokenHeader: nonEmptyStringSchema.optional().describe("The request header that carries the OAuth access token."),
|
|
174
|
-
tokenPrefix: nonEmptyStringSchema.optional().describe(
|
|
244
|
+
tokenPrefix: nonEmptyStringSchema.optional().describe('The prefix added before the OAuth access token. Defaults to "Bearer" when omitted.'),
|
|
245
|
+
omitTokenPrefix: z.boolean().optional().describe(
|
|
246
|
+
'Whether the OAuth access token is sent as-is, with no prefix. Without it, a missing tokenPrefix means "Bearer". Cannot be combined with tokenPrefix.'
|
|
247
|
+
),
|
|
175
248
|
refreshBufferSeconds: z.number().nonnegative().optional().describe("How early, in seconds, the client refreshes a token before it expires."),
|
|
176
249
|
description: z.string().optional().describe(
|
|
177
250
|
"A description of the authentication scheme included in generated SDK documentation."
|
|
178
251
|
)
|
|
179
252
|
});
|
|
253
|
+
var oauth2AuthSchema = oauth2AuthObjectSchema.refine(
|
|
254
|
+
(scheme) => !(scheme.omitTokenPrefix === true && scheme.tokenPrefix !== void 0),
|
|
255
|
+
{ message: "omitTokenPrefix cannot be combined with tokenPrefix", path: ["omitTokenPrefix"] }
|
|
256
|
+
);
|
|
180
257
|
var customAuthParameterSchema = z.strictObject({
|
|
181
258
|
location: z.enum(["header", "query", "cookie"]).describe("Where the custom authentication value is sent."),
|
|
182
259
|
name: nonEmptyStringSchema.describe("The header, query parameter, or cookie name."),
|
|
@@ -586,6 +663,9 @@ var RESERVED_PROFILES_COMMAND_NAMES = /* @__PURE__ */ new Set([
|
|
|
586
663
|
var binaryNameSchema = nonEmptyStringSchema.regex(ALPHANUMERIC_PATTERN, {
|
|
587
664
|
message: "binaryName must contain at least one ASCII letter or digit"
|
|
588
665
|
});
|
|
666
|
+
var crateNameSchema = z.string().regex(/^[A-Za-z][A-Za-z0-9_-]{0,63}$/, {
|
|
667
|
+
message: "crateName must start with a letter, contain only letters, digits, hyphens, and underscores, and be at most 64 characters"
|
|
668
|
+
});
|
|
589
669
|
var rootGroupSchema = z.string().regex(ROOT_GROUP_PATTERN, {
|
|
590
670
|
message: "rootGroup must start with a lowercase letter and contain only lowercase letters, digits, hyphens, and underscores"
|
|
591
671
|
});
|
|
@@ -650,17 +730,78 @@ var profilesConfigSchema = z.strictObject({
|
|
|
650
730
|
revokeOperation: dottedCommandPathSchema("profiles.revokeOperation").optional().describe('The dotted command path called by "profiles remove --revoke".'),
|
|
651
731
|
provisionOperation: profilesProvisionOperationSchema.optional().describe('The operation called by "profiles create --provision" and its response mapping.')
|
|
652
732
|
});
|
|
733
|
+
var oauthPropertyPathSchema = z.string().regex(FIELD_NAME_PATTERN, {
|
|
734
|
+
message: 'must be a property name, or a dotted path to a nested property, such as "data.token"'
|
|
735
|
+
}).regex(/^[^.]+(\.[^.]+)*$/, { message: "must not have an empty path segment" });
|
|
736
|
+
var oauthTokenRequestPropertiesSchema = z.strictObject({
|
|
737
|
+
clientId: oauthPropertyPathSchema.optional().describe('The request property that carries the client ID. Defaults to "client_id".'),
|
|
738
|
+
clientSecret: oauthPropertyPathSchema.optional().describe('The request property that carries the client secret. Defaults to "client_secret".'),
|
|
739
|
+
scopes: oauthPropertyPathSchema.optional().describe('The request property that carries the scopes. Defaults to "scope".')
|
|
740
|
+
});
|
|
741
|
+
var oauthTokenResponsePropertiesSchema = z.strictObject({
|
|
742
|
+
accessToken: oauthPropertyPathSchema.optional().describe('The response property that holds the access token. Defaults to "access_token".'),
|
|
743
|
+
expiresIn: oauthPropertyPathSchema.optional().describe(
|
|
744
|
+
'The response property that holds the lifetime in seconds. Defaults to "expires_in".'
|
|
745
|
+
),
|
|
746
|
+
refreshToken: oauthPropertyPathSchema.optional().describe('The response property that holds the refresh token. Defaults to "refresh_token".')
|
|
747
|
+
});
|
|
748
|
+
var oauthTokenEndpointsSchema = z.strictObject({
|
|
749
|
+
token: z.strictObject({
|
|
750
|
+
requestProperties: oauthTokenRequestPropertiesSchema.optional().describe("The names of the properties of the token request."),
|
|
751
|
+
responseProperties: oauthTokenResponsePropertiesSchema.optional().describe("The names of the properties of the token response.")
|
|
752
|
+
}).optional().describe("The token endpoint of the client credentials flow (its tokenUrl)."),
|
|
753
|
+
refresh: z.strictObject({
|
|
754
|
+
requestProperties: z.strictObject({
|
|
755
|
+
refreshToken: oauthPropertyPathSchema.optional().describe(
|
|
756
|
+
'The request property that carries the refresh token. Defaults to "refresh_token".'
|
|
757
|
+
)
|
|
758
|
+
}).optional().describe("The names of the properties of the refresh request."),
|
|
759
|
+
responseProperties: oauthTokenResponsePropertiesSchema.optional().describe("The names of the properties of the refresh response.")
|
|
760
|
+
}).optional().describe("The refresh endpoint of the client credentials flow (its refreshUrl).")
|
|
761
|
+
});
|
|
762
|
+
function oauthTokenEndpointsIssues(oauthTokenEndpoints, schemes, basePath) {
|
|
763
|
+
const flowsById = /* @__PURE__ */ new Map();
|
|
764
|
+
for (const scheme of schemes ?? []) {
|
|
765
|
+
const flow = scheme.type === "oauth2" ? scheme.flows?.find((f) => f.type === "client-credentials") : void 0;
|
|
766
|
+
if (flow !== void 0) {
|
|
767
|
+
flowsById.set(scheme.id, flow);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
return Object.entries(oauthTokenEndpoints ?? {}).flatMap(([id, endpoints]) => {
|
|
771
|
+
const flow = flowsById.get(id);
|
|
772
|
+
if (flow === void 0) {
|
|
773
|
+
return [
|
|
774
|
+
{
|
|
775
|
+
message: `oauthTokenEndpoints "${id}" must name an OAuth scheme with a client-credentials flow`,
|
|
776
|
+
path: [...basePath, id]
|
|
777
|
+
}
|
|
778
|
+
];
|
|
779
|
+
}
|
|
780
|
+
return endpoints.refresh !== void 0 && flow.refreshUrl === void 0 ? [
|
|
781
|
+
{
|
|
782
|
+
message: `oauthTokenEndpoints "${id}" has refresh settings, but its flow has no refreshUrl`,
|
|
783
|
+
path: [...basePath, id, "refresh"]
|
|
784
|
+
}
|
|
785
|
+
] : [];
|
|
786
|
+
});
|
|
787
|
+
}
|
|
653
788
|
var cliGenerationConfigSchema = z.strictObject({
|
|
654
789
|
paginationParameters: z.array(nonEmptyStringSchema).optional().describe("Request parameter names treated as pagination controls by the CLI."),
|
|
655
790
|
skills: z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands."),
|
|
656
791
|
binaryName: binaryNameSchema.optional().describe(
|
|
657
792
|
"The CLI executable name. The generator kebab-cases it and also uses it for the source directory and env-var prefix."
|
|
658
793
|
),
|
|
794
|
+
crateName: crateNameSchema.optional().describe(
|
|
795
|
+
"The name of the generated Cargo package, which release archives and installers are named after. The generator defaults it to the binary name when the output is delivered to GitHub."
|
|
796
|
+
),
|
|
659
797
|
customCommands: z.boolean().optional().describe("Whether hand-written command support is generated. The generator defaults to true."),
|
|
660
798
|
rootGroup: rootGroupSchema.optional().describe("A command group that every spec-derived command is nested under."),
|
|
661
799
|
profiles: profilesConfigSchema.optional().describe("Named profile command configuration."),
|
|
662
800
|
splitTypeCrates: z.boolean().optional().describe("Whether generated types are split into one crate per API behind a facade crate."),
|
|
663
|
-
userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.')
|
|
801
|
+
userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.'),
|
|
802
|
+
oauthTokenEndpoints: z.record(nonEmptyStringSchema, oauthTokenEndpointsSchema).optional().describe(
|
|
803
|
+
"Per OAuth scheme id (api.auth.schemes[].id), the names of the properties of the token and refresh requests and responses, for the client credentials flow of an API whose token endpoint does not use the RFC 6749 names."
|
|
804
|
+
)
|
|
664
805
|
});
|
|
665
806
|
var csharpGenerationConfigSchema = z.strictObject({
|
|
666
807
|
useOptionalWrapper: z.boolean().optional().describe("Whether optional values use an explicit Optional wrapper."),
|
|
@@ -1309,6 +1450,14 @@ var zipOutputSchema = z.strictObject({
|
|
|
1309
1450
|
...distributionShape,
|
|
1310
1451
|
...credentialResolutionShape
|
|
1311
1452
|
});
|
|
1453
|
+
var localAliasOutputSchema = zipOutputSchema.extend({
|
|
1454
|
+
delivery: z.literal("local").describe('Alias of "zip": the package on the local machine.')
|
|
1455
|
+
}).transform(
|
|
1456
|
+
(output) => ({
|
|
1457
|
+
...output,
|
|
1458
|
+
delivery: "zip"
|
|
1459
|
+
})
|
|
1460
|
+
);
|
|
1312
1461
|
var githubDeliverySchema = z.strictObject({
|
|
1313
1462
|
delivery: z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
1314
1463
|
github: githubOutputSchema.describe("GitHub repository delivery settings."),
|
|
@@ -1318,9 +1467,9 @@ var githubDeliverySchema = z.strictObject({
|
|
|
1318
1467
|
});
|
|
1319
1468
|
var outputConfigSchema = z.discriminatedUnion(
|
|
1320
1469
|
"delivery",
|
|
1321
|
-
[filesOutputSchema, zipOutputSchema, githubDeliverySchema],
|
|
1470
|
+
[filesOutputSchema, zipOutputSchema, githubDeliverySchema, localAliasOutputSchema],
|
|
1322
1471
|
{
|
|
1323
|
-
error: 'output.delivery must be one of "files", "zip", or "github"'
|
|
1472
|
+
error: 'output.delivery must be one of "files", "zip", "local", or "github"'
|
|
1324
1473
|
}
|
|
1325
1474
|
);
|
|
1326
1475
|
var replayConfigSchema = z.strictObject({
|
|
@@ -1540,63 +1689,71 @@ var sdkConfigIrV1Schema = z.strictObject({
|
|
|
1540
1689
|
"Shared and language-specific generation behavior."
|
|
1541
1690
|
),
|
|
1542
1691
|
compatibility: compatibilityConfigSchema.optional().describe("Temporary provenance and diagnostics retained during legacy migration.")
|
|
1543
|
-
}).superRefine(
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
[
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1692
|
+
}).superRefine(
|
|
1693
|
+
({ api, compatibility, generation, output, package: packageConfig, target }, context) => {
|
|
1694
|
+
const configuredLanguages = Object.keys(generation.language ?? {});
|
|
1695
|
+
const requiresExternalPublishIdentity = output.delivery === "github" || output.publish !== void 0;
|
|
1696
|
+
if (requiresExternalPublishIdentity) {
|
|
1697
|
+
[
|
|
1698
|
+
["apiName", "target.apiName is required for external publishing"],
|
|
1699
|
+
["organizationName", "target.organizationName is required for external publishing"]
|
|
1700
|
+
].forEach(([field, message]) => {
|
|
1701
|
+
if (!target[field]) {
|
|
1702
|
+
context.addIssue({
|
|
1703
|
+
code: "custom",
|
|
1704
|
+
message,
|
|
1705
|
+
path: ["target", field]
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
oauthTokenEndpointsIssues(generation.language?.cli?.oauthTokenEndpoints, api.auth?.schemes, [
|
|
1711
|
+
"generation",
|
|
1712
|
+
"language",
|
|
1713
|
+
"cli",
|
|
1714
|
+
"oauthTokenEndpoints"
|
|
1715
|
+
]).forEach((issue) => context.addIssue({ code: "custom", ...issue }));
|
|
1716
|
+
configuredLanguages.forEach((language) => {
|
|
1717
|
+
if (language !== target.language) {
|
|
1552
1718
|
context.addIssue({
|
|
1553
1719
|
code: "custom",
|
|
1554
|
-
message
|
|
1555
|
-
path: ["
|
|
1720
|
+
message: `generation.language.${language} does not match target language "${target.language}"`,
|
|
1721
|
+
path: ["generation", "language", language]
|
|
1556
1722
|
});
|
|
1557
1723
|
}
|
|
1558
1724
|
});
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1725
|
+
if (output.publish && !publishRegistryLanguages[output.publish.registry].some(
|
|
1726
|
+
(language) => language === target.language
|
|
1727
|
+
)) {
|
|
1562
1728
|
context.addIssue({
|
|
1563
1729
|
code: "custom",
|
|
1564
|
-
message: `
|
|
1565
|
-
path: ["
|
|
1730
|
+
message: `registry "${output.publish.registry}" is not supported for target language "${target.language}"`,
|
|
1731
|
+
path: ["output", "publish", "registry"]
|
|
1566
1732
|
});
|
|
1567
1733
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
}
|
|
1578
|
-
if (output.publish) {
|
|
1579
|
-
validatePublishingIdentity(packageConfig, output.publish.registry, context);
|
|
1580
|
-
if (output.delivery !== "github" && output.publish.shouldGeneratePublishWorkflow === true) {
|
|
1581
|
-
context.addIssue({
|
|
1582
|
-
code: "custom",
|
|
1583
|
-
message: "output.publish.shouldGeneratePublishWorkflow requires GitHub delivery",
|
|
1584
|
-
path: ["output", "publish", "shouldGeneratePublishWorkflow"]
|
|
1585
|
-
});
|
|
1734
|
+
if (output.publish) {
|
|
1735
|
+
validatePublishingIdentity(packageConfig, output.publish.registry, context);
|
|
1736
|
+
if (output.delivery !== "github" && output.publish.shouldGeneratePublishWorkflow === true) {
|
|
1737
|
+
context.addIssue({
|
|
1738
|
+
code: "custom",
|
|
1739
|
+
message: "output.publish.shouldGeneratePublishWorkflow requires GitHub delivery",
|
|
1740
|
+
path: ["output", "publish", "shouldGeneratePublishWorkflow"]
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1586
1743
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
}
|
|
1744
|
+
validateCliOutput(output, target.language, context);
|
|
1745
|
+
if (compatibility?.legacyInput) {
|
|
1746
|
+
const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
|
|
1747
|
+
if (compatibility.legacyInput.kind !== expectedKind) {
|
|
1748
|
+
context.addIssue({
|
|
1749
|
+
code: "custom",
|
|
1750
|
+
message: `compatibility.legacyInput kind "${compatibility.legacyInput.kind}" does not match target.sourceOrigin "${target.sourceOrigin}"`,
|
|
1751
|
+
path: ["compatibility", "legacyInput", "kind"]
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1597
1754
|
}
|
|
1598
1755
|
}
|
|
1599
|
-
|
|
1756
|
+
);
|
|
1600
1757
|
function parseSdkConfigIrV1(value) {
|
|
1601
1758
|
return sdkConfigIrV1Schema.parse(value);
|
|
1602
1759
|
}
|
|
@@ -1746,6 +1903,6 @@ function parseSdkConfigIrV1ForConsumption(value) {
|
|
|
1746
1903
|
return parseSdkConfigIrV1(stripUnknownProperties(value, sdkConfigIrV1InputJsonSchema));
|
|
1747
1904
|
}
|
|
1748
1905
|
|
|
1749
|
-
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, parentRelativePathSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, replayConfigSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecOriginSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema, webhookSignatureSchema };
|
|
1906
|
+
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, oauthTokenEndpointsIssues, outputConfigSchema, packageConfigSchema, parentRelativePathSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, replayConfigSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecOriginSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema, webhookSignatureSchema };
|
|
1750
1907
|
//# sourceMappingURL=index.js.map
|
|
1751
1908
|
//# sourceMappingURL=index.js.map
|