@postman/sdk-config 0.5.1 → 0.7.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.
Files changed (35) hide show
  1. package/README.md +15 -0
  2. package/dist/index.cjs +263 -27
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +3 -3
  5. package/dist/index.d.ts +3 -3
  6. package/dist/index.js +260 -28
  7. package/dist/index.js.map +1 -1
  8. package/dist/sdk-config/index.cjs +224 -27
  9. package/dist/sdk-config/index.cjs.map +1 -1
  10. package/dist/sdk-config/index.d.cts +2 -2
  11. package/dist/sdk-config/index.d.ts +2 -2
  12. package/dist/sdk-config/index.js +224 -28
  13. package/dist/sdk-config/index.js.map +1 -1
  14. package/dist/sdk-config/v1/index.cjs +224 -27
  15. package/dist/sdk-config/v1/index.cjs.map +1 -1
  16. package/dist/sdk-config/v1/index.d.cts +20 -2
  17. package/dist/sdk-config/v1/index.d.ts +20 -2
  18. package/dist/sdk-config/v1/index.js +224 -28
  19. package/dist/sdk-config/v1/index.js.map +1 -1
  20. package/dist/sdk-config-ir/index.cjs +153 -0
  21. package/dist/sdk-config-ir/index.cjs.map +1 -1
  22. package/dist/sdk-config-ir/index.d.cts +2 -2
  23. package/dist/sdk-config-ir/index.d.ts +2 -2
  24. package/dist/sdk-config-ir/index.js +151 -1
  25. package/dist/sdk-config-ir/index.js.map +1 -1
  26. package/dist/sdk-config-ir/v1/index.cjs +153 -0
  27. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  28. package/dist/sdk-config-ir/v1/index.d.cts +43 -3
  29. package/dist/sdk-config-ir/v1/index.d.ts +43 -3
  30. package/dist/sdk-config-ir/v1/index.js +151 -1
  31. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  32. package/dist/{typescript-BruxA5zG.d.cts → typescript-BdDv_kwT.d.cts} +8 -0
  33. package/dist/{typescript-BruxA5zG.d.ts → typescript-BdDv_kwT.d.ts} +8 -0
  34. package/package.json +1 -1
  35. package/src/sdk-config-ir/v1/README.md +10 -2
@@ -1,3 +1,3 @@
1
- export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, mapFernConfigToSdkConfigV1, parseSdkConfigV1, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './v1/index.cjs';
2
- export { k as sdkConfigV1CliGenerationConfigSchema, l as sdkConfigV1ComposerPackageNameSchema, m as sdkConfigV1CsharpGenerationConfigSchema, o as sdkConfigV1ExactSemverSchema, p as sdkConfigV1GoGenerationConfigSchema, q as sdkConfigV1GoModulePathSchema, r as sdkConfigV1JavaGenerationConfigSchema, u as sdkConfigV1KotlinGenerationConfigSchema, w as sdkConfigV1McpGenerationConfigSchema, x as sdkConfigV1NonEmptyStringSchema, z as sdkConfigV1PhpGenerationConfigSchema, A as sdkConfigV1PythonGenerationConfigSchema, B as sdkConfigV1RelativePathSchema, E as sdkConfigV1RubyGenerationConfigSchema, F as sdkConfigV1RustGenerationConfigSchema, H as sdkConfigV1SwiftGenerationConfigSchema, I as sdkConfigV1TerraformGenerationConfigSchema, L as sdkConfigV1TypescriptGenerationConfigSchema } from '../typescript-BruxA5zG.cjs';
1
+ export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, mapFernConfigToSdkConfigV1, parseSdkConfigV1, parseSdkConfigV1ForConsumption, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './v1/index.cjs';
2
+ export { k as sdkConfigV1CliGenerationConfigSchema, l as sdkConfigV1ComposerPackageNameSchema, m as sdkConfigV1CsharpGenerationConfigSchema, o as sdkConfigV1ExactSemverSchema, p as sdkConfigV1GoGenerationConfigSchema, q as sdkConfigV1GoModulePathSchema, r as sdkConfigV1JavaGenerationConfigSchema, u as sdkConfigV1KotlinGenerationConfigSchema, w as sdkConfigV1McpGenerationConfigSchema, x as sdkConfigV1NonEmptyStringSchema, z as sdkConfigV1PhpGenerationConfigSchema, A as sdkConfigV1PythonGenerationConfigSchema, B as sdkConfigV1RelativePathSchema, E as sdkConfigV1RubyGenerationConfigSchema, F as sdkConfigV1RustGenerationConfigSchema, H as sdkConfigV1SwiftGenerationConfigSchema, I as sdkConfigV1TerraformGenerationConfigSchema, L as sdkConfigV1TypescriptGenerationConfigSchema } from '../typescript-BdDv_kwT.cjs';
3
3
  import 'zod';
