@postman/sdk-config 0.21.0 → 0.24.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 +220 -253
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +220 -254
  6. package/dist/index.js.map +1 -1
  7. package/dist/sdk-config/index.cjs +219 -253
  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 +219 -253
  12. package/dist/sdk-config/index.js.map +1 -1
  13. package/dist/sdk-config/v1/index.cjs +219 -253
  14. package/dist/sdk-config/v1/index.cjs.map +1 -1
  15. package/dist/sdk-config/v1/index.d.cts +26 -767
  16. package/dist/sdk-config/v1/index.d.ts +26 -767
  17. package/dist/sdk-config/v1/index.js +219 -253
  18. package/dist/sdk-config/v1/index.js.map +1 -1
  19. package/dist/sdk-config-ir/index.cjs +34 -150
  20. package/dist/sdk-config-ir/index.cjs.map +1 -1
  21. package/dist/sdk-config-ir/index.d.cts +1 -1
  22. package/dist/sdk-config-ir/index.d.ts +1 -1
  23. package/dist/sdk-config-ir/index.js +34 -151
  24. package/dist/sdk-config-ir/index.js.map +1 -1
  25. package/dist/sdk-config-ir/v1/index.cjs +34 -150
  26. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  27. package/dist/sdk-config-ir/v1/index.d.cts +38 -446
  28. package/dist/sdk-config-ir/v1/index.d.ts +38 -446
  29. package/dist/sdk-config-ir/v1/index.js +34 -151
  30. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  31. package/dist/{typescript-DNic6Rq5.d.cts → typescript-BcBGIPrg.d.cts} +30 -21
  32. package/dist/{typescript-DNic6Rq5.d.ts → typescript-BcBGIPrg.d.ts} +30 -21
  33. package/package.json +1 -1
  34. package/src/sdk-config/v1/README.md +12 -24
  35. package/src/sdk-config-ir/v1/README.md +0 -39
@@ -715,28 +715,6 @@ function fieldNameMapSchema(field) {
715
715
  }
716
716
  });
717
717
  }
