@postman/sdk-config 0.2.0 → 0.3.1
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 -2
- package/dist/index.cjs +82 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +82 -18
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +14 -12
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.js +14 -12
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +14 -12
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +10 -10
- package/dist/sdk-config/v1/index.d.ts +10 -10
- package/dist/sdk-config/v1/index.js +14 -12
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +70 -8
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.js +70 -8
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +70 -8
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +440 -0
- package/dist/sdk-config-ir/v1/index.d.ts +440 -0
- package/dist/sdk-config-ir/v1/index.js +70 -8
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +3 -3
- package/src/sdk-config-ir/v1/README.md +89 -82
|
@@ -958,7 +958,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
958
958
|
}>>;
|
|
959
959
|
}, z.core.$strict>>;
|
|
960
960
|
}, z.core.$strict>;
|
|
961
|
-
api: z.ZodObject<{
|
|
961
|
+
api: z.ZodPrefault<z.ZodObject<{
|
|
962
962
|
baseUrl: z.ZodDefault<z.ZodString>;
|
|
963
963
|
environments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
964
964
|
name: z.ZodString;
|
|
@@ -1091,8 +1091,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1091
1091
|
environmentVariable: z.ZodOptional<z.ZodString>;
|
|
1092
1092
|
}, z.core.$strict>>>;
|
|
1093
1093
|
audiences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1094
|
-
}, z.core.$strict
|
|
1095
|
-
client: z.ZodObject<{
|
|
1094
|
+
}, z.core.$strict>>;
|
|
1095
|
+
client: z.ZodPrefault<z.ZodObject<{
|
|
1096
1096
|
retry: z.ZodPrefault<z.ZodObject<{
|
|
1097
1097
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1098
1098
|
maxAttempts: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1141,8 +1141,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1141
1141
|
accessTokenField: z.ZodOptional<z.ZodString>;
|
|
1142
1142
|
refreshTokenField: z.ZodOptional<z.ZodString>;
|
|
1143
1143
|
}, z.core.$strict>>;
|
|
1144
|
-
}, z.core.$strict
|
|
1145
|
-
package: z.ZodObject<{
|
|
1144
|
+
}, z.core.$strict>>;
|
|
1145
|
+
package: z.ZodPrefault<z.ZodObject<{
|
|
1146
1146
|
packageName: z.ZodOptional<z.ZodString>;
|
|
1147
1147
|
moduleName: z.ZodOptional<z.ZodString>;
|
|
1148
1148
|
modulePath: z.ZodOptional<z.ZodString>;
|
|
@@ -1241,7 +1241,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1241
1241
|
defaultFeatures: z.ZodOptional<z.ZodBoolean>;
|
|
1242
1242
|
environmentMarker: z.ZodOptional<z.ZodString>;
|
|
1243
1243
|
}, z.core.$strict>>>;
|
|
1244
|
-
}, z.core.$strict
|
|
1244
|
+
}, z.core.$strict>>;
|
|
1245
1245
|
output: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1246
1246
|
delivery: z.ZodLiteral<"files">;
|
|
1247
1247
|
path: z.ZodOptional<z.ZodString>;
|
|
@@ -1389,7 +1389,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1389
1389
|
registry: z.ZodLiteral<"composer">;
|
|
1390
1390
|
}, z.core.$strict>], "registry">>;
|
|
1391
1391
|
}, z.core.$strict>], "delivery">>;
|
|
1392
|
-
docs: z.ZodObject<{
|
|
1392
|
+
docs: z.ZodPrefault<z.ZodObject<{
|
|
1393
1393
|
readme: z.ZodOptional<z.ZodObject<{
|
|
1394
1394
|
apiName: z.ZodOptional<z.ZodString>;
|
|
1395
1395
|
introduction: z.ZodOptional<z.ZodString>;
|
|
@@ -1441,8 +1441,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1441
1441
|
}, z.core.$strict>>;
|
|
1442
1442
|
referenceBaseUrl: z.ZodOptional<z.ZodString>;
|
|
1443
1443
|
includeApiReference: z.ZodOptional<z.ZodBoolean>;
|
|
1444
|
-
}, z.core.$strict
|
|
1445
|
-
generation: z.ZodObject<{
|
|
1444
|
+
}, z.core.$strict>>;
|
|
1445
|
+
generation: z.ZodPrefault<z.ZodObject<{
|
|
1446
1446
|
includeWatermark: z.ZodDefault<z.ZodBoolean>;
|
|
1447
1447
|
ai: z.ZodDefault<z.ZodBoolean>;
|
|
1448
1448
|
buildAllModels: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1576,7 +1576,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1576
1576
|
inlineTypes: z.ZodOptional<z.ZodBoolean>;
|
|
1577
1577
|
omitUndefined: z.ZodOptional<z.ZodBoolean>;
|
|
1578
1578
|
}, z.core.$strict>>;
|
|
1579
|
-
}, z.core.$strict
|
|
1579
|
+
}, z.core.$strict>>;
|
|
1580
1580
|
targets: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1581
1581
|
generatorVersion: z.ZodOptional<z.ZodString>;
|
|
1582
1582
|
sdkName: z.ZodOptional<z.ZodString>;
|
|
@@ -958,7 +958,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
958
958
|
}>>;
|
|
959
959
|
}, z.core.$strict>>;
|
|
960
960
|
}, z.core.$strict>;
|
|
961
|
-
api: z.ZodObject<{
|
|
961
|
+
api: z.ZodPrefault<z.ZodObject<{
|
|
962
962
|
baseUrl: z.ZodDefault<z.ZodString>;
|
|
963
963
|
environments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
964
964
|
name: z.ZodString;
|
|
@@ -1091,8 +1091,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1091
1091
|
environmentVariable: z.ZodOptional<z.ZodString>;
|
|
1092
1092
|
}, z.core.$strict>>>;
|
|
1093
1093
|
audiences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1094
|
-
}, z.core.$strict
|
|
1095
|
-
client: z.ZodObject<{
|
|
1094
|
+
}, z.core.$strict>>;
|
|
1095
|
+
client: z.ZodPrefault<z.ZodObject<{
|
|
1096
1096
|
retry: z.ZodPrefault<z.ZodObject<{
|
|
1097
1097
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1098
1098
|
maxAttempts: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1141,8 +1141,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1141
1141
|
accessTokenField: z.ZodOptional<z.ZodString>;
|
|
1142
1142
|
refreshTokenField: z.ZodOptional<z.ZodString>;
|
|
1143
1143
|
}, z.core.$strict>>;
|
|
1144
|
-
}, z.core.$strict
|
|
1145
|
-
package: z.ZodObject<{
|
|
1144
|
+
}, z.core.$strict>>;
|
|
1145
|
+
package: z.ZodPrefault<z.ZodObject<{
|
|
1146
1146
|
packageName: z.ZodOptional<z.ZodString>;
|
|
1147
1147
|
moduleName: z.ZodOptional<z.ZodString>;
|
|
1148
1148
|
modulePath: z.ZodOptional<z.ZodString>;
|
|
@@ -1241,7 +1241,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1241
1241
|
defaultFeatures: z.ZodOptional<z.ZodBoolean>;
|
|
1242
1242
|
environmentMarker: z.ZodOptional<z.ZodString>;
|
|
1243
1243
|
}, z.core.$strict>>>;
|
|
1244
|
-
}, z.core.$strict
|
|
1244
|
+
}, z.core.$strict>>;
|
|
1245
1245
|
output: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1246
1246
|
delivery: z.ZodLiteral<"files">;
|
|
1247
1247
|
path: z.ZodOptional<z.ZodString>;
|
|
@@ -1389,7 +1389,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1389
1389
|
registry: z.ZodLiteral<"composer">;
|
|
1390
1390
|
}, z.core.$strict>], "registry">>;
|
|
1391
1391
|
}, z.core.$strict>], "delivery">>;
|
|
1392
|
-
docs: z.ZodObject<{
|
|
1392
|
+
docs: z.ZodPrefault<z.ZodObject<{
|
|
1393
1393
|
readme: z.ZodOptional<z.ZodObject<{
|
|
1394
1394
|
apiName: z.ZodOptional<z.ZodString>;
|
|
1395
1395
|
introduction: z.ZodOptional<z.ZodString>;
|
|
@@ -1441,8 +1441,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1441
1441
|
}, z.core.$strict>>;
|
|
1442
1442
|
referenceBaseUrl: z.ZodOptional<z.ZodString>;
|
|
1443
1443
|
includeApiReference: z.ZodOptional<z.ZodBoolean>;
|
|
1444
|
-
}, z.core.$strict
|
|
1445
|
-
generation: z.ZodObject<{
|
|
1444
|
+
}, z.core.$strict>>;
|
|
1445
|
+
generation: z.ZodPrefault<z.ZodObject<{
|
|
1446
1446
|
includeWatermark: z.ZodDefault<z.ZodBoolean>;
|
|
1447
1447
|
ai: z.ZodDefault<z.ZodBoolean>;
|
|
1448
1448
|
buildAllModels: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1576,7 +1576,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
|
|
|
1576
1576
|
inlineTypes: z.ZodOptional<z.ZodBoolean>;
|
|
1577
1577
|
omitUndefined: z.ZodOptional<z.ZodBoolean>;
|
|
1578
1578
|
}, z.core.$strict>>;
|
|
1579
|
-
}, z.core.$strict
|
|
1579
|
+
}, z.core.$strict>>;
|
|
1580
1580
|
targets: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1581
1581
|
generatorVersion: z.ZodOptional<z.ZodString>;
|
|
1582
1582
|
sdkName: z.ZodOptional<z.ZodString>;
|
|
@@ -277,8 +277,8 @@ var clientConfigSchema = z.strictObject({
|
|
|
277
277
|
var sdkConfigV1ClientConfigSchema = clientConfigSchema;
|
|
278
278
|
var sdkConfigV1ClientConfigOverrideSchema = clientConfigOverrideSchema;
|
|
279
279
|
var goModulePathSchema = relativePathSchema.regex(
|
|
280
|
-
/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)
|
|
281
|
-
"Go module path must
|
|
280
|
+
/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)*$/,
|
|
281
|
+
"Go module path must use letters, numbers, dots, dashes, underscores or tildes, in slash-delimited segments"
|
|
282
282
|
);
|
|
283
283
|
var composerPackageNameSchema = nonEmptyStringSchema.regex(
|
|
284
284
|
/^[a-z0-9]([_.-]?[a-z0-9]+)*\/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$/,
|
|
@@ -543,6 +543,9 @@ function compact(value) {
|
|
|
543
543
|
function optional(key, value) {
|
|
544
544
|
return value === void 0 ? {} : { [key]: value };
|
|
545
545
|
}
|
|
546
|
+
function optionalObject(key, value) {
|
|
547
|
+
return Object.keys(value).length === 0 ? {} : { [key]: value };
|
|
548
|
+
}
|
|
546
549
|
function isObject(value) {
|
|
547
550
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
548
551
|
}
|
|
@@ -1552,12 +1555,12 @@ var sdkConfigV1Schema = z.strictObject({
|
|
|
1552
1555
|
sdkVersion: nonEmptyStringSchema.default("1.0.0"),
|
|
1553
1556
|
apiVersion: nonEmptyStringSchema.optional(),
|
|
1554
1557
|
source: sdkConfigV1SourceConfigSchema,
|
|
1555
|
-
api: sdkConfigV1ApiConfigSchema,
|
|
1556
|
-
client: sdkConfigV1ClientConfigSchema,
|
|
1557
|
-
package: sdkConfigV1PackageConfigSchema,
|
|
1558
|
+
api: sdkConfigV1ApiConfigSchema.prefault({}),
|
|
1559
|
+
client: sdkConfigV1ClientConfigSchema.prefault({}),
|
|
1560
|
+
package: sdkConfigV1PackageConfigSchema.prefault({}),
|
|
1558
1561
|
output: sdkConfigV1OutputConfigSchema.optional(),
|
|
1559
|
-
docs: sdkConfigV1DocsConfigSchema,
|
|
1560
|
-
generation: sdkConfigV1GenerationConfigSchema,
|
|
1562
|
+
docs: sdkConfigV1DocsConfigSchema.prefault({}),
|
|
1563
|
+
generation: sdkConfigV1GenerationConfigSchema.prefault({}),
|
|
1561
1564
|
targets: z.array(sdkConfigV1TargetSchema).min(1)
|
|
1562
1565
|
}).superRefine(({ output, package: globalPackage, targets }, context) => {
|
|
1563
1566
|
const configuredLanguages = /* @__PURE__ */ new Set();
|
|
@@ -1673,11 +1676,10 @@ function mapFernConfigToSdkConfigV1(input) {
|
|
|
1673
1676
|
source: input.source,
|
|
1674
1677
|
...optional("sdkVersion", input.sdkVersion),
|
|
1675
1678
|
...optional("apiVersion", input.apiVersion),
|
|
1676
|
-
api,
|
|
1677
|
-
client
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
generation: generations.shared,
|
|
1679
|
+
...optionalObject("api", api),
|
|
1680
|
+
...optionalObject("client", clients.shared),
|
|
1681
|
+
...optionalObject("docs", docs.shared),
|
|
1682
|
+
...optionalObject("generation", generations.shared),
|
|
1681
1683
|
targets
|
|
1682
1684
|
};
|
|
1683
1685
|
const parsed = sdkConfigV1Schema.safeParse(sdkConfig);
|