@osdk/generator-converters 2.2.0-beta.2 → 2.2.0-beta.21

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,172 @@
1
1
  # @osdk/generator-converters
2
2
 
3
+ ## 2.2.0-beta.21
4
+
5
+ ### Minor Changes
6
+
7
+ - 317b555: Release
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [317b555]
12
+ - @osdk/api@2.2.0-beta.21
13
+
14
+ ## 2.2.0-beta.20
15
+
16
+ ### Minor Changes
17
+
18
+ - 889e84b: Release
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [889e84b]
23
+ - @osdk/api@2.2.0-beta.20
24
+
25
+ ## 2.2.0-beta.19
26
+
27
+ ### Patch Changes
28
+
29
+ - @osdk/api@2.2.0-beta.19
30
+
31
+ ## 2.2.0-beta.18
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [56aa502]
36
+ - @osdk/api@2.2.0-beta.18
37
+
38
+ ## 2.2.0-beta.17
39
+
40
+ ### Minor Changes
41
+
42
+ - abe4897: Removes support for boolean primary keys
43
+ - 791e655: Add support for geoshape and geohash action parameters.
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [c6bee50]
48
+ - Updated dependencies [abe4897]
49
+ - Updated dependencies [70b4464]
50
+ - Updated dependencies [791e655]
51
+ - @osdk/api@2.2.0-beta.17
52
+
53
+ ## 2.2.0-beta.16
54
+
55
+ ### Patch Changes
56
+
57
+ - @osdk/api@2.2.0-beta.16
58
+
59
+ ## 2.2.0-beta.15
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [ed69666]
64
+ - @osdk/api@2.2.0-beta.15
65
+
66
+ ## 2.2.0-beta.14
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [6abf078]
71
+ - @osdk/api@2.2.0-beta.14
72
+
73
+ ## 2.2.0-beta.13
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [488b51c]
78
+ - Updated dependencies [71462e9]
79
+ - @osdk/api@2.2.0-beta.13
80
+
81
+ ## 2.2.0-beta.12
82
+
83
+ ### Patch Changes
84
+
85
+ - @osdk/api@2.2.0-beta.12
86
+
87
+ ## 2.2.0-beta.11
88
+
89
+ ### Patch Changes
90
+
91
+ - Updated dependencies [7170fd1]
92
+ - @osdk/api@2.2.0-beta.11
93
+
94
+ ## 2.2.0-beta.10
95
+
96
+ ### Patch Changes
97
+
98
+ - Updated dependencies [23ea0e4]
99
+ - Updated dependencies [46cede4]
100
+ - @osdk/api@2.2.0-beta.10
101
+
102
+ ## 2.2.0-beta.9
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies [12843cb]
107
+ - Updated dependencies [f82767c]
108
+ - @osdk/api@2.2.0-beta.9
109
+
110
+ ## 2.2.0-beta.8
111
+
112
+ ### Minor Changes
113
+
114
+ - 63b2e63: Update Platform SDK Dependencies
115
+ - 63b2e63: Supports generating queries for entrySet function types
116
+
117
+ ### Patch Changes
118
+
119
+ - Updated dependencies [0e874b1]
120
+ - Updated dependencies [63b2e63]
121
+ - Updated dependencies [26c2d95]
122
+ - Updated dependencies [63b2e63]
123
+ - Updated dependencies [63b2e63]
124
+ - @osdk/api@2.2.0-beta.8
125
+
126
+ ## 2.2.0-beta.7
127
+
128
+ ### Minor Changes
129
+
130
+ - 7416ce4: Update Platform SDK Dependencies
131
+
132
+ ### Patch Changes
133
+
134
+ - Updated dependencies [7416ce4]
135
+ - Updated dependencies [7416ce4]
136
+ - Updated dependencies [805df40]
137
+ - @osdk/api@2.2.0-beta.7
138
+
139
+ ## 2.2.0-beta.6
140
+
141
+ ### Minor Changes
142
+
143
+ - b68adea: Add support for inherited interfaces.
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies [cddfbf9]
148
+ - Updated dependencies [a6e5f89]
149
+ - @osdk/api@2.2.0-beta.6
150
+
151
+ ## 2.2.0-beta.5
152
+
153
+ ### Patch Changes
154
+
155
+ - @osdk/api@2.2.0-beta.5
156
+
157
+ ## 2.2.0-beta.4
158
+
159
+ ### Patch Changes
160
+
161
+ - @osdk/api@2.2.0-beta.4
162
+
163
+ ## 2.2.0-beta.3
164
+
165
+ ### Patch Changes
166
+
167
+ - Updated dependencies [761e69d]
168
+ - @osdk/api@2.2.0-beta.3
169
+
3
170
  ## 2.2.0-beta.2
4
171
 
5
172
  ### Patch Changes
@@ -22,8 +22,8 @@ export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceTyp
22
22
  apiName: interfaceType.apiName,
23
23
  displayName: interfaceType.displayName,
24
24
  description: interfaceType.description,
25
- implements: interfaceType.extendsInterfaces,
26
- properties: Object.fromEntries(Object.entries(interfaceType.properties).map(([key, value]) => {
25
+ implements: interfaceType.allExtendsInterfaces ?? interfaceType.extendsInterfaces,
26
+ properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {
27
27
  return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];
28
28
  }).filter(([key, value]) => value != null)),
29
29
  links: {},
