@osdk/generator 0.0.16 → 1.0.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 (28) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/js/index.cjs +361 -0
  3. package/build/js/index.cjs.map +1 -0
  4. package/build/js/index.mjs +137 -141
  5. package/build/js/index.mjs.map +1 -1
  6. package/build/types/WireOntologyDefinition.d.ts +1 -10
  7. package/build/types/shared/wireObjectTypeV2ToSdkObjectConst.d.ts +2 -0
  8. package/build/types/shared/wireObjectTypeV2ToSdkObjectDefinition.d.ts +3 -3
  9. package/build/types/shared/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts +2 -2
  10. package/build/types/shared/wirePropertyV2ToSdkPropertyDefinition.d.ts +2 -2
  11. package/build/types/util/test/TodoWireOntology.d.ts +86 -76
  12. package/build/types/v1.1/generateActions.d.ts +1 -1
  13. package/build/types/v1.1/generateClientSdkVersionOneDotOne.d.ts +1 -1
  14. package/build/types/v1.1/generateFoundryClientFile.d.ts +1 -1
  15. package/build/types/v1.1/generateIndexFile.d.ts +1 -1
  16. package/build/types/v1.1/generateMetadataFile.d.ts +1 -1
  17. package/build/types/v1.1/generateObjectsInterfaceFile.d.ts +1 -1
  18. package/build/types/v1.1/generateObjectsInterfaceSupportFiles.d.ts +1 -1
  19. package/build/types/v1.1/generatePerActionDataFiles.d.ts +1 -1
  20. package/build/types/v1.1/generatePerObjectInterfaceAndDataFiles.d.ts +1 -1
  21. package/build/types/v1.1/generatePerQueryDataFiles.d.ts +1 -1
  22. package/build/types/v1.1/generateQueries.d.ts +1 -1
  23. package/build/types/v1.1/wireObjectTypeV2ToV1ObjectInterfaceString.d.ts +2 -2
  24. package/build/types/v2.0/generateClientSdkVersionTwoPointZero.d.ts +1 -1
  25. package/build/types/v2.0/generateMetadata.d.ts +3 -0
  26. package/package.json +5 -5
  27. package/build/js/index.js +0 -365
  28. package/build/js/index.js.map +0 -1
@@ -1,12 +1,3 @@
1
1
  import type * as gateway from "@osdk/gateway";
2
- export interface WireOntologyDefinition {
3
- rid: string;
4
- apiName: string;
5
- description?: string;
6
- objectTypes: {
7
- [key: string]: gateway.components.ObjectTypeV2;
8
- };
9
- actionTypes: gateway.components.ActionTypeV2[];
10
- queryTypes: gateway.components.QueryTypeV2[];
11
- linkTypes: Record<string, gateway.components.LinkTypeSideV2[]>;
2
+ export interface WireOntologyDefinition extends gateway.components.OntologyFullMetadata {
12
3
  }
@@ -0,0 +1,2 @@
1
+ import type { ObjectTypeWithLink } from "@osdk/gateway/types";
2
+ export declare function wireObjectTypeV2ToSdkObjectConst(object: ObjectTypeWithLink, v2?: boolean): string;
@@ -1,3 +1,3 @@
1
- import type { ObjectDefinition } from "@osdk/api";
2
- import type { LinkTypeSideV2, ObjectTypeV2 } from "@osdk/gateway/types";
3
- export declare function wireObjectTypeV2ToSdkObjectDefinition(input: ObjectTypeV2, linkTypes?: LinkTypeSideV2[]): ObjectDefinition<any, any>;
1
+ import type { ObjectTypeDefinition } from "@osdk/api";
2
+ import type { ObjectTypeWithLink } from "@osdk/gateway/types";
3
+ export declare function wireObjectTypeV2ToSdkObjectDefinition(objectTypeWithLink: ObjectTypeWithLink, v2: boolean): ObjectTypeDefinition<any, any>;
@@ -1,3 +1,3 @@
1
- import type { ValidPropertyTypes } from "@osdk/api";
1
+ import type { WirePropertyTypes } from "@osdk/api";
2
2
  import type { PropertyV2 } from "@osdk/gateway/types";
3
- export declare function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input: PropertyV2): keyof ValidPropertyTypes;
3
+ export declare function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input: PropertyV2): keyof WirePropertyTypes;
@@ -1,3 +1,3 @@
1
- import type { PropertyDefinition } from "@osdk/api";
1
+ import type { ObjectTypePropertyDefinition } from "@osdk/api";
2
2
  import type { PropertyV2 } from "@osdk/gateway/types";
