@osdk/api 2.3.0-rc.11 → 2.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +40 -6
  2. package/build/browser/actions/Actions.js.map +1 -1
  3. package/build/browser/actions/NullValue.js +18 -0
  4. package/build/browser/actions/NullValue.js.map +1 -0
  5. package/build/browser/derivedProperties/DerivedProperty.js +1 -16
  6. package/build/browser/derivedProperties/DerivedProperty.js.map +1 -1
  7. package/build/browser/derivedProperties/Expressions.js +2 -0
  8. package/build/browser/derivedProperties/Expressions.js.map +1 -0
  9. package/build/browser/index.js +1 -0
  10. package/build/browser/index.js.map +1 -1
  11. package/build/browser/mapping/DataValueMapping.js.map +1 -1
  12. package/build/browser/object/Media.js.map +1 -1
  13. package/build/browser/objectSet/ObjectSet.test.js +205 -4
  14. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  15. package/build/cjs/{ObjectSet-C3Ud9v-e.d.cts → ObjectSet-C67LQ5JX.d.cts} +57 -6
  16. package/build/cjs/index.cjs +4 -0
  17. package/build/cjs/index.cjs.map +1 -1
  18. package/build/cjs/index.d.cts +13 -4
  19. package/build/cjs/public/unstable.d.cts +2 -2
  20. package/build/esm/actions/Actions.js.map +1 -1
  21. package/build/esm/actions/NullValue.js +18 -0
  22. package/build/esm/actions/NullValue.js.map +1 -0
  23. package/build/esm/derivedProperties/DerivedProperty.js +1 -16
  24. package/build/esm/derivedProperties/DerivedProperty.js.map +1 -1
  25. package/build/esm/derivedProperties/Expressions.js +2 -0
  26. package/build/esm/derivedProperties/Expressions.js.map +1 -0
  27. package/build/esm/index.js +1 -0
  28. package/build/esm/index.js.map +1 -1
  29. package/build/esm/mapping/DataValueMapping.js.map +1 -1
  30. package/build/esm/object/Media.js.map +1 -1
  31. package/build/esm/objectSet/ObjectSet.test.js +205 -4
  32. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  33. package/build/types/actions/Actions.d.ts +2 -0
  34. package/build/types/actions/Actions.d.ts.map +1 -1
  35. package/build/types/actions/NullValue.d.ts +3 -0
  36. package/build/types/actions/NullValue.d.ts.map +1 -0
  37. package/build/types/derivedProperties/DerivedProperty.d.ts +32 -6
  38. package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -1
  39. package/build/types/derivedProperties/Expressions.d.ts +53 -0
  40. package/build/types/derivedProperties/Expressions.d.ts.map +1 -0
  41. package/build/types/index.d.ts +2 -1
  42. package/build/types/index.d.ts.map +1 -1
  43. package/build/types/mapping/DataValueMapping.d.ts +2 -2
  44. package/build/types/mapping/DataValueMapping.d.ts.map +1 -1
  45. package/build/types/object/Media.d.ts +7 -0
  46. package/build/types/object/Media.d.ts.map +1 -1
  47. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
  48. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","it","test","vi","createMockObjectSet","fauxObject","fauxResults","fauxObjectSet","$link","peeps","$objectSetInternals","def","data","where","fn","withProperties","fetchPage","Promise","resolve","fetchOne","asyncIter","aggregate","pivotTo","toEqualTypeOf","fetchPageResult","class","$includeAllBaseObjectProperties","asyncIterResult","$select","x","$includeRid","subselect","withA","base","withFamily","withMom","withParents","todo","withAggregations","whereResults","aggTestObjectSet","result","maxHasSameType","minHasSameType","approximateDistinctNumberNoUndefined","exactDistinctNumberNoUndefined","countNumberNoUndefined","sumNumber","avgNumber","branded"],"sources":["ObjectSet.test.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 { describe, expectTypeOf, it, test, vi } from \"vitest\";\n\nimport type {\n NullabilityAdherence,\n ObjectOrInterfaceDefinition,\n ObjectSet as $ObjectSet,\n Osdk,\n PageResult,\n PropertyKeys,\n} from \"../index.js\";\nimport type { DerivedObjectOrInterfaceDefinition } from \"../ontology/ObjectOrInterface.js\";\nimport type { EmployeeApiTest } from \"../test/EmployeeApiTest.js\";\n\nexport function createMockObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n>(): $ObjectSet<Q, never> {\n let fauxObject: Osdk.Instance<Q>,\n fauxResults: any,\n fauxObjectSet: $ObjectSet<Q>;\n\n // eslint-disable-next-line prefer-const\n fauxObject = {\n $link: {\n peeps: {\n $objectSetInternals: {\n def: {},\n },\n },\n },\n } as Osdk.Instance<Q>;\n\n fauxResults = {\n data: [fauxObject],\n };\n\n fauxObjectSet = {\n where: vi.fn(() => {\n return fauxObjectSet;\n }),\n withProperties: vi.fn(() => {\n return fauxObjectSet;\n }),\n fetchPage: vi.fn(() => Promise.resolve(fauxResults)),\n fetchOne: vi.fn(() => fauxObject),\n asyncIter: vi.fn(() => {\n return {};\n }),\n aggregate: vi.fn(() => {\n return {};\n }),\n pivotTo: vi.fn(() => {\n return fauxObjectSet;\n }),\n } as any as $ObjectSet<Q>;\n\n return fauxObjectSet;\n}\n\ndescribe(\"ObjectSet\", () => {\n const fauxObjectSet = createMockObjectSet<EmployeeApiTest>();\n\n describe(\"normal\", () => {\n test(\"select none\", async () => {\n const result = await fauxObjectSet.fetchPage();\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>>\n >();\n\n // Do it again but be explicit about the params to be sure\n // we don't break them\n const result2 = await fauxObjectSet.fetchPage<\n PropertyKeys<EmployeeApiTest>,\n false,\n never,\n NullabilityAdherence.Default,\n false\n >();\n });\n\n test(\"select one\", async () => {\n const result = await fauxObjectSet.fetchPage({ \"$select\": [\"fullName\"] });\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"fullName\">\n >();\n });\n });\n\n describe(\"includeAllBaseObjectProperties\", () => {\n it(\"has the right types if you pass true\", async () => {\n const fetchPageResult = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({ $includeAllBaseObjectProperties: true });\n\n expectTypeOf(fetchPageResult).toEqualTypeOf<\n PageResult<\n Osdk.Instance<EmployeeApiTest, \"$allBaseProperties\">\n >\n >();\n\n const asyncIterResult = fauxObjectSet\n .where({ class: \"idk\" })\n .asyncIter({ $includeAllBaseObjectProperties: true });\n\n expectTypeOf(asyncIterResult).toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<EmployeeApiTest, \"$allBaseProperties\">\n >\n >();\n });\n\n it(\"does not let you pass partial $select and true\", async () => {\n const fetchPageResult = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({\n // @ts-expect-error\n $includeAllBaseObjectProperties: true,\n $select: [\"attachment\"],\n });\n\n const asyncIterResult = fauxObjectSet\n .where({ class: \"idk\" })\n .asyncIter({\n // @ts-expect-error\n $includeAllBaseObjectProperties: true,\n $select: [\"attachment\"],\n });\n });\n\n it(\"does let you pass full select options and false\", async () => {\n const fetchPageResult = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({\n $includeAllBaseObjectProperties: true,\n\n // this select list is intended to represent all properties on `EmployeeApiTest`,\n // so if you get an error here later and you added properties to that object,\n // be sure to add them here too.\n $select: [\n \"attachment\",\n \"class\",\n \"employeeId\",\n \"fullName\",\n \"geopoint\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"mediaReference\",\n \"timeseries\",\n \"dateOfJoining\",\n \"hourlyRate\",\n \"yearsOfExperience\",\n \"rank\",\n \"performanceScore\",\n \"mediaReference\",\n \"lastUpdated\",\n ],\n });\n\n const asyncIterResult = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({\n $includeAllBaseObjectProperties: true,\n\n // this select list is intended to represent all properties on `EmployeeApiTest`,\n // so if you get an error here later and you added properties to that object,\n // be sure to add them here too.\n $select: [\n \"attachment\",\n \"class\",\n \"employeeId\",\n \"fullName\",\n \"geopoint\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"mediaReference\",\n \"timeseries\",\n \"dateOfJoining\",\n \"hourlyRate\",\n \"yearsOfExperience\",\n \"rank\",\n \"performanceScore\",\n \"mediaReference\",\n \"lastUpdated\",\n ],\n });\n });\n });\n\n test(\"includeRid\", async () => {\n const x = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({ $includeRid: true });\n\n expectTypeOf(x).toEqualTypeOf<\n PageResult<\n Osdk.Instance<EmployeeApiTest, \"$rid\">\n >\n >();\n });\n\n test(\"pivotTo\", async () => {\n const noArgs = await fauxObjectSet.pivotTo(\"peeps\").fetchPage({});\n const subselect = await fauxObjectSet.pivotTo(\"peeps\").fetchPage({\n $select: [\"employeeId\", \"class\"],\n });\n\n expectTypeOf(subselect).toEqualTypeOf<\n PageResult<\n Osdk.Instance<EmployeeApiTest, never, \"employeeId\" | \"class\">\n >\n >();\n });\n\n describe(\".withProperties\", () => {\n test(\"single property\", async () => {\n const withA = fauxObjectSet.withProperties({\n \"a\": (base) => {\n return base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\");\n },\n });\n\n const isWithAAssignable: $ObjectSet<EmployeeApiTest, {}> = withA;\n\n expectTypeOf(withA).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n a: \"integer\";\n }>\n >();\n\n const withAResults = await withA.fetchPage();\n\n expectTypeOf<typeof withAResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n a: \"integer\";\n }>\n >();\n\n expectTypeOf<typeof withAResults[\"data\"][0][\"a\"]>()\n .toEqualTypeOf<number>();\n });\n\n it(\"can be sub-selected\", () => {\n const objectWithUndefinedRdp = fauxObjectSet.withProperties({\n \"derivedPropertyName\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:max\"),\n }).fetchOne(3, {\n $select: [\"derivedPropertyName\"],\n });\n });\n\n test(\"multiple properties\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").aggregate(\"dateOfJoining:max\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n expectTypeOf(withFamily).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"datetime\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"dad\"]>()\n .toEqualTypeOf<string | undefined>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"sister\"]>()\n .toEqualTypeOf<string[] | undefined>();\n });\n\n describe(\"called in succession\", () => {\n test(\"independently\", () => {\n const withMom = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n const withParents = withMom.withProperties({\n \"dad\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"fullName:approximateDistinct\"),\n });\n\n expectTypeOf(withParents).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"integer\";\n }>\n >();\n });\n\n test.todo(\"with calculated properties\");\n });\n\n describe(\"nullability\", () => {\n it(\"count, exactDistinct, and approximateDistinct aren't nullable\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\"),\n \"sis\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:approximateDistinct\"),\n });\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"integer\";\n sis: \"integer\";\n }>\n >();\n });\n\n it(\n \"collectToSet, collectToList, selectProperty, and numeric aggregations are nullable\",\n async () => {\n const withAggregations = fauxObjectSet.withProperties({\n \"collectSet\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectSet\"),\n \"collectList\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"min\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:max\"),\n \"max\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:min\"),\n \"sum\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avg\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n \"approximatePercentile\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"employeeId:approximatePercentile\",\n ),\n });\n\n const withAggregationResults = await withAggregations.fetchPage();\n\n expectTypeOf<typeof withAggregationResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n collectSet: \"string\"[] | undefined;\n collectList: \"string\"[] | undefined;\n min: \"double\" | undefined;\n max: \"double\" | undefined;\n sum: \"double\" | undefined;\n avg: \"double\" | undefined;\n approximatePercentile: \"double\" | undefined;\n }\n >\n >();\n },\n );\n });\n\n describe(\"fetch functions return correct Osdk.Instance\", () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n\n it(\"works with .where\", async () => {\n const where = withFamily.where({ \"mom\": 1 });\n const whereResults = await where.fetchPage();\n\n // Checks that if you did an `await where.fetchPage()` that you can then\n // pass/assign it to something explicit.\n const _assignPreviouslyInferredPages: PageResult<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n sister: \"string\"[] | undefined;\n }\n >\n > = whereResults;\n\n // Checks that if you did an `await where.fetchPage()` that you can then\n // pass/assign it to something explicit.\n const _assignPreviouslyInferredInstance: Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n sister: \"string\"[] | undefined;\n }\n > = whereResults.data[0];\n\n const q = whereResults.data[0].$link.peeps.$objectSetInternals.def;\n\n // same as above but with expectTypeOf\n expectTypeOf<typeof where>().toEqualTypeOf<typeof withFamily>();\n expectTypeOf<typeof whereResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n sister: \"string\"[] | undefined;\n }\n >\n >();\n\n // Checks that when you directly assign, it infers correctly.\n // Sometimes an explicit assignment can affect how typescript infers\n // types.\n const shouldBeAssignablePage: PageResult<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n sister: \"string\"[] | undefined;\n }\n >\n > = await where.fetchPage();\n\n const _shouldBeAssignableSingle: Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n sister: \"string\"[] | undefined;\n }\n > = await withFamily.fetchOne(1);\n await withFamily.fetchOne(1);\n });\n\n it(\"works with .async\", () => {\n const asyncIter = withFamily.asyncIter();\n expectTypeOf<typeof asyncIter>().toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n sister: \"string\"[] | undefined;\n }\n >\n >\n >();\n });\n\n it(\"Works with no select\", async () => {\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"Works with selecting all RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\", \"sister\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n });\n\n it(\"Works with selecting some RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n }>\n >();\n });\n\n it(\"Works with selecting all non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\n \"employeeId\",\n \"fullName\",\n \"class\",\n \"attachment\",\n \"geopoint\",\n \"timeseries\",\n \"mediaReference\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"yearsOfExperience\",\n \"rank\",\n \"performanceScore\",\n \"hourlyRate\",\n \"dateOfJoining\",\n \"lastUpdated\",\n ],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {}\n >\n >();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"class\"]>()\n .toEqualTypeOf<\n string | undefined\n >();\n });\n\n it(\"Works with selecting some non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"class\", {}>\n >();\n });\n\n it(\"Works with selecting a mix\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\", \"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n \"class\",\n { mom: \"integer\" }\n >\n >();\n });\n });\n\n it(\"allows extracting the type\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n type ObjectSetType = typeof objectSet;\n\n expectTypeOf<ObjectSetType>().toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n }>\n >();\n\n const objectSet2 = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"Defining the Type\", () => {\n type ObjectSetType = $ObjectSet<\n EmployeeApiTest,\n {\n mom: \"integer\";\n }\n >;\n\n fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"has correct aggregation keys\", () => {\n fauxObjectSet.withProperties({\n \"integer\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"integerNumericAgg\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"string\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"stringDoesNotHaveNumericAgg\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"class:sum\"),\n \"isActive\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"isActive:approximateDistinct\"),\n \"attachment\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"attachment:collectList\"),\n \"geopoint\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"geopoint:collectList\"),\n \"numericTimeseries\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"timeseries:sum\"),\n \"numericTimeseriesExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"timeseries:exactDistinct\"),\n \"mediaReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"mediaReference:avg\"),\n \"mediaReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"mediaReference:exactDistinct\"),\n \"geotimeSeriesReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"geotimeSeriesReference:sum\"),\n \"geotimeSeriesReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"geotimeSeriesReference:exactDistinct\",\n ),\n \"lastUpdated\": (base) => {\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:approximateDistinct\");\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:exactDistinct\");\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:max\");\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:min\");\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:collectList\");\n return base.pivotTo(\"lead\").aggregate(\"lastUpdated:collectSet\");\n },\n \"dateOfJoining\": (base) => {\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:approximateDistinct\");\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:exactDistinct\");\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:max\");\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:min\");\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:collectList\");\n return base.pivotTo(\"lead\").aggregate(\"dateOfJoining:collectSet\");\n },\n });\n });\n\n it(\"has correct aggregation return types\", async () => {\n const aggTestObjectSet = fauxObjectSet.withProperties({\n \"maxHasSameType\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:max\"),\n \"minHasSameType\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:min\"),\n \"approximateDistinctNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:approximateDistinct\"),\n \"exactDistinctNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:exactDistinct\"),\n \"countNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"sumNumber\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avgNumber\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n }).fetchPage();\n\n const result = (await aggTestObjectSet).data[0];\n expectTypeOf((await aggTestObjectSet).data[0]).toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n maxHasSameType: \"datetime\" | undefined;\n minHasSameType: \"datetime\" | undefined;\n avgNumber: \"double\" | undefined;\n approximateDistinctNumberNoUndefined: \"integer\";\n exactDistinctNumberNoUndefined: \"integer\";\n countNumberNoUndefined: \"integer\";\n sumNumber: \"double\" | undefined;\n }>\n >();\n\n expectTypeOf(result.maxHasSameType).toEqualTypeOf<string | undefined>();\n expectTypeOf(result.minHasSameType).toEqualTypeOf<string | undefined>();\n expectTypeOf(result.approximateDistinctNumberNoUndefined).toEqualTypeOf<\n number\n >();\n expectTypeOf(result.exactDistinctNumberNoUndefined).toEqualTypeOf<\n number\n >();\n expectTypeOf(result.countNumberNoUndefined).toEqualTypeOf<number>();\n expectTypeOf(result.sumNumber).toEqualTypeOf<number | undefined>();\n expectTypeOf(result.avgNumber).toEqualTypeOf<number | undefined>();\n });\n\n it(\"Merged object type is equivalent to original\", () => {\n const a = {} as EmployeeApiTest;\n let b = {} as DerivedObjectOrInterfaceDefinition.WithDerivedProperties<\n EmployeeApiTest,\n {}\n >;\n\n b = a; // should be assignable. testing explicitly due to break in 2.2 release.\n\n expectTypeOf<\n EmployeeApiTest\n >().branded.toEqualTypeOf<\n DerivedObjectOrInterfaceDefinition.WithDerivedProperties<\n EmployeeApiTest,\n {}\n >\n >();\n });\n });\n describe(\"aggregate\", () => {\n it(\"has correct aggregation keys\", () => {\n void fauxObjectSet.aggregate({\n \"$select\": {\n \"lastUpdated:max\": \"asc\",\n \"lastUpdated:min\": \"desc\",\n \"lastUpdated:approximateDistinct\": \"asc\",\n \"lastUpdated:exactDistinct\": \"desc\",\n \"dateOfJoining:max\": \"desc\",\n \"dateOfJoining:min\": \"asc\",\n \"dateOfJoining:approximateDistinct\": \"asc\",\n \"dateOfJoining:exactDistinct\": \"desc\",\n },\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,EAAEC,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AAa7D,OAAO,SAASC,mBAAmBA,CAAA,EAET;EACxB,IAAIC,UAA4B,EAC9BC,WAAgB,EAChBC,aAA4B;;EAE9B;EACAF,UAAU,GAAG;IACXG,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,mBAAmB,EAAE;UACnBC,GAAG,EAAE,CAAC;QACR;MACF;IACF;EACF,CAAqB;EAErBL,WAAW,GAAG;IACZM,IAAI,EAAE,CAACP,UAAU;EACnB,CAAC;EAEDE,aAAa,GAAG;IACdM,KAAK,EAAEV,EAAE,CAACW,EAAE,CAAC,MAAM;MACjB,OAAOP,aAAa;IACtB,CAAC,CAAC;IACFQ,cAAc,EAAEZ,EAAE,CAACW,EAAE,CAAC,MAAM;MAC1B,OAAOP,aAAa;IACtB,CAAC,CAAC;IACFS,SAAS,EAAEb,EAAE,CAACW,EAAE,CAAC,MAAMG,OAA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,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","it","test","vi","createMockObjectSet","fauxObject","fauxResults","fauxObjectSet","$link","peeps","$objectSetInternals","def","data","where","fn","withProperties","fetchPage","Promise","resolve","fetchOne","asyncIter","aggregate","pivotTo","toEqualTypeOf","fetchPageResult","class","$includeAllBaseObjectProperties","asyncIterResult","$select","x","$includeRid","subselect","withA","base","selectProperty","withFamily","withMom","withParents","todo","withAggregations","whereResults","aggTestObjectSet","result","maxHasSameType","minHasSameType","approximateDistinctNumberNoUndefined","exactDistinctNumberNoUndefined","countNumberNoUndefined","sumNumber","avgNumber","branded","selectedInteger","add","subtract","multiply","divide","abs","negate","max","min","extractPart","maxAggregation","collectList","plus","intAndLong","intAndDouble","longAndDouble","longAndLong","intAndInt","intLongDoubleChain","shortAndIntReturnsInt","shortAndFloatReturnsDouble","constant","double","intPlusIntReturnsInt","integer","nested","selectedDatetime","dateAndDateReturnDate","datetime","dateAndTimeReturnTime","timestamp"],"sources":["ObjectSet.test.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 { describe, expectTypeOf, it, test, vi } from \"vitest\";\n\nimport type {\n DerivedProperty,\n NullabilityAdherence,\n ObjectOrInterfaceDefinition,\n ObjectSet as $ObjectSet,\n Osdk,\n PageResult,\n PropertyKeys,\n} from \"../index.js\";\nimport type { DerivedObjectOrInterfaceDefinition } from \"../ontology/ObjectOrInterface.js\";\nimport type { EmployeeApiTest } from \"../test/EmployeeApiTest.js\";\n\nexport function createMockObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n>(): $ObjectSet<Q, never> {\n let fauxObject: Osdk.Instance<Q>,\n fauxResults: any,\n fauxObjectSet: $ObjectSet<Q>;\n\n // eslint-disable-next-line prefer-const\n fauxObject = {\n $link: {\n peeps: {\n $objectSetInternals: {\n def: {},\n },\n },\n },\n } as Osdk.Instance<Q>;\n\n fauxResults = {\n data: [fauxObject],\n };\n\n fauxObjectSet = {\n where: vi.fn(() => {\n return fauxObjectSet;\n }),\n withProperties: vi.fn(() => {\n return fauxObjectSet;\n }),\n fetchPage: vi.fn(() => Promise.resolve(fauxResults)),\n fetchOne: vi.fn(() => fauxObject),\n asyncIter: vi.fn(() => {\n return {};\n }),\n aggregate: vi.fn(() => {\n return {};\n }),\n pivotTo: vi.fn(() => {\n return fauxObjectSet;\n }),\n } as any as $ObjectSet<Q>;\n\n return fauxObjectSet;\n}\n\ndescribe(\"ObjectSet\", () => {\n const fauxObjectSet = createMockObjectSet<EmployeeApiTest>();\n\n describe(\"normal\", () => {\n test(\"select none\", async () => {\n const result = await fauxObjectSet.fetchPage();\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>>\n >();\n\n // Do it again but be explicit about the params to be sure\n // we don't break them\n const result2 = await fauxObjectSet.fetchPage<\n PropertyKeys<EmployeeApiTest>,\n false,\n never,\n NullabilityAdherence.Default,\n false\n >();\n });\n\n test(\"select one\", async () => {\n const result = await fauxObjectSet.fetchPage({ \"$select\": [\"fullName\"] });\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"fullName\">\n >();\n });\n });\n\n describe(\"includeAllBaseObjectProperties\", () => {\n it(\"has the right types if you pass true\", async () => {\n const fetchPageResult = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({ $includeAllBaseObjectProperties: true });\n\n expectTypeOf(fetchPageResult).toEqualTypeOf<\n PageResult<\n Osdk.Instance<EmployeeApiTest, \"$allBaseProperties\">\n >\n >();\n\n const asyncIterResult = fauxObjectSet\n .where({ class: \"idk\" })\n .asyncIter({ $includeAllBaseObjectProperties: true });\n\n expectTypeOf(asyncIterResult).toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<EmployeeApiTest, \"$allBaseProperties\">\n >\n >();\n });\n\n it(\"does not let you pass partial $select and true\", async () => {\n const fetchPageResult = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({\n // @ts-expect-error\n $includeAllBaseObjectProperties: true,\n $select: [\"attachment\"],\n });\n\n const asyncIterResult = fauxObjectSet\n .where({ class: \"idk\" })\n .asyncIter({\n // @ts-expect-error\n $includeAllBaseObjectProperties: true,\n $select: [\"attachment\"],\n });\n });\n\n it(\"does let you pass full select options and false\", async () => {\n const fetchPageResult = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({\n $includeAllBaseObjectProperties: true,\n\n // this select list is intended to represent all properties on `EmployeeApiTest`,\n // so if you get an error here later and you added properties to that object,\n // be sure to add them here too.\n $select: [\n \"attachment\",\n \"class\",\n \"employeeId\",\n \"fullName\",\n \"geopoint\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"mediaReference\",\n \"timeseries\",\n \"dateOfJoining\",\n \"hourlyRate\",\n \"yearsOfExperience\",\n \"rank\",\n \"performanceScore\",\n \"mediaReference\",\n \"lastUpdated\",\n ],\n });\n\n const asyncIterResult = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({\n $includeAllBaseObjectProperties: true,\n\n // this select list is intended to represent all properties on `EmployeeApiTest`,\n // so if you get an error here later and you added properties to that object,\n // be sure to add them here too.\n $select: [\n \"attachment\",\n \"class\",\n \"employeeId\",\n \"fullName\",\n \"geopoint\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"mediaReference\",\n \"timeseries\",\n \"dateOfJoining\",\n \"hourlyRate\",\n \"yearsOfExperience\",\n \"rank\",\n \"performanceScore\",\n \"mediaReference\",\n \"lastUpdated\",\n ],\n });\n });\n });\n\n test(\"includeRid\", async () => {\n const x = await fauxObjectSet\n .where({ class: \"idk\" })\n .fetchPage({ $includeRid: true });\n\n expectTypeOf(x).toEqualTypeOf<\n PageResult<\n Osdk.Instance<EmployeeApiTest, \"$rid\">\n >\n >();\n });\n\n test(\"pivotTo\", async () => {\n const noArgs = await fauxObjectSet.pivotTo(\"peeps\").fetchPage({});\n const subselect = await fauxObjectSet.pivotTo(\"peeps\").fetchPage({\n $select: [\"employeeId\", \"class\"],\n });\n\n expectTypeOf(subselect).toEqualTypeOf<\n PageResult<\n Osdk.Instance<EmployeeApiTest, never, \"employeeId\" | \"class\">\n >\n >();\n });\n\n describe(\".withProperties\", () => {\n test(\"single property\", async () => {\n const withA = fauxObjectSet.withProperties({\n \"a\": (base) => {\n return base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\");\n },\n });\n\n const isWithAAssignable: $ObjectSet<EmployeeApiTest, {}> = withA;\n\n expectTypeOf(withA).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n a: \"integer\";\n }>\n >();\n\n const withAResults = await withA.fetchPage();\n\n expectTypeOf<typeof withAResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n a: \"integer\";\n }>\n >();\n\n expectTypeOf<typeof withAResults[\"data\"][0][\"a\"]>()\n .toEqualTypeOf<number>();\n });\n\n it(\"can be sub-selected\", () => {\n const objectWithUndefinedRdp = fauxObjectSet.withProperties({\n \"derivedPropertyName\": (base) =>\n base.pivotTo(\"lead\").selectProperty(\"employeeId\"),\n }).fetchOne(3, {\n $select: [\"derivedPropertyName\"],\n });\n });\n\n test(\"multiple properties\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n expectTypeOf(withFamily).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"dad\"]>()\n .toEqualTypeOf<string | undefined>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"sister\"]>()\n .toEqualTypeOf<string[] | undefined>();\n });\n\n describe(\"called in succession\", () => {\n test(\"independently\", () => {\n const withMom = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n const withParents = withMom.withProperties({\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n });\n\n expectTypeOf(withParents).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n }>\n >();\n });\n\n test.todo(\"with calculated properties\");\n });\n\n describe(\"nullability\", () => {\n it(\"count, exactDistinct, and approximateDistinct aren't nullable\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\"),\n \"sis\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:approximateDistinct\"),\n });\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"integer\";\n sis: \"integer\";\n }>\n >();\n });\n\n it(\n \"collectToSet, collectToList, selectProperty, and numeric aggregations are nullable\",\n async () => {\n const withAggregations = fauxObjectSet.withProperties({\n \"collectSet\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectSet\"),\n \"select\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"collectList\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"min\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:max\"),\n \"max\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:min\"),\n \"sum\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avg\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n \"approximatePercentile\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"employeeId:approximatePercentile\",\n ),\n });\n\n const withAggregationResults = await withAggregations.fetchPage();\n\n expectTypeOf<typeof withAggregationResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n collectSet: \"string\"[] | undefined;\n select: \"string\" | undefined;\n collectList: \"string\"[] | undefined;\n min: \"double\" | undefined;\n max: \"double\" | undefined;\n sum: \"double\" | undefined;\n avg: \"double\" | undefined;\n approximatePercentile: \"double\" | undefined;\n }\n >\n >();\n },\n );\n });\n\n describe(\"fetch functions return correct Osdk.Instance\", () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n\n it(\"works with .where\", async () => {\n const where = withFamily.where({ \"mom\": 1 });\n const whereResults = await where.fetchPage();\n\n // Checks that if you did an `await where.fetchPage()` that you can then\n // pass/assign it to something explicit.\n const _assignPreviouslyInferredPages: PageResult<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n > = whereResults;\n\n // Checks that if you did an `await where.fetchPage()` that you can then\n // pass/assign it to something explicit.\n const _assignPreviouslyInferredInstance: Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n > = whereResults.data[0];\n\n const q = whereResults.data[0].$link.peeps.$objectSetInternals.def;\n\n // same as above but with expectTypeOf\n expectTypeOf<typeof where>().toEqualTypeOf<typeof withFamily>();\n expectTypeOf<typeof whereResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n\n // Checks that when you directly assign, it infers correctly.\n // Sometimes an explicit assignment can affect how typescript infers\n // types.\n const shouldBeAssignablePage: PageResult<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n > = await where.fetchPage();\n\n const _shouldBeAssignableSingle: Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n > = await withFamily.fetchOne(1);\n await withFamily.fetchOne(1);\n });\n\n it(\"works with .async\", () => {\n const asyncIter = withFamily.asyncIter();\n expectTypeOf<typeof asyncIter>().toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >\n >();\n });\n\n it(\"Works with no select\", async () => {\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"Works with selecting all RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\", \"dad\", \"sister\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n });\n\n it(\"Works with selecting some RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n }>\n >();\n });\n\n it(\"Works with selecting all non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\n \"employeeId\",\n \"fullName\",\n \"class\",\n \"attachment\",\n \"geopoint\",\n \"timeseries\",\n \"mediaReference\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"yearsOfExperience\",\n \"rank\",\n \"performanceScore\",\n \"hourlyRate\",\n \"dateOfJoining\",\n \"lastUpdated\",\n ],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {}\n >\n >();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"class\"]>()\n .toEqualTypeOf<\n string | undefined\n >();\n });\n\n it(\"Works with selecting some non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"class\", {}>\n >();\n });\n\n it(\"Works with selecting a mix\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\", \"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n \"class\",\n { mom: \"integer\" }\n >\n >();\n });\n });\n\n it(\"allows extracting the type\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n type ObjectSetType = typeof objectSet;\n\n expectTypeOf<ObjectSetType>().toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n }>\n >();\n\n const objectSet2 = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"Defining the Type\", () => {\n type ObjectSetType = $ObjectSet<\n EmployeeApiTest,\n {\n mom: \"integer\";\n }\n >;\n\n fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"has correct aggregation keys\", () => {\n fauxObjectSet.withProperties({\n \"integer\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"integerNumericAgg\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"string\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"stringDoesNotHaveNumericAgg\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"class:sum\"),\n \"isActive\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"isActive:approximateDistinct\"),\n \"attachment\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"attachment:collectList\"),\n \"geopoint\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"geopoint:collectList\"),\n \"numericTimeseries\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"timeseries:sum\"),\n \"numericTimeseriesExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"timeseries:exactDistinct\"),\n \"mediaReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"mediaReference:avg\"),\n \"mediaReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"mediaReference:exactDistinct\"),\n \"geotimeSeriesReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"geotimeSeriesReference:sum\"),\n \"geotimeSeriesReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"geotimeSeriesReference:exactDistinct\",\n ),\n \"lastUpdated\": (base) => {\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:approximateDistinct\");\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:exactDistinct\");\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:max\");\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:min\");\n base.pivotTo(\"lead\").aggregate(\"lastUpdated:collectList\");\n return base.pivotTo(\"lead\").aggregate(\"lastUpdated:collectSet\");\n },\n \"dateOfJoining\": (base) => {\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:approximateDistinct\");\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:exactDistinct\");\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:max\");\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:min\");\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:collectList\");\n return base.pivotTo(\"lead\").aggregate(\"dateOfJoining:collectSet\");\n },\n });\n });\n\n it(\"has correct aggregation return types\", async () => {\n const aggTestObjectSet = fauxObjectSet.withProperties({\n \"maxHasSameType\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:max\"),\n \"minHasSameType\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfJoining:min\"),\n \"approximateDistinctNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:approximateDistinct\"),\n \"exactDistinctNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:exactDistinct\"),\n \"countNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"sumNumber\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avgNumber\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n }).fetchPage();\n\n const result = (await aggTestObjectSet).data[0];\n expectTypeOf((await aggTestObjectSet).data[0]).toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n maxHasSameType: \"datetime\" | undefined;\n minHasSameType: \"datetime\" | undefined;\n avgNumber: \"double\" | undefined;\n approximateDistinctNumberNoUndefined: \"integer\";\n exactDistinctNumberNoUndefined: \"integer\";\n countNumberNoUndefined: \"integer\";\n sumNumber: \"double\" | undefined;\n }>\n >();\n\n expectTypeOf(result.maxHasSameType).toEqualTypeOf<string | undefined>();\n expectTypeOf(result.minHasSameType).toEqualTypeOf<string | undefined>();\n expectTypeOf(result.approximateDistinctNumberNoUndefined).toEqualTypeOf<\n number\n >();\n expectTypeOf(result.exactDistinctNumberNoUndefined).toEqualTypeOf<\n number\n >();\n expectTypeOf(result.countNumberNoUndefined).toEqualTypeOf<number>();\n expectTypeOf(result.sumNumber).toEqualTypeOf<number | undefined>();\n expectTypeOf(result.avgNumber).toEqualTypeOf<number | undefined>();\n });\n\n it(\"Merged object type is equivalent to original\", () => {\n const a = {} as EmployeeApiTest;\n let b = {} as DerivedObjectOrInterfaceDefinition.WithDerivedProperties<\n EmployeeApiTest,\n {}\n >;\n\n b = a; // should be assignable. testing explicitly due to break in 2.2 release.\n\n expectTypeOf<\n EmployeeApiTest\n >().branded.toEqualTypeOf<\n DerivedObjectOrInterfaceDefinition.WithDerivedProperties<\n EmployeeApiTest,\n {}\n >\n >();\n });\n });\n describe(\"aggregate\", () => {\n it(\"has correct aggregation keys\", () => {\n void fauxObjectSet.aggregate({\n \"$select\": {\n \"lastUpdated:max\": \"asc\",\n \"lastUpdated:min\": \"desc\",\n \"lastUpdated:approximateDistinct\": \"asc\",\n \"lastUpdated:exactDistinct\": \"desc\",\n \"dateOfJoining:max\": \"desc\",\n \"dateOfJoining:min\": \"asc\",\n \"dateOfJoining:approximateDistinct\": \"asc\",\n \"dateOfJoining:exactDistinct\": \"desc\",\n },\n });\n });\n });\n describe(\"expressions\", () => {\n \"Test all property types\";\n describe(\"numeric expressions\", () => {\n it(\"provides correct methods off of selected numeric derived property definitions\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const selectedInteger = base.pivotTo(\"lead\").selectProperty(\n \"employeeId\",\n );\n\n expectTypeOf(selectedInteger).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"integer\" | undefined,\n EmployeeApiTest\n >\n >;\n\n selectedInteger.add(1);\n selectedInteger.subtract(1);\n selectedInteger.multiply(1);\n selectedInteger.divide(1);\n selectedInteger.abs();\n selectedInteger.negate();\n selectedInteger.max(1);\n selectedInteger.min(1);\n\n // @ts-expect-error\n selectedInteger.extractPart(\"1\");\n\n expectTypeOf(\n base.pivotTo(\"lead\").selectProperty(\n \"performanceScore\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\" | undefined,\n EmployeeApiTest\n >\n >();\n expectTypeOf(\n base.pivotTo(\"lead\").selectProperty(\n \"rank\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"short\" | undefined,\n EmployeeApiTest\n >\n >();\n expectTypeOf(\n base.pivotTo(\"lead\").selectProperty(\n \"yearsOfExperience\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"long\" | undefined,\n EmployeeApiTest\n >\n >();\n expectTypeOf(\n base.pivotTo(\"lead\").selectProperty(\n \"hourlyRate\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"float\" | undefined,\n EmployeeApiTest\n >\n >();\n\n return selectedInteger;\n },\n });\n });\n\n it(\"provides correct methods off of selection definitions\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const selectedInteger = base.pivotTo(\"lead\").selectProperty(\n \"employeeId\",\n );\n\n expectTypeOf(selectedInteger).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"integer\" | undefined,\n EmployeeApiTest\n >\n >;\n\n selectedInteger.add(1);\n selectedInteger.subtract(1);\n selectedInteger.multiply(1);\n selectedInteger.divide(1);\n selectedInteger.abs();\n selectedInteger.negate();\n selectedInteger.max(1);\n selectedInteger.min(1);\n\n // @ts-expect-error\n selectedInteger.extractPart(\"1\");\n\n expectTypeOf(\n base.pivotTo(\"lead\").selectProperty(\n \"performanceScore\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\" | undefined,\n EmployeeApiTest\n >\n >();\n expectTypeOf(\n base.pivotTo(\"lead\").selectProperty(\n \"rank\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"short\" | undefined,\n EmployeeApiTest\n >\n >();\n expectTypeOf(\n base.pivotTo(\"lead\").selectProperty(\n \"yearsOfExperience\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"long\" | undefined,\n EmployeeApiTest\n >\n >();\n expectTypeOf(\n base.pivotTo(\"lead\").selectProperty(\n \"hourlyRate\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"float\" | undefined,\n EmployeeApiTest\n >\n >();\n\n return selectedInteger;\n },\n });\n });\n\n it(\"provides correct methods off of aggregated properties\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const maxAggregation = base.pivotTo(\"lead\").aggregate(\n \"employeeId:max\",\n );\n\n expectTypeOf(maxAggregation).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"integer\" | undefined,\n EmployeeApiTest\n >\n >;\n\n maxAggregation.add(1);\n maxAggregation.subtract(1);\n maxAggregation.multiply(1);\n maxAggregation.divide(1);\n maxAggregation.abs();\n maxAggregation.negate();\n maxAggregation.max(1);\n maxAggregation.min(1);\n\n expectTypeOf(\n base.pivotTo(\"peeps\").aggregate(\"employeeId:sum\"),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\" | undefined,\n EmployeeApiTest\n >\n >();\n\n expectTypeOf(\n base.pivotTo(\"peeps\").aggregate(\"employeeId:avg\"),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\" | undefined,\n EmployeeApiTest\n >\n >();\n\n expectTypeOf(\n base.pivotTo(\"peeps\").aggregate(\"employeeId:min\"),\n ).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"integer\" | undefined,\n EmployeeApiTest\n >\n >();\n\n const collectList = base.pivotTo(\"peeps\").aggregate(\n \"employeeId:collectList\",\n );\n expectTypeOf(\n collectList,\n ).toEqualTypeOf<\n DerivedProperty.Definition<\n \"integer\"[] | undefined,\n EmployeeApiTest\n >\n >();\n\n // @ts-expect-error\n collectList.plus(1);\n\n expectTypeOf(\n base.pivotTo(\"peeps\").aggregate(\n \"employeeId:collectList\",\n ),\n ).toEqualTypeOf<\n DerivedProperty.Definition<\n \"integer\"[] | undefined,\n EmployeeApiTest\n >\n >();\n\n return maxAggregation;\n },\n });\n });\n\n it(\"correctly coerces numeric types\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const intAndLong = base.pivotTo(\"lead\").selectProperty(\"employeeId\")\n .add(base.selectProperty(\"yearsOfExperience\")).add(\n base.selectProperty(\"employeeId\"),\n );\n expectTypeOf(intAndLong).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\"long\", EmployeeApiTest>\n >();\n\n const intAndDouble = base.pivotTo(\"lead\").selectProperty(\n \"employeeId\",\n )\n .add(base.selectProperty(\"performanceScore\")).add(\n base.selectProperty(\"employeeId\"),\n );\n expectTypeOf(intAndDouble).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\",\n EmployeeApiTest\n >\n >();\n\n const longAndDouble = base.pivotTo(\"lead\").selectProperty(\n \"yearsOfExperience\",\n )\n .add(base.selectProperty(\"performanceScore\")).add(\n base.selectProperty(\"yearsOfExperience\"),\n );\n expectTypeOf(longAndDouble).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\",\n EmployeeApiTest\n >\n >();\n\n const longAndLong = base.pivotTo(\"lead\").selectProperty(\n \"yearsOfExperience\",\n )\n .add(base.selectProperty(\"yearsOfExperience\"));\n expectTypeOf(longAndLong).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\"long\", EmployeeApiTest>\n >();\n\n const intAndInt = base.pivotTo(\"lead\").selectProperty(\"employeeId\")\n .add(base.selectProperty(\"employeeId\"));\n expectTypeOf(intAndInt).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"integer\",\n EmployeeApiTest\n >\n >();\n\n const intLongDoubleChain = base.pivotTo(\"lead\").selectProperty(\n \"employeeId\",\n ).add(base.selectProperty(\"yearsOfExperience\")).add(\n base.selectProperty(\"employeeId\"),\n ).add(\n base.selectProperty(\"performanceScore\"),\n ).add(base.selectProperty(\"employeeId\"));\n expectTypeOf(intLongDoubleChain).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\",\n EmployeeApiTest\n >\n >();\n\n const shortAndIntReturnsInt = base.pivotTo(\"lead\").selectProperty(\n \"rank\",\n ).add(base.selectProperty(\"employeeId\"));\n expectTypeOf(shortAndIntReturnsInt).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"integer\",\n EmployeeApiTest\n >\n >();\n\n const shortAndFloatReturnsDouble = base.pivotTo(\"lead\")\n .selectProperty(\n \"rank\",\n ).add(base.selectProperty(\"hourlyRate\"));\n expectTypeOf(shortAndFloatReturnsDouble).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\",\n EmployeeApiTest\n >\n >();\n\n return intLongDoubleChain;\n },\n });\n });\n\n it(\"allows adding number literals as a double\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const plus = base.pivotTo(\"lead\").selectProperty(\"employeeId\")\n .add(1);\n expectTypeOf(plus).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\",\n EmployeeApiTest\n >\n >();\n\n return plus;\n },\n });\n });\n\n it(\"allows adding literals via base.constant\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const plus = base.pivotTo(\"lead\").selectProperty(\"employeeId\")\n .add(base.constant.double(1));\n expectTypeOf(plus).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\",\n EmployeeApiTest\n >\n >();\n\n const intPlusIntReturnsInt = base.pivotTo(\"lead\").selectProperty(\n \"employeeId\",\n )\n .add(base.constant.integer(1));\n expectTypeOf(intPlusIntReturnsInt).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"integer\",\n EmployeeApiTest\n >\n >();\n\n return plus;\n },\n });\n });\n\n it(\"allows correctly typed nested property definitions\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const nested = base.pivotTo(\"lead\").selectProperty(\"employeeId\")\n .add(\n base.pivotTo(\"peeps\").aggregate(\"employeeId:sum\"),\n );\n expectTypeOf(nested).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\",\n EmployeeApiTest\n >\n >();\n\n return nested;\n },\n });\n });\n\n it(\"allows correctly types property keys off the linked OT\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const nested = base.pivotTo(\"lead\").selectProperty(\"employeeId\")\n .add(\n base.selectProperty(\"performanceScore\"),\n );\n expectTypeOf(nested).toEqualTypeOf<\n DerivedProperty.NumericPropertyDefinition<\n \"double\",\n EmployeeApiTest\n >\n >();\n\n return nested;\n },\n });\n });\n\n // it(\"allows correctly types property keys off the base OT\", () => {});\n });\n describe(\"datetime expressions\", () => {\n it(\"provides correct methods off of datetime selections\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const selectedDatetime = base.pivotTo(\"lead\").selectProperty(\n \"dateOfJoining\",\n );\n\n expectTypeOf(selectedDatetime).toEqualTypeOf<\n DerivedProperty.DatetimePropertyDefinition<\n \"datetime\" | undefined,\n EmployeeApiTest\n >\n >();\n\n selectedDatetime.max(base.selectProperty(\"dateOfJoining\"));\n selectedDatetime.min(base.selectProperty(\"lastUpdated\"));\n\n expectTypeOf(base.pivotTo(\"lead\").selectProperty(\"lastUpdated\"))\n .toEqualTypeOf<\n DerivedProperty.DatetimePropertyDefinition<\n \"timestamp\" | undefined,\n EmployeeApiTest\n >\n >();\n\n return selectedDatetime;\n },\n });\n });\n\n it(\"correctly coerces datetime types\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const max = base.pivotTo(\"lead\").selectProperty(\"dateOfJoining\")\n .max(base.selectProperty(\"lastUpdated\"));\n expectTypeOf(max).toEqualTypeOf<\n DerivedProperty.DatetimePropertyDefinition<\n \"timestamp\",\n EmployeeApiTest\n >\n >();\n\n const min = base.pivotTo(\"lead\").selectProperty(\"dateOfJoining\")\n .min(base.selectProperty(\"dateOfJoining\"));\n expectTypeOf(min).toEqualTypeOf<\n DerivedProperty.DatetimePropertyDefinition<\n \"datetime\",\n EmployeeApiTest\n >\n >();\n\n return max;\n },\n });\n });\n\n it(\"allows adding literals via base.constant\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const dateAndDateReturnDate = base.pivotTo(\"lead\").selectProperty(\n \"dateOfJoining\",\n )\n .min(base.constant.datetime(\"2025-01-01T00:00:00Z\"));\n expectTypeOf(dateAndDateReturnDate).toEqualTypeOf<\n DerivedProperty.DatetimePropertyDefinition<\n \"datetime\",\n EmployeeApiTest\n >\n >();\n\n const dateAndTimeReturnTime = base.pivotTo(\"lead\").selectProperty(\n \"dateOfJoining\",\n )\n .min(base.constant.timestamp(\"2025-01-01T00:00:00Z\"));\n expectTypeOf(dateAndTimeReturnTime).toEqualTypeOf<\n DerivedProperty.DatetimePropertyDefinition<\n \"timestamp\",\n EmployeeApiTest\n >\n >();\n\n return dateAndTimeReturnTime;\n },\n });\n });\n\n it(\"allows correctly typed nested property definitions\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const nested = base.pivotTo(\"lead\").selectProperty(\"dateOfJoining\")\n .min(\n base.pivotTo(\"lead\").pivotTo(\"lead\").selectProperty(\n \"lastUpdated\",\n ),\n );\n expectTypeOf(nested).toEqualTypeOf<\n DerivedProperty.DatetimePropertyDefinition<\n \"timestamp\",\n EmployeeApiTest\n >\n >();\n\n return nested;\n },\n });\n });\n\n it(\"allows correctly typed property keys off the linked OT\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"myProp1\": (base) => {\n const nested = base.pivotTo(\"lead\").selectProperty(\"dateOfJoining\")\n .min(\n base.selectProperty(\"lastUpdated\"),\n );\n expectTypeOf(nested).toEqualTypeOf<\n DerivedProperty.DatetimePropertyDefinition<\n \"timestamp\",\n EmployeeApiTest\n >\n >();\n\n return nested;\n },\n });\n });\n\n // it(\"allows correctly typed property keys off the base OT\", () => {});\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAA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qD,MAAM;UACf;QACF,CAAC,CAAC;MACJ,CAAC,CAAC;MAEF3E,EAAE,CAAC,wDAAwD,EAAE,MAAM;QAC/CM,aAAa,CAACQ,cAAc,CAAC;UAC7C,SAAS,EAAGkB,IAAI,IAAK;YACnB,MAAM2C,MAAM,GAAG3C,IAAI,CAACX,OAAO,CAAC,MAAM,CAAC,CAACY,cAAc,CAAC,eAAe,CAAC,CAChEyB,GAAG,CACF1B,IAAI,CAACC,cAAc,CAAC,aAAa,CACnC,CAAC;YACHlC,YAAY,CAAC4E,MAAM,CAAC,CAACrD,aAAa,CAKhC,CAAC;YAEH,OAAOqD,MAAM;UACf;QACF,CAAC,CAAC;MACJ,CAAC,CAAC;;MAEF;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -52,6 +52,13 @@ interface MediaReference {
