@osdk/api 2.3.1 → 2.4.0-beta.10

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 (80) hide show
  1. package/CHANGELOG.md +25 -15
  2. package/build/browser/OsdkObjectFrom.js.map +1 -1
  3. package/build/browser/actions/Actions.js.map +1 -1
  4. package/build/browser/actions/NullValue.js +18 -0
  5. package/build/browser/actions/NullValue.js.map +1 -0
  6. package/build/browser/aggregate/AggregateOptsThatErrors.js.map +1 -1
  7. package/build/browser/aggregate/AggregationResultsWithGroups.js.map +1 -1
  8. package/build/browser/derivedProperties/DerivedProperty.js +1 -16
  9. package/build/browser/derivedProperties/DerivedProperty.js.map +1 -1
  10. package/build/browser/derivedProperties/Expressions.js +2 -0
  11. package/build/browser/derivedProperties/Expressions.js.map +1 -0
  12. package/build/browser/groupby/GroupByClause.js.map +1 -1
  13. package/build/browser/index.js +1 -0
  14. package/build/browser/index.js.map +1 -1
  15. package/build/browser/mapping/DataValueMapping.js.map +1 -1
  16. package/build/browser/mapping/PropertyValueMapping.js.map +1 -1
  17. package/build/browser/object/Media.js.map +1 -1
  18. package/build/browser/objectSet/ObjectSet.js.map +1 -1
  19. package/build/browser/objectSet/ObjectSet.test.js +240 -8
  20. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  21. package/build/browser/ontology/WirePropertyTypes.js.map +1 -1
  22. package/build/browser/test/EmployeeApiTest.js.map +1 -1
  23. package/build/cjs/{ObjectSet-DwxUt6uD.d.cts → ObjectSet-DmnkezS6.d.cts} +112 -15
  24. package/build/cjs/index.cjs +4 -0
  25. package/build/cjs/index.cjs.map +1 -1
  26. package/build/cjs/index.d.cts +13 -4
  27. package/build/cjs/public/unstable.d.cts +2 -2
  28. package/build/esm/OsdkObjectFrom.js.map +1 -1
  29. package/build/esm/actions/Actions.js.map +1 -1
  30. package/build/esm/actions/NullValue.js +18 -0
  31. package/build/esm/actions/NullValue.js.map +1 -0
  32. package/build/esm/aggregate/AggregateOptsThatErrors.js.map +1 -1
  33. package/build/esm/aggregate/AggregationResultsWithGroups.js.map +1 -1
  34. package/build/esm/derivedProperties/DerivedProperty.js +1 -16
  35. package/build/esm/derivedProperties/DerivedProperty.js.map +1 -1
  36. package/build/esm/derivedProperties/Expressions.js +2 -0
  37. package/build/esm/derivedProperties/Expressions.js.map +1 -0
  38. package/build/esm/groupby/GroupByClause.js.map +1 -1
  39. package/build/esm/index.js +1 -0
  40. package/build/esm/index.js.map +1 -1
  41. package/build/esm/mapping/DataValueMapping.js.map +1 -1
  42. package/build/esm/mapping/PropertyValueMapping.js.map +1 -1
  43. package/build/esm/object/Media.js.map +1 -1
  44. package/build/esm/objectSet/ObjectSet.js.map +1 -1
  45. package/build/esm/objectSet/ObjectSet.test.js +240 -8
  46. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  47. package/build/esm/ontology/WirePropertyTypes.js.map +1 -1
  48. package/build/esm/test/EmployeeApiTest.js.map +1 -1
  49. package/build/types/OsdkObjectFrom.d.ts +8 -2
  50. package/build/types/OsdkObjectFrom.d.ts.map +1 -1
  51. package/build/types/actions/Actions.d.ts +2 -0
  52. package/build/types/actions/Actions.d.ts.map +1 -1
  53. package/build/types/actions/NullValue.d.ts +3 -0
  54. package/build/types/actions/NullValue.d.ts.map +1 -0
  55. package/build/types/aggregate/AggregateOptsThatErrors.d.ts +9 -1
  56. package/build/types/aggregate/AggregateOptsThatErrors.d.ts.map +1 -1
  57. package/build/types/aggregate/AggregationResultsWithGroups.d.ts +10 -1
  58. package/build/types/aggregate/AggregationResultsWithGroups.d.ts.map +1 -1
  59. package/build/types/derivedProperties/DerivedProperty.d.ts +32 -6
  60. package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -1
  61. package/build/types/derivedProperties/Expressions.d.ts +53 -0
  62. package/build/types/derivedProperties/Expressions.d.ts.map +1 -0
  63. package/build/types/groupby/GroupByClause.d.ts +10 -2
  64. package/build/types/groupby/GroupByClause.d.ts.map +1 -1
  65. package/build/types/index.d.ts +3 -2
  66. package/build/types/index.d.ts.map +1 -1
  67. package/build/types/mapping/DataValueMapping.d.ts +2 -2
  68. package/build/types/mapping/DataValueMapping.d.ts.map +1 -1
  69. package/build/types/mapping/PropertyValueMapping.d.ts +2 -0
  70. package/build/types/mapping/PropertyValueMapping.d.ts.map +1 -1
  71. package/build/types/object/Media.d.ts +7 -0
  72. package/build/types/object/Media.d.ts.map +1 -1
  73. package/build/types/objectSet/ObjectSet.d.ts +16 -1
  74. package/build/types/objectSet/ObjectSet.d.ts.map +1 -1
  75. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
  76. package/build/types/ontology/WirePropertyTypes.d.ts +1 -1
  77. package/build/types/ontology/WirePropertyTypes.d.ts.map +1 -1
  78. package/build/types/test/EmployeeApiTest.d.ts +5 -1
  79. package/build/types/test/EmployeeApiTest.d.ts.map +1 -1
  80. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"DerivedProperty.js","names":["DerivedProperty"],"sources":["DerivedProperty.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ValidAggregationKeys } from \"../aggregate/AggregatableKeys.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type {\n CollectWithPropAggregations,\n MinMaxWithPropAggregateOption,\n} from \"./WithPropertiesAggregationOptions.js\";\n\ndeclare const DerivedPropertyDefinitionBrand: unique symbol;\n\nexport namespace DerivedProperty {\n export interface Definition<\n T extends SimplePropertyDef,\n Q extends ObjectOrInterfaceDefinition,\n > {\n readonly [DerivedPropertyDefinitionBrand]: true;\n }\n\n export type Clause<\n Q extends ObjectOrInterfaceDefinition,\n > = {\n [key: string]: DerivedPropertyCreator<Q, SimplePropertyDef>;\n };\n\n interface BaseBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {\n }\n\n export interface Builder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends BaseBuilder<Q, CONSTRAINED> {\n }\n\n export interface AggregateBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends BaseBuilder<Q, CONSTRAINED>, Aggregatable<Q> {\n }\n\n // export interface SelectPropertyBuilder<\n // Q extends ObjectOrInterfaceDefinition,\n // CONSTRAINED extends boolean,\n // > extends AggregateBuilder<Q, CONSTRAINED> {\n // }\n}\n\nexport type DerivedPropertyCreator<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n> = (\n baseObjectSet: DerivedProperty.Builder<Q, false>,\n) => DerivedProperty.Definition<T, Q>;\n\ntype BuilderTypeFromConstraint<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true>\n : DerivedProperty.AggregateBuilder<Q, false>;\n\ntype Filterable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly where: (\n clause: WhereClause<Q>,\n ) => BuilderTypeFromConstraint<Q, CONSTRAINED>;\n};\n\ntype Pivotable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CONSTRAINED extends true\n ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : NonNullable<CompileTimeMetadata<Q>[\"links\"][L][\"multiplicity\"]> extends\n true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : DerivedProperty.AggregateBuilder<LinkedType<Q, L>, false>;\n};\n\ntype Aggregatable<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n readonly aggregate: <\n V extends ValidAggregationKeys<\n Q,\n \"withPropertiesAggregate\"\n >,\n >(\n aggregationSpecifier: V,\n opts?: V extends `${any}:${infer P}`\n ? P extends CollectWithPropAggregations ? { limit: number }\n : P extends \"approximatePercentile\" ? { percentile: number }\n : never\n : never,\n ) => DerivedProperty.Definition<\n V extends `${infer N}:${infer P}`\n ? P extends CollectWithPropAggregations ? SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][N][\"type\"],\n \"nullable\",\n \"array\"\n >\n : P extends MinMaxWithPropAggregateOption ? SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][N][\"type\"],\n \"nullable\",\n \"single\"\n >\n : P extends \"approximateDistinct\" | \"exactDistinct\"\n ? SimplePropertyDef.Make<\n \"integer\",\n \"non-nullable\",\n \"single\"\n >\n : SimplePropertyDef.Make<\n \"double\",\n \"nullable\",\n \"single\"\n >\n : V extends \"$count\" ? SimplePropertyDef.Make<\n \"integer\",\n \"non-nullable\",\n \"single\"\n >\n : never,\n Q\n >;\n};\n\n// type Selectable<Q extends ObjectOrInterfaceDefinition> = {\n// readonly selectProperty: <R extends PropertyKeys<Q>>(\n// propertyName: R,\n// ) => DefinitionForType<\n// Q,\n// SimplePropertyDef.Make<\n// CompileTimeMetadata<Q>[\"properties\"][R][\"type\"],\n// CompileTimeMetadata<Q>[\"properties\"][R][\"nullable\"] extends true\n// ? \"nullable\"\n// : \"non-nullable\",\n// CompileTimeMetadata<Q>[\"properties\"][R][\"multiplicity\"] extends true\n// ? \"array\"\n// : \"single\"\n// >\n// >;\n// };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA+BiBA,eAAe,EA0HhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"DerivedProperty.js","names":["DerivedProperty"],"sources":["DerivedProperty.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ValidAggregationKeys } from \"../aggregate/AggregatableKeys.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type {\n DatetimeExpressions,\n DefinitionForType,\n NumericExpressions,\n} from \"./Expressions.js\";\nimport type {\n CollectWithPropAggregations,\n MinMaxWithPropAggregateOption,\n} from \"./WithPropertiesAggregationOptions.js\";\n\ndeclare const DerivedPropertyDefinitionBrand: unique symbol;\n\nexport namespace DerivedProperty {\n export interface Definition<\n T extends SimplePropertyDef,\n Q extends ObjectOrInterfaceDefinition,\n > {\n readonly [DerivedPropertyDefinitionBrand]: true;\n }\n\n export interface NumericPropertyDefinition<\n T extends SimplePropertyDef,\n Q extends ObjectOrInterfaceDefinition,\n > extends Definition<T, Q>, NumericExpressions<Q, T> {}\n\n export interface DatetimePropertyDefinition<\n T extends SimplePropertyDef,\n Q extends ObjectOrInterfaceDefinition,\n > extends Definition<T, Q>, DatetimeExpressions<Q, T> {}\n\n export type Clause<\n Q extends ObjectOrInterfaceDefinition,\n > = {\n [key: string]: DerivedPropertyCreator<Q, SimplePropertyDef>;\n };\n\n interface BaseBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {\n }\n\n export interface Builder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends BaseBuilder<Q, CONSTRAINED>, Selectable<Q>, Constant<Q> {\n }\n\n export interface AggregateBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends BaseBuilder<Q, CONSTRAINED>, Aggregatable<Q> {\n }\n\n export interface SelectPropertyBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {\n }\n\n export type ValidParts = \"DAYS\" | \"MONTHS\" | \"QUARTERS\" | \"YEARS\";\n}\n\nexport type DerivedPropertyCreator<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n> = (\n baseObjectSet: DerivedProperty.Builder<Q, false>,\n) =>\n | DerivedProperty.Definition<T, Q>\n | DerivedProperty.NumericPropertyDefinition<T, Q>\n | DerivedProperty.DatetimePropertyDefinition<T, Q>;\n\ntype BuilderTypeFromConstraint<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true>\n : DerivedProperty.SelectPropertyBuilder<Q, false>;\n\ntype Filterable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly where: (\n clause: WhereClause<Q>,\n ) => BuilderTypeFromConstraint<Q, CONSTRAINED>;\n};\n\ntype Pivotable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CONSTRAINED extends true\n ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : NonNullable<CompileTimeMetadata<Q>[\"links\"][L][\"multiplicity\"]> extends\n true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : DerivedProperty.SelectPropertyBuilder<LinkedType<Q, L>, false>;\n};\n\ntype Constant<Q extends ObjectOrInterfaceDefinition> = {\n readonly constant: {\n readonly double: (\n value: number,\n ) => DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"double\", \"non-nullable\", \"single\">,\n Q\n >;\n\n readonly integer: (\n value: number,\n ) => DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"integer\", \"non-nullable\", \"single\">,\n Q\n >;\n readonly long: (\n value: string,\n ) => DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"long\", \"non-nullable\", \"single\">,\n Q\n >;\n\n readonly datetime: (\n value: string,\n ) => DerivedProperty.DatetimePropertyDefinition<\n SimplePropertyDef.Make<\"datetime\", \"non-nullable\", \"single\">,\n Q\n >;\n readonly timestamp: (\n value: string,\n ) => DerivedProperty.DatetimePropertyDefinition<\n SimplePropertyDef.Make<\"timestamp\", \"non-nullable\", \"single\">,\n Q\n >;\n };\n};\n\ntype Aggregatable<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n readonly aggregate: <\n V extends ValidAggregationKeys<\n Q,\n \"withPropertiesAggregate\"\n >,\n >(\n aggregationSpecifier: V,\n opts?: V extends `${any}:${infer P}`\n ? P extends CollectWithPropAggregations ? { limit: number }\n : P extends \"approximatePercentile\" ? { percentile: number }\n : never\n : never,\n ) => DefinitionForType<\n Q,\n V extends `${infer N}:${infer P}`\n ? P extends CollectWithPropAggregations ? SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][N][\"type\"],\n \"nullable\",\n \"array\"\n >\n : P extends MinMaxWithPropAggregateOption ? SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][N][\"type\"],\n \"nullable\",\n \"single\"\n >\n : P extends \"approximateDistinct\" | \"exactDistinct\"\n ? SimplePropertyDef.Make<\n \"integer\",\n \"non-nullable\",\n \"single\"\n >\n : SimplePropertyDef.Make<\n \"double\",\n \"nullable\",\n \"single\"\n >\n : V extends \"$count\" ? SimplePropertyDef.Make<\n \"integer\",\n \"non-nullable\",\n \"single\"\n >\n : never\n >;\n};\n\ntype Selectable<Q extends ObjectOrInterfaceDefinition> = {\n readonly selectProperty: <R extends PropertyKeys<Q>>(\n propertyName: R,\n ) => DefinitionForType<\n Q,\n SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][R][\"type\"],\n CompileTimeMetadata<Q>[\"properties\"][R][\"nullable\"] extends true\n ? \"nullable\"\n : \"non-nullable\",\n CompileTimeMetadata<Q>[\"properties\"][R][\"multiplicity\"] extends true\n ? \"array\"\n : \"single\"\n >\n >;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAqCiBA,eAAe","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Expressions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Expressions.js","names":[],"sources":["Expressions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { WirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\nimport type { DerivedProperty } from \"./DerivedProperty.js\";\n\ntype WithPropertiesNumerics =\n | \"integer\"\n | \"double\"\n | \"float\"\n | \"short\"\n | \"long\";\n\ntype WithPropertiesDatetime =\n | \"datetime\"\n | \"timestamp\";\n\nexport type DefinitionForType<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n> = SimplePropertyDef.ExtractMultiplicity<T> extends \"array\"\n ? DerivedProperty.Definition<T, Q>\n : SimplePropertyDef.ExtractWirePropertyType<T> extends WithPropertiesNumerics\n ? DerivedProperty.NumericPropertyDefinition<T, Q>\n : SimplePropertyDef.ExtractWirePropertyType<T> extends WithPropertiesDatetime\n ? DerivedProperty.DatetimePropertyDefinition<T, Q>\n : DerivedProperty.Definition<T, Q>;\n\ntype NumericExpressionArg<Q extends ObjectOrInterfaceDefinition> =\n | number\n | DerivedProperty.NumericPropertyDefinition<any, Q>;\n\ntype ReturnTypeForNumericMethod<\n Q extends ObjectOrInterfaceDefinition,\n LEFT extends WirePropertyTypes,\n RIGHT extends WirePropertyTypes,\n> = \"double\" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"double\", \"non-nullable\", \"single\">,\n Q\n >\n : \"float\" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"double\", \"non-nullable\", \"single\">,\n Q\n >\n : \"long\" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"long\", \"non-nullable\", \"single\">,\n Q\n >\n : DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"integer\", \"non-nullable\", \"single\">,\n Q\n >;\n\ntype ReturnTypeForDatetimeMethod<\n Q extends ObjectOrInterfaceDefinition,\n LEFT extends WirePropertyTypes,\n RIGHT extends WirePropertyTypes,\n> = \"timestamp\" extends (LEFT | RIGHT)\n ? DerivedProperty.DatetimePropertyDefinition<\n SimplePropertyDef.Make<\"timestamp\", \"non-nullable\", \"single\">,\n Q\n >\n : DerivedProperty.DatetimePropertyDefinition<\n SimplePropertyDef.Make<\"datetime\", \"non-nullable\", \"single\">,\n Q\n >;\n\ntype ExtractWirePropertyTypeFromNumericArg<\n Q extends ObjectOrInterfaceDefinition,\n ARG extends NumericExpressionArg<Q>,\n> = ARG extends number ? \"double\"\n : ARG extends DerivedProperty.NumericPropertyDefinition<infer T, Q>\n ? T extends SimplePropertyDef ? SimplePropertyDef.ExtractWirePropertyType<T>\n : never\n : ARG extends PropertyKeys.Filtered<Q, WithPropertiesNumerics>\n ? NonNullable<CompileTimeMetadata<Q>[\"properties\"][ARG][\"type\"]>\n : never;\n\nexport type NumericExpressions<\n Q extends ObjectOrInterfaceDefinition,\n LEFT_PROPERTY_TYPE extends SimplePropertyDef,\n> = {\n readonly add: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly subtract: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly multiply: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly divide: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly abs: () => DerivedProperty.NumericPropertyDefinition<\n LEFT_PROPERTY_TYPE,\n Q\n >;\n\n readonly negate: () => DerivedProperty.NumericPropertyDefinition<\n LEFT_PROPERTY_TYPE,\n Q\n >;\n\n readonly max: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly min: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n};\n\ntype DatetimeExpressionArg<Q extends ObjectOrInterfaceDefinition> =\n DerivedProperty.DatetimePropertyDefinition<any, Q>;\n\ntype ExtractPropertyTypeFromDatetimeArg<\n Q extends ObjectOrInterfaceDefinition,\n ARG extends DatetimeExpressionArg<Q>,\n> = ARG extends DerivedProperty.DatetimePropertyDefinition<infer T, Q>\n ? T extends SimplePropertyDef ? SimplePropertyDef.ExtractWirePropertyType<T>\n : never\n : ARG extends PropertyKeys.Filtered<Q, WithPropertiesDatetime>\n ? NonNullable<CompileTimeMetadata<Q>[\"properties\"][ARG][\"type\"]>\n : never;\n\nexport type DatetimeExpressions<\n Q extends ObjectOrInterfaceDefinition,\n LEFT_PROPERTY_TYPE extends SimplePropertyDef,\n> = {\n readonly min: <A extends DatetimeExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForDatetimeMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractPropertyTypeFromDatetimeArg<Q, A>\n >;\n readonly max: (\n value: DatetimeExpressionArg<Q>,\n ) => ReturnTypeForDatetimeMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractPropertyTypeFromDatetimeArg<Q, typeof value>\n >;\n readonly extractPart: (\n value: DerivedProperty.ValidParts,\n ) => DerivedProperty.Definition<\n SimplePropertyDef.Make<\"string\", \"non-nullable\", \"single\">,\n Q\n >;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"GroupByClause.js","names":["TimeDurationMapping","DurationMapping"],"sources":["GroupByClause.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 { AggregatableKeys } from \"../aggregate/AggregatableKeys.js\";\nimport { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\nimport type { ObjectOrInterfaceDefinition } from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { GroupByMapper } from \"./GroupByMapper.js\";\n\nexport type GroupByClause<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n [P in AggregatableKeys<Q>]?: GroupByEntry<Q, P>;\n};\n\ntype BaseGroupByValue =\n | \"exact\"\n | { $exactWithLimit: number }\n | ExactGroupByWithOptions;\n\ntype ExactGroupByWithOptions = {\n $exact: { $limit?: number; $defaultValue?: string };\n};\n\nexport type GroupByRange<T> = [T, T];\n\nexport type StringGroupByValue = BaseGroupByValue;\n\nexport type NumericGroupByValue = BaseGroupByValue | {\n $fixedWidth: number;\n} | { $ranges: GroupByRange<number>[] };\n\nexport type TimestampGroupByValue =\n | BaseGroupByValue\n | { $ranges: GroupByRange<string>[] }\n | { $duration: TimestampDurationGroupBy };\n\nexport type DateGroupByValue =\n | BaseGroupByValue\n | { $ranges: GroupByRange<string>[] }\n | { $duration: DatetimeDurationGroupBy };\n\nexport type BooleanGroupByValue = BaseGroupByValue;\n\nexport type TimestampTimeUnits =\n | DateTimeUnits\n | \"SECONDS\"\n | \"MINUTES\"\n | \"HOURS\";\n\nexport type DateTimeUnits = \"DAYS\" | \"WEEKS\" | \"MONTHS\" | \"YEARS\" | \"QUARTERS\";\nexport const DurationMapping: {\n quarter: \"QUARTERS\";\n quarters: \"QUARTERS\";\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 ...TimeDurationMapping,\n \"quarter\": \"QUARTERS\",\n \"quarters\": \"QUARTERS\",\n} satisfies Record<string, DateTimeUnits | TimestampTimeUnits>;\n\ninterface TimeValueMapping {\n SECONDS: number;\n MINUTES: number;\n HOURS: number;\n DAYS: number;\n WEEKS: 1;\n MONTHS: 1;\n YEARS: 1;\n QUARTERS: 1;\n}\n\ntype DurationGroupBy<A> = {\n [K in keyof typeof DurationMapping]: typeof DurationMapping[K] extends A\n ? [TimeValueMapping[typeof DurationMapping[K]], K]\n : never;\n}[keyof typeof DurationMapping];\n\ntype TimestampDurationGroupBy = DurationGroupBy<TimestampTimeUnits>;\ntype DatetimeDurationGroupBy = DurationGroupBy<DateTimeUnits>;\n\ntype GroupByEntry<\n Q extends ObjectOrInterfaceDefinition,\n P extends AggregatableKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][P][\"type\"] extends keyof GroupByMapper\n ? GroupByMapper[CompileTimeMetadata<Q>[\"properties\"][P][\"type\"]]\n : never;\n\nexport type AllGroupByValues = GroupByMapper[keyof GroupByMapper];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,mBAAmB,QAAQ,+BAA+B;AA+CnE,OAAO,MAAMC,eAuBZ,GAAG;EACF,GAAGD,mBAAmB;EACtB,SAAS,EAAE,UAAU;EACrB,UAAU,EAAE;AACd,CAA8D","ignoreList":[]}
