@postman/sdk-config 0.3.4 → 0.4.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/README.md +3 -1
- package/dist/index.cjs +56 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +55 -10
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +51 -9
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.d.cts +2 -2
- package/dist/sdk-config/index.d.ts +2 -2
- package/dist/sdk-config/index.js +51 -10
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +51 -9
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +95 -6
- package/dist/sdk-config/v1/index.d.ts +95 -6
- package/dist/sdk-config/v1/index.js +51 -10
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +19 -0
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +2 -2
- package/dist/sdk-config-ir/index.d.ts +2 -2
- package/dist/sdk-config-ir/index.js +19 -1
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +19 -0
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +84 -9
- package/dist/sdk-config-ir/v1/index.d.ts +84 -9
- package/dist/sdk-config-ir/v1/index.js +19 -1
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-CKRe_6MB.d.cts → typescript-BruxA5zG.d.cts} +10 -2
- package/dist/{typescript-CKRe_6MB.d.ts → typescript-BruxA5zG.d.ts} +10 -2
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +3 -0
- package/src/sdk-config-ir/v1/README.md +64 -37
package/README.md
CHANGED
|
@@ -39,6 +39,7 @@ const input: SdkConfigV1Input = {
|
|
|
39
39
|
},
|
|
40
40
|
client: { timeoutMs: 30_000 },
|
|
41
41
|
output: { delivery: 'zip', fileName: 'example-typescript.zip' },
|
|
42
|
+
replay: { enabled: false },
|
|
42
43
|
docs: { includeApiReference: true },
|
|
43
44
|
generation: { includeWatermark: true },
|
|
44
45
|
targets: [
|
|
@@ -59,7 +60,8 @@ Use `parseSdkConfigV1` when entering the runtime boundary and materializing the
|
|
|
59
60
|
defaults. For validation without throwing, use the exported schema:
|
|
60
61
|
|
|
61
62
|
Empty top-level `api`, `client`, `package`, `docs`, and `generation` blocks may be omitted from the
|
|
62
|
-
customer document. Runtime parsing materializes those blocks and their versioned defaults.
|
|
63
|
+
customer document. Runtime parsing materializes those blocks and their versioned defaults. The
|
|
64
|
+
optional top-level `replay` block is preserved only when authored.
|
|
63
65
|
|
|
64
66
|
```ts
|
|
65
67
|
import { sdkConfigV1Schema } from '@postman/sdk-config/sdk-config/v1';
|
package/dist/index.cjs
CHANGED
|
@@ -478,9 +478,9 @@ function takeBoolean(value, aliases, state, basePath) {
|
|
|
478
478
|
consume(state, located.path);
|
|
479
479
|
return located.value;
|
|
480
480
|
}
|
|
481
|
-
function takeNumber(value, aliases, state, basePath) {
|
|
481
|
+
function takeNumber(value, aliases, state, basePath, minimum = 0) {
|
|
482
482
|
const located = locate(value, aliases, basePath);
|
|
483
|
-
if (!located || !isNonNegativeNumber(located.value) || !Number.isInteger(located.value))
|
|
483
|
+
if (!located || !isNonNegativeNumber(located.value) || !Number.isInteger(located.value) || located.value < minimum)
|
|
484
484
|
return void 0;
|
|
485
485
|
consume(state, located.path);
|
|
486
486
|
return located.value;
|
|
@@ -1248,6 +1248,9 @@ var sdkConfigV1OutputConfigSchema = zod.z.discriminatedUnion(
|
|
|
1248
1248
|
// src/sdk-config/v1/package.ts
|
|
1249
1249
|
var sdkConfigV1DependencySchema = dependencySchema;
|
|
1250
1250
|
var sdkConfigV1PackageConfigSchema = packageConfigSchema;
|
|
1251
|
+
var sdkConfigV1ReplayConfigSchema = zod.z.strictObject({
|
|
1252
|
+
enabled: zod.z.boolean()
|
|
1253
|
+
});
|
|
1251
1254
|
var apiImportSettingsSchema = zod.z.strictObject({
|
|
1252
1255
|
respectNullableSchemas: zod.z.boolean().optional(),
|
|
1253
1256
|
titleAsSchemaName: zod.z.boolean().optional(),
|
|
@@ -1262,6 +1265,12 @@ var apiImportSettingsSchema = zod.z.strictObject({
|
|
|
1262
1265
|
groupMultiApiEnvironments: zod.z.boolean().optional(),
|
|
1263
1266
|
ignoreTags: zod.z.boolean().optional(),
|
|
1264
1267
|
disambiguateRequestNames: zod.z.boolean().optional(),
|
|
1268
|
+
respectReadonlySchemas: zod.z.boolean().optional(),
|
|
1269
|
+
discriminatedUnionV2: zod.z.boolean().optional(),
|
|
1270
|
+
undiscriminatedUnionsWithLiterals: zod.z.boolean().optional(),
|
|
1271
|
+
inlineAllOfSchemas: zod.z.boolean().optional(),
|
|
1272
|
+
resolveSchemaCollisions: zod.z.boolean().optional(),
|
|
1273
|
+
asyncApiMessageNaming: zod.z.enum(["v1", "v2"]).optional(),
|
|
1265
1274
|
defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional()
|
|
1266
1275
|
});
|
|
1267
1276
|
var sourceSpecTypeSchema = zod.z.enum([
|
|
@@ -1429,6 +1438,14 @@ var pythonGenerationConfigSchema = zod.z.strictObject({
|
|
|
1429
1438
|
pydanticVersion: nonEmptyStringSchema.optional(),
|
|
1430
1439
|
pydantic: pydanticConfigSchema.optional(),
|
|
1431
1440
|
client: pythonClientSchema.optional(),
|
|
1441
|
+
/** Default followed by generated sync and async HTTP clients when the caller does not override it. */
|
|
1442
|
+
followRedirectsByDefault: zod.z.boolean().optional(),
|
|
1443
|
+
/** Chunk size passed to Python byte-stream iterators. */
|
|
1444
|
+
defaultBytesStreamChunkSize: zod.z.number().int().positive().optional(),
|
|
1445
|
+
/** Python interpreter recursion limit installed by the generated package at import time. */
|
|
1446
|
+
recursionLimit: zod.z.number().int().gt(1e3).optional(),
|
|
1447
|
+
/** Published Python extras, keyed by extra name with package dependency names as values. */
|
|
1448
|
+
extras: zod.z.record(nonEmptyStringSchema, zod.z.array(nonEmptyStringSchema)).optional(),
|
|
1432
1449
|
alwaysInitializeOptionals: zod.z.boolean().optional(),
|
|
1433
1450
|
useTypedDictRequests: zod.z.boolean().optional(),
|
|
1434
1451
|
additionalInitExports: zod.z.array(additionalInitExportSchema).optional()
|
|
@@ -1650,6 +1667,7 @@ var sdkConfigV1Schema = zod.z.strictObject({
|
|
|
1650
1667
|
client: sdkConfigV1ClientConfigSchema.prefault({}),
|
|
1651
1668
|
package: sdkConfigV1PackageConfigSchema.prefault({}),
|
|
1652
1669
|
output: sdkConfigV1OutputConfigSchema.optional(),
|
|
1670
|
+
replay: sdkConfigV1ReplayConfigSchema.optional(),
|
|
1653
1671
|
docs: sdkConfigV1DocsConfigSchema.prefault({}),
|
|
1654
1672
|
generation: sdkConfigV1GenerationConfigSchema.prefault({}),
|
|
1655
1673
|
targets: zod.z.array(sdkConfigV1TargetSchema).min(1)
|
|
@@ -2023,6 +2041,16 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2023
2041
|
...optional("statusCodeProfile", statusCodeProfile)
|
|
2024
2042
|
};
|
|
2025
2043
|
}
|
|
2044
|
+
const pythonClient = language === "python" ? takeObject(config, ["client"], state, basePath) : void 0;
|
|
2045
|
+
const directClientName = takeString(config, ["clientName", "clientClassName"], state, basePath);
|
|
2046
|
+
const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : void 0;
|
|
2047
|
+
const directExportedClientName = takeString(
|
|
2048
|
+
config,
|
|
2049
|
+
["exportedClientName", "exportedClientClassName"],
|
|
2050
|
+
state,
|
|
2051
|
+
basePath
|
|
2052
|
+
);
|
|
2053
|
+
const nestedExportedClientName = pythonClient ? takeString(pythonClient.value, ["exportedClassName"], state, pythonClient.path) : void 0;
|
|
2026
2054
|
const naming = compact({
|
|
2027
2055
|
pagerName: takeString(
|
|
2028
2056
|
config,
|
|
@@ -2030,13 +2058,8 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
2030
2058
|
state,
|
|
2031
2059
|
basePath
|
|
2032
2060
|
),
|
|
2033
|
-
clientName:
|
|
2034
|
-
exportedClientName:
|
|
2035
|
-
config,
|
|
2036
|
-
["exportedClientName", "exportedClientClassName"],
|
|
2037
|
-
state,
|
|
2038
|
-
basePath
|
|
2039
|
-
),
|
|
2061
|
+
clientName: directClientName ?? nestedClientName,
|
|
2062
|
+
exportedClientName: directExportedClientName ?? nestedExportedClientName,
|
|
2040
2063
|
environmentTypeName: takeString(
|
|
2041
2064
|
config,
|
|
2042
2065
|
["environmentClassName", "environmentEnumName"],
|
|
@@ -2134,9 +2157,27 @@ function mapPython(config, state, packageConfig, basePath) {
|
|
|
2134
2157
|
const packageName = takeString(config, ["pypiPackageName"], state, basePath);
|
|
2135
2158
|
if (moduleName !== void 0) packageConfig.moduleName = moduleName;
|
|
2136
2159
|
if (packageName !== void 0) packageConfig.packageName = packageName;
|
|
2160
|
+
const client = takeObject(config, ["client"], state, basePath);
|
|
2161
|
+
const directFileName = takeString(config, ["clientFilename"], state, basePath);
|
|
2162
|
+
const nestedFileName = client ? takeString(client.value, ["filename"], state, client.path) : void 0;
|
|
2163
|
+
const exportedFileName = client ? takeString(client.value, ["exportedFilename"], state, client.path) : void 0;
|
|
2137
2164
|
return compact({
|
|
2138
2165
|
pythonVersion: takeString(config, ["pythonVersion", "pyprojectPythonVersion"], state, basePath),
|
|
2139
2166
|
pydanticVersion: takeString(config, ["pydanticVersion"], state, basePath),
|
|
2167
|
+
...optionalObject(
|
|
2168
|
+
"client",
|
|
2169
|
+
compact({ fileName: directFileName ?? nestedFileName, exportedFileName })
|
|
2170
|
+
),
|
|
2171
|
+
followRedirectsByDefault: takeBoolean(config, ["followRedirectsByDefault"], state, basePath),
|
|
2172
|
+
defaultBytesStreamChunkSize: takeNumber(
|
|
2173
|
+
config,
|
|
2174
|
+
["defaultBytesStreamChunkSize"],
|
|
2175
|
+
state,
|
|
2176
|
+
basePath,
|
|
2177
|
+
1
|
|
2178
|
+
),
|
|
2179
|
+
recursionLimit: takeNumber(config, ["recursionLimit"], state, basePath, 1001),
|
|
2180
|
+
extras: takeStringArrayRecord(config, ["extras"], state, basePath),
|
|
2140
2181
|
alwaysInitializeOptionals: takeBoolean(config, ["alwaysInitializeOptionals"], state, basePath),
|
|
2141
2182
|
useTypedDictRequests: takeBoolean(config, ["useTypedDictRequests"], state, basePath),
|
|
2142
2183
|
additionalInitExports: takePythonAdditionalInitExports(config, state, basePath)
|
|
@@ -2838,6 +2879,9 @@ var outputConfigSchema = zod.z.discriminatedUnion(
|
|
|
2838
2879
|
error: 'output.delivery must be one of "files", "zip", or "github"'
|
|
2839
2880
|
}
|
|
2840
2881
|
);
|
|
2882
|
+
var replayConfigSchema = zod.z.strictObject({
|
|
2883
|
+
enabled: zod.z.boolean()
|
|
2884
|
+
});
|
|
2841
2885
|
var sourceSpecConfigSchema = zod.z.strictObject({
|
|
2842
2886
|
id: nonEmptyStringSchema.optional(),
|
|
2843
2887
|
name: nonEmptyStringSchema.optional(),
|
|
@@ -2969,6 +3013,7 @@ var sdkConfigIrV1Schema = zod.z.strictObject({
|
|
|
2969
3013
|
client: clientConfigSchema,
|
|
2970
3014
|
package: packageConfigSchema,
|
|
2971
3015
|
output: outputConfigSchema,
|
|
3016
|
+
replay: replayConfigSchema.optional(),
|
|
2972
3017
|
docs: docsConfigSchema,
|
|
2973
3018
|
generation: generationConfigSchema,
|
|
2974
3019
|
compatibility: compatibilityConfigSchema.optional()
|
|
@@ -3073,6 +3118,7 @@ exports.pythonGenerationConfigSchema = pythonGenerationConfigSchema;
|
|
|
3073
3118
|
exports.readmeCustomSectionSchema = readmeCustomSectionSchema;
|
|
3074
3119
|
exports.readmeEndpointSchema = readmeEndpointSchema;
|
|
3075
3120
|
exports.relativePathSchema = relativePathSchema;
|
|
3121
|
+
exports.replayConfigSchema = replayConfigSchema;
|
|
3076
3122
|
exports.rubyGenerationConfigSchema = rubyGenerationConfigSchema;
|
|
3077
3123
|
exports.rustGenerationConfigSchema = rustGenerationConfigSchema;
|
|
3078
3124
|
exports.sdkConfigIrV1Schema = sdkConfigIrV1Schema;
|
|
@@ -3104,6 +3150,7 @@ exports.sdkConfigV1PythonGenerationConfigSchema = pythonGenerationConfigSchema;
|
|
|
3104
3150
|
exports.sdkConfigV1ReadmeCustomSectionSchema = sdkConfigV1ReadmeCustomSectionSchema;
|
|
3105
3151
|
exports.sdkConfigV1ReadmeEndpointSchema = sdkConfigV1ReadmeEndpointSchema;
|
|
3106
3152
|
exports.sdkConfigV1RelativePathSchema = relativePathSchema;
|
|
3153
|
+
exports.sdkConfigV1ReplayConfigSchema = sdkConfigV1ReplayConfigSchema;
|
|
3107
3154
|
exports.sdkConfigV1RubyGenerationConfigSchema = rubyGenerationConfigSchema;
|
|
3108
3155
|
exports.sdkConfigV1RustGenerationConfigSchema = rustGenerationConfigSchema;
|
|
3109
3156
|
exports.sdkConfigV1Schema = sdkConfigV1Schema;
|