@@ -1 +1 @@
1
- {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","v2","log","type","rid","apiName","displayName","description","implements","extendsInterfaces","properties","Object","fromEntries","entries","map","key","value","filter","links","implementedBy","implementedByObjectTypes"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts"],"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 */\n\nimport type { InterfaceMetadata } from \"@osdk/api\";\nimport type { InterfaceType } from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceType: InterfaceType,\n v2: boolean,\n log?: { info: (msg: string) => void },\n): InterfaceMetadata {\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(\n Object.entries(interfaceType.properties).map((\n [key, value],\n ) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n true,\n log,\n ),\n ];\n }).filter(([key, value]) => value != null),\n ),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,mDAAmDA,CACjEC,aAA4B,EAC5BC,EAAW,EACXC,GAAqC,EAClB;EACnB,OAAO;IACLC,IAAI,EAAE,WAAW;IACjBC,GAAG,EAAEJ,aAAa,CAACI,GAAG;IACtBC,OAAO,EAAEL,aAAa,CAACK,OAAO;IAC9BC,WAAW,EAAEN,aAAa,CAACM,WAAW;IACtCC,WAAW,EAAEP,aAAa,CAACO,WAAW;IACtCC,UAAU,EAAER,aAAa,CAACS,iBAAiB;IAC3CC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACb,aAAa,CAACU,UAAU,CAAC,CAACI,GAAG,CAAC,CAC3C,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT;MACH,OAAO,CACLD,GAAG,EACHjB,qCAAqC,CACnCkB,KAAK,EACL,IAAI,EACJd,GACF,CAAC,CACF;IACH,CAAC,CAAC,CAACe,MAAM,CAAC,CAAC,CAACF,GAAG,EAAEC,KAAK,CAAC,KAAKA,KAAK,IAAI,IAAI,CAC3C,CAAC;IACDE,KAAK,EAAE,CAAC,CAAC;IACTC,aAAa,EAAEnB,aAAa,CAACoB;EAC/B,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","v2","log","type","rid","apiName","displayName","description","implements","allExtendsInterfaces","extendsInterfaces","properties","Object","fromEntries","entries","allProperties","map","key","value","filter","links","implementedBy","implementedByObjectTypes"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts"],"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 */\n\nimport type { InterfaceMetadata } from \"@osdk/api\";\nimport type { InterfaceType } from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceType: InterfaceType,\n v2: boolean,\n log?: { info: (msg: string) => void },\n): InterfaceMetadata {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.allExtendsInterfaces\n ?? interfaceType.extendsInterfaces,\n properties: Object.fromEntries(\n Object.entries(interfaceType.allProperties ?? interfaceType.properties)\n .map((\n [key, value],\n ) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n true,\n log,\n ),\n ];\n }).filter(([key, value]) => value != null),\n ),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,mDAAmDA,CACjEC,aAA4B,EAC5BC,EAAW,EACXC,GAAqC,EAClB;EACnB,OAAO;IACLC,IAAI,EAAE,WAAW;IACjBC,GAAG,EAAEJ,aAAa,CAACI,GAAG;IACtBC,OAAO,EAAEL,aAAa,CAACK,OAAO;IAC9BC,WAAW,EAAEN,aAAa,CAACM,WAAW;IACtCC,WAAW,EAAEP,aAAa,CAACO,WAAW;IACtCC,UAAU,EAAER,aAAa,CAACS,oBAAoB,IACzCT,aAAa,CAACU,iBAAiB;IACpCC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACd,aAAa,CAACe,aAAa,IAAIf,aAAa,CAACW,UAAU,CAAC,CACpEK,GAAG,CAAC,CACH,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT;MACH,OAAO,CACLD,GAAG,EACHnB,qCAAqC,CACnCoB,KAAK,EACL,IAAI,EACJhB,GACF,CAAC,CACF;IACH,CAAC,CAAC,CAACiB,MAAM,CAAC,CAAC,CAACF,GAAG,EAAEC,KAAK,CAAC,KAAKA,KAAK,IAAI,IAAI,CAC7C,CAAC;IACDE,KAAK,EAAE,CAAC,CAAC;IACTC,aAAa,EAAErB,aAAa,CAACsB;EAC/B,CAAC;AACH","ignoreList":[]}
@@ -48,6 +48,8 @@ function actionPropertyToSdkPropertyDefinition(parameterType) {
48
48
  case "mediaReference":
49
49
  case "marking":
50
50
  case "objectType":
51
+ case "geohash":
52
+ case "geoshape":
51
53
  return parameterType.type;
52
54
  case "date":
53
55
  return "datetime";
@@ -1 +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","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","Error","JSON","stringify","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.ts"],"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\nimport type { ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n} from \"@osdk/foundry.ontologies\";\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\n\nexport function wireActionTypeV2ToSdkActionMetadata(\n input: ActionTypeV2,\n): ActionMetadata {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(\n Object.entries(input.parameters).map((\n [key, value],\n ) => [key, wireActionParameterV2ToSdkParameterDefinition(value)]),\n ),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(\n modifiedEntityTypes.addedObjects,\n modifiedEntityTypes.modifiedObjects,\n ),\n rid: input.rid,\n status: input.status,\n };\n}\n\nfunction wireActionParameterV2ToSdkParameterDefinition(\n value: ActionParameterV2,\n): ActionMetadata.Parameter<any> {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(\n value.dataType.type === \"array\" ? value.dataType.subType : value.dataType,\n ),\n nullable: !value.required,\n description: value.description,\n };\n}\n\nfunction actionPropertyToSdkPropertyDefinition(\n parameterType: ActionParameterType,\n): ActionMetadata.Parameter[\"type\"] {\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 \"mediaReference\":\n case \"marking\":\n case \"objectType\":\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 case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName,\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce(\n (\n structMap: Record<\n string,\n ActionMetadata.DataType.BaseActionParameterTypes\n >,\n structField,\n ) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(\n structField.fieldType as ActionParameterType,\n ) as ActionMetadata.DataType.BaseActionParameterTypes;\n return structMap;\n },\n {},\n ),\n };\n default:\n throw new Error(\n `Unsupported action parameter type: ${JSON.stringify(parameterType)}`,\n );\n }\n}\n\nfunction createModifiedEntities<K extends string>(\n addedObjects: Set<K>,\n modifiedObjects: Set<K>,\n): ActionMetadata[\"modifiedEntities\"] {\n const entities = {} as Record<\n K,\n {\n created: boolean;\n modified: boolean;\n }\n >;\n\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = { created: false, modified: true };\n }\n }\n\n return entities;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,sBAAsB,QAAQ,wBAAwB;AAE/D,OAAO,SAASC,mCAAmCA,CACjDC,KAAmB,EACH;EAChB,MAAMC,mBAAmB,GAAGH,sBAAsB,CAACE,KAAK,CAAC;EACzD,OAAO;IACLE,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACP,KAAK,CAACI,UAAU,CAAC,CAACI,GAAG,CAAC,CACnC,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT,CAACD,GAAG,EAAEE,6CAA6C,CAACD,KAAK,CAAC,CAAC,CAClE,CAAC;IACDE,WAAW,EAAEZ,KAAK,CAACY,WAAW;IAC9BC,WAAW,EAAEb,KAAK,CAACa,WAAW;IAC9BC,gBAAgB,EAAEC,sBAAsB,CACtCd,mBAAmB,CAACe,YAAY,EAChCf,mBAAmB,CAACgB,eACtB,CAAC;IACDC,GAAG,EAAElB,KAAK,CAACkB,GAAG;IACdC,MAAM,EAAEnB,KAAK,CAACmB;EAChB,CAAC;AACH;AAEA,SAASR,6CAA6CA,CACpDD,KAAwB,EACO;EAC/B,OAAO;IACLU,YAAY,EAAEV,KAAK,CAACW,QAAQ,CAACnB,IAAI,KAAK,OAAO;IAC7CA,IAAI,EAAEoB,qCAAqC,CACzCZ,KAAK,CAACW,QAAQ,CAACnB,IAAI,KAAK,OAAO,GAAGQ,KAAK,CAACW,QAAQ,CAACE,OAAO,GAAGb,KAAK,CAACW,QACnE,CAAC;IACDG,QAAQ,EAAE,CAACd,KAAK,CAACe,QAAQ;IACzBZ,WAAW,EAAEH,KAAK,CAACG;EACrB,CAAC;A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;IAC9B0B,QAAQ,CAACjC,GAAG,CAAC,GAAG;MAAEkC,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAM,CAAC;EACpD;EAEA,KAAK,MAAMnC,GAAG,IAAIQ,eAAe,EAAE;IACjC,IAAIyB,QAAQ,CAACjC,GAAG,CAAC,EAAE;MACjBiC,QAAQ,CAACjC,GAAG,CAAC,CAACmC,QAAQ,GAAG,IAAI;IAC/B,CAAC,MAAM;MACLF,QAAQ,CAACjC,GAAG,CAAC,GAAG;QAAEkC,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAK,CAAC;IACpD;EACF;EAEA,OAAOF,QAAQ;AACjB","ignoreList":[]}
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","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","Error","JSON","stringify","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.ts"],"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\nimport type { ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n} from \"@osdk/foundry.ontologies\";\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\n\nexport function wireActionTypeV2ToSdkActionMetadata(\n input: ActionTypeV2,\n): ActionMetadata {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(\n Object.entries(input.parameters).map((\n [key, value],\n ) => [key, wireActionParameterV2ToSdkParameterDefinition(value)]),\n ),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(\n modifiedEntityTypes.addedObjects,\n modifiedEntityTypes.modifiedObjects,\n ),\n rid: input.rid,\n status: input.status,\n };\n}\n\nfunction wireActionParameterV2ToSdkParameterDefinition(\n value: ActionParameterV2,\n): ActionMetadata.Parameter<any> {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(\n value.dataType.type === \"array\" ? value.dataType.subType : value.dataType,\n ),\n nullable: !value.required,\n description: value.description,\n };\n}\n\nfunction actionPropertyToSdkPropertyDefinition(\n parameterType: ActionParameterType,\n): ActionMetadata.Parameter[\"type\"] {\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 \"mediaReference\":\n case \"marking\":\n case \"objectType\":\n case \"geohash\":\n case \"geoshape\":\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 case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName,\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce(\n (\n structMap: Record<\n string,\n ActionMetadata.DataType.BaseActionParameterTypes\n >,\n structField,\n ) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(\n structField.fieldType as ActionParameterType,\n ) as ActionMetadata.DataType.BaseActionParameterTypes;\n return structMap;\n },\n {},\n ),\n };\n default:\n throw new Error(\n `Unsupported action parameter type: ${JSON.stringify(parameterType)}`,\n );\n }\n}\n\nfunction createModifiedEntities<K extends string>(\n addedObjects: Set<K>,\n modifiedObjects: Set<K>,\n): ActionMetadata[\"modifiedEntities\"] {\n const entities = {} as Record<\n K,\n {\n created: boolean;\n modified: boolean;\n }\n >;\n\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = { created: false, modified: true };\n }\n }\n\n return entities;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,sBAAsB,QAAQ,wBAAwB;AAE/D,OAAO,SAASC,mCAAmCA,CACjDC,KAAmB,EACH;EAChB,MAAMC,mBAAmB,GAAGH,sBAAsB,CAACE,KAAK,CAAC;EACzD,OAAO;IACLE,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACP,KAAK,CAACI,UAAU,CAAC,CAACI,GAAG,CAAC,CACnC,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT,CAACD,GAAG,EAAEE,6CAA6C,CAACD,KAAK,CAAC,CAAC,CAClE,CAAC;IACDE,WAAW,EAAEZ,KAAK,CAACY,WAAW;IAC9BC,WAAW,EAAEb,KAAK,CAACa,WAAW;IAC9BC,gBAAgB,EAAEC,sBAAsB,CACtCd,mBAAmB,CAACe,YAAY,EAChCf,mBAAmB,CAACgB,eACtB,CAAC;IACDC,GAAG,EAAElB,KAAK,CAACkB,GAAG;IACdC,MAAM,EAAEnB,KAAK,CAACmB;EAChB,CAAC;AACH;AAEA,SAASR,6CAA6CA,CACpDD,KAAwB,EAC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ACC,IAAI,CAAC,GAAGf,qCAAqC,CACjEc,WAAW,CAACE,SACd,CAAqD;UACrD,OAAOH,SAAS;QAClB,CAAC,EACD,CAAC,CACH;MACF,CAAC;IACH;MACE,MAAM,IAAII,KAAK,CACb,sCAAsCC,IAAI,CAACC,SAAS,CAACf,aAAa,CAAC,EACrE,CAAC;EACL;AACF;AAEA,SAASX,sBAAsBA,CAC7BC,YAAoB,EACpBC,eAAuB,EACa;EACpC,MAAMyB,QAAQ,GAAG,CAAC,CAMjB;EAED,KAAK,MAAMjC,GAAG,IAAIO,YAAY,EAAE;IAC9B0B,QAAQ,CAACjC,GAAG,CAAC,GAAG;MAAEkC,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAM,CAAC;EACpD;EAEA,KAAK,MAAMnC,GAAG,IAAIQ,eAAe,EAAE;IACjC,IAAIyB,QAAQ,CAACjC,GAAG,CAAC,EAAE;MACjBiC,QAAQ,CAACjC,GAAG,CAAC,CAACmC,QAAQ,GAAG,IAAI;IAC/B,CAAC,MAAM;MACLF,QAAQ,CAACjC,GAAG,CAAC,GAAG;QAAEkC,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAK,CAAC;IACpD;EACF;EAEA,OAAOF,QAAQ;AACjB","ignoreList":[]}
@@ -19,10 +19,10 @@ export function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
19
19
  case "integer":
20
20
  case "double":
21
21
  case "string":
22
- case "boolean":
23
22
  case "byte":
24
23
  case "long":
25
24
  case "short":
25
+ case "timestamp":
26
26
  {
27
27
  return input.dataType.type;
28
28
  }
@@ -30,10 +30,7 @@ export function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
30
30
  {
31
31
  return "datetime";
32
32
  }
33
- case "timestamp":
34
- {
35
- return "timestamp";
36
- }
33
+ case "boolean":
37
34
  case "geopoint":
38
35
  case "geoshape":
39
36
  case "decimal":
@@ -47,7 +44,7 @@ export function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
47
44
  case "struct":
48
45
  case "cipherText":
49
46
  case "vector":
50
- throw new Error(`Type not supported for primaryKey: ${input.dataType.type}`);
47
+ throw new Error(`Primary key of type ${input.dataType.type} is not supported`);
51
48
  default:
52
49
  input.dataType;
53
50
  throw new Error(`Unknown type encountered for primaryKey: ${input.dataType}`);
