@postman/sdk-config 0.3.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.
@@ -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 be a slash-delimited path using letters, numbers, dots, dashes, underscores, or tildes"
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: clients.shared,
1678
- package: {},
1679
- docs: docs.shared,
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);