@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
|
@@ -188,26 +188,42 @@ var apiConfigSchema = z.strictObject({
|
|
|
188
188
|
*/
|
|
189
189
|
audiences: z.array(nonEmptyStringSchema).optional()
|
|
190
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);
|
|
191
216
|
var retryConfigSchema = z.strictObject({
|
|
217
|
+
...retryOverrideShape,
|
|
192
218
|
enabled: z.boolean().default(true),
|
|
193
219
|
maxAttempts: z.number().int().min(1).default(3),
|
|
194
220
|
retryDelayMs: z.number().nonnegative().default(150),
|
|
195
221
|
maxDelayMs: z.number().nonnegative().default(5e3),
|
|
196
222
|
jitterMs: z.number().nonnegative().default(50),
|
|
197
223
|
backoffFactor: z.number().positive().default(2),
|
|
198
|
-
statusCodes: z.array(z.number().int().min(100).max(599)).optional(),
|
|
199
224
|
methods: z.array(nonEmptyStringSchema).default(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]),
|
|
200
|
-
statusCodeProfile: z.enum(["legacy", "recommended"]).optional(),
|
|
201
225
|
maxRetryAfterDelayMs: z.number().nonnegative().default(6e4)
|
|
202
|
-
}).superRefine(
|
|
203
|
-
if (maxDelayMs < retryDelayMs) {
|
|
204
|
-
context.addIssue({
|
|
205
|
-
code: "custom",
|
|
206
|
-
message: "maxDelayMs must be greater than or equal to retryDelayMs",
|
|
207
|
-
path: ["maxDelayMs"]
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
});
|
|
226
|
+
}).superRefine(validateRetryDelays);
|
|
211
227
|
var constructorParameterSchema = z.strictObject({
|
|
212
228
|
name: nonEmptyStringSchema,
|
|
213
229
|
example: z.string().optional(),
|
|
@@ -229,12 +245,12 @@ var tokenRefreshConfigSchema = z.strictObject({
|
|
|
229
245
|
});
|
|
230
246
|
}
|
|
231
247
|
});
|
|
232
|
-
var
|
|
233
|
-
retry:
|
|
234
|
-
responseHeaders: z.boolean().
|
|
248
|
+
var clientOverrideShape = {
|
|
249
|
+
retry: clientRetryOverrideSchema.optional(),
|
|
250
|
+
responseHeaders: z.boolean().optional(),
|
|
235
251
|
responseValidation: z.boolean().optional(),
|
|
236
|
-
multiTenant: z.boolean().
|
|
237
|
-
additionalConstructorParameters: z.array(constructorParameterSchema).
|
|
252
|
+
multiTenant: z.boolean().optional(),
|
|
253
|
+
additionalConstructorParameters: z.array(constructorParameterSchema).optional(),
|
|
238
254
|
timeoutMs: z.union([z.number().nonnegative(), z.literal("infinity")]).optional(),
|
|
239
255
|
requestParameterStyle: parameterStyleSchema.optional(),
|
|
240
256
|
pathParameterStyle: parameterStyleSchema.optional(),
|
|
@@ -242,6 +258,14 @@ var clientConfigSchema = z.strictObject({
|
|
|
242
258
|
useDefaultRequestParameterValues: z.boolean().optional(),
|
|
243
259
|
respectOptionalRequestBody: z.boolean().optional(),
|
|
244
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([])
|
|
245
269
|
});
|
|
246
270
|
var unsupportedFieldSchema = z.strictObject({
|
|
247
271
|
source: z.enum(["fern", "postman", "sdk-config-ir"]),
|
|
@@ -311,6 +335,18 @@ var docsConfigSchema = z.strictObject({
|
|
|
311
335
|
referenceBaseUrl: nonEmptyStringSchema.optional(),
|
|
312
336
|
includeApiReference: z.boolean().optional()
|
|
313
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
|
+
});
|
|
314
350
|
var cliGenerationConfigSchema = z.strictObject({
|
|
315
351
|
paginationParameters: z.array(nonEmptyStringSchema).optional(),
|
|
316
352
|
skills: z.boolean().optional()
|
|
@@ -372,6 +408,8 @@ var typescriptGenerationConfigSchema = z.strictObject({
|
|
|
372
408
|
namingStrategy: z.enum(["base", "originalPropertyNames"]).optional(),
|
|
373
409
|
bundle: z.boolean().optional(),
|
|
374
410
|
exportClassDefault: z.boolean().optional(),
|
|
411
|
+
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
412
|
+
namespaceExportName: nonEmptyStringSchema.optional(),
|
|
375
413
|
allowCustomFetcher: z.boolean().optional(),
|
|
376
414
|
useBrandedStringAliases: z.boolean().optional(),
|
|
377
415
|
useLegacyExports: z.boolean().optional(),
|
|
@@ -622,14 +660,6 @@ var streamsSchema = z.strictObject({
|
|
|
622
660
|
fileResponseType: z.enum(["stream", "binary-response"]).optional(),
|
|
623
661
|
defaultChunkSizeBytes: z.number().int().positive().optional()
|
|
624
662
|
});
|
|
625
|
-
var namingConfigSchema = z.strictObject({
|
|
626
|
-
clientName: nonEmptyStringSchema.optional(),
|
|
627
|
-
exportedClientName: nonEmptyStringSchema.optional(),
|
|
628
|
-
environmentTypeName: nonEmptyStringSchema.optional(),
|
|
629
|
-
apiErrorName: nonEmptyStringSchema.optional(),
|
|
630
|
-
baseErrorName: nonEmptyStringSchema.optional(),
|
|
631
|
-
pagerName: nonEmptyStringSchema.optional()
|
|
632
|
-
});
|
|
633
663
|
var layoutConfigSchema = z.strictObject({
|
|
634
664
|
outputDirectory: z.enum(["project-root", "source-root"]).optional(),
|
|
635
665
|
packagePath: nonEmptyStringSchema.optional()
|
|
@@ -715,19 +745,74 @@ var commonPublishShape = {
|
|
|
715
745
|
* SDK Config IR; the external publisher or orchestrator resolves this reference before use.
|
|
716
746
|
*/
|
|
717
747
|
credentialsRef: nonEmptyStringSchema.optional(),
|
|
748
|
+
/**
|
|
749
|
+
* Registry-specific package version override. If omitted, the external publisher/orchestrator may
|
|
750
|
+
* fall back to target.sdkVersion.
|
|
751
|
+
*/
|
|
752
|
+
version: nonEmptyStringSchema.optional(),
|
|
718
753
|
releaseBranch: nonEmptyStringSchema.optional(),
|
|
719
|
-
tolerateRepublish: z.boolean().optional()
|
|
754
|
+
tolerateRepublish: z.boolean().optional(),
|
|
755
|
+
/** Generate registry publishing workflow files when publishing through GitHub delivery. */
|
|
756
|
+
shouldGeneratePublishWorkflow: z.boolean().optional()
|
|
720
757
|
};
|
|
758
|
+
var trustedPublishingShape = {
|
|
759
|
+
/** Use registry trusted publishing / OIDC instead of a static token secret. */
|
|
760
|
+
trustedPublishing: z.boolean().optional()
|
|
761
|
+
};
|
|
762
|
+
var mavenCoordinateSchema = nonEmptyStringSchema.regex(
|
|
763
|
+
/^[A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+$/,
|
|
764
|
+
"Maven coordinate must be in groupId:artifactId form"
|
|
765
|
+
);
|
|
766
|
+
var mavenSignatureEnvironmentSchema = z.strictObject({
|
|
767
|
+
keyIdEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
768
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
769
|
+
secretKeyEnvironmentVariable: nonEmptyStringSchema.optional()
|
|
770
|
+
});
|
|
721
771
|
var publishConfigSchema = z.discriminatedUnion("registry", [
|
|
722
|
-
z.strictObject({
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
772
|
+
z.strictObject({
|
|
773
|
+
registry: z.literal("npm"),
|
|
774
|
+
/** Environment variable name containing the npm registry token. */
|
|
775
|
+
tokenEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
776
|
+
/** Write npm package metadata as private when the publisher creates/updates package.json. */
|
|
777
|
+
isPackagePrivate: z.boolean().optional(),
|
|
778
|
+
/** Also publish the TypeScript package to JSR from the npm publishing path. */
|
|
779
|
+
publishToJsr: z.boolean().optional(),
|
|
780
|
+
...trustedPublishingShape,
|
|
781
|
+
...commonPublishShape
|
|
782
|
+
}),
|
|
783
|
+
z.strictObject({
|
|
784
|
+
registry: z.literal("pypi"),
|
|
785
|
+
usernameEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
786
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
787
|
+
...trustedPublishingShape,
|
|
788
|
+
...commonPublishShape
|
|
789
|
+
}),
|
|
790
|
+
z.strictObject({
|
|
791
|
+
registry: z.literal("nuget"),
|
|
792
|
+
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
793
|
+
...trustedPublishingShape,
|
|
794
|
+
...commonPublishShape
|
|
795
|
+
}),
|
|
796
|
+
z.strictObject({
|
|
797
|
+
registry: z.literal("rubygems"),
|
|
798
|
+
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
799
|
+
...commonPublishShape
|
|
800
|
+
}),
|
|
801
|
+
z.strictObject({
|
|
802
|
+
registry: z.literal("crates"),
|
|
803
|
+
tokenEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
804
|
+
...commonPublishShape
|
|
805
|
+
}),
|
|
727
806
|
z.strictObject({ registry: z.literal("go"), ...commonPublishShape }),
|
|
728
807
|
z.strictObject({ registry: z.literal("composer"), ...commonPublishShape }),
|
|
729
808
|
z.strictObject({
|
|
730
809
|
registry: z.literal("maven"),
|
|
810
|
+
/** Maven coordinate in groupId:artifactId form when consumers need the combined value. */
|
|
811
|
+
coordinate: mavenCoordinateSchema.optional(),
|
|
812
|
+
usernameEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
813
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
814
|
+
mavenUrlEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
815
|
+
signatureEnvironmentVariables: mavenSignatureEnvironmentSchema.optional(),
|
|
731
816
|
/**
|
|
732
817
|
* Reference to Maven signing credentials. Raw signing keys are intentionally not part of SDK
|
|
733
818
|
* Config IR; the external publisher or orchestrator resolves this reference before use.
|
|
@@ -817,6 +902,8 @@ var sourceSpecTypeSchema = z.enum([
|
|
|
817
902
|
"asyncapi",
|
|
818
903
|
"graphql"
|
|
819
904
|
]);
|
|
905
|
+
|
|
906
|
+
// src/sdk-config-ir/v1/source.ts
|
|
820
907
|
var sourceSpecConfigSchema = z.strictObject({
|
|
821
908
|
id: nonEmptyStringSchema.optional(),
|
|
822
909
|
name: nonEmptyStringSchema.optional(),
|
|
@@ -988,6 +1075,13 @@ var sdkConfigIrV1Schema = z.strictObject({
|
|
|
988
1075
|
}
|
|
989
1076
|
if (output.publish) {
|
|
990
1077
|
validatePublishingIdentity(packageConfig, output.publish.registry, context);
|
|
1078
|
+
if (output.delivery !== "github" && output.publish.shouldGeneratePublishWorkflow === true) {
|
|
1079
|
+
context.addIssue({
|
|
1080
|
+
code: "custom",
|
|
1081
|
+
message: "output.publish.shouldGeneratePublishWorkflow requires GitHub delivery",
|
|
1082
|
+
path: ["output", "publish", "shouldGeneratePublishWorkflow"]
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
991
1085
|
}
|
|
992
1086
|
if (compatibility?.legacyInput) {
|
|
993
1087
|
const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
|
|
@@ -1004,6 +1098,6 @@ function parseSdkConfigIrV1(value) {
|
|
|
1004
1098
|
return sdkConfigIrV1Schema.parse(value);
|
|
1005
1099
|
}
|
|
1006
1100
|
|
|
1007
|
-
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, relativePathSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrV1Schema, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema };
|
|
1101
|
+
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 };
|
|
1008
1102
|
//# sourceMappingURL=index.js.map
|
|
1009
1103
|
//# sourceMappingURL=index.js.map
|