@osdk/client 2.6.0-beta.7 → 2.6.0-beta.8

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 (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/build/browser/index.js.map +1 -1
  3. package/build/browser/internal/conversions/modernToLegacyWhereClause.js +13 -15
  4. package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  5. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +62 -0
  6. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
  7. package/build/browser/object/mediaUpload.js +1 -1
  8. package/build/browser/object/mediaUpload.js.map +1 -1
  9. package/build/browser/util/UserAgent.js +2 -2
  10. package/build/browser/util/toDataValue.js +3 -2
  11. package/build/browser/util/toDataValue.js.map +1 -1
  12. package/build/browser/util/toDataValue.test.js +1 -1
  13. package/build/browser/util/toDataValue.test.js.map +1 -1
  14. package/build/cjs/{chunk-3LMKH6RS.cjs → chunk-HJV24UL2.cjs} +25 -35
  15. package/build/cjs/chunk-HJV24UL2.cjs.map +1 -0
  16. package/build/cjs/{chunk-4ZOXOCQX.cjs → chunk-PCNVSZXT.cjs} +133 -67
  17. package/build/cjs/chunk-PCNVSZXT.cjs.map +1 -0
  18. package/build/cjs/index.cjs +8 -8
  19. package/build/cjs/index.d.cts +1 -1
  20. package/build/cjs/public/internal.cjs +8 -8
  21. package/build/cjs/public/unstable-do-not-use.cjs +32 -32
  22. package/build/esm/index.js.map +1 -1
  23. package/build/esm/internal/conversions/modernToLegacyWhereClause.js +13 -15
  24. package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  25. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +62 -0
  26. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
  27. package/build/esm/object/mediaUpload.js +1 -1
  28. package/build/esm/object/mediaUpload.js.map +1 -1
  29. package/build/esm/util/UserAgent.js +2 -2
  30. package/build/esm/util/toDataValue.js +3 -2
  31. package/build/esm/util/toDataValue.js.map +1 -1
  32. package/build/esm/util/toDataValue.test.js +1 -1
  33. package/build/esm/util/toDataValue.test.js.map +1 -1
  34. package/build/types/index.d.ts +1 -1
  35. package/build/types/index.d.ts.map +1 -1
  36. package/package.json +10 -9
  37. package/build/cjs/chunk-3LMKH6RS.cjs.map +0 -1
  38. package/build/cjs/chunk-4ZOXOCQX.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @osdk/client
2
2
 
3
+ ## 2.6.0-beta.8
4
+
5
+ ### Minor Changes
6
+
7
+ - a1ffb20: Use new ephemeral media upload endpoint.
8
+ - e62c692: Allow all applicable filters for struct sub properties to be applied on struct arrays
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [a1ffb20]
13
+ - Updated dependencies [e62c692]
14
+ - @osdk/generator-converters@2.6.0-beta.8
15
+ - @osdk/api@2.6.0-beta.8
16
+ - @osdk/client.unstable@2.6.0-beta.8
17
+
3
18
  ## 2.6.0-beta.7
4
19
 
5
20
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isOk","NULL_VALUE","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC","createObjectSpecifierFromPrimaryKey","extractPrimaryKeyFromObjectSpecifier"],"sources":["index.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\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { isOk, NULL_VALUE } from \"@osdk/api\";\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n DerivedProperty,\n InterfaceDefinition,\n InterfaceMetadata,\n Logger,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n\nexport {\n createObjectSpecifierFromPrimaryKey,\n extractPrimaryKeyFromObjectSpecifier,\n} from \"./util/objectSpecifierUtils.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,IAAI,EAAEC,UAAU,QAAQ,WAAW;AAuC5C,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAGrE,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B;AAErC,SACEC,mCAAmC,EACnCC,oCAAoC,QAC/B,gCAAgC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["isOk","NULL_VALUE","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC","createObjectSpecifierFromPrimaryKey","extractPrimaryKeyFromObjectSpecifier"],"sources":["index.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\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { isOk, NULL_VALUE } from \"@osdk/api\";\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n DerivedProperty,\n InterfaceDefinition,\n InterfaceMetadata,\n Logger,\n MediaReference,\n MediaUpload,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n\nexport {\n createObjectSpecifierFromPrimaryKey,\n extractPrimaryKeyFromObjectSpecifier,\n} from \"./util/objectSpecifierUtils.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,IAAI,EAAEC,UAAU,QAAQ,WAAW;AAyC5C,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAGrE,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B;AAErC,SACEC,mCAAmC,EACnCC,oCAAoC,QAC/B,gCAAgC","ignoreList":[]}
@@ -93,6 +93,8 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
93
93
  // e.g. `where({ name: { $eq: "foo", $ne: "bar" } })` is invalid currently
94
94
  const hasDollarSign = keysOfFilter.some(key => key.startsWith("$"));
