@postman/sdk-config 0.2.0 → 0.3.1
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 +3 -2
- package/dist/index.cjs +82 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +82 -18
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +14 -12
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.js +14 -12
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +14 -12
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +10 -10
- package/dist/sdk-config/v1/index.d.ts +10 -10
- package/dist/sdk-config/v1/index.js +14 -12
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +70 -8
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.js +70 -8
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +70 -8
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +440 -0
- package/dist/sdk-config-ir/v1/index.d.ts +440 -0
- package/dist/sdk-config-ir/v1/index.js +70 -8
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +3 -3
- package/src/sdk-config-ir/v1/README.md +89 -82
package/dist/index.js
CHANGED
|
@@ -277,8 +277,8 @@ var clientConfigSchema = z.strictObject({
|
|
|
277
277
|
var sdkConfigV1ClientConfigSchema = clientConfigSchema;
|
|
278
278
|
var sdkConfigV1ClientConfigOverrideSchema = clientConfigOverrideSchema;
|
|
279
279
|
var goModulePathSchema = relativePathSchema.regex(
|
|
280
|
-
/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)
|
|
281
|
-
"Go module path must
|
|
280
|
+
/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)*$/,
|
|
281
|
+
"Go module path must use letters, numbers, dots, dashes, underscores or tildes, in slash-delimited segments"
|
|
282
282
|
);
|
|
283
283
|
var composerPackageNameSchema = nonEmptyStringSchema.regex(
|
|
284
284
|
/^[a-z0-9]([_.-]?[a-z0-9]+)*\/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$/,
|
|
@@ -543,6 +543,9 @@ function compact(value) {
|
|
|
543
543
|
function optional(key, value) {
|
|
544
544
|
return value === void 0 ? {} : { [key]: value };
|
|
545
545
|
}
|
|
546
|
+
function optionalObject(key, value) {
|
|
547
|
+
return Object.keys(value).length === 0 ? {} : { [key]: value };
|
|
548
|
+
}
|
|
546
549
|
function isObject(value) {
|
|
547
550
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
548
551
|
}
|
|
@@ -1552,12 +1555,12 @@ var sdkConfigV1Schema = z.strictObject({
|
|
|
1552
1555
|
sdkVersion: nonEmptyStringSchema.default("1.0.0"),
|
|
1553
1556
|
apiVersion: nonEmptyStringSchema.optional(),
|
|
1554
1557
|
source: sdkConfigV1SourceConfigSchema,
|
|
1555
|
-
api: sdkConfigV1ApiConfigSchema,
|
|
1556
|
-
client: sdkConfigV1ClientConfigSchema,
|
|
1557
|
-
package: sdkConfigV1PackageConfigSchema,
|
|
1558
|
+
api: sdkConfigV1ApiConfigSchema.prefault({}),
|
|
1559
|
+
client: sdkConfigV1ClientConfigSchema.prefault({}),
|
|
1560
|
+
package: sdkConfigV1PackageConfigSchema.prefault({}),
|
|
1558
1561
|
output: sdkConfigV1OutputConfigSchema.optional(),
|
|
1559
|
-
docs: sdkConfigV1DocsConfigSchema,
|
|
1560
|
-
generation: sdkConfigV1GenerationConfigSchema,
|
|
1562
|
+
docs: sdkConfigV1DocsConfigSchema.prefault({}),
|
|
1563
|
+
generation: sdkConfigV1GenerationConfigSchema.prefault({}),
|
|
1561
1564
|
targets: z.array(sdkConfigV1TargetSchema).min(1)
|
|
1562
1565
|
}).superRefine(({ output, package: globalPackage, targets }, context) => {
|
|
1563
1566
|
const configuredLanguages = /* @__PURE__ */ new Set();
|
|
@@ -1673,11 +1676,10 @@ function mapFernConfigToSdkConfigV1(input) {
|
|
|
1673
1676
|
source: input.source,
|
|
1674
1677
|
...optional("sdkVersion", input.sdkVersion),
|
|
1675
1678
|
...optional("apiVersion", input.apiVersion),
|
|
1676
|
-
api,
|
|
1677
|
-
client
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
generation: generations.shared,
|
|
1679
|
+
...optionalObject("api", api),
|
|
1680
|
+
...optionalObject("client", clients.shared),
|
|
1681
|
+
...optionalObject("docs", docs.shared),
|
|
1682
|
+
...optionalObject("generation", generations.shared),
|
|
1681
1683
|
targets
|
|
1682
1684
|
};
|
|
1683
1685
|
const parsed = sdkConfigV1Schema.safeParse(sdkConfig);
|
|
@@ -2538,19 +2540,74 @@ var commonPublishShape2 = {
|
|
|
2538
2540
|
* SDK Config IR; the external publisher or orchestrator resolves this reference before use.
|
|
2539
2541
|
*/
|
|
2540
2542
|
credentialsRef: nonEmptyStringSchema.optional(),
|
|
2543
|
+
/**
|
|
2544
|
+
* Registry-specific package version override. If omitted, the external publisher/orchestrator may
|
|
2545
|
+
* fall back to target.sdkVersion.
|
|
2546
|
+
*/
|
|
2547
|
+
version: nonEmptyStringSchema.optional(),
|
|
2541
2548
|
releaseBranch: nonEmptyStringSchema.optional(),
|
|
2542
|
-
tolerateRepublish: z.boolean().optional()
|
|
2549
|
+
tolerateRepublish: z.boolean().optional(),
|
|
2550
|
+
/** Generate registry publishing workflow files when publishing through GitHub delivery. */
|
|
2551
|
+
shouldGeneratePublishWorkflow: z.boolean().optional()
|
|
2552
|
+
};
|
|
2553
|
+
var trustedPublishingShape = {
|
|
2554
|
+
/** Use registry trusted publishing / OIDC instead of a static token secret. */
|
|
2555
|
+
trustedPublishing: z.boolean().optional()
|
|
2543
2556
|
};
|
|
2557
|
+
var mavenCoordinateSchema = nonEmptyStringSchema.regex(
|
|
2558
|
+
/^[A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+$/,
|
|
2559
|
+
"Maven coordinate must be in groupId:artifactId form"
|
|
2560
|
+
);
|
|
2561
|
+
var mavenSignatureEnvironmentSchema = z.strictObject({
|
|
2562
|
+
keyIdEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2563
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2564
|
+
secretKeyEnvironmentVariable: nonEmptyStringSchema.optional()
|
|
2565
|
+
});
|
|
2544
2566
|
var publishConfigSchema = z.discriminatedUnion("registry", [
|
|
2545
|
-
z.strictObject({
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2567
|
+
z.strictObject({
|
|
2568
|
+
registry: z.literal("npm"),
|
|
2569
|
+
/** Environment variable name containing the npm registry token. */
|
|
2570
|
+
tokenEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2571
|
+
/** Write npm package metadata as private when the publisher creates/updates package.json. */
|
|
2572
|
+
isPackagePrivate: z.boolean().optional(),
|
|
2573
|
+
/** Also publish the TypeScript package to JSR from the npm publishing path. */
|
|
2574
|
+
publishToJsr: z.boolean().optional(),
|
|
2575
|
+
...trustedPublishingShape,
|
|
2576
|
+
...commonPublishShape2
|
|
2577
|
+
}),
|
|
2578
|
+
z.strictObject({
|
|
2579
|
+
registry: z.literal("pypi"),
|
|
2580
|
+
usernameEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2581
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2582
|
+
...trustedPublishingShape,
|
|
2583
|
+
...commonPublishShape2
|
|
2584
|
+
}),
|
|
2585
|
+
z.strictObject({
|
|
2586
|
+
registry: z.literal("nuget"),
|
|
2587
|
+
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2588
|
+
...trustedPublishingShape,
|
|
2589
|
+
...commonPublishShape2
|
|
2590
|
+
}),
|
|
2591
|
+
z.strictObject({
|
|
2592
|
+
registry: z.literal("rubygems"),
|
|
2593
|
+
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2594
|
+
...commonPublishShape2
|
|
2595
|
+
}),
|
|
2596
|
+
z.strictObject({
|
|
2597
|
+
registry: z.literal("crates"),
|
|
2598
|
+
tokenEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2599
|
+
...commonPublishShape2
|
|
2600
|
+
}),
|
|
2550
2601
|
z.strictObject({ registry: z.literal("go"), ...commonPublishShape2 }),
|
|
2551
2602
|
z.strictObject({ registry: z.literal("composer"), ...commonPublishShape2 }),
|
|
2552
2603
|
z.strictObject({
|
|
2553
2604
|
registry: z.literal("maven"),
|
|
2605
|
+
/** Maven coordinate in groupId:artifactId form when consumers need the combined value. */
|
|
2606
|
+
coordinate: mavenCoordinateSchema.optional(),
|
|
2607
|
+
usernameEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2608
|
+
passwordEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2609
|
+
mavenUrlEnvironmentVariable: nonEmptyStringSchema.optional(),
|
|
2610
|
+
signatureEnvironmentVariables: mavenSignatureEnvironmentSchema.optional(),
|
|
2554
2611
|
/**
|
|
2555
2612
|
* Reference to Maven signing credentials. Raw signing keys are intentionally not part of SDK
|
|
2556
2613
|
* Config IR; the external publisher or orchestrator resolves this reference before use.
|
|
@@ -2790,6 +2847,13 @@ var sdkConfigIrV1Schema = z.strictObject({
|
|
|
2790
2847
|
}
|
|
2791
2848
|
if (output.publish) {
|
|
2792
2849
|
validatePublishingIdentity2(packageConfig, output.publish.registry, context);
|
|
2850
|
+
if (output.delivery !== "github" && output.publish.shouldGeneratePublishWorkflow === true) {
|
|
2851
|
+
context.addIssue({
|
|
2852
|
+
code: "custom",
|
|
2853
|
+
message: "output.publish.shouldGeneratePublishWorkflow requires GitHub delivery",
|
|
2854
|
+
path: ["output", "publish", "shouldGeneratePublishWorkflow"]
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2793
2857
|
}
|
|
2794
2858
|
if (compatibility?.legacyInput) {
|
|
2795
2859
|
const expectedKind = target.sourceOrigin === "postman" ? "postman-build-parameters" : "fern-generator-invocation";
|