@postman/sdk-config 0.1.1 → 0.3.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 +29 -12
- package/dist/index.cjs +352 -145
- 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 +345 -146
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +281 -109
- 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 +276 -110
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +281 -109
- 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 +276 -110
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +126 -30
- 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 +125 -31
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +126 -30
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +534 -15
- package/dist/sdk-config-ir/v1/index.d.ts +534 -15
- package/dist/sdk-config-ir/v1/index.js +125 -31
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-DK97815_.d.cts → typescript-DNqK3T3v.d.cts} +3 -0
- package/dist/{typescript-DK97815_.d.ts → typescript-DNqK3T3v.d.ts} +3 -0
- package/docs/releasing.md +114 -0
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +91 -23
- package/src/sdk-config-ir/v1/README.md +91 -83
|
@@ -194,26 +194,42 @@ var apiConfigSchema = zod.z.strictObject({
|
|
|
194
194
|
*/
|
|
195
195
|
audiences: zod.z.array(nonEmptyStringSchema).optional()
|
|
196
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);
|
|
197
222
|
var retryConfigSchema = zod.z.strictObject({
|
|
223
|
+
...retryOverrideShape,
|
|
198
224
|
enabled: zod.z.boolean().default(true),
|
|
199
225
|
maxAttempts: zod.z.number().int().min(1).default(3),
|
|
200
226
|
retryDelayMs: zod.z.number().nonnegative().default(150),
|
|
201
227
|
maxDelayMs: zod.z.number().nonnegative().default(5e3),
|
|
202
228
|
jitterMs: zod.z.number().nonnegative().default(50),
|
|
203
229
|
backoffFactor: zod.z.number().positive().default(2),
|
|
204
|
-
statusCodes: zod.z.array(zod.z.number().int().min(100).max(599)).optional(),
|
|
205
230
|
methods: zod.z.array(nonEmptyStringSchema).default(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]),
|
|
206
|
-
statusCodeProfile: zod.z.enum(["legacy", "recommended"]).optional(),
|
|
207
231
|
maxRetryAfterDelayMs: zod.z.number().nonnegative().default(6e4)
|
|
208
|
-
}).superRefine(
|
|
209
|
-
if (maxDelayMs < retryDelayMs) {
|
|
210
|
-
context.addIssue({
|
|
211
|
-
code: "custom",
|
|
212
|
-
message: "maxDelayMs must be greater than or equal to retryDelayMs",
|
|
213
|
-
path: ["maxDelayMs"]
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
});
|
|
232
|
+
}).superRefine(validateRetryDelays);
|
|
217
233
|
var constructorParameterSchema = zod.z.strictObject({
|
|
218
234
|
name: nonEmptyStringSchema,
|
|
219
235
|
example: zod.z.string().optional(),
|
|
@@ -235,12 +251,12 @@ var tokenRefreshConfigSchema = zod.z.strictObject({
|
|
|
235
251
|
});
|
|
236
252
|
}
|
|
237
253
|
});
|
|
238
|
-
var
|
|
239
|
-
retry:
|
|
240
|
-
responseHeaders: zod.z.boolean().
|
|
254
|
+
var clientOverrideShape = {
|
|
255
|
+
retry: clientRetryOverrideSchema.optional(),
|
|
256
|
+
responseHeaders: zod.z.boolean().optional(),
|
|
241
257
|
responseValidation: zod.z.boolean().optional(),
|
|
242
|
-
multiTenant: zod.z.boolean().
|
|
243
|
-
additionalConstructorParameters: zod.z.array(constructorParameterSchema).
|
|
258
|
+
multiTenant: zod.z.boolean().optional(),
|
|
259
|
+
additionalConstructorParameters: zod.z.array(constructorParameterSchema).optional(),
|
|
244
260
|
timeoutMs: zod.z.union([zod.z.number().nonnegative(), zod.z.literal("infinity")]).optional(),
|
|
245
261
|
requestParameterStyle: parameterStyleSchema.optional(),
|
|
246
262
|
pathParameterStyle: parameterStyleSchema.optional(),
|
|
@@ -248,6 +264,14 @@ var clientConfigSchema = zod.z.strictObject({
|
|
|
248
264
|
useDefaultRequestParameterValues: zod.z.boolean().optional(),
|
|
249
265
|
respectOptionalRequestBody: zod.z.boolean().optional(),
|
|
250
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([])
|
|
251
275
|
});
|
|
252
276
|
var unsupportedFieldSchema = zod.z.strictObject({
|
|
253
277
|
source: zod.z.enum(["fern", "postman", "sdk-config-ir"]),
|
|
@@ -317,6 +341,18 @@ var docsConfigSchema = zod.z.strictObject({
|
|
|
317
341
|
referenceBaseUrl: nonEmptyStringSchema.optional(),
|
|
318
342
|
includeApiReference: zod.z.boolean().optional()
|
|
319
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
|
+
});
|
|
320
356
|
var cliGenerationConfigSchema = zod.z.strictObject({
|
|
321
357
|
paginationParameters: zod.z.array(nonEmptyStringSchema).optional(),
|
|
322
358
|
skills: zod.z.boolean().optional()
|
|
@@ -378,6 +414,8 @@ var typescriptGenerationConfigSchema = zod.z.strictObject({
|
|
|
378
414
|
namingStrategy: zod.z.enum(["base", "originalPropertyNames"]).optional(),
|
|
379
415
|
bundle: zod.z.boolean().optional(),
|
|
380
416
|
exportClassDefault: zod.z.boolean().optional(),
|
|
417
|
+
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
418
|
+
namespaceExportName: nonEmptyStringSchema.optional(),
|
|
381
419
|
allowCustomFetcher: zod.z.boolean().optional(),
|
|
382
420
|
useBrandedStringAliases: zod.z.boolean().optional(),
|
|
383
421
|
useLegacyExports: zod.z.boolean().optional(),
|
|
@@ -628,14 +666,6 @@ var streamsSchema = zod.z.strictObject({
|
|
|
628
666
|
fileResponseType: zod.z.enum(["stream", "binary-response"]).optional(),
|
|
629
667
|
defaultChunkSizeBytes: zod.z.number().int().positive().optional()
|
|
630
668
|
});
|
|
631
|
-
var namingConfigSchema = zod.z.strictObject({
|
|
632
|
-
clientName: nonEmptyStringSchema.optional(),
|
|
633
|
-
exportedClientName: nonEmptyStringSchema.optional(),
|
|
634
|
-
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
635
|
-
apiErrorName: nonEmptyStringSchema.optional(),
|
|
636
|
-
baseErrorName: nonEmptyStringSchema.optional(),
|
|
637
|
-
pagerName: nonEmptyStringSchema.optional()
|
|
638
|
-
});
|
|
639
669
|
var layoutConfigSchema = zod.z.strictObject({
|
|
640
670
|
outputDirectory: zod.z.enum(["project-root", "source-root"]).optional(),
|
|
641
671
|
packagePath: nonEmptyStringSchema.optional()
|
|
@@ -721,19 +751,74 @@ var commonPublishShape = {
|
|
|
721
751
|
* SDK Config IR; the external publisher or orchestrator resolves this reference before use.
|
|
722
752
|
*/
|
|
723
753
|
credentialsRef: nonEmptyStringSchema.optional(),
|
|
754
|
+
/**
|
|
755
|
+
* Registry-specific package version override. If omitted, the external publisher/orchestrator may
|
|
756
|
+
* fall back to target.sdkVersion.
|
|
757
|
+
*/
|
|
758
|
+
version: nonEmptyStringSchema.optional(),
|
|
724
759
|
releaseBranch: nonEmptyStringSchema.optional(),
|
|
725
|
-
tolerateRepublish: zod.z.boolean().optional()
|
|
760
|
+
tolerateRepublish: zod.z.boolean().optional(),
|
|
761
|
+
/** Generate registry publishing workflow files when publishing through GitHub delivery. */
|
|
762
|
+
shouldGeneratePublishWorkflow: zod.z.boolean().optional()
|
|
726
763
|
};
|
|
764
|
+
var trustedPublishingShape = {
|
|
765
|
+
/** Use registry trusted publishing / OIDC instead of a static token secret. */
|
|
766
|
+
trustedPublishing: zod.z.boolean().optional()
|
|
767
|
+
};
|
|
768
|
+
var mavenCoordinateSchema = nonEmptyStringSchema.regex(
|
|
769
|
+
/^[A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+$/,
|
|
770
|
+
"Maven coordinate must be in groupId:artifactId form"
|
|
771
|
+
);
|
|
772
|
+
var mavenSignatureEnvironmentSchema = zod.z.strictObject({
|
|
773
|
+
keyIdEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
774
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
775
|
+
secretKeyEnvironmentVariable: nonEmptyStringSchema.optional()
|
|
776
|
+
});
|
|
727
777
|
var publishConfigSchema = zod.z.discriminatedUnion("registry", [
|
|
728
|
-
zod.z.strictObject({
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
778
|
+
zod.z.strictObject({
|
|
779
|
+
registry: zod.z.literal("npm"),
|
|
780
|
+
/** Environment variable name containing the npm registry token. */
|
|
781
|
+
tokenEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
782
|
+
/** Write npm package metadata as private when the publisher creates/updates package.json. */
|
|
783
|
+
isPackagePrivate: zod.z.boolean().optional(),
|
|
784
|
+
/** Also publish the TypeScript package to JSR from the npm publishing path. */
|
|
785
|
+
publishToJsr: zod.z.boolean().optional(),
|
|
786
|
+
...trustedPublishingShape,
|
|
787
|
+
...commonPublishShape
|
|
788
|
+
}),
|
|
789
|
+
zod.z.strictObject({
|
|
790
|
+
registry: zod.z.literal("pypi"),
|
|
791
|
+
usernameEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
792
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
793
|
+
...trustedPublishingShape,
|
|
794
|
+
...commonPublishShape
|
|
795
|
+
}),
|
|
796
|
+
zod.z.strictObject({
|
|
797
|
+
registry: zod.z.literal("nuget"),
|
|
798
|
+
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
799
|
+
...trustedPublishingShape,
|
|
800
|
+
...commonPublishShape
|
|
801
|
+
}),
|
|
802
|
+
zod.z.strictObject({
|
|
803
|
+
registry: zod.z.literal("rubygems"),
|
|
804
|
+
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
805
|
+
...commonPublishShape
|
|
806
|
+
}),
|
|
807
|
+
zod.z.strictObject({
|
|
808
|
+
registry: zod.z.literal("crates"),
|
|
809
|
+
tokenEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
810
|
+
...commonPublishShape
|
|
811
|
+
}),
|
|
733
812
|
zod.z.strictObject({ registry: zod.z.literal("go"), ...commonPublishShape }),
|
|
734
813
|
zod.z.strictObject({ registry: zod.z.literal("composer"), ...commonPublishShape }),
|
|
735
814
|
zod.z.strictObject({
|
|
736
815
|
registry: zod.z.literal("maven"),
|
|
816
|
+
/** Maven coordinate in groupId:artifactId form when consumers need the combined value. */
|
|
817
|
+
coordinate: mavenCoordinateSchema.optional(),
|
|
818
|
+
usernameEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
819
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
820
|
+
mavenUrlEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
821
|
+
signatureEnvironmentVariables: mavenSignatureEnvironmentSchema.optional(),
|
|
737
822
|
/**
|
|
738
823
|
* Reference to Maven signing credentials. Raw signing keys are intentionally not part of SDK
|
|
739
824
|
* Config IR; the external publisher or orchestrator resolves this reference before use.
|
|
@@ -823,6 +908,8 @@ var sourceSpecTypeSchema = zod.z.enum([
|
|
|
823
908
|
"asyncapi",
|
|
824
909
|
"graphql"
|
|
825
910
|
]);
|
|
911
|
+
|
|
912
|
+
// src/sdk-config-ir/v1/source.ts
|
|
826
913
|
var sourceSpecConfigSchema = zod.z.strictObject({
|
|
827
914
|
id: nonEmptyStringSchema.optional(),
|
|
828
915
|
name: nonEmptyStringSchema.optional(),
|
|
@@ -994,6 +1081,13 @@ var sdkConfigIrV1Schema = zod.z.strictObject({
|
|
|
994
1081
|
}
|
|
995
1082
|
if (output.publish) {
|
|
996
1083
|
validatePublishingIdentity(packageConfig, output.publish.registry, context);
|
|
1084
|
+
if (output.delivery !== "github" && output.publish.shouldGeneratePublishWorkflow === true) {
|
|
1085
|
+
context.addIssue({
|
|
1086
|
+
code: "custom",
|
|
1087
|
+
message: "output.publish.shouldGeneratePublishWorkflow requires GitHub delivery",
|
|
1088
|
+
path: ["output", "publish", "shouldGeneratePublishWorkflow"]
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
997
1091
|
}
|
|
998
1092
|
if (compatibility?.legacyInput) {
|
|
999
1093
|
const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
|
|
@@ -1016,7 +1110,9 @@ exports.apiImportSettingsSchema = apiImportSettingsSchema;
|
|
|
1016
1110
|
exports.authConfigSchema = authConfigSchema;
|
|
1017
1111
|
exports.authSchemeSchema = authSchemeSchema;
|
|
1018
1112
|
exports.cliGenerationConfigSchema = cliGenerationConfigSchema;
|
|
1113
|
+
exports.clientConfigOverrideSchema = clientConfigOverrideSchema;
|
|
1019
1114
|
exports.clientConfigSchema = clientConfigSchema;
|
|
1115
|
+
exports.clientRetryOverrideSchema = clientRetryOverrideSchema;
|
|
1020
1116
|
exports.compatibilityConfigSchema = compatibilityConfigSchema;
|
|
1021
1117
|
exports.composerPackageNameSchema = composerPackageNameSchema;
|
|
1022
1118
|
exports.csharpGenerationConfigSchema = csharpGenerationConfigSchema;
|