@osdk/generator-converters 2.0.0-beta.12 → 2.0.0-beta.14

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 (95) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts +4 -0
  3. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map +1 -0
  4. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js +31 -0
  5. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map +1 -0
  6. package/build/browser/empty.test.d.ts +2 -0
  7. package/build/browser/empty.test.d.ts.map +1 -0
  8. package/build/browser/empty.test.js +22 -0
  9. package/build/browser/empty.test.js.map +1 -0
  10. package/build/browser/getEditedEntities.d.ts +7 -0
  11. package/build/browser/getEditedEntities.d.ts.map +1 -0
  12. package/build/browser/getEditedEntities.js +41 -0
  13. package/build/browser/getEditedEntities.js.map +1 -0
  14. package/build/browser/index.d.ts +9 -0
  15. package/build/browser/index.d.ts.map +1 -0
  16. package/build/browser/index.js +23 -405
  17. package/build/browser/index.js.map +1 -1
  18. package/build/browser/isNullableQueryDataType.d.ts +3 -0
  19. package/build/browser/isNullableQueryDataType.d.ts.map +1 -0
  20. package/build/browser/isNullableQueryDataType.js +25 -0
  21. package/build/browser/isNullableQueryDataType.js.map +1 -0
  22. package/build/browser/wireActionTypeV2ToSdkActionMetadata.d.ts +4 -0
  23. package/build/browser/wireActionTypeV2ToSdkActionMetadata.d.ts.map +1 -0
  24. package/build/browser/wireActionTypeV2ToSdkActionMetadata.js +85 -0
  25. package/build/browser/wireActionTypeV2ToSdkActionMetadata.js.map +1 -0
  26. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts +10 -0
  27. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +1 -0
  28. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js +56 -0
  29. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -0
  30. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts +2 -0
  31. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts.map +1 -0
  32. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +67 -0
  33. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +1 -0
  34. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts +4 -0
  35. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts.map +1 -0
  36. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js +51 -0
  37. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js.map +1 -0
  38. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.d.ts +6 -0
  39. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +1 -0
  40. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.js +90 -0
  41. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.js.map +1 -0
  42. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.d.ts +4 -0
  43. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.d.ts.map +1 -0
  44. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js +143 -0
  45. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -0
  46. package/build/{esm/wireQueryTypeV2ToSdkQueryDefinition.d.ts → browser/wireQueryTypeV2ToSdkQueryMetadata.d.ts} +4 -3
  47. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.d.ts.map +1 -0
  48. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.js +45 -0
  49. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.js.map +1 -0
  50. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts +2 -2
  51. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map +1 -1
  52. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js +31 -0
  53. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map +1 -0
  54. package/build/esm/empty.test.js +22 -0
  55. package/build/esm/empty.test.js.map +1 -0
  56. package/build/esm/getEditedEntities.js +41 -0
  57. package/build/esm/getEditedEntities.js.map +1 -0
  58. package/build/esm/index.d.ts +5 -5
  59. package/build/esm/index.d.ts.map +1 -1
  60. package/build/esm/index.js +23 -405
  61. package/build/esm/index.js.map +1 -1
  62. package/build/esm/isNullableQueryDataType.js +25 -0
  63. package/build/esm/isNullableQueryDataType.js.map +1 -0
  64. package/build/esm/wireActionTypeV2ToSdkActionMetadata.d.ts +4 -0
  65. package/build/esm/wireActionTypeV2ToSdkActionMetadata.d.ts.map +1 -0
  66. package/build/esm/wireActionTypeV2ToSdkActionMetadata.js +85 -0
  67. package/build/esm/wireActionTypeV2ToSdkActionMetadata.js.map +1 -0
  68. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts +10 -0
  69. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +1 -0
  70. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js +56 -0
  71. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -0
  72. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts +2 -0
  73. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts.map +1 -0
  74. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +67 -0
  75. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +1 -0
  76. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts.map +1 -1
  77. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js +51 -0
  78. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js.map +1 -0
  79. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +1 -1
  80. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.js +90 -0
  81. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.js.map +1 -0
  82. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js +143 -0
  83. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -0
  84. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.d.ts +13 -0
  85. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.d.ts.map +1 -0
  86. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.js +45 -0
  87. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.js.map +1 -0
  88. package/package.json +6 -8
  89. package/build/esm/wireActionTypeV2ToSdkActionDefinition.d.ts +0 -4
  90. package/build/esm/wireActionTypeV2ToSdkActionDefinition.d.ts.map +0 -1
  91. package/build/esm/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.d.ts +0 -10
  92. package/build/esm/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.d.ts.map +0 -1
  93. package/build/esm/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.test.d.ts +0 -2
  94. package/build/esm/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.test.d.ts.map +0 -1
  95. package/build/esm/wireQueryTypeV2ToSdkQueryDefinition.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @osdk/generator-converters