1
+ {"version":3,"file":"GroupByClause.js","names":["TimeDurationMapping","DurationMapping"],"sources":["GroupByClause.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 { AggregatableKeys } from \"../aggregate/AggregatableKeys.js\";\nimport { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\nimport type { ObjectOrInterfaceDefinition } from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { GroupByMapper } from \"./GroupByMapper.js\";\n\nexport type GroupByClause<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n [P in AggregatableKeys<Q>]?: GroupByEntry<Q, P>;\n};\n\ntype BaseGroupByValue =\n | \"exact\"\n | { $exactWithLimit: number }\n | ExactGroupByWithOptions;\n\ntype ExactGroupByWithOptions = {\n $exact:\n & {\n $limit?: number;\n }\n & (\n | {\n $defaultValue?: undefined;\n $includeNullValue?: false;\n }\n | {\n $defaultValue: string;\n $includeNullValue?: false;\n }\n | {\n $defaultValue?: never;\n $includeNullValue: true;\n }\n );\n};\n\nexport type GroupByRange<T> = [T, T];\n\nexport type StringGroupByValue = BaseGroupByValue;\n\nexport type NumericGroupByValue = BaseGroupByValue | {\n $fixedWidth: number;\n} | { $ranges: GroupByRange<number>[] };\n\nexport type TimestampGroupByValue =\n | BaseGroupByValue\n | { $ranges: GroupByRange<string>[] }\n | { $duration: TimestampDurationGroupBy };\n\nexport type DateGroupByValue =\n | BaseGroupByValue\n | { $ranges: GroupByRange<string>[] }\n | { $duration: DatetimeDurationGroupBy };\n\nexport type BooleanGroupByValue = BaseGroupByValue;\n\nexport type TimestampTimeUnits =\n | DateTimeUnits\n | \"SECONDS\"\n | \"MINUTES\"\n | \"HOURS\";\n\nexport type DateTimeUnits = \"DAYS\" | \"WEEKS\" | \"MONTHS\" | \"YEARS\" | \"QUARTERS\";\nexport const DurationMapping: {\n quarter: \"QUARTERS\";\n quarters: \"QUARTERS\";\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 ...TimeDurationMapping,\n \"quarter\": \"QUARTERS\",\n \"quarters\": \"QUARTERS\",\n} satisfies Record<string, DateTimeUnits | TimestampTimeUnits>;\n\ninterface TimeValueMapping {\n SECONDS: number;\n MINUTES: number;\n HOURS: number;\n DAYS: number;\n WEEKS: 1;\n MONTHS: 1;\n YEARS: 1;\n QUARTERS: 1;\n}\n\ntype DurationGroupBy<A> = {\n [K in keyof typeof DurationMapping]: typeof DurationMapping[K] extends A\n ? [TimeValueMapping[typeof DurationMapping[K]], K]\n : never;\n}[keyof typeof DurationMapping];\n\ntype TimestampDurationGroupBy = DurationGroupBy<TimestampTimeUnits>;\ntype DatetimeDurationGroupBy = DurationGroupBy<DateTimeUnits>;\n\ntype GroupByEntry<\n Q extends ObjectOrInterfaceDefinition,\n P extends AggregatableKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][P][\"type\"] extends keyof GroupByMapper\n ? GroupByMapper[CompileTimeMetadata<Q>[\"properties\"][P][\"type\"]]\n : never;\n\nexport type AllGroupByValues = GroupByMapper[keyof GroupByMapper];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,mBAAmB,QAAQ,+BAA+B;AAgEnE,OAAO,MAAMC,eAuBZ,GAAG;EACF,GAAGD,mBAAmB;EACtB,SAAS,EAAE,UAAU;EACrB,UAAU,EAAE;AACd,CAA8D","ignoreList":[]}
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ export { NULL_VALUE } from "./actions/NullValue.js";
17
18
  export { DistanceUnitMapping } from "./aggregate/WhereClause.js";
18
19
  export { DurationMapping } from "./groupby/GroupByClause.js";
19
20
  export { isOk } from "./object/Result.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type {\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n} from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport type { DerivedProperty } from \"./derivedProperties/DerivedProperty.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type { Media, MediaMetadata, MediaReference } from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type { ObjectSpecifier } from \"./ontology/ObjectSpecifier.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type {\n ObjectIdentifiers,\n OsdkBase,\n PrimaryKeyType,\n} from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type {\n Range,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"./queries/Aggregations.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\nexport {};\nexport type { Logger } from \"./Logger.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,mBAAmB,QAAQ,4BAA4B;AAgBhE,SAASC,eAAe,QAAQ,4BAA4B;AA8B5D,SAASC,IAAI,QAAQ,oBAAoB;AAuDzC,SAASC,yBAAyB,QAAQ,4BAA4B;AAQtE","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["NULL_VALUE","DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport { NULL_VALUE } from \"./actions/NullValue.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type {\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n} from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport type { DerivedProperty } from \"./derivedProperties/DerivedProperty.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n ObjectSetArgs,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type {\n Media,\n MediaMetadata,\n MediaReference,\n MediaUpload,\n} from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type { ObjectSpecifier } from \"./ontology/ObjectSpecifier.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type {\n ObjectIdentifiers,\n OsdkBase,\n PrimaryKeyType,\n} from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type {\n Range,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"./queries/Aggregations.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\nexport {};\nexport type { Logger } from \"./Logger.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,UAAU,QAAQ,wBAAwB;AASnD,SAASC,mBAAmB,QAAQ,4BAA4B;AAgBhE,SAASC,eAAe,QAAQ,4BAA4B;AAoC5D,SAASC,IAAI,QAAQ,oBAAoB;AAuDzC,SAASC,yBAAyB,QAAQ,4BAA4B;AAQtE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"DataValueMapping.js","names":[],"sources":["DataValueMapping.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Attachment, AttachmentUpload } from \"../object/Attachment.js\";\nimport type { MediaReference } from \"../object/Media.js\";\n\n/**\n * Map from the DataValue type to the typescript type that we return\n */\nexport interface DataValueWireToClient {\n attachment: Attachment;\n boolean: boolean;\n byte: number;\n datetime: string;\n date: string;\n decimal: string;\n float: number;\n double: number;\n integer: number;\n long: string;\n marking: string;\n null: null;\n short: number;\n string: string;\n timestamp: string;\n mediaReference: MediaReference;\n twoDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[];\n threeDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[];\n struct: Record<string, any>;\n set: Set<any>;\n objectType: string;\n geohash: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n}\n\n/**\n * Map from the DataValue type to the typescript type that we accept\n */\nexport interface DataValueClientToWire {\n attachment: string | AttachmentUpload | Blob & { readonly name: string };\n boolean: boolean;\n byte: number;\n datetime: string;\n date: string;\n decimal: string | number;\n float: number;\n double: number;\n integer: number;\n long: string | number;\n marking: string;\n null: null;\n short: number;\n string: string;\n timestamp: string;\n set: Set<any>;\n mediaReference: MediaReference;\n twoDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[];\n threeDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[];\n struct: Record<string, any>;\n objectType: string;\n geohash: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n}\n\nexport type AllowedBucketTypes = string | number | boolean;\nexport type AllowedBucketKeyTypes =\n | AllowedBucketTypes\n | {\n startValue: AllowedBucketTypes;\n endValue: AllowedBucketTypes;\n };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"DataValueMapping.js","names":[],"sources":["DataValueMapping.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Attachment, AttachmentUpload } from \"../object/Attachment.js\";\nimport type { MediaReference, MediaUpload } from \"../object/Media.js\";\n\n/**\n * Map from the DataValue type to the typescript type that we return\n */\nexport interface DataValueWireToClient {\n attachment: Attachment;\n boolean: boolean;\n byte: number;\n datetime: string;\n date: string;\n decimal: string;\n float: number;\n double: number;\n integer: number;\n long: string;\n marking: string;\n null: null;\n short: number;\n string: string;\n timestamp: string;\n mediaReference: MediaReference;\n twoDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[];\n threeDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[];\n struct: Record<string, any>;\n set: Set<any>;\n objectType: string;\n geohash: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n}\n\n/**\n * Map from the DataValue type to the typescript type that we accept\n */\nexport interface DataValueClientToWire {\n attachment: string | AttachmentUpload | Blob & { readonly name: string };\n boolean: boolean;\n byte: number;\n datetime: string;\n date: string;\n decimal: string | number;\n float: number;\n double: number;\n integer: number;\n long: string | number;\n marking: string;\n null: null;\n short: number;\n string: string;\n timestamp: string;\n set: Set<any>;\n mediaReference: MediaReference | MediaUpload;\n twoDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[];\n threeDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[];\n struct: Record<string, any>;\n objectType: string;\n geohash: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n}\n\nexport type AllowedBucketTypes = string | number | boolean;\nexport type AllowedBucketKeyTypes =\n | AllowedBucketTypes\n | {\n startValue: AllowedBucketTypes;\n endValue: AllowedBucketTypes;\n };\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyValueMapping.js","names":[],"sources":["PropertyValueMapping.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Attachment, AttachmentUpload } from \"../object/Attachment.js\";\nimport type { Media } from \"../object/Media.js\";\nimport type {\n GeotimeSeriesProperty,\n TimeSeriesProperty,\n} from \"../timeseries/timeseries.js\";\n\n/**\n * Map from the PropertyDefinition type to the typescript type that we return\n */\nexport interface PropertyValueWireToClient {\n attachment: Attachment;\n boolean: boolean;\n byte: number;\n datetime: string;\n decimal: string;\n double: number;\n float: number;\n geopoint: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n integer: number;\n long: string;\n marking: string;\n mediaReference: Media;\n short: number;\n string: string;\n timestamp: string;\n numericTimeseries: TimeSeriesProperty<number>;\n stringTimeseries: TimeSeriesProperty<string>;\n sensorTimeseries: TimeSeriesProperty<string | number>;\n geotimeSeriesReference: GeotimeSeriesProperty<GeoJSON.Point>;\n}\n\nexport type GetClientPropertyValueFromWire<\n T extends\n | keyof PropertyValueWireToClient\n | Record<string, keyof PropertyValueWireToClient>,\n> = T extends keyof PropertyValueWireToClient ? PropertyValueWireToClient[T]\n : T extends Record<string, keyof PropertyValueWireToClient>\n ? { [K in keyof T]: PropertyValueWireToClient[T[K]] }\n : never;\n\n/**\n * Map from the PropertyDefinition type to the typescript type that we accept\n */\nexport interface PropertyValueClientToWire {\n attachment: string | AttachmentUpload | Blob & { readonly name: string };\n boolean: boolean;\n byte: number;\n datetime: string;\n decimal: string | number;\n double: number;\n float: number;\n geopoint: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n integer: number;\n long: string | number;\n marking: string;\n short: number;\n string: string;\n timestamp: string;\n mediaReference: Media;\n numericTimeseries: TimeSeriesProperty<number>;\n stringTimeseries: TimeSeriesProperty<string>;\n sensorTimeseries: TimeSeriesProperty<string | number>;\n geotimeSeriesReference: GeotimeSeriesProperty<GeoJSON.Point>;\n}\nexport type GetWirePropertyValueFromClient<\n T extends\n | keyof PropertyValueClientToWire\n | Record<string, keyof PropertyValueClientToWire>,\n> = T extends keyof PropertyValueClientToWire ? PropertyValueClientToWire[T]\n : T extends Record<string, keyof PropertyValueClientToWire>\n ? { [K in keyof T]: PropertyValueClientToWire[T[K]] }\n : never;\n\nexport interface PropertyValueWireToCreate {\n attachment: Attachment | string;\n boolean: boolean;\n byte: number;\n datetime: string;\n decimal: string;\n double: number;\n float: number;\n geopoint: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n integer: number;\n long: string;\n marking: string;\n mediaReference: Media;\n short: number;\n string: string;\n timestamp: string;\n numericTimeseries: TimeSeriesProperty<number>;\n stringTimeseries: TimeSeriesProperty<string>;\n sensorTimeseries: TimeSeriesProperty<string | number>;\n geotimeSeriesReference: GeotimeSeriesProperty<GeoJSON.Point>;\n vector: number[];\n}\n\nexport type GetCreatePropertyValueFromWire<\n T extends\n | keyof PropertyValueWireToCreate\n | Record<string, keyof PropertyValueWireToCreate>,\n> = T extends keyof PropertyValueWireToCreate ? PropertyValueWireToCreate[T]\n : T extends Record<string, keyof PropertyValueWireToCreate>\n ? { [K in keyof T]: PropertyValueWireToCreate[T[K]] }\n : never;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"PropertyValueMapping.js","names":[],"sources":["PropertyValueMapping.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Attachment, AttachmentUpload } from \"../object/Attachment.js\";\nimport type { Media } from \"../object/Media.js\";\nimport type {\n GeotimeSeriesProperty,\n TimeSeriesProperty,\n} from \"../timeseries/timeseries.js\";\n\n/**\n * Map from the PropertyDefinition type to the typescript type that we return\n */\nexport interface PropertyValueWireToClient {\n attachment: Attachment;\n boolean: boolean;\n byte: number;\n datetime: string;\n decimal: string;\n double: number;\n float: number;\n geopoint: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n integer: number;\n long: string;\n marking: string;\n mediaReference: Media;\n short: number;\n string: string;\n timestamp: string;\n numericTimeseries: TimeSeriesProperty<number>;\n stringTimeseries: TimeSeriesProperty<string>;\n sensorTimeseries: TimeSeriesProperty<string | number>;\n geotimeSeriesReference: GeotimeSeriesProperty<GeoJSON.Point>;\n vector: number[];\n}\n\nexport type GetClientPropertyValueFromWire<\n T extends\n | keyof PropertyValueWireToClient\n | Record<string, keyof PropertyValueWireToClient>,\n> = T extends keyof PropertyValueWireToClient ? PropertyValueWireToClient[T]\n : T extends Record<string, keyof PropertyValueWireToClient>\n ? { [K in keyof T]: PropertyValueWireToClient[T[K]] }\n : never;\n\n/**\n * Map from the PropertyDefinition type to the typescript type that we accept\n */\nexport interface PropertyValueClientToWire {\n attachment: string | AttachmentUpload | Blob & { readonly name: string };\n boolean: boolean;\n byte: number;\n datetime: string;\n decimal: string | number;\n double: number;\n float: number;\n geopoint: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n integer: number;\n long: string | number;\n marking: string;\n short: number;\n string: string;\n timestamp: string;\n mediaReference: Media;\n numericTimeseries: TimeSeriesProperty<number>;\n stringTimeseries: TimeSeriesProperty<string>;\n sensorTimeseries: TimeSeriesProperty<string | number>;\n geotimeSeriesReference: GeotimeSeriesProperty<GeoJSON.Point>;\n vector: number[];\n}\nexport type GetWirePropertyValueFromClient<\n T extends\n | keyof PropertyValueClientToWire\n | Record<string, keyof PropertyValueClientToWire>,\n> = T extends keyof PropertyValueClientToWire ? PropertyValueClientToWire[T]\n : T extends Record<string, keyof PropertyValueClientToWire>\n ? { [K in keyof T]: PropertyValueClientToWire[T[K]] }\n : never;\n\nexport interface PropertyValueWireToCreate {\n attachment: Attachment | string;\n boolean: boolean;\n byte: number;\n datetime: string;\n decimal: string;\n double: number;\n float: number;\n geopoint: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n integer: number;\n long: string;\n marking: string;\n mediaReference: Media;\n short: number;\n string: string;\n timestamp: string;\n numericTimeseries: TimeSeriesProperty<number>;\n stringTimeseries: TimeSeriesProperty<string>;\n sensorTimeseries: TimeSeriesProperty<string | number>;\n geotimeSeriesReference: GeotimeSeriesProperty<GeoJSON.Point>;\n vector: number[];\n}\n\nexport type GetCreatePropertyValueFromWire<\n T extends\n | keyof PropertyValueWireToCreate\n | Record<string, keyof PropertyValueWireToCreate>,\n> = T extends keyof PropertyValueWireToCreate ? PropertyValueWireToCreate[T]\n : T extends Record<string, keyof PropertyValueWireToCreate>\n ? { [K in keyof T]: PropertyValueWireToCreate[T[K]] }\n : never;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Media.js","names":[],"sources":["Media.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Media {\n /**\n * Fetches metadata for media reference property\n */\n fetchMetadata(): Promise<MediaMetadata>;\n /**\n * Fetches content of a media reference property\n */\n fetchContents(): Promise<Response>;\n /**\n * Returns the media reference\n */\n getMediaReference(): MediaReference;\n}\n\n/**\n * Unique identifier of a media item in Foundry.\n */\nexport interface MediaReference {\n mimeType: string;\n reference: {\n type: \"mediaSetViewItem\";\n mediaSetViewItem: {\n mediaItemRid: string;\n mediaSetRid: string;\n mediaSetViewRid: string;\n readToken?: string;\n };\n };\n}\n\n/**\n * Metadata of a media item\n */\nexport interface MediaMetadata {\n path?: string;\n sizeBytes: number;\n mediaType: string;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"Media.js","names":[],"sources":["Media.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Media {\n /**\n * Fetches metadata for media reference property\n */\n fetchMetadata(): Promise<MediaMetadata>;\n /**\n * Fetches content of a media reference property\n */\n fetchContents(): Promise<Response>;\n /**\n * Returns the media reference\n */\n getMediaReference(): MediaReference;\n}\n\n/**\n * Unique identifier of a media item in Foundry.\n */\nexport interface MediaReference {\n mimeType: string;\n reference: {\n type: \"mediaSetViewItem\";\n mediaSetViewItem: {\n mediaItemRid: string;\n mediaSetRid: string;\n mediaSetViewRid: string;\n readToken?: string;\n };\n };\n}\n\n/**\n * Object for uploading Media\n */\nexport interface MediaUpload {\n readonly path: string;\n readonly data: Blob;\n}\n\n/**\n * Metadata of a media item\n */\nexport interface MediaMetadata {\n path?: string;\n sizeBytes: number;\n mediaType: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.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 { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedPropertyCreator } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n ObjectSetArgs,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type {\n DerivedObjectOrInterfaceDefinition,\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type {\n ExtractAllPropertiesOption,\n ExtractOptions,\n ExtractRidOption,\n Osdk,\n} from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef> = {},\n> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;\n\ntype ExtractRdp<\n D extends\n | BaseObjectSet<any>\n | Record<string, SimplePropertyDef>,\n> = [D] extends [never] ? {}\n : D extends BaseObjectSet<any> ? {}\n : D extends Record<string, SimplePropertyDef> ? D\n : {};\n\ntype MaybeSimplifyPropertyKeys<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;\n\ntype SubSelectKeysHelper<\n Q extends ObjectOrInterfaceDefinition,\n L extends string,\n> = [L] extends [never] ? PropertyKeys<Q>\n : PropertyKeys<Q> extends L ? PropertyKeys<Q>\n : L & PropertyKeys<Q>;\n\ntype SubSelectKeys<\n Q extends ObjectOrInterfaceDefinition,\n X extends SelectArg<Q, PropertyKeys<Q>, any, any> = never,\n> = SubSelectKeysHelper<Q, Extract$Select<X>>;\n\ntype NOOP<T> = T extends (...args: any[]) => any ? T\n : T extends abstract new(...args: any[]) => any ? T\n : { [K in keyof T]: T[K] };\n\ntype SubSelectRDPsHelper<\n X extends ValidFetchPageArgs<any, any> | ValidAsyncIterArgs<any, any>,\n DEFAULT extends string,\n> = [X] extends [never] ? DEFAULT\n : (X[\"$select\"] & string[])[number] & DEFAULT;\n\ntype SubSelectRDPs<\n RDPs extends Record<string, SimplePropertyDef>,\n X extends ValidFetchPageArgs<any, RDPs> | ValidAsyncIterArgs<any, RDPs>,\n> = [RDPs] extends [never] ? never\n : NOOP<{ [K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K] }>;\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\nexport type ExtractOptions2<\n X extends FetchPageArgs<any, any, any, any, any, any, any>,\n> = [X] extends [never] ? never\n :\n | ExtractRidOption<X[\"$includeRid\"] extends true ? true : false>\n | ExtractAllPropertiesOption<\n X[\"$includeAllBaseObjectProperties\"] extends true ? true : false\n >;\n\ntype Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<\n X[\"$select\"]\n>[number];\n\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly fetchPage: FetchPageSignature<Q, RDPs>;\n readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;\n}\n\ntype ValidFetchPageArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> = ObjectSetArgs.FetchPage<\n Q,\n PropertyKeys<Q>,\n boolean,\n string & keyof RDPs\n>;\n\ntype ValidAsyncIterArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> =\n | ObjectSetArgs.AsyncIter<\n Q,\n PropertyKeys<Q>,\n false,\n string & keyof RDPs\n >\n | AsyncIterArgs<\n Q,\n never,\n any,\n any,\n any,\n true,\n string & keyof RDPs\n >;\n\ninterface FetchPageSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n >(\n args?: FetchPageArgs<Q, L, R, A, S, T>,\n ): Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >\n >\n >;\n}\n\ninterface FetchPageWithErrorsSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n >(\n args?: FetchPageArgs<Q, L, R, A, S, T>,\n ): Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIterSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n <X extends ValidAsyncIterArgs<Q, RDPs> = never>(\n args?: X,\n ): AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions2<X>,\n SubSelectKeys<Q, X>,\n SubSelectRDPs<RDPs, X>\n >\n >;\n\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S, T>,\n ): AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >\n >;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n asyncIter: AsyncIterSignature<Q, RDPs>;\n}\n\ninterface WithProperties<\n Q extends ObjectOrInterfaceDefinition = any,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly withProperties: <\n NEW extends Record<string, SimplePropertyDef>,\n >(\n clause: { [K in keyof NEW]: DerivedPropertyCreator<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends\n | BaseObjectSet<Q>\n | Record<string, SimplePropertyDef> = never,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, ExtractRdp<UNUSED_OR_RDP>>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOneSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ): Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >;\n}\n\ninterface FetchOneWithErrorsSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ): Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >\n >;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;\n fetchOneWithErrors: Q extends ObjectTypeDefinition\n ? FetchOneWithErrorsSignature<Q, RDPs>\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetSubscription.Listener<Q, P>,\n opts?: ObjectSetSubscription.Options<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition & Q,\n> extends\n MinimalObjectSet<Q, D>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<Q>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.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 { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedPropertyCreator } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n ObjectSetArgs,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type {\n DerivedObjectOrInterfaceDefinition,\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type {\n ExtractAllPropertiesOption,\n ExtractOptions,\n ExtractRidOption,\n Osdk,\n} from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef> = {},\n> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;\n\ntype ExtractRdp<\n D extends\n | BaseObjectSet<any>\n | Record<string, SimplePropertyDef>,\n> = [D] extends [never] ? {}\n : D extends BaseObjectSet<any> ? {}\n : D extends Record<string, SimplePropertyDef> ? D\n : {};\n\ntype MaybeSimplifyPropertyKeys<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;\n\ntype SubSelectKeysHelper<\n Q extends ObjectOrInterfaceDefinition,\n L extends string,\n> = [L] extends [never] ? PropertyKeys<Q>\n : PropertyKeys<Q> extends L ? PropertyKeys<Q>\n : L & PropertyKeys<Q>;\n\ntype SubSelectKeys<\n Q extends ObjectOrInterfaceDefinition,\n X extends SelectArg<Q, PropertyKeys<Q>, any, any> = never,\n> = SubSelectKeysHelper<Q, Extract$Select<X>>;\n\ntype NOOP<T> = T extends (...args: any[]) => any ? T\n : T extends abstract new(...args: any[]) => any ? T\n : { [K in keyof T]: T[K] };\n\ntype SubSelectRDPsHelper<\n X extends ValidFetchPageArgs<any, any> | ValidAsyncIterArgs<any, any>,\n DEFAULT extends string,\n> = [X] extends [never] ? DEFAULT\n : (X[\"$select\"] & string[])[number] & DEFAULT;\n\ntype SubSelectRDPs<\n RDPs extends Record<string, SimplePropertyDef>,\n X extends ValidFetchPageArgs<any, RDPs> | ValidAsyncIterArgs<any, RDPs>,\n> = [RDPs] extends [never] ? never\n : NOOP<{ [K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K] }>;\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\nexport type ExtractOptions2<\n X extends FetchPageArgs<any, any, any, any, any, any, any>,\n> = [X] extends [never] ? never\n :\n | ExtractRidOption<X[\"$includeRid\"] extends true ? true : false>\n | ExtractAllPropertiesOption<\n X[\"$includeAllBaseObjectProperties\"] extends true ? true : false\n >;\n\ntype Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<\n X[\"$select\"]\n>[number];\n\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly fetchPage: FetchPageSignature<Q, RDPs>;\n readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;\n}\n\ntype ValidFetchPageArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> = ObjectSetArgs.FetchPage<\n Q,\n PropertyKeys<Q>,\n boolean,\n string & keyof RDPs\n>;\n\ntype ValidAsyncIterArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> =\n | ObjectSetArgs.AsyncIter<\n Q,\n PropertyKeys<Q>,\n false,\n string & keyof RDPs\n >\n | AsyncIterArgs<\n Q,\n never,\n any,\n any,\n any,\n true,\n string & keyof RDPs\n >;\n\ninterface FetchPageSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n >(\n args?: FetchPageArgs<Q, L, R, A, S, T>,\n ): Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >\n >\n >;\n}\n\ninterface NearestNeighbors<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Finds the nearest neighbors for a given text or vector within the object set.\n *\n * @param query - Queries support either a vector matching the embedding model defined on the property, or text that is\n automatically embedded.\n * @param numNeighbors - The number of objects to return. If the number of documents in the objectType is less than the provided\n value, all objects will be returned. This value is limited to 1 &le; numNeighbors &ge; 500.\n * @param property - The property key with a defined embedding model to search over.\n *\n * @returns An object set containing the `numNeighbors` nearest neighbors. To return the objects ordered by relevance and each\n * objects associated score, specify \"relevance\" in the orderBy.\n */\n\n readonly nearestNeighbors: (\n query: string | number[],\n numNeighbors: number,\n property: PropertyKeys.Filtered<Q, \"vector\">,\n ) => this;\n}\n\ninterface FetchPageWithErrorsSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n >(\n args?: FetchPageArgs<Q, L, R, A, S, T>,\n ): Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIterSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n <X extends ValidAsyncIterArgs<Q, RDPs> = never>(\n args?: X,\n ): AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions2<X>,\n SubSelectKeys<Q, X>,\n SubSelectRDPs<RDPs, X>\n >\n >;\n\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S, T>,\n ): AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >\n >;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n asyncIter: AsyncIterSignature<Q, RDPs>;\n}\n\ninterface WithProperties<\n Q extends ObjectOrInterfaceDefinition = any,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly withProperties: <\n NEW extends Record<string, SimplePropertyDef>,\n >(\n clause: { [K in keyof NEW]: DerivedPropertyCreator<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends\n | BaseObjectSet<Q>\n | Record<string, SimplePropertyDef> = never,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, ExtractRdp<UNUSED_OR_RDP>>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOneSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ): Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >;\n}\n\ninterface FetchOneWithErrorsSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ): Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >\n >;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;\n fetchOneWithErrors: Q extends ObjectTypeDefinition\n ? FetchOneWithErrorsSignature<Q, RDPs>\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetSubscription.Listener<Q, P>,\n opts?: ObjectSetSubscription.Options<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition & Q,\n> extends\n MinimalObjectSet<Q, D>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<Q>,\n FetchOne<Q, D>,\n Subscribe<MERGED>,\n NearestNeighbors<Q>\n{\n}\n"],"mappings":"","ignoreList":[]}
@@ -48,6 +48,9 @@ export function createMockObjectSet() {
48
48
  }),
