@postman/sdk-config 0.20.0 → 0.21.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 +159 -4
- 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 +159 -4
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +159 -4
- 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 +159 -4
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +159 -4
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +767 -2
- package/dist/sdk-config/v1/index.d.ts +767 -2
- package/dist/sdk-config/v1/index.js +159 -4
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +149 -2
- 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 +149 -2
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +149 -2
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +446 -2
- package/dist/sdk-config-ir/v1/index.d.ts +446 -2
- package/dist/sdk-config-ir/v1/index.js +149 -2
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-VEqEGvnA.d.cts → typescript-DNic6Rq5.d.cts} +20 -0
- package/dist/{typescript-VEqEGvnA.d.ts → typescript-DNic6Rq5.d.ts} +20 -0
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +24 -12
- package/src/sdk-config-ir/v1/README.md +39 -0
|
@@ -967,6 +967,28 @@ function fieldNameMapSchema(field) {
|
|
|
967
967
|
}
|
|
968
968
|
});
|
|
969
969
|
}
|
|
970
|
+
var SAFE_TEXT_PATTERN = /^[^"\\\x00-\x1f]*$/;
|
|
971
|
+
var HEX_COLOR_PATTERN = /^#[0-9a-fA-F]{6}$/;
|
|
972
|
+
var provisionFlagSchema = zod.z.string().regex(KEBAB_NAME_PATTERN, {
|
|
973
|
+
message: 'profiles.provisionOperation.flag must be a kebab-case flag name without dashes, such as "api-key"'
|
|
974
|
+
});
|
|
975
|
+
var provisionParametersSchema = zod.z.record(zod.z.string(), zod.z.string()).superRefine((value, context) => {
|
|
976
|
+
for (const [key, text] of Object.entries(value)) {
|
|
977
|
+
if (!FIELD_NAME_PATTERN.test(key)) {
|
|
978
|
+
context.addIssue({
|
|
979
|
+
code: "custom",
|
|
980
|
+
message: "profiles.provisionOperation.parameters keys must be field names containing only [A-Za-z0-9_.-]",
|
|
981
|
+
path: [key]
|
|
982
|
+
});
|
|
983
|
+
} else if (!SAFE_TEXT_PATTERN.test(text)) {
|
|
984
|
+
context.addIssue({
|
|
985
|
+
code: "custom",
|
|
986
|
+
message: "profiles.provisionOperation.parameters values must not contain quotes, backslashes or control characters",
|
|
987
|
+
path: [key]
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
});
|
|
970
992
|
var profilesProvisionOperationSchema = zod.z.strictObject({
|
|
971
993
|
operation: dottedCommandPathSchema("profiles.provisionOperation.operation").describe(
|
|
972
994
|
"The dotted command path of the operation that mints a profile credential."
|
|
@@ -974,7 +996,16 @@ var profilesProvisionOperationSchema = zod.z.strictObject({
|
|
|
974
996
|
credential: fieldNameMapSchema("profiles.provisionOperation.credential").refine((value) => Object.keys(value).length > 0, {
|
|
975
997
|
message: "profiles.provisionOperation.credential must map at least one credential field"
|
|
976
998
|
}).describe("Maps each stored credential field to the response field that supplies it."),
|
|
977
|
-
revokeParameters: fieldNameMapSchema("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it.")
|
|
999
|
+
revokeParameters: fieldNameMapSchema("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it."),
|
|
1000
|
+
flag: provisionFlagSchema.optional().describe(
|
|
1001
|
+
'The long name of the "profiles create" flag, without "--". The generator defaults it to "provision", which stays accepted as a hidden alias.'
|
|
1002
|
+
),
|
|
1003
|
+
parameters: provisionParametersSchema.optional().describe(
|
|
1004
|
+
"Extra request values sent with the operation. {cli}, {profile}, {user} and {host} are substituted; a value the profile sets wins."
|
|
1005
|
+
),
|
|
1006
|
+
profileParameters: fieldNameMapSchema("profiles.provisionOperation.profileParameters").optional().describe(
|
|
1007
|
+
"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."
|
|
1008
|
+
)
|
|
978
1009
|
});
|
|
979
1010
|
var profilesConfigSchema = zod.z.strictObject({
|
|
980
1011
|
enabled: zod.z.boolean().describe("Whether the CLI emits profile commands and the global --profile flag."),
|
|
@@ -982,6 +1013,24 @@ var profilesConfigSchema = zod.z.strictObject({
|
|
|
982
1013
|
revokeOperation: dottedCommandPathSchema("profiles.revokeOperation").optional().describe('The dotted command path called by "profiles remove --revoke".'),
|
|
983
1014
|
provisionOperation: profilesProvisionOperationSchema.optional().describe('The operation called by "profiles create --provision" and its response mapping.')
|
|
984
1015
|
});
|
|
1016
|
+
var bannerColorsSchema = (field) => zod.z.array(
|
|
1017
|
+
zod.z.string().regex(HEX_COLOR_PATTERN, {
|
|
1018
|
+
message: `banner.${field} must hold 6-digit hex colours such as "#4949F2"`
|
|
1019
|
+
})
|
|
1020
|
+
);
|
|
1021
|
+
var bannerObjectSchema = zod.z.strictObject({
|
|
1022
|
+
text: nonEmptyStringSchema.describe("The banner text. May span several lines."),
|
|
1023
|
+
colors: bannerColorsSchema("colors").optional().describe("One colour for a solid banner, or several for a gradient along the direction."),
|
|
1024
|
+
lineColors: bannerColorsSchema("lineColors").optional().describe("One colour per line of the banner. Exclusive with colors."),
|
|
1025
|
+
direction: zod.z.enum(["horizontal", "vertical", "diagonal"]).optional().describe("The direction of the gradient. The generator defaults to horizontal."),
|
|
1026
|
+
animate: zod.z.boolean().optional().describe(
|
|
1027
|
+
"Whether root --help on an interactive terminal plays a short shimmer across the banner before printing it."
|
|
1028
|
+
)
|
|
1029
|
+
}).refine((banner) => banner.colors === void 0 || banner.lineColors === void 0, {
|
|
1030
|
+
message: "banner must set either colors (a gradient) or lineColors (one colour per line), not both",
|
|
1031
|
+
path: ["lineColors"]
|
|
1032
|
+
});
|
|
1033
|
+
var bannerSchema = zod.z.union([nonEmptyStringSchema, bannerObjectSchema]);
|
|
985
1034
|
var oauthPropertyPathSchema = zod.z.string().regex(FIELD_NAME_PATTERN, {
|
|
986
1035
|
message: 'must be a property name, or a dotted path to a nested property, such as "data.token"'
|
|
987
1036
|
}).regex(/^[^.]+(\.[^.]+)*$/, { message: "must not have an empty path segment" });
|
|
@@ -1051,6 +1100,9 @@ var cliGenerationConfigSchema = zod.z.strictObject({
|
|
|
1051
1100
|
profiles: profilesConfigSchema.optional().describe("Named profile command configuration."),
|
|
1052
1101
|
splitTypeCrates: zod.z.boolean().optional().describe("Whether generated types are split into one crate per API behind a facade crate."),
|
|
1053
1102
|
userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.'),
|
|
1103
|
+
banner: bannerSchema.optional().describe(
|
|
1104
|
+
"The banner printed above root --help: a string, or text with colours, a gradient direction, per-line colours and an animation switch."
|
|
1105
|
+
),
|
|
1054
1106
|
oauthTokenEndpoints: zod.z.record(nonEmptyStringSchema, oauthTokenEndpointsSchema).optional().describe(
|
|
1055
1107
|
"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."
|
|
1056
1108
|
)
|
|
@@ -1063,10 +1115,18 @@ var CLI_GENERATION_FIELDS = [
|
|
|
1063
1115
|
"rootGroup",
|
|
1064
1116
|
"profiles",
|
|
1065
1117
|
"splitTypeCrates",
|
|
1066
|
-
"userAgentSuffixFlag"
|
|
1118
|
+
"userAgentSuffixFlag",
|
|
1119
|
+
"banner"
|
|
1067
1120
|
];
|
|
1068
1121
|
var PROFILES_FIELDS = ["enabled", "commandName", "revokeOperation"];
|
|
1069
|
-
var PROVISION_OPERATION_FIELDS = [
|
|
1122
|
+
var PROVISION_OPERATION_FIELDS = [
|
|
1123
|
+
"operation",
|
|
1124
|
+
"credential",
|
|
1125
|
+
"revokeParameters",
|
|
1126
|
+
"flag",
|
|
1127
|
+
"parameters",
|
|
1128
|
+
"profileParameters"
|
|
1129
|
+
];
|
|
1070
1130
|
function mapCliGeneration(config, state, basePath, targetIndex) {
|
|
1071
1131
|
const generation = {};
|
|
1072
1132
|
for (const field of CLI_GENERATION_FIELDS) {
|
|
@@ -2651,6 +2711,52 @@ var sdkConfigV1CliOutputConfigSchema = zod.z.discriminatedUnion(
|
|
|
2651
2711
|
var sdkConfigV1ReplayConfigSchema = zod.z.strictObject({
|
|
2652
2712
|
enabled: zod.z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
|
|
2653
2713
|
});
|
|
2714
|
+
var errorResponsesHttpMethodSchema = zod.z.enum([
|
|
2715
|
+
"get",
|
|
2716
|
+
"post",
|
|
2717
|
+
"put",
|
|
2718
|
+
"patch",
|
|
2719
|
+
"delete",
|
|
2720
|
+
"head",
|
|
2721
|
+
"options",
|
|
2722
|
+
"trace"
|
|
2723
|
+
]);
|
|
2724
|
+
var errorResponsesEnsureSchema = zod.z.strictObject({
|
|
2725
|
+
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."),
|
|
2726
|
+
methods: zod.z.array(errorResponsesHttpMethodSchema).optional().describe("The HTTP methods whose operations receive the response. Defaults to all methods.")
|
|
2727
|
+
});
|
|
2728
|
+
var errorResponsesSchema = zod.z.strictObject({
|
|
2729
|
+
schema: zod.z.record(zod.z.string(), zod.z.unknown()).describe(
|
|
2730
|
+
"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."
|
|
2731
|
+
),
|
|
2732
|
+
name: nonEmptyStringSchema.optional().describe(
|
|
2733
|
+
"The name of the generated error body type. Defaults to the schema title, then ProblemDetails."
|
|
2734
|
+
),
|
|
2735
|
+
applyTo: zod.z.enum(["all", "untyped"]).optional().describe(
|
|
2736
|
+
"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."
|
|
2737
|
+
),
|
|
2738
|
+
ensure: zod.z.array(errorResponsesEnsureSchema).optional().describe("Error responses added to operations that do not already declare them.")
|
|
2739
|
+
});
|
|
2740
|
+
var exampleDepthSchema = zod.z.strictObject({
|
|
2741
|
+
maxDepth: zod.z.number().int().min(0).optional().describe("How many levels of optional properties an example includes. 0 leaves them out.")
|
|
2742
|
+
});
|
|
2743
|
+
var exampleGenerationSchema = zod.z.strictObject({
|
|
2744
|
+
request: exampleDepthSchema.optional().describe("Depth of generated request examples."),
|
|
2745
|
+
response: exampleDepthSchema.optional().describe("Depth of generated response examples.")
|
|
2746
|
+
});
|
|
2747
|
+
var resolveAliasesSchema = zod.z.union([
|
|
2748
|
+
zod.z.boolean(),
|
|
2749
|
+
zod.z.strictObject({
|
|
2750
|
+
except: zod.z.array(nonEmptyStringSchema).optional().describe("Component schema names whose aliases are kept.")
|
|
2751
|
+
})
|
|
2752
|
+
]);
|
|
2753
|
+
var endpointFilterSchema = zod.z.strictObject({
|
|
2754
|
+
endpoints: zod.z.array(
|
|
2755
|
+
nonEmptyStringSchema.describe(
|
|
2756
|
+
'An endpoint to keep, as "METHOD /path/template". An entry in another shape is ignored.'
|
|
2757
|
+
)
|
|
2758
|
+
).describe("The only endpoints imported. Every other operation is dropped before conversion.")
|
|
2759
|
+
});
|
|
2654
2760
|
var apiImportSettingsSchema = zod.z.strictObject({
|
|
2655
2761
|
respectNullableSchemas: zod.z.boolean().optional().describe("Whether nullable schemas remain nullable in generated types."),
|
|
2656
2762
|
titleAsSchemaName: zod.z.boolean().optional().describe("Whether a schema title can determine the generated type name."),
|
|
@@ -2679,7 +2785,56 @@ var apiImportSettingsSchema = zod.z.strictObject({
|
|
|
2679
2785
|
resolveSchemaCollisions: zod.z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
|
|
2680
2786
|
asyncApiMessageNaming: zod.z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
|
|
2681
2787
|
defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one."),
|
|
2682
|
-
respectByteFormat: zod.z.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes.")
|
|
2788
|
+
respectByteFormat: zod.z.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes."),
|
|
2789
|
+
additionalPropertiesDefaultsTo: zod.z.boolean().optional().describe(
|
|
2790
|
+
"Whether an object schema that does not declare additionalProperties admits any extra property."
|
|
2791
|
+
),
|
|
2792
|
+
optionalAdditionalProperties: zod.z.boolean().optional().describe("Whether the values of a nullable map are also nullable."),
|
|
2793
|
+
anyOfSiblingPropertiesAsObject: zod.z.boolean().optional().describe(
|
|
2794
|
+
"Whether an anyOf that only constrains which sibling properties are present imports as the object it sits beside."
|
|
2795
|
+
),
|
|
2796
|
+
preserveSingleSchemaOneOf: zod.z.boolean().optional().describe(
|
|
2797
|
+
"Whether a oneOf with a single member stays a union instead of collapsing to that member."
|
|
2798
|
+
),
|
|
2799
|
+
preserveOneOfInAllOf: zod.z.boolean().optional().describe(
|
|
2800
|
+
"Whether a oneOf inside an allOf stays a union of the merged variants instead of being flattened."
|
|
2801
|
+
),
|
|
2802
|
+
removeDiscriminantsFromSchemas: zod.z.enum(["always", "never"]).optional().describe(
|
|
2803
|
+
"Whether the discriminator property is removed from the schemas of a discriminated union."
|
|
2804
|
+
),
|
|
2805
|
+
coerceConstsTo: zod.z.enum(["literals", "enums", "enums-coerceable-to-literals"]).optional().describe(
|
|
2806
|
+
"What a const imports as: a literal, a single-value enum, or an enum that coerceEnumsToLiterals can turn into a literal."
|
|
2807
|
+
),
|
|
2808
|
+
resolveAliases: resolveAliasesSchema.optional().describe(
|
|
2809
|
+
"Whether references to alias-like schemas are replaced by the schema they alias, optionally keeping the named exceptions."
|
|
2810
|
+
),
|
|
2811
|
+
respectForwardCompatibleEnums: zod.z.boolean().optional().describe(
|
|
2812
|
+
"Whether a query or header parameter that accepts an enum or any string keeps both options."
|
|
2813
|
+
),
|
|
2814
|
+
inferForwardCompatible: zod.z.boolean().optional().describe(
|
|
2815
|
+
"Whether a oneOf or anyOf of an enum and a plain string imports as a forward-compatible enum."
|
|
2816
|
+
),
|
|
2817
|
+
respectOperationIdWordBoundaries: zod.z.boolean().optional().describe(
|
|
2818
|
+
"Whether operation ids are split at every word boundary when method names are derived."
|
|
2819
|
+
),
|
|
2820
|
+
namespacedErrors: zod.z.boolean().optional().describe("Whether an error response takes the x-fern-sdk-namespace it declares."),
|
|
2821
|
+
defaultFormParameterEncoding: zod.z.enum(["form", "json"]).optional().describe("How multipart form properties without an explicit content type are encoded."),
|
|
2822
|
+
respectParameterContent: zod.z.boolean().optional().describe(
|
|
2823
|
+
"Whether a header declared with a JSON content entry instead of a schema is typed by that content."
|
|
2824
|
+
),
|
|
2825
|
+
useBytesForBinaryResponse: zod.z.boolean().optional().describe("Whether a binary response is returned as bytes instead of a file stream."),
|
|
2826
|
+
useReadVariantForResponses: zod.z.boolean().optional().describe(
|
|
2827
|
+
"Whether responses use the read variant of a schema that has read-only properties. Needs respectReadonlySchemas."
|
|
2828
|
+
),
|
|
2829
|
+
exampleGeneration: exampleGenerationSchema.optional().describe("How deep the examples generated for operations without one go."),
|
|
2830
|
+
filter: endpointFilterSchema.optional().describe("Restricts the import to a list of endpoints."),
|
|
2831
|
+
groupEnvironmentsByHost: zod.z.boolean().optional().describe("Whether HTTP and WebSocket servers with the same host become one environment."),
|
|
2832
|
+
multiServerStrategy: zod.z.enum(["environment-per-server", "urls-per-environment"]).optional().describe(
|
|
2833
|
+
"Whether each named server is its own environment or a named URL of one environment."
|
|
2834
|
+
),
|
|
2835
|
+
inferDefaultEnvironment: zod.z.boolean().optional().describe("Whether the first server becomes the default environment."),
|
|
2836
|
+
respectPerSpecBasePath: zod.z.boolean().optional().describe("Whether each spec's plain x-fern-base-path applies to that spec's endpoints."),
|
|
2837
|
+
errorResponses: errorResponsesSchema.optional().describe("A shared error body schema applied to the 4xx/5xx responses of the specs.")
|
|
2683
2838
|
});
|
|
2684
2839
|
var sourceSpecTypeSchema = zod.z.enum([
|
|
2685
2840
|
"openapi",
|