@osdk/generator-converters 2.0.5 → 2.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,66 +1,31 @@
1
1
  # @osdk/generator-converters
2
2
 
3
- ## 2.0.5
3
+ ## 2.1.0-beta.1
4
4
 
5
- ### Patch Changes
6
-
7
- - Updated dependencies [ca78964]
8
- - @osdk/api@2.0.5
9
-
10
- ## 2.0.4
11
-
12
- ### Patch Changes
13
-
14
- - Updated dependencies [7f29753]
15
- - @osdk/api@2.0.4
16
-
17
- ## 2.0.3
18
-
19
- ### Patch Changes
20
-
21
- - @osdk/api@2.0.3
22
-
23
- ## 2.0.2
24
-
25
- ### Patch Changes
26
-
27
- - 51354c5: Locks dependency version of 3 internal libraries
28
- - Updated dependencies [1edf95b]
29
- - Updated dependencies [4c5e0ae]
30
- - @osdk/api@2.0.2
31
-
32
- ## 2.0.2-rc.3
33
-
34
- ### Patch Changes
35
-
36
- - Updated dependencies [4c5e0ae]
37
- - @osdk/api@2.0.2-rc.3
38
-
39
- ## 2.0.2-beta.2
40
-
41
- ### Patch Changes
42
-
43
- - 51354c5: Locks dependency version of 3 internal libraries
44
- - @osdk/api@2.0.2-beta.2
5
+ ### Minor Changes
45
6
 
46
- ## 2.0.2-beta.1
7
+ - 1812118: Add geotime support for OSDK.
47
8
 
48
9
  ### Patch Changes
49
10
 
50
- - @osdk/api@2.0.2-beta.1
11
+ - Updated dependencies [1812118]
12
+ - Updated dependencies [72c1905]
13
+ - Updated dependencies [6c60414]
14
+ - Updated dependencies [8e6a5f4]
15
+ - @osdk/api@2.1.0-beta.1
51
16
 
52
- ## 2.0.2-rc.0
17
+ ## 2.1.0-beta.0
53
18
 
54
- ### Patch Changes
55
-
56
- - @osdk/api@2.0.2-rc.0
19
+ ### Minor Changes
57
20
 
58
- ## 2.0.1
21
+ - c682504: Locks dependency version of 3 internal libraries
59
22
 
60
23
  ### Patch Changes
61
24
 
62
- - @osdk/internal.foundry.core@0.2.1
63
- - @osdk/api@2.0.1
25
+ - Updated dependencies [0dc40b0]
26
+ - Updated dependencies [03e1941]
27
+ - Updated dependencies [e548b9b]
28
+ - @osdk/api@2.1.0-beta.0
64
29
 
65
30
  ## 2.0.0
66
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"wirePropertyV2ToSdkPropertyDefinition.d.ts","sourceRoot":"","sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EAEV,UAAU,EACV,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,CAAC,UAAU,GAAG,kBAAkB,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EACjE,UAAU,GAAE,OAAc,GACzB,cAAc,CAAC,QAAQ,CA6CzB"}
1
+ {"version":3,"file":"wirePropertyV2ToSdkPropertyDefinition.d.ts","sourceRoot":"","sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EAEV,UAAU,EACV,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,CAAC,UAAU,GAAG,kBAAkB,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EACjE,UAAU,GAAE,OAAc,GACzB,cAAc,CAAC,QAAQ,CA0CzB"}
@@ -31,6 +31,7 @@ export function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true)
31
31
  case "timestamp":
32
32
  case "timeseries":
33
33
  case "marking":
34
+ case "geotimeSeriesReference":
34
35
  return {
35
36
  displayName: input.displayName,
36
37
  multiplicity: false,
@@ -48,8 +49,6 @@ export function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true)
48
49
  nullable: true
49
50
  };
50
51
  }
51
- case "geotimeSeriesReference":
52
- throw new Error(`Unsupported data type ${JSON.stringify(input.dataType)}`);
53
52
  default:
54
53
  input.dataType;
55
54
  throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);
