@postman/sdk-config 0.23.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 +85 -2
  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 +85 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/sdk-config/index.cjs +67 -1
  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 +67 -1
  12. package/dist/sdk-config/index.js.map +1 -1
  13. package/dist/sdk-config/v1/index.cjs +67 -1
  14. package/dist/sdk-config/v1/index.cjs.map +1 -1
  15. package/dist/sdk-config/v1/index.d.cts +16 -2
  16. package/dist/sdk-config/v1/index.d.ts +16 -2
  17. package/dist/sdk-config/v1/index.js +67 -1
  18. package/dist/sdk-config/v1/index.js.map +1 -1
  19. package/dist/sdk-config-ir/index.cjs +63 -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 +63 -2
  24. package/dist/sdk-config-ir/index.js.map +1 -1
  25. package/dist/sdk-config-ir/v1/index.cjs +63 -1
  26. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  27. package/dist/sdk-config-ir/v1/index.d.cts +39 -3
  28. package/dist/sdk-config-ir/v1/index.d.ts +39 -3
  29. package/dist/sdk-config-ir/v1/index.js +63 -2
  30. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  31. package/dist/{typescript-ZRqfOhMd.d.cts → typescript-BIq_eF34.d.cts} +10 -1
  32. package/dist/{typescript-ZRqfOhMd.d.ts → typescript-BIq_eF34.d.ts} +10 -1
  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-ZRqfOhMd.cjs';
2
- export { C as CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as CliDistributionConfig, b as CliDistributionGithubAppConfig, c as CliDistributionHomebrewConfig, d as CliDistributionScoopConfig, e as CliGenerationConfig, f as CliOAuthTokenEndpoints, g as CliProfilesConfig, h as CliProfilesProvisionOperation, i as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, k as JsonValue, K as KotlinGenerationConfig, M as MCP_TOOL_NAME_PATTERN, l as McpAvailabilityStatus, m as McpCustomTool, n as McpGenerationConfig, o as McpMergedTool, p as McpToolFilter, P as PackageConfig, q as PhpGenerationConfig, r as PlanModifiers, s as PythonGenerationConfig, R as RubyGenerationConfig, t as RustGenerationConfig, u as SwiftGenerationConfig, T as TerraformGenerationConfig, v as TypescriptGenerationConfig, w as cliDistributionConfigSchema, x as cliDistributionGithubAppSchema, y as cliDistributionHomebrewSchema, z as cliDistributionScoopSchema, A as cliGenerationConfigSchema, B as composerPackageNameSchema, E as csharpGenerationConfigSchema, F as dependencySchema, H as exactSemverSchema, I as githubActionsSecretNameSchema, L as goGenerationConfigSchema, N as goModulePathSchema, O as javaGenerationConfigSchema, Q as jsonObjectSchema, U as jsonValueSchema, V as kotlinGenerationConfigSchema, W as mcpAvailabilityStatuses, X as mcpGenerationConfigSchema, Y as nonEmptyStringSchema, Z as oauthTokenEndpointsIssues, _ as packageConfigSchema, $ as parentRelativePathSchema, a0 as phpGenerationConfigSchema, a1 as pythonGenerationConfigSchema, a2 as relativePathSchema, a3 as rubyGenerationConfigSchema, a4 as rustGenerationConfigSchema, a5 as swiftGenerationConfigSchema, a6 as terraformGenerationConfigSchema, a7 as typescriptGenerationConfigSchema } from '../../typescript-ZRqfOhMd.cjs';
1
+ import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-BIq_eF34.cjs';
2
+ export { C as CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as CliDistributionConfig, b as CliDistributionGithubAppConfig, c as CliDistributionHomebrewConfig, d as CliDistributionScoopConfig, e as CliGenerationConfig, f as CliOAuthTokenEndpoints, g as CliProfilesConfig, h as CliProfilesProvisionOperation, i as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, k as JsonValue, K as KotlinGenerationConfig, M as MCP_TOOL_NAME_PATTERN, l as McpAvailabilityStatus, m as McpCustomTool, n as McpGenerationConfig, o as McpHooks, p as McpMergedTool, q as McpToolFilter, P as PackageConfig, r as PhpGenerationConfig, s as PlanModifiers, t as PythonGenerationConfig, R as RubyGenerationConfig, u as RustGenerationConfig, v as SwiftGenerationConfig, T as TerraformGenerationConfig, w as TypescriptGenerationConfig, x as cliDistributionConfigSchema, y as cliDistributionGithubAppSchema, z as cliDistributionHomebrewSchema, A as cliDistributionScoopSchema, B as cliGenerationConfigSchema, E as composerPackageNameSchema, F as csharpGenerationConfigSchema, H as dependencySchema, I as exactSemverSchema, L as githubActionsSecretNameSchema, N as goGenerationConfigSchema, O as goModulePathSchema, Q as javaGenerationConfigSchema, U as jsonObjectSchema, V as jsonValueSchema, W as kotlinGenerationConfigSchema, X as mcpAvailabilityStatuses, Y as mcpGenerationConfigSchema, Z as nonEmptyStringSchema, _ as oauthTokenEndpointsIssues, $ as packageConfigSchema, a0 as parentRelativePathSchema, a1 as phpGenerationConfigSchema, a2 as pythonGenerationConfigSchema, a3 as relativePathSchema, a4 as rubyGenerationConfigSchema, a5 as rustGenerationConfigSchema, a6 as swiftGenerationConfigSchema, a7 as terraformGenerationConfigSchema, a8 as typescriptGenerationConfigSchema } from '../../typescript-BIq_eF34.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const authSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -60,6 +60,7 @@ declare const authSchemeSchema: 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 authConfigSchema: 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 apiConfigSchema: 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;
@@ -482,6 +485,22 @@ type AuthScheme = z.infer<typeof authSchemeSchema>;
482
485
  type AuthConfig = z.infer<typeof authConfigSchema>;