@@ -1,3 +1,3 @@
1
- export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, mapFernConfigToSdkConfigV1, parseSdkConfigV1, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './v1/index.js';
2
- export { k as sdkConfigV1CliGenerationConfigSchema, l as sdkConfigV1ComposerPackageNameSchema, m as sdkConfigV1CsharpGenerationConfigSchema, o as sdkConfigV1ExactSemverSchema, p as sdkConfigV1GoGenerationConfigSchema, q as sdkConfigV1GoModulePathSchema, r as sdkConfigV1JavaGenerationConfigSchema, u as sdkConfigV1KotlinGenerationConfigSchema, w as sdkConfigV1McpGenerationConfigSchema, x as sdkConfigV1NonEmptyStringSchema, z as sdkConfigV1PhpGenerationConfigSchema, A as sdkConfigV1PythonGenerationConfigSchema, B as sdkConfigV1RelativePathSchema, E as sdkConfigV1RubyGenerationConfigSchema, F as sdkConfigV1RustGenerationConfigSchema, H as sdkConfigV1SwiftGenerationConfigSchema, I as sdkConfigV1TerraformGenerationConfigSchema, L as sdkConfigV1TypescriptGenerationConfigSchema } from '../typescript-BruxA5zG.js';
1
+ export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, mapFernConfigToSdkConfigV1, parseSdkConfigV1, parseSdkConfigV1ForConsumption, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './v1/index.js';
2
+ export { k as sdkConfigV1CliGenerationConfigSchema, l as sdkConfigV1ComposerPackageNameSchema, m as sdkConfigV1CsharpGenerationConfigSchema, o as sdkConfigV1ExactSemverSchema, p as sdkConfigV1GoGenerationConfigSchema, q as sdkConfigV1GoModulePathSchema, r as sdkConfigV1JavaGenerationConfigSchema, u as sdkConfigV1KotlinGenerationConfigSchema, w as sdkConfigV1McpGenerationConfigSchema, x as sdkConfigV1NonEmptyStringSchema, z as sdkConfigV1PhpGenerationConfigSchema, A as sdkConfigV1PythonGenerationConfigSchema, B as sdkConfigV1RelativePathSchema, E as sdkConfigV1RubyGenerationConfigSchema, F as sdkConfigV1RustGenerationConfigSchema, H as sdkConfigV1SwiftGenerationConfigSchema, I as sdkConfigV1TerraformGenerationConfigSchema, L as sdkConfigV1TypescriptGenerationConfigSchema } from '../typescript-BdDv_kwT.js';
3
3
  import 'zod';
@@ -784,6 +784,7 @@ function githubOutput(value, publishInfo, rawOutput, language, sourcePath, state
784
784
  consume(state, [...sourcePath, "repo"]);
785
785
  const publication = publishInfo ? mapPublication(publishInfo, rawOutput, language, [...sourcePath, "publishInfo"], state, index) : void 0;
786
786
  const type = stringValue(value.type);
787
+ const licensePackage = mapGithubLicense(value.license, [...sourcePath, "license"], state);
787
788
  const reviewers = mapReviewers(value.reviewers, [...sourcePath, "reviewers"], state);
788
789
  if (type) consume(state, [...sourcePath, "type"]);
789
790
  if (typeof value.makePr === "boolean") consume(state, [...sourcePath, "makePr"]);
@@ -810,9 +811,20 @@ function githubOutput(value, publishInfo, rawOutput, language, sourcePath, state
810
811
  },
811
812
  ...publication ? { publish: publication.publish } : {}
812
813
  },
813
- ...optional("package", publication?.package)
814
+ // The GitHub license wins over a publication-supplied one; `licensePackage` is `{}` or `{ license }`.
815
+ ...optionalObject("package", { ...publication?.package, ...licensePackage })
814
816
  };
815
817
  }