49
49
  pivotTo: vi.fn(() => {
50
50
  return fauxObjectSet;
51
+ }),
52
+ nearestNeighbors: vi.fn(() => {
53
+ return fauxObjectSet;
51
54
  })
52
55
  };
53
56
  return fauxObjectSet;
@@ -109,7 +112,7 @@ describe("ObjectSet", () => {
109
112
  // this select list is intended to represent all properties on `EmployeeApiTest`,
110
113
  // so if you get an error here later and you added properties to that object,
111
114
  // be sure to add them here too.
112
- $select: ["attachment", "class", "employeeId", "fullName", "geopoint", "geotimeSeriesReference", "isActive", "mediaReference", "timeseries", "dateOfJoining", "hourlyRate", "yearsOfExperience", "rank", "performanceScore", "mediaReference", "lastUpdated"]
115
+ $select: ["attachment", "class", "employeeId", "fullName", "geopoint", "geotimeSeriesReference", "isActive", "mediaReference", "timeseries", "dateOfJoining", "hourlyRate", "yearsOfExperience", "rank", "performanceScore", "mediaReference", "lastUpdated", "skillSet", "skillSetEmbedding"]
113
116
  });
114
117
  await fauxObjectSet.where({
115
118
  class: "idk"
@@ -118,7 +121,7 @@ describe("ObjectSet", () => {
118
121
  // this select list is intended to represent all properties on `EmployeeApiTest`,
119
122
  // so if you get an error here later and you added properties to that object,
120
123
  // be sure to add them here too.
121
- $select: ["attachment", "class", "employeeId", "fullName", "geopoint", "geotimeSeriesReference", "isActive", "mediaReference", "timeseries", "dateOfJoining", "hourlyRate", "yearsOfExperience", "rank", "performanceScore", "mediaReference", "lastUpdated"]
124
+ $select: ["attachment", "class", "employeeId", "fullName", "geopoint", "geotimeSeriesReference", "isActive", "mediaReference", "timeseries", "dateOfJoining", "hourlyRate", "yearsOfExperience", "rank", "performanceScore", "mediaReference", "lastUpdated", "skillSet", "skillSetEmbedding"]
122
125
  });
123
126
  });
