@osdk/generator-converters 2.0.0-beta.9 → 2.0.1

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 (108) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/build/{cjs/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.cts → browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts} +2 -2
  3. package/build/{cjs → browser}/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map +1 -1
  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.js +22 -0
  7. package/build/browser/empty.test.js.map +1 -0
  8. package/build/browser/getEditedEntities.d.ts +7 -0
  9. package/build/browser/getEditedEntities.d.ts.map +1 -0
  10. package/build/browser/getEditedEntities.js +41 -0
  11. package/build/browser/getEditedEntities.js.map +1 -0
  12. package/build/browser/index.d.ts +9 -0
  13. package/build/browser/index.d.ts.map +1 -0
  14. package/build/browser/index.js +23 -154
  15. package/build/browser/index.js.map +1 -1
  16. package/build/browser/isNullableQueryDataType.d.ts +3 -0
  17. package/build/browser/isNullableQueryDataType.d.ts.map +1 -0
  18. package/build/browser/isNullableQueryDataType.js +25 -0
  19. package/build/browser/isNullableQueryDataType.js.map +1 -0
  20. package/build/browser/wireActionTypeV2ToSdkActionMetadata.d.ts +4 -0
  21. package/build/browser/wireActionTypeV2ToSdkActionMetadata.d.ts.map +1 -0
  22. package/build/browser/wireActionTypeV2ToSdkActionMetadata.js +85 -0
  23. package/build/browser/wireActionTypeV2ToSdkActionMetadata.js.map +1 -0
  24. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts +10 -0
  25. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +1 -0
  26. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js +56 -0
  27. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -0
  28. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts +2 -0
  29. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts.map +1 -0
  30. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +67 -0
  31. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +1 -0
  32. package/build/{cjs → browser}/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts.map +1 -1
  33. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js +51 -0
  34. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js.map +1 -0
  35. package/build/{cjs/wirePropertyV2ToSdkPropertyDefinition.d.cts → browser/wirePropertyV2ToSdkPropertyDefinition.d.ts} +2 -2
  36. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +1 -0
  37. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.js +90 -0
  38. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.js.map +1 -0
  39. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.d.ts +4 -0
  40. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.d.ts.map +1 -0
  41. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js +143 -0
  42. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -0
  43. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.d.ts +13 -0
  44. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.d.ts.map +1 -0
  45. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.js +45 -0
  46. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.js.map +1 -0
  47. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts +2 -2
  48. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map +1 -1
  49. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js +31 -0
  50. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map +1 -0
  51. package/build/esm/empty.test.js +22 -0
  52. package/build/esm/empty.test.js.map +1 -0
  53. package/build/esm/getEditedEntities.d.ts +7 -0
  54. package/build/esm/getEditedEntities.d.ts.map +1 -0
  55. package/build/esm/getEditedEntities.js +41 -0
  56. package/build/esm/getEditedEntities.js.map +1 -0
  57. package/build/esm/index.d.ts +6 -1
  58. package/build/esm/index.d.ts.map +1 -1
  59. package/build/esm/index.js +23 -154
  60. package/build/esm/index.js.map +1 -1
  61. package/build/esm/isNullableQueryDataType.d.ts +3 -0
  62. package/build/esm/isNullableQueryDataType.d.ts.map +1 -0
  63. package/build/esm/isNullableQueryDataType.js +25 -0
  64. package/build/esm/isNullableQueryDataType.js.map +1 -0
  65. package/build/esm/wireActionTypeV2ToSdkActionMetadata.d.ts +4 -0
  66. package/build/esm/wireActionTypeV2ToSdkActionMetadata.d.ts.map +1 -0
  67. package/build/esm/wireActionTypeV2ToSdkActionMetadata.js +85 -0
  68. package/build/esm/wireActionTypeV2ToSdkActionMetadata.js.map +1 -0
  69. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts +10 -0
  70. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +1 -0
  71. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js +56 -0
  72. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -0
  73. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts +2 -0
  74. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts.map +1 -0
  75. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +67 -0
  76. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +1 -0
  77. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts.map +1 -1
  78. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js +51 -0
  79. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js.map +1 -0
  80. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.d.ts +2 -2
  81. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +1 -1
  82. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.js +90 -0
  83. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.js.map +1 -0
  84. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.d.ts +4 -0
  85. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.d.ts.map +1 -0
  86. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js +143 -0
  87. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -0
  88. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.d.ts +13 -0
  89. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.d.ts.map +1 -0
  90. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.js +45 -0
  91. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.js.map +1 -0
  92. package/package.json +8 -13
  93. package/build/cjs/index.cjs +0 -159
  94. package/build/cjs/index.cjs.map +0 -1
  95. package/build/cjs/index.d.cts +0 -4
  96. package/build/cjs/index.d.ts.map +0 -1
  97. package/build/cjs/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.d.cts +0 -10
  98. package/build/cjs/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.d.ts.map +0 -1
  99. package/build/cjs/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.test.d.cts +0 -2
  100. package/build/cjs/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.test.d.ts.map +0 -1
  101. package/build/cjs/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +0 -1
  102. package/build/esm/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.d.ts +0 -10
  103. package/build/esm/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.d.ts.map +0 -1
  104. package/build/esm/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.test.d.ts +0 -2
  105. package/build/esm/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.test.d.ts.map +0 -1
  106. /package/build/{cjs/empty.test.d.cts → browser/empty.test.d.ts} +0 -0
  107. /package/build/{cjs → browser}/empty.test.d.ts.map +0 -0
  108. /package/build/{cjs/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.cts → browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts} +0 -0