52
52
  };
53
53
  };
54
54
  }
55
+ /**
56
+ * Object for uploading Media
57
+ */
58
+ interface MediaUpload {
59
+ readonly path: string;
60
+ readonly data: Blob;
61
+ }
55
62
  /**
56
63
  * Metadata of a media item
57
64
  */
@@ -951,36 +958,80 @@ type WhereClause<T extends ObjectOrInterfaceDefinition> = OrWhereClause<T> | And
951
958
  type LinkNames<Q extends ObjectOrInterfaceDefinition> = keyof CompileTimeMetadata<Q>["links"] & string;
952
959
  type LinkedType<Q extends ObjectOrInterfaceDefinition, L extends LinkNames<Q>> = NonNullable<CompileTimeMetadata<Q>["links"][L]["__OsdkLinkTargetType"]>;
953
960
 
961
+ type WithPropertiesNumerics = "integer" | "double" | "float" | "short" | "long";
962
+ type WithPropertiesDatetime = "datetime" | "timestamp";
963
+ type DefinitionForType<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = SimplePropertyDef.ExtractMultiplicity<T> extends "array" ? DerivedProperty.Definition<T, Q> : SimplePropertyDef.ExtractWirePropertyType<T> extends WithPropertiesNumerics ? DerivedProperty.NumericPropertyDefinition<T, Q> : SimplePropertyDef.ExtractWirePropertyType<T> extends WithPropertiesDatetime ? DerivedProperty.DatetimePropertyDefinition<T, Q> : DerivedProperty.Definition<T, Q>;
964
+ type NumericExpressionArg<Q extends ObjectOrInterfaceDefinition> = number | DerivedProperty.NumericPropertyDefinition<any, Q>;
965
+ type ReturnTypeForNumericMethod<Q extends ObjectOrInterfaceDefinition, LEFT extends WirePropertyTypes, RIGHT extends WirePropertyTypes> = "double" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"double", "non-nullable", "single">, Q> : "float" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"double", "non-nullable", "single">, Q> : "long" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"long", "non-nullable", "single">, Q> : DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"integer", "non-nullable", "single">, Q>;
966
+ type ReturnTypeForDatetimeMethod<Q extends ObjectOrInterfaceDefinition, LEFT extends WirePropertyTypes, RIGHT extends WirePropertyTypes> = "timestamp" extends (LEFT | RIGHT) ? DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"timestamp", "non-nullable", "single">, Q> : DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"datetime", "non-nullable", "single">, Q>;
967
+ type ExtractWirePropertyTypeFromNumericArg<Q extends ObjectOrInterfaceDefinition, ARG extends NumericExpressionArg<Q>> = ARG extends number ? "double" : ARG extends DerivedProperty.NumericPropertyDefinition<infer T, Q> ? T extends SimplePropertyDef ? SimplePropertyDef.ExtractWirePropertyType<T> : never : ARG extends PropertyKeys.Filtered<Q, WithPropertiesNumerics> ? NonNullable<CompileTimeMetadata<Q>["properties"][ARG]["type"]> : never;
968
+ type NumericExpressions<Q extends ObjectOrInterfaceDefinition, LEFT_PROPERTY_TYPE extends SimplePropertyDef> = {
969
+ readonly add: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
970
+ readonly subtract: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
971
+ readonly multiply: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
972
+ readonly divide: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
973
+ readonly abs: () => DerivedProperty.NumericPropertyDefinition<LEFT_PROPERTY_TYPE, Q>;
974
+ readonly negate: () => DerivedProperty.NumericPropertyDefinition<LEFT_PROPERTY_TYPE, Q>;
975
+ readonly max: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
976
+ readonly min: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
977
+ };
978
+ type DatetimeExpressionArg<Q extends ObjectOrInterfaceDefinition> = DerivedProperty.DatetimePropertyDefinition<any, Q>;
979
+ type ExtractPropertyTypeFromDatetimeArg<Q extends ObjectOrInterfaceDefinition, ARG extends DatetimeExpressionArg<Q>> = ARG extends DerivedProperty.DatetimePropertyDefinition<infer T, Q> ? T extends SimplePropertyDef ? SimplePropertyDef.ExtractWirePropertyType<T> : never : ARG extends PropertyKeys.Filtered<Q, WithPropertiesDatetime> ? NonNullable<CompileTimeMetadata<Q>["properties"][ARG]["type"]> : never;
980
+ type DatetimeExpressions<Q extends ObjectOrInterfaceDefinition, LEFT_PROPERTY_TYPE extends SimplePropertyDef> = {
981
+ readonly min: <A extends DatetimeExpressionArg<Q>>(value: A) => ReturnTypeForDatetimeMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractPropertyTypeFromDatetimeArg<Q, A>>;
982
+ readonly max: (value: DatetimeExpressionArg<Q>) => ReturnTypeForDatetimeMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractPropertyTypeFromDatetimeArg<Q, typeof value>>;
983
+ readonly extractPart: (value: DerivedProperty.ValidParts) => DerivedProperty.Definition<SimplePropertyDef.Make<"string", "non-nullable", "single">, Q>;
984
+ };
985
+
954
986
  declare const DerivedPropertyDefinitionBrand: unique symbol;