124
127
  });
@@ -151,7 +154,7 @@ describe("ObjectSet", () => {
151
154
  });
152
155
  it("can be sub-selected", () => {
153
156
  fauxObjectSet.withProperties({
154
- "derivedPropertyName": base => base.pivotTo("lead").aggregate("dateOfJoining:max")
157
+ "derivedPropertyName": base => base.pivotTo("lead").selectProperty("employeeId")
155
158
  }).fetchOne(3, {
156
159
  $select: ["derivedPropertyName"]
157
160
  });
@@ -159,7 +162,7 @@ describe("ObjectSet", () => {
159
162
  test("multiple properties", async () => {
160
163
  const withFamily = fauxObjectSet.withProperties({
161
164
  "mom": base => base.pivotTo("lead").aggregate("$count"),
162
- "dad": base => base.pivotTo("lead").aggregate("dateOfJoining:max"),
165
+ "dad": base => base.pivotTo("lead").selectProperty("fullName"),
163
166
  "sister": base => base.pivotTo("lead").aggregate("class:collectList")
164
167
  });
165
168
  expectTypeOf(withFamily).toEqualTypeOf();
@@ -175,7 +178,7 @@ describe("ObjectSet", () => {
175
178
  "mom": base => base.pivotTo("lead").aggregate("$count")
176
179
  });
177
180
  const withParents = withMom.withProperties({
178
- "dad": base => base.pivotTo("lead").aggregate("fullName:approximateDistinct")
181
+ "dad": base => base.pivotTo("lead").selectProperty("fullName")
179
182
  });
180
183
  expectTypeOf(withParents).toEqualTypeOf();
181
184
  });
@@ -191,9 +194,10 @@ describe("ObjectSet", () => {
191
194
  await withFamily.fetchPage();
192
195
  expectTypeOf().toEqualTypeOf();
193
196
  });
194
- it("collectToSet, collectToList, selectProperty, and numeric aggregations are nullable", async () => {
197
+ it("collectSet, collectList, selectProperty, and numeric aggregations are nullable", async () => {
195
198
  const withAggregations = fauxObjectSet.withProperties({
196
199
  "collectSet": base => base.pivotTo("lead").aggregate("class:collectSet"),
200
+ "select": base => base.pivotTo("lead").selectProperty("fullName"),
197
201
  "collectList": base => base.pivotTo("lead").aggregate("class:collectList"),
198
202
  "min": base => base.pivotTo("lead").aggregate("employeeId:max"),
199
203
  "max": base => base.pivotTo("lead").aggregate("employeeId:min"),
@@ -208,6 +212,7 @@ describe("ObjectSet", () => {
208
212
  describe("fetch functions return correct Osdk.Instance", () => {
209
213
  const withFamily = fauxObjectSet.withProperties({
210
214
  "mom": base => base.pivotTo("lead").aggregate("$count"),
215
+ "dad": base => base.pivotTo("lead").selectProperty("fullName"),
211
216
  "sister": base => base.pivotTo("lead").aggregate("class:collectList")
212
217
  });
213
218
  it("works with .where", async () => {
@@ -242,7 +247,7 @@ describe("ObjectSet", () => {
242
247
  });
243
248
  it("Works with selecting all RDPs", async () => {
244
249
  await withFamily.fetchPage({
245
- $select: ["mom", "sister"]
250
+ $select: ["mom", "dad", "sister"]
246
251
  });
247
252
  expectTypeOf().toEqualTypeOf();
248
253
  expectTypeOf().toEqualTypeOf();
@@ -255,7 +260,7 @@ describe("ObjectSet", () => {
255
260
  });
256
261
  it("Works with selecting all non-RDP's", async () => {
257
262
  await withFamily.fetchPage({
258
- $select: ["employeeId", "fullName", "class", "attachment", "geopoint", "timeseries", "mediaReference", "geotimeSeriesReference", "isActive", "yearsOfExperience", "rank", "performanceScore", "hourlyRate", "dateOfJoining", "lastUpdated"]
263
+ $select: ["employeeId", "fullName", "class", "attachment", "geopoint", "timeseries", "mediaReference", "geotimeSeriesReference", "isActive", "yearsOfExperience", "rank", "performanceScore", "hourlyRate", "dateOfJoining", "lastUpdated", "skillSet", "skillSetEmbedding"]
259
264
  });
260
265
  expectTypeOf().toEqualTypeOf();
261
266
  expectTypeOf().toEqualTypeOf();
@@ -370,5 +375,232 @@ describe("ObjectSet", () => {
370
375
  });
371
376
  });
372
377
  });
378
+ describe("expressions", () => {
379
+ "Test all property types";
380
+
381
+ describe("numeric expressions", () => {
382
+ it("provides correct methods off of selected numeric derived property definitions", () => {
383
+ fauxObjectSet.withProperties({
384
+ "myProp1": base => {
385
+ const selectedInteger = base.pivotTo("lead").selectProperty("employeeId");
386
+ expectTypeOf(selectedInteger).toEqualTypeOf;
387
+ selectedInteger.add(1);
388
+ selectedInteger.subtract(1);
389
+ selectedInteger.multiply(1);
390
+ selectedInteger.divide(1);
391
+ selectedInteger.abs();
392
+ selectedInteger.negate();
393
+ selectedInteger.max(1);
394
+ selectedInteger.min(1);
395
+
396
+ // @ts-expect-error
397
+ selectedInteger.extractPart("1");
398
+ expectTypeOf(base.pivotTo("lead").selectProperty("performanceScore")).toEqualTypeOf();
399
+ expectTypeOf(base.pivotTo("lead").selectProperty("rank")).toEqualTypeOf();
400
+ expectTypeOf(base.pivotTo("lead").selectProperty("yearsOfExperience")).toEqualTypeOf();
401
+ expectTypeOf(base.pivotTo("lead").selectProperty("hourlyRate")).toEqualTypeOf();
402
+ return selectedInteger;
403
+ }
404
+ });
405
+ });
406
+ it("provides correct methods off of selection definitions", () => {
407
+ fauxObjectSet.withProperties({
408
+ "myProp1": base => {
409
+ const selectedInteger = base.pivotTo("lead").selectProperty("employeeId");
410
+ expectTypeOf(selectedInteger).toEqualTypeOf;
411
+ selectedInteger.add(1);
412
+ selectedInteger.subtract(1);
413
+ selectedInteger.multiply(1);
414
+ selectedInteger.divide(1);
415
+ selectedInteger.abs();
416
+ selectedInteger.negate();
417
+ selectedInteger.max(1);
418
+ selectedInteger.min(1);
419
+
420
+ // @ts-expect-error
421
+ selectedInteger.extractPart("1");
422
+ expectTypeOf(base.pivotTo("lead").selectProperty("performanceScore")).toEqualTypeOf();
423
+ expectTypeOf(base.pivotTo("lead").selectProperty("rank")).toEqualTypeOf();
424
+ expectTypeOf(base.pivotTo("lead").selectProperty("yearsOfExperience")).toEqualTypeOf();
425
+ expectTypeOf(base.pivotTo("lead").selectProperty("hourlyRate")).toEqualTypeOf();
426
+ return selectedInteger;
427
+ }
428
+ });
429
+ });
430
+ it("provides correct methods off of aggregated properties", () => {
431
+ fauxObjectSet.withProperties({
432
+ "myProp1": base => {
433
+ const maxAggregation = base.pivotTo("lead").aggregate("employeeId:max");
434
+ expectTypeOf(maxAggregation).toEqualTypeOf;
435
+ maxAggregation.add(1);
436
+ maxAggregation.subtract(1);
437
+ maxAggregation.multiply(1);
438
+ maxAggregation.divide(1);
439
+ maxAggregation.abs();
440
+ maxAggregation.negate();
441
+ maxAggregation.max(1);
442
+ maxAggregation.min(1);
443
+ expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:sum")).toEqualTypeOf();
444
+ expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:avg")).toEqualTypeOf();
445
+ expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:min")).toEqualTypeOf();
446
+ const collectList = base.pivotTo("peeps").aggregate("employeeId:collectList");
447
+ expectTypeOf(collectList).toEqualTypeOf();
448
+
449
+ // @ts-expect-error
450
+ collectList.plus(1);
451
+ expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:collectList")).toEqualTypeOf();
452
+ return maxAggregation;
453
+ }
454
+ });
455
+ });
456
+ it("correctly coerces numeric types", () => {
457
+ fauxObjectSet.withProperties({
458
+ "myProp1": base => {
459
+ const intAndLong = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("yearsOfExperience")).add(base.selectProperty("employeeId"));
460
+ expectTypeOf(intAndLong).toEqualTypeOf();
461
+ const intAndDouble = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("performanceScore")).add(base.selectProperty("employeeId"));
462
+ expectTypeOf(intAndDouble).toEqualTypeOf();
463
+ const longAndDouble = base.pivotTo("lead").selectProperty("yearsOfExperience").add(base.selectProperty("performanceScore")).add(base.selectProperty("yearsOfExperience"));
464
+ expectTypeOf(longAndDouble).toEqualTypeOf();
465
+ const longAndLong = base.pivotTo("lead").selectProperty("yearsOfExperience").add(base.selectProperty("yearsOfExperience"));
466
+ expectTypeOf(longAndLong).toEqualTypeOf();
467
+ const intAndInt = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("employeeId"));
468
+ expectTypeOf(intAndInt).toEqualTypeOf();
469
+ const intLongDoubleChain = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("yearsOfExperience")).add(base.selectProperty("employeeId")).add(base.selectProperty("performanceScore")).add(base.selectProperty("employeeId"));
470
+ expectTypeOf(intLongDoubleChain).toEqualTypeOf();
471
+ const shortAndIntReturnsInt = base.pivotTo("lead").selectProperty("rank").add(base.selectProperty("employeeId"));
472
+ expectTypeOf(shortAndIntReturnsInt).toEqualTypeOf();
473
+ const shortAndFloatReturnsDouble = base.pivotTo("lead").selectProperty("rank").add(base.selectProperty("hourlyRate"));
474
+ expectTypeOf(shortAndFloatReturnsDouble).toEqualTypeOf();
475
+ return intLongDoubleChain;
476
+ }
477
+ });
478
+ });
479
+ it("allows adding number literals as a double", () => {
480
+ fauxObjectSet.withProperties({
481
+ "myProp1": base => {
482
+ const plus = base.pivotTo("lead").selectProperty("employeeId").add(1);
483
+ expectTypeOf(plus).toEqualTypeOf();
484
+ return plus;
485
+ }
486
+ });
487
+ });
488
+ it("allows adding literals via base.constant", () => {
489
+ fauxObjectSet.withProperties({
490
+ "myProp1": base => {
491
+ const plus = base.pivotTo("lead").selectProperty("employeeId").add(base.constant.double(1));
492
+ expectTypeOf(plus).toEqualTypeOf();
493
+ const intPlusIntReturnsInt = base.pivotTo("lead").selectProperty("employeeId").add(base.constant.integer(1));
494
+ expectTypeOf(intPlusIntReturnsInt).toEqualTypeOf();
495
+ return plus;
496
+ }
497
+ });
498
+ });
499
+ it("allows correctly typed nested property definitions", () => {
500
+ fauxObjectSet.withProperties({
501
+ "myProp1": base => {
502
+ const nested = base.pivotTo("lead").selectProperty("employeeId").add(base.pivotTo("peeps").aggregate("employeeId:sum"));
503
+ expectTypeOf(nested).toEqualTypeOf();
504
+ return nested;
505
+ }
506
+ });
507
+ });
508
+ it("allows correctly types property keys off the linked OT", () => {
509
+ fauxObjectSet.withProperties({
510
+ "myProp1": base => {
511
+ const nested = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("performanceScore"));
512
+ expectTypeOf(nested).toEqualTypeOf();
513
+ return nested;
514
+ }
515
+ });
516
+ });
517
+
518
+ // it("allows correctly types property keys off the base OT", () => {});
519
+ });
520
+ describe("datetime expressions", () => {
521
+ it("provides correct methods off of datetime selections", () => {
522
+ fauxObjectSet.withProperties({
523
+ "myProp1": base => {
524
+ const selectedDatetime = base.pivotTo("lead").selectProperty("dateOfJoining");
525
+ expectTypeOf(selectedDatetime).toEqualTypeOf();
526
+ selectedDatetime.max(base.selectProperty("dateOfJoining"));
527
+ selectedDatetime.min(base.selectProperty("lastUpdated"));
528
+ expectTypeOf(base.pivotTo("lead").selectProperty("lastUpdated")).toEqualTypeOf();
529
+ return selectedDatetime;
530
+ }
531
+ });
532
+ });
533
+ it("correctly coerces datetime types", () => {
534
+ fauxObjectSet.withProperties({
535
+ "myProp1": base => {
536
+ const max = base.pivotTo("lead").selectProperty("dateOfJoining").max(base.selectProperty("lastUpdated"));
537
+ expectTypeOf(max).toEqualTypeOf();
538
+ const min = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.selectProperty("dateOfJoining"));
539
+ expectTypeOf(min).toEqualTypeOf();
540
+ return max;
541
+ }
542
+ });
543
+ });
544
+ it("allows adding literals via base.constant", () => {
545
+ fauxObjectSet.withProperties({
546
+ "myProp1": base => {
547
+ const dateAndDateReturnDate = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.constant.datetime("2025-01-01T00:00:00Z"));
548
+ expectTypeOf(dateAndDateReturnDate).toEqualTypeOf();
549
+ const dateAndTimeReturnTime = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.constant.timestamp("2025-01-01T00:00:00Z"));
550
+ expectTypeOf(dateAndTimeReturnTime).toEqualTypeOf();
551
+ return dateAndTimeReturnTime;
552
+ }
553
+ });
554
+ });
555
+ it("allows correctly typed nested property definitions", () => {
556
+ fauxObjectSet.withProperties({
557
+ "myProp1": base => {
558
+ const nested = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.pivotTo("lead").pivotTo("lead").selectProperty("lastUpdated"));
559
+ expectTypeOf(nested).toEqualTypeOf();
560
+ return nested;
561
+ }
562
+ });
563
+ });
564
+ it("allows correctly typed property keys off the linked OT", () => {
565
+ fauxObjectSet.withProperties({
566
+ "myProp1": base => {
567
+ const nested = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.selectProperty("lastUpdated"));
568
+ expectTypeOf(nested).toEqualTypeOf();
569
+ return nested;
570
+ }
571
+ });
572
+ });
573
+
574
+ // it("allows correctly typed property keys off the base OT", () => {});
575
+ });
576
+ });
577
+ describe("nearestNeighbors", () => {
578
+ it("has correct nearest neighbors object set query return type", () => {
579
+ const nearestNeighborsObjectSet = fauxObjectSet.nearestNeighbors("textQuery", 3, "skillSetEmbedding");
580
+ expectTypeOf(nearestNeighborsObjectSet).toEqualTypeOf();
581
+ });
582
+ it("allows text queries", async () => {
583
+ const nearestNeighborsObjectSet = fauxObjectSet.nearestNeighbors("textQuery", 3, "skillSetEmbedding");
584
+ const {
585
+ data: employees
586
+ } = await nearestNeighborsObjectSet.fetchPage();
587
+ expectTypeOf(employees).toEqualTypeOf();
588
+ });
589
+ it("allows vector queries", async () => {
590
+ const vectorQuery = Array.from({
591
+ length: 1536
592
+ }, () => 0.3);
593
+ const nearestNeighborsObjectSet = fauxObjectSet.nearestNeighbors(vectorQuery, 3, "skillSetEmbedding");
594
+ const {
595
+ data: employees
596
+ } = await nearestNeighborsObjectSet.fetchPage();
597
+ expectTypeOf(employees).toEqualTypeOf();
598
+ });
599
+ it("only supports queries on vector properties", () => {
600
+ fauxObjectSet.nearestNeighbors("textQuery", 3,
601
+ // @ts-expect-error
602
+ "skillSet");
603
+ });
604
+ });
373
605
  });
374
606
  //# sourceMappingURL=ObjectSet.test.js.map