@osdk/generator-converters 2.8.0-beta.2 → 2.8.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js +3 -0
  3. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -1
  4. package/build/cjs/index.cjs +3 -0
  5. package/build/cjs/index.cjs.map +1 -1
  6. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js +3 -0
  7. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -1
  8. package/package.json +3 -3
  9. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js +0 -78
  10. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js.map +0 -1
  11. package/build/browser/empty.test.js +0 -23
  12. package/build/browser/empty.test.js.map +0 -1
  13. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +0 -269
  14. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +0 -1
  15. package/build/browser/wirePropertyFormattingToSdkFormatting.test.js +0 -344
  16. package/build/browser/wirePropertyFormattingToSdkFormatting.test.js.map +0 -1
  17. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js +0 -78
  18. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js.map +0 -1
  19. package/build/esm/empty.test.js +0 -23
  20. package/build/esm/empty.test.js.map +0 -1
  21. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +0 -269
  22. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +0 -1
  23. package/build/esm/wirePropertyFormattingToSdkFormatting.test.js +0 -344
  24. package/build/esm/wirePropertyFormattingToSdkFormatting.test.js.map +0 -1
  25. package/build/types/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.d.ts +0 -1
  26. package/build/types/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.d.ts.map +0 -1
  27. package/build/types/empty.test.d.ts +0 -1
  28. package/build/types/empty.test.d.ts.map +0 -1
  29. package/build/types/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts +0 -1
  30. package/build/types/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts.map +0 -1
  31. package/build/types/wirePropertyFormattingToSdkFormatting.test.d.ts +0 -1
  32. package/build/types/wirePropertyFormattingToSdkFormatting.test.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # @osdk/generator-converters
2
2
 
3
+ ## 2.8.0-beta.20
4
+
5
+ ### Patch Changes
6
+
7
+ - @osdk/api@2.8.0-beta.20
8
+
9
+ ## 2.8.0-beta.19
10
+
11
+ ### Patch Changes
12
+
13
+ - @osdk/api@2.8.0-beta.19
14
+
15
+ ## 2.8.0-beta.18
16
+
17
+ ### Patch Changes
18
+
19
+ - @osdk/api@2.8.0-beta.18
20
+
21
+ ## 2.8.0-beta.17
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [8c30908]
26
+ - @osdk/api@2.8.0-beta.17
27
+
28
+ ## 2.8.0-beta.16
29
+
30
+ ### Patch Changes
31
+
32
+ - @osdk/api@2.8.0-beta.16
33
+
34
+ ## 2.8.0-beta.15
35
+
36
+ ### Patch Changes
37
+
38
+ - @osdk/api@2.8.0-beta.15
39
+
40
+ ## 2.8.0-beta.14
41
+
42
+ ### Minor Changes
43
+
44
+ - 35f2f1a: Add Media inputs/outputs for Queries
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [35f2f1a]
49
+ - @osdk/api@2.8.0-beta.14
50
+
51
+ ## 2.8.0-beta.13
52
+
53
+ ### Minor Changes
54
+
55
+ - 4470c0d: Add support to execute queries on branches.
56
+
57
+ ### Patch Changes
58
+
59
+ - @osdk/api@2.8.0-beta.13
60
+
61
+ ## 2.8.0-beta.12
62
+
63
+ ### Patch Changes
64
+
65
+ - @osdk/api@2.8.0-beta.12
66
+
67
+ ## 2.8.0-beta.11
68
+
69
+ ### Patch Changes
70
+
71
+ - @osdk/api@2.8.0-beta.11
72
+
73
+ ## 2.8.0-beta.10
74
+
75
+ ### Patch Changes
76
+
77
+ - @osdk/api@2.8.0-beta.10
78
+
79
+ ## 2.8.0-beta.9
80
+
81
+ ### Minor Changes
82
+
83
+ - abb0e0f: Bump Platform SDK dependencies
84
+
85
+ ### Patch Changes
86
+
87
+ - @osdk/api@2.8.0-beta.9
88
+
89
+ ## 2.8.0-beta.8
90
+
91
+ ### Patch Changes
92
+
93
+ - @osdk/api@2.8.0-beta.8
94
+
95
+ ## 2.8.0-beta.7
96
+
97
+ ### Patch Changes
98
+
99
+ - @osdk/api@2.8.0-beta.7
100
+
101
+ ## 2.8.0-beta.6
102
+
103
+ ### Patch Changes
104
+
105
+ - @osdk/api@2.8.0-beta.6
106
+
107
+ ## 2.8.0-beta.5
108
+
109
+ ### Patch Changes
110
+
111
+ - @osdk/api@2.8.0-beta.5
112
+
113
+ ## 2.8.0-beta.4
114
+
115
+ ### Patch Changes
116
+
117
+ - @osdk/api@2.8.0-beta.4
118
+
119
+ ## 2.8.0-beta.3
120
+
121
+ ### Patch Changes
122
+
123
+ - @osdk/api@2.8.0-beta.3
124
+
3
125
  ## 2.8.0-beta.2
4
126
 
5
127
  ### Patch Changes
@@ -26,6 +26,7 @@ export function wireQueryDataTypeToQueryDataTypeDefinition(input) {
26
26
  case "date":
27
27
  case "string":
28
28
  case "timestamp":
29
+ case "mediaReference":
29
30
  return {
30
31
  type: input.type,
31
32
  nullable: false
@@ -124,6 +125,8 @@ export function wireQueryDataTypeToQueryDataTypeDefinition(input) {
124
125
  };
125
126
  case "null":
126
127
  case "unsupported":
128
+ case "mediaReference":
129
+ case "void":
127
130
  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.`);
128
131
  default:
129
132
  throw new Error(`Unsupported QueryDataType.type ${input.type}`);
@@ -1 +1 @@
1
- {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","interface","interfaceTypeApiName","array","subType","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 case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: input.interfaceTypeApiName as K,\n nullable: false,\n };\n case \"interfaceObjectSet\":\n return {\n type: \"interfaceObjectSet\",\n objectSet: input.interfaceTypeApiName as K,\n nullable: false,\n };\n case \"array\":\n return {\n array: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n type: \"array\",\n nullable: isNullableQueryDataType(input.subType),\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.type === \"array\") {\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,EAAE,WAAW;QACjBI,SAAS,EAAEL,KAAK,CAACI,iBAAsB;QACvCF,QAAQ,EAAE;MACZ,CAAC;IACH,KAAK,iBAAiB;MACpB,OAAO;QACLD,IAAI,EAAE,WAAW;QACjBK,SAAS,EAAEN,KAAK,CAACO,oBAAyB;QAC1CL,QAAQ,EAAE;MACZ,CAAC;IACH,KAAK,oBAAoB;MACvB,OAAO;QACLD,IAAI,EAAE,oBAAoB;QAC1BI,SAAS,EAAEL,KAAK,CAACO,oBAAyB;QAC1CL,QAAQ,EAAE;MACZ,CAAC;IACH,KAAK,OAAO;MACV,OAAO;QACLM,KAAK,EAAET,0CAA0C,CAACC,KAAK,CAACS,OAA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AgB,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":[]}
1
+ {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","interface","interfaceTypeApiName","array","subType","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 case \"mediaReference\":\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 case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: input.interfaceTypeApiName as K,\n nullable: false,\n };\n case \"interfaceObjectSet\":\n return {\n type: \"interfaceObjectSet\",\n objectSet: input.interfaceTypeApiName as K,\n nullable: false,\n };\n case \"array\":\n return {\n array: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n type: \"array\",\n nullable: isNullableQueryDataType(input.subType),\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.type === \"array\") {\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 case \"mediaReference\":\n case \"void\":\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;IAChB,KAAK,gBAAgB;MACnB,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;MACZ,CAAC;IACH,KAAK,iBAAiB;MACpB,OAAO;QACLD,IAAI,EAAE,WAAW;QACjBK,SAAS,EAAEN,KAAK,CAACO,oBAAyB;QAC1CL,QAAQ,EAAE;MACZ,CAAC;IACH,KAAK,oBAAoB;MACvB,OAAO;QACLD,IAAI,EAAE,oBAAoB;QA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;;AAEA;AACA;AACA;AACA,SAASuC,oBAAoBA,CAC3BC,GAA4B,EACuC;EACnE,OAAOA,GAAG,CAACxC,IAAI,KAAK,QAAQ,IAAIwC,GAAG,CAACxC,IAAI,KAAK,SAAS;AACxD;;AAEA;AACA;AACA;AACA,MAAMiC,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":[]}
@@ -584,6 +584,7 @@ function wireQueryDataTypeToQueryDataTypeDefinition(input) {
584
584
  case "date":
585
585
  case "string":
586
586
  case "timestamp":
587
+ case "mediaReference":
587
588
  return {
588
589
  type: input.type,
589
590
  nullable: false
@@ -680,6 +681,8 @@ function wireQueryDataTypeToQueryDataTypeDefinition(input) {
680
681
  };
681
682
  case "null":
682
683
  case "unsupported":
684
+ case "mediaReference":
685
+ case "void":
683
686
  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.`);
684
687
  default:
685
688
  throw new Error(`Unsupported QueryDataType.type ${input.type}`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/valueFormatting/convertBooleanValueFormattingRule.ts","../../src/valueFormatting/commonValueFormattingUtils.ts","../../src/valueFormatting/convertDateAndTimestampValueFormattingRule.ts","../../src/valueFormatting/convertKnownTypeValueFormattingRule.ts","../../src/valueFormatting/convertNumberValueFormattingRule.ts","../../src/wirePropertyFormattingToSdkFormatting.ts","../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/getEditedEntities.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts","../../src/wireActionTypeV2ToSdkActionMetadata.ts","../../src/isNullableQueryDataType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,WAAY,CAAA,MAAA,CAAO,QAAQ,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 2025 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 convertBooleanFormattingRule(wireFormatting) {\n return {\n type: \"boolean\",\n valueIfTrue: wireFormatting.valueIfTrue,\n valueIfFalse: wireFormatting.valueIfFalse\n };\n}","/*\n * Copyright 2025 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 convertPropertyTypeReferenceOrStringConstant(value) {\n switch (value.type) {\n case \"constant\":\n return {\n type: \"constant\",\n value: value.value\n };\n case \"propertyType\":\n return {\n type: \"propertyType\",\n propertyApiName: value.propertyApiName\n };\n default:\n value;\n throw new Error(`Unknown property reference type: ${value.type}`);\n }\n}","/*\n * Copyright 2025 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 { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\nexport function convertDateFormattingRule(wireFormatting) {\n return {\n type: \"date\",\n format: convertDatetimeFormat(wireFormatting.format)\n };\n}\nexport function convertTimestampFormattingRule(wireFormatting) {\n return {\n type: \"timestamp\",\n format: convertDatetimeFormat(wireFormatting.format),\n displayTimezone: convertDatetimeTimezone(wireFormatting.displayTimezone)\n };\n}\nfunction convertDatetimeFormat(wireFormat) {\n switch (wireFormat.type) {\n case \"stringFormat\":\n return {\n type: \"stringFormat\",\n pattern: wireFormat.pattern\n };\n case \"localizedFormat\":\n return {\n type: \"localizedFormat\",\n format: wireFormat.format\n };\n default:\n wireFormat;\n throw new Error(`Unknown datetime format type: ${wireFormat.type}`);\n }\n}\nfunction convertDatetimeTimezone(wireTimezone) {\n switch (wireTimezone.type) {\n case \"static\":\n return {\n type: \"static\",\n zoneId: convertPropertyTypeReferenceOrStringConstant(wireTimezone.zoneId)\n };\n case \"user\":\n return {\n type: \"user\"\n };\n default:\n wireTimezone;\n throw new Error(`Unknown timezone type: ${wireTimezone.type}`);\n }\n}","/*\n * Copyright 2025 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 convertKnownTypeFormattingRule(wireFormatting) {\n switch (wireFormatting.knownType) {\n case \"ARTIFACT_GID\":\n return {\n type: \"knownType\",\n knownType: \"ARTIFACT_GID\"\n };\n case \"RESOURCE_RID\":\n return {\n type: \"knownType\",\n knownType: \"RESOURCE_RID\"\n };\n case \"USER_OR_GROUP_ID\":\n return {\n type: \"knownType\",\n knownType: \"USER_OR_GROUP_ID\"\n };\n default:\n wireFormatting.knownType;\n return undefined;\n }\n}","/*\n * Copyright 2025 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 { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\nexport function convertNumberFormattingRule(wireFormatting) {\n const numberType = convertNumberFormattingType(wireFormatting.numberType);\n if (!numberType) {\n return undefined;\n }\n return {\n type: \"number\",\n numberType\n };\n}\nfunction convertNumberFormatOptions(wireOptions) {\n return {\n useGrouping: wireOptions.useGrouping,\n convertNegativeToParenthesis: wireOptions.convertNegativeToParenthesis,\n minimumIntegerDigits: wireOptions.minimumIntegerDigits,\n minimumFractionDigits: wireOptions.minimumFractionDigits,\n maximumFractionDigits: wireOptions.maximumFractionDigits,\n minimumSignificantDigits: wireOptions.minimumSignificantDigits,\n maximumSignificantDigits: wireOptions.maximumSignificantDigits,\n notation: wireOptions.notation,\n roundingMode: wireOptions.roundingMode\n };\n}\nfunction convertDurationFormatStyle(formatStyle) {\n switch (formatStyle.type) {\n case \"humanReadable\":\n return {\n type: \"humanReadable\",\n showFullUnits: formatStyle.showFullUnits\n };\n case \"timecode\":\n return {\n type: \"timecode\"\n };\n default:\n formatStyle;\n throw new Error(`Unknown duration format style: ${formatStyle.type}`);\n }\n}\nfunction convertNumberFormattingType(wireNumberType) {\n switch (wireNumberType.type) {\n case \"standard\":\n return {\n type: \"standard\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n case \"fixedValues\":\n return {\n type: \"fixedValues\",\n values: wireNumberType.values\n };\n case \"currency\":\n {\n return {\n type: \"currency\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n style: wireNumberType.style,\n currencyCode: convertPropertyTypeReferenceOrStringConstant(wireNumberType.currencyCode)\n };\n }\n case \"standardUnit\":\n {\n return {\n type: \"standardUnit\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)\n };\n }\n case \"customUnit\":\n {\n return {\n type: \"customUnit\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)\n };\n }\n case \"affix\":\n {\n return {\n type: \"affix\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n affix: {\n prefix: wireNumberType.affix?.prefix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.prefix) : undefined,\n postfix: wireNumberType.affix?.postfix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.postfix) : undefined\n }\n };\n }\n case \"duration\":\n {\n return {\n type: \"duration\",\n formatStyle: convertDurationFormatStyle(wireNumberType.formatStyle),\n precision: wireNumberType.precision,\n baseValue: wireNumberType.baseValue\n };\n }\n case \"scale\":\n {\n return {\n type: \"scale\",\n scaleType: wireNumberType.scaleType,\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n }\n case \"ratio\":\n {\n return {\n type: \"ratio\",\n ratioType: wireNumberType.ratioType,\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n }\n default:\n wireNumberType;\n throw new Error(`Unknown number format type: ${wireNumberType.type}`);\n }\n}","/*\n * Copyright 2025 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 { convertBooleanFormattingRule } from \"./valueFormatting/convertBooleanValueFormattingRule.js\";\nimport { convertDateFormattingRule, convertTimestampFormattingRule } from \"./valueFormatting/convertDateAndTimestampValueFormattingRule.js\";\nimport { convertKnownTypeFormattingRule } from \"./valueFormatting/convertKnownTypeValueFormattingRule.js\";\nimport { convertNumberFormattingRule } from \"./valueFormatting/convertNumberValueFormattingRule.js\";\n\n/**\n * Converts a PropertyValueFormattingRule from the ontologies format to the SDK format\n */\nexport function wirePropertyFormattingToSdkFormatting(wireFormatting, log) {\n try {\n return convertPropertyFormattingInternal(wireFormatting);\n } catch (error) {\n log?.info(`Failed to convert property formatting rule: ${error}`);\n return undefined;\n }\n}\nfunction convertPropertyFormattingInternal(wireFormatting) {\n switch (wireFormatting.type) {\n case \"date\":\n return convertDateFormattingRule(wireFormatting);\n case \"timestamp\":\n return convertTimestampFormattingRule(wireFormatting);\n case \"boolean\":\n return convertBooleanFormattingRule(wireFormatting);\n case \"knownType\":\n return convertKnownTypeFormattingRule(wireFormatting);\n case \"number\":\n return convertNumberFormattingRule(wireFormatting);\n default:\n wireFormatting;\n throw new Error(`Unknown formatting type: ${wireFormatting.type}`);\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 { wirePropertyFormattingToSdkFormatting } from \"./wirePropertyFormattingToSdkFormatting.js\";\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 case \"vector\":\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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined\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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined\n };\n }\n case \"cipherText\":\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 case \"vector\":\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 {\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.allExtendsInterfaces].sort((a, b) => a.localeCompare(b)) : interfaceType.extendsInterfaces ? [...interfaceType.extendsInterfaces].sort((a, b) => a.localeCompare(b)) : undefined,\n properties: Object.fromEntries(Object.entries(\n // prefer V2 if available and non-empty, otherwise fall back to V1\n interfaceType.allPropertiesV2 && Object.keys(interfaceType.allPropertiesV2).length > 0 ? interfaceType.allPropertiesV2 : interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {\n return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];\n }).filter(([_, value]) => value != null)),\n links: Object.fromEntries(Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).map(([linkApiName, linkType]) => [linkApiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetTypeApiName: linkType.linkedEntityApiName.apiName,\n targetType: linkType.linkedEntityApiName.type === \"objectTypeApiName\" ? \"object\" : \"interface\"\n }])),\n implementedBy: interfaceType.implementedByObjectTypes ? [...interfaceType.implementedByObjectTypes].sort((a, b) => a.localeCompare(b)) : 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\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]) => {\n // prefer V2 if available and non-empty\n if (impl.propertiesV2 && Object.keys(impl.propertiesV2).length > 0) {\n const propMap = {};\n for (const [iptApiName, implementation] of Object.entries(impl.propertiesV2)) {\n if (implementation.type === \"localPropertyImplementation\") {\n propMap[iptApiName] = implementation.propertyApiName;\n }\n }\n return [interfaceApiName, propMap];\n }\n // fall back to V1\n return [interfaceApiName, impl.properties];\n })) : {};\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].sort((a, b) => a.apiName.localeCompare(b.apiName)).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(([_, value]) => value != null)),\n implements: objectTypeWithLink.implementsInterfaces ? [...objectTypeWithLink.implementsInterfaces].sort((a, b) => a.localeCompare(b)) : 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: ensureStringEnumSupportedOrUndefined(objectTypeWithLink.objectType.status, supportedReleaseStatus),\n rid: objectTypeWithLink.objectType.rid,\n visibility: ensureStringEnumSupportedOrUndefined(objectTypeWithLink.objectType.visibility, supportedObjectTypeVisibility)\n };\n}\nfunction invertProps(a) {\n return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : undefined;\n}\nexport const supportedIconTypes = [\"blueprint\"];\nexport const supportedReleaseStatus = [\"ACTIVE\", \"EXPERIMENTAL\", \"DEPRECATED\", \"ENDORSED\"];\nexport const supportedObjectTypeVisibility = [\"NORMAL\", \"PROMINENT\", \"HIDDEN\"];\nexport function ensureStringEnumSupportedOrUndefined(value, supportedValues) {\n return value && supportedValues.includes(value) ? value : undefined;\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\";\nimport { ensureStringEnumSupportedOrUndefined, supportedReleaseStatus } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.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: ensureStringEnumSupportedOrUndefined(input.status, supportedReleaseStatus)\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 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 \"interfaceObject\":\n return {\n type: \"interface\",\n interface: input.interfaceTypeApiName,\n nullable: false\n };\n case \"interfaceObjectSet\":\n return {\n type: \"interfaceObjectSet\",\n objectSet: input.interfaceTypeApiName,\n nullable: false\n };\n case \"array\":\n return {\n array: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n type: \"array\",\n nullable: isNullableQueryDataType(input.subType)\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.type === \"array\") {\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}"]}
1
+ {"version":3,"sources":["../../src/valueFormatting/convertBooleanValueFormattingRule.ts","../../src/valueFormatting/commonValueFormattingUtils.ts","../../src/valueFormatting/convertDateAndTimestampValueFormattingRule.ts","../../src/valueFormatting/convertKnownTypeValueFormattingRule.ts","../../src/valueFormatting/convertNumberValueFormattingRule.ts","../../src/wirePropertyFormattingToSdkFormatting.ts","../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/getEditedEntities.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts","../../src/wireActionTypeV2ToSdkActionMetadata.ts","../../src/isNullableQueryDataType.ts","../../src/wireQueryDataTypeToQueryDataTypeDefinition.ts","../../src/wireQueryTypeV2ToSdkQueryMetadata.ts"],"names":[],"mappings":";;;AAgBO,SAAS,6BAA6B,cAAgB,EAAA;AAC3D,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,SAAA;AAAA,IACN,aAAa,cAAe,CAAA,WAAA;AAAA,IAC5B,cAAc,cAAe,CAAA;AAAA,GAC/B;AACF;;;ACNO,SAAS,6CAA6C,KAAO,EAAA;AAClE,EAAA,QAAQ,MAAM,IAAM;AAAA,IAClB,KAAK,UAAA;AACH,MAAO,OAAA;AAAA,QACL,IAAM,EAAA,UAAA;AAAA,QACN,OAAO,KAAM,CAAA;AAAA,OACf;AAAA,IACF,KAAK,cAAA;AACH,MAAO,OAAA;AAAA,QACL,IAAM,EAAA,cAAA;AAAA,QACN,iBAAiB,KAAM,CAAA;AAAA,OACzB;AAAA,IACF;AAEE,MAAA,MAAM,IAAI,KAAA,CAAM,CAAoC,iCAAA,EAAA,KAAA,CAAM,IAAI,CAAE,CAAA,CAAA;AAAA;AAEtE;;;ACfO,SAAS,0BAA0B,cAAgB,EAAA;AACxD,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,MAAA,EAAQ,qBAAsB,CAAA,cAAA,CAAe,MAAM;AAAA,GACrD;AACF;AACO,SAAS,+BAA+B,cAAgB,EAAA;AAC7D,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,WAAA;AAAA,IACN,MAAA,EAAQ,qBAAsB,CAAA,cAAA,CAAe,MAAM,CAAA;AAAA,IACnD,eAAA,EAAiB,uBAAwB,CAAA,cAAA,CAAe,eAAe;AAAA,GACzE;AACF;AACA,S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AA;;;ACnKjK,SAAS,kCAAkC,KAAO,EAAA;AACvD,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,UAAA,EAAY,OAAO,WAAY,CAAA,MAAA,CAAO,QAAQ,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 2025 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 convertBooleanFormattingRule(wireFormatting) {\n return {\n type: \"boolean\",\n valueIfTrue: wireFormatting.valueIfTrue,\n valueIfFalse: wireFormatting.valueIfFalse\n };\n}","/*\n * Copyright 2025 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 convertPropertyTypeReferenceOrStringConstant(value) {\n switch (value.type) {\n case \"constant\":\n return {\n type: \"constant\",\n value: value.value\n };\n case \"propertyType\":\n return {\n type: \"propertyType\",\n propertyApiName: value.propertyApiName\n };\n default:\n value;\n throw new Error(`Unknown property reference type: ${value.type}`);\n }\n}","/*\n * Copyright 2025 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 { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\nexport function convertDateFormattingRule(wireFormatting) {\n return {\n type: \"date\",\n format: convertDatetimeFormat(wireFormatting.format)\n };\n}\nexport function convertTimestampFormattingRule(wireFormatting) {\n return {\n type: \"timestamp\",\n format: convertDatetimeFormat(wireFormatting.format),\n displayTimezone: convertDatetimeTimezone(wireFormatting.displayTimezone)\n };\n}\nfunction convertDatetimeFormat(wireFormat) {\n switch (wireFormat.type) {\n case \"stringFormat\":\n return {\n type: \"stringFormat\",\n pattern: wireFormat.pattern\n };\n case \"localizedFormat\":\n return {\n type: \"localizedFormat\",\n format: wireFormat.format\n };\n default:\n wireFormat;\n throw new Error(`Unknown datetime format type: ${wireFormat.type}`);\n }\n}\nfunction convertDatetimeTimezone(wireTimezone) {\n switch (wireTimezone.type) {\n case \"static\":\n return {\n type: \"static\",\n zoneId: convertPropertyTypeReferenceOrStringConstant(wireTimezone.zoneId)\n };\n case \"user\":\n return {\n type: \"user\"\n };\n default:\n wireTimezone;\n throw new Error(`Unknown timezone type: ${wireTimezone.type}`);\n }\n}","/*\n * Copyright 2025 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 convertKnownTypeFormattingRule(wireFormatting) {\n switch (wireFormatting.knownType) {\n case \"ARTIFACT_GID\":\n return {\n type: \"knownType\",\n knownType: \"ARTIFACT_GID\"\n };\n case \"RESOURCE_RID\":\n return {\n type: \"knownType\",\n knownType: \"RESOURCE_RID\"\n };\n case \"USER_OR_GROUP_ID\":\n return {\n type: \"knownType\",\n knownType: \"USER_OR_GROUP_ID\"\n };\n default:\n wireFormatting.knownType;\n return undefined;\n }\n}","/*\n * Copyright 2025 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 { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\nexport function convertNumberFormattingRule(wireFormatting) {\n const numberType = convertNumberFormattingType(wireFormatting.numberType);\n if (!numberType) {\n return undefined;\n }\n return {\n type: \"number\",\n numberType\n };\n}\nfunction convertNumberFormatOptions(wireOptions) {\n return {\n useGrouping: wireOptions.useGrouping,\n convertNegativeToParenthesis: wireOptions.convertNegativeToParenthesis,\n minimumIntegerDigits: wireOptions.minimumIntegerDigits,\n minimumFractionDigits: wireOptions.minimumFractionDigits,\n maximumFractionDigits: wireOptions.maximumFractionDigits,\n minimumSignificantDigits: wireOptions.minimumSignificantDigits,\n maximumSignificantDigits: wireOptions.maximumSignificantDigits,\n notation: wireOptions.notation,\n roundingMode: wireOptions.roundingMode\n };\n}\nfunction convertDurationFormatStyle(formatStyle) {\n switch (formatStyle.type) {\n case \"humanReadable\":\n return {\n type: \"humanReadable\",\n showFullUnits: formatStyle.showFullUnits\n };\n case \"timecode\":\n return {\n type: \"timecode\"\n };\n default:\n formatStyle;\n throw new Error(`Unknown duration format style: ${formatStyle.type}`);\n }\n}\nfunction convertNumberFormattingType(wireNumberType) {\n switch (wireNumberType.type) {\n case \"standard\":\n return {\n type: \"standard\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n case \"fixedValues\":\n return {\n type: \"fixedValues\",\n values: wireNumberType.values\n };\n case \"currency\":\n {\n return {\n type: \"currency\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n style: wireNumberType.style,\n currencyCode: convertPropertyTypeReferenceOrStringConstant(wireNumberType.currencyCode)\n };\n }\n case \"standardUnit\":\n {\n return {\n type: \"standardUnit\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)\n };\n }\n case \"customUnit\":\n {\n return {\n type: \"customUnit\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)\n };\n }\n case \"affix\":\n {\n return {\n type: \"affix\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n affix: {\n prefix: wireNumberType.affix?.prefix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.prefix) : undefined,\n postfix: wireNumberType.affix?.postfix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.postfix) : undefined\n }\n };\n }\n case \"duration\":\n {\n return {\n type: \"duration\",\n formatStyle: convertDurationFormatStyle(wireNumberType.formatStyle),\n precision: wireNumberType.precision,\n baseValue: wireNumberType.baseValue\n };\n }\n case \"scale\":\n {\n return {\n type: \"scale\",\n scaleType: wireNumberType.scaleType,\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n }\n case \"ratio\":\n {\n return {\n type: \"ratio\",\n ratioType: wireNumberType.ratioType,\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n }\n default:\n wireNumberType;\n throw new Error(`Unknown number format type: ${wireNumberType.type}`);\n }\n}","/*\n * Copyright 2025 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 { convertBooleanFormattingRule } from \"./valueFormatting/convertBooleanValueFormattingRule.js\";\nimport { convertDateFormattingRule, convertTimestampFormattingRule } from \"./valueFormatting/convertDateAndTimestampValueFormattingRule.js\";\nimport { convertKnownTypeFormattingRule } from \"./valueFormatting/convertKnownTypeValueFormattingRule.js\";\nimport { convertNumberFormattingRule } from \"./valueFormatting/convertNumberValueFormattingRule.js\";\n\n/**\n * Converts a PropertyValueFormattingRule from the ontologies format to the SDK format\n */\nexport function wirePropertyFormattingToSdkFormatting(wireFormatting, log) {\n try {\n return convertPropertyFormattingInternal(wireFormatting);\n } catch (error) {\n log?.info(`Failed to convert property formatting rule: ${error}`);\n return undefined;\n }\n}\nfunction convertPropertyFormattingInternal(wireFormatting) {\n switch (wireFormatting.type) {\n case \"date\":\n return convertDateFormattingRule(wireFormatting);\n case \"timestamp\":\n return convertTimestampFormattingRule(wireFormatting);\n case \"boolean\":\n return convertBooleanFormattingRule(wireFormatting);\n case \"knownType\":\n return convertKnownTypeFormattingRule(wireFormatting);\n case \"number\":\n return convertNumberFormattingRule(wireFormatting);\n default:\n wireFormatting;\n throw new Error(`Unknown formatting type: ${wireFormatting.type}`);\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 { wirePropertyFormattingToSdkFormatting } from \"./wirePropertyFormattingToSdkFormatting.js\";\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 case \"vector\":\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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined\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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined\n };\n }\n case \"cipherText\":\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 case \"vector\":\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 {\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.allExtendsInterfaces].sort((a, b) => a.localeCompare(b)) : interfaceType.extendsInterfaces ? [...interfaceType.extendsInterfaces].sort((a, b) => a.localeCompare(b)) : undefined,\n properties: Object.fromEntries(Object.entries(\n // prefer V2 if available and non-empty, otherwise fall back to V1\n interfaceType.allPropertiesV2 && Object.keys(interfaceType.allPropertiesV2).length > 0 ? interfaceType.allPropertiesV2 : interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {\n return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];\n }).filter(([_, value]) => value != null)),\n links: Object.fromEntries(Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).map(([linkApiName, linkType]) => [linkApiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetTypeApiName: linkType.linkedEntityApiName.apiName,\n targetType: linkType.linkedEntityApiName.type === \"objectTypeApiName\" ? \"object\" : \"interface\"\n }])),\n implementedBy: interfaceType.implementedByObjectTypes ? [...interfaceType.implementedByObjectTypes].sort((a, b) => a.localeCompare(b)) : 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\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]) => {\n // prefer V2 if available and non-empty\n if (impl.propertiesV2 && Object.keys(impl.propertiesV2).length > 0) {\n const propMap = {};\n for (const [iptApiName, implementation] of Object.entries(impl.propertiesV2)) {\n if (implementation.type === \"localPropertyImplementation\") {\n propMap[iptApiName] = implementation.propertyApiName;\n }\n }\n return [interfaceApiName, propMap];\n }\n // fall back to V1\n return [interfaceApiName, impl.properties];\n })) : {};\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].sort((a, b) => a.apiName.localeCompare(b.apiName)).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(([_, value]) => value != null)),\n implements: objectTypeWithLink.implementsInterfaces ? [...objectTypeWithLink.implementsInterfaces].sort((a, b) => a.localeCompare(b)) : 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: ensureStringEnumSupportedOrUndefined(objectTypeWithLink.objectType.status, supportedReleaseStatus),\n rid: objectTypeWithLink.objectType.rid,\n visibility: ensureStringEnumSupportedOrUndefined(objectTypeWithLink.objectType.visibility, supportedObjectTypeVisibility)\n };\n}\nfunction invertProps(a) {\n return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : undefined;\n}\nexport const supportedIconTypes = [\"blueprint\"];\nexport const supportedReleaseStatus = [\"ACTIVE\", \"EXPERIMENTAL\", \"DEPRECATED\", \"ENDORSED\"];\nexport const supportedObjectTypeVisibility = [\"NORMAL\", \"PROMINENT\", \"HIDDEN\"];\nexport function ensureStringEnumSupportedOrUndefined(value, supportedValues) {\n return value && supportedValues.includes(value) ? value : undefined;\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\";\nimport { ensureStringEnumSupportedOrUndefined, supportedReleaseStatus } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.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: ensureStringEnumSupportedOrUndefined(input.status, supportedReleaseStatus)\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 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 case \"mediaReference\":\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 \"interfaceObject\":\n return {\n type: \"interface\",\n interface: input.interfaceTypeApiName,\n nullable: false\n };\n case \"interfaceObjectSet\":\n return {\n type: \"interfaceObjectSet\",\n objectSet: input.interfaceTypeApiName,\n nullable: false\n };\n case \"array\":\n return {\n array: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n type: \"array\",\n nullable: isNullableQueryDataType(input.subType)\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.type === \"array\") {\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 case \"mediaReference\":\n case \"void\":\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}"]}
@@ -26,6 +26,7 @@ export function wireQueryDataTypeToQueryDataTypeDefinition(input) {
26
26
  case "date":
27
27
  case "string":
28
28
  case "timestamp":
29
+ case "mediaReference":
29
30
  return {
30
31
  type: input.type,
31
32
  nullable: false
@@ -124,6 +125,8 @@ export function wireQueryDataTypeToQueryDataTypeDefinition(input) {
124
125
  };
125
126
  case "null":
126
127
  case "unsupported":
128
+ case "mediaReference":
129
+ case "void":
127
130
  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.`);
128
131
  default:
129
132
  throw new Error(`Unsupported QueryDataType.type ${input.type}`);
@@ -1 +1 @@
1
- {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","interface","interfaceTypeApiName","array","subType","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 case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: input.interfaceTypeApiName as K,\n nullable: false,\n };\n case \"interfaceObjectSet\":\n return {\n type: \"interfaceObjectSet\",\n objectSet: input.interfaceTypeApiName as K,\n nullable: false,\n };\n case \"array\":\n return {\n array: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n type: \"array\",\n nullable: isNullableQueryDataType(input.subType),\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.type === \"array\") {\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,EAAE,WAAW;QACjBI,SAAS,EAAEL,KAAK,CAACI,iBAAsB;QACvCF,QAAQ,EAAE;MACZ,CAAC;IACH,KAAK,iB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B,CAAC9B,KAAK,CAACsC,SAAS;MACvD,CAAC;IACH;IACA,MAAM,IAAIF,KAAK,CACb,qCAAqCpC,KAAK,CAACiC,OAAO,CAAChC,IAAI,cACzD,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA,SAASuC,oBAAoBA,CAC3BC,GAA4B,EACuC;EACnE,OAAOA,GAAG,CAACxC,IAAI,KAAK,QAAQ,IAAIwC,GAAG,CAACxC,IAAI,KAAK,SAAS;AACxD;;AAEA;AACA;AACA;AACA,MAAMiC,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":[]}
1
+ {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","interface","interfaceTypeApiName","array","subType","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 case \"mediaReference\":\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 case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: input.interfaceTypeApiName as K,\n nullable: false,\n };\n case \"interfaceObjectSet\":\n return {\n type: \"interfaceObjectSet\",\n objectSet: input.interfaceTypeApiName as K,\n nullable: false,\n };\n case \"array\":\n return {\n array: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n type: \"array\",\n nullable: isNullableQueryDataType(input.subType),\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.type === \"array\") {\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 case \"mediaReference\":\n case \"void\":\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;IAChB,KAAK,gBAAgB;MACnB,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;MAC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