@@ -1 +1 @@
1
- {"version":3,"file":"wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js","names":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition","input","dataType","type","Error"],"sources":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts"],"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\nimport type { PrimaryKeyTypes } from \"@osdk/api\";\nimport type { PropertyV2 } from \"@osdk/foundry.ontologies\";\n\nexport function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(\n input: PropertyV2,\n): PrimaryKeyTypes {\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 return input.dataType.type;\n }\n case \"date\": {\n return \"datetime\";\n }\n case \"timestamp\": {\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 case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"struct\":\n case \"cipherText\":\n case \"vector\":\n throw new Error(\n `Type not supported for primaryKey: ${input.dataType.type}`,\n );\n default:\n const _: never = input.dataType;\n throw new Error(\n `Unknown type encountered for primaryKey: ${input.dataType}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,2CAA2CA,CACzDC,KAAiB,EACA;EACjB,QAAQA,KAAK,CAACC,QAAQ,CAACC,IAAI;IACzB,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,QAAQ;IACb,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,OAAO;MAAE;QACZ,OAAOF,KAAK,CAACC,QAAQ,CAACC,IAAI;MAC5B;IACA,KAAK,MAAM;MAAE;QACX,OAAO,UAAU;MACnB;IACA,KAAK,WAAW;MAAE;QAChB,OAAO,WAAW;MACpB;IACA,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,SAAS;IACd,KAAK,YAAY;IACjB,KAAK,YAAY;IACjB,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,OAAO;IACZ,KAAK,wBAAwB;IAC7B,KAAK,gBAAgB;IACrB,KAAK,QAAQ;IACb,KAAK,YAAY;IACjB,KAAK,QAAQ;MACX,MAAM,IAAIC,KAAK,CACb,sCAAsCH,KAAK,CAACC,QAAQ,CAACC,IAAI,EAC3D,CAAC;IACH;MACmBF,KAAK,CAACC,QAAQ;MAC/B,MAAM,IAAIE,KAAK,CACb,4CAA4CH,KAAK,CAACC,QAAQ,EAC5D,CAAC;EACL;AACF","ignoreList":[]}
1
+ {"version":3,"file":"wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js","names":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition","input","dataType","type","Error"],"sources":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts"],"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\nimport type { PrimaryKeyTypes } from \"@osdk/api\";\nimport type { PropertyV2 } from \"@osdk/foundry.ontologies\";\n\nexport function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(\n input: PropertyV2,\n): PrimaryKeyTypes {\n switch (input.dataType.type) {\n case \"integer\":\n case \"double\":\n case \"string\":\n case \"byte\":\n case \"long\":\n case \"short\":\n case \"timestamp\": {\n return input.dataType.type;\n }\n case \"date\": {\n return \"datetime\";\n }\n case \"boolean\":\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 case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"struct\":\n case \"cipherText\":\n case \"vector\":\n throw new Error(\n `Primary key of type ${input.dataType.type} is not supported`,\n );\n default:\n const _: never = input.dataType;\n throw new Error(\n `Unknown type encountered for primaryKey: ${input.dataType}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,2CAA2CA,CACzDC,KAAiB,EACA;EACjB,QAAQA,KAAK,CAACC,QAAQ,CAACC,IAAI;IACzB,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,QAAQ;IACb,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,OAAO;IACZ,KAAK,WAAW;MAAE;QAChB,OAAOF,KAAK,CAACC,QAAQ,CAACC,IAAI;MAC5B;IACA,KAAK,MAAM;MAAE;QACX,OAAO,UAAU;MACnB;IACA,KAAK,SAAS;IACd,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,SAAS;IACd,KAAK,YAAY;IACjB,KAAK,YAAY;IACjB,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,OAAO;IACZ,KAAK,wBAAwB;IAC7B,KAAK,gBAAgB;IACrB,KAAK,QAAQ;IACb,KAAK,YAAY;IACjB,KAAK,QAAQ;MACX,MAAM,IAAIC,KAAK,CACb,uBAAuBH,KAAK,CAACC,QAAQ,CAACC,IAAI,mBAC5C,CAAC;IACH;MACmBF,KAAK,CAACC,QAAQ;MAC/B,MAAM,IAAIE,KAAK,CACb,4CAA4CH,KAAK,CAACC,QAAQ,EAC5D,CAAC;EACL;AACF","ignoreList":[]}
@@ -95,6 +95,20 @@ export function wireQueryDataTypeToQueryDataTypeDefinition(input) {
95
95
  threeDimensionalAggregation: get3DQueryAggregationProps(input),
96
96
  nullable: false
97
97
  };
98
+ case "entrySet":
99
+ const keyType = wireQueryDataTypeToQueryDataTypeDefinition(input.keyType);
100
+ if (!validMapKeyTypes.includes(keyType.type)) {
101
+ throw new Error("Map types with a key type of " + keyType.type + " are not supported" + validMapKeyTypes.toString());
102
+ }
103
+ if (keyType.multiplicity === true) {
104
+ throw new Error("Map types cannot have keys as arrays");
105
+ }
106
+ return {
107
+ type: "map",
108
+ nullable: false,
109
+ keyType,
110
+ valueType: wireQueryDataTypeToQueryDataTypeDefinition(input.valueType)
111
+ };
98
112
  case "null":
99
113
  case "unsupported":
100
114
  throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);