2
2
 
3
+ ## 2.0.0-beta.14
4
+
5
+ ### Minor Changes
6
+
7
+ - d4d6605: Audited and cleaned up deps
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [5d6d5ab]
12
+ - Updated dependencies [a2c7b37]
13
+ - Updated dependencies [fe9547e]
14
+ - Updated dependencies [1f633f7]
15
+ - Updated dependencies [d4d6605]
16
+ - @osdk/internal.foundry.core@0.2.0-beta.9
17
+ - @osdk/api@2.0.0-beta.14
18
+
19
+ ## 2.0.0-beta.13
20
+
21
+ ### Minor Changes
22
+
23
+ - 1488144: Renamed definition types to metadata
24
+ - c28792e: Modified return type of fetchMetadata to return Object/Interface Definitions
25
+ - 26ee3bd: Updates return types of fetchMetadata to be Action and Query Definitions
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [1488144]
30
+ - Updated dependencies [c28792e]
31
+ - Updated dependencies [26ee3bd]
32
+ - Updated dependencies [6ab5d2e]
33
+ - @osdk/api@2.0.0-beta.13
34
+
3
35
  ## 2.0.0-beta.12
4
36
 
5
37
  ### Minor Changes
@@ -0,0 +1,4 @@
1
+ import type { InterfaceMetadata } from "@osdk/api";
2
+ import type { InterfaceType } from "@osdk/internal.foundry.core";
3
+ export declare function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType: InterfaceType, v2: boolean): InterfaceMetadata<any, any>;
4
+ //# sourceMappingURL=__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts","sourceRoot":"","sources":["../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGjE,wBAAgB,mDAAmD,CACjE,aAAa,EAAE,aAAa,EAC5B,EAAE,EAAE,OAAO,GACV,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAuB7B"}
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { wirePropertyV2ToSdkPropertyDefinition } from "./wirePropertyV2ToSdkPropertyDefinition.js";
17
+ export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType) {
18
+ return {
19
+ type: "interface",
20
+ rid: interfaceType.rid,
21
+ apiName: interfaceType.apiName,
22
+ displayName: interfaceType.displayName,
23
+ description: interfaceType.description,
24
+ implements: interfaceType.extendsInterfaces,
25
+ properties: Object.fromEntries(Object.entries(interfaceType.properties).map(([key, value]) => {
26
+ return [key, wirePropertyV2ToSdkPropertyDefinition(value, true)];
27
+ })),
28
+ links: {}
29
+ };
30
+ }
31
+ //# sourceMappingURL=__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","type","rid","apiName","displayName","description","implements","extendsInterfaces","properties","Object","fromEntries","entries","map","key","value","links"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2) {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.extendsInterfaces,\n properties: Object.fromEntries(Object.entries(interfaceType.properties).map(([key, value]) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(value, true),\n ];\n })),\n links: {},\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,qCAAqC,QAAQ,4CAA4C;AAClG,OAAO,SAASC,mDAAmDA,CAACC,aAAa,EAAM;EACnF,OAAO;IACHC,IAAI,EAAE,WAAW;IACjBC,GAAG,EAAEF,aAAa,CAACE,GAAG;IACtBC,OAAO,EAAEH,aAAa,CAACG,OAAO;IAC9BC,WAAW,EAAEJ,aAAa,CAACI,WAAW;IACtCC,WAAW,EAAEL,aAAa,CAACK,WAAW;IACtCC,UAAU,EAAEN,aAAa,CAACO,iBAAiB;IAC3CC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACX,aAAa,CAACQ,UAAU,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;MAC1F,OAAO,CACHD,GAAG,EACHf,qCAAqC,CAACgB,KAAK,EAAE,IAAI,CAAC,CACrD;IACL,CAAC,CAAC,CAAC;IACHC,KAAK,EAAE,CAAC;EACZ,CAAC;AACL","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=empty.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty.test.d.ts","sourceRoot":"","sources":["../../src/empty.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { describe, it } from "vitest";
17
+ describe("nothing", () => {
18
+ it("does nothing", () => {
19
+ return true;
20
+ });
21
+ });
22
+ //# sourceMappingURL=empty.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty.test.js","names":["describe","it"],"sources":["empty.test.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { describe, it } from \"vitest\";\ndescribe(\"nothing\", () => {\n it(\"does nothing\", () => {\n return true;\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,EAAE,QAAQ,QAAQ;AACrCD,QAAQ,CAAC,SAAS,EAAE,MAAM;EACtBC,EAAE,CAAC,cAAc,EAAE,MAAM;IACrB,OAAO,IAAI;EACf,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import type { ActionTypeV2 } from "@osdk/internal.foundry.core";
2
+ export type ModifiedEntityTypes = {
3
+ addedObjects: Set<string>;
4
+ modifiedObjects: Set<string>;
5
+ };
6
+ export declare function getModifiedEntityTypes(action: ActionTypeV2): ModifiedEntityTypes;
7
+ //# sourceMappingURL=getEditedEntities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEditedEntities.d.ts","sourceRoot":"","sources":["../../src/getEditedEntities.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,YAAY,GACnB,mBAAmB,CAsBrB"}
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export function getModifiedEntityTypes(action) {
17
+ const addedObjects = new Set();
18
+ const modifiedObjects = new Set();
19
+ for (const operation of action.operations) {
20
+ switch (operation.type) {
21
+ case "createObject":
22
+ addedObjects.add(operation.objectTypeApiName);
23
+ break;
24
+ case "modifyObject":
25
+ modifiedObjects.add(operation.objectTypeApiName);
26
+ break;
27
+ case "deleteObject":
28
+ case "createLink":
29
+ case "deleteLink":
30
+ case "createInterfaceObject":
31
+ case "modifyInterfaceObject":
32
+ break;
33
+ default:
34
+ }
35
+ }
36
+ return {
37
+ addedObjects,
38
+ modifiedObjects
39
+ };
40
+ }
41
+ //# sourceMappingURL=getEditedEntities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEditedEntities.js","names":["getModifiedEntityTypes","action","addedObjects","Set","modifiedObjects","operation","operations","type","add","objectTypeApiName"],"sources":["getEditedEntities.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function getModifiedEntityTypes(action) {\n const addedObjects = new Set();\n const modifiedObjects = new Set();\n for (const operation of action.operations) {\n switch (operation.type) {\n case \"createObject\":\n addedObjects.add(operation.objectTypeApiName);\n break;\n case \"modifyObject\":\n modifiedObjects.add(operation.objectTypeApiName);\n break;\n case \"deleteObject\":\n case \"createLink\":\n case \"deleteLink\":\n case \"createInterfaceObject\":\n case \"modifyInterfaceObject\":\n break;\n default:\n const _ = operation;\n }\n }\n return { addedObjects, modifiedObjects };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CAACC,MAAM,EAAE;EAC3C,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC9B,MAAMC,eAAe,GAAG,IAAID,GAAG,CAAC,CAAC;EACjC,KAAK,MAAME,SAAS,IAAIJ,MAAM,CAACK,UAAU,EAAE;IACvC,QAAQD,SAAS,CAACE,IAAI;MAClB,KAAK,cAAc;QACfL,YAAY,CAACM,GAAG,CAACH,SAAS,CAACI,iBAAiB,CAAC;QAC7C;MACJ,KAAK,cAAc;QACfL,eAAe,CAACI,GAAG,CAACH,SAAS,CAACI,iBAAiB,CAAC;QAChD;MACJ,KAAK,cAAc;MACnB,KAAK,YAAY;MACjB,KAAK,YAAY;MACjB,KAAK,uBAAuB;MAC5B,KAAK,uBAAuB;QACxB;MACJ;IAEJ;EACJ;EACA,OAAO;IAAEP,YAAY;IAAEE;EAAgB,CAAC;AAC5C","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js";
2
+ export { wireActionTypeV2ToSdkActionMetadata } from "./wireActionTypeV2ToSdkActionMetadata.js";
3
+ export { wireObjectTypeFullMetadataToSdkObjectMetadata } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
4
+ export { wirePropertyV2ToSdkPropertyDefinition } from "./wirePropertyV2ToSdkPropertyDefinition.js";
5
+ export { wireQueryDataTypeToQueryDataTypeDefinition } from "./wireQueryDataTypeToQueryDataTypeDefinition.js";
6
+ export { wireQueryTypeV2ToSdkQueryMetadata } from "./wireQueryTypeV2ToSdkQueryMetadata.js";
7
+ export { wireQueryParameterV2ToQueryParameterDefinition } from "./wireQueryTypeV2ToSdkQueryMetadata.js";
8
+ export { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from "./wireQueryTypeV2ToSdkQueryMetadata.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mDAAmD,EAAE,MAAM,0DAA0D,CAAC;AAC/H,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,6CAA6C,EAAE,MAAM,oDAAoD,CAAC;AACnH,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AACnG,OAAO,EAAE,0CAA0C,EAAE,MAAM,iDAAiD,CAAC;AAC7G,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,8CAA8C,EAAE,MAAM,wCAAwC,CAAC;AACxG,OAAO,EAAE,2CAA2C,EAAE,MAAM,wCAAwC,CAAC"}
@@ -1,406 +1,24 @@
1
- // src/wirePropertyV2ToSdkPropertyDefinition.ts
2
- function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true) {
3
- switch (input.dataType.type) {
4
- case "integer":
5
- case "string":
6
- case "byte":
7
- case "decimal":
8
- case "double":
9
- case "float":
10
- case "long":
11
- case "short":
12
- case "boolean":
13
- case "date":
14
- case "attachment":
15
- case "geopoint":
16
- case "geoshape":
17
- case "timestamp":
18
- case "timeseries":
19
- case "marking":
20
- return {
21
- displayName: input.displayName,
22
- multiplicity: false,
23
- description: input.description,
24
- type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),
25
- nullable: input.nullable == null ? isNullable : input.nullable
26
- };
27
- case "array": {
28
- return {
29
- displayName: input.displayName,
30
- multiplicity: true,
31
- description: input.description,
32
- type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),
33
- nullable: true
34
- };
35
- }
36
- default:
37
- input.dataType;
38
- throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);
39
- }
40
- }
41
- function objectPropertyTypeToSdkPropertyDefinition(propertyType) {
42
- switch (propertyType.type) {
43
- case "integer":
44
- case "string":
45
- case "byte":
46
- case "decimal":
47
- case "double":
48
- case "float":
49
- case "long":
50
- case "short":
51
- case "boolean":
52
- case "attachment":
53
- case "geopoint":
54
- case "geoshape":
55
- case "timestamp":
56
- case "marking":
57
- return propertyType.type;
58
- case "date":
59
- return "datetime";
60
- case "array":
61
- return objectPropertyTypeToSdkPropertyDefinition(propertyType.subType);
62
- case "timeseries":
63
- if (propertyType.itemType.type === "string") {
64
- return "stringTimeseries";
65
- }
66
- return "numericTimeseries";
67
- default:
68
- throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);
69
- }
70
- }
71
-
72
- // src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts
73
- function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2) {
74
- return {
75
- type: "interface",
76
- apiName: interfaceType.apiName,
77
- displayName: interfaceType.displayName,
78
- description: interfaceType.description,
79
- implements: interfaceType.extendsInterfaces,
80
- properties: Object.fromEntries(Object.entries(interfaceType.properties).map(([key, value]) => {
81
- return [key, wirePropertyV2ToSdkPropertyDefinition(value, true)];
82
- })),
83
- links: {}
84
- };
85
- }
86
-
87
- // src/getEditedEntities.ts
88
- function getModifiedEntityTypes(action) {
89
- const addedObjects = /* @__PURE__ */ new Set();
90
- const modifiedObjects = /* @__PURE__ */ new Set();
91
- for (const operation of action.operations) {
92
- switch (operation.type) {
93
- case "createObject":
94
- addedObjects.add(operation.objectTypeApiName);
95
- break;
96
- case "modifyObject":
97
- modifiedObjects.add(operation.objectTypeApiName);
98
- break;
99
- }
100
- }
101
- return {
102
- addedObjects,
103
- modifiedObjects
104
- };
105
- }
106
-
107
- // src/wireActionTypeV2ToSdkActionDefinition.ts
108
- function wireActionTypeV2ToSdkActionDefinition(input) {
109
- const modifiedEntityTypes = getModifiedEntityTypes(input);
110
- return {
111
- type: "action",
112
- apiName: input.apiName,
113
- parameters: Object.fromEntries(Object.entries(input.parameters).map(([key, value]) => [key, wireActionParameterV2ToSdkParameterDefinition(value)])),
114
- displayName: input.displayName,
115
- description: input.description,
116
- modifiedEntities: createModifiedEntities(modifiedEntityTypes.addedObjects, modifiedEntityTypes.modifiedObjects)
117
- };
118
- }
119
- function wireActionParameterV2ToSdkParameterDefinition(value) {
120
- return {
121
- multiplicity: value.dataType.type === "array",
122
- type: actionPropertyToSdkPropertyDefinition(value.dataType.type === "array" ? value.dataType.subType : value.dataType),
123
- nullable: !value.required,
124
- description: value.description
125
- };
126
- }
127
- function actionPropertyToSdkPropertyDefinition(parameterType) {
128
- switch (parameterType.type) {
129
- case "string":
130
- case "boolean":
131
- case "attachment":
132
- case "double":
133
- case "integer":
134
- case "long":
135
- case "timestamp":
136
- case "marking":
137
- return parameterType.type;
138
- case "date":
139
- return "datetime";
140
- case "objectSet":
141
- return {
142
- type: "objectSet",
143
- objectSet: parameterType.objectTypeApiName
144
- };
145
- case "object":
146
- return {
147
- type: "object",
148
- object: parameterType.objectTypeApiName
149
- };
150
- case "array":
151
- return actionPropertyToSdkPropertyDefinition(parameterType.subType);
152
- }
153
- }
154
- function createModifiedEntities(addedObjects, modifiedObjects) {
155
- let entities = {};
156
- for (const key of addedObjects) {
157
- entities[key] = {
158
- created: true,
159
- modified: false
160
- };
161
- }
162
- for (const key of modifiedObjects) {
163
- if (entities[key]) {
164
- entities[key].modified = true;
165
- } else {
166
- entities[key] = {
167
- created: false,
168
- modified: true
169
- };
170
- }
171
- }
172
- return entities;
173
- }
174
-
175
- // src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts
176
- function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
177
- switch (input.dataType.type) {
178
- case "integer":
179
- case "double":
180
- case "string":
181
- case "boolean":
182
- case "byte":
183
- case "long":
184
- case "short": {
185
- return input.dataType.type;
186
- }
187
- case "date": {
188
- return "datetime";
189
- }
190
- case "timestamp": {
191
- return "timestamp";
192
- }
193
- case "geopoint":
194
- case "geoshape":
195
- case "decimal":
196
- case "attachment":
197
- case "timeseries":
198
- case "array":
199
- case "marking":
200
- case "float":
201
- throw new Error(`Type not supported for primaryKey: ${input.dataType.type}`);
202
- default:
203
- input.dataType;
204
- throw new Error(`Unknown type encountered for primaryKey: ${input.dataType}`);
205
- }
206
- }
207
-
208
- // src/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.ts
209
- function wireObjectTypeFullMetadataToSdkObjectTypeDefinition(objectTypeWithLink, v2) {
210
- if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === void 0) {
211
- throw new Error(`Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`);
212
- }
213
- if (objectTypeWithLink.implementsInterfaces2 == null && objectTypeWithLink.implementsInterfaces != null) {
214
- throw new Error("Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.");
215
- }
216
- const interfaceMap = objectTypeWithLink.implementsInterfaces2 ? Object.fromEntries(Object.entries(objectTypeWithLink.implementsInterfaces2).map(([interfaceApiName, impl]) => [interfaceApiName, impl.properties])) : {};
217
- return {
218
- type: "object",
219
- apiName: objectTypeWithLink.objectType.apiName,
220
- description: objectTypeWithLink.objectType.description,
221
- primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,
222
- primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey]),
223
- links: Object.fromEntries(objectTypeWithLink.linkTypes.map((linkType) => {
224
- return [linkType.apiName, {
225
- multiplicity: linkType.cardinality === "MANY",
226
- targetType: linkType.objectTypeApiName
227
- }];
228
- })),
229
- properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key))])),
230
- spts: objectTypeWithLink.sharedPropertyTypeMapping,
231
- inverseSpts: invertProps(objectTypeWithLink.sharedPropertyTypeMapping),
232
- implements: objectTypeWithLink.implementsInterfaces,
233
- interfaceMap,
234
- inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)]))
235
- };
236
- }
237
- function invertProps(a) {
238
- return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : void 0;
239
- }
240
-
241
- // src/isNullableQueryDataType.ts
242
- function isNullableQueryDataType(input) {
243
- if (input.type === "null") {
244
- return true;
245
- }
246
- if (input.type === "union") {
247
- return input.unionTypes.some((t) => isNullableQueryDataType(t));
248
- }
249
- return false;
250
- }
251
-
252
- // src/wireQueryDataTypeToQueryDataTypeDefinition.ts
253
- function wireQueryDataTypeToQueryDataTypeDefinition(input) {
254
- switch (input.type) {
255
- case "double":
256
- case "float":
257
- case "integer":
258
- case "long":
259
- case "attachment":
260
- case "boolean":
261
- case "date":
262
- case "string":
263
- case "timestamp":
264
- return {
265
- type: input.type,
266
- nullable: false
267
- };
268
- case "object":
269
- return {
270
- type: "object",
271
- object: input.objectTypeApiName,
272
- nullable: false
273
- };
274
- case "objectSet":
275
- return {
276
- type: "objectSet",
277
- objectSet: input.objectTypeApiName,
278
- nullable: false
279
- };
280
- case "array":
281
- return {
282
- ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),
283
- multiplicity: true
284
- };
285
- case "set":
286
- return {
287
- type: "set",
288
- set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),
289
- nullable: false
290
- };
291
- case "union":
292
- const allowNulls = isNullableQueryDataType(input);
293
- if (allowNulls && input.unionTypes.length === 2) {
294
- const nonNull = input.unionTypes.find((t) => t.type != null);
295
- if (nonNull) {
296
- return {
297
- ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),
298
- nullable: true
299
- };
300
- }
301
- }
302
- return {
303
- type: "union",
304
- union: input.unionTypes.reduce((acc, t) => {
305
- if (t.type === "null") {
306
- return acc;
307
- }
308
- acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));
309
- return acc;
310
- }, []),
311
- nullable: allowNulls
312
- };
313
- case "struct":
314
- return {
315
- type: "struct",
316
- struct: Object.fromEntries(input.fields.map((f) => [f.name, wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType)])),
317
- nullable: false
318
- };
319
- case "twoDimensionalAggregation":
320
- return {
321
- type: "twoDimensionalAggregation",
322
- twoDimensionalAggregation: get2DQueryAggregationProps(input),
323
- nullable: false
324
- };
325
- case "threeDimensionalAggregation":
326
- return {
327
- type: "threeDimensionalAggregation",
328
- threeDimensionalAggregation: get3DQueryAggregationProps(input),
329
- nullable: false
330
- };
331
- case "null":
332
- case "unsupported":
333
- throw new Error(`Accidentally tried to handle QueryDataType.type ${input.type}`);
334
- default:
335
- throw new Error(`Unsupported QueryDataType.type ${input.type}`);
336
- }
337
- }
338
- function get2DQueryAggregationProps(input) {
339
- if (input.keyType.type === "range") {
340
- return {
341
- keyType: input.keyType.type,
342
- keySubtype: input.keyType.subType.type,
343
- valueType: input.valueType.type
344
- };
345
- } else {
346
- if (guardInvalidKeyTypes(input.keyType)) {
347
- return {
348
- keyType: input.keyType.type,
349
- valueType: input.valueType.type
350
- };
351
- }
352
- throw new Error(`Cannot create 2D aggregation with ${input.keyType.type} as its type`);
353
- }
354
- }
355
- function get3DQueryAggregationProps(input) {
356
- if (input.keyType.type === "range") {
357
- return {
358
- keyType: input.keyType.type,
359
- keySubtype: input.keyType.subType.type,
360
- valueType: get2DQueryAggregationProps(input.valueType)
361
- };
362
- } else {
363
- if (guardInvalidKeyTypes(input.keyType)) {
364
- return {
365
- keyType: input.keyType.type,
366
- valueType: get2DQueryAggregationProps(input.valueType)
367
- };
368
- }
369
- throw new Error(`Cannot create 3D aggregation with ${input.keyType.type} as its type`);
370
- }
371
- }
372
- function guardInvalidKeyTypes(key) {
373
- return key.type === "string" || key.type === "boolean";
374
- }
375
-
376
- // src/wireQueryTypeV2ToSdkQueryDefinition.ts
377
- function wireQueryTypeV2ToSdkQueryDefinition(input) {
378
- return {
379
- type: "query",
380
- apiName: input.apiName,
381
- description: input.description,
382
- displayName: input.displayName,
383
- version: input.version,
384
- parameters: Object.fromEntries(Object.entries(input.parameters).map(([name, parameter]) => [name, wireQueryParameterV2ToQueryParameterDefinition(parameter)])),
385
- output: wireQueryDataTypeToQueryDataTypeDefinition(input.output)
386
- };
387
- }
388
- function wireQueryTypeV2ToSdkQueryDefinitionNoParams(input) {
389
- return {
390
- type: "query",
391
- apiName: input.apiName,
392
- description: input.description,
393
- displayName: input.displayName,
394
- version: input.version
395
- };
396
- }
397
- function wireQueryParameterV2ToQueryParameterDefinition(parameter) {
398
- return {
399
- description: parameter.description,
400
- ...wireQueryDataTypeToQueryDataTypeDefinition(parameter.dataType)
401
- };
402
- }
403
-
404
- export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireActionTypeV2ToSdkActionDefinition, wireObjectTypeFullMetadataToSdkObjectTypeDefinition, wirePropertyV2ToSdkPropertyDefinition, wireQueryDataTypeToQueryDataTypeDefinition, wireQueryParameterV2ToQueryParameterDefinition, wireQueryTypeV2ToSdkQueryDefinition, wireQueryTypeV2ToSdkQueryDefinitionNoParams };
405
- //# sourceMappingURL=index.js.map
1
+ /*
2
+ * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js";
17
+ export { wireActionTypeV2ToSdkActionMetadata } from "./wireActionTypeV2ToSdkActionMetadata.js";
18
+ export { wireObjectTypeFullMetadataToSdkObjectMetadata } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
19
+ export { wirePropertyV2ToSdkPropertyDefinition } from "./wirePropertyV2ToSdkPropertyDefinition.js";
20
+ export { wireQueryDataTypeToQueryDataTypeDefinition } from "./wireQueryDataTypeToQueryDataTypeDefinition.js";
21
+ export { wireQueryTypeV2ToSdkQueryMetadata } from "./wireQueryTypeV2ToSdkQueryMetadata.js";
22
+ export { wireQueryParameterV2ToQueryParameterDefinition } from "./wireQueryTypeV2ToSdkQueryMetadata.js";
23
+ export { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from "./wireQueryTypeV2ToSdkQueryMetadata.js";
406
24
  //# sourceMappingURL=index.js.map