@osdk/generator 0.0.1 → 0.0.3

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 (52) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/build/js/index.js +251 -19
  3. package/build/js/index.js.map +1 -1
  4. package/build/js/index.mjs +237 -5
  5. package/build/js/index.mjs.map +1 -1
  6. package/build/types/MinimalFs.d.ts +7 -0
  7. package/build/types/WireOntologyDefinition.d.ts +12 -0
  8. package/build/types/index.d.ts +2 -15
  9. package/build/types/shared/generateMetadata.d.ts +3 -0
  10. package/build/types/shared/getEditedEntities.d.ts +6 -0
  11. package/build/types/shared/index.d.ts +3 -0
  12. package/build/types/shared/isNullableQueryDataType.d.ts +2 -0
  13. package/build/types/shared/sanitizeMetadata.d.ts +2 -0
  14. package/build/types/shared/wireActionTypeV2ToSdkActionDefinition.d.ts +3 -0
  15. package/build/types/shared/wireObjectTypeV2ToSdkObjectDefinition.d.ts +3 -0
  16. package/build/types/shared/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts +3 -0
  17. package/build/types/shared/wirePropertyV2ToSdkPropertyDefinition.d.ts +3 -0
  18. package/build/types/shared/wireQueryDataTypeToQueryDataTypeDefinition.d.ts +3 -0
  19. package/build/types/shared/wireQueryTypeV2ToSdkQueryDefinition.d.ts +3 -0
  20. package/build/types/util/InMemoryFs.d.ts +6 -0
  21. package/build/types/util/commaSeparatedIdentifiers.d.ts +1 -0
  22. package/build/types/util/test/TodoWireOntology.d.ts +102 -0
  23. package/build/types/util/test/compileThis.d.ts +2 -0
  24. package/build/types/util/test/createMockMinimalFiles.d.ts +11 -0
  25. package/build/types/util/test/formatTs.d.ts +1 -0
  26. package/build/types/v1.1/generateActions.d.ts +3 -0
  27. package/build/types/v1.1/generateActions.test.d.ts +1 -0
  28. package/build/types/v1.1/generateClientSdkVersionOneDotOne.d.ts +3 -0
  29. package/build/types/v1.1/generateClientSdkVersionOneDotOne.test.d.ts +1 -0
  30. package/build/types/v1.1/generateFoundryClientFile.d.ts +2 -0
  31. package/build/types/v1.1/generateFoundryClientFile.test.d.ts +1 -0
  32. package/build/types/v1.1/generateIndexFile.d.ts +2 -0
  33. package/build/types/v1.1/generateMetadataFile.d.ts +3 -0
  34. package/build/types/v1.1/generateMetadataFile.test.d.ts +1 -0
  35. package/build/types/v1.1/generateObjectsInterfaceFile.d.ts +3 -0
  36. package/build/types/v1.1/generateObjectsInterfaceFile.test.d.ts +1 -0
  37. package/build/types/v1.1/generatePerActionDataFiles.d.ts +3 -0
  38. package/build/types/v1.1/generatePerActionDataFiles.test.d.ts +1 -0
  39. package/build/types/v1.1/generatePerObjectInterfaceAndDataFiles.d.ts +3 -0
  40. package/build/types/v1.1/generatePerObjectInterfaceAndDataFiles.test.d.ts +1 -0
  41. package/build/types/v1.1/generatePerQueryDataFiles.d.ts +3 -0
  42. package/build/types/v1.1/generatePerQueryDataFiles.test.d.ts +1 -0
  43. package/build/types/v1.1/generateQueries.d.ts +3 -0
  44. package/build/types/v1.1/generateQueries.test.d.ts +1 -0
  45. package/build/types/v1.1/wireObjectTypeV2ToV1ObjectInterfaceString.d.ts +2 -0
  46. package/build/types/v1.1/wireObjectTypeV2ToV1ObjectInterfaceString.test.d.ts +1 -0
  47. package/build/types/v2.0/generateClientSdkVersionTwoPointZero.d.ts +3 -0
  48. package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +1 -0
  49. package/build/types/v2.0/wireObjectTypeV2ToObjectDefinitionInterfaceString.d.ts +2 -0
  50. package/build/types/validateWireOntologyAssumptions.d.ts +2 -0
  51. package/package.json +7 -2
  52. /package/build/types/{index.test.d.ts → shared/sanitizeMetadata.test.d.ts} +0 -0