@@ -143,4 +157,9 @@ function get3DQueryAggregationProps(input) {
143
157
  function guardInvalidKeyTypes(key) {
144
158
  return key.type === "string" || key.type === "boolean";
145
159
  }
160
+
161
+ /**
162
+ * The set of all valid key types for maps. This includes all types that are represented by strings or numbers in the OSDK, and Ontology Objects.
163
+ */
164
+ const validMapKeyTypes = ["string", "object", "double", "float", "integer", "long", "date", "timestamp", "byte", "datetime", "decimal", "marking", "short", "objectType"];
146
165
  //# sourceMappingURL=wireQueryDataTypeToQueryDataTypeDefinition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","subType","multiplicity","set","allowNulls","unionTypes","length","nonNull","find","t","union","reduce","acc","push","struct","Object","fromEntries","fields","map","f","name","fieldType","twoDimensionalAggregation","get2DQueryAggregationProps","threeDimensionalAggregation","get3DQueryAggregationProps","Error","keyType","keySubtype","valueType","guardInvalidKeyTypes","key"],"sources":["wireQueryDataTypeToQueryDataTypeDefinition.ts"],"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\nimport type {\n QueryDataTypeDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"@osdk/api\";\nimport type {\n QueryAggregationKeyType,\n QueryDataType,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"@osdk/foundry.ontologies\";\nimport { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\n\nexport function wireQueryDataTypeToQueryDataTypeDefinition<\n K extends string,\n>(\n input: QueryDataType,\n): QueryDataTypeDefinition {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false,\n };\n\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName as K,\n nullable: false,\n };\n\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName as K,\n nullable: false,\n };\n\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true,\n };\n\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false,\n };\n\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n\n // special case for a union where one half is nullable to skip the union step and just allow nulls directly\n if (allowNulls && input.unionTypes.length === 2) {\n const nonNull = input.unionTypes.find(t => t.type != null);\n if (nonNull) {\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),\n nullable: true,\n };\n }\n }\n\n return {\n type: \"union\",\n union: input.unionTypes.reduce<QueryDataTypeDefinition[]>((acc, t) => {\n if (t.type === \"null\") {\n return acc;\n }\n acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));\n return acc;\n }, []),\n nullable: allowNulls,\n };\n\n case \"struct\":\n return {\n type: \"struct\",\n struct: Object.fromEntries(input.fields.map(f => [\n f.name,\n wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType),\n ])),\n nullable: false,\n };\n\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false,\n };\n\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false,\n };\n\n case \"null\":\n case \"unsupported\":\n throw new Error(\n `Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`,\n );\n\n default:\n const _: never = input;\n throw new Error(`Unsupported QueryDataType.type ${(input as any).type}`);\n }\n}\n\nfunction get2DQueryAggregationProps(\n input: TwoDimensionalAggregation,\n): TwoDimensionalQueryAggregationDefinition {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type,\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: input.valueType.type,\n };\n }\n throw new Error(\n `Cannot create 2D aggregation with ${input.keyType.type} as its type`,\n );\n }\n}\n\nfunction get3DQueryAggregationProps(\n input: ThreeDimensionalAggregation,\n): ThreeDimensionalQueryAggregationDefinition {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: get2DQueryAggregationProps(input.valueType),\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: get2DQueryAggregationProps(input.valueType),\n };\n }\n throw new Error(\n `Cannot create 3D aggregation with ${input.keyType.type} as its type`,\n );\n }\n}\n\n/**\n * Guard against aggregation key types that are allowed by the backend types but are illegal to actually use\n */\nfunction guardInvalidKeyTypes(\n key: QueryAggregationKeyType,\n): key is QueryAggregationKeyType & ({ type: \"string\" | \"boolean\" }) {\n return key.type === \"string\" || key.type === \"boolean\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,SAASA,uBAAuB,QAAQ,8BAA8B;AAEtE,OAAO,SAASC,0CAA0CA,CAGxDC,KAAoB,EACK;EACzB,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,WAAW;MACd,OAAO;QACLA,IAAI,EAAED,KAAK,CAACC,IAAI;QAChBC,QAAQ,EAAE;MACZ,CAAC;IAEH,KAAK,QAAQ;MACX,OAAO;QACLD,IAAI,EAAE,QAAQ;QACdE,MAAM,EAAEH,KAAK,CAACI,iBAAsB;QACpCF,QAAQ,EAAE;MACZ,CAAC;IAEH,KAAK,WAAW;MACd,OAAO;QACLD,IAA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AS6B,0BAA0BA,CACjC9B,KAAkC,EACU;EAC5C,IAAIA,KAAK,CAACgC,OAAO,CAAC/B,IAAI,KAAK,OAAO,EAAE;IAClC,OAAO;MACL+B,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;MAC3BgC,UAAU,EAAEjC,KAAK,CAACgC,OAAO,CAAC1B,OAAO,CAACL,IAAI;MACtCiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;IACvD,CAAC;EACH,CAAC,MAAM;IACL,IAAIC,oBAAoB,CAACnC,KAAK,CAACgC,OAAO,CAAC,EAAE;MACvC,OAAO;QACLA,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;QAC3BiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;MACvD,CAAC;IACH;IACA,MAAM,IAAIH,KAAK,CACb,qCAAqC/B,KAAK,CAACgC,OAAO,CAAC/B,IAAI,cACzD,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA,SAASkC,oBAAoBA,CAC3BC,GAA4B,EACuC;EACnE,OAAOA,GAAG,CAACnC,IAAI,KAAK,QAAQ,IAAImC,GAAG,CAACnC,IAAI,KAAK,SAAS;AACxD","ignoreList":[]}
1
+ {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","subType","multiplicity","set","allowNulls","unionTypes","length","nonNull","find","t","union","reduce","acc","push","struct","Object","fromEntries","fields","map","f","name","fieldType","twoDimensionalAggregation","get2DQueryAggregationProps","threeDimensionalAggregation","get3DQueryAggregationProps","keyType","validMapKeyTypes","includes","Error","toString","valueType","keySubtype","guardInvalidKeyTypes","key"],"sources":["wireQueryDataTypeToQueryDataTypeDefinition.ts"],"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\nimport type {\n QueryDataTypeDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"@osdk/api\";\nimport type {\n QueryAggregationKeyType,\n QueryDataType,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"@osdk/foundry.ontologies\";\nimport { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\n\nexport function wireQueryDataTypeToQueryDataTypeDefinition<\n K extends string,\n>(\n input: QueryDataType,\n): QueryDataTypeDefinition {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false,\n };\n\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName as K,\n nullable: false,\n };\n\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName as K,\n nullable: false,\n };\n\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true,\n };\n\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false,\n };\n\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n\n // special case for a union where one half is nullable to skip the union step and just allow nulls directly\n if (allowNulls && input.unionTypes.length === 2) {\n const nonNull = input.unionTypes.find(t => t.type != null);\n if (nonNull) {\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),\n nullable: true,\n };\n }\n }\n\n return {\n type: \"union\",\n union: input.unionTypes.reduce<QueryDataTypeDefinition[]>((acc, t) => {\n if (t.type === \"null\") {\n return acc;\n }\n acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));\n return acc;\n }, []),\n nullable: allowNulls,\n };\n\n case \"struct\":\n return {\n type: \"struct\",\n struct: Object.fromEntries(input.fields.map(f => [\n f.name,\n wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType),\n ])),\n nullable: false,\n };\n\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false,\n };\n\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false,\n };\n\n case \"entrySet\":\n const keyType = wireQueryDataTypeToQueryDataTypeDefinition(input.keyType);\n\n if (!validMapKeyTypes.includes(keyType.type)) {\n throw new Error(\n \"Map types with a key type of \" + keyType.type + \" are not supported\"\n + validMapKeyTypes.toString(),\n );\n }\n\n if (keyType.multiplicity === true) {\n throw new Error(\n \"Map types cannot have keys as arrays\",\n );\n }\n\n return {\n type: \"map\",\n nullable: false,\n keyType,\n valueType: wireQueryDataTypeToQueryDataTypeDefinition(input.valueType),\n };\n\n case \"null\":\n case \"unsupported\":\n throw new Error(\n `Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`,\n );\n\n default:\n const _: never = input;\n throw new Error(`Unsupported QueryDataType.type ${(input as any).type}`);\n }\n}\n\nfunction get2DQueryAggregationProps(\n input: TwoDimensionalAggregation,\n): TwoDimensionalQueryAggregationDefinition {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type,\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: input.valueType.type,\n };\n }\n throw new Error(\n `Cannot create 2D aggregation with ${input.keyType.type} as its type`,\n );\n }\n}\n\nfunction get3DQueryAggregationProps(\n input: ThreeDimensionalAggregation,\n): ThreeDimensionalQueryAggregationDefinition {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: get2DQueryAggregationProps(input.valueType),\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: get2DQueryAggregationProps(input.valueType),\n };\n }\n throw new Error(\n `Cannot create 3D aggregation with ${input.keyType.type} as its type`,\n );\n }\n}\n\n/**\n * Guard against aggregation key types that are allowed by the backend types but are illegal to actually use\n */\nfunction guardInvalidKeyTypes(\n key: QueryAggregationKeyType,\n): key is QueryAggregationKeyType & ({ type: \"string\" | \"boolean\" }) {\n return key.type === \"string\" || key.type === \"boolean\";\n}\n\n/**\n * The set of all valid key types for maps. This includes all types that are represented by strings or numbers in the OSDK, and Ontology Objects.\n */\nconst validMapKeyTypes = [\n \"string\",\n \"object\",\n \"double\",\n \"float\",\n \"integer\",\n \"long\",\n \"date\",\n \"timestamp\",\n \"byte\",\n \"datetime\",\n \"decimal\",\n \"marking\",\n \"short\",\n \"objectType\",\n];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,SAASA,uBAAuB,QAAQ,8BAA8B;AAEtE,OAAO,SAASC,0CAA0CA,CAGxDC,KAAoB,EACK;EACzB,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,WAAW;MACd,OAAO;QACLA,IAAI,EAAED,KAAK,CAACC,IAAI;QAChBC,QAAQ,EAAE;MACZ,CAAC;IAEH,KAAK,QAAQ;MACX,OAAO;QACLD,IAAI,EAAE,QAAQ;QACdE,MAAM,EAAEH,KAAK,CAACI,iBAA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C;EACH;AACF;;AAEA;AACA;AACA;AACA,SAASqC,oBAAoBA,CAC3BC,GAA4B,EACuC;EACnE,OAAOA,GAAG,CAACtC,IAAI,KAAK,QAAQ,IAAIsC,GAAG,CAACtC,IAAI,KAAK,SAAS;AACxD;;AAEA;AACA;AACA;AACA,MAAM+B,gBAAgB,GAAG,CACvB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,WAAW,EACX,MAAM,EACN,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,YAAY,CACb","ignoreList":[]}
@@ -4,7 +4,7 @@
4
4
  function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true, log) {
5
5
  const sdkPropDefinition = objectPropertyTypeToSdkPropertyDefinition(input.dataType, log);
6
6
  if (sdkPropDefinition == null) {
7
- return undefined;
7
+ return void 0;
8
8
  }
9
9
  switch (input.dataType.type) {
10
10
  case "integer":
@@ -45,12 +45,12 @@ function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true, log) {
45
45
  case "cipherText":
46
46
  case "vector": {
47
47
  log?.info(`${JSON.stringify(input.dataType.type)} is not a supported dataType`);
48
- return undefined;
48
+ return void 0;
49
49
  }
50
50
  default:
51
51
  input.dataType;
52
52
  log?.info(`${JSON.stringify(input.dataType)} is not a supported dataType`);
53
- return undefined;
53
+ return void 0;
54
54
  }
55
55
  }
56
56
  function objectPropertyTypeToSdkPropertyDefinition(propertyType, log) {
@@ -91,11 +91,11 @@ function objectPropertyTypeToSdkPropertyDefinition(propertyType, log) {
91
91
  case "cipherText":
92
92
  case "vector": {
93
93
  log?.info(`${JSON.stringify(propertyType.type)} is not a supported propertyType`);
94
- return undefined;
94
+ return void 0;
95
95
  }
96
96
  default: {
97
97
  log?.info(`${JSON.stringify(propertyType)} is not a supported propertyType`);
98
- return undefined;
98
+ return void 0;
99
99
  }
100
100
  }
101
101
  }
@@ -108,8 +108,8 @@ function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2,
108
108
  apiName: interfaceType.apiName,
109
109
  displayName: interfaceType.displayName,
110
110
  description: interfaceType.description,
111
- implements: interfaceType.extendsInterfaces,
112
- properties: Object.fromEntries(Object.entries(interfaceType.properties).map(([key, value]) => {
111
+ implements: interfaceType.allExtendsInterfaces ?? interfaceType.extendsInterfaces,
112
+ properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {
113
113
  return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];
114
114
  }).filter(([key, value]) => value != null)),
115
115
  links: {},
@@ -171,6 +171,8 @@ function actionPropertyToSdkPropertyDefinition(parameterType) {
171
171
  case "mediaReference":
172
172
  case "marking":
173
173
  case "objectType":
174
+ case "geohash":
175
+ case "geoshape":
174
176
  return parameterType.type;
175
177
  case "date":
176
178
  return "datetime";
@@ -230,18 +232,16 @@ function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
230
232
  case "integer":
231
233
  case "double":
232
234
  case "string":
233
- case "boolean":
234
235
  case "byte":
235
236
  case "long":
236
- case "short": {
237
+ case "short":
238
+ case "timestamp": {
237
239
  return input.dataType.type;
238
240
  }
239
241
  case "date": {
240
242
  return "datetime";
241
243
  }
242
- case "timestamp": {
243
- return "timestamp";
244
- }
244
+ case "boolean":
245
245
  case "geopoint":
246
246
  case "geoshape":
247
247
  case "decimal":
@@ -255,7 +255,7 @@ function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
255
255
  case "struct":
256
256
  case "cipherText":
257
257
  case "vector":
258
- throw new Error(`Type not supported for primaryKey: ${input.dataType.type}`);
258
+ throw new Error(`Primary key of type ${input.dataType.type} is not supported`);
259
259
  default:
260
260
  input.dataType;
261
261
  throw new Error(`Unknown type encountered for primaryKey: ${input.dataType}`);
@@ -264,7 +264,7 @@ function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
264
264
 
265
265
  // src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts
266
266
  function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {
267
- if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === undefined) {
267
+ if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === void 0) {
268
268
  throw new Error(`Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`);
269
269
  }
270
270
  if (objectTypeWithLink.implementsInterfaces2 == null && objectTypeWithLink.implementsInterfaces != null) {
@@ -287,7 +287,7 @@ function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, l
287
287
  implements: objectTypeWithLink.implementsInterfaces,
288
288
  interfaceMap,
289
289
  inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),
290
- icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : undefined,
290
+ icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : void 0,
291
291
  titleProperty: objectTypeWithLink.objectType.titleProperty,
292
292
  displayName: objectTypeWithLink.objectType.displayName,
293
293
  pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,
@@ -297,7 +297,7 @@ function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, l
297
297
  };
298
298
  }
299
299
  function invertProps(a) {
300
- return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : undefined;
300
+ return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : void 0;
301
301
  }
302
302
  var supportedIconTypes = ["blueprint"];
303
303
 
@@ -391,6 +391,20 @@ function wireQueryDataTypeToQueryDataTypeDefinition(input) {
391
391
  threeDimensionalAggregation: get3DQueryAggregationProps(input),
392
392
  nullable: false
393
393
  };
394
+ case "entrySet":
395
+ const keyType = wireQueryDataTypeToQueryDataTypeDefinition(input.keyType);
396
+ if (!validMapKeyTypes.includes(keyType.type)) {
397
+ throw new Error("Map types with a key type of " + keyType.type + " are not supported" + validMapKeyTypes.toString());
398
+ }
399
+ if (keyType.multiplicity === true) {
400
+ throw new Error("Map types cannot have keys as arrays");
401
+ }
402
+ return {
403
+ type: "map",
404
+ nullable: false,
405
+ keyType,
406
+ valueType: wireQueryDataTypeToQueryDataTypeDefinition(input.valueType)
407
+ };
394
408
  case "null":
395
409
  case "unsupported":
396
410
  throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);