955
987
  declare namespace DerivedProperty {
956
988
  export interface Definition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> {
957
989
  readonly [DerivedPropertyDefinitionBrand]: true;
958
990
  }
991
+ export interface NumericPropertyDefinition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> extends Definition<T, Q>, NumericExpressions<Q, T> {
992
+ }
993
+ export interface DatetimePropertyDefinition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> extends Definition<T, Q>, DatetimeExpressions<Q, T> {
994
+ }
959
995
  export type Clause<Q extends ObjectOrInterfaceDefinition> = {
960
996
  [key: string]: DerivedPropertyCreator<Q, SimplePropertyDef>;
961
997
  };
962
998
  interface BaseBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {
963
999
  }
964
- export interface Builder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends BaseBuilder<Q, CONSTRAINED> {
1000
+ export interface Builder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends BaseBuilder<Q, CONSTRAINED>, Selectable<Q>, Constant<Q> {
965
1001
  }
966
1002
  export interface AggregateBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends BaseBuilder<Q, CONSTRAINED>, Aggregatable<Q> {
967
1003
  }
1004
+ export interface SelectPropertyBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {
1005
+ }
1006
+ export type ValidParts = "DAYS" | "MONTHS" | "QUARTERS" | "YEARS";
968
1007
  export { };
969
1008
  }
970
- type DerivedPropertyCreator<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = (baseObjectSet: DerivedProperty.Builder<Q, false>) => DerivedProperty.Definition<T, Q>;
971
- type BuilderTypeFromConstraint<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true> : DerivedProperty.AggregateBuilder<Q, false>;
1009
+ type DerivedPropertyCreator<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = (baseObjectSet: DerivedProperty.Builder<Q, false>) => DerivedProperty.Definition<T, Q> | DerivedProperty.NumericPropertyDefinition<T, Q> | DerivedProperty.DatetimePropertyDefinition<T, Q>;
1010
+ type BuilderTypeFromConstraint<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true> : DerivedProperty.SelectPropertyBuilder<Q, false>;
972
1011
  type Filterable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
973
1012
  readonly where: (clause: WhereClause<Q>) => BuilderTypeFromConstraint<Q, CONSTRAINED>;
974
1013
  };