@@ -0,0 +1,13 @@
1
+ import type { QueryMetadata, QueryParameterDefinition } from "@osdk/api";
2
+ import type { QueryParameterV2, QueryTypeV2 } from "@osdk/internal.foundry.core";
3
+ export declare function wireQueryTypeV2ToSdkQueryMetadata(input: QueryTypeV2): QueryMetadata;
4
+ export declare function wireQueryTypeV2ToSdkQueryDefinitionNoParams(input: QueryTypeV2): {
5
+ type: string;
6
+ apiName: import("@osdk/internal.foundry.core").QueryApiName;
7
+ description: string | undefined;
8
+ displayName: import("@osdk/internal.foundry.core").DisplayName | undefined;
9
+ version: import("@osdk/internal.foundry.core").FunctionVersion;
10
+ rid: import("@osdk/internal.foundry.core").FunctionRid;
11
+ };
12
+ export declare function wireQueryParameterV2ToQueryParameterDefinition(parameter: QueryParameterV2): QueryParameterDefinition<any>;
13
+ //# sourceMappingURL=wireQueryTypeV2ToSdkQueryMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wireQueryTypeV2ToSdkQueryMetadata.d.ts","sourceRoot":"","sources":["../../src/wireQueryTypeV2ToSdkQueryMetadata.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,6BAA6B,CAAC;AAKrC,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,WAAW,GACjB,aAAa,CAef;AAED,wBAAgB,2CAA2C,CACzD,KAAK,EAAE,WAAW;;;;;;;EAUnB;AAED,wBAAgB,8CAA8C,CAC5D,SAAS,EAAE,gBAAgB,GAC1B,wBAAwB,CAAC,GAAG,CAAC,CAK/B"}
@@ -0,0 +1,45 @@
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
+ import { wireQueryDataTypeToQueryDataTypeDefinition } from "./wireQueryDataTypeToQueryDataTypeDefinition.js";
17
+ export function wireQueryTypeV2ToSdkQueryMetadata(input) {
18
+ return {
19
+ type: "query",
20
+ apiName: input.apiName,
21
+ description: input.description,
22
+ displayName: input.displayName,
23
+ version: input.version,
24
+ parameters: Object.fromEntries(Object.entries(input.parameters).map(([name, parameter]) => [name, wireQueryParameterV2ToQueryParameterDefinition(parameter)])),
25
+ output: wireQueryDataTypeToQueryDataTypeDefinition(input.output),
26
+ rid: input.rid
27
+ };
28
+ }
29
+ export function wireQueryTypeV2ToSdkQueryDefinitionNoParams(input) {
30
+ return {
31
+ type: "query",
32
+ apiName: input.apiName,
33
+ description: input.description,
34
+ displayName: input.displayName,
35
+ version: input.version,
36
+ rid: input.rid
37
+ };
38
+ }
39
+ export function wireQueryParameterV2ToQueryParameterDefinition(parameter) {
40
+ return {
41
+ description: parameter.description,
42
+ ...wireQueryDataTypeToQueryDataTypeDefinition(parameter.dataType)
43
+ };
44
+ }
45
+ //# sourceMappingURL=wireQueryTypeV2ToSdkQueryMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wireQueryTypeV2ToSdkQueryMetadata.js","names":["wireQueryDataTypeToQueryDataTypeDefinition","wireQueryTypeV2ToSdkQueryMetadata","input","type","apiName","description","displayName","version","parameters","Object","fromEntries","entries","map","name","parameter","wireQueryParameterV2ToQueryParameterDefinition","output","rid","wireQueryTypeV2ToSdkQueryDefinitionNoParams","dataType"],"sources":["wireQueryTypeV2ToSdkQueryMetadata.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 */\nimport { wireQueryDataTypeToQueryDataTypeDefinition, } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport function wireQueryTypeV2ToSdkQueryMetadata(input) {\n return {\n type: \"query\",\n apiName: input.apiName,\n description: input.description,\n displayName: input.displayName,\n version: input.version,\n parameters: Object.fromEntries(Object.entries(input.parameters).map(([name, parameter]) => [name, wireQueryParameterV2ToQueryParameterDefinition(parameter)])),\n output: wireQueryDataTypeToQueryDataTypeDefinition(input.output),\n rid: input.rid,\n };\n}\nexport function wireQueryTypeV2ToSdkQueryDefinitionNoParams(input) {\n return {\n type: \"query\",\n apiName: input.apiName,\n description: input.description,\n displayName: input.displayName,\n version: input.version,\n rid: input.rid,\n };\n}\nexport function wireQueryParameterV2ToQueryParameterDefinition(parameter) {\n return {\n description: parameter.description,\n ...wireQueryDataTypeToQueryDataTypeDefinition(parameter.dataType),\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,0CAA0C,QAAS,iDAAiD;AAC7G,OAAO,SAASC,iCAAiCA,CAACC,KAAK,EAAE;EACrD,OAAO;IACHC,IAAI,EAAE,OAAO;IACbC,OAAO,EAAEF,KAAK,CAACE,OAAO;IACtBC,WAAW,EAAEH,KAAK,CAACG,WAAW;IAC9BC,WAAW,EAAEJ,KAAK,CAACI,WAAW;IAC9BC,OAAO,EAAEL,KAAK,CAACK,OAAO;IACtBC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACT,KAAK,CAACM,UAAU,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,IAAI,EAAEC,SAAS,CAAC,KAAK,CAACD,IAAI,EAAEE,8CAA8C,CAACD,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9JE,MAAM,EAAEhB,0CAA0C,CAACE,KAAK,CAACc,MAAM,CAAC;IAChEC,GAAG,EAAEf,KAAK,CAACe;EACf,CAAC;AACL;AACA,OAAO,SAASC,2CAA2CA,CAAChB,KAAK,EAAE;EAC/D,OAAO;IACHC,IAAI,EAAE,OAAO;IACbC,OAAO,EAAEF,KAAK,CAACE,OAAO;IACtBC,WAAW,EAAEH,KAAK,CAACG,WAAW;IAC9BC,WAAW,EAAEJ,KAAK,CAACI,WAAW;IAC9BC,OAAO,EAAEL,KAAK,CAACK,OAAO;IACtBU,GAAG,EAAEf,KAAK,CAACe;EACf,CAAC;AACL;AACA,OAAO,SAASF,8CAA8CA,CAACD,SAAS,EAAE;EACtE,OAAO;IACHT,WAAW,EAAES,SAAS,CAACT,WAAW;IAClC,GAAGL,0CAA0C,CAACc,SAAS,CAACK,QAAQ;EACpE,CAAC;AACL","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { InterfaceDefinition } from "@osdk/api";
1
+ import type { InterfaceMetadata } from "@osdk/api";
2
2
  import type { InterfaceType } from "@osdk/internal.foundry.core";