@@ -435,6 +449,7 @@ function get3DQueryAggregationProps(input) {
435
449
  function guardInvalidKeyTypes(key) {
436
450
  return key.type === "string" || key.type === "boolean";
437
451
  }
452
+ var validMapKeyTypes = ["string", "object", "double", "float", "integer", "long", "date", "timestamp", "byte", "datetime", "decimal", "marking", "short", "objectType"];
438
453
 
439
454
  // src/wireQueryTypeV2ToSdkQueryMetadata.ts
440
455
  function wireQueryTypeV2ToSdkQueryMetadata(input) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/getEditedEntities.ts","../../src/wireActionTypeV2ToSdkActionMetadata.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts","../../src/isNullableQueryDataType.ts","../../src/wireQueryDataTypeToQueryDataTypeDefinition.ts","../../src/wireQueryTypeV2ToSdkQueryMetadata.ts"],"names":[],"mappings":";;;AAgBO,SAAS,qCAAsC,CAAA,KAAA,EAAO,UAAa,GAAA,IAAA,EAAM,GAAK,EAAA;AACnF,EAAA,MAAM,iBAAoB,GAAA,yCAAA,CAA0C,KAAM,CAAA,QAAA,EAAU,GAAG,CAAA;AACvF,EAAA,IAAI,qBAAqB,IAAM,EAAA;AAC7B,IAAO,OAA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KAAM,CAAA,UAAU,EAAE,GAAI,CAAA,CAAC,CAAC,IAAM,EAAA,SAAS,MAAM,CAAC,IAAA,EAAM,+CAA+C,SAAS,CAAC,CAAC,CAAC,CAAA;AAAA,IAC7J,MAAA,EAAQ,0CAA2C,CAAA,KAAA,CAAM,MAAM,CAAA;AAAA,IAC/D,KAAK,KAAM,CAAA;AAAA,GACb;AACF;AACO,SAAS,4CAA4C,KAAO,EAAA;AACjE,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,SAAS,KAAM,CAAA,OAAA;AAAA,IACf,aAAa,KAAM,CAAA,WAAA;AAAA,IACnB,aAAa,KAAM,CAAA,WAAA;AAAA,IACnB,SAAS,KAAM,CAAA,OAAA;AAAA,IACf,KAAK,KAAM,CAAA;AAAA,GACb;AACF;AACO,SAAS,+CAA+C,SAAW,EAAA;AACxE,EAAO,OAAA;AAAA,IACL,aAAa,SAAU,CAAA,WAAA;AAAA,IACvB,GAAG,0CAA2C,CAAA,SAAA,CAAU,QAAQ;AAAA,GAClE;AACF","file":"index.cjs","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, log) {\n const sdkPropDefinition = objectPropertyTypeToSdkPropertyDefinition(input.dataType, log);\n if (sdkPropDefinition == null) {\n return undefined;\n }\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 \"mediaReference\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n case \"struct\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: sdkPropDefinition,\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: sdkPropDefinition,\n nullable: true\n };\n }\n case \"cipherText\":\n case \"vector\":\n {\n log?.info(`${JSON.stringify(input.dataType.type)} is not a supported dataType`);\n return undefined;\n }\n default:\n const _ = input.dataType;\n log?.info(`${JSON.stringify(input.dataType)} is not a supported dataType`);\n return undefined;\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType, log) {\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 case \"geotimeSeriesReference\":\n case \"mediaReference\":\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 } else if (propertyType.itemType?.type === \"double\") {\n return \"numericTimeseries\";\n } else return \"sensorTimeseries\";\n case \"struct\":\n {\n return propertyType.structFieldTypes.reduce((structMap, structField) => {\n structMap[structField.apiName] = objectPropertyTypeToSdkPropertyDefinition(structField.dataType);\n return structMap;\n }, {});\n }\n case \"cipherText\":\n case \"vector\":\n {\n log?.info(`${JSON.stringify(propertyType.type)} is not a supported propertyType`);\n return undefined;\n }\n default:\n {\n const _ = propertyType;\n log?.info(`${JSON.stringify(propertyType)} is not a supported propertyType`);\n return undefined;\n }\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, log) {\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 [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];\n }).filter(([key, value]) => value != null)),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes\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 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 case \"deleteInterfaceObject\":\n break;\n default:\n const _ = operation;\n }\n }\n return {\n addedObjects,\n modifiedObjects\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 { 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 \"mediaReference\":\n case \"marking\":\n case \"objectType\":\n return parameterType.type;\n case \"date\":\n return \"datetime\";\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: parameterType.objectTypeApiName\n };\n case \"object\":\n return {\n type: \"object\",\n object: parameterType.objectTypeApiName\n };\n case \"array\":\n return actionPropertyToSdkPropertyDefinition(parameterType.subType);\n case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce((structMap, structField) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(structField.fieldType);\n return structMap;\n }, {})\n };\n default:\n throw new Error(`Unsupported action parameter type: ${JSON.stringify(parameterType)}`);\n }\n}\nfunction createModifiedEntities(addedObjects, modifiedObjects) {\n const entities = {};\n for (const key of addedObjects) {\n entities[key] = {\n created: true,\n modified: false\n };\n }\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = {\n created: false,\n modified: true\n };\n }\n }\n return entities;\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 case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"struct\":\n case \"cipherText\":\n case \"vector\":\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 wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {\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])) : {};\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), log)]).filter(([key, value]) => value != null)),\n implements: objectTypeWithLink.implementsInterfaces,\n interfaceMap,\n inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),\n icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : undefined,\n titleProperty: objectTypeWithLink.objectType.titleProperty,\n displayName: objectTypeWithLink.objectType.displayName,\n pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,\n status: objectTypeWithLink.objectType.status,\n rid: objectTypeWithLink.objectType.rid,\n visibility: objectTypeWithLink.objectType.visibility\n };\n}\nfunction invertProps(a) {\n return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : undefined;\n}\nconst supportedIconTypes = [\"blueprint\"];","/*\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 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 * 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 { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\nexport function wireQueryDataTypeToQueryDataTypeDefinition(input) {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false\n };\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName,\n nullable: false\n };\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName,\n nullable: false\n };\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true\n };\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false\n };\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n\n // special case for a union where one half is nullable to skip the union step and just allow nulls directly\n if (allowNulls && input.unionTypes.length === 2) {\n const nonNull = input.unionTypes.find(t => t.type != null);\n if (nonNull) {\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),\n nullable: true\n };\n }\n }\n return {\n type: \"union\",\n union: input.unionTypes.reduce((acc, t) => {\n if (t.type === \"null\") {\n return acc;\n }\n acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));\n return acc;\n }, []),\n nullable: allowNulls\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: Object.fromEntries(input.fields.map(f => [f.name, wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType)])),\n nullable: false\n };\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false\n };\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false\n };\n case \"null\":\n case \"unsupported\":\n throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);\n default:\n const _ = input;\n throw new Error(`Unsupported QueryDataType.type ${input.type}`);\n }\n}\nfunction get2DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: input.valueType.type\n };\n }\n throw new Error(`Cannot create 2D aggregation with ${input.keyType.type} as its type`);\n }\n}\nfunction get3DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: get2DQueryAggregationProps(input.valueType)\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: get2DQueryAggregationProps(input.valueType)\n };\n }\n throw new Error(`Cannot create 3D aggregation with ${input.keyType.type} as its type`);\n }\n}\n\n/**\n * Guard against aggregation key types that are allowed by the backend types but are illegal to actually use\n */\nfunction guardInvalidKeyTypes(key) {\n return key.type === \"string\" || key.type === \"boolean\";\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 { 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}"]}
1
+ {"version":3,"sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/getEditedEntities.ts","../../src/wireActionTypeV2ToSdkActionMetadata.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts","../../src/isNullableQueryDataType.ts","../../src/wireQueryDataTypeToQueryDataTypeDefinition.ts","../../src/wireQueryTypeV2ToSdkQueryMetadata.ts"],"names":[],"mappings":";;;AAgBO,SAAS,qCAAsC,CAAA,KAAA,EAAO,UAAa,GAAA,IAAA,EAAM,GAAK,EAAA;AACnF,EAAA,MAAM,iBAAoB,GAAA,yCAAA,CAA0C,KAAM,CAAA,QAAA,EAAU,GAAG,CAAA;AACvF,EAAA,IAAI,qBAAqB,IAAM,EAAA;AAC7B,IAAO,OAAA,MAAA;AAAA;AAET,EAAQ,QAAA,KAAA,CAAM,SAAS,IAAM;AAAA,IAC3B,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,MAAA;AAAA,IACL,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,OAAA;AAAA,IACL,KAAK,MAAA;AAAA,IACL,KAAK,OAAA;AAAA,IACL,KAAK,SAAA;AAAA,I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ies, 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, log) {\n const sdkPropDefinition = objectPropertyTypeToSdkPropertyDefinition(input.dataType, log);\n if (sdkPropDefinition == null) {\n return undefined;\n }\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 \"mediaReference\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n case \"struct\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: sdkPropDefinition,\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: sdkPropDefinition,\n nullable: true\n };\n }\n case \"cipherText\":\n case \"vector\":\n {\n log?.info(`${JSON.stringify(input.dataType.type)} is not a supported dataType`);\n return undefined;\n }\n default:\n const _ = input.dataType;\n log?.info(`${JSON.stringify(input.dataType)} is not a supported dataType`);\n return undefined;\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType, log) {\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 case \"geotimeSeriesReference\":\n case \"mediaReference\":\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 } else if (propertyType.itemType?.type === \"double\") {\n return \"numericTimeseries\";\n } else return \"sensorTimeseries\";\n case \"struct\":\n {\n return propertyType.structFieldTypes.reduce((structMap, structField) => {\n structMap[structField.apiName] = objectPropertyTypeToSdkPropertyDefinition(structField.dataType);\n return structMap;\n }, {});\n }\n case \"cipherText\":\n case \"vector\":\n {\n log?.info(`${JSON.stringify(propertyType.type)} is not a supported propertyType`);\n return undefined;\n }\n default:\n {\n const _ = propertyType;\n log?.info(`${JSON.stringify(propertyType)} is not a supported propertyType`);\n return undefined;\n }\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, log) {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.allExtendsInterfaces ?? interfaceType.extendsInterfaces,\n properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {\n return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];\n }).filter(([key, value]) => value != null)),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes\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 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 case \"deleteInterfaceObject\":\n break;\n default:\n const _ = operation;\n }\n }\n return {\n addedObjects,\n modifiedObjects\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 { 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 \"mediaReference\":\n case \"marking\":\n case \"objectType\":\n case \"geohash\":\n case \"geoshape\":\n return parameterType.type;\n case \"date\":\n return \"datetime\";\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: parameterType.objectTypeApiName\n };\n case \"object\":\n return {\n type: \"object\",\n object: parameterType.objectTypeApiName\n };\n case \"array\":\n return actionPropertyToSdkPropertyDefinition(parameterType.subType);\n case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce((structMap, structField) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(structField.fieldType);\n return structMap;\n }, {})\n };\n default:\n throw new Error(`Unsupported action parameter type: ${JSON.stringify(parameterType)}`);\n }\n}\nfunction createModifiedEntities(addedObjects, modifiedObjects) {\n const entities = {};\n for (const key of addedObjects) {\n entities[key] = {\n created: true,\n modified: false\n };\n }\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = {\n created: false,\n modified: true\n };\n }\n }\n return entities;\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 \"byte\":\n case \"long\":\n case \"short\":\n case \"timestamp\":\n {\n return input.dataType.type;\n }\n case \"date\":\n {\n return \"datetime\";\n }\n case \"boolean\":\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 case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"struct\":\n case \"cipherText\":\n case \"vector\":\n throw new Error(`Primary key of type ${input.dataType.type} is not supported`);\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 wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {\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])) : {};\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), log)]).filter(([key, value]) => value != null)),\n implements: objectTypeWithLink.implementsInterfaces,\n interfaceMap,\n inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),\n icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : undefined,\n titleProperty: objectTypeWithLink.objectType.titleProperty,\n displayName: objectTypeWithLink.objectType.displayName,\n pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,\n status: objectTypeWithLink.objectType.status,\n rid: objectTypeWithLink.objectType.rid,\n visibility: objectTypeWithLink.objectType.visibility\n };\n}\nfunction invertProps(a) {\n return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : undefined;\n}\nconst supportedIconTypes = [\"blueprint\"];","/*\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 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 * 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 { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\nexport function wireQueryDataTypeToQueryDataTypeDefinition(input) {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false\n };\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName,\n nullable: false\n };\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName,\n nullable: false\n };\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true\n };\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false\n };\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n\n // special case for a union where one half is nullable to skip the union step and just allow nulls directly\n if (allowNulls && input.unionTypes.length === 2) {\n const nonNull = input.unionTypes.find(t => t.type != null);\n if (nonNull) {\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),\n nullable: true\n };\n }\n }\n return {\n type: \"union\",\n union: input.unionTypes.reduce((acc, t) => {\n if (t.type === \"null\") {\n return acc;\n }\n acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));\n return acc;\n }, []),\n nullable: allowNulls\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: Object.fromEntries(input.fields.map(f => [f.name, wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType)])),\n nullable: false\n };\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false\n };\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false\n };\n case \"entrySet\":\n const keyType = wireQueryDataTypeToQueryDataTypeDefinition(input.keyType);\n if (!validMapKeyTypes.includes(keyType.type)) {\n throw new Error(\"Map types with a key type of \" + keyType.type + \" are not supported\" + validMapKeyTypes.toString());\n }\n if (keyType.multiplicity === true) {\n throw new Error(\"Map types cannot have keys as arrays\");\n }\n return {\n type: \"map\",\n nullable: false,\n keyType,\n valueType: wireQueryDataTypeToQueryDataTypeDefinition(input.valueType)\n };\n case \"null\":\n case \"unsupported\":\n throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);\n default:\n const _ = input;\n throw new Error(`Unsupported QueryDataType.type ${input.type}`);\n }\n}\nfunction get2DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: input.valueType.type\n };\n }\n throw new Error(`Cannot create 2D aggregation with ${input.keyType.type} as its type`);\n }\n}\nfunction get3DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: get2DQueryAggregationProps(input.valueType)\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: get2DQueryAggregationProps(input.valueType)\n };\n }\n throw new Error(`Cannot create 3D aggregation with ${input.keyType.type} as its type`);\n }\n}\n\n/**\n * Guard against aggregation key types that are allowed by the backend types but are illegal to actually use\n */\nfunction guardInvalidKeyTypes(key) {\n return key.type === \"string\" || key.type === \"boolean\";\n}\n\n/**\n * The set of all valid key types for maps. This includes all types that are represented by strings or numbers in the OSDK, and Ontology Objects.\n */\nconst validMapKeyTypes = [\"string\", \"object\", \"double\", \"float\", \"integer\", \"long\", \"date\", \"timestamp\", \"byte\", \"datetime\", \"decimal\", \"marking\", \"short\", \"objectType\"];","/*\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 { 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}"]}
@@ -22,8 +22,8 @@ export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceTyp
22
22
  apiName: interfaceType.apiName,
