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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +40 -6
  2. package/build/browser/actions/Actions.js.map +1 -1
  3. package/build/browser/actions/NullValue.js +18 -0
  4. package/build/browser/actions/NullValue.js.map +1 -0
  5. package/build/browser/derivedProperties/DerivedProperty.js +1 -16
  6. package/build/browser/derivedProperties/DerivedProperty.js.map +1 -1
  7. package/build/browser/derivedProperties/Expressions.js +2 -0
  8. package/build/browser/derivedProperties/Expressions.js.map +1 -0
  9. package/build/browser/index.js +1 -0
  10. package/build/browser/index.js.map +1 -1
  11. package/build/browser/mapping/DataValueMapping.js.map +1 -1
  12. package/build/browser/object/Media.js.map +1 -1
  13. package/build/browser/objectSet/ObjectSet.test.js +205 -4
  14. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  15. package/build/cjs/{ObjectSet-C3Ud9v-e.d.cts → ObjectSet-C67LQ5JX.d.cts} +57 -6
  16. package/build/cjs/index.cjs +4 -0
  17. package/build/cjs/index.cjs.map +1 -1
  18. package/build/cjs/index.d.cts +13 -4
  19. package/build/cjs/public/unstable.d.cts +2 -2
  20. package/build/esm/actions/Actions.js.map +1 -1
  21. package/build/esm/actions/NullValue.js +18 -0
  22. package/build/esm/actions/NullValue.js.map +1 -0
  23. package/build/esm/derivedProperties/DerivedProperty.js +1 -16
  24. package/build/esm/derivedProperties/DerivedProperty.js.map +1 -1
  25. package/build/esm/derivedProperties/Expressions.js +2 -0
  26. package/build/esm/derivedProperties/Expressions.js.map +1 -0
  27. package/build/esm/index.js +1 -0
  28. package/build/esm/index.js.map +1 -1
  29. package/build/esm/mapping/DataValueMapping.js.map +1 -1
  30. package/build/esm/object/Media.js.map +1 -1
  31. package/build/esm/objectSet/ObjectSet.test.js +205 -4
  32. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  33. package/build/types/actions/Actions.d.ts +2 -0
  34. package/build/types/actions/Actions.d.ts.map +1 -1
  35. package/build/types/actions/NullValue.d.ts +3 -0
  36. package/build/types/actions/NullValue.d.ts.map +1 -0
  37. package/build/types/derivedProperties/DerivedProperty.d.ts +32 -6
  38. package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -1
  39. package/build/types/derivedProperties/Expressions.d.ts +53 -0
  40. package/build/types/derivedProperties/Expressions.d.ts.map +1 -0
  41. package/build/types/index.d.ts +2 -1
  42. package/build/types/index.d.ts.map +1 -1
  43. package/build/types/mapping/DataValueMapping.d.ts +2 -2
  44. package/build/types/mapping/DataValueMapping.d.ts.map +1 -1
  45. package/build/types/object/Media.d.ts +7 -0
  46. package/build/types/object/Media.d.ts.map +1 -1
  47. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
  48. package/package.json +3 -3
@@ -13,20 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export let DerivedProperty; // type Selectable<Q extends ObjectOrInterfaceDefinition> = {
17
- // readonly selectProperty: <R extends PropertyKeys<Q>>(
18
- // propertyName: R,
19
- // ) => DefinitionForType<
20
- // Q,
21
- // SimplePropertyDef.Make<
22
- // CompileTimeMetadata<Q>["properties"][R]["type"],
23
- // CompileTimeMetadata<Q>["properties"][R]["nullable"] extends true
24
- // ? "nullable"
25
- // : "non-nullable",
26
- // CompileTimeMetadata<Q>["properties"][R]["multiplicity"] extends true
27
- // ? "array"
28
- // : "single"
29
- // >
30
- // >;
31
- // };
16
+ export let DerivedProperty;
32
17
  //# sourceMappingURL=DerivedProperty.js.map