3
- export declare function wirePropertyV2ToSdkPropertyDefinition(input: PropertyV2): PropertyDefinition;
3
+ export declare function wirePropertyV2ToSdkPropertyDefinition(input: PropertyV2, isNullable?: boolean): ObjectTypePropertyDefinition;
@@ -1,102 +1,112 @@
1
1
  export declare const TodoWireOntology: {
2
- rid: string;
3
- actionTypes: {
2
+ ontology: {
3
+ rid: string;
4
4
  apiName: string;
5
+ displayName: string;
5
6
  description: string;
6
- parameters: {
7
- object: {
8
- description: string;
9
- dataType: {
10
- type: "object";
11
- objectApiName: string;
12
- objectTypeApiName: string;
7
+ };
8
+ actionTypes: {
9
+ markTodoCompleted: {
10
+ apiName: string;
11
+ description: string;
12
+ parameters: {
13
+ object: {
14
+ description: string;
15
+ dataType: {
16
+ type: "object";
17
+ objectApiName: string;
18
+ objectTypeApiName: string;
19
+ };
20
+ required: false;
13
21
  };
14
- required: false;
15
22
  };
23
+ rid: string;
24
+ operations: {
25
+ type: "modifyObject";
26
+ objectTypeApiName: string;
27
+ }[];
28
+ status: "ACTIVE";
16
29
  };
17
- rid: string;
18
- operations: {
19
- type: "modifyObject";
20
- objectTypeApiName: string;
21
- }[];
22
- status: "ACTIVE";
23
- }[];
24
- apiName: string;
30
+ };
25
31
  objectTypes: {
26
32
  Todo: {
27
- apiName: string;
28
- primaryKey: string;
29
- displayName: string;
30
- description: string;
31
- properties: {
32
- id: {
33
- dataType: {
34
- type: "integer";
33
+ objectType: {
34
+ apiName: string;
35
+ primaryKey: string;
36
+ displayName: string;
37
+ description: string;
38
+ properties: {
39
+ id: {
40
+ dataType: {
41
+ type: "integer";
42
+ };
35
43
  };
36
- };
37
- body: {
38
- dataType: {
39
- type: "string";
44
+ body: {
45
+ dataType: {
46
+ type: "string";
47
+ };
48
+ description: string;
49
+ displayName: string;
40
50
  };
41
- description: string;
42
- displayName: string;
43
- };
44
- complete: {
45
- dataType: {
46
- type: "boolean";
51
+ complete: {
52
+ dataType: {
53
+ type: "boolean";
54
+ };
47
55
  };
48
56
  };
57
+ status: "ACTIVE";
58
+ rid: string;
49
59
  };
50
- status: "ACTIVE";
51
- rid: string;
60
+ linkTypes: {
61
+ apiName: string;
62
+ cardinality: "ONE";
63
+ displayName: string;
64
+ objectTypeApiName: string;
65
+ status: "ACTIVE";
66
+ foreignKeyPropertyApiName: string;
67
+ }[];
52
68
  };
53
69
  Person: {
54
- apiName: string;
55
- primaryKey: string;
56
- displayName: string;
57
- description: string;
58
- properties: {
59
- email: {
60
- dataType: {
61
- type: "string";
70
+ objectType: {
71
+ apiName: string;
72
+ primaryKey: string;
73
+ displayName: string;
74
+ description: string;
75
+ properties: {
76
+ email: {
77
+ dataType: {
78
+ type: "string";
79
+ };
62
80
  };
63
81
  };
82
+ rid: string;
83
+ status: "ACTIVE";
64
84
  };
65
- rid: string;
66
- status: "ACTIVE";
85
+ linkTypes: {
86
+ apiName: string;
87
+ cardinality: "MANY";
88
+ displayName: string;
89
+ objectTypeApiName: string;
90
+ status: "ACTIVE";
91
+ foreignKeyPropertyApiName: string;
92
+ }[];
67
93
  };
68
94
  };
69
95
  queryTypes: {
70
- apiName: string;
71
- output: {
72
- type: "integer";
73
- };
74
- parameters: {
75
- completed: {
76
- dataType: {
77
- type: "boolean";
96
+ getCount: {
97
+ apiName: string;
98
+ output: {
99
+ type: "integer";
100
+ };
101
+ parameters: {
102
+ completed: {
103
+ dataType: {
104
+ type: "boolean";
105
+ };
78
106
  };
79
107
  };
108
+ rid: string;
109
+ version: string;
80
110
  };
81
- rid: string;
82
- version: string;
83
- }[];
84
- linkTypes: {
85
- Person: {
86
- apiName: string;
87
- cardinality: "MANY";
88
- displayName: string;
89
- objectTypeApiName: string;
90
- status: "ACTIVE";
91
- foreignKeyPropertyApiName: string;
92
- }[];
93
- Todo: {
94
- apiName: string;
95
- cardinality: "ONE";
96
- displayName: string;
97
- objectTypeApiName: string;
98
- status: "ACTIVE";
99
- foreignKeyPropertyApiName: string;
100
- }[];
101
111
  };
102
112
  };
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generateActions(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generateActions(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generateClientSdkVersionOneDotOne(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generateClientSdkVersionOneDotOne(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, packageType?: "commonjs" | "module"): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
- export declare function generateFoundryClientFile(fs: MinimalFs, outDir: string): Promise<void>;
2
+ export declare function generateFoundryClientFile(fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
- export declare function generateIndexFile(fs: MinimalFs, outDir: string): Promise<void>;
2
+ export declare function generateIndexFile(fs: MinimalFs, outDir: string, importExt: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generateMetadataFile(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generateMetadataFile(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generateObjectsInterfaceFile(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generateObjectsInterfaceFile(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generateObjectsInterfaceSupportFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generateObjectsInterfaceSupportFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generatePerActionDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generatePerActionDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generatePerObjectInterfaceAndDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generatePerObjectInterfaceAndDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generatePerQueryDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generatePerQueryDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generateQueries(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generateQueries(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, importExt?: string): Promise<void>;
@@ -1,2 +1,2 @@
1
- import type { LinkTypeSideV2, ObjectTypeV2 } from "@osdk/gateway/types";
2
- export declare function wireObjectTypeV2ToObjectInterfaceStringV1(input: ObjectTypeV2, linkTypes?: LinkTypeSideV2[]): string;
1
+ import type { ObjectTypeWithLink } from "@osdk/gateway/types";
2
+ export declare function wireObjectTypeV2ToObjectInterfaceStringV1(objectTypeWithLinks: ObjectTypeWithLink): string;
@@ -1,3 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
- export declare function generateClientSdkVersionTwoPointZero(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
3
+ export declare function generateClientSdkVersionTwoPointZero(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string, packageType?: "module" | "commonjs"): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generateOntologyMetadataFile(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/generator",
3
- "version": "0.0.16",
3
+ "version": "1.0.0",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -8,12 +8,12 @@
8
8
  ".": {
9
9
  "types": "./build/types/index.d.ts",
10
10
  "import": "./build/js/index.mjs",
11
- "require": "./build/js/index.js"
11
+ "require": "./build/js/index.cjs"
12
12
  },
13
13
  "./*": {
14
14
  "types": "./build/types/public/*.d.ts",
15
15
  "import": "./build/js/public/*.mjs",
16
- "require": "./build/js/public/*.js"
16
+ "require": "./build/js/public/*.cjs"
17
17
  }
18
18
  },
19
19
  "dependencies": {
@@ -21,8 +21,8 @@
21
21
  "prettier": "^3.0.3",
22
22
  "prettier-plugin-organize-imports": "^3.2.3",
23
23
  "tiny-invariant": "^1.3.1",
24
- "@osdk/api": "0.0.17",
25
- "@osdk/gateway": "0.0.10"
24
+ "@osdk/api": "1.0.0",
25
+ "@osdk/gateway": "1.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^16.11.11",