23
23
  displayName: interfaceType.displayName,
24
24
  description: interfaceType.description,
25
- implements: interfaceType.extendsInterfaces,
26
- properties: Object.fromEntries(Object.entries(interfaceType.properties).map(([key, value]) => {
25
+ implements: interfaceType.allExtendsInterfaces ?? interfaceType.extendsInterfaces,
26
+ properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {
27
27
  return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];
28
28
  }).filter(([key, value]) => value != null)),
29
29
  links: {},
@@ -1 +1 @@
1
- {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","v2","log","type","rid","apiName","displayName","description","implements","extendsInterfaces","properties","Object","fromEntries","entries","map","key","value","filter","links","implementedBy","implementedByObjectTypes"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts"],"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 */\n\nimport type { InterfaceMetadata } from \"@osdk/api\";\nimport type { InterfaceType } from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceType: InterfaceType,\n v2: boolean,\n log?: { info: (msg: string) => void },\n): InterfaceMetadata {\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(\n Object.entries(interfaceType.properties).map((\n [key, value],\n ) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n true,\n log,\n ),\n ];\n }).filter(([key, value]) => value != null),\n ),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,mDAAmDA,CACjEC,aAA4B,EAC5BC,EAAW,EACXC,GAAqC,EAClB;EACnB,OAAO;IACLC,IAAI,EAAE,WAAW;IACjBC,GAAG,EAAEJ,aAAa,CAACI,GAAG;IACtBC,OAAO,EAAEL,aAAa,CAACK,OAAO;IAC9BC,WAAW,EAAEN,aAAa,CAACM,WAAW;IACtCC,WAAW,EAAEP,aAAa,CAACO,WAAW;IACtCC,UAAU,EAAER,aAAa,CAACS,iBAAiB;IAC3CC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACb,aAAa,CAACU,UAAU,CAAC,CAACI,GAAG,CAAC,CAC3C,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT;MACH,OAAO,CACLD,GAAG,EACHjB,qCAAqC,CACnCkB,KAAK,EACL,IAAI,EACJd,GACF,CAAC,CACF;IACH,CAAC,CAAC,CAACe,MAAM,CAAC,CAAC,CAACF,GAAG,EAAEC,KAAK,CAAC,KAAKA,KAAK,IAAI,IAAI,CAC3C,CAAC;IACDE,KAAK,EAAE,CAAC,CAAC;IACTC,aAAa,EAAEnB,aAAa,CAACoB;EAC/B,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","v2","log","type","rid","apiName","displayName","description","implements","allExtendsInterfaces","extendsInterfaces","properties","Object","fromEntries","entries","allProperties","map","key","value","filter","links","implementedBy","implementedByObjectTypes"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts"],"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 */\n\nimport type { InterfaceMetadata } from \"@osdk/api\";\nimport type { InterfaceType } from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceType: InterfaceType,\n v2: boolean,\n log?: { info: (msg: string) => void },\n): InterfaceMetadata {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.allExtendsInterfaces\n ?? interfaceType.extendsInterfaces,\n properties: Object.fromEntries(\n Object.entries(interfaceType.allProperties ?? interfaceType.properties)\n .map((\n [key, value],\n ) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n true,\n log,\n ),\n ];\n }).filter(([key, value]) => value != null),\n ),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,mDAAmDA,CACjEC,aAA4B,EAC5BC,EAAW,EACXC,GAAqC,EAClB;EACnB,OAAO;IACLC,IAAI,EAAE,WAAW;IACjBC,GAAG,EAAEJ,aAAa,CAACI,GAAG;IACtBC,OAAO,EAAEL,aAAa,CAACK,OAAO;IAC9BC,WAAW,EAAEN,aAAa,CAACM,WAAW;IACtCC,WAAW,EAAEP,aAAa,CAACO,WAAW;IACtCC,UAAU,EAAER,aAAa,CAACS,oBAAoB,IACzCT,aAAa,CAACU,iBAAiB;IACpCC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACd,aAAa,CAACe,aAAa,IAAIf,aAAa,CAACW,UAAU,CAAC,CACpEK,GAAG,CAAC,CACH,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT;MACH,OAAO,CACLD,GAAG,EACHnB,qCAAqC,CACnCoB,KAAK,EACL,IAAI,EACJhB,GACF,CAAC,CACF;IACH,CAAC,CAAC,CAACiB,MAAM,CAAC,CAAC,CAACF,GAAG,EAAEC,KAAK,CAAC,KAAKA,KAAK,IAAI,IAAI,CAC7C,CAAC;IACDE,KAAK,EAAE,CAAC,CAAC;IACTC,aAAa,EAAErB,aAAa,CAACsB;EAC/B,CAAC;AACH","ignoreList":[]}
@@ -48,6 +48,8 @@ function actionPropertyToSdkPropertyDefinition(parameterType) {
48
48
  case "mediaReference":
49
49
  case "marking":
50
50
  case "objectType":
51
+ case "geohash":
52
+ case "geoshape":
51
53
  return parameterType.type;
52
54
  case "date":
53
55
  return "datetime";
@@ -1 +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","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","Error","JSON","stringify","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.ts"],"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\nimport type { ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n} from \"@osdk/foundry.ontologies\";\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\n\nexport function wireActionTypeV2ToSdkActionMetadata(\n input: ActionTypeV2,\n): ActionMetadata {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(\n Object.entries(input.parameters).map((\n [key, value],\n ) => [key, wireActionParameterV2ToSdkParameterDefinition(value)]),\n ),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(\n modifiedEntityTypes.addedObjects,\n modifiedEntityTypes.modifiedObjects,\n ),\n rid: input.rid,\n status: input.status,\n };\n}\n\nfunction wireActionParameterV2ToSdkParameterDefinition(\n value: ActionParameterV2,\n): ActionMetadata.Parameter<any> {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(\n value.dataType.type === \"array\" ? value.dataType.subType : value.dataType,\n ),\n nullable: !value.required,\n description: value.description,\n };\n}\n\nfunction actionPropertyToSdkPropertyDefinition(\n parameterType: ActionParameterType,\n): ActionMetadata.Parameter[\"type\"] {\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 \"mediaReference\":\n case \"marking\":\n case \"objectType\":\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 case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName,\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce(\n (\n structMap: Record<\n string,\n ActionMetadata.DataType.BaseActionParameterTypes\n >,\n structField,\n ) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(\n structField.fieldType as ActionParameterType,\n ) as ActionMetadata.DataType.BaseActionParameterTypes;\n return structMap;\n },\n {},\n ),\n };\n default:\n throw new Error(\n `Unsupported action parameter type: ${JSON.stringify(parameterType)}`,\n );\n }\n}\n\nfunction createModifiedEntities<K extends string>(\n addedObjects: Set<K>,\n modifiedObjects: Set<K>,\n): ActionMetadata[\"modifiedEntities\"] {\n const entities = {} as Record<\n K,\n {\n created: boolean;\n modified: boolean;\n }\n >;\n\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = { created: false, modified: true };\n }\n }\n\n return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AAQ,EAAE;IAAM,CAAC;EACpD;EAEA,KAAK,MAAMnC,GAAG,IAAIQ,eAAe,EAAE;IACjC,IAAIyB,QAAQ,CAACjC,GAAG,CAAC,EAAE;MACjBiC,QAAQ,CAACjC,GAAG,CAAC,CAACmC,QAAQ,GAAG,IAAI;IAC/B,CAAC,MAAM;MACLF,QAAQ,CAACjC,GAAG,CAAC,GAAG;QAAEkC,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAK,CAAC;IACpD;EACF;EAEA,OAAOF,QAAQ;AACjB","ignoreList":[]}
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","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","Error","JSON","stringify","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.ts"],"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\nimport type { ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n} from \"@osdk/foundry.ontologies\";\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\n\nexport function wireActionTypeV2ToSdkActionMetadata(\n input: ActionTypeV2,\n): ActionMetadata {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(\n Object.entries(input.parameters).map((\n [key, value],\n ) => [key, wireActionParameterV2ToSdkParameterDefinition(value)]),\n ),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(\n modifiedEntityTypes.addedObjects,\n modifiedEntityTypes.modifiedObjects,\n ),\n rid: input.rid,\n status: input.status,\n };\n}\n\nfunction wireActionParameterV2ToSdkParameterDefinition(\n value: ActionParameterV2,\n): ActionMetadata.Parameter<any> {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(\n value.dataType.type === \"array\" ? value.dataType.subType : value.dataType,\n ),\n nullable: !value.required,\n description: value.description,\n };\n}\n\nfunction actionPropertyToSdkPropertyDefinition(\n parameterType: ActionParameterType,\n): ActionMetadata.Parameter[\"type\"] {\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 \"mediaReference\":\n case \"marking\":\n case \"objectType\":\n case \"geohash\":\n case \"geoshape\":\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 case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName,\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce(\n (\n structMap: Record<\n string,\n ActionMetadata.DataType.BaseActionParameterTypes\n >,\n structField,\n ) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(\n structField.fieldType as ActionParameterType,\n ) as ActionMetadata.DataType.BaseActionParameterTypes;\n return structMap;\n },\n {},\n ),\n };\n default:\n throw new Error(\n `Unsupported action parameter type: ${JSON.stringify(parameterType)}`,\n );\n }\n}\n\nfunction createModifiedEntities<K extends string>(\n addedObjects: Set<K>,\n modifiedObjects: Set<K>,\n): ActionMetadata[\"modifiedEntities\"] {\n const entities = {} as Record<\n K,\n {\n created: boolean;\n modified: boolean;\n }\n >;\n\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = { created: false, modified: true };\n }\n }\n\n return entities;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,sBAAsB,QAAQ,wBAAwB;AAE/D,OAAO,SAASC,mCAAmCA,CACjDC,KAAmB,EACH;EAChB,MAAMC,mBAAmB,GAAGH,sBAAsB,CAACE,KAAK,CAAC;EACzD,OAAO;IACLE,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACP,KAAK,CAACI,UAAU,CAAC,CAACI,GAAG,CAAC,CACnC,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT,CAACD,GAAG,EAAEE,6CAA6C,CAACD,KAAK,CAAC,CAAC,CAClE,CAAC;IACDE,WAAW,EAAEZ,KAAK,CAACY,WAAW;IAC9BC,WAAW,EAAEb,KAAK,CAACa,WAAW;IAC9BC,gBAAgB,EAAEC,sBAAsB,CACtCd,mBAAmB,CAACe,YAAY,EAChCf,mBAAmB,CAACgB,eACtB,CAAC;IACDC,GAAG,EAAElB,KAAK,CAACkB,GAAG;IACdC,MAAM,EAAEnB,KAAK,CAACmB;EAChB,CAAC;AACH;AAEA,SAASR,6CAA6CA,CACpDD,KAAwB,EACO;EAC/B,OAAO;IACLU,YAAY,EAAEV,KAAK,CAACW,QAAQ,CAACnB,IAAI,KAAK,OAAO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AS;QAClB,CAAC,EACD,CAAC,CACH;MACF,CAAC;IACH;MACE,MAAM,IAAII,KAAK,CACb,sCAAsCC,IAAI,CAACC,SAAS,CAACf,aAAa,CAAC,EACrE,CAAC;EACL;AACF;AAEA,SAASX,sBAAsBA,CAC7BC,YAAoB,EACpBC,eAAuB,EACa;EACpC,MAAMyB,QAAQ,GAAG,CAAC,CAMjB;EAED,KAAK,MAAMjC,GAAG,IAAIO,YAAY,EAAE;IAC9B0B,QAAQ,CAACjC,GAAG,CAAC,GAAG;MAAEkC,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAM,CAAC;EACpD;EAEA,KAAK,MAAMnC,GAAG,IAAIQ,eAAe,EAAE;IACjC,IAAIyB,QAAQ,CAACjC,GAAG,CAAC,EAAE;MACjBiC,QAAQ,CAACjC,GAAG,CAAC,CAACmC,QAAQ,GAAG,IAAI;IAC/B,CAAC,MAAM;MACLF,QAAQ,CAACjC,GAAG,CAAC,GAAG;QAAEkC,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAK,CAAC;IACpD;EACF;EAEA,OAAOF,QAAQ;AACjB","ignoreList":[]}
@@ -19,10 +19,10 @@ export function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
19
19
  case "integer":
