@postman/sdk-config 0.7.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 +808 -742
- 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 +808 -742
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +570 -539
- 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 +570 -539
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +570 -539
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +62 -934
- package/dist/sdk-config/v1/index.d.ts +62 -934
- package/dist/sdk-config/v1/index.js +570 -539
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +606 -541
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +1 -1
- package/dist/sdk-config-ir/index.d.ts +1 -1
- package/dist/sdk-config-ir/index.js +606 -541
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +606 -541
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +7 -7
- package/dist/sdk-config-ir/v1/index.d.ts +7 -7
- package/dist/sdk-config-ir/v1/index.js +606 -541
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-BdDv_kwT.d.cts → typescript-Chge0X4f.d.cts} +1 -2
- package/dist/{typescript-BdDv_kwT.d.ts → typescript-Chge0X4f.d.ts} +1 -2
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +15 -14
|
@@ -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,57 +218,57 @@ 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
|
var retryOverrideShape = {
|
|
250
|
-
enabled: z.boolean().optional(),
|
|
251
|
-
maxAttempts: z.number().int().min(1).optional(),
|
|
252
|
-
retryDelayMs: z.number().nonnegative().optional(),
|
|
253
|
-
maxDelayMs: z.number().nonnegative().optional(),
|
|
254
|
-
jitterMs: z.number().nonnegative().optional(),
|
|
255
|
-
backoffFactor: z.number().positive().optional(),
|
|
256
|
-
statusCodes: z.array(z.number().int().min(100).max(599)).optional(),
|
|
257
|
-
methods: z.array(nonEmptyStringSchema).optional(),
|
|
258
|
-
statusCodeProfile: z.enum(["legacy", "recommended"]).optional(),
|
|
259
|
-
maxRetryAfterDelayMs: z.number().nonnegative().optional()
|
|
262
|
+
enabled: z.boolean().optional().describe("Whether the generated client retries failed requests."),
|
|
263
|
+
maxAttempts: z.number().int().min(1).optional().describe("The maximum total request attempts, including the initial attempt."),
|
|
264
|
+
retryDelayMs: z.number().nonnegative().optional().describe("The initial delay between retry attempts, in milliseconds."),
|
|
265
|
+
maxDelayMs: z.number().nonnegative().optional().describe("The maximum backoff delay between attempts, in milliseconds."),
|
|
266
|
+
jitterMs: z.number().nonnegative().optional().describe("The maximum random jitter added to retry delays, in milliseconds."),
|
|
267
|
+
backoffFactor: z.number().positive().optional().describe("The multiplier applied to the delay after each failed attempt."),
|
|
268
|
+
statusCodes: z.array(z.number().int().min(100).max(599)).optional().describe("HTTP status codes that are eligible for retries."),
|
|
269
|
+
methods: z.array(nonEmptyStringSchema).optional().describe("HTTP methods that are eligible for retries."),
|
|
270
|
+
statusCodeProfile: z.enum(["legacy", "recommended"]).optional().describe("The built-in retryable status-code policy."),
|
|
271
|
+
maxRetryAfterDelayMs: z.number().nonnegative().optional().describe("The longest Retry-After delay the client will honor, in milliseconds.")
|
|
260
272
|
};
|
|
261
273
|
function validateRetryDelays({
|
|
262
274
|
maxDelayMs,
|
|
@@ -273,27 +285,29 @@ function validateRetryDelays({
|
|
|
273
285
|
var clientRetryOverrideSchema = z.strictObject(retryOverrideShape).superRefine(validateRetryDelays);
|
|
274
286
|
var retryConfigSchema = z.strictObject({
|
|
275
287
|
...retryOverrideShape,
|
|
276
|
-
enabled: z.boolean().default(true),
|
|
277
|
-
maxAttempts: z.number().int().min(1).default(3),
|
|
278
|
-
retryDelayMs: z.number().nonnegative().default(150),
|
|
279
|
-
maxDelayMs: z.number().nonnegative().default(5e3),
|
|
280
|
-
jitterMs: z.number().nonnegative().default(50),
|
|
281
|
-
backoffFactor: z.number().positive().default(2),
|
|
282
|
-
methods: z.array(nonEmptyStringSchema).default(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]),
|
|
283
|
-
maxRetryAfterDelayMs: z.number().nonnegative().default(6e4)
|
|
288
|
+
enabled: z.boolean().default(true).describe("Whether the generated client retries failed requests."),
|
|
289
|
+
maxAttempts: z.number().int().min(1).default(3).describe("The maximum total request attempts, including the initial attempt."),
|
|
290
|
+
retryDelayMs: z.number().nonnegative().default(150).describe("The initial delay between retry attempts, in milliseconds."),
|
|
291
|
+
maxDelayMs: z.number().nonnegative().default(5e3).describe("The maximum backoff delay between attempts, in milliseconds."),
|
|
292
|
+
jitterMs: z.number().nonnegative().default(50).describe("The maximum random jitter added to retry delays, in milliseconds."),
|
|
293
|
+
backoffFactor: z.number().positive().default(2).describe("The multiplier applied to the delay after each failed attempt."),
|
|
294
|
+
methods: z.array(nonEmptyStringSchema).default(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).describe("HTTP methods that are eligible for retries."),
|
|
295
|
+
maxRetryAfterDelayMs: z.number().nonnegative().default(6e4).describe("The longest Retry-After delay the client will honor, in milliseconds.")
|
|
284
296
|
}).superRefine(validateRetryDelays);
|
|
285
297
|
var constructorParameterSchema = z.strictObject({
|
|
286
|
-
name: nonEmptyStringSchema,
|
|
287
|
-
example: z.string().optional(),
|
|
288
|
-
description: z.string().optional()
|
|
289
|
-
|
|
298
|
+
name: nonEmptyStringSchema.describe("The parameter name in the generated client constructor."),
|
|
299
|
+
example: z.string().optional().describe("An example value shown in generated documentation."),
|
|
300
|
+
description: z.string().optional().describe(
|
|
301
|
+
"A description of the constructor parameter included in generated SDK documentation."
|
|
302
|
+
),
|
|
303
|
+
required: z.boolean().optional().describe("Whether callers must provide the parameter.")
|
|
290
304
|
});
|
|
291
305
|
var parameterStyleSchema = z.enum(["wrapped", "inline", "language-default"]);
|
|
292
306
|
var tokenRefreshConfigSchema = z.strictObject({
|
|
293
|
-
enabled: z.boolean(),
|
|
294
|
-
endpoint: nonEmptyStringSchema.optional(),
|
|
295
|
-
accessTokenField: nonEmptyStringSchema.optional(),
|
|
296
|
-
refreshTokenField: nonEmptyStringSchema.optional()
|
|
307
|
+
enabled: z.boolean().describe("Whether the client can exchange refresh tokens."),
|
|
308
|
+
endpoint: nonEmptyStringSchema.optional().describe("The API endpoint used to refresh tokens."),
|
|
309
|
+
accessTokenField: nonEmptyStringSchema.optional().describe("The response field containing the refreshed access token."),
|
|
310
|
+
refreshTokenField: nonEmptyStringSchema.optional().describe("The response field containing the refreshed refresh token.")
|
|
297
311
|
}).superRefine(({ enabled, endpoint }, context) => {
|
|
298
312
|
if (enabled && endpoint === void 0) {
|
|
299
313
|
context.addIssue({
|
|
@@ -304,53 +318,57 @@ var tokenRefreshConfigSchema = z.strictObject({
|
|
|
304
318
|
}
|
|
305
319
|
});
|
|
306
320
|
var clientOverrideShape = {
|
|
307
|
-
retry: clientRetryOverrideSchema.optional(),
|
|
308
|
-
responseHeaders: z.boolean().optional(),
|
|
309
|
-
responseValidation: z.boolean().optional(),
|
|
310
|
-
multiTenant: z.boolean().optional(),
|
|
311
|
-
additionalConstructorParameters: z.array(constructorParameterSchema).optional(),
|
|
312
|
-
timeoutMs: z.union([z.number().nonnegative(), z.literal("infinity")]).optional(),
|
|
313
|
-
requestParameterStyle: parameterStyleSchema.optional(),
|
|
314
|
-
pathParameterStyle: parameterStyleSchema.optional(),
|
|
315
|
-
filePropertyStyle: parameterStyleSchema.optional(),
|
|
316
|
-
useDefaultRequestParameterValues: z.boolean().optional(),
|
|
317
|
-
respectOptionalRequestBody: z.boolean().optional(),
|
|
318
|
-
tokenRefresh: tokenRefreshConfigSchema.optional()
|
|
321
|
+
retry: clientRetryOverrideSchema.optional().describe("Retry behavior for generated API requests."),
|
|
322
|
+
responseHeaders: z.boolean().optional().describe("Whether generated operations expose HTTP response headers."),
|
|
323
|
+
responseValidation: z.boolean().optional().describe("Whether the client validates API responses against the schema."),
|
|
324
|
+
multiTenant: z.boolean().optional().describe("Whether the client exposes configuration for tenant-specific API access."),
|
|
325
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).optional().describe("Additional parameters added to the generated client constructor."),
|
|
326
|
+
timeoutMs: z.union([z.number().nonnegative(), z.literal("infinity")]).optional().describe('The default request timeout in milliseconds, or "infinity" for no timeout.'),
|
|
327
|
+
requestParameterStyle: parameterStyleSchema.optional().describe("Whether generated operation parameters are wrapped or passed inline."),
|
|
328
|
+
pathParameterStyle: parameterStyleSchema.optional().describe("Whether generated path parameters are wrapped or passed inline."),
|
|
329
|
+
filePropertyStyle: parameterStyleSchema.optional().describe("Whether generated file properties are wrapped or passed inline."),
|
|
330
|
+
useDefaultRequestParameterValues: z.boolean().optional().describe("Whether schema defaults are applied to omitted request parameters."),
|
|
331
|
+
respectOptionalRequestBody: z.boolean().optional().describe("Whether an optional request body remains optional in generated methods."),
|
|
332
|
+
tokenRefresh: tokenRefreshConfigSchema.optional().describe("Refresh-token behavior for the generated client.")
|
|
319
333
|
};
|
|
320
334
|
var clientConfigOverrideSchema = z.strictObject(clientOverrideShape);
|
|
321
335
|
var clientConfigSchema = z.strictObject({
|
|
322
336
|
...clientOverrideShape,
|
|
323
|
-
retry: retryConfigSchema.prefault({}),
|
|
324
|
-
responseHeaders: z.boolean().default(false),
|
|
325
|
-
multiTenant: z.boolean().default(false),
|
|
326
|
-
additionalConstructorParameters: z.array(constructorParameterSchema).default([])
|
|
337
|
+
retry: retryConfigSchema.prefault({}).describe("Retry behavior for generated API requests."),
|
|
338
|
+
responseHeaders: z.boolean().default(false).describe("Whether generated operations expose HTTP response headers."),
|
|
339
|
+
multiTenant: z.boolean().default(false).describe("Whether the client exposes configuration for tenant-specific API access."),
|
|
340
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).default([]).describe("Additional parameters added to the generated client constructor.")
|
|
327
341
|
});
|
|
328
342
|
var unsupportedFieldSchema = z.strictObject({
|
|
329
|
-
source: z.enum(["fern", "postman", "sdk-config-ir"]),
|
|
330
|
-
path: z.array(z.union([nonEmptyStringSchema, z.number().int().nonnegative()])).min(1),
|
|
331
|
-
code: nonEmptyStringSchema.optional(),
|
|
332
|
-
reason: nonEmptyStringSchema
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
343
|
+
source: z.enum(["fern", "postman", "sdk-config-ir"]).describe("The configuration surface containing the unsupported field."),
|
|
344
|
+
path: z.array(z.union([nonEmptyStringSchema, z.number().int().nonnegative()])).min(1).describe("The property path to the unsupported field in its source configuration."),
|
|
345
|
+
code: nonEmptyStringSchema.optional().describe("A stable diagnostic code for the unsupported field."),
|
|
346
|
+
reason: nonEmptyStringSchema.describe(
|
|
347
|
+
"Why the field could not be represented in normalized configuration."
|
|
348
|
+
),
|
|
349
|
+
severity: z.enum(["error", "warning", "info"]).describe("The diagnostic severity."),
|
|
350
|
+
risk: z.enum(["high", "medium", "low"]).describe("The migration risk of omitting this field."),
|
|
351
|
+
owner: nonEmptyStringSchema.describe("The component or team responsible for resolving the gap."),
|
|
352
|
+
suggestedAction: nonEmptyStringSchema.describe(
|
|
353
|
+
"Recommended action for preserving the intended behavior."
|
|
354
|
+
)
|
|
337
355
|
});
|
|
338
356
|
var postmanLegacyInputSchema = z.strictObject({
|
|
339
|
-
kind: z.literal("postman-build-parameters"),
|
|
340
|
-
value: jsonObjectSchema
|
|
357
|
+
kind: z.literal("postman-build-parameters").describe("Identifies legacy Postman build parameters."),
|
|
358
|
+
value: jsonObjectSchema.describe("A debugging copy of the original Postman build parameters.")
|
|
341
359
|
});
|
|
342
360
|
var fernLegacyInputSchema = z.strictObject({
|
|
343
|
-
kind: z.literal("fern-generator-invocation"),
|
|
344
|
-
value: jsonObjectSchema
|
|
361
|
+
kind: z.literal("fern-generator-invocation").describe("Identifies a legacy Fern generator invocation."),
|
|
362
|
+
value: jsonObjectSchema.describe("A debugging copy of the original Fern generator invocation.")
|
|
345
363
|
});
|
|
346
364
|
var legacyInputSchema = z.discriminatedUnion("kind", [
|
|
347
365
|
postmanLegacyInputSchema,
|
|
348
366
|
fernLegacyInputSchema
|
|
349
367
|
]);
|
|
350
368
|
var compatibilityConfigSchema = z.strictObject({
|
|
351
|
-
outputProfile: z.enum(["converged", "postman-legacy", "fern-legacy"]),
|
|
352
|
-
legacyInput: legacyInputSchema.optional(),
|
|
353
|
-
unsupportedFields: z.array(unsupportedFieldSchema).optional()
|
|
369
|
+
outputProfile: z.enum(["converged", "postman-legacy", "fern-legacy"]).describe("The output-default profile retained while legacy producers converge."),
|
|
370
|
+
legacyInput: legacyInputSchema.optional().describe("Original producer input retained only for migration debugging."),
|
|
371
|
+
unsupportedFields: z.array(unsupportedFieldSchema).optional().describe("Legacy fields that could not be represented in normalized configuration.")
|
|
354
372
|
});
|
|
355
373
|
var httpMethodSchema = z.enum([
|
|
356
374
|
"GET",
|
|
@@ -364,121 +382,122 @@ var httpMethodSchema = z.enum([
|
|
|
364
382
|
"CONNECT"
|
|
365
383
|
]);
|
|
366
384
|
var readmeEndpointSchema = z.strictObject({
|
|
367
|
-
method: httpMethodSchema,
|
|
368
|
-
path: nonEmptyStringSchema,
|
|
369
|
-
stream: z.boolean().optional()
|
|
385
|
+
method: httpMethodSchema.describe("The HTTP method of the documented endpoint."),
|
|
386
|
+
path: nonEmptyStringSchema.describe("The endpoint path used in generated examples."),
|
|
387
|
+
stream: z.boolean().optional().describe("Whether the example uses the streaming response API.")
|
|
370
388
|
});
|
|
371
389
|
var readmeCustomSectionSchema = z.strictObject({
|
|
372
|
-
title: nonEmptyStringSchema,
|
|
373
|
-
content: z.string()
|
|
390
|
+
title: nonEmptyStringSchema.describe("The heading displayed for this README section."),
|
|
391
|
+
content: z.string().describe("The Markdown content of this README section.")
|
|
374
392
|
});
|
|
375
393
|
var readmeConfigSchema = z.strictObject({
|
|
376
|
-
apiName: nonEmptyStringSchema.optional(),
|
|
377
|
-
introduction: z.string().optional(),
|
|
378
|
-
apiReferenceLink: nonEmptyStringSchema.optional(),
|
|
379
|
-
bannerLink: nonEmptyStringSchema.optional(),
|
|
380
|
-
disabledSections: z.array(nonEmptyStringSchema).optional(),
|
|
381
|
-
customSections: z.array(readmeCustomSectionSchema).optional(),
|
|
382
|
-
defaultEndpoint: readmeEndpointSchema.optional(),
|
|
383
|
-
features: z.record(z.string(), z.array(readmeEndpointSchema)).optional()
|
|
394
|
+
apiName: nonEmptyStringSchema.optional().describe("The API name displayed in the README."),
|
|
395
|
+
introduction: z.string().optional().describe("Custom introductory Markdown for the README."),
|
|
396
|
+
apiReferenceLink: nonEmptyStringSchema.optional().describe("The URL linked as the API reference."),
|
|
397
|
+
bannerLink: nonEmptyStringSchema.optional().describe("The destination URL for the README banner."),
|
|
398
|
+
disabledSections: z.array(nonEmptyStringSchema).optional().describe("Generated README sections to omit."),
|
|
399
|
+
customSections: z.array(readmeCustomSectionSchema).optional().describe("Additional sections inserted into the README."),
|
|
400
|
+
defaultEndpoint: readmeEndpointSchema.optional().describe("The endpoint used for the primary README example."),
|
|
401
|
+
features: z.record(z.string(), z.array(readmeEndpointSchema)).optional().describe("Named feature groups and the endpoints demonstrated by each group.")
|
|
384
402
|
});
|
|
385
403
|
var snippetsConfigSchema = z.strictObject({
|
|
386
|
-
enabled: z.boolean(),
|
|
387
|
-
format: z.enum(["md", "json"]).optional(),
|
|
388
|
-
outputPath: nonEmptyStringSchema.optional()
|
|
404
|
+
enabled: z.boolean().describe("Whether standalone usage snippets are generated."),
|
|
405
|
+
format: z.enum(["md", "json"]).optional().describe("The output format for generated snippets."),
|
|
406
|
+
outputPath: nonEmptyStringSchema.optional().describe("The output path for generated snippet files.")
|
|
389
407
|
});
|
|
390
408
|
var docsConfigSchema = z.strictObject({
|
|
391
|
-
readme: readmeConfigSchema.optional(),
|
|
392
|
-
snippets: snippetsConfigSchema.optional(),
|
|
393
|
-
referenceBaseUrl: nonEmptyStringSchema.optional(),
|
|
394
|
-
includeApiReference: z.boolean().optional()
|
|
409
|
+
readme: readmeConfigSchema.optional().describe("README content and example configuration."),
|
|
410
|
+
snippets: snippetsConfigSchema.optional().describe("Standalone usage snippet generation."),
|
|
411
|
+
referenceBaseUrl: nonEmptyStringSchema.optional().describe("The base URL used for links to generated API reference files."),
|
|
412
|
+
includeApiReference: z.boolean().optional().describe("Whether API reference documentation is included in the SDK output.")
|
|
395
413
|
});
|
|
396
414
|
var namingConfigSchema = z.strictObject({
|
|
397
|
-
clientName: nonEmptyStringSchema.optional(),
|
|
398
|
-
exportedClientName: nonEmptyStringSchema.optional(),
|
|
399
|
-
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
400
|
-
apiErrorName: nonEmptyStringSchema.optional(),
|
|
401
|
-
baseErrorName: nonEmptyStringSchema.optional(),
|
|
402
|
-
pagerName: nonEmptyStringSchema.optional(),
|
|
415
|
+
clientName: nonEmptyStringSchema.optional().describe("The generated client class name."),
|
|
416
|
+
exportedClientName: nonEmptyStringSchema.optional().describe("The client name exported from the generated package."),
|
|
417
|
+
environmentTypeName: nonEmptyStringSchema.optional().describe("The generated type name for API environments."),
|
|
418
|
+
apiErrorName: nonEmptyStringSchema.optional().describe("The generated API error class name."),
|
|
419
|
+
baseErrorName: nonEmptyStringSchema.optional().describe("The generated base error class name."),
|
|
420
|
+
pagerName: nonEmptyStringSchema.optional().describe("The generated pagination helper name."),
|
|
403
421
|
/** Apply Fern's initialism-aware casing rules when deriving generated identifiers. */
|
|
404
|
-
smartCasing: z.boolean().optional(),
|
|
422
|
+
smartCasing: z.boolean().optional().describe("Whether generated identifiers use initialism-aware casing."),
|
|
405
423
|
/** Preserve a word boundary after digits when Fern smart casing is enabled. */
|
|
406
|
-
smartCasingDigitWordBoundary: z.boolean().optional()
|
|
424
|
+
smartCasingDigitWordBoundary: z.boolean().optional().describe("Whether smart casing preserves a word boundary after digits.")
|
|
407
425
|
});
|
|
408
426
|
var cliGenerationConfigSchema = z.strictObject({
|
|
409
|
-
paginationParameters: z.array(nonEmptyStringSchema).optional(),
|
|
410
|
-
skills: z.boolean().optional()
|
|
427
|
+
paginationParameters: z.array(nonEmptyStringSchema).optional().describe("Request parameter names treated as pagination controls by the CLI."),
|
|
428
|
+
skills: z.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands.")
|
|
411
429
|
});
|
|
412
430
|
var csharpGenerationConfigSchema = z.strictObject({
|
|
413
|
-
useOptionalWrapper: z.boolean().optional(),
|
|
414
|
-
simplifyObjectDictionaries: z.boolean().optional(),
|
|
415
|
-
explicitNamespaces: z.boolean().optional(),
|
|
416
|
-
rootNamespaceForCoreClasses: z.boolean().optional(),
|
|
417
|
-
includeExceptionHandler: z.boolean().optional(),
|
|
418
|
-
experimentalExplicitNullableOptional: z.boolean().optional()
|
|
431
|
+
useOptionalWrapper: z.boolean().optional().describe("Whether optional values use an explicit Optional wrapper."),
|
|
432
|
+
simplifyObjectDictionaries: z.boolean().optional().describe("Whether object schemas with arbitrary values use simplified dictionary types."),
|
|
433
|
+
explicitNamespaces: z.boolean().optional().describe("Whether generated resource groups use explicit nested namespaces."),
|
|
434
|
+
rootNamespaceForCoreClasses: z.boolean().optional().describe("Whether shared client classes are emitted in the root namespace."),
|
|
435
|
+
includeExceptionHandler: z.boolean().optional().describe("Whether generated client operations use a configurable exception handler."),
|
|
436
|
+
experimentalExplicitNullableOptional: z.boolean().optional().describe(
|
|
437
|
+
"Whether optional nullable properties distinguish omitted values from explicit nulls."
|
|
438
|
+
)
|
|
419
439
|
});
|
|
420
440
|
var goGenerationConfigSchema = z.strictObject({
|
|
421
|
-
legacyComplexModels: z.boolean().optional(),
|
|
441
|
+
legacyComplexModels: z.boolean().optional().describe("Whether complex models use the legacy Go representation."),
|
|
422
442
|
/** Uppercase common initialisms in generated names (`UserID` rather than `UserId`). */
|
|
423
|
-
smartCasing: z.boolean().optional(),
|
|
443
|
+
smartCasing: z.boolean().optional().describe("Whether generated Go names capitalize common initialisms."),
|
|
424
444
|
/** Overrides the fern root-client constructor independently from the client type name. */
|
|
425
|
-
clientConstructorName: nonEmptyStringSchema.optional(),
|
|
426
|
-
unionVersion: z.enum(["v0", "v1"]).optional(),
|
|
427
|
-
includeLegacyClientOptions: z.boolean().optional()
|
|
445
|
+
clientConstructorName: nonEmptyStringSchema.optional().describe("The generated root-client constructor name."),
|
|
446
|
+
unionVersion: z.enum(["v0", "v1"]).optional().describe("The representation used for generated Go unions."),
|
|
447
|
+
includeLegacyClientOptions: z.boolean().optional().describe("Whether the client retains legacy constructor option helpers.")
|
|
428
448
|
});
|
|
429
449
|
var jvmGenerationConfigSchema = z.strictObject({
|
|
430
|
-
packageLayout: z.enum(["flat", "nested"]).optional(),
|
|
431
|
-
useLocalDateForDates: z.boolean().optional(),
|
|
432
|
-
collapseOptionalNullable: z.boolean().optional(),
|
|
433
|
-
gradleDistributionUrl: z.string().min(1).optional(),
|
|
434
|
-
gradlePluginManagement: z.string().optional(),
|
|
435
|
-
gradleCentralDependencyManagement: z.boolean().optional(),
|
|
450
|
+
packageLayout: z.enum(["flat", "nested"]).optional().describe("Whether generated JVM packages use a flat or nested resource layout."),
|
|
451
|
+
useLocalDateForDates: z.boolean().optional().describe("Whether date-only values use LocalDate instead of OffsetDateTime."),
|
|
452
|
+
collapseOptionalNullable: z.boolean().optional().describe("Whether optional nullable values collapse into a single nullable representation."),
|
|
453
|
+
gradleDistributionUrl: z.string().min(1).optional().describe("The Gradle distribution URL written to the generated wrapper."),
|
|
454
|
+
gradlePluginManagement: z.string().optional().describe("Plugin management configuration added to the generated Gradle settings."),
|
|
455
|
+
gradleCentralDependencyManagement: z.boolean().optional().describe("Whether dependency versions are managed centrally in the Gradle project."),
|
|
436
456
|
/** Selects co-located async methods or a separate async client surface. */
|
|
437
|
-
asyncStyle: z.enum(["dedicated-client", "twin-methods"]).optional()
|
|
457
|
+
asyncStyle: z.enum(["dedicated-client", "twin-methods"]).optional().describe("Whether asynchronous operations use a separate client or co-located methods.")
|
|
438
458
|
});
|
|
439
459
|
|
|
440
460
|
// src/sdk-config-domain/v1/language/java.ts
|
|
441
461
|
var javaGenerationConfigSchema = jvmGenerationConfigSchema.extend({
|
|
442
|
-
includeKotlinSnippets: z.boolean().optional()
|
|
462
|
+
includeKotlinSnippets: z.boolean().optional().describe("Whether Java SDK documentation includes Kotlin usage snippets.")
|
|
443
463
|
});
|
|
444
464
|
|
|
445
465
|
// src/sdk-config-domain/v1/language/kotlin.ts
|
|
446
466
|
var kotlinGenerationConfigSchema = jvmGenerationConfigSchema;
|
|
447
467
|
var compilerOptionsSchema = z.strictObject({
|
|
448
|
-
target: nonEmptyStringSchema.optional(),
|
|
449
|
-
module: nonEmptyStringSchema.optional(),
|
|
450
|
-
lib: z.array(nonEmptyStringSchema).optional()
|
|
468
|
+
target: nonEmptyStringSchema.optional().describe("The JavaScript language target passed to TypeScript."),
|
|
469
|
+
module: nonEmptyStringSchema.optional().describe("The module format passed to TypeScript."),
|
|
470
|
+
lib: z.array(nonEmptyStringSchema).optional().describe("The runtime library definitions passed to TypeScript.")
|
|
451
471
|
});
|
|
452
472
|
var packageScriptSchema = z.strictObject({
|
|
453
|
-
name: nonEmptyStringSchema,
|
|
454
|
-
command: nonEmptyStringSchema
|
|
473
|
+
name: nonEmptyStringSchema.describe("The package script name."),
|
|
474
|
+
command: nonEmptyStringSchema.describe("The command executed by the package script.")
|
|
455
475
|
});
|
|
456
476
|
var httpClientSchema = z.strictObject({
|
|
457
|
-
name: z.enum(["axios", "fetch"])
|
|
477
|
+
name: z.enum(["axios", "fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
458
478
|
});
|
|
459
479
|
var typescriptGenerationConfigSchema = z.strictObject({
|
|
460
|
-
typescriptVersion: nonEmptyStringSchema.optional(),
|
|
461
|
-
zodVersion: nonEmptyStringSchema.optional(),
|
|
462
|
-
compilerOptions: compilerOptionsSchema.optional(),
|
|
463
|
-
httpClient: httpClientSchema.optional(),
|
|
464
|
-
packageManager: z.enum(["pnpm", "yarn"]).optional(),
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
exportClassDefault: z.boolean().optional(),
|
|
480
|
+
typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
|
|
481
|
+
zodVersion: nonEmptyStringSchema.optional().describe("The Zod version used by generated runtime schemas."),
|
|
482
|
+
compilerOptions: compilerOptionsSchema.optional().describe("TypeScript compiler options for the generated project."),
|
|
483
|
+
httpClient: httpClientSchema.optional().describe("The HTTP client used by generated TypeScript code."),
|
|
484
|
+
packageManager: z.enum(["pnpm", "yarn"]).optional().describe("The package manager used by the generated project."),
|
|
485
|
+
packageManagerVersion: nonEmptyStringSchema.optional().describe("The package manager version used by the generated project."),
|
|
486
|
+
testFramework: z.enum(["jest", "vitest"]).optional().describe("The test framework used by generated tests."),
|
|
487
|
+
namingStrategy: z.enum(["base", "originalPropertyNames"]).optional().describe("How schema property names are converted into TypeScript identifiers."),
|
|
488
|
+
bundle: z.boolean().optional().describe("Whether the generated package includes bundled output."),
|
|
489
|
+
exportClassDefault: z.boolean().optional().describe("Whether the client class is also exported as the default export."),
|
|
471
490
|
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
472
|
-
namespaceExportName: nonEmptyStringSchema.optional(),
|
|
473
|
-
consolidateTypeFiles: z.boolean().optional(),
|
|
474
|
-
allowCustomFetcher: z.boolean().optional(),
|
|
475
|
-
useBrandedStringAliases: z.boolean().optional(),
|
|
476
|
-
useLegacyExports: z.boolean().optional(),
|
|
477
|
-
useBigInt: z.boolean().optional(),
|
|
478
|
-
serdeLayer: z.boolean().optional(),
|
|
491
|
+
namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
|
|
492
|
+
consolidateTypeFiles: z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
|
|
493
|
+
allowCustomFetcher: z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
|
|
494
|
+
useBrandedStringAliases: z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
|
|
495
|
+
useLegacyExports: z.boolean().optional().describe("Whether the package emits the legacy export layout."),
|
|
496
|
+
useBigInt: z.boolean().optional().describe("Whether 64-bit integer values are represented with bigint."),
|
|
497
|
+
serdeLayer: z.boolean().optional().describe("Whether generated models use Fern serialization and deserialization helpers."),
|
|
479
498
|
/** Ship only the ESM build (drops CJS) to avoid the Node dual-package hazard. */
|
|
480
|
-
esmOnly: z.boolean().optional(),
|
|
481
|
-
scripts: z.array(packageScriptSchema).optional()
|
|
499
|
+
esmOnly: z.boolean().optional().describe("Whether the package emits only ECMAScript modules."),
|
|
500
|
+
scripts: z.array(packageScriptSchema).optional().describe("Additional scripts added to the generated package manifest.")
|
|
482
501
|
});
|
|
483
502
|
|
|
484
503
|
// src/sdk-config-domain/v1/language/mcp.ts
|
|
@@ -493,75 +512,75 @@ var mcpAvailabilityStatuses = [
|
|
|
493
512
|
"LEGACY"
|
|
494
513
|
];
|
|
495
514
|
var mcpToolFilterSchema = z.strictObject({
|
|
496
|
-
include: z.array(nonEmptyStringSchema).optional(),
|
|
497
|
-
exclude: z.array(nonEmptyStringSchema).optional()
|
|
515
|
+
include: z.array(nonEmptyStringSchema).optional().describe("Operations explicitly included as MCP tools."),
|
|
516
|
+
exclude: z.array(nonEmptyStringSchema).optional().describe("Operations explicitly excluded from MCP tools.")
|
|
498
517
|
});
|
|
499
518
|
var mcpToolsetNameSchema = nonEmptyStringSchema.refine(
|
|
500
519
|
(name) => name !== "default" && /^[a-z0-9-]+$/.test(name),
|
|
501
520
|
'toolset names must match [a-z0-9-]+ and cannot be "default"'
|
|
502
521
|
);
|
|
503
522
|
var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
|
|
504
|
-
serverName: nonEmptyStringSchema.optional(),
|
|
505
|
-
serverDescription: nonEmptyStringSchema.optional(),
|
|
506
|
-
excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional(),
|
|
507
|
-
tools: mcpToolFilterSchema.optional(),
|
|
508
|
-
toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional()
|
|
523
|
+
serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
|
|
524
|
+
serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
|
|
525
|
+
excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
|
|
526
|
+
tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
|
|
527
|
+
toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset.")
|
|
509
528
|
});
|
|
510
529
|
var phpGenerationConfigSchema = z.strictObject({
|
|
511
|
-
propertyAccess: z.enum(["public", "private"]).optional(),
|
|
512
|
-
generateClientInterfaces: z.boolean().optional()
|
|
530
|
+
propertyAccess: z.enum(["public", "private"]).optional().describe("The visibility of generated PHP model properties."),
|
|
531
|
+
generateClientInterfaces: z.boolean().optional().describe("Whether interfaces are generated for PHP client classes.")
|
|
513
532
|
});
|
|
514
533
|
var pythonClientSchema = z.strictObject({
|
|
515
|
-
fileName: nonEmptyStringSchema.optional(),
|
|
516
|
-
exportedFileName: nonEmptyStringSchema.optional()
|
|
534
|
+
fileName: nonEmptyStringSchema.optional().describe("The source file name for the Python client."),
|
|
535
|
+
exportedFileName: nonEmptyStringSchema.optional().describe("The file name used when exporting the Python client.")
|
|
517
536
|
});
|
|
518
537
|
var pydanticConfigSchema = z.strictObject({
|
|
519
|
-
versionCompatibility: z.enum(["v1", "v2", "both", "v1-on-v2"]).optional(),
|
|
520
|
-
frozen: z.boolean().optional(),
|
|
521
|
-
requireOptionalFields: z.boolean().optional(),
|
|
522
|
-
unionNaming: z.enum(["v0", "v1"]).optional(),
|
|
523
|
-
useFieldAliases: z.boolean().optional()
|
|
538
|
+
versionCompatibility: z.enum(["v1", "v2", "both", "v1-on-v2"]).optional().describe("The Pydantic major versions supported by generated models."),
|
|
539
|
+
frozen: z.boolean().optional().describe("Whether generated Pydantic models are immutable."),
|
|
540
|
+
requireOptionalFields: z.boolean().optional().describe("Whether Optional fields remain required unless they declare a default."),
|
|
541
|
+
unionNaming: z.enum(["v0", "v1"]).optional().describe("The naming strategy for generated union types."),
|
|
542
|
+
useFieldAliases: z.boolean().optional().describe("Whether Pydantic field aliases preserve wire names.")
|
|
524
543
|
});
|
|
525
544
|
var additionalInitExportSchema = z.strictObject({
|
|
526
|
-
from: nonEmptyStringSchema,
|
|
527
|
-
imports: z.array(nonEmptyStringSchema).min(1)
|
|
545
|
+
from: nonEmptyStringSchema.describe("The module from which names are re-exported."),
|
|
546
|
+
imports: z.array(nonEmptyStringSchema).min(1).describe("Names re-exported from the module.")
|
|
528
547
|
});
|
|
529
548
|
var pythonGenerationConfigSchema = z.strictObject({
|
|
530
|
-
pythonVersion: nonEmptyStringSchema.optional(),
|
|
531
|
-
pydanticVersion: nonEmptyStringSchema.optional(),
|
|
532
|
-
pydantic: pydanticConfigSchema.optional(),
|
|
533
|
-
client: pythonClientSchema.optional(),
|
|
549
|
+
pythonVersion: nonEmptyStringSchema.optional().describe("The Python version targeted by the generated project."),
|
|
550
|
+
pydanticVersion: nonEmptyStringSchema.optional().describe("The Pydantic dependency version requirement."),
|
|
551
|
+
pydantic: pydanticConfigSchema.optional().describe("Pydantic model-generation behavior."),
|
|
552
|
+
client: pythonClientSchema.optional().describe("Python client file naming."),
|
|
534
553
|
/** Default followed by generated sync and async HTTP clients when the caller does not override it. */
|
|
535
|
-
followRedirectsByDefault: z.boolean().optional(),
|
|
554
|
+
followRedirectsByDefault: z.boolean().optional().describe("Whether generated HTTP clients follow redirects by default."),
|
|
536
555
|
/** Chunk size passed to Python byte-stream iterators. */
|
|
537
|
-
defaultBytesStreamChunkSize: z.number().int().positive().optional(),
|
|
556
|
+
defaultBytesStreamChunkSize: z.number().int().positive().optional().describe("The default byte-stream iterator chunk size."),
|
|
538
557
|
/** Python interpreter recursion limit installed by the generated package at import time. */
|
|
539
|
-
recursionLimit: z.number().int().gt(1e3).optional(),
|
|
558
|
+
recursionLimit: z.number().int().gt(1e3).optional().describe("The Python recursion limit installed when the generated package is imported."),
|
|
540
559
|
/** Published Python extras, keyed by extra name with package dependency names as values. */
|
|
541
|
-
extras: z.record(nonEmptyStringSchema, z.array(nonEmptyStringSchema)).optional(),
|
|
542
|
-
alwaysInitializeOptionals: z.boolean().optional(),
|
|
543
|
-
useTypedDictRequests: z.boolean().optional(),
|
|
544
|
-
additionalInitExports: z.array(additionalInitExportSchema).optional()
|
|
560
|
+
extras: z.record(nonEmptyStringSchema, z.array(nonEmptyStringSchema)).optional().describe("Published Python extras and their dependency names."),
|
|
561
|
+
alwaysInitializeOptionals: z.boolean().optional().describe("Whether optional model fields are initialized even when omitted."),
|
|
562
|
+
useTypedDictRequests: z.boolean().optional().describe("Whether request bodies are generated as TypedDict types."),
|
|
563
|
+
additionalInitExports: z.array(additionalInitExportSchema).optional().describe("Additional names re-exported from the package initializer.")
|
|
545
564
|
});
|
|
546
565
|
var rubyGenerationConfigSchema = z.strictObject({
|
|
547
|
-
requirePaths: z.array(nonEmptyStringSchema).optional()
|
|
566
|
+
requirePaths: z.array(nonEmptyStringSchema).optional().describe("Ruby load paths included in the generated gem specification.")
|
|
548
567
|
});
|
|
549
568
|
var rustGenerationConfigSchema = z.strictObject({
|
|
550
569
|
/**
|
|
551
570
|
* Rust type for datetime primitives. `offset` maps to `DateTime<FixedOffset>` and preserves the
|
|
552
571
|
* timezone the payload carried; `utc` maps to `DateTime<Utc>` and normalizes to UTC.
|
|
553
572
|
*/
|
|
554
|
-
dateTimeType: z.enum(["offset", "utc"]).optional(),
|
|
573
|
+
dateTimeType: z.enum(["offset", "utc"]).optional().describe("Whether datetime values preserve their offset or normalize to UTC."),
|
|
555
574
|
/** Uppercase common initialisms in generated names (`UserID` rather than `UserId`). */
|
|
556
|
-
capitalizeInitialisms: z.boolean().optional(),
|
|
575
|
+
capitalizeInitialisms: z.boolean().optional().describe("Whether generated Rust names capitalize common initialisms."),
|
|
557
576
|
/** Cargo features, mapping a feature name to the dependencies or features it enables. */
|
|
558
|
-
features: z.record(z.string(), z.array(nonEmptyStringSchema)).optional(),
|
|
577
|
+
features: z.record(z.string(), z.array(nonEmptyStringSchema)).optional().describe("Cargo features and the dependencies or features each enables."),
|
|
559
578
|
/** Overrides which features make up Cargo's `default` feature set. */
|
|
560
|
-
defaultFeatures: z.array(nonEmptyStringSchema).optional()
|
|
579
|
+
defaultFeatures: z.array(nonEmptyStringSchema).optional().describe("Cargo features included in the crate default feature set.")
|
|
561
580
|
});
|
|
562
581
|
var swiftGenerationConfigSchema = z.strictObject({
|
|
563
|
-
moduleName: nonEmptyStringSchema.optional(),
|
|
564
|
-
nullableAsOptional: z.boolean().optional()
|
|
582
|
+
moduleName: nonEmptyStringSchema.optional().describe("The Swift module name for the generated package."),
|
|
583
|
+
nullableAsOptional: z.boolean().optional().describe("Whether nullable values are represented as Swift optionals.")
|
|
565
584
|
});
|
|
566
585
|
var goModulePathSchema = relativePathSchema.regex(
|
|
567
586
|
/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)*$/,
|
|
@@ -572,140 +591,166 @@ var composerPackageNameSchema = nonEmptyStringSchema.regex(
|
|
|
572
591
|
'Composer package name must be a lowercase "vendor/package" name'
|
|
573
592
|
);
|
|
574
593
|
var authorSchema = z.strictObject({
|
|
575
|
-
name: nonEmptyStringSchema,
|
|
576
|
-
email: z.email().optional(),
|
|
577
|
-
url: nonEmptyStringSchema.optional()
|
|
594
|
+
name: nonEmptyStringSchema.describe("The package author name."),
|
|
595
|
+
email: z.email().optional().describe("The package author email address."),
|
|
596
|
+
url: nonEmptyStringSchema.optional().describe("The package author website.")
|
|
578
597
|
});
|
|
579
598
|
var developerSchema = z.strictObject({
|
|
580
|
-
name: nonEmptyStringSchema,
|
|
581
|
-
email: z.email().optional(),
|
|
582
|
-
organization: nonEmptyStringSchema.optional(),
|
|
583
|
-
organizationUrl: nonEmptyStringSchema.optional()
|
|
599
|
+
name: nonEmptyStringSchema.describe("The package developer name."),
|
|
600
|
+
email: z.email().optional().describe("The package developer email address."),
|
|
601
|
+
organization: nonEmptyStringSchema.optional().describe("The developer organization name."),
|
|
602
|
+
organizationUrl: nonEmptyStringSchema.optional().describe("The developer organization website.")
|
|
584
603
|
});
|
|
585
604
|
var licenseSchema = z.strictObject({
|
|
586
|
-
type: nonEmptyStringSchema,
|
|
587
|
-
name: nonEmptyStringSchema.optional(),
|
|
588
|
-
url: nonEmptyStringSchema.optional(),
|
|
589
|
-
path: nonEmptyStringSchema.optional()
|
|
605
|
+
type: nonEmptyStringSchema.describe("The license identifier or license type."),
|
|
606
|
+
name: nonEmptyStringSchema.optional().describe("The human-readable license name."),
|
|
607
|
+
url: nonEmptyStringSchema.optional().describe("The URL containing the license text."),
|
|
608
|
+
path: nonEmptyStringSchema.optional().describe("The path to a custom license file.")
|
|
590
609
|
});
|
|
591
610
|
var dependencySourceSchema = z.discriminatedUnion("type", [
|
|
592
611
|
z.strictObject({
|
|
593
|
-
type: z.literal("registry"),
|
|
594
|
-
registry: nonEmptyStringSchema.optional()
|
|
612
|
+
type: z.literal("registry").describe("Resolves the dependency from a package registry."),
|
|
613
|
+
registry: nonEmptyStringSchema.optional().describe("The registry used to resolve the dependency.")
|
|
595
614
|
}),
|
|
596
615
|
z.strictObject({
|
|
597
|
-
type: z.literal("git"),
|
|
598
|
-
url: nonEmptyStringSchema,
|
|
599
|
-
ref: nonEmptyStringSchema.optional(),
|
|
600
|
-
subdirectory: nonEmptyStringSchema.optional()
|
|
616
|
+
type: z.literal("git").describe("Resolves the dependency from a Git repository."),
|
|
617
|
+
url: nonEmptyStringSchema.describe("The Git repository URL."),
|
|
618
|
+
ref: nonEmptyStringSchema.optional().describe("The Git branch, tag, or commit to use."),
|
|
619
|
+
subdirectory: nonEmptyStringSchema.optional().describe("The package subdirectory within the Git repository.")
|
|
601
620
|
}),
|
|
602
621
|
z.strictObject({
|
|
603
|
-
type: z.literal("path"),
|
|
604
|
-
path: nonEmptyStringSchema
|
|
622
|
+
type: z.literal("path").describe("Resolves the dependency from a local path."),
|
|
623
|
+
path: nonEmptyStringSchema.describe("The local path containing the dependency.")
|
|
605
624
|
})
|
|
606
625
|
]);
|
|
607
626
|
var dependencySchema = z.strictObject({
|
|
608
|
-
name: nonEmptyStringSchema,
|
|
609
|
-
version: nonEmptyStringSchema.optional(),
|
|
610
|
-
source: dependencySourceSchema.optional(),
|
|
611
|
-
packageName: nonEmptyStringSchema.optional(),
|
|
612
|
-
features: z.array(nonEmptyStringSchema).optional(),
|
|
613
|
-
extras: z.array(nonEmptyStringSchema).optional(),
|
|
614
|
-
optional: z.boolean().optional(),
|
|
615
|
-
defaultFeatures: z.boolean().optional(),
|
|
616
|
-
environmentMarker: nonEmptyStringSchema.optional()
|
|
627
|
+
name: nonEmptyStringSchema.describe("The dependency name used by the package manager."),
|
|
628
|
+
version: nonEmptyStringSchema.optional().describe("The dependency version requirement."),
|
|
629
|
+
source: dependencySourceSchema.optional().describe("A non-default source for the dependency."),
|
|
630
|
+
packageName: nonEmptyStringSchema.optional().describe("The source package name when it differs from the dependency alias."),
|
|
631
|
+
features: z.array(nonEmptyStringSchema).optional().describe("Cargo features enabled for this dependency."),
|
|
632
|
+
extras: z.array(nonEmptyStringSchema).optional().describe("Python extras enabled for this dependency."),
|
|
633
|
+
optional: z.boolean().optional().describe("Whether the dependency is optional."),
|
|
634
|
+
defaultFeatures: z.boolean().optional().describe("Whether the dependency enables its default Cargo features."),
|
|
635
|
+
environmentMarker: nonEmptyStringSchema.optional().describe("A Python environment marker that conditions this dependency.")
|
|
617
636
|
}).refine(({ source, version }) => source !== void 0 || version !== void 0, {
|
|
618
637
|
message: "dependency must define a version or a source"
|
|
619
638
|
});
|
|
620
639
|
var projectUrlSchema = z.strictObject({
|
|
621
|
-
label: nonEmptyStringSchema,
|
|
622
|
-
url: nonEmptyStringSchema
|
|
640
|
+
label: nonEmptyStringSchema.describe("The label displayed for the project link."),
|
|
641
|
+
url: nonEmptyStringSchema.describe("The project link URL.")
|
|
623
642
|
});
|
|
624
643
|
var packageConfigSchema = z.strictObject({
|
|
625
|
-
packageName: nonEmptyStringSchema.optional(),
|
|
626
|
-
moduleName: nonEmptyStringSchema.optional(),
|
|
627
|
-
modulePath: goModulePathSchema.optional(),
|
|
628
|
-
namespace: nonEmptyStringSchema.optional(),
|
|
629
|
-
groupId: nonEmptyStringSchema.optional(),
|
|
630
|
-
artifactId: nonEmptyStringSchema.optional(),
|
|
631
|
-
description: z.string().optional(),
|
|
632
|
-
repository: nonEmptyStringSchema.optional(),
|
|
633
|
-
homepage: nonEmptyStringSchema.optional(),
|
|
634
|
-
documentationUrl: nonEmptyStringSchema.optional(),
|
|
635
|
-
authors: z.array(authorSchema).optional(),
|
|
636
|
-
developers: z.array(developerSchema).optional(),
|
|
637
|
-
license: licenseSchema.optional(),
|
|
638
|
-
keywords: z.array(nonEmptyStringSchema).optional(),
|
|
639
|
-
classifiers: z.array(nonEmptyStringSchema).optional(),
|
|
640
|
-
projectUrls: z.array(projectUrlSchema).optional(),
|
|
641
|
-
extraDependencies: z.array(dependencySchema).optional(),
|
|
642
|
-
extraDevDependencies: z.array(dependencySchema).optional(),
|
|
643
|
-
extraPeerDependencies: z.array(dependencySchema).optional()
|
|
644
|
+
packageName: nonEmptyStringSchema.optional().describe("The package name used by the target language registry."),
|
|
645
|
+
moduleName: nonEmptyStringSchema.optional().describe("The generated module or import name when it differs from the package name."),
|
|
646
|
+
modulePath: goModulePathSchema.optional().describe("The Go module path used for imports and publishing."),
|
|
647
|
+
namespace: nonEmptyStringSchema.optional().describe("The namespace or package prefix for generated code."),
|
|
648
|
+
groupId: nonEmptyStringSchema.optional().describe("The Maven group identifier."),
|
|
649
|
+
artifactId: nonEmptyStringSchema.optional().describe("The Maven artifact identifier."),
|
|
650
|
+
description: z.string().optional().describe("The package description used in generated metadata."),
|
|
651
|
+
repository: nonEmptyStringSchema.optional().describe("The source repository for the generated SDK."),
|
|
652
|
+
homepage: nonEmptyStringSchema.optional().describe("The package homepage URL."),
|
|
653
|
+
documentationUrl: nonEmptyStringSchema.optional().describe("The package documentation URL."),
|
|
654
|
+
authors: z.array(authorSchema).optional().describe("Authors credited in package metadata."),
|
|
655
|
+
developers: z.array(developerSchema).optional().describe("Developers credited in package metadata."),
|
|
656
|
+
license: licenseSchema.optional().describe("License metadata for the generated package."),
|
|
657
|
+
keywords: z.array(nonEmptyStringSchema).optional().describe("Search keywords for package metadata."),
|
|
658
|
+
classifiers: z.array(nonEmptyStringSchema).optional().describe("Package classifiers used by registries such as PyPI."),
|
|
659
|
+
projectUrls: z.array(projectUrlSchema).optional().describe("Labeled project links for package metadata."),
|
|
660
|
+
extraDependencies: z.array(dependencySchema).optional().describe("Additional runtime dependencies added to the generated package."),
|
|
661
|
+
extraDevDependencies: z.array(dependencySchema).optional().describe("Additional development dependencies added to the generated package."),
|
|
662
|
+
extraPeerDependencies: z.array(dependencySchema).optional().describe("Additional peer dependencies added to the generated package.")
|
|
644
663
|
});
|
|
645
664
|
|
|
646
665
|
// src/sdk-config-domain/v1/language/terraform.ts
|
|
647
666
|
var planModifierSourceSchema = z.discriminatedUnion("enabled", [
|
|
648
|
-
z.strictObject({
|
|
649
|
-
|
|
667
|
+
z.strictObject({
|
|
668
|
+
enabled: z.literal(true).describe("Enables custom Terraform plan modifiers."),
|
|
669
|
+
sourceDir: nonEmptyStringSchema.describe(
|
|
670
|
+
"The directory containing custom plan modifier source files."
|
|
671
|
+
)
|
|
672
|
+
}),
|
|
673
|
+
z.strictObject({
|
|
674
|
+
enabled: z.literal(false).describe("Disables custom Terraform plan modifiers.")
|
|
675
|
+
})
|
|
650
676
|
]);
|
|
651
677
|
var planModifiersSchema = z.strictObject({
|
|
652
|
-
resources: planModifierSourceSchema,
|
|
653
|
-
attributes: planModifierSourceSchema
|
|
678
|
+
resources: planModifierSourceSchema.describe("Custom plan modifiers for generated resources."),
|
|
679
|
+
attributes: planModifierSourceSchema.describe("Custom plan modifiers for generated attributes.")
|
|
654
680
|
});
|
|
655
681
|
var providerSchemaSchema = z.strictObject({
|
|
656
|
-
addressKey: nonEmptyStringSchema
|
|
657
|
-
|
|
682
|
+
addressKey: nonEmptyStringSchema.describe(
|
|
683
|
+
"The provider attribute used to configure the API address."
|
|
684
|
+
),
|
|
685
|
+
authTokenKey: nonEmptyStringSchema.describe(
|
|
686
|
+
"The provider attribute used to configure the authentication token."
|
|
687
|
+
)
|
|
658
688
|
});
|
|
659
689
|
var terraformGenerationConfigSchema = z.strictObject({
|
|
660
|
-
providerName: nonEmptyStringSchema.optional(),
|
|
661
|
-
providerVersion: nonEmptyStringSchema.optional(),
|
|
662
|
-
providerModulePath: goModulePathSchema.optional(),
|
|
663
|
-
mockAcceptance: z.boolean().optional(),
|
|
664
|
-
hideComputedDiff: z.boolean().optional(),
|
|
665
|
-
providerSchema: providerSchemaSchema.optional(),
|
|
666
|
-
planModifiers: planModifiersSchema.optional()
|
|
690
|
+
providerName: nonEmptyStringSchema.optional().describe("The Terraform provider name."),
|
|
691
|
+
providerVersion: nonEmptyStringSchema.optional().describe("The generated Terraform provider version."),
|
|
692
|
+
providerModulePath: goModulePathSchema.optional().describe("The Go module path for the generated provider."),
|
|
693
|
+
mockAcceptance: z.boolean().optional().describe("Whether acceptance tests use a mock API server."),
|
|
694
|
+
hideComputedDiff: z.boolean().optional().describe("Whether computed-only changes are hidden from Terraform plans."),
|
|
695
|
+
providerSchema: providerSchemaSchema.optional().describe("Names of provider-level configuration attributes."),
|
|
696
|
+
planModifiers: planModifiersSchema.optional().describe("Custom plan modifier source configuration.")
|
|
667
697
|
});
|
|
668
698
|
|
|
669
699
|
// src/sdk-config-ir/v1/generation.ts
|
|
670
700
|
var generationAssetSchema = z.discriminatedUnion("type", [
|
|
671
|
-
z.strictObject({
|
|
672
|
-
|
|
673
|
-
|
|
701
|
+
z.strictObject({
|
|
702
|
+
type: z.literal("path").describe("Loads the generation asset from a relative path."),
|
|
703
|
+
location: relativePathSchema.describe("The relative path to the generation asset.")
|
|
704
|
+
}),
|
|
705
|
+
z.strictObject({
|
|
706
|
+
type: z.literal("url").describe("Loads the generation asset from a URL."),
|
|
707
|
+
location: nonEmptyStringSchema.describe("The URL of the generation asset.")
|
|
708
|
+
}),
|
|
709
|
+
z.strictObject({
|
|
710
|
+
type: z.literal("artifact").describe("Loads the generation asset from stored build output."),
|
|
711
|
+
location: nonEmptyStringSchema.describe("The artifact identifier or location.")
|
|
712
|
+
})
|
|
674
713
|
]);
|
|
675
714
|
var hookDependencySchema = z.strictObject({
|
|
676
|
-
name: nonEmptyStringSchema,
|
|
677
|
-
version: nonEmptyStringSchema,
|
|
678
|
-
groupId: nonEmptyStringSchema.optional()
|
|
715
|
+
name: nonEmptyStringSchema.describe("The hook dependency name."),
|
|
716
|
+
version: nonEmptyStringSchema.describe("The hook dependency version requirement."),
|
|
717
|
+
groupId: nonEmptyStringSchema.optional().describe("The Maven group identifier for the dependency.")
|
|
679
718
|
});
|
|
680
719
|
var hooksConfigSchema = z.strictObject({
|
|
681
|
-
enabled: z.boolean(),
|
|
682
|
-
source: generationAssetSchema.optional(),
|
|
683
|
-
dependencies: z.array(hookDependencySchema).optional()
|
|
720
|
+
enabled: z.boolean().describe("Whether custom request and response hooks are generated."),
|
|
721
|
+
source: generationAssetSchema.optional().describe("The source containing custom hook implementations."),
|
|
722
|
+
dependencies: z.array(hookDependencySchema).optional().describe("Dependencies required by custom hooks.")
|
|
684
723
|
});
|
|
685
724
|
var customCodeConfigSchema = z.strictObject({
|
|
686
|
-
enabled: z.boolean(),
|
|
687
|
-
source: generationAssetSchema.optional(),
|
|
688
|
-
conflictStrategy: z.enum(["mark", "ours", "theirs"]).optional(),
|
|
689
|
-
trackChanges: z.boolean().optional(),
|
|
690
|
-
previousBuildId: z.number().int().positive().optional(),
|
|
691
|
-
protectedFiles: z.array(nonEmptyStringSchema).optional()
|
|
725
|
+
enabled: z.boolean().describe("Whether customer-authored code is merged into generated output."),
|
|
726
|
+
source: generationAssetSchema.optional().describe("The source containing customer-authored code."),
|
|
727
|
+
conflictStrategy: z.enum(["mark", "ours", "theirs"]).optional().describe("How merge conflicts between generated and custom code are handled."),
|
|
728
|
+
trackChanges: z.boolean().optional().describe("Whether custom-code changes are tracked between builds."),
|
|
729
|
+
previousBuildId: z.number().int().positive().optional().describe("The previous build used as the merge baseline."),
|
|
730
|
+
protectedFiles: z.array(nonEmptyStringSchema).optional().describe("Generated file paths that custom-code merging must not overwrite.")
|
|
692
731
|
});
|
|
693
732
|
var workflowConfigSchema = z.strictObject({
|
|
694
|
-
path: relativePathSchema,
|
|
695
|
-
outputName: nonEmptyStringSchema.optional()
|
|
733
|
+
path: relativePathSchema.describe("The relative path to the workflow definition."),
|
|
734
|
+
outputName: nonEmptyStringSchema.optional().describe("The file name used for the generated workflow.")
|
|
696
735
|
});
|
|
697
736
|
var analyticsHeaderSchema = z.union([
|
|
698
|
-
z.strictObject({
|
|
699
|
-
|
|
737
|
+
z.strictObject({
|
|
738
|
+
name: nonEmptyStringSchema.describe("The exported telemetry header name."),
|
|
739
|
+
value: z.string().describe("The literal telemetry header value.")
|
|
740
|
+
}),
|
|
741
|
+
z.strictObject({
|
|
742
|
+
name: nonEmptyStringSchema.describe("The exported telemetry header name."),
|
|
743
|
+
valueRef: nonEmptyStringSchema.describe("A reference to the telemetry header value.")
|
|
744
|
+
})
|
|
700
745
|
]);
|
|
701
746
|
var analyticsConfigSchema = z.strictObject({
|
|
702
|
-
enabled: z.boolean(),
|
|
703
|
-
endpoint: nonEmptyStringSchema.optional(),
|
|
704
|
-
exporter: z.enum(["otlp-http", "console"]).optional(),
|
|
705
|
-
headers: z.array(analyticsHeaderSchema).optional(),
|
|
706
|
-
batchSize: z.number().int().positive().optional(),
|
|
707
|
-
scheduledDelayMs: z.number().nonnegative().optional(),
|
|
708
|
-
exportTimeoutMs: z.number().nonnegative().optional()
|
|
747
|
+
enabled: z.boolean().describe("Whether generated clients export usage telemetry."),
|
|
748
|
+
endpoint: nonEmptyStringSchema.optional().describe("The telemetry export endpoint."),
|
|
749
|
+
exporter: z.enum(["otlp-http", "console"]).optional().describe("The telemetry exporter implementation."),
|
|
750
|
+
headers: z.array(analyticsHeaderSchema).optional().describe("Headers sent by the telemetry exporter."),
|
|
751
|
+
batchSize: z.number().int().positive().optional().describe("The maximum spans in each export batch."),
|
|
752
|
+
scheduledDelayMs: z.number().nonnegative().optional().describe("The delay between scheduled exports, in milliseconds."),
|
|
753
|
+
exportTimeoutMs: z.number().nonnegative().optional().describe("The maximum time allowed for an export, in milliseconds.")
|
|
709
754
|
}).superRefine(({ enabled, endpoint }, context) => {
|
|
710
755
|
if (enabled && endpoint === void 0) {
|
|
711
756
|
context.addIssue({
|
|
@@ -716,91 +761,93 @@ var analyticsConfigSchema = z.strictObject({
|
|
|
716
761
|
}
|
|
717
762
|
});
|
|
718
763
|
var wireTestsSchema = z.strictObject({
|
|
719
|
-
enabled: z.boolean(),
|
|
720
|
-
exclusions: z.array(nonEmptyStringSchema).optional(),
|
|
721
|
-
fallbackToGeneratedErrorExamples: z.boolean().optional(),
|
|
722
|
-
fixtureSource: z.enum(["synthetic", "recorded", "auto"]).optional()
|
|
764
|
+
enabled: z.boolean().describe("Whether wire-level request and response tests are generated."),
|
|
765
|
+
exclusions: z.array(nonEmptyStringSchema).optional().describe("Operations excluded from wire tests."),
|
|
766
|
+
fallbackToGeneratedErrorExamples: z.boolean().optional().describe("Whether missing error fixtures are synthesized from generated examples."),
|
|
767
|
+
fixtureSource: z.enum(["synthetic", "recorded", "auto"]).optional().describe("Where wire-test fixtures are obtained.")
|
|
723
768
|
});
|
|
724
769
|
var unitTestsSchema = z.strictObject({
|
|
725
|
-
enabled: z.boolean(),
|
|
726
|
-
mode: z.enum(["core-runtime", "schema-driven", "both"]).optional(),
|
|
727
|
-
exclusions: z.array(nonEmptyStringSchema).optional()
|
|
770
|
+
enabled: z.boolean().describe("Whether SDK unit tests are generated."),
|
|
771
|
+
mode: z.enum(["core-runtime", "schema-driven", "both"]).optional().describe("The unit-test generation strategy."),
|
|
772
|
+
exclusions: z.array(nonEmptyStringSchema).optional().describe("Operations excluded from unit tests.")
|
|
728
773
|
});
|
|
729
774
|
var fernDefinitionMetadataSchema = z.strictObject({
|
|
730
|
-
definitionS3DownloadUrl: nonEmptyStringSchema
|
|
731
|
-
|
|
732
|
-
|
|
775
|
+
definitionS3DownloadUrl: nonEmptyStringSchema.describe(
|
|
776
|
+
"The download URL for the materialized Fern definition archive."
|
|
777
|
+
),
|
|
778
|
+
outputPath: nonEmptyStringSchema.optional().describe("The destination path for Fern definition support files."),
|
|
779
|
+
cliVersion: nonEmptyStringSchema.optional().describe("The Fern CLI version associated with the definition.")
|
|
733
780
|
});
|
|
734
781
|
var streamsSchema = z.strictObject({
|
|
735
|
-
enabled: z.boolean(),
|
|
736
|
-
responseType: z.enum(["wrapper", "native", "web"]).optional(),
|
|
737
|
-
fileResponseType: z.enum(["stream", "binary-response"]).optional(),
|
|
738
|
-
defaultChunkSizeBytes: z.number().int().positive().optional()
|
|
782
|
+
enabled: z.boolean().describe("Whether generated clients expose streaming response APIs."),
|
|
783
|
+
responseType: z.enum(["wrapper", "native", "web"]).optional().describe("The streaming response abstraction exposed by generated clients."),
|
|
784
|
+
fileResponseType: z.enum(["stream", "binary-response"]).optional().describe("The response type used for file downloads."),
|
|
785
|
+
defaultChunkSizeBytes: z.number().int().positive().optional().describe("The default number of bytes yielded by streaming iterators.")
|
|
739
786
|
});
|
|
740
787
|
var layoutConfigSchema = z.strictObject({
|
|
741
|
-
outputDirectory: z.enum(["project-root", "source-root"]).optional(),
|
|
742
|
-
packagePath: nonEmptyStringSchema.optional()
|
|
788
|
+
outputDirectory: z.enum(["project-root", "source-root"]).optional().describe("Whether generated source is rooted at the project or its source directory."),
|
|
789
|
+
packagePath: nonEmptyStringSchema.optional().describe("The package-relative path for generated source files.")
|
|
743
790
|
});
|
|
744
791
|
var serializationConfigSchema = z.strictObject({
|
|
745
|
-
enumRepresentation: z.enum(["enum", "union", "literal", "forward-compatible-enum", "language-default"]).optional(),
|
|
746
|
-
additionalProperties: z.enum(["allow", "forbid", "ignore", "language-default"]).optional(),
|
|
747
|
-
inlineTypes: z.boolean().optional(),
|
|
748
|
-
omitUndefined: z.boolean().optional()
|
|
792
|
+
enumRepresentation: z.enum(["enum", "union", "literal", "forward-compatible-enum", "language-default"]).optional().describe("How schema enums are represented in generated code."),
|
|
793
|
+
additionalProperties: z.enum(["allow", "forbid", "ignore", "language-default"]).optional().describe("How undeclared object properties are handled."),
|
|
794
|
+
inlineTypes: z.boolean().optional().describe("Whether inline schemas remain nested under their parent types."),
|
|
795
|
+
omitUndefined: z.boolean().optional().describe("Whether undefined properties are omitted during serialization.")
|
|
749
796
|
});
|
|
750
797
|
var languageGenerationConfigSchema = z.strictObject({
|
|
751
|
-
typescript: typescriptGenerationConfigSchema.optional(),
|
|
752
|
-
python: pythonGenerationConfigSchema.optional(),
|
|
753
|
-
java: javaGenerationConfigSchema.optional(),
|
|
754
|
-
kotlin: kotlinGenerationConfigSchema.optional(),
|
|
755
|
-
go: goGenerationConfigSchema.optional(),
|
|
756
|
-
csharp: csharpGenerationConfigSchema.optional(),
|
|
757
|
-
php: phpGenerationConfigSchema.optional(),
|
|
758
|
-
ruby: rubyGenerationConfigSchema.optional(),
|
|
759
|
-
rust: rustGenerationConfigSchema.optional(),
|
|
760
|
-
cli: cliGenerationConfigSchema.optional(),
|
|
761
|
-
mcp: mcpGenerationConfigSchema.optional(),
|
|
762
|
-
swift: swiftGenerationConfigSchema.optional(),
|
|
763
|
-
terraform: terraformGenerationConfigSchema.optional()
|
|
798
|
+
typescript: typescriptGenerationConfigSchema.optional().describe("TypeScript-specific generation settings."),
|
|
799
|
+
python: pythonGenerationConfigSchema.optional().describe("Python-specific generation settings."),
|
|
800
|
+
java: javaGenerationConfigSchema.optional().describe("Java-specific generation settings."),
|
|
801
|
+
kotlin: kotlinGenerationConfigSchema.optional().describe("Kotlin-specific generation settings."),
|
|
802
|
+
go: goGenerationConfigSchema.optional().describe("Go-specific generation settings."),
|
|
803
|
+
csharp: csharpGenerationConfigSchema.optional().describe("C#-specific generation settings."),
|
|
804
|
+
php: phpGenerationConfigSchema.optional().describe("PHP-specific generation settings."),
|
|
805
|
+
ruby: rubyGenerationConfigSchema.optional().describe("Ruby-specific generation settings."),
|
|
806
|
+
rust: rustGenerationConfigSchema.optional().describe("Rust-specific generation settings."),
|
|
807
|
+
cli: cliGenerationConfigSchema.optional().describe("CLI-specific generation settings."),
|
|
808
|
+
mcp: mcpGenerationConfigSchema.optional().describe("MCP-specific generation settings."),
|
|
809
|
+
swift: swiftGenerationConfigSchema.optional().describe("Swift-specific generation settings."),
|
|
810
|
+
terraform: terraformGenerationConfigSchema.optional().describe("Terraform-specific generation settings.")
|
|
764
811
|
});
|
|
765
812
|
var generationConfigSchema = z.strictObject({
|
|
766
|
-
includeWatermark: z.boolean().default(false),
|
|
813
|
+
includeWatermark: z.boolean().default(false).describe("Whether generated files include a generator watermark."),
|
|
767
814
|
/** Emits an AI service into the generated SDK. Python, Java and TypeScript honour it. */
|
|
768
|
-
ai: z.boolean().default(false),
|
|
769
|
-
includeOptionalSnippetParameters: z.boolean().optional(),
|
|
770
|
-
buildAllModels: z.boolean().default(false),
|
|
771
|
-
inferServiceNames: z.boolean().default(false),
|
|
772
|
-
includeDeprecatedOperations: z.boolean().default(true),
|
|
773
|
-
multipleResponses: z.boolean().default(false),
|
|
815
|
+
ai: z.boolean().default(false).describe("Whether the SDK includes generated AI service helpers."),
|
|
816
|
+
includeOptionalSnippetParameters: z.boolean().optional().describe("Whether usage snippets include optional request parameters."),
|
|
817
|
+
buildAllModels: z.boolean().default(false).describe("Whether models not referenced by operations are also generated."),
|
|
818
|
+
inferServiceNames: z.boolean().default(false).describe("Whether service names are inferred from API structure."),
|
|
819
|
+
includeDeprecatedOperations: z.boolean().default(true).describe("Whether deprecated API operations are generated."),
|
|
820
|
+
multipleResponses: z.boolean().default(false).describe("Whether operations model multiple successful response types."),
|
|
774
821
|
/** Generate the entire SDK project, including package manifests and publishable artifacts. */
|
|
775
|
-
generateFullProject: z.boolean().default(false),
|
|
776
|
-
devContainer: z.boolean().default(false),
|
|
777
|
-
allowMockClient: z.boolean().default(false),
|
|
778
|
-
ignoreFiles: z.array(nonEmptyStringSchema).optional(),
|
|
822
|
+
generateFullProject: z.boolean().default(false).describe("Whether generation emits a complete publishable project."),
|
|
823
|
+
devContainer: z.boolean().default(false).describe("Whether development-container configuration is generated."),
|
|
824
|
+
allowMockClient: z.boolean().default(false).describe("Whether a mock API client is included in the generated SDK."),
|
|
825
|
+
ignoreFiles: z.array(nonEmptyStringSchema).optional().describe("Generated paths excluded from the final output."),
|
|
779
826
|
/**
|
|
780
827
|
* Raw .fernignore file contents supplied to external publishers that need Fern ignore semantics.
|
|
781
828
|
* This is separate from generation.ignoreFiles because raw contents preserve comments, ordering,
|
|
782
829
|
* blank lines, and negation rules.
|
|
783
830
|
*/
|
|
784
|
-
fernignoreContents: z.string().optional(),
|
|
831
|
+
fernignoreContents: z.string().optional().describe("The raw .fernignore contents retained for external publishers."),
|
|
785
832
|
/**
|
|
786
833
|
* Optional Fern definition metadata for publisher paths that need to write definition or
|
|
787
834
|
* mock-server support files. This is not required for core GitHub artifact publishing.
|
|
788
835
|
*/
|
|
789
|
-
fernDefinitionMetadata: fernDefinitionMetadataSchema.optional(),
|
|
790
|
-
reservedKeywords: z.array(nonEmptyStringSchema).optional(),
|
|
791
|
-
hooks: hooksConfigSchema.optional(),
|
|
792
|
-
customCode: customCodeConfigSchema.optional(),
|
|
793
|
-
workflows: z.array(workflowConfigSchema).optional(),
|
|
794
|
-
customQueryPaths: z.array(relativePathSchema).optional(),
|
|
795
|
-
analytics: analyticsConfigSchema.optional(),
|
|
796
|
-
wireTests: wireTestsSchema.optional(),
|
|
797
|
-
unitTests: unitTestsSchema.optional(),
|
|
798
|
-
webSockets: z.boolean().optional(),
|
|
799
|
-
streams: streamsSchema.optional(),
|
|
800
|
-
naming: namingConfigSchema.optional(),
|
|
801
|
-
layout: layoutConfigSchema.optional(),
|
|
802
|
-
serialization: serializationConfigSchema.optional(),
|
|
803
|
-
language: languageGenerationConfigSchema.optional()
|
|
836
|
+
fernDefinitionMetadata: fernDefinitionMetadataSchema.optional().describe("Materialized Fern definition metadata used by external publishers."),
|
|
837
|
+
reservedKeywords: z.array(nonEmptyStringSchema).optional().describe("Additional identifiers treated as reserved words."),
|
|
838
|
+
hooks: hooksConfigSchema.optional().describe("Custom SDK request and response hook configuration."),
|
|
839
|
+
customCode: customCodeConfigSchema.optional().describe("Customer-authored code merge configuration."),
|
|
840
|
+
workflows: z.array(workflowConfigSchema).optional().describe("Workflow definitions included in generated output."),
|
|
841
|
+
customQueryPaths: z.array(relativePathSchema).optional().describe("Relative paths to custom query definitions."),
|
|
842
|
+
analytics: analyticsConfigSchema.optional().describe("Generated client telemetry configuration."),
|
|
843
|
+
wireTests: wireTestsSchema.optional().describe("Wire-level request and response test generation."),
|
|
844
|
+
unitTests: unitTestsSchema.optional().describe("SDK unit-test generation."),
|
|
845
|
+
webSockets: z.boolean().optional().describe("Whether WebSocket clients are generated for supported channels."),
|
|
846
|
+
streams: streamsSchema.optional().describe("Streaming response generation behavior."),
|
|
847
|
+
naming: namingConfigSchema.optional().describe("Names and casing used by generated code."),
|
|
848
|
+
layout: layoutConfigSchema.optional().describe("Generated project and source layout."),
|
|
849
|
+
serialization: serializationConfigSchema.optional().describe("Generated model serialization behavior."),
|
|
850
|
+
language: languageGenerationConfigSchema.optional().describe("Settings specific to the selected target language.")
|
|
804
851
|
});
|
|
805
852
|
var publishRegistrySchema = z.enum([
|
|
806
853
|
"npm",
|
|
@@ -818,154 +865,160 @@ var credentialResolutionSchema = z.enum([
|
|
|
818
865
|
"resolved-by-fiddle"
|
|
819
866
|
]);
|
|
820
867
|
var registryCredentialsSchema = z.strictObject({
|
|
821
|
-
username: nonEmptyStringSchema.optional(),
|
|
822
|
-
password: nonEmptyStringSchema.optional(),
|
|
823
|
-
token: nonEmptyStringSchema.optional(),
|
|
824
|
-
apiKey: nonEmptyStringSchema.optional()
|
|
868
|
+
username: nonEmptyStringSchema.optional().describe("The resolved credential username."),
|
|
869
|
+
password: nonEmptyStringSchema.optional().describe("The resolved credential password."),
|
|
870
|
+
token: nonEmptyStringSchema.optional().describe("The resolved credential token."),
|
|
871
|
+
apiKey: nonEmptyStringSchema.optional().describe("The resolved credential API key.")
|
|
825
872
|
});
|
|
826
873
|
var commonPublishShape = {
|
|
827
|
-
url: nonEmptyStringSchema.optional(),
|
|
874
|
+
url: nonEmptyStringSchema.optional().describe("A custom package registry URL."),
|
|
828
875
|
/** Reference to registry publishing credentials. */
|
|
829
|
-
credentialsRef: nonEmptyStringSchema.optional(),
|
|
876
|
+
credentialsRef: nonEmptyStringSchema.optional().describe("A reference to registry publishing credentials."),
|
|
830
877
|
/** Raw registry credentials. These values can be sensitive and must be handled as secrets. */
|
|
831
|
-
credentials: registryCredentialsSchema.optional(),
|
|
878
|
+
credentials: registryCredentialsSchema.optional().describe("Resolved registry publishing credentials."),
|
|
832
879
|
/**
|
|
833
880
|
* Registry-specific package version override. If omitted, the external publisher/orchestrator may
|
|
834
881
|
* fall back to target.sdkVersion.
|
|
835
882
|
*/
|
|
836
|
-
version: nonEmptyStringSchema.optional(),
|
|
837
|
-
releaseBranch: nonEmptyStringSchema.optional(),
|
|
838
|
-
tolerateRepublish: z.boolean().optional(),
|
|
883
|
+
version: nonEmptyStringSchema.optional().describe("A registry-specific package version override."),
|
|
884
|
+
releaseBranch: nonEmptyStringSchema.optional().describe("The branch used by generated package release workflows."),
|
|
885
|
+
tolerateRepublish: z.boolean().optional().describe("Whether publishing succeeds when this package version already exists."),
|
|
839
886
|
/** Generate registry publishing workflow files when publishing through GitHub delivery. */
|
|
840
|
-
shouldGeneratePublishWorkflow: z.boolean().optional()
|
|
887
|
+
shouldGeneratePublishWorkflow: z.boolean().optional().describe("Whether GitHub delivery includes a registry publishing workflow.")
|
|
841
888
|
};
|
|
842
889
|
var trustedPublishingShape = {
|
|
843
890
|
/** Use registry trusted publishing / OIDC instead of a static token secret. */
|
|
844
|
-
trustedPublishing: z.boolean().optional()
|
|
891
|
+
trustedPublishing: z.boolean().optional().describe("Whether registry publication uses trusted publishing or OIDC.")
|
|
845
892
|
};
|
|
846
893
|
var mavenCoordinateSchema = nonEmptyStringSchema.regex(
|
|
847
894
|
/^[A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+$/,
|
|
848
895
|
"Maven coordinate must be in groupId:artifactId form"
|
|
849
896
|
);
|
|
850
897
|
var mavenSignatureEnvironmentSchema = z.strictObject({
|
|
851
|
-
keyIdEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
852
|
-
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
853
|
-
secretKeyEnvironmentVariable: nonEmptyStringSchema.optional()
|
|
898
|
+
keyIdEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the signing key ID."),
|
|
899
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the signing key password."),
|
|
900
|
+
secretKeyEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the armored secret key.")
|
|
854
901
|
});
|
|
855
902
|
var mavenSignatureSchema = z.strictObject({
|
|
856
|
-
keyId: nonEmptyStringSchema,
|
|
857
|
-
password: nonEmptyStringSchema,
|
|
858
|
-
secretKey: nonEmptyStringSchema
|
|
903
|
+
keyId: nonEmptyStringSchema.describe("The resolved signing key identifier."),
|
|
904
|
+
password: nonEmptyStringSchema.describe("The resolved signing key password."),
|
|
905
|
+
secretKey: nonEmptyStringSchema.describe("The resolved armored secret key.")
|
|
859
906
|
});
|
|
860
907
|
var publishConfigSchema = z.discriminatedUnion("registry", [
|
|
861
908
|
z.strictObject({
|
|
862
|
-
registry: z.literal("npm"),
|
|
909
|
+
registry: z.literal("npm").describe("Publishes the package to an npm-compatible registry."),
|
|
863
910
|
/** Environment variable name containing the npm registry token. */
|
|
864
|
-
tokenEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
911
|
+
tokenEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the npm registry token."),
|
|
865
912
|
/** Write npm package metadata as private when the publisher creates/updates package.json. */
|
|
866
|
-
isPackagePrivate: z.boolean().optional(),
|
|
913
|
+
isPackagePrivate: z.boolean().optional().describe("Whether generated npm package metadata marks the package as private."),
|
|
867
914
|
/** Also publish the TypeScript package to JSR from the npm publishing path. */
|
|
868
|
-
publishToJsr: z.boolean().optional(),
|
|
915
|
+
publishToJsr: z.boolean().optional().describe("Whether the npm publishing flow also publishes the package to JSR."),
|
|
869
916
|
...trustedPublishingShape,
|
|
870
917
|
...commonPublishShape
|
|
871
918
|
}),
|
|
872
919
|
z.strictObject({
|
|
873
|
-
registry: z.literal("pypi"),
|
|
874
|
-
usernameEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
875
|
-
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
920
|
+
registry: z.literal("pypi").describe("Publishes the package to a PyPI-compatible registry."),
|
|
921
|
+
usernameEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the PyPI username."),
|
|
922
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the PyPI password or token."),
|
|
876
923
|
...trustedPublishingShape,
|
|
877
924
|
...commonPublishShape
|
|
878
925
|
}),
|
|
879
926
|
z.strictObject({
|
|
880
|
-
registry: z.literal("nuget"),
|
|
881
|
-
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
927
|
+
registry: z.literal("nuget").describe("Publishes the package to a NuGet-compatible registry."),
|
|
928
|
+
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the NuGet API key."),
|
|
882
929
|
...trustedPublishingShape,
|
|
883
930
|
...commonPublishShape
|
|
884
931
|
}),
|
|
885
932
|
z.strictObject({
|
|
886
|
-
registry: z.literal("rubygems"),
|
|
887
|
-
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
933
|
+
registry: z.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),
|
|
934
|
+
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the RubyGems API key."),
|
|
935
|
+
...commonPublishShape
|
|
936
|
+
}),
|
|
937
|
+
z.strictObject({
|
|
938
|
+
registry: z.literal("crates").describe("Publishes the crate to a Cargo-compatible registry."),
|
|
939
|
+
tokenEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the Cargo registry token."),
|
|
940
|
+
...commonPublishShape
|
|
941
|
+
}),
|
|
942
|
+
z.strictObject({
|
|
943
|
+
registry: z.literal("go").describe("Publishes the SDK as a Go module."),
|
|
888
944
|
...commonPublishShape
|
|
889
945
|
}),
|
|
890
946
|
z.strictObject({
|
|
891
|
-
registry: z.literal("
|
|
892
|
-
tokenEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
947
|
+
registry: z.literal("composer").describe("Publishes the package to a Composer-compatible registry."),
|
|
893
948
|
...commonPublishShape
|
|
894
949
|
}),
|
|
895
|
-
z.strictObject({ registry: z.literal("go"), ...commonPublishShape }),
|
|
896
|
-
z.strictObject({ registry: z.literal("composer"), ...commonPublishShape }),
|
|
897
950
|
z.strictObject({
|
|
898
|
-
registry: z.literal("maven"),
|
|
951
|
+
registry: z.literal("maven").describe("Publishes the package to a Maven-compatible repository."),
|
|
899
952
|
/** Maven coordinate in groupId:artifactId form when consumers need the combined value. */
|
|
900
|
-
coordinate: mavenCoordinateSchema.optional(),
|
|
901
|
-
usernameEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
902
|
-
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
903
|
-
mavenUrlEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
904
|
-
signatureEnvironmentVariables: mavenSignatureEnvironmentSchema.optional(),
|
|
953
|
+
coordinate: mavenCoordinateSchema.optional().describe("The Maven coordinate in groupId:artifactId form."),
|
|
954
|
+
usernameEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the Maven username."),
|
|
955
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the Maven password."),
|
|
956
|
+
mavenUrlEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the Maven repository URL."),
|
|
957
|
+
signatureEnvironmentVariables: mavenSignatureEnvironmentSchema.optional().describe("Environment variables containing Maven signing material."),
|
|
905
958
|
/** Reference to Maven signing credentials. */
|
|
906
|
-
signingCredentialsRef: nonEmptyStringSchema.optional(),
|
|
959
|
+
signingCredentialsRef: nonEmptyStringSchema.optional().describe("A reference to Maven signing credentials."),
|
|
907
960
|
/** Raw Maven signing material. These values can be sensitive and must be handled as secrets. */
|
|
908
|
-
signature: mavenSignatureSchema.optional(),
|
|
961
|
+
signature: mavenSignatureSchema.optional().describe("Resolved Maven signing material."),
|
|
909
962
|
...commonPublishShape
|
|
910
963
|
})
|
|
911
964
|
]);
|
|
912
965
|
var reviewersSchema = z.strictObject({
|
|
913
|
-
teams: z.array(nonEmptyStringSchema).optional(),
|
|
914
|
-
users: z.array(nonEmptyStringSchema).optional()
|
|
966
|
+
teams: z.array(nonEmptyStringSchema).optional().describe("GitHub teams requested as reviewers."),
|
|
967
|
+
users: z.array(nonEmptyStringSchema).optional().describe("GitHub users requested as reviewers.")
|
|
915
968
|
});
|
|
916
969
|
var replayControlSchema = z.strictObject({
|
|
917
|
-
enabled: z.boolean()
|
|
970
|
+
enabled: z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
|
|
918
971
|
});
|
|
919
972
|
var githubLicenseSchema = z.strictObject({
|
|
920
973
|
/** SPDX identifier or license key for the repository license (for example, "MIT"). */
|
|
921
|
-
type: nonEmptyStringSchema.optional(),
|
|
974
|
+
type: nonEmptyStringSchema.optional().describe("The SPDX identifier or license key for the repository license."),
|
|
922
975
|
/** Path to a custom license file to be committed into the GitHub repository. */
|
|
923
|
-
customPath: nonEmptyStringSchema.optional()
|
|
976
|
+
customPath: nonEmptyStringSchema.optional().describe("The path to a custom license file committed to the repository.")
|
|
924
977
|
}).refine((value) => value.type !== void 0 || value.customPath !== void 0, {
|
|
925
978
|
message: "GitHub license must set type or customPath"
|
|
926
979
|
});
|
|
927
980
|
var githubOutputSchema = z.strictObject({
|
|
928
|
-
repository: nonEmptyStringSchema,
|
|
929
|
-
host: nonEmptyStringSchema.optional(),
|
|
930
|
-
branch: nonEmptyStringSchema.optional(),
|
|
931
|
-
mode: z.enum(["release", "pull-request", "push", "commit", "commit-and-release"]).optional(),
|
|
932
|
-
reviewers: reviewersSchema.optional(),
|
|
981
|
+
repository: nonEmptyStringSchema.describe("The GitHub repository that receives generated files."),
|
|
982
|
+
host: nonEmptyStringSchema.optional().describe("The GitHub host for enterprise installations."),
|
|
983
|
+
branch: nonEmptyStringSchema.optional().describe("The target branch for generated changes."),
|
|
984
|
+
mode: z.enum(["release", "pull-request", "push", "commit", "commit-and-release"]).optional().describe("How generated changes are delivered to the repository."),
|
|
985
|
+
reviewers: reviewersSchema.optional().describe("Reviewers requested for generated pull requests."),
|
|
933
986
|
/** Reference to GitHub credentials. */
|
|
934
|
-
credentialsRef: nonEmptyStringSchema.optional(),
|
|
987
|
+
credentialsRef: nonEmptyStringSchema.optional().describe("A reference to GitHub credentials."),
|
|
935
988
|
/** Raw GitHub credentials. These values can be sensitive and must be handled as secrets. */
|
|
936
|
-
credentials: registryCredentialsSchema.optional(),
|
|
937
|
-
privateRepository: z.boolean().optional(),
|
|
989
|
+
credentials: registryCredentialsSchema.optional().describe("Resolved GitHub credentials."),
|
|
990
|
+
privateRepository: z.boolean().optional().describe("Whether the destination repository is private."),
|
|
938
991
|
/** GitHub license block scoped to repository delivery. */
|
|
939
|
-
license: githubLicenseSchema.optional(),
|
|
992
|
+
license: githubLicenseSchema.optional().describe("License configuration for the destination repository."),
|
|
940
993
|
/** GitHub replay control. If omitted, the external publisher applies its default behavior. */
|
|
941
|
-
replay: replayControlSchema.optional(),
|
|
994
|
+
replay: replayControlSchema.optional().describe("Replay behavior for the external GitHub publisher."),
|
|
942
995
|
/** Run GitHub publishing verification. Defaults to false to match current Fiddle job behavior. */
|
|
943
|
-
verify: z.boolean().default(false),
|
|
996
|
+
verify: z.boolean().default(false).describe("Whether the GitHub publisher verifies the generated result."),
|
|
944
997
|
/** Skip creating/updating a GitHub PR when no files changed. Defaults to false. */
|
|
945
|
-
skipIfNoDiff: z.boolean().default(false),
|
|
998
|
+
skipIfNoDiff: z.boolean().default(false).describe("Whether GitHub publication is skipped when no generated files changed."),
|
|
946
999
|
/** Automatically merge the GitHub publishing PR. Defaults to false. */
|
|
947
|
-
autoMerge: z.boolean().default(false)
|
|
1000
|
+
autoMerge: z.boolean().default(false).describe("Whether the GitHub publisher automatically merges its pull request.")
|
|
948
1001
|
});
|
|
949
1002
|
var credentialResolutionShape = {
|
|
950
1003
|
/** Where output credential references are resolved. */
|
|
951
|
-
credentialResolution: credentialResolutionSchema.default("refs-only")
|
|
1004
|
+
credentialResolution: credentialResolutionSchema.default("refs-only").describe("Where output credential references are resolved.")
|
|
952
1005
|
};
|
|
953
1006
|
var filesOutputSchema = z.strictObject({
|
|
954
|
-
delivery: z.literal("files"),
|
|
955
|
-
path: nonEmptyStringSchema.optional(),
|
|
956
|
-
publish: publishConfigSchema.optional(),
|
|
1007
|
+
delivery: z.literal("files").describe("Writes the generated SDK to a directory."),
|
|
1008
|
+
path: nonEmptyStringSchema.optional().describe("The destination directory for generated files."),
|
|
1009
|
+
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
957
1010
|
...credentialResolutionShape
|
|
958
1011
|
});
|
|
959
1012
|
var zipOutputSchema = z.strictObject({
|
|
960
|
-
delivery: z.literal("zip"),
|
|
961
|
-
fileName: nonEmptyStringSchema.optional(),
|
|
962
|
-
publish: publishConfigSchema.optional(),
|
|
1013
|
+
delivery: z.literal("zip").describe("Packages the generated SDK as a ZIP archive."),
|
|
1014
|
+
fileName: nonEmptyStringSchema.optional().describe("The generated ZIP archive file name."),
|
|
1015
|
+
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
963
1016
|
...credentialResolutionShape
|
|
964
1017
|
});
|
|
965
1018
|
var githubDeliverySchema = z.strictObject({
|
|
966
|
-
delivery: z.literal("github"),
|
|
967
|
-
github: githubOutputSchema,
|
|
968
|
-
publish: publishConfigSchema.optional(),
|
|
1019
|
+
delivery: z.literal("github").describe("Delivers the generated SDK to GitHub."),
|
|
1020
|
+
github: githubOutputSchema.describe("GitHub repository delivery settings."),
|
|
1021
|
+
publish: publishConfigSchema.optional().describe("Optional package registry publication."),
|
|
969
1022
|
...credentialResolutionShape
|
|
970
1023
|
});
|
|
971
1024
|
var outputConfigSchema = z.discriminatedUnion(
|
|
@@ -976,29 +1029,33 @@ var outputConfigSchema = z.discriminatedUnion(
|
|
|
976
1029
|
}
|
|
977
1030
|
);
|
|
978
1031
|
var replayConfigSchema = z.strictObject({
|
|
979
|
-
enabled: z.boolean()
|
|
1032
|
+
enabled: z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
|
|
980
1033
|
});
|
|
981
1034
|
var apiImportSettingsSchema = z.strictObject({
|
|
982
|
-
respectNullableSchemas: z.boolean().optional(),
|
|
983
|
-
titleAsSchemaName: z.boolean().optional(),
|
|
984
|
-
coerceEnumsToLiterals: z.boolean().optional(),
|
|
985
|
-
idiomaticRequestNames: z.boolean().optional(),
|
|
986
|
-
wrapReferencesToNullableInOptional: z.boolean().optional(),
|
|
987
|
-
coerceOptionalSchemasToNullable: z.boolean().optional(),
|
|
988
|
-
pathParameterOrder: z.enum(["url-order", "spec-order"]).optional(),
|
|
989
|
-
onlyIncludeReferencedSchemas: z.boolean().optional(),
|
|
990
|
-
objectQueryParameters: z.boolean().optional(),
|
|
991
|
-
typeDatesAsStrings: z.boolean().optional(),
|
|
992
|
-
groupMultiApiEnvironments: z.boolean().optional()
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1035
|
+
respectNullableSchemas: z.boolean().optional().describe("Whether nullable schemas remain nullable in generated types."),
|
|
1036
|
+
titleAsSchemaName: z.boolean().optional().describe("Whether a schema title can determine the generated type name."),
|
|
1037
|
+
coerceEnumsToLiterals: z.boolean().optional().describe("Whether single-value enums are imported as literal values."),
|
|
1038
|
+
idiomaticRequestNames: z.boolean().optional().describe("Whether request types use concise, idiomatic generated names."),
|
|
1039
|
+
wrapReferencesToNullableInOptional: z.boolean().optional().describe("Whether nullable schema references are also treated as optional."),
|
|
1040
|
+
coerceOptionalSchemasToNullable: z.boolean().optional().describe("Whether optional properties are represented as nullable required properties."),
|
|
1041
|
+
pathParameterOrder: z.enum(["url-order", "spec-order"]).optional().describe("Whether path parameters follow their URL order or specification order."),
|
|
1042
|
+
onlyIncludeReferencedSchemas: z.boolean().optional().describe("Whether unreferenced schemas are omitted from the generated SDK."),
|
|
1043
|
+
objectQueryParameters: z.boolean().optional().describe("Whether object-valued query parameters are preserved as objects."),
|
|
1044
|
+
typeDatesAsStrings: z.boolean().optional().describe("Whether date and date-time schemas are generated as strings."),
|
|
1045
|
+
groupMultiApiEnvironments: z.boolean().optional().describe(
|
|
1046
|
+
"Whether environments from multiple API sources are merged into shared named groups."
|
|
1047
|
+
),
|
|
1048
|
+
ignoreTags: z.boolean().optional().describe("Whether API tags are ignored when organizing generated resources."),
|
|
1049
|
+
disambiguateRequestNames: z.boolean().optional().describe("Whether colliding request type names are automatically disambiguated."),
|
|
1050
|
+
respectReadonlySchemas: z.boolean().optional().describe(
|
|
1051
|
+
"Whether read-only properties are modeled separately for request and response types."
|
|
1052
|
+
),
|
|
1053
|
+
discriminatedUnionV2: z.boolean().optional().describe("Whether oneOf and anyOf schemas use the newer discriminator inference rules."),
|
|
1054
|
+
undiscriminatedUnionsWithLiterals: z.boolean().optional().describe("Whether literal-bearing unions remain undiscriminated during import."),
|
|
1055
|
+
inlineAllOfSchemas: z.boolean().optional().describe("Whether schemas composed with allOf are inlined when possible."),
|
|
1056
|
+
resolveSchemaCollisions: z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
|
|
1057
|
+
asyncApiMessageNaming: z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
|
|
1058
|
+
defaultIntegerFormat: z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one.")
|
|
1002
1059
|
});
|
|
1003
1060
|
var sourceSpecTypeSchema = z.enum([
|
|
1004
1061
|
"openapi",
|
|
@@ -1010,18 +1067,20 @@ var sourceSpecTypeSchema = z.enum([
|
|
|
1010
1067
|
|
|
1011
1068
|
// src/sdk-config-ir/v1/source.ts
|
|
1012
1069
|
var sourceSpecConfigSchema = z.strictObject({
|
|
1013
|
-
id: nonEmptyStringSchema.optional(),
|
|
1014
|
-
name: nonEmptyStringSchema.optional(),
|
|
1015
|
-
namespace: nonEmptyStringSchema.optional(),
|
|
1016
|
-
specUrl: nonEmptyStringSchema
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1070
|
+
id: nonEmptyStringSchema.optional().describe("A unique identifier for this API source."),
|
|
1071
|
+
name: nonEmptyStringSchema.optional().describe("A human-readable name for this API source."),
|
|
1072
|
+
namespace: nonEmptyStringSchema.optional().describe("A namespace used to isolate this source in a multi-source SDK."),
|
|
1073
|
+
specUrl: nonEmptyStringSchema.describe(
|
|
1074
|
+
"The materialized URL from which the generator retrieves the API source."
|
|
1075
|
+
),
|
|
1076
|
+
specType: sourceSpecTypeSchema.describe("The API description format of this source."),
|
|
1077
|
+
apiImportSettings: apiImportSettingsSchema.optional().describe("Import behavior that overrides the source-level defaults for this spec."),
|
|
1078
|
+
overlays: z.array(nonEmptyStringSchema).optional().describe("Materialized overlays applied to this source in order."),
|
|
1079
|
+
overrides: z.array(nonEmptyStringSchema).optional().describe("Materialized source overrides applied in order.")
|
|
1021
1080
|
});
|
|
1022
1081
|
var sourceConfigSchema = z.strictObject({
|
|
1023
|
-
specs: z.array(sourceSpecConfigSchema).min(1, "source.specs must contain at least one source spec"),
|
|
1024
|
-
apiImportSettings: apiImportSettingsSchema.optional()
|
|
1082
|
+
specs: z.array(sourceSpecConfigSchema).min(1, "source.specs must contain at least one source spec").describe("Materialized API sources in authoritative processing order."),
|
|
1083
|
+
apiImportSettings: apiImportSettingsSchema.optional().describe("Default import behavior shared by every source spec.")
|
|
1025
1084
|
}).superRefine(({ specs }, context) => {
|
|
1026
1085
|
const seenIds = /* @__PURE__ */ new Set();
|
|
1027
1086
|
specs.forEach(({ id }, index) => {
|
|
@@ -1053,25 +1112,27 @@ var targetLanguageSchema = z.enum([
|
|
|
1053
1112
|
"terraform"
|
|
1054
1113
|
]);
|
|
1055
1114
|
var targetConfigSchema = z.strictObject({
|
|
1056
|
-
language: targetLanguageSchema
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1115
|
+
language: targetLanguageSchema.describe(
|
|
1116
|
+
"The language or platform generated by this single-target request."
|
|
1117
|
+
),
|
|
1118
|
+
generatorVersion: exactSemverSchema.optional().describe("The exact generator version requested for this target."),
|
|
1119
|
+
sourceOrigin: z.enum(["postman", "fern"]).describe("The configuration system from which this IR was normalized."),
|
|
1120
|
+
sdkName: nonEmptyStringSchema.describe("The name used for the generated SDK."),
|
|
1060
1121
|
/**
|
|
1061
1122
|
* Stable Fern/Fiddle API identity for external publishing.
|
|
1062
1123
|
* Producers must set this explicitly for GitHub or registry publishing; it is not inferred from
|
|
1063
1124
|
* target.sdkName because SDK display names and Fern API names are not equivalent.
|
|
1064
1125
|
*/
|
|
1065
|
-
apiName: nonEmptyStringSchema.optional(),
|
|
1066
|
-
organization: nonEmptyStringSchema.optional(),
|
|
1126
|
+
apiName: nonEmptyStringSchema.optional().describe("The stable API identity used for external publishing."),
|
|
1127
|
+
organization: nonEmptyStringSchema.optional().describe("Source organization metadata retained for generation."),
|
|
1067
1128
|
/**
|
|
1068
1129
|
* Stable Fern/Fiddle organization identity for external publishing.
|
|
1069
1130
|
* Producers must set this explicitly for GitHub or registry publishing; it is not inferred from
|
|
1070
1131
|
* target.organization because source organization metadata is optional and may not match Fern.
|
|
1071
1132
|
*/
|
|
1072
|
-
organizationName: nonEmptyStringSchema.optional(),
|
|
1073
|
-
sdkVersion: nonEmptyStringSchema.default("1.0.0"),
|
|
1074
|
-
apiVersion: nonEmptyStringSchema.optional()
|
|
1133
|
+
organizationName: nonEmptyStringSchema.optional().describe("The stable organization identity used for external publishing."),
|
|
1134
|
+
sdkVersion: nonEmptyStringSchema.default("1.0.0").describe("The version of the generated SDK."),
|
|
1135
|
+
apiVersion: nonEmptyStringSchema.optional().describe("The version of the API represented by the SDK.")
|
|
1075
1136
|
});
|
|
1076
1137
|
|
|
1077
1138
|
// src/sdk-config-ir/v1/sdk-config-ir-v1.ts
|
|
@@ -1133,17 +1194,21 @@ function validatePublishingIdentity(packageConfig, registry, context) {
|
|
|
1133
1194
|
}
|
|
1134
1195
|
}
|
|
1135
1196
|
var sdkConfigIrV1Schema = z.strictObject({
|
|
1136
|
-
schemaVersion: z.literal(SDK_CONFIG_IR_V1_SCHEMA_VERSION),
|
|
1137
|
-
source: sourceConfigSchema,
|
|
1138
|
-
target: targetConfigSchema
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1197
|
+
schemaVersion: z.literal(SDK_CONFIG_IR_V1_SCHEMA_VERSION).describe("The version of the normalized SDK Config IR schema."),
|
|
1198
|
+
source: sourceConfigSchema.describe("Materialized API descriptions consumed by generation."),
|
|
1199
|
+
target: targetConfigSchema.describe(
|
|
1200
|
+
"Identity and provenance for this single generation target."
|
|
1201
|
+
),
|
|
1202
|
+
api: apiConfigSchema.describe("API behavior exposed by the generated SDK."),
|
|
1203
|
+
client: clientConfigSchema.describe("Behavior of the generated API client."),
|
|
1204
|
+
package: packageConfigSchema.describe("Package identity and metadata for the generated SDK."),
|
|
1205
|
+
output: outputConfigSchema.describe("Artifact delivery and optional package publication."),
|
|
1206
|
+
replay: replayConfigSchema.optional().describe("Generation replay behavior."),
|
|
1207
|
+
docs: docsConfigSchema.describe("Generated documentation settings."),
|
|
1208
|
+
generation: generationConfigSchema.describe(
|
|
1209
|
+
"Shared and language-specific generation behavior."
|
|
1210
|
+
),
|
|
1211
|
+
compatibility: compatibilityConfigSchema.optional().describe("Temporary provenance and diagnostics retained during legacy migration.")
|
|
1147
1212
|
}).superRefine(({ compatibility, generation, output, package: packageConfig, target }, context) => {
|
|
1148
1213
|
const configuredLanguages = Object.keys(generation.language ?? {});
|
|
1149
1214
|
const requiresExternalPublishIdentity = output.delivery === "github" || output.publish !== void 0;
|