@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
|
@@ -3,6 +3,10 @@ import semver from 'semver';
|
|
|
3
3
|
|
|
4
4
|
// src/sdk-config-domain/v1/api.ts
|
|
5
5
|
var nonEmptyStringSchema = z.string().min(1);
|
|
6
|
+
var relativePathSchema = nonEmptyStringSchema.refine(
|
|
7
|
+
(value) => !/^(?:[\\/]|[A-Za-z]:)/.test(value) && !value.split(/[\\/]/).some((segment) => segment === ".."),
|
|
8
|
+
{ message: "must be a relative path without parent directory segments" }
|
|
9
|
+
);
|
|
6
10
|
var exactSemverSchema = z.string().refine(
|
|
7
11
|
(value) => {
|
|
8
12
|
if (value.trim() !== value || !/^\d/.test(value)) {
|
|
@@ -184,26 +188,42 @@ var apiConfigSchema = z.strictObject({
|
|
|
184
188
|
*/
|
|
185
189
|
audiences: z.array(nonEmptyStringSchema).optional()
|
|
186
190
|
});
|
|
191
|
+
var retryOverrideShape = {
|
|
192
|
+
enabled: z.boolean().optional(),
|
|
193
|
+
maxAttempts: z.number().int().min(1).optional(),
|
|
194
|
+
retryDelayMs: z.number().nonnegative().optional(),
|
|
195
|
+
maxDelayMs: z.number().nonnegative().optional(),
|
|
196
|
+
jitterMs: z.number().nonnegative().optional(),
|
|
197
|
+
backoffFactor: z.number().positive().optional(),
|
|
198
|
+
statusCodes: z.array(z.number().int().min(100).max(599)).optional(),
|
|
199
|
+
methods: z.array(nonEmptyStringSchema).optional(),
|
|
200
|
+
statusCodeProfile: z.enum(["legacy", "recommended"]).optional(),
|
|
201
|
+
maxRetryAfterDelayMs: z.number().nonnegative().optional()
|
|
202
|
+
};
|
|
203
|
+
function validateRetryDelays({
|
|
204
|
+
maxDelayMs,
|
|
205
|
+
retryDelayMs
|
|
206
|
+
}, context) {
|
|
207
|
+
if (maxDelayMs !== void 0 && retryDelayMs !== void 0 && maxDelayMs < retryDelayMs) {
|
|
208
|
+
context.addIssue({
|
|
209
|
+
code: "custom",
|
|
210
|
+
message: "maxDelayMs must be greater than or equal to retryDelayMs",
|
|
211
|
+
path: ["maxDelayMs"]
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
var clientRetryOverrideSchema = z.strictObject(retryOverrideShape).superRefine(validateRetryDelays);
|
|
187
216
|
var retryConfigSchema = z.strictObject({
|
|
217
|
+
...retryOverrideShape,
|
|
188
218
|
enabled: z.boolean().default(true),
|
|
189
219
|
maxAttempts: z.number().int().min(1).default(3),
|
|
190
220
|
retryDelayMs: z.number().nonnegative().default(150),
|
|
191
221
|
maxDelayMs: z.number().nonnegative().default(5e3),
|
|
192
222
|
jitterMs: z.number().nonnegative().default(50),
|
|
193
223
|
backoffFactor: z.number().positive().default(2),
|
|
194
|
-
statusCodes: z.array(z.number().int().min(100).max(599)).optional(),
|
|
195
224
|
methods: z.array(nonEmptyStringSchema).default(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]),
|
|
196
|
-
statusCodeProfile: z.enum(["legacy", "recommended"]).optional(),
|
|
197
225
|
maxRetryAfterDelayMs: z.number().nonnegative().default(6e4)
|
|
198
|
-
}).superRefine(
|
|
199
|
-
if (maxDelayMs < retryDelayMs) {
|
|
200
|
-
context.addIssue({
|
|
201
|
-
code: "custom",
|
|
202
|
-
message: "maxDelayMs must be greater than or equal to retryDelayMs",
|
|
203
|
-
path: ["maxDelayMs"]
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
});
|
|
226
|
+
}).superRefine(validateRetryDelays);
|
|
207
227
|
var constructorParameterSchema = z.strictObject({
|
|
208
228
|
name: nonEmptyStringSchema,
|
|
209
229
|
example: z.string().optional(),
|
|
@@ -225,12 +245,12 @@ var tokenRefreshConfigSchema = z.strictObject({
|
|
|
225
245
|
});
|
|
226
246
|
}
|
|
227
247
|
});
|
|
228
|
-
var
|
|
229
|
-
retry:
|
|
230
|
-
responseHeaders: z.boolean().
|
|
248
|
+
var clientOverrideShape = {
|
|
249
|
+
retry: clientRetryOverrideSchema.optional(),
|
|
250
|
+
responseHeaders: z.boolean().optional(),
|
|
231
251
|
responseValidation: z.boolean().optional(),
|
|
232
|
-
multiTenant: z.boolean().
|
|
233
|
-
additionalConstructorParameters: z.array(constructorParameterSchema).
|
|
252
|
+
multiTenant: z.boolean().optional(),
|
|
253
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).optional(),
|
|
234
254
|
timeoutMs: z.union([z.number().nonnegative(), z.literal("infinity")]).optional(),
|
|
235
255
|
requestParameterStyle: parameterStyleSchema.optional(),
|
|
236
256
|
pathParameterStyle: parameterStyleSchema.optional(),
|
|
@@ -238,6 +258,14 @@ var clientConfigSchema = z.strictObject({
|
|
|
238
258
|
useDefaultRequestParameterValues: z.boolean().optional(),
|
|
239
259
|
respectOptionalRequestBody: z.boolean().optional(),
|
|
240
260
|
tokenRefresh: tokenRefreshConfigSchema.optional()
|
|
261
|
+
};
|
|
262
|
+
var clientConfigOverrideSchema = z.strictObject(clientOverrideShape);
|
|
263
|
+
var clientConfigSchema = z.strictObject({
|
|
264
|
+
...clientOverrideShape,
|
|
265
|
+
retry: retryConfigSchema.prefault({}),
|
|
266
|
+
responseHeaders: z.boolean().default(false),
|
|
267
|
+
multiTenant: z.boolean().default(false),
|
|
268
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).default([])
|
|
241
269
|
});
|
|
242
270
|
var unsupportedFieldSchema = z.strictObject({
|
|
243
271
|
source: z.enum(["fern", "postman", "sdk-config-ir"]),
|
|
@@ -307,6 +335,18 @@ var docsConfigSchema = z.strictObject({
|
|
|
307
335
|
referenceBaseUrl: nonEmptyStringSchema.optional(),
|
|
308
336
|
includeApiReference: z.boolean().optional()
|
|
309
337
|
});
|
|
338
|
+
var namingConfigSchema = z.strictObject({
|
|
339
|
+
clientName: nonEmptyStringSchema.optional(),
|
|
340
|
+
exportedClientName: nonEmptyStringSchema.optional(),
|
|
341
|
+
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
342
|
+
apiErrorName: nonEmptyStringSchema.optional(),
|
|
343
|
+
baseErrorName: nonEmptyStringSchema.optional(),
|
|
344
|
+
pagerName: nonEmptyStringSchema.optional(),
|
|
345
|
+
/** Apply Fern's initialism-aware casing rules when deriving generated identifiers. */
|
|
346
|
+
smartCasing: z.boolean().optional(),
|
|
347
|
+
/** Preserve a word boundary after digits when Fern smart casing is enabled. */
|
|
348
|
+
smartCasingDigitWordBoundary: z.boolean().optional()
|
|
349
|
+
});
|
|
310
350
|
var cliGenerationConfigSchema = z.strictObject({
|
|
311
351
|
paginationParameters: z.array(nonEmptyStringSchema).optional(),
|
|
312
352
|
skills: z.boolean().optional()
|
|
@@ -368,6 +408,8 @@ var typescriptGenerationConfigSchema = z.strictObject({
|
|
|
368
408
|
namingStrategy: z.enum(["base", "originalPropertyNames"]).optional(),
|
|
369
409
|
bundle: z.boolean().optional(),
|
|
370
410
|
exportClassDefault: z.boolean().optional(),
|
|
411
|
+
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
412
|
+
namespaceExportName: nonEmptyStringSchema.optional(),
|
|
371
413
|
allowCustomFetcher: z.boolean().optional(),
|
|
372
414
|
useBrandedStringAliases: z.boolean().optional(),
|
|
373
415
|
useLegacyExports: z.boolean().optional(),
|
|
@@ -445,7 +487,7 @@ var swiftGenerationConfigSchema = z.strictObject({
|
|
|
445
487
|
moduleName: nonEmptyStringSchema.optional(),
|
|
446
488
|
nullableAsOptional: z.boolean().optional()
|
|
447
489
|
});
|
|
448
|
-
var goModulePathSchema =
|
|
490
|
+
var goModulePathSchema = relativePathSchema.regex(
|
|
449
491
|
/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)+$/,
|
|
450
492
|
"Go module path must be a slash-delimited path using letters, numbers, dots, dashes, underscores, or tildes"
|
|
451
493
|
);
|
|
@@ -548,10 +590,11 @@ var terraformGenerationConfigSchema = z.strictObject({
|
|
|
548
590
|
});
|
|
549
591
|
|
|
550
592
|
// src/sdk-config-ir/v1/generation.ts
|
|
551
|
-
var generationAssetSchema = z.
|
|
552
|
-
type: z.
|
|
553
|
-
location: nonEmptyStringSchema
|
|
554
|
-
})
|
|
593
|
+
var generationAssetSchema = z.discriminatedUnion("type", [
|
|
594
|
+
z.strictObject({ type: z.literal("path"), location: relativePathSchema }),
|
|
595
|
+
z.strictObject({ type: z.literal("url"), location: nonEmptyStringSchema }),
|
|
596
|
+
z.strictObject({ type: z.literal("artifact"), location: nonEmptyStringSchema })
|
|
597
|
+
]);
|
|
555
598
|
var hookDependencySchema = z.strictObject({
|
|
556
599
|
name: nonEmptyStringSchema,
|
|
557
600
|
version: nonEmptyStringSchema,
|
|
@@ -571,7 +614,7 @@ var customCodeConfigSchema = z.strictObject({
|
|
|
571
614
|
protectedFiles: z.array(nonEmptyStringSchema).optional()
|
|
572
615
|
});
|
|
573
616
|
var workflowConfigSchema = z.strictObject({
|
|
574
|
-
path:
|
|
617
|
+
path: relativePathSchema,
|
|
575
618
|
outputName: nonEmptyStringSchema.optional()
|
|
576
619
|
});
|
|
577
620
|
var analyticsHeaderSchema = z.union([
|
|
@@ -617,14 +660,6 @@ var streamsSchema = z.strictObject({
|
|
|
617
660
|
fileResponseType: z.enum(["stream", "binary-response"]).optional(),
|
|
618
661
|
defaultChunkSizeBytes: z.number().int().positive().optional()
|
|
619
662
|
});
|
|
620
|
-
var namingConfigSchema = z.strictObject({
|
|
621
|
-
clientName: nonEmptyStringSchema.optional(),
|
|
622
|
-
exportedClientName: nonEmptyStringSchema.optional(),
|
|
623
|
-
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
624
|
-
apiErrorName: nonEmptyStringSchema.optional(),
|
|
625
|
-
baseErrorName: nonEmptyStringSchema.optional(),
|
|
626
|
-
pagerName: nonEmptyStringSchema.optional()
|
|
627
|
-
});
|
|
628
663
|
var layoutConfigSchema = z.strictObject({
|
|
629
664
|
outputDirectory: z.enum(["project-root", "source-root"]).optional(),
|
|
630
665
|
packagePath: nonEmptyStringSchema.optional()
|
|
@@ -677,7 +712,7 @@ var generationConfigSchema = z.strictObject({
|
|
|
677
712
|
hooks: hooksConfigSchema.optional(),
|
|
678
713
|
customCode: customCodeConfigSchema.optional(),
|
|
679
714
|
workflows: z.array(workflowConfigSchema).optional(),
|
|
680
|
-
customQueryPaths: z.array(
|
|
715
|
+
customQueryPaths: z.array(relativePathSchema).optional(),
|
|
681
716
|
analytics: analyticsConfigSchema.optional(),
|
|
682
717
|
wireTests: wireTestsSchema.optional(),
|
|
683
718
|
unitTests: unitTestsSchema.optional(),
|
|
@@ -812,6 +847,8 @@ var sourceSpecTypeSchema = z.enum([
|
|
|
812
847
|
"asyncapi",
|
|
813
848
|
"graphql"
|
|
814
849
|
]);
|
|
850
|
+
|
|
851
|
+
// src/sdk-config-ir/v1/source.ts
|
|
815
852
|
var sourceSpecConfigSchema = z.strictObject({
|
|
816
853
|
id: nonEmptyStringSchema.optional(),
|
|
817
854
|
name: nonEmptyStringSchema.optional(),
|
|
@@ -999,6 +1036,6 @@ function parseSdkConfigIrV1(value) {
|
|
|
999
1036
|
return sdkConfigIrV1Schema.parse(value);
|
|
1000
1037
|
}
|
|
1001
1038
|
|
|
1002
|
-
export { SDK_CONFIG_IR_V1_SCHEMA_VERSION, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, cliGenerationConfigSchema, clientConfigSchema, compatibilityConfigSchema, composerPackageNameSchema, csharpGenerationConfigSchema, dependencySchema, docsConfigSchema, exactSemverSchema, generationConfigSchema, goGenerationConfigSchema, goModulePathSchema, javaGenerationConfigSchema, jsonObjectSchema, jsonValueSchema, kotlinGenerationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, mcpAvailabilityStatuses, mcpGenerationConfigSchema, nonEmptyStringSchema, outputConfigSchema, packageConfigSchema, parseSdkConfigIrV1, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrV1Schema, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema };
|
|
1039
|
+
export { SDK_CONFIG_IR_V1_SCHEMA_VERSION, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, cliGenerationConfigSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, composerPackageNameSchema, csharpGenerationConfigSchema, dependencySchema, docsConfigSchema, exactSemverSchema, generationConfigSchema, goGenerationConfigSchema, goModulePathSchema, javaGenerationConfigSchema, jsonObjectSchema, jsonValueSchema, kotlinGenerationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, mcpAvailabilityStatuses, mcpGenerationConfigSchema, nonEmptyStringSchema, outputConfigSchema, packageConfigSchema, parseSdkConfigIrV1, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrV1Schema, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema };
|
|
1003
1040
|
//# sourceMappingURL=index.js.map
|
|
1004
1041
|
//# sourceMappingURL=index.js.map
|