20
20
  case "double":
21
21
  case "string":
22
- case "boolean":
23
22
  case "byte":
24
23
  case "long":
25
24
  case "short":
25
+ case "timestamp":
26
26
  {
27
27
  return input.dataType.type;
28
28
  }
@@ -30,10 +30,7 @@ export function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
30
30
  {
31
31
  return "datetime";
32
32
  }
33
- case "timestamp":
34
- {
35
- return "timestamp";
36
- }
33
+ case "boolean":
37
34
  case "geopoint":
38
35
  case "geoshape":
39
36
  case "decimal":
@@ -47,7 +44,7 @@ export function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
47
44
  case "struct":
48
45
  case "cipherText":
49
46
  case "vector":
50
- throw new Error(`Type not supported for primaryKey: ${input.dataType.type}`);
47
+ throw new Error(`Primary key of type ${input.dataType.type} is not supported`);
51
48
  default:
52
49
  input.dataType;
53
50
  throw new Error(`Unknown type encountered for primaryKey: ${input.dataType}`);
@@ -1 +1 @@
1
- {"version":3,"file":"wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js","names":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition","input","dataType","type","Error"],"sources":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts"],"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\nimport type { PrimaryKeyTypes } from \"@osdk/api\";\nimport type { PropertyV2 } from \"@osdk/foundry.ontologies\";\n\nexport function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(\n input: PropertyV2,\n): PrimaryKeyTypes {\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 return input.dataType.type;\n }\n case \"date\": {\n return \"datetime\";\n }\n case \"timestamp\": {\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 case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"struct\":\n case \"cipherText\":\n case \"vector\":\n throw new Error(\n `Type not supported for primaryKey: ${input.dataType.type}`,\n );\n default:\n const _: never = input.dataType;\n throw new Error(\n `Unknown type encountered for primaryKey: ${input.dataType}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,2CAA2CA,CACzDC,KAAiB,EACA;EACjB,QAAQA,KAAK,CAACC,QAAQ,CAACC,IAAI;IACzB,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,QAAQ;IACb,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,OAAO;MAAE;QACZ,OAAOF,KAAK,CAACC,QAAQ,CAACC,IAAI;MAC5B;IACA,KAAK,MAAM;MAAE;QACX,OAAO,UAAU;MACnB;IACA,KAAK,WAAW;MAAE;QAChB,OAAO,WAAW;MACpB;IACA,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,SAAS;IACd,KAAK,YAAY;IACjB,KAAK,YAAY;IACjB,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,OAAO;IACZ,KAAK,wBAAwB;IAC7B,KAAK,gBAAgB;IACrB,KAAK,QAAQ;IACb,KAAK,YAAY;IACjB,KAAK,QAAQ;MACX,MAAM,IAAIC,KAAK,CACb,sCAAsCH,KAAK,CAACC,QAAQ,CAACC,IAAI,EAC3D,CAAC;IACH;MACmBF,KAAK,CAACC,QAAQ;MAC/B,MAAM,IAAIE,KAAK,CACb,4CAA4CH,KAAK,CAACC,QAAQ,EAC5D,CAAC;EACL;AACF","ignoreList":[]}
1
+ {"version":3,"file":"wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js","names":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition","input","dataType","type","Error"],"sources":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts"],"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\nimport type { PrimaryKeyTypes } from \"@osdk/api\";\nimport type { PropertyV2 } from \"@osdk/foundry.ontologies\";\n\nexport function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(\n input: PropertyV2,\n): PrimaryKeyTypes {\n switch (input.dataType.type) {\n case \"integer\":\n case \"double\":\n case \"string\":\n case \"byte\":\n case \"long\":\n case \"short\":\n case \"timestamp\": {\n return input.dataType.type;\n }\n case \"date\": {\n return \"datetime\";\n }\n case \"boolean\":\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 case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"struct\":\n case \"cipherText\":\n case \"vector\":\n throw new Error(\n `Primary key of type ${input.dataType.type} is not supported`,\n );\n default:\n const _: never = input.dataType;\n throw new Error(\n `Unknown type encountered for primaryKey: ${input.dataType}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,2CAA2CA,CACzDC,KAAiB,EACA;EACjB,QAAQA,KAAK,CAACC,QAAQ,CAACC,IAAI;IACzB,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,QAAQ;IACb,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,OAAO;IACZ,KAAK,WAAW;MAAE;QAChB,OAAOF,KAAK,CAACC,QAAQ,CAACC,IAAI;MAC5B;IACA,KAAK,MAAM;MAAE;QACX,OAAO,UAAU;MACnB;IACA,KAAK,SAAS;IACd,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,SAAS;IACd,KAAK,YAAY;IACjB,KAAK,YAAY;IACjB,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,OAAO;IACZ,KAAK,wBAAwB;IAC7B,KAAK,gBAAgB;IACrB,KAAK,QAAQ;IACb,KAAK,YAAY;IACjB,KAAK,QAAQ;MACX,MAAM,IAAIC,KAAK,CACb,uBAAuBH,KAAK,CAACC,QAAQ,CAACC,IAAI,mBAC5C,CAAC;IACH;MACmBF,KAAK,CAACC,QAAQ;MAC/B,MAAM,IAAIE,KAAK,CACb,4CAA4CH,KAAK,CAACC,QAAQ,EAC5D,CAAC;EACL;AACF","ignoreList":[]}
@@ -95,6 +95,20 @@ export function wireQueryDataTypeToQueryDataTypeDefinition(input) {
95
95
  threeDimensionalAggregation: get3DQueryAggregationProps(input),
96
96
  nullable: false
97
97
  };
98
+ case "entrySet":
99
+ const keyType = wireQueryDataTypeToQueryDataTypeDefinition(input.keyType);
100
+ if (!validMapKeyTypes.includes(keyType.type)) {
101
+ throw new Error("Map types with a key type of " + keyType.type + " are not supported" + validMapKeyTypes.toString());
102
+ }
103
+ if (keyType.multiplicity === true) {
104
+ throw new Error("Map types cannot have keys as arrays");
105
+ }
106
+ return {
107
+ type: "map",
108
+ nullable: false,
109
+ keyType,
110
+ valueType: wireQueryDataTypeToQueryDataTypeDefinition(input.valueType)
111
+ };
98
112
  case "null":
99
113
  case "unsupported":
100
114
  throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);