@@ -0,0 +1,102 @@
1
+ export declare const TodoWireOntology: {
2
+ rid: string;
3
+ actionTypes: {
4
+ apiName: string;
5
+ description: string;
6
+ parameters: {
7
+ object: {
8
+ description: string;
9
+ dataType: {
10
+ type: "object";
11
+ objectApiName: string;
12
+ objectTypeApiName: string;
13
+ };
14
+ required: false;
15
+ };
16
+ };
17
+ rid: string;
18
+ operations: {
19
+ type: "modifyObject";
20
+ objectTypeApiName: string;
21
+ }[];
22
+ status: "ACTIVE";
23
+ }[];
24
+ apiName: string;
25
+ objectTypes: {
26
+ Todo: {
27
+ apiName: string;
28
+ primaryKey: string;
29
+ displayName: string;
30
+ description: string;
31
+ properties: {
32
+ id: {
33
+ dataType: {
34
+ type: "integer";
35
+ };
36
+ };
37
+ body: {
38
+ dataType: {
39
+ type: "string";
40
+ };
41
+ description: string;
42
+ displayName: string;
43
+ };
44
+ complete: {
45
+ dataType: {
46
+ type: "boolean";
47
+ };
48
+ };
49
+ };
50
+ status: "ACTIVE";
51
+ rid: string;
52
+ };
53
+ Person: {
54
+ apiName: string;
55
+ primaryKey: string;
56
+ displayName: string;
57
+ description: string;
58
+ properties: {
59
+ email: {
60
+ dataType: {
61
+ type: "string";
62
+ };
63
+ };
64
+ };
65
+ rid: string;
66
+ status: "ACTIVE";
67
+ };
68
+ };
69
+ queryTypes: {
70
+ apiName: string;
71
+ output: {
72
+ type: "integer";
73
+ };
74
+ parameters: {
75
+ completed: {
76
+ dataType: {
77
+ type: "boolean";
78
+ };
79
+ };
80
+ };
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
+ };
102
+ };
@@ -0,0 +1,2 @@
1
+ import * as ts from "typescript";
2
+ export declare function compileThis(files: Record<string, string>, basePath: string): readonly ts.Diagnostic[];
@@ -0,0 +1,11 @@
1
+ import type { WriteFileFn } from "../../MinimalFs";
2
+ export declare function createMockMinimalFiles(): {
3
+ minimalFiles: {
4
+ writeFile: WriteFileFn;
5
+ mkdir: () => Promise<void>;
6
+ };
7
+ getFiles: () => {
8
+ [k: string]: string;
9
+ };
10
+ dumpFilesToConsole: () => void;
11
+ };
@@ -0,0 +1 @@
1
+ export declare function formatTs(contents: string): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generateActions(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generateClientSdkVersionOneDotOne(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ export declare function generateFoundryClientFile(fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ export declare function generateIndexFile(fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generateMetadataFile(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generateObjectsInterfaceFile(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generatePerActionDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generatePerObjectInterfaceAndDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generatePerQueryDataFiles(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generateQueries(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { LinkTypeSideV2, ObjectTypeV2 } from "@osdk/gateway/types";
2
+ export declare function wireObjectTypeV2ToObjectInterfaceStringV1(input: ObjectTypeV2, linkTypes?: LinkTypeSideV2[]): string;
@@ -0,0 +1,3 @@
1
+ import type { MinimalFs } from "../MinimalFs";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition";
3
+ export declare function generateClientSdkVersionTwoPointZero(ontology: WireOntologyDefinition, fs: MinimalFs, outDir: string): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { ObjectTypeV2 } from "@osdk/gateway/types";
2
+ export declare function wireObjectTypeV2ToObjectDefinitionInterfaceString(input: ObjectTypeV2): string;
@@ -0,0 +1,2 @@
1
+ import type { WireOntologyDefinition } from "./WireOntologyDefinition";
2
+ export declare function validateWireOntologyAssumptions(ontology: WireOntologyDefinition): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/generator",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -18,8 +18,11 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "fetch-retry": "^5.0.6",
21
+ "prettier": "^3.0.3",
22
+ "prettier-plugin-organize-imports": "^3.2.3",
21
23
  "tiny-invariant": "^1.3.1",
22
- "@osdk/gateway": "0.0.1"
24
+ "@osdk/api": "0.0.7",
25
+ "@osdk/gateway": "0.0.2"
23
26
  },
24
27
  "devDependencies": {
25
28
  "@types/node": "^16.11.11",
@@ -42,6 +45,8 @@
42
45
  "dev:transpile": "tsup --watch",
43
46
  "fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
44
47
  "lint": "eslint . && dprint check --config $(find-up dprint.json)",
48
+ "test": "vitest run",
49
+ "test:watch": "vitest",
45
50
  "transpile": "tsup",
46
51
  "transpileWatch": "tsup --watch",
47
52
  "typecheck": "tsc-absolute --build"