3
- export declare function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType: InterfaceType, v2: boolean): InterfaceDefinition<any, any>;
3
+ export declare function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType: InterfaceType, v2: boolean): InterfaceMetadata;
4
4
  //# sourceMappingURL=__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts","sourceRoot":"","sources":["../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGjE,wBAAgB,mDAAmD,CACjE,aAAa,EAAE,aAAa,EAC5B,EAAE,EAAE,OAAO,GACV,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAsB/B"}
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,CAuBnB"}
@@ -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,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":[]}
@@ -1,4 +1,9 @@
1
1
  export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js";
2
- export { wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from "./wireObjectTypeFullMetadataToSdkObjectTypeDefinition.js";
2
+ export { wireActionTypeV2ToSdkActionMetadata } from "./wireActionTypeV2ToSdkActionMetadata.js";
3
+ export { wireObjectTypeFullMetadataToSdkObjectMetadata } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
3
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";
4
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,mDAAmD,EAAE,MAAM,0DAA0D,CAAC;AAC/H,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC"}
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,155 +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/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts
88
- function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
89
- switch (input.dataType.type) {
90
- case "integer":
91
- case "double":
92
- case "string":
93
- case "boolean":
94
- case "byte":
95
- case "long":
96
- case "short": {
97
- return input.dataType.type;
98
- }
99
- case "date": {
100
- return "datetime";
101
- }
102
- case "timestamp": {
103
- return "timestamp";
104
- }
105
- case "geopoint":
106
- case "geoshape":
107
- case "decimal":
108
- case "attachment":
109
- case "timeseries":
110
- case "array":
111
- case "marking":
112
- case "float":
113
- throw new Error(`Type not supported for primaryKey: ${input.dataType.type}`);
114
- default:
115
- input.dataType;
116
- throw new Error(`Unknown type encountered for primaryKey: ${input.dataType}`);
117
- }
118
- }
119
-
120
- // src/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.ts
121
- function wireObjectTypeFullMetadataToSdkObjectTypeDefinition(objectTypeWithLink, v2) {
122
- if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === void 0) {
123
- throw new Error(`Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`);
124
- }
125
- if (objectTypeWithLink.implementsInterfaces2 == null && objectTypeWithLink.implementsInterfaces != null) {
126
- throw new Error("Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.");
127
- }
128
- const interfaceMap = objectTypeWithLink.implementsInterfaces2 ? Object.fromEntries(Object.entries(objectTypeWithLink.implementsInterfaces2).map(([interfaceApiName, impl]) => [interfaceApiName, impl.properties])) : void 0;
129
- return {
130
- type: "object",
131
- apiName: objectTypeWithLink.objectType.apiName,
132
- description: objectTypeWithLink.objectType.description,
133
- primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,
134
- primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey]),
135
- links: Object.fromEntries(objectTypeWithLink.linkTypes.map((linkType) => {
136
- return [linkType.apiName, {
137
- multiplicity: linkType.cardinality === "MANY",
138
- targetType: linkType.objectTypeApiName
139
- }];
140
- })),
141
- properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key))])),
142
- spts: objectTypeWithLink.sharedPropertyTypeMapping,
143
- inverseSpts: invertProps(objectTypeWithLink.sharedPropertyTypeMapping),
144
- implements: objectTypeWithLink.implementsInterfaces,
145
- interfaceMap,
146
- inverseInterfaceMap: interfaceMap ? Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])) : void 0
147
- };
148
- }
149
- function invertProps(a) {
150
- return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : void 0;
151
- }
152
-
153
- export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireObjectTypeFullMetadataToSdkObjectTypeDefinition, wirePropertyV2ToSdkPropertyDefinition };
154
- //# 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";
155
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectTypeDefinition.ts"],"names":[],"mappings":";AAgBO,SAAS,qCAAA,CAAsC,KAAO,EAAA,UAAA,GAAa,IAAM,EAAA;AAC9E,EAAQ,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WAAgB,KAAA,MAAA;AAAA,QACvC,YAAY,QAAS,CAAA,iBAAA;AAAA,OACtB,CAAA,CAAA;AAAA,KACF,CAAC,CAAA;AAAA,IACF,UAAA,EAAY,MAAO,CAAA,WAAA,CAAY,MAAO,CAAA,OAAA,CAAQ,kBAAmB,CAAA,UAAA,CAAW,UAAU,CAAA,CAAE,GAAI,CAAA,CAAC,CAAC,GAAA,EAAK,KAAK,CAAA,KAAM,CAAC,GAAA,EAAK,qCAAsC,CAAA,KAAA,EAAO,EAAE,EAAA,IAAM,kBAAmB,CAAA,UAAA,CAAW,UAAe,KAAA,GAAA,CAAI,CAAC,CAAC,CAAC,CAAA;AAAA,IAC7N,MAAM,kBAAmB,CAAA,yBAAA;AAAA,IACzB,WAAA,EAAa,WAAY,CAAA,kBAAA,CAAmB,yBAAyB,CAAA;AAAA,IACrE,YAAY,kBAAmB,CAAA,oBAAA;AAAA,IAC/B,YAAA;AAAA,IACA,mBAAA,EAAqB,eAAe,MAAO,CAAA,WAAA,CAAY,OAAO,OAAQ,CAAA,YAAY,EAAE,GAAI,CAAA,CAAC,CAAC,gBAAkB,EAAA,KAAK,MAAM,CAAC,gBAAA,EAAkB,YAAY,KAAK,CAAC,CAAC,CAAC,CAAI,GAAA,KAAA,CAAA;AAAA,GACpK,CAAA;AACF,CAAA;AACA,SAAS,YAAY,CAAG,EAAA;AACtB,EAAA,OAAO,IAAI,MAAO,CAAA,WAAA,CAAY,OAAO,OAAQ,CAAA,CAAC,EAAE,GAAI,CAAA,CAAC,CAAC,CAAA,EAAG,CAAC,CAAM,KAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAI,GAAA,KAAA,CAAA,CAAA;AAC7E","file":"index.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 */\n\nexport function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true) {\n switch (input.dataType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"date\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: input.nullable == null ? isNullable : input.nullable\n };\n case \"array\":\n {\n return {\n displayName: input.displayName,\n multiplicity: true,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: true\n };\n }\n default:\n const _ = input.dataType;\n throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType) {\n switch (propertyType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"marking\":\n return propertyType.type;\n case \"date\":\n return \"datetime\";\n case \"array\":\n return objectPropertyTypeToSdkPropertyDefinition(propertyType.subType);\n case \"timeseries\":\n if (propertyType.itemType.type === \"string\") {\n return \"stringTimeseries\";\n }\n return \"numericTimeseries\";\n default:\n const _ = propertyType;\n throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);\n }\n}","/*\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 */\n\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2) {\n return {\n type: \"interface\",\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 [key, wirePropertyV2ToSdkPropertyDefinition(value, true)];\n })),\n links: {}\n };\n}","/*\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 */\n\nexport function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {\n switch (input.dataType.type) {\n case \"integer\":\n case \"double\":\n case \"string\":\n case \"boolean\":\n case \"byte\":\n case \"long\":\n case \"short\":\n {\n return input.dataType.type;\n }\n case \"date\":\n {\n return \"datetime\";\n }\n case \"timestamp\":\n {\n return \"timestamp\";\n }\n case \"geopoint\":\n case \"geoshape\":\n case \"decimal\":\n case \"attachment\":\n case \"timeseries\":\n case \"array\":\n case \"marking\":\n case \"float\":\n throw new Error(`Type not supported for primaryKey: ${input.dataType.type}`);\n default:\n const _ = input.dataType;\n throw new Error(`Unknown type encountered for primaryKey: ${input.dataType}`);\n }\n}","/*\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 */\n\nimport { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from \"./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function wireObjectTypeFullMetadataToSdkObjectTypeDefinition(objectTypeWithLink, v2) {\n if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === undefined) {\n throw new Error(`Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`);\n }\n\n // saved ontology.json files may not have this implementsInterfaces2 so we need to handle\n if (objectTypeWithLink.implementsInterfaces2 == null && objectTypeWithLink.implementsInterfaces != null) {\n throw new Error(\"Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.\");\n }\n const interfaceMap = objectTypeWithLink.implementsInterfaces2 ? Object.fromEntries(Object.entries(objectTypeWithLink.implementsInterfaces2).map(([interfaceApiName, impl]) => [interfaceApiName, impl.properties])) : undefined;\n return {\n type: \"object\",\n apiName: objectTypeWithLink.objectType.apiName,\n description: objectTypeWithLink.objectType.description,\n primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,\n primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey]),\n links: Object.fromEntries(objectTypeWithLink.linkTypes.map(linkType => {\n return [linkType.apiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetType: linkType.objectTypeApiName\n }];\n })),\n properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key))])),\n spts: objectTypeWithLink.sharedPropertyTypeMapping,\n inverseSpts: invertProps(objectTypeWithLink.sharedPropertyTypeMapping),\n implements: objectTypeWithLink.implementsInterfaces,\n interfaceMap,\n inverseInterfaceMap: interfaceMap ? Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])) : undefined\n };\n}\nfunction invertProps(a) {\n return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : undefined;\n}"]}
1
+ {"version":3,"file":"index.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireActionTypeV2ToSdkActionMetadata","wireObjectTypeFullMetadataToSdkObjectMetadata","wirePropertyV2ToSdkPropertyDefinition","wireQueryDataTypeToQueryDataTypeDefinition","wireQueryTypeV2ToSdkQueryMetadata","wireQueryParameterV2ToQueryParameterDefinition","wireQueryTypeV2ToSdkQueryDefinitionNoParams"],"sources":["index.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 */\nexport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js\";\nexport { wireActionTypeV2ToSdkActionMetadata } from \"./wireActionTypeV2ToSdkActionMetadata.js\";\nexport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport { wireQueryTypeV2ToSdkQueryMetadata } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryParameterV2ToQueryParameterDefinition } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,mDAAmD,QAAQ,0DAA0D;AAC9H,SAASC,mCAAmC,QAAQ,0CAA0C;AAC9F,SAASC,6CAA6C,QAAQ,oDAAoD;AAClH,SAASC,qCAAqC,QAAQ,4CAA4C;AAClG,SAASC,0CAA0C,QAAQ,iDAAiD;AAC5G,SAASC,iCAAiC,QAAQ,wCAAwC;AAC1F,SAASC,8CAA8C,QAAQ,wCAAwC;AACvG,SAASC,2CAA2C,QAAQ,wCAAwC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import type { QueryDataType } from "@osdk/internal.foundry.core";
2
+ export declare function isNullableQueryDataType(input: QueryDataType): boolean;
3
+ //# sourceMappingURL=isNullableQueryDataType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isNullableQueryDataType.d.ts","sourceRoot":"","sources":["../../src/isNullableQueryDataType.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAQrE"}
@@ -0,0 +1,25 @@
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 isNullableQueryDataType(input) {
17
+ if (input.type === "null") {
18
+ return true;
19
+ }
20
+ if (input.type === "union") {
21
+ return input.unionTypes.some(t => isNullableQueryDataType(t));
22
+ }
23
+ return false;
24
+ }
25
+ //# sourceMappingURL=isNullableQueryDataType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isNullableQueryDataType.js","names":["isNullableQueryDataType","input","type","unionTypes","some","t"],"sources":["isNullableQueryDataType.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 isNullableQueryDataType(input) {\n if (input.type === \"null\") {\n return true;\n }\n if (input.type === \"union\") {\n return input.unionTypes.some(t => isNullableQueryDataType(t));\n }\n return false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,uBAAuBA,CAACC,KAAK,EAAE;EAC3C,IAAIA,KAAK,CAACC,IAAI,KAAK,MAAM,EAAE;IACvB,OAAO,IAAI;EACf;EACA,IAAID,KAAK,CAACC,IAAI,KAAK,OAAO,EAAE;IACxB,OAAOD,KAAK,CAACE,UAAU,CAACC,IAAI,CAACC,CAAC,IAAIL,uBAAuB,CAACK,CAAC,CAAC,CAAC;EACjE;EACA,OAAO,KAAK;AAChB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ import type { ActionMetadata } from "@osdk/api";
2
+ import type { ActionTypeV2 } from "@osdk/internal.foundry.core";
3
+ export declare function wireActionTypeV2ToSdkActionMetadata(input: ActionTypeV2): ActionMetadata;
4
+ //# sourceMappingURL=wireActionTypeV2ToSdkActionMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.d.ts","sourceRoot":"","sources":["../../src/wireActionTypeV2ToSdkActionMetadata.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAGV,YAAY,EACb,MAAM,6BAA6B,CAAC;AAGrC,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,YAAY,GAClB,cAAc,CAmBhB"}
@@ -0,0 +1,85 @@
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
+ import { getModifiedEntityTypes } from "./getEditedEntities.js";
17
+ export function wireActionTypeV2ToSdkActionMetadata(input) {
18
+ const modifiedEntityTypes = getModifiedEntityTypes(input);
19
+ return {
20
+ type: "action",
21
+ apiName: input.apiName,
22
+ parameters: Object.fromEntries(Object.entries(input.parameters).map(([key, value]) => [key, wireActionParameterV2ToSdkParameterDefinition(value)])),
23
+ displayName: input.displayName,
24
+ description: input.description,
25
+ modifiedEntities: createModifiedEntities(modifiedEntityTypes.addedObjects, modifiedEntityTypes.modifiedObjects),
26
+ rid: input.rid,
27
+ status: input.status
28
+ };
29
+ }
30
+ function wireActionParameterV2ToSdkParameterDefinition(value) {
31
+ return {
32
+ multiplicity: value.dataType.type === "array",
33
+ type: actionPropertyToSdkPropertyDefinition(value.dataType.type === "array" ? value.dataType.subType : value.dataType),
34
+ nullable: !value.required,
35
+ description: value.description
36
+ };
37
+ }
38
+ function actionPropertyToSdkPropertyDefinition(parameterType) {
39
+ switch (parameterType.type) {
40
+ case "string":
41
+ case "boolean":
42
+ case "attachment":
43
+ case "double":
44
+ case "integer":
45
+ case "long":
46
+ case "timestamp":
47
+ case "marking":
48
+ return parameterType.type;
49
+ case "date":
50
+ return "datetime";
51
+ case "objectSet":
52
+ return {
53
+ type: "objectSet",
54
+ objectSet: parameterType.objectTypeApiName
55
+ };
56
+ case "object":
57
+ return {
58
+ type: "object",
59
+ object: parameterType.objectTypeApiName
60
+ };
61
+ case "array":
62
+ return actionPropertyToSdkPropertyDefinition(parameterType.subType);
63
+ }
64
+ }
65
+ function createModifiedEntities(addedObjects, modifiedObjects) {
66
+ let entities = {};
67
+ for (const key of addedObjects) {
68
+ entities[key] = {
69
+ created: true,
70
+ modified: false
71
+ };
72
+ }
73
+ for (const key of modifiedObjects) {
74
+ if (entities[key]) {
75
+ entities[key].modified = true;
76
+ } else {
77
+ entities[key] = {
78
+ created: false,
79
+ modified: true
80
+ };
81
+ }
82
+ }
83
+ return entities;
84
+ }
85
+ //# sourceMappingURL=wireActionTypeV2ToSdkActionMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.js","names":["getModifiedEntityTypes","wireActionTypeV2ToSdkActionMetadata","input","modifiedEntityTypes","type","apiName","parameters","Object","fromEntries","entries","map","key","value","wireActionParameterV2ToSdkParameterDefinition","displayName","description","modifiedEntities","createModifiedEntities","addedObjects","modifiedObjects","rid","status","multiplicity","dataType","actionPropertyToSdkPropertyDefinition","subType","nullable","required","parameterType","objectSet","objectTypeApiName","object","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.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 */\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\nexport function wireActionTypeV2ToSdkActionMetadata(input) {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(Object.entries(input.parameters).map(([key, value]) => [key, wireActionParameterV2ToSdkParameterDefinition(value)])),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(modifiedEntityTypes.addedObjects, modifiedEntityTypes.modifiedObjects),\n rid: input.rid,\n status: input.status,\n };\n}\nfunction wireActionParameterV2ToSdkParameterDefinition(value) {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(value.dataType.type === \"array\" ? value.dataType.subType : value.dataType),\n nullable: !value.required,\n description: value.description,\n };\n}\nfunction actionPropertyToSdkPropertyDefinition(parameterType) {\n switch (parameterType.type) {\n case \"string\":\n case \"boolean\":\n case \"attachment\":\n case \"double\":\n case \"integer\":\n case \"long\":\n case \"timestamp\":\n case \"marking\":\n return parameterType.type;\n case \"date\":\n return \"datetime\";\n case \"objectSet\":\n return { type: \"objectSet\", objectSet: parameterType.objectTypeApiName };\n case \"object\":\n return { type: \"object\", object: parameterType.objectTypeApiName };\n case \"array\":\n return actionPropertyToSdkPropertyDefinition(parameterType.subType);\n }\n}\nfunction createModifiedEntities(addedObjects, modifiedObjects) {\n let entities = {};\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n }\n else {\n entities[key] = { created: false, modified: true };\n }\n }\n return entities;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,wBAAwB;AAC/D,OAAO,SAASC,mCAAmCA,CAACC,KAAK,EAAE;EACvD,MAAMC,mBAAmB,GAAGH,sBAAsB,CAACE,KAAK,CAAC;EACzD,OAAO;IACHE,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACP,KAAK,CAACI,UAAU,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,CAACD,GAAG,EAAEE,6CAA6C,CAACD,KAAK,CAAC,CAAC,CAAC,CAAC;IACnJE,WAAW,EAAEZ,KAAK,CAACY,WAAW;IAC9BC,WAAW,EAAEb,KAAK,CAACa,WAAW;IAC9BC,gBAAgB,EAAEC,sBAAsB,CAACd,mBAAmB,CAACe,YAAY,EAAEf,mBAAmB,CAACgB,eAAe,CAAC;IAC/GC,GAAG,EAAElB,KAAK,CAACkB,GAAG;IACdC,MAAM,EAAEnB,KAAK,CAACmB;EAClB,CAAC;AACL;AACA,SAASR,6CAA6CA,CAACD,KAAK,EAAE;EAC1D,OAAO;IACHU,YAAY,EAAEV,KAAK,CAACW,QAAQ,CAACnB,IAAI,KAAK,OAAO;IAC7CA,IAAI,EAAEoB,qCAAqC,CAACZ,KAAK,CAACW,QAAQ,CAACnB,IAAI,KAAK,OAAO,GAAGQ,KAAK,CAACW,QAAQ,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;EACA,OAAOF,QAAQ;AACnB","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import type { ObjectMetadata } from "@osdk/api";
2
+ import type { ObjectTypeFullMetadata, PropertyApiName, PropertyV2 } from "@osdk/internal.foundry.core";
3
+ export declare function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink: ObjectTypeFullMetadata & {
4
+ objectType: {
5
+ properties: Record<PropertyApiName, PropertyV2 & {
6
+ nullable?: boolean;
7
+ }>;
8
+ };
9
+ }, v2: boolean): ObjectMetadata;
10
+ //# sourceMappingURL=wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts","sourceRoot":"","sources":["../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAEV,sBAAsB,EACtB,eAAe,EACf,UAAU,EACX,MAAM,6BAA6B,CAAC;AAIrC,wBAAgB,6CAA6C,CAC3D,kBAAkB,EAAE,sBAAsB,GAAG;IAC3C,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC,eAAe,EAAE,UAAU,GAAG;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC,CAAC;KAC1E,CAAC;CACH,EACD,EAAE,EAAE,OAAO,GACV,cAAc,CAuEhB"}