@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
package/README.md
CHANGED
|
@@ -187,7 +187,7 @@ For each request target, the API request and matching SDK Config target must agr
|
|
|
187
187
|
- API version, when present
|
|
188
188
|
- generator version, when `generatorVersion` is present in SDK Config
|
|
189
189
|
- every package property included in the API request; the request may omit package properties
|
|
190
|
-
- ZIP output without publication settings, paired with a download request
|
|
190
|
+
- ZIP output without publication settings, paired with a download request. `delivery: local` is an alias of `zip` and is normalized to `zip` on parse.
|
|
191
191
|
|
|
192
192
|
Root package properties are inherited by each target and overridden by target package properties.
|
|
193
193
|
A target output replaces the root output; it is not merged with it.
|
package/dist/index.cjs
CHANGED
|
@@ -140,6 +140,39 @@ var publicClientIdSchema = nonEmptyStringSchema.refine((value) => value.trim() =
|
|
|
140
140
|
}).refine((value) => !value.includes("${"), {
|
|
141
141
|
message: "must be a literal public client ID, not an environment expression"
|
|
142
142
|
});
|
|
143
|
+
var oauthExtraParametersSchema = zod.z.record(zod.z.string().min(1), zod.z.string());
|
|
144
|
+
function parseUrl(value) {
|
|
145
|
+
try {
|
|
146
|
+
return new URL(value);
|
|
147
|
+
} catch {
|
|
148
|
+
return void 0;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
var loopbackRedirectUriSchema = nonEmptyStringSchema.refine(
|
|
152
|
+
(value) => {
|
|
153
|
+
const url = parseUrl(value);
|
|
154
|
+
return url !== void 0 && url.protocol === "http:" && (url.hostname === "127.0.0.1" || url.hostname === "localhost") && url.port !== "";
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
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"
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
function containsControlCharacter(value) {
|
|
161
|
+
return [...value].some((character) => {
|
|
162
|
+
const code = character.charCodeAt(0);
|
|
163
|
+
return code <= 31 || code === 127;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
var hostedPageUrlSchema = nonEmptyStringSchema.refine(
|
|
167
|
+
(value) => {
|
|
168
|
+
const url = parseUrl(value);
|
|
169
|
+
return url !== void 0 && (url.protocol === "http:" || url.protocol === "https:");
|
|
170
|
+
},
|
|
171
|
+
{ message: "must be an absolute http or https URL" }
|
|
172
|
+
).refine((value) => !containsControlCharacter(value), {
|
|
173
|
+
message: "must not contain control characters"
|
|
174
|
+
});
|
|
175
|
+
var redirectPortSchema = zod.z.number().int().min(1).max(65535);
|
|
143
176
|
var oauthFlowSchema = zod.z.discriminatedUnion("type", [
|
|
144
177
|
zod.z.strictObject({
|
|
145
178
|
type: zod.z.literal("authorization-code").describe("Uses the OAuth authorization code flow."),
|
|
@@ -149,7 +182,25 @@ var oauthFlowSchema = zod.z.discriminatedUnion("type", [
|
|
|
149
182
|
scopes: zod.z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow."),
|
|
150
183
|
clientId: publicClientIdSchema.optional().describe(
|
|
151
184
|
"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."
|
|
152
|
-
)
|
|
185
|
+
),
|
|
186
|
+
redirectUri: loopbackRedirectUriSchema.optional().describe(
|
|
187
|
+
"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."
|
|
188
|
+
),
|
|
189
|
+
redirectUriBackupPorts: zod.z.array(redirectPortSchema).min(1).optional().describe(
|
|
190
|
+
"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."
|
|
191
|
+
),
|
|
192
|
+
successRedirectUrl: hostedPageUrlSchema.optional().describe(
|
|
193
|
+
"A page the browser is sent to once the login captured the authorization code. Without it the login shows its own page."
|
|
194
|
+
),
|
|
195
|
+
errorRedirectUrl: hostedPageUrlSchema.optional().describe(
|
|
196
|
+
"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."
|
|
197
|
+
),
|
|
198
|
+
authorizationParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the authorization request, such as audience."),
|
|
199
|
+
tokenParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the authorization code exchange request."),
|
|
200
|
+
refreshParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the token refresh request.")
|
|
201
|
+
}).refine((flow) => flow.redirectUriBackupPorts === void 0 || flow.redirectUri !== void 0, {
|
|
202
|
+
message: "redirectUriBackupPorts requires redirectUri",
|
|
203
|
+
path: ["redirectUriBackupPorts"]
|
|
153
204
|
}),
|
|
154
205
|
zod.z.strictObject({
|
|
155
206
|
type: zod.z.literal("client-credentials").describe("Uses the OAuth client credentials flow."),
|
|
@@ -168,21 +219,47 @@ var oauthFlowSchema = zod.z.discriminatedUnion("type", [
|
|
|
168
219
|
tokenUrl: nonEmptyStringSchema.describe("The URL used to obtain access tokens."),
|
|
169
220
|
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
170
221
|
scopes: zod.z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
|
|
222
|
+
}),
|
|
223
|
+
zod.z.strictObject({
|
|
224
|
+
type: zod.z.literal("device-code").describe(
|
|
225
|
+
"Uses the OAuth device authorization flow (RFC 8628) for logins without a browser."
|
|
226
|
+
),
|
|
227
|
+
clientId: publicClientIdSchema.describe(
|
|
228
|
+
"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."
|
|
229
|
+
),
|
|
230
|
+
deviceAuthorizationUrl: nonEmptyStringSchema.describe(
|
|
231
|
+
"The URL that issues the device code, the user code and the verification URL."
|
|
232
|
+
),
|
|
233
|
+
tokenUrl: nonEmptyStringSchema.describe(
|
|
234
|
+
"The URL polled to exchange the device code for tokens once the user approved."
|
|
235
|
+
),
|
|
236
|
+
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
237
|
+
scopes: zod.z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow."),
|
|
238
|
+
deviceAuthorizationParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the device authorization request, such as audience."),
|
|
239
|
+
tokenParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the token polling request."),
|
|
240
|
+
refreshParameters: oauthExtraParametersSchema.optional().describe("Extra parameters added to the token refresh request.")
|
|
171
241
|
})
|
|
172
242
|
]);
|
|
173
|
-
var
|
|
243
|
+
var oauth2AuthObjectSchema = zod.z.strictObject({
|
|
174
244
|
id: nonEmptyStringSchema.describe("A unique identifier for this authentication scheme."),
|
|
175
245
|
type: zod.z.literal("oauth2").describe("Identifies an OAuth 2.0 authentication scheme."),
|
|
176
246
|
flows: zod.z.array(oauthFlowSchema).min(1).describe("The OAuth flows supported by the API."),
|
|
177
247
|
clientId: authVariableSchema.optional().describe("The OAuth client ID parameter exposed by the SDK."),
|
|
178
248
|
clientSecret: authVariableSchema.optional().describe("The OAuth client secret parameter exposed by the SDK."),
|
|
179
249
|
tokenHeader: nonEmptyStringSchema.optional().describe("The request header that carries the OAuth access token."),
|
|
180
|
-
tokenPrefix: nonEmptyStringSchema.optional().describe(
|
|
250
|
+
tokenPrefix: nonEmptyStringSchema.optional().describe('The prefix added before the OAuth access token. Defaults to "Bearer" when omitted.'),
|
|
251
|
+
omitTokenPrefix: zod.z.boolean().optional().describe(
|
|
252
|
+
'Whether the OAuth access token is sent as-is, with no prefix. Without it, a missing tokenPrefix means "Bearer". Cannot be combined with tokenPrefix.'
|
|
253
|
+
),
|
|
181
254
|
refreshBufferSeconds: zod.z.number().nonnegative().optional().describe("How early, in seconds, the client refreshes a token before it expires."),
|
|
182
255
|
description: zod.z.string().optional().describe(
|
|
183
256
|
"A description of the authentication scheme included in generated SDK documentation."
|
|
184
257
|
)
|
|
185
258
|
});
|
|
259
|
+
var oauth2AuthSchema = oauth2AuthObjectSchema.refine(
|
|
260
|
+
(scheme) => !(scheme.omitTokenPrefix === true && scheme.tokenPrefix !== void 0),
|
|
261
|
+
{ message: "omitTokenPrefix cannot be combined with tokenPrefix", path: ["omitTokenPrefix"] }
|
|
262
|
+
);
|
|
186
263
|
var customAuthParameterSchema = zod.z.strictObject({
|
|
187
264
|
location: zod.z.enum(["header", "query", "cookie"]).describe("Where the custom authentication value is sent."),
|
|
188
265
|
name: nonEmptyStringSchema.describe("The header, query parameter, or cookie name."),
|
|
@@ -838,6 +915,9 @@ var RESERVED_PROFILES_COMMAND_NAMES = /* @__PURE__ */ new Set([
|
|
|
838
915
|
var binaryNameSchema = nonEmptyStringSchema.regex(ALPHANUMERIC_PATTERN, {
|
|
839
916
|
message: "binaryName must contain at least one ASCII letter or digit"
|
|
840
917
|
});
|
|
918
|
+
var crateNameSchema = zod.z.string().regex(/^[A-Za-z][A-Za-z0-9_-]{0,63}$/, {
|
|
919
|
+
message: "crateName must start with a letter, contain only letters, digits, hyphens, and underscores, and be at most 64 characters"
|
|
920
|
+
});
|
|
841
921
|
var rootGroupSchema = zod.z.string().regex(ROOT_GROUP_PATTERN, {
|
|
842
922
|
message: "rootGroup must start with a lowercase letter and contain only lowercase letters, digits, hyphens, and underscores"
|
|
843
923
|
});
|
|
@@ -902,17 +982,78 @@ var profilesConfigSchema = zod.z.strictObject({
|
|
|
902
982
|
revokeOperation: dottedCommandPathSchema("profiles.revokeOperation").optional().describe('The dotted command path called by "profiles remove --revoke".'),
|
|
903
983
|
provisionOperation: profilesProvisionOperationSchema.optional().describe('The operation called by "profiles create --provision" and its response mapping.')
|
|
904
984
|
});
|
|
985
|
+
var oauthPropertyPathSchema = zod.z.string().regex(FIELD_NAME_PATTERN, {
|
|
986
|
+
message: 'must be a property name, or a dotted path to a nested property, such as "data.token"'
|
|
987
|
+
}).regex(/^[^.]+(\.[^.]+)*$/, { message: "must not have an empty path segment" });
|
|
988
|
+
var oauthTokenRequestPropertiesSchema = zod.z.strictObject({
|
|
989
|
+
clientId: oauthPropertyPathSchema.optional().describe('The request property that carries the client ID. Defaults to "client_id".'),
|
|
990
|
+
clientSecret: oauthPropertyPathSchema.optional().describe('The request property that carries the client secret. Defaults to "client_secret".'),
|
|
991
|
+
scopes: oauthPropertyPathSchema.optional().describe('The request property that carries the scopes. Defaults to "scope".')
|
|
992
|
+
});
|
|
993
|
+
var oauthTokenResponsePropertiesSchema = zod.z.strictObject({
|
|
994
|
+
accessToken: oauthPropertyPathSchema.optional().describe('The response property that holds the access token. Defaults to "access_token".'),
|
|
995
|
+
expiresIn: oauthPropertyPathSchema.optional().describe(
|
|
996
|
+
'The response property that holds the lifetime in seconds. Defaults to "expires_in".'
|
|
997
|
+
),
|
|
998
|
+
refreshToken: oauthPropertyPathSchema.optional().describe('The response property that holds the refresh token. Defaults to "refresh_token".')
|
|
999
|
+
});
|
|
1000
|
+
var oauthTokenEndpointsSchema = zod.z.strictObject({
|
|
1001
|
+
token: zod.z.strictObject({
|
|
1002
|
+
requestProperties: oauthTokenRequestPropertiesSchema.optional().describe("The names of the properties of the token request."),
|
|
1003
|
+
responseProperties: oauthTokenResponsePropertiesSchema.optional().describe("The names of the properties of the token response.")
|
|
1004
|
+
}).optional().describe("The token endpoint of the client credentials flow (its tokenUrl)."),
|
|
1005
|
+
refresh: zod.z.strictObject({
|
|
1006
|
+
requestProperties: zod.z.strictObject({
|
|
1007
|
+
refreshToken: oauthPropertyPathSchema.optional().describe(
|
|
1008
|
+
'The request property that carries the refresh token. Defaults to "refresh_token".'
|
|
1009
|
+
)
|
|
1010
|
+
}).optional().describe("The names of the properties of the refresh request."),
|
|
1011
|
+
responseProperties: oauthTokenResponsePropertiesSchema.optional().describe("The names of the properties of the refresh response.")
|
|
1012
|
+
}).optional().describe("The refresh endpoint of the client credentials flow (its refreshUrl).")
|
|
1013
|
+
});
|
|
1014
|
+
function oauthTokenEndpointsIssues(oauthTokenEndpoints, schemes, basePath) {
|
|
1015
|
+
const flowsById = /* @__PURE__ */ new Map();
|
|
1016
|
+
for (const scheme of schemes ?? []) {
|
|
1017
|
+
const flow = scheme.type === "oauth2" ? scheme.flows?.find((f) => f.type === "client-credentials") : void 0;
|
|
1018
|
+
if (flow !== void 0) {
|
|
1019
|
+
flowsById.set(scheme.id, flow);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
return Object.entries(oauthTokenEndpoints ?? {}).flatMap(([id, endpoints]) => {
|
|
1023
|
+
const flow = flowsById.get(id);
|
|
1024
|
+
if (flow === void 0) {
|
|
1025
|
+
return [
|
|
1026
|
+
{
|
|
1027
|
+
message: `oauthTokenEndpoints "${id}" must name an OAuth scheme with a client-credentials flow`,
|
|
1028
|
+
path: [...basePath, id]
|
|
1029
|
+
}
|
|
1030
|
+
];
|
|
1031
|
+
}
|
|
1032
|
+
return endpoints.refresh !== void 0 && flow.refreshUrl === void 0 ? [
|
|
1033
|
+
{
|
|
1034
|
+
message: `oauthTokenEndpoints "${id}" has refresh settings, but its flow has no refreshUrl`,
|
|
1035
|
+
path: [...basePath, id, "refresh"]
|
|
1036
|
+
}
|
|
1037
|
+
] : [];
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
905
1040
|
var cliGenerationConfigSchema = zod.z.strictObject({
|
|
906
1041
|
paginationParameters: zod.z.array(nonEmptyStringSchema).optional().describe("Request parameter names treated as pagination controls by the CLI."),
|
|
907
1042
|
skills: zod.z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands."),
|
|
908
1043
|
binaryName: binaryNameSchema.optional().describe(
|
|
909
1044
|
"The CLI executable name. The generator kebab-cases it and also uses it for the source directory and env-var prefix."
|
|
910
1045
|
),
|
|
1046
|
+
crateName: crateNameSchema.optional().describe(
|
|
1047
|
+
"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."
|
|
1048
|
+
),
|
|
911
1049
|
customCommands: zod.z.boolean().optional().describe("Whether hand-written command support is generated. The generator defaults to true."),
|
|
912
1050
|
rootGroup: rootGroupSchema.optional().describe("A command group that every spec-derived command is nested under."),
|
|
913
1051
|
profiles: profilesConfigSchema.optional().describe("Named profile command configuration."),
|
|
914
1052
|
splitTypeCrates: zod.z.boolean().optional().describe("Whether generated types are split into one crate per API behind a facade crate."),
|
|
915
|
-
userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.')
|
|
1053
|
+
userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.'),
|
|
1054
|
+
oauthTokenEndpoints: zod.z.record(nonEmptyStringSchema, oauthTokenEndpointsSchema).optional().describe(
|
|
1055
|
+
"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."
|
|
1056
|
+
)
|
|
916
1057
|
});
|
|
917
1058
|
|
|
918
1059
|
// src/sdk-config/v1/fern-config-mapper-cli.ts
|
|
@@ -2462,6 +2603,12 @@ var zipOutputSchema = zod.z.strictObject({
|
|
|
2462
2603
|
fileName: nonEmptyStringSchema.optional().describe("The generated ZIP archive file name."),
|
|
2463
2604
|
publish: sdkConfigV1PublishConfigSchema.optional().describe("Optional package registry publication.")
|
|
2464
2605
|
});
|
|
2606
|
+
var localAliasOutputSchema = zipOutputSchema.extend({
|
|
2607
|
+
delivery: zod.z.literal("local").describe('Alias of "zip": the package on the local machine.')
|
|
2608
|
+
}).transform(normalizeLocalDelivery);
|
|
2609
|
+
function normalizeLocalDelivery(output) {
|
|
2610
|
+
return { ...output, delivery: "zip" };
|
|
2611
|
+
}
|
|
2465
2612
|
var githubDeliverySchema = zod.z.strictObject({
|
|
2466
2613
|
delivery: zod.z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
2467
2614
|
github: githubOutputSchema.describe("GitHub repository delivery settings."),
|
|
@@ -2469,8 +2616,8 @@ var githubDeliverySchema = zod.z.strictObject({
|
|
|
2469
2616
|
});
|
|
2470
2617
|
var sdkConfigV1OutputConfigSchema = zod.z.discriminatedUnion(
|
|
2471
2618
|
"delivery",
|
|
2472
|
-
[filesOutputSchema, zipOutputSchema, githubDeliverySchema],
|
|
2473
|
-
{ error: 'output.delivery must be one of "files", "zip", or "github"' }
|
|
2619
|
+
[filesOutputSchema, zipOutputSchema, githubDeliverySchema, localAliasOutputSchema],
|
|
2620
|
+
{ error: 'output.delivery must be one of "files", "zip", "local", or "github"' }
|
|
2474
2621
|
);
|
|
2475
2622
|
var hostedOutputSchema = zod.z.strictObject({
|
|
2476
2623
|
delivery: zod.z.literal("hosted").describe("Deploys the generated MCP server to Fern-hosted infrastructure."),
|
|
@@ -2480,8 +2627,14 @@ var hostedOutputSchema = zod.z.strictObject({
|
|
|
2480
2627
|
});
|
|
2481
2628
|
var sdkConfigV1McpOutputConfigSchema = zod.z.discriminatedUnion(
|
|
2482
2629
|
"delivery",
|
|
2483
|
-
[
|
|
2484
|
-
|
|
2630
|
+
[
|
|
2631
|
+
filesOutputSchema,
|
|
2632
|
+
zipOutputSchema,
|
|
2633
|
+
githubDeliverySchema,
|
|
2634
|
+
hostedOutputSchema,
|
|
2635
|
+
localAliasOutputSchema
|
|
2636
|
+
],
|
|
2637
|
+
{ error: 'output.delivery must be one of "files", "zip", "local", "github", or "hosted"' }
|
|
2485
2638
|
);
|
|
2486
2639
|
var cliDistributionShape = {
|
|
2487
2640
|
distribution: cliDistributionConfigSchema.optional().describe(
|
|
@@ -2502,9 +2655,10 @@ var sdkConfigV1CliOutputConfigSchema = zod.z.discriminatedUnion(
|
|
|
2502
2655
|
[
|
|
2503
2656
|
filesOutputSchema.extend(cliDistributionShape).superRefine(rejectDistributionWithoutGithub),
|
|
2504
2657
|
zipOutputSchema.extend(cliDistributionShape).superRefine(rejectDistributionWithoutGithub),
|
|
2505
|
-
githubDeliverySchema.extend(cliDistributionShape)
|
|
2658
|
+
githubDeliverySchema.extend(cliDistributionShape),
|
|
2659
|
+
localAliasOutputSchema.in.extend(cliDistributionShape).superRefine(rejectDistributionWithoutGithub).transform(normalizeLocalDelivery)
|
|
2506
2660
|
],
|
|
2507
|
-
{ error: 'output.delivery must be one of "files", "zip", or "github"' }
|
|
2661
|
+
{ error: 'output.delivery must be one of "files", "zip", "local", or "github"' }
|
|
2508
2662
|
);
|
|
2509
2663
|
var sdkConfigV1ReplayConfigSchema = zod.z.strictObject({
|
|
2510
2664
|
enabled: zod.z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
|
|
@@ -3042,7 +3196,7 @@ var sdkConfigV1Schema = zod.z.strictObject({
|
|
|
3042
3196
|
docs: sdkConfigV1DocsConfigSchema.prefault({}).describe("Documentation settings inherited by every target."),
|
|
3043
3197
|
generation: sdkConfigV1GenerationConfigSchema.prefault({}).describe("Generation settings inherited by every target."),
|
|
3044
3198
|
targets: zod.z.array(sdkConfigV1TargetSchema).min(1).describe("Language targets to generate; each language may appear once.")
|
|
3045
|
-
}).superRefine(({ output, package: globalPackage, targets }, context) => {
|
|
3199
|
+
}).superRefine(({ api, output, package: globalPackage, targets }, context) => {
|
|
3046
3200
|
const configuredLanguages = /* @__PURE__ */ new Set();
|
|
3047
3201
|
targets.forEach((target, targetIndex) => {
|
|
3048
3202
|
if (configuredLanguages.has(target.language)) {
|
|
@@ -3054,6 +3208,14 @@ var sdkConfigV1Schema = zod.z.strictObject({
|
|
|
3054
3208
|
}
|
|
3055
3209
|
configuredLanguages.add(target.language);
|
|
3056
3210
|
validateTargetPublishing(target, targetIndex, globalPackage, output, context);
|
|
3211
|
+
if (target.language === "cli") {
|
|
3212
|
+
oauthTokenEndpointsIssues(target.generation?.oauthTokenEndpoints, api.auth?.schemes, [
|
|
3213
|
+
"targets",
|
|
3214
|
+
targetIndex,
|
|
3215
|
+
"generation",
|
|
3216
|
+
"oauthTokenEndpoints"
|
|
3217
|
+
]).forEach((issue) => context.addIssue({ code: "custom", ...issue }));
|
|
3218
|
+
}
|
|
3057
3219
|
});
|
|
3058
3220
|
});
|
|
3059
3221
|
function validateSdkConfigV1(value) {
|
|
@@ -4706,6 +4868,14 @@ var zipOutputSchema2 = zod.z.strictObject({
|
|
|
4706
4868
|
...distributionShape,
|
|
4707
4869
|
...credentialResolutionShape
|
|
4708
4870
|
});
|
|
4871
|
+
var localAliasOutputSchema2 = zipOutputSchema2.extend({
|
|
4872
|
+
delivery: zod.z.literal("local").describe('Alias of "zip": the package on the local machine.')
|
|
4873
|
+
}).transform(
|
|
4874
|
+
(output) => ({
|
|
4875
|
+
...output,
|
|
4876
|
+
delivery: "zip"
|
|
4877
|
+
})
|
|
4878
|
+
);
|
|
4709
4879
|
var githubDeliverySchema2 = zod.z.strictObject({
|
|
4710
4880
|
delivery: zod.z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
4711
4881
|
github: githubOutputSchema2.describe("GitHub repository delivery settings."),
|
|
@@ -4715,9 +4885,9 @@ var githubDeliverySchema2 = zod.z.strictObject({
|
|
|
4715
4885
|
});
|
|
4716
4886
|
var outputConfigSchema = zod.z.discriminatedUnion(
|
|
4717
4887
|
"delivery",
|
|
4718
|
-
[filesOutputSchema2, zipOutputSchema2, githubDeliverySchema2],
|
|
4888
|
+
[filesOutputSchema2, zipOutputSchema2, githubDeliverySchema2, localAliasOutputSchema2],
|
|
4719
4889
|
{
|
|
4720
|
-
error: 'output.delivery must be one of "files", "zip", or "github"'
|
|
4890
|
+
error: 'output.delivery must be one of "files", "zip", "local", or "github"'
|
|
4721
4891
|
}
|
|
4722
4892
|
);
|
|
4723
4893
|
var replayConfigSchema = zod.z.strictObject({
|
|
@@ -4898,63 +5068,71 @@ var sdkConfigIrV1Schema = zod.z.strictObject({
|
|
|
4898
5068
|
"Shared and language-specific generation behavior."
|
|
4899
5069
|
),
|
|
4900
5070
|
compatibility: compatibilityConfigSchema.optional().describe("Temporary provenance and diagnostics retained during legacy migration.")
|
|
4901
|
-
}).superRefine(
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
[
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
5071
|
+
}).superRefine(
|
|
5072
|
+
({ api, compatibility, generation, output, package: packageConfig, target }, context) => {
|
|
5073
|
+
const configuredLanguages = Object.keys(generation.language ?? {});
|
|
5074
|
+
const requiresExternalPublishIdentity = output.delivery === "github" || output.publish !== void 0;
|
|
5075
|
+
if (requiresExternalPublishIdentity) {
|
|
5076
|
+
[
|
|
5077
|
+
["apiName", "target.apiName is required for external publishing"],
|
|
5078
|
+
["organizationName", "target.organizationName is required for external publishing"]
|
|
5079
|
+
].forEach(([field, message]) => {
|
|
5080
|
+
if (!target[field]) {
|
|
5081
|
+
context.addIssue({
|
|
5082
|
+
code: "custom",
|
|
5083
|
+
message,
|
|
5084
|
+
path: ["target", field]
|
|
5085
|
+
});
|
|
5086
|
+
}
|
|
5087
|
+
});
|
|
5088
|
+
}
|
|
5089
|
+
oauthTokenEndpointsIssues(generation.language?.cli?.oauthTokenEndpoints, api.auth?.schemes, [
|
|
5090
|
+
"generation",
|
|
5091
|
+
"language",
|
|
5092
|
+
"cli",
|
|
5093
|
+
"oauthTokenEndpoints"
|
|
5094
|
+
]).forEach((issue) => context.addIssue({ code: "custom", ...issue }));
|
|
5095
|
+
configuredLanguages.forEach((language) => {
|
|
5096
|
+
if (language !== target.language) {
|
|
4910
5097
|
context.addIssue({
|
|
4911
5098
|
code: "custom",
|
|
4912
|
-
message
|
|
4913
|
-
path: ["
|
|
5099
|
+
message: `generation.language.${language} does not match target language "${target.language}"`,
|
|
5100
|
+
path: ["generation", "language", language]
|
|
4914
5101
|
});
|
|
4915
5102
|
}
|
|
4916
5103
|
});
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
5104
|
+
if (output.publish && !publishRegistryLanguages2[output.publish.registry].some(
|
|
5105
|
+
(language) => language === target.language
|
|
5106
|
+
)) {
|
|
4920
5107
|
context.addIssue({
|
|
4921
5108
|
code: "custom",
|
|
4922
|
-
message: `
|
|
4923
|
-
path: ["
|
|
5109
|
+
message: `registry "${output.publish.registry}" is not supported for target language "${target.language}"`,
|
|
5110
|
+
path: ["output", "publish", "registry"]
|
|
4924
5111
|
});
|
|
4925
5112
|
}
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
}
|
|
4936
|
-
if (output.publish) {
|
|
4937
|
-
validatePublishingIdentity2(packageConfig, output.publish.registry, context);
|
|
4938
|
-
if (output.delivery !== "github" && output.publish.shouldGeneratePublishWorkflow === true) {
|
|
4939
|
-
context.addIssue({
|
|
4940
|
-
code: "custom",
|
|
4941
|
-
message: "output.publish.shouldGeneratePublishWorkflow requires GitHub delivery",
|
|
4942
|
-
path: ["output", "publish", "shouldGeneratePublishWorkflow"]
|
|
4943
|
-
});
|
|
5113
|
+
if (output.publish) {
|
|
5114
|
+
validatePublishingIdentity2(packageConfig, output.publish.registry, context);
|
|
5115
|
+
if (output.delivery !== "github" && output.publish.shouldGeneratePublishWorkflow === true) {
|
|
5116
|
+
context.addIssue({
|
|
5117
|
+
code: "custom",
|
|
5118
|
+
message: "output.publish.shouldGeneratePublishWorkflow requires GitHub delivery",
|
|
5119
|
+
path: ["output", "publish", "shouldGeneratePublishWorkflow"]
|
|
5120
|
+
});
|
|
5121
|
+
}
|
|
4944
5122
|
}
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
}
|
|
5123
|
+
validateCliOutput(output, target.language, context);
|
|
5124
|
+
if (compatibility?.legacyInput) {
|
|
5125
|
+
const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
|
|
5126
|
+
if (compatibility.legacyInput.kind !== expectedKind) {
|
|
5127
|
+
context.addIssue({
|
|
5128
|
+
code: "custom",
|
|
5129
|
+
message: `compatibility.legacyInput kind "${compatibility.legacyInput.kind}" does not match target.sourceOrigin "${target.sourceOrigin}"`,
|
|
5130
|
+
path: ["compatibility", "legacyInput", "kind"]
|
|
5131
|
+
});
|
|
5132
|
+
}
|
|
4955
5133
|
}
|
|
4956
5134
|
}
|
|
4957
|
-
|
|
5135
|
+
);
|
|
4958
5136
|
function parseSdkConfigIrV1(value) {
|
|
4959
5137
|
return sdkConfigIrV1Schema.parse(value);
|
|
4960
5138
|
}
|
|
@@ -5022,6 +5200,7 @@ exports.mapFernConfigToSdkConfigV1 = mapFernConfigToSdkConfigV1;
|
|
|
5022
5200
|
exports.mcpAvailabilityStatuses = mcpAvailabilityStatuses;
|
|
5023
5201
|
exports.mcpGenerationConfigSchema = mcpGenerationConfigSchema;
|
|
5024
5202
|
exports.nonEmptyStringSchema = nonEmptyStringSchema;
|
|
5203
|
+
exports.oauthTokenEndpointsIssues = oauthTokenEndpointsIssues;
|
|
5025
5204
|
exports.outputConfigSchema = outputConfigSchema;
|
|
5026
5205
|
exports.packageConfigSchema = packageConfigSchema;
|
|
5027
5206
|
exports.parentRelativePathSchema = parentRelativePathSchema;
|