@postman/sdk-config 0.24.0 → 0.25.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 (34) hide show
  1. package/dist/index.cjs +60 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +2 -2
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +60 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/sdk-config/index.cjs +42 -0
  8. package/dist/sdk-config/index.cjs.map +1 -1
  9. package/dist/sdk-config/index.d.cts +1 -1
  10. package/dist/sdk-config/index.d.ts +1 -1
  11. package/dist/sdk-config/index.js +42 -0
  12. package/dist/sdk-config/index.js.map +1 -1
  13. package/dist/sdk-config/v1/index.cjs +42 -0
  14. package/dist/sdk-config/v1/index.cjs.map +1 -1
  15. package/dist/sdk-config/v1/index.d.cts +10 -2
  16. package/dist/sdk-config/v1/index.d.ts +10 -2
  17. package/dist/sdk-config/v1/index.js +42 -0
  18. package/dist/sdk-config/v1/index.js.map +1 -1
  19. package/dist/sdk-config-ir/index.cjs +55 -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 +55 -2
  24. package/dist/sdk-config-ir/index.js.map +1 -1
  25. package/dist/sdk-config-ir/v1/index.cjs +55 -1
  26. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  27. package/dist/sdk-config-ir/v1/index.d.cts +30 -3
  28. package/dist/sdk-config-ir/v1/index.d.ts +30 -3
  29. package/dist/sdk-config-ir/v1/index.js +55 -2
  30. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  31. package/dist/{typescript-BcBGIPrg.d.cts → typescript-BIq_eF34.d.cts} +2 -0
  32. package/dist/{typescript-BcBGIPrg.d.ts → typescript-BIq_eF34.d.ts} +2 -0
  33. package/package.json +1 -1
  34. package/src/sdk-config/v1/README.md +31 -0
