@postman/sdk-config 0.6.0 → 0.8.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 +916 -765
- 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 +916 -765
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +678 -562
- 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 +678 -562
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +678 -562
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +74 -934
- package/dist/sdk-config/v1/index.d.ts +74 -934
- package/dist/sdk-config/v1/index.js +678 -562
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +607 -537
- 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 +607 -537
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +607 -537
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +25 -7
- package/dist/sdk-config-ir/v1/index.d.ts +25 -7
- package/dist/sdk-config-ir/v1/index.js +607 -537
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-BruxA5zG.d.cts → typescript-Chge0X4f.d.cts} +8 -1
- package/dist/{typescript-BruxA5zG.d.ts → typescript-Chge0X4f.d.ts} +8 -1
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +15 -14
- package/src/sdk-config-ir/v1/README.md +4 -2
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", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]),
|
|
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", "POST", "PUT", "DELETE", "PATCH", "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({
|
|
@@ -310,26 +324,26 @@ var tokenRefreshConfigSchema = z.strictObject({
|
|
|
310
324
|
}
|
|
311
325
|
});
|
|
312
326
|
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()
|
|
327
|
+
retry: clientRetryOverrideSchema.optional().describe("Retry behavior for generated API requests."),
|
|
328
|
+
responseHeaders: z.boolean().optional().describe("Whether generated operations expose HTTP response headers."),
|
|
329
|
+
responseValidation: z.boolean().optional().describe("Whether the client validates API responses against the schema."),
|
|
330
|
+
multiTenant: z.boolean().optional().describe("Whether the client exposes configuration for tenant-specific API access."),
|
|
331
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).optional().describe("Additional parameters added to the generated client constructor."),
|
|
332
|
+
timeoutMs: z.union([z.number().nonnegative(), z.literal("infinity")]).optional().describe('The default request timeout in milliseconds, or "infinity" for no timeout.'),
|
|
333
|
+
requestParameterStyle: parameterStyleSchema.optional().describe("Whether generated operation parameters are wrapped or passed inline."),
|
|
334
|
+
pathParameterStyle: parameterStyleSchema.optional().describe("Whether generated path parameters are wrapped or passed inline."),
|
|
335
|
+
filePropertyStyle: parameterStyleSchema.optional().describe("Whether generated file properties are wrapped or passed inline."),
|
|
336
|
+
useDefaultRequestParameterValues: z.boolean().optional().describe("Whether schema defaults are applied to omitted request parameters."),
|
|
337
|
+
respectOptionalRequestBody: z.boolean().optional().describe("Whether an optional request body remains optional in generated methods."),
|
|
338
|
+
tokenRefresh: tokenRefreshConfigSchema.optional().describe("Refresh-token behavior for the generated client.")
|
|
325
339
|
};
|
|
326
340
|
var clientConfigOverrideSchema = z.strictObject(clientOverrideShape);
|
|
327
341
|
var clientConfigSchema = z.strictObject({
|
|
328
342
|
...clientOverrideShape,
|
|
329
|
-
retry: retryConfigSchema.prefault({}),
|
|
330
|
-
responseHeaders: z.boolean().default(false),
|
|
331
|
-
multiTenant: z.boolean().default(false),
|
|
332
|
-
additionalConstructorParameters: z.array(constructorParameterSchema).default([])
|
|
343
|
+
retry: retryConfigSchema.prefault({}).describe("Retry behavior for generated API requests."),
|
|
344
|
+
responseHeaders: z.boolean().default(false).describe("Whether generated operations expose HTTP response headers."),
|
|
345
|
+
multiTenant: z.boolean().default(false).describe("Whether the client exposes configuration for tenant-specific API access."),
|
|
346
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).default([]).describe("Additional parameters added to the generated client constructor.")
|
|
333
347
|
});
|
|
334
348
|
|
|
335
349
|
// src/sdk-config/v1/client.ts
|
|
@@ -344,75 +358,75 @@ var composerPackageNameSchema = nonEmptyStringSchema.regex(
|
|
|
344
358
|
'Composer package name must be a lowercase "vendor/package" name'
|
|
345
359
|
);
|
|
346
360
|
var authorSchema = z.strictObject({
|
|
347
|
-
name: nonEmptyStringSchema,
|
|
348
|
-
email: z.email().optional(),
|
|
349
|
-
url: nonEmptyStringSchema.optional()
|
|
361
|
+
name: nonEmptyStringSchema.describe("The package author name."),
|
|
362
|
+
email: z.email().optional().describe("The package author email address."),
|
|
363
|
+
url: nonEmptyStringSchema.optional().describe("The package author website.")
|
|
350
364
|
});
|
|
351
365
|
var developerSchema = z.strictObject({
|
|
352
|
-
name: nonEmptyStringSchema,
|
|
353
|
-
email: z.email().optional(),
|
|
354
|
-
organization: nonEmptyStringSchema.optional(),
|
|
355
|
-
organizationUrl: nonEmptyStringSchema.optional()
|
|
366
|
+
name: nonEmptyStringSchema.describe("The package developer name."),
|
|
367
|
+
email: z.email().optional().describe("The package developer email address."),
|
|
368
|
+
organization: nonEmptyStringSchema.optional().describe("The developer organization name."),
|
|
369
|
+
organizationUrl: nonEmptyStringSchema.optional().describe("The developer organization website.")
|
|
356
370
|
});
|
|
357
371
|
var licenseSchema = z.strictObject({
|
|
358
|
-
type: nonEmptyStringSchema,
|
|
359
|
-
name: nonEmptyStringSchema.optional(),
|
|
360
|
-
url: nonEmptyStringSchema.optional(),
|
|
361
|
-
path: nonEmptyStringSchema.optional()
|
|
372
|
+
type: nonEmptyStringSchema.describe("The license identifier or license type."),
|
|
373
|
+
name: nonEmptyStringSchema.optional().describe("The human-readable license name."),
|
|
374
|
+
url: nonEmptyStringSchema.optional().describe("The URL containing the license text."),
|
|
375
|
+
path: nonEmptyStringSchema.optional().describe("The path to a custom license file.")
|
|
362
376
|
});
|
|
363
377
|
var dependencySourceSchema = z.discriminatedUnion("type", [
|
|
364
378
|
z.strictObject({
|
|
365
|
-
type: z.literal("registry"),
|
|
366
|
-
registry: nonEmptyStringSchema.optional()
|
|
379
|
+
type: z.literal("registry").describe("Resolves the dependency from a package registry."),
|
|
380
|
+
registry: nonEmptyStringSchema.optional().describe("The registry used to resolve the dependency.")
|
|
367
381
|
}),
|
|
368
382
|
z.strictObject({
|
|
369
|
-
type: z.literal("git"),
|
|
370
|
-
url: nonEmptyStringSchema,
|
|
371
|
-
ref: nonEmptyStringSchema.optional(),
|
|
372
|
-
subdirectory: nonEmptyStringSchema.optional()
|
|
383
|
+
type: z.literal("git").describe("Resolves the dependency from a Git repository."),
|
|
384
|
+
url: nonEmptyStringSchema.describe("The Git repository URL."),
|
|
385
|
+
ref: nonEmptyStringSchema.optional().describe("The Git branch, tag, or commit to use."),
|
|
386
|
+
subdirectory: nonEmptyStringSchema.optional().describe("The package subdirectory within the Git repository.")
|
|
373
387
|
}),
|
|
374
388
|
z.strictObject({
|
|
375
|
-
type: z.literal("path"),
|
|
376
|
-
path: nonEmptyStringSchema
|
|
389
|
+
type: z.literal("path").describe("Resolves the dependency from a local path."),
|
|
390
|
+
path: nonEmptyStringSchema.describe("The local path containing the dependency.")
|
|
377
391
|
})
|
|
378
392
|
]);
|
|
379
393
|
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()
|
|
394
|
+
name: nonEmptyStringSchema.describe("The dependency name used by the package manager."),
|
|
395
|
+
version: nonEmptyStringSchema.optional().describe("The dependency version requirement."),
|
|
396
|
+
source: dependencySourceSchema.optional().describe("A non-default source for the dependency."),
|
|
397
|
+
packageName: nonEmptyStringSchema.optional().describe("The source package name when it differs from the dependency alias."),
|
|
398
|
+
features: z.array(nonEmptyStringSchema).optional().describe("Cargo features enabled for this dependency."),
|
|
399
|
+
extras: z.array(nonEmptyStringSchema).optional().describe("Python extras enabled for this dependency."),
|
|
400
|
+
optional: z.boolean().optional().describe("Whether the dependency is optional."),
|
|
401
|
+
defaultFeatures: z.boolean().optional().describe("Whether the dependency enables its default Cargo features."),
|
|
402
|
+
environmentMarker: nonEmptyStringSchema.optional().describe("A Python environment marker that conditions this dependency.")
|
|
389
403
|
}).refine(({ source, version }) => source !== void 0 || version !== void 0, {
|
|
390
404
|
message: "dependency must define a version or a source"
|
|
391
405
|
});
|
|
392
406
|
var projectUrlSchema = z.strictObject({
|
|
393
|
-
label: nonEmptyStringSchema,
|
|
394
|
-
url: nonEmptyStringSchema
|
|
407
|
+
label: nonEmptyStringSchema.describe("The label displayed for the project link."),
|
|
408
|
+
url: nonEmptyStringSchema.describe("The project link URL.")
|
|
395
409
|
});
|
|
396
410
|
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()
|
|
411
|
+
packageName: nonEmptyStringSchema.optional().describe("The package name used by the target language registry."),
|
|
412
|
+
moduleName: nonEmptyStringSchema.optional().describe("The generated module or import name when it differs from the package name."),
|
|
413
|
+
modulePath: goModulePathSchema.optional().describe("The Go module path used for imports and publishing."),
|
|
414
|
+
namespace: nonEmptyStringSchema.optional().describe("The namespace or package prefix for generated code."),
|
|
415
|
+
groupId: nonEmptyStringSchema.optional().describe("The Maven group identifier."),
|
|
416
|
+
artifactId: nonEmptyStringSchema.optional().describe("The Maven artifact identifier."),
|
|
417
|
+
description: z.string().optional().describe("The package description used in generated metadata."),
|
|
418
|
+
repository: nonEmptyStringSchema.optional().describe("The source repository for the generated SDK."),
|
|
419
|
+
homepage: nonEmptyStringSchema.optional().describe("The package homepage URL."),
|
|
420
|
+
documentationUrl: nonEmptyStringSchema.optional().describe("The package documentation URL."),
|
|
421
|
+
authors: z.array(authorSchema).optional().describe("Authors credited in package metadata."),
|
|
422
|
+
developers: z.array(developerSchema).optional().describe("Developers credited in package metadata."),
|
|
423
|
+
license: licenseSchema.optional().describe("License metadata for the generated package."),
|
|
424
|
+
keywords: z.array(nonEmptyStringSchema).optional().describe("Search keywords for package metadata."),
|
|
425
|
+
classifiers: z.array(nonEmptyStringSchema).optional().describe("Package classifiers used by registries such as PyPI."),
|
|
426
|
+
projectUrls: z.array(projectUrlSchema).optional().describe("Labeled project links for package metadata."),
|
|
427
|
+
extraDependencies: z.array(dependencySchema).optional().describe("Additional runtime dependencies added to the generated package."),
|
|
428
|
+
extraDevDependencies: z.array(dependencySchema).optional().describe("Additional development dependencies added to the generated package."),
|
|
429
|
+
extraPeerDependencies: z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package.")
|
|
416
430
|
});
|
|
417
431
|
var httpMethodSchema = z.enum([
|
|
418
432
|
"GET",
|
|
@@ -426,34 +440,34 @@ var httpMethodSchema = z.enum([
|
|
|
426
440
|
"CONNECT"
|
|
427
441
|
]);
|
|
428
442
|
var readmeEndpointSchema = z.strictObject({
|
|
429
|
-
method: httpMethodSchema,
|
|
430
|
-
path: nonEmptyStringSchema,
|
|
431
|
-
stream: z.boolean().optional()
|
|
443
|
+
method: httpMethodSchema.describe("The HTTP method of the documented endpoint."),
|
|
444
|
+
path: nonEmptyStringSchema.describe("The endpoint path used in generated examples."),
|
|
445
|
+
stream: z.boolean().optional().describe("Whether the example uses the streaming response API.")
|
|
432
446
|
});
|
|
433
447
|
var readmeCustomSectionSchema = z.strictObject({
|
|
434
|
-
title: nonEmptyStringSchema,
|
|
435
|
-
content: z.string()
|
|
448
|
+
title: nonEmptyStringSchema.describe("The heading displayed for this README section."),
|
|
449
|
+
content: z.string().describe("The Markdown content of this README section.")
|
|
436
450
|
});
|
|
437
451
|
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()
|
|
452
|
+
apiName: nonEmptyStringSchema.optional().describe("The API name displayed in the README."),
|
|
453
|
+
introduction: z.string().optional().describe("Custom introductory Markdown for the README."),
|
|
454
|
+
apiReferenceLink: nonEmptyStringSchema.optional().describe("The URL linked as the API reference."),
|
|
455
|
+
bannerLink: nonEmptyStringSchema.optional().describe("The destination URL for the README banner."),
|
|
456
|
+
disabledSections: z.array(nonEmptyStringSchema).optional().describe("Generated README sections to omit."),
|
|
457
|
+
customSections: z.array(readmeCustomSectionSchema).optional().describe("Additional sections inserted into the README."),
|
|
458
|
+
defaultEndpoint: readmeEndpointSchema.optional().describe("The endpoint used for the primary README example."),
|
|
459
|
+
features: z.record(z.string(), z.array(readmeEndpointSchema)).optional().describe("Named feature groups and the endpoints demonstrated by each group.")
|
|
446
460
|
});
|
|
447
461
|
var snippetsConfigSchema = z.strictObject({
|
|
448
|
-
enabled: z.boolean(),
|
|
449
|
-
format: z.enum(["md", "json"]).optional(),
|
|
450
|
-
outputPath: nonEmptyStringSchema.optional()
|
|
462
|
+
enabled: z.boolean().describe("Whether standalone usage snippets are generated."),
|
|
463
|
+
format: z.enum(["md", "json"]).optional().describe("The output format for generated snippets."),
|
|
464
|
+
outputPath: nonEmptyStringSchema.optional().describe("The output path for generated snippet files.")
|
|
451
465
|
});
|
|
452
466
|
var docsConfigSchema = z.strictObject({
|
|
453
|
-
readme: readmeConfigSchema.optional(),
|
|
454
|
-
snippets: snippetsConfigSchema.optional(),
|
|
455
|
-
referenceBaseUrl: nonEmptyStringSchema.optional(),
|
|
456
|
-
includeApiReference: z.boolean().optional()
|
|
467
|
+
readme: readmeConfigSchema.optional().describe("README content and example configuration."),
|
|
468
|
+
snippets: snippetsConfigSchema.optional().describe("Standalone usage snippet generation."),
|
|
469
|
+
referenceBaseUrl: nonEmptyStringSchema.optional().describe("The base URL used for links to generated API reference files."),
|
|
470
|
+
includeApiReference: z.boolean().optional().describe("Whether API reference documentation is included in the SDK output.")
|
|
457
471
|
});
|
|
458
472
|
|
|
459
473
|
// src/sdk-config/v1/docs.ts
|
|
@@ -784,6 +798,7 @@ function githubOutput(value, publishInfo, rawOutput, language, sourcePath, state
|
|
|
784
798
|
consume(state, [...sourcePath, "repo"]);
|
|
785
799
|
const publication = publishInfo ? mapPublication(publishInfo, rawOutput, language, [...sourcePath, "publishInfo"], state, index) : void 0;
|
|
786
800
|
const type = stringValue(value.type);
|
|
801
|
+
const licensePackage = mapGithubLicense(value.license, [...sourcePath, "license"], state);
|
|
787
802
|
const reviewers = mapReviewers(value.reviewers, [...sourcePath, "reviewers"], state);
|
|
788
803
|
if (type) consume(state, [...sourcePath, "type"]);
|
|
789
804
|
if (typeof value.makePr === "boolean") consume(state, [...sourcePath, "makePr"]);
|
|
@@ -810,9 +825,20 @@ function githubOutput(value, publishInfo, rawOutput, language, sourcePath, state
|
|
|
810
825
|
},
|
|
811
826
|
...publication ? { publish: publication.publish } : {}
|
|
812
827
|
},
|
|
813
|
-
|
|
828
|
+
// The GitHub license wins over a publication-supplied one; `licensePackage` is `{}` or `{ license }`.
|
|
829
|
+
...optionalObject("package", { ...publication?.package, ...licensePackage })
|
|
814
830
|
};
|
|
815
831
|
}
|
|
832
|
+
var basicLicenseTypes = { mit: "MIT", apache: "APACHE" };
|
|
833
|
+
function mapGithubLicense(value, sourcePath, state) {
|
|
834
|
+
if (!isObject(value) || stringValue(value.type) !== "basic") return {};
|
|
835
|
+
const id = stringValue(value.id);
|
|
836
|
+
const type = id ? basicLicenseTypes[id.toLowerCase()] : void 0;
|
|
837
|
+
if (!type) return {};
|
|
838
|
+
consume(state, [...sourcePath, "type"]);
|
|
839
|
+
consume(state, [...sourcePath, "id"]);
|
|
840
|
+
return { license: { type } };
|
|
841
|
+
}
|
|
816
842
|
function consumeCredentialObject(value, sourcePath, state) {
|
|
817
843
|
if (!isObject(value)) return;
|
|
818
844
|
for (const field of ["username", "password", "token", "apiKey"]) {
|
|
@@ -1240,16 +1266,10 @@ function finishOutputMapping(mapping, outputMode, sourcePath, state, index) {
|
|
|
1240
1266
|
for (const path of collectLeafPaths(outputMode, sourcePath)) {
|
|
1241
1267
|
if (path[path.length - 1] === "_visit") consume(state, path);
|
|
1242
1268
|
}
|
|
1243
|
-
const legacyGenerateFullProject = isObject(outputMode) ? outputMode.generateFullProject : void 0;
|
|
1244
|
-
const generationShape = typeof legacyGenerateFullProject === "boolean" ? { generation: { ...mapping.generation, generateFullProject: legacyGenerateFullProject } } : {};
|
|
1245
|
-
if (typeof legacyGenerateFullProject === "boolean") {
|
|
1246
|
-
consume(state, [...sourcePath, "generateFullProject"]);
|
|
1247
|
-
}
|
|
1248
1269
|
const unsupported = collectUnsupported(outputMode, sourcePath, state);
|
|
1249
1270
|
const hasCredentials = unsupported.some((diagnostic) => isCredentialPath(diagnostic.path));
|
|
1250
1271
|
return {
|
|
1251
1272
|
...mapping,
|
|
1252
|
-
...generationShape,
|
|
1253
1273
|
unsupportedFields: [
|
|
1254
1274
|
...state.credentialDiagnostics ?? [],
|
|
1255
1275
|
...hasCredentials ? [
|
|
@@ -1320,6 +1340,9 @@ function outputDiagnostic(path, index) {
|
|
|
1320
1340
|
homepageLink: {
|
|
1321
1341
|
sdkConfigPath: ["targets", index, "package", "homepage"],
|
|
1322
1342
|
suggestedAction: "Set target.package.homepage manually to a valid URL."
|
|
1343
|
+
},
|
|
1344
|
+
generateFullProject: {
|
|
1345
|
+
suggestedAction: "Preserve this packaging setting on the generation request; it is not customer-authored SDK configuration."
|
|
1323
1346
|
}
|
|
1324
1347
|
};
|
|
1325
1348
|
const fieldGuidance = field ? guidance[field] : void 0;
|
|
@@ -1441,59 +1464,48 @@ function deepEqual(left, right) {
|
|
|
1441
1464
|
return false;
|
|
1442
1465
|
}
|
|
1443
1466
|
var namingConfigSchema = z.strictObject({
|
|
1444
|
-
clientName: nonEmptyStringSchema.optional(),
|
|
1445
|
-
exportedClientName: nonEmptyStringSchema.optional(),
|
|
1446
|
-
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
1447
|
-
apiErrorName: nonEmptyStringSchema.optional(),
|
|
1448
|
-
baseErrorName: nonEmptyStringSchema.optional(),
|
|
1449
|
-
pagerName: nonEmptyStringSchema.optional(),
|
|
1467
|
+
clientName: nonEmptyStringSchema.optional().describe("The generated client class name."),
|
|
1468
|
+
exportedClientName: nonEmptyStringSchema.optional().describe("The client name exported from the generated package."),
|
|
1469
|
+
environmentTypeName: nonEmptyStringSchema.optional().describe("The generated type name for API environments."),
|
|
1470
|
+
apiErrorName: nonEmptyStringSchema.optional().describe("The generated API error class name."),
|
|
1471
|
+
baseErrorName: nonEmptyStringSchema.optional().describe("The generated base error class name."),
|
|
1472
|
+
pagerName: nonEmptyStringSchema.optional().describe("The generated pagination helper name."),
|
|
1450
1473
|
/** Apply Fern's initialism-aware casing rules when deriving generated identifiers. */
|
|
1451
|
-
smartCasing: z.boolean().optional(),
|
|
1474
|
+
smartCasing: z.boolean().optional().describe("Whether generated identifiers use initialism-aware casing."),
|
|
1452
1475
|
/** Preserve a word boundary after digits when Fern smart casing is enabled. */
|
|
1453
|
-
smartCasingDigitWordBoundary: z.boolean().optional()
|
|
1476
|
+
smartCasingDigitWordBoundary: z.boolean().optional().describe("Whether smart casing preserves a word boundary after digits.")
|
|
1454
1477
|
});
|
|
1455
1478
|
|
|
1456
1479
|
// src/sdk-config/v1/generation.ts
|
|
1457
1480
|
var customerGenerationAssetSchema = z.discriminatedUnion("type", [
|
|
1458
|
-
z.strictObject({ type: z.literal("path"), location: relativePathSchema }),
|
|
1459
|
-
z.strictObject({ type: z.literal("url"), location: nonEmptyStringSchema })
|
|
1460
|
-
]);
|
|
1461
|
-
var hookDependencySchema = z.strictObject({
|
|
1462
|
-
name: nonEmptyStringSchema,
|
|
1463
|
-
version: nonEmptyStringSchema,
|
|
1464
|
-
groupId: nonEmptyStringSchema.optional()
|
|
1465
|
-
});
|
|
1466
|
-
var hooksConfigSchema = z.strictObject({
|
|
1467
|
-
enabled: z.boolean(),
|
|
1468
|
-
source: customerGenerationAssetSchema.optional(),
|
|
1469
|
-
dependencies: z.array(hookDependencySchema).optional()
|
|
1470
|
-
});
|
|
1471
|
-
var customCodeConfigSchema = z.strictObject({
|
|
1472
|
-
enabled: z.boolean(),
|
|
1473
|
-
source: customerGenerationAssetSchema.optional(),
|
|
1474
|
-
conflictStrategy: z.enum(["mark", "ours", "theirs"]).optional(),
|
|
1475
|
-
trackChanges: z.boolean().optional(),
|
|
1476
|
-
protectedFiles: z.array(nonEmptyStringSchema).optional()
|
|
1477
|
-
});
|
|
1478
|
-
var workflowConfigSchema = z.strictObject({
|
|
1479
|
-
path: relativePathSchema,
|
|
1480
|
-
outputName: nonEmptyStringSchema.optional()
|
|
1481
|
-
});
|
|
1482
|
-
var analyticsHeaderSchema = z.union([
|
|
1483
|
-
z.strictObject({ name: nonEmptyStringSchema, value: z.string() }),
|
|
1484
1481
|
z.strictObject({
|
|
1485
|
-
|
|
1486
|
-
|
|
1482
|
+
type: z.literal("path").describe("Loads the generation asset from a relative path."),
|
|
1483
|
+
location: relativePathSchema.describe("The relative path to the generation asset.")
|
|
1484
|
+
}),
|
|
1485
|
+
z.strictObject({
|
|
1486
|
+
type: z.literal("url").describe("Loads the generation asset from a URL."),
|
|
1487
|
+
location: nonEmptyStringSchema.describe("The URL of the generation asset.")
|
|
1487
1488
|
})
|
|
1488
1489
|
]);
|
|
1490
|
+
var customCodeConfigSchema = z.strictObject({
|
|
1491
|
+
enabled: z.boolean().describe("Whether customer-authored code is merged into generated output."),
|
|
1492
|
+
source: customerGenerationAssetSchema.optional().describe("The source containing customer-authored code."),
|
|
1493
|
+
conflictStrategy: z.enum(["mark", "ours", "theirs"]).optional().describe("How merge conflicts between generated and custom code are handled."),
|
|
1494
|
+
trackChanges: z.boolean().optional().describe("Whether custom-code changes are tracked between builds."),
|
|
1495
|
+
protectedFiles: z.array(nonEmptyStringSchema).optional().describe("Generated file paths that custom-code merging must not overwrite.")
|
|
1496
|
+
});
|
|
1497
|
+
var analyticsHeaderSchema = z.strictObject({
|
|
1498
|
+
name: nonEmptyStringSchema.describe("The exported telemetry header name."),
|
|
1499
|
+
value: z.string().describe("The literal telemetry header value.")
|
|
1500
|
+
});
|
|
1489
1501
|
var analyticsConfigSchema = z.strictObject({
|
|
1490
|
-
enabled: z.boolean(),
|
|
1491
|
-
endpoint: nonEmptyStringSchema.optional(),
|
|
1492
|
-
exporter: z.enum(["otlp-http", "console"]).optional(),
|
|
1493
|
-
headers: z.array(analyticsHeaderSchema).optional(),
|
|
1494
|
-
batchSize: z.number().int().positive().optional(),
|
|
1495
|
-
scheduledDelayMs: z.number().nonnegative().optional(),
|
|
1496
|
-
exportTimeoutMs: z.number().nonnegative().optional()
|
|
1502
|
+
enabled: z.boolean().describe("Whether generated clients export usage telemetry."),
|
|
1503
|
+
endpoint: nonEmptyStringSchema.optional().describe("The telemetry export endpoint."),
|
|
1504
|
+
exporter: z.enum(["otlp-http", "console"]).optional().describe("The telemetry exporter implementation."),
|
|
1505
|
+
headers: z.array(analyticsHeaderSchema).optional().describe("Headers sent by the telemetry exporter."),
|
|
1506
|
+
batchSize: z.number().int().positive().optional().describe("The maximum spans in each export batch."),
|
|
1507
|
+
scheduledDelayMs: z.number().nonnegative().optional().describe("The delay between scheduled exports, in milliseconds."),
|
|
1508
|
+
exportTimeoutMs: z.number().nonnegative().optional().describe("The maximum time allowed for an export, in milliseconds.")
|
|
1497
1509
|
}).superRefine(({ enabled, endpoint }, context) => {
|
|
1498
1510
|
if (enabled && endpoint === void 0) {
|
|
1499
1511
|
context.addIssue({
|
|
@@ -1504,73 +1516,63 @@ var analyticsConfigSchema = z.strictObject({
|
|
|
1504
1516
|
}
|
|
1505
1517
|
});
|
|
1506
1518
|
var wireTestsSchema = z.strictObject({
|
|
1507
|
-
enabled: z.boolean(),
|
|
1508
|
-
exclusions: z.array(nonEmptyStringSchema).optional(),
|
|
1509
|
-
fallbackToGeneratedErrorExamples: z.boolean().optional(),
|
|
1510
|
-
fixtureSource: z.enum(["synthetic", "recorded", "auto"]).optional()
|
|
1519
|
+
enabled: z.boolean().describe("Whether wire-level request and response tests are generated."),
|
|
1520
|
+
exclusions: z.array(nonEmptyStringSchema).optional().describe("Operations excluded from wire tests."),
|
|
1521
|
+
fallbackToGeneratedErrorExamples: z.boolean().optional().describe("Whether missing error fixtures are synthesized from generated examples."),
|
|
1522
|
+
fixtureSource: z.enum(["synthetic", "recorded", "auto"]).optional().describe("Where wire-test fixtures are obtained.")
|
|
1511
1523
|
});
|
|
1512
1524
|
var unitTestsSchema = z.strictObject({
|
|
1513
|
-
enabled: z.boolean(),
|
|
1514
|
-
|
|
1515
|
-
exclusions: z.array(nonEmptyStringSchema).optional()
|
|
1525
|
+
enabled: z.boolean().describe("Whether SDK unit tests are generated."),
|
|
1526
|
+
exclusions: z.array(nonEmptyStringSchema).optional().describe("Operations excluded from unit tests.")
|
|
1516
1527
|
});
|
|
1517
1528
|
var streamsSchema = z.strictObject({
|
|
1518
|
-
enabled: z.boolean(),
|
|
1519
|
-
responseType: z.enum(["wrapper", "native", "web"]).optional(),
|
|
1520
|
-
fileResponseType: z.enum(["stream", "binary-response"]).optional(),
|
|
1521
|
-
defaultChunkSizeBytes: z.number().int().positive().optional()
|
|
1529
|
+
enabled: z.boolean().describe("Whether generated clients expose streaming response APIs."),
|
|
1530
|
+
responseType: z.enum(["wrapper", "native", "web"]).optional().describe("The streaming response abstraction exposed by generated clients."),
|
|
1531
|
+
fileResponseType: z.enum(["stream", "binary-response"]).optional().describe("The response type used for file downloads."),
|
|
1532
|
+
defaultChunkSizeBytes: z.number().int().positive().optional().describe("The default number of bytes yielded by streaming iterators.")
|
|
1522
1533
|
});
|
|
1523
1534
|
var layoutConfigSchema = z.strictObject({
|
|
1524
|
-
outputDirectory: z.enum(["project-root", "source-root"]).optional(),
|
|
1525
|
-
packagePath: nonEmptyStringSchema.optional()
|
|
1535
|
+
outputDirectory: z.enum(["project-root", "source-root"]).optional().describe("Whether generated source is rooted at the project or its source directory."),
|
|
1536
|
+
packagePath: nonEmptyStringSchema.optional().describe("The package-relative path for generated source files.")
|
|
1526
1537
|
});
|
|
1527
1538
|
var serializationConfigSchema = z.strictObject({
|
|
1528
|
-
enumRepresentation: z.enum(["enum", "union", "literal", "forward-compatible-enum", "language-default"]).optional(),
|
|
1529
|
-
additionalProperties: z.enum(["allow", "forbid", "ignore", "language-default"]).optional(),
|
|
1530
|
-
inlineTypes: z.boolean().optional(),
|
|
1531
|
-
omitUndefined: z.boolean().optional()
|
|
1539
|
+
enumRepresentation: z.enum(["enum", "union", "literal", "forward-compatible-enum", "language-default"]).optional().describe("How schema enums are represented in generated code."),
|
|
1540
|
+
additionalProperties: z.enum(["allow", "forbid", "ignore", "language-default"]).optional().describe("How undeclared object properties are handled."),
|
|
1541
|
+
inlineTypes: z.boolean().optional().describe("Whether inline schemas remain nested under their parent types."),
|
|
1542
|
+
omitUndefined: z.boolean().optional().describe("Whether undefined properties are omitted during serialization.")
|
|
1532
1543
|
});
|
|
1533
1544
|
var generationConfigOverrideShape = {
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
unitTests: unitTestsSchema.optional(),
|
|
1554
|
-
webSockets: z.boolean().optional(),
|
|
1555
|
-
streams: streamsSchema.optional(),
|
|
1556
|
-
naming: namingConfigSchema.optional(),
|
|
1557
|
-
layout: layoutConfigSchema.optional(),
|
|
1558
|
-
serialization: serializationConfigSchema.optional()
|
|
1545
|
+
includeOptionalSnippetParameters: z.boolean().optional().describe("Whether usage snippets include optional request parameters."),
|
|
1546
|
+
buildAllModels: z.boolean().optional().describe("Whether models not referenced by operations are also generated."),
|
|
1547
|
+
inferServiceNames: z.boolean().optional().describe("Whether service names are inferred from API structure."),
|
|
1548
|
+
includeDeprecatedOperations: z.boolean().optional().describe("Whether deprecated API operations are generated."),
|
|
1549
|
+
multipleResponses: z.boolean().optional().describe("Whether operations model multiple successful response types."),
|
|
1550
|
+
devContainer: z.boolean().optional().describe("Whether development-container configuration is generated."),
|
|
1551
|
+
allowMockClient: z.boolean().optional().describe("Whether a mock API client is included in the generated SDK."),
|
|
1552
|
+
ignoreFiles: z.array(nonEmptyStringSchema).optional().describe("Generated paths excluded from the final output."),
|
|
1553
|
+
reservedKeywords: z.array(nonEmptyStringSchema).optional().describe("Additional identifiers treated as reserved words."),
|
|
1554
|
+
customCode: customCodeConfigSchema.optional().describe("Customer-authored code merge configuration."),
|
|
1555
|
+
customQueryPaths: z.array(relativePathSchema).optional().describe("Relative paths to custom query definitions."),
|
|
1556
|
+
analytics: analyticsConfigSchema.optional().describe("Generated client telemetry configuration."),
|
|
1557
|
+
wireTests: wireTestsSchema.optional().describe("Wire-level request and response test generation."),
|
|
1558
|
+
unitTests: unitTestsSchema.optional().describe("SDK unit-test generation."),
|
|
1559
|
+
webSockets: z.boolean().optional().describe("Whether WebSocket clients are generated for supported channels."),
|
|
1560
|
+
streams: streamsSchema.optional().describe("Streaming response generation behavior."),
|
|
1561
|
+
naming: namingConfigSchema.optional().describe("Names and casing used by generated code."),
|
|
1562
|
+
layout: layoutConfigSchema.optional().describe("Generated project and source layout."),
|
|
1563
|
+
serialization: serializationConfigSchema.optional().describe("Generated model serialization behavior.")
|
|
1559
1564
|
};
|
|
1560
1565
|
var sdkConfigV1GenerationConfigOverrideSchema = z.strictObject(
|
|
1561
1566
|
generationConfigOverrideShape
|
|
1562
1567
|
);
|
|
1563
1568
|
var sdkConfigV1GenerationConfigSchema = z.strictObject({
|
|
1564
1569
|
...generationConfigOverrideShape,
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
generateFullProject: z.boolean().default(false),
|
|
1572
|
-
devContainer: z.boolean().default(false),
|
|
1573
|
-
allowMockClient: z.boolean().default(false)
|
|
1570
|
+
buildAllModels: z.boolean().default(false).describe("Whether models not referenced by operations are also generated."),
|
|
1571
|
+
inferServiceNames: z.boolean().default(false).describe("Whether service names are inferred from API structure."),
|
|
1572
|
+
includeDeprecatedOperations: z.boolean().default(true).describe("Whether deprecated API operations are generated."),
|
|
1573
|
+
multipleResponses: z.boolean().default(false).describe("Whether operations model multiple successful response types."),
|
|
1574
|
+
devContainer: z.boolean().default(false).describe("Whether development-container configuration is generated."),
|
|
1575
|
+
allowMockClient: z.boolean().default(false).describe("Whether a mock API client is included in the generated SDK.")
|
|
1574
1576
|
});
|
|
1575
1577
|
var commonGenerationKeys = new Set(Object.keys(generationConfigOverrideShape));
|
|
1576
1578
|
function splitSdkConfigV1TargetGeneration(generation) {
|
|
@@ -1592,78 +1594,97 @@ var sdkConfigV1PublishRegistrySchema = z.enum([
|
|
|
1592
1594
|
"composer"
|
|
1593
1595
|
]);
|
|
1594
1596
|
var mavenSignatureSchema = z.strictObject({
|
|
1595
|
-
keyId: nonEmptyStringSchema
|
|
1596
|
-
|
|
1597
|
-
|
|
1597
|
+
keyId: nonEmptyStringSchema.describe(
|
|
1598
|
+
"The signing key identifier, or an environment expression that resolves to it."
|
|
1599
|
+
),
|
|
1600
|
+
password: nonEmptyStringSchema.describe(
|
|
1601
|
+
"The signing key password, or an environment expression that resolves to it."
|
|
1602
|
+
),
|
|
1603
|
+
secretKey: nonEmptyStringSchema.describe(
|
|
1604
|
+
"The armored secret key, or an environment expression that resolves to it."
|
|
1605
|
+
)
|
|
1598
1606
|
});
|
|
1599
1607
|
var commonPublishShape = {
|
|
1600
|
-
url: nonEmptyStringSchema.optional(),
|
|
1601
|
-
releaseBranch: nonEmptyStringSchema.optional(),
|
|
1602
|
-
tolerateRepublish: z.boolean().optional()
|
|
1608
|
+
url: nonEmptyStringSchema.optional().describe("A custom package registry URL."),
|
|
1609
|
+
releaseBranch: nonEmptyStringSchema.optional().describe("The branch used by generated package release workflows."),
|
|
1610
|
+
tolerateRepublish: z.boolean().optional().describe("Whether an already-published package version is treated as non-fatal.")
|
|
1603
1611
|
};
|
|
1604
1612
|
var sdkConfigV1PublishConfigSchema = z.discriminatedUnion("registry", [
|
|
1605
1613
|
z.strictObject({
|
|
1606
|
-
registry: z.literal("npm"),
|
|
1607
|
-
token: nonEmptyStringSchema.optional(),
|
|
1614
|
+
registry: z.literal("npm").describe("Publishes the package to an npm-compatible registry."),
|
|
1615
|
+
token: nonEmptyStringSchema.optional().describe("The npm registry token, or an environment expression that resolves to it."),
|
|
1616
|
+
...commonPublishShape
|
|
1617
|
+
}),
|
|
1618
|
+
z.strictObject({
|
|
1619
|
+
registry: z.literal("pypi").describe("Publishes the package to a PyPI-compatible registry."),
|
|
1620
|
+
username: nonEmptyStringSchema.optional().describe("The PyPI username, or an environment expression that resolves to it."),
|
|
1621
|
+
password: nonEmptyStringSchema.optional().describe("The PyPI password or token, or an environment expression that resolves to it."),
|
|
1608
1622
|
...commonPublishShape
|
|
1609
1623
|
}),
|
|
1610
1624
|
z.strictObject({
|
|
1611
|
-
registry: z.literal("
|
|
1612
|
-
username: nonEmptyStringSchema.optional(),
|
|
1613
|
-
password: nonEmptyStringSchema.optional(),
|
|
1625
|
+
registry: z.literal("maven").describe("Publishes the package to a Maven-compatible repository."),
|
|
1626
|
+
username: nonEmptyStringSchema.optional().describe("The Maven username, or an environment expression that resolves to it."),
|
|
1627
|
+
password: nonEmptyStringSchema.optional().describe("The Maven password, or an environment expression that resolves to it."),
|
|
1628
|
+
signature: mavenSignatureSchema.optional().describe("Credentials used to sign Maven artifacts."),
|
|
1614
1629
|
...commonPublishShape
|
|
1615
1630
|
}),
|
|
1616
1631
|
z.strictObject({
|
|
1617
|
-
registry: z.literal("
|
|
1618
|
-
username: nonEmptyStringSchema.optional(),
|
|
1619
|
-
password: nonEmptyStringSchema.optional(),
|
|
1620
|
-
signature: mavenSignatureSchema.optional(),
|
|
1632
|
+
registry: z.literal("nuget").describe("Publishes the package to a NuGet-compatible registry."),
|
|
1621
1633
|
...commonPublishShape
|
|
1622
1634
|
}),
|
|
1623
|
-
z.strictObject({ registry: z.literal("nuget"), ...commonPublishShape }),
|
|
1624
|
-
z.strictObject({ registry: z.literal("rubygems"), ...commonPublishShape }),
|
|
1625
1635
|
z.strictObject({
|
|
1626
|
-
registry: z.literal("
|
|
1627
|
-
token: nonEmptyStringSchema.optional(),
|
|
1636
|
+
registry: z.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),
|
|
1628
1637
|
...commonPublishShape
|
|
1629
1638
|
}),
|
|
1630
|
-
z.strictObject({
|
|
1631
|
-
|
|
1639
|
+
z.strictObject({
|
|
1640
|
+
registry: z.literal("crates").describe("Publishes the crate to a Cargo-compatible registry."),
|
|
1641
|
+
token: nonEmptyStringSchema.optional().describe("The Cargo registry token, or an environment expression that resolves to it."),
|
|
1642
|
+
...commonPublishShape
|
|
1643
|
+
}),
|
|
1644
|
+
z.strictObject({
|
|
1645
|
+
registry: z.literal("go").describe("Publishes the SDK as a Go module."),
|
|
1646
|
+
...commonPublishShape
|
|
1647
|
+
}),
|
|
1648
|
+
z.strictObject({
|
|
1649
|
+
registry: z.literal("composer").describe("Publishes the package to a Composer-compatible registry."),
|
|
1650
|
+
...commonPublishShape
|
|
1651
|
+
})
|
|
1632
1652
|
]);
|
|
1633
1653
|
var reviewersSchema = z.strictObject({
|
|
1634
|
-
teams: z.array(nonEmptyStringSchema).optional(),
|
|
1635
|
-
users: z.array(nonEmptyStringSchema).optional()
|
|
1654
|
+
teams: z.array(nonEmptyStringSchema).optional().describe("GitHub teams requested as reviewers."),
|
|
1655
|
+
users: z.array(nonEmptyStringSchema).optional().describe("GitHub users requested as reviewers.")
|
|
1636
1656
|
});
|
|
1637
1657
|
var githubCredentialsSchema = z.strictObject({
|
|
1638
|
-
username: nonEmptyStringSchema.optional(),
|
|
1639
|
-
password: nonEmptyStringSchema.optional(),
|
|
1640
|
-
token: nonEmptyStringSchema.optional(),
|
|
1641
|
-
apiKey: nonEmptyStringSchema.optional()
|
|
1658
|
+
username: nonEmptyStringSchema.optional().describe("The username used to authenticate with the GitHub host."),
|
|
1659
|
+
password: nonEmptyStringSchema.optional().describe("The password used to authenticate with the GitHub host."),
|
|
1660
|
+
token: nonEmptyStringSchema.optional().describe("A token used to authenticate with the GitHub host."),
|
|
1661
|
+
apiKey: nonEmptyStringSchema.optional().describe("An API key used to authenticate with the GitHub host.")
|
|
1642
1662
|
});
|
|
1643
1663
|
var githubOutputSchema = z.strictObject({
|
|
1644
|
-
repository: nonEmptyStringSchema
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1664
|
+
repository: nonEmptyStringSchema.describe(
|
|
1665
|
+
"The GitHub repository that receives generated files."
|
|
1666
|
+
),
|
|
1667
|
+
host: nonEmptyStringSchema.optional().describe("The GitHub host for enterprise installations."),
|
|
1668
|
+
branch: nonEmptyStringSchema.optional().describe("The target branch for generated changes."),
|
|
1669
|
+
mode: z.enum(["release", "pull-request", "push", "commit", "commit-and-release"]).optional().describe("How generated changes are delivered to the repository."),
|
|
1670
|
+
reviewers: reviewersSchema.optional().describe("Reviewers requested for generated pull requests."),
|
|
1671
|
+
credentials: githubCredentialsSchema.optional().describe("Credentials used to authenticate GitHub delivery."),
|
|
1672
|
+
privateRepository: z.boolean().optional().describe("Whether the destination repository is private.")
|
|
1652
1673
|
});
|
|
1653
1674
|
var filesOutputSchema = z.strictObject({
|
|
1654
|
-
delivery: z.literal("files"),
|
|
1655
|
-
path: nonEmptyStringSchema.optional(),
|
|
1656
|
-
publish: sdkConfigV1PublishConfigSchema.optional()
|
|
1675
|
+
delivery: z.literal("files").describe("Writes the generated SDK to a directory."),
|
|
1676
|
+
path: nonEmptyStringSchema.optional().describe("The destination directory for generated files."),
|
|
1677
|
+
publish: sdkConfigV1PublishConfigSchema.optional().describe("Optional package registry publication.")
|
|
1657
1678
|
});
|
|
1658
1679
|
var zipOutputSchema = z.strictObject({
|
|
1659
|
-
delivery: z.literal("zip"),
|
|
1660
|
-
fileName: nonEmptyStringSchema.optional(),
|
|
1661
|
-
publish: sdkConfigV1PublishConfigSchema.optional()
|
|
1680
|
+
delivery: z.literal("zip").describe("Packages the generated SDK as a ZIP archive."),
|
|
1681
|
+
fileName: nonEmptyStringSchema.optional().describe("The generated ZIP archive file name."),
|
|
1682
|
+
publish: sdkConfigV1PublishConfigSchema.optional().describe("Optional package registry publication.")
|
|
1662
1683
|
});
|
|
1663
1684
|
var githubDeliverySchema = z.strictObject({
|
|
1664
|
-
delivery: z.literal("github"),
|
|
1665
|
-
github: githubOutputSchema,
|
|
1666
|
-
publish: sdkConfigV1PublishConfigSchema.optional()
|
|
1685
|
+
delivery: z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
1686
|
+
github: githubOutputSchema.describe("GitHub repository delivery settings."),
|
|
1687
|
+
publish: sdkConfigV1PublishConfigSchema.optional().describe("Optional package registry publication.")
|
|
1667
1688
|
});
|
|
1668
1689
|
var sdkConfigV1OutputConfigSchema = z.discriminatedUnion(
|
|
1669
1690
|
"delivery",
|
|
@@ -1675,29 +1696,33 @@ var sdkConfigV1OutputConfigSchema = z.discriminatedUnion(
|
|
|
1675
1696
|
var sdkConfigV1DependencySchema = dependencySchema;
|
|
1676
1697
|
var sdkConfigV1PackageConfigSchema = packageConfigSchema;
|
|
1677
1698
|
var sdkConfigV1ReplayConfigSchema = z.strictObject({
|
|
1678
|
-
enabled: z.boolean()
|
|
1699
|
+
enabled: z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
|
|
1679
1700
|
});
|
|
1680
1701
|
var apiImportSettingsSchema = z.strictObject({
|
|
1681
|
-
respectNullableSchemas: z.boolean().optional(),
|
|
1682
|
-
titleAsSchemaName: z.boolean().optional(),
|
|
1683
|
-
coerceEnumsToLiterals: z.boolean().optional(),
|
|
1684
|
-
idiomaticRequestNames: z.boolean().optional(),
|
|
1685
|
-
wrapReferencesToNullableInOptional: z.boolean().optional(),
|
|
1686
|
-
coerceOptionalSchemasToNullable: z.boolean().optional(),
|
|
1687
|
-
pathParameterOrder: z.enum(["url-order", "spec-order"]).optional(),
|
|
1688
|
-
onlyIncludeReferencedSchemas: z.boolean().optional(),
|
|
1689
|
-
objectQueryParameters: z.boolean().optional(),
|
|
1690
|
-
typeDatesAsStrings: z.boolean().optional(),
|
|
1691
|
-
groupMultiApiEnvironments: z.boolean().optional()
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1702
|
+
respectNullableSchemas: z.boolean().optional().describe("Whether nullable schemas remain nullable in generated types."),
|
|
1703
|
+
titleAsSchemaName: z.boolean().optional().describe("Whether a schema title can determine the generated type name."),
|
|
1704
|
+
coerceEnumsToLiterals: z.boolean().optional().describe("Whether single-value enums are imported as literal values."),
|
|
1705
|
+
idiomaticRequestNames: z.boolean().optional().describe("Whether request types use concise, idiomatic generated names."),
|
|
1706
|
+
wrapReferencesToNullableInOptional: z.boolean().optional().describe("Whether nullable schema references are also treated as optional."),
|
|
1707
|
+
coerceOptionalSchemasToNullable: z.boolean().optional().describe("Whether optional properties are represented as nullable required properties."),
|
|
1708
|
+
pathParameterOrder: z.enum(["url-order", "spec-order"]).optional().describe("Whether path parameters follow their URL order or specification order."),
|
|
1709
|
+
onlyIncludeReferencedSchemas: z.boolean().optional().describe("Whether unreferenced schemas are omitted from the generated SDK."),
|
|
1710
|
+
objectQueryParameters: z.boolean().optional().describe("Whether object-valued query parameters are preserved as objects."),
|
|
1711
|
+
typeDatesAsStrings: z.boolean().optional().describe("Whether date and date-time schemas are generated as strings."),
|
|
1712
|
+
groupMultiApiEnvironments: z.boolean().optional().describe(
|
|
1713
|
+
"Whether environments from multiple API sources are merged into shared named groups."
|
|
1714
|
+
),
|
|
1715
|
+
ignoreTags: z.boolean().optional().describe("Whether API tags are ignored when organizing generated resources."),
|
|
1716
|
+
disambiguateRequestNames: z.boolean().optional().describe("Whether colliding request type names are automatically disambiguated."),
|
|
1717
|
+
respectReadonlySchemas: z.boolean().optional().describe(
|
|
1718
|
+
"Whether read-only properties are modeled separately for request and response types."
|
|
1719
|
+
),
|
|
1720
|
+
discriminatedUnionV2: z.boolean().optional().describe("Whether oneOf and anyOf schemas use the newer discriminator inference rules."),
|
|
1721
|
+
undiscriminatedUnionsWithLiterals: z.boolean().optional().describe("Whether literal-bearing unions remain undiscriminated during import."),
|
|
1722
|
+
inlineAllOfSchemas: z.boolean().optional().describe("Whether schemas composed with allOf are inlined when possible."),
|
|
1723
|
+
resolveSchemaCollisions: z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
|
|
1724
|
+
asyncApiMessageNaming: z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
|
|
1725
|
+
defaultIntegerFormat: z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one.")
|
|
1701
1726
|
});
|
|
1702
1727
|
var sourceSpecTypeSchema = z.enum([
|
|
1703
1728
|
"openapi",
|
|
@@ -1709,27 +1734,30 @@ var sourceSpecTypeSchema = z.enum([
|
|
|
1709
1734
|
|
|
1710
1735
|
// src/sdk-config/v1/source.ts
|
|
1711
1736
|
var sourceSpecShape = {
|
|
1712
|
-
id: nonEmptyStringSchema,
|
|
1713
|
-
type: sourceSpecTypeSchema,
|
|
1714
|
-
name: nonEmptyStringSchema.optional(),
|
|
1715
|
-
namespace: nonEmptyStringSchema.optional(),
|
|
1716
|
-
apiImportSettings: apiImportSettingsSchema.optional(),
|
|
1717
|
-
overlays: z.array(relativePathSchema).optional(),
|
|
1718
|
-
overrides: z.array(relativePathSchema).optional()
|
|
1737
|
+
id: nonEmptyStringSchema.describe("A unique identifier for this API source."),
|
|
1738
|
+
type: sourceSpecTypeSchema.describe("The API description format of this source."),
|
|
1739
|
+
name: nonEmptyStringSchema.optional().describe("A human-readable name for this API source."),
|
|
1740
|
+
namespace: nonEmptyStringSchema.optional().describe("A namespace used to isolate this source in a multi-source SDK."),
|
|
1741
|
+
apiImportSettings: apiImportSettingsSchema.optional().describe("Import behavior that overrides the source-level defaults for this spec."),
|
|
1742
|
+
overlays: z.array(relativePathSchema).optional().describe("Relative paths to overlays applied to this source in order."),
|
|
1743
|
+
overrides: z.array(relativePathSchema).optional().describe("Relative paths to source override files applied in order.")
|
|
1719
1744
|
};
|
|
1720
1745
|
var sdkConfigV1SourceSpecSchema = z.union(
|
|
1721
1746
|
[
|
|
1722
|
-
z.strictObject({ ...sourceSpecShape, path: relativePathSchema }),
|
|
1723
1747
|
z.strictObject({
|
|
1724
1748
|
...sourceSpecShape,
|
|
1725
|
-
|
|
1749
|
+
path: relativePathSchema.describe("The relative path to the API source file.")
|
|
1750
|
+
}),
|
|
1751
|
+
z.strictObject({
|
|
1752
|
+
...sourceSpecShape,
|
|
1753
|
+
url: z.url({ protocol: /^https?$/ }).describe("The HTTP or HTTPS URL of the API source file.")
|
|
1726
1754
|
})
|
|
1727
1755
|
],
|
|
1728
1756
|
{ error: "source spec must contain exactly one locator: path or HTTP(S) url" }
|
|
1729
1757
|
);
|
|
1730
1758
|
var sdkConfigV1SourceConfigSchema = z.strictObject({
|
|
1731
|
-
specs: z.array(sdkConfigV1SourceSpecSchema).min(1, "source.specs must contain at least one source spec"),
|
|
1732
|
-
apiImportSettings: apiImportSettingsSchema.optional()
|
|
1759
|
+
specs: z.array(sdkConfigV1SourceSpecSchema).min(1, "source.specs must contain at least one source spec").describe("API source files in authoritative processing order."),
|
|
1760
|
+
apiImportSettings: apiImportSettingsSchema.optional().describe("Default import behavior shared by every source spec.")
|
|
1733
1761
|
}).superRefine(({ specs }, context) => {
|
|
1734
1762
|
const seenIds = /* @__PURE__ */ new Set();
|
|
1735
1763
|
specs.forEach(({ id }, index) => {
|
|
@@ -1744,74 +1772,80 @@ var sdkConfigV1SourceConfigSchema = z.strictObject({
|
|
|
1744
1772
|
});
|
|
1745
1773
|
});
|
|
1746
1774
|
var cliGenerationConfigSchema = z.strictObject({
|
|
1747
|
-
paginationParameters: z.array(nonEmptyStringSchema).optional(),
|
|
1748
|
-
skills: z.boolean().optional()
|
|
1775
|
+
paginationParameters: z.array(nonEmptyStringSchema).optional().describe("Request parameter names treated as pagination controls by the CLI."),
|
|
1776
|
+
skills: z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands.")
|
|
1749
1777
|
});
|
|
1750
1778
|
var csharpGenerationConfigSchema = z.strictObject({
|
|
1751
|
-
useOptionalWrapper: z.boolean().optional(),
|
|
1752
|
-
simplifyObjectDictionaries: z.boolean().optional(),
|
|
1753
|
-
explicitNamespaces: z.boolean().optional(),
|
|
1754
|
-
rootNamespaceForCoreClasses: z.boolean().optional(),
|
|
1755
|
-
includeExceptionHandler: z.boolean().optional(),
|
|
1756
|
-
experimentalExplicitNullableOptional: z.boolean().optional()
|
|
1779
|
+
useOptionalWrapper: z.boolean().optional().describe("Whether optional values use an explicit Optional wrapper."),
|
|
1780
|
+
simplifyObjectDictionaries: z.boolean().optional().describe("Whether object schemas with arbitrary values use simplified dictionary types."),
|
|
1781
|
+
explicitNamespaces: z.boolean().optional().describe("Whether generated resource groups use explicit nested namespaces."),
|
|
1782
|
+
rootNamespaceForCoreClasses: z.boolean().optional().describe("Whether shared client classes are emitted in the root namespace."),
|
|
1783
|
+
includeExceptionHandler: z.boolean().optional().describe("Whether generated client operations use a configurable exception handler."),
|
|
1784
|
+
experimentalExplicitNullableOptional: z.boolean().optional().describe(
|
|
1785
|
+
"Whether optional nullable properties distinguish omitted values from explicit nulls."
|
|
1786
|
+
)
|
|
1757
1787
|
});
|
|
1758
1788
|
var goGenerationConfigSchema = z.strictObject({
|
|
1759
|
-
legacyComplexModels: z.boolean().optional(),
|
|
1789
|
+
legacyComplexModels: z.boolean().optional().describe("Whether complex models use the legacy Go representation."),
|
|
1760
1790
|
/** Uppercase common initialisms in generated names (`UserID` rather than `UserId`). */
|
|
1761
|
-
smartCasing: z.boolean().optional(),
|
|
1791
|
+
smartCasing: z.boolean().optional().describe("Whether generated Go names capitalize common initialisms."),
|
|
1762
1792
|
/** Overrides the fern root-client constructor independently from the client type name. */
|
|
1763
|
-
clientConstructorName: nonEmptyStringSchema.optional(),
|
|
1764
|
-
unionVersion: z.enum(["v0", "v1"]).optional(),
|
|
1765
|
-
includeLegacyClientOptions: z.boolean().optional()
|
|
1793
|
+
clientConstructorName: nonEmptyStringSchema.optional().describe("The generated root-client constructor name."),
|
|
1794
|
+
unionVersion: z.enum(["v0", "v1"]).optional().describe("The representation used for generated Go unions."),
|
|
1795
|
+
includeLegacyClientOptions: z.boolean().optional().describe("Whether the client retains legacy constructor option helpers.")
|
|
1766
1796
|
});
|
|
1767
1797
|
var jvmGenerationConfigSchema = z.strictObject({
|
|
1768
|
-
packageLayout: z.enum(["flat", "nested"]).optional(),
|
|
1769
|
-
useLocalDateForDates: z.boolean().optional(),
|
|
1770
|
-
collapseOptionalNullable: z.boolean().optional(),
|
|
1771
|
-
gradleDistributionUrl: z.string().min(1).optional(),
|
|
1772
|
-
gradlePluginManagement: z.string().optional(),
|
|
1773
|
-
gradleCentralDependencyManagement: z.boolean().optional(),
|
|
1798
|
+
packageLayout: z.enum(["flat", "nested"]).optional().describe("Whether generated JVM packages use a flat or nested resource layout."),
|
|
1799
|
+
useLocalDateForDates: z.boolean().optional().describe("Whether date-only values use LocalDate instead of OffsetDateTime."),
|
|
1800
|
+
collapseOptionalNullable: z.boolean().optional().describe("Whether optional nullable values collapse into a single nullable representation."),
|
|
1801
|
+
gradleDistributionUrl: z.string().min(1).optional().describe("The Gradle distribution URL written to the generated wrapper."),
|
|
1802
|
+
gradlePluginManagement: z.string().optional().describe("Plugin management configuration added to the generated Gradle settings."),
|
|
1803
|
+
gradleCentralDependencyManagement: z.boolean().optional().describe("Whether dependency versions are managed centrally in the Gradle project."),
|
|
1774
1804
|
/** Selects co-located async methods or a separate async client surface. */
|
|
1775
|
-
asyncStyle: z.enum(["dedicated-client", "twin-methods"]).optional()
|
|
1805
|
+
asyncStyle: z.enum(["dedicated-client", "twin-methods"]).optional().describe("Whether asynchronous operations use a separate client or co-located methods.")
|
|
1776
1806
|
});
|
|
1777
1807
|
|
|
1778
1808
|
// src/sdk-config-domain/v1/language/java.ts
|
|
1779
1809
|
var javaGenerationConfigSchema = jvmGenerationConfigSchema.extend({
|
|
1780
|
-
includeKotlinSnippets: z.boolean().optional()
|
|
1810
|
+
includeKotlinSnippets: z.boolean().optional().describe("Whether Java SDK documentation includes Kotlin usage snippets.")
|
|
1781
1811
|
});
|
|
1782
1812
|
|
|
1783
1813
|
// src/sdk-config-domain/v1/language/kotlin.ts
|
|
1784
1814
|
var kotlinGenerationConfigSchema = jvmGenerationConfigSchema;
|
|
1785
1815
|
var compilerOptionsSchema = z.strictObject({
|
|
1786
|
-
target: nonEmptyStringSchema.optional(),
|
|
1787
|
-
module: nonEmptyStringSchema.optional(),
|
|
1788
|
-
lib: z.array(nonEmptyStringSchema).optional()
|
|
1816
|
+
target: nonEmptyStringSchema.optional().describe("The JavaScript language target passed to TypeScript."),
|
|
1817
|
+
module: nonEmptyStringSchema.optional().describe("The module format passed to TypeScript."),
|
|
1818
|
+
lib: z.array(nonEmptyStringSchema).optional().describe("The runtime library definitions passed to TypeScript.")
|
|
1789
1819
|
});
|
|
1790
1820
|
var packageScriptSchema = z.strictObject({
|
|
1791
|
-
name: nonEmptyStringSchema,
|
|
1792
|
-
command: nonEmptyStringSchema
|
|
1821
|
+
name: nonEmptyStringSchema.describe("The package script name."),
|
|
1822
|
+
command: nonEmptyStringSchema.describe("The command executed by the package script.")
|
|
1793
1823
|
});
|
|
1794
1824
|
var httpClientSchema = z.strictObject({
|
|
1795
|
-
name: z.enum(["axios", "fetch"])
|
|
1825
|
+
name: z.enum(["axios", "fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
1796
1826
|
});
|
|
1797
1827
|
var typescriptGenerationConfigSchema = z.strictObject({
|
|
1798
|
-
typescriptVersion: nonEmptyStringSchema.optional(),
|
|
1799
|
-
zodVersion: nonEmptyStringSchema.optional(),
|
|
1800
|
-
compilerOptions: compilerOptionsSchema.optional(),
|
|
1801
|
-
httpClient: httpClientSchema.optional(),
|
|
1802
|
-
packageManager: z.enum(["pnpm", "yarn"]).optional(),
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1828
|
+
typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
|
|
1829
|
+
zodVersion: nonEmptyStringSchema.optional().describe("The Zod version used by generated runtime schemas."),
|
|
1830
|
+
compilerOptions: compilerOptionsSchema.optional().describe("TypeScript compiler options for the generated project."),
|
|
1831
|
+
httpClient: httpClientSchema.optional().describe("The HTTP client used by generated TypeScript code."),
|
|
1832
|
+
packageManager: z.enum(["pnpm", "yarn"]).optional().describe("The package manager used by the generated project."),
|
|
1833
|
+
packageManagerVersion: nonEmptyStringSchema.optional().describe("The package manager version used by the generated project."),
|
|
1834
|
+
testFramework: z.enum(["jest", "vitest"]).optional().describe("The test framework used by generated tests."),
|
|
1835
|
+
namingStrategy: z.enum(["base", "originalPropertyNames"]).optional().describe("How schema property names are converted into TypeScript identifiers."),
|
|
1836
|
+
bundle: z.boolean().optional().describe("Whether the generated package includes bundled output."),
|
|
1837
|
+
exportClassDefault: z.boolean().optional().describe("Whether the client class is also exported as the default export."),
|
|
1807
1838
|
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
1808
|
-
namespaceExportName: nonEmptyStringSchema.optional(),
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1839
|
+
namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
|
|
1840
|
+
consolidateTypeFiles: z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
|
|
1841
|
+
allowCustomFetcher: z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
|
|
1842
|
+
useBrandedStringAliases: z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
|
|
1843
|
+
useLegacyExports: z.boolean().optional().describe("Whether the package emits the legacy export layout."),
|
|
1844
|
+
useBigInt: z.boolean().optional().describe("Whether 64-bit integer values are represented with bigint."),
|
|
1845
|
+
serdeLayer: z.boolean().optional().describe("Whether generated models use Fern serialization and deserialization helpers."),
|
|
1846
|
+
/** Ship only the ESM build (drops CJS) to avoid the Node dual-package hazard. */
|
|
1847
|
+
esmOnly: z.boolean().optional().describe("Whether the package emits only ECMAScript modules."),
|
|
1848
|
+
scripts: z.array(packageScriptSchema).optional().describe("Additional scripts added to the generated package manifest.")
|
|
1815
1849
|
});
|
|
1816
1850
|
|
|
1817
1851
|
// src/sdk-config-domain/v1/language/mcp.ts
|
|
@@ -1826,172 +1860,183 @@ var mcpAvailabilityStatuses = [
|
|
|
1826
1860
|
"LEGACY"
|
|
1827
1861
|
];
|
|
1828
1862
|
var mcpToolFilterSchema = z.strictObject({
|
|
1829
|
-
include: z.array(nonEmptyStringSchema).optional(),
|
|
1830
|
-
exclude: z.array(nonEmptyStringSchema).optional()
|
|
1863
|
+
include: z.array(nonEmptyStringSchema).optional().describe("Operations explicitly included as MCP tools."),
|
|
1864
|
+
exclude: z.array(nonEmptyStringSchema).optional().describe("Operations explicitly excluded from MCP tools.")
|
|
1831
1865
|
});
|
|
1832
1866
|
var mcpToolsetNameSchema = nonEmptyStringSchema.refine(
|
|
1833
1867
|
(name) => name !== "default" && /^[a-z0-9-]+$/.test(name),
|
|
1834
1868
|
'toolset names must match [a-z0-9-]+ and cannot be "default"'
|
|
1835
1869
|
);
|
|
1836
1870
|
var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
|
|
1837
|
-
serverName: nonEmptyStringSchema.optional(),
|
|
1838
|
-
serverDescription: nonEmptyStringSchema.optional(),
|
|
1839
|
-
excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional(),
|
|
1840
|
-
tools: mcpToolFilterSchema.optional(),
|
|
1841
|
-
toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional()
|
|
1871
|
+
serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
|
|
1872
|
+
serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
|
|
1873
|
+
excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
|
|
1874
|
+
tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
|
|
1875
|
+
toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset.")
|
|
1842
1876
|
});
|
|
1843
1877
|
var phpGenerationConfigSchema = z.strictObject({
|
|
1844
|
-
propertyAccess: z.enum(["public", "private"]).optional(),
|
|
1845
|
-
generateClientInterfaces: z.boolean().optional()
|
|
1878
|
+
propertyAccess: z.enum(["public", "private"]).optional().describe("The visibility of generated PHP model properties."),
|
|
1879
|
+
generateClientInterfaces: z.boolean().optional().describe("Whether interfaces are generated for PHP client classes.")
|
|
1846
1880
|
});
|
|
1847
1881
|
var pythonClientSchema = z.strictObject({
|
|
1848
|
-
fileName: nonEmptyStringSchema.optional(),
|
|
1849
|
-
exportedFileName: nonEmptyStringSchema.optional()
|
|
1882
|
+
fileName: nonEmptyStringSchema.optional().describe("The source file name for the Python client."),
|
|
1883
|
+
exportedFileName: nonEmptyStringSchema.optional().describe("The file name used when exporting the Python client.")
|
|
1850
1884
|
});
|
|
1851
1885
|
var pydanticConfigSchema = z.strictObject({
|
|
1852
|
-
versionCompatibility: z.enum(["v1", "v2", "both", "v1-on-v2"]).optional(),
|
|
1853
|
-
frozen: z.boolean().optional(),
|
|
1854
|
-
requireOptionalFields: z.boolean().optional(),
|
|
1855
|
-
unionNaming: z.enum(["v0", "v1"]).optional(),
|
|
1856
|
-
useFieldAliases: z.boolean().optional()
|
|
1886
|
+
versionCompatibility: z.enum(["v1", "v2", "both", "v1-on-v2"]).optional().describe("The Pydantic major versions supported by generated models."),
|
|
1887
|
+
frozen: z.boolean().optional().describe("Whether generated Pydantic models are immutable."),
|
|
1888
|
+
requireOptionalFields: z.boolean().optional().describe("Whether Optional fields remain required unless they declare a default."),
|
|
1889
|
+
unionNaming: z.enum(["v0", "v1"]).optional().describe("The naming strategy for generated union types."),
|
|
1890
|
+
useFieldAliases: z.boolean().optional().describe("Whether Pydantic field aliases preserve wire names.")
|
|
1857
1891
|
});
|
|
1858
1892
|
var additionalInitExportSchema = z.strictObject({
|
|
1859
|
-
from: nonEmptyStringSchema,
|
|
1860
|
-
imports: z.array(nonEmptyStringSchema).min(1)
|
|
1893
|
+
from: nonEmptyStringSchema.describe("The module from which names are re-exported."),
|
|
1894
|
+
imports: z.array(nonEmptyStringSchema).min(1).describe("Names re-exported from the module.")
|
|
1861
1895
|
});
|
|
1862
1896
|
var pythonGenerationConfigSchema = z.strictObject({
|
|
1863
|
-
pythonVersion: nonEmptyStringSchema.optional(),
|
|
1864
|
-
pydanticVersion: nonEmptyStringSchema.optional(),
|
|
1865
|
-
pydantic: pydanticConfigSchema.optional(),
|
|
1866
|
-
client: pythonClientSchema.optional(),
|
|
1897
|
+
pythonVersion: nonEmptyStringSchema.optional().describe("The Python version targeted by the generated project."),
|
|
1898
|
+
pydanticVersion: nonEmptyStringSchema.optional().describe("The Pydantic dependency version requirement."),
|
|
1899
|
+
pydantic: pydanticConfigSchema.optional().describe("Pydantic model-generation behavior."),
|
|
1900
|
+
client: pythonClientSchema.optional().describe("Python client file naming."),
|
|
1867
1901
|
/** Default followed by generated sync and async HTTP clients when the caller does not override it. */
|
|
1868
|
-
followRedirectsByDefault: z.boolean().optional(),
|
|
1902
|
+
followRedirectsByDefault: z.boolean().optional().describe("Whether generated HTTP clients follow redirects by default."),
|
|
1869
1903
|
/** Chunk size passed to Python byte-stream iterators. */
|
|
1870
|
-
defaultBytesStreamChunkSize: z.number().int().positive().optional(),
|
|
1904
|
+
defaultBytesStreamChunkSize: z.number().int().positive().optional().describe("The default byte-stream iterator chunk size."),
|
|
1871
1905
|
/** Python interpreter recursion limit installed by the generated package at import time. */
|
|
1872
|
-
recursionLimit: z.number().int().gt(1e3).optional(),
|
|
1906
|
+
recursionLimit: z.number().int().gt(1e3).optional().describe("The Python recursion limit installed when the generated package is imported."),
|
|
1873
1907
|
/** Published Python extras, keyed by extra name with package dependency names as values. */
|
|
1874
|
-
extras: z.record(nonEmptyStringSchema, z.array(nonEmptyStringSchema)).optional(),
|
|
1875
|
-
alwaysInitializeOptionals: z.boolean().optional(),
|
|
1876
|
-
useTypedDictRequests: z.boolean().optional(),
|
|
1877
|
-
additionalInitExports: z.array(additionalInitExportSchema).optional()
|
|
1908
|
+
extras: z.record(nonEmptyStringSchema, z.array(nonEmptyStringSchema)).optional().describe("Published Python extras and their dependency names."),
|
|
1909
|
+
alwaysInitializeOptionals: z.boolean().optional().describe("Whether optional model fields are initialized even when omitted."),
|
|
1910
|
+
useTypedDictRequests: z.boolean().optional().describe("Whether request bodies are generated as TypedDict types."),
|
|
1911
|
+
additionalInitExports: z.array(additionalInitExportSchema).optional().describe("Additional names re-exported from the package initializer.")
|
|
1878
1912
|
});
|
|
1879
1913
|
var rubyGenerationConfigSchema = z.strictObject({
|
|
1880
|
-
requirePaths: z.array(nonEmptyStringSchema).optional()
|
|
1914
|
+
requirePaths: z.array(nonEmptyStringSchema).optional().describe("Ruby load paths included in the generated gem specification.")
|
|
1881
1915
|
});
|
|
1882
1916
|
var rustGenerationConfigSchema = z.strictObject({
|
|
1883
1917
|
/**
|
|
1884
1918
|
* Rust type for datetime primitives. `offset` maps to `DateTime<FixedOffset>` and preserves the
|
|
1885
1919
|
* timezone the payload carried; `utc` maps to `DateTime<Utc>` and normalizes to UTC.
|
|
1886
1920
|
*/
|
|
1887
|
-
dateTimeType: z.enum(["offset", "utc"]).optional(),
|
|
1921
|
+
dateTimeType: z.enum(["offset", "utc"]).optional().describe("Whether datetime values preserve their offset or normalize to UTC."),
|
|
1888
1922
|
/** Uppercase common initialisms in generated names (`UserID` rather than `UserId`). */
|
|
1889
|
-
capitalizeInitialisms: z.boolean().optional(),
|
|
1923
|
+
capitalizeInitialisms: z.boolean().optional().describe("Whether generated Rust names capitalize common initialisms."),
|
|
1890
1924
|
/** Cargo features, mapping a feature name to the dependencies or features it enables. */
|
|
1891
|
-
features: z.record(z.string(), z.array(nonEmptyStringSchema)).optional(),
|
|
1925
|
+
features: z.record(z.string(), z.array(nonEmptyStringSchema)).optional().describe("Cargo features and the dependencies or features each enables."),
|
|
1892
1926
|
/** Overrides which features make up Cargo's `default` feature set. */
|
|
1893
|
-
defaultFeatures: z.array(nonEmptyStringSchema).optional()
|
|
1927
|
+
defaultFeatures: z.array(nonEmptyStringSchema).optional().describe("Cargo features included in the crate default feature set.")
|
|
1894
1928
|
});
|
|
1895
1929
|
var swiftGenerationConfigSchema = z.strictObject({
|
|
1896
|
-
moduleName: nonEmptyStringSchema.optional(),
|
|
1897
|
-
nullableAsOptional: z.boolean().optional()
|
|
1930
|
+
moduleName: nonEmptyStringSchema.optional().describe("The Swift module name for the generated package."),
|
|
1931
|
+
nullableAsOptional: z.boolean().optional().describe("Whether nullable values are represented as Swift optionals.")
|
|
1898
1932
|
});
|
|
1899
1933
|
var planModifierSourceSchema = z.discriminatedUnion("enabled", [
|
|
1900
|
-
z.strictObject({
|
|
1901
|
-
|
|
1934
|
+
z.strictObject({
|
|
1935
|
+
enabled: z.literal(true).describe("Enables custom Terraform plan modifiers."),
|
|
1936
|
+
sourceDir: nonEmptyStringSchema.describe(
|
|
1937
|
+
"The directory containing custom plan modifier source files."
|
|
1938
|
+
)
|
|
1939
|
+
}),
|
|
1940
|
+
z.strictObject({
|
|
1941
|
+
enabled: z.literal(false).describe("Disables custom Terraform plan modifiers.")
|
|
1942
|
+
})
|
|
1902
1943
|
]);
|
|
1903
1944
|
var planModifiersSchema = z.strictObject({
|
|
1904
|
-
resources: planModifierSourceSchema,
|
|
1905
|
-
attributes: planModifierSourceSchema
|
|
1945
|
+
resources: planModifierSourceSchema.describe("Custom plan modifiers for generated resources."),
|
|
1946
|
+
attributes: planModifierSourceSchema.describe("Custom plan modifiers for generated attributes.")
|
|
1906
1947
|
});
|
|
1907
1948
|
var providerSchemaSchema = z.strictObject({
|
|
1908
|
-
addressKey: nonEmptyStringSchema
|
|
1909
|
-
|
|
1949
|
+
addressKey: nonEmptyStringSchema.describe(
|
|
1950
|
+
"The provider attribute used to configure the API address."
|
|
1951
|
+
),
|
|
1952
|
+
authTokenKey: nonEmptyStringSchema.describe(
|
|
1953
|
+
"The provider attribute used to configure the authentication token."
|
|
1954
|
+
)
|
|
1910
1955
|
});
|
|
1911
1956
|
var terraformGenerationConfigSchema = z.strictObject({
|
|
1912
|
-
providerName: nonEmptyStringSchema.optional(),
|
|
1913
|
-
providerVersion: nonEmptyStringSchema.optional(),
|
|
1914
|
-
providerModulePath: goModulePathSchema.optional(),
|
|
1915
|
-
mockAcceptance: z.boolean().optional(),
|
|
1916
|
-
hideComputedDiff: z.boolean().optional(),
|
|
1917
|
-
providerSchema: providerSchemaSchema.optional(),
|
|
1918
|
-
planModifiers: planModifiersSchema.optional()
|
|
1957
|
+
providerName: nonEmptyStringSchema.optional().describe("The Terraform provider name."),
|
|
1958
|
+
providerVersion: nonEmptyStringSchema.optional().describe("The generated Terraform provider version."),
|
|
1959
|
+
providerModulePath: goModulePathSchema.optional().describe("The Go module path for the generated provider."),
|
|
1960
|
+
mockAcceptance: z.boolean().optional().describe("Whether acceptance tests use a mock API server."),
|
|
1961
|
+
hideComputedDiff: z.boolean().optional().describe("Whether computed-only changes are hidden from Terraform plans."),
|
|
1962
|
+
providerSchema: providerSchemaSchema.optional().describe("Names of provider-level configuration attributes."),
|
|
1963
|
+
planModifiers: planModifiersSchema.optional().describe("Custom plan modifier source configuration.")
|
|
1919
1964
|
});
|
|
1920
1965
|
|
|
1921
1966
|
// src/sdk-config/v1/target.ts
|
|
1922
1967
|
var targetOverrideShape = {
|
|
1923
|
-
generatorVersion: exactSemverSchema.optional(),
|
|
1924
|
-
sdkName: nonEmptyStringSchema.optional(),
|
|
1925
|
-
sdkVersion: nonEmptyStringSchema.optional(),
|
|
1926
|
-
client: sdkConfigV1ClientConfigOverrideSchema.optional(),
|
|
1927
|
-
docs: sdkConfigV1DocsConfigSchema.optional(),
|
|
1928
|
-
package: sdkConfigV1PackageConfigSchema.optional(),
|
|
1929
|
-
output: sdkConfigV1OutputConfigSchema.optional()
|
|
1968
|
+
generatorVersion: exactSemverSchema.optional().describe("The exact generator version used for this target."),
|
|
1969
|
+
sdkName: nonEmptyStringSchema.optional().describe("An SDK name that overrides the root value for this target."),
|
|
1970
|
+
sdkVersion: nonEmptyStringSchema.optional().describe("An SDK version that overrides the root value for this target."),
|
|
1971
|
+
client: sdkConfigV1ClientConfigOverrideSchema.optional().describe("Client settings that override root client configuration for this target."),
|
|
1972
|
+
docs: sdkConfigV1DocsConfigSchema.optional().describe("Documentation settings that override root documentation for this target."),
|
|
1973
|
+
package: sdkConfigV1PackageConfigSchema.optional().describe("Package metadata that overrides root package configuration for this target."),
|
|
1974
|
+
output: sdkConfigV1OutputConfigSchema.optional().describe("Output configuration that replaces the root output for this target.")
|
|
1930
1975
|
};
|
|
1931
1976
|
var sdkConfigV1TargetSchema = z.discriminatedUnion("language", [
|
|
1932
1977
|
z.strictObject({
|
|
1933
|
-
language: z.literal("typescript"),
|
|
1934
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(typescriptGenerationConfigSchema.shape).optional(),
|
|
1978
|
+
language: z.literal("typescript").describe("Generates a TypeScript SDK."),
|
|
1979
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(typescriptGenerationConfigSchema.shape).optional().describe("Common and TypeScript-specific generation settings for this target."),
|
|
1935
1980
|
...targetOverrideShape
|
|
1936
1981
|
}),
|
|
1937
1982
|
z.strictObject({
|
|
1938
|
-
language: z.literal("python"),
|
|
1939
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(pythonGenerationConfigSchema.shape).optional(),
|
|
1983
|
+
language: z.literal("python").describe("Generates a Python SDK."),
|
|
1984
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(pythonGenerationConfigSchema.shape).optional().describe("Common and Python-specific generation settings for this target."),
|
|
1940
1985
|
...targetOverrideShape
|
|
1941
1986
|
}),
|
|
1942
1987
|
z.strictObject({
|
|
1943
|
-
language: z.literal("java"),
|
|
1944
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(javaGenerationConfigSchema.shape).optional(),
|
|
1988
|
+
language: z.literal("java").describe("Generates a Java SDK."),
|
|
1989
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(javaGenerationConfigSchema.shape).optional().describe("Common and Java-specific generation settings for this target."),
|
|
1945
1990
|
...targetOverrideShape
|
|
1946
1991
|
}),
|
|
1947
1992
|
z.strictObject({
|
|
1948
|
-
language: z.literal("kotlin"),
|
|
1949
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(kotlinGenerationConfigSchema.shape).optional(),
|
|
1993
|
+
language: z.literal("kotlin").describe("Generates a Kotlin SDK."),
|
|
1994
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(kotlinGenerationConfigSchema.shape).optional().describe("Common and Kotlin-specific generation settings for this target."),
|
|
1950
1995
|
...targetOverrideShape
|
|
1951
1996
|
}),
|
|
1952
1997
|
z.strictObject({
|
|
1953
|
-
language: z.literal("go"),
|
|
1954
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(goGenerationConfigSchema.shape).optional(),
|
|
1998
|
+
language: z.literal("go").describe("Generates a Go SDK."),
|
|
1999
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(goGenerationConfigSchema.shape).optional().describe("Common and Go-specific generation settings for this target."),
|
|
1955
2000
|
...targetOverrideShape
|
|
1956
2001
|
}),
|
|
1957
2002
|
z.strictObject({
|
|
1958
|
-
language: z.literal("csharp"),
|
|
1959
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(csharpGenerationConfigSchema.shape).optional(),
|
|
2003
|
+
language: z.literal("csharp").describe("Generates a C# SDK."),
|
|
2004
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(csharpGenerationConfigSchema.shape).optional().describe("Common and C#-specific generation settings for this target."),
|
|
1960
2005
|
...targetOverrideShape
|
|
1961
2006
|
}),
|
|
1962
2007
|
z.strictObject({
|
|
1963
|
-
language: z.literal("php"),
|
|
1964
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(phpGenerationConfigSchema.shape).optional(),
|
|
2008
|
+
language: z.literal("php").describe("Generates a PHP SDK."),
|
|
2009
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(phpGenerationConfigSchema.shape).optional().describe("Common and PHP-specific generation settings for this target."),
|
|
1965
2010
|
...targetOverrideShape
|
|
1966
2011
|
}),
|
|
1967
2012
|
z.strictObject({
|
|
1968
|
-
language: z.literal("ruby"),
|
|
1969
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(rubyGenerationConfigSchema.shape).optional(),
|
|
2013
|
+
language: z.literal("ruby").describe("Generates a Ruby SDK."),
|
|
2014
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(rubyGenerationConfigSchema.shape).optional().describe("Common and Ruby-specific generation settings for this target."),
|
|
1970
2015
|
...targetOverrideShape
|
|
1971
2016
|
}),
|
|
1972
2017
|
z.strictObject({
|
|
1973
|
-
language: z.literal("rust"),
|
|
1974
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(rustGenerationConfigSchema.shape).optional(),
|
|
2018
|
+
language: z.literal("rust").describe("Generates a Rust SDK."),
|
|
2019
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(rustGenerationConfigSchema.shape).optional().describe("Common and Rust-specific generation settings for this target."),
|
|
1975
2020
|
...targetOverrideShape
|
|
1976
2021
|
}),
|
|
1977
2022
|
z.strictObject({
|
|
1978
|
-
language: z.literal("swift"),
|
|
1979
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(swiftGenerationConfigSchema.shape).optional(),
|
|
2023
|
+
language: z.literal("swift").describe("Generates a Swift SDK."),
|
|
2024
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(swiftGenerationConfigSchema.shape).optional().describe("Common and Swift-specific generation settings for this target."),
|
|
1980
2025
|
...targetOverrideShape
|
|
1981
2026
|
}),
|
|
1982
2027
|
z.strictObject({
|
|
1983
|
-
language: z.literal("cli"),
|
|
1984
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(cliGenerationConfigSchema.shape).optional(),
|
|
2028
|
+
language: z.literal("cli").describe("Generates a command-line interface."),
|
|
2029
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(cliGenerationConfigSchema.shape).optional().describe("Common and CLI-specific generation settings for this target."),
|
|
1985
2030
|
...targetOverrideShape
|
|
1986
2031
|
}),
|
|
1987
2032
|
z.strictObject({
|
|
1988
|
-
language: z.literal("mcp"),
|
|
1989
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(mcpGenerationConfigSchema.shape).optional(),
|
|
2033
|
+
language: z.literal("mcp").describe("Generates an MCP server."),
|
|
2034
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(mcpGenerationConfigSchema.shape).optional().describe("Common and MCP-specific generation settings for this target."),
|
|
1990
2035
|
...targetOverrideShape
|
|
1991
2036
|
}),
|
|
1992
2037
|
z.strictObject({
|
|
1993
|
-
language: z.literal("terraform"),
|
|
1994
|
-
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(terraformGenerationConfigSchema.shape).optional(),
|
|
2038
|
+
language: z.literal("terraform").describe("Generates a Terraform provider."),
|
|
2039
|
+
generation: sdkConfigV1GenerationConfigOverrideSchema.extend(terraformGenerationConfigSchema.shape).optional().describe("Common and Terraform-specific generation settings for this target."),
|
|
1995
2040
|
...targetOverrideShape
|
|
1996
2041
|
})
|
|
1997
2042
|
]);
|
|
@@ -2084,19 +2129,21 @@ function validateTargetPublishing(target, targetIndex, globalPackage, globalOutp
|
|
|
2084
2129
|
);
|
|
2085
2130
|
}
|
|
2086
2131
|
var sdkConfigV1Schema = z.strictObject({
|
|
2087
|
-
schemaVersion: z.literal(SDK_CONFIG_V1_SCHEMA_VERSION),
|
|
2088
|
-
sdkName: nonEmptyStringSchema,
|
|
2089
|
-
sdkVersion: nonEmptyStringSchema.default("1.0.0"),
|
|
2090
|
-
apiVersion: nonEmptyStringSchema.optional(),
|
|
2091
|
-
source: sdkConfigV1SourceConfigSchema
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2132
|
+
schemaVersion: z.literal(SDK_CONFIG_V1_SCHEMA_VERSION).describe("The version of the customer-facing SDK Config schema."),
|
|
2133
|
+
sdkName: nonEmptyStringSchema.describe("The default name used for generated SDKs."),
|
|
2134
|
+
sdkVersion: nonEmptyStringSchema.default("1.0.0").describe("The default version assigned to generated SDKs."),
|
|
2135
|
+
apiVersion: nonEmptyStringSchema.optional().describe("The version of the API represented by the generated SDKs."),
|
|
2136
|
+
source: sdkConfigV1SourceConfigSchema.describe(
|
|
2137
|
+
"The API descriptions used to generate the SDKs."
|
|
2138
|
+
),
|
|
2139
|
+
api: sdkConfigV1ApiConfigSchema.prefault({}).describe("Shared API behavior for every target."),
|
|
2140
|
+
client: sdkConfigV1ClientConfigSchema.prefault({}).describe("Shared generated-client behavior for every target."),
|
|
2141
|
+
package: sdkConfigV1PackageConfigSchema.prefault({}).describe("Package metadata inherited by every target."),
|
|
2142
|
+
output: sdkConfigV1OutputConfigSchema.optional().describe("The default output delivery and publication configuration."),
|
|
2143
|
+
replay: sdkConfigV1ReplayConfigSchema.optional().describe("Generation replay behavior shared by every target."),
|
|
2144
|
+
docs: sdkConfigV1DocsConfigSchema.prefault({}).describe("Documentation settings inherited by every target."),
|
|
2145
|
+
generation: sdkConfigV1GenerationConfigSchema.prefault({}).describe("Generation settings inherited by every target."),
|
|
2146
|
+
targets: z.array(sdkConfigV1TargetSchema).min(1).describe("Language targets to generate; each language may appear once.")
|
|
2100
2147
|
}).superRefine(({ output, package: globalPackage, targets }, context) => {
|
|
2101
2148
|
const configuredLanguages = /* @__PURE__ */ new Set();
|
|
2102
2149
|
targets.forEach((target, targetIndex) => {
|
|
@@ -2376,9 +2423,6 @@ function mapInvocation(generator, language, activeLanguages, index) {
|
|
|
2376
2423
|
if (generator.keywords?.length) {
|
|
2377
2424
|
generation.reservedKeywords = [...generator.keywords];
|
|
2378
2425
|
}
|
|
2379
|
-
if (generator.generateFullProject !== void 0) {
|
|
2380
|
-
generation.generateFullProject = generator.generateFullProject;
|
|
2381
|
-
}
|
|
2382
2426
|
const settings = isObject(generator.settings) ? generator.settings : void 0;
|
|
2383
2427
|
if (settings) {
|
|
2384
2428
|
const inlinePathParameters = takeBoolean(settings, ["inlinePathParameters"], state, [
|
|
@@ -2409,6 +2453,7 @@ function unsupportedResolvedFields(generator, index) {
|
|
|
2409
2453
|
"disableExamples",
|
|
2410
2454
|
generator.disableExamples === false ? void 0 : generator.disableExamples
|
|
2411
2455
|
],
|
|
2456
|
+
["generateFullProject", generator.generateFullProject],
|
|
2412
2457
|
["apiOverride", generator.apiOverride]
|
|
2413
2458
|
];
|
|
2414
2459
|
return values.flatMap(([field, value]) => {
|
|
@@ -2438,6 +2483,11 @@ function resolvedFieldGuidance(field) {
|
|
|
2438
2483
|
suggestedAction: "Preserve this orchestration setting outside SDK Config; public v1 has no idempotency-generation field."
|
|
2439
2484
|
};
|
|
2440
2485
|
}
|
|
2486
|
+
if (field === "generateFullProject") {
|
|
2487
|
+
return {
|
|
2488
|
+
suggestedAction: "Preserve this packaging setting on the generation request; it is not customer-authored SDK configuration."
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2441
2491
|
return {
|
|
2442
2492
|
suggestedAction: "Review this Fern setting and preserve it outside SDK Config, or set an equivalent SDK Config field manually if one is introduced."
|
|
2443
2493
|
};
|
|
@@ -2484,15 +2534,23 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2484
2534
|
};
|
|
2485
2535
|
}
|
|
2486
2536
|
const pythonClient = language === "python" ? takeObject(config, ["client"], state, basePath) : void 0;
|
|
2537
|
+
const typescriptNaming = language === "typescript" || language === "mcp" ? takeObject(config, ["naming"], state, basePath) : void 0;
|
|
2487
2538
|
const directClientName = takeString(config, ["clientName", "clientClassName"], state, basePath);
|
|
2488
|
-
const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : void 0;
|
|
2539
|
+
const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : typescriptNaming ? takeString(typescriptNaming.value, ["client"], state, typescriptNaming.path) : void 0;
|
|
2489
2540
|
const directExportedClientName = takeString(
|
|
2490
2541
|
config,
|
|
2491
2542
|
["exportedClientName", "exportedClientClassName"],
|
|
2492
2543
|
state,
|
|
2493
2544
|
basePath
|
|
2494
2545
|
);
|
|
2495
|
-
const nestedExportedClientName = pythonClient ? takeString(pythonClient.value, ["exportedClassName"], state, pythonClient.path) :
|
|
2546
|
+
const nestedExportedClientName = pythonClient ? takeString(pythonClient.value, ["exportedClassName"], state, pythonClient.path) : typescriptNaming ? (
|
|
2547
|
+
// TypeScript's `naming.namespace` is the base every other naming.* field defaults from
|
|
2548
|
+
// (Fern's docs: `client` defaults to `${PascalCase(namespace)}Client`, same for
|
|
2549
|
+
// `environment`/`error`/etc.) — the same role `exportedClientName` already plays for every
|
|
2550
|
+
// other language's `clientPrefix` derivation.
|
|
2551
|
+
takeString(typescriptNaming.value, ["namespace"], state, typescriptNaming.path)
|
|
2552
|
+
) : void 0;
|
|
2553
|
+
const nestedEnvironmentTypeName = typescriptNaming ? takeString(typescriptNaming.value, ["environment"], state, typescriptNaming.path) : void 0;
|
|
2496
2554
|
const naming = compact({
|
|
2497
2555
|
pagerName: takeString(
|
|
2498
2556
|
config,
|
|
@@ -2502,12 +2560,7 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2502
2560
|
),
|
|
2503
2561
|
clientName: directClientName ?? nestedClientName,
|
|
2504
2562
|
exportedClientName: directExportedClientName ?? nestedExportedClientName,
|
|
2505
|
-
environmentTypeName: takeString(
|
|
2506
|
-
config,
|
|
2507
|
-
["environmentClassName", "environmentEnumName"],
|
|
2508
|
-
state,
|
|
2509
|
-
basePath
|
|
2510
|
-
),
|
|
2563
|
+
environmentTypeName: takeString(config, ["environmentClassName", "environmentEnumName"], state, basePath) ?? nestedEnvironmentTypeName,
|
|
2511
2564
|
apiErrorName: takeString(config, ["baseApiExceptionClassName"], state, basePath),
|
|
2512
2565
|
baseErrorName: takeString(config, ["baseExceptionClassName"], state, basePath)
|
|
2513
2566
|
});
|
|
@@ -2521,8 +2574,10 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2521
2574
|
basePath
|
|
2522
2575
|
);
|
|
2523
2576
|
if (webSockets !== void 0) generation.webSockets = webSockets;
|
|
2524
|
-
|
|
2525
|
-
|
|
2577
|
+
if (language === "typescript") {
|
|
2578
|
+
const streams = mapTypescriptStreams(config, state, basePath);
|
|
2579
|
+
if (streams) generation.streams = streams;
|
|
2580
|
+
}
|
|
2526
2581
|
const inlineTypes = takeBoolean(config, ["enableInlineTypes"], state, basePath);
|
|
2527
2582
|
const omitUndefined = takeBoolean(config, ["omitUndefined"], state, basePath);
|
|
2528
2583
|
const forwardEnums = takeBoolean(config, ["enableForwardCompatibleEnums"], state, basePath);
|
|
@@ -2538,6 +2593,18 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2538
2593
|
if (packagePath !== void 0) generation.layout = { packagePath };
|
|
2539
2594
|
mapDependencies(config, state, packageConfig, basePath);
|
|
2540
2595
|
}
|
|
2596
|
+
function mapTypescriptStreams(config, state, basePath) {
|
|
2597
|
+
const responseType = takeEnum(config, ["streamType"], ["wrapper", "web"], state, basePath);
|
|
2598
|
+
const fileResponseType = takeEnum(
|
|
2599
|
+
config,
|
|
2600
|
+
["fileResponseType"],
|
|
2601
|
+
["stream", "binary-response"],
|
|
2602
|
+
state,
|
|
2603
|
+
basePath
|
|
2604
|
+
);
|
|
2605
|
+
if (responseType === void 0 && fileResponseType === void 0) return void 0;
|
|
2606
|
+
return { enabled: true, ...compact({ responseType, fileResponseType }) };
|
|
2607
|
+
}
|
|
2541
2608
|
function mapLanguageConfig(language, config, state, packageConfig, basePath) {
|
|
2542
2609
|
switch (language) {
|
|
2543
2610
|
case "typescript":
|
|
@@ -2571,29 +2638,39 @@ function mapLanguageConfig(language, config, state, packageConfig, basePath) {
|
|
|
2571
2638
|
}
|
|
2572
2639
|
}
|
|
2573
2640
|
function mapTypescript(config, state, packageConfig, basePath) {
|
|
2574
|
-
|
|
2641
|
+
const packageJsonManifest = mapPackageManifest(
|
|
2642
|
+
config,
|
|
2643
|
+
["packageJson"],
|
|
2644
|
+
state,
|
|
2645
|
+
packageConfig,
|
|
2646
|
+
basePath
|
|
2647
|
+
);
|
|
2648
|
+
const packageJsonPackageManager = packageJsonManifest ? takeString(packageJsonManifest.value, ["packageManager"], state, packageJsonManifest.path) : void 0;
|
|
2649
|
+
const packageManagerAtIndex = packageJsonPackageManager ? packageJsonPackageManager.indexOf("@", packageJsonPackageManager.startsWith("@") ? 1 : 0) : -1;
|
|
2650
|
+
const packageManagerVersionPart = packageManagerAtIndex >= 0 ? packageJsonPackageManager?.slice(packageManagerAtIndex + 1).split("+")[0] : void 0;
|
|
2651
|
+
const packageManagerVersion = packageManagerVersionPart || void 0;
|
|
2575
2652
|
const serdeLayer = takeBoolean(config, ["serdeLayer"], state, basePath);
|
|
2576
2653
|
const noSerdeLayer = takeBoolean(config, ["noSerdeLayer"], state, basePath);
|
|
2577
2654
|
const fetchSupport = takeEnum(config, ["fetchSupport"], ["native"], state, basePath);
|
|
2655
|
+
const namingObject = takeObject(config, ["naming"], state, basePath);
|
|
2656
|
+
const nestedNamespace = namingObject ? takeString(namingObject.value, ["namespace"], state, namingObject.path) : void 0;
|
|
2578
2657
|
return compact({
|
|
2579
2658
|
typescriptVersion: takeString(config, ["typescriptVersion"], state, basePath),
|
|
2580
2659
|
zodVersion: takeString(config, ["zodVersion"], state, basePath),
|
|
2581
2660
|
packageManager: takeEnum(config, ["packageManager"], ["pnpm", "yarn"], state, basePath),
|
|
2661
|
+
packageManagerVersion,
|
|
2582
2662
|
testFramework: takeEnum(config, ["testFramework"], ["jest", "vitest"], state, basePath),
|
|
2583
2663
|
httpClient: fetchSupport === "native" ? { name: "fetch" } : void 0,
|
|
2584
2664
|
bundle: takeBoolean(config, ["bundle"], state, basePath),
|
|
2585
2665
|
exportClassDefault: takeBoolean(config, ["exportClassDefault"], state, basePath),
|
|
2586
|
-
namespaceExportName: takeString(
|
|
2587
|
-
|
|
2588
|
-
["namespaceExportName", "namespaceExport"],
|
|
2589
|
-
state,
|
|
2590
|
-
basePath
|
|
2591
|
-
),
|
|
2666
|
+
namespaceExportName: takeString(config, ["namespaceExportName", "namespaceExport"], state, basePath) ?? nestedNamespace,
|
|
2667
|
+
consolidateTypeFiles: takeBoolean(config, ["consolidateTypeFiles"], state, basePath),
|
|
2592
2668
|
allowCustomFetcher: takeBoolean(config, ["allowCustomFetcher"], state, basePath),
|
|
2593
2669
|
useBrandedStringAliases: takeBoolean(config, ["useBrandedStringAliases"], state, basePath),
|
|
2594
2670
|
useLegacyExports: takeBoolean(config, ["useLegacyExports"], state, basePath),
|
|
2595
2671
|
useBigInt: takeBoolean(config, ["useBigInt"], state, basePath),
|
|
2596
|
-
serdeLayer: serdeLayer ?? (noSerdeLayer === void 0 ? void 0 : !noSerdeLayer)
|
|
2672
|
+
serdeLayer: serdeLayer ?? (noSerdeLayer === void 0 ? void 0 : !noSerdeLayer),
|
|
2673
|
+
esmOnly: takeBoolean(config, ["esmOnly"], state, basePath)
|
|
2597
2674
|
});
|
|
2598
2675
|
}
|
|
2599
2676
|
function mapPython(config, state, packageConfig, basePath) {
|
|
@@ -2704,7 +2781,8 @@ function mapCsharp(config, state, packageConfig, basePath) {
|
|
|
2704
2781
|
});
|
|
2705
2782
|
}
|
|
2706
2783
|
function mapPhp(config, state, packageConfig, basePath) {
|
|
2707
|
-
mapPackageManifest(config, ["composerJson"], state, packageConfig, basePath);
|
|
2784
|
+
const manifest = mapPackageManifest(config, ["composerJson"], state, packageConfig, basePath);
|
|
2785
|
+
if (manifest) mapComposerRequirements(manifest, state, packageConfig);
|
|
2708
2786
|
const packageName = takeString(config, ["packageName"], state, basePath);
|
|
2709
2787
|
if (packageName !== void 0) packageConfig.packageName = packageName;
|
|
2710
2788
|
return compact({
|
|
@@ -2712,6 +2790,20 @@ function mapPhp(config, state, packageConfig, basePath) {
|
|
|
2712
2790
|
generateClientInterfaces: takeBoolean(config, ["generateClientInterfaces"], state, basePath)
|
|
2713
2791
|
});
|
|
2714
2792
|
}
|
|
2793
|
+
function mapComposerRequirements(manifest, state, packageConfig) {
|
|
2794
|
+
const fields = [
|
|
2795
|
+
["require", "extraDependencies"],
|
|
2796
|
+
["require-dev", "extraDevDependencies"]
|
|
2797
|
+
];
|
|
2798
|
+
for (const [composerField, packageField] of fields) {
|
|
2799
|
+
const located = takeObject(manifest.value, [composerField], state, manifest.path);
|
|
2800
|
+
if (!located) continue;
|
|
2801
|
+
const dependencies = Object.entries(located.value).flatMap(
|
|
2802
|
+
([name, dependency]) => mapDependency(name, dependency, state, [...located.path, name])
|
|
2803
|
+
);
|
|
2804
|
+
if (dependencies.length) packageConfig[packageField] = dependencies;
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2715
2807
|
function mapRuby(config, state, packageConfig, basePath) {
|
|
2716
2808
|
const moduleName = takeString(config, ["moduleName"], state, basePath);
|
|
2717
2809
|
if (moduleName !== void 0) packageConfig.moduleName = moduleName;
|
|
@@ -2881,28 +2973,52 @@ function takeCustomSections(value, language, activeLanguages, state, basePath) {
|
|
|
2881
2973
|
}
|
|
2882
2974
|
function mapPackageManifest(config, aliases, state, packageConfig, basePath) {
|
|
2883
2975
|
const manifest = takeObject(config, aliases, state, basePath);
|
|
2884
|
-
if (!manifest) return;
|
|
2976
|
+
if (!manifest) return void 0;
|
|
2885
2977
|
const packageName = takeString(manifest.value, ["name"], state, manifest.path);
|
|
2886
2978
|
const description = takeString(manifest.value, ["description"], state, manifest.path);
|
|
2979
|
+
const keywords = takeStringArray(manifest.value, ["keywords"], state, manifest.path);
|
|
2887
2980
|
const license = takeString(manifest.value, ["license"], state, manifest.path);
|
|
2888
2981
|
const author = takeObject(manifest.value, ["author"], state, manifest.path);
|
|
2889
2982
|
const authorName = author ? takeString(author.value, ["name"], state, author.path) : void 0;
|
|
2890
|
-
const authors =
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2983
|
+
const authors = [
|
|
2984
|
+
...authorName && author ? [
|
|
2985
|
+
compact({
|
|
2986
|
+
name: authorName,
|
|
2987
|
+
email: takeString(author.value, ["email"], state, author.path),
|
|
2988
|
+
url: takeString(author.value, ["url"], state, author.path)
|
|
2989
|
+
})
|
|
2990
|
+
] : [],
|
|
2991
|
+
...takeManifestAuthors(manifest, state)
|
|
2992
|
+
];
|
|
2897
2993
|
Object.assign(
|
|
2898
2994
|
packageConfig,
|
|
2899
2995
|
compact({
|
|
2900
2996
|
packageName,
|
|
2901
2997
|
description,
|
|
2902
|
-
|
|
2998
|
+
homepage: takeString(manifest.value, ["homepage"], state, manifest.path),
|
|
2999
|
+
keywords,
|
|
3000
|
+
authors: authors.length ? authors : void 0,
|
|
2903
3001
|
license: license ? { type: license } : void 0
|
|
2904
3002
|
})
|
|
2905
3003
|
);
|
|
3004
|
+
return manifest;
|
|
3005
|
+
}
|
|
3006
|
+
function takeManifestAuthors(manifest, state) {
|
|
3007
|
+
const located = locate(manifest.value, ["authors"], manifest.path);
|
|
3008
|
+
if (!located || !Array.isArray(located.value)) return [];
|
|
3009
|
+
return located.value.flatMap((entry, index) => {
|
|
3010
|
+
if (!isObject(entry)) return [];
|
|
3011
|
+
const path = [...located.path, index];
|
|
3012
|
+
const name = takeString(entry, ["name"], state, path);
|
|
3013
|
+
if (!name) return [];
|
|
3014
|
+
return [
|
|
3015
|
+
compact({
|
|
3016
|
+
name,
|
|
3017
|
+
email: takeString(entry, ["email"], state, path),
|
|
3018
|
+
url: takeString(entry, ["url"], state, path)
|
|
3019
|
+
})
|
|
3020
|
+
];
|
|
3021
|
+
});
|
|
2906
3022
|
}
|
|
2907
3023
|
function takePythonAdditionalInitExports(config, state, basePath) {
|
|
2908
3024
|
const located = locate(config, ["additionalInitExports"], basePath);
|