975
1014
  type Pivotable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
976
- readonly pivotTo: <L extends LinkNames<Q>>(type: L) => CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : NonNullable<CompileTimeMetadata<Q>["links"][L]["multiplicity"]> extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : DerivedProperty.AggregateBuilder<LinkedType<Q, L>, false>;
1015
+ readonly pivotTo: <L extends LinkNames<Q>>(type: L) => CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : NonNullable<CompileTimeMetadata<Q>["links"][L]["multiplicity"]> extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : DerivedProperty.SelectPropertyBuilder<LinkedType<Q, L>, false>;
1016
+ };
1017
+ type Constant<Q extends ObjectOrInterfaceDefinition> = {
1018
+ readonly constant: {
1019
+ readonly double: (value: number) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"double", "non-nullable", "single">, Q>;
1020
+ readonly integer: (value: number) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"integer", "non-nullable", "single">, Q>;
1021
+ readonly long: (value: string) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"long", "non-nullable", "single">, Q>;
1022
+ readonly datetime: (value: string) => DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"datetime", "non-nullable", "single">, Q>;
1023
+ readonly timestamp: (value: string) => DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"timestamp", "non-nullable", "single">, Q>;
1024
+ };
977
1025
  };
978
1026
  type Aggregatable<Q extends ObjectOrInterfaceDefinition> = {
979
1027
  readonly aggregate: <V extends ValidAggregationKeys<Q, "withPropertiesAggregate">>(aggregationSpecifier: V, opts?: V extends `${any}:${infer P}` ? P extends CollectWithPropAggregations ? {
980
1028
  limit: number;
981
1029
  } : P extends "approximatePercentile" ? {
982
1030
  percentile: number;
983
- } : never : never) => DerivedProperty.Definition<V extends `${infer N}:${infer P}` ? P extends CollectWithPropAggregations ? SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][N]["type"], "nullable", "array"> : P extends MinMaxWithPropAggregateOption ? SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][N]["type"], "nullable", "single"> : P extends "approximateDistinct" | "exactDistinct" ? SimplePropertyDef.Make<"integer", "non-nullable", "single"> : SimplePropertyDef.Make<"double", "nullable", "single"> : V extends "$count" ? SimplePropertyDef.Make<"integer", "non-nullable", "single"> : never, Q>;
1031
+ } : never : never) => DefinitionForType<Q, V extends `${infer N}:${infer P}` ? P extends CollectWithPropAggregations ? SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][N]["type"], "nullable", "array"> : P extends MinMaxWithPropAggregateOption ? SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][N]["type"], "nullable", "single"> : P extends "approximateDistinct" | "exactDistinct" ? SimplePropertyDef.Make<"integer", "non-nullable", "single"> : SimplePropertyDef.Make<"double", "nullable", "single"> : V extends "$count" ? SimplePropertyDef.Make<"integer", "non-nullable", "single"> : never>;
1032
+ };
1033
+ type Selectable<Q extends ObjectOrInterfaceDefinition> = {
1034
+ readonly selectProperty: <R extends PropertyKeys<Q>>(propertyName: R) => DefinitionForType<Q, SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][R]["type"], CompileTimeMetadata<Q>["properties"][R]["nullable"] extends true ? "nullable" : "non-nullable", CompileTimeMetadata<Q>["properties"][R]["multiplicity"] extends true ? "array" : "single">>;
984
1035
  };