718
- var SAFE_TEXT_PATTERN = /^[^"\\\x00-\x1f]*$/;
719
- var HEX_COLOR_PATTERN = /^#[0-9a-fA-F]{6}$/;
720
- var provisionFlagSchema = z.string().regex(KEBAB_NAME_PATTERN, {
721
- message: 'profiles.provisionOperation.flag must be a kebab-case flag name without dashes, such as "api-key"'
722
- });
723
- var provisionParametersSchema = z.record(z.string(), z.string()).superRefine((value, context) => {
724
- for (const [key, text] of Object.entries(value)) {
725
- if (!FIELD_NAME_PATTERN.test(key)) {
726
- context.addIssue({
727
- code: "custom",
728
- message: "profiles.provisionOperation.parameters keys must be field names containing only [A-Za-z0-9_.-]",
729
- path: [key]
730
- });
731
- } else if (!SAFE_TEXT_PATTERN.test(text)) {
732
- context.addIssue({
733
- code: "custom",
734
- message: "profiles.provisionOperation.parameters values must not contain quotes, backslashes or control characters",
735
- path: [key]
736
- });
737
- }
738
- }
739
- });
740
718
  var profilesProvisionOperationSchema = z.strictObject({
741
719
  operation: dottedCommandPathSchema("profiles.provisionOperation.operation").describe(
742
720
  "The dotted command path of the operation that mints a profile credential."
@@ -744,16 +722,7 @@ var profilesProvisionOperationSchema = z.strictObject({
744
722
  credential: fieldNameMapSchema("profiles.provisionOperation.credential").refine((value) => Object.keys(value).length > 0, {
745
723
  message: "profiles.provisionOperation.credential must map at least one credential field"
746
724
  }).describe("Maps each stored credential field to the response field that supplies it."),
747
- revokeParameters: fieldNameMapSchema("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it."),
748
- flag: provisionFlagSchema.optional().describe(
749
- 'The long name of the "profiles create" flag, without "--". The generator defaults it to "provision", which stays accepted as a hidden alias.'
750
- ),
751
- parameters: provisionParametersSchema.optional().describe(
752
- "Extra request values sent with the operation. {cli}, {profile}, {user} and {host} are substituted; a value the profile sets wins."
753
- ),
754
- profileParameters: fieldNameMapSchema("profiles.provisionOperation.profileParameters").optional().describe(
755
- "Maps each profile parameter to the typed credential field it is copied from, so requests keep it once the credential is replaced by the provisioned key."
756
- )
725
+ revokeParameters: fieldNameMapSchema("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it.")
757
726
  });
758
727
  var profilesConfigSchema = z.strictObject({
759
728
  enabled: z.boolean().describe("Whether the CLI emits profile commands and the global --profile flag."),
@@ -761,24 +730,6 @@ var profilesConfigSchema = z.strictObject({
761
730
  revokeOperation: dottedCommandPathSchema("profiles.revokeOperation").optional().describe('The dotted command path called by "profiles remove --revoke".'),
762
731
  provisionOperation: profilesProvisionOperationSchema.optional().describe('The operation called by "profiles create --provision" and its response mapping.')
763
732
  });
764
- var bannerColorsSchema = (field) => z.array(
765
- z.string().regex(HEX_COLOR_PATTERN, {
766
- message: `banner.${field} must hold 6-digit hex colours such as "#4949F2"`
767
- })
768
- );
769
- var bannerObjectSchema = z.strictObject({
770
- text: nonEmptyStringSchema.describe("The banner text. May span several lines."),
771
- colors: bannerColorsSchema("colors").optional().describe("One colour for a solid banner, or several for a gradient along the direction."),
772
- lineColors: bannerColorsSchema("lineColors").optional().describe("One colour per line of the banner. Exclusive with colors."),
773
- direction: z.enum(["horizontal", "vertical", "diagonal"]).optional().describe("The direction of the gradient. The generator defaults to horizontal."),
774
- animate: z.boolean().optional().describe(
775
- "Whether root --help on an interactive terminal plays a short shimmer across the banner before printing it."
776
- )
777
- }).refine((banner) => banner.colors === void 0 || banner.lineColors === void 0, {
778
- message: "banner must set either colors (a gradient) or lineColors (one colour per line), not both",
779
- path: ["lineColors"]
780
- });
781
- var bannerSchema = z.union([nonEmptyStringSchema, bannerObjectSchema]);
782
733
  var oauthPropertyPathSchema = z.string().regex(FIELD_NAME_PATTERN, {
783
734
  message: 'must be a property name, or a dotted path to a nested property, such as "data.token"'
784
735
  }).regex(/^[^.]+(\.[^.]+)*$/, { message: "must not have an empty path segment" });
@@ -848,9 +799,6 @@ var cliGenerationConfigSchema = z.strictObject({
848
799
  profiles: profilesConfigSchema.optional().describe("Named profile command configuration."),
849
800
  splitTypeCrates: z.boolean().optional().describe("Whether generated types are split into one crate per API behind a facade crate."),
850
801
  userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.'),
851
- banner: bannerSchema.optional().describe(
852
- "The banner printed above root --help: a string, or text with colours, a gradient direction, per-line colours and an animation switch."
853
- ),
854
802
  oauthTokenEndpoints: z.record(nonEmptyStringSchema, oauthTokenEndpointsSchema).optional().describe(
855
803
  "Per OAuth scheme id (api.auth.schemes[].id), the names of the properties of the token and refresh requests and responses, for the client credentials flow of an API whose token endpoint does not use the RFC 6749 names."
856
804
  )
@@ -980,12 +928,42 @@ var mcpToolsetNameSchema = nonEmptyStringSchema.refine(
980
928
  (name) => name !== "default" && /^[a-z0-9-]+$/.test(name),
981
929
  'toolset names must match [a-z0-9-]+ and cannot be "default"'
982
930
  );
931
+ var MCP_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
932
+ var mcpToolNameSchema = nonEmptyStringSchema.refine(
933
+ (name) => MCP_TOOL_NAME_PATTERN.test(name),
934
+ "tool names must match [a-zA-Z0-9_-]{1,64}"
935
+ );
936
+ var mcpMergedToolSchema = mcpToolFilterSchema.extend({
937
+ dispatchOn: nonEmptyStringSchema.describe(
938
+ "The tool argument whose value selects which member operation to call."
939
+ ),
940
+ description: nonEmptyStringSchema.optional().describe("Overrides the generated description of the merged tool.")
941
+ });
942
+ var mcpCustomToolSchema = z.strictObject({
943
+ path: relativePathSchema.describe(
944
+ "Path to a TypeScript module that exports the tool `definition` and `handler`."
945
+ )
946
+ });
947
+ var mcpHooksSchema = z.strictObject({
948
+ path: relativePathSchema.describe(
949
+ "Path to a TypeScript module exporting the MCP request/response hooks (`beforeRequest`, `afterResponse`, `onError`, `transformResult`)."
950
+ )
951
+ });
983
952
  var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
984
953
  serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
985
954
  serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
986
955
  excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
987
956
  tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
988
- toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset.")
957
+ toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset."),
958
+ mergedTools: z.record(mcpToolNameSchema, mcpMergedToolSchema).optional().describe(
959
+ "Tools that fan several operations into one, dispatching on an argument. Each entry selects its member operations with the same include/exclude filter as `tools`."
960
+ ),
961
+ customTools: z.record(mcpToolNameSchema, mcpCustomToolSchema).optional().describe(
962
+ "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."
963
+ ),
964
+ hooks: mcpHooksSchema.optional().describe(
965
+ "Customer-authored request/response hooks, emitted into the generated server as `src/hooks.ts` (replacing the no-op stub)."
966
+ )
989
967
  });
990
968
  var phpGenerationConfigSchema = z.strictObject({
991
969
  propertyAccess: z.enum(["public", "private"]).optional().describe("The visibility of generated PHP model properties."),
@@ -1527,52 +1505,6 @@ var outputConfigSchema = z.discriminatedUnion(
1527
1505
  var replayConfigSchema = z.strictObject({
1528
1506
  enabled: z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
1529
1507
  });
1530
- var errorResponsesHttpMethodSchema = z.enum([
1531
- "get",
1532
- "post",
1533
- "put",
1534
- "patch",
1535
- "delete",
1536
- "head",
1537
- "options",
1538
- "trace"
1539
- ]);
1540
- var errorResponsesEnsureSchema = z.strictObject({
1541
- statusCode: z.number().int().min(400).max(599).describe("The 4xx or 5xx status code added to an operation that does not declare it."),
1542
- methods: z.array(errorResponsesHttpMethodSchema).optional().describe("The HTTP methods whose operations receive the response. Defaults to all methods.")
1543
- });
1544
- var errorResponsesSchema = z.strictObject({
1545
- schema: z.record(z.string(), z.unknown()).describe(
1546
- "The OpenAPI schema of error response bodies, inline. The client resolves a schema file to its content before the config reaches the generator. Any $ref inside must be a local #/components/... pointer into the spec it is applied to."
1547
- ),
1548
- name: nonEmptyStringSchema.optional().describe(
1549
- "The name of the generated error body type. Defaults to the schema title, then ProblemDetails."
1550
- ),
1551
- applyTo: z.enum(["all", "untyped"]).optional().describe(
1552
- "all replaces the body of every 4xx/5xx response with the schema. untyped only fills in 4xx/5xx responses that declare no body schema. Defaults to all."
1553
- ),
1554
- ensure: z.array(errorResponsesEnsureSchema).optional().describe("Error responses added to operations that do not already declare them.")
1555
- });
1556
- var exampleDepthSchema = z.strictObject({
1557
- maxDepth: z.number().int().min(0).optional().describe("How many levels of optional properties an example includes. 0 leaves them out.")
1558
- });
1559
- var exampleGenerationSchema = z.strictObject({
1560
- request: exampleDepthSchema.optional().describe("Depth of generated request examples."),
1561
- response: exampleDepthSchema.optional().describe("Depth of generated response examples.")
1562
- });
1563
- var resolveAliasesSchema = z.union([
1564
- z.boolean(),
1565
- z.strictObject({
1566
- except: z.array(nonEmptyStringSchema).optional().describe("Component schema names whose aliases are kept.")
1567
- })
1568
- ]);
1569
- var endpointFilterSchema = z.strictObject({
1570
- endpoints: z.array(
1571
- nonEmptyStringSchema.describe(
1572
- 'An endpoint to keep, as "METHOD /path/template". An entry in another shape is ignored.'
1573
- )
1574
- ).describe("The only endpoints imported. Every other operation is dropped before conversion.")
1575
- });
1576
1508
  var apiImportSettingsSchema = z.strictObject({
1577
1509
  respectNullableSchemas: z.boolean().optional().describe("Whether nullable schemas remain nullable in generated types."),
1578
1510
  titleAsSchemaName: z.boolean().optional().describe("Whether a schema title can determine the generated type name."),
@@ -1601,56 +1533,7 @@ var apiImportSettingsSchema = z.strictObject({
1601
1533
  resolveSchemaCollisions: z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
1602
1534
  asyncApiMessageNaming: z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
1603
1535
  defaultIntegerFormat: z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one."),
1604
- respectByteFormat: z.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes."),
1605
- additionalPropertiesDefaultsTo: z.boolean().optional().describe(
1606
- "Whether an object schema that does not declare additionalProperties admits any extra property."
1607
- ),
1608
- optionalAdditionalProperties: z.boolean().optional().describe("Whether the values of a nullable map are also nullable."),
1609
- anyOfSiblingPropertiesAsObject: z.boolean().optional().describe(
1610
- "Whether an anyOf that only constrains which sibling properties are present imports as the object it sits beside."
1611
- ),
1612
- preserveSingleSchemaOneOf: z.boolean().optional().describe(
1613
- "Whether a oneOf with a single member stays a union instead of collapsing to that member."
1614
- ),
1615
- preserveOneOfInAllOf: z.boolean().optional().describe(
1616
- "Whether a oneOf inside an allOf stays a union of the merged variants instead of being flattened."
1617
- ),
1618
- removeDiscriminantsFromSchemas: z.enum(["always", "never"]).optional().describe(
1619
- "Whether the discriminator property is removed from the schemas of a discriminated union."
1620
- ),
1621
- coerceConstsTo: z.enum(["literals", "enums", "enums-coerceable-to-literals"]).optional().describe(
1622
- "What a const imports as: a literal, a single-value enum, or an enum that coerceEnumsToLiterals can turn into a literal."
1623
- ),
1624
- resolveAliases: resolveAliasesSchema.optional().describe(
1625
- "Whether references to alias-like schemas are replaced by the schema they alias, optionally keeping the named exceptions."
1626
- ),
1627
- respectForwardCompatibleEnums: z.boolean().optional().describe(
1628
- "Whether a query or header parameter that accepts an enum or any string keeps both options."
1629
- ),
1630
- inferForwardCompatible: z.boolean().optional().describe(
1631
- "Whether a oneOf or anyOf of an enum and a plain string imports as a forward-compatible enum."
1632
- ),
1633
- respectOperationIdWordBoundaries: z.boolean().optional().describe(
1634
- "Whether operation ids are split at every word boundary when method names are derived."
1635
- ),
1636
- namespacedErrors: z.boolean().optional().describe("Whether an error response takes the x-fern-sdk-namespace it declares."),
1637
- defaultFormParameterEncoding: z.enum(["form", "json"]).optional().describe("How multipart form properties without an explicit content type are encoded."),
1638
- respectParameterContent: z.boolean().optional().describe(
1639
- "Whether a header declared with a JSON content entry instead of a schema is typed by that content."
1640
- ),
1641
- useBytesForBinaryResponse: z.boolean().optional().describe("Whether a binary response is returned as bytes instead of a file stream."),
1642
- useReadVariantForResponses: z.boolean().optional().describe(
1643
- "Whether responses use the read variant of a schema that has read-only properties. Needs respectReadonlySchemas."
1644
- ),
1645
- exampleGeneration: exampleGenerationSchema.optional().describe("How deep the examples generated for operations without one go."),
1646
- filter: endpointFilterSchema.optional().describe("Restricts the import to a list of endpoints."),
1647
- groupEnvironmentsByHost: z.boolean().optional().describe("Whether HTTP and WebSocket servers with the same host become one environment."),
1648
- multiServerStrategy: z.enum(["environment-per-server", "urls-per-environment"]).optional().describe(
1649
- "Whether each named server is its own environment or a named URL of one environment."
1650
- ),
1651
- inferDefaultEnvironment: z.boolean().optional().describe("Whether the first server becomes the default environment."),
1652
- respectPerSpecBasePath: z.boolean().optional().describe("Whether each spec's plain x-fern-base-path applies to that spec's endpoints."),
1653
- errorResponses: errorResponsesSchema.optional().describe("A shared error body schema applied to the 4xx/5xx responses of the specs.")
1536
+ respectByteFormat: z.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes.")
1654
1537
  });
1655
1538
  var sourceSpecTypeSchema = z.enum([
1656
1539
  "openapi",
@@ -2050,6 +1933,6 @@ function parseSdkConfigIrV1ForConsumption(value) {
2050
1933
  return parseSdkConfigIrV1(stripUnknownProperties(value, sdkConfigIrV1InputJsonSchema));
2051
1934
  }
2052
1935
 
2053
- export { CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, 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 };
1936
+ 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 };
2054
1937
  //# sourceMappingURL=index.js.map
2055
1938
  //# sourceMappingURL=index.js.map