@postman/sdk-config 0.6.0 → 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 (34) hide show
  1. package/dist/index.cjs +112 -27
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +112 -27
  6. package/dist/index.js.map +1 -1
  7. package/dist/sdk-config/index.cjs +112 -27
  8. package/dist/sdk-config/index.cjs.map +1 -1
  9. package/dist/sdk-config/index.d.cts +1 -1
  10. package/dist/sdk-config/index.d.ts +1 -1
  11. package/dist/sdk-config/index.js +112 -27
  12. package/dist/sdk-config/index.js.map +1 -1
  13. package/dist/sdk-config/v1/index.cjs +112 -27
  14. package/dist/sdk-config/v1/index.cjs.map +1 -1
  15. package/dist/sdk-config/v1/index.d.cts +13 -1
  16. package/dist/sdk-config/v1/index.d.ts +13 -1
  17. package/dist/sdk-config/v1/index.js +112 -27
  18. package/dist/sdk-config/v1/index.js.map +1 -1
  19. package/dist/sdk-config-ir/index.cjs +5 -0
  20. package/dist/sdk-config-ir/index.cjs.map +1 -1
  21. package/dist/sdk-config-ir/index.d.cts +1 -1
  22. package/dist/sdk-config-ir/index.d.ts +1 -1
  23. package/dist/sdk-config-ir/index.js +5 -0
  24. package/dist/sdk-config-ir/index.js.map +1 -1
  25. package/dist/sdk-config-ir/v1/index.cjs +5 -0
  26. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  27. package/dist/sdk-config-ir/v1/index.d.cts +20 -2
  28. package/dist/sdk-config-ir/v1/index.d.ts +20 -2
  29. package/dist/sdk-config-ir/v1/index.js +5 -0
  30. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  31. package/dist/{typescript-BruxA5zG.d.cts → typescript-BdDv_kwT.d.cts} +8 -0
  32. package/dist/{typescript-BruxA5zG.d.ts → typescript-BdDv_kwT.d.ts} +8 -0
  33. package/package.json +1 -1
  34. package/src/sdk-config-ir/v1/README.md +4 -2
@@ -1,4 +1,4 @@
1
- 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 { 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';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2712,6 +2712,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
2712
2712
  pnpm: "pnpm";
2713
2713
  yarn: "yarn";
2714
2714
  }>>;
