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