818
+ var basicLicenseTypes = { mit: "MIT", apache: "APACHE" };
819
+ function mapGithubLicense(value, sourcePath, state) {
820
+ if (!isObject(value) || stringValue(value.type) !== "basic") return {};
821
+ const id = stringValue(value.id);
822
+ const type = id ? basicLicenseTypes[id.toLowerCase()] : void 0;
823
+ if (!type) return {};
824
+ consume(state, [...sourcePath, "type"]);
825
+ consume(state, [...sourcePath, "id"]);
826
+ return { license: { type } };
827
+ }
816
828
  function consumeCredentialObject(value, sourcePath, state) {
817
829
  if (!isObject(value)) return;
818
830
  for (const field of ["username", "password", "token", "apiKey"]) {
@@ -1333,6 +1345,113 @@ function outputDiagnostic(path, index) {
1333
1345
  suggestedAction: resolvedGuidance?.suggestedAction ?? "Review this output setting and preserve it outside SDK Config when no equivalent exists."
1334
1346
  };
1335
1347
  }
1348
+ var OMIT = /* @__PURE__ */ Symbol("omit");
1349
+ function inputJsonSchema(schema) {
1350
+ return z.toJSONSchema(schema, {
1351
+ io: "input",
1352
+ unrepresentable: "any"
1353
+ });
1354
+ }
1355
+ function stripUnknownProperties(value, schema) {
1356
+ return project(value, schema, schema);
1357
+ }
1358
+ function project(value, candidateSchema, rootSchema, omitDefaults) {
1359
+ const resolvedCandidate = resolveSchema(candidateSchema, rootSchema);
1360
+ const schema = selectSchema(value, resolvedCandidate, rootSchema);
1361
+ if (Array.isArray(value)) {
1362
+ if (!schema.items) return value;
1363
+ return value.map((item) => {
1364
+ const projected = project(item, schema.items, rootSchema);
1365
+ return projected === OMIT ? item : projected;
1366
+ });
1367
+ }
1368
+ if (!isRecord(value) || schema.type !== "object") return value;
1369
+ const entries = [];
1370
+ const properties = schema.properties ?? {};
1371
+ const unionProperties = collectAlternativeProperties(resolvedCandidate, rootSchema);
1372
+ for (const [key, propertySchema] of Object.entries(properties)) {
1373
+ if (!Object.hasOwn(value, key)) continue;
1374
+ const projected = project(value[key], propertySchema, rootSchema);
1375
+ if (projected !== OMIT) entries.push([key, projected]);
1376
+ }
1377
+ for (const [key, fieldValue] of Object.entries(value)) {
1378
+ if (Object.hasOwn(properties, key)) continue;
1379
+ if (Object.hasOwn(unionProperties, key)) {
1380
+ entries.push([key, fieldValue]);
1381
+ continue;
1382
+ }
1383
+ if (schema.additionalProperties !== false) {
1384
+ const projected = typeof schema.additionalProperties === "object" ? project(fieldValue, schema.additionalProperties, rootSchema) : fieldValue;
1385
+ if (projected !== OMIT) entries.push([key, projected]);
1386
+ }
1387
+ }
1388
+ return Object.fromEntries(entries);
1389
+ }
1390
+ function collectAlternativeProperties(schema, rootSchema) {
1391
+ const alternatives = schema.oneOf ?? schema.anyOf;
1392
+ if (!alternatives) return schema.properties ?? {};
1393
+ return Object.assign(
1394
+ {},
1395
+ ...alternatives.map((alternative) => resolveSchema(alternative, rootSchema).properties ?? {})
1396
+ );
1397
+ }
1398
+ function selectSchema(value, schema, rootSchema) {
1399
+ const alternatives = schema.oneOf ?? schema.anyOf;
1400
+ if (!alternatives || alternatives.length === 0) return schema;
1401
+ const best = alternatives.map((alternative, index) => {
1402
+ const resolved = resolveSchema(alternative, rootSchema);
1403
+ return { index, schema: resolved, score: schemaMatchScore(value, resolved) };
1404
+ }).sort((left, right) => right.score - left.score || left.index - right.index)[0];
1405
+ return best.score === Number.NEGATIVE_INFINITY ? schema : best.schema;
1406
+ }
1407
+ function schemaMatchScore(value, schema) {
1408
+ if (Object.hasOwn(schema, "const") && !deepEqual(value, schema.const)) {
1409
+ return Number.NEGATIVE_INFINITY;
1410
+ }
1411
+ if (schema.enum && !schema.enum.some((candidate) => deepEqual(value, candidate))) {
1412
+ return Number.NEGATIVE_INFINITY;
1413
+ }
1414
+ if (schema.type === "object") {
1415
+ if (!isRecord(value)) return Number.NEGATIVE_INFINITY;
1416
+ const properties = schema.properties ?? {};
1417
+ for (const [key, propertySchema] of Object.entries(properties)) {
1418
+ if (!Object.hasOwn(value, key)) continue;
1419
+ if (Object.hasOwn(propertySchema, "const") && !deepEqual(value[key], propertySchema.const)) {
1420
+ return Number.NEGATIVE_INFINITY;
1421
+ }
1422
+ }
1423
+ return Object.keys(value).filter((key) => Object.hasOwn(properties, key)).length;
1424
+ }
1425
+ if (schema.type === "array") return Array.isArray(value) ? 1 : Number.NEGATIVE_INFINITY;
1426
+ if (schema.type === "string") return typeof value === "string" ? 1 : Number.NEGATIVE_INFINITY;
1427
+ if (schema.type === "number" || schema.type === "integer") {
1428
+ return typeof value === "number" ? 1 : Number.NEGATIVE_INFINITY;
1429
+ }
1430
+ if (schema.type === "boolean") return typeof value === "boolean" ? 1 : Number.NEGATIVE_INFINITY;
1431
+ if (schema.type === "null") return value === null ? 1 : Number.NEGATIVE_INFINITY;
1432
+ return 0;
1433
+ }
1434
+ function resolveSchema(schema, rootSchema) {
1435
+ if (!schema.$ref) return schema;
1436
+ if (!schema.$ref.startsWith("#/$defs/")) return schema;
1437
+ const name = schema.$ref.slice("#/$defs/".length).replaceAll("~1", "/").replaceAll("~0", "~");
1438
+ return rootSchema.$defs?.[name] ?? schema;
1439
+ }
1440
+ function isRecord(value) {
1441
+ return value !== null && typeof value === "object" && !Array.isArray(value);
1442
+ }
1443
+ function deepEqual(left, right) {
1444
+ if (Object.is(left, right)) return true;
1445
+ if (Array.isArray(left) && Array.isArray(right)) {
1446
+ return left.length === right.length && left.every((value, index) => deepEqual(value, right[index]));
1447
+ }
1448
+ if (isRecord(left) && isRecord(right)) {
1449
+ const leftKeys = Object.keys(left);
1450
+ const rightKeys = Object.keys(right);
1451
+ return leftKeys.length === rightKeys.length && leftKeys.every((key) => Object.hasOwn(right, key) && deepEqual(left[key], right[key]));
1452
+ }
1453
+ return false;
1454
+ }
1336
1455
  var namingConfigSchema = z.strictObject({
1337
1456
  clientName: nonEmptyStringSchema.optional(),
1338
1457
  exportedClientName: nonEmptyStringSchema.optional(),
@@ -1693,17 +1812,22 @@ var typescriptGenerationConfigSchema = z.strictObject({
1693
1812
  compilerOptions: compilerOptionsSchema.optional(),
1694
1813
  httpClient: httpClientSchema.optional(),
1695
1814
  packageManager: z.enum(["pnpm", "yarn"]).optional(),
1815
+ /** e.g. `1.22.22` — from the customer's own `config.packageJson.packageManager` (`yarn@1.22.22`). */
1816
+ packageManagerVersion: nonEmptyStringSchema.optional(),
1696
1817
  testFramework: z.enum(["jest", "vitest"]).optional(),
1697
1818
  namingStrategy: z.enum(["base", "originalPropertyNames"]).optional(),
1698
1819
  bundle: z.boolean().optional(),
1699
1820
  exportClassDefault: z.boolean().optional(),
1700
1821
  /** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
1701
1822
  namespaceExportName: nonEmptyStringSchema.optional(),
1823
+ consolidateTypeFiles: z.boolean().optional(),
1702
1824
  allowCustomFetcher: z.boolean().optional(),
1703
1825
  useBrandedStringAliases: z.boolean().optional(),
1704
1826
  useLegacyExports: z.boolean().optional(),
1705
1827
  useBigInt: z.boolean().optional(),
1706
1828
  serdeLayer: z.boolean().optional(),
1829
+ /** Ship only the ESM build (drops CJS) to avoid the Node dual-package hazard. */
1830
+ esmOnly: z.boolean().optional(),
1707
1831
  scripts: z.array(packageScriptSchema).optional()
1708
1832
  });
1709
1833
 
@@ -2011,6 +2135,10 @@ function validateSdkConfigV1(value) {
2011
2135
  function parseSdkConfigV1(value) {
2012
2136
  return sdkConfigV1Schema.parse(value);
2013
2137
  }
2138
+ var sdkConfigV1InputJsonSchema = inputJsonSchema(sdkConfigV1Schema);
2139
+ function parseSdkConfigV1ForConsumption(value) {
2140
+ return parseSdkConfigV1(stripUnknownProperties(value, sdkConfigV1InputJsonSchema));
2141
+ }
2014
2142
 
2015
2143
  // src/sdk-config/v1/fern-config-mapper.ts
2016
2144
  var generatorLanguages = {
@@ -2373,15 +2501,23 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
2373
2501
  };
2374
2502
  }
2375
2503
  const pythonClient = language === "python" ? takeObject(config, ["client"], state, basePath) : void 0;
2504
+ const typescriptNaming = language === "typescript" || language === "mcp" ? takeObject(config, ["naming"], state, basePath) : void 0;
2376
2505
  const directClientName = takeString(config, ["clientName", "clientClassName"], state, basePath);
2377
- const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : void 0;
2506
+ const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : typescriptNaming ? takeString(typescriptNaming.value, ["client"], state, typescriptNaming.path) : void 0;
2378
2507
  const directExportedClientName = takeString(
2379
2508
  config,
2380
2509
  ["exportedClientName", "exportedClientClassName"],
2381
2510
  state,
2382
2511
  basePath
2383
2512
  );
2384
- const nestedExportedClientName = pythonClient ? takeString(pythonClient.value, ["exportedClassName"], state, pythonClient.path) : void 0;
2513
+ const nestedExportedClientName = pythonClient ? takeString(pythonClient.value, ["exportedClassName"], state, pythonClient.path) : typescriptNaming ? (
2514
+ // TypeScript's `naming.namespace` is the base every other naming.* field defaults from
2515
+ // (Fern's docs: `client` defaults to `${PascalCase(namespace)}Client`, same for
2516
+ // `environment`/`error`/etc.) — the same role `exportedClientName` already plays for every
2517
+ // other language's `clientPrefix` derivation.
2518
+ takeString(typescriptNaming.value, ["namespace"], state, typescriptNaming.path)
2519
+ ) : void 0;
2520
+ const nestedEnvironmentTypeName = typescriptNaming ? takeString(typescriptNaming.value, ["environment"], state, typescriptNaming.path) : void 0;
2385
2521
  const naming = compact({
2386
2522
  pagerName: takeString(
2387
2523
  config,
@@ -2391,12 +2527,7 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
2391
2527
  ),
2392
2528
  clientName: directClientName ?? nestedClientName,
2393
2529
  exportedClientName: directExportedClientName ?? nestedExportedClientName,
2394
- environmentTypeName: takeString(
2395
- config,
2396
- ["environmentClassName", "environmentEnumName"],
2397
- state,
2398
- basePath
2399
- ),
2530
+ environmentTypeName: takeString(config, ["environmentClassName", "environmentEnumName"], state, basePath) ?? nestedEnvironmentTypeName,
2400
2531
  apiErrorName: takeString(config, ["baseApiExceptionClassName"], state, basePath),
2401
2532
  baseErrorName: takeString(config, ["baseExceptionClassName"], state, basePath)
2402
2533
  });
@@ -2410,6 +2541,10 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
2410
2541
  basePath
2411
2542
  );
2412
2543
  if (webSockets !== void 0) generation.webSockets = webSockets;
2544
+ if (language === "typescript") {
2545
+ const streams = mapTypescriptStreams(config, state, basePath);
2546
+ if (streams) generation.streams = streams;
2547
+ }
2413
2548
  const generateFullProject = takeBoolean(config, ["generateFullProject"], state, basePath);
2414
2549
  if (generateFullProject !== void 0) generation.generateFullProject = generateFullProject;
2415
2550
  const inlineTypes = takeBoolean(config, ["enableInlineTypes"], state, basePath);
@@ -2427,6 +2562,18 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
2427
2562
  if (packagePath !== void 0) generation.layout = { packagePath };
2428
2563
  mapDependencies(config, state, packageConfig, basePath);
2429
2564
  }
2565
+ function mapTypescriptStreams(config, state, basePath) {
2566
+ const responseType = takeEnum(config, ["streamType"], ["wrapper", "web"], state, basePath);
2567
+ const fileResponseType = takeEnum(
2568
+ config,
2569
+ ["fileResponseType"],
2570
+ ["stream", "binary-response"],
2571
+ state,
2572
+ basePath
2573
+ );
2574
+ if (responseType === void 0 && fileResponseType === void 0) return void 0;
2575
+ return { enabled: true, ...compact({ responseType, fileResponseType }) };
2576
+ }
2430
2577
  function mapLanguageConfig(language, config, state, packageConfig, basePath) {
2431
2578
  switch (language) {
2432
2579
  case "typescript":
@@ -2460,29 +2607,39 @@ function mapLanguageConfig(language, config, state, packageConfig, basePath) {
2460
2607
  }
2461
2608
  }
2462
2609
  function mapTypescript(config, state, packageConfig, basePath) {
2463
- mapPackageManifest(config, ["packageJson"], state, packageConfig, basePath);
2610
+ const packageJsonManifest = mapPackageManifest(
2611
+ config,
2612
+ ["packageJson"],
2613
+ state,
2614
+ packageConfig,
2615
+ basePath
2616
+ );
2617
+ const packageJsonPackageManager = packageJsonManifest ? takeString(packageJsonManifest.value, ["packageManager"], state, packageJsonManifest.path) : void 0;
2618
+ const packageManagerAtIndex = packageJsonPackageManager ? packageJsonPackageManager.indexOf("@", packageJsonPackageManager.startsWith("@") ? 1 : 0) : -1;
2619
+ const packageManagerVersionPart = packageManagerAtIndex >= 0 ? packageJsonPackageManager?.slice(packageManagerAtIndex + 1).split("+")[0] : void 0;
2620
+ const packageManagerVersion = packageManagerVersionPart || void 0;
2464
2621
  const serdeLayer = takeBoolean(config, ["serdeLayer"], state, basePath);
2465
2622
  const noSerdeLayer = takeBoolean(config, ["noSerdeLayer"], state, basePath);
2466
2623
  const fetchSupport = takeEnum(config, ["fetchSupport"], ["native"], state, basePath);
2624
+ const namingObject = takeObject(config, ["naming"], state, basePath);
2625
+ const nestedNamespace = namingObject ? takeString(namingObject.value, ["namespace"], state, namingObject.path) : void 0;
2467
2626
  return compact({
2468
2627
  typescriptVersion: takeString(config, ["typescriptVersion"], state, basePath),
2469
2628
  zodVersion: takeString(config, ["zodVersion"], state, basePath),
2470
2629
  packageManager: takeEnum(config, ["packageManager"], ["pnpm", "yarn"], state, basePath),
2630
+ packageManagerVersion,
2471
2631
  testFramework: takeEnum(config, ["testFramework"], ["jest", "vitest"], state, basePath),
2472
2632
  httpClient: fetchSupport === "native" ? { name: "fetch" } : void 0,
2473
2633
  bundle: takeBoolean(config, ["bundle"], state, basePath),
2474
2634
  exportClassDefault: takeBoolean(config, ["exportClassDefault"], state, basePath),
2475
- namespaceExportName: takeString(
2476
- config,
2477
- ["namespaceExportName", "namespaceExport"],
2478
- state,
2479
- basePath
2480
- ),
2635
+ namespaceExportName: takeString(config, ["namespaceExportName", "namespaceExport"], state, basePath) ?? nestedNamespace,
2636
+ consolidateTypeFiles: takeBoolean(config, ["consolidateTypeFiles"], state, basePath),
2481
2637
  allowCustomFetcher: takeBoolean(config, ["allowCustomFetcher"], state, basePath),
2482
2638
  useBrandedStringAliases: takeBoolean(config, ["useBrandedStringAliases"], state, basePath),
2483
2639
  useLegacyExports: takeBoolean(config, ["useLegacyExports"], state, basePath),
2484
2640
  useBigInt: takeBoolean(config, ["useBigInt"], state, basePath),
2485
- serdeLayer: serdeLayer ?? (noSerdeLayer === void 0 ? void 0 : !noSerdeLayer)
2641
+ serdeLayer: serdeLayer ?? (noSerdeLayer === void 0 ? void 0 : !noSerdeLayer),
2642
+ esmOnly: takeBoolean(config, ["esmOnly"], state, basePath)
2486
2643
  });
2487
2644
  }
2488
2645
  function mapPython(config, state, packageConfig, basePath) {
@@ -2593,7 +2750,8 @@ function mapCsharp(config, state, packageConfig, basePath) {
2593
2750
  });
2594
2751
  }
2595
2752
  function mapPhp(config, state, packageConfig, basePath) {
2596
- mapPackageManifest(config, ["composerJson"], state, packageConfig, basePath);
2753
+ const manifest = mapPackageManifest(config, ["composerJson"], state, packageConfig, basePath);
2754
+ if (manifest) mapComposerRequirements(manifest, state, packageConfig);
2597
2755
  const packageName = takeString(config, ["packageName"], state, basePath);
2598
2756
  if (packageName !== void 0) packageConfig.packageName = packageName;
2599
2757
  return compact({
@@ -2601,6 +2759,20 @@ function mapPhp(config, state, packageConfig, basePath) {
2601
2759
  generateClientInterfaces: takeBoolean(config, ["generateClientInterfaces"], state, basePath)
2602
2760
  });
2603
2761
  }
2762
+ function mapComposerRequirements(manifest, state, packageConfig) {
2763
+ const fields = [
2764
+ ["require", "extraDependencies"],
2765
+ ["require-dev", "extraDevDependencies"]
2766
+ ];
2767
+ for (const [composerField, packageField] of fields) {
2768
+ const located = takeObject(manifest.value, [composerField], state, manifest.path);
2769
+ if (!located) continue;
2770
+ const dependencies = Object.entries(located.value).flatMap(
2771
+ ([name, dependency]) => mapDependency(name, dependency, state, [...located.path, name])
2772
+ );
2773
+ if (dependencies.length) packageConfig[packageField] = dependencies;
2774
+ }
2775
+ }
2604
2776
  function mapRuby(config, state, packageConfig, basePath) {
2605
2777
  const moduleName = takeString(config, ["moduleName"], state, basePath);
2606
2778
  if (moduleName !== void 0) packageConfig.moduleName = moduleName;
@@ -2770,28 +2942,52 @@ function takeCustomSections(value, language, activeLanguages, state, basePath) {
2770
2942
  }
2771
2943
  function mapPackageManifest(config, aliases, state, packageConfig, basePath) {
2772
2944
  const manifest = takeObject(config, aliases, state, basePath);
2773
- if (!manifest) return;
2945
+ if (!manifest) return void 0;
2774
2946
  const packageName = takeString(manifest.value, ["name"], state, manifest.path);
2775
2947
  const description = takeString(manifest.value, ["description"], state, manifest.path);
2948
+ const keywords = takeStringArray(manifest.value, ["keywords"], state, manifest.path);
2776
2949
  const license = takeString(manifest.value, ["license"], state, manifest.path);
2777
2950
  const author = takeObject(manifest.value, ["author"], state, manifest.path);
2778
2951
  const authorName = author ? takeString(author.value, ["name"], state, author.path) : void 0;
2779
- const authors = authorName && author ? [
2780
- compact({
2781
- name: authorName,
2782
- email: takeString(author.value, ["email"], state, author.path),
2783
- url: takeString(author.value, ["url"], state, author.path)
2784
- })
2785
- ] : void 0;
2952
+ const authors = [
2953
+ ...authorName && author ? [
2954
+ compact({
2955
+ name: authorName,
2956
+ email: takeString(author.value, ["email"], state, author.path),
2957
+ url: takeString(author.value, ["url"], state, author.path)
2958
+ })
2959
+ ] : [],
2960
+ ...takeManifestAuthors(manifest, state)
2961
+ ];
2786
2962
  Object.assign(
2787
2963
  packageConfig,
2788
2964
  compact({
2789
2965
  packageName,
2790
2966
  description,
2791
- authors,
2967
+ homepage: takeString(manifest.value, ["homepage"], state, manifest.path),
2968
+ keywords,
2969
+ authors: authors.length ? authors : void 0,
2792
2970
  license: license ? { type: license } : void 0
2793
2971
  })
2794
2972
  );
2973
+ return manifest;
2974
+ }
2975
+ function takeManifestAuthors(manifest, state) {
2976
+ const located = locate(manifest.value, ["authors"], manifest.path);
2977
+ if (!located || !Array.isArray(located.value)) return [];
2978
+ return located.value.flatMap((entry, index) => {
2979
+ if (!isObject(entry)) return [];
2980
+ const path = [...located.path, index];
2981
+ const name = takeString(entry, ["name"], state, path);
2982
+ if (!name) return [];
2983
+ return [
2984
+ compact({
2985
+ name,
2986
+ email: takeString(entry, ["email"], state, path),
2987
+ url: takeString(entry, ["url"], state, path)
2988
+ })
2989
+ ];
2990
+ });
2795
2991
  }
2796
2992
  function takePythonAdditionalInitExports(config, state, basePath) {
2797
2993
  const located = locate(config, ["additionalInitExports"], basePath);
@@ -2886,6 +3082,6 @@ function takeToolsets(value, aliases, state, basePath) {
2886
3082
  return Object.fromEntries(entries.filter((entry) => entry !== void 0));
2887
3083
  }
2888
3084
 
2889
- export { FernConfigMappingError, SDK_CONFIG_V1_SCHEMA_VERSION, mapFernConfigToSdkConfigV1, parseSdkConfigV1, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, cliGenerationConfigSchema as sdkConfigV1CliGenerationConfigSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, composerPackageNameSchema as sdkConfigV1ComposerPackageNameSchema, csharpGenerationConfigSchema as sdkConfigV1CsharpGenerationConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, exactSemverSchema as sdkConfigV1ExactSemverSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, goGenerationConfigSchema as sdkConfigV1GoGenerationConfigSchema, goModulePathSchema as sdkConfigV1GoModulePathSchema, javaGenerationConfigSchema as sdkConfigV1JavaGenerationConfigSchema, kotlinGenerationConfigSchema as sdkConfigV1KotlinGenerationConfigSchema, mcpGenerationConfigSchema as sdkConfigV1McpGenerationConfigSchema, nonEmptyStringSchema as sdkConfigV1NonEmptyStringSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, phpGenerationConfigSchema as sdkConfigV1PhpGenerationConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, pythonGenerationConfigSchema as sdkConfigV1PythonGenerationConfigSchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, relativePathSchema as sdkConfigV1RelativePathSchema, sdkConfigV1ReplayConfigSchema, rubyGenerationConfigSchema as sdkConfigV1RubyGenerationConfigSchema, rustGenerationConfigSchema as sdkConfigV1RustGenerationConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, swiftGenerationConfigSchema as sdkConfigV1SwiftGenerationConfigSchema, sdkConfigV1TargetSchema, terraformGenerationConfigSchema as sdkConfigV1TerraformGenerationConfigSchema, typescriptGenerationConfigSchema as sdkConfigV1TypescriptGenerationConfigSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 };
3085
+ export { FernConfigMappingError, SDK_CONFIG_V1_SCHEMA_VERSION, mapFernConfigToSdkConfigV1, parseSdkConfigV1, parseSdkConfigV1ForConsumption, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, cliGenerationConfigSchema as sdkConfigV1CliGenerationConfigSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, composerPackageNameSchema as sdkConfigV1ComposerPackageNameSchema, csharpGenerationConfigSchema as sdkConfigV1CsharpGenerationConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, exactSemverSchema as sdkConfigV1ExactSemverSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, goGenerationConfigSchema as sdkConfigV1GoGenerationConfigSchema, goModulePathSchema as sdkConfigV1GoModulePathSchema, javaGenerationConfigSchema as sdkConfigV1JavaGenerationConfigSchema, kotlinGenerationConfigSchema as sdkConfigV1KotlinGenerationConfigSchema, mcpGenerationConfigSchema as sdkConfigV1McpGenerationConfigSchema, nonEmptyStringSchema as sdkConfigV1NonEmptyStringSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, phpGenerationConfigSchema as sdkConfigV1PhpGenerationConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, pythonGenerationConfigSchema as sdkConfigV1PythonGenerationConfigSchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, relativePathSchema as sdkConfigV1RelativePathSchema, sdkConfigV1ReplayConfigSchema, rubyGenerationConfigSchema as sdkConfigV1RubyGenerationConfigSchema, rustGenerationConfigSchema as sdkConfigV1RustGenerationConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, swiftGenerationConfigSchema as sdkConfigV1SwiftGenerationConfigSchema, sdkConfigV1TargetSchema, terraformGenerationConfigSchema as sdkConfigV1TerraformGenerationConfigSchema, typescriptGenerationConfigSchema as sdkConfigV1TypescriptGenerationConfigSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 };
2890
3086
  //# sourceMappingURL=index.js.map
2891
3087
  //# sourceMappingURL=index.js.map