2715
+ packageManagerVersion: z.ZodOptional<z.ZodString>;
2715
2716
  testFramework: z.ZodOptional<z.ZodEnum<{
2716
2717
  jest: "jest";
2717
2718
  vitest: "vitest";
@@ -2723,11 +2724,13 @@ declare const sdkConfigV1Schema: z.ZodObject<{
2723
2724
  bundle: z.ZodOptional<z.ZodBoolean>;
2724
2725
  exportClassDefault: z.ZodOptional<z.ZodBoolean>;
2725
2726
  namespaceExportName: z.ZodOptional<z.ZodString>;
2727
+ consolidateTypeFiles: z.ZodOptional<z.ZodBoolean>;
2726
2728
  allowCustomFetcher: z.ZodOptional<z.ZodBoolean>;
2727
2729
  useBrandedStringAliases: z.ZodOptional<z.ZodBoolean>;
2728
2730
  useLegacyExports: z.ZodOptional<z.ZodBoolean>;
2729
2731
  useBigInt: z.ZodOptional<z.ZodBoolean>;
2730
2732
  serdeLayer: z.ZodOptional<z.ZodBoolean>;
2733
+ esmOnly: z.ZodOptional<z.ZodBoolean>;
2731
2734
  scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
2732
2735
  name: z.ZodString;
2733
2736
  command: z.ZodString;
@@ -8701,6 +8704,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
8701
8704
  pnpm: "pnpm";
8702
8705
  yarn: "yarn";
8703
8706
  }>>;
8707
+ packageManagerVersion: z.ZodOptional<z.ZodString>;
8704
8708
  testFramework: z.ZodOptional<z.ZodEnum<{
8705
8709
  jest: "jest";
8706
8710
  vitest: "vitest";
@@ -8712,11 +8716,13 @@ declare const sdkConfigV1Schema: z.ZodObject<{
8712
8716
  bundle: z.ZodOptional<z.ZodBoolean>;
8713
8717
  exportClassDefault: z.ZodOptional<z.ZodBoolean>;
8714
8718
  namespaceExportName: z.ZodOptional<z.ZodString>;
8719
+ consolidateTypeFiles: z.ZodOptional<z.ZodBoolean>;
8715
8720
  allowCustomFetcher: z.ZodOptional<z.ZodBoolean>;
8716
8721
  useBrandedStringAliases: z.ZodOptional<z.ZodBoolean>;
8717
8722
  useLegacyExports: z.ZodOptional<z.ZodBoolean>;
8718
8723
  useBigInt: z.ZodOptional<z.ZodBoolean>;
8719
8724
  serdeLayer: z.ZodOptional<z.ZodBoolean>;
8725
+ esmOnly: z.ZodOptional<z.ZodBoolean>;
8720
8726
  scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
8721
8727
  name: z.ZodString;
8722
8728
  command: z.ZodString;
@@ -10093,6 +10099,7 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10093
10099
  pnpm: "pnpm";
10094
10100
  yarn: "yarn";
10095
10101
  }>>;
10102
+ packageManagerVersion: z.ZodOptional<z.ZodString>;
10096
10103
  testFramework: z.ZodOptional<z.ZodEnum<{
10097
10104
  jest: "jest";
10098
10105
  vitest: "vitest";
@@ -10104,11 +10111,13 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10104
10111
  bundle: z.ZodOptional<z.ZodBoolean>;
10105
10112
  exportClassDefault: z.ZodOptional<z.ZodBoolean>;
10106
10113
  namespaceExportName: z.ZodOptional<z.ZodString>;
10114
+ consolidateTypeFiles: z.ZodOptional<z.ZodBoolean>;
10107
10115
  allowCustomFetcher: z.ZodOptional<z.ZodBoolean>;
10108
10116
  useBrandedStringAliases: z.ZodOptional<z.ZodBoolean>;
10109
10117
  useLegacyExports: z.ZodOptional<z.ZodBoolean>;
10110
10118
  useBigInt: z.ZodOptional<z.ZodBoolean>;
10111
10119
  serdeLayer: z.ZodOptional<z.ZodBoolean>;
10120
+ esmOnly: z.ZodOptional<z.ZodBoolean>;
10112
10121
  scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
10113
10122
  name: z.ZodString;
10114
10123
  command: z.ZodString;
@@ -16082,6 +16091,7 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
16082
16091
  pnpm: "pnpm";
16083
16092
  yarn: "yarn";
16084
16093
  }>>;
16094
+ packageManagerVersion: z.ZodOptional<z.ZodString>;
16085
16095
  testFramework: z.ZodOptional<z.ZodEnum<{
16086
16096
  jest: "jest";
16087
16097
  vitest: "vitest";
@@ -16093,11 +16103,13 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
16093
16103
  bundle: z.ZodOptional<z.ZodBoolean>;
16094
16104
  exportClassDefault: z.ZodOptional<z.ZodBoolean>;
16095
16105
  namespaceExportName: z.ZodOptional<z.ZodString>;
16106
+ consolidateTypeFiles: z.ZodOptional<z.ZodBoolean>;
16096
16107
  allowCustomFetcher: z.ZodOptional<z.ZodBoolean>;
16097
16108
  useBrandedStringAliases: z.ZodOptional<z.ZodBoolean>;
16098
16109
  useLegacyExports: z.ZodOptional<z.ZodBoolean>;
16099
16110
  useBigInt: z.ZodOptional<z.ZodBoolean>;
16100
16111
  serdeLayer: z.ZodOptional<z.ZodBoolean>;
16112
+ esmOnly: z.ZodOptional<z.ZodBoolean>;
16101
16113
  scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
16102
16114
  name: z.ZodString;
16103
16115
  command: z.ZodString;
@@ -1,4 +1,4 @@
1
- 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 { 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';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2712,6 +2712,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
2712
2712
  pnpm: "pnpm";
2713
2713
  yarn: "yarn";
2714
2714
  }>>;
2715
+ packageManagerVersion: z.ZodOptional<z.ZodString>;
2715
2716
  testFramework: z.ZodOptional<z.ZodEnum<{
2716
2717
  jest: "jest";
2717
2718
  vitest: "vitest";
@@ -2723,11 +2724,13 @@ declare const sdkConfigV1Schema: z.ZodObject<{
2723
2724
  bundle: z.ZodOptional<z.ZodBoolean>;
2724
2725
  exportClassDefault: z.ZodOptional<z.ZodBoolean>;
2725
2726
  namespaceExportName: z.ZodOptional<z.ZodString>;
2727
+ consolidateTypeFiles: z.ZodOptional<z.ZodBoolean>;
2726
2728
  allowCustomFetcher: z.ZodOptional<z.ZodBoolean>;
2727
2729
  useBrandedStringAliases: z.ZodOptional<z.ZodBoolean>;
2728
2730
  useLegacyExports: z.ZodOptional<z.ZodBoolean>;
2729
2731
  useBigInt: z.ZodOptional<z.ZodBoolean>;
2730
2732
  serdeLayer: z.ZodOptional<z.ZodBoolean>;
2733
+ esmOnly: z.ZodOptional<z.ZodBoolean>;
2731
2734
  scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
2732
2735
  name: z.ZodString;
2733
2736
  command: z.ZodString;
@@ -8701,6 +8704,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
8701
8704
  pnpm: "pnpm";
8702
8705
  yarn: "yarn";
8703
8706
  }>>;
8707
+ packageManagerVersion: z.ZodOptional<z.ZodString>;
8704
8708
  testFramework: z.ZodOptional<z.ZodEnum<{
8705
8709
  jest: "jest";
8706
8710
  vitest: "vitest";
@@ -8712,11 +8716,13 @@ declare const sdkConfigV1Schema: z.ZodObject<{
8712
8716
  bundle: z.ZodOptional<z.ZodBoolean>;
8713
8717
  exportClassDefault: z.ZodOptional<z.ZodBoolean>;
8714
8718
  namespaceExportName: z.ZodOptional<z.ZodString>;
8719
+ consolidateTypeFiles: z.ZodOptional<z.ZodBoolean>;
8715
8720
  allowCustomFetcher: z.ZodOptional<z.ZodBoolean>;
8716
8721
  useBrandedStringAliases: z.ZodOptional<z.ZodBoolean>;
8717
8722
  useLegacyExports: z.ZodOptional<z.ZodBoolean>;
8718
8723
  useBigInt: z.ZodOptional<z.ZodBoolean>;
8719
8724
  serdeLayer: z.ZodOptional<z.ZodBoolean>;
8725
+ esmOnly: z.ZodOptional<z.ZodBoolean>;
8720
8726
  scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
8721
8727
  name: z.ZodString;
8722
8728
  command: z.ZodString;
@@ -10093,6 +10099,7 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10093
10099
  pnpm: "pnpm";
10094
10100
  yarn: "yarn";
10095
10101
  }>>;
10102
+ packageManagerVersion: z.ZodOptional<z.ZodString>;
10096
10103
  testFramework: z.ZodOptional<z.ZodEnum<{
10097
10104
  jest: "jest";
10098
10105
  vitest: "vitest";
@@ -10104,11 +10111,13 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10104
10111
  bundle: z.ZodOptional<z.ZodBoolean>;
10105
10112
  exportClassDefault: z.ZodOptional<z.ZodBoolean>;
10106
10113
  namespaceExportName: z.ZodOptional<z.ZodString>;
10114
+ consolidateTypeFiles: z.ZodOptional<z.ZodBoolean>;
10107
10115
  allowCustomFetcher: z.ZodOptional<z.ZodBoolean>;
10108
10116
  useBrandedStringAliases: z.ZodOptional<z.ZodBoolean>;
10109
10117
  useLegacyExports: z.ZodOptional<z.ZodBoolean>;
10110
10118
  useBigInt: z.ZodOptional<z.ZodBoolean>;
10111
10119
  serdeLayer: z.ZodOptional<z.ZodBoolean>;
10120
+ esmOnly: z.ZodOptional<z.ZodBoolean>;
10112
10121
  scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
10113
10122
  name: z.ZodString;
10114
10123
  command: z.ZodString;
@@ -16082,6 +16091,7 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
16082
16091
  pnpm: "pnpm";
16083
16092
  yarn: "yarn";
16084
16093
  }>>;
16094
+ packageManagerVersion: z.ZodOptional<z.ZodString>;
16085
16095
  testFramework: z.ZodOptional<z.ZodEnum<{
16086
16096
  jest: "jest";
16087
16097
  vitest: "vitest";
@@ -16093,11 +16103,13 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
16093
16103
  bundle: z.ZodOptional<z.ZodBoolean>;
16094
16104
  exportClassDefault: z.ZodOptional<z.ZodBoolean>;
16095
16105
  namespaceExportName: z.ZodOptional<z.ZodString>;
16106
+ consolidateTypeFiles: z.ZodOptional<z.ZodBoolean>;
16096
16107
  allowCustomFetcher: z.ZodOptional<z.ZodBoolean>;
16097
16108
  useBrandedStringAliases: z.ZodOptional<z.ZodBoolean>;
16098
16109
  useLegacyExports: z.ZodOptional<z.ZodBoolean>;
16099
16110
  useBigInt: z.ZodOptional<z.ZodBoolean>;
16100
16111
  serdeLayer: z.ZodOptional<z.ZodBoolean>;
16112
+ esmOnly: z.ZodOptional<z.ZodBoolean>;
16101
16113
  scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
16102
16114
  name: z.ZodString;
16103
16115
  command: z.ZodString;
@@ -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"]) {
@@ -1800,17 +1812,22 @@ var typescriptGenerationConfigSchema = z.strictObject({
1800
1812
  compilerOptions: compilerOptionsSchema.optional(),
1801
1813
  httpClient: httpClientSchema.optional(),
1802
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(),
1803
1817
  testFramework: z.enum(["jest", "vitest"]).optional(),
1804
1818
  namingStrategy: z.enum(["base", "originalPropertyNames"]).optional(),
1805
1819
  bundle: z.boolean().optional(),
1806
1820
  exportClassDefault: z.boolean().optional(),
1807
1821
  /** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
1808
1822
  namespaceExportName: nonEmptyStringSchema.optional(),
1823
+ consolidateTypeFiles: z.boolean().optional(),
1809
1824
  allowCustomFetcher: z.boolean().optional(),
1810
1825
  useBrandedStringAliases: z.boolean().optional(),
1811
1826
  useLegacyExports: z.boolean().optional(),
1812
1827
  useBigInt: z.boolean().optional(),
1813
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(),
1814
1831
  scripts: z.array(packageScriptSchema).optional()
1815
1832
  });
1816
1833
 
@@ -2484,15 +2501,23 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
2484
2501
  };
2485
2502
  }
2486
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;
2487
2505
  const directClientName = takeString(config, ["clientName", "clientClassName"], state, basePath);
2488
- 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;
2489
2507
  const directExportedClientName = takeString(
2490
2508
  config,
2491
2509
  ["exportedClientName", "exportedClientClassName"],
2492
2510
  state,
2493
2511
  basePath
2494
2512
  );
2495
- 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;
2496
2521
  const naming = compact({
2497
2522
  pagerName: takeString(
2498
2523
  config,
@@ -2502,12 +2527,7 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
2502
2527
  ),
2503
2528
  clientName: directClientName ?? nestedClientName,
2504
2529
  exportedClientName: directExportedClientName ?? nestedExportedClientName,
2505
- environmentTypeName: takeString(
2506
- config,
2507
- ["environmentClassName", "environmentEnumName"],
2508
- state,
2509
- basePath
2510
- ),
2530
+ environmentTypeName: takeString(config, ["environmentClassName", "environmentEnumName"], state, basePath) ?? nestedEnvironmentTypeName,
2511
2531
  apiErrorName: takeString(config, ["baseApiExceptionClassName"], state, basePath),
2512
2532
  baseErrorName: takeString(config, ["baseExceptionClassName"], state, basePath)
2513
2533
  });
@@ -2521,6 +2541,10 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
2521
2541
  basePath
2522
2542
  );
2523
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
+ }
2524
2548
  const generateFullProject = takeBoolean(config, ["generateFullProject"], state, basePath);
2525
2549
  if (generateFullProject !== void 0) generation.generateFullProject = generateFullProject;
2526
2550
  const inlineTypes = takeBoolean(config, ["enableInlineTypes"], state, basePath);
@@ -2538,6 +2562,18 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
2538
2562
  if (packagePath !== void 0) generation.layout = { packagePath };
2539
2563
  mapDependencies(config, state, packageConfig, basePath);
2540
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
+ }
2541
2577
  function mapLanguageConfig(language, config, state, packageConfig, basePath) {
2542
2578
  switch (language) {
2543
2579
  case "typescript":
@@ -2571,29 +2607,39 @@ function mapLanguageConfig(language, config, state, packageConfig, basePath) {
2571
2607
  }
2572
2608
  }
2573
2609
  function mapTypescript(config, state, packageConfig, basePath) {
2574
- 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;
2575
2621
  const serdeLayer = takeBoolean(config, ["serdeLayer"], state, basePath);
2576
2622
  const noSerdeLayer = takeBoolean(config, ["noSerdeLayer"], state, basePath);
2577
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;
2578
2626
  return compact({
2579
2627
  typescriptVersion: takeString(config, ["typescriptVersion"], state, basePath),
2580
2628
  zodVersion: takeString(config, ["zodVersion"], state, basePath),
2581
2629
  packageManager: takeEnum(config, ["packageManager"], ["pnpm", "yarn"], state, basePath),
2630
+ packageManagerVersion,
2582
2631
  testFramework: takeEnum(config, ["testFramework"], ["jest", "vitest"], state, basePath),
2583
2632
  httpClient: fetchSupport === "native" ? { name: "fetch" } : void 0,
2584
2633
  bundle: takeBoolean(config, ["bundle"], state, basePath),
2585
2634
  exportClassDefault: takeBoolean(config, ["exportClassDefault"], state, basePath),
2586
- namespaceExportName: takeString(
2587
- config,
2588
- ["namespaceExportName", "namespaceExport"],
2589
- state,
2590
- basePath
2591
- ),
2635
+ namespaceExportName: takeString(config, ["namespaceExportName", "namespaceExport"], state, basePath) ?? nestedNamespace,
2636
+ consolidateTypeFiles: takeBoolean(config, ["consolidateTypeFiles"], state, basePath),
2592
2637
  allowCustomFetcher: takeBoolean(config, ["allowCustomFetcher"], state, basePath),
2593
2638
  useBrandedStringAliases: takeBoolean(config, ["useBrandedStringAliases"], state, basePath),
2594
2639
  useLegacyExports: takeBoolean(config, ["useLegacyExports"], state, basePath),
2595
2640
  useBigInt: takeBoolean(config, ["useBigInt"], state, basePath),
2596
- serdeLayer: serdeLayer ?? (noSerdeLayer === void 0 ? void 0 : !noSerdeLayer)
2641
+ serdeLayer: serdeLayer ?? (noSerdeLayer === void 0 ? void 0 : !noSerdeLayer),
2642
+ esmOnly: takeBoolean(config, ["esmOnly"], state, basePath)
2597
2643
  });
2598
2644
  }
2599
2645
  function mapPython(config, state, packageConfig, basePath) {
@@ -2704,7 +2750,8 @@ function mapCsharp(config, state, packageConfig, basePath) {
2704
2750
  });
2705
2751
  }
2706
2752
  function mapPhp(config, state, packageConfig, basePath) {
2707
- mapPackageManifest(config, ["composerJson"], state, packageConfig, basePath);
2753
+ const manifest = mapPackageManifest(config, ["composerJson"], state, packageConfig, basePath);
2754
+ if (manifest) mapComposerRequirements(manifest, state, packageConfig);
2708
2755
  const packageName = takeString(config, ["packageName"], state, basePath);
2709
2756
  if (packageName !== void 0) packageConfig.packageName = packageName;
2710
2757
  return compact({
@@ -2712,6 +2759,20 @@ function mapPhp(config, state, packageConfig, basePath) {
2712
2759
  generateClientInterfaces: takeBoolean(config, ["generateClientInterfaces"], state, basePath)
2713
2760
  });
2714
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
+ }
2715
2776
  function mapRuby(config, state, packageConfig, basePath) {
2716
2777
  const moduleName = takeString(config, ["moduleName"], state, basePath);
2717
2778
  if (moduleName !== void 0) packageConfig.moduleName = moduleName;
@@ -2881,28 +2942,52 @@ function takeCustomSections(value, language, activeLanguages, state, basePath) {
2881
2942
  }
2882
2943
  function mapPackageManifest(config, aliases, state, packageConfig, basePath) {
2883
2944
  const manifest = takeObject(config, aliases, state, basePath);
2884
- if (!manifest) return;
2945
+ if (!manifest) return void 0;
2885
2946
  const packageName = takeString(manifest.value, ["name"], state, manifest.path);
2886
2947
  const description = takeString(manifest.value, ["description"], state, manifest.path);
2948
+ const keywords = takeStringArray(manifest.value, ["keywords"], state, manifest.path);
2887
2949
  const license = takeString(manifest.value, ["license"], state, manifest.path);
2888
2950
  const author = takeObject(manifest.value, ["author"], state, manifest.path);
2889
2951
  const authorName = author ? takeString(author.value, ["name"], state, author.path) : void 0;
2890
- const authors = authorName && author ? [
2891
- compact({
2892
- name: authorName,
2893
- email: takeString(author.value, ["email"], state, author.path),
2894
- url: takeString(author.value, ["url"], state, author.path)
2895
- })
2896
- ] : 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
+ ];
2897
2962
  Object.assign(
2898
2963
  packageConfig,
2899
2964
  compact({
2900
2965
  packageName,
2901
2966
  description,
2902
- authors,
2967
+ homepage: takeString(manifest.value, ["homepage"], state, manifest.path),
2968
+ keywords,
2969
+ authors: authors.length ? authors : void 0,
2903
2970
  license: license ? { type: license } : void 0
2904
2971
  })
2905
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
+ });
2906
2991
  }
2907
2992
  function takePythonAdditionalInitExports(config, state, basePath) {
2908
2993
  const located = locate(config, ["additionalInitExports"], basePath);