985
1036
 
986
1037
  interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
@@ -1229,4 +1280,4 @@ interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
1229
1280
  interface ObjectSetCleanedTypes<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef>, MERGED extends ObjectOrInterfaceDefinition & Q> extends MinimalObjectSet<Q, D>, WithProperties<Q, D>, Aggregate<MERGED>, SetArithmetic<MERGED>, PivotTo<Q>, FetchOne<Q, D>, Subscribe<MERGED> {
1230
1281
  }
1231
1282
 
1232
- export { type ObjectSpecifier as $, type AttachmentUpload as A, type SelectArg as B, type CompileTimeMetadata as C, DistanceUnitMapping as D, type SelectArgToKeys as E, type FetchPageArgs as F, type GeoFilterOptions as G, type FetchPageResult as H, type InterfaceDefinition as I, type SingleOsdkResult as J, type Media as K, type MediaMetadata as L, type MediaReference as M, NullabilityAdherence as N, type ObjectTypeDefinition as O, type PropertyValueWireToClient as P, isOk as Q, type ReleaseStatus as R, type SingleLinkAccessor as S, type Result as T, type BaseObjectSet as U, type ValidAggregationKeys as V, type WhereClause as W, ObjectSetSubscription as X, type InterfaceMetadata as Y, type ObjectOrInterfaceDefinition as Z, PropertyKeys as _, type Attachment as a, ObjectMetadata as a0, type PropertyDef as a1, type VersionBound as a2, type BaseWirePropertyTypes as a3, type WirePropertyTypes as a4, type PrimaryKeyType as a5, type ConvertProps as a6, Osdk as a7, type PageResult as a8, TimeseriesDurationMapping as a9, type GeotimeSeriesProperty as aa, type TimeSeriesPoint as ab, type TimeSeriesProperty as ac, type TimeSeriesQuery as ad, type LinkedType as ae, type LinkNames as af, type ExtractOptions as ag, type MinimalObjectSet as ah, type ObjectIdentifiers as b, type OsdkObjectPrimaryKeyType as c, type ObjectSet as d, type OsdkMetadata as e, type PrimaryKeyTypes as f, type OsdkBase as g, type AggregateOpts as h, type AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy as i, type AggregationResultsWithGroups as j, type AggregationResultsWithoutGroups as k, type AggregationClause as l, type AggregationsResults as m, type GeoFilter_Intersects as n, type GeoFilter_Within as o, type PossibleWhereClauseFilters as p, type OsdkObjectPropertyType as q, type OsdkObjectLinksObject as r, DerivedProperty as s, DurationMapping as t, type AllGroupByValues as u, type GroupByClause as v, type GroupByRange as w, type AsyncIterArgs as x, type Augment as y, type Augments as z };
1283
+ export { PropertyKeys as $, type AttachmentUpload as A, type Augments as B, type CompileTimeMetadata as C, DistanceUnitMapping as D, type SelectArg as E, type FetchPageArgs as F, type GeoFilterOptions as G, type SelectArgToKeys as H, type InterfaceDefinition as I, type FetchPageResult as J, type SingleOsdkResult as K, type Media as L, type MediaReference as M, NullabilityAdherence as N, type ObjectTypeDefinition as O, type PropertyValueWireToClient as P, type MediaMetadata as Q, type ReleaseStatus as R, type SingleLinkAccessor as S, isOk as T, type Result as U, type ValidAggregationKeys as V, type WhereClause as W, type BaseObjectSet as X, ObjectSetSubscription as Y, type InterfaceMetadata as Z, type ObjectOrInterfaceDefinition as _, type MediaUpload as a, type ObjectSpecifier as a0, ObjectMetadata as a1, type PropertyDef as a2, type VersionBound as a3, type BaseWirePropertyTypes as a4, type WirePropertyTypes as a5, type PrimaryKeyType as a6, type ConvertProps as a7, Osdk as a8, type PageResult as a9, TimeseriesDurationMapping as aa, type GeotimeSeriesProperty as ab, type TimeSeriesPoint as ac, type TimeSeriesProperty as ad, type TimeSeriesQuery as ae, type LinkedType as af, type LinkNames as ag, type ExtractOptions as ah, type MinimalObjectSet as ai, type Attachment as b, type ObjectIdentifiers as c, type OsdkObjectPrimaryKeyType as d, type ObjectSet as e, type OsdkMetadata as f, type PrimaryKeyTypes as g, type OsdkBase as h, type AggregateOpts as i, type AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy as j, type AggregationResultsWithGroups as k, type AggregationResultsWithoutGroups as l, type AggregationClause as m, type AggregationsResults as n, type GeoFilter_Intersects as o, type GeoFilter_Within as p, type PossibleWhereClauseFilters as q, type OsdkObjectPropertyType as r, type OsdkObjectLinksObject as s, DerivedProperty as t, DurationMapping as u, type AllGroupByValues as v, type GroupByClause as w, type GroupByRange as x, type AsyncIterArgs as y, type Augment as z };
@@ -1,5 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ // src/actions/NullValue.ts
4
+ var NULL_VALUE = Symbol.for("NULL_VALUE");
5
+
3
6
  // src/aggregate/WhereClause.ts
4
7
  var DistanceUnitMapping = {
5
8
  "centimeter": "CENTIMETERS",
@@ -69,6 +72,7 @@ var TimeseriesDurationMapping = {
69
72
 
70
73
  exports.DistanceUnitMapping = DistanceUnitMapping;
71
74
  exports.DurationMapping = DurationMapping;
75
+ exports.NULL_VALUE = NULL_VALUE;
72
76
  exports.TimeseriesDurationMapping = TimeseriesDurationMapping;
73
77
  exports.isOk = isOk;
74
78
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/aggregate/WhereClause.ts","../../src/mapping/DurationMapping.ts","../../src/groupby/GroupByClause.ts","../../src/object/Result.ts","../../src/timeseries/timeseries.ts"],"names":[],"mappings":";;;AAkBO,IAAM,mBAAsB,GAAA;AAAA,EACjC,YAAc,EAAA,aAAA;AAAA,EACd,aAAe,EAAA,aAAA;AAAA,EACf,IAAM,EAAA,aAAA;AAAA,EACN,OAAS,EAAA,QAAA;AAAA,EACT,QAAU,EAAA,QAAA;AAAA,EACV,GAAK,EAAA,QAAA;AAAA,EACL,WAAa,EAAA,YAAA;AAAA,EACb,YAAc,EAAA,YAAA;AAAA,EACd,IAAM,EAAA,YAAA;AAAA,EACN,MAAQ,EAAA,QAAA;AAAA,EACR,QAAU,EAAA,QAAA;AAAA,EACV,MAAQ,EAAA,MAAA;AAAA,EACR,MAAQ,EAAA,MAAA;AAAA,EACR,MAAQ,EAAA,OAAA;AAAA,EACR,OAAS,EAAA,OAAA;AAAA,EACT,MAAQ,EAAA,OAAA;AAAA,EACR,OAAS,EAAA,OAAA;AAAA,EACT,eAAiB,EAAA,gBAAA;AAAA,EACjB,cAAgB,EAAA,gBAAA;AAAA,EAChB,gBAAkB,EAAA;AACpB;;;ACvBO,IAAM,mBAAsB,GAAA;AAAA,EACjC,KAAO,EAAA,SAAA;AAAA,EACP,SAAW,EAAA,SAAA;AAAA,EACX,KAAO,EAAA,SAAA;AAAA,EACP,QAAU,EAAA,SAAA;AAAA,EACV,SAAW,EAAA,SAAA;AAAA,EACX,IAAM,EAAA,OAAA;AAAA,EACN,KAAO,EAAA,OAAA;AAAA,EACP,MAAQ,EAAA,OAAA;AAAA,EACR,OAAS,EAAA,OAAA;AAAA,EACT,KAAO,EAAA,MAAA;AAAA,EACP,MAAQ,EAAA,MAAA;AAAA,EACR,IAAM,EAAA,OAAA;AAAA,EACN,MAAQ,EAAA,OAAA;AAAA,EACR,OAAS,EAAA,OAAA;AAAA,EACT,KAAO,EAAA,QAAA;AAAA,EACP,OAAS,EAAA,QAAA;AAAA,EACT,QAAU,EAAA,QAAA;AAAA,EACV,IAAM,EAAA,OAAA;AAAA,EACN,MAAQ,EAAA,OAAA;AAAA,EACR,OAAS,EAAA;AACX,CAAA;;;ACpBO,IAAM,eAAkB,GAAA;AAAA,EAC7B,GAAG,mBAAA;AAAA,EACH,SAAW,EAAA,UAAA;AAAA,EACX,UAAY,EAAA;AACd;;;ACAO,SAAS,KAAK,CAAG,EAAA;AACtB,EAAA,OAAO,OAAW,IAAA,CAAA;AACpB;;;ACNO,IAAM,yBAA4B,GAAA;AAAA,EACvC,IAAM,EAAA,cAAA;AAAA,EACN,cAAgB,EAAA,cAAA;AAAA,EAChB,GAAG;AACL","file":"index.cjs","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// the value side of this needs to match DistanceUnit from @osdk/foundry but we don't\n// want the dependency\nexport const DistanceUnitMapping = {\n \"centimeter\": \"CENTIMETERS\",\n \"centimeters\": \"CENTIMETERS\",\n \"cm\": \"CENTIMETERS\",\n \"meter\": \"METERS\",\n \"meters\": \"METERS\",\n \"m\": \"METERS\",\n \"kilometer\": \"KILOMETERS\",\n \"kilometers\": \"KILOMETERS\",\n \"km\": \"KILOMETERS\",\n \"inch\": \"INCHES\",\n \"inches\": \"INCHES\",\n \"foot\": \"FEET\",\n \"feet\": \"FEET\",\n \"yard\": \"YARDS\",\n \"yards\": \"YARDS\",\n \"mile\": \"MILES\",\n \"miles\": \"MILES\",\n \"nautical_mile\": \"NAUTICAL_MILES\",\n \"nauticalMile\": \"NAUTICAL_MILES\",\n \"nautical miles\": \"NAUTICAL_MILES\"\n};\n\n// FIXME we need to represent all types","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const TimeDurationMapping = {\n \"sec\": \"SECONDS\",\n \"seconds\": \"SECONDS\",\n \"min\": \"MINUTES\",\n \"minute\": \"MINUTES\",\n \"minutes\": \"MINUTES\",\n \"hr\": \"HOURS\",\n \"hrs\": \"HOURS\",\n \"hour\": \"HOURS\",\n \"hours\": \"HOURS\",\n \"day\": \"DAYS\",\n \"days\": \"DAYS\",\n \"wk\": \"WEEKS\",\n \"week\": \"WEEKS\",\n \"weeks\": \"WEEKS\",\n \"mos\": \"MONTHS\",\n \"month\": \"MONTHS\",\n \"months\": \"MONTHS\",\n \"yr\": \"YEARS\",\n \"year\": \"YEARS\",\n \"years\": \"YEARS\"\n};","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\nexport const DurationMapping = {\n ...TimeDurationMapping,\n \"quarter\": \"QUARTERS\",\n \"quarters\": \"QUARTERS\"\n};","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Check if a result was successfully received\n * @param a - result wrapped value\n * @returns whether a result has a value in it\n */\nexport function isOk(a) {\n return \"value\" in a;\n}\n\n/**\n * Check if a result contains an error value\n * @param a Result wrapped value\n * @returns whether a result has an error in it\n */\nexport function isError(a) {\n return \"error\" in a;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\nexport const TimeseriesDurationMapping = {\n \"ms\": \"MILLISECONDS\",\n \"milliseconds\": \"MILLISECONDS\",\n ...TimeDurationMapping\n};"]}
1
+ {"version":3,"sources":["../../src/actions/NullValue.ts","../../src/aggregate/WhereClause.ts","../../src/mapping/DurationMapping.ts","../../src/groupby/GroupByClause.ts","../../src/object/Result.ts","../../src/timeseries/timeseries.ts"],"names":[],"mappings":";;;AAgBa,IAAA,UAAA,GAAa,MAAO,CAAA,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,EACR,OAAS,EAAA;AACX,CAAA;;;ACpBO,IAAM,eAAkB,GAAA;AAAA,EAC7B,GAAG,mBAAA;AAAA,EACH,SAAW,EAAA,UAAA;AAAA,EACX,UAAY,EAAA;AACd;;;ACAO,SAAS,KAAK,CAAG,EAAA;AACtB,EAAA,OAAO,OAAW,IAAA,CAAA;AACpB;;;ACNO,IAAM,yBAA4B,GAAA;AAAA,EACvC,IAAM,EAAA,cAAA;AAAA,EACN,cAAgB,EAAA,cAAA;AAAA,EAChB,GAAG;AACL","file":"index.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const NULL_VALUE = Symbol.for(\"NULL_VALUE\");","/*\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// the value side of this needs to match DistanceUnit from @osdk/foundry but we don't\n// want the dependency\nexport const DistanceUnitMapping = {\n \"centimeter\": \"CENTIMETERS\",\n \"centimeters\": \"CENTIMETERS\",\n \"cm\": \"CENTIMETERS\",\n \"meter\": \"METERS\",\n \"meters\": \"METERS\",\n \"m\": \"METERS\",\n \"kilometer\": \"KILOMETERS\",\n \"kilometers\": \"KILOMETERS\",\n \"km\": \"KILOMETERS\",\n \"inch\": \"INCHES\",\n \"inches\": \"INCHES\",\n \"foot\": \"FEET\",\n \"feet\": \"FEET\",\n \"yard\": \"YARDS\",\n \"yards\": \"YARDS\",\n \"mile\": \"MILES\",\n \"miles\": \"MILES\",\n \"nautical_mile\": \"NAUTICAL_MILES\",\n \"nauticalMile\": \"NAUTICAL_MILES\",\n \"nautical miles\": \"NAUTICAL_MILES\"\n};\n\n// FIXME we need to represent all types","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const TimeDurationMapping = {\n \"sec\": \"SECONDS\",\n \"seconds\": \"SECONDS\",\n \"min\": \"MINUTES\",\n \"minute\": \"MINUTES\",\n \"minutes\": \"MINUTES\",\n \"hr\": \"HOURS\",\n \"hrs\": \"HOURS\",\n \"hour\": \"HOURS\",\n \"hours\": \"HOURS\",\n \"day\": \"DAYS\",\n \"days\": \"DAYS\",\n \"wk\": \"WEEKS\",\n \"week\": \"WEEKS\",\n \"weeks\": \"WEEKS\",\n \"mos\": \"MONTHS\",\n \"month\": \"MONTHS\",\n \"months\": \"MONTHS\",\n \"yr\": \"YEARS\",\n \"year\": \"YEARS\",\n \"years\": \"YEARS\"\n};","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\nexport const DurationMapping = {\n ...TimeDurationMapping,\n \"quarter\": \"QUARTERS\",\n \"quarters\": \"QUARTERS\"\n};","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Check if a result was successfully received\n * @param a - result wrapped value\n * @returns whether a result has a value in it\n */\nexport function isOk(a) {\n return \"value\" in a;\n}\n\n/**\n * Check if a result contains an error value\n * @param a Result wrapped value\n * @returns whether a result has an error in it\n */\nexport function isError(a) {\n return \"error\" in a;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\nexport const TimeseriesDurationMapping = {\n \"ms\": \"MILLISECONDS\",\n \"milliseconds\": \"MILLISECONDS\",\n ...TimeDurationMapping\n};"]}
@@ -1,5 +1,5 @@
1
- import { A as AttachmentUpload, M as MediaReference, a as Attachment, O as ObjectTypeDefinition, b as ObjectIdentifiers, c as OsdkObjectPrimaryKeyType, d as ObjectSet, I as InterfaceDefinition, C as CompileTimeMetadata, e as OsdkMetadata, R as ReleaseStatus, P as PropertyValueWireToClient, f as PrimaryKeyTypes, g as OsdkBase } from './ObjectSet-C3Ud9v-e.cjs';
2
- export { h as AggregateOpts, i as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, l as AggregationClause, j as AggregationResultsWithGroups, k as AggregationResultsWithoutGroups, m as AggregationsResults, u as AllGroupByValues, x as AsyncIterArgs, y as Augment, z as Augments, U as BaseObjectSet, a3 as BaseWirePropertyTypes, a6 as ConvertProps, s as DerivedProperty, D as DistanceUnitMapping, t as DurationMapping, F as FetchPageArgs, H as FetchPageResult, G as GeoFilterOptions, n as GeoFilter_Intersects, o as GeoFilter_Within, aa as GeotimeSeriesProperty, v as GroupByClause, w as GroupByRange, Y as InterfaceMetadata, af as LinkNames, ae as LinkedType, K as Media, L as MediaMetadata, N as NullabilityAdherence, a0 as ObjectMetadata, Z as ObjectOrInterfaceDefinition, X as ObjectSetSubscription, $ as ObjectSpecifier, a7 as Osdk, r as OsdkObjectLinksObject, q as OsdkObjectPropertyType, a8 as PageResult, p as PossibleWhereClauseFilters, a5 as PrimaryKeyType, a1 as PropertyDef, _ as PropertyKeys, T as Result, B as SelectArg, E as SelectArgToKeys, S as SingleLinkAccessor, J as SingleOsdkResult, ab as TimeSeriesPoint, ac as TimeSeriesProperty, ad as TimeSeriesQuery, a9 as TimeseriesDurationMapping, V as ValidAggregationKeys, a2 as VersionBound, W as WhereClause, a4 as WirePropertyTypes, Q as isOk } from './ObjectSet-C3Ud9v-e.cjs';
1
+ import { A as AttachmentUpload, M as MediaReference, a as MediaUpload, b as Attachment, O as ObjectTypeDefinition, c as ObjectIdentifiers, d as OsdkObjectPrimaryKeyType, e as ObjectSet, I as InterfaceDefinition, C as CompileTimeMetadata, f as OsdkMetadata, R as ReleaseStatus, P as PropertyValueWireToClient, g as PrimaryKeyTypes, h as OsdkBase } from './ObjectSet-C67LQ5JX.cjs';
2
+ export { i as AggregateOpts, j as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, m as AggregationClause, k as AggregationResultsWithGroups, l as AggregationResultsWithoutGroups, n as AggregationsResults, v as AllGroupByValues, y as AsyncIterArgs, z as Augment, B as Augments, X as BaseObjectSet, a4 as BaseWirePropertyTypes, a7 as ConvertProps, t as DerivedProperty, D as DistanceUnitMapping, u as DurationMapping, F as FetchPageArgs, J as FetchPageResult, G as GeoFilterOptions, o as GeoFilter_Intersects, p as GeoFilter_Within, ab as GeotimeSeriesProperty, w as GroupByClause, x as GroupByRange, Z as InterfaceMetadata, ag as LinkNames, af as LinkedType, L as Media, Q as MediaMetadata, N as NullabilityAdherence, a1 as ObjectMetadata, _ as ObjectOrInterfaceDefinition, Y as ObjectSetSubscription, a0 as ObjectSpecifier, a8 as Osdk, s as OsdkObjectLinksObject, r as OsdkObjectPropertyType, a9 as PageResult, q as PossibleWhereClauseFilters, a6 as PrimaryKeyType, a2 as PropertyDef, $ as PropertyKeys, U as Result, E as SelectArg, H as SelectArgToKeys, S as SingleLinkAccessor, K as SingleOsdkResult, ac as TimeSeriesPoint, ad as TimeSeriesProperty, ae as TimeSeriesQuery, aa as TimeseriesDurationMapping, V as ValidAggregationKeys, a3 as VersionBound, W as WhereClause, a5 as WirePropertyTypes, T as isOk } from './ObjectSet-C67LQ5JX.cjs';
3
3
  import 'type-fest';
4
4
  import 'geojson';
5
5
 
@@ -62,7 +62,7 @@ interface DataValueClientToWire {
62
62
  string: string;
63
63
  timestamp: string;
64
64
  set: Set<any>;
65
- mediaReference: MediaReference;
65
+ mediaReference: MediaReference | MediaUpload;
66
66
  twoDimensionalAggregation: {
67
67
  key: AllowedBucketKeyTypes$1;
68
68
  value: AllowedBucketTypes$1;
@@ -169,6 +169,10 @@ type ParameterEvaluatedConstraint = {
169
169
  type: "unevaluable";
170
170
  };
171
171
 
172
+ declare const NULL_VALUE: symbol & {
173
+ __type: "NULL_VALUE";
174
+ };
175
+
172
176
  type ApplyActionOptions = {
173
177
  $returnEdits?: true;
174
178
  $validateOnly?: false;
@@ -207,6 +211,11 @@ declare namespace ActionParam {
207
211
  type StructType<T extends Record<string, keyof DataValueClientToWire>> = {
208
212
  [K in keyof T]: DataValueClientToWire[T[K]];
209
213
  };
214
+ /**
215
+ * Type of the symbol that indicates that a "null" value should be passed for the action parameter.
216
+ * For any autogenerated modify actions, this will cause the action to clear the value of the parameter.
217
+ */
218
+ type NullValueType = typeof NULL_VALUE;
210
219
  }
211
220
  type ActionEditResponse = ActionResults;
212
221
  type ActionValidationResponse = ValidateActionResponseV2;
@@ -447,4 +456,4 @@ declare namespace Logger {
447
456
  }
448
457
  }
449
458
 
450
- export { type ActionDefinition, type ActionEditResponse, ActionMetadata, ActionParam, type ActionReturnTypeForOptions, type ActionValidationResponse, type AllowedBucketKeyTypes$1 as AllowedBucketKeyTypes, type AllowedBucketTypes$1 as AllowedBucketTypes, type ApplyActionOptions, type ApplyBatchActionOptions, Attachment, AttachmentUpload, CompileTimeMetadata, type DataValueClientToWire, type DataValueWireToClient, InterfaceDefinition, Logger, MediaReference, ObjectIdentifiers, type ObjectQueryDataType, type ObjectSet, type ObjectSetQueryDataType, ObjectTypeDefinition, type OntologyMetadata, OsdkBase, type OsdkObject, PrimaryKeyTypes, PropertyValueWireToClient, type QueryDataTypeDefinition, type QueryDefinition, type QueryMetadata, QueryParam, type QueryParameterDefinition, QueryResult, type Range, type ThreeDimensionalAggregation, type ThreeDimensionalQueryAggregationDefinition, type TwoDimensionalAggregation, type TwoDimensionalQueryAggregationDefinition };
459
+ export { type ActionDefinition, type ActionEditResponse, ActionMetadata, ActionParam, type ActionReturnTypeForOptions, type ActionValidationResponse, type AllowedBucketKeyTypes$1 as AllowedBucketKeyTypes, type AllowedBucketTypes$1 as AllowedBucketTypes, type ApplyActionOptions, type ApplyBatchActionOptions, Attachment, AttachmentUpload, CompileTimeMetadata, type DataValueClientToWire, type DataValueWireToClient, InterfaceDefinition, Logger, MediaReference, MediaUpload, NULL_VALUE, ObjectIdentifiers, type ObjectQueryDataType, type ObjectSet, type ObjectSetQueryDataType, ObjectTypeDefinition, type OntologyMetadata, OsdkBase, type OsdkObject, PrimaryKeyTypes, PropertyValueWireToClient, type QueryDataTypeDefinition, type QueryDefinition, type QueryMetadata, QueryParam, type QueryParameterDefinition, QueryResult, type Range, type ThreeDimensionalAggregation, type ThreeDimensionalQueryAggregationDefinition, type TwoDimensionalAggregation, type TwoDimensionalQueryAggregationDefinition };
@@ -1,5 +1,5 @@
1
- import { Z as ObjectOrInterfaceDefinition, _ as PropertyKeys, M as MediaReference, O as ObjectTypeDefinition, N as NullabilityAdherence, B as SelectArg, a7 as Osdk, ag as ExtractOptions, F as FetchPageArgs, H as FetchPageResult, g as OsdkBase } from '../ObjectSet-C3Ud9v-e.cjs';
2
- export { ah as MinimalObjectSet } from '../ObjectSet-C3Ud9v-e.cjs';
1
+ import { _ as ObjectOrInterfaceDefinition, $ as PropertyKeys, M as MediaReference, O as ObjectTypeDefinition, N as NullabilityAdherence, E as SelectArg, a8 as Osdk, ah as ExtractOptions, F as FetchPageArgs, J as FetchPageResult, h as OsdkBase } from '../ObjectSet-C67LQ5JX.cjs';
2
+ export { ai as MinimalObjectSet } from '../ObjectSet-C67LQ5JX.cjs';
3
3
  import 'type-fest';
4
4
  import 'geojson';
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","names":["ActionParam"],"sources":["Actions.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 { DataValueClientToWire } from \"../mapping/DataValueMapping.js\";\nimport type { ObjectSet } from \"../objectSet/ObjectSet.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { ObjectIdentifiers } from \"../OsdkBase.js\";\nimport type { OsdkObjectPrimaryKeyType } from \"../OsdkObjectPrimaryKeyType.js\";\n\nimport type {\n ActionResults,\n ValidateActionResponseV2,\n} from \"./ActionResults.js\";\n\nexport type ApplyActionOptions =\n | { $returnEdits?: true; $validateOnly?: false }\n | {\n $validateOnly?: true;\n $returnEdits?: false;\n };\n\nexport type ApplyBatchActionOptions = { $returnEdits?: boolean };\n\n/**\n * Helper types for converting action definition parameter types to typescript types\n */\nexport namespace ActionParam {\n /**\n * Helper type to convert action definition parameter primitives to typescript types\n */\n export type PrimitiveType<T extends keyof DataValueClientToWire> =\n DataValueClientToWire[T];\n\n /**\n * Helper type to convert action definition parameter object types to typescript types\n */\n export type ObjectType<T extends ObjectTypeDefinition> =\n | ObjectIdentifiers<T>\n | OsdkObjectPrimaryKeyType<T>;\n\n /**\n * Helper type to convert action definition parameter object sets to typescript types\n */\n export type ObjectSetType<T extends ObjectTypeDefinition> = ObjectSet<T>;\n\n /**\n * Helper type to convert action definition parameter interface types to typescript types\n */\n export type InterfaceType<T extends InterfaceDefinition> = {\n $objectType: CompileTimeMetadata<T> extends { implementedBy: infer U }\n ? (U extends ReadonlyArray<never> ? string\n : U extends ReadonlyArray<string> ? U[number]\n : string)\n : string;\n $primaryKey: string | number;\n };\n\n export type StructType<\n T extends Record<string, keyof DataValueClientToWire>,\n > = { [K in keyof T]: DataValueClientToWire[T[K]] };\n}\n\nexport type ActionEditResponse = ActionResults;\nexport type ActionValidationResponse = ValidateActionResponseV2;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0BA;AACA;AACA;AAFA,WAGiBA,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"Actions.js","names":["ActionParam"],"sources":["Actions.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 { DataValueClientToWire } from \"../mapping/DataValueMapping.js\";\nimport type { ObjectSet } from \"../objectSet/ObjectSet.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { ObjectIdentifiers } from \"../OsdkBase.js\";\nimport type { OsdkObjectPrimaryKeyType } from \"../OsdkObjectPrimaryKeyType.js\";\n\nimport type {\n ActionResults,\n ValidateActionResponseV2,\n} from \"./ActionResults.js\";\nimport type { NULL_VALUE } from \"./NullValue.js\";\n\nexport type ApplyActionOptions =\n | { $returnEdits?: true; $validateOnly?: false }\n | {\n $validateOnly?: true;\n $returnEdits?: false;\n };\n\nexport type ApplyBatchActionOptions = { $returnEdits?: boolean };\n\n/**\n * Helper types for converting action definition parameter types to typescript types\n */\nexport namespace ActionParam {\n /**\n * Helper type to convert action definition parameter primitives to typescript types\n */\n export type PrimitiveType<T extends keyof DataValueClientToWire> =\n DataValueClientToWire[T];\n\n /**\n * Helper type to convert action definition parameter object types to typescript types\n */\n export type ObjectType<T extends ObjectTypeDefinition> =\n | ObjectIdentifiers<T>\n | OsdkObjectPrimaryKeyType<T>;\n\n /**\n * Helper type to convert action definition parameter object sets to typescript types\n */\n export type ObjectSetType<T extends ObjectTypeDefinition> = ObjectSet<T>;\n\n /**\n * Helper type to convert action definition parameter interface types to typescript types\n */\n export type InterfaceType<T extends InterfaceDefinition> = {\n $objectType: CompileTimeMetadata<T> extends { implementedBy: infer U }\n ? (U extends ReadonlyArray<never> ? string\n : U extends ReadonlyArray<string> ? U[number]\n : string)\n : string;\n $primaryKey: string | number;\n };\n\n export type StructType<\n T extends Record<string, keyof DataValueClientToWire>,\n > = { [K in keyof T]: DataValueClientToWire[T[K]] };\n\n /**\n * Type of the symbol that indicates that a \"null\" value should be passed for the action parameter.\n * For any autogenerated modify actions, this will cause the action to clear the value of the parameter.\n */\n export type NullValueType = typeof NULL_VALUE;\n}\n\nexport type ActionEditResponse = ActionResults;\nexport type ActionValidationResponse = ValidateActionResponseV2;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA2BA;AACA;AACA;AAFA,WAGiBA,WAAW","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export const NULL_VALUE = Symbol.for("NULL_VALUE");
18
+ //# sourceMappingURL=NullValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NullValue.js","names":["NULL_VALUE","Symbol","for"],"sources":["NullValue.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\nexport const NULL_VALUE: symbol & { __type: \"NULL_VALUE\" } = Symbol.for(\n \"NULL_VALUE\",\n) as symbol & { __type: \"NULL_VALUE\" };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAA6C,GAAGC,MAAM,CAACC,GAAG,CACrE,YACF,CAAsC","ignoreList":[]}