@postman/sdk-config 0.15.0 → 0.17.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/dist/index.cjs +83 -19
- 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 +78 -20
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +71 -19
- 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 +68 -20
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +71 -19
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +230 -22
- package/dist/sdk-config/v1/index.d.ts +230 -22
- package/dist/sdk-config/v1/index.js +68 -20
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +21 -2
- 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 +20 -3
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +21 -2
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +34 -3
- package/dist/sdk-config-ir/v1/index.d.ts +34 -3
- package/dist/sdk-config-ir/v1/index.js +20 -3
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-sGNHFomT.d.cts → typescript-D0YeGxxS.d.cts} +11 -1
- package/dist/{typescript-sGNHFomT.d.ts → typescript-D0YeGxxS.d.ts} +11 -1
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +31 -0
- package/src/sdk-config-ir/v1/README.md +7 -0
package/dist/index.cjs
CHANGED
|
@@ -13,6 +13,10 @@ var relativePathSchema = nonEmptyStringSchema.refine(
|
|
|
13
13
|
(value) => !/^(?:[\\/]|[A-Za-z]:)/.test(value) && !value.split(/[\\/]/).some((segment) => segment === ".."),
|
|
14
14
|
{ message: "must be a relative path without parent directory segments" }
|
|
15
15
|
);
|
|
16
|
+
var parentRelativePathSchema = nonEmptyStringSchema.refine(
|
|
17
|
+
(value) => !/^(?:[\\/]|[A-Za-z]:)/.test(value),
|
|
18
|
+
{ message: "must be a relative path" }
|
|
19
|
+
);
|
|
16
20
|
var exactSemverSchema = zod.z.string().refine(
|
|
17
21
|
(value) => {
|
|
18
22
|
if (value.trim() !== value || !/^\d/.test(value)) {
|
|
@@ -2500,7 +2504,8 @@ var apiImportSettingsSchema = zod.z.strictObject({
|
|
|
2500
2504
|
),
|
|
2501
2505
|
resolveSchemaCollisions: zod.z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
|
|
2502
2506
|
asyncApiMessageNaming: zod.z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
|
|
2503
|
-
defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one.")
|
|
2507
|
+
defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one."),
|
|
2508
|
+
respectByteFormat: zod.z.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes.")
|
|
2504
2509
|
});
|
|
2505
2510
|
var sourceSpecTypeSchema = zod.z.enum([
|
|
2506
2511
|
"openapi",
|
|
@@ -2511,28 +2516,66 @@ var sourceSpecTypeSchema = zod.z.enum([
|
|
|
2511
2516
|
]);
|
|
2512
2517
|
|
|
2513
2518
|
// src/sdk-config/v1/source.ts
|
|
2514
|
-
var
|
|
2519
|
+
var commonSourceSpecShape = {
|
|
2515
2520
|
id: nonEmptyStringSchema.describe("A unique identifier for this API source."),
|
|
2516
|
-
type: sourceSpecTypeSchema.describe("The API description format of this source."),
|
|
2517
2521
|
name: nonEmptyStringSchema.optional().describe("A human-readable name for this API source."),
|
|
2518
2522
|
namespace: nonEmptyStringSchema.optional().describe("A namespace used to isolate this source in a multi-source SDK."),
|
|
2519
|
-
apiImportSettings: apiImportSettingsSchema.optional().describe("Import behavior that overrides the source-level defaults for this spec.")
|
|
2523
|
+
apiImportSettings: apiImportSettingsSchema.optional().describe("Import behavior that overrides the source-level defaults for this spec.")
|
|
2524
|
+
};
|
|
2525
|
+
var sourceSpecShape = {
|
|
2526
|
+
...commonSourceSpecShape,
|
|
2527
|
+
type: sourceSpecTypeSchema.describe("The API description format of this source."),
|
|
2520
2528
|
overlays: zod.z.array(relativePathSchema).optional().describe("Relative paths to overlays applied to this source in order."),
|
|
2521
2529
|
overrides: zod.z.array(relativePathSchema).optional().describe("Relative paths to source override files applied in order.")
|
|
2522
2530
|
};
|
|
2523
|
-
var
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2531
|
+
var sdkConfigV1GitRemoteSchema = zod.z.strictObject({
|
|
2532
|
+
repo: nonEmptyStringSchema.describe("The git repository URL."),
|
|
2533
|
+
ref: nonEmptyStringSchema.optional().describe("The branch, tag, or commit SHA. Defaults to the repository's default branch."),
|
|
2534
|
+
path: relativePathSchema.describe("The path to the directory within the repository.")
|
|
2535
|
+
});
|
|
2536
|
+
var sdkConfigV1ProtobufRootSchema = zod.z.union([
|
|
2537
|
+
parentRelativePathSchema.describe("The relative path to the .proto directory root."),
|
|
2538
|
+
zod.z.strictObject({
|
|
2539
|
+
git: sdkConfigV1GitRemoteSchema.describe("The git remote holding the .proto files.")
|
|
2540
|
+
}).describe("A .proto directory root in a remote git repository.")
|
|
2541
|
+
]);
|
|
2542
|
+
var sdkConfigV1ProtobufSourceSchema = zod.z.strictObject({
|
|
2543
|
+
root: sdkConfigV1ProtobufRootSchema.describe(
|
|
2544
|
+
"The .proto directory root, as a relative path or a git remote."
|
|
2545
|
+
),
|
|
2546
|
+
target: parentRelativePathSchema.optional().describe("The relative path to the single .proto file that defines the API."),
|
|
2547
|
+
overrides: zod.z.array(parentRelativePathSchema).optional().describe("Relative paths to override files applied to the converted API in order."),
|
|
2548
|
+
dependencies: zod.z.array(nonEmptyStringSchema).optional().describe("Buf Schema Registry modules the .proto files depend on."),
|
|
2549
|
+
localGeneration: zod.z.boolean().optional().describe("Whether the .proto files are compiled locally instead of remotely."),
|
|
2550
|
+
fromOpenApi: zod.z.boolean().default(false).describe("Whether SDKs are generated from the OpenAPI converted from the .proto files.")
|
|
2551
|
+
});
|
|
2552
|
+
var sourceSpecOptions = [
|
|
2553
|
+
zod.z.strictObject({
|
|
2554
|
+
...sourceSpecShape,
|
|
2555
|
+
path: relativePathSchema.describe("The relative path to the API source file.")
|
|
2556
|
+
}),
|
|
2557
|
+
zod.z.strictObject({
|
|
2558
|
+
...sourceSpecShape,
|
|
2559
|
+
url: zod.z.url({ protocol: /^https?$/ }).describe("The HTTP or HTTPS URL of the API source file.")
|
|
2560
|
+
}),
|
|
2561
|
+
zod.z.strictObject({
|
|
2562
|
+
...commonSourceSpecShape,
|
|
2563
|
+
proto: sdkConfigV1ProtobufSourceSchema.describe("The protobuf definitions of this source.")
|
|
2564
|
+
})
|
|
2565
|
+
];
|
|
2566
|
+
var protobufSourceSpecOptionIndex = 2;
|
|
2567
|
+
function hasProtoLocator(input) {
|
|
2568
|
+
return typeof input === "object" && input !== null && "proto" in input;
|
|
2569
|
+
}
|
|
2570
|
+
var sdkConfigV1SourceSpecSchema = zod.z.union(sourceSpecOptions, {
|
|
2571
|
+
error: (issue) => {
|
|
2572
|
+
if (issue.code !== "invalid_union" || !hasProtoLocator(issue.input)) {
|
|
2573
|
+
return "source spec must contain exactly one locator: path, HTTP(S) url, or proto";
|
|
2574
|
+
}
|
|
2575
|
+
const details = (issue.errors[protobufSourceSpecOptionIndex] ?? []).map(({ path, message }) => path.length ? `${path.join(".")}: ${message}` : message).join("; ");
|
|
2576
|
+
return `protobuf source spec is invalid: ${details}`;
|
|
2577
|
+
}
|
|
2578
|
+
});
|
|
2536
2579
|
var sdkConfigV1SourceConfigSchema = zod.z.strictObject({
|
|
2537
2580
|
specs: zod.z.array(sdkConfigV1SourceSpecSchema).min(1, "source.specs must contain at least one source spec").describe("API source files in authoritative processing order."),
|
|
2538
2581
|
apiImportSettings: apiImportSettingsSchema.optional().describe("Default import behavior shared by every source spec.")
|
|
@@ -2566,7 +2609,9 @@ var goGenerationConfigSchema = zod.z.strictObject({
|
|
|
2566
2609
|
/** Overrides the fern root-client constructor independently from the client type name. */
|
|
2567
2610
|
clientConstructorName: nonEmptyStringSchema.optional().describe("The generated root-client constructor name."),
|
|
2568
2611
|
unionVersion: zod.z.enum(["v0", "v1"]).optional().describe("The representation used for generated Go unions."),
|
|
2569
|
-
includeLegacyClientOptions: zod.z.boolean().optional().describe("Whether the client retains legacy constructor option helpers.")
|
|
2612
|
+
includeLegacyClientOptions: zod.z.boolean().optional().describe("Whether the client retains legacy constructor option helpers."),
|
|
2613
|
+
/** `root` keeps Fern's layout; `types` moves the schema types into a `types` subpackage. */
|
|
2614
|
+
packageLayout: zod.z.enum(["root", "types"]).optional().describe("Where the generated Go schema types are declared.")
|
|
2570
2615
|
});
|
|
2571
2616
|
var jvmGenerationConfigSchema = zod.z.strictObject({
|
|
2572
2617
|
packageLayout: zod.z.enum(["flat", "nested"]).optional().describe("Whether generated JVM packages use a flat or nested resource layout."),
|
|
@@ -3739,7 +3784,10 @@ function mapGo(config, state, packageConfig, basePath) {
|
|
|
3739
3784
|
state,
|
|
3740
3785
|
basePath
|
|
3741
3786
|
),
|
|
3742
|
-
clientConstructorName: takeString(config, ["clientConstructorName"], state, basePath)
|
|
3787
|
+
clientConstructorName: takeString(config, ["clientConstructorName"], state, basePath),
|
|
3788
|
+
// One alias covers every spelling: `locate` compares through `normalizeKey`, which strips `-`
|
|
3789
|
+
// and `_` and lowercases, so `package-layout` in generators.yml matches too.
|
|
3790
|
+
packageLayout: takeEnum(config, ["packageLayout"], ["root", "types"], state, basePath)
|
|
3743
3791
|
});
|
|
3744
3792
|
}
|
|
3745
3793
|
function mapCsharp(config, state, packageConfig, basePath) {
|
|
@@ -4619,6 +4667,7 @@ var outputConfigSchema = zod.z.discriminatedUnion(
|
|
|
4619
4667
|
var replayConfigSchema = zod.z.strictObject({
|
|
4620
4668
|
enabled: zod.z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
|
|
4621
4669
|
});
|
|
4670
|
+
var sourceSpecOriginSchema = zod.z.enum(["protobuf"]);
|
|
4622
4671
|
var sourceSpecConfigSchema = zod.z.strictObject({
|
|
4623
4672
|
id: nonEmptyStringSchema.optional().describe("A unique identifier for this API source."),
|
|
4624
4673
|
name: nonEmptyStringSchema.optional().describe("A human-readable name for this API source."),
|
|
@@ -4627,9 +4676,18 @@ var sourceSpecConfigSchema = zod.z.strictObject({
|
|
|
4627
4676
|
"The materialized URL from which the generator retrieves the API source."
|
|
4628
4677
|
),
|
|
4629
4678
|
specType: sourceSpecTypeSchema.describe("The API description format of this source."),
|
|
4679
|
+
origin: sourceSpecOriginSchema.optional().describe("The format this source was authored in before it was converted to specType."),
|
|
4630
4680
|
apiImportSettings: apiImportSettingsSchema.optional().describe("Import behavior that overrides the source-level defaults for this spec."),
|
|
4631
4681
|
overlays: zod.z.array(nonEmptyStringSchema).optional().describe("Materialized overlays applied to this source in order."),
|
|
4632
4682
|
overrides: zod.z.array(nonEmptyStringSchema).optional().describe("Materialized source overrides applied in order.")
|
|
4683
|
+
}).superRefine(({ specType, origin }, context) => {
|
|
4684
|
+
if (origin === "protobuf" && specType !== "openapi") {
|
|
4685
|
+
context.addIssue({
|
|
4686
|
+
code: "custom",
|
|
4687
|
+
message: 'origin "protobuf" is only allowed on openapi specs',
|
|
4688
|
+
path: ["origin"]
|
|
4689
|
+
});
|
|
4690
|
+
}
|
|
4633
4691
|
});
|
|
4634
4692
|
var sourceConfigSchema = zod.z.strictObject({
|
|
4635
4693
|
specs: zod.z.array(sourceSpecConfigSchema).min(1, "source.specs must contain at least one source spec").describe("Materialized API sources in authoritative processing order."),
|
|
@@ -4910,6 +4968,7 @@ exports.mcpGenerationConfigSchema = mcpGenerationConfigSchema;
|
|
|
4910
4968
|
exports.nonEmptyStringSchema = nonEmptyStringSchema;
|
|
4911
4969
|
exports.outputConfigSchema = outputConfigSchema;
|
|
4912
4970
|
exports.packageConfigSchema = packageConfigSchema;
|
|
4971
|
+
exports.parentRelativePathSchema = parentRelativePathSchema;
|
|
4913
4972
|
exports.parseSdkConfigIrV1 = parseSdkConfigIrV1;
|
|
4914
4973
|
exports.parseSdkConfigIrV1ForConsumption = parseSdkConfigIrV1ForConsumption;
|
|
4915
4974
|
exports.parseSdkConfigV1 = parseSdkConfigV1;
|
|
@@ -4944,6 +5003,7 @@ exports.sdkConfigV1DocsConfigSchema = sdkConfigV1DocsConfigSchema;
|
|
|
4944
5003
|
exports.sdkConfigV1ExactSemverSchema = exactSemverSchema;
|
|
4945
5004
|
exports.sdkConfigV1GenerationConfigOverrideSchema = sdkConfigV1GenerationConfigOverrideSchema;
|
|
4946
5005
|
exports.sdkConfigV1GenerationConfigSchema = sdkConfigV1GenerationConfigSchema;
|
|
5006
|
+
exports.sdkConfigV1GitRemoteSchema = sdkConfigV1GitRemoteSchema;
|
|
4947
5007
|
exports.sdkConfigV1GithubActionsSecretNameSchema = githubActionsSecretNameSchema;
|
|
4948
5008
|
exports.sdkConfigV1GoGenerationConfigSchema = goGenerationConfigSchema;
|
|
4949
5009
|
exports.sdkConfigV1GoModulePathSchema = goModulePathSchema;
|
|
@@ -4953,7 +5013,10 @@ exports.sdkConfigV1McpGenerationConfigSchema = mcpGenerationConfigSchema;
|
|
|
4953
5013
|
exports.sdkConfigV1NonEmptyStringSchema = nonEmptyStringSchema;
|
|
4954
5014
|
exports.sdkConfigV1OutputConfigSchema = sdkConfigV1OutputConfigSchema;
|
|
4955
5015
|
exports.sdkConfigV1PackageConfigSchema = sdkConfigV1PackageConfigSchema;
|
|
5016
|
+
exports.sdkConfigV1ParentRelativePathSchema = parentRelativePathSchema;
|
|
4956
5017
|
exports.sdkConfigV1PhpGenerationConfigSchema = phpGenerationConfigSchema;
|
|
5018
|
+
exports.sdkConfigV1ProtobufRootSchema = sdkConfigV1ProtobufRootSchema;
|
|
5019
|
+
exports.sdkConfigV1ProtobufSourceSchema = sdkConfigV1ProtobufSourceSchema;
|
|
4957
5020
|
exports.sdkConfigV1PublishConfigSchema = sdkConfigV1PublishConfigSchema;
|
|
4958
5021
|
exports.sdkConfigV1PublishRegistrySchema = sdkConfigV1PublishRegistrySchema;
|
|
4959
5022
|
exports.sdkConfigV1PythonGenerationConfigSchema = pythonGenerationConfigSchema;
|
|
@@ -4974,6 +5037,7 @@ exports.sdkConfigV1WebhookSignatureSchema = sdkConfigV1WebhookSignatureSchema;
|
|
|
4974
5037
|
exports.serializeSdkConfigIrV1 = serializeSdkConfigIrV1;
|
|
4975
5038
|
exports.sourceConfigSchema = sourceConfigSchema;
|
|
4976
5039
|
exports.sourceSpecConfigSchema = sourceSpecConfigSchema;
|
|
5040
|
+
exports.sourceSpecOriginSchema = sourceSpecOriginSchema;
|
|
4977
5041
|
exports.sourceSpecTypeSchema = sourceSpecTypeSchema;
|
|
4978
5042
|
exports.splitSdkConfigV1TargetGeneration = splitSdkConfigV1TargetGeneration;
|
|
4979
5043
|
exports.swiftGenerationConfigSchema = swiftGenerationConfigSchema;
|