@@ -1,5 +1,5 @@
1
- import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-BcBGIPrg.cjs';
2
- export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, x as sdkConfigV1CliDistributionConfigSchema, y as sdkConfigV1CliDistributionGithubAppSchema, z as sdkConfigV1CliDistributionHomebrewSchema, A as sdkConfigV1CliDistributionScoopSchema, B as sdkConfigV1CliGenerationConfigSchema, E as sdkConfigV1ComposerPackageNameSchema, F as sdkConfigV1CsharpGenerationConfigSchema, I as sdkConfigV1ExactSemverSchema, L as sdkConfigV1GithubActionsSecretNameSchema, N as sdkConfigV1GoGenerationConfigSchema, O as sdkConfigV1GoModulePathSchema, Q as sdkConfigV1JavaGenerationConfigSchema, W as sdkConfigV1KotlinGenerationConfigSchema, Y as sdkConfigV1McpGenerationConfigSchema, Z as sdkConfigV1NonEmptyStringSchema, a0 as sdkConfigV1ParentRelativePathSchema, a1 as sdkConfigV1PhpGenerationConfigSchema, a2 as sdkConfigV1PythonGenerationConfigSchema, a3 as sdkConfigV1RelativePathSchema, a4 as sdkConfigV1RubyGenerationConfigSchema, a5 as sdkConfigV1RustGenerationConfigSchema, a6 as sdkConfigV1SwiftGenerationConfigSchema, a7 as sdkConfigV1TerraformGenerationConfigSchema, a8 as sdkConfigV1TypescriptGenerationConfigSchema } from '../../typescript-BcBGIPrg.cjs';
1
+ import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-BIq_eF34.cjs';
2
+ export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, x as sdkConfigV1CliDistributionConfigSchema, y as sdkConfigV1CliDistributionGithubAppSchema, z as sdkConfigV1CliDistributionHomebrewSchema, A as sdkConfigV1CliDistributionScoopSchema, B as sdkConfigV1CliGenerationConfigSchema, E as sdkConfigV1ComposerPackageNameSchema, F as sdkConfigV1CsharpGenerationConfigSchema, I as sdkConfigV1ExactSemverSchema, L as sdkConfigV1GithubActionsSecretNameSchema, N as sdkConfigV1GoGenerationConfigSchema, O as sdkConfigV1GoModulePathSchema, Q as sdkConfigV1JavaGenerationConfigSchema, W as sdkConfigV1KotlinGenerationConfigSchema, Y as sdkConfigV1McpGenerationConfigSchema, Z as sdkConfigV1NonEmptyStringSchema, a0 as sdkConfigV1ParentRelativePathSchema, a1 as sdkConfigV1PhpGenerationConfigSchema, a2 as sdkConfigV1PythonGenerationConfigSchema, a3 as sdkConfigV1RelativePathSchema, a4 as sdkConfigV1RubyGenerationConfigSchema, a5 as sdkConfigV1RustGenerationConfigSchema, a6 as sdkConfigV1SwiftGenerationConfigSchema, a7 as sdkConfigV1TerraformGenerationConfigSchema, a8 as sdkConfigV1TypescriptGenerationConfigSchema } from '../../typescript-BIq_eF34.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -60,6 +60,7 @@ declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
60
60
  }, z.core.$strict>, z.ZodObject<{
61
61
  type: z.ZodLiteral<"client-credentials">;
62
62
  tokenUrl: z.ZodString;
63
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
63
64
  refreshUrl: z.ZodOptional<z.ZodString>;
64
65
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
65
66
  name: z.ZodString;
@@ -186,6 +187,7 @@ declare const sdkConfigV1AuthConfigSchema: z.ZodObject<{
186
187
  }, z.core.$strict>, z.ZodObject<{
187
188
  type: z.ZodLiteral<"client-credentials">;
188
189
  tokenUrl: z.ZodString;
190
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
189
191
  refreshUrl: z.ZodOptional<z.ZodString>;
190
192
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
193
  name: z.ZodString;
@@ -334,6 +336,7 @@ declare const sdkConfigV1ApiConfigSchema: z.ZodObject<{
334
336
  }, z.core.$strict>, z.ZodObject<{
335
337
  type: z.ZodLiteral<"client-credentials">;
336
338
  tokenUrl: z.ZodString;
339
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
337
340
  refreshUrl: z.ZodOptional<z.ZodString>;
338
341
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
339
342
  name: z.ZodString;
@@ -930,6 +933,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
930
933
  }, z.core.$strict>, z.ZodObject<{
931
934
  type: z.ZodLiteral<"client-credentials">;
932
935
  tokenUrl: z.ZodString;
936
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
933
937
  refreshUrl: z.ZodOptional<z.ZodString>;
934
938
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
935
939
  name: z.ZodString;
@@ -10796,6 +10800,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
10796
10800
  }, z.core.$strict>>>;
10797
10801
  serverName: z.ZodOptional<z.ZodString>;
10798
10802
  serverDescription: z.ZodOptional<z.ZodString>;
10803
+ instructions: z.ZodOptional<z.ZodString>;
10804
+ appendInstructions: z.ZodOptional<z.ZodString>;
10799
10805
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
10800
10806
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
10801
10807
  PRE_RELEASE: "PRE_RELEASE";
@@ -22752,6 +22758,8 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22752
22758
  }, z.core.$strict>>>;
22753
22759
  serverName: z.ZodOptional<z.ZodString>;
22754
22760
  serverDescription: z.ZodOptional<z.ZodString>;
22761
+ instructions: z.ZodOptional<z.ZodString>;
22762
+ appendInstructions: z.ZodOptional<z.ZodString>;
22755
22763
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
22756
22764
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
22757
22765
  PRE_RELEASE: "PRE_RELEASE";
@@ -1,5 +1,5 @@
1
- import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-BcBGIPrg.js';
2
- export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, x as sdkConfigV1CliDistributionConfigSchema, y as sdkConfigV1CliDistributionGithubAppSchema, z as sdkConfigV1CliDistributionHomebrewSchema, A as sdkConfigV1CliDistributionScoopSchema, B as sdkConfigV1CliGenerationConfigSchema, E as sdkConfigV1ComposerPackageNameSchema, F as sdkConfigV1CsharpGenerationConfigSchema, I as sdkConfigV1ExactSemverSchema, L as sdkConfigV1GithubActionsSecretNameSchema, N as sdkConfigV1GoGenerationConfigSchema, O as sdkConfigV1GoModulePathSchema, Q as sdkConfigV1JavaGenerationConfigSchema, W as sdkConfigV1KotlinGenerationConfigSchema, Y as sdkConfigV1McpGenerationConfigSchema, Z as sdkConfigV1NonEmptyStringSchema, a0 as sdkConfigV1ParentRelativePathSchema, a1 as sdkConfigV1PhpGenerationConfigSchema, a2 as sdkConfigV1PythonGenerationConfigSchema, a3 as sdkConfigV1RelativePathSchema, a4 as sdkConfigV1RubyGenerationConfigSchema, a5 as sdkConfigV1RustGenerationConfigSchema, a6 as sdkConfigV1SwiftGenerationConfigSchema, a7 as sdkConfigV1TerraformGenerationConfigSchema, a8 as sdkConfigV1TypescriptGenerationConfigSchema } from '../../typescript-BcBGIPrg.js';
1
+ import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-BIq_eF34.js';
2
+ export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, x as sdkConfigV1CliDistributionConfigSchema, y as sdkConfigV1CliDistributionGithubAppSchema, z as sdkConfigV1CliDistributionHomebrewSchema, A as sdkConfigV1CliDistributionScoopSchema, B as sdkConfigV1CliGenerationConfigSchema, E as sdkConfigV1ComposerPackageNameSchema, F as sdkConfigV1CsharpGenerationConfigSchema, I as sdkConfigV1ExactSemverSchema, L as sdkConfigV1GithubActionsSecretNameSchema, N as sdkConfigV1GoGenerationConfigSchema, O as sdkConfigV1GoModulePathSchema, Q as sdkConfigV1JavaGenerationConfigSchema, W as sdkConfigV1KotlinGenerationConfigSchema, Y as sdkConfigV1McpGenerationConfigSchema, Z as sdkConfigV1NonEmptyStringSchema, a0 as sdkConfigV1ParentRelativePathSchema, a1 as sdkConfigV1PhpGenerationConfigSchema, a2 as sdkConfigV1PythonGenerationConfigSchema, a3 as sdkConfigV1RelativePathSchema, a4 as sdkConfigV1RubyGenerationConfigSchema, a5 as sdkConfigV1RustGenerationConfigSchema, a6 as sdkConfigV1SwiftGenerationConfigSchema, a7 as sdkConfigV1TerraformGenerationConfigSchema, a8 as sdkConfigV1TypescriptGenerationConfigSchema } from '../../typescript-BIq_eF34.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -60,6 +60,7 @@ declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
60
60
  }, z.core.$strict>, z.ZodObject<{
61
61
  type: z.ZodLiteral<"client-credentials">;
62
62
  tokenUrl: z.ZodString;
63
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
63
64
  refreshUrl: z.ZodOptional<z.ZodString>;
64
65
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
65
66
  name: z.ZodString;
@@ -186,6 +187,7 @@ declare const sdkConfigV1AuthConfigSchema: z.ZodObject<{
186
187
  }, z.core.$strict>, z.ZodObject<{
187
188
  type: z.ZodLiteral<"client-credentials">;
188
189
  tokenUrl: z.ZodString;
190
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
189
191
  refreshUrl: z.ZodOptional<z.ZodString>;
190
192
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
193
  name: z.ZodString;
@@ -334,6 +336,7 @@ declare const sdkConfigV1ApiConfigSchema: z.ZodObject<{
334
336
  }, z.core.$strict>, z.ZodObject<{
335
337
  type: z.ZodLiteral<"client-credentials">;
336
338
  tokenUrl: z.ZodString;
339
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
337
340
  refreshUrl: z.ZodOptional<z.ZodString>;
338
341
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
339
342
  name: z.ZodString;
@@ -930,6 +933,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
930
933
  }, z.core.$strict>, z.ZodObject<{
931
934
  type: z.ZodLiteral<"client-credentials">;
932
935
  tokenUrl: z.ZodString;
936
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
933
937
  refreshUrl: z.ZodOptional<z.ZodString>;
934
938
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
935
939
  name: z.ZodString;
@@ -10796,6 +10800,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
10796
10800
  }, z.core.$strict>>>;
10797
10801
  serverName: z.ZodOptional<z.ZodString>;
10798
10802
  serverDescription: z.ZodOptional<z.ZodString>;
10803
+ instructions: z.ZodOptional<z.ZodString>;
10804
+ appendInstructions: z.ZodOptional<z.ZodString>;
10799
10805
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
10800
10806
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
10801
10807
  PRE_RELEASE: "PRE_RELEASE";
@@ -22752,6 +22758,8 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22752
22758
  }, z.core.$strict>>>;
22753
22759
  serverName: z.ZodOptional<z.ZodString>;
22754
22760
  serverDescription: z.ZodOptional<z.ZodString>;
22761
+ instructions: z.ZodOptional<z.ZodString>;
22762
+ appendInstructions: z.ZodOptional<z.ZodString>;
22755
22763
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
22756
22764
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
22757
22765
  PRE_RELEASE: "PRE_RELEASE";
@@ -199,6 +199,9 @@ var oauthFlowSchema = z.discriminatedUnion("type", [
199
199
  z.strictObject({
200
200
  type: z.literal("client-credentials").describe("Uses the OAuth client credentials flow."),
201
201
  tokenUrl: nonEmptyStringSchema.describe("The URL used to obtain access tokens."),
202
+ environmentTokenUrls: z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe(
203
+ "Token URLs by environment name, for an API whose token endpoint differs per environment. When the selected environment has an entry, its URL replaces tokenUrl, so staging and development do not call the production token endpoint. Each key must name an entry of api.environments; environments without an entry use tokenUrl."
204
+ ),
202
205
  refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
203
206
  scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
204
207
  }),
@@ -347,6 +350,34 @@ var apiConfigSchema = z.strictObject({
347
350
  */
348
351
  webhookSignature: webhookSignatureSchema.optional().describe("How generated helpers verify webhook signatures from the API.")
349
352
  });
353
+ function oauthEnvironmentTokenUrlsIssues(api, basePath) {
354
+ const environmentNames = new Set((api.environments ?? []).map(({ name }) => name));
355
+ const issues = [];
356
+ (api.auth?.schemes ?? []).forEach((scheme, schemeIndex) => {
357
+ if (scheme.type !== "oauth2") return;
358
+ scheme.flows.forEach((flow, flowIndex) => {
359
+ if (flow.type !== "client-credentials") return;
360
+ Object.keys(flow.environmentTokenUrls ?? {}).forEach((environment) => {
361
+ if (!environmentNames.has(environment)) {
362
+ issues.push({
363
+ message: `environmentTokenUrls "${environment}" must name an entry of api.environments`,
364
+ path: [
365
+ ...basePath,
366
+ "auth",
367
+ "schemes",
368
+ schemeIndex,
369
+ "flows",
370
+ flowIndex,
371
+ "environmentTokenUrls",
372
+ environment
373
+ ]
374
+ });
375
+ }
376
+ });
377
+ });
378
+ });
379
+ return issues;
380
+ }
350
381
 
351
382
  // src/sdk-config/v1/api.ts
352
383
  var sdkConfigV1AuthSchemeSchema = authSchemeSchema;
@@ -804,6 +835,12 @@ var mcpHooksSchema = z.strictObject({
804
835
  var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
805
836
  serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
806
837
  serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
838
+ instructions: nonEmptyStringSchema.optional().describe(
839
+ "Replaces the auto-generated server instructions returned on initialize. WARNING: the generated instructions encode protocol wiring (the openapi:// resource and schema URI templates and the _meta keys the agent needs to browse docs and fetch full input schemas); replacing them drops that wiring and can break schema/doc browsing, so prefer appendInstructions unless you intend to restate it. Emitted verbatim and sent to the MCP client on every conversation, so keep it concise."
840
+ ),
841
+ appendInstructions: nonEmptyStringSchema.optional().describe(
842
+ "Appended after the auto-generated server instructions returned on initialize, preserving the generated protocol wiring. When both instructions and appendInstructions are set, this is appended after the replacement text. Emitted verbatim and sent to the MCP client on every conversation, so keep it concise."
843
+ ),
807
844
  excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
808
845
  tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
809
846
  toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset."),
@@ -3210,6 +3247,9 @@ var sdkConfigV1Schema = z.strictObject({
3210
3247
  targets: z.array(sdkConfigV1TargetSchema).min(1).describe("Language targets to generate; each language may appear once.")
3211
3248
  }).superRefine(({ api, output, package: globalPackage, targets }, context) => {
3212
3249
  const configuredLanguages = /* @__PURE__ */ new Set();
3250
+ oauthEnvironmentTokenUrlsIssues(api, ["api"]).forEach(
3251
+ (issue) => context.addIssue({ code: "custom", ...issue })
3252
+ );
3213
3253
  targets.forEach((target, targetIndex) => {
3214
3254
  if (configuredLanguages.has(target.language)) {
3215
3255
  context.addIssue({
@@ -4138,6 +4178,8 @@ function mapMcp(config, state, basePath) {
4138
4178
  return compact({
4139
4179
  serverName: takeString(config, ["serverName"], state, basePath),
4140
4180
  serverDescription: takeString(config, ["serverDescription"], state, basePath),
4181
+ instructions: takeString(config, ["instructions"], state, basePath),
4182
+ appendInstructions: takeString(config, ["appendInstructions"], state, basePath),
4141
4183
  excludeAvailability: takeEnumArray(
4142
4184
  config,
4143
4185
  ["excludeAvailability"],