483
486
  type ApiConfigInput = z.input<typeof apiConfigSchema>;
484
487
  type ApiConfig = z.output<typeof apiConfigSchema>;
488
+ interface EnvironmentTokenUrlIssue {
489
+ message: string;
490
+ path: (string | number)[];
491
+ }
492
+ /**
493
+ * Checks each client-credentials `environmentTokenUrls` key against the environments of the same
494
+ * document, so a typo cannot silently leave an environment on the production token endpoint.
495
+ */
496
+ declare function oauthEnvironmentTokenUrlsIssues(api: {
497
+ environments?: readonly {
498
+ name: string;
499
+ }[] | undefined;
500
+ auth?: {
501
+ schemes: readonly AuthScheme[];
502
+ } | undefined;
503
+ }, basePath: (string | number)[]): EnvironmentTokenUrlIssue[];
485
504
 
486
505
  declare const clientRetryOverrideSchema: z.ZodObject<{
487
506
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -897,6 +916,7 @@ declare const sdkConfigIrV1Schema: z.ZodObject<{
897
916
  }, z.core.$strict>, z.ZodObject<{
898
917
  type: z.ZodLiteral<"client-credentials">;
899
918
  tokenUrl: z.ZodString;
919
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
900
920
  refreshUrl: z.ZodOptional<z.ZodString>;
901
921
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
902
922
  name: z.ZodString;
@@ -2714,6 +2734,8 @@ declare const sdkConfigIrV1Schema: z.ZodObject<{
2714
2734
  }, z.core.$strict>>>;
2715
2735
  serverName: z.ZodOptional<z.ZodString>;
2716
2736
  serverDescription: z.ZodOptional<z.ZodString>;
2737
+ instructions: z.ZodOptional<z.ZodString>;
2738
+ appendInstructions: z.ZodOptional<z.ZodString>;
2717
2739
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2718
2740
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
2719
2741
  PRE_RELEASE: "PRE_RELEASE";
@@ -2741,6 +2763,9 @@ declare const sdkConfigIrV1Schema: z.ZodObject<{
2741
2763
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2742
2764
  path: z.ZodString;
2743
2765
  }, z.core.$strict>>>;
2766
+ hooks: z.ZodOptional<z.ZodObject<{
2767
+ path: z.ZodString;
2768
+ }, z.core.$strict>>;
2744
2769
  }, z.core.$strict>>;
2745
2770
  swift: z.ZodOptional<z.ZodObject<{
2746
2771
  moduleName: z.ZodOptional<z.ZodString>;
@@ -3192,6 +3217,8 @@ declare const languageGenerationConfigSchema: z.ZodObject<{
3192
3217
  }, z.core.$strict>>>;
3193
3218
  serverName: z.ZodOptional<z.ZodString>;
3194
3219
  serverDescription: z.ZodOptional<z.ZodString>;
3220
+ instructions: z.ZodOptional<z.ZodString>;
3221
+ appendInstructions: z.ZodOptional<z.ZodString>;
3195
3222
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3196
3223
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
3197
3224
  PRE_RELEASE: "PRE_RELEASE";
@@ -3219,6 +3246,9 @@ declare const languageGenerationConfigSchema: z.ZodObject<{
3219
3246
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3220
3247
  path: z.ZodString;
3221
3248
  }, z.core.$strict>>>;
3249
+ hooks: z.ZodOptional<z.ZodObject<{
3250
+ path: z.ZodString;
3251
+ }, z.core.$strict>>;
3222
3252
  }, z.core.$strict>>;
3223
3253
  swift: z.ZodOptional<z.ZodObject<{
3224
3254
  moduleName: z.ZodOptional<z.ZodString>;
@@ -3705,6 +3735,8 @@ declare const generationConfigSchema: z.ZodObject<{
3705
3735
  }, z.core.$strict>>>;
3706
3736
  serverName: z.ZodOptional<z.ZodString>;
3707
3737
  serverDescription: z.ZodOptional<z.ZodString>;
3738
+ instructions: z.ZodOptional<z.ZodString>;
3739
+ appendInstructions: z.ZodOptional<z.ZodString>;
3708
3740
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3709
3741
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
3710
3742
  PRE_RELEASE: "PRE_RELEASE";
@@ -3732,6 +3764,9 @@ declare const generationConfigSchema: z.ZodObject<{
3732
3764
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3733
3765
  path: z.ZodString;
3734
3766
  }, z.core.$strict>>>;
3767
+ hooks: z.ZodOptional<z.ZodObject<{
3768
+ path: z.ZodString;
3769
+ }, z.core.$strict>>;
3735
3770
  }, z.core.$strict>>;
3736
3771
  swift: z.ZodOptional<z.ZodObject<{
3737
3772
  moduleName: z.ZodOptional<z.ZodString>;
@@ -5613,6 +5648,7 @@ type WebhookSignature = z.output<typeof webhookSignatureSchema>;
5613
5648
 
5614
5649
  declare const sdkConfigIrCapabilitySchema: z.ZodEnum<{
5615
5650
  "generation.generateFullProject": "generation.generateFullProject";
5651
+ "api.auth.oauth.environmentTokenUrls": "api.auth.oauth.environmentTokenUrls";
5616
5652
  }>;
5617
5653
  type SdkConfigIrCapability = z.infer<typeof sdkConfigIrCapabilitySchema>;
5618
5654
  interface SerializedSdkConfigIrV1 {
@@ -5633,4 +5669,4 @@ declare function serializeSdkConfigIrV1(value: SdkConfigIrV1Input | SdkConfigIrV
5633
5669
  */
5634
5670
  declare function parseSdkConfigIrV1ForConsumption(value: unknown): SdkConfigIrV1;
5635
5671
 
5636
- export { type ApiConfig, type ApiConfigInput, type ApiImportSettings, type AuthConfig, type AuthScheme, type ClientConfig, type ClientConfigInput, type ClientConfigOverride, type CompatibilityConfig, type CredentialResolution, type DocsConfig, type GenerationConfig, JsonObject, type LanguageGenerationConfig, type LegacyInput, type OutputConfig, type PublishConfig, type PublishRegistry, type ReadmeCustomSection, type ReadmeEndpoint, type ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, type SdkConfigIrCapability, type SdkConfigIrV1, SdkConfigDiagnostic as SdkConfigIrV1Diagnostic, type SdkConfigIrV1Input, type SerializedSdkConfigIrV1, type SourceConfig, type SourceSpecConfig, type SourceSpecOrigin, type SourceSpecType, type TargetConfig, type TargetLanguage, type UnsupportedField, type WebhookSignature, type WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecOriginSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema };
5672
+ export { type ApiConfig, type ApiConfigInput, type ApiImportSettings, type AuthConfig, type AuthScheme, type ClientConfig, type ClientConfigInput, type ClientConfigOverride, type CompatibilityConfig, type CredentialResolution, type DocsConfig, type GenerationConfig, JsonObject, type LanguageGenerationConfig, type LegacyInput, type OutputConfig, type PublishConfig, type PublishRegistry, type ReadmeCustomSection, type ReadmeEndpoint, type ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, type SdkConfigIrCapability, type SdkConfigIrV1, SdkConfigDiagnostic as SdkConfigIrV1Diagnostic, type SdkConfigIrV1Input, type SerializedSdkConfigIrV1, type SourceConfig, type SourceSpecConfig, type SourceSpecOrigin, type SourceSpecType, type TargetConfig, type TargetLanguage, type UnsupportedField, type WebhookSignature, type WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, languageGenerationConfigSchema, legacyInputSchema, oauthEnvironmentTokenUrlsIssues, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecOriginSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema };
@@ -1,5 +1,5 @@
1
- import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-ZRqfOhMd.js';
2
- export { C as CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as CliDistributionConfig, b as CliDistributionGithubAppConfig, c as CliDistributionHomebrewConfig, d as CliDistributionScoopConfig, e as CliGenerationConfig, f as CliOAuthTokenEndpoints, g as CliProfilesConfig, h as CliProfilesProvisionOperation, i as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, k as JsonValue, K as KotlinGenerationConfig, M as MCP_TOOL_NAME_PATTERN, l as McpAvailabilityStatus, m as McpCustomTool, n as McpGenerationConfig, o as McpMergedTool, p as McpToolFilter, P as PackageConfig, q as PhpGenerationConfig, r as PlanModifiers, s as PythonGenerationConfig, R as RubyGenerationConfig, t as RustGenerationConfig, u as SwiftGenerationConfig, T as TerraformGenerationConfig, v as TypescriptGenerationConfig, w as cliDistributionConfigSchema, x as cliDistributionGithubAppSchema, y as cliDistributionHomebrewSchema, z as cliDistributionScoopSchema, A as cliGenerationConfigSchema, B as composerPackageNameSchema, E as csharpGenerationConfigSchema, F as dependencySchema, H as exactSemverSchema, I as githubActionsSecretNameSchema, L as goGenerationConfigSchema, N as goModulePathSchema, O as javaGenerationConfigSchema, Q as jsonObjectSchema, U as jsonValueSchema, V as kotlinGenerationConfigSchema, W as mcpAvailabilityStatuses, X as mcpGenerationConfigSchema, Y as nonEmptyStringSchema, Z as oauthTokenEndpointsIssues, _ as packageConfigSchema, $ as parentRelativePathSchema, a0 as phpGenerationConfigSchema, a1 as pythonGenerationConfigSchema, a2 as relativePathSchema, a3 as rubyGenerationConfigSchema, a4 as rustGenerationConfigSchema, a5 as swiftGenerationConfigSchema, a6 as terraformGenerationConfigSchema, a7 as typescriptGenerationConfigSchema } from '../../typescript-ZRqfOhMd.js';
1
+ import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-BIq_eF34.js';
2
+ export { C as CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as CliDistributionConfig, b as CliDistributionGithubAppConfig, c as CliDistributionHomebrewConfig, d as CliDistributionScoopConfig, e as CliGenerationConfig, f as CliOAuthTokenEndpoints, g as CliProfilesConfig, h as CliProfilesProvisionOperation, i as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, k as JsonValue, K as KotlinGenerationConfig, M as MCP_TOOL_NAME_PATTERN, l as McpAvailabilityStatus, m as McpCustomTool, n as McpGenerationConfig, o as McpHooks, p as McpMergedTool, q as McpToolFilter, P as PackageConfig, r as PhpGenerationConfig, s as PlanModifiers, t as PythonGenerationConfig, R as RubyGenerationConfig, u as RustGenerationConfig, v as SwiftGenerationConfig, T as TerraformGenerationConfig, w as TypescriptGenerationConfig, x as cliDistributionConfigSchema, y as cliDistributionGithubAppSchema, z as cliDistributionHomebrewSchema, A as cliDistributionScoopSchema, B as cliGenerationConfigSchema, E as composerPackageNameSchema, F as csharpGenerationConfigSchema, H as dependencySchema, I as exactSemverSchema, L as githubActionsSecretNameSchema, N as goGenerationConfigSchema, O as goModulePathSchema, Q as javaGenerationConfigSchema, U as jsonObjectSchema, V as jsonValueSchema, W as kotlinGenerationConfigSchema, X as mcpAvailabilityStatuses, Y as mcpGenerationConfigSchema, Z as nonEmptyStringSchema, _ as oauthTokenEndpointsIssues, $ as packageConfigSchema, a0 as parentRelativePathSchema, a1 as phpGenerationConfigSchema, a2 as pythonGenerationConfigSchema, a3 as relativePathSchema, a4 as rubyGenerationConfigSchema, a5 as rustGenerationConfigSchema, a6 as swiftGenerationConfigSchema, a7 as terraformGenerationConfigSchema, a8 as typescriptGenerationConfigSchema } from '../../typescript-BIq_eF34.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const authSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -60,6 +60,7 @@ declare const authSchemeSchema: 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 authConfigSchema: 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 apiConfigSchema: 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;
@@ -482,6 +485,22 @@ type AuthScheme = z.infer<typeof authSchemeSchema>;
482
485
  type AuthConfig = z.infer<typeof authConfigSchema>;
483
486
  type ApiConfigInput = z.input<typeof apiConfigSchema>;
484
487
  type ApiConfig = z.output<typeof apiConfigSchema>;
488
+ interface EnvironmentTokenUrlIssue {
489
+ message: string;
490
+ path: (string | number)[];
491
+ }
492
+ /**
493
+ * Checks each client-credentials `environmentTokenUrls` key against the environments of the same
494
+ * document, so a typo cannot silently leave an environment on the production token endpoint.
495
+ */
496
+ declare function oauthEnvironmentTokenUrlsIssues(api: {
497
+ environments?: readonly {
498
+ name: string;
499
+ }[] | undefined;
500
+ auth?: {
501
+ schemes: readonly AuthScheme[];
502
+ } | undefined;
503
+ }, basePath: (string | number)[]): EnvironmentTokenUrlIssue[];
485
504
 
486
505
  declare const clientRetryOverrideSchema: z.ZodObject<{
487
506
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -897,6 +916,7 @@ declare const sdkConfigIrV1Schema: z.ZodObject<{
897
916
  }, z.core.$strict>, z.ZodObject<{
898
917
  type: z.ZodLiteral<"client-credentials">;
899
918
  tokenUrl: z.ZodString;
919
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
900
920
  refreshUrl: z.ZodOptional<z.ZodString>;
901
921
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
902
922
  name: z.ZodString;
@@ -2714,6 +2734,8 @@ declare const sdkConfigIrV1Schema: z.ZodObject<{
2714
2734
  }, z.core.$strict>>>;
2715
2735
  serverName: z.ZodOptional<z.ZodString>;
2716
2736
  serverDescription: z.ZodOptional<z.ZodString>;
2737
+ instructions: z.ZodOptional<z.ZodString>;
2738
+ appendInstructions: z.ZodOptional<z.ZodString>;
2717
2739
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2718
2740
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
2719
2741
  PRE_RELEASE: "PRE_RELEASE";
@@ -2741,6 +2763,9 @@ declare const sdkConfigIrV1Schema: z.ZodObject<{
2741
2763
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2742
2764
  path: z.ZodString;
2743
2765
  }, z.core.$strict>>>;
2766
+ hooks: z.ZodOptional<z.ZodObject<{
2767
+ path: z.ZodString;
2768
+ }, z.core.$strict>>;
2744
2769
  }, z.core.$strict>>;
2745
2770
  swift: z.ZodOptional<z.ZodObject<{
2746
2771
  moduleName: z.ZodOptional<z.ZodString>;
@@ -3192,6 +3217,8 @@ declare const languageGenerationConfigSchema: z.ZodObject<{
3192
3217
  }, z.core.$strict>>>;
3193
3218
  serverName: z.ZodOptional<z.ZodString>;
3194
3219
  serverDescription: z.ZodOptional<z.ZodString>;
3220
+ instructions: z.ZodOptional<z.ZodString>;
3221
+ appendInstructions: z.ZodOptional<z.ZodString>;
3195
3222
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3196
3223
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
3197
3224
  PRE_RELEASE: "PRE_RELEASE";
@@ -3219,6 +3246,9 @@ declare const languageGenerationConfigSchema: z.ZodObject<{
3219
3246
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3220
3247
  path: z.ZodString;
3221
3248
  }, z.core.$strict>>>;
3249
+ hooks: z.ZodOptional<z.ZodObject<{
3250
+ path: z.ZodString;
3251
+ }, z.core.$strict>>;
3222
3252
  }, z.core.$strict>>;
3223
3253
  swift: z.ZodOptional<z.ZodObject<{
3224
3254
  moduleName: z.ZodOptional<z.ZodString>;
@@ -3705,6 +3735,8 @@ declare const generationConfigSchema: z.ZodObject<{
3705
3735
  }, z.core.$strict>>>;
3706
3736
  serverName: z.ZodOptional<z.ZodString>;
3707
3737
  serverDescription: z.ZodOptional<z.ZodString>;
3738
+ instructions: z.ZodOptional<z.ZodString>;
3739
+ appendInstructions: z.ZodOptional<z.ZodString>;
3708
3740
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3709
3741
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
3710
3742
  PRE_RELEASE: "PRE_RELEASE";
@@ -3732,6 +3764,9 @@ declare const generationConfigSchema: z.ZodObject<{
3732
3764
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3733
3765
  path: z.ZodString;
3734
3766
  }, z.core.$strict>>>;
3767
+ hooks: z.ZodOptional<z.ZodObject<{
3768
+ path: z.ZodString;
3769
+ }, z.core.$strict>>;
3735
3770
  }, z.core.$strict>>;
3736
3771
  swift: z.ZodOptional<z.ZodObject<{
3737
3772
  moduleName: z.ZodOptional<z.ZodString>;
@@ -5613,6 +5648,7 @@ type WebhookSignature = z.output<typeof webhookSignatureSchema>;
5613
5648
 
5614
5649
  declare const sdkConfigIrCapabilitySchema: z.ZodEnum<{
5615
5650
  "generation.generateFullProject": "generation.generateFullProject";
5651
+ "api.auth.oauth.environmentTokenUrls": "api.auth.oauth.environmentTokenUrls";
5616
5652
  }>;
5617
5653
  type SdkConfigIrCapability = z.infer<typeof sdkConfigIrCapabilitySchema>;
5618
5654
  interface SerializedSdkConfigIrV1 {
@@ -5633,4 +5669,4 @@ declare function serializeSdkConfigIrV1(value: SdkConfigIrV1Input | SdkConfigIrV
5633
5669
  */
5634
5670
  declare function parseSdkConfigIrV1ForConsumption(value: unknown): SdkConfigIrV1;
5635
5671
 
5636
- export { type ApiConfig, type ApiConfigInput, type ApiImportSettings, type AuthConfig, type AuthScheme, type ClientConfig, type ClientConfigInput, type ClientConfigOverride, type CompatibilityConfig, type CredentialResolution, type DocsConfig, type GenerationConfig, JsonObject, type LanguageGenerationConfig, type LegacyInput, type OutputConfig, type PublishConfig, type PublishRegistry, type ReadmeCustomSection, type ReadmeEndpoint, type ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, type SdkConfigIrCapability, type SdkConfigIrV1, SdkConfigDiagnostic as SdkConfigIrV1Diagnostic, type SdkConfigIrV1Input, type SerializedSdkConfigIrV1, type SourceConfig, type SourceSpecConfig, type SourceSpecOrigin, type SourceSpecType, type TargetConfig, type TargetLanguage, type UnsupportedField, type WebhookSignature, type WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecOriginSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema };
5672
+ export { type ApiConfig, type ApiConfigInput, type ApiImportSettings, type AuthConfig, type AuthScheme, type ClientConfig, type ClientConfigInput, type ClientConfigOverride, type CompatibilityConfig, type CredentialResolution, type DocsConfig, type GenerationConfig, JsonObject, type LanguageGenerationConfig, type LegacyInput, type OutputConfig, type PublishConfig, type PublishRegistry, type ReadmeCustomSection, type ReadmeEndpoint, type ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, type SdkConfigIrCapability, type SdkConfigIrV1, SdkConfigDiagnostic as SdkConfigIrV1Diagnostic, type SdkConfigIrV1Input, type SerializedSdkConfigIrV1, type SourceConfig, type SourceSpecConfig, type SourceSpecOrigin, type SourceSpecType, type TargetConfig, type TargetLanguage, type UnsupportedField, type WebhookSignature, type WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, languageGenerationConfigSchema, legacyInputSchema, oauthEnvironmentTokenUrlsIssues, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecOriginSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema };
@@ -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
  var retryOverrideShape = {
351
382
  enabled: z.boolean().optional().describe("Whether the generated client retries failed requests."),
352
383
  maxAttempts: z.number().int().min(1).optional().describe("The maximum total request attempts, including the initial attempt."),
@@ -944,9 +975,20 @@ var mcpCustomToolSchema = z.strictObject({
944
975
  "Path to a TypeScript module that exports the tool `definition` and `handler`."
945
976
  )
946
977
  });
978
+ var mcpHooksSchema = z.strictObject({
979
+ path: relativePathSchema.describe(
980
+ "Path to a TypeScript module exporting the MCP request/response hooks (`beforeRequest`, `afterResponse`, `onError`, `transformResult`)."
981
+ )
982
+ });
947
983
  var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
948
984
  serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
949
985
  serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
986
+ instructions: nonEmptyStringSchema.optional().describe(
987
+ "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."
988
+ ),
989
+ appendInstructions: nonEmptyStringSchema.optional().describe(
990
+ "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."
991
+ ),
950
992
  excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
951
993
  tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
952
994
  toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset."),
@@ -955,6 +997,9 @@ var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
955
997
  ),
956
998
  customTools: z.record(mcpToolNameSchema, mcpCustomToolSchema).optional().describe(
957
999
  "Hand-written tools, keyed by tool name, each pointing at a TypeScript module that exports its `definition` and `handler`. Emitted alongside the operation-derived tools."
1000
+ ),
1001
+ hooks: mcpHooksSchema.optional().describe(
1002
+ "Customer-authored request/response hooks, emitted into the generated server as `src/hooks.ts` (replacing the no-op stub)."
958
1003
  )
959
1004
  });
960
1005
  var phpGenerationConfigSchema = z.strictObject({
@@ -1729,6 +1774,9 @@ var sdkConfigIrV1Schema = z.strictObject({
1729
1774
  }
1730
1775
  });
1731
1776
  }
1777
+ oauthEnvironmentTokenUrlsIssues(api, ["api"]).forEach(
1778
+ (issue) => context.addIssue({ code: "custom", ...issue })
1779
+ );
1732
1780
  oauthTokenEndpointsIssues(generation.language?.cli?.oauthTokenEndpoints, api.auth?.schemes, [
1733
1781
  "generation",
1734
1782
  "language",
@@ -1900,7 +1948,10 @@ function deepEqual(left, right) {
1900
1948
  }
1901
1949
 
1902
1950
  // src/sdk-config-ir/v1/wire.ts
1903
- var sdkConfigIrCapabilitySchema = z.enum(["generation.generateFullProject"]);
1951
+ var sdkConfigIrCapabilitySchema = z.enum([
1952
+ "generation.generateFullProject",
1953
+ "api.auth.oauth.environmentTokenUrls"
1954
+ ]);
1904
1955
  var sdkConfigIrV1InputJsonSchema = inputJsonSchema(sdkConfigIrV1Schema);
1905
1956
  function serializeSdkConfigIrV1(value) {
1906
1957
  const parsed = parseSdkConfigIrV1(value);
@@ -1912,6 +1963,9 @@ function serializeSdkConfigIrV1(value) {
1912
1963
  if (parsed.generation.generateFullProject) {
1913
1964
  requiredCapabilities.push("generation.generateFullProject");
1914
1965
  }
1966
+ if (usesEnvironmentTokenUrls(parsed)) {
1967
+ requiredCapabilities.push("api.auth.oauth.environmentTokenUrls");
1968
+ }
1915
1969
  const json = JSON.stringify(wireValue);
1916
1970
  if (json === void 0) {
1917
1971
  throw new Error("SDK Config IR v1 could not be serialized as JSON");
@@ -1924,7 +1978,14 @@ function serializeSdkConfigIrV1(value) {
1924
1978
  function parseSdkConfigIrV1ForConsumption(value) {
1925
1979
  return parseSdkConfigIrV1(stripUnknownProperties(value, sdkConfigIrV1InputJsonSchema));
1926
1980
  }
1981
+ function usesEnvironmentTokenUrls(value) {
1982
+ return (value.api.auth?.schemes ?? []).some(
1983
+ (scheme) => scheme.type === "oauth2" && scheme.flows.some(
1984
+ (flow) => flow.type === "client-credentials" && flow.environmentTokenUrls !== void 0 && Object.keys(flow.environmentTokenUrls).length > 0
1985
+ )
1986
+ );
1987
+ }
1927
1988
 
1928
- export { CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, MCP_TOOL_NAME_PATTERN, SDK_CONFIG_IR_V1_SCHEMA_VERSION, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, cliDistributionConfigSchema, cliDistributionGithubAppSchema, cliDistributionHomebrewSchema, cliDistributionScoopSchema, cliGenerationConfigSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, composerPackageNameSchema, csharpGenerationConfigSchema, dependencySchema, docsConfigSchema, exactSemverSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, githubActionsSecretNameSchema, goGenerationConfigSchema, goModulePathSchema, javaGenerationConfigSchema, jsonObjectSchema, jsonValueSchema, kotlinGenerationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, mcpAvailabilityStatuses, mcpGenerationConfigSchema, nonEmptyStringSchema, oauthTokenEndpointsIssues, outputConfigSchema, packageConfigSchema, parentRelativePathSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, replayConfigSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecOriginSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema, webhookSignatureSchema };
1989
+ export { CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, MCP_TOOL_NAME_PATTERN, SDK_CONFIG_IR_V1_SCHEMA_VERSION, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, cliDistributionConfigSchema, cliDistributionGithubAppSchema, cliDistributionHomebrewSchema, cliDistributionScoopSchema, cliGenerationConfigSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, composerPackageNameSchema, csharpGenerationConfigSchema, dependencySchema, docsConfigSchema, exactSemverSchema, generationConfigSchema, getSdkConfigIrV1Diagnostics, githubActionsSecretNameSchema, goGenerationConfigSchema, goModulePathSchema, javaGenerationConfigSchema, jsonObjectSchema, jsonValueSchema, kotlinGenerationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, mcpAvailabilityStatuses, mcpGenerationConfigSchema, nonEmptyStringSchema, oauthEnvironmentTokenUrlsIssues, oauthTokenEndpointsIssues, outputConfigSchema, packageConfigSchema, parentRelativePathSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, replayConfigSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecOriginSchema, sourceSpecTypeSchema, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema, webhookSignatureSchema };
1929
1990
  //# sourceMappingURL=index.js.map
1930
1991
  //# sourceMappingURL=index.js.map