95
95
  !(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant(false, "A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.") : invariant(false) : void 0;
96
+
97
+ // Struct
96
98
  if (!hasDollarSign) {
97
99
  const structFilter = Object.entries(filter);
98
100
  !(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant(false) : void 0;
@@ -104,6 +106,17 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
104
106
  }
105
107
  const firstKey = keysOfFilter[0];
106
108
  !(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
109
+
110
+ // Struct array
111
+ if (firstKey === "$contains" && filter[firstKey] instanceof Object) {
112
+ const structFilter = Object.entries(filter[firstKey]);
113
+ !(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant(false) : void 0;
114
+ const structFieldApiName = structFilter[0][0];
115
+ return handleWherePair(structFilter[0], objectOrInterface, {
116
+ propertyApiName: fieldName,
117
+ structFieldApiName
118
+ });
119
+ }
107
120
  if (firstKey === "$ne") {
108
121
  return {
109
122
  type: "not",
@@ -134,21 +147,6 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
134
147
  fuzzy: typeof filter[firstKey] === "string" ? false : filter[firstKey]["fuzzySearch"] ?? false
135
148
  };
136
149
  }
137
- if (firstKey === "$contains" && filter[firstKey] instanceof Object) {
138
- const structFilter = Object.entries(filter[firstKey]);
139
- !(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant(false) : void 0;
140
- const structFieldApiName = structFilter[0][0];
141
- !(structFilter[0][1] != null && Object.keys(structFilter[0][1]).length === 1 && "$eq" in structFilter[0][1]) ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot filter on a struct field in an array with anything other than a single $eq") : invariant(false) : void 0;
142
- return {
143
- type: "contains",
144
- propertyIdentifier: {
145
- type: "structField",
146
- propertyApiName: fieldName,
147
- structFieldApiName
148
- },
149
- value: structFilter[0][1]["$eq"]
150
- };
151
- }
152
150
  return {
153
151
  type: firstKey.substring(1),
154
152
  ...(propertyIdentifier != null && {
@@ -1 +1 @@
1
- {"version":3,"file":"modernToLegacyWhereClause.js","names":["invariant","fullyQualifyPropName","makeGeoFilterIntersects","makeGeoFilterWithin","isAndClause","whereClause","$and","undefined","isOrClause","$or","isNotClause","$not","modernToLegacyWhereClause","objectOrInterface","rdpNames","parts","Object","entries","map","key","value","length","modernToLegacyWhereClauseInner","type","v","process","env","NODE_ENV","clause","handleWherePair","fieldName","filter","structFieldSelector","isRdp","has","propertyIdentifier","apiName","propertyApiName","field","keysOfFilter","keys","hasDollarSign","some","startsWith","structFilter","structFieldApiName","firstKey","substring","fuzzy"],"sources":["modernToLegacyWhereClause.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 AndWhereClause,\n NotWhereClause,\n ObjectOrInterfaceDefinition,\n OrWhereClause,\n PossibleWhereClauseFilters,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\n\nimport type {\n PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { fullyQualifyPropName } from \"./fullyQualifyPropName.js\";\nimport { makeGeoFilterIntersects } from \"./makeGeoFilterIntersects.js\";\nimport { makeGeoFilterWithin } from \"./makeGeoFilterWithin.js\";\n\ntype DropDollarSign<T extends `$${string}`> = T extends `$${infer U}` ? U\n : never;\n\nfunction isAndClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is AndWhereClause<T, RDPs> {\n return \"$and\" in whereClause && whereClause.$and !== undefined;\n}\n\nfunction isOrClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is OrWhereClause<T, RDPs> {\n return \"$or\" in whereClause && whereClause.$or !== undefined;\n}\n\nfunction isNotClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is NotWhereClause<T, RDPs> {\n return \"$not\" in whereClause && whereClause.$not !== undefined;\n}\n\n/** @internal */\nexport function modernToLegacyWhereClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause).map(([key, value]) => ({\n [key]: value,\n })) as WhereClause<T, RDPs>[];\n if (parts.length === 1) {\n return modernToLegacyWhereClauseInner(\n whereClause,\n objectOrInterface,\n rdpNames,\n );\n }\n return {\n type: \"and\",\n value: parts.map<SearchJsonQueryV2>(\n v => modernToLegacyWhereClauseInner(v, objectOrInterface, rdpNames),\n ),\n };\n}\n\n/** @internal */\nexport function modernToLegacyWhereClauseInner<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause);\n\n invariant(parts.length === 1, \"Invalid where clause provided.\");\n\n if (isAndClause(whereClause)) {\n return {\n type: \"and\",\n value: (whereClause.$and as WhereClause<T, RDPs>[]).map(\n (clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isOrClause(whereClause)) {\n return {\n type: \"or\",\n value: (whereClause.$or as WhereClause<T, RDPs>[]).map(\n (clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isNotClause(whereClause)) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(\n whereClause.$not as WhereClause<T, RDPs>,\n objectOrInterface,\n rdpNames,\n ),\n };\n }\n\n return handleWherePair(parts[0], objectOrInterface, undefined, rdpNames);\n}\n\nfunction handleWherePair(\n [fieldName, filter]: [string, any],\n objectOrInterface: ObjectOrInterfaceDefinition,\n structFieldSelector?: { propertyApiName: string; structFieldApiName: string },\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n invariant(\n filter != null,\n \"Defined key values are only allowed when they are not undefined.\",\n );\n\n const isRdp = !structFieldSelector && rdpNames?.has(fieldName);\n\n const propertyIdentifier: PropertyIdentifier | undefined = isRdp\n ? {\n type: \"property\",\n apiName: fieldName,\n }\n : structFieldSelector != null\n ? {\n type: \"structField\",\n ...structFieldSelector,\n propertyApiName: fullyQualifyPropName(\n structFieldSelector.propertyApiName,\n objectOrInterface,\n ),\n }\n : undefined;\n\n const field = !isRdp && structFieldSelector == null\n ? fullyQualifyPropName(fieldName, objectOrInterface)\n : undefined;\n\n invariant(\n field == null\n || propertyIdentifier == null && (field != null || isRdp != null),\n \"Encountered error constructing where clause: field and propertyIdentifier cannot both be defined\",\n );\n\n if (\n typeof filter === \"string\" || typeof filter === \"number\"\n || typeof filter === \"boolean\"\n ) {\n return {\n type: \"eq\",\n ...(propertyIdentifier != null\n && { propertyIdentifier }),\n field,\n value: filter,\n };\n }\n\n const keysOfFilter = Object.keys(filter);\n\n // If any of the keys start with `$` then they must be the only one.\n // e.g. `where({ name: { $eq: \"foo\", $ne: \"bar\" } })` is invalid currently\n const hasDollarSign = keysOfFilter.some((key) => key.startsWith(\"$\"));\n invariant(\n !hasDollarSign\n || keysOfFilter.length === 1,\n \"A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.\",\n );\n\n if (!hasDollarSign) {\n const structFilter = Object.entries(filter);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = keysOfFilter[0];\n return handleWherePair(Object.entries(filter)[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n }, rdpNames);\n }\n\n const firstKey = keysOfFilter[0] as PossibleWhereClauseFilters;\n invariant(filter[firstKey] != null);\n\n if (firstKey === \"$ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey],\n },\n };\n }\n\n if (firstKey === \"$within\") {\n return makeGeoFilterWithin(filter[firstKey], propertyIdentifier, field);\n }\n if (firstKey === \"$intersects\") {\n return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);\n }\n\n if (firstKey === \"$containsAllTerms\" || firstKey === \"$containsAnyTerm\") {\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: typeof filter[firstKey] === \"string\"\n ? filter[firstKey]\n : filter[firstKey][\"term\"],\n fuzzy: typeof filter[firstKey] === \"string\"\n ? false\n : filter[firstKey][\"fuzzySearch\"] ?? false,\n };\n }\n\n if (firstKey === \"$contains\" && filter[firstKey] instanceof Object) {\n const structFilter: [string, any][] = Object.entries(filter[firstKey]);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = structFilter[0][0];\n invariant(\n structFilter[0][1] != null\n && Object.keys(structFilter[0][1]).length === 1\n && \"$eq\" in structFilter[0][1],\n \"Cannot filter on a struct field in an array with anything other than a single $eq\",\n );\n return {\n type: \"contains\",\n propertyIdentifier: {\n type: \"structField\",\n propertyApiName: fieldName,\n structFieldApiName,\n },\n value: structFilter[0][1][\"$eq\"],\n };\n }\n\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey] as any,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,uBAAuB,QAAQ,8BAA8B;AACtE,SAASC,mBAAmB,QAAQ,0BAA0B;AAK9D,SAASC,WAAWA,CAIlBC,WAAiC,EACO;EACxC,OAAO,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACC,IAAI,KAAKC,SAAS;AAChE;AAEA,SAASC,UAAUA,CAIjBH,WAAiC,EACM;EACvC,OAAO,KAAK,IAAIA,WAAW,IAAIA,WAAW,CAACI,GAAG,KAAKF,SAAS;AAC9D;AAEA,SAASG,WAAWA,CAIlBL,WAAiC,EACO;EACxC,OAAO,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACM,IAAI,KAAKJ,SAAS;AAChE;;AAEA;AACA,OAAO,SAASK,yBAAyBA,CAIvCP,WAAiC,EACjCQ,iBAAoB,EACpBC,QAAsB,EACH;EACnB,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACZ,WAAW,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,MAAM;IAC/D,CAACD,GAAG,GAAGC;EACT,CAAC,CAAC,CAA2B;EAC7B,IAAIL,KAAK,CAACM,MAAM,KAAK,CAAC,EAAE;IACtB,OAAOC,8BAA8B,CACnCjB,WAAW,EACXQ,iBAAiB,EACjBC,QACF,CAAC;EACH;EACA,OAAO;IACLS,IAAI,EAAE,KAAK;IACXH,KAAK,EAAEL,KAAK,CAACG,GAAG,CACdM,CAAC,IAAIF,8BAA8B,CAACE,CAAC,EAAEX,iBAAiB,EAAEC,QAAQ,CACpE;EACF,CAAC;AACH;;AAEA;AACA,OAAO,SAASQ,8BAA8BA,CAI5CjB,WAAi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BAAkB,EAAE;QAClBZ,IAAI,EAAE,aAAa;QACnBc,eAAe,EAAEP,SAAS;QAC1Be;MACF,CAAC;MACDzB,KAAK,EAAEwB,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;IACjC,CAAC;EACH;EAEA,OAAO;IACLrB,IAAI,EAAEuB,QAAQ,CAACC,SAAS,CAAC,CAAC,CAAoC;IAC9D,IAAIZ,kBAAkB,IAAI,IAAI,IAAI;MAAEA;IAAmB,CAAC,CAAC;IACzDG,KAAK;IACLlB,KAAK,EAAEW,MAAM,CAACe,QAAQ;EACxB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"modernToLegacyWhereClause.js","names":["invariant","fullyQualifyPropName","makeGeoFilterIntersects","makeGeoFilterWithin","isAndClause","whereClause","$and","undefined","isOrClause","$or","isNotClause","$not","modernToLegacyWhereClause","objectOrInterface","rdpNames","parts","Object","entries","map","key","value","length","modernToLegacyWhereClauseInner","type","v","process","env","NODE_ENV","clause","handleWherePair","fieldName","filter","structFieldSelector","isRdp","has","propertyIdentifier","apiName","propertyApiName","field","keysOfFilter","keys","hasDollarSign","some","startsWith","structFilter","structFieldApiName","firstKey","substring","fuzzy"],"sources":["modernToLegacyWhereClause.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 AndWhereClause,\n NotWhereClause,\n ObjectOrInterfaceDefinition,\n OrWhereClause,\n PossibleWhereClauseFilters,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\n\nimport type {\n PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { fullyQualifyPropName } from \"./fullyQualifyPropName.js\";\nimport { makeGeoFilterIntersects } from \"./makeGeoFilterIntersects.js\";\nimport { makeGeoFilterWithin } from \"./makeGeoFilterWithin.js\";\n\ntype DropDollarSign<T extends `$${string}`> = T extends `$${infer U}` ? U\n : never;\n\nfunction isAndClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is AndWhereClause<T, RDPs> {\n return \"$and\" in whereClause && whereClause.$and !== undefined;\n}\n\nfunction isOrClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is OrWhereClause<T, RDPs> {\n return \"$or\" in whereClause && whereClause.$or !== undefined;\n}\n\nfunction isNotClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is NotWhereClause<T, RDPs> {\n return \"$not\" in whereClause && whereClause.$not !== undefined;\n}\n\n/** @internal */\nexport function modernToLegacyWhereClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause).map(([key, value]) => ({\n [key]: value,\n })) as WhereClause<T, RDPs>[];\n if (parts.length === 1) {\n return modernToLegacyWhereClauseInner(\n whereClause,\n objectOrInterface,\n rdpNames,\n );\n }\n return {\n type: \"and\",\n value: parts.map<SearchJsonQueryV2>(\n v => modernToLegacyWhereClauseInner(v, objectOrInterface, rdpNames),\n ),\n };\n}\n\n/** @internal */\nexport function modernToLegacyWhereClauseInner<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause);\n\n invariant(parts.length === 1, \"Invalid where clause provided.\");\n\n if (isAndClause(whereClause)) {\n return {\n type: \"and\",\n value: (whereClause.$and as WhereClause<T, RDPs>[]).map(\n (clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isOrClause(whereClause)) {\n return {\n type: \"or\",\n value: (whereClause.$or as WhereClause<T, RDPs>[]).map(\n (clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isNotClause(whereClause)) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(\n whereClause.$not as WhereClause<T, RDPs>,\n objectOrInterface,\n rdpNames,\n ),\n };\n }\n\n return handleWherePair(parts[0], objectOrInterface, undefined, rdpNames);\n}\n\nfunction handleWherePair(\n [fieldName, filter]: [string, any],\n objectOrInterface: ObjectOrInterfaceDefinition,\n structFieldSelector?: { propertyApiName: string; structFieldApiName: string },\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n invariant(\n filter != null,\n \"Defined key values are only allowed when they are not undefined.\",\n );\n\n const isRdp = !structFieldSelector && rdpNames?.has(fieldName);\n\n const propertyIdentifier: PropertyIdentifier | undefined = isRdp\n ? {\n type: \"property\",\n apiName: fieldName,\n }\n : structFieldSelector != null\n ? {\n type: \"structField\",\n ...structFieldSelector,\n propertyApiName: fullyQualifyPropName(\n structFieldSelector.propertyApiName,\n objectOrInterface,\n ),\n }\n : undefined;\n\n const field = !isRdp && structFieldSelector == null\n ? fullyQualifyPropName(fieldName, objectOrInterface)\n : undefined;\n\n invariant(\n field == null\n || propertyIdentifier == null && (field != null || isRdp != null),\n \"Encountered error constructing where clause: field and propertyIdentifier cannot both be defined\",\n );\n\n if (\n typeof filter === \"string\" || typeof filter === \"number\"\n || typeof filter === \"boolean\"\n ) {\n return {\n type: \"eq\",\n ...(propertyIdentifier != null\n && { propertyIdentifier }),\n field,\n value: filter,\n };\n }\n\n const keysOfFilter = Object.keys(filter);\n\n // If any of the keys start with `$` then they must be the only one.\n // e.g. `where({ name: { $eq: \"foo\", $ne: \"bar\" } })` is invalid currently\n const hasDollarSign = keysOfFilter.some((key) => key.startsWith(\"$\"));\n invariant(\n !hasDollarSign\n || keysOfFilter.length === 1,\n \"A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.\",\n );\n\n // Struct\n if (!hasDollarSign) {\n const structFilter = Object.entries(filter);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = keysOfFilter[0];\n return handleWherePair(Object.entries(filter)[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n }, rdpNames);\n }\n\n const firstKey = keysOfFilter[0] as PossibleWhereClauseFilters;\n invariant(filter[firstKey] != null);\n\n // Struct array\n if (firstKey === \"$contains\" && filter[firstKey] instanceof Object) {\n const structFilter: [string, any][] = Object.entries(filter[firstKey]);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = structFilter[0][0];\n\n return handleWherePair(structFilter[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n });\n }\n\n if (firstKey === \"$ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey],\n },\n };\n }\n\n if (firstKey === \"$within\") {\n return makeGeoFilterWithin(filter[firstKey], propertyIdentifier, field);\n }\n if (firstKey === \"$intersects\") {\n return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);\n }\n\n if (firstKey === \"$containsAllTerms\" || firstKey === \"$containsAnyTerm\") {\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: typeof filter[firstKey] === \"string\"\n ? filter[firstKey]\n : filter[firstKey][\"term\"],\n fuzzy: typeof filter[firstKey] === \"string\"\n ? false\n : filter[firstKey][\"fuzzySearch\"] ?? false,\n };\n }\n\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey] as any,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,uBAAuB,QAAQ,8BAA8B;AACtE,SAASC,mBAAmB,QAAQ,0BAA0B;AAK9D,SAASC,WAAWA,CAIlBC,WAAiC,EACO;EACxC,OAAO,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACC,IAAI,KAAKC,SAAS;AAChE;AAEA,SAASC,UAAUA,CAIjBH,WAAiC,EACM;EACvC,OAAO,KAAK,IAAIA,WAAW,IAAIA,WAAW,CAACI,GAAG,KAAKF,SAAS;AAC9D;AAEA,SAASG,WAAWA,CAIlBL,WAAiC,EACO;EACxC,OAAO,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACM,IAAI,KAAKJ,SAAS;AAChE;;AAEA;AACA,OAAO,SAASK,yBAAyBA,CAIvCP,WAAiC,EACjCQ,iBAAoB,EACpBC,QAAsB,EACH;EACnB,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACZ,WAAW,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,MAAM;IAC/D,CAACD,GAAG,GAAGC;EACT,CAAC,CAAC,CAA2B;EAC7B,IAAIL,KAAK,CAACM,MAAM,KAAK,CAAC,EAAE;IACtB,OAAOC,8BAA8B,CACnCjB,WAAW,EACXQ,iBAAiB,EACjBC,QACF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AEA,OAAO;IACLvB,IAAI,EAAEuB,QAAQ,CAACC,SAAS,CAAC,CAAC,CAAoC;IAC9D,IAAIZ,kBAAkB,IAAI,IAAI,IAAI;MAAEA;IAAmB,CAAC,CAAC;IACzDG,KAAK;IACLlB,KAAK,EAAEW,MAAM,CAACe,QAAQ;EACxB,CAAC;AACH","ignoreList":[]}
@@ -907,6 +907,68 @@ describe(modernToLegacyWhereClause, () => {
907
907
  }
908
908
  `);
909
909
  });
910
+ it("converts struct arrays correctly", () => {
911
+ expect(modernToLegacyWhereClause({
912
+ $and: [{
913
+ addressArray: {
914
+ $contains: {
915
+ zipCode: {
916
+ $gte: 10001
917
+ }
918
+ }
919
+ }
920
+ }, {
921
+ addressArray: {
922
+ $contains: {
923
+ location: {
924
+ $within: [1, 2, 3, 4]
925
+ }
926
+ }
927
+ }
928
+ }]
929
+ }, BgaoNflPlayer)).toMatchInlineSnapshot(`
930
+ {
931
+ "type": "and",
932
+ "value": [
933
+ {
934
+ "field": undefined,
935
+ "propertyIdentifier": {
936
+ "propertyApiName": "addressArray",
937
+ "structFieldApiName": "zipCode",
938
+ "type": "structField",
939
+ },
940
+ "type": "gte",
941
+ "value": 10001,
942
+ },
943
+ {
944
+ "field": undefined,
945
+ "propertyIdentifier": {
946
+ "propertyApiName": "addressArray",
947
+ "structFieldApiName": "location",
948
+ "type": "structField",
949
+ },
950
+ "type": "withinBoundingBox",
951
+ "value": {
952
+ "bottomRight": {
953
+ "coordinates": [
954
+ 3,
955
+ 2,
956
+ ],
957
+ "type": "Point",
958
+ },
959
+ "topLeft": {
960
+ "coordinates": [
961
+ 1,
962
+ 4,
963
+ ],
964
+ "type": "Point",
965
+ },
966
+ },
967
+ },
968
+ ],
969
+ }
970
+ `);
971
+ });
910
972
  });
911
973
  describe("multiple checks", () => {
912
974
  it("properly handles multiple simple where checks", () => {
@@ -1 +1 @@
1
- {"version":3,"file":"modernToLegacyWhereClause.test.js","names":["BgaoNflPlayer","objectTypeWithAllPropertyTypes","expectType","describe","expect","it","modernToLegacyWhereClause","T","type","apiName","__DefinitionMetadata","properties","displayName","links","rid","description","undefined","r","$and","prop","$eq","prop2","innerProp1","toMatchInlineSnapshot","foo","geoPoint","$within","$bbox","$distance","$of","coordinates","$polygon","geoShape","$intersects","integer","$ne","string","$containsAllTerms","term","fuzzySearch","$containsAnyTerm","address","state","city","$or","gamesPlayed","$gt","decimal","result","$not","$in","boolean","mockObjectType","department","status","primaryKeyApiName","titleProperty","primaryKeyType","icon","visibility","pluralDisplayName","interfaceMap","inverseInterfaceMap","rdpNames","Set","reportCount","$gte","managerName"],"sources":["modernToLegacyWhereClause.test.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 { ObjectOrInterfaceDefinition, WhereClause } from \"@osdk/api\";\nimport {\n BgaoNflPlayer,\n objectTypeWithAllPropertyTypes,\n} from \"@osdk/client.test.ontology\";\nimport type { Point } from \"geojson\";\nimport { expectType } from \"ts-expect\";\nimport { describe, expect, it } from \"vitest\";\nimport { modernToLegacyWhereClause } from \"./modernToLegacyWhereClause.js\";\n\ntype ObjAllProps = objectTypeWithAllPropertyTypes;\ntype structObj = BgaoNflPlayer;\ndescribe(modernToLegacyWhereClause, () => {\n describe(\"api namespaces\", () => {\n describe(\"interfaces\", () => {\n it(\"properly converts shortname to fqApiName\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"prop\": { type: \"integer\" },\n \"prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n $and: [\n { prop: { $eq: 5 } },\n { prop2: { innerProp1: { $eq: \"myProp\" } } },\n ],\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"a.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"a.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"properly does not convert when interface has no apiNamespace\", () => {\n const T = {\n type: \"interface\",\n apiName: \"Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n \"c.prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n \"b.prop\": 5,\n foo: 6,\n \"c.prop2\": { innerProp1: { $eq: \"myProp\" } },\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"foo\",\n \"type\": \"eq\",\n \"value\": 6,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"c.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"gracefully handles redundant apiNamespace in property\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n \"c.prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n \"b.prop\": 5,\n \"a.foo\": 6,\n \"c.prop2\": { innerProp1: { $eq: \"myProp\" } },\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"a.foo\",\n \"type\": \"eq\",\n \"value\": 6,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"c.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"properly does not convert different apiNamespaces\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n expect(modernToLegacyWhereClause({\n \"b.prop\": 5,\n }, T)).toMatchInlineSnapshot(`\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n }\n `);\n });\n });\n\n describe(\"objects\", () => {\n it(\"does not convert object short property names to fq\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n const r = modernToLegacyWhereClause({\n prop: 5,\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"field\": \"a.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n }\n `);\n });\n });\n });\n\n describe(\"single checks\", () => {\n describe(\"$within\", () => {\n it(\"properly generates bbox shortcut\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: [-5, 5, -10, 10],\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates bbox long form\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: {\n $bbox: [-5, 5, -10, 10],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates within radius\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $distance: [5, \"km\"], $of: [-5, 5] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinDistanceOf\",\n \"value\": {\n \"center\": {\n \"coordinates\": [\n -5,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"distance\": {\n \"unit\": \"KILOMETERS\",\n \"value\": 5,\n },\n },\n }\n `);\n });\n\n it(\"properly generates within radius of geopoint\", async () => {\n // suppose you loaded an object with a geopoint field\n // and you want to find all objects within 5 km of that point\n const pointAsGeoJsonPoint: Point = {\n type: \"Point\",\n coordinates: [-5, 5],\n };\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $distance: [5, \"km\"], $of: pointAsGeoJsonPoint },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinDistanceOf\",\n \"value\": {\n \"center\": {\n \"coordinates\": [\n -5,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"distance\": {\n \"unit\": \"KILOMETERS\",\n \"value\": 5,\n },\n },\n }\n `);\n });\n\n it(\"properly generates within polygon\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n\n it(\"properly generates within polygon geojson\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n it(\"check types\", async () => {\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: [-5, 5, -10, 10],\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $distance: [2, \"centimeter\"], $of: [2, 2] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $bbox: [-5, 5, -10, 10] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n $bbox: [-5, 5, -10, 10],\n // @ts-expect-error\n $distance: [2, \"centimeter\"],\n // @ts-expect-error\n $of: [2, 2],\n },\n },\n });\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n $polygon: [[[0, 1], [3, 2], [0, 1]]],\n // @ts-expect-error\n $bbox: [2, 2, 2, 2],\n },\n },\n });\n });\n describe(\"$intersects\", () => {\n it(\"properly generates bbox shortcut\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: [-5, 5, -10, 10],\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n it(\"properly generates bbox long form\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: {\n $bbox: [-5, 5, -10, 10],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates intersects polygon\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n\n it(\"properly generates within polygon geojson\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n });\n\n it(\"inverts ne short hand properly\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n integer: { $ne: 5 },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n }\n `);\n });\n it(\"converts $containsAllTerms correctly if using new type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\", fuzzySearch: true } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": true,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\", fuzzySearch: false } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\" } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n });\n\n it(\"converts $containsAllTerms correctly if using old type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: \"test\" },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n });\n it(\"converts $containsAnyTerm correctly if using new type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\", fuzzySearch: true } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": true,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\", fuzzySearch: false } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\" } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n });\n\n it(\"converts $containsAnyTerm correctly if using old type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: \"test\" },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n });\n it(\"converts struct where clauses correctly\", () => {\n expect(modernToLegacyWhereClause<structObj>({\n address: { state: { $eq: \"NJ\" } },\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n }\n `);\n\n expect(modernToLegacyWhereClause<structObj>({\n $and: [\n { address: { state: { $eq: \"NJ\" } } },\n { address: { city: { $containsAnyTerm: \"N\" } } },\n ],\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n },\n {\n \"field\": undefined,\n \"fuzzy\": false,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"city\",\n \"type\": \"structField\",\n },\n \"type\": \"containsAnyTerm\",\n \"value\": \"N\",\n },\n ],\n }\n `);\n\n expect(modernToLegacyWhereClause<structObj>({\n $or: [\n { address: { state: { $eq: \"NJ\" } } },\n { address: { city: { $containsAnyTerm: \"N\" } } },\n { gamesPlayed: { $gt: 5 } },\n ],\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n },\n {\n \"field\": undefined,\n \"fuzzy\": false,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"city\",\n \"type\": \"structField\",\n },\n \"type\": \"containsAnyTerm\",\n \"value\": \"N\",\n },\n {\n \"field\": \"gamesPlayed\",\n \"type\": \"gt\",\n \"value\": 5,\n },\n ],\n }\n `);\n });\n });\n\n describe(\"multiple checks\", () => {\n it(\"properly handles multiple simple where checks\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n decimal: 5,\n integer: 10,\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n\n it(\"properly handles $and\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n $and: [{\n decimal: 5,\n }, {\n integer: 10,\n }],\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n\n it(\"properly handles $or\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n $or: [{\n decimal: 5,\n }, {\n integer: 10,\n }],\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n });\n });\n\n describe(\"mixed $ operators and regular properties\", () => {\n it(\"should handle $not operator with regular properties at top level\", () => {\n const whereClause: WhereClause<ObjAllProps> = {\n integer: { $eq: 5 },\n $not: { string: { $in: [\"a\", \"b\", \"c\"] } },\n };\n\n const result = modernToLegacyWhereClause(\n whereClause,\n objectTypeWithAllPropertyTypes,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": \"string\",\n \"type\": \"in\",\n \"value\": [\n \"a\",\n \"b\",\n \"c\",\n ],\n },\n },\n ],\n }\n `);\n });\n\n it(\"should handle multiple regular properties with $not at top level\", () => {\n const whereClause: WhereClause<ObjAllProps> = {\n integer: 5,\n boolean: true,\n $not: { string: { $eq: \"excluded\" } },\n };\n\n const result = modernToLegacyWhereClause(\n whereClause,\n objectTypeWithAllPropertyTypes,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"boolean\",\n \"type\": \"eq\",\n \"value\": true,\n },\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": \"string\",\n \"type\": \"eq\",\n \"value\": \"excluded\",\n },\n },\n ],\n }\n `);\n });\n });\n\n describe(\"RDP properties\", () => {\n type TestRDPs = {\n reportCount: \"integer\";\n managerName: \"string\";\n };\n\n const mockObjectType = {\n type: \"object\" as const,\n apiName: \"TestObject\",\n __DefinitionMetadata: {\n type: \"object\" as const,\n apiName: \"TestObject\",\n displayName: \"Test Object\",\n description: undefined,\n properties: {\n department: { type: \"string\" as const },\n status: { type: \"string\" as const },\n },\n rid: \"test-rid\",\n primaryKeyApiName: \"id\",\n titleProperty: \"department\",\n links: {},\n primaryKeyType: \"string\" as const,\n icon: undefined,\n visibility: undefined,\n pluralDisplayName: \"Test Objects\",\n status: undefined,\n interfaceMap: {},\n inverseInterfaceMap: {},\n },\n };\n\n it(\"should handle RDP properties at top level\", () => {\n const whereClause: WhereClause<typeof mockObjectType, TestRDPs> = {\n department: \"Engineering\",\n reportCount: { $gte: 5 },\n managerName: \"John\",\n };\n\n const rdpNames = new Set([\"reportCount\", \"managerName\"]);\n\n const result = modernToLegacyWhereClause(\n whereClause,\n mockObjectType,\n rdpNames,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"department\",\n \"type\": \"eq\",\n \"value\": \"Engineering\",\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"reportCount\",\n \"type\": \"property\",\n },\n \"type\": \"gte\",\n \"value\": 5,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"managerName\",\n \"type\": \"property\",\n },\n \"type\": \"eq\",\n \"value\": \"John\",\n },\n ],\n }\n `);\n });\n\n it(\"should handle RDP properties in $and clauses\", () => {\n const whereClause: WhereClause<typeof mockObjectType, TestRDPs> = {\n $and: [\n { department: \"Engineering\" },\n { reportCount: { $gte: 5 } },\n ],\n };\n\n const rdpNames = new Set([\"reportCount\"]);\n\n const result = modernToLegacyWhereClause(\n whereClause,\n mockObjectType,\n rdpNames,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"department\",\n \"type\": \"eq\",\n \"value\": \"Engineering\",\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"reportCount\",\n \"type\": \"property\",\n },\n \"type\": \"gte\",\n \"value\": 5,\n },\n ],\n }\n `);\n });\n\n it(\"should handle complex nested structures with RDP\", () => {\n const whereClause: WhereClause<typeof mockObjectType, TestRDPs> = {\n department: \"Engineering\",\n $and: [\n {\n $or: [\n { status: \"active\" },\n { reportCount: { $gte: 10 } },\n ],\n },\n {\n managerName: { $ne: \"Admin\" },\n },\n ],\n };\n\n const rdpNames = new Set([\"reportCount\", \"managerName\"]);\n\n const result = modernToLegacyWhereClause(\n whereClause,\n mockObjectType,\n rdpNames,\n );\n\n // The actual structure flattens the nested $and differently\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"department\",\n \"type\": \"eq\",\n \"value\": \"Engineering\",\n },\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": \"status\",\n \"type\": \"eq\",\n \"value\": \"active\",\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"reportCount\",\n \"type\": \"property\",\n },\n \"type\": \"gte\",\n \"value\": 10,\n },\n ],\n },\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"managerName\",\n \"type\": \"property\",\n },\n \"type\": \"eq\",\n \"value\": \"Admin\",\n },\n },\n ],\n },\n ],\n }\n `);\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,aAAa,EACbC,8BAA8B,QACzB,4BAA4B;AAEnC,SAASC,UAAU,QAAQ,WAAW;AACtC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,yBAAyB,QAAQ,gCAAgC;AAI1EH,QAAQ,CAACG,yBAAyB,EAAE,MAAM;EACxCH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;IAC/BA,QAAQ,CAAC,YAAY,EAAE,MAAM;MAC3BE,EAAE,CAAC,0CAA0C,EAAE,MAAM;QACnD,MAAME,CAAC,GAAG;UACRC,IAAI,EAAE,WAAW;UACjBC,OAAO,EAAE,OAAO;UA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,CAAC,CAACuB,qBAAqB,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;MACA,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFpB,QAAQ,CAAC,iBAAiB,EAAE,MAAM;MAChCE,EAAE,CAAC,+CAA+C,EAAE,MAAM;QACxDD,MAAM,CAACE,yBAAyB,CAC9B;UACEyC,OAAO,EAAE,CAAC;UACVb,OAAO,EAAE;QACX,CAAC,EACDjC,8BACF,CAAC,CAAC,CAACsB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;MACF,CAAC,CAAC;MAEFlB,EAAE,CAAC,uBAAuB,EAAE,MAAM;QAChCD,MAAM,CAACE,yBAAyB,CAC9B;UACEY,IAAI,EAAE,CAAC;YACL6B,OAAO,EAAE;UACX,CAAC,EAAE;YACDb,OAAO,EAAE;UACX,CAAC;QACH,CAAC,EACDjC,8BACF,CAAC,CAAC,CAACsB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;MACJ,CAAC,CAAC;MAEFlB,EAAE,CAAC,sBAAsB,EAAE,MAAM;QAC/BD,MAAM,CAACE,yBAAyB,CAC9B;UACEsC,GAAG,EAAE,CAAC;YACJG,OAAO,EAAE;UACX,CAAC,EAAE;YACDb,OAAO,EAAE;UACX,CAAC;QACH,CAAC,EACDjC,8BACF,CAAC,CAAC,CAACsB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,CAAC;MACN,CAAC,CAAC;IACJ,CAAC,CA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AEY,WAAW,EAAE;YAAEC,IAAI,EAAE;UAAE;QAAE,CAAC;MAEhC,CAAC,EAMCd,cAAc,EACdW,QACF,CAAC;MAED3D,MAAM,CAAC4C,MAAM,CAAC,CAACzB,qBAAqB,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;IAEFlB,EAAE,CAAC,kDAAkD,EAAE,MAAM;MAgB3D,MAAM0D,QAAQ,GAAG,IAAIC,GAAG,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;MAExD,MAAMhB,MAAM,GAAG1C,yBAAyB,CAjB0B;QAChE+C,UAAU,EAAE,aAAa;QACzBnC,IAAI,EAAE,CACJ;UACE0B,GAAG,EAAE,CACH;YAAEU,MAAM,EAAE;UAAS,CAAC,EACpB;YAAEW,WAAW,EAAE;cAAEC,IAAI,EAAE;YAAG;UAAE,CAAC;QAEjC,CAAC,EACD;UACEC,WAAW,EAAE;YAAEhC,GAAG,EAAE;UAAQ;QAC9B,CAAC;MAEL,CAAC,EAMCiB,cAAc,EACdW,QACF,CAAC;;MAED;MACA3D,MAAM,CAAC4C,MAAM,CAAC,CAACzB,qBAAqB,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modernToLegacyWhereClause.test.js","names":["BgaoNflPlayer","objectTypeWithAllPropertyTypes","expectType","describe","expect","it","modernToLegacyWhereClause","T","type","apiName","__DefinitionMetadata","properties","displayName","links","rid","description","undefined","r","$and","prop","$eq","prop2","innerProp1","toMatchInlineSnapshot","foo","geoPoint","$within","$bbox","$distance","$of","coordinates","$polygon","geoShape","$intersects","integer","$ne","string","$containsAllTerms","term","fuzzySearch","$containsAnyTerm","address","state","city","$or","gamesPlayed","$gt","addressArray","$contains","zipCode","$gte","location","decimal","result","$not","$in","boolean","mockObjectType","department","status","primaryKeyApiName","titleProperty","primaryKeyType","icon","visibility","pluralDisplayName","interfaceMap","inverseInterfaceMap","rdpNames","Set","reportCount","managerName"],"sources":["modernToLegacyWhereClause.test.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 { ObjectOrInterfaceDefinition, WhereClause } from \"@osdk/api\";\nimport {\n BgaoNflPlayer,\n objectTypeWithAllPropertyTypes,\n} from \"@osdk/client.test.ontology\";\nimport type { Point } from \"geojson\";\nimport { expectType } from \"ts-expect\";\nimport { describe, expect, it } from \"vitest\";\nimport { modernToLegacyWhereClause } from \"./modernToLegacyWhereClause.js\";\n\ntype ObjAllProps = objectTypeWithAllPropertyTypes;\ntype structObj = BgaoNflPlayer;\ndescribe(modernToLegacyWhereClause, () => {\n describe(\"api namespaces\", () => {\n describe(\"interfaces\", () => {\n it(\"properly converts shortname to fqApiName\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"prop\": { type: \"integer\" },\n \"prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n $and: [\n { prop: { $eq: 5 } },\n { prop2: { innerProp1: { $eq: \"myProp\" } } },\n ],\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"a.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"a.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"properly does not convert when interface has no apiNamespace\", () => {\n const T = {\n type: \"interface\",\n apiName: \"Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n \"c.prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n \"b.prop\": 5,\n foo: 6,\n \"c.prop2\": { innerProp1: { $eq: \"myProp\" } },\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"foo\",\n \"type\": \"eq\",\n \"value\": 6,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"c.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"gracefully handles redundant apiNamespace in property\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n \"c.prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n \"b.prop\": 5,\n \"a.foo\": 6,\n \"c.prop2\": { innerProp1: { $eq: \"myProp\" } },\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"a.foo\",\n \"type\": \"eq\",\n \"value\": 6,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"c.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"properly does not convert different apiNamespaces\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n expect(modernToLegacyWhereClause({\n \"b.prop\": 5,\n }, T)).toMatchInlineSnapshot(`\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n }\n `);\n });\n });\n\n describe(\"objects\", () => {\n it(\"does not convert object short property names to fq\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n const r = modernToLegacyWhereClause({\n prop: 5,\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"field\": \"a.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n }\n `);\n });\n });\n });\n\n describe(\"single checks\", () => {\n describe(\"$within\", () => {\n it(\"properly generates bbox shortcut\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: [-5, 5, -10, 10],\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates bbox long form\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: {\n $bbox: [-5, 5, -10, 10],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates within radius\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $distance: [5, \"km\"], $of: [-5, 5] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinDistanceOf\",\n \"value\": {\n \"center\": {\n \"coordinates\": [\n -5,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"distance\": {\n \"unit\": \"KILOMETERS\",\n \"value\": 5,\n },\n },\n }\n `);\n });\n\n it(\"properly generates within radius of geopoint\", async () => {\n // suppose you loaded an object with a geopoint field\n // and you want to find all objects within 5 km of that point\n const pointAsGeoJsonPoint: Point = {\n type: \"Point\",\n coordinates: [-5, 5],\n };\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $distance: [5, \"km\"], $of: pointAsGeoJsonPoint },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinDistanceOf\",\n \"value\": {\n \"center\": {\n \"coordinates\": [\n -5,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"distance\": {\n \"unit\": \"KILOMETERS\",\n \"value\": 5,\n },\n },\n }\n `);\n });\n\n it(\"properly generates within polygon\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n\n it(\"properly generates within polygon geojson\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n it(\"check types\", async () => {\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: [-5, 5, -10, 10],\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $distance: [2, \"centimeter\"], $of: [2, 2] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $bbox: [-5, 5, -10, 10] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n $bbox: [-5, 5, -10, 10],\n // @ts-expect-error\n $distance: [2, \"centimeter\"],\n // @ts-expect-error\n $of: [2, 2],\n },\n },\n });\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n $polygon: [[[0, 1], [3, 2], [0, 1]]],\n // @ts-expect-error\n $bbox: [2, 2, 2, 2],\n },\n },\n });\n });\n describe(\"$intersects\", () => {\n it(\"properly generates bbox shortcut\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: [-5, 5, -10, 10],\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n it(\"properly generates bbox long form\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: {\n $bbox: [-5, 5, -10, 10],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates intersects polygon\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n\n it(\"properly generates within polygon geojson\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n });\n\n it(\"inverts ne short hand properly\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n integer: { $ne: 5 },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n }\n `);\n });\n it(\"converts $containsAllTerms correctly if using new type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\", fuzzySearch: true } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": true,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\", fuzzySearch: false } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\" } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n });\n\n it(\"converts $containsAllTerms correctly if using old type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: \"test\" },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n });\n it(\"converts $containsAnyTerm correctly if using new type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\", fuzzySearch: true } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": true,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\", fuzzySearch: false } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\" } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n });\n\n it(\"converts $containsAnyTerm correctly if using old type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: \"test\" },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n });\n it(\"converts struct where clauses correctly\", () => {\n expect(modernToLegacyWhereClause<structObj>({\n address: { state: { $eq: \"NJ\" } },\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n }\n `);\n\n expect(modernToLegacyWhereClause<structObj>({\n $and: [\n { address: { state: { $eq: \"NJ\" } } },\n { address: { city: { $containsAnyTerm: \"N\" } } },\n ],\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n },\n {\n \"field\": undefined,\n \"fuzzy\": false,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"city\",\n \"type\": \"structField\",\n },\n \"type\": \"containsAnyTerm\",\n \"value\": \"N\",\n },\n ],\n }\n `);\n\n expect(modernToLegacyWhereClause<structObj>({\n $or: [\n { address: { state: { $eq: \"NJ\" } } },\n { address: { city: { $containsAnyTerm: \"N\" } } },\n { gamesPlayed: { $gt: 5 } },\n ],\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n },\n {\n \"field\": undefined,\n \"fuzzy\": false,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"city\",\n \"type\": \"structField\",\n },\n \"type\": \"containsAnyTerm\",\n \"value\": \"N\",\n },\n {\n \"field\": \"gamesPlayed\",\n \"type\": \"gt\",\n \"value\": 5,\n },\n ],\n }\n `);\n });\n it(\"converts struct arrays correctly\", () => {\n expect(\n modernToLegacyWhereClause<structObj>({\n $and: [{\n addressArray: { $contains: { zipCode: { $gte: 10001 } } },\n }, {\n addressArray: {\n $contains: {\n location: {\n $within: [1, 2, 3, 4],\n },\n },\n },\n }],\n }, BgaoNflPlayer),\n )\n .toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"addressArray\",\n \"structFieldApiName\": \"zipCode\",\n \"type\": \"structField\",\n },\n \"type\": \"gte\",\n \"value\": 10001,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"addressArray\",\n \"structFieldApiName\": \"location\",\n \"type\": \"structField\",\n },\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n 3,\n 2,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n 1,\n 4,\n ],\n \"type\": \"Point\",\n },\n },\n },\n ],\n }\n `);\n });\n });\n\n describe(\"multiple checks\", () => {\n it(\"properly handles multiple simple where checks\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n decimal: 5,\n integer: 10,\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n\n it(\"properly handles $and\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n $and: [{\n decimal: 5,\n }, {\n integer: 10,\n }],\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n\n it(\"properly handles $or\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n $or: [{\n decimal: 5,\n }, {\n integer: 10,\n }],\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n });\n });\n\n describe(\"mixed $ operators and regular properties\", () => {\n it(\"should handle $not operator with regular properties at top level\", () => {\n const whereClause: WhereClause<ObjAllProps> = {\n integer: { $eq: 5 },\n $not: { string: { $in: [\"a\", \"b\", \"c\"] } },\n };\n\n const result = modernToLegacyWhereClause(\n whereClause,\n objectTypeWithAllPropertyTypes,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": \"string\",\n \"type\": \"in\",\n \"value\": [\n \"a\",\n \"b\",\n \"c\",\n ],\n },\n },\n ],\n }\n `);\n });\n\n it(\"should handle multiple regular properties with $not at top level\", () => {\n const whereClause: WhereClause<ObjAllProps> = {\n integer: 5,\n boolean: true,\n $not: { string: { $eq: \"excluded\" } },\n };\n\n const result = modernToLegacyWhereClause(\n whereClause,\n objectTypeWithAllPropertyTypes,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"boolean\",\n \"type\": \"eq\",\n \"value\": true,\n },\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": \"string\",\n \"type\": \"eq\",\n \"value\": \"excluded\",\n },\n },\n ],\n }\n `);\n });\n });\n\n describe(\"RDP properties\", () => {\n type TestRDPs = {\n reportCount: \"integer\";\n managerName: \"string\";\n };\n\n const mockObjectType = {\n type: \"object\" as const,\n apiName: \"TestObject\",\n __DefinitionMetadata: {\n type: \"object\" as const,\n apiName: \"TestObject\",\n displayName: \"Test Object\",\n description: undefined,\n properties: {\n department: { type: \"string\" as const },\n status: { type: \"string\" as const },\n },\n rid: \"test-rid\",\n primaryKeyApiName: \"id\",\n titleProperty: \"department\",\n links: {},\n primaryKeyType: \"string\" as const,\n icon: undefined,\n visibility: undefined,\n pluralDisplayName: \"Test Objects\",\n status: undefined,\n interfaceMap: {},\n inverseInterfaceMap: {},\n },\n };\n\n it(\"should handle RDP properties at top level\", () => {\n const whereClause: WhereClause<typeof mockObjectType, TestRDPs> = {\n department: \"Engineering\",\n reportCount: { $gte: 5 },\n managerName: \"John\",\n };\n\n const rdpNames = new Set([\"reportCount\", \"managerName\"]);\n\n const result = modernToLegacyWhereClause(\n whereClause,\n mockObjectType,\n rdpNames,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"department\",\n \"type\": \"eq\",\n \"value\": \"Engineering\",\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"reportCount\",\n \"type\": \"property\",\n },\n \"type\": \"gte\",\n \"value\": 5,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"managerName\",\n \"type\": \"property\",\n },\n \"type\": \"eq\",\n \"value\": \"John\",\n },\n ],\n }\n `);\n });\n\n it(\"should handle RDP properties in $and clauses\", () => {\n const whereClause: WhereClause<typeof mockObjectType, TestRDPs> = {\n $and: [\n { department: \"Engineering\" },\n { reportCount: { $gte: 5 } },\n ],\n };\n\n const rdpNames = new Set([\"reportCount\"]);\n\n const result = modernToLegacyWhereClause(\n whereClause,\n mockObjectType,\n rdpNames,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"department\",\n \"type\": \"eq\",\n \"value\": \"Engineering\",\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"reportCount\",\n \"type\": \"property\",\n },\n \"type\": \"gte\",\n \"value\": 5,\n },\n ],\n }\n `);\n });\n\n it(\"should handle complex nested structures with RDP\", () => {\n const whereClause: WhereClause<typeof mockObjectType, TestRDPs> = {\n department: \"Engineering\",\n $and: [\n {\n $or: [\n { status: \"active\" },\n { reportCount: { $gte: 10 } },\n ],\n },\n {\n managerName: { $ne: \"Admin\" },\n },\n ],\n };\n\n const rdpNames = new Set([\"reportCount\", \"managerName\"]);\n\n const result = modernToLegacyWhereClause(\n whereClause,\n mockObjectType,\n rdpNames,\n );\n\n // The actual structure flattens the nested $and differently\n expect(result).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"department\",\n \"type\": \"eq\",\n \"value\": \"Engineering\",\n },\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": \"status\",\n \"type\": \"eq\",\n \"value\": \"active\",\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"reportCount\",\n \"type\": \"property\",\n },\n \"type\": \"gte\",\n \"value\": 10,\n },\n ],\n },\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"apiName\": \"managerName\",\n \"type\": \"property\",\n },\n \"type\": \"eq\",\n \"value\": \"Admin\",\n },\n },\n ],\n },\n ],\n }\n `);\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,aAAa,EACbC,8BAA8B,QACzB,4BAA4B;AAEnC,SAASC,UAAU,QAAQ,WAAW;AACtC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,yBAAyB,QAAQ,gCAAgC;AAI1EH,QAAQ,CAACG,yBAAyB,EAAE,MAAM;EACxCH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;IAC/BA,QAAQ,CAAC,YAAY,EAAE,MAAM;MAC3BE,EAAE,CAAC,0CAA0C,EAAE,MAAM;QACnD,MAAME,CAAC,GAAG;UACRC,IAAI,EAAE,WAAW;UACjBC,OAAO,EAAE,OAAO;UAChBC,oBAAoB,EAAE;YACpBF,IAAI,EAAE,WAAW;YACjBG,UAAU,EAAE;cACV,MAAM,EAAE;gBAAEH,IAAI,EAAE;cAAU,CAAC;cAC3B,OAAO,EAAE;gBACPA,IAAI,EAAE;kBAAE,YAAY,EAAE,QAAQ;kBAAE,YAAY,EAAE;gBAAQ;cACxD;YACF,CAAC;YACDC,OAAO,EAAE,OAAO;YAChBG,WAAW,EAAE,EAAE;YACfC,KAAK,EAAE,CAAC,CAAC;YACTC,GAAG,EAAE,EAAE;YACPC,WAAW,EAAEC;UACf;QACF,CAAgD;QAEhD,MAAMC,CAAC,GAAGX,yBAAyB,CAAC;UAClCY,IAAI,EAAE,CACJ;YAAEC,IAAI,EAAE;cAAEC,GAAG,EAAE;YAAE;UAAE,CAAC,EACpB;YAAEC,KAAK,EAAE;cAAEC,UAAU,EAAE;gBAAEF,GAAG,EAAE;cAAS;YAAE;UAAE,CAAC;QAEhD,CAAC,EAAEb,CAAC,C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aAAa,CAClB,CAAC,CACEuB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,CAAC;MACN,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFpB,QAAQ,CAAC,iBAAiB,EAAE,MAAM;MAChCE,EAAE,CAAC,+CAA+C,EAAE,MAAM;QACxDD,MAAM,CAACE,yBAAyB,CAC9B;UACE8C,OAAO,EAAE,CAAC;UACVlB,OAAO,EAAE;QACX,CAAC,EACDjC,8BACF,CAAC,CAAC,CAACsB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;MACF,CAAC,CAAC;MAEFlB,EAAE,CAAC,uBAAuB,EAAE,MAAM;QAChCD,MAAM,CAACE,yBAAyB,CAC9B;UACEY,IAAI,EAAE,CAAC;YACLkC,OAAO,EAAE;UACX,CAAC,EAAE;YACDlB,OAAO,EAAE;UACX,CAAC;QACH,CAAC,EACDjC,8BACF,CAAC,CAAC,CAACsB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;MACJ,CAAC,CAAC;MAEFlB,EAAE,CAAC,sBAAsB,EAAE,MAAM;QAC/BD,MAAM,CAACE,yBAAyB,CAC9B;UACEsC,GAAG,EAAE,CAAC;YACJQ,OAAO,EAAE;UACX,CAAC,EAAE;YACDlB,OAAO,EAAE;UACX,CAAC;QACH,CAAC,EACDjC,8BACF,CAAC,CAAC,CAACsB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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Y,IAAI,EAAE,CACJ;UAAEwC,UAAU,EAAE;QAAc,CAAC,EAC7B;UAAEY,WAAW,EAAE;YAAEpB,IAAI,EAAE;UAAE;QAAE,CAAC;MAEhC,CAAC,EAMCO,cAAc,EACdW,QACF,CAAC;MAEDhE,MAAM,CAACiD,MAAM,CAAC,CAAC9B,qBAAqB,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;IAEFlB,EAAE,CAAC,kDAAkD,EAAE,MAAM;MAgB3D,MAAM+D,QAAQ,GAAG,IAAIC,GAAG,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;MAExD,MAAMhB,MAAM,GAAG/C,yBAAyB,CAjB0B;QAChEoD,UAAU,EAAE,aAAa;QACzBxC,IAAI,EAAE,CACJ;UACE0B,GAAG,EAAE,CACH;YAAEe,MAAM,EAAE;UAAS,CAAC,EACpB;YAAEW,WAAW,EAAE;cAAEpB,IAAI,EAAE;YAAG;UAAE,CAAC;QAEjC,CAAC,EACD;UACEqB,WAAW,EAAE;YAAEpC,GAAG,EAAE;UAAQ;QAC9B,CAAC;MAEL,CAAC,EAMCsB,cAAc,EACdW,QACF,CAAC;;MAED;MACAhE,MAAM,CAACiD,MAAM,CAAC,CAAC9B,qBAAqB,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -18,6 +18,6 @@ export function isMediaReference(o) {
18
18
  return typeof o === `object` && typeof o.mimeType === "string" && "reference" in o && typeof o.reference === "object" && o.reference.type === "mediaSetViewItem" && "mediaSetViewItem" in o.reference && typeof o.reference.mediaSetViewItem === "object" && typeof o.reference.mediaSetViewItem.mediaSetRid === "string" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === "string" && typeof o.reference.mediaSetViewItem.mediaItemRid === "string";
19
19
  }
20
20
  export function isMediaUpload(o) {
21
- return typeof o === "object" && "path" in o && typeof o.path === "string" && "data" in o && typeof o.data === "object" && o.data instanceof Blob;
21
+ return typeof o === "object" && "fileName" in o && typeof o.fileName === "string" && "data" in o && typeof o.data === "object" && o.data instanceof Blob;
22
22
  }
23
23
  //# sourceMappingURL=mediaUpload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mediaUpload.js","names":["isMediaReference","o","mimeType","reference","type","mediaSetViewItem","mediaSetRid","mediaSetViewRid","mediaItemRid","isMediaUpload","path","data","Blob"],"sources":["mediaUpload.ts"],"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\nimport type { MediaReference, MediaUpload } from \"@osdk/api\";\n\nexport function isMediaReference(o: any): o is MediaReference {\n return typeof o === `object`\n && typeof o.mimeType === \"string\"\n && \"reference\" in o\n && typeof o.reference === \"object\"\n && o.reference.type === \"mediaSetViewItem\"\n && \"mediaSetViewItem\" in o.reference\n && typeof o.reference.mediaSetViewItem === \"object\"\n && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\n\nexport function isMediaUpload(o: any): o is MediaUpload {\n return typeof o === \"object\"\n && \"path\" in o\n && typeof o.path === \"string\"\n && \"data\" in o\n && typeof o.data === \"object\"\n && o.data instanceof Blob;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,gBAAgBA,CAACC,CAAM,EAAuB;EAC5D,OAAO,OAAOA,CAAC,KAAK,QAAQ,IACvB,OAAOA,CAAC,CAACC,QAAQ,KAAK,QAAQ,IAC9B,WAAW,IAAID,CAAC,IAChB,OAAOA,CAAC,CAACE,SAAS,KAAK,QAAQ,IAC/BF,CAAC,CAACE,SAAS,CAACC,IAAI,KAAK,kBAAkB,IACvC,kBAAkB,IAAIH,CAAC,CAACE,SAAS,IACjC,OAAOF,CAAC,CAACE,SAAS,CAACE,gBAAgB,KAAK,QAAQ,IAChD,OAAOJ,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACC,WAAW,KAAK,QAAQ,IAC5D,OAAOL,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACE,eAAe,KAAK,QAAQ,IAChE,OAAON,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACG,YAAY,KAAK,QAAQ;AACpE;AAEA,OAAO,SAASC,aAAaA,CAACR,CAAM,EAAoB;EACtD,OAAO,OAAOA,CAAC,KAAK,QAAQ,IACvB,MAAM,IAAIA,CAAC,IACX,OAAOA,CAAC,CAACS,IAAI,KAAK,QAAQ,IAC1B,MAAM,IAAIT,CAAC,IACX,OAAOA,CAAC,CAACU,IAAI,KAAK,QAAQ,IAC1BV,CAAC,CAACU,IAAI,YAAYC,IAAI;AAC7B","ignoreList":[]}
1
+ {"version":3,"file":"mediaUpload.js","names":["isMediaReference","o","mimeType","reference","type","mediaSetViewItem","mediaSetRid","mediaSetViewRid","mediaItemRid","isMediaUpload","fileName","data","Blob"],"sources":["mediaUpload.ts"],"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\nimport type { MediaReference, MediaUpload } from \"@osdk/api\";\n\nexport function isMediaReference(o: any): o is MediaReference {\n return typeof o === `object`\n && typeof o.mimeType === \"string\"\n && \"reference\" in o\n && typeof o.reference === \"object\"\n && o.reference.type === \"mediaSetViewItem\"\n && \"mediaSetViewItem\" in o.reference\n && typeof o.reference.mediaSetViewItem === \"object\"\n && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\n\nexport function isMediaUpload(o: any): o is MediaUpload {\n return typeof o === \"object\"\n && \"fileName\" in o\n && typeof o.fileName === \"string\"\n && \"data\" in o\n && typeof o.data === \"object\"\n && o.data instanceof Blob;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,gBAAgBA,CAACC,CAAM,EAAuB;EAC5D,OAAO,OAAOA,CAAC,KAAK,QAAQ,IACvB,OAAOA,CAAC,CAACC,QAAQ,KAAK,QAAQ,IAC9B,WAAW,IAAID,CAAC,IAChB,OAAOA,CAAC,CAACE,SAAS,KAAK,QAAQ,IAC/BF,CAAC,CAACE,SAAS,CAACC,IAAI,KAAK,kBAAkB,IACvC,kBAAkB,IAAIH,CAAC,CAACE,SAAS,IACjC,OAAOF,CAAC,CAACE,SAAS,CAACE,gBAAgB,KAAK,QAAQ,IAChD,OAAOJ,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACC,WAAW,KAAK,QAAQ,IAC5D,OAAOL,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACE,eAAe,KAAK,QAAQ,IAChE,OAAON,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACG,YAAY,KAAK,QAAQ;AACpE;AAEA,OAAO,SAASC,aAAaA,CAACR,CAAM,EAAoB;EACtD,OAAO,OAAOA,CAAC,KAAK,QAAQ,IACvB,UAAU,IAAIA,CAAC,IACf,OAAOA,CAAC,CAACS,QAAQ,KAAK,QAAQ,IAC9B,MAAM,IAAIT,CAAC,IACX,OAAOA,CAAC,CAACU,IAAI,KAAK,QAAQ,IAC1BV,CAAC,CAACU,IAAI,YAAYC,IAAI;AAC7B","ignoreList":[]}
@@ -14,6 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export const USER_AGENT = `osdk-client/${"2.6.0-beta.7"}`;
18
- export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.6.0-beta.7"}`;
17
+ export const USER_AGENT = `osdk-client/${"2.6.0-beta.8"}`;
18
+ export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.6.0-beta.8"}`;
19
19
  //# sourceMappingURL=UserAgent.js.map
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import { NULL_VALUE } from "@osdk/api";
18
+ import { MediaSets } from "@osdk/foundry.mediasets";
18
19
  import * as OntologiesV2 from "@osdk/foundry.ontologies";
19
20
  import { isAttachmentFile, isAttachmentUpload } from "../object/AttachmentUpload.js";
20
21
  import { isMediaReference, isMediaUpload } from "../object/mediaUpload.js";
@@ -73,8 +74,8 @@ export async function toDataValue(value, client, actionMetadata) {
73
74
  // new media item upload interface, very similar to how attachments work above
74
75
 
75
76
  if (isMediaUpload(value)) {
76
- const mediaRef = await OntologiesV2.MediaReferenceProperties.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
77
- mediaItemPath: value.path,
77
+ const mediaRef = await MediaSets.uploadMedia(client, value.data, {
78
+ filename: value.fileName,
78
79
  preview: true
79
80
  });
80
81
  return await toDataValue(mediaRef, client, actionMetadata);