@@ -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":[]}
@@ -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 { OsdkObjectPropertyType } 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;AAahE,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 { OsdkObjectPropertyType } 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 {\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;AAahE,SAASC,eAAe,QAAQ,4BAA4B;AAmC5D,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":"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":[]}
@@ -151,7 +151,7 @@ describe("ObjectSet", () => {
151
151
  });
152
152
  it("can be sub-selected", () => {
153
153
  fauxObjectSet.withProperties({
154
- "derivedPropertyName": base => base.pivotTo("lead").aggregate("dateOfJoining:max")
154
+ "derivedPropertyName": base => base.pivotTo("lead").selectProperty("employeeId")
155
155
  }).fetchOne(3, {
156
156
  $select: ["derivedPropertyName"]
157
157
  });
@@ -159,7 +159,7 @@ describe("ObjectSet", () => {
159
159
  test("multiple properties", async () => {
160
160
  const withFamily = fauxObjectSet.withProperties({
161
161
  "mom": base => base.pivotTo("lead").aggregate("$count"),
162
- "dad": base => base.pivotTo("lead").aggregate("dateOfJoining:max"),
162
+ "dad": base => base.pivotTo("lead").selectProperty("fullName"),
163
163
  "sister": base => base.pivotTo("lead").aggregate("class:collectList")
164
164
  });
165
165
  expectTypeOf(withFamily).toEqualTypeOf();
@@ -175,7 +175,7 @@ describe("ObjectSet", () => {
175
175
  "mom": base => base.pivotTo("lead").aggregate("$count")
176
176
  });
177
177
  const withParents = withMom.withProperties({
178
- "dad": base => base.pivotTo("lead").aggregate("fullName:approximateDistinct")
178
+ "dad": base => base.pivotTo("lead").selectProperty("fullName")
179
179
  });
180
180
  expectTypeOf(withParents).toEqualTypeOf();
181
181
  });
@@ -194,6 +194,7 @@ describe("ObjectSet", () => {
194
194
  it("collectToSet, collectToList, selectProperty, and numeric aggregations are nullable", async () => {
195
195
  const withAggregations = fauxObjectSet.withProperties({
196
196
  "collectSet": base => base.pivotTo("lead").aggregate("class:collectSet"),
197
+ "select": base => base.pivotTo("lead").selectProperty("fullName"),
197
198
  "collectList": base => base.pivotTo("lead").aggregate("class:collectList"),
198
199
  "min": base => base.pivotTo("lead").aggregate("employeeId:max"),
199
200
  "max": base => base.pivotTo("lead").aggregate("employeeId:min"),
@@ -208,6 +209,7 @@ describe("ObjectSet", () => {
208
209
  describe("fetch functions return correct Osdk.Instance", () => {
209
210
  const withFamily = fauxObjectSet.withProperties({
210
211
  "mom": base => base.pivotTo("lead").aggregate("$count"),
212
+ "dad": base => base.pivotTo("lead").selectProperty("fullName"),
211
213
  "sister": base => base.pivotTo("lead").aggregate("class:collectList")
212
214
  });
213
215
  it("works with .where", async () => {
@@ -242,7 +244,7 @@ describe("ObjectSet", () => {
242
244
  });
243
245
  it("Works with selecting all RDPs", async () => {
244
246
  await withFamily.fetchPage({
245
- $select: ["mom", "sister"]
247
+ $select: ["mom", "dad", "sister"]
246
248
  });
247
249
  expectTypeOf().toEqualTypeOf();
248
250
  expectTypeOf().toEqualTypeOf();
@@ -370,5 +372,204 @@ describe("ObjectSet", () => {
370
372
  });
371
373
  });
372
374
  });
375
+ describe("expressions", () => {
376
+ "Test all property types";
377
+
378
+ describe("numeric expressions", () => {
379
+ it("provides correct methods off of selected numeric derived property definitions", () => {
380
+ fauxObjectSet.withProperties({
381
+ "myProp1": base => {
382
+ const selectedInteger = base.pivotTo("lead").selectProperty("employeeId");
383
+ expectTypeOf(selectedInteger).toEqualTypeOf;
384
+ selectedInteger.add(1);
385
+ selectedInteger.subtract(1);
386
+ selectedInteger.multiply(1);
387
+ selectedInteger.divide(1);
388
+ selectedInteger.abs();
389
+ selectedInteger.negate();
390
+ selectedInteger.max(1);
391
+ selectedInteger.min(1);
392
+
393
+ // @ts-expect-error
394
+ selectedInteger.extractPart("1");
395
+ expectTypeOf(base.pivotTo("lead").selectProperty("performanceScore")).toEqualTypeOf();
396
+ expectTypeOf(base.pivotTo("lead").selectProperty("rank")).toEqualTypeOf();
397
+ expectTypeOf(base.pivotTo("lead").selectProperty("yearsOfExperience")).toEqualTypeOf();
398
+ expectTypeOf(base.pivotTo("lead").selectProperty("hourlyRate")).toEqualTypeOf();
399
+ return selectedInteger;
400
+ }
401
+ });
402
+ });
403
+ it("provides correct methods off of selection definitions", () => {
404
+ fauxObjectSet.withProperties({
405
+ "myProp1": base => {
406
+ const selectedInteger = base.pivotTo("lead").selectProperty("employeeId");
407
+ expectTypeOf(selectedInteger).toEqualTypeOf;
408
+ selectedInteger.add(1);
409
+ selectedInteger.subtract(1);
410
+ selectedInteger.multiply(1);
411
+ selectedInteger.divide(1);
412
+ selectedInteger.abs();
413
+ selectedInteger.negate();
414
+ selectedInteger.max(1);
415
+ selectedInteger.min(1);
416
+
417
+ // @ts-expect-error
418
+ selectedInteger.extractPart("1");
419
+ expectTypeOf(base.pivotTo("lead").selectProperty("performanceScore")).toEqualTypeOf();
420
+ expectTypeOf(base.pivotTo("lead").selectProperty("rank")).toEqualTypeOf();
421
+ expectTypeOf(base.pivotTo("lead").selectProperty("yearsOfExperience")).toEqualTypeOf();
422
+ expectTypeOf(base.pivotTo("lead").selectProperty("hourlyRate")).toEqualTypeOf();
423
+ return selectedInteger;
424
+ }
425
+ });
426
+ });
427
+ it("provides correct methods off of aggregated properties", () => {
428
+ fauxObjectSet.withProperties({
429
+ "myProp1": base => {
430
+ const maxAggregation = base.pivotTo("lead").aggregate("employeeId:max");
431
+ expectTypeOf(maxAggregation).toEqualTypeOf;
432
+ maxAggregation.add(1);
433
+ maxAggregation.subtract(1);
434
+ maxAggregation.multiply(1);
435
+ maxAggregation.divide(1);
436
+ maxAggregation.abs();
437
+ maxAggregation.negate();
438
+ maxAggregation.max(1);
439
+ maxAggregation.min(1);
440
+ expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:sum")).toEqualTypeOf();
441
+ expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:avg")).toEqualTypeOf();
442
+ expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:min")).toEqualTypeOf();
443
+ const collectList = base.pivotTo("peeps").aggregate("employeeId:collectList");
444
+ expectTypeOf(collectList).toEqualTypeOf();
445
+
446
+ // @ts-expect-error
447
+ collectList.plus(1);
448
+ expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:collectList")).toEqualTypeOf();
449
+ return maxAggregation;
450
+ }
451
+ });
452
+ });
453
+ it("correctly coerces numeric types", () => {
454
+ fauxObjectSet.withProperties({
455
+ "myProp1": base => {
456
+ const intAndLong = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("yearsOfExperience")).add(base.selectProperty("employeeId"));
457
+ expectTypeOf(intAndLong).toEqualTypeOf();
458
+ const intAndDouble = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("performanceScore")).add(base.selectProperty("employeeId"));
459
+ expectTypeOf(intAndDouble).toEqualTypeOf();
460
+ const longAndDouble = base.pivotTo("lead").selectProperty("yearsOfExperience").add(base.selectProperty("performanceScore")).add(base.selectProperty("yearsOfExperience"));
461
+ expectTypeOf(longAndDouble).toEqualTypeOf();
462
+ const longAndLong = base.pivotTo("lead").selectProperty("yearsOfExperience").add(base.selectProperty("yearsOfExperience"));
463
+ expectTypeOf(longAndLong).toEqualTypeOf();
464
+ const intAndInt = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("employeeId"));
465
+ expectTypeOf(intAndInt).toEqualTypeOf();
466
+ const intLongDoubleChain = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("yearsOfExperience")).add(base.selectProperty("employeeId")).add(base.selectProperty("performanceScore")).add(base.selectProperty("employeeId"));
467
+ expectTypeOf(intLongDoubleChain).toEqualTypeOf();
468
+ const shortAndIntReturnsInt = base.pivotTo("lead").selectProperty("rank").add(base.selectProperty("employeeId"));
469
+ expectTypeOf(shortAndIntReturnsInt).toEqualTypeOf();
470
+ const shortAndFloatReturnsDouble = base.pivotTo("lead").selectProperty("rank").add(base.selectProperty("hourlyRate"));
471
+ expectTypeOf(shortAndFloatReturnsDouble).toEqualTypeOf();
472
+ return intLongDoubleChain;
473
+ }
474
+ });
475
+ });
476
+ it("allows adding number literals as a double", () => {
477
+ fauxObjectSet.withProperties({
478
+ "myProp1": base => {
479
+ const plus = base.pivotTo("lead").selectProperty("employeeId").add(1);
480
+ expectTypeOf(plus).toEqualTypeOf();
481
+ return plus;
482
+ }
483
+ });
484
+ });
485
+ it("allows adding literals via base.constant", () => {
486
+ fauxObjectSet.withProperties({
487
+ "myProp1": base => {
488
+ const plus = base.pivotTo("lead").selectProperty("employeeId").add(base.constant.double(1));
489
+ expectTypeOf(plus).toEqualTypeOf();
490
+ const intPlusIntReturnsInt = base.pivotTo("lead").selectProperty("employeeId").add(base.constant.integer(1));
491
+ expectTypeOf(intPlusIntReturnsInt).toEqualTypeOf();
492
+ return plus;
493
+ }
494
+ });
495
+ });
496
+ it("allows correctly typed nested property definitions", () => {
497
+ fauxObjectSet.withProperties({
498
+ "myProp1": base => {
499
+ const nested = base.pivotTo("lead").selectProperty("employeeId").add(base.pivotTo("peeps").aggregate("employeeId:sum"));
500
+ expectTypeOf(nested).toEqualTypeOf();
501
+ return nested;
502
+ }
503
+ });
504
+ });
505
+ it("allows correctly types property keys off the linked OT", () => {
506
+ fauxObjectSet.withProperties({
507
+ "myProp1": base => {
508
+ const nested = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("performanceScore"));
509
+ expectTypeOf(nested).toEqualTypeOf();
510
+ return nested;
511
+ }
512
+ });
513
+ });
514
+
515
+ // it("allows correctly types property keys off the base OT", () => {});
516
+ });
517
+ describe("datetime expressions", () => {
518
+ it("provides correct methods off of datetime selections", () => {
519
+ fauxObjectSet.withProperties({
520
+ "myProp1": base => {
521
+ const selectedDatetime = base.pivotTo("lead").selectProperty("dateOfJoining");
522
+ expectTypeOf(selectedDatetime).toEqualTypeOf();
523
+ selectedDatetime.max(base.selectProperty("dateOfJoining"));
524
+ selectedDatetime.min(base.selectProperty("lastUpdated"));
525
+ expectTypeOf(base.pivotTo("lead").selectProperty("lastUpdated")).toEqualTypeOf();
526
+ return selectedDatetime;
527
+ }
528
+ });
529
+ });
530
+ it("correctly coerces datetime types", () => {
531
+ fauxObjectSet.withProperties({
532
+ "myProp1": base => {
533
+ const max = base.pivotTo("lead").selectProperty("dateOfJoining").max(base.selectProperty("lastUpdated"));
534
+ expectTypeOf(max).toEqualTypeOf();
535
+ const min = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.selectProperty("dateOfJoining"));
536
+ expectTypeOf(min).toEqualTypeOf();
537
+ return max;
538
+ }
539
+ });
540
+ });
541
+ it("allows adding literals via base.constant", () => {
542
+ fauxObjectSet.withProperties({
543
+ "myProp1": base => {
544
+ const dateAndDateReturnDate = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.constant.datetime("2025-01-01T00:00:00Z"));
545
+ expectTypeOf(dateAndDateReturnDate).toEqualTypeOf();
546
+ const dateAndTimeReturnTime = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.constant.timestamp("2025-01-01T00:00:00Z"));
547
+ expectTypeOf(dateAndTimeReturnTime).toEqualTypeOf();
548
+ return dateAndTimeReturnTime;
549
+ }
550
+ });
551
+ });
552
+ it("allows correctly typed nested property definitions", () => {
553
+ fauxObjectSet.withProperties({
554
+ "myProp1": base => {
555
+ const nested = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.pivotTo("lead").pivotTo("lead").selectProperty("lastUpdated"));
556
+ expectTypeOf(nested).toEqualTypeOf();
557
+ return nested;
558
+ }
559
+ });
560
+ });
561
+ it("allows correctly typed property keys off the linked OT", () => {
562
+ fauxObjectSet.withProperties({
563
+ "myProp1": base => {
564
+ const nested = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.selectProperty("lastUpdated"));
565
+ expectTypeOf(nested).toEqualTypeOf();
566
+ return nested;
567
+ }
568
+ });
569
+ });
570
+
571
+ // it("allows correctly typed property keys off the base OT", () => {});
572
+ });
573
+ });
373
574
  });
374
575
  //# sourceMappingURL=ObjectSet.test.js.map