@osdk/generator 1.11.1-main-20240520213923 → 1.12.0-main-20240529132607

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.
@@ -7,47 +7,66 @@ export interface DependencyVersions {
7
7
  areTheTypesWrongVersion: string;
8
8
  osdkApiVersion: string;
9
9
  osdkClientVersion: string;
10
+ osdkClientApiVersion: string;
10
11
  osdkLegacyClientVersion: string;
11
12
  }
12
- export declare function getPackageJsonContents(name: string, version: string, sdkVersion: "2.0" | "1.1", { typescriptVersion, tslibVersion, areTheTypesWrongVersion, osdkApiVersion, osdkClientVersion, osdkLegacyClientVersion, }: DependencyVersions): {
13
- name: string;
14
- version: string;
15
- main: string;
16
- module: string;
17
- exports: {
18
- ".": {
19
- import: string;
20
- require: string;
21
- };
22
- "./ontology/objects": {
23
- import: string;
24
- require: string;
25
- };
13
+ export declare function getExpectedDependencies(sdkVersion: "2.0" | "1.1", { osdkApiVersion, osdkClientVersion, osdkClientApiVersion, osdkLegacyClientVersion, }: DependencyVersions): {
14
+ devDependencies: {
15
+ "@osdk/client.api": string;
16
+ "@osdk/api": string;
17
+ } | {
18
+ "@osdk/legacy-client": string;
19
+ "@osdk/api": string;
26
20
  };
27
- scripts: {
28
- prepack: string;
29
- check: string;
21
+ peerDependencies: {
22
+ "@osdk/client.api": string;
23
+ "@osdk/client": string;
24
+ "@osdk/api": string;
25
+ } | {
26
+ "@osdk/legacy-client": string;
27
+ "@osdk/api": string;
30
28
  };
29
+ };
30
+ export declare function getPackageJsonContents(name: string, version: string, sdkVersion: "2.0" | "1.1", dependencyVersions: DependencyVersions): {
31
+ files: string[];
31
32
  devDependencies: {
32
- "@osdk/client": string;
33
33
  typescript: string;
34
34
  tslib: string;
35
35
  "@arethetypeswrong/cli": string;
36
+ "@osdk/client.api": string;
36
37
  "@osdk/api": string;
37
38
  } | {
38
- "@osdk/legacy-client": string;
39
39
  typescript: string;
40
40
  tslib: string;
41
41
  "@arethetypeswrong/cli": string;
42
+ "@osdk/legacy-client": string;
42
43
  "@osdk/api": string;
43
44
  };
44
45
  peerDependencies: {
46
+ "@osdk/client.api": string;
45
47
  "@osdk/client": string;
46
48
  "@osdk/api": string;
47
49
  } | {
48
50
  "@osdk/legacy-client": string;
49
51
  "@osdk/api": string;
50
52
  };
51
- files: string[];
53
+ name: string;
54
+ version: string;
55
+ main: string;
56
+ module: string;
57
+ exports: {
58
+ ".": {
59
+ import: string;
60
+ require: string;
61
+ };
62
+ "./ontology/objects": {
63
+ import: string;
64
+ require: string;
65
+ };
66
+ };
67
+ scripts: {
68
+ prepack: string;
69
+ check: string;
70
+ };
52
71
  };
53
72
  //# sourceMappingURL=generateClientSdkPackage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateClientSdkPackage.d.ts","sourceRoot":"","sources":["../../src/generateClientSdkPackage.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,KAAK,GAAG,KAAK,EACzB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,UAAU,EAAE,MAAM,iBA0DnB;AA+BD,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB,EAAE,MAAM,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,KAAK,GAAG,KAAK,EACzB,EACE,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,GACxB,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDtB"}
1
+ {"version":3,"file":"generateClientSdkPackage.d.ts","sourceRoot":"","sources":["../../src/generateClientSdkPackage.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,KAAK,GAAG,KAAK,EACzB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,UAAU,EAAE,MAAM,iBA0DnB;AA+BD,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB,EAAE,MAAM,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,KAAK,GAAG,KAAK,EACzB,EACE,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,GACxB,EAAE,kBAAkB;;;;;;;;;;;;;;;;EAoBtB;AA2BD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,KAAK,GAAG,KAAK,EACzB,kBAAkB,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCvC"}
@@ -400,7 +400,7 @@ async function generatePerActionDataFiles(ontology, fs2, outDir, importExt, v2)
400
400
  const importObjects = referencedObjectDefs.size > 0 ? `import type {${[...referencedObjectDefs].join(",")}} from "../objects${importExt}";` : "";
401
401
  await fs2.writeFile(path16__namespace.default.join(outDir, `${action.apiName}.ts`), await formatTs(`
402
402
  import type { ActionDefinition, ObjectActionDataType, ObjectSetActionDataType } from "@osdk/api";
403
- import type { ActionSignature, ApplyActionOptions, OsdkActionParameters,ActionReturnTypeForOptions, NOOP } from '@osdk/client';
403
+ import type { ActionSignature, ApplyActionOptions, OsdkActionParameters,ActionReturnTypeForOptions, NOOP } from '@osdk/client.api';
404
404
  import { $osdkMetadata} from "../../OntologyMetadata${importExt}";
405
405
  ${importObjects}
406
406
 
@@ -1726,7 +1726,29 @@ async function generateClientSdkVersionTwoPointZero(ontology, userAgent, fs2, ou
1726
1726
  import * as Interfaces from "./ontology/interfaces${importExt}";
1727
1727
  import { OntologyMetadata } from "./OntologyMetadata${importExt}";
1728
1728
 
1729
- const _Ontology = {
1729
+ export interface Ontology extends OntologyDefinition<${stringUnionFrom2(objectNames)}> {
1730
+ metadata: OntologyMetadata,
1731
+ objects: {
1732
+ ${objectNames.map((objectName) => {
1733
+ return `${objectName}: Objects.${objectName}`;
1734
+ }).join(",\n")}
1735
+ },
1736
+ actions: {
1737
+ ${actionNames.map((actionName) => {
1738
+ return `${actionName}: typeof Actions.${actionName}`;
1739
+ }).join(",\n")}
1740
+ },
1741
+ queries: {
1742
+ // TODO
1743
+ },
1744
+ interfaces: {
1745
+ ${interfaceNames.map((objectName) => {
1746
+ return `${objectName}: Interfaces.${objectName}`;
1747
+ }).join(",\n")}
1748
+ }
1749
+ }
1750
+
1751
+ export const Ontology: Ontology = {
1730
1752
  metadata: OntologyMetadata,
1731
1753
  objects: {
1732
1754
  ${objectNames.map((objectName) => {
@@ -1748,11 +1770,8 @@ async function generateClientSdkVersionTwoPointZero(ontology, userAgent, fs2, ou
1748
1770
  }).join(",\n")}
1749
1771
 
1750
1772
  }
1751
- } satisfies OntologyDefinition<${stringUnionFrom2(objectNames)}>;
1773
+ };
1752
1774
 
1753
- type _Ontology = typeof _Ontology;
1754
- export interface Ontology extends _Ontology {}
1755
- export const Ontology = _Ontology as Ontology;
1756
1775
  `));
1757
1776
  await fs2.mkdir(path16__namespace.default.join(outDir, "ontology", "objects"), {
1758
1777
  recursive: true
@@ -1761,7 +1780,7 @@ async function generateClientSdkVersionTwoPointZero(ontology, userAgent, fs2, ou
1761
1780
  const obj = ontology.objectTypes[name];
1762
1781
  await fs2.writeFile(path16__namespace.default.join(outDir, "ontology", `objects`, `${name}.ts`), await formatTs(`
1763
1782
  import type { ObjectTypeDefinition, VersionBound, ObjectTypeLinkDefinition, PropertyDef } from "@osdk/api";
1764
- import { Osdk } from "@osdk/client";
1783
+ import { Osdk } from "@osdk/client.api";
1765
1784
  import { $osdkMetadata } from "../../OntologyMetadata${importExt}";
1766
1785
  import type { $ExpectedClientVersion } from "../../OntologyMetadata${importExt}";
1767
1786
 
@@ -1853,14 +1872,52 @@ function getTsCompilerOptions(packageType) {
1853
1872
  };
1854
1873
  return compilerOptions;
1855
1874
  }
1856
- function getPackageJsonContents(name, version, sdkVersion, {
1857
- typescriptVersion,
1858
- tslibVersion,
1859
- areTheTypesWrongVersion,
1875
+ function getExpectedDependencies(sdkVersion, {
1860
1876
  osdkApiVersion,
1861
1877
  osdkClientVersion,
1878
+ osdkClientApiVersion,
1862
1879
  osdkLegacyClientVersion
1863
1880
  }) {
1881
+ return {
1882
+ devDependencies: {
1883
+ "@osdk/api": osdkApiVersion,
1884
+ ...sdkVersion === "2.0" ? {
1885
+ "@osdk/client.api": osdkClientApiVersion
1886
+ } : {
1887
+ "@osdk/legacy-client": osdkLegacyClientVersion
1888
+ }
1889
+ },
1890
+ peerDependencies: {
1891
+ "@osdk/api": osdkApiVersion,
1892
+ ...sdkVersion === "2.0" ? {
1893
+ "@osdk/client.api": osdkClientApiVersion,
1894
+ "@osdk/client": osdkClientVersion
1895
+ } : {
1896
+ "@osdk/legacy-client": osdkLegacyClientVersion
1897
+ }
1898
+ }
1899
+ };
1900
+ }
1901
+ function getExpectedDependenciesFull(sdkVersion, dependencyVersions) {
1902
+ const {
1903
+ typescriptVersion,
1904
+ tslibVersion,
1905
+ areTheTypesWrongVersion
1906
+ } = dependencyVersions;
1907
+ const base = getExpectedDependencies(sdkVersion, dependencyVersions);
1908
+ return {
1909
+ devDependencies: {
1910
+ ...base.devDependencies,
1911
+ "typescript": typescriptVersion,
1912
+ "tslib": tslibVersion,
1913
+ "@arethetypeswrong/cli": areTheTypesWrongVersion
1914
+ },
1915
+ peerDependencies: {
1916
+ ...base.peerDependencies
1917
+ }
1918
+ };
1919
+ }
1920
+ function getPackageJsonContents(name, version, sdkVersion, dependencyVersions) {
1864
1921
  const esmPrefix = "./dist/module";
1865
1922
  const commonjsPrefix = "./dist/commonjs";
1866
1923
  return {
@@ -1882,25 +1939,7 @@ function getPackageJsonContents(name, version, sdkVersion, {
1882
1939
  prepack: `tsc -p ${esmPrefix}/tsconfig.json && tsc -p ${commonjsPrefix}/tsconfig.json`,
1883
1940
  check: "npm exec attw $(npm pack)"
1884
1941
  },
1885
- devDependencies: {
1886
- "typescript": typescriptVersion,
1887
- "tslib": tslibVersion,
1888
- "@arethetypeswrong/cli": areTheTypesWrongVersion,
1889
- "@osdk/api": osdkApiVersion,
1890
- ...sdkVersion === "2.0" ? {
1891
- "@osdk/client": osdkClientVersion
1892
- } : {
1893
- "@osdk/legacy-client": osdkLegacyClientVersion
1894
- }
1895
- },
1896
- peerDependencies: {
1897
- "@osdk/api": osdkApiVersion,
1898
- ...sdkVersion === "2.0" ? {
1899
- "@osdk/client": osdkClientVersion
1900
- } : {
1901
- "@osdk/legacy-client": osdkLegacyClientVersion
1902
- }
1903
- },
1942
+ ...getExpectedDependenciesFull(sdkVersion, dependencyVersions),
1904
1943
  files: ["**/*.js", "**/*.d.ts", "dist/**/package.json"]
1905
1944
  };
1906
1945
  }
@@ -1911,5 +1950,6 @@ async function writeJson(minimalFs, filePath, body) {
1911
1950
  exports.__UNSTABLE_generateClientSdkPackage = generateClientSdkPackage;
1912
1951
  exports.generateClientSdkVersionOneDotOne = generateClientSdkVersionOneDotOne;
1913
1952
  exports.generateClientSdkVersionTwoPointZero = generateClientSdkVersionTwoPointZero;
1953
+ exports.getExpectedDependencies = getExpectedDependencies;
1914
1954
  //# sourceMappingURL=out.js.map
1915
1955
  //# sourceMappingURL=index.cjs.map