@postman/sdk-config 0.1.0 → 0.2.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 +139 -124
- package/dist/index.cjs +301 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +292 -150
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +290 -113
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.d.cts +2 -2
- package/dist/sdk-config/index.d.ts +2 -2
- package/dist/sdk-config/index.js +284 -114
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +290 -113
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +6903 -289
- package/dist/sdk-config/v1/index.d.ts +6903 -289
- package/dist/sdk-config/v1/index.js +284 -114
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +71 -31
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +2 -2
- package/dist/sdk-config-ir/index.d.ts +2 -2
- package/dist/sdk-config-ir/index.js +69 -32
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +71 -31
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +130 -43
- package/dist/sdk-config-ir/v1/index.d.ts +130 -43
- package/dist/sdk-config-ir/v1/index.js +69 -32
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-ByDbin_v.d.cts → typescript-DNqK3T3v.d.cts} +5 -1
- package/dist/{typescript-ByDbin_v.d.ts → typescript-DNqK3T3v.d.ts} +5 -1
- package/docs/releasing.md +114 -0
- package/package.json +2 -2
- package/src/sdk-config/v1/README.md +91 -23
- package/src/sdk-config-ir/v1/README.md +3 -2
|
@@ -9,6 +9,10 @@ var semver__default = /*#__PURE__*/_interopDefault(semver);
|
|
|
9
9
|
|
|
10
10
|
// src/sdk-config-domain/v1/api.ts
|
|
11
11
|
var nonEmptyStringSchema = zod.z.string().min(1);
|
|
12
|
+
var relativePathSchema = nonEmptyStringSchema.refine(
|
|
13
|
+
(value) => !/^(?:[\\/]|[A-Za-z]:)/.test(value) && !value.split(/[\\/]/).some((segment) => segment === ".."),
|
|
14
|
+
{ message: "must be a relative path without parent directory segments" }
|
|
15
|
+
);
|
|
12
16
|
var exactSemverSchema = zod.z.string().refine(
|
|
13
17
|
(value) => {
|
|
14
18
|
if (value.trim() !== value || !/^\d/.test(value)) {
|
|
@@ -190,26 +194,42 @@ var apiConfigSchema = zod.z.strictObject({
|
|
|
190
194
|
*/
|
|
191
195
|
audiences: zod.z.array(nonEmptyStringSchema).optional()
|
|
192
196
|
});
|
|
197
|
+
var retryOverrideShape = {
|
|
198
|
+
enabled: zod.z.boolean().optional(),
|
|
199
|
+
maxAttempts: zod.z.number().int().min(1).optional(),
|
|
200
|
+
retryDelayMs: zod.z.number().nonnegative().optional(),
|
|
201
|
+
maxDelayMs: zod.z.number().nonnegative().optional(),
|
|
202
|
+
jitterMs: zod.z.number().nonnegative().optional(),
|
|
203
|
+
backoffFactor: zod.z.number().positive().optional(),
|
|
204
|
+
statusCodes: zod.z.array(zod.z.number().int().min(100).max(599)).optional(),
|
|
205
|
+
methods: zod.z.array(nonEmptyStringSchema).optional(),
|
|
206
|
+
statusCodeProfile: zod.z.enum(["legacy", "recommended"]).optional(),
|
|
207
|
+
maxRetryAfterDelayMs: zod.z.number().nonnegative().optional()
|
|
208
|
+
};
|
|
209
|
+
function validateRetryDelays({
|
|
210
|
+
maxDelayMs,
|
|
211
|
+
retryDelayMs
|
|
212
|
+
}, context) {
|
|
213
|
+
if (maxDelayMs !== void 0 && retryDelayMs !== void 0 && maxDelayMs < retryDelayMs) {
|
|
214
|
+
context.addIssue({
|
|
215
|
+
code: "custom",
|
|
216
|
+
message: "maxDelayMs must be greater than or equal to retryDelayMs",
|
|
217
|
+
path: ["maxDelayMs"]
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
var clientRetryOverrideSchema = zod.z.strictObject(retryOverrideShape).superRefine(validateRetryDelays);
|
|
193
222
|
var retryConfigSchema = zod.z.strictObject({
|
|
223
|
+
...retryOverrideShape,
|
|
194
224
|
enabled: zod.z.boolean().default(true),
|
|
195
225
|
maxAttempts: zod.z.number().int().min(1).default(3),
|
|
196
226
|
retryDelayMs: zod.z.number().nonnegative().default(150),
|
|
197
227
|
maxDelayMs: zod.z.number().nonnegative().default(5e3),
|
|
198
228
|
jitterMs: zod.z.number().nonnegative().default(50),
|
|
199
229
|
backoffFactor: zod.z.number().positive().default(2),
|
|
200
|
-
statusCodes: zod.z.array(zod.z.number().int().min(100).max(599)).optional(),
|
|
201
230
|
methods: zod.z.array(nonEmptyStringSchema).default(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]),
|
|
202
|
-
statusCodeProfile: zod.z.enum(["legacy", "recommended"]).optional(),
|
|
203
231
|
maxRetryAfterDelayMs: zod.z.number().nonnegative().default(6e4)
|
|
204
|
-
}).superRefine(
|
|
205
|
-
if (maxDelayMs < retryDelayMs) {
|
|
206
|
-
context.addIssue({
|
|
207
|
-
code: "custom",
|
|
208
|
-
message: "maxDelayMs must be greater than or equal to retryDelayMs",
|
|
209
|
-
path: ["maxDelayMs"]
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
});
|
|
232
|
+
}).superRefine(validateRetryDelays);
|
|
213
233
|
var constructorParameterSchema = zod.z.strictObject({
|
|
214
234
|
name: nonEmptyStringSchema,
|
|
215
235
|
example: zod.z.string().optional(),
|
|
@@ -231,12 +251,12 @@ var tokenRefreshConfigSchema = zod.z.strictObject({
|
|
|
231
251
|
});
|
|
232
252
|
}
|
|
233
253
|
});
|
|
234
|
-
var
|
|
235
|
-
retry:
|
|
236
|
-
responseHeaders: zod.z.boolean().
|
|
254
|
+
var clientOverrideShape = {
|
|
255
|
+
retry: clientRetryOverrideSchema.optional(),
|
|
256
|
+
responseHeaders: zod.z.boolean().optional(),
|
|
237
257
|
responseValidation: zod.z.boolean().optional(),
|
|
238
|
-
multiTenant: zod.z.boolean().
|
|
239
|
-
additionalConstructorParameters: zod.z.array(constructorParameterSchema).
|
|
258
|
+
multiTenant: zod.z.boolean().optional(),
|
|
259
|
+
additionalConstructorParameters: zod.z.array(constructorParameterSchema).optional(),
|
|
240
260
|
timeoutMs: zod.z.union([zod.z.number().nonnegative(), zod.z.literal("infinity")]).optional(),
|
|
241
261
|
requestParameterStyle: parameterStyleSchema.optional(),
|
|
242
262
|
pathParameterStyle: parameterStyleSchema.optional(),
|
|
@@ -244,6 +264,14 @@ var clientConfigSchema = zod.z.strictObject({
|
|
|
244
264
|
useDefaultRequestParameterValues: zod.z.boolean().optional(),
|
|
245
265
|
respectOptionalRequestBody: zod.z.boolean().optional(),
|
|
246
266
|
tokenRefresh: tokenRefreshConfigSchema.optional()
|
|
267
|
+
};
|
|
268
|
+
var clientConfigOverrideSchema = zod.z.strictObject(clientOverrideShape);
|
|
269
|
+
var clientConfigSchema = zod.z.strictObject({
|
|
270
|
+
...clientOverrideShape,
|
|
271
|
+
retry: retryConfigSchema.prefault({}),
|
|
272
|
+
responseHeaders: zod.z.boolean().default(false),
|
|
273
|
+
multiTenant: zod.z.boolean().default(false),
|
|
274
|
+
additionalConstructorParameters: zod.z.array(constructorParameterSchema).default([])
|
|
247
275
|
});
|
|
248
276
|
var unsupportedFieldSchema = zod.z.strictObject({
|
|
249
277
|
source: zod.z.enum(["fern", "postman", "sdk-config-ir"]),
|
|
@@ -313,6 +341,18 @@ var docsConfigSchema = zod.z.strictObject({
|
|
|
313
341
|
referenceBaseUrl: nonEmptyStringSchema.optional(),
|
|
314
342
|
includeApiReference: zod.z.boolean().optional()
|
|
315
343
|
});
|
|
344
|
+
var namingConfigSchema = zod.z.strictObject({
|
|
345
|
+
clientName: nonEmptyStringSchema.optional(),
|
|
346
|
+
exportedClientName: nonEmptyStringSchema.optional(),
|
|
347
|
+
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
348
|
+
apiErrorName: nonEmptyStringSchema.optional(),
|
|
349
|
+
baseErrorName: nonEmptyStringSchema.optional(),
|
|
350
|
+
pagerName: nonEmptyStringSchema.optional(),
|
|
351
|
+
/** Apply Fern's initialism-aware casing rules when deriving generated identifiers. */
|
|
352
|
+
smartCasing: zod.z.boolean().optional(),
|
|
353
|
+
/** Preserve a word boundary after digits when Fern smart casing is enabled. */
|
|
354
|
+
smartCasingDigitWordBoundary: zod.z.boolean().optional()
|
|
355
|
+
});
|
|
316
356
|
var cliGenerationConfigSchema = zod.z.strictObject({
|
|
317
357
|
paginationParameters: zod.z.array(nonEmptyStringSchema).optional(),
|
|
318
358
|
skills: zod.z.boolean().optional()
|
|
@@ -374,6 +414,8 @@ var typescriptGenerationConfigSchema = zod.z.strictObject({
|
|
|
374
414
|
namingStrategy: zod.z.enum(["base", "originalPropertyNames"]).optional(),
|
|
375
415
|
bundle: zod.z.boolean().optional(),
|
|
376
416
|
exportClassDefault: zod.z.boolean().optional(),
|
|
417
|
+
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
418
|
+
namespaceExportName: nonEmptyStringSchema.optional(),
|
|
377
419
|
allowCustomFetcher: zod.z.boolean().optional(),
|
|
378
420
|
useBrandedStringAliases: zod.z.boolean().optional(),
|
|
379
421
|
useLegacyExports: zod.z.boolean().optional(),
|
|
@@ -451,7 +493,7 @@ var swiftGenerationConfigSchema = zod.z.strictObject({
|
|
|
451
493
|
moduleName: nonEmptyStringSchema.optional(),
|
|
452
494
|
nullableAsOptional: zod.z.boolean().optional()
|
|
453
495
|
});
|
|
454
|
-
var goModulePathSchema =
|
|
496
|
+
var goModulePathSchema = relativePathSchema.regex(
|
|
455
497
|
/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)+$/,
|
|
456
498
|
"Go module path must be a slash-delimited path using letters, numbers, dots, dashes, underscores, or tildes"
|
|
457
499
|
);
|
|
@@ -554,10 +596,11 @@ var terraformGenerationConfigSchema = zod.z.strictObject({
|
|
|
554
596
|
});
|
|
555
597
|
|
|
556
598
|
// src/sdk-config-ir/v1/generation.ts
|
|
557
|
-
var generationAssetSchema = zod.z.
|
|
558
|
-
type: zod.z.
|
|
559
|
-
location: nonEmptyStringSchema
|
|
560
|
-
})
|
|
599
|
+
var generationAssetSchema = zod.z.discriminatedUnion("type", [
|
|
600
|
+
zod.z.strictObject({ type: zod.z.literal("path"), location: relativePathSchema }),
|
|
601
|
+
zod.z.strictObject({ type: zod.z.literal("url"), location: nonEmptyStringSchema }),
|
|
602
|
+
zod.z.strictObject({ type: zod.z.literal("artifact"), location: nonEmptyStringSchema })
|
|
603
|
+
]);
|
|
561
604
|
var hookDependencySchema = zod.z.strictObject({
|
|
562
605
|
name: nonEmptyStringSchema,
|
|
563
606
|
version: nonEmptyStringSchema,
|
|
@@ -577,7 +620,7 @@ var customCodeConfigSchema = zod.z.strictObject({
|
|
|
577
620
|
protectedFiles: zod.z.array(nonEmptyStringSchema).optional()
|
|
578
621
|
});
|
|
579
622
|
var workflowConfigSchema = zod.z.strictObject({
|
|
580
|
-
path:
|
|
623
|
+
path: relativePathSchema,
|
|
581
624
|
outputName: nonEmptyStringSchema.optional()
|
|
582
625
|
});
|
|
583
626
|
var analyticsHeaderSchema = zod.z.union([
|
|
@@ -623,14 +666,6 @@ var streamsSchema = zod.z.strictObject({
|
|
|
623
666
|
fileResponseType: zod.z.enum(["stream", "binary-response"]).optional(),
|
|
624
667
|
defaultChunkSizeBytes: zod.z.number().int().positive().optional()
|
|
625
668
|
});
|
|
626
|
-
var namingConfigSchema = zod.z.strictObject({
|
|
627
|
-
clientName: nonEmptyStringSchema.optional(),
|
|
628
|
-
exportedClientName: nonEmptyStringSchema.optional(),
|
|
629
|
-
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
630
|
-
apiErrorName: nonEmptyStringSchema.optional(),
|
|
631
|
-
baseErrorName: nonEmptyStringSchema.optional(),
|
|
632
|
-
pagerName: nonEmptyStringSchema.optional()
|
|
633
|
-
});
|
|
634
669
|
var layoutConfigSchema = zod.z.strictObject({
|
|
635
670
|
outputDirectory: zod.z.enum(["project-root", "source-root"]).optional(),
|
|
636
671
|
packagePath: nonEmptyStringSchema.optional()
|
|
@@ -683,7 +718,7 @@ var generationConfigSchema = zod.z.strictObject({
|
|
|
683
718
|
hooks: hooksConfigSchema.optional(),
|
|
684
719
|
customCode: customCodeConfigSchema.optional(),
|
|
685
720
|
workflows: zod.z.array(workflowConfigSchema).optional(),
|
|
686
|
-
customQueryPaths: zod.z.array(
|
|
721
|
+
customQueryPaths: zod.z.array(relativePathSchema).optional(),
|
|
687
722
|
analytics: analyticsConfigSchema.optional(),
|
|
688
723
|
wireTests: wireTestsSchema.optional(),
|
|
689
724
|
unitTests: unitTestsSchema.optional(),
|
|
@@ -818,6 +853,8 @@ var sourceSpecTypeSchema = zod.z.enum([
|
|
|
818
853
|
"asyncapi",
|
|
819
854
|
"graphql"
|
|
820
855
|
]);
|
|
856
|
+
|
|
857
|
+
// src/sdk-config-ir/v1/source.ts
|
|
821
858
|
var sourceSpecConfigSchema = zod.z.strictObject({
|
|
822
859
|
id: nonEmptyStringSchema.optional(),
|
|
823
860
|
name: nonEmptyStringSchema.optional(),
|
|
@@ -1011,7 +1048,9 @@ exports.apiImportSettingsSchema = apiImportSettingsSchema;
|
|
|
1011
1048
|
exports.authConfigSchema = authConfigSchema;
|
|
1012
1049
|
exports.authSchemeSchema = authSchemeSchema;
|
|
1013
1050
|
exports.cliGenerationConfigSchema = cliGenerationConfigSchema;
|
|
1051
|
+
exports.clientConfigOverrideSchema = clientConfigOverrideSchema;
|
|
1014
1052
|
exports.clientConfigSchema = clientConfigSchema;
|
|
1053
|
+
exports.clientRetryOverrideSchema = clientRetryOverrideSchema;
|
|
1015
1054
|
exports.compatibilityConfigSchema = compatibilityConfigSchema;
|
|
1016
1055
|
exports.composerPackageNameSchema = composerPackageNameSchema;
|
|
1017
1056
|
exports.csharpGenerationConfigSchema = csharpGenerationConfigSchema;
|
|
@@ -1039,6 +1078,7 @@ exports.publishRegistrySchema = publishRegistrySchema;
|
|
|
1039
1078
|
exports.pythonGenerationConfigSchema = pythonGenerationConfigSchema;
|
|
1040
1079
|
exports.readmeCustomSectionSchema = readmeCustomSectionSchema;
|
|
1041
1080
|
exports.readmeEndpointSchema = readmeEndpointSchema;
|
|
1081
|
+
exports.relativePathSchema = relativePathSchema;
|
|
1042
1082
|
exports.rubyGenerationConfigSchema = rubyGenerationConfigSchema;
|
|
1043
1083
|
exports.rustGenerationConfigSchema = rustGenerationConfigSchema;
|
|
1044
1084
|
exports.sdkConfigIrV1Schema = sdkConfigIrV1Schema;
|