@postman/sdk-config 0.7.0 → 0.9.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 -3
- package/dist/index.cjs +882 -747
- 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 +882 -747
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +644 -544
- 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 +644 -544
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +644 -544
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +581 -1047
- package/dist/sdk-config/v1/index.d.ts +581 -1047
- package/dist/sdk-config/v1/index.js +644 -544
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +627 -541
- 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 +627 -541
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +627 -541
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +59 -17
- package/dist/sdk-config-ir/v1/index.d.ts +59 -17
- package/dist/sdk-config-ir/v1/index.js +627 -541
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-BdDv_kwT.d.cts → typescript-Chge0X4f.d.cts} +1 -2
- package/dist/{typescript-BdDv_kwT.d.ts → typescript-Chge0X4f.d.ts} +1 -2
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +15 -14
- package/src/sdk-config-ir/v1/README.md +29 -15
package/dist/sdk-config/index.js
CHANGED
|
@@ -32,140 +32,152 @@ var hashAlgorithmSchema = z.enum(["sha1", "sha256", "sha384", "sha512"]);
|
|
|
32
32
|
var encodingSchema = z.enum(["base64", "hex"]);
|
|
33
33
|
var payloadComponentSchema = z.enum(["body", "timestamp", "notification-url", "message-id"]);
|
|
34
34
|
var payloadFormatSchema = z.strictObject({
|
|
35
|
-
components: z.array(payloadComponentSchema).min(1),
|
|
36
|
-
delimiter: z.string().optional(),
|
|
35
|
+
components: z.array(payloadComponentSchema).min(1).describe("Payload components concatenated in declaration order before signing."),
|
|
36
|
+
delimiter: z.string().optional().describe("The delimiter inserted between payload components."),
|
|
37
37
|
/**
|
|
38
38
|
* Set when the body is a form-encoded parameter map that must be canonicalized before signing:
|
|
39
39
|
* keys sorted, each key's values deduped and sorted, concatenated as key-value pairs.
|
|
40
40
|
*/
|
|
41
|
-
bodySort: z.literal("alphabetical").optional()
|
|
41
|
+
bodySort: z.literal("alphabetical").optional().describe("Canonicalizes form body keys and values alphabetically before signing.")
|
|
42
42
|
});
|
|
43
43
|
var timestampSchema = z.strictObject({
|
|
44
|
-
header: nonEmptyStringSchema,
|
|
45
|
-
format: z.enum(["unix-seconds", "unix-millis", "iso8601"]).optional(),
|
|
44
|
+
header: nonEmptyStringSchema.describe("The request header containing the signing timestamp."),
|
|
45
|
+
format: z.enum(["unix-seconds", "unix-millis", "iso8601"]).optional().describe("The timestamp format used in the signature payload."),
|
|
46
46
|
/** Replay window in seconds. */
|
|
47
|
-
tolerance: z.number().positive().optional()
|
|
47
|
+
tolerance: z.number().positive().optional().describe("The maximum accepted timestamp age, in seconds.")
|
|
48
48
|
});
|
|
49
49
|
var bodyHashLocationSchema = z.discriminatedUnion("type", [
|
|
50
50
|
z.strictObject({
|
|
51
|
-
type: z.literal("query-parameter"),
|
|
52
|
-
name: nonEmptyStringSchema
|
|
51
|
+
type: z.literal("query-parameter").describe("Reads the body hash from a query parameter."),
|
|
52
|
+
name: nonEmptyStringSchema.describe("The query parameter containing the body hash.")
|
|
53
53
|
})
|
|
54
54
|
]);
|
|
55
55
|
var bodyHashBindingSchema = z.strictObject({
|
|
56
|
-
algorithm: hashAlgorithmSchema,
|
|
57
|
-
encoding: encodingSchema.optional(),
|
|
58
|
-
location: bodyHashLocationSchema
|
|
56
|
+
algorithm: hashAlgorithmSchema.describe("The hash algorithm applied to the raw request body."),
|
|
57
|
+
encoding: encodingSchema.optional().describe("The encoding used for the body hash."),
|
|
58
|
+
location: bodyHashLocationSchema.describe("Where the expected body hash is read from.")
|
|
59
59
|
});
|
|
60
60
|
var urlNormalizationSchema = z.strictObject({
|
|
61
61
|
/** Try the URL with and without an explicit default port. */
|
|
62
|
-
portVariants: z.boolean().optional(),
|
|
62
|
+
portVariants: z.boolean().optional().describe("Whether verification tries URLs with and without an explicit default port."),
|
|
63
63
|
/** Try the URL with the pre-RFC3986 query encoding (`+` for space, unescaped `*`). */
|
|
64
|
-
legacyQueryEncoding: z.boolean().optional()
|
|
64
|
+
legacyQueryEncoding: z.boolean().optional().describe("Whether verification also tries legacy form-style query encoding.")
|
|
65
65
|
}).refine(
|
|
66
66
|
({ portVariants, legacyQueryEncoding }) => portVariants === true || legacyQueryEncoding === true,
|
|
67
67
|
{ message: "url normalization must enable at least one variant" }
|
|
68
68
|
);
|
|
69
69
|
var webhookSignatureSchema = z.discriminatedUnion("type", [
|
|
70
70
|
z.strictObject({
|
|
71
|
-
type: z.literal("hmac"),
|
|
71
|
+
type: z.literal("hmac").describe("Identifies HMAC webhook signature verification."),
|
|
72
72
|
/** Request header carrying the signature. */
|
|
73
|
-
header: nonEmptyStringSchema,
|
|
74
|
-
algorithm: hashAlgorithmSchema.optional(),
|
|
75
|
-
encoding: encodingSchema.optional(),
|
|
73
|
+
header: nonEmptyStringSchema.describe("The request header containing the signature."),
|
|
74
|
+
algorithm: hashAlgorithmSchema.optional().describe("The HMAC hash algorithm."),
|
|
75
|
+
encoding: encodingSchema.optional().describe("The encoding used for the HMAC signature."),
|
|
76
76
|
/** Stripped from the header value before comparison, e.g. `sha256=`. */
|
|
77
|
-
signaturePrefix: z.string().optional(),
|
|
78
|
-
payloadFormat: payloadFormatSchema.optional(),
|
|
79
|
-
timestamp: timestampSchema.optional(),
|
|
80
|
-
bodyHashBinding: bodyHashBindingSchema.optional(),
|
|
81
|
-
urlNormalization: urlNormalizationSchema.optional()
|
|
77
|
+
signaturePrefix: z.string().optional().describe("A prefix removed from the signature header before comparison."),
|
|
78
|
+
payloadFormat: payloadFormatSchema.optional().describe("How the payload signed by the provider is assembled."),
|
|
79
|
+
timestamp: timestampSchema.optional().describe("Timestamp validation included in signature verification."),
|
|
80
|
+
bodyHashBinding: bodyHashBindingSchema.optional().describe("A separately transmitted hash that binds the raw body to the signed payload."),
|
|
81
|
+
urlNormalization: urlNormalizationSchema.optional().describe("Alternate notification URL forms accepted during verification.")
|
|
82
82
|
})
|
|
83
83
|
]);
|
|
84
84
|
|
|
85
85
|
// src/sdk-config-domain/v1/api.ts
|
|
86
86
|
var authVariableSchema = z.strictObject({
|
|
87
|
-
name: nonEmptyStringSchema.optional(),
|
|
88
|
-
environmentVariable: nonEmptyStringSchema.optional(),
|
|
89
|
-
description: z.string().optional()
|
|
90
|
-
|
|
87
|
+
name: nonEmptyStringSchema.optional().describe("The parameter name exposed by the SDK."),
|
|
88
|
+
environmentVariable: nonEmptyStringSchema.optional().describe("The environment variable used to populate the parameter."),
|
|
89
|
+
description: z.string().optional().describe(
|
|
90
|
+
"A description of the authentication parameter included in generated SDK documentation."
|
|
91
|
+
),
|
|
92
|
+
omit: z.boolean().optional().describe("Whether the parameter is omitted from the SDK surface.")
|
|
91
93
|
});
|
|
92
94
|
var apiKeyAuthSchema = z.strictObject({
|
|
93
|
-
id: nonEmptyStringSchema,
|
|
94
|
-
type: z.literal("api-key"),
|
|
95
|
-
location: z.enum(["header", "query", "cookie"]),
|
|
96
|
-
name: nonEmptyStringSchema,
|
|
97
|
-
prefix: nonEmptyStringSchema.optional(),
|
|
98
|
-
environmentVariable: nonEmptyStringSchema.optional(),
|
|
99
|
-
description: z.string().optional()
|
|
95
|
+
id: nonEmptyStringSchema.describe("A unique identifier for this authentication scheme."),
|
|
96
|
+
type: z.literal("api-key").describe("Identifies an API key authentication scheme."),
|
|
97
|
+
location: z.enum(["header", "query", "cookie"]).describe("Where the API key is sent on requests."),
|
|
98
|
+
name: nonEmptyStringSchema.describe("The header, query parameter, or cookie name."),
|
|
99
|
+
prefix: nonEmptyStringSchema.optional().describe("A prefix added before the API key value."),
|
|
100
|
+
environmentVariable: nonEmptyStringSchema.optional().describe("The default environment variable for the API key."),
|
|
101
|
+
description: z.string().optional().describe(
|
|
102
|
+
"A description of the authentication scheme included in generated SDK documentation."
|
|
103
|
+
)
|
|
100
104
|
});
|
|
101
105
|
var bearerAuthSchema = z.strictObject({
|
|
102
|
-
id: nonEmptyStringSchema,
|
|
103
|
-
type: z.literal("bearer"),
|
|
104
|
-
header: nonEmptyStringSchema.optional(),
|
|
105
|
-
prefix: nonEmptyStringSchema.optional(),
|
|
106
|
-
environmentVariable: nonEmptyStringSchema.optional(),
|
|
107
|
-
description: z.string().optional()
|
|
106
|
+
id: nonEmptyStringSchema.describe("A unique identifier for this authentication scheme."),
|
|
107
|
+
type: z.literal("bearer").describe("Identifies a bearer token authentication scheme."),
|
|
108
|
+
header: nonEmptyStringSchema.optional().describe("The request header that carries the bearer token."),
|
|
109
|
+
prefix: nonEmptyStringSchema.optional().describe('The token prefix, such as "Bearer".'),
|
|
110
|
+
environmentVariable: nonEmptyStringSchema.optional().describe("The default environment variable for the bearer token."),
|
|
111
|
+
description: z.string().optional().describe(
|
|
112
|
+
"A description of the authentication scheme included in generated SDK documentation."
|
|
113
|
+
)
|
|
108
114
|
});
|
|
109
115
|
var basicAuthSchema = z.strictObject({
|
|
110
|
-
id: nonEmptyStringSchema,
|
|
111
|
-
type: z.literal("basic"),
|
|
112
|
-
username: authVariableSchema.optional(),
|
|
113
|
-
password: authVariableSchema.optional(),
|
|
114
|
-
description: z.string().optional()
|
|
116
|
+
id: nonEmptyStringSchema.describe("A unique identifier for this authentication scheme."),
|
|
117
|
+
type: z.literal("basic").describe("Identifies an HTTP Basic authentication scheme."),
|
|
118
|
+
username: authVariableSchema.optional().describe("The username parameter exposed by the SDK."),
|
|
119
|
+
password: authVariableSchema.optional().describe("The password parameter exposed by the SDK."),
|
|
120
|
+
description: z.string().optional().describe(
|
|
121
|
+
"A description of the authentication scheme included in generated SDK documentation."
|
|
122
|
+
)
|
|
115
123
|
});
|
|
116
124
|
var oauthScopeSchema = z.strictObject({
|
|
117
|
-
name: nonEmptyStringSchema,
|
|
118
|
-
description: z.string().optional()
|
|
125
|
+
name: nonEmptyStringSchema.describe("The OAuth scope value requested from the provider."),
|
|
126
|
+
description: z.string().optional().describe("A description of the OAuth scope included in generated SDK documentation.")
|
|
119
127
|
});
|
|
120
128
|
var oauthFlowSchema = z.discriminatedUnion("type", [
|
|
121
129
|
z.strictObject({
|
|
122
|
-
type: z.literal("authorization-code"),
|
|
123
|
-
authorizationUrl: nonEmptyStringSchema,
|
|
124
|
-
tokenUrl: nonEmptyStringSchema,
|
|
125
|
-
refreshUrl: nonEmptyStringSchema.optional(),
|
|
126
|
-
scopes: z.array(oauthScopeSchema).optional()
|
|
130
|
+
type: z.literal("authorization-code").describe("Uses the OAuth authorization code flow."),
|
|
131
|
+
authorizationUrl: nonEmptyStringSchema.describe("The URL used to authorize the client."),
|
|
132
|
+
tokenUrl: nonEmptyStringSchema.describe("The URL used to exchange a code for tokens."),
|
|
133
|
+
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
134
|
+
scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
|
|
127
135
|
}),
|
|
128
136
|
z.strictObject({
|
|
129
|
-
type: z.literal("client-credentials"),
|
|
130
|
-
tokenUrl: nonEmptyStringSchema,
|
|
131
|
-
refreshUrl: nonEmptyStringSchema.optional(),
|
|
132
|
-
scopes: z.array(oauthScopeSchema).optional()
|
|
137
|
+
type: z.literal("client-credentials").describe("Uses the OAuth client credentials flow."),
|
|
138
|
+
tokenUrl: nonEmptyStringSchema.describe("The URL used to obtain access tokens."),
|
|
139
|
+
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
140
|
+
scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
|
|
133
141
|
}),
|
|
134
142
|
z.strictObject({
|
|
135
|
-
type: z.literal("implicit"),
|
|
136
|
-
authorizationUrl: nonEmptyStringSchema,
|
|
137
|
-
refreshUrl: nonEmptyStringSchema.optional(),
|
|
138
|
-
scopes: z.array(oauthScopeSchema).optional()
|
|
143
|
+
type: z.literal("implicit").describe("Uses the OAuth implicit flow."),
|
|
144
|
+
authorizationUrl: nonEmptyStringSchema.describe("The URL used to authorize the client."),
|
|
145
|
+
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
146
|
+
scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
|
|
139
147
|
}),
|
|
140
148
|
z.strictObject({
|
|
141
|
-
type: z.literal("password"),
|
|
142
|
-
tokenUrl: nonEmptyStringSchema,
|
|
143
|
-
refreshUrl: nonEmptyStringSchema.optional(),
|
|
144
|
-
scopes: z.array(oauthScopeSchema).optional()
|
|
149
|
+
type: z.literal("password").describe("Uses the OAuth resource owner password flow."),
|
|
150
|
+
tokenUrl: nonEmptyStringSchema.describe("The URL used to obtain access tokens."),
|
|
151
|
+
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
152
|
+
scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
|
|
145
153
|
})
|
|
146
154
|
]);
|
|
147
155
|
var oauth2AuthSchema = z.strictObject({
|
|
148
|
-
id: nonEmptyStringSchema,
|
|
149
|
-
type: z.literal("oauth2"),
|
|
150
|
-
flows: z.array(oauthFlowSchema).min(1),
|
|
151
|
-
clientId: authVariableSchema.optional(),
|
|
152
|
-
clientSecret: authVariableSchema.optional(),
|
|
153
|
-
tokenHeader: nonEmptyStringSchema.optional(),
|
|
154
|
-
tokenPrefix: nonEmptyStringSchema.optional(),
|
|
155
|
-
refreshBufferSeconds: z.number().nonnegative().optional(),
|
|
156
|
-
description: z.string().optional()
|
|
156
|
+
id: nonEmptyStringSchema.describe("A unique identifier for this authentication scheme."),
|
|
157
|
+
type: z.literal("oauth2").describe("Identifies an OAuth 2.0 authentication scheme."),
|
|
158
|
+
flows: z.array(oauthFlowSchema).min(1).describe("The OAuth flows supported by the API."),
|
|
159
|
+
clientId: authVariableSchema.optional().describe("The OAuth client ID parameter exposed by the SDK."),
|
|
160
|
+
clientSecret: authVariableSchema.optional().describe("The OAuth client secret parameter exposed by the SDK."),
|
|
161
|
+
tokenHeader: nonEmptyStringSchema.optional().describe("The request header that carries the OAuth access token."),
|
|
162
|
+
tokenPrefix: nonEmptyStringSchema.optional().describe("The prefix added before the OAuth access token."),
|
|
163
|
+
refreshBufferSeconds: z.number().nonnegative().optional().describe("How early, in seconds, the client refreshes a token before it expires."),
|
|
164
|
+
description: z.string().optional().describe(
|
|
165
|
+
"A description of the authentication scheme included in generated SDK documentation."
|
|
166
|
+
)
|
|
157
167
|
});
|
|
158
168
|
var customAuthParameterSchema = z.strictObject({
|
|
159
|
-
location: z.enum(["header", "query", "cookie"]),
|
|
160
|
-
name: nonEmptyStringSchema,
|
|
161
|
-
prefix: nonEmptyStringSchema.optional(),
|
|
162
|
-
environmentVariable: nonEmptyStringSchema.optional()
|
|
169
|
+
location: z.enum(["header", "query", "cookie"]).describe("Where the custom authentication value is sent."),
|
|
170
|
+
name: nonEmptyStringSchema.describe("The header, query parameter, or cookie name."),
|
|
171
|
+
prefix: nonEmptyStringSchema.optional().describe("A prefix added before the parameter value."),
|
|
172
|
+
environmentVariable: nonEmptyStringSchema.optional().describe("The default environment variable for the parameter.")
|
|
163
173
|
});
|
|
164
174
|
var customAuthSchema = z.strictObject({
|
|
165
|
-
id: nonEmptyStringSchema,
|
|
166
|
-
type: z.literal("custom"),
|
|
167
|
-
parameters: z.array(customAuthParameterSchema).min(1),
|
|
168
|
-
description: z.string().optional()
|
|
175
|
+
id: nonEmptyStringSchema.describe("A unique identifier for this authentication scheme."),
|
|
176
|
+
type: z.literal("custom").describe("Identifies a custom authentication scheme."),
|
|
177
|
+
parameters: z.array(customAuthParameterSchema).min(1).describe("The request parameters that implement the custom scheme."),
|
|
178
|
+
description: z.string().optional().describe(
|
|
179
|
+
"A description of the authentication scheme included in generated SDK documentation."
|
|
180
|
+
)
|
|
169
181
|
});
|
|
170
182
|
var authSchemeSchema = z.discriminatedUnion("type", [
|
|
171
183
|
apiKeyAuthSchema,
|
|
@@ -175,12 +187,12 @@ var authSchemeSchema = z.discriminatedUnion("type", [
|
|
|
175
187
|
customAuthSchema
|
|
176
188
|
]);
|
|
177
189
|
var authRequirementSchema = z.strictObject({
|
|
178
|
-
schemes: z.array(nonEmptyStringSchema).min(1)
|
|
190
|
+
schemes: z.array(nonEmptyStringSchema).min(1).describe("Scheme identifiers that must be satisfied together.")
|
|
179
191
|
});
|
|
180
192
|
var authConfigSchema = z.strictObject({
|
|
181
|
-
schemes: z.array(authSchemeSchema).min(1),
|
|
182
|
-
requirements: z.array(authRequirementSchema).optional(),
|
|
183
|
-
endpointSecurity: z.boolean().optional()
|
|
193
|
+
schemes: z.array(authSchemeSchema).min(1).describe("Authentication schemes offered by the API."),
|
|
194
|
+
requirements: z.array(authRequirementSchema).optional().describe("Valid combinations of authentication schemes."),
|
|
195
|
+
endpointSecurity: z.boolean().optional().describe("Whether generated endpoints expose their individual security requirements.")
|
|
184
196
|
}).superRefine(({ requirements, schemes }, context) => {
|
|
185
197
|
const schemeIds = /* @__PURE__ */ new Set();
|
|
186
198
|
schemes.forEach(({ id }, index) => {
|
|
@@ -206,45 +218,45 @@ var authConfigSchema = z.strictObject({
|
|
|
206
218
|
});
|
|
207
219
|
});
|
|
208
220
|
var environmentUrlSchema = z.strictObject({
|
|
209
|
-
name: nonEmptyStringSchema,
|
|
210
|
-
url: nonEmptyStringSchema,
|
|
211
|
-
serverName: nonEmptyStringSchema.optional()
|
|
221
|
+
name: nonEmptyStringSchema.describe("The display name for this environment URL."),
|
|
222
|
+
url: nonEmptyStringSchema.describe("The base URL used for this environment entry."),
|
|
223
|
+
serverName: nonEmptyStringSchema.optional().describe("The source server represented by this URL.")
|
|
212
224
|
});
|
|
213
225
|
var environmentSchema = z.strictObject({
|
|
214
|
-
name: nonEmptyStringSchema,
|
|
215
|
-
urls: z.array(environmentUrlSchema).min(1),
|
|
216
|
-
description: z.string().optional()
|
|
226
|
+
name: nonEmptyStringSchema.describe("The environment name exposed by the SDK."),
|
|
227
|
+
urls: z.array(environmentUrlSchema).min(1).describe("The base URLs available in this environment."),
|
|
228
|
+
description: z.string().optional().describe("A description of the environment included in generated SDK documentation.")
|
|
217
229
|
});
|
|
218
230
|
var headerSchema = z.strictObject({
|
|
219
|
-
name: nonEmptyStringSchema,
|
|
220
|
-
value: z.string().optional(),
|
|
221
|
-
description: z.string().optional(),
|
|
222
|
-
environmentVariable: nonEmptyStringSchema.optional()
|
|
231
|
+
name: nonEmptyStringSchema.describe("The HTTP header name."),
|
|
232
|
+
value: z.string().optional().describe("A fixed value for the generated header."),
|
|
233
|
+
description: z.string().optional().describe("A description of the header included in generated SDK documentation."),
|
|
234
|
+
environmentVariable: nonEmptyStringSchema.optional().describe("The environment variable used to populate the header.")
|
|
223
235
|
});
|
|
224
236
|
var environmentVariableSchema = z.strictObject({
|
|
225
|
-
name: nonEmptyStringSchema,
|
|
226
|
-
description: z.string().optional(),
|
|
227
|
-
defaultValue: z.string().optional()
|
|
237
|
+
name: nonEmptyStringSchema.describe("The environment variable name exposed by the SDK."),
|
|
238
|
+
description: z.string().optional().describe("A description of the environment variable included in generated SDK documentation."),
|
|
239
|
+
defaultValue: z.string().optional().describe("The default value used when the variable is unset.")
|
|
228
240
|
});
|
|
229
241
|
var apiConfigSchema = z.strictObject({
|
|
230
|
-
baseUrl: z.string().default(""),
|
|
231
|
-
environments: z.array(environmentSchema).default([]),
|
|
232
|
-
environmentVariables: z.array(environmentVariableSchema).default([]),
|
|
233
|
-
defaultEnvironment: nonEmptyStringSchema.optional(),
|
|
234
|
-
auth: authConfigSchema.optional(),
|
|
235
|
-
headers: z.array(headerSchema).optional(),
|
|
242
|
+
baseUrl: z.string().default("").describe("The default base URL used by the generated client."),
|
|
243
|
+
environments: z.array(environmentSchema).default([]).describe("Named API environments and their base URLs."),
|
|
244
|
+
environmentVariables: z.array(environmentVariableSchema).default([]).describe("Environment variables exposed through generated client configuration."),
|
|
245
|
+
defaultEnvironment: nonEmptyStringSchema.optional().describe("The environment selected when a caller does not choose one."),
|
|
246
|
+
auth: authConfigSchema.optional().describe("Authentication supported by the API."),
|
|
247
|
+
headers: z.array(headerSchema).optional().describe("Headers added to generated API requests."),
|
|
236
248
|
/**
|
|
237
249
|
* Selects the named `x-fern-audiences`.
|
|
238
250
|
*
|
|
239
251
|
* Absent means all audiences. A present empty array selects no tagged audience: untagged nodes
|
|
240
252
|
* remain included, while every audience-tagged node is excluded.
|
|
241
253
|
*/
|
|
242
|
-
audiences: z.array(nonEmptyStringSchema).optional(),
|
|
254
|
+
audiences: z.array(nonEmptyStringSchema).optional().describe("Named API audiences included in the generated SDK."),
|
|
243
255
|
/**
|
|
244
256
|
* How the API signs the webhooks it sends, enabling a generated verification helper. API-wide, and
|
|
245
257
|
* independent of whether any webhook is modeled — see {@link webhookSignatureSchema}.
|
|
246
258
|
*/
|
|
247
|
-
webhookSignature: webhookSignatureSchema.optional()
|
|
259
|
+
webhookSignature: webhookSignatureSchema.optional().describe("How generated helpers verify webhook signatures from the API.")
|
|
248
260
|
});
|
|
249
261
|
|
|
250
262
|
// src/sdk-config/v1/api.ts
|
|
@@ -253,16 +265,16 @@ var sdkConfigV1AuthConfigSchema = authConfigSchema;
|
|
|
253
265
|
var sdkConfigV1ApiConfigSchema = apiConfigSchema;
|
|
254
266
|
var sdkConfigV1WebhookSignatureSchema = webhookSignatureSchema;
|
|
255
267
|
var retryOverrideShape = {
|
|
256
|
-
enabled: z.boolean().optional(),
|
|
257
|
-
maxAttempts: z.number().int().min(1).optional(),
|
|
258
|
-
retryDelayMs: z.number().nonnegative().optional(),
|
|
259
|
-
maxDelayMs: z.number().nonnegative().optional(),
|
|
260
|
-
jitterMs: z.number().nonnegative().optional(),
|
|
261
|
-
backoffFactor: z.number().positive().optional(),
|
|
262
|
-
statusCodes: z.array(z.number().int().min(100).max(599)).optional(),
|
|
263
|
-
methods: z.array(nonEmptyStringSchema).optional(),
|
|
264
|
-
statusCodeProfile: z.enum(["legacy", "recommended"]).optional(),
|
|
265
|
-
maxRetryAfterDelayMs: z.number().nonnegative().optional()
|
|
268
|
+
enabled: z.boolean().optional().describe("Whether the generated client retries failed requests."),
|
|
269
|
+
maxAttempts: z.number().int().min(1).optional().describe("The maximum total request attempts, including the initial attempt."),
|
|
270
|
+
retryDelayMs: z.number().nonnegative().optional().describe("The initial delay between retry attempts, in milliseconds."),
|
|
271
|
+
maxDelayMs: z.number().nonnegative().optional().describe("The maximum backoff delay between attempts, in milliseconds."),
|
|
272
|
+
jitterMs: z.number().nonnegative().optional().describe("The maximum random jitter added to retry delays, in milliseconds."),
|
|
273
|
+
backoffFactor: z.number().positive().optional().describe("The multiplier applied to the delay after each failed attempt."),
|
|
274
|
+
statusCodes: z.array(z.number().int().min(100).max(599)).optional().describe("HTTP status codes that are eligible for retries."),
|
|
275
|
+
methods: z.array(nonEmptyStringSchema).optional().describe("HTTP methods that are eligible for retries."),
|
|
276
|
+
statusCodeProfile: z.enum(["legacy", "recommended"]).optional().describe("The built-in retryable status-code policy."),
|
|
277
|
+
maxRetryAfterDelayMs: z.number().nonnegative().optional().describe("The longest Retry-After delay the client will honor, in milliseconds.")
|
|
266
278
|
};
|
|
267
279
|
function validateRetryDelays({
|
|
268
280
|
maxDelayMs,
|
|
@@ -279,27 +291,29 @@ function validateRetryDelays({
|
|
|
279
291
|
var clientRetryOverrideSchema = z.strictObject(retryOverrideShape).superRefine(validateRetryDelays);
|
|
280
292
|
var retryConfigSchema = z.strictObject({
|
|
281
293
|
...retryOverrideShape,
|
|
282
|
-
enabled: z.boolean().default(true),
|
|
283
|
-
maxAttempts: z.number().int().min(1).default(3),
|
|
284
|
-
retryDelayMs: z.number().nonnegative().default(150),
|
|
285
|
-
maxDelayMs: z.number().nonnegative().default(5e3),
|
|
286
|
-
jitterMs: z.number().nonnegative().default(50),
|
|
287
|
-
backoffFactor: z.number().positive().default(2),
|
|
288
|
-
methods: z.array(nonEmptyStringSchema).default(["GET", "
|
|
289
|
-
maxRetryAfterDelayMs: z.number().nonnegative().default(6e4)
|
|
294
|
+
enabled: z.boolean().default(true).describe("Whether the generated client retries failed requests."),
|
|
295
|
+
maxAttempts: z.number().int().min(1).default(3).describe("The maximum total request attempts, including the initial attempt."),
|
|
296
|
+
retryDelayMs: z.number().nonnegative().default(150).describe("The initial delay between retry attempts, in milliseconds."),
|
|
297
|
+
maxDelayMs: z.number().nonnegative().default(5e3).describe("The maximum backoff delay between attempts, in milliseconds."),
|
|
298
|
+
jitterMs: z.number().nonnegative().default(50).describe("The maximum random jitter added to retry delays, in milliseconds."),
|
|
299
|
+
backoffFactor: z.number().positive().default(2).describe("The multiplier applied to the delay after each failed attempt."),
|
|
300
|
+
methods: z.array(nonEmptyStringSchema).default(["GET", "PUT", "DELETE", "HEAD", "OPTIONS"]).describe("HTTP methods that are eligible for retries."),
|
|
301
|
+
maxRetryAfterDelayMs: z.number().nonnegative().default(6e4).describe("The longest Retry-After delay the client will honor, in milliseconds.")
|
|
290
302
|
}).superRefine(validateRetryDelays);
|
|
291
303
|
var constructorParameterSchema = z.strictObject({
|
|
292
|
-
name: nonEmptyStringSchema,
|
|
293
|
-
example: z.string().optional(),
|
|
294
|
-
description: z.string().optional()
|
|
295
|
-
|
|
304
|
+
name: nonEmptyStringSchema.describe("The parameter name in the generated client constructor."),
|
|
305
|
+
example: z.string().optional().describe("An example value shown in generated documentation."),
|
|
306
|
+
description: z.string().optional().describe(
|
|
307
|
+
"A description of the constructor parameter included in generated SDK documentation."
|
|
308
|
+
),
|
|
309
|
+
required: z.boolean().optional().describe("Whether callers must provide the parameter.")
|
|
296
310
|
});
|
|
297
311
|
var parameterStyleSchema = z.enum(["wrapped", "inline", "language-default"]);
|
|
298
312
|
var tokenRefreshConfigSchema = z.strictObject({
|
|
299
|
-
enabled: z.boolean(),
|
|
300
|
-
endpoint: nonEmptyStringSchema.optional(),
|
|
301
|
-
accessTokenField: nonEmptyStringSchema.optional(),
|
|
302
|
-
refreshTokenField: nonEmptyStringSchema.optional()
|
|
313
|
+
enabled: z.boolean().describe("Whether the client can exchange refresh tokens."),
|
|
314
|
+
endpoint: nonEmptyStringSchema.optional().describe("The API endpoint used to refresh tokens."),
|
|
315
|
+
accessTokenField: nonEmptyStringSchema.optional().describe("The response field containing the refreshed access token."),
|
|
316
|
+
refreshTokenField: nonEmptyStringSchema.optional().describe("The response field containing the refreshed refresh token.")
|
|
303
317
|
}).superRefine(({ enabled, endpoint }, context) => {
|
|
304
318
|
if (enabled && endpoint === void 0) {
|
|
305
319
|
context.addIssue({
|
|
@@ -309,27 +323,48 @@ var tokenRefreshConfigSchema = z.strictObject({
|
|
|
309
323
|
});
|
|
310
324
|
}
|
|
311
325
|
});
|
|
326
|
+
var idempotencyKeyGenerationSchema = z.strictObject({
|
|
327
|
+
enabled: z.boolean().describe("Whether the client generates an idempotency key when the caller supplies none."),
|
|
328
|
+
headerName: nonEmptyStringSchema.optional().describe("The header that carries the generated key. Generators default to Idempotency-Key."),
|
|
329
|
+
methods: z.array(nonEmptyStringSchema).optional().describe("HTTP methods that receive a generated key. Generators default to POST and PUT.")
|
|
330
|
+
});
|
|
331
|
+
var userAgentConfigSchema = z.strictObject({
|
|
332
|
+
template: nonEmptyStringSchema.optional().describe(
|
|
333
|
+
"The User-Agent product token, resolved at generation time. Supports the {packageName}, {version}, {language}, {generatorVersion}, {organization}, and {apiName} placeholders."
|
|
334
|
+
),
|
|
335
|
+
includePlatformInfo: z.boolean().optional().describe(
|
|
336
|
+
"Whether the User-Agent carries operating system, architecture, and runtime details, as `{product} ({os}; {arch}) {runtime}/{runtimeVersion}`."
|
|
337
|
+
),
|
|
338
|
+
allowAppInfo: z.boolean().optional().describe(
|
|
339
|
+
"Whether callers can pass application info that is appended to the User-Agent as a `{name}/{version} ({comment})` product token."
|
|
340
|
+
)
|
|
341
|
+
});
|
|
312
342
|
var clientOverrideShape = {
|
|
313
|
-
retry: clientRetryOverrideSchema.optional(),
|
|
314
|
-
responseHeaders: z.boolean().optional(),
|
|
315
|
-
responseValidation: z.boolean().optional(),
|
|
316
|
-
multiTenant: z.boolean().optional(),
|
|
317
|
-
additionalConstructorParameters: z.array(constructorParameterSchema).optional(),
|
|
318
|
-
timeoutMs: z.union([z.number().nonnegative(), z.literal("infinity")]).optional(),
|
|
319
|
-
requestParameterStyle: parameterStyleSchema.optional(),
|
|
320
|
-
pathParameterStyle: parameterStyleSchema.optional(),
|
|
321
|
-
filePropertyStyle: parameterStyleSchema.optional(),
|
|
322
|
-
useDefaultRequestParameterValues: z.boolean().optional(),
|
|
323
|
-
respectOptionalRequestBody: z.boolean().optional(),
|
|
324
|
-
tokenRefresh: tokenRefreshConfigSchema.optional()
|
|
343
|
+
retry: clientRetryOverrideSchema.optional().describe("Retry behavior for generated API requests."),
|
|
344
|
+
responseHeaders: z.boolean().optional().describe("Whether generated operations expose HTTP response headers."),
|
|
345
|
+
responseValidation: z.boolean().optional().describe("Whether the client validates API responses against the schema."),
|
|
346
|
+
multiTenant: z.boolean().optional().describe("Whether the client exposes configuration for tenant-specific API access."),
|
|
347
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).optional().describe("Additional parameters added to the generated client constructor."),
|
|
348
|
+
timeoutMs: z.union([z.number().nonnegative(), z.literal("infinity")]).optional().describe('The default request timeout in milliseconds, or "infinity" for no timeout.'),
|
|
349
|
+
requestParameterStyle: parameterStyleSchema.optional().describe("Whether generated operation parameters are wrapped or passed inline."),
|
|
350
|
+
pathParameterStyle: parameterStyleSchema.optional().describe("Whether generated path parameters are wrapped or passed inline."),
|
|
351
|
+
filePropertyStyle: parameterStyleSchema.optional().describe("Whether generated file properties are wrapped or passed inline."),
|
|
352
|
+
useDefaultRequestParameterValues: z.boolean().optional().describe("Whether schema defaults are applied to omitted request parameters."),
|
|
353
|
+
respectOptionalRequestBody: z.boolean().optional().describe("Whether an optional request body remains optional in generated methods."),
|
|
354
|
+
tokenRefresh: tokenRefreshConfigSchema.optional().describe("Refresh-token behavior for the generated client."),
|
|
355
|
+
idempotencyKeyGeneration: idempotencyKeyGenerationSchema.optional().describe("Automatic idempotency keys on eligible requests."),
|
|
356
|
+
userAgent: userAgentConfigSchema.optional().describe("The User-Agent header the generated client sends."),
|
|
357
|
+
offsetSemantics: z.enum(["item-index", "page-index"]).optional().describe(
|
|
358
|
+
"How an offset-paginated endpoint advances: by the number of items returned, or by one page."
|
|
359
|
+
)
|
|
325
360
|
};
|
|
326
361
|
var clientConfigOverrideSchema = z.strictObject(clientOverrideShape);
|
|
327
362
|
var clientConfigSchema = z.strictObject({
|
|
328
363
|
...clientOverrideShape,
|
|
329
|
-
retry: retryConfigSchema.prefault({}),
|
|
330
|
-
responseHeaders: z.boolean().default(false),
|
|
331
|
-
multiTenant: z.boolean().default(false),
|
|
332
|
-
additionalConstructorParameters: z.array(constructorParameterSchema).default([])
|
|
364
|
+
retry: retryConfigSchema.prefault({}).describe("Retry behavior for generated API requests."),
|
|
365
|
+
responseHeaders: z.boolean().default(false).describe("Whether generated operations expose HTTP response headers."),
|
|
366
|
+
multiTenant: z.boolean().default(false).describe("Whether the client exposes configuration for tenant-specific API access."),
|
|
367
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).default([]).describe("Additional parameters added to the generated client constructor.")
|
|
333
368
|
});
|
|
334
369
|
|
|
335
370
|
// src/sdk-config/v1/client.ts
|
|
@@ -344,75 +379,75 @@ var composerPackageNameSchema = nonEmptyStringSchema.regex(
|
|
|
344
379
|
'Composer package name must be a lowercase "vendor/package" name'
|
|
345
380
|
);
|
|
346
381
|
var authorSchema = z.strictObject({
|
|
347
|
-
name: nonEmptyStringSchema,
|
|
348
|
-
email: z.email().optional(),
|
|
349
|
-
url: nonEmptyStringSchema.optional()
|
|
382
|
+
name: nonEmptyStringSchema.describe("The package author name."),
|
|
383
|
+
email: z.email().optional().describe("The package author email address."),
|
|
384
|
+
url: nonEmptyStringSchema.optional().describe("The package author website.")
|
|
350
385
|
});
|
|
351
386
|
var developerSchema = z.strictObject({
|
|
352
|
-
name: nonEmptyStringSchema,
|
|
353
|
-
email: z.email().optional(),
|
|
354
|
-
organization: nonEmptyStringSchema.optional(),
|
|
355
|
-
organizationUrl: nonEmptyStringSchema.optional()
|
|
387
|
+
name: nonEmptyStringSchema.describe("The package developer name."),
|
|
388
|
+
email: z.email().optional().describe("The package developer email address."),
|
|
389
|
+
organization: nonEmptyStringSchema.optional().describe("The developer organization name."),
|
|
390
|
+
organizationUrl: nonEmptyStringSchema.optional().describe("The developer organization website.")
|
|
356
391
|
});
|
|
357
392
|
var licenseSchema = z.strictObject({
|
|
358
|
-
type: nonEmptyStringSchema,
|
|
359
|
-
name: nonEmptyStringSchema.optional(),
|
|
360
|
-
url: nonEmptyStringSchema.optional(),
|
|
361
|
-
path: nonEmptyStringSchema.optional()
|
|
393
|
+
type: nonEmptyStringSchema.describe("The license identifier or license type."),
|
|
394
|
+
name: nonEmptyStringSchema.optional().describe("The human-readable license name."),
|
|
395
|
+
url: nonEmptyStringSchema.optional().describe("The URL containing the license text."),
|
|
396
|
+
path: nonEmptyStringSchema.optional().describe("The path to a custom license file.")
|
|
362
397
|
});
|
|
363
398
|
var dependencySourceSchema = z.discriminatedUnion("type", [
|
|
364
399
|
z.strictObject({
|
|
365
|
-
type: z.literal("registry"),
|
|
366
|
-
registry: nonEmptyStringSchema.optional()
|
|
400
|
+
type: z.literal("registry").describe("Resolves the dependency from a package registry."),
|
|
401
|
+
registry: nonEmptyStringSchema.optional().describe("The registry used to resolve the dependency.")
|
|
367
402
|
}),
|
|
368
403
|
z.strictObject({
|
|
369
|
-
type: z.literal("git"),
|
|
370
|
-
url: nonEmptyStringSchema,
|
|
371
|
-
ref: nonEmptyStringSchema.optional(),
|
|
372
|
-
subdirectory: nonEmptyStringSchema.optional()
|
|
404
|
+
type: z.literal("git").describe("Resolves the dependency from a Git repository."),
|
|
405
|
+
url: nonEmptyStringSchema.describe("The Git repository URL."),
|
|
406
|
+
ref: nonEmptyStringSchema.optional().describe("The Git branch, tag, or commit to use."),
|
|
407
|
+
subdirectory: nonEmptyStringSchema.optional().describe("The package subdirectory within the Git repository.")
|
|
373
408
|
}),
|
|
374
409
|
z.strictObject({
|
|
375
|
-
type: z.literal("path"),
|
|
376
|
-
path: nonEmptyStringSchema
|
|
410
|
+
type: z.literal("path").describe("Resolves the dependency from a local path."),
|
|
411
|
+
path: nonEmptyStringSchema.describe("The local path containing the dependency.")
|
|
377
412
|
})
|
|
378
413
|
]);
|
|
379
414
|
var dependencySchema = z.strictObject({
|
|
380
|
-
name: nonEmptyStringSchema,
|
|
381
|
-
version: nonEmptyStringSchema.optional(),
|
|
382
|
-
source: dependencySourceSchema.optional(),
|
|
383
|
-
packageName: nonEmptyStringSchema.optional(),
|
|
384
|
-
features: z.array(nonEmptyStringSchema).optional(),
|
|
385
|
-
extras: z.array(nonEmptyStringSchema).optional(),
|
|
386
|
-
optional: z.boolean().optional(),
|
|
387
|
-
defaultFeatures: z.boolean().optional(),
|
|
388
|
-
environmentMarker: nonEmptyStringSchema.optional()
|
|
415
|
+
name: nonEmptyStringSchema.describe("The dependency name used by the package manager."),
|
|
416
|
+
version: nonEmptyStringSchema.optional().describe("The dependency version requirement."),
|
|
417
|
+
source: dependencySourceSchema.optional().describe("A non-default source for the dependency."),
|
|
418
|
+
packageName: nonEmptyStringSchema.optional().describe("The source package name when it differs from the dependency alias."),
|
|
419
|
+
features: z.array(nonEmptyStringSchema).optional().describe("Cargo features enabled for this dependency."),
|
|
420
|
+
extras: z.array(nonEmptyStringSchema).optional().describe("Python extras enabled for this dependency."),
|
|
421
|
+
optional: z.boolean().optional().describe("Whether the dependency is optional."),
|
|
422
|
+
defaultFeatures: z.boolean().optional().describe("Whether the dependency enables its default Cargo features."),
|
|
423
|
+
environmentMarker: nonEmptyStringSchema.optional().describe("A Python environment marker that conditions this dependency.")
|
|
389
424
|
}).refine(({ source, version }) => source !== void 0 || version !== void 0, {
|
|
390
425
|
message: "dependency must define a version or a source"
|
|
391
426
|
});
|
|
392
427
|
var projectUrlSchema = z.strictObject({
|
|
393
|
-
label: nonEmptyStringSchema,
|
|
394
|
-
url: nonEmptyStringSchema
|
|
428
|
+
label: nonEmptyStringSchema.describe("The label displayed for the project link."),
|
|
429
|
+
url: nonEmptyStringSchema.describe("The project link URL.")
|
|
395
430
|
});
|
|
396
431
|
var packageConfigSchema = z.strictObject({
|
|
397
|
-
packageName: nonEmptyStringSchema.optional(),
|
|
398
|
-
moduleName: nonEmptyStringSchema.optional(),
|
|
399
|
-
modulePath: goModulePathSchema.optional(),
|
|
400
|
-
namespace: nonEmptyStringSchema.optional(),
|
|
401
|
-
groupId: nonEmptyStringSchema.optional(),
|
|
402
|
-
artifactId: nonEmptyStringSchema.optional(),
|
|
403
|
-
description: z.string().optional(),
|
|
404
|
-
repository: nonEmptyStringSchema.optional(),
|
|
405
|
-
homepage: nonEmptyStringSchema.optional(),
|
|
406
|
-
documentationUrl: nonEmptyStringSchema.optional(),
|
|
407
|
-
authors: z.array(authorSchema).optional(),
|
|
408
|
-
developers: z.array(developerSchema).optional(),
|
|
409
|
-
license: licenseSchema.optional(),
|
|
410
|
-
keywords: z.array(nonEmptyStringSchema).optional(),
|
|
411
|
-
classifiers: z.array(nonEmptyStringSchema).optional(),
|
|
412
|
-
projectUrls: z.array(projectUrlSchema).optional(),
|
|
413
|
-
extraDependencies: z.array(dependencySchema).optional(),
|
|
414
|
-
extraDevDependencies: z.array(dependencySchema).optional(),
|
|
415
|
-
extraPeerDependencies: z.array(dependencySchema).optional()
|
|
432
|
+
packageName: nonEmptyStringSchema.optional().describe("The package name used by the target language registry."),
|
|
433
|
+
moduleName: nonEmptyStringSchema.optional().describe("The generated module or import name when it differs from the package name."),
|
|
434
|
+
modulePath: goModulePathSchema.optional().describe("The Go module path used for imports and publishing."),
|
|
435
|
+
namespace: nonEmptyStringSchema.optional().describe("The namespace or package prefix for generated code."),
|
|
436
|
+
groupId: nonEmptyStringSchema.optional().describe("The Maven group identifier."),
|
|
437
|
+
artifactId: nonEmptyStringSchema.optional().describe("The Maven artifact identifier."),
|
|
438
|
+
description: z.string().optional().describe("The package description used in generated metadata."),
|
|
439
|
+
repository: nonEmptyStringSchema.optional().describe("The source repository for the generated SDK."),
|
|
440
|
+
homepage: nonEmptyStringSchema.optional().describe("The package homepage URL."),
|
|
441
|
+
documentationUrl: nonEmptyStringSchema.optional().describe("The package documentation URL."),
|
|
442
|
+
authors: z.array(authorSchema).optional().describe("Authors credited in package metadata."),
|
|
443
|
+
developers: z.array(developerSchema).optional().describe("Developers credited in package metadata."),
|
|
444
|
+
license: licenseSchema.optional().describe("License metadata for the generated package."),
|
|
445
|
+
keywords: z.array(nonEmptyStringSchema).optional().describe("Search keywords for package metadata."),
|
|
446
|
+
classifiers: z.array(nonEmptyStringSchema).optional().describe("Package classifiers used by registries such as PyPI."),
|
|
447
|
+
projectUrls: z.array(projectUrlSchema).optional().describe("Labeled project links for package metadata."),
|
|
448
|
+
extraDependencies: z.array(dependencySchema).optional().describe("Additional runtime dependencies added to the generated package."),
|
|
449
|
+
extraDevDependencies: z.array(dependencySchema).optional().describe("Additional development dependencies added to the generated package."),
|
|
450
|
+
extraPeerDependencies: z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package.")
|
|
416
451
|
});
|
|
417
452
|
var httpMethodSchema = z.enum([
|
|
418
453
|
"GET",
|
|
@@ -426,34 +461,34 @@ var httpMethodSchema = z.enum([
|
|
|
426
461
|
"CONNECT"
|
|
427
462
|
]);
|
|
428
463
|
var readmeEndpointSchema = z.strictObject({
|
|
429
|
-
method: httpMethodSchema,
|
|
430
|
-
path: nonEmptyStringSchema,
|
|
431
|
-
stream: z.boolean().optional()
|
|
464
|
+
method: httpMethodSchema.describe("The HTTP method of the documented endpoint."),
|
|
465
|
+
path: nonEmptyStringSchema.describe("The endpoint path used in generated examples."),
|
|
466
|
+
stream: z.boolean().optional().describe("Whether the example uses the streaming response API.")
|
|
432
467
|
});
|
|
433
468
|
var readmeCustomSectionSchema = z.strictObject({
|
|
434
|
-
title: nonEmptyStringSchema,
|
|
435
|
-
content: z.string()
|
|
469
|
+
title: nonEmptyStringSchema.describe("The heading displayed for this README section."),
|
|
470
|
+
content: z.string().describe("The Markdown content of this README section.")
|
|
436
471
|
});
|
|
437
472
|
var readmeConfigSchema = z.strictObject({
|
|
438
|
-
apiName: nonEmptyStringSchema.optional(),
|
|
439
|
-
introduction: z.string().optional(),
|
|
440
|
-
apiReferenceLink: nonEmptyStringSchema.optional(),
|
|
441
|
-
bannerLink: nonEmptyStringSchema.optional(),
|
|
442
|
-
disabledSections: z.array(nonEmptyStringSchema).optional(),
|
|
443
|
-
customSections: z.array(readmeCustomSectionSchema).optional(),
|
|
444
|
-
defaultEndpoint: readmeEndpointSchema.optional(),
|
|
445
|
-
features: z.record(z.string(), z.array(readmeEndpointSchema)).optional()
|
|
473
|
+
apiName: nonEmptyStringSchema.optional().describe("The API name displayed in the README."),
|
|
474
|
+
introduction: z.string().optional().describe("Custom introductory Markdown for the README."),
|
|
475
|
+
apiReferenceLink: nonEmptyStringSchema.optional().describe("The URL linked as the API reference."),
|
|
476
|
+
bannerLink: nonEmptyStringSchema.optional().describe("The destination URL for the README banner."),
|
|
477
|
+
disabledSections: z.array(nonEmptyStringSchema).optional().describe("Generated README sections to omit."),
|
|
478
|
+
customSections: z.array(readmeCustomSectionSchema).optional().describe("Additional sections inserted into the README."),
|
|
479
|
+
defaultEndpoint: readmeEndpointSchema.optional().describe("The endpoint used for the primary README example."),
|
|
480
|
+
features: z.record(z.string(), z.array(readmeEndpointSchema)).optional().describe("Named feature groups and the endpoints demonstrated by each group.")
|
|
446
481
|
});
|
|
447
482
|
var snippetsConfigSchema = z.strictObject({
|
|
448
|
-
enabled: z.boolean(),
|
|
449
|
-
format: z.enum(["md", "json"]).optional(),
|
|
450
|
-
outputPath: nonEmptyStringSchema.optional()
|
|
483
|
+
enabled: z.boolean().describe("Whether standalone usage snippets are generated."),
|
|
484
|
+
format: z.enum(["md", "json"]).optional().describe("The output format for generated snippets."),
|
|
485
|
+
outputPath: nonEmptyStringSchema.optional().describe("The output path for generated snippet files.")
|
|
451
486
|
});
|
|
452
487
|
var docsConfigSchema = z.strictObject({
|
|
453
|
-
readme: readmeConfigSchema.optional(),
|
|
454
|
-
snippets: snippetsConfigSchema.optional(),
|
|
455
|
-
referenceBaseUrl: nonEmptyStringSchema.optional(),
|
|
456
|
-
includeApiReference: z.boolean().optional()
|
|
488
|
+
readme: readmeConfigSchema.optional().describe("README content and example configuration."),
|
|
489
|
+
snippets: snippetsConfigSchema.optional().describe("Standalone usage snippet generation."),
|
|
490
|
+
referenceBaseUrl: nonEmptyStringSchema.optional().describe("The base URL used for links to generated API reference files."),
|
|
491
|
+
includeApiReference: z.boolean().optional().describe("Whether API reference documentation is included in the SDK output.")
|
|
457
492
|
});
|
|
458
493
|
|
|
459
494
|
// src/sdk-config/v1/docs.ts
|
|
@@ -1252,16 +1287,10 @@ function finishOutputMapping(mapping, outputMode, sourcePath, state, index) {
|
|
|
1252
1287
|
for (const path of collectLeafPaths(outputMode, sourcePath)) {
|
|
1253
1288
|
if (path[path.length - 1] === "_visit") consume(state, path);
|
|
1254
1289
|
}
|
|
1255
|
-
const legacyGenerateFullProject = isObject(outputMode) ? outputMode.generateFullProject : void 0;
|
|
1256
|
-
const generationShape = typeof legacyGenerateFullProject === "boolean" ? { generation: { ...mapping.generation, generateFullProject: legacyGenerateFullProject } } : {};
|
|
1257
|
-
if (typeof legacyGenerateFullProject === "boolean") {
|
|
1258
|
-
consume(state, [...sourcePath, "generateFullProject"]);
|
|
1259
|
-
}
|
|
1260
1290
|
const unsupported = collectUnsupported(outputMode, sourcePath, state);
|
|
1261
1291
|
const hasCredentials = unsupported.some((diagnostic) => isCredentialPath(diagnostic.path));
|
|
1262
1292
|
return {
|
|
1263
1293
|
...mapping,
|
|
1264
|
-
...generationShape,
|
|
1265
1294
|
unsupportedFields: [
|
|
1266
1295
|
...state.credentialDiagnostics ?? [],
|
|
1267
1296
|
...hasCredentials ? [
|
|
@@ -1332,6 +1361,9 @@ function outputDiagnostic(path, index) {
|
|
|
1332
1361
|
homepageLink: {
|
|
1333
1362
|
sdkConfigPath: ["targets", index, "package", "homepage"],
|
|
1334
1363
|
suggestedAction: "Set target.package.homepage manually to a valid URL."
|
|
1364
|
+
},
|
|
1365
|
+
generateFullProject: {
|
|
1366
|
+
suggestedAction: "Preserve this packaging setting on the generation request; it is not customer-authored SDK configuration."
|
|
1335
1367
|
}
|
|
1336
1368
|
};
|
|
1337
1369
|
const fieldGuidance = field ? guidance[field] : void 0;
|
|
@@ -1453,59 +1485,48 @@ function deepEqual(left, right) {
|
|
|
1453
1485
|
return false;
|
|
1454
1486
|
}
|
|
1455
1487
|
var namingConfigSchema = z.strictObject({
|
|
1456
|
-
clientName: nonEmptyStringSchema.optional(),
|
|
1457
|
-
exportedClientName: nonEmptyStringSchema.optional(),
|
|
1458
|
-
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
1459
|
-
apiErrorName: nonEmptyStringSchema.optional(),
|
|
1460
|
-
baseErrorName: nonEmptyStringSchema.optional(),
|
|
1461
|
-
pagerName: nonEmptyStringSchema.optional(),
|
|
1488
|
+
clientName: nonEmptyStringSchema.optional().describe("The generated client class name."),
|
|
1489
|
+
exportedClientName: nonEmptyStringSchema.optional().describe("The client name exported from the generated package."),
|
|
1490
|
+
environmentTypeName: nonEmptyStringSchema.optional().describe("The generated type name for API environments."),
|
|
1491
|
+
apiErrorName: nonEmptyStringSchema.optional().describe("The generated API error class name."),
|
|
1492
|
+
baseErrorName: nonEmptyStringSchema.optional().describe("The generated base error class name."),
|
|
1493
|
+
pagerName: nonEmptyStringSchema.optional().describe("The generated pagination helper name."),
|
|
1462
1494
|
/** Apply Fern's initialism-aware casing rules when deriving generated identifiers. */
|
|
1463
|
-
smartCasing: z.boolean().optional(),
|
|
1495
|
+
smartCasing: z.boolean().optional().describe("Whether generated identifiers use initialism-aware casing."),
|
|
1464
1496
|
/** Preserve a word boundary after digits when Fern smart casing is enabled. */
|
|
1465
|
-
smartCasingDigitWordBoundary: z.boolean().optional()
|
|
1497
|
+
smartCasingDigitWordBoundary: z.boolean().optional().describe("Whether smart casing preserves a word boundary after digits.")
|
|
1466
1498
|
});
|
|
1467
1499
|
|
|
1468
1500
|
// src/sdk-config/v1/generation.ts
|
|
1469
1501
|
var customerGenerationAssetSchema = z.discriminatedUnion("type", [
|
|
1470
|
-
z.strictObject({ type: z.literal("path"), location: relativePathSchema }),
|
|
1471
|
-
z.strictObject({ type: z.literal("url"), location: nonEmptyStringSchema })
|
|
1472
|
-
]);
|
|
1473
|
-
var hookDependencySchema = z.strictObject({
|
|
1474
|
-
name: nonEmptyStringSchema,
|
|
1475
|
-
version: nonEmptyStringSchema,
|
|
1476
|
-
groupId: nonEmptyStringSchema.optional()
|
|
1477
|
-
});
|
|
1478
|
-
var hooksConfigSchema = z.strictObject({
|
|
1479
|
-
enabled: z.boolean(),
|
|
1480
|
-
source: customerGenerationAssetSchema.optional(),
|
|
1481
|
-
dependencies: z.array(hookDependencySchema).optional()
|
|
1482
|
-
});
|
|
1483
|
-
var customCodeConfigSchema = z.strictObject({
|
|
1484
|
-
enabled: z.boolean(),
|
|
1485
|
-
source: customerGenerationAssetSchema.optional(),
|
|
1486
|
-
conflictStrategy: z.enum(["mark", "ours", "theirs"]).optional(),
|
|
1487
|
-
trackChanges: z.boolean().optional(),
|
|
1488
|
-
protectedFiles: z.array(nonEmptyStringSchema).optional()
|
|
1489
|
-
});
|
|
1490
|
-
var workflowConfigSchema = z.strictObject({
|
|
1491
|
-
path: relativePathSchema,
|
|
1492
|
-
outputName: nonEmptyStringSchema.optional()
|
|
1493
|
-
});
|
|
1494
|
-
var analyticsHeaderSchema = z.union([
|
|
1495
|
-
z.strictObject({ name: nonEmptyStringSchema, value: z.string() }),
|
|
1496
1502
|
z.strictObject({
|
|
1497
|
-
|
|
1498
|
-
|
|
1503
|
+
type: z.literal("path").describe("Loads the generation asset from a relative path."),
|
|
1504
|
+
location: relativePathSchema.describe("The relative path to the generation asset.")
|
|
1505
|
+
}),
|
|
1506
|
+
z.strictObject({
|
|
1507
|
+
type: z.literal("url").describe("Loads the generation asset from a URL."),
|
|
1508
|
+
location: nonEmptyStringSchema.describe("The URL of the generation asset.")
|
|
1499
1509
|
})
|
|
1500
1510
|
]);
|
|
1511
|
+
var customCodeConfigSchema = z.strictObject({
|
|
1512
|
+
enabled: z.boolean().describe("Whether customer-authored code is merged into generated output."),
|
|
1513
|
+
source: customerGenerationAssetSchema.optional().describe("The source containing customer-authored code."),
|
|
1514
|
+
conflictStrategy: z.enum(["mark", "ours", "theirs"]).optional().describe("How merge conflicts between generated and custom code are handled."),
|
|
1515
|
+
trackChanges: z.boolean().optional().describe("Whether custom-code changes are tracked between builds."),
|
|
1516
|
+
protectedFiles: z.array(nonEmptyStringSchema).optional().describe("Generated file paths that custom-code merging must not overwrite.")
|
|
1517
|
+
});
|
|
1518
|
+
var analyticsHeaderSchema = z.strictObject({
|
|
1519
|
+
name: nonEmptyStringSchema.describe("The exported telemetry header name."),
|
|
1520
|
+
value: z.string().describe("The literal telemetry header value.")
|
|
1521
|
+
});
|
|
1501
1522
|
var analyticsConfigSchema = z.strictObject({
|
|
1502
|
-
enabled: z.boolean(),
|
|
1503
|
-
endpoint: nonEmptyStringSchema.optional(),
|
|
1504
|
-
exporter: z.enum(["otlp-http", "console"]).optional(),
|
|
1505
|
-
headers: z.array(analyticsHeaderSchema).optional(),
|
|
1506
|
-
batchSize: z.number().int().positive().optional(),
|
|
1507
|
-
scheduledDelayMs: z.number().nonnegative().optional(),
|
|
1508
|
-
exportTimeoutMs: z.number().nonnegative().optional()
|
|
1523
|
+
enabled: z.boolean().describe("Whether generated clients export usage telemetry."),
|
|
1524
|
+
endpoint: nonEmptyStringSchema.optional().describe("The telemetry export endpoint."),
|
|
1525
|
+
exporter: z.enum(["otlp-http", "console"]).optional().describe("The telemetry exporter implementation."),
|
|
1526
|
+
headers: z.array(analyticsHeaderSchema).optional().describe("Headers sent by the telemetry exporter."),
|
|
1527
|
+
batchSize: z.number().int().positive().optional().describe("The maximum spans in each export batch."),
|
|
1528
|
+
scheduledDelayMs: z.number().nonnegative().optional().describe("The delay between scheduled exports, in milliseconds."),
|
|
1529
|
+
exportTimeoutMs: z.number().nonnegative().optional().describe("The maximum time allowed for an export, in milliseconds.")
|
|
1509
1530
|
}).superRefine(({ enabled, endpoint }, context) => {
|
|
1510
1531
|
if (enabled && endpoint === void 0) {
|
|
1511
1532
|
context.addIssue({
|
|
@@ -1516,73 +1537,63 @@ var analyticsConfigSchema = z.strictObject({
|
|
|
1516
1537
|
}
|
|
1517
1538
|
});
|
|
1518
1539
|
var wireTestsSchema = z.strictObject({
|
|
1519
|
-
enabled: z.boolean(),
|
|
1520
|
-
exclusions: z.array(nonEmptyStringSchema).optional(),
|
|
1521
|
-
fallbackToGeneratedErrorExamples: z.boolean().optional(),
|
|
1522
|
-
fixtureSource: z.enum(["synthetic", "recorded", "auto"]).optional()
|
|
1540
|
+
enabled: z.boolean().describe("Whether wire-level request and response tests are generated."),
|
|
1541
|
+
exclusions: z.array(nonEmptyStringSchema).optional().describe("Operations excluded from wire tests."),
|
|
1542
|
+
fallbackToGeneratedErrorExamples: z.boolean().optional().describe("Whether missing error fixtures are synthesized from generated examples."),
|
|
1543
|
+
fixtureSource: z.enum(["synthetic", "recorded", "auto"]).optional().describe("Where wire-test fixtures are obtained.")
|
|
1523
1544
|
});
|
|
1524
1545
|
var unitTestsSchema = z.strictObject({
|
|
1525
|
-
enabled: z.boolean(),
|
|
1526
|
-
|
|
1527
|
-
exclusions: z.array(nonEmptyStringSchema).optional()
|
|
1546
|
+
enabled: z.boolean().describe("Whether SDK unit tests are generated."),
|
|
1547
|
+
exclusions: z.array(nonEmptyStringSchema).optional().describe("Operations excluded from unit tests.")
|
|
1528
1548
|
});
|
|
1529
1549
|
var streamsSchema = z.strictObject({
|
|
1530
|
-
enabled: z.boolean(),
|
|
1531
|
-
responseType: z.enum(["wrapper", "native", "web"]).optional(),
|
|
1532
|
-
fileResponseType: z.enum(["stream", "binary-response"]).optional(),
|
|
1533
|
-
defaultChunkSizeBytes: z.number().int().positive().optional()
|
|
1550
|
+
enabled: z.boolean().describe("Whether generated clients expose streaming response APIs."),
|
|
1551
|
+
responseType: z.enum(["wrapper", "native", "web"]).optional().describe("The streaming response abstraction exposed by generated clients."),
|
|
1552
|
+
fileResponseType: z.enum(["stream", "binary-response"]).optional().describe("The response type used for file downloads."),
|
|
1553
|
+
defaultChunkSizeBytes: z.number().int().positive().optional().describe("The default number of bytes yielded by streaming iterators.")
|
|
1534
1554
|
});
|
|
1535
1555
|
var layoutConfigSchema = z.strictObject({
|
|
1536
|
-
outputDirectory: z.enum(["project-root", "source-root"]).optional(),
|
|
1537
|
-
packagePath: nonEmptyStringSchema.optional()
|
|
1556
|
+
outputDirectory: z.enum(["project-root", "source-root"]).optional().describe("Whether generated source is rooted at the project or its source directory."),
|
|
1557
|
+
packagePath: nonEmptyStringSchema.optional().describe("The package-relative path for generated source files.")
|
|
1538
1558
|
});
|
|
1539
1559
|
var serializationConfigSchema = z.strictObject({
|
|
1540
|
-
enumRepresentation: z.enum(["enum", "union", "literal", "forward-compatible-enum", "language-default"]).optional(),
|
|
1541
|
-
additionalProperties: z.enum(["allow", "forbid", "ignore", "language-default"]).optional(),
|
|
1542
|
-
inlineTypes: z.boolean().optional(),
|
|
1543
|
-
omitUndefined: z.boolean().optional()
|
|
1560
|
+
enumRepresentation: z.enum(["enum", "union", "literal", "forward-compatible-enum", "language-default"]).optional().describe("How schema enums are represented in generated code."),
|
|
1561
|
+
additionalProperties: z.enum(["allow", "forbid", "ignore", "language-default"]).optional().describe("How undeclared object properties are handled."),
|
|
1562
|
+
inlineTypes: z.boolean().optional().describe("Whether inline schemas remain nested under their parent types."),
|
|
1563
|
+
omitUndefined: z.boolean().optional().describe("Whether undefined properties are omitted during serialization.")
|
|
1544
1564
|
});
|
|
1545
1565
|
var generationConfigOverrideShape = {
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
unitTests: unitTestsSchema.optional(),
|
|
1566
|
-
webSockets: z.boolean().optional(),
|
|
1567
|
-
streams: streamsSchema.optional(),
|
|
1568
|
-
naming: namingConfigSchema.optional(),
|
|
1569
|
-
layout: layoutConfigSchema.optional(),
|
|
1570
|
-
serialization: serializationConfigSchema.optional()
|
|
1566
|
+
includeOptionalSnippetParameters: z.boolean().optional().describe("Whether usage snippets include optional request parameters."),
|
|
1567
|
+
buildAllModels: z.boolean().optional().describe("Whether models not referenced by operations are also generated."),
|
|
1568
|
+
inferServiceNames: z.boolean().optional().describe("Whether service names are inferred from API structure."),
|
|
1569
|
+
includeDeprecatedOperations: z.boolean().optional().describe("Whether deprecated API operations are generated."),
|
|
1570
|
+
multipleResponses: z.boolean().optional().describe("Whether operations model multiple successful response types."),
|
|
1571
|
+
devContainer: z.boolean().optional().describe("Whether development-container configuration is generated."),
|
|
1572
|
+
allowMockClient: z.boolean().optional().describe("Whether a mock API client is included in the generated SDK."),
|
|
1573
|
+
ignoreFiles: z.array(nonEmptyStringSchema).optional().describe("Generated paths excluded from the final output."),
|
|
1574
|
+
reservedKeywords: z.array(nonEmptyStringSchema).optional().describe("Additional identifiers treated as reserved words."),
|
|
1575
|
+
customCode: customCodeConfigSchema.optional().describe("Customer-authored code merge configuration."),
|
|
1576
|
+
customQueryPaths: z.array(relativePathSchema).optional().describe("Relative paths to custom query definitions."),
|
|
1577
|
+
analytics: analyticsConfigSchema.optional().describe("Generated client telemetry configuration."),
|
|
1578
|
+
wireTests: wireTestsSchema.optional().describe("Wire-level request and response test generation."),
|
|
1579
|
+
unitTests: unitTestsSchema.optional().describe("SDK unit-test generation."),
|
|
1580
|
+
webSockets: z.boolean().optional().describe("Whether WebSocket clients are generated for supported channels."),
|
|
1581
|
+
streams: streamsSchema.optional().describe("Streaming response generation behavior."),
|
|
1582
|
+
naming: namingConfigSchema.optional().describe("Names and casing used by generated code."),
|
|
1583
|
+
layout: layoutConfigSchema.optional().describe("Generated project and source layout."),
|
|
1584
|
+
serialization: serializationConfigSchema.optional().describe("Generated model serialization behavior.")
|
|
1571
1585
|
};
|
|
1572
1586
|
var sdkConfigV1GenerationConfigOverrideSchema = z.strictObject(
|
|
1573
1587
|
generationConfigOverrideShape
|
|
1574
1588
|
);
|
|
1575
1589
|
var sdkConfigV1GenerationConfigSchema = z.strictObject({
|
|
1576
1590
|
...generationConfigOverrideShape,
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
generateFullProject: z.boolean().default(false),
|
|
1584
|
-
devContainer: z.boolean().default(false),
|
|
1585
|
-
allowMockClient: z.boolean().default(false)
|
|
1591
|
+
buildAllModels: z.boolean().default(false).describe("Whether models not referenced by operations are also generated."),
|
|
1592
|
+
inferServiceNames: z.boolean().default(false).describe("Whether service names are inferred from API structure."),
|
|
1593
|
+
includeDeprecatedOperations: z.boolean().default(true).describe("Whether deprecated API operations are generated."),
|
|
1594
|
+
multipleResponses: z.boolean().default(false).describe("Whether operations model multiple successful response types."),
|
|
1595
|
+
devContainer: z.boolean().default(false).describe("Whether development-container configuration is generated."),
|
|
1596
|
+
allowMockClient: z.boolean().default(false).describe("Whether a mock API client is included in the generated SDK.")
|
|
1586
1597
|
});
|
|
1587
1598
|
var commonGenerationKeys = new Set(Object.keys(generationConfigOverrideShape));
|
|
1588
1599
|
function splitSdkConfigV1TargetGeneration(generation) {
|
|
@@ -1604,78 +1615,97 @@ var sdkConfigV1PublishRegistrySchema = z.enum([
|
|
|
1604
1615
|
"composer"
|
|
1605
1616
|
]);
|
|
1606
1617
|
var mavenSignatureSchema = z.strictObject({
|
|
1607
|
-
keyId: nonEmptyStringSchema
|
|
1608
|
-
|
|
1609
|
-
|
|
1618
|
+
keyId: nonEmptyStringSchema.describe(
|
|
1619
|
+
"The signing key identifier, or an environment expression that resolves to it."
|
|
1620
|
+
),
|
|
1621
|
+
password: nonEmptyStringSchema.describe(
|
|
1622
|
+
"The signing key password, or an environment expression that resolves to it."
|
|
1623
|
+
),
|
|
1624
|
+
secretKey: nonEmptyStringSchema.describe(
|
|
1625
|
+
"The armored secret key, or an environment expression that resolves to it."
|
|
1626
|
+
)
|
|
1610
1627
|
});
|
|
1611
1628
|
var commonPublishShape = {
|
|
1612
|
-
url: nonEmptyStringSchema.optional(),
|
|
1613
|
-
releaseBranch: nonEmptyStringSchema.optional(),
|
|
1614
|
-
tolerateRepublish: z.boolean().optional()
|
|
1629
|
+
url: nonEmptyStringSchema.optional().describe("A custom package registry URL."),
|
|
1630
|
+
releaseBranch: nonEmptyStringSchema.optional().describe("The branch used by generated package release workflows."),
|
|
1631
|
+
tolerateRepublish: z.boolean().optional().describe("Whether an already-published package version is treated as non-fatal.")
|
|
1615
1632
|
};
|
|
1616
1633
|
var sdkConfigV1PublishConfigSchema = z.discriminatedUnion("registry", [
|
|
1617
1634
|
z.strictObject({
|
|
1618
|
-
registry: z.literal("npm"),
|
|
1619
|
-
token: nonEmptyStringSchema.optional(),
|
|
1635
|
+
registry: z.literal("npm").describe("Publishes the package to an npm-compatible registry."),
|
|
1636
|
+
token: nonEmptyStringSchema.optional().describe("The npm registry token, or an environment expression that resolves to it."),
|
|
1620
1637
|
...commonPublishShape
|
|
1621
1638
|
}),
|
|
1622
1639
|
z.strictObject({
|
|
1623
|
-
registry: z.literal("pypi"),
|
|
1624
|
-
username: nonEmptyStringSchema.optional(),
|
|
1625
|
-
password: nonEmptyStringSchema.optional(),
|
|
1640
|
+
registry: z.literal("pypi").describe("Publishes the package to a PyPI-compatible registry."),
|
|
1641
|
+
username: nonEmptyStringSchema.optional().describe("The PyPI username, or an environment expression that resolves to it."),
|
|
1642
|
+
password: nonEmptyStringSchema.optional().describe("The PyPI password or token, or an environment expression that resolves to it."),
|
|
1626
1643
|
...commonPublishShape
|
|
1627
1644
|
}),
|
|
1628
1645
|
z.strictObject({
|
|
1629
|
-
registry: z.literal("maven"),
|
|
1630
|
-
username: nonEmptyStringSchema.optional(),
|
|
1631
|
-
password: nonEmptyStringSchema.optional(),
|
|
1632
|
-
signature: mavenSignatureSchema.optional(),
|
|
1646
|
+
registry: z.literal("maven").describe("Publishes the package to a Maven-compatible repository."),
|
|
1647
|
+
username: nonEmptyStringSchema.optional().describe("The Maven username, or an environment expression that resolves to it."),
|
|
1648
|
+
password: nonEmptyStringSchema.optional().describe("The Maven password, or an environment expression that resolves to it."),
|
|
1649
|
+
signature: mavenSignatureSchema.optional().describe("Credentials used to sign Maven artifacts."),
|
|
1633
1650
|
...commonPublishShape
|
|
1634
1651
|
}),
|
|
1635
|
-
z.strictObject({ registry: z.literal("nuget"), ...commonPublishShape }),
|
|
1636
|
-
z.strictObject({ registry: z.literal("rubygems"), ...commonPublishShape }),
|
|
1637
1652
|
z.strictObject({
|
|
1638
|
-
registry: z.literal("
|
|
1639
|
-
token: nonEmptyStringSchema.optional(),
|
|
1653
|
+
registry: z.literal("nuget").describe("Publishes the package to a NuGet-compatible registry."),
|
|
1640
1654
|
...commonPublishShape
|
|
1641
1655
|
}),
|
|
1642
|
-
z.strictObject({
|
|
1643
|
-
|
|
1656
|
+
z.strictObject({
|
|
1657
|
+
registry: z.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),
|
|
1658
|
+
...commonPublishShape
|
|
1659
|
+
}),
|
|
1660
|
+
z.strictObject({
|
|
1661
|
+
registry: z.literal("crates").describe("Publishes the crate to a Cargo-compatible registry."),
|
|
1662
|
+
token: nonEmptyStringSchema.optional().describe("The Cargo registry token, or an environment expression that resolves to it."),
|
|
1663
|
+
...commonPublishShape
|
|
1664
|
+
}),
|
|
1665
|
+
z.strictObject({
|
|
1666
|
+
registry: z.literal("go").describe("Publishes the SDK as a Go module."),
|
|
1667
|
+
...commonPublishShape
|
|
1668
|
+
}),
|
|
1669
|
+
z.strictObject({
|
|
1670
|
+
registry: z.literal("composer").describe("Publishes the package to a Composer-compatible registry."),
|
|
1671
|
+
...commonPublishShape
|
|
1672
|
+
})
|
|
1644
1673
|
]);
|
|
1645
1674
|
var reviewersSchema = z.strictObject({
|
|
1646
|
-
teams: z.array(nonEmptyStringSchema).optional(),
|
|
1647
|
-
users: z.array(nonEmptyStringSchema).optional()
|
|
1675
|
+
teams: z.array(nonEmptyStringSchema).optional().describe("GitHub teams requested as reviewers."),
|
|
1676
|
+
users: z.array(nonEmptyStringSchema).optional().describe("GitHub users requested as reviewers.")
|
|
1648
1677
|
});
|
|
1649
1678
|
var githubCredentialsSchema = z.strictObject({
|
|
1650
|
-
username: nonEmptyStringSchema.optional(),
|
|
1651
|
-
password: nonEmptyStringSchema.optional(),
|
|
1652
|
-
token: nonEmptyStringSchema.optional(),
|
|
1653
|
-
apiKey: nonEmptyStringSchema.optional()
|
|
1679
|
+
username: nonEmptyStringSchema.optional().describe("The username used to authenticate with the GitHub host."),
|
|
1680
|
+
password: nonEmptyStringSchema.optional().describe("The password used to authenticate with the GitHub host."),
|
|
1681
|
+
token: nonEmptyStringSchema.optional().describe("A token used to authenticate with the GitHub host."),
|
|
1682
|
+
apiKey: nonEmptyStringSchema.optional().describe("An API key used to authenticate with the GitHub host.")
|
|
1654
1683
|
});
|
|
1655
1684
|
var githubOutputSchema = z.strictObject({
|
|
1656
|
-
repository: nonEmptyStringSchema
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1685
|
+
repository: nonEmptyStringSchema.describe(
|
|
1686
|
+
"The GitHub repository that receives generated files."
|
|
1687
|
+
),
|
|
1688
|
+
host: nonEmptyStringSchema.optional().describe("The GitHub host for enterprise installations."),
|
|
1689
|
+
branch: nonEmptyStringSchema.optional().describe("The target branch for generated changes."),
|
|
1690
|
+
mode: z.enum(["release", "pull-request", "push", "commit", "commit-and-release"]).optional().describe("How generated changes are delivered to the repository."),
|
|
1691
|
+
reviewers: reviewersSchema.optional().describe("Reviewers requested for generated pull requests."),
|
|
1692
|
+
credentials: githubCredentialsSchema.optional().describe("Credentials used to authenticate GitHub delivery."),
|
|
1693
|
+
privateRepository: z.boolean().optional().describe("Whether the destination repository is private.")
|
|
1664
1694
|
});
|
|
1665
1695
|
var filesOutputSchema = z.strictObject({
|
|
1666
|
-
delivery: z.literal("files"),
|
|
1667
|
-
path: nonEmptyStringSchema.optional(),
|
|
1668
|
-
publish: sdkConfigV1PublishConfigSchema.optional()
|
|
1696
|
+
delivery: z.literal("files").describe("Writes the generated SDK to a directory."),
|
|
1697
|
+
path: nonEmptyStringSchema.optional().describe("The destination directory for generated files."),
|
|
1698
|
+
publish: sdkConfigV1PublishConfigSchema.optional().describe("Optional package registry publication.")
|
|
1669
1699
|
});
|
|
1670
1700
|
var zipOutputSchema = z.strictObject({
|
|
1671
|
-
delivery: z.literal("zip"),
|
|
1672
|
-
fileName: nonEmptyStringSchema.optional(),
|
|
1673
|
-
publish: sdkConfigV1PublishConfigSchema.optional()
|
|
1701
|
+
delivery: z.literal("zip").describe("Packages the generated SDK as a ZIP archive."),
|
|
1702
|
+
fileName: nonEmptyStringSchema.optional().describe("The generated ZIP archive file name."),
|
|
1703
|
+
publish: sdkConfigV1PublishConfigSchema.optional().describe("Optional package registry publication.")
|
|
1674
1704
|
});
|
|
1675
1705
|
var githubDeliverySchema = z.strictObject({
|
|
1676
|
-
delivery: z.literal("github"),
|
|
1677
|
-
github: githubOutputSchema,
|
|
1678
|
-
publish: sdkConfigV1PublishConfigSchema.optional()
|
|
1706
|
+
delivery: z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
1707
|
+
github: githubOutputSchema.describe("GitHub repository delivery settings."),
|
|
1708
|
+
publish: sdkConfigV1PublishConfigSchema.optional().describe("Optional package registry publication.")
|
|
1679
1709
|
});
|
|
1680
1710
|
var sdkConfigV1OutputConfigSchema = z.discriminatedUnion(
|
|
1681
1711
|
"delivery",
|
|
@@ -1687,29 +1717,33 @@ var sdkConfigV1OutputConfigSchema = z.discriminatedUnion(
|
|
|
1687
1717
|
var sdkConfigV1DependencySchema = dependencySchema;
|
|
1688
1718
|
var sdkConfigV1PackageConfigSchema = packageConfigSchema;
|
|
1689
1719
|
var sdkConfigV1ReplayConfigSchema = z.strictObject({
|
|
1690
|
-
enabled: z.boolean()
|
|
1720
|
+
enabled: z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
|
|
1691
1721
|
});
|
|
1692
1722
|
var apiImportSettingsSchema = z.strictObject({
|
|
1693
|
-
respectNullableSchemas: z.boolean().optional(),
|
|
1694
|
-
titleAsSchemaName: z.boolean().optional(),
|
|
1695
|
-
coerceEnumsToLiterals: z.boolean().optional(),
|
|
1696
|
-
idiomaticRequestNames: z.boolean().optional(),
|
|
1697
|
-
wrapReferencesToNullableInOptional: z.boolean().optional(),
|
|
1698
|
-
coerceOptionalSchemasToNullable: z.boolean().optional(),
|
|
1699
|
-
pathParameterOrder: z.enum(["url-order", "spec-order"]).optional(),
|
|
1700
|
-
onlyIncludeReferencedSchemas: z.boolean().optional(),
|
|
1701
|
-
objectQueryParameters: z.boolean().optional(),
|
|
1702
|
-
typeDatesAsStrings: z.boolean().optional(),
|
|
1703
|
-
groupMultiApiEnvironments: z.boolean().optional()
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1723
|
+
respectNullableSchemas: z.boolean().optional().describe("Whether nullable schemas remain nullable in generated types."),
|
|
1724
|
+
titleAsSchemaName: z.boolean().optional().describe("Whether a schema title can determine the generated type name."),
|
|
1725
|
+
coerceEnumsToLiterals: z.boolean().optional().describe("Whether single-value enums are imported as literal values."),
|
|
1726
|
+
idiomaticRequestNames: z.boolean().optional().describe("Whether request types use concise, idiomatic generated names."),
|
|
1727
|
+
wrapReferencesToNullableInOptional: z.boolean().optional().describe("Whether nullable schema references are also treated as optional."),
|
|
1728
|
+
coerceOptionalSchemasToNullable: z.boolean().optional().describe("Whether optional properties are represented as nullable required properties."),
|
|
1729
|
+
pathParameterOrder: z.enum(["url-order", "spec-order"]).optional().describe("Whether path parameters follow their URL order or specification order."),
|
|
1730
|
+
onlyIncludeReferencedSchemas: z.boolean().optional().describe("Whether unreferenced schemas are omitted from the generated SDK."),
|
|
1731
|
+
objectQueryParameters: z.boolean().optional().describe("Whether object-valued query parameters are preserved as objects."),
|
|
1732
|
+
typeDatesAsStrings: z.boolean().optional().describe("Whether date and date-time schemas are generated as strings."),
|
|
1733
|
+
groupMultiApiEnvironments: z.boolean().optional().describe(
|
|
1734
|
+
"Whether environments from multiple API sources are merged into shared named groups."
|
|
1735
|
+
),
|
|
1736
|
+
ignoreTags: z.boolean().optional().describe("Whether API tags are ignored when organizing generated resources."),
|
|
1737
|
+
disambiguateRequestNames: z.boolean().optional().describe("Whether colliding request type names are automatically disambiguated."),
|
|
1738
|
+
respectReadonlySchemas: z.boolean().optional().describe(
|
|
1739
|
+
"Whether read-only properties are modeled separately for request and response types."
|
|
1740
|
+
),
|
|
1741
|
+
discriminatedUnionV2: z.boolean().optional().describe("Whether oneOf and anyOf schemas use the newer discriminator inference rules."),
|
|
1742
|
+
undiscriminatedUnionsWithLiterals: z.boolean().optional().describe("Whether literal-bearing unions remain undiscriminated during import."),
|
|
1743
|
+
inlineAllOfSchemas: z.boolean().optional().describe("Whether schemas composed with allOf are inlined when possible."),
|
|
1744
|
+
resolveSchemaCollisions: z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
|
|
1745
|
+
asyncApiMessageNaming: z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
|
|
1746
|
+
defaultIntegerFormat: z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one.")
|
|
1713
1747
|
});
|
|
1714
1748
|
var sourceSpecTypeSchema = z.enum([
|
|
1715
1749
|
"openapi",
|
|
@@ -1721,27 +1755,30 @@ var sourceSpecTypeSchema = z.enum([
|
|
|
1721
1755
|
|
|
1722
1756
|
// src/sdk-config/v1/source.ts
|
|
1723
1757
|
var sourceSpecShape = {
|
|
1724
|
-
id: nonEmptyStringSchema,
|
|
1725
|
-
type: sourceSpecTypeSchema,
|
|
1726
|
-
name: nonEmptyStringSchema.optional(),
|
|
1727
|
-
namespace: nonEmptyStringSchema.optional(),
|
|
1728
|
-
apiImportSettings: apiImportSettingsSchema.optional(),
|
|
1729
|
-
overlays: z.array(relativePathSchema).optional(),
|
|
1730
|
-
overrides: z.array(relativePathSchema).optional()
|
|
1758
|
+
id: nonEmptyStringSchema.describe("A unique identifier for this API source."),
|
|
1759
|
+
type: sourceSpecTypeSchema.describe("The API description format of this source."),
|
|
1760
|
+
name: nonEmptyStringSchema.optional().describe("A human-readable name for this API source."),
|
|
1761
|
+
namespace: nonEmptyStringSchema.optional().describe("A namespace used to isolate this source in a multi-source SDK."),
|
|
1762
|
+
apiImportSettings: apiImportSettingsSchema.optional().describe("Import behavior that overrides the source-level defaults for this spec."),
|
|
1763
|
+
overlays: z.array(relativePathSchema).optional().describe("Relative paths to overlays applied to this source in order."),
|
|
1764
|
+
overrides: z.array(relativePathSchema).optional().describe("Relative paths to source override files applied in order.")
|
|
1731
1765
|
};
|
|
1732
1766
|
var sdkConfigV1SourceSpecSchema = z.union(
|
|
1733
1767
|
[
|
|
1734
|
-
z.strictObject({ ...sourceSpecShape, path: relativePathSchema }),
|
|
1735
1768
|
z.strictObject({
|
|
1736
1769
|
...sourceSpecShape,
|
|
1737
|
-
|
|
1770
|
+
path: relativePathSchema.describe("The relative path to the API source file.")
|
|
1771
|
+
}),
|
|
1772
|
+
z.strictObject({
|
|
1773
|
+
...sourceSpecShape,
|
|
1774
|
+
url: z.url({ protocol: /^https?$/ }).describe("The HTTP or HTTPS URL of the API source file.")
|
|
1738
1775
|
})
|
|
1739
1776
|
],
|
|
1740
1777
|
{ error: "source spec must contain exactly one locator: path or HTTP(S) url" }
|
|
1741
1778
|
);
|
|
1742
1779
|
var sdkConfigV1SourceConfigSchema = z.strictObject({
|
|
1743
|
-
specs: z.array(sdkConfigV1SourceSpecSchema).min(1, "source.specs must contain at least one source spec"),
|
|
1744
|
-
apiImportSettings: apiImportSettingsSchema.optional()
|
|
1780
|
+
specs: z.array(sdkConfigV1SourceSpecSchema).min(1, "source.specs must contain at least one source spec").describe("API source files in authoritative processing order."),
|
|
1781
|
+
apiImportSettings: apiImportSettingsSchema.optional().describe("Default import behavior shared by every source spec.")
|
|
1745
1782
|
}).superRefine(({ specs }, context) => {
|
|
1746
1783
|
const seenIds = /* @__PURE__ */ new Set();
|
|
1747
1784
|
specs.forEach(({ id }, index) => {
|
|
@@ -1756,79 +1793,80 @@ var sdkConfigV1SourceConfigSchema = z.strictObject({
|
|
|
1756
1793
|
});
|
|
1757
1794
|
});
|
|
1758
1795
|
var cliGenerationConfigSchema = z.strictObject({
|
|
1759
|
-
paginationParameters: z.array(nonEmptyStringSchema).optional(),
|
|
1760
|
-
skills: z.boolean().optional()
|
|
1796
|
+
paginationParameters: z.array(nonEmptyStringSchema).optional().describe("Request parameter names treated as pagination controls by the CLI."),
|
|
1797
|
+
skills: z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands.")
|
|
1761
1798
|
});
|
|
1762
1799
|
var csharpGenerationConfigSchema = z.strictObject({
|
|
1763
|
-
useOptionalWrapper: z.boolean().optional(),
|
|
1764
|
-
simplifyObjectDictionaries: z.boolean().optional(),
|
|
1765
|
-
explicitNamespaces: z.boolean().optional(),
|
|
1766
|
-
rootNamespaceForCoreClasses: z.boolean().optional(),
|
|
1767
|
-
includeExceptionHandler: z.boolean().optional(),
|
|
1768
|
-
experimentalExplicitNullableOptional: z.boolean().optional()
|
|
1800
|
+
useOptionalWrapper: z.boolean().optional().describe("Whether optional values use an explicit Optional wrapper."),
|
|
1801
|
+
simplifyObjectDictionaries: z.boolean().optional().describe("Whether object schemas with arbitrary values use simplified dictionary types."),
|
|
1802
|
+
explicitNamespaces: z.boolean().optional().describe("Whether generated resource groups use explicit nested namespaces."),
|
|
1803
|
+
rootNamespaceForCoreClasses: z.boolean().optional().describe("Whether shared client classes are emitted in the root namespace."),
|
|
1804
|
+
includeExceptionHandler: z.boolean().optional().describe("Whether generated client operations use a configurable exception handler."),
|
|
1805
|
+
experimentalExplicitNullableOptional: z.boolean().optional().describe(
|
|
1806
|
+
"Whether optional nullable properties distinguish omitted values from explicit nulls."
|
|
1807
|
+
)
|
|
1769
1808
|
});
|
|
1770
1809
|
var goGenerationConfigSchema = z.strictObject({
|
|
1771
|
-
legacyComplexModels: z.boolean().optional(),
|
|
1810
|
+
legacyComplexModels: z.boolean().optional().describe("Whether complex models use the legacy Go representation."),
|
|
1772
1811
|
/** Uppercase common initialisms in generated names (`UserID` rather than `UserId`). */
|
|
1773
|
-
smartCasing: z.boolean().optional(),
|
|
1812
|
+
smartCasing: z.boolean().optional().describe("Whether generated Go names capitalize common initialisms."),
|
|
1774
1813
|
/** Overrides the fern root-client constructor independently from the client type name. */
|
|
1775
|
-
clientConstructorName: nonEmptyStringSchema.optional(),
|
|
1776
|
-
unionVersion: z.enum(["v0", "v1"]).optional(),
|
|
1777
|
-
includeLegacyClientOptions: z.boolean().optional()
|
|
1814
|
+
clientConstructorName: nonEmptyStringSchema.optional().describe("The generated root-client constructor name."),
|
|
1815
|
+
unionVersion: z.enum(["v0", "v1"]).optional().describe("The representation used for generated Go unions."),
|
|
1816
|
+
includeLegacyClientOptions: z.boolean().optional().describe("Whether the client retains legacy constructor option helpers.")
|
|
1778
1817
|
});
|
|
1779
1818
|
var jvmGenerationConfigSchema = z.strictObject({
|
|
1780
|
-
packageLayout: z.enum(["flat", "nested"]).optional(),
|
|
1781
|
-
useLocalDateForDates: z.boolean().optional(),
|
|
1782
|
-
collapseOptionalNullable: z.boolean().optional(),
|
|
1783
|
-
gradleDistributionUrl: z.string().min(1).optional(),
|
|
1784
|
-
gradlePluginManagement: z.string().optional(),
|
|
1785
|
-
gradleCentralDependencyManagement: z.boolean().optional(),
|
|
1819
|
+
packageLayout: z.enum(["flat", "nested"]).optional().describe("Whether generated JVM packages use a flat or nested resource layout."),
|
|
1820
|
+
useLocalDateForDates: z.boolean().optional().describe("Whether date-only values use LocalDate instead of OffsetDateTime."),
|
|
1821
|
+
collapseOptionalNullable: z.boolean().optional().describe("Whether optional nullable values collapse into a single nullable representation."),
|
|
1822
|
+
gradleDistributionUrl: z.string().min(1).optional().describe("The Gradle distribution URL written to the generated wrapper."),
|
|
1823
|
+
gradlePluginManagement: z.string().optional().describe("Plugin management configuration added to the generated Gradle settings."),
|
|
1824
|
+
gradleCentralDependencyManagement: z.boolean().optional().describe("Whether dependency versions are managed centrally in the Gradle project."),
|
|
1786
1825
|
/** Selects co-located async methods or a separate async client surface. */
|
|
1787
|
-
asyncStyle: z.enum(["dedicated-client", "twin-methods"]).optional()
|
|
1826
|
+
asyncStyle: z.enum(["dedicated-client", "twin-methods"]).optional().describe("Whether asynchronous operations use a separate client or co-located methods.")
|
|
1788
1827
|
});
|
|
1789
1828
|
|
|
1790
1829
|
// src/sdk-config-domain/v1/language/java.ts
|
|
1791
1830
|
var javaGenerationConfigSchema = jvmGenerationConfigSchema.extend({
|
|
1792
|
-
includeKotlinSnippets: z.boolean().optional()
|
|
1831
|
+
includeKotlinSnippets: z.boolean().optional().describe("Whether Java SDK documentation includes Kotlin usage snippets.")
|
|
1793
1832
|
});
|
|
1794
1833
|
|
|
1795
1834
|
// src/sdk-config-domain/v1/language/kotlin.ts
|
|
1796
1835
|
var kotlinGenerationConfigSchema = jvmGenerationConfigSchema;
|
|
1797
1836
|
var compilerOptionsSchema = z.strictObject({
|
|
1798
|
-
target: nonEmptyStringSchema.optional(),
|
|
1799
|
-
module: nonEmptyStringSchema.optional(),
|
|
1800
|
-
lib: z.array(nonEmptyStringSchema).optional()
|
|
1837
|
+
target: nonEmptyStringSchema.optional().describe("The JavaScript language target passed to TypeScript."),
|
|
1838
|
+
module: nonEmptyStringSchema.optional().describe("The module format passed to TypeScript."),
|
|
1839
|
+
lib: z.array(nonEmptyStringSchema).optional().describe("The runtime library definitions passed to TypeScript.")
|
|
1801
1840
|
});
|
|
1802
1841
|
var packageScriptSchema = z.strictObject({
|
|
1803
|
-
name: nonEmptyStringSchema,
|
|
1804
|
-
command: nonEmptyStringSchema
|
|
1842
|
+
name: nonEmptyStringSchema.describe("The package script name."),
|
|
1843
|
+
command: nonEmptyStringSchema.describe("The command executed by the package script.")
|
|
1805
1844
|
});
|
|
1806
1845
|
var httpClientSchema = z.strictObject({
|
|
1807
|
-
name: z.enum(["axios", "fetch"])
|
|
1846
|
+
name: z.enum(["axios", "fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
1808
1847
|
});
|
|
1809
1848
|
var typescriptGenerationConfigSchema = z.strictObject({
|
|
1810
|
-
typescriptVersion: nonEmptyStringSchema.optional(),
|
|
1811
|
-
zodVersion: nonEmptyStringSchema.optional(),
|
|
1812
|
-
compilerOptions: compilerOptionsSchema.optional(),
|
|
1813
|
-
httpClient: httpClientSchema.optional(),
|
|
1814
|
-
packageManager: z.enum(["pnpm", "yarn"]).optional(),
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
exportClassDefault: z.boolean().optional(),
|
|
1849
|
+
typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
|
|
1850
|
+
zodVersion: nonEmptyStringSchema.optional().describe("The Zod version used by generated runtime schemas."),
|
|
1851
|
+
compilerOptions: compilerOptionsSchema.optional().describe("TypeScript compiler options for the generated project."),
|
|
1852
|
+
httpClient: httpClientSchema.optional().describe("The HTTP client used by generated TypeScript code."),
|
|
1853
|
+
packageManager: z.enum(["pnpm", "yarn"]).optional().describe("The package manager used by the generated project."),
|
|
1854
|
+
packageManagerVersion: nonEmptyStringSchema.optional().describe("The package manager version used by the generated project."),
|
|
1855
|
+
testFramework: z.enum(["jest", "vitest"]).optional().describe("The test framework used by generated tests."),
|
|
1856
|
+
namingStrategy: z.enum(["base", "originalPropertyNames"]).optional().describe("How schema property names are converted into TypeScript identifiers."),
|
|
1857
|
+
bundle: z.boolean().optional().describe("Whether the generated package includes bundled output."),
|
|
1858
|
+
exportClassDefault: z.boolean().optional().describe("Whether the client class is also exported as the default export."),
|
|
1821
1859
|
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
1822
|
-
namespaceExportName: nonEmptyStringSchema.optional(),
|
|
1823
|
-
consolidateTypeFiles: z.boolean().optional(),
|
|
1824
|
-
allowCustomFetcher: z.boolean().optional(),
|
|
1825
|
-
useBrandedStringAliases: z.boolean().optional(),
|
|
1826
|
-
useLegacyExports: z.boolean().optional(),
|
|
1827
|
-
useBigInt: z.boolean().optional(),
|
|
1828
|
-
serdeLayer: z.boolean().optional(),
|
|
1860
|
+
namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
|
|
1861
|
+
consolidateTypeFiles: z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
|
|
1862
|
+
allowCustomFetcher: z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
|
|
1863
|
+
useBrandedStringAliases: z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
|
|
1864
|
+
useLegacyExports: z.boolean().optional().describe("Whether the package emits the legacy export layout."),
|
|
1865
|
+
useBigInt: z.boolean().optional().describe("Whether 64-bit integer values are represented with bigint."),
|
|
1866
|
+
serdeLayer: z.boolean().optional().describe("Whether generated models use Fern serialization and deserialization helpers."),
|
|
1829
1867
|
/** Ship only the ESM build (drops CJS) to avoid the Node dual-package hazard. */
|
|
1830
|
-
esmOnly: z.boolean().optional(),
|
|
1831
|
-
scripts: z.array(packageScriptSchema).optional()
|
|
1868
|
+
esmOnly: z.boolean().optional().describe("Whether the package emits only ECMAScript modules."),
|
|
1869
|
+
scripts: z.array(packageScriptSchema).optional().describe("Additional scripts added to the generated package manifest.")
|
|
1832
1870
|
});
|
|
1833
1871
|
|
|
1834
1872
|
// src/sdk-config-domain/v1/language/mcp.ts
|
|
@@ -1843,172 +1881,183 @@ var mcpAvailabilityStatuses = [
|
|
|
1843
1881
|
"LEGACY"
|
|
1844
1882
|
];
|
|
1845
1883
|
var mcpToolFilterSchema = z.strictObject({
|
|
1846
|
-
include: z.array(nonEmptyStringSchema).optional(),
|
|
1847
|
-
exclude: z.array(nonEmptyStringSchema).optional()
|
|
1884
|
+
include: z.array(nonEmptyStringSchema).optional().describe("Operations explicitly included as MCP tools."),
|
|
1885
|
+
exclude: z.array(nonEmptyStringSchema).optional().describe("Operations explicitly excluded from MCP tools.")
|
|
1848
1886
|
});
|
|
1849
1887
|
var mcpToolsetNameSchema = nonEmptyStringSchema.refine(
|
|
1850
1888
|
(name) => name !== "default" && /^[a-z0-9-]+$/.test(name),
|
|
1851
1889
|
'toolset names must match [a-z0-9-]+ and cannot be "default"'
|
|
1852
1890
|
);
|
|
1853
1891
|
var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
|
|
1854
|
-
serverName: nonEmptyStringSchema.optional(),
|
|
1855
|
-
serverDescription: nonEmptyStringSchema.optional(),
|
|
1856
|
-
excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional(),
|
|
1857
|
-
tools: mcpToolFilterSchema.optional(),
|
|
1858
|
-
toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional()
|
|
1892
|
+
serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
|
|
1893
|
+
serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
|
|
1894
|
+
excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
|
|
1895
|
+
tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
|
|
1896
|
+
toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset.")
|
|
1859
1897
|
});
|
|
1860
1898
|
var phpGenerationConfigSchema = z.strictObject({
|
|
1861
|
-
propertyAccess: z.enum(["public", "private"]).optional(),
|
|
1862
|
-
generateClientInterfaces: z.boolean().optional()
|
|
1899
|
+
propertyAccess: z.enum(["public", "private"]).optional().describe("The visibility of generated PHP model properties."),
|
|
1900
|
+
generateClientInterfaces: z.boolean().optional().describe("Whether interfaces are generated for PHP client classes.")
|
|
1863
1901
|
});
|
|
1864
1902
|
var pythonClientSchema = z.strictObject({
|
|
1865
|
-
fileName: nonEmptyStringSchema.optional(),
|
|
1866
|
-
exportedFileName: nonEmptyStringSchema.optional()
|
|
1903
|
+
fileName: nonEmptyStringSchema.optional().describe("The source file name for the Python client."),
|
|
1904
|
+
exportedFileName: nonEmptyStringSchema.optional().describe("The file name used when exporting the Python client.")
|
|
1867
1905
|
});
|
|
1868
1906
|
var pydanticConfigSchema = z.strictObject({
|
|
1869
|
-
versionCompatibility: z.enum(["v1", "v2", "both", "v1-on-v2"]).optional(),
|
|
1870
|
-
frozen: z.boolean().optional(),
|
|
1871
|
-
requireOptionalFields: z.boolean().optional(),
|
|
1872
|
-
unionNaming: z.enum(["v0", "v1"]).optional(),
|
|
1873
|
-
useFieldAliases: z.boolean().optional()
|
|
1907
|
+
versionCompatibility: z.enum(["v1", "v2", "both", "v1-on-v2"]).optional().describe("The Pydantic major versions supported by generated models."),
|
|
1908
|
+
frozen: z.boolean().optional().describe("Whether generated Pydantic models are immutable."),
|
|
1909
|
+
requireOptionalFields: z.boolean().optional().describe("Whether Optional fields remain required unless they declare a default."),
|
|
1910
|
+
unionNaming: z.enum(["v0", "v1"]).optional().describe("The naming strategy for generated union types."),
|
|
1911
|
+
useFieldAliases: z.boolean().optional().describe("Whether Pydantic field aliases preserve wire names.")
|
|
1874
1912
|
});
|
|
1875
1913
|
var additionalInitExportSchema = z.strictObject({
|
|
1876
|
-
from: nonEmptyStringSchema,
|
|
1877
|
-
imports: z.array(nonEmptyStringSchema).min(1)
|
|
1914
|
+
from: nonEmptyStringSchema.describe("The module from which names are re-exported."),
|
|
1915
|
+
imports: z.array(nonEmptyStringSchema).min(1).describe("Names re-exported from the module.")
|
|
1878
1916
|
});
|
|
1879
1917
|
var pythonGenerationConfigSchema = z.strictObject({
|
|
1880
|
-
pythonVersion: nonEmptyStringSchema.optional(),
|
|
1881
|
-
pydanticVersion: nonEmptyStringSchema.optional(),
|
|
1882
|
-
pydantic: pydanticConfigSchema.optional(),
|
|
1883
|
-
client: pythonClientSchema.optional(),
|
|
1918
|
+
pythonVersion: nonEmptyStringSchema.optional().describe("The Python version targeted by the generated project."),
|
|
1919
|
+
pydanticVersion: nonEmptyStringSchema.optional().describe("The Pydantic dependency version requirement."),
|
|
1920
|
+
pydantic: pydanticConfigSchema.optional().describe("Pydantic model-generation behavior."),
|
|
1921
|
+
client: pythonClientSchema.optional().describe("Python client file naming."),
|
|
1884
1922
|
/** Default followed by generated sync and async HTTP clients when the caller does not override it. */
|
|
1885
|
-
followRedirectsByDefault: z.boolean().optional(),
|
|
1923
|
+
followRedirectsByDefault: z.boolean().optional().describe("Whether generated HTTP clients follow redirects by default."),
|
|
1886
1924
|
/** Chunk size passed to Python byte-stream iterators. */
|
|
1887
|
-
defaultBytesStreamChunkSize: z.number().int().positive().optional(),
|
|
1925
|
+
defaultBytesStreamChunkSize: z.number().int().positive().optional().describe("The default byte-stream iterator chunk size."),
|
|
1888
1926
|
/** Python interpreter recursion limit installed by the generated package at import time. */
|
|
1889
|
-
recursionLimit: z.number().int().gt(1e3).optional(),
|
|
1927
|
+
recursionLimit: z.number().int().gt(1e3).optional().describe("The Python recursion limit installed when the generated package is imported."),
|
|
1890
1928
|
/** Published Python extras, keyed by extra name with package dependency names as values. */
|
|
1891
|
-
extras: z.record(nonEmptyStringSchema, z.array(nonEmptyStringSchema)).optional(),
|
|
1892
|
-
alwaysInitializeOptionals: z.boolean().optional(),
|
|
1893
|
-
useTypedDictRequests: z.boolean().optional(),
|
|
1894
|
-
additionalInitExports: z.array(additionalInitExportSchema).optional()
|
|
1929
|
+
extras: z.record(nonEmptyStringSchema, z.array(nonEmptyStringSchema)).optional().describe("Published Python extras and their dependency names."),
|
|
1930
|
+
alwaysInitializeOptionals: z.boolean().optional().describe("Whether optional model fields are initialized even when omitted."),
|
|
1931
|
+
useTypedDictRequests: z.boolean().optional().describe("Whether request bodies are generated as TypedDict types."),
|
|
1932
|
+
additionalInitExports: z.array(additionalInitExportSchema).optional().describe("Additional names re-exported from the package initializer.")
|
|
1895
1933
|
});
|
|
1896
1934
|
var rubyGenerationConfigSchema = z.strictObject({
|
|
1897
|
-
requirePaths: z.array(nonEmptyStringSchema).optional()
|
|
1935
|
+
requirePaths: z.array(nonEmptyStringSchema).optional().describe("Ruby load paths included in the generated gem specification.")
|
|
1898
1936
|
});
|
|
1899
1937
|
var rustGenerationConfigSchema = z.strictObject({
|
|
1900
1938
|
/**
|
|
1901
1939
|
* Rust type for datetime primitives. `offset` maps to `DateTime<FixedOffset>` and preserves the
|
|
1902
1940
|
* timezone the payload carried; `utc` maps to `DateTime<Utc>` and normalizes to UTC.
|
|
1903
1941
|
*/
|
|
1904
|
-
dateTimeType: z.enum(["offset", "utc"]).optional(),
|
|
1942
|
+
dateTimeType: z.enum(["offset", "utc"]).optional().describe("Whether datetime values preserve their offset or normalize to UTC."),
|
|
1905
1943
|
/** Uppercase common initialisms in generated names (`UserID` rather than `UserId`). */
|
|
1906
|
-
capitalizeInitialisms: z.boolean().optional(),
|
|
1944
|
+
capitalizeInitialisms: z.boolean().optional().describe("Whether generated Rust names capitalize common initialisms."),
|
|
1907
1945
|
/** Cargo features, mapping a feature name to the dependencies or features it enables. */
|
|
1908
|
-
features: z.record(z.string(), z.array(nonEmptyStringSchema)).optional(),
|
|
1946
|
+
features: z.record(z.string(), z.array(nonEmptyStringSchema)).optional().describe("Cargo features and the dependencies or features each enables."),
|
|
1909
1947
|
/** Overrides which features make up Cargo's `default` feature set. */
|
|
1910
|
-
defaultFeatures: z.array(nonEmptyStringSchema).optional()
|
|
1948
|
+
defaultFeatures: z.array(nonEmptyStringSchema).optional().describe("Cargo features included in the crate default feature set.")
|
|
1911
1949
|
});
|
|
1912
1950
|
var swiftGenerationConfigSchema = z.strictObject({
|
|
1913
|
-
moduleName: nonEmptyStringSchema.optional(),
|
|
1914
|
-
nullableAsOptional: z.boolean().optional()
|
|
1951
|
+
moduleName: nonEmptyStringSchema.optional().describe("The Swift module name for the generated package."),
|
|
1952
|
+
nullableAsOptional: z.boolean().optional().describe("Whether nullable values are represented as Swift optionals.")
|
|
1915
1953
|
});
|
|
1916
1954
|
var planModifierSourceSchema = z.discriminatedUnion("enabled", [
|
|
1917
|
-
z.strictObject({
|
|
1918
|
-
|
|
1955
|
+
z.strictObject({
|
|
1956
|
+
enabled: z.literal(true).describe("Enables custom Terraform plan modifiers."),
|
|
1957
|
+
sourceDir: nonEmptyStringSchema.describe(
|
|
1958
|
+
"The directory containing custom plan modifier source files."
|
|
1959
|
+
)
|
|
1960
|
+
}),
|
|
1961
|
+
z.strictObject({
|
|
1962
|
+
enabled: z.literal(false).describe("Disables custom Terraform plan modifiers.")
|
|
1963
|
+
})
|
|
1919
1964
|
]);
|
|
1920
1965
|
var planModifiersSchema = z.strictObject({
|
|
1921
|
-
resources: planModifierSourceSchema,
|
|
1922
|
-
attributes: planModifierSourceSchema
|
|
1966
|
+
resources: planModifierSourceSchema.describe("Custom plan modifiers for generated resources."),
|
|
1967
|
+
attributes: planModifierSourceSchema.describe("Custom plan modifiers for generated attributes.")
|
|
1923
1968
|
});
|
|
1924
1969
|
var providerSchemaSchema = z.strictObject({
|
|
1925
|
-
addressKey: nonEmptyStringSchema
|
|
1926
|
-
|
|
1970
|
+
addressKey: nonEmptyStringSchema.describe(
|
|
1971
|
+
"The provider attribute used to configure the API address."
|
|
1972
|
+
),
|
|
1973
|
+
authTokenKey: nonEmptyStringSchema.describe(
|
|
1974
|
+
"The provider attribute used to configure the authentication token."
|
|
1975
|
+
)
|
|
1927
1976
|
});
|
|
1928
1977
|
var terraformGenerationConfigSchema = z.strictObject({
|
|
1929
|
-
providerName: nonEmptyStringSchema.optional(),
|
|
1930
|
-
providerVersion: nonEmptyStringSchema.optional(),
|
|
1931
|
-
providerModulePath: goModulePathSchema.optional(),
|
|
1932
|
-
mockAcceptance: z.boolean().optional(),
|
|
1933
|
-
hideComputedDiff: z.boolean().optional(),
|
|
1934
|
-
providerSchema: providerSchemaSchema.optional(),
|
|
1935
|
-
planModifiers: planModifiersSchema.optional()
|
|
1978
|
+
providerName: nonEmptyStringSchema.optional().describe("The Terraform provider name."),
|
|
1979
|
+
providerVersion: nonEmptyStringSchema.optional().describe("The generated Terraform provider version."),
|
|
1980
|
+
providerModulePath: goModulePathSchema.optional().describe("The Go module path for the generated provider."),
|
|
1981
|
+
mockAcceptance: z.boolean().optional().describe("Whether acceptance tests use a mock API server."),
|
|
1982
|
+
hideComputedDiff: z.boolean().optional().describe("Whether computed-only changes are hidden from Terraform plans."),
|
|
1983
|
+
providerSchema: providerSchemaSchema.optional().describe("Names of provider-level configuration attributes."),
|
|
1984
|
+
planModifiers: planModifiersSchema.optional().describe("Custom plan modifier source configuration.")
|
|
1936
1985
|
});
|
|
1937
1986
|
|
|
1938
1987
|
// src/sdk-config/v1/target.ts
|
|
1939
1988
|
var targetOverrideShape = {
|
|
1940
|
-
generatorVersion: exactSemverSchema.optional(),
|
|
1941
|
-
sdkName: nonEmptyStringSchema.optional(),
|
|
1942
|
-
sdkVersion: nonEmptyStringSchema.optional(),
|
|
1943
|
-
client: sdkConfigV1ClientConfigOverrideSchema.optional(),
|
|
1944
|
-
docs: sdkConfigV1DocsConfigSchema.optional(),
|
|
1945
|
-
package: sdkConfigV1PackageConfigSchema.optional(),
|
|
1946
|
-
output: sdkConfigV1OutputConfigSchema.optional()
|
|
1989
|
+
generatorVersion: exactSemverSchema.optional().describe("The exact generator version used for this target."),
|
|
1990
|
+
sdkName: nonEmptyStringSchema.optional().describe("An SDK name that overrides the root value for this target."),
|
|
1991
|
+
sdkVersion: nonEmptyStringSchema.optional().describe("An SDK version that overrides the root value for this target."),
|
|
1992
|
+
client: sdkConfigV1ClientConfigOverrideSchema.optional().describe("Client settings that override root client configuration for this target."),
|
|
1993
|
+
docs: sdkConfigV1DocsConfigSchema.optional().describe("Documentation settings that override root documentation for this target."),
|
|
1994
|
+
package: sdkConfigV1PackageConfigSchema.optional().describe("Package metadata that overrides root package configuration for this target."),
|
|
1995
|
+
output: sdkConfigV1OutputConfigSchema.optional().describe("Output configuration that replaces the root output for this target.")
|
|
1947
1996
|
};
|
|
1948
1997
|
var sdkConfigV1TargetSchema = z.discriminatedUnion("language", [
|
|
1949
1998
|
z.strictObject({
|
|
1950
|
-
language: z.literal("typescript"),
|
|
1951
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(typescriptGenerationConfigSchema.shape).optional(),
|
|
1999
|
+
language: z.literal("typescript").describe("Generates a TypeScript SDK."),
|
|
2000
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(typescriptGenerationConfigSchema.shape).optional().describe("Common and TypeScript-specific generation settings for this target."),
|
|
1952
2001
|
...targetOverrideShape
|
|
1953
2002
|
}),
|
|
1954
2003
|
z.strictObject({
|
|
1955
|
-
language: z.literal("python"),
|
|
1956
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(pythonGenerationConfigSchema.shape).optional(),
|
|
2004
|
+
language: z.literal("python").describe("Generates a Python SDK."),
|
|
2005
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(pythonGenerationConfigSchema.shape).optional().describe("Common and Python-specific generation settings for this target."),
|
|
1957
2006
|
...targetOverrideShape
|
|
1958
2007
|
}),
|
|
1959
2008
|
z.strictObject({
|
|
1960
|
-
language: z.literal("java"),
|
|
1961
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(javaGenerationConfigSchema.shape).optional(),
|
|
2009
|
+
language: z.literal("java").describe("Generates a Java SDK."),
|
|
2010
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(javaGenerationConfigSchema.shape).optional().describe("Common and Java-specific generation settings for this target."),
|
|
1962
2011
|
...targetOverrideShape
|
|
1963
2012
|
}),
|
|
1964
2013
|
z.strictObject({
|
|
1965
|
-
language: z.literal("kotlin"),
|
|
1966
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(kotlinGenerationConfigSchema.shape).optional(),
|
|
2014
|
+
language: z.literal("kotlin").describe("Generates a Kotlin SDK."),
|
|
2015
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(kotlinGenerationConfigSchema.shape).optional().describe("Common and Kotlin-specific generation settings for this target."),
|
|
1967
2016
|
...targetOverrideShape
|
|
1968
2017
|
}),
|
|
1969
2018
|
z.strictObject({
|
|
1970
|
-
language: z.literal("go"),
|
|
1971
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(goGenerationConfigSchema.shape).optional(),
|
|
2019
|
+
language: z.literal("go").describe("Generates a Go SDK."),
|
|
2020
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(goGenerationConfigSchema.shape).optional().describe("Common and Go-specific generation settings for this target."),
|
|
1972
2021
|
...targetOverrideShape
|
|
1973
2022
|
}),
|
|
1974
2023
|
z.strictObject({
|
|
1975
|
-
language: z.literal("csharp"),
|
|
1976
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(csharpGenerationConfigSchema.shape).optional(),
|
|
2024
|
+
language: z.literal("csharp").describe("Generates a C# SDK."),
|
|
2025
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(csharpGenerationConfigSchema.shape).optional().describe("Common and C#-specific generation settings for this target."),
|
|
1977
2026
|
...targetOverrideShape
|
|
1978
2027
|
}),
|
|
1979
2028
|
z.strictObject({
|
|
1980
|
-
language: z.literal("php"),
|
|
1981
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(phpGenerationConfigSchema.shape).optional(),
|
|
2029
|
+
language: z.literal("php").describe("Generates a PHP SDK."),
|
|
2030
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(phpGenerationConfigSchema.shape).optional().describe("Common and PHP-specific generation settings for this target."),
|
|
1982
2031
|
...targetOverrideShape
|
|
1983
2032
|
}),
|
|
1984
2033
|
z.strictObject({
|
|
1985
|
-
language: z.literal("ruby"),
|
|
1986
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(rubyGenerationConfigSchema.shape).optional(),
|
|
2034
|
+
language: z.literal("ruby").describe("Generates a Ruby SDK."),
|
|
2035
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(rubyGenerationConfigSchema.shape).optional().describe("Common and Ruby-specific generation settings for this target."),
|
|
1987
2036
|
...targetOverrideShape
|
|
1988
2037
|
}),
|
|
1989
2038
|
z.strictObject({
|
|
1990
|
-
language: z.literal("rust"),
|
|
1991
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(rustGenerationConfigSchema.shape).optional(),
|
|
2039
|
+
language: z.literal("rust").describe("Generates a Rust SDK."),
|
|
2040
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(rustGenerationConfigSchema.shape).optional().describe("Common and Rust-specific generation settings for this target."),
|
|
1992
2041
|
...targetOverrideShape
|
|
1993
2042
|
}),
|
|
1994
2043
|
z.strictObject({
|
|
1995
|
-
language: z.literal("swift"),
|
|
1996
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(swiftGenerationConfigSchema.shape).optional(),
|
|
2044
|
+
language: z.literal("swift").describe("Generates a Swift SDK."),
|
|
2045
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(swiftGenerationConfigSchema.shape).optional().describe("Common and Swift-specific generation settings for this target."),
|
|
1997
2046
|
...targetOverrideShape
|
|
1998
2047
|
}),
|
|
1999
2048
|
z.strictObject({
|
|
2000
|
-
language: z.literal("cli"),
|
|
2001
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(cliGenerationConfigSchema.shape).optional(),
|
|
2049
|
+
language: z.literal("cli").describe("Generates a command-line interface."),
|
|
2050
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(cliGenerationConfigSchema.shape).optional().describe("Common and CLI-specific generation settings for this target."),
|
|
2002
2051
|
...targetOverrideShape
|
|
2003
2052
|
}),
|
|
2004
2053
|
z.strictObject({
|
|
2005
|
-
language: z.literal("mcp"),
|
|
2006
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(mcpGenerationConfigSchema.shape).optional(),
|
|
2054
|
+
language: z.literal("mcp").describe("Generates an MCP server."),
|
|
2055
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(mcpGenerationConfigSchema.shape).optional().describe("Common and MCP-specific generation settings for this target."),
|
|
2007
2056
|
...targetOverrideShape
|
|
2008
2057
|
}),
|
|
2009
2058
|
z.strictObject({
|
|
2010
|
-
language: z.literal("terraform"),
|
|
2011
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(terraformGenerationConfigSchema.shape).optional(),
|
|
2059
|
+
language: z.literal("terraform").describe("Generates a Terraform provider."),
|
|
2060
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(terraformGenerationConfigSchema.shape).optional().describe("Common and Terraform-specific generation settings for this target."),
|
|
2012
2061
|
...targetOverrideShape
|
|
2013
2062
|
})
|
|
2014
2063
|
]);
|
|
@@ -2101,19 +2150,21 @@ function validateTargetPublishing(target, targetIndex, globalPackage, globalOutp
|
|
|
2101
2150
|
);
|
|
2102
2151
|
}
|
|
2103
2152
|
var sdkConfigV1Schema = z.strictObject({
|
|
2104
|
-
schemaVersion: z.literal(SDK_CONFIG_V1_SCHEMA_VERSION),
|
|
2105
|
-
sdkName: nonEmptyStringSchema,
|
|
2106
|
-
sdkVersion: nonEmptyStringSchema.default("1.0.0"),
|
|
2107
|
-
apiVersion: nonEmptyStringSchema.optional(),
|
|
2108
|
-
source: sdkConfigV1SourceConfigSchema
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2153
|
+
schemaVersion: z.literal(SDK_CONFIG_V1_SCHEMA_VERSION).describe("The version of the customer-facing SDK Config schema."),
|
|
2154
|
+
sdkName: nonEmptyStringSchema.describe("The default name used for generated SDKs."),
|
|
2155
|
+
sdkVersion: nonEmptyStringSchema.default("1.0.0").describe("The default version assigned to generated SDKs."),
|
|
2156
|
+
apiVersion: nonEmptyStringSchema.optional().describe("The version of the API represented by the generated SDKs."),
|
|
2157
|
+
source: sdkConfigV1SourceConfigSchema.describe(
|
|
2158
|
+
"The API descriptions used to generate the SDKs."
|
|
2159
|
+
),
|
|
2160
|
+
api: sdkConfigV1ApiConfigSchema.prefault({}).describe("Shared API behavior for every target."),
|
|
2161
|
+
client: sdkConfigV1ClientConfigSchema.prefault({}).describe("Shared generated-client behavior for every target."),
|
|
2162
|
+
package: sdkConfigV1PackageConfigSchema.prefault({}).describe("Package metadata inherited by every target."),
|
|
2163
|
+
output: sdkConfigV1OutputConfigSchema.optional().describe("The default output delivery and publication configuration."),
|
|
2164
|
+
replay: sdkConfigV1ReplayConfigSchema.optional().describe("Generation replay behavior shared by every target."),
|
|
2165
|
+
docs: sdkConfigV1DocsConfigSchema.prefault({}).describe("Documentation settings inherited by every target."),
|
|
2166
|
+
generation: sdkConfigV1GenerationConfigSchema.prefault({}).describe("Generation settings inherited by every target."),
|
|
2167
|
+
targets: z.array(sdkConfigV1TargetSchema).min(1).describe("Language targets to generate; each language may appear once.")
|
|
2117
2168
|
}).superRefine(({ output, package: globalPackage, targets }, context) => {
|
|
2118
2169
|
const configuredLanguages = /* @__PURE__ */ new Set();
|
|
2119
2170
|
targets.forEach((target, targetIndex) => {
|
|
@@ -2375,6 +2426,14 @@ function mapInvocation(generator, language, activeLanguages, index) {
|
|
|
2375
2426
|
...prefix,
|
|
2376
2427
|
"config"
|
|
2377
2428
|
]);
|
|
2429
|
+
const apiWideIdempotency = idempotencyKeyGenerationFrom(
|
|
2430
|
+
generator.idempotencyKeyGenerationConfig,
|
|
2431
|
+
[...prefix, "idempotencyKeyGenerationConfig"],
|
|
2432
|
+
state
|
|
2433
|
+
);
|
|
2434
|
+
if (apiWideIdempotency && client.idempotencyKeyGeneration === void 0) {
|
|
2435
|
+
client.idempotencyKeyGeneration = apiWideIdempotency;
|
|
2436
|
+
}
|
|
2378
2437
|
const rawGenerator = isObject(generator.raw) ? generator.raw : void 0;
|
|
2379
2438
|
const smartCasing = typeof rawGenerator?.["smart-casing"] === "boolean" ? rawGenerator["smart-casing"] : generator.smartCasing === false ? false : void 0;
|
|
2380
2439
|
const smartCasingDigitWordBoundary = typeof rawGenerator?.["smart-casing-digit-word-boundary"] === "boolean" ? rawGenerator["smart-casing-digit-word-boundary"] : generator.smartCasingDigitWordBoundary === true ? true : void 0;
|
|
@@ -2393,9 +2452,6 @@ function mapInvocation(generator, language, activeLanguages, index) {
|
|
|
2393
2452
|
if (generator.keywords?.length) {
|
|
2394
2453
|
generation.reservedKeywords = [...generator.keywords];
|
|
2395
2454
|
}
|
|
2396
|
-
if (generator.generateFullProject !== void 0) {
|
|
2397
|
-
generation.generateFullProject = generator.generateFullProject;
|
|
2398
|
-
}
|
|
2399
2455
|
const settings = isObject(generator.settings) ? generator.settings : void 0;
|
|
2400
2456
|
if (settings) {
|
|
2401
2457
|
const inlinePathParameters = takeBoolean(settings, ["inlinePathParameters"], state, [
|
|
@@ -2411,21 +2467,25 @@ function mapInvocation(generator, language, activeLanguages, index) {
|
|
|
2411
2467
|
...collectUnsupported(config, [...prefix, "config"], state),
|
|
2412
2468
|
...settings ? collectUnsupported(settings, [...prefix, "settings"], state) : [],
|
|
2413
2469
|
...isObject(generator.readme) ? collectUnsupported(generator.readme, [...prefix, "readme"], state) : [],
|
|
2414
|
-
...unsupportedResolvedFields(generator, index)
|
|
2470
|
+
...unsupportedResolvedFields(generator, index, apiWideIdempotency !== void 0)
|
|
2415
2471
|
];
|
|
2416
2472
|
return { client, docs, generation, package: packageConfig, targetGeneration, unsupportedFields };
|
|
2417
2473
|
}
|
|
2418
|
-
function unsupportedResolvedFields(generator, index) {
|
|
2474
|
+
function unsupportedResolvedFields(generator, index, idempotencyMapped) {
|
|
2419
2475
|
const values = [
|
|
2420
2476
|
["automation", isDefaultAutomation(generator.automation) ? void 0 : generator.automation],
|
|
2421
2477
|
["containerImage", generator.containerImage],
|
|
2422
2478
|
["irVersionOverride", generator.irVersionOverride],
|
|
2423
|
-
[
|
|
2479
|
+
[
|
|
2480
|
+
"idempotencyKeyGenerationConfig",
|
|
2481
|
+
idempotencyMapped ? void 0 : generator.idempotencyKeyGenerationConfig
|
|
2482
|
+
],
|
|
2424
2483
|
["absolutePathToLocalSnippets", generator.absolutePathToLocalSnippets],
|
|
2425
2484
|
[
|
|
2426
2485
|
"disableExamples",
|
|
2427
2486
|
generator.disableExamples === false ? void 0 : generator.disableExamples
|
|
2428
2487
|
],
|
|
2488
|
+
["generateFullProject", generator.generateFullProject],
|
|
2429
2489
|
["apiOverride", generator.apiOverride]
|
|
2430
2490
|
];
|
|
2431
2491
|
return values.flatMap(([field, value]) => {
|
|
@@ -2452,7 +2512,13 @@ function resolvedFieldGuidance(field) {
|
|
|
2452
2512
|
}
|
|
2453
2513
|
if (field === "idempotencyKeyGenerationConfig") {
|
|
2454
2514
|
return {
|
|
2455
|
-
|
|
2515
|
+
sdkConfigPath: ["client", "idempotencyKeyGeneration"],
|
|
2516
|
+
suggestedAction: "Use true, false, or an object with header-name and methods, or set client.idempotencyKeyGeneration manually."
|
|
2517
|
+
};
|
|
2518
|
+
}
|
|
2519
|
+
if (field === "generateFullProject") {
|
|
2520
|
+
return {
|
|
2521
|
+
suggestedAction: "Preserve this packaging setting on the generation request; it is not customer-authored SDK configuration."
|
|
2456
2522
|
};
|
|
2457
2523
|
}
|
|
2458
2524
|
return {
|
|
@@ -2462,6 +2528,20 @@ function resolvedFieldGuidance(field) {
|
|
|
2462
2528
|
function isDefaultAutomation(value) {
|
|
2463
2529
|
return isObject(value) && value.generate === true && value.upgrade === true && value.preview === true && value.verify === true;
|
|
2464
2530
|
}
|
|
2531
|
+
var HTTP_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"];
|
|
2532
|
+
function idempotencyKeyGenerationFrom(value, path, state) {
|
|
2533
|
+
if (typeof value === "boolean") {
|
|
2534
|
+
consume(state, path);
|
|
2535
|
+
return { enabled: value };
|
|
2536
|
+
}
|
|
2537
|
+
if (!isObject(value)) return void 0;
|
|
2538
|
+
const probe = { consumedPaths: /* @__PURE__ */ new Set() };
|
|
2539
|
+
const headerName = takeString(value, ["headerName"], probe, path);
|
|
2540
|
+
const methods = takeEnumArray(value, ["methods"], HTTP_METHODS, probe, path);
|
|
2541
|
+
if (probe.consumedPaths.size !== Object.keys(value).length) return void 0;
|
|
2542
|
+
consume(state, path);
|
|
2543
|
+
return { enabled: true, ...optional("headerName", headerName), ...optional("methods", methods) };
|
|
2544
|
+
}
|
|
2465
2545
|
function mapCommonConfig(language, config, state, client, generation, packageConfig, basePath) {
|
|
2466
2546
|
const inlinePath = takeBoolean(config, ["inlinePathParameters"], state, basePath);
|
|
2467
2547
|
const inlineFile = takeBoolean(config, ["inlineFileProperties"], state, basePath);
|
|
@@ -2486,6 +2566,23 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2486
2566
|
if (useDefaults !== void 0) client.useDefaultRequestParameterValues = useDefaults;
|
|
2487
2567
|
const respectOptionalBody = takeBoolean(config, ["respectOptionalRequestBody"], state, basePath);
|
|
2488
2568
|
if (respectOptionalBody !== void 0) client.respectOptionalRequestBody = respectOptionalBody;
|
|
2569
|
+
const idempotency = locate(config, ["autoGenerateIdempotencyKey"], basePath);
|
|
2570
|
+
const idempotencyKeyGeneration = idempotency && idempotencyKeyGenerationFrom(idempotency.value, idempotency.path, state);
|
|
2571
|
+
if (idempotencyKeyGeneration) client.idempotencyKeyGeneration = idempotencyKeyGeneration;
|
|
2572
|
+
const userAgent = compact({
|
|
2573
|
+
template: takeString(config, ["userAgent"], state, basePath),
|
|
2574
|
+
includePlatformInfo: takeBoolean(config, ["includePlatformHeaders"], state, basePath),
|
|
2575
|
+
allowAppInfo: takeBoolean(config, ["allowUserAgentAppInfo"], state, basePath)
|
|
2576
|
+
});
|
|
2577
|
+
if (Object.keys(userAgent).length) client.userAgent = userAgent;
|
|
2578
|
+
const offsetSemantics = takeEnum(
|
|
2579
|
+
config,
|
|
2580
|
+
["offsetSemantics"],
|
|
2581
|
+
["item-index", "page-index"],
|
|
2582
|
+
state,
|
|
2583
|
+
basePath
|
|
2584
|
+
);
|
|
2585
|
+
if (offsetSemantics !== void 0) client.offsetSemantics = offsetSemantics;
|
|
2489
2586
|
const maxRetries = takeNumber(config, ["maxRetries"], state, basePath);
|
|
2490
2587
|
const statusCodeProfile = takeEnum(
|
|
2491
2588
|
config,
|
|
@@ -2503,7 +2600,10 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2503
2600
|
const pythonClient = language === "python" ? takeObject(config, ["client"], state, basePath) : void 0;
|
|
2504
2601
|
const typescriptNaming = language === "typescript" || language === "mcp" ? takeObject(config, ["naming"], state, basePath) : void 0;
|
|
2505
2602
|
const directClientName = takeString(config, ["clientName", "clientClassName"], state, basePath);
|
|
2506
|
-
const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : typescriptNaming ? takeString(typescriptNaming.value, ["client"], state, typescriptNaming.path) :
|
|
2603
|
+
const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : typescriptNaming ? takeString(typescriptNaming.value, ["client"], state, typescriptNaming.path) : language === "ruby" ? (
|
|
2604
|
+
// Fern's Ruby generator renames the root client class (`Auth0::Management`) with it.
|
|
2605
|
+
takeString(config, ["clientModuleName"], state, basePath)
|
|
2606
|
+
) : void 0;
|
|
2507
2607
|
const directExportedClientName = takeString(
|
|
2508
2608
|
config,
|
|
2509
2609
|
["exportedClientName", "exportedClientClassName"],
|
|
@@ -2545,8 +2645,6 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2545
2645
|
const streams = mapTypescriptStreams(config, state, basePath);
|
|
2546
2646
|
if (streams) generation.streams = streams;
|
|
2547
2647
|
}
|
|
2548
|
-
const generateFullProject = takeBoolean(config, ["generateFullProject"], state, basePath);
|
|
2549
|
-
if (generateFullProject !== void 0) generation.generateFullProject = generateFullProject;
|
|
2550
2648
|
const inlineTypes = takeBoolean(config, ["enableInlineTypes"], state, basePath);
|
|
2551
2649
|
const omitUndefined = takeBoolean(config, ["omitUndefined"], state, basePath);
|
|
2552
2650
|
const forwardEnums = takeBoolean(config, ["enableForwardCompatibleEnums"], state, basePath);
|
|
@@ -2776,6 +2874,8 @@ function mapComposerRequirements(manifest, state, packageConfig) {
|
|
|
2776
2874
|
function mapRuby(config, state, packageConfig, basePath) {
|
|
2777
2875
|
const moduleName = takeString(config, ["moduleName"], state, basePath);
|
|
2778
2876
|
if (moduleName !== void 0) packageConfig.moduleName = moduleName;
|
|
2877
|
+
const packageName = takeString(config, ["package-name"], state, basePath);
|
|
2878
|
+
if (packageName !== void 0) packageConfig.packageName = packageName;
|
|
2779
2879
|
return compact({ requirePaths: takeStringArray(config, ["requirePaths"], state, basePath) });
|
|
2780
2880
|
}
|
|
2781
2881
|
function mapRust(config, state, packageConfig, basePath) {
|