@@ -143,4 +157,9 @@ function get3DQueryAggregationProps(input) {
143
157
  function guardInvalidKeyTypes(key) {
144
158
  return key.type === "string" || key.type === "boolean";
145
159
  }
160
+
161
+ /**
162
+ * The set of all valid key types for maps. This includes all types that are represented by strings or numbers in the OSDK, and Ontology Objects.
163
+ */
164
+ const validMapKeyTypes = ["string", "object", "double", "float", "integer", "long", "date", "timestamp", "byte", "datetime", "decimal", "marking", "short", "objectType"];
146
165
  //# sourceMappingURL=wireQueryDataTypeToQueryDataTypeDefinition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","subType","multiplicity","set","allowNulls","unionTypes","length","nonNull","find","t","union","reduce","acc","push","struct","Object","fromEntries","fields","map","f","name","fieldType","twoDimensionalAggregation","get2DQueryAggregationProps","threeDimensionalAggregation","get3DQueryAggregationProps","Error","keyType","keySubtype","valueType","guardInvalidKeyTypes","key"],"sources":["wireQueryDataTypeToQueryDataTypeDefinition.ts"],"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\nimport type {\n QueryDataTypeDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"@osdk/api\";\nimport type {\n QueryAggregationKeyType,\n QueryDataType,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"@osdk/foundry.ontologies\";\nimport { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\n\nexport function wireQueryDataTypeToQueryDataTypeDefinition<\n K extends string,\n>(\n input: QueryDataType,\n): QueryDataTypeDefinition {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false,\n };\n\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName as K,\n nullable: false,\n };\n\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName as K,\n nullable: false,\n };\n\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true,\n };\n\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false,\n };\n\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n\n // special case for a union where one half is nullable to skip the union step and just allow nulls directly\n if (allowNulls && input.unionTypes.length === 2) {\n const nonNull = input.unionTypes.find(t => t.type != null);\n if (nonNull) {\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),\n nullable: true,\n };\n }\n }\n\n return {\n type: \"union\",\n union: input.unionTypes.reduce<QueryDataTypeDefinition[]>((acc, t) => {\n if (t.type === \"null\") {\n return acc;\n }\n acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));\n return acc;\n }, []),\n nullable: allowNulls,\n };\n\n case \"struct\":\n return {\n type: \"struct\",\n struct: Object.fromEntries(input.fields.map(f => [\n f.name,\n wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType),\n ])),\n nullable: false,\n };\n\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false,\n };\n\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false,\n };\n\n case \"null\":\n case \"unsupported\":\n throw new Error(\n `Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`,\n );\n\n default:\n const _: never = input;\n throw new Error(`Unsupported QueryDataType.type ${(input as any).type}`);\n }\n}\n\nfunction get2DQueryAggregationProps(\n input: TwoDimensionalAggregation,\n): TwoDimensionalQueryAggregationDefinition {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type,\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: input.valueType.type,\n };\n }\n throw new Error(\n `Cannot create 2D aggregation with ${input.keyType.type} as its type`,\n );\n }\n}\n\nfunction get3DQueryAggregationProps(\n input: ThreeDimensionalAggregation,\n): ThreeDimensionalQueryAggregationDefinition {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: get2DQueryAggregationProps(input.valueType),\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: get2DQueryAggregationProps(input.valueType),\n };\n }\n throw new Error(\n `Cannot create 3D aggregation with ${input.keyType.type} as its type`,\n );\n }\n}\n\n/**\n * Guard against aggregation key types that are allowed by the backend types but are illegal to actually use\n */\nfunction guardInvalidKeyTypes(\n key: QueryAggregationKeyType,\n): key is QueryAggregationKeyType & ({ type: \"string\" | \"boolean\" }) {\n return key.type === \"string\" || key.type === \"boolean\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,SAASA,uBAAuB,QAAQ,8BAA8B;AAEtE,OAAO,SAASC,0CAA0CA,CAGxDC,KAAoB,EACK;EACzB,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,WAAW;MACd,OAAO;QACLA,IAAI,EAAED,KAAK,CAACC,IAAI;QAChBC,QAAQ,EAAE;MACZ,CAAC;IAEH,KAAK,QAAQ;MACX,OAAO;QACLD,IAAI,EAAE,QAAQ;QACdE,MAAM,EAAEH,KAAK,CAACI,iBAAsB;QACpCF,QAAQ,EAAE;MACZ,CAAC;IAEH,KAAK,WAAW;MACd,OAAO;QACLD,IAAI,EAAE,WAAW;QACjBI,SAAS,EAAEL,KAAK,CAACI,iBAAsB;QACvCF,QAAQ,EAAE;MAC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IAAI,KAAK,OAAO,EAAE;IAClC,OAAO;MACL+B,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;MAC3BgC,UAAU,EAAEjC,KAAK,CAACgC,OAAO,CAAC1B,OAAO,CAACL,IAAI;MACtCiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;IACvD,CAAC;EACH,CAAC,MAAM;IACL,IAAIC,oBAAoB,CAACnC,KAAK,CAACgC,OAAO,CAAC,EAAE;MACvC,OAAO;QACLA,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;QAC3BiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;MACvD,CAAC;IACH;IACA,MAAM,IAAIH,KAAK,CACb,qCAAqC/B,KAAK,CAACgC,OAAO,CAAC/B,IAAI,cACzD,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA,SAASkC,oBAAoBA,CAC3BC,GAA4B,EACuC;EACnE,OAAOA,GAAG,CAACnC,IAAI,KAAK,QAAQ,IAAImC,GAAG,CAACnC,IAAI,KAAK,SAAS;AACxD","ignoreList":[]}
1
+ {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","subType","multiplicity","set","allowNulls","unionTypes","length","nonNull","find","t","union","reduce","acc","push","struct","Object","fromEntries","fields","map","f","name","fieldType","twoDimensionalAggregation","get2DQueryAggregationProps","threeDimensionalAggregation","get3DQueryAggregationProps","keyType","validMapKeyTypes","includes","Error","toString","valueType","keySubtype","guardInvalidKeyTypes","key"],"sources":["wireQueryDataTypeToQueryDataTypeDefinition.ts"],"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\nimport type {\n QueryDataTypeDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"@osdk/api\";\nimport type {\n QueryAggregationKeyType,\n QueryDataType,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"@osdk/foundry.ontologies\";\nimport { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\n\nexport function wireQueryDataTypeToQueryDataTypeDefinition<\n K extends string,\n>(\n input: QueryDataType,\n): QueryDataTypeDefinition {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false,\n };\n\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName as K,\n nullable: false,\n };\n\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName as K,\n nullable: false,\n };\n\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true,\n };\n\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false,\n };\n\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n\n // special case for a union where one half is nullable to skip the union step and just allow nulls directly\n if (allowNulls && input.unionTypes.length === 2) {\n const nonNull = input.unionTypes.find(t => t.type != null);\n if (nonNull) {\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),\n nullable: true,\n };\n }\n }\n\n return {\n type: \"union\",\n union: input.unionTypes.reduce<QueryDataTypeDefinition[]>((acc, t) => {\n if (t.type === \"null\") {\n return acc;\n }\n acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));\n return acc;\n }, []),\n nullable: allowNulls,\n };\n\n case \"struct\":\n return {\n type: \"struct\",\n struct: Object.fromEntries(input.fields.map(f => [\n f.name,\n wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType),\n ])),\n nullable: false,\n };\n\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false,\n };\n\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false,\n };\n\n case \"entrySet\":\n const keyType = wireQueryDataTypeToQueryDataTypeDefinition(input.keyType);\n\n if (!validMapKeyTypes.includes(keyType.type)) {\n throw new Error(\n \"Map types with a key type of \" + keyType.type + \" are not supported\"\n + validMapKeyTypes.toString(),\n );\n }\n\n if (keyType.multiplicity === true) {\n throw new Error(\n \"Map types cannot have keys as arrays\",\n );\n }\n\n return {\n type: \"map\",\n nullable: false,\n keyType,\n valueType: wireQueryDataTypeToQueryDataTypeDefinition(input.valueType),\n };\n\n case \"null\":\n case \"unsupported\":\n throw new Error(\n `Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`,\n );\n\n default:\n const _: never = input;\n throw new Error(`Unsupported QueryDataType.type ${(input as any).type}`);\n }\n}\n\nfunction get2DQueryAggregationProps(\n input: TwoDimensionalAggregation,\n): TwoDimensionalQueryAggregationDefinition {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type,\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: input.valueType.type,\n };\n }\n throw new Error(\n `Cannot create 2D aggregation with ${input.keyType.type} as its type`,\n );\n }\n}\n\nfunction get3DQueryAggregationProps(\n input: ThreeDimensionalAggregation,\n): ThreeDimensionalQueryAggregationDefinition {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: get2DQueryAggregationProps(input.valueType),\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: get2DQueryAggregationProps(input.valueType),\n };\n }\n throw new Error(\n `Cannot create 3D aggregation with ${input.keyType.type} as its type`,\n );\n }\n}\n\n/**\n * Guard against aggregation key types that are allowed by the backend types but are illegal to actually use\n */\nfunction guardInvalidKeyTypes(\n key: QueryAggregationKeyType,\n): key is QueryAggregationKeyType & ({ type: \"string\" | \"boolean\" }) {\n return key.type === \"string\" || key.type === \"boolean\";\n}\n\n/**\n * The set of all valid key types for maps. This includes all types that are represented by strings or numbers in the OSDK, and Ontology Objects.\n */\nconst validMapKeyTypes = [\n \"string\",\n \"object\",\n \"double\",\n \"float\",\n \"integer\",\n \"long\",\n \"date\",\n \"timestamp\",\n \"byte\",\n \"datetime\",\n \"decimal\",\n \"marking\",\n \"short\",\n \"objectType\",\n];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,SAASA,uBAAuB,QAAQ,8BAA8B;AAEtE,OAAO,SAASC,0CAA0CA,CAGxDC,KAAoB,EACK;EACzB,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,WAAW;MACd,OAAO;QACLA,IAAI,EAAED,KAAK,CAACC,IAAI;QAChBC,QAAQ,EAAE;MACZ,CAAC;IAEH,KAAK,QAAQ;MACX,OAAO;QACLD,IAAI,EAAE,QAAQ;QACdE,MAAM,EAAEH,KAAK,CAACI,iBAAsB;QACpCF,QAAQ,EAAE;MACZ,CAAC;IAEH,KAAK,WAAW;MACd,OAAO;QACLD,IAAI,E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OAAOA,GAAG,CAACtC,IAAI,KAAK,QAAQ,IAAIsC,GAAG,CAACtC,IAAI,KAAK,SAAS;AACxD;;AAEA;AACA;AACA;AACA,MAAM+B,gBAAgB,GAAG,CACvB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,WAAW,EACX,MAAM,EACN,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,YAAY,CACb","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/generator-converters",
3
- "version": "2.2.0-beta.2",
3
+ "version": "2.2.0-beta.21",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -29,8 +29,8 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@osdk/foundry.ontologies": "2.13.0",
33
- "@osdk/api": "~2.2.0-beta.2"
32
+ "@osdk/foundry.ontologies": "2.18.0",
33
+ "@osdk/api": "~2.2.0-beta.21"
34
34
  },
35
35
  "devDependencies": {
36
36
  "ts-expect": "^1.3.0",