@osdk/api 2.2.0-beta.13 → 2.2.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/browser/aggregate/AggregatableKeys.js.map +1 -1
- package/build/browser/derivedProperties/DerivedProperty.js.map +1 -1
- package/build/browser/derivedProperties/WithPropertiesAggregationOptions.js.map +1 -1
- package/build/browser/objectSet/BulkLinkResult.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +47 -3
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/cjs/{FilteredPropertyKeys-6yt7Kfww.d.cts → FilteredPropertyKeys-CyOYr7Je.d.cts} +3 -2
- package/build/cjs/index.d.cts +2 -2
- package/build/cjs/public/unstable.d.cts +3 -3
- package/build/esm/aggregate/AggregatableKeys.js.map +1 -1
- package/build/esm/derivedProperties/DerivedProperty.js.map +1 -1
- package/build/esm/derivedProperties/WithPropertiesAggregationOptions.js.map +1 -1
- package/build/esm/objectSet/BulkLinkResult.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +47 -3
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/types/aggregate/AggregatableKeys.d.ts +2 -2
- package/build/types/aggregate/AggregatableKeys.d.ts.map +1 -1
- package/build/types/derivedProperties/DerivedProperty.d.ts +2 -2
- package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -1
- package/build/types/derivedProperties/WithPropertiesAggregationOptions.d.ts +1 -1
- package/build/types/derivedProperties/WithPropertiesAggregationOptions.d.ts.map +1 -1
- package/build/types/objectSet/BulkLinkResult.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @osdk/api
|
|
2
2
|
|
|
3
|
+
## 2.2.0-beta.15
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ed69666: Update conjure-lite to 0.7.1
|
|
8
|
+
|
|
9
|
+
## 2.2.0-beta.14
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 6abf078: Fixes aggregation types for datetime to include collectList and collectSet
|
|
14
|
+
|
|
3
15
|
## 2.2.0-beta.13
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregatableKeys.js","names":[],"sources":["AggregatableKeys.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n BaseWithPropAggregations,\n DistinctWithPropAggregateOption,\n NumericWithPropAggregateOption,\n ValidCollectPropertyKeysForSpecialTypes,\n} from \"../derivedProperties/WithPropertiesAggregationOptions.js\";\nimport type {\n GetWirePropertyValueFromClient,\n} from \"../mapping/PropertyValueMapping.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { WirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\n\nexport type BaseAggregateOptions = \"approximateDistinct\" | \"exactDistinct\";\n\nexport type MinMaxAggregateOption = \"min\" | \"max\";\n\nexport type DatetimeAggregateOption =\n | MinMaxAggregateOption\n | BaseAggregateOptions;\n\nexport type NumericAggregateOption =\n | \"sum\"\n | \"avg\"\n | \"approximateDistinct\"\n | \"exactDistinct\"\n | MinMaxAggregateOption;\n\ntype AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends\n GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\" ? DatetimeAggregateOption\n : BaseAggregateOptions;\n\ntype WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> =\n number extends GetWirePropertyValueFromClient<WIRE_TYPE>\n ? NumericWithPropAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\"
|
|
1
|
+
{"version":3,"file":"AggregatableKeys.js","names":[],"sources":["AggregatableKeys.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n BaseWithPropAggregations,\n DatetimeWithPropAggregateOption,\n DistinctWithPropAggregateOption,\n NumericWithPropAggregateOption,\n ValidCollectPropertyKeysForSpecialTypes,\n} from \"../derivedProperties/WithPropertiesAggregationOptions.js\";\nimport type {\n GetWirePropertyValueFromClient,\n} from \"../mapping/PropertyValueMapping.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { WirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\n\nexport type BaseAggregateOptions = \"approximateDistinct\" | \"exactDistinct\";\n\nexport type MinMaxAggregateOption = \"min\" | \"max\";\n\nexport type DatetimeAggregateOption =\n | MinMaxAggregateOption\n | BaseAggregateOptions;\n\nexport type NumericAggregateOption =\n | \"sum\"\n | \"avg\"\n | \"approximateDistinct\"\n | \"exactDistinct\"\n | MinMaxAggregateOption;\n\ntype AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends\n GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\" ? DatetimeAggregateOption\n : BaseAggregateOptions;\n\ntype WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> =\n number extends GetWirePropertyValueFromClient<WIRE_TYPE>\n ? NumericWithPropAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\"\n ? DatetimeWithPropAggregateOption\n : WIRE_TYPE extends \"string\" ? BaseWithPropAggregations\n : WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE>;\n\ntype WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<\n WIRE_TYPE extends WirePropertyTypes,\n> = WIRE_TYPE extends ValidCollectPropertyKeysForSpecialTypes\n ? BaseWithPropAggregations\n : DistinctWithPropAggregateOption;\n\nexport type ValidAggregationKeys<\n Q extends ObjectOrInterfaceDefinition,\n R extends \"aggregate\" | \"withPropertiesAggregate\" = \"aggregate\",\n> = keyof (\n & {\n [\n KK in AggregatableKeys<Q> as `${KK & string}:${R extends \"aggregate\"\n ? AGG_FOR_TYPE<\n CompileTimeMetadata<Q>[\"properties\"][KK][\"type\"]\n >\n : WITH_PROPERTIES_AGG_FOR_TYPE<\n CompileTimeMetadata<Q>[\"properties\"][KK][\"type\"]\n >}`\n ]?: any;\n }\n & { $count?: any }\n);\n\nexport type AggregatableKeys<\n Q extends ObjectOrInterfaceDefinition,\n> = keyof {\n [P in PropertyKeys<Q>]: any;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -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 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 {
|
|
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 CollectWithPropAggregations,\n MinMaxWithPropAggregateOption,\n} from \"./WithPropertiesAggregationOptions.js\";\n\nexport namespace DerivedProperty {\n export type SelectorResult<\n T extends SimplePropertyDef,\n > = {\n type: T;\n };\n\n export type Clause<\n Q extends ObjectOrInterfaceDefinition,\n > = {\n [key: string]: Selector<Q, SimplePropertyDef>;\n };\n\n export type Selector<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n > = (\n baseObjectSet: DerivedProperty.Builder<Q, false>,\n ) => SelectorResult<T>;\n\n export interface Builder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {\n }\n\n export interface AggregateBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Builder<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\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 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.SelectorResult<\n V extends `${infer N}:${infer P}`\n ? P extends CollectWithPropAggregations\n ? Array<CompileTimeMetadata<Q>[\"properties\"][N][\"type\"]> | undefined\n : P extends MinMaxWithPropAggregateOption\n ? CompileTimeMetadata<Q>[\"properties\"][N][\"type\"] | undefined\n : P extends \"approximateDistinct\" | \"exactDistinct\" | \"$count\" ? \"integer\"\n : \"double\" | undefined\n : V extends \"$count\" ? \"integer\"\n : never\n >;\n};\n\ntype Selectable<Q extends ObjectOrInterfaceDefinition> = {\n readonly selectProperty: <R extends PropertyKeys<Q>>(\n propertyName: R,\n ) => DerivedProperty.SelectorResult<\n SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][R][\"type\"],\n CompileTimeMetadata<Q>[\"properties\"][R][\"nullable\"],\n CompileTimeMetadata<Q>[\"properties\"][R][\"multiplicity\"]\n >\n >;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA8BiBA,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithPropertiesAggregationOptions.js","names":[],"sources":["WithPropertiesAggregationOptions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type DistinctWithPropAggregateOption =\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\nexport type CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | DistinctWithPropAggregateOption\n | CollectWithPropAggregations;\n\nexport type MinMaxWithPropAggregateOption = \"min\" | \"max\";\n\nexport type
|
|
1
|
+
{"version":3,"file":"WithPropertiesAggregationOptions.js","names":[],"sources":["WithPropertiesAggregationOptions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type DistinctWithPropAggregateOption =\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\nexport type CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | DistinctWithPropAggregateOption\n | CollectWithPropAggregations;\n\nexport type MinMaxWithPropAggregateOption = \"min\" | \"max\";\n\nexport type DatetimeWithPropAggregateOption =\n | MinMaxWithPropAggregateOption\n | BaseWithPropAggregations;\n\nexport type NumericWithPropAggregateOption =\n | \"sum\"\n | \"avg\"\n | \"approximatePercentile\"\n | MinMaxWithPropAggregateOption\n | BaseWithPropAggregations;\n\nexport type ValidCollectPropertyKeysForSpecialTypes =\n | \"attachment\"\n | \"geopoint\"\n | \"geoshape\"\n | \"boolean\";\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkLinkResult.js","names":[],"sources":["BulkLinkResult.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 { OsdkBase } from \"../OsdkBase.js\";\n\nexport interface EXPERIMENTAL_BulkLinkResult {\n object: OsdkBase<any>;\n linkApiName: string;\n otherObjectApiName: string | undefined;\n otherObjectPk: unknown;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BulkLinkResult.js","names":[],"sources":["BulkLinkResult.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 { OsdkBase } from \"../OsdkBase.js\";\n\nexport interface EXPERIMENTAL_BulkLinkResult {\n object: OsdkBase<any>;\n linkApiName: string;\n otherObjectApiName: string | null | undefined;\n otherObjectPk: unknown;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -23,7 +23,9 @@ describe("ObjectSet", () => {
|
|
|
23
23
|
withProperties: vi.fn(() => {
|
|
24
24
|
return fauxObjectSet;
|
|
25
25
|
}),
|
|
26
|
-
fetchPage: vi.fn(() => Promise.resolve(
|
|
26
|
+
fetchPage: vi.fn(() => Promise.resolve({
|
|
27
|
+
data: [{}]
|
|
28
|
+
})),
|
|
27
29
|
asyncIter: vi.fn(() => {
|
|
28
30
|
return {};
|
|
29
31
|
}),
|
|
@@ -196,16 +198,58 @@ describe("ObjectSet", () => {
|
|
|
196
198
|
"geotimeSeriesReference": base =>
|
|
197
199
|
// @ts-expect-error
|
|
198
200
|
base.pivotTo("lead").aggregate("geotimeSeriesReference:sum"),
|
|
199
|
-
"geotimeSeriesReferenceExactDistinct": base => base.pivotTo("lead").aggregate("geotimeSeriesReference:exactDistinct")
|
|
201
|
+
"geotimeSeriesReferenceExactDistinct": base => base.pivotTo("lead").aggregate("geotimeSeriesReference:exactDistinct"),
|
|
202
|
+
"lastClockIn": base => {
|
|
203
|
+
base.pivotTo("lead").aggregate("lastClockIn:approximateDistinct");
|
|
204
|
+
base.pivotTo("lead").aggregate("lastClockIn:exactDistinct");
|
|
205
|
+
base.pivotTo("lead").aggregate("lastClockIn:max");
|
|
206
|
+
base.pivotTo("lead").aggregate("lastClockIn:min");
|
|
207
|
+
base.pivotTo("lead").aggregate("lastClockIn:collectList");
|
|
208
|
+
return base.pivotTo("lead").aggregate("lastClockIn:collectSet");
|
|
209
|
+
},
|
|
210
|
+
"dateOfBirth": base => {
|
|
211
|
+
base.pivotTo("lead").aggregate("dateOfBirth:approximateDistinct");
|
|
212
|
+
base.pivotTo("lead").aggregate("dateOfBirth:exactDistinct");
|
|
213
|
+
base.pivotTo("lead").aggregate("dateOfBirth:max");
|
|
214
|
+
base.pivotTo("lead").aggregate("dateOfBirth:min");
|
|
215
|
+
base.pivotTo("lead").aggregate("dateOfBirth:collectList");
|
|
216
|
+
return base.pivotTo("lead").aggregate("dateOfBirth:collectSet");
|
|
217
|
+
}
|
|
200
218
|
});
|
|
201
219
|
});
|
|
220
|
+
it("has correct aggregation return types", async () => {
|
|
221
|
+
const aggTestObjectSet = fauxObjectSet.withProperties({
|
|
222
|
+
"maxHasSameType": base => base.pivotTo("lead").aggregate("dateOfBirth:max"),
|
|
223
|
+
"minHasSameType": base => base.pivotTo("lead").aggregate("dateOfBirth:min"),
|
|
224
|
+
"approximateDistinctNumberNoUndefined": base => base.pivotTo("lead").aggregate("employeeId:approximateDistinct"),
|
|
225
|
+
"exactDistinctNumberNoUndefined": base => base.pivotTo("lead").aggregate("employeeId:exactDistinct"),
|
|
226
|
+
"countNumberNoUndefined": base => base.pivotTo("lead").aggregate("$count"),
|
|
227
|
+
"sumNumber": base => base.pivotTo("lead").aggregate("employeeId:sum"),
|
|
228
|
+
"avgNumber": base => base.pivotTo("lead").aggregate("employeeId:avg")
|
|
229
|
+
}).fetchPage();
|
|
230
|
+
const result = (await aggTestObjectSet).data[0];
|
|
231
|
+
expectTypeOf((await aggTestObjectSet).data[0]).toEqualTypeOf();
|
|
232
|
+
expectTypeOf(result.maxHasSameType).toEqualTypeOf();
|
|
233
|
+
expectTypeOf(result.minHasSameType).toEqualTypeOf();
|
|
234
|
+
expectTypeOf(result.approximateDistinctNumberNoUndefined).toEqualTypeOf();
|
|
235
|
+
expectTypeOf(result.exactDistinctNumberNoUndefined).toEqualTypeOf();
|
|
236
|
+
expectTypeOf(result.countNumberNoUndefined).toEqualTypeOf();
|
|
237
|
+
expectTypeOf(result.sumNumber).toEqualTypeOf();
|
|
238
|
+
expectTypeOf(result.avgNumber).toEqualTypeOf();
|
|
239
|
+
});
|
|
202
240
|
});
|
|
203
241
|
describe("aggregate", () => {
|
|
204
242
|
it("has correct aggregation keys", () => {
|
|
205
243
|
void fauxObjectSet.aggregate({
|
|
206
244
|
"$select": {
|
|
207
245
|
"lastClockIn:max": "asc",
|
|
208
|
-
"
|
|
246
|
+
"lastClockIn:min": "desc",
|
|
247
|
+
"lastClockIn:approximateDistinct": "asc",
|
|
248
|
+
"lastClockIn:exactDistinct": "desc",
|
|
249
|
+
"dateOfBirth:max": "desc",
|
|
250
|
+
"dateOfBirth:min": "asc",
|
|
251
|
+
"dateOfBirth:approximateDistinct": "asc",
|
|
252
|
+
"dateOfBirth:exactDistinct": "desc"
|
|
209
253
|
}
|
|
210
254
|
});
|
|
211
255
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","it","test","vi","fauxObjectSet","where","fn","withProperties","fetchPage","Promise","resolve","asyncIter","aggregate","toEqualTypeOf","withA","base","pivotTo","withFamily","selectProperty","withMom","withParents","todo","withAggregations","$select"],"sources":["ObjectSet.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it, test, vi } from \"vitest\";\n\nimport type { ObjectSet as $ObjectSet, Osdk, PropertyKeys } from \"../index.js\";\nimport type { EmployeeApiTest } from \"../test/EmployeeApiTest.js\";\n\ndescribe(\"ObjectSet\", () => {\n const fauxObjectSet = {\n where: vi.fn(() => {\n return fauxObjectSet;\n }),\n withProperties: vi.fn(() => {\n return fauxObjectSet;\n }),\n fetchPage: vi.fn(() => Promise.resolve()),\n asyncIter: vi.fn(() => {\n return {};\n }),\n aggregate: vi.fn(() => {\n return {};\n }),\n } as any as EmployeeApiTest.ObjectSet;\n\n describe(\"normal\", () => {\n test(\"select none\", async () => {\n const result = await fauxObjectSet.fetchPage();\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never>\n >();\n });\n\n test(\"select one\", async () => {\n const result = await fauxObjectSet.fetchPage({ \"$select\": [\"fullName\"] });\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"fullName\">\n >();\n });\n });\n\n describe(\".withProperties\", () => {\n test(\"single property\", async () => {\n const withA = fauxObjectSet.withProperties({\n \"a\": (base) => {\n return base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\");\n },\n });\n\n expectTypeOf(withA).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n a: \"integer\";\n }>\n >();\n\n const withAResults = await withA.fetchPage();\n\n expectTypeOf<typeof withAResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n a: \"integer\";\n }>\n >();\n\n expectTypeOf<typeof withAResults[\"data\"][0][\"a\"]>()\n .toEqualTypeOf<number>();\n });\n\n test(\"multiple properties\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n expectTypeOf(withFamily).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"dad\"]>()\n .toEqualTypeOf<string | undefined>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"sister\"]>()\n .toEqualTypeOf<string[] | undefined>();\n });\n\n describe(\"called in succession\", () => {\n test(\"independently\", () => {\n const withMom = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n const withParents = withMom.withProperties({\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n });\n\n expectTypeOf(withParents).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n }>\n >();\n });\n\n test.todo(\"with calculated properties\");\n });\n\n describe(\"nullability\", () => {\n it(\"count, exactDistinct, and approximateDistinct aren't nullable\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\"),\n \"sis\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:approximateDistinct\"),\n });\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"integer\";\n sis: \"integer\";\n }>\n >();\n });\n\n it(\n \"collectToSet, collectToList, selectProperty, and numeric aggregations are nullable\",\n async () => {\n const withAggregations = fauxObjectSet.withProperties({\n \"collectSet\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectSet\"),\n \"select\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"collectList\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"min\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:max\"),\n \"max\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:min\"),\n \"sum\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avg\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n \"approximatePercentile\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"employeeId:approximatePercentile\",\n ),\n });\n\n const withAggregationResults = await withAggregations.fetchPage();\n\n expectTypeOf<typeof withAggregationResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n collectSet: \"string\"[] | undefined;\n select: \"string\" | undefined;\n collectList: \"string\"[] | undefined;\n min: \"double\" | undefined;\n max: \"double\" | undefined;\n sum: \"double\" | undefined;\n avg: \"double\" | undefined;\n approximatePercentile: \"double\" | undefined;\n }\n >\n >();\n },\n );\n });\n\n describe(\"fetch functions return correct Osdk.Instance\", () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n\n it(\"works with .where\", async () => {\n const where = withFamily.where({ \"mom\": 1 });\n const whereResults = await where.fetchPage();\n\n expectTypeOf<typeof where>().toEqualTypeOf<typeof withFamily>();\n expectTypeOf<typeof whereResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"works with .async\", () => {\n const asyncIter = withFamily.asyncIter();\n expectTypeOf<typeof asyncIter>().toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >\n >();\n });\n\n it(\"Works with no select\", async () => {\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"Works with selecting all RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\", \"dad\", \"sister\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n });\n\n it(\"Works with selecting some RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n }>\n >();\n });\n\n it(\"Works with selecting all non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\n \"class\",\n \"fullName\",\n \"employeeId\",\n \"attachment\",\n \"geopoint\",\n \"timeseries\",\n \"mediaReference\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"lastClockIn\",\n \"dateOfBirth\",\n ],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {}\n >\n >();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"class\"]>()\n .toEqualTypeOf<\n string | undefined\n >();\n });\n\n it(\"Works with selecting some non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"class\", {}>\n >();\n });\n\n it(\"Works with selecting a mix\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\", \"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n \"class\",\n { mom: \"integer\" }\n >\n >();\n });\n });\n\n it(\"allows extracting the type\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n type ObjectSetType = typeof objectSet;\n\n expectTypeOf<ObjectSetType>().toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n }>\n >();\n\n const objectSet2 = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"Defining the Type\", () => {\n type ObjectSetType = $ObjectSet<\n EmployeeApiTest,\n {\n mom: \"integer\" | undefined;\n }\n >;\n\n fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"has correct aggregation keys\", () => {\n fauxObjectSet.withProperties({\n \"integer\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"integerNumericAgg\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"string\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"stringDoesNotHaveNumericAgg\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"class:sum\"),\n \"isActive\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"isActive:approximateDistinct\"),\n \"attachment\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"attachment:collectList\"),\n \"geopoint\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"geopoint:collectList\"),\n \"numericTimeseries\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"timeseries:sum\"),\n \"numericTimeseriesExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"timeseries:exactDistinct\"),\n \"mediaReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"mediaReference:avg\"),\n \"mediaReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"mediaReference:exactDistinct\"),\n \"geotimeSeriesReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"geotimeSeriesReference:sum\"),\n \"geotimeSeriesReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"geotimeSeriesReference:exactDistinct\",\n ),\n });\n });\n });\n describe(\"aggregate\", () => {\n it(\"has correct aggregation keys\", () => {\n void fauxObjectSet.aggregate({\n \"$select\": {\n \"lastClockIn:max\": \"asc\",\n \"dateOfBirth:max\": \"desc\",\n },\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,EAAEC,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AAK7DJ,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1B,MAAMK,aAAa,GAAG;IACpBC,KAAK,EAAEF,EAAE,CAACG,EAAE,CAAC,MAAM;MACjB,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFG,cAAc,EAAEJ,EAAE,CAACG,EAAE,CAAC,MAAM;MAC1B,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFI,SAAS,EAAEL,EAAE,CAACG,EAAE,CAAC,MAAMG,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;IACzCC,SAAS,EAAER,EAAE,CAACG,EAAE,CAAC,MAAM;MACrB,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;IACFM,SAAS,EAAET,EAAE,CAACG,EAAE,CAAC,MAAM;MACrB,OAAO,CAAC,CAAC;IACX,CAAC;EACH,CAAqC;EAErCP,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACvBG,IAAI,CAAC,aAAa,EAAE,YAAY;MACf,MAAME,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AC,CAACJ,SAAS,CAAC,sBAAsB,CAAC;QACxD,mBAAmB,EAAGG,IAAI;QACxB;QACAA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,gBAAgB,CAAC;QAClD,gCAAgC,EAAGG,IAAI,IACrCA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,0BAA0B,CAAC;QAC5D,gBAAgB,EAAGG,IAAI;QACrB;QACAA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,oBAAoB,CAAC;QACtD,6BAA6B,EAAGG,IAAI,IAClCA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,8BAA8B,CAAC;QAChE,wBAAwB,EAAGG,IAAI;QAC7B;QACAA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,4BAA4B,CAAC;QAC9D,qCAAqC,EAAGG,IAAI,IAC1CA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAC5B,sCACF;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EACFb,QAAQ,CAAC,WAAW,EAAE,MAAM;IAC1BE,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvC,KAAKG,aAAa,CAACQ,SAAS,CAAC;QAC3B,SAAS,EAAE;UACT,iBAAiB,EAAE,KAAK;UACxB,iBAAiB,EAAE;QACrB;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","it","test","vi","fauxObjectSet","where","fn","withProperties","fetchPage","Promise","resolve","data","asyncIter","aggregate","toEqualTypeOf","withA","base","pivotTo","withFamily","selectProperty","withMom","withParents","todo","withAggregations","$select","aggTestObjectSet","result","maxHasSameType","minHasSameType","approximateDistinctNumberNoUndefined","exactDistinctNumberNoUndefined","countNumberNoUndefined","sumNumber","avgNumber"],"sources":["ObjectSet.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it, test, vi } from \"vitest\";\n\nimport type { ObjectSet as $ObjectSet, Osdk, PropertyKeys } from \"../index.js\";\nimport type { EmployeeApiTest } from \"../test/EmployeeApiTest.js\";\n\ndescribe(\"ObjectSet\", () => {\n const fauxObjectSet = {\n where: vi.fn(() => {\n return fauxObjectSet;\n }),\n withProperties: vi.fn(() => {\n return fauxObjectSet;\n }),\n fetchPage: vi.fn(() => Promise.resolve({ data: [{}] })),\n asyncIter: vi.fn(() => {\n return {};\n }),\n aggregate: vi.fn(() => {\n return {};\n }),\n } as any as EmployeeApiTest.ObjectSet;\n\n describe(\"normal\", () => {\n test(\"select none\", async () => {\n const result = await fauxObjectSet.fetchPage();\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never>\n >();\n });\n\n test(\"select one\", async () => {\n const result = await fauxObjectSet.fetchPage({ \"$select\": [\"fullName\"] });\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"fullName\">\n >();\n });\n });\n\n describe(\".withProperties\", () => {\n test(\"single property\", async () => {\n const withA = fauxObjectSet.withProperties({\n \"a\": (base) => {\n return base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\");\n },\n });\n\n expectTypeOf(withA).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n a: \"integer\";\n }>\n >();\n\n const withAResults = await withA.fetchPage();\n\n expectTypeOf<typeof withAResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n a: \"integer\";\n }>\n >();\n\n expectTypeOf<typeof withAResults[\"data\"][0][\"a\"]>()\n .toEqualTypeOf<number>();\n });\n\n test(\"multiple properties\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n expectTypeOf(withFamily).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"dad\"]>()\n .toEqualTypeOf<string | undefined>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"sister\"]>()\n .toEqualTypeOf<string[] | undefined>();\n });\n\n describe(\"called in succession\", () => {\n test(\"independently\", () => {\n const withMom = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n const withParents = withMom.withProperties({\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n });\n\n expectTypeOf(withParents).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n }>\n >();\n });\n\n test.todo(\"with calculated properties\");\n });\n\n describe(\"nullability\", () => {\n it(\"count, exactDistinct, and approximateDistinct aren't nullable\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\"),\n \"sis\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:approximateDistinct\"),\n });\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"integer\";\n sis: \"integer\";\n }>\n >();\n });\n\n it(\n \"collectToSet, collectToList, selectProperty, and numeric aggregations are nullable\",\n async () => {\n const withAggregations = fauxObjectSet.withProperties({\n \"collectSet\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectSet\"),\n \"select\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"collectList\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"min\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:max\"),\n \"max\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:min\"),\n \"sum\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avg\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n \"approximatePercentile\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"employeeId:approximatePercentile\",\n ),\n });\n\n const withAggregationResults = await withAggregations.fetchPage();\n\n expectTypeOf<typeof withAggregationResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n collectSet: \"string\"[] | undefined;\n select: \"string\" | undefined;\n collectList: \"string\"[] | undefined;\n min: \"double\" | undefined;\n max: \"double\" | undefined;\n sum: \"double\" | undefined;\n avg: \"double\" | undefined;\n approximatePercentile: \"double\" | undefined;\n }\n >\n >();\n },\n );\n });\n\n describe(\"fetch functions return correct Osdk.Instance\", () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n\n it(\"works with .where\", async () => {\n const where = withFamily.where({ \"mom\": 1 });\n const whereResults = await where.fetchPage();\n\n expectTypeOf<typeof where>().toEqualTypeOf<typeof withFamily>();\n expectTypeOf<typeof whereResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"works with .async\", () => {\n const asyncIter = withFamily.asyncIter();\n expectTypeOf<typeof asyncIter>().toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >\n >();\n });\n\n it(\"Works with no select\", async () => {\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"Works with selecting all RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\", \"dad\", \"sister\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n });\n\n it(\"Works with selecting some RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n }>\n >();\n });\n\n it(\"Works with selecting all non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\n \"class\",\n \"fullName\",\n \"employeeId\",\n \"attachment\",\n \"geopoint\",\n \"timeseries\",\n \"mediaReference\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"lastClockIn\",\n \"dateOfBirth\",\n ],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {}\n >\n >();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"class\"]>()\n .toEqualTypeOf<\n string | undefined\n >();\n });\n\n it(\"Works with selecting some non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"class\", {}>\n >();\n });\n\n it(\"Works with selecting a mix\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\", \"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n \"class\",\n { mom: \"integer\" }\n >\n >();\n });\n });\n\n it(\"allows extracting the type\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n type ObjectSetType = typeof objectSet;\n\n expectTypeOf<ObjectSetType>().toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n }>\n >();\n\n const objectSet2 = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"Defining the Type\", () => {\n type ObjectSetType = $ObjectSet<\n EmployeeApiTest,\n {\n mom: \"integer\" | undefined;\n }\n >;\n\n fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"has correct aggregation keys\", () => {\n fauxObjectSet.withProperties({\n \"integer\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"integerNumericAgg\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"string\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"stringDoesNotHaveNumericAgg\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"class:sum\"),\n \"isActive\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"isActive:approximateDistinct\"),\n \"attachment\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"attachment:collectList\"),\n \"geopoint\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"geopoint:collectList\"),\n \"numericTimeseries\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"timeseries:sum\"),\n \"numericTimeseriesExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"timeseries:exactDistinct\"),\n \"mediaReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"mediaReference:avg\"),\n \"mediaReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"mediaReference:exactDistinct\"),\n \"geotimeSeriesReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"geotimeSeriesReference:sum\"),\n \"geotimeSeriesReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"geotimeSeriesReference:exactDistinct\",\n ),\n \"lastClockIn\": (base) => {\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:approximateDistinct\");\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:exactDistinct\");\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:max\");\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:min\");\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:collectList\");\n return base.pivotTo(\"lead\").aggregate(\"lastClockIn:collectSet\");\n },\n \"dateOfBirth\": (base) => {\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:approximateDistinct\");\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:exactDistinct\");\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:max\");\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:min\");\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:collectList\");\n return base.pivotTo(\"lead\").aggregate(\"dateOfBirth:collectSet\");\n },\n });\n });\n\n it(\"has correct aggregation return types\", async () => {\n const aggTestObjectSet = fauxObjectSet.withProperties({\n \"maxHasSameType\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:max\"),\n \"minHasSameType\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:min\"),\n \"approximateDistinctNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:approximateDistinct\"),\n \"exactDistinctNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:exactDistinct\"),\n \"countNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"sumNumber\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avgNumber\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n }).fetchPage();\n\n const result = (await aggTestObjectSet).data[0];\n expectTypeOf((await aggTestObjectSet).data[0]).toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n maxHasSameType: \"datetime\" | undefined;\n minHasSameType: \"datetime\" | undefined;\n avgNumber: \"double\" | undefined;\n approximateDistinctNumberNoUndefined: \"integer\";\n exactDistinctNumberNoUndefined: \"integer\";\n countNumberNoUndefined: \"integer\";\n sumNumber: \"double\" | undefined;\n }>\n >();\n\n expectTypeOf(result.maxHasSameType).toEqualTypeOf<string | undefined>();\n expectTypeOf(result.minHasSameType).toEqualTypeOf<string | undefined>();\n expectTypeOf(result.approximateDistinctNumberNoUndefined).toEqualTypeOf<\n number\n >();\n expectTypeOf(result.exactDistinctNumberNoUndefined).toEqualTypeOf<\n number\n >();\n expectTypeOf(result.countNumberNoUndefined).toEqualTypeOf<number>();\n expectTypeOf(result.sumNumber).toEqualTypeOf<number | undefined>();\n expectTypeOf(result.avgNumber).toEqualTypeOf<number | undefined>();\n });\n });\n describe(\"aggregate\", () => {\n it(\"has correct aggregation keys\", () => {\n void fauxObjectSet.aggregate({\n \"$select\": {\n \"lastClockIn:max\": \"asc\",\n \"lastClockIn:min\": \"desc\",\n \"lastClockIn:approximateDistinct\": \"asc\",\n \"lastClockIn:exactDistinct\": \"desc\",\n \"dateOfBirth:max\": \"desc\",\n \"dateOfBirth:min\": \"asc\",\n \"dateOfBirth:approximateDistinct\": \"asc\",\n \"dateOfBirth:exactDistinct\": \"desc\",\n },\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,EAAEC,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AAK7DJ,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1B,MAAMK,aAAa,GAAG;IACpBC,KAAK,EAAEF,EAAE,CAACG,EAAE,CAAC,MAAM;MACjB,OAAOF,aAAa;I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AClB,aAAa,CAAqB,CAAC;MAClEd,YAAY,CAAC0B,MAAM,CAACO,SAAS,CAAC,CAACnB,aAAa,CAAqB,CAAC;IACpE,CAAC,CAAC;EACJ,CAAC,CAAC;EACFf,QAAQ,CAAC,WAAW,EAAE,MAAM;IAC1BE,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvC,KAAKG,aAAa,CAACS,SAAS,CAAC;QAC3B,SAAS,EAAE;UACT,iBAAiB,EAAE,KAAK;UACxB,iBAAiB,EAAE,MAAM;UACzB,iCAAiC,EAAE,KAAK;UACxC,2BAA2B,EAAE,MAAM;UACnC,iBAAiB,EAAE,MAAM;UACzB,iBAAiB,EAAE,KAAK;UACxB,iCAAiC,EAAE,KAAK;UACxC,2BAA2B,EAAE;QAC/B;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/build/cjs/{FilteredPropertyKeys-6yt7Kfww.d.cts → FilteredPropertyKeys-CyOYr7Je.d.cts}
RENAMED
|
@@ -60,6 +60,7 @@ type DistinctWithPropAggregateOption = "approximateDistinct" | "exactDistinct";
|
|
|
60
60
|
type CollectWithPropAggregations = "collectSet" | "collectList";
|
|
61
61
|
type BaseWithPropAggregations = DistinctWithPropAggregateOption | CollectWithPropAggregations;
|
|
62
62
|
type MinMaxWithPropAggregateOption = "min" | "max";
|
|
63
|
+
type DatetimeWithPropAggregateOption = MinMaxWithPropAggregateOption | BaseWithPropAggregations;
|
|
63
64
|
type NumericWithPropAggregateOption = "sum" | "avg" | "approximatePercentile" | MinMaxWithPropAggregateOption | BaseWithPropAggregations;
|
|
64
65
|
type ValidCollectPropertyKeysForSpecialTypes = "attachment" | "geopoint" | "geoshape" | "boolean";
|
|
65
66
|
|
|
@@ -376,7 +377,7 @@ type MinMaxAggregateOption = "min" | "max";
|
|
|
376
377
|
type DatetimeAggregateOption = MinMaxAggregateOption | BaseAggregateOptions;
|
|
377
378
|
type NumericAggregateOption = "sum" | "avg" | "approximateDistinct" | "exactDistinct" | MinMaxAggregateOption;
|
|
378
379
|
type AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericAggregateOption : WIRE_TYPE extends "datetime" | "timestamp" ? DatetimeAggregateOption : BaseAggregateOptions;
|
|
379
|
-
type WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericWithPropAggregateOption : WIRE_TYPE extends "datetime" | "timestamp" ?
|
|
380
|
+
type WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericWithPropAggregateOption : WIRE_TYPE extends "datetime" | "timestamp" ? DatetimeWithPropAggregateOption : WIRE_TYPE extends "string" ? BaseWithPropAggregations : WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE>;
|
|
380
381
|
type WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE extends WirePropertyTypes> = WIRE_TYPE extends ValidCollectPropertyKeysForSpecialTypes ? BaseWithPropAggregations : DistinctWithPropAggregateOption;
|
|
381
382
|
type ValidAggregationKeys<Q extends ObjectOrInterfaceDefinition, R extends "aggregate" | "withPropertiesAggregate" = "aggregate"> = keyof ({
|
|
382
383
|
[KK in AggregatableKeys<Q> as `${KK & string}:${R extends "aggregate" ? AGG_FOR_TYPE<CompileTimeMetadata<Q>["properties"][KK]["type"]> : WITH_PROPERTIES_AGG_FOR_TYPE<CompileTimeMetadata<Q>["properties"][KK]["type"]>}`]?: any;
|
|
@@ -943,7 +944,7 @@ type Aggregatable<Q extends ObjectOrInterfaceDefinition> = {
|
|
|
943
944
|
limit: number;
|
|
944
945
|
} : P extends "approximatePercentile" ? {
|
|
945
946
|
percentile: number;
|
|
946
|
-
} : never : never) => DerivedProperty.SelectorResult<V extends `${infer N}:${infer P}` ? P extends CollectWithPropAggregations ? Array<CompileTimeMetadata<Q>["properties"][N]["type"]> | undefined : P extends "approximateDistinct" | "exactDistinct" | "$count" ? "integer" : "double" | undefined : V extends "$count" ? "integer" : never>;
|
|
947
|
+
} : never : never) => DerivedProperty.SelectorResult<V extends `${infer N}:${infer P}` ? P extends CollectWithPropAggregations ? Array<CompileTimeMetadata<Q>["properties"][N]["type"]> | undefined : P extends MinMaxWithPropAggregateOption ? CompileTimeMetadata<Q>["properties"][N]["type"] | undefined : P extends "approximateDistinct" | "exactDistinct" | "$count" ? "integer" : "double" | undefined : V extends "$count" ? "integer" : never>;
|
|
947
948
|
};
|
|
948
949
|
type Selectable<Q extends ObjectOrInterfaceDefinition> = {
|
|
949
950
|
readonly selectProperty: <R extends PropertyKeys<Q>>(propertyName: R) => DerivedProperty.SelectorResult<SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][R]["type"], CompileTimeMetadata<Q>["properties"][R]["nullable"], CompileTimeMetadata<Q>["properties"][R]["multiplicity"]>>;
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Attachment, M as MediaReference, a as AttachmentUpload, O as ObjectTypeDefinition, b as OsdkBase, c as OsdkObjectPrimaryKeyType, d as ObjectSet, I as InterfaceDefinition, R as ReleaseStatus, e as OsdkMetadata, P as PropertyValueWireToClient, f as PrimaryKeyTypes } from './FilteredPropertyKeys-
|
|
2
|
-
export { g as AggregateOpts, h as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, k as AggregationClause, i as AggregationResultsWithGroups, j as AggregationResultsWithoutGroups, l as AggregationsResults, t as AllGroupByValues, w as AsyncIterArgs, x as Augment, y as Augments, Q as BaseObjectSet, a3 as BaseWirePropertyTypes, $ as CompileTimeMetadata, a6 as ConvertProps, r as DerivedProperty, D as DistanceUnitMapping, s as DurationMapping, F as FetchPageArgs, C as FetchPageResult, U as FilteredPropertyKeys, G as GeoFilterOptions, m as GeoFilter_Intersects, n as GeoFilter_Within, aa as GeotimeSeriesProperty, u as GroupByClause, v as GroupByRange, X as InterfaceMetadata, af as LinkNames, ae as LinkedType, H as Media, J as MediaMetadata, N as NullabilityAdherence, a0 as ObjectMetadata, Y as ObjectOrInterfaceDefinition, T as ObjectSetSubscription, _ as ObjectSpecifier, a7 as Osdk, q as OsdkObjectLinksObject, p as OsdkObjectPropertyType, a8 as PageResult, o as PossibleWhereClauseFilters, a5 as PrimaryKeyType, a1 as PropertyDef, Z as PropertyKeys, L as Result, z as SelectArg, B as SelectArgToKeys, S as SingleLinkAccessor, E as SingleOsdkResult, ab as TimeSeriesPoint, ac as TimeSeriesProperty, ad as TimeSeriesQuery, a9 as TimeseriesDurationMapping, V as ValidAggregationKeys, a2 as VersionBound, W as WhereClause, a4 as WirePropertyTypes, K as isOk } from './FilteredPropertyKeys-
|
|
1
|
+
import { A as Attachment, M as MediaReference, a as AttachmentUpload, O as ObjectTypeDefinition, b as OsdkBase, c as OsdkObjectPrimaryKeyType, d as ObjectSet, I as InterfaceDefinition, R as ReleaseStatus, e as OsdkMetadata, P as PropertyValueWireToClient, f as PrimaryKeyTypes } from './FilteredPropertyKeys-CyOYr7Je.cjs';
|
|
2
|
+
export { g as AggregateOpts, h as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, k as AggregationClause, i as AggregationResultsWithGroups, j as AggregationResultsWithoutGroups, l as AggregationsResults, t as AllGroupByValues, w as AsyncIterArgs, x as Augment, y as Augments, Q as BaseObjectSet, a3 as BaseWirePropertyTypes, $ as CompileTimeMetadata, a6 as ConvertProps, r as DerivedProperty, D as DistanceUnitMapping, s as DurationMapping, F as FetchPageArgs, C as FetchPageResult, U as FilteredPropertyKeys, G as GeoFilterOptions, m as GeoFilter_Intersects, n as GeoFilter_Within, aa as GeotimeSeriesProperty, u as GroupByClause, v as GroupByRange, X as InterfaceMetadata, af as LinkNames, ae as LinkedType, H as Media, J as MediaMetadata, N as NullabilityAdherence, a0 as ObjectMetadata, Y as ObjectOrInterfaceDefinition, T as ObjectSetSubscription, _ as ObjectSpecifier, a7 as Osdk, q as OsdkObjectLinksObject, p as OsdkObjectPropertyType, a8 as PageResult, o as PossibleWhereClauseFilters, a5 as PrimaryKeyType, a1 as PropertyDef, Z as PropertyKeys, L as Result, z as SelectArg, B as SelectArgToKeys, S as SingleLinkAccessor, E as SingleOsdkResult, ab as TimeSeriesPoint, ac as TimeSeriesProperty, ad as TimeSeriesQuery, a9 as TimeseriesDurationMapping, V as ValidAggregationKeys, a2 as VersionBound, W as WhereClause, a4 as WirePropertyTypes, K as isOk } from './FilteredPropertyKeys-CyOYr7Je.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Y as ObjectOrInterfaceDefinition, U as FilteredPropertyKeys, M as MediaReference, O as ObjectTypeDefinition, Z as PropertyKeys, N as NullabilityAdherence, z as SelectArg, a7 as Osdk, ag as ExtractOptions, F as FetchPageArgs, C as FetchPageResult, b as OsdkBase } from '../FilteredPropertyKeys-
|
|
2
|
-
export { ah as MinimalObjectSet } from '../FilteredPropertyKeys-
|
|
1
|
+
import { Y as ObjectOrInterfaceDefinition, U as FilteredPropertyKeys, M as MediaReference, O as ObjectTypeDefinition, Z as PropertyKeys, N as NullabilityAdherence, z as SelectArg, a7 as Osdk, ag as ExtractOptions, F as FetchPageArgs, C as FetchPageResult, b as OsdkBase } from '../FilteredPropertyKeys-CyOYr7Je.cjs';
|
|
2
|
+
export { ah as MinimalObjectSet } from '../FilteredPropertyKeys-CyOYr7Je.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -46,7 +46,7 @@ declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<"2.2
|
|
|
46
46
|
interface EXPERIMENTAL_BulkLinkResult {
|
|
47
47
|
object: OsdkBase<any>;
|
|
48
48
|
linkApiName: string;
|
|
49
|
-
otherObjectApiName: string | undefined;
|
|
49
|
+
otherObjectApiName: string | null | undefined;
|
|
50
50
|
otherObjectPk: unknown;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregatableKeys.js","names":[],"sources":["AggregatableKeys.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n BaseWithPropAggregations,\n DistinctWithPropAggregateOption,\n NumericWithPropAggregateOption,\n ValidCollectPropertyKeysForSpecialTypes,\n} from \"../derivedProperties/WithPropertiesAggregationOptions.js\";\nimport type {\n GetWirePropertyValueFromClient,\n} from \"../mapping/PropertyValueMapping.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { WirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\n\nexport type BaseAggregateOptions = \"approximateDistinct\" | \"exactDistinct\";\n\nexport type MinMaxAggregateOption = \"min\" | \"max\";\n\nexport type DatetimeAggregateOption =\n | MinMaxAggregateOption\n | BaseAggregateOptions;\n\nexport type NumericAggregateOption =\n | \"sum\"\n | \"avg\"\n | \"approximateDistinct\"\n | \"exactDistinct\"\n | MinMaxAggregateOption;\n\ntype AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends\n GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\" ? DatetimeAggregateOption\n : BaseAggregateOptions;\n\ntype WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> =\n number extends GetWirePropertyValueFromClient<WIRE_TYPE>\n ? NumericWithPropAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\"
|
|
1
|
+
{"version":3,"file":"AggregatableKeys.js","names":[],"sources":["AggregatableKeys.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n BaseWithPropAggregations,\n DatetimeWithPropAggregateOption,\n DistinctWithPropAggregateOption,\n NumericWithPropAggregateOption,\n ValidCollectPropertyKeysForSpecialTypes,\n} from \"../derivedProperties/WithPropertiesAggregationOptions.js\";\nimport type {\n GetWirePropertyValueFromClient,\n} from \"../mapping/PropertyValueMapping.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { WirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\n\nexport type BaseAggregateOptions = \"approximateDistinct\" | \"exactDistinct\";\n\nexport type MinMaxAggregateOption = \"min\" | \"max\";\n\nexport type DatetimeAggregateOption =\n | MinMaxAggregateOption\n | BaseAggregateOptions;\n\nexport type NumericAggregateOption =\n | \"sum\"\n | \"avg\"\n | \"approximateDistinct\"\n | \"exactDistinct\"\n | MinMaxAggregateOption;\n\ntype AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends\n GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\" ? DatetimeAggregateOption\n : BaseAggregateOptions;\n\ntype WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> =\n number extends GetWirePropertyValueFromClient<WIRE_TYPE>\n ? NumericWithPropAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\"\n ? DatetimeWithPropAggregateOption\n : WIRE_TYPE extends \"string\" ? BaseWithPropAggregations\n : WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE>;\n\ntype WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<\n WIRE_TYPE extends WirePropertyTypes,\n> = WIRE_TYPE extends ValidCollectPropertyKeysForSpecialTypes\n ? BaseWithPropAggregations\n : DistinctWithPropAggregateOption;\n\nexport type ValidAggregationKeys<\n Q extends ObjectOrInterfaceDefinition,\n R extends \"aggregate\" | \"withPropertiesAggregate\" = \"aggregate\",\n> = keyof (\n & {\n [\n KK in AggregatableKeys<Q> as `${KK & string}:${R extends \"aggregate\"\n ? AGG_FOR_TYPE<\n CompileTimeMetadata<Q>[\"properties\"][KK][\"type\"]\n >\n : WITH_PROPERTIES_AGG_FOR_TYPE<\n CompileTimeMetadata<Q>[\"properties\"][KK][\"type\"]\n >}`\n ]?: any;\n }\n & { $count?: any }\n);\n\nexport type AggregatableKeys<\n Q extends ObjectOrInterfaceDefinition,\n> = keyof {\n [P in PropertyKeys<Q>]: any;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -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 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 {
|
|
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 CollectWithPropAggregations,\n MinMaxWithPropAggregateOption,\n} from \"./WithPropertiesAggregationOptions.js\";\n\nexport namespace DerivedProperty {\n export type SelectorResult<\n T extends SimplePropertyDef,\n > = {\n type: T;\n };\n\n export type Clause<\n Q extends ObjectOrInterfaceDefinition,\n > = {\n [key: string]: Selector<Q, SimplePropertyDef>;\n };\n\n export type Selector<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n > = (\n baseObjectSet: DerivedProperty.Builder<Q, false>,\n ) => SelectorResult<T>;\n\n export interface Builder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {\n }\n\n export interface AggregateBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Builder<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\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 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.SelectorResult<\n V extends `${infer N}:${infer P}`\n ? P extends CollectWithPropAggregations\n ? Array<CompileTimeMetadata<Q>[\"properties\"][N][\"type\"]> | undefined\n : P extends MinMaxWithPropAggregateOption\n ? CompileTimeMetadata<Q>[\"properties\"][N][\"type\"] | undefined\n : P extends \"approximateDistinct\" | \"exactDistinct\" | \"$count\" ? \"integer\"\n : \"double\" | undefined\n : V extends \"$count\" ? \"integer\"\n : never\n >;\n};\n\ntype Selectable<Q extends ObjectOrInterfaceDefinition> = {\n readonly selectProperty: <R extends PropertyKeys<Q>>(\n propertyName: R,\n ) => DerivedProperty.SelectorResult<\n SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][R][\"type\"],\n CompileTimeMetadata<Q>[\"properties\"][R][\"nullable\"],\n CompileTimeMetadata<Q>[\"properties\"][R][\"multiplicity\"]\n >\n >;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA8BiBA,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithPropertiesAggregationOptions.js","names":[],"sources":["WithPropertiesAggregationOptions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type DistinctWithPropAggregateOption =\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\nexport type CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | DistinctWithPropAggregateOption\n | CollectWithPropAggregations;\n\nexport type MinMaxWithPropAggregateOption = \"min\" | \"max\";\n\nexport type
|
|
1
|
+
{"version":3,"file":"WithPropertiesAggregationOptions.js","names":[],"sources":["WithPropertiesAggregationOptions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type DistinctWithPropAggregateOption =\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\nexport type CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | DistinctWithPropAggregateOption\n | CollectWithPropAggregations;\n\nexport type MinMaxWithPropAggregateOption = \"min\" | \"max\";\n\nexport type DatetimeWithPropAggregateOption =\n | MinMaxWithPropAggregateOption\n | BaseWithPropAggregations;\n\nexport type NumericWithPropAggregateOption =\n | \"sum\"\n | \"avg\"\n | \"approximatePercentile\"\n | MinMaxWithPropAggregateOption\n | BaseWithPropAggregations;\n\nexport type ValidCollectPropertyKeysForSpecialTypes =\n | \"attachment\"\n | \"geopoint\"\n | \"geoshape\"\n | \"boolean\";\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkLinkResult.js","names":[],"sources":["BulkLinkResult.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 { OsdkBase } from \"../OsdkBase.js\";\n\nexport interface EXPERIMENTAL_BulkLinkResult {\n object: OsdkBase<any>;\n linkApiName: string;\n otherObjectApiName: string | undefined;\n otherObjectPk: unknown;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BulkLinkResult.js","names":[],"sources":["BulkLinkResult.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 { OsdkBase } from \"../OsdkBase.js\";\n\nexport interface EXPERIMENTAL_BulkLinkResult {\n object: OsdkBase<any>;\n linkApiName: string;\n otherObjectApiName: string | null | undefined;\n otherObjectPk: unknown;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -23,7 +23,9 @@ describe("ObjectSet", () => {
|
|
|
23
23
|
withProperties: vi.fn(() => {
|
|
24
24
|
return fauxObjectSet;
|
|
25
25
|
}),
|
|
26
|
-
fetchPage: vi.fn(() => Promise.resolve(
|
|
26
|
+
fetchPage: vi.fn(() => Promise.resolve({
|
|
27
|
+
data: [{}]
|
|
28
|
+
})),
|
|
27
29
|
asyncIter: vi.fn(() => {
|
|
28
30
|
return {};
|
|
29
31
|
}),
|
|
@@ -196,16 +198,58 @@ describe("ObjectSet", () => {
|
|
|
196
198
|
"geotimeSeriesReference": base =>
|
|
197
199
|
// @ts-expect-error
|
|
198
200
|
base.pivotTo("lead").aggregate("geotimeSeriesReference:sum"),
|
|
199
|
-
"geotimeSeriesReferenceExactDistinct": base => base.pivotTo("lead").aggregate("geotimeSeriesReference:exactDistinct")
|
|
201
|
+
"geotimeSeriesReferenceExactDistinct": base => base.pivotTo("lead").aggregate("geotimeSeriesReference:exactDistinct"),
|
|
202
|
+
"lastClockIn": base => {
|
|
203
|
+
base.pivotTo("lead").aggregate("lastClockIn:approximateDistinct");
|
|
204
|
+
base.pivotTo("lead").aggregate("lastClockIn:exactDistinct");
|
|
205
|
+
base.pivotTo("lead").aggregate("lastClockIn:max");
|
|
206
|
+
base.pivotTo("lead").aggregate("lastClockIn:min");
|
|
207
|
+
base.pivotTo("lead").aggregate("lastClockIn:collectList");
|
|
208
|
+
return base.pivotTo("lead").aggregate("lastClockIn:collectSet");
|
|
209
|
+
},
|
|
210
|
+
"dateOfBirth": base => {
|
|
211
|
+
base.pivotTo("lead").aggregate("dateOfBirth:approximateDistinct");
|
|
212
|
+
base.pivotTo("lead").aggregate("dateOfBirth:exactDistinct");
|
|
213
|
+
base.pivotTo("lead").aggregate("dateOfBirth:max");
|
|
214
|
+
base.pivotTo("lead").aggregate("dateOfBirth:min");
|
|
215
|
+
base.pivotTo("lead").aggregate("dateOfBirth:collectList");
|
|
216
|
+
return base.pivotTo("lead").aggregate("dateOfBirth:collectSet");
|
|
217
|
+
}
|
|
200
218
|
});
|
|
201
219
|
});
|
|
220
|
+
it("has correct aggregation return types", async () => {
|
|
221
|
+
const aggTestObjectSet = fauxObjectSet.withProperties({
|
|
222
|
+
"maxHasSameType": base => base.pivotTo("lead").aggregate("dateOfBirth:max"),
|
|
223
|
+
"minHasSameType": base => base.pivotTo("lead").aggregate("dateOfBirth:min"),
|
|
224
|
+
"approximateDistinctNumberNoUndefined": base => base.pivotTo("lead").aggregate("employeeId:approximateDistinct"),
|
|
225
|
+
"exactDistinctNumberNoUndefined": base => base.pivotTo("lead").aggregate("employeeId:exactDistinct"),
|
|
226
|
+
"countNumberNoUndefined": base => base.pivotTo("lead").aggregate("$count"),
|
|
227
|
+
"sumNumber": base => base.pivotTo("lead").aggregate("employeeId:sum"),
|
|
228
|
+
"avgNumber": base => base.pivotTo("lead").aggregate("employeeId:avg")
|
|
229
|
+
}).fetchPage();
|
|
230
|
+
const result = (await aggTestObjectSet).data[0];
|
|
231
|
+
expectTypeOf((await aggTestObjectSet).data[0]).toEqualTypeOf();
|
|
232
|
+
expectTypeOf(result.maxHasSameType).toEqualTypeOf();
|
|
233
|
+
expectTypeOf(result.minHasSameType).toEqualTypeOf();
|
|
234
|
+
expectTypeOf(result.approximateDistinctNumberNoUndefined).toEqualTypeOf();
|
|
235
|
+
expectTypeOf(result.exactDistinctNumberNoUndefined).toEqualTypeOf();
|
|
236
|
+
expectTypeOf(result.countNumberNoUndefined).toEqualTypeOf();
|
|
237
|
+
expectTypeOf(result.sumNumber).toEqualTypeOf();
|
|
238
|
+
expectTypeOf(result.avgNumber).toEqualTypeOf();
|
|
239
|
+
});
|
|
202
240
|
});
|
|
203
241
|
describe("aggregate", () => {
|
|
204
242
|
it("has correct aggregation keys", () => {
|
|
205
243
|
void fauxObjectSet.aggregate({
|
|
206
244
|
"$select": {
|
|
207
245
|
"lastClockIn:max": "asc",
|
|
208
|
-
"
|
|
246
|
+
"lastClockIn:min": "desc",
|
|
247
|
+
"lastClockIn:approximateDistinct": "asc",
|
|
248
|
+
"lastClockIn:exactDistinct": "desc",
|
|
249
|
+
"dateOfBirth:max": "desc",
|
|
250
|
+
"dateOfBirth:min": "asc",
|
|
251
|
+
"dateOfBirth:approximateDistinct": "asc",
|
|
252
|
+
"dateOfBirth:exactDistinct": "desc"
|
|
209
253
|
}
|
|
210
254
|
});
|
|
211
255
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","it","test","vi","fauxObjectSet","where","fn","withProperties","fetchPage","Promise","resolve","asyncIter","aggregate","toEqualTypeOf","withA","base","pivotTo","withFamily","selectProperty","withMom","withParents","todo","withAggregations","$select"],"sources":["ObjectSet.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it, test, vi } from \"vitest\";\n\nimport type { ObjectSet as $ObjectSet, Osdk, PropertyKeys } from \"../index.js\";\nimport type { EmployeeApiTest } from \"../test/EmployeeApiTest.js\";\n\ndescribe(\"ObjectSet\", () => {\n const fauxObjectSet = {\n where: vi.fn(() => {\n return fauxObjectSet;\n }),\n withProperties: vi.fn(() => {\n return fauxObjectSet;\n }),\n fetchPage: vi.fn(() => Promise.resolve()),\n asyncIter: vi.fn(() => {\n return {};\n }),\n aggregate: vi.fn(() => {\n return {};\n }),\n } as any as EmployeeApiTest.ObjectSet;\n\n describe(\"normal\", () => {\n test(\"select none\", async () => {\n const result = await fauxObjectSet.fetchPage();\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never>\n >();\n });\n\n test(\"select one\", async () => {\n const result = await fauxObjectSet.fetchPage({ \"$select\": [\"fullName\"] });\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"fullName\">\n >();\n });\n });\n\n describe(\".withProperties\", () => {\n test(\"single property\", async () => {\n const withA = fauxObjectSet.withProperties({\n \"a\": (base) => {\n return base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\");\n },\n });\n\n expectTypeOf(withA).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n a: \"integer\";\n }>\n >();\n\n const withAResults = await withA.fetchPage();\n\n expectTypeOf<typeof withAResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n a: \"integer\";\n }>\n >();\n\n expectTypeOf<typeof withAResults[\"data\"][0][\"a\"]>()\n .toEqualTypeOf<number>();\n });\n\n test(\"multiple properties\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n expectTypeOf(withFamily).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"dad\"]>()\n .toEqualTypeOf<string | undefined>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"sister\"]>()\n .toEqualTypeOf<string[] | undefined>();\n });\n\n describe(\"called in succession\", () => {\n test(\"independently\", () => {\n const withMom = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n const withParents = withMom.withProperties({\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n });\n\n expectTypeOf(withParents).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n }>\n >();\n });\n\n test.todo(\"with calculated properties\");\n });\n\n describe(\"nullability\", () => {\n it(\"count, exactDistinct, and approximateDistinct aren't nullable\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\"),\n \"sis\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:approximateDistinct\"),\n });\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"integer\";\n sis: \"integer\";\n }>\n >();\n });\n\n it(\n \"collectToSet, collectToList, selectProperty, and numeric aggregations are nullable\",\n async () => {\n const withAggregations = fauxObjectSet.withProperties({\n \"collectSet\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectSet\"),\n \"select\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"collectList\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"min\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:max\"),\n \"max\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:min\"),\n \"sum\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avg\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n \"approximatePercentile\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"employeeId:approximatePercentile\",\n ),\n });\n\n const withAggregationResults = await withAggregations.fetchPage();\n\n expectTypeOf<typeof withAggregationResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n collectSet: \"string\"[] | undefined;\n select: \"string\" | undefined;\n collectList: \"string\"[] | undefined;\n min: \"double\" | undefined;\n max: \"double\" | undefined;\n sum: \"double\" | undefined;\n avg: \"double\" | undefined;\n approximatePercentile: \"double\" | undefined;\n }\n >\n >();\n },\n );\n });\n\n describe(\"fetch functions return correct Osdk.Instance\", () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n\n it(\"works with .where\", async () => {\n const where = withFamily.where({ \"mom\": 1 });\n const whereResults = await where.fetchPage();\n\n expectTypeOf<typeof where>().toEqualTypeOf<typeof withFamily>();\n expectTypeOf<typeof whereResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"works with .async\", () => {\n const asyncIter = withFamily.asyncIter();\n expectTypeOf<typeof asyncIter>().toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >\n >();\n });\n\n it(\"Works with no select\", async () => {\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"Works with selecting all RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\", \"dad\", \"sister\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n });\n\n it(\"Works with selecting some RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n }>\n >();\n });\n\n it(\"Works with selecting all non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\n \"class\",\n \"fullName\",\n \"employeeId\",\n \"attachment\",\n \"geopoint\",\n \"timeseries\",\n \"mediaReference\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"lastClockIn\",\n \"dateOfBirth\",\n ],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {}\n >\n >();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"class\"]>()\n .toEqualTypeOf<\n string | undefined\n >();\n });\n\n it(\"Works with selecting some non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"class\", {}>\n >();\n });\n\n it(\"Works with selecting a mix\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\", \"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n \"class\",\n { mom: \"integer\" }\n >\n >();\n });\n });\n\n it(\"allows extracting the type\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n type ObjectSetType = typeof objectSet;\n\n expectTypeOf<ObjectSetType>().toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n }>\n >();\n\n const objectSet2 = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"Defining the Type\", () => {\n type ObjectSetType = $ObjectSet<\n EmployeeApiTest,\n {\n mom: \"integer\" | undefined;\n }\n >;\n\n fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"has correct aggregation keys\", () => {\n fauxObjectSet.withProperties({\n \"integer\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"integerNumericAgg\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"string\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"stringDoesNotHaveNumericAgg\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"class:sum\"),\n \"isActive\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"isActive:approximateDistinct\"),\n \"attachment\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"attachment:collectList\"),\n \"geopoint\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"geopoint:collectList\"),\n \"numericTimeseries\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"timeseries:sum\"),\n \"numericTimeseriesExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"timeseries:exactDistinct\"),\n \"mediaReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"mediaReference:avg\"),\n \"mediaReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"mediaReference:exactDistinct\"),\n \"geotimeSeriesReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"geotimeSeriesReference:sum\"),\n \"geotimeSeriesReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"geotimeSeriesReference:exactDistinct\",\n ),\n });\n });\n });\n describe(\"aggregate\", () => {\n it(\"has correct aggregation keys\", () => {\n void fauxObjectSet.aggregate({\n \"$select\": {\n \"lastClockIn:max\": \"asc\",\n \"dateOfBirth:max\": \"desc\",\n },\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,EAAEC,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AAK7DJ,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1B,MAAMK,aAAa,GAAG;IACpBC,KAAK,EAAEF,EAAE,CAACG,EAAE,CAAC,MAAM;MACjB,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFG,cAAc,EAAEJ,EAAE,CAACG,EAAE,CAAC,MAAM;MAC1B,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFI,SAAS,EAAEL,EAAE,CAACG,EAAE,CAAC,MAAMG,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;IACzCC,SAAS,EAAER,EAAE,CAACG,EAAE,CAAC,MAAM;MACrB,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;IACFM,SAAS,EAAET,EAAE,CAACG,EAAE,CAAC,MAAM;MACrB,OAAO,CAAC,CAAC;IACX,CAAC;EACH,CAAqC;EAErCP,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACvBG,IAAI,CAAC,aAAa,EAAE,YAAY;MACf,MAAME,aAAa,CAACI,SAAS,CAAC,CAAC;MAC9CR,YAAY,CAAwB,CAAC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G,IAAI;QACxB;QACAA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,gBAAgB,CAAC;QAClD,gCAAgC,EAAGG,IAAI,IACrCA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,0BAA0B,CAAC;QAC5D,gBAAgB,EAAGG,IAAI;QACrB;QACAA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,oBAAoB,CAAC;QACtD,6BAA6B,EAAGG,IAAI,IAClCA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,8BAA8B,CAAC;QAChE,wBAAwB,EAAGG,IAAI;QAC7B;QACAA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAAC,4BAA4B,CAAC;QAC9D,qCAAqC,EAAGG,IAAI,IAC1CA,IAAI,CAACC,OAAO,CAAC,MAAM,CAAC,CAACJ,SAAS,CAC5B,sCACF;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EACFb,QAAQ,CAAC,WAAW,EAAE,MAAM;IAC1BE,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvC,KAAKG,aAAa,CAACQ,SAAS,CAAC;QAC3B,SAAS,EAAE;UACT,iBAAiB,EAAE,KAAK;UACxB,iBAAiB,EAAE;QACrB;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","it","test","vi","fauxObjectSet","where","fn","withProperties","fetchPage","Promise","resolve","data","asyncIter","aggregate","toEqualTypeOf","withA","base","pivotTo","withFamily","selectProperty","withMom","withParents","todo","withAggregations","$select","aggTestObjectSet","result","maxHasSameType","minHasSameType","approximateDistinctNumberNoUndefined","exactDistinctNumberNoUndefined","countNumberNoUndefined","sumNumber","avgNumber"],"sources":["ObjectSet.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it, test, vi } from \"vitest\";\n\nimport type { ObjectSet as $ObjectSet, Osdk, PropertyKeys } from \"../index.js\";\nimport type { EmployeeApiTest } from \"../test/EmployeeApiTest.js\";\n\ndescribe(\"ObjectSet\", () => {\n const fauxObjectSet = {\n where: vi.fn(() => {\n return fauxObjectSet;\n }),\n withProperties: vi.fn(() => {\n return fauxObjectSet;\n }),\n fetchPage: vi.fn(() => Promise.resolve({ data: [{}] })),\n asyncIter: vi.fn(() => {\n return {};\n }),\n aggregate: vi.fn(() => {\n return {};\n }),\n } as any as EmployeeApiTest.ObjectSet;\n\n describe(\"normal\", () => {\n test(\"select none\", async () => {\n const result = await fauxObjectSet.fetchPage();\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never>\n >();\n });\n\n test(\"select one\", async () => {\n const result = await fauxObjectSet.fetchPage({ \"$select\": [\"fullName\"] });\n expectTypeOf<typeof result.data[0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"fullName\">\n >();\n });\n });\n\n describe(\".withProperties\", () => {\n test(\"single property\", async () => {\n const withA = fauxObjectSet.withProperties({\n \"a\": (base) => {\n return base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\");\n },\n });\n\n expectTypeOf(withA).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n a: \"integer\";\n }>\n >();\n\n const withAResults = await withA.fetchPage();\n\n expectTypeOf<typeof withAResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n a: \"integer\";\n }>\n >();\n\n expectTypeOf<typeof withAResults[\"data\"][0][\"a\"]>()\n .toEqualTypeOf<number>();\n });\n\n test(\"multiple properties\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n expectTypeOf(withFamily).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"dad\"]>()\n .toEqualTypeOf<string | undefined>();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"sister\"]>()\n .toEqualTypeOf<string[] | undefined>();\n });\n\n describe(\"called in succession\", () => {\n test(\"independently\", () => {\n const withMom = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n const withParents = withMom.withProperties({\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n });\n\n expectTypeOf(withParents).toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n }>\n >();\n });\n\n test.todo(\"with calculated properties\");\n });\n\n describe(\"nullability\", () => {\n it(\"count, exactDistinct, and approximateDistinct aren't nullable\", async () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:exactDistinct\"),\n \"sis\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:approximateDistinct\"),\n });\n\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n mom: \"integer\";\n dad: \"integer\";\n sis: \"integer\";\n }>\n >();\n });\n\n it(\n \"collectToSet, collectToList, selectProperty, and numeric aggregations are nullable\",\n async () => {\n const withAggregations = fauxObjectSet.withProperties({\n \"collectSet\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectSet\"),\n \"select\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"collectList\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"min\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:max\"),\n \"max\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:min\"),\n \"sum\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avg\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n \"approximatePercentile\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"employeeId:approximatePercentile\",\n ),\n });\n\n const withAggregationResults = await withAggregations.fetchPage();\n\n expectTypeOf<typeof withAggregationResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n collectSet: \"string\"[] | undefined;\n select: \"string\" | undefined;\n collectList: \"string\"[] | undefined;\n min: \"double\" | undefined;\n max: \"double\" | undefined;\n sum: \"double\" | undefined;\n avg: \"double\" | undefined;\n approximatePercentile: \"double\" | undefined;\n }\n >\n >();\n },\n );\n });\n\n describe(\"fetch functions return correct Osdk.Instance\", () => {\n const withFamily = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"dad\": (base) => base.pivotTo(\"lead\").selectProperty(\"fullName\"),\n \"sister\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n });\n\n it(\"works with .where\", async () => {\n const where = withFamily.where({ \"mom\": 1 });\n const whereResults = await where.fetchPage();\n\n expectTypeOf<typeof where>().toEqualTypeOf<typeof withFamily>();\n expectTypeOf<typeof whereResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"works with .async\", () => {\n const asyncIter = withFamily.asyncIter();\n expectTypeOf<typeof asyncIter>().toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >\n >();\n });\n\n it(\"Works with no select\", async () => {\n const withFamilyResults = await withFamily.fetchPage();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }\n >\n >();\n });\n\n it(\"Works with selecting all RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\", \"dad\", \"sister\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number>();\n });\n\n it(\"Works with selecting some RDPs\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, never, {\n mom: \"integer\";\n }>\n >();\n });\n\n it(\"Works with selecting all non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\n \"class\",\n \"fullName\",\n \"employeeId\",\n \"attachment\",\n \"geopoint\",\n \"timeseries\",\n \"mediaReference\",\n \"geotimeSeriesReference\",\n \"isActive\",\n \"lastClockIn\",\n \"dateOfBirth\",\n ],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n PropertyKeys<EmployeeApiTest>,\n {}\n >\n >();\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"class\"]>()\n .toEqualTypeOf<\n string | undefined\n >();\n });\n\n it(\"Works with selecting some non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, \"class\", {}>\n >();\n });\n\n it(\"Works with selecting a mix\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\", \"mom\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<\n EmployeeApiTest,\n never,\n \"class\",\n { mom: \"integer\" }\n >\n >();\n });\n });\n\n it(\"allows extracting the type\", () => {\n const objectSet = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n });\n\n type ObjectSetType = typeof objectSet;\n\n expectTypeOf<ObjectSetType>().toEqualTypeOf<\n $ObjectSet<EmployeeApiTest, {\n mom: \"integer\";\n }>\n >();\n\n const objectSet2 = fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"Defining the Type\", () => {\n type ObjectSetType = $ObjectSet<\n EmployeeApiTest,\n {\n mom: \"integer\" | undefined;\n }\n >;\n\n fauxObjectSet.withProperties({\n \"mom\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n }) satisfies ObjectSetType;\n });\n\n it(\"has correct aggregation keys\", () => {\n fauxObjectSet.withProperties({\n \"integer\": (base) => base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"integerNumericAgg\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"string\": (base) => base.pivotTo(\"lead\").aggregate(\"class:collectList\"),\n \"stringDoesNotHaveNumericAgg\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"class:sum\"),\n \"isActive\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"isActive:approximateDistinct\"),\n \"attachment\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"attachment:collectList\"),\n \"geopoint\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"geopoint:collectList\"),\n \"numericTimeseries\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"timeseries:sum\"),\n \"numericTimeseriesExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"timeseries:exactDistinct\"),\n \"mediaReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"mediaReference:avg\"),\n \"mediaReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"mediaReference:exactDistinct\"),\n \"geotimeSeriesReference\": (base) =>\n // @ts-expect-error\n base.pivotTo(\"lead\").aggregate(\"geotimeSeriesReference:sum\"),\n \"geotimeSeriesReferenceExactDistinct\": (base) =>\n base.pivotTo(\"lead\").aggregate(\n \"geotimeSeriesReference:exactDistinct\",\n ),\n \"lastClockIn\": (base) => {\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:approximateDistinct\");\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:exactDistinct\");\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:max\");\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:min\");\n base.pivotTo(\"lead\").aggregate(\"lastClockIn:collectList\");\n return base.pivotTo(\"lead\").aggregate(\"lastClockIn:collectSet\");\n },\n \"dateOfBirth\": (base) => {\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:approximateDistinct\");\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:exactDistinct\");\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:max\");\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:min\");\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:collectList\");\n return base.pivotTo(\"lead\").aggregate(\"dateOfBirth:collectSet\");\n },\n });\n });\n\n it(\"has correct aggregation return types\", async () => {\n const aggTestObjectSet = fauxObjectSet.withProperties({\n \"maxHasSameType\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:max\"),\n \"minHasSameType\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"dateOfBirth:min\"),\n \"approximateDistinctNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:approximateDistinct\"),\n \"exactDistinctNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"employeeId:exactDistinct\"),\n \"countNumberNoUndefined\": (base) =>\n base.pivotTo(\"lead\").aggregate(\"$count\"),\n \"sumNumber\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:sum\"),\n \"avgNumber\": (base) => base.pivotTo(\"lead\").aggregate(\"employeeId:avg\"),\n }).fetchPage();\n\n const result = (await aggTestObjectSet).data[0];\n expectTypeOf((await aggTestObjectSet).data[0]).toEqualTypeOf<\n Osdk.Instance<EmployeeApiTest, never, PropertyKeys<EmployeeApiTest>, {\n maxHasSameType: \"datetime\" | undefined;\n minHasSameType: \"datetime\" | undefined;\n avgNumber: \"double\" | undefined;\n approximateDistinctNumberNoUndefined: \"integer\";\n exactDistinctNumberNoUndefined: \"integer\";\n countNumberNoUndefined: \"integer\";\n sumNumber: \"double\" | undefined;\n }>\n >();\n\n expectTypeOf(result.maxHasSameType).toEqualTypeOf<string | undefined>();\n expectTypeOf(result.minHasSameType).toEqualTypeOf<string | undefined>();\n expectTypeOf(result.approximateDistinctNumberNoUndefined).toEqualTypeOf<\n number\n >();\n expectTypeOf(result.exactDistinctNumberNoUndefined).toEqualTypeOf<\n number\n >();\n expectTypeOf(result.countNumberNoUndefined).toEqualTypeOf<number>();\n expectTypeOf(result.sumNumber).toEqualTypeOf<number | undefined>();\n expectTypeOf(result.avgNumber).toEqualTypeOf<number | undefined>();\n });\n });\n describe(\"aggregate\", () => {\n it(\"has correct aggregation keys\", () => {\n void fauxObjectSet.aggregate({\n \"$select\": {\n \"lastClockIn:max\": \"asc\",\n \"lastClockIn:min\": \"desc\",\n \"lastClockIn:approximateDistinct\": \"asc\",\n \"lastClockIn:exactDistinct\": \"desc\",\n \"dateOfBirth:max\": \"desc\",\n \"dateOfBirth:min\": \"asc\",\n \"dateOfBirth:approximateDistinct\": \"asc\",\n \"dateOfBirth:exactDistinct\": \"desc\",\n },\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,EAAEC,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AAK7DJ,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1B,MAAMK,aAAa,GAAG;IACpBC,KAAK,EAAEF,EAAE,CAACG,EAAE,CAAC,MAAM;MACjB,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFG,cAAc,EAAEJ,EAAE,CAACG,EAAE,C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,SAAS,CAAC,CAACnB,aAAa,CAAqB,CAAC;IACpE,CAAC,CAAC;EACJ,CAAC,CAAC;EACFf,QAAQ,CAAC,WAAW,EAAE,MAAM;IAC1BE,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvC,KAAKG,aAAa,CAACS,SAAS,CAAC;QAC3B,SAAS,EAAE;UACT,iBAAiB,EAAE,KAAK;UACxB,iBAAiB,EAAE,MAAM;UACzB,iCAAiC,EAAE,KAAK;UACxC,2BAA2B,EAAE,MAAM;UACnC,iBAAiB,EAAE,MAAM;UACzB,iBAAiB,EAAE,KAAK;UACxB,iCAAiC,EAAE,KAAK;UACxC,2BAA2B,EAAE;QAC/B;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseWithPropAggregations, DistinctWithPropAggregateOption, NumericWithPropAggregateOption, ValidCollectPropertyKeysForSpecialTypes } from "../derivedProperties/WithPropertiesAggregationOptions.js";
|
|
1
|
+
import type { BaseWithPropAggregations, DatetimeWithPropAggregateOption, DistinctWithPropAggregateOption, NumericWithPropAggregateOption, ValidCollectPropertyKeysForSpecialTypes } from "../derivedProperties/WithPropertiesAggregationOptions.js";
|
|
2
2
|
import type { GetWirePropertyValueFromClient } from "../mapping/PropertyValueMapping.js";
|
|
3
3
|
import type { ObjectOrInterfaceDefinition, PropertyKeys } from "../ontology/ObjectOrInterface.js";
|
|
4
4
|
import type { CompileTimeMetadata } from "../ontology/ObjectTypeDefinition.js";
|
|
@@ -8,7 +8,7 @@ export type MinMaxAggregateOption = "min" | "max";
|
|
|
8
8
|
export type DatetimeAggregateOption = MinMaxAggregateOption | BaseAggregateOptions;
|
|
9
9
|
export type NumericAggregateOption = "sum" | "avg" | "approximateDistinct" | "exactDistinct" | MinMaxAggregateOption;
|
|
10
10
|
type AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericAggregateOption : WIRE_TYPE extends "datetime" | "timestamp" ? DatetimeAggregateOption : BaseAggregateOptions;
|
|
11
|
-
type WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericWithPropAggregateOption : WIRE_TYPE extends "datetime" | "timestamp" ?
|
|
11
|
+
type WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericWithPropAggregateOption : WIRE_TYPE extends "datetime" | "timestamp" ? DatetimeWithPropAggregateOption : WIRE_TYPE extends "string" ? BaseWithPropAggregations : WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE>;
|
|
12
12
|
type WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE extends WirePropertyTypes> = WIRE_TYPE extends ValidCollectPropertyKeysForSpecialTypes ? BaseWithPropAggregations : DistinctWithPropAggregateOption;
|
|
13
13
|
export type ValidAggregationKeys<
|
|
14
14
|
Q extends ObjectOrInterfaceDefinition,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,0BACA,iCACA,gCACA,+CACK,0DAA2D;AAClE,cACE,sCACK,oCAAqC;AAC5C,cACE,6BACA,oBACK,kCAAmC;AAC1C,cAAc,2BAA2B,qCAAsC;AAC/E,cAAc,yBAAyB,kCAAmC;AAE1E,YAAY,uBAAuB,wBAAwB;AAE3D,YAAY,wBAAwB,QAAQ;AAE5C,YAAY,0BACR,wBACA;AAEJ,YAAY,yBACR,QACA,QACA,wBACA,kBACA;KAEC,aAAa,kBAAkB,oCAClC,+BAA+B,aAAa,yBAC1C,kBAAkB,aAAa,cAAc,0BAC7C;KAEC,6BAA6B,kBAAkB,oCACnC,+BAA+B,aAC1C,iCACA,kBAAkB,aAAa,
|
|
1
|
+
{"mappings":"AAgBA,cACE,0BACA,iCACA,iCACA,gCACA,+CACK,0DAA2D;AAClE,cACE,sCACK,oCAAqC;AAC5C,cACE,6BACA,oBACK,kCAAmC;AAC1C,cAAc,2BAA2B,qCAAsC;AAC/E,cAAc,yBAAyB,kCAAmC;AAE1E,YAAY,uBAAuB,wBAAwB;AAE3D,YAAY,wBAAwB,QAAQ;AAE5C,YAAY,0BACR,wBACA;AAEJ,YAAY,yBACR,QACA,QACA,wBACA,kBACA;KAEC,aAAa,kBAAkB,oCAClC,+BAA+B,aAAa,yBAC1C,kBAAkB,aAAa,cAAc,0BAC7C;KAEC,6BAA6B,kBAAkB,oCACnC,+BAA+B,aAC1C,iCACA,kBAAkB,aAAa,cAC7B,kCACF,kBAAkB,WAAW,2BAC7B,0CAA0C;KAE3C,0CACH,kBAAkB,qBAChB,kBAAkB,0CAClB,2BACA;AAEJ,YAAY;CACV,UAAU;CACV,UAAU,cAAc,4BAA4B;cAIhD,MAAM,iBAAiB,SAAS,eAAe,UAAU,cACrD,aACA,oBAAoB,GAAG,cAAc,IAAI,WAEzC,6BACA,oBAAoB,GAAG,cAAc,IAAI,uBAI/C;CAAE;AAAc;AAGpB,YAAY,iBACV,UAAU,wCAET,KAAK,aAAa","names":[],"sources":["../../../src/aggregate/AggregatableKeys.ts"],"version":3,"file":"AggregatableKeys.d.ts"}
|
|
@@ -4,7 +4,7 @@ import type { ObjectOrInterfaceDefinition, PropertyKeys } from "../ontology/Obje
|
|
|
4
4
|
import type { CompileTimeMetadata } from "../ontology/ObjectTypeDefinition.js";
|
|
5
5
|
import type { SimplePropertyDef } from "../ontology/SimplePropertyDef.js";
|
|
6
6
|
import type { LinkedType, LinkNames } from "../util/LinkUtils.js";
|
|
7
|
-
import type { CollectWithPropAggregations } from "./WithPropertiesAggregationOptions.js";
|
|
7
|
+
import type { CollectWithPropAggregations, MinMaxWithPropAggregateOption } from "./WithPropertiesAggregationOptions.js";
|
|
8
8
|
export declare namespace DerivedProperty {
|
|
9
9
|
type SelectorResult<T extends SimplePropertyDef> = {
|
|
10
10
|
type: T
|
|
@@ -50,7 +50,7 @@ type Aggregatable<Q extends ObjectOrInterfaceDefinition> = {
|
|
|
50
50
|
limit: number
|
|
51
51
|
} : P extends "approximatePercentile" ? {
|
|
52
52
|
percentile: number
|
|
53
|
-
} : never : never) => DerivedProperty.SelectorResult<V extends `${infer N}:${infer P}` ? P extends CollectWithPropAggregations ? Array<CompileTimeMetadata<Q>["properties"][N]["type"]> | undefined : P extends "approximateDistinct" | "exactDistinct" | "$count" ? "integer" : "double" | undefined : V extends "$count" ? "integer" : never>
|
|
53
|
+
} : never : never) => DerivedProperty.SelectorResult<V extends `${infer N}:${infer P}` ? P extends CollectWithPropAggregations ? Array<CompileTimeMetadata<Q>["properties"][N]["type"]> | undefined : P extends MinMaxWithPropAggregateOption ? CompileTimeMetadata<Q>["properties"][N]["type"] | undefined : P extends "approximateDistinct" | "exactDistinct" | "$count" ? "integer" : "double" | undefined : V extends "$count" ? "integer" : never>
|
|
54
54
|
};
|
|
55
55
|
type Selectable<Q extends ObjectOrInterfaceDefinition> = {
|
|
56
56
|
readonly selectProperty: <R extends PropertyKeys<Q>>(propertyName: R) => DerivedProperty.SelectorResult<SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][R]["type"], CompileTimeMetadata<Q>["properties"][R]["nullable"], CompileTimeMetadata<Q>["properties"][R]["multiplicity"]>>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,4BAA4B,kCAAmC;AAC7E,cAAc,mBAAmB,6BAA8B;AAC/D,cACE,6BACA,oBACK,kCAAmC;AAC1C,cAAc,2BAA2B,qCAAsC;AAC/E,cAAc,yBAAyB,kCAAmC;AAC1E,cAAc,YAAY,iBAAiB,sBAAuB;AAClE,
|
|
1
|
+
{"mappings":"AAgBA,cAAc,4BAA4B,kCAAmC;AAC7E,cAAc,mBAAmB,6BAA8B;AAC/D,cACE,6BACA,oBACK,kCAAmC;A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AAU,wBAAwB,kBAAkB,WAAW,YAC/D,uBACA,UAAU,WAAW;AAG5B;KAEI,WAAW,UAAU,+BAA+B;UAC9C,iBAAiB,UAAU,aAAa,IAC/CC,cAAc,MACX,gBAAgB,eACnB,kBAAkB,KAChB,oBAAoB,GAAG,cAAc,GAAG,SACxC,oBAAoB,GAAG,cAAc,GAAG,aACxC,oBAAoB,GAAG,cAAc,GAAG;AAG7C","names":["baseObjectSet: DerivedProperty.Builder<Q, false>","clause: WhereClause<Q>","type: L","aggregationSpecifier: V","opts?: V extends `${any}:${infer P}`\n ? P extends CollectWithPropAggregations ? { limit: number }\n : P extends \"approximatePercentile\" ? { percentile: number }\n : never\n : never","propertyName: R"],"sources":["../../../src/derivedProperties/DerivedProperty.ts"],"version":3,"file":"DerivedProperty.d.ts"}
|
|
@@ -2,6 +2,6 @@ export type DistinctWithPropAggregateOption = "approximateDistinct" | "exactDist
|
|
|
2
2
|
export type CollectWithPropAggregations = "collectSet" | "collectList";
|
|
3
3
|
export type BaseWithPropAggregations = DistinctWithPropAggregateOption | CollectWithPropAggregations;
|
|
4
4
|
export type MinMaxWithPropAggregateOption = "min" | "max";
|
|
5
|
-
export type
|
|
5
|
+
export type DatetimeWithPropAggregateOption = MinMaxWithPropAggregateOption | BaseWithPropAggregations;
|
|
6
6
|
export type NumericWithPropAggregateOption = "sum" | "avg" | "approximatePercentile" | MinMaxWithPropAggregateOption | BaseWithPropAggregations;
|
|
7
7
|
export type ValidCollectPropertyKeysForSpecialTypes = "attachment" | "geopoint" | "geoshape" | "boolean";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,YAAY,kCACR,wBACA;AAEJ,YAAY,8BAA8B,eAAe;AAEzD,YAAY,2BACR,kCACA;AAEJ,YAAY,gCAAgC,QAAQ;AAEpD,YAAY,
|
|
1
|
+
{"mappings":"AAgBA,YAAY,kCACR,wBACA;AAEJ,YAAY,8BAA8B,eAAe;AAEzD,YAAY,2BACR,kCACA;AAEJ,YAAY,gCAAgC,QAAQ;AAEpD,YAAY,kCACR,gCACA;AAEJ,YAAY,iCACR,QACA,QACA,0BACA,gCACA;AAEJ,YAAY,0CACR,eACA,aACA,aACA","names":[],"sources":["../../../src/derivedProperties/WithPropertiesAggregationOptions.ts"],"version":3,"file":"WithPropertiesAggregationOptions.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/api",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@microsoft/api-extractor": "^7.49.1",
|
|
49
49
|
"ts-expect": "^1.3.0",
|
|
50
50
|
"typescript": "~5.5.4",
|
|
51
|
-
"@osdk/monorepo.
|
|
52
|
-
"@osdk/monorepo.
|
|
51
|
+
"@osdk/monorepo.tsconfig": "~0.1.0-beta.1",
|
|
52
|
+
"@osdk/monorepo.api-extractor": "~0.1.0-beta.1"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|