@postman/sdk-config 0.16.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.
Files changed (35) hide show
  1. package/dist/index.cjs +76 -17
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +3 -3
  4. package/dist/index.d.ts +3 -3
  5. package/dist/index.js +71 -18
  6. package/dist/index.js.map +1 -1
  7. package/dist/sdk-config/index.cjs +64 -17
  8. package/dist/sdk-config/index.cjs.map +1 -1
  9. package/dist/sdk-config/index.d.cts +2 -2
  10. package/dist/sdk-config/index.d.ts +2 -2
  11. package/dist/sdk-config/index.js +61 -18
  12. package/dist/sdk-config/index.js.map +1 -1
  13. package/dist/sdk-config/v1/index.cjs +64 -17
  14. package/dist/sdk-config/v1/index.cjs.map +1 -1
  15. package/dist/sdk-config/v1/index.d.cts +222 -22
  16. package/dist/sdk-config/v1/index.d.ts +222 -22
  17. package/dist/sdk-config/v1/index.js +61 -18
  18. package/dist/sdk-config/v1/index.js.map +1 -1
  19. package/dist/sdk-config-ir/index.cjs +18 -1
  20. package/dist/sdk-config-ir/index.cjs.map +1 -1
  21. package/dist/sdk-config-ir/index.d.cts +2 -2
  22. package/dist/sdk-config-ir/index.d.ts +2 -2
  23. package/dist/sdk-config-ir/index.js +17 -2
  24. package/dist/sdk-config-ir/index.js.map +1 -1
  25. package/dist/sdk-config-ir/v1/index.cjs +18 -1
  26. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  27. package/dist/sdk-config-ir/v1/index.d.cts +22 -3
  28. package/dist/sdk-config-ir/v1/index.d.ts +22 -3
  29. package/dist/sdk-config-ir/v1/index.js +17 -2
  30. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  31. package/dist/{typescript-Cc50beVo.d.cts → typescript-D0YeGxxS.d.cts} +6 -1
  32. package/dist/{typescript-Cc50beVo.d.ts → typescript-D0YeGxxS.d.ts} +6 -1
  33. package/package.json +1 -1
  34. package/src/sdk-config/v1/README.md +31 -0
  35. package/src/sdk-config-ir/v1/README.md +7 -0
@@ -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)) {
@@ -2488,7 +2492,8 @@ var apiImportSettingsSchema = zod.z.strictObject({
2488
2492
  ),
2489
2493
  resolveSchemaCollisions: zod.z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
2490
2494
  asyncApiMessageNaming: zod.z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
2491
- defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one.")
2495
+ defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one."),
2496
+ respectByteFormat: zod.z.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes.")
2492
2497
  });
2493
2498
  var sourceSpecTypeSchema = zod.z.enum([
2494
2499
  "openapi",
@@ -2499,28 +2504,66 @@ var sourceSpecTypeSchema = zod.z.enum([
2499
2504
  ]);
2500
2505
 
2501
2506
  // src/sdk-config/v1/source.ts
2502
- var sourceSpecShape = {
2507
+ var commonSourceSpecShape = {
2503
2508
  id: nonEmptyStringSchema.describe("A unique identifier for this API source."),
2504
- type: sourceSpecTypeSchema.describe("The API description format of this source."),
2505
2509
  name: nonEmptyStringSchema.optional().describe("A human-readable name for this API source."),
2506
2510
  namespace: nonEmptyStringSchema.optional().describe("A namespace used to isolate this source in a multi-source SDK."),
2507
- apiImportSettings: apiImportSettingsSchema.optional().describe("Import behavior that overrides the source-level defaults for this spec."),
2511
+ apiImportSettings: apiImportSettingsSchema.optional().describe("Import behavior that overrides the source-level defaults for this spec.")
2512
+ };
2513
+ var sourceSpecShape = {
2514
+ ...commonSourceSpecShape,
2515
+ type: sourceSpecTypeSchema.describe("The API description format of this source."),
2508
2516
  overlays: zod.z.array(relativePathSchema).optional().describe("Relative paths to overlays applied to this source in order."),
2509
2517
  overrides: zod.z.array(relativePathSchema).optional().describe("Relative paths to source override files applied in order.")
2510
2518
  };
2511
- var sdkConfigV1SourceSpecSchema = zod.z.union(
2512
- [
2513
- zod.z.strictObject({
2514
- ...sourceSpecShape,
2515
- path: relativePathSchema.describe("The relative path to the API source file.")
2516
- }),
2517
- zod.z.strictObject({
2518
- ...sourceSpecShape,
2519
- url: zod.z.url({ protocol: /^https?$/ }).describe("The HTTP or HTTPS URL of the API source file.")
2520
- })
2521
- ],
2522
- { error: "source spec must contain exactly one locator: path or HTTP(S) url" }
2523
- );
2519
+ var sdkConfigV1GitRemoteSchema = zod.z.strictObject({
2520
+ repo: nonEmptyStringSchema.describe("The git repository URL."),
2521
+ ref: nonEmptyStringSchema.optional().describe("The branch, tag, or commit SHA. Defaults to the repository's default branch."),
2522
+ path: relativePathSchema.describe("The path to the directory within the repository.")
2523
+ });
2524
+ var sdkConfigV1ProtobufRootSchema = zod.z.union([
2525
+ parentRelativePathSchema.describe("The relative path to the .proto directory root."),
2526
+ zod.z.strictObject({
2527
+ git: sdkConfigV1GitRemoteSchema.describe("The git remote holding the .proto files.")
2528
+ }).describe("A .proto directory root in a remote git repository.")
2529
+ ]);
2530
+ var sdkConfigV1ProtobufSourceSchema = zod.z.strictObject({
2531
+ root: sdkConfigV1ProtobufRootSchema.describe(
2532
+ "The .proto directory root, as a relative path or a git remote."
2533
+ ),
2534
+ target: parentRelativePathSchema.optional().describe("The relative path to the single .proto file that defines the API."),
2535
+ overrides: zod.z.array(parentRelativePathSchema).optional().describe("Relative paths to override files applied to the converted API in order."),
2536
+ dependencies: zod.z.array(nonEmptyStringSchema).optional().describe("Buf Schema Registry modules the .proto files depend on."),
2537
+ localGeneration: zod.z.boolean().optional().describe("Whether the .proto files are compiled locally instead of remotely."),
2538
+ fromOpenApi: zod.z.boolean().default(false).describe("Whether SDKs are generated from the OpenAPI converted from the .proto files.")
2539
+ });
2540
+ var sourceSpecOptions = [
2541
+ zod.z.strictObject({
2542
+ ...sourceSpecShape,
2543
+ path: relativePathSchema.describe("The relative path to the API source file.")
2544
+ }),
2545
+ zod.z.strictObject({
2546
+ ...sourceSpecShape,
2547
+ url: zod.z.url({ protocol: /^https?$/ }).describe("The HTTP or HTTPS URL of the API source file.")
2548
+ }),
2549
+ zod.z.strictObject({
2550
+ ...commonSourceSpecShape,
2551
+ proto: sdkConfigV1ProtobufSourceSchema.describe("The protobuf definitions of this source.")
2552
+ })
2553
+ ];
2554
+ var protobufSourceSpecOptionIndex = 2;
2555
+ function hasProtoLocator(input) {
2556
+ return typeof input === "object" && input !== null && "proto" in input;
2557
+ }
2558
+ var sdkConfigV1SourceSpecSchema = zod.z.union(sourceSpecOptions, {
2559
+ error: (issue) => {
2560
+ if (issue.code !== "invalid_union" || !hasProtoLocator(issue.input)) {
2561
+ return "source spec must contain exactly one locator: path, HTTP(S) url, or proto";
2562
+ }
2563
+ const details = (issue.errors[protobufSourceSpecOptionIndex] ?? []).map(({ path, message }) => path.length ? `${path.join(".")}: ${message}` : message).join("; ");
2564
+ return `protobuf source spec is invalid: ${details}`;
2565
+ }
2566
+ });
2524
2567
  var sdkConfigV1SourceConfigSchema = zod.z.strictObject({
2525
2568
  specs: zod.z.array(sdkConfigV1SourceSpecSchema).min(1, "source.specs must contain at least one source spec").describe("API source files in authoritative processing order."),
2526
2569
  apiImportSettings: apiImportSettingsSchema.optional().describe("Default import behavior shared by every source spec.")
@@ -4250,6 +4293,7 @@ exports.sdkConfigV1DocsConfigSchema = sdkConfigV1DocsConfigSchema;
4250
4293
  exports.sdkConfigV1ExactSemverSchema = exactSemverSchema;
4251
4294
  exports.sdkConfigV1GenerationConfigOverrideSchema = sdkConfigV1GenerationConfigOverrideSchema;
4252
4295
  exports.sdkConfigV1GenerationConfigSchema = sdkConfigV1GenerationConfigSchema;
4296
+ exports.sdkConfigV1GitRemoteSchema = sdkConfigV1GitRemoteSchema;
4253
4297
  exports.sdkConfigV1GithubActionsSecretNameSchema = githubActionsSecretNameSchema;
4254
4298
  exports.sdkConfigV1GoGenerationConfigSchema = goGenerationConfigSchema;
4255
4299
  exports.sdkConfigV1GoModulePathSchema = goModulePathSchema;
@@ -4259,7 +4303,10 @@ exports.sdkConfigV1McpGenerationConfigSchema = mcpGenerationConfigSchema;
4259
4303
  exports.sdkConfigV1NonEmptyStringSchema = nonEmptyStringSchema;
4260
4304
  exports.sdkConfigV1OutputConfigSchema = sdkConfigV1OutputConfigSchema;
4261
4305
  exports.sdkConfigV1PackageConfigSchema = sdkConfigV1PackageConfigSchema;
4306
+ exports.sdkConfigV1ParentRelativePathSchema = parentRelativePathSchema;
4262
4307
  exports.sdkConfigV1PhpGenerationConfigSchema = phpGenerationConfigSchema;
4308
+ exports.sdkConfigV1ProtobufRootSchema = sdkConfigV1ProtobufRootSchema;
4309
+ exports.sdkConfigV1ProtobufSourceSchema = sdkConfigV1ProtobufSourceSchema;
4263
4310
  exports.sdkConfigV1PublishConfigSchema = sdkConfigV1PublishConfigSchema;
4264
4311
  exports.sdkConfigV1PublishRegistrySchema = sdkConfigV1PublishRegistrySchema;
4265
4312
  exports.sdkConfigV1PythonGenerationConfigSchema = pythonGenerationConfigSchema;