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