@@ -71,6 +70,7 @@ function objectPropertyTypeToSdkPropertyDefinition(propertyType) {
71
70
  case "geoshape":
72
71
  case "timestamp":
73
72
  case "marking":
73
+ case "geotimeSeriesReference":
74
74
  return propertyType.type;
75
75
  case "date":
76
76
  return "datetime";
@@ -81,8 +81,6 @@ function objectPropertyTypeToSdkPropertyDefinition(propertyType) {
81
81
  return "stringTimeseries";
82
82
  }
83
83
  return "numericTimeseries";
84
- case "geotimeSeriesReference":
85
- throw new Error(`Unsupported data type ${JSON.stringify(propertyType)}`);
86
84
  default:
87
85
  throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);
88
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wirePropertyV2ToSdkPropertyDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","input","isNullable","dataType","type","displayName","multiplicity","description","objectPropertyTypeToSdkPropertyDefinition","nullable","Error","JSON","stringify","propertyType","subType","itemType"],"sources":["wirePropertyV2ToSdkPropertyDefinition.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true) {\n switch (input.dataType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"date\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: input.nullable == null ? isNullable : input.nullable,\n };\n case \"array\": {\n return {\n displayName: input.displayName,\n multiplicity: true,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: true,\n };\n }\n case \"geotimeSeriesReference\":\n throw new Error(`Unsupported data type ${JSON.stringify(input.dataType)}`);\n default:\n const _ = input.dataType;\n throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType) {\n switch (propertyType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"marking\":\n return propertyType.type;\n case \"date\":\n return \"datetime\";\n case \"array\":\n return objectPropertyTypeToSdkPropertyDefinition(propertyType.subType);\n case \"timeseries\":\n if (propertyType.itemType.type === \"string\") {\n return \"stringTimeseries\";\n }\n return \"numericTimeseries\";\n case \"geotimeSeriesReference\":\n throw new Error(`Unsupported data type ${JSON.stringify(propertyType)}`);\n default:\n const _ = propertyType;\n throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,qCAAqCA,CAACC,KAAK,EAAEC,UAAU,GAAG,IAAI,EAAE;EAC5E,QAAQD,KAAK,CAACE,QAAQ,CAACC,IAAI;IACvB,KAAK,SAAS;IACd,KAAK,QA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K,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,YAAY;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,WAAW;IAChB,KAAK,SAAS;MACV,OAAOS,YAAY,CAACT,IAAI;IAC5B,KAAK,MAAM;MACP,OAAO,UAAU;IACrB,KAAK,OAAO;MACR,OAAOI,yCAAyC,CAACK,YAAY,CAACC,OAAO,CAAC;IAC1E,KAAK,YAAY;MACb,IAAID,YAAY,CAACE,QAAQ,CAACX,IAAI,KAAK,QAAQ,EAAE;QACzC,OAAO,kBAAkB;MAC7B;MACA,OAAO,mBAAmB;IAC9B,KAAK,wBAAwB;MACzB,MAAM,IAAIM,KAAK,CAAC,yBAAyBC,IAAI,CAACC,SAAS,CAACC,YAAY,CAAC,EAAE,CAAC;IAC5E;MAEI,MAAM,IAAIH,KAAK,CAAC,wBAAwBC,IAAI,CAACC,SAAS,CAACC,YAAY,CAAC,EAAE,CAAC;EAC/E;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"wirePropertyV2ToSdkPropertyDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","input","isNullable","dataType","type","displayName","multiplicity","description","objectPropertyTypeToSdkPropertyDefinition","nullable","Error","JSON","stringify","propertyType","subType","itemType"],"sources":["wirePropertyV2ToSdkPropertyDefinition.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true) {\n switch (input.dataType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"date\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: input.nullable == null ? isNullable : input.nullable,\n };\n case \"array\": {\n return {\n displayName: input.displayName,\n multiplicity: true,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: true,\n };\n }\n default:\n const _ = input.dataType;\n throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType) {\n switch (propertyType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n return propertyType.type;\n case \"date\":\n return \"datetime\";\n case \"array\":\n return objectPropertyTypeToSdkPropertyDefinition(propertyType.subType);\n case \"timeseries\":\n if (propertyType.itemType.type === \"string\") {\n return \"stringTimeseries\";\n }\n return \"numericTimeseries\";\n default:\n const _ = propertyType;\n throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,qCAAqCA,CAACC,KAAK,EAAEC,UAAU,GAAG,IAAI,EAAE;EAC5E,QAAQD,KAAK,CAACE,QAAQ,CAACC,IAAI;IACvB,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,MAAM;IACX,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,MAAM;IACX,KAAK,OA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AK,OAAO;MACR,OAAOI,yCAAyC,CAACK,YAAY,CAACC,OAAO,CAAC;IAC1E,KAAK,YAAY;MACb,IAAID,YAAY,CAACE,QAAQ,CAACX,IAAI,KAAK,QAAQ,EAAE;QACzC,OAAO,kBAAkB;MAC7B;MACA,OAAO,mBAAmB;IAC9B;MAEI,MAAM,IAAIM,KAAK,CAAC,wBAAwBC,IAAI,CAACC,SAAS,CAACC,YAAY,CAAC,EAAE,CAAC;EAC/E;AACJ","ignoreList":[]}
@@ -95,7 +95,7 @@ export function wireQueryDataTypeToQueryDataTypeDefinition(input) {
95
95
  };
96
96
  case "null":
97
97
  case "unsupported":
98
- throw new Error(`Accidentally tried to handle QueryDataType.type ${input.type}`);
98
+ 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.`);
99
99
  default:
100
100
  throw new Error(`Unsupported QueryDataType.type ${input.type}`);
101
101
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","subType","multiplicity","set","allowNulls","unionTypes","length","nonNull","find","t","union","reduce","acc","push","struct","Object","fromEntries","fields","map","f","name","fieldType","twoDimensionalAggregation","get2DQueryAggregationProps","threeDimensionalAggregation","get3DQueryAggregationProps","Error","keyType","keySubtype","valueType","guardInvalidKeyTypes","key"],"sources":["wireQueryDataTypeToQueryDataTypeDefinition.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\nexport function wireQueryDataTypeToQueryDataTypeDefinition(input) {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false,\n };\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName,\n nullable: false,\n };\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName,\n nullable: false,\n };\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true,\n };\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false,\n };\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n // 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 => [\n f.name,\n wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType),\n ])),\n nullable: false,\n };\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false,\n };\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false,\n };\n case \"null\":\n case \"unsupported\":\n throw new Error(`Accidentally tried to handle QueryDataType.type ${input.type}`);\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 }\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 }\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 * 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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuB,QAAQ,8BAA8B;AACtE,OAAO,SAASC,0CAA0CA,CAACC,KAAK,EAAE;EAC9D,QAAQA,KAAK,CAACC,IAAI;IACd,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;MACZ,OAAO;QACHA,IAAI,EAAED,KAAK,CAACC,IAAI;QAChBC,QAAQ,EAAE;MACd,CAAC;IACL,KAAK,QAAQ;MACT,OAAO;QACHD,IAAI,EAAE,QAAQ;QACdE,MAAM,EAAEH,KAAK,CAACI,iBAAiB;QAC/BF,QAAQ,E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cAAc,CAAC;EAC1F;AACJ;AACA,SAAS6B,0BAA0BA,CAAC9B,KAAK,EAAE;EACvC,IAAIA,KAAK,CAACgC,OAAO,CAAC/B,IAAI,KAAK,OAAO,EAAE;IAChC,OAAO;MACH+B,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;MAC3BgC,UAAU,EAAEjC,KAAK,CAACgC,OAAO,CAAC1B,OAAO,CAACL,IAAI;MACtCiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;IACzD,CAAC;EACL,CAAC,MACI;IACD,IAAIC,oBAAoB,CAACnC,KAAK,CAACgC,OAAO,CAAC,EAAE;MACrC,OAAO;QACHA,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;QAC3BiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;MACzD,CAAC;IACL;IACA,MAAM,IAAIH,KAAK,CAAC,qCAAqC/B,KAAK,CAACgC,OAAO,CAAC/B,IAAI,cAAc,CAAC;EAC1F;AACJ;AACA;AACA;AACA;AACA,SAASkC,oBAAoBA,CAACC,GAAG,EAAE;EAC/B,OAAOA,GAAG,CAACnC,IAAI,KAAK,QAAQ,IAAImC,GAAG,CAACnC,IAAI,KAAK,SAAS;AAC1D","ignoreList":[]}
1
+ {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","subType","multiplicity","set","allowNulls","unionTypes","length","nonNull","find","t","union","reduce","acc","push","struct","Object","fromEntries","fields","map","f","name","fieldType","twoDimensionalAggregation","get2DQueryAggregationProps","threeDimensionalAggregation","get3DQueryAggregationProps","Error","keyType","keySubtype","valueType","guardInvalidKeyTypes","key"],"sources":["wireQueryDataTypeToQueryDataTypeDefinition.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\nexport function wireQueryDataTypeToQueryDataTypeDefinition(input) {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false,\n };\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName,\n nullable: false,\n };\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName,\n nullable: false,\n };\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true,\n };\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false,\n };\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n // 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 => [\n f.name,\n wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType),\n ])),\n nullable: false,\n };\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false,\n };\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false,\n };\n case \"null\":\n case \"unsupported\":\n throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);\n default:\n const _ = input;\n throw new Error(`Unsupported QueryDataType.type ${input.type}`);\n }\n}\nfunction get2DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type,\n };\n }\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 }\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 * 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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuB,QAAQ,8BAA8B;AACtE,OAAO,SAASC,0CAA0CA,CAACC,KAAK,EAAE;EAC9D,QAAQA,KAAK,CAACC,IAAI;IACd,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,YAAY;IACjB,K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BAAoB,CAACnC,KAAK,CAACgC,OAAO,CAAC,EAAE;MACrC,OAAO;QACHA,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;QAC3BiC,SAAS,EAAElC,KAAK,CAACkC,SAAS,CAACjC;MAC/B,CAAC;IACL;IACA,MAAM,IAAI8B,KAAK,CAAC,qCAAqC/B,KAAK,CAACgC,OAAO,CAAC/B,IAAI,cAAc,CAAC;EAC1F;AACJ;AACA,SAAS6B,0BAA0BA,CAAC9B,KAAK,EAAE;EACvC,IAAIA,KAAK,CAACgC,OAAO,CAAC/B,IAAI,KAAK,OAAO,EAAE;IAChC,OAAO;MACH+B,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;MAC3BgC,UAAU,EAAEjC,KAAK,CAACgC,OAAO,CAAC1B,OAAO,CAACL,IAAI;MACtCiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;IACzD,CAAC;EACL,CAAC,MACI;IACD,IAAIC,oBAAoB,CAACnC,KAAK,CAACgC,OAAO,CAAC,EAAE;MACrC,OAAO;QACHA,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;QAC3BiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;MACzD,CAAC;IACL;IACA,MAAM,IAAIH,KAAK,CAAC,qCAAqC/B,KAAK,CAACgC,OAAO,CAAC/B,IAAI,cAAc,CAAC;EAC1F;AACJ;AACA;AACA;AACA;AACA,SAASkC,oBAAoBA,CAACC,GAAG,EAAE;EAC/B,OAAOA,GAAG,CAACnC,IAAI,KAAK,QAAQ,IAAImC,GAAG,CAACnC,IAAI,KAAK,SAAS;AAC1D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"wirePropertyV2ToSdkPropertyDefinition.d.ts","sourceRoot":"","sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EAEV,UAAU,EACV,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,CAAC,UAAU,GAAG,kBAAkB,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EACjE,UAAU,GAAE,OAAc,GACzB,cAAc,CAAC,QAAQ,CA6CzB"}
1
+ {"version":3,"file":"wirePropertyV2ToSdkPropertyDefinition.d.ts","sourceRoot":"","sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EAEV,UAAU,EACV,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,CAAC,UAAU,GAAG,kBAAkB,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EACjE,UAAU,GAAE,OAAc,GACzB,cAAc,CAAC,QAAQ,CA0CzB"}
@@ -31,6 +31,7 @@ export function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true)
31
31
  case "timestamp":
32
32
  case "timeseries":
33
33
  case "marking":
34
+ case "geotimeSeriesReference":
34
35
  return {
35
36
  displayName: input.displayName,
36
37
  multiplicity: false,
@@ -48,8 +49,6 @@ export function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true)
48
49
  nullable: true
49
50
  };
50
51
  }
51
- case "geotimeSeriesReference":
52
- throw new Error(`Unsupported data type ${JSON.stringify(input.dataType)}`);
53
52
  default:
54
53
  input.dataType;
55
54
  throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);
@@ -71,6 +70,7 @@ function objectPropertyTypeToSdkPropertyDefinition(propertyType) {
71
70
  case "geoshape":
72
71
  case "timestamp":
73
72
  case "marking":
73
+ case "geotimeSeriesReference":
74
74
  return propertyType.type;
75
75
  case "date":
76
76
  return "datetime";
@@ -81,8 +81,6 @@ function objectPropertyTypeToSdkPropertyDefinition(propertyType) {
81
81
  return "stringTimeseries";
82
82
  }
83
83
  return "numericTimeseries";
84
- case "geotimeSeriesReference":
85
- throw new Error(`Unsupported data type ${JSON.stringify(propertyType)}`);
86
84
  default:
87
85
  throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);
88
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wirePropertyV2ToSdkPropertyDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","input","isNullable","dataType","type","displayName","multiplicity","description","objectPropertyTypeToSdkPropertyDefinition","nullable","Error","JSON","stringify","propertyType","subType","itemType"],"sources":["wirePropertyV2ToSdkPropertyDefinition.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true) {\n switch (input.dataType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"date\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: input.nullable == null ? isNullable : input.nullable,\n };\n case \"array\": {\n return {\n displayName: input.displayName,\n multiplicity: true,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: true,\n };\n }\n case \"geotimeSeriesReference\":\n throw new Error(`Unsupported data type ${JSON.stringify(input.dataType)}`);\n default:\n const _ = input.dataType;\n throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType) {\n switch (propertyType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"marking\":\n return propertyType.type;\n case \"date\":\n return \"datetime\";\n case \"array\":\n return objectPropertyTypeToSdkPropertyDefinition(propertyType.subType);\n case \"timeseries\":\n if (propertyType.itemType.type === \"string\") {\n return \"stringTimeseries\";\n }\n return \"numericTimeseries\";\n case \"geotimeSeriesReference\":\n throw new Error(`Unsupported data type ${JSON.stringify(propertyType)}`);\n default:\n const _ = propertyType;\n throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,qCAAqCA,CAACC,KAAK,EAAEC,UAAU,GAAG,IAAI,EAAE;EAC5E,QAAQD,KAAK,CAACE,QAAQ,CAACC,IAAI;IACvB,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,MAAM;IACX,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,MAAM;IACX,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,YAAY;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,WAAW;IAChB,KAAK,YAAY;IACjB,KAAK,SAAS;MACV,OAAO;QACHC,WAAW,EAAEJ,KAAK,CAACI,WAAW;QAC9BC,YAAY,EAAE,KAAK;QACnBC,WAAW,EAAEN,KAAK,CAACM,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MACA,OAAO,mBAAmB;IAC9B,KAAK,wBAAwB;MACzB,MAAM,IAAIM,KAAK,CAAC,yBAAyBC,IAAI,CAACC,SAAS,CAACC,YAAY,CAAC,EAAE,CAAC;IAC5E;MAEI,MAAM,IAAIH,KAAK,CAAC,wBAAwBC,IAAI,CAACC,SAAS,CAACC,YAAY,CAAC,EAAE,CAAC;EAC/E;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"wirePropertyV2ToSdkPropertyDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","input","isNullable","dataType","type","displayName","multiplicity","description","objectPropertyTypeToSdkPropertyDefinition","nullable","Error","JSON","stringify","propertyType","subType","itemType"],"sources":["wirePropertyV2ToSdkPropertyDefinition.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true) {\n switch (input.dataType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"date\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: input.nullable == null ? isNullable : input.nullable,\n };\n case \"array\": {\n return {\n displayName: input.displayName,\n multiplicity: true,\n description: input.description,\n type: objectPropertyTypeToSdkPropertyDefinition(input.dataType),\n nullable: true,\n };\n }\n default:\n const _ = input.dataType;\n throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType) {\n switch (propertyType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n return propertyType.type;\n case \"date\":\n return \"datetime\";\n case \"array\":\n return objectPropertyTypeToSdkPropertyDefinition(propertyType.subType);\n case \"timeseries\":\n if (propertyType.itemType.type === \"string\") {\n return \"stringTimeseries\";\n }\n return \"numericTimeseries\";\n default:\n const _ = propertyType;\n throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,qCAAqCA,CAACC,KAAK,EAAEC,UAAU,GAAG,IAAI,EAAE;EAC5E,QAAQD,KAAK,CAACE,QAAQ,CAACC,IAAI;IACvB,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,MAAM;IACX,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,MAAM;IACX,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,YAAY;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,WAAW;IAChB,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,wBAAwB;MACzB,OAAO;QACHC,WAAW,EAAEJ,KAAK,CAACI,WAAW;QAC9BC,YAAY,EAAE,KAAK;QACnBC,WAAW,EAAEN,KAAK,CAACM,WAAW;QAC9BH,IAAI,EAAEI,yCAAyC,CAACP,KAAK,CAACE,QAAQ,CAAC;QAC/DM,QAAQ,E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inition(input) {
95
95
  };
96
96
  case "null":
97
97
  case "unsupported":
98
- throw new Error(`Accidentally tried to handle QueryDataType.type ${input.type}`);
98
+ 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.`);
99
99
  default:
100
100
  throw new Error(`Unsupported QueryDataType.type ${input.type}`);
101
101
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","subType","multiplicity","set","allowNulls","unionTypes","length","nonNull","find","t","union","reduce","acc","push","struct","Object","fromEntries","fields","map","f","name","fieldType","twoDimensionalAggregation","get2DQueryAggregationProps","threeDimensionalAggregation","get3DQueryAggregationProps","Error","keyType","keySubtype","valueType","guardInvalidKeyTypes","key"],"sources":["wireQueryDataTypeToQueryDataTypeDefinition.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\nexport function wireQueryDataTypeToQueryDataTypeDefinition(input) {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false,\n };\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName,\n nullable: false,\n };\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName,\n nullable: false,\n };\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true,\n };\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false,\n };\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n // 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 => [\n f.name,\n wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType),\n ])),\n nullable: false,\n };\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false,\n };\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false,\n };\n case \"null\":\n case \"unsupported\":\n throw new Error(`Accidentally tried to handle QueryDataType.type ${input.type}`);\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 }\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 }\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 * 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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuB,QAAQ,8BAA8B;AACtE,OAAO,SAASC,0CAA0CA,CAACC,KAAK,EAAE;EAC9D,QAAQA,KAAK,CAACC,IAAI;IACd,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;MACZ,OAAO;QACHA,IAAI,EAAED,KAAK,CAACC,IAAI;QAChBC,QAAQ,EAAE;MACd,CAAC;IACL,KAAK,QAAQ;MACT,OAAO;QACHD,IAAI,EAAE,QAAQ;QACdE,MAAM,EAAEH,KAAK,CAACI,iBAAiB;QAC/BF,QAAQ,EAAE;MACd,CAAC;IACL,KAAK,WAAW;MACZ,OAAO;QACHD,IAAI,EAAE,WAAW;QACjBI,SAAS,EAAEL,KAAK,CAACI,iBAAiB;QAClCF,QAAQ,EAAE;MACd,CAAC;IACL,KAAK,OAAO;MACR,OAAO;QACH,GAAGH,0CAA0C,CAACC,KAAK,CAACM,OAAO,CAAC;QAC5DC,YAAY,EAAE;MAClB,CAAC;IACL,KAAK,KAAK;MACN,OAAO;QACHN,IAAI,EAAE,KAAK;QACXO,GAAG,EAAET,0CAA0C,CAACC,KAAK,CAACM,OAAO,CA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IACD,IAAIC,oBAAoB,CAACnC,KAAK,CAACgC,OAAO,CAAC,EAAE;MACrC,OAAO;QACHA,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;QAC3BiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;MACzD,CAAC;IACL;IACA,MAAM,IAAIH,KAAK,CAAC,qCAAqC/B,KAAK,CAACgC,OAAO,CAAC/B,IAAI,cAAc,CAAC;EAC1F;AACJ;AACA;AACA;AACA;AACA,SAASkC,oBAAoBA,CAACC,GAAG,EAAE;EAC/B,OAAOA,GAAG,CAACnC,IAAI,KAAK,QAAQ,IAAImC,GAAG,CAACnC,IAAI,KAAK,SAAS;AAC1D","ignoreList":[]}
1
+ {"version":3,"file":"wireQueryDataTypeToQueryDataTypeDefinition.js","names":["isNullableQueryDataType","wireQueryDataTypeToQueryDataTypeDefinition","input","type","nullable","object","objectTypeApiName","objectSet","subType","multiplicity","set","allowNulls","unionTypes","length","nonNull","find","t","union","reduce","acc","push","struct","Object","fromEntries","fields","map","f","name","fieldType","twoDimensionalAggregation","get2DQueryAggregationProps","threeDimensionalAggregation","get3DQueryAggregationProps","Error","keyType","keySubtype","valueType","guardInvalidKeyTypes","key"],"sources":["wireQueryDataTypeToQueryDataTypeDefinition.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\nexport function wireQueryDataTypeToQueryDataTypeDefinition(input) {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false,\n };\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName,\n nullable: false,\n };\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName,\n nullable: false,\n };\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true,\n };\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false,\n };\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n // 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 => [\n f.name,\n wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType),\n ])),\n nullable: false,\n };\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false,\n };\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false,\n };\n case \"null\":\n case \"unsupported\":\n throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);\n default:\n const _ = input;\n throw new Error(`Unsupported QueryDataType.type ${input.type}`);\n }\n}\nfunction get2DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type,\n };\n }\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 }\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 * 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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuB,QAAQ,8BAA8B;AACtE,OAAO,SAASC,0CAA0CA,CAACC,KAAK,EAAE;EAC9D,QAAQA,KAAK,CAACC,IAAI;IACd,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;MACZ,OAAO;QACHA,IAAI,EAAED,KAAK,CAACC,IAAI;QAChBC,QAAQ,EAAE;MACd,CAAC;IACL,KAAK,QAAQ;MACT,OAAO;QACHD,IAAI,EAAE,QAAQ;QACdE,MAAM,EAAEH,KAAK,CAACI,iBAAiB;QAC/BF,QAAQ,EAAE;MACd,CAAC;IACL,KAAK,WAAW;MACZ,OAAO;QACHD,IAAI,EAAE,WAAW;QACjBI,SAAS,EAAEL,KAAK,CAACI,iB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CAAC/B,IAAI,KAAK,OAAO,EAAE;IAChC,OAAO;MACH+B,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;MAC3BgC,UAAU,EAAEjC,KAAK,CAACgC,OAAO,CAAC1B,OAAO,CAACL,IAAI;MACtCiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;IACzD,CAAC;EACL,CAAC,MACI;IACD,IAAIC,oBAAoB,CAACnC,KAAK,CAACgC,OAAO,CAAC,EAAE;MACrC,OAAO;QACHA,OAAO,EAAEhC,KAAK,CAACgC,OAAO,CAAC/B,IAAI;QAC3BiC,SAAS,EAAEN,0BAA0B,CAAC5B,KAAK,CAACkC,SAAS;MACzD,CAAC;IACL;IACA,MAAM,IAAIH,KAAK,CAAC,qCAAqC/B,KAAK,CAACgC,OAAO,CAAC/B,IAAI,cAAc,CAAC;EAC1F;AACJ;AACA;AACA;AACA;AACA,SAASkC,oBAAoBA,CAACC,GAAG,EAAE;EAC/B,OAAOA,GAAG,CAACnC,IAAI,KAAK,QAAQ,IAAImC,GAAG,CAACnC,IAAI,KAAK,SAAS;AAC1D","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/generator-converters",
3
- "version": "2.0.5",
3
+ "version": "2.1.0-beta.1",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -19,13 +19,13 @@
19
19
  }
20
20
  },
21
21
  "dependencies": {
22
- "@osdk/internal.foundry.core": "0.2.1",
23
- "@osdk/api": "~2.0.5"
22
+ "@osdk/internal.foundry.core": "0.3.0-beta.0",
23
+ "@osdk/api": "~2.1.0-beta.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "ts-expect": "^1.3.0",
27
27
  "typescript": "^5.5.4",
28
- "vitest": "^2.0.4",
28
+ "vitest": "^2.1.2",
29
29
  "@osdk/monorepo.api-extractor": "~0.0.0",
30
30
  "@osdk/monorepo.tsconfig": "~0.0.0",
31
31
  "@osdk/monorepo.tsup": "~0.0.0"