@osdk/api 2.1.0-rc.32 → 2.2.0-beta.2
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 +3 -3
- package/build/browser/derivedProperties/DerivedProperty.js +17 -0
- package/build/browser/derivedProperties/DerivedProperty.js.map +1 -0
- package/build/browser/derivedProperties/WithPropertiesAggregationOptions.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +111 -1
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/cjs/{ObjectSet-BPh3Vefb.d.cts → ObjectSet-C2x3lIr7.d.cts} +44 -4
- package/build/cjs/index.d.cts +2 -2
- package/build/cjs/public/unstable.d.cts +2 -2
- package/build/esm/derivedProperties/DerivedProperty.js +17 -0
- package/build/esm/derivedProperties/DerivedProperty.js.map +1 -0
- package/build/esm/derivedProperties/WithPropertiesAggregationOptions.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +111 -1
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/types/derivedProperties/DerivedProperty.d.ts +58 -0
- package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -0
- package/build/types/derivedProperties/WithPropertiesAggregationOptions.d.ts +2 -2
- package/build/types/derivedProperties/WithPropertiesAggregationOptions.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/objectSet/ObjectSet.d.ts +8 -1
- package/build/types/objectSet/ObjectSet.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export let DerivedProperty;
|
|
17
|
+
//# sourceMappingURL=DerivedProperty.js.map
|
|
@@ -0,0 +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 { CollectWithPropAggregations } 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 \"approximateDistinct\" | \"exactDistinct\" | \"$count\"\n ? \"integer\" | undefined\n : \"double\" | undefined\n : V extends \"$count\" ? \"integer\" | undefined\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,WA2BiBA,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 CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | \"approximateDistinct\"\n | \"exactDistinct\"
|
|
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 CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\nexport type StringWithPropAggregateOption =\n | BaseWithPropAggregations\n | CollectWithPropAggregations;\n\nexport type NumericWithPropAggregateOption =\n | \"min\"\n | \"max\"\n | \"sum\"\n | \"avg\"\n | \"approximatePercentile\"\n | BaseWithPropAggregations\n | CollectWithPropAggregations;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type { Media, MediaMetadata, MediaReference } from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type { OsdkBase, PrimaryKeyType } from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\n\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,mBAAmB,QAAQ,4BAA4B;
|
|
1
|
+
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport type { DerivedProperty } from \"./derivedProperties/DerivedProperty.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type { Media, MediaMetadata, MediaReference } from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type { OsdkBase, PrimaryKeyType } from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\n\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,mBAAmB,QAAQ,4BAA4B;AAahE,SAASC,eAAe,QAAQ,4BAA4B;AA8B5D,SAASC,IAAI,QAAQ,oBAAoB;AA6CzC,SAASC,yBAAyB,QAAQ,4BAA4B;AAStE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n DerivedObjectOrInterfaceDefinition,\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type { ExtractOptions, Osdk } from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {},\n> = D extends Record<string, SimplePropertyDef>\n ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>\n : Q;\n\ntype ExtractRdp<\n D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>,\n> = D extends Record<string, SimplePropertyDef> ? D : {};\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\n// TODO MOVE THIS\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n readonly fetchPage: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >;\n\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n readonly fetchPageWithErrors: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n readonly asyncIter: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S>,\n ) => AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >;\n}\n\ninterface InterfaceObjectSet<\n Q extends InterfaceDefinition,\n> extends MinimalObjectSet<Q> {\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> =\n ObjectSet<Q, any>,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, UNUSED_OR_RDP>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CompileTimeMetadata<LinkedType<Q, L>>[\"objectSet\"]; // ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n readonly fetchOne: Q extends ObjectTypeDefinition ? <\n const L extends PropertyKeys<Q, RDPs>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n : never;\n\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetSubscription.Listener<Q, P>,\n opts?: ObjectSetSubscription.Options<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition,\n> extends\n MinimalObjectSet<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<MERGED>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedProperty } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n DerivedObjectOrInterfaceDefinition,\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type { ExtractOptions, Osdk } from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {},\n> = D extends Record<string, SimplePropertyDef>\n ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>\n : Q;\n\ntype ExtractRdp<\n D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>,\n> = D extends Record<string, SimplePropertyDef> ? D : {};\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\n// TODO MOVE THIS\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n readonly fetchPage: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >;\n\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n readonly fetchPageWithErrors: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n readonly asyncIter: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S>,\n ) => AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >;\n}\n\ninterface InterfaceObjectSet<\n Q extends InterfaceDefinition,\n> extends MinimalObjectSet<Q> {\n}\n\ninterface WithProperties<\n Q extends ObjectOrInterfaceDefinition = any,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly withProperties: <\n NEW extends Record<string, SimplePropertyDef>,\n >(\n clause: { [K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> =\n ObjectSet<Q, any>,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, UNUSED_OR_RDP>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CompileTimeMetadata<LinkedType<Q, L>>[\"objectSet\"]; // ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n readonly fetchOne: Q extends ObjectTypeDefinition ? <\n const L extends PropertyKeys<Q, RDPs>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n : never;\n\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetSubscription.Listener<Q, P>,\n opts?: ObjectSetSubscription.Options<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition,\n> extends\n MinimalObjectSet<Q, D>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<MERGED>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { describe, expectTypeOf, test, vi } from "vitest";
|
|
17
|
+
import { describe, expectTypeOf, it, test, vi } from "vitest";
|
|
18
18
|
const Employee = {
|
|
19
19
|
type: "object",
|
|
20
20
|
apiName: "Employee"
|
|
@@ -24,6 +24,9 @@ describe("ObjectSet", () => {
|
|
|
24
24
|
where: vi.fn(() => {
|
|
25
25
|
return fauxObjectSet;
|
|
26
26
|
}),
|
|
27
|
+
withProperties: vi.fn(() => {
|
|
28
|
+
return fauxObjectSet;
|
|
29
|
+
}),
|
|
27
30
|
fetchPage: vi.fn(() => Promise.resolve()),
|
|
28
31
|
asyncIter: vi.fn(() => {
|
|
29
32
|
return {};
|
|
@@ -41,5 +44,112 @@ describe("ObjectSet", () => {
|
|
|
41
44
|
expectTypeOf().toEqualTypeOf();
|
|
42
45
|
});
|
|
43
46
|
});
|
|
47
|
+
describe(".withProperties", () => {
|
|
48
|
+
test("single property", async () => {
|
|
49
|
+
const withA = fauxObjectSet.withProperties({
|
|
50
|
+
"a": base => {
|
|
51
|
+
return base.pivotTo("lead").aggregate("class:exactDistinct");
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
expectTypeOf(withA).toEqualTypeOf();
|
|
55
|
+
await withA.fetchPage();
|
|
56
|
+
expectTypeOf().toEqualTypeOf();
|
|
57
|
+
expectTypeOf().toEqualTypeOf();
|
|
58
|
+
});
|
|
59
|
+
test("multiple properties", async () => {
|
|
60
|
+
const withFamily = fauxObjectSet.withProperties({
|
|
61
|
+
"mom": base => base.pivotTo("lead").aggregate("$count"),
|
|
62
|
+
"dad": base => base.pivotTo("lead").selectProperty("fullName"),
|
|
63
|
+
"sister": base => base.pivotTo("lead").aggregate("class:collectList")
|
|
64
|
+
});
|
|
65
|
+
expectTypeOf(withFamily).toEqualTypeOf();
|
|
66
|
+
await withFamily.fetchPage();
|
|
67
|
+
expectTypeOf().toEqualTypeOf();
|
|
68
|
+
expectTypeOf().toEqualTypeOf();
|
|
69
|
+
expectTypeOf().toEqualTypeOf();
|
|
70
|
+
expectTypeOf().toEqualTypeOf();
|
|
71
|
+
});
|
|
72
|
+
describe("called in succession", () => {
|
|
73
|
+
test("independently", () => {
|
|
74
|
+
const withMom = fauxObjectSet.withProperties({
|
|
75
|
+
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
76
|
+
});
|
|
77
|
+
const withParents = withMom.withProperties({
|
|
78
|
+
"dad": base => base.pivotTo("lead").selectProperty("fullName")
|
|
79
|
+
});
|
|
80
|
+
expectTypeOf(withParents).toEqualTypeOf();
|
|
81
|
+
});
|
|
82
|
+
test.todo("with calculated properties");
|
|
83
|
+
});
|
|
84
|
+
describe("fetch functions return correct Osdk.Instance", () => {
|
|
85
|
+
const withFamily = fauxObjectSet.withProperties({
|
|
86
|
+
"mom": base => base.pivotTo("lead").aggregate("$count"),
|
|
87
|
+
"dad": base => base.pivotTo("lead").selectProperty("fullName"),
|
|
88
|
+
"sister": base => base.pivotTo("lead").aggregate("class:collectList")
|
|
89
|
+
});
|
|
90
|
+
it("works with .where", async () => {
|
|
91
|
+
const where = withFamily.where({
|
|
92
|
+
"mom": 1
|
|
93
|
+
});
|
|
94
|
+
await where.fetchPage();
|
|
95
|
+
expectTypeOf().toEqualTypeOf();
|
|
96
|
+
expectTypeOf().toEqualTypeOf();
|
|
97
|
+
});
|
|
98
|
+
it("works with .async", () => {
|
|
99
|
+
withFamily.asyncIter();
|
|
100
|
+
expectTypeOf().toEqualTypeOf();
|
|
101
|
+
});
|
|
102
|
+
it("Works with no select", async () => {
|
|
103
|
+
await withFamily.fetchPage();
|
|
104
|
+
expectTypeOf().toEqualTypeOf();
|
|
105
|
+
});
|
|
106
|
+
it("Works with selecting all RDPs", async () => {
|
|
107
|
+
await withFamily.fetchPage({
|
|
108
|
+
$select: ["mom", "dad", "sister"]
|
|
109
|
+
});
|
|
110
|
+
expectTypeOf().toEqualTypeOf();
|
|
111
|
+
expectTypeOf().toEqualTypeOf();
|
|
112
|
+
});
|
|
113
|
+
it("Works with selecting some RDPs", async () => {
|
|
114
|
+
await withFamily.fetchPage({
|
|
115
|
+
$select: ["mom"]
|
|
116
|
+
});
|
|
117
|
+
expectTypeOf().toEqualTypeOf();
|
|
118
|
+
});
|
|
119
|
+
it("Works with selecting all non-RDP's", async () => {
|
|
120
|
+
await withFamily.fetchPage({
|
|
121
|
+
$select: ["class", "fullName"]
|
|
122
|
+
});
|
|
123
|
+
expectTypeOf().toEqualTypeOf();
|
|
124
|
+
expectTypeOf().toEqualTypeOf();
|
|
125
|
+
});
|
|
126
|
+
it("Works with selecting some non-RDP's", async () => {
|
|
127
|
+
await withFamily.fetchPage({
|
|
128
|
+
$select: ["class"]
|
|
129
|
+
});
|
|
130
|
+
expectTypeOf().toEqualTypeOf();
|
|
131
|
+
});
|
|
132
|
+
it("Works with selecting a mix", async () => {
|
|
133
|
+
await withFamily.fetchPage({
|
|
134
|
+
$select: ["class", "mom"]
|
|
135
|
+
});
|
|
136
|
+
expectTypeOf().toEqualTypeOf();
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
it("allows extracting the type", () => {
|
|
140
|
+
fauxObjectSet.withProperties({
|
|
141
|
+
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
142
|
+
});
|
|
143
|
+
expectTypeOf().toEqualTypeOf();
|
|
144
|
+
fauxObjectSet.withProperties({
|
|
145
|
+
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
it("Defining the Type", () => {
|
|
149
|
+
fauxObjectSet.withProperties({
|
|
150
|
+
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
});
|
|
44
154
|
});
|
|
45
155
|
//# sourceMappingURL=ObjectSet.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","test","vi","Employee","type","apiName","fauxObjectSet","where","fn","fetchPage","Promise","resolve","asyncIter","toEqualTypeOf"],"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, test, vi } from \"vitest\";\n\nimport type {\n ObjectMetadata as $ObjectMetadata,\n ObjectSet as $ObjectSet,\n ObjectTypeDefinition as $ObjectTypeDefinition,\n Osdk,\n PropertyDef as $PropertyDef,\n PropertyValueWireToClient as $PropType,\n SingleLinkAccessor as $SingleLinkAccessor,\n} from \"../index.js\";\n\nnamespace Employee {\n export type PropertyKeys =\n | \"fullName\"\n | \"class\";\n\n export interface Links {\n readonly lead: $SingleLinkAccessor<Employee>;\n readonly peeps: Employee.ObjectSet;\n }\n\n export interface Props {\n readonly class: $PropType[\"string\"] | undefined;\n readonly fullName: $PropType[\"string\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Employee, Employee.ObjectSet> {}\n}\n\ninterface Employee extends $ObjectTypeDefinition {\n type: \"object\";\n apiName: \"Employee\";\n __DefinitionMetadata?: {\n objectSet: Employee.ObjectSet;\n props: Employee.Props;\n linksType: Employee.Links;\n strictProps: Employee.StrictProps;\n apiName: \"Employee\";\n description: \"A full-time or part-time \\n\\n employee of our firm\";\n displayName: \"Employee\";\n icon: {\n type: \"blueprint\";\n color: \"blue\";\n name: \"person\";\n };\n implements: [\"FooInterface\"];\n interfaceMap: {\n FooInterface: {\n fooSpt: \"fullName\";\n };\n };\n inverseInterfaceMap: {\n FooInterface: {\n fullName: \"fooSpt\";\n };\n };\n links: {\n lead: $ObjectMetadata.Link<Employee, false>;\n peeps: $ObjectMetadata.Link<Employee, true>;\n };\n pluralDisplayName: \"Employees\";\n primaryKeyApiName: \"employeeId\";\n primaryKeyType: \"integer\";\n properties: {\n class: $PropertyDef<\"string\", \"nullable\", \"single\">;\n fullName: $PropertyDef<\"string\", \"nullable\", \"single\">;\n };\n rid: \"ri.ontology.main.object-type.401ac022-89eb-4591-8b7e-0a912b9efb44\";\n status: \"ACTIVE\";\n titleProperty: \"fullName\";\n type: \"object\";\n visibility: \"NORMAL\";\n };\n}\n\nconst Employee: Employee = {\n type: \"object\",\n apiName: \"Employee\",\n};\n\ndescribe(\"ObjectSet\", () => {\n const fauxObjectSet = {\n where: vi.fn(() => {\n return fauxObjectSet;\n }),\n fetchPage: vi.fn(() => Promise.resolve()),\n asyncIter: vi.fn(() => {\n return {};\n }),\n } as any as Employee.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<Employee, 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<Employee, never, \"fullName\">\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,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AA6EzD,MAAMC,QAAkB,GAAG;EACzBC,IAAI,EAAE,QAAQ;EACdC,OAAO,EAAE;AACX,CAAC;AAEDN,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1B,MAAMO,aAAa,GAAG;IACpBC,KAAK,EAAEL,EAAE,CAACM,EAAE,CAAC,MAAM;MACjB,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFG,SAAS,EAAEP,EAAE,CAACM,EAAE,CAAC,MAAME,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;IACzCC,SAAS,EAAEV,EAAE,CAACM,EAAE,CAAC,MAAM;MACrB,OAAO,CAAC,CAAC;IACX,CAAC;EACH,CAA8B;EAE9BT,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACvBE,IAAI,CAAC,aAAa,EAAE,YAAY;MACf,MAAMK,aAAa,CAACG,SAAS,CAAC,CAAC;MAC9CT,YAAY,CAAwB,CAAC,CAACa,aAAa,CAEjD,CAAC;IACL,CAAC,CAAC;IAEFZ,IAAI,CAAC,YAAY,EAAE,YAAY;MACd,MAAMK,aAAa,CAACG,SAAS,CAAC;QAAE,SAAS,EAAE,CAAC,UAAU;MAAE,CAAC,CAAC;MACzET,YAAY,CAAwB,CAAC,CAACa,aAAa,CAEjD,CAAC;IACL,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","it","test","vi","Employee","type","apiName","fauxObjectSet","where","fn","withProperties","fetchPage","Promise","resolve","asyncIter","toEqualTypeOf","withA","base","pivotTo","aggregate","withFamily","selectProperty","withMom","withParents","todo","$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 {\n ObjectMetadata as $ObjectMetadata,\n ObjectSet as $ObjectSet,\n ObjectTypeDefinition as $ObjectTypeDefinition,\n Osdk,\n PropertyDef as $PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient as $PropType,\n SingleLinkAccessor as $SingleLinkAccessor,\n} from \"../index.js\";\n\nnamespace Employee {\n export type PropertyKeys =\n | \"fullName\"\n | \"class\";\n\n export interface Links {\n readonly lead: $SingleLinkAccessor<Employee>;\n readonly peeps: Employee.ObjectSet;\n }\n\n export interface Props {\n readonly class: $PropType[\"string\"] | undefined;\n readonly fullName: $PropType[\"string\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Employee, Employee.ObjectSet> {}\n}\n\ninterface Employee extends $ObjectTypeDefinition {\n type: \"object\";\n apiName: \"Employee\";\n __DefinitionMetadata?: {\n objectSet: Employee.ObjectSet;\n props: Employee.Props;\n linksType: Employee.Links;\n strictProps: Employee.StrictProps;\n apiName: \"Employee\";\n description: \"A full-time or part-time \\n\\n employee of our firm\";\n displayName: \"Employee\";\n icon: {\n type: \"blueprint\";\n color: \"blue\";\n name: \"person\";\n };\n implements: [\"FooInterface\"];\n interfaceMap: {\n FooInterface: {\n fooSpt: \"fullName\";\n };\n };\n inverseInterfaceMap: {\n FooInterface: {\n fullName: \"fooSpt\";\n };\n };\n links: {\n lead: $ObjectMetadata.Link<Employee, false>;\n peeps: $ObjectMetadata.Link<Employee, true>;\n };\n pluralDisplayName: \"Employees\";\n primaryKeyApiName: \"employeeId\";\n primaryKeyType: \"integer\";\n properties: {\n class: $PropertyDef<\"string\", \"nullable\", \"single\">;\n fullName: $PropertyDef<\"string\", \"nullable\", \"single\">;\n };\n rid: \"ri.ontology.main.object-type.401ac022-89eb-4591-8b7e-0a912b9efb44\";\n status: \"ACTIVE\";\n titleProperty: \"fullName\";\n type: \"object\";\n visibility: \"NORMAL\";\n };\n}\n\nconst Employee: Employee = {\n type: \"object\",\n apiName: \"Employee\",\n};\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 } as any as Employee.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<Employee, 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<Employee, 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<Employee, {\n a: \"integer\" | undefined;\n }>\n >();\n\n const withAResults = await withA.fetchPage();\n\n expectTypeOf<typeof withAResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<Employee, never, PropertyKeys<Employee>, {\n a: \"integer\" | undefined;\n }>\n >();\n\n expectTypeOf<typeof withAResults[\"data\"][0][\"a\"]>()\n .toEqualTypeOf<number | undefined>();\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<Employee, {\n mom: \"integer\" | undefined;\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<Employee, never, PropertyKeys<Employee>, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number | undefined>();\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<Employee, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n }>\n >();\n });\n\n test.todo(\"with calculated properties\");\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<Employee, never, PropertyKeys<Employee>, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n });\n\n it(\"works with .async\", () => {\n const asyncIter = withFamily.asyncIter();\n expectTypeOf<typeof asyncIter>().toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<Employee, never, PropertyKeys<Employee>, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\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<Employee, never, PropertyKeys<Employee>, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\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<Employee, never, never, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number | undefined>();\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<Employee, never, never, {\n mom: \"integer\" | undefined;\n }>\n >();\n });\n\n it(\"Works with selecting all non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\", \"fullName\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<Employee, never, PropertyKeys<Employee>, {}>\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<Employee, 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 Employee,\n never,\n \"class\",\n { mom: \"integer\" | undefined }\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<Employee, {\n mom: \"integer\" | undefined;\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 Employee,\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});\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;AA8E7D,MAAMC,QAAkB,GAAG;EACzBC,IAAI,EAAE,QAAQ;EACdC,OAAO,EAAE;AACX,CAAC;AAEDP,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1B,MAAMQ,aAAa,GAAG;IACpBC,KAAK,EAAEL,EAAE,CAACM,EAAE,CAAC,MAAM;MACjB,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFG,cAAc,EAAEP,EAAE,CAACM,EAAE,CAAC,MAAM;MAC1B,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFI,SAAS,EAAER,EAAE,CAACM,EAAE,CAAC,MAAMG,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;IACzCC,SAAS,EAAEX,EAAE,CAACM,EAAE,CAAC,MAAM;MACrB,OAAO,CAAC,CAAC;IACX,CAAC;EACH,CAA8B;EAE9BV,QAAQ,CAA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AAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -57,9 +57,9 @@ interface MediaMetadata {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
type CollectWithPropAggregations = "collectSet" | "collectList";
|
|
60
|
-
type BaseWithPropAggregations = "approximateDistinct" | "exactDistinct"
|
|
60
|
+
type BaseWithPropAggregations = "approximateDistinct" | "exactDistinct";
|
|
61
61
|
type StringWithPropAggregateOption = BaseWithPropAggregations | CollectWithPropAggregations;
|
|
62
|
-
type NumericWithPropAggregateOption = "min" | "max" | "sum" | "avg" | BaseWithPropAggregations | CollectWithPropAggregations;
|
|
62
|
+
type NumericWithPropAggregateOption = "min" | "max" | "sum" | "avg" | "approximatePercentile" | BaseWithPropAggregations | CollectWithPropAggregations;
|
|
63
63
|
|
|
64
64
|
type TimeSeriesQuery = {
|
|
65
65
|
$before: number;
|
|
@@ -897,6 +897,39 @@ type WhereClause<T extends ObjectOrInterfaceDefinition> = OrWhereClause<T> | And
|
|
|
897
897
|
type LinkNames<Q extends ObjectOrInterfaceDefinition> = keyof CompileTimeMetadata<Q>["links"] & string;
|
|
898
898
|
type LinkedType<Q extends ObjectOrInterfaceDefinition, L extends LinkNames<Q>> = NonNullable<CompileTimeMetadata<Q>["links"][L]["__OsdkLinkTargetType"]>;
|
|
899
899
|
|
|
900
|
+
declare namespace DerivedProperty {
|
|
901
|
+
type SelectorResult<T extends SimplePropertyDef> = {
|
|
902
|
+
type: T;
|
|
903
|
+
};
|
|
904
|
+
type Clause<Q extends ObjectOrInterfaceDefinition> = {
|
|
905
|
+
[key: string]: Selector<Q, SimplePropertyDef>;
|
|
906
|
+
};
|
|
907
|
+
type Selector<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = (baseObjectSet: DerivedProperty.Builder<Q, false>) => SelectorResult<T>;
|
|
908
|
+
interface Builder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {
|
|
909
|
+
}
|
|
910
|
+
interface AggregateBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends Builder<Q, CONSTRAINED>, Aggregatable<Q> {
|
|
911
|
+
}
|
|
912
|
+
interface SelectPropertyBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
type BuilderTypeFromConstraint<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true> : DerivedProperty.SelectPropertyBuilder<Q, false>;
|
|
916
|
+
type Filterable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
|
|
917
|
+
readonly where: (clause: WhereClause<Q>) => BuilderTypeFromConstraint<Q, CONSTRAINED>;
|
|
918
|
+
};
|
|
919
|
+
type Pivotable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
|
|
920
|
+
readonly pivotTo: <L extends LinkNames<Q>>(type: L) => CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : NonNullable<CompileTimeMetadata<Q>["links"][L]["multiplicity"]> extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : DerivedProperty.SelectPropertyBuilder<LinkedType<Q, L>, false>;
|
|
921
|
+
};
|
|
922
|
+
type Aggregatable<Q extends ObjectOrInterfaceDefinition> = {
|
|
923
|
+
readonly aggregate: <V extends ValidAggregationKeys<Q, "withPropertiesAggregate">>(aggregationSpecifier: V, opts?: V extends `${any}:${infer P}` ? P extends CollectWithPropAggregations ? {
|
|
924
|
+
limit: number;
|
|
925
|
+
} : P extends "approximatePercentile" ? {
|
|
926
|
+
percentile: number;
|
|
927
|
+
} : 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" | undefined : "double" | undefined : V extends "$count" ? "integer" | undefined : never>;
|
|
928
|
+
};
|
|
929
|
+
type Selectable<Q extends ObjectOrInterfaceDefinition> = {
|
|
930
|
+
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"]>>;
|
|
931
|
+
};
|
|
932
|
+
|
|
900
933
|
interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
|
|
901
934
|
readonly $objectSetInternals: {
|
|
902
935
|
def: Q;
|
|
@@ -1005,6 +1038,13 @@ interface AsyncIter<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
|
|
|
1005
1038
|
[K in Extract<keyof RDPs, L>]: RDPs[K];
|
|
1006
1039
|
}>>;
|
|
1007
1040
|
}
|
|
1041
|
+
interface WithProperties<Q extends ObjectOrInterfaceDefinition = any, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1042
|
+
readonly withProperties: <NEW extends Record<string, SimplePropertyDef>>(clause: {
|
|
1043
|
+
[K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]>;
|
|
1044
|
+
}) => ObjectSet<Q, {
|
|
1045
|
+
[NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN] : NN extends keyof RDPs ? RDPs[NN] : never;
|
|
1046
|
+
}>;
|
|
1047
|
+
}
|
|
1008
1048
|
interface ObjectSet<Q extends ObjectOrInterfaceDefinition = any, UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> = ObjectSet<Q, any>> extends ObjectSetCleanedTypes<Q, ExtractRdp<UNUSED_OR_RDP>, MergeObjectSet<Q, UNUSED_OR_RDP>> {
|
|
1009
1049
|
}
|
|
1010
1050
|
interface Aggregate<Q extends ObjectOrInterfaceDefinition> {
|
|
@@ -1098,7 +1138,7 @@ interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1098
1138
|
unsubscribe: () => void;
|
|
1099
1139
|
};
|
|
1100
1140
|
}
|
|
1101
|
-
interface ObjectSetCleanedTypes<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef>, MERGED extends ObjectOrInterfaceDefinition> extends MinimalObjectSet<Q, D>, Aggregate<MERGED>, SetArithmetic<MERGED>, PivotTo<MERGED>, FetchOne<Q, D>, Subscribe<MERGED> {
|
|
1141
|
+
interface ObjectSetCleanedTypes<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef>, MERGED extends ObjectOrInterfaceDefinition> extends MinimalObjectSet<Q, D>, WithProperties<Q, D>, Aggregate<MERGED>, SetArithmetic<MERGED>, PivotTo<MERGED>, FetchOne<Q, D>, Subscribe<MERGED> {
|
|
1102
1142
|
}
|
|
1103
1143
|
|
|
1104
|
-
export { type
|
|
1144
|
+
export { type PropertyDef as $, type Attachment as A, type SelectArgToKeys as B, type FetchPageResult as C, DistanceUnitMapping as D, type SingleOsdkResult as E, type FetchPageArgs as F, type GeoFilterOptions as G, type Media as H, type InterfaceDefinition as I, type MediaMetadata as J, isOk as K, type Result as L, type MediaReference as M, NullabilityAdherence as N, type ObjectTypeDefinition as O, type PropertyValueWireToClient as P, type BaseObjectSet as Q, type ReleaseStatus as R, type SingleLinkAccessor as S, ObjectSetSubscription as T, type InterfaceMetadata as U, type ValidAggregationKeys as V, type WhereClause as W, type ObjectOrInterfaceDefinition as X, type PropertyKeys as Y, type CompileTimeMetadata as Z, ObjectMetadata as _, type AttachmentUpload as a, type VersionBound as a0, type BaseWirePropertyTypes as a1, type WirePropertyTypes as a2, type PrimaryKeyType as a3, type ConvertProps as a4, Osdk as a5, type PageResult as a6, TimeseriesDurationMapping as a7, type GeotimeSeriesProperty as a8, type TimeSeriesPoint as a9, type TimeSeriesProperty as aa, type TimeSeriesQuery as ab, type LinkedType as ac, type LinkNames as ad, type ExtractOptions as ae, type MinimalObjectSet as af, type OsdkBase as b, type OsdkObjectPrimaryKeyType as c, type ObjectSet as d, type OsdkMetadata as e, type PrimaryKeyTypes as f, type AggregateOpts as g, type AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy as h, type AggregationResultsWithGroups as i, type AggregationResultsWithoutGroups as j, type AggregationClause as k, type AggregationsResults as l, type GeoFilter_Intersects as m, type GeoFilter_Within as n, type PossibleWhereClauseFilters as o, type OsdkObjectPropertyType as p, type OsdkObjectLinksObject as q, DerivedProperty as r, DurationMapping as s, type AllGroupByValues as t, type GroupByClause as u, type GroupByRange as v, type AsyncIterArgs as w, type Augment as x, type Augments as y, type SelectArg as z };
|
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 './ObjectSet-
|
|
2
|
-
export { g as AggregateOpts, h as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, k as AggregationClause, i as AggregationResultsWithGroups, j as AggregationResultsWithoutGroups, l as AggregationsResults,
|
|
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 './ObjectSet-C2x3lIr7.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, a1 as BaseWirePropertyTypes, Z as CompileTimeMetadata, a4 as ConvertProps, r as DerivedProperty, D as DistanceUnitMapping, s as DurationMapping, F as FetchPageArgs, C as FetchPageResult, G as GeoFilterOptions, m as GeoFilter_Intersects, n as GeoFilter_Within, a8 as GeotimeSeriesProperty, u as GroupByClause, v as GroupByRange, U as InterfaceMetadata, ad as LinkNames, ac as LinkedType, H as Media, J as MediaMetadata, N as NullabilityAdherence, _ as ObjectMetadata, X as ObjectOrInterfaceDefinition, T as ObjectSetSubscription, a5 as Osdk, q as OsdkObjectLinksObject, p as OsdkObjectPropertyType, a6 as PageResult, o as PossibleWhereClauseFilters, a3 as PrimaryKeyType, $ as PropertyDef, Y as PropertyKeys, L as Result, z as SelectArg, B as SelectArgToKeys, S as SingleLinkAccessor, E as SingleOsdkResult, a9 as TimeSeriesPoint, aa as TimeSeriesProperty, ab as TimeSeriesQuery, a7 as TimeseriesDurationMapping, V as ValidAggregationKeys, a0 as VersionBound, W as WhereClause, a2 as WirePropertyTypes, K as isOk } from './ObjectSet-C2x3lIr7.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MediaReference, O as ObjectTypeDefinition,
|
|
2
|
-
export {
|
|
1
|
+
import { M as MediaReference, O as ObjectTypeDefinition, Y as PropertyKeys, N as NullabilityAdherence, z as SelectArg, a5 as Osdk, ae as ExtractOptions, b as OsdkBase, X as ObjectOrInterfaceDefinition } from '../ObjectSet-C2x3lIr7.cjs';
|
|
2
|
+
export { af as MinimalObjectSet } from '../ObjectSet-C2x3lIr7.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export let DerivedProperty;
|
|
17
|
+
//# sourceMappingURL=DerivedProperty.js.map
|
|
@@ -0,0 +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 { CollectWithPropAggregations } 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 \"approximateDistinct\" | \"exactDistinct\" | \"$count\"\n ? \"integer\" | undefined\n : \"double\" | undefined\n : V extends \"$count\" ? \"integer\" | undefined\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,WA2BiBA,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 CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | \"approximateDistinct\"\n | \"exactDistinct\"
|
|
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 CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\nexport type StringWithPropAggregateOption =\n | BaseWithPropAggregations\n | CollectWithPropAggregations;\n\nexport type NumericWithPropAggregateOption =\n | \"min\"\n | \"max\"\n | \"sum\"\n | \"avg\"\n | \"approximatePercentile\"\n | BaseWithPropAggregations\n | CollectWithPropAggregations;\n"],"mappings":"","ignoreList":[]}
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type { Media, MediaMetadata, MediaReference } from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type { OsdkBase, PrimaryKeyType } from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\n\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,mBAAmB,QAAQ,4BAA4B;
|
|
1
|
+
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport type { DerivedProperty } from \"./derivedProperties/DerivedProperty.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type { Media, MediaMetadata, MediaReference } from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type { OsdkBase, PrimaryKeyType } from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\n\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,mBAAmB,QAAQ,4BAA4B;AAahE,SAASC,eAAe,QAAQ,4BAA4B;AA8B5D,SAASC,IAAI,QAAQ,oBAAoB;AA6CzC,SAASC,yBAAyB,QAAQ,4BAA4B;AAStE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n DerivedObjectOrInterfaceDefinition,\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type { ExtractOptions, Osdk } from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {},\n> = D extends Record<string, SimplePropertyDef>\n ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>\n : Q;\n\ntype ExtractRdp<\n D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>,\n> = D extends Record<string, SimplePropertyDef> ? D : {};\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\n// TODO MOVE THIS\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n readonly fetchPage: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >;\n\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n readonly fetchPageWithErrors: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n readonly asyncIter: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S>,\n ) => AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >;\n}\n\ninterface InterfaceObjectSet<\n Q extends InterfaceDefinition,\n> extends MinimalObjectSet<Q> {\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> =\n ObjectSet<Q, any>,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, UNUSED_OR_RDP>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CompileTimeMetadata<LinkedType<Q, L>>[\"objectSet\"]; // ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n readonly fetchOne: Q extends ObjectTypeDefinition ? <\n const L extends PropertyKeys<Q, RDPs>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n : never;\n\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetSubscription.Listener<Q, P>,\n opts?: ObjectSetSubscription.Options<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition,\n> extends\n MinimalObjectSet<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<MERGED>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedProperty } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n DerivedObjectOrInterfaceDefinition,\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type { ExtractOptions, Osdk } from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {},\n> = D extends Record<string, SimplePropertyDef>\n ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>\n : Q;\n\ntype ExtractRdp<\n D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>,\n> = D extends Record<string, SimplePropertyDef> ? D : {};\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\n// TODO MOVE THIS\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n readonly fetchPage: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >;\n\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n readonly fetchPageWithErrors: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n readonly asyncIter: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S>,\n ) => AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >;\n}\n\ninterface InterfaceObjectSet<\n Q extends InterfaceDefinition,\n> extends MinimalObjectSet<Q> {\n}\n\ninterface WithProperties<\n Q extends ObjectOrInterfaceDefinition = any,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly withProperties: <\n NEW extends Record<string, SimplePropertyDef>,\n >(\n clause: { [K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> =\n ObjectSet<Q, any>,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, UNUSED_OR_RDP>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CompileTimeMetadata<LinkedType<Q, L>>[\"objectSet\"]; // ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n readonly fetchOne: Q extends ObjectTypeDefinition ? <\n const L extends PropertyKeys<Q, RDPs>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n : never;\n\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetSubscription.Listener<Q, P>,\n opts?: ObjectSetSubscription.Options<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition,\n> extends\n MinimalObjectSet<Q, D>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<MERGED>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { describe, expectTypeOf, test, vi } from "vitest";
|
|
17
|
+
import { describe, expectTypeOf, it, test, vi } from "vitest";
|
|
18
18
|
const Employee = {
|
|
19
19
|
type: "object",
|
|
20
20
|
apiName: "Employee"
|
|
@@ -24,6 +24,9 @@ describe("ObjectSet", () => {
|
|
|
24
24
|
where: vi.fn(() => {
|
|
25
25
|
return fauxObjectSet;
|
|
26
26
|
}),
|
|
27
|
+
withProperties: vi.fn(() => {
|
|
28
|
+
return fauxObjectSet;
|
|
29
|
+
}),
|
|
27
30
|
fetchPage: vi.fn(() => Promise.resolve()),
|
|
28
31
|
asyncIter: vi.fn(() => {
|
|
29
32
|
return {};
|
|
@@ -41,5 +44,112 @@ describe("ObjectSet", () => {
|
|
|
41
44
|
expectTypeOf().toEqualTypeOf();
|
|
42
45
|
});
|
|
43
46
|
});
|
|
47
|
+
describe(".withProperties", () => {
|
|
48
|
+
test("single property", async () => {
|
|
49
|
+
const withA = fauxObjectSet.withProperties({
|
|
50
|
+
"a": base => {
|
|
51
|
+
return base.pivotTo("lead").aggregate("class:exactDistinct");
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
expectTypeOf(withA).toEqualTypeOf();
|
|
55
|
+
await withA.fetchPage();
|
|
56
|
+
expectTypeOf().toEqualTypeOf();
|
|
57
|
+
expectTypeOf().toEqualTypeOf();
|
|
58
|
+
});
|
|
59
|
+
test("multiple properties", async () => {
|
|
60
|
+
const withFamily = fauxObjectSet.withProperties({
|
|
61
|
+
"mom": base => base.pivotTo("lead").aggregate("$count"),
|
|
62
|
+
"dad": base => base.pivotTo("lead").selectProperty("fullName"),
|
|
63
|
+
"sister": base => base.pivotTo("lead").aggregate("class:collectList")
|
|
64
|
+
});
|
|
65
|
+
expectTypeOf(withFamily).toEqualTypeOf();
|
|
66
|
+
await withFamily.fetchPage();
|
|
67
|
+
expectTypeOf().toEqualTypeOf();
|
|
68
|
+
expectTypeOf().toEqualTypeOf();
|
|
69
|
+
expectTypeOf().toEqualTypeOf();
|
|
70
|
+
expectTypeOf().toEqualTypeOf();
|
|
71
|
+
});
|
|
72
|
+
describe("called in succession", () => {
|
|
73
|
+
test("independently", () => {
|
|
74
|
+
const withMom = fauxObjectSet.withProperties({
|
|
75
|
+
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
76
|
+
});
|
|
77
|
+
const withParents = withMom.withProperties({
|
|
78
|
+
"dad": base => base.pivotTo("lead").selectProperty("fullName")
|
|
79
|
+
});
|
|
80
|
+
expectTypeOf(withParents).toEqualTypeOf();
|
|
81
|
+
});
|
|
82
|
+
test.todo("with calculated properties");
|
|
83
|
+
});
|
|
84
|
+
describe("fetch functions return correct Osdk.Instance", () => {
|
|
85
|
+
const withFamily = fauxObjectSet.withProperties({
|
|
86
|
+
"mom": base => base.pivotTo("lead").aggregate("$count"),
|
|
87
|
+
"dad": base => base.pivotTo("lead").selectProperty("fullName"),
|
|
88
|
+
"sister": base => base.pivotTo("lead").aggregate("class:collectList")
|
|
89
|
+
});
|
|
90
|
+
it("works with .where", async () => {
|
|
91
|
+
const where = withFamily.where({
|
|
92
|
+
"mom": 1
|
|
93
|
+
});
|
|
94
|
+
await where.fetchPage();
|
|
95
|
+
expectTypeOf().toEqualTypeOf();
|
|
96
|
+
expectTypeOf().toEqualTypeOf();
|
|
97
|
+
});
|
|
98
|
+
it("works with .async", () => {
|
|
99
|
+
withFamily.asyncIter();
|
|
100
|
+
expectTypeOf().toEqualTypeOf();
|
|
101
|
+
});
|
|
102
|
+
it("Works with no select", async () => {
|
|
103
|
+
await withFamily.fetchPage();
|
|
104
|
+
expectTypeOf().toEqualTypeOf();
|
|
105
|
+
});
|
|
106
|
+
it("Works with selecting all RDPs", async () => {
|
|
107
|
+
await withFamily.fetchPage({
|
|
108
|
+
$select: ["mom", "dad", "sister"]
|
|
109
|
+
});
|
|
110
|
+
expectTypeOf().toEqualTypeOf();
|
|
111
|
+
expectTypeOf().toEqualTypeOf();
|
|
112
|
+
});
|
|
113
|
+
it("Works with selecting some RDPs", async () => {
|
|
114
|
+
await withFamily.fetchPage({
|
|
115
|
+
$select: ["mom"]
|
|
116
|
+
});
|
|
117
|
+
expectTypeOf().toEqualTypeOf();
|
|
118
|
+
});
|
|
119
|
+
it("Works with selecting all non-RDP's", async () => {
|
|
120
|
+
await withFamily.fetchPage({
|
|
121
|
+
$select: ["class", "fullName"]
|
|
122
|
+
});
|
|
123
|
+
expectTypeOf().toEqualTypeOf();
|
|
124
|
+
expectTypeOf().toEqualTypeOf();
|
|
125
|
+
});
|
|
126
|
+
it("Works with selecting some non-RDP's", async () => {
|
|
127
|
+
await withFamily.fetchPage({
|
|
128
|
+
$select: ["class"]
|
|
129
|
+
});
|
|
130
|
+
expectTypeOf().toEqualTypeOf();
|
|
131
|
+
});
|
|
132
|
+
it("Works with selecting a mix", async () => {
|
|
133
|
+
await withFamily.fetchPage({
|
|
134
|
+
$select: ["class", "mom"]
|
|
135
|
+
});
|
|
136
|
+
expectTypeOf().toEqualTypeOf();
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
it("allows extracting the type", () => {
|
|
140
|
+
fauxObjectSet.withProperties({
|
|
141
|
+
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
142
|
+
});
|
|
143
|
+
expectTypeOf().toEqualTypeOf();
|
|
144
|
+
fauxObjectSet.withProperties({
|
|
145
|
+
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
it("Defining the Type", () => {
|
|
149
|
+
fauxObjectSet.withProperties({
|
|
150
|
+
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
});
|
|
44
154
|
});
|
|
45
155
|
//# sourceMappingURL=ObjectSet.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","test","vi","Employee","type","apiName","fauxObjectSet","where","fn","fetchPage","Promise","resolve","asyncIter","toEqualTypeOf"],"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, test, vi } from \"vitest\";\n\nimport type {\n ObjectMetadata as $ObjectMetadata,\n ObjectSet as $ObjectSet,\n ObjectTypeDefinition as $ObjectTypeDefinition,\n Osdk,\n PropertyDef as $PropertyDef,\n PropertyValueWireToClient as $PropType,\n SingleLinkAccessor as $SingleLinkAccessor,\n} from \"../index.js\";\n\nnamespace Employee {\n export type PropertyKeys =\n | \"fullName\"\n | \"class\";\n\n export interface Links {\n readonly lead: $SingleLinkAccessor<Employee>;\n readonly peeps: Employee.ObjectSet;\n }\n\n export interface Props {\n readonly class: $PropType[\"string\"] | undefined;\n readonly fullName: $PropType[\"string\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Employee, Employee.ObjectSet> {}\n}\n\ninterface Employee extends $ObjectTypeDefinition {\n type: \"object\";\n apiName: \"Employee\";\n __DefinitionMetadata?: {\n objectSet: Employee.ObjectSet;\n props: Employee.Props;\n linksType: Employee.Links;\n strictProps: Employee.StrictProps;\n apiName: \"Employee\";\n description: \"A full-time or part-time \\n\\n employee of our firm\";\n displayName: \"Employee\";\n icon: {\n type: \"blueprint\";\n color: \"blue\";\n name: \"person\";\n };\n implements: [\"FooInterface\"];\n interfaceMap: {\n FooInterface: {\n fooSpt: \"fullName\";\n };\n };\n inverseInterfaceMap: {\n FooInterface: {\n fullName: \"fooSpt\";\n };\n };\n links: {\n lead: $ObjectMetadata.Link<Employee, false>;\n peeps: $ObjectMetadata.Link<Employee, true>;\n };\n pluralDisplayName: \"Employees\";\n primaryKeyApiName: \"employeeId\";\n primaryKeyType: \"integer\";\n properties: {\n class: $PropertyDef<\"string\", \"nullable\", \"single\">;\n fullName: $PropertyDef<\"string\", \"nullable\", \"single\">;\n };\n rid: \"ri.ontology.main.object-type.401ac022-89eb-4591-8b7e-0a912b9efb44\";\n status: \"ACTIVE\";\n titleProperty: \"fullName\";\n type: \"object\";\n visibility: \"NORMAL\";\n };\n}\n\nconst Employee: Employee = {\n type: \"object\",\n apiName: \"Employee\",\n};\n\ndescribe(\"ObjectSet\", () => {\n const fauxObjectSet = {\n where: vi.fn(() => {\n return fauxObjectSet;\n }),\n fetchPage: vi.fn(() => Promise.resolve()),\n asyncIter: vi.fn(() => {\n return {};\n }),\n } as any as Employee.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<Employee, 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<Employee, never, \"fullName\">\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,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AA6EzD,MAAMC,QAAkB,GAAG;EACzBC,IAAI,EAAE,QAAQ;EACdC,OAAO,EAAE;AACX,CAAC;AAEDN,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1B,MAAMO,aAAa,GAAG;IACpBC,KAAK,EAAEL,EAAE,CAACM,EAAE,CAAC,MAAM;MACjB,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFG,SAAS,EAAEP,EAAE,CAACM,EAAE,CAAC,MAAME,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;IACzCC,SAAS,EAAEV,EAAE,CAACM,EAAE,CAAC,MAAM;MACrB,OAAO,CAAC,CAAC;IACX,CAAC;EACH,CAA8B;EAE9BT,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACvBE,IAAI,CAAC,aAAa,EAAE,YAAY;MACf,MAAMK,aAAa,CAACG,SAAS,CAAC,CAAC;MAC9CT,YAAY,CAAwB,CAAC,CAACa,aAAa,CAEjD,CAAC;IACL,CAAC,CAAC;IAEFZ,IAAI,CAAC,YAAY,EAAE,YAAY;MACd,MAAMK,aAAa,CAACG,SAAS,CAAC;QAAE,SAAS,EAAE,CAAC,UAAU;MAAE,CAAC,CAAC;MACzET,YAAY,CAAwB,CAAC,CAACa,aAAa,CAEjD,CAAC;IACL,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSet.test.js","names":["describe","expectTypeOf","it","test","vi","Employee","type","apiName","fauxObjectSet","where","fn","withProperties","fetchPage","Promise","resolve","asyncIter","toEqualTypeOf","withA","base","pivotTo","aggregate","withFamily","selectProperty","withMom","withParents","todo","$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 {\n ObjectMetadata as $ObjectMetadata,\n ObjectSet as $ObjectSet,\n ObjectTypeDefinition as $ObjectTypeDefinition,\n Osdk,\n PropertyDef as $PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient as $PropType,\n SingleLinkAccessor as $SingleLinkAccessor,\n} from \"../index.js\";\n\nnamespace Employee {\n export type PropertyKeys =\n | \"fullName\"\n | \"class\";\n\n export interface Links {\n readonly lead: $SingleLinkAccessor<Employee>;\n readonly peeps: Employee.ObjectSet;\n }\n\n export interface Props {\n readonly class: $PropType[\"string\"] | undefined;\n readonly fullName: $PropType[\"string\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Employee, Employee.ObjectSet> {}\n}\n\ninterface Employee extends $ObjectTypeDefinition {\n type: \"object\";\n apiName: \"Employee\";\n __DefinitionMetadata?: {\n objectSet: Employee.ObjectSet;\n props: Employee.Props;\n linksType: Employee.Links;\n strictProps: Employee.StrictProps;\n apiName: \"Employee\";\n description: \"A full-time or part-time \\n\\n employee of our firm\";\n displayName: \"Employee\";\n icon: {\n type: \"blueprint\";\n color: \"blue\";\n name: \"person\";\n };\n implements: [\"FooInterface\"];\n interfaceMap: {\n FooInterface: {\n fooSpt: \"fullName\";\n };\n };\n inverseInterfaceMap: {\n FooInterface: {\n fullName: \"fooSpt\";\n };\n };\n links: {\n lead: $ObjectMetadata.Link<Employee, false>;\n peeps: $ObjectMetadata.Link<Employee, true>;\n };\n pluralDisplayName: \"Employees\";\n primaryKeyApiName: \"employeeId\";\n primaryKeyType: \"integer\";\n properties: {\n class: $PropertyDef<\"string\", \"nullable\", \"single\">;\n fullName: $PropertyDef<\"string\", \"nullable\", \"single\">;\n };\n rid: \"ri.ontology.main.object-type.401ac022-89eb-4591-8b7e-0a912b9efb44\";\n status: \"ACTIVE\";\n titleProperty: \"fullName\";\n type: \"object\";\n visibility: \"NORMAL\";\n };\n}\n\nconst Employee: Employee = {\n type: \"object\",\n apiName: \"Employee\",\n};\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 } as any as Employee.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<Employee, 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<Employee, 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<Employee, {\n a: \"integer\" | undefined;\n }>\n >();\n\n const withAResults = await withA.fetchPage();\n\n expectTypeOf<typeof withAResults[\"data\"][0]>().toEqualTypeOf<\n Osdk.Instance<Employee, never, PropertyKeys<Employee>, {\n a: \"integer\" | undefined;\n }>\n >();\n\n expectTypeOf<typeof withAResults[\"data\"][0][\"a\"]>()\n .toEqualTypeOf<number | undefined>();\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<Employee, {\n mom: \"integer\" | undefined;\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<Employee, never, PropertyKeys<Employee>, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number | undefined>();\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<Employee, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n }>\n >();\n });\n\n test.todo(\"with calculated properties\");\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<Employee, never, PropertyKeys<Employee>, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n });\n\n it(\"works with .async\", () => {\n const asyncIter = withFamily.asyncIter();\n expectTypeOf<typeof asyncIter>().toEqualTypeOf<\n AsyncIterableIterator<\n Osdk.Instance<Employee, never, PropertyKeys<Employee>, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\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<Employee, never, PropertyKeys<Employee>, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\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<Employee, never, never, {\n mom: \"integer\" | undefined;\n dad: \"string\" | undefined;\n sister: \"string\"[] | undefined;\n }>\n >();\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0][\"mom\"]>()\n .toEqualTypeOf<number | undefined>();\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<Employee, never, never, {\n mom: \"integer\" | undefined;\n }>\n >();\n });\n\n it(\"Works with selecting all non-RDP's\", async () => {\n const withFamilyResults = await withFamily.fetchPage({\n $select: [\"class\", \"fullName\"],\n });\n\n expectTypeOf<typeof withFamilyResults[\"data\"][0]>()\n .toEqualTypeOf<\n Osdk.Instance<Employee, never, PropertyKeys<Employee>, {}>\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<Employee, 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 Employee,\n never,\n \"class\",\n { mom: \"integer\" | undefined }\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<Employee, {\n mom: \"integer\" | undefined;\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 Employee,\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});\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;AA8E7D,MAAMC,QAAkB,GAAG;EACzBC,IAAI,EAAE,QAAQ;EACdC,OAAO,EAAE;AACX,CAAC;AAEDP,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1B,MAAMQ,aAAa,GAAG;IACpBC,KAAK,EAAEL,EAAE,CAACM,EAAE,CAAC,MAAM;MACjB,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFG,cAAc,EAAEP,EAAE,CAACM,EAAE,CAAC,MAAM;MAC1B,OAAOF,aAAa;IACtB,CAAC,CAAC;IACFI,SAAS,EAAER,EAAE,CAACM,EAAE,CAAC,MAAMG,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;IACzCC,SAAS,EAAEX,EAAE,CAACM,EAAE,CAAC,MAAM;MACrB,OAAO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AC,MAAM,CAAC,CAACC,SAAS,CAAC,QAAQ;MAC1D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ValidAggregationKeys } from "../aggregate/AggregatableKeys.js";
|
|
2
|
+
import type { WhereClause } from "../aggregate/WhereClause.js";
|
|
3
|
+
import type { ObjectOrInterfaceDefinition, PropertyKeys } from "../ontology/ObjectOrInterface.js";
|
|
4
|
+
import type { CompileTimeMetadata } from "../ontology/ObjectTypeDefinition.js";
|
|
5
|
+
import type { SimplePropertyDef } from "../ontology/SimplePropertyDef.js";
|
|
6
|
+
import type { LinkedType, LinkNames } from "../util/LinkUtils.js";
|
|
7
|
+
import type { CollectWithPropAggregations } from "./WithPropertiesAggregationOptions.js";
|
|
8
|
+
export declare namespace DerivedProperty {
|
|
9
|
+
type SelectorResult<T extends SimplePropertyDef> = {
|
|
10
|
+
type: T
|
|
11
|
+
};
|
|
12
|
+
type Clause<Q extends ObjectOrInterfaceDefinition> = {
|
|
13
|
+
[key: string]: Selector<Q, SimplePropertyDef>
|
|
14
|
+
};
|
|
15
|
+
type Selector<
|
|
16
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
17
|
+
T extends SimplePropertyDef
|
|
18
|
+
> = (baseObjectSet: DerivedProperty.Builder<Q, false>) => SelectorResult<T>;
|
|
19
|
+
interface Builder<
|
|
20
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
21
|
+
CONSTRAINED extends boolean
|
|
22
|
+
> extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {}
|
|
23
|
+
interface AggregateBuilder<
|
|
24
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
25
|
+
CONSTRAINED extends boolean
|
|
26
|
+
> extends Builder<Q, CONSTRAINED>, Aggregatable<Q> {}
|
|
27
|
+
interface SelectPropertyBuilder<
|
|
28
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
29
|
+
CONSTRAINED extends boolean
|
|
30
|
+
> extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {}
|
|
31
|
+
}
|
|
32
|
+
type BuilderTypeFromConstraint<
|
|
33
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
34
|
+
CONSTRAINED extends boolean
|
|
35
|
+
> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true> : DerivedProperty.SelectPropertyBuilder<Q, false>;
|
|
36
|
+
type Filterable<
|
|
37
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
38
|
+
CONSTRAINED extends boolean
|
|
39
|
+
> = {
|
|
40
|
+
readonly where: (clause: WhereClause<Q>) => BuilderTypeFromConstraint<Q, CONSTRAINED>
|
|
41
|
+
};
|
|
42
|
+
type Pivotable<
|
|
43
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
44
|
+
CONSTRAINED extends boolean
|
|
45
|
+
> = {
|
|
46
|
+
readonly pivotTo: <L extends LinkNames<Q>>(type: L) => CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : NonNullable<CompileTimeMetadata<Q>["links"][L]["multiplicity"]> extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : DerivedProperty.SelectPropertyBuilder<LinkedType<Q, L>, false>
|
|
47
|
+
};
|
|
48
|
+
type Aggregatable<Q extends ObjectOrInterfaceDefinition> = {
|
|
49
|
+
readonly aggregate: <V extends ValidAggregationKeys<Q, "withPropertiesAggregate">>(aggregationSpecifier: V, opts?: V extends `${any}:${infer P}` ? P extends CollectWithPropAggregations ? {
|
|
50
|
+
limit: number
|
|
51
|
+
} : P extends "approximatePercentile" ? {
|
|
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" | undefined : "double" | undefined : V extends "$count" ? "integer" | undefined : never>
|
|
54
|
+
};
|
|
55
|
+
type Selectable<Q extends ObjectOrInterfaceDefinition> = {
|
|
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"]>>
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
@@ -0,0 +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,cAAc,mCAAmC,uCAAwC;AAEzF,yBAAiB;MACH,eACV,UAAU,qBACR;EACF,MAAM;CACP;MAEW,OACV,UAAU,+BACR;iBACa,SAAS,GAAG;CAC5B;MAEW;EACV,UAAU;EACV,UAAU;MAEVA,eAAe,gBAAgB,QAAQ,GAAG,WACvC,eAAe;WAEH;EACf,UAAU;EACV;WACQ,WAAW,GAAG,cAAc,UAAU,GAAG,aAAa,CAC/D;WAEgB;EACf,UAAU;EACV;WACQ,QAAQ,GAAG,cAAc,aAAa,GAAG,CAClD;WAEgB;EACf,UAAU;EACV;WACQ,iBAAiB,GAAG,cAAc,WAAW,GAAG,CACzD;;KAGE;CACH,UAAU;CACV;IACE,oBAAoB,OAAO,gBAAgB,iBAAiB,GAAG,QAC/D,gBAAgB,sBAAsB,GAAG;KAExC;CACH,UAAU;CACV;IACE;UACO,QACPC,QAAQ,YAAY,OACjB,0BAA0B,GAAG;AACnC;KAEI;CACH,UAAU;CACV;IACE;UACO,UAAU,UAAU,UAAU,IACrCC,MAAM,MACH,oBAAoB,OACrB,gBAAgB,iBAAiB,WAAW,GAAG,IAAI,QACnD,YAAY,oBAAoB,GAAG,SAAS,GAAG,yBAC/C,OAAO,gBAAgB,iBAAiB,WAAW,GAAG,IAAI,QAC1D,gBAAgB,sBAAsB,WAAW,GAAG,IAAI;AAC7D;KAEI,aACH,UAAU,+BACR;UACO,YACP,UAAU,qBACR,GACA,4BAGFC,sBAAsB,GACtBC,OAAO,0BAA0B,MAC7B,UAAU,8BAA8B;EAAE;CAAe,IACzD,UAAU,0BAA0B;EAAE;CAAoB,sBAG3D,gBAAgB,eACnB,mBAAmB,WAAW,MAC1B,UAAU,8BACR,MAAM,oBAAoB,GAAG,cAAc,GAAG,uBAChD,UAAU,wBAAwB,kBAAkB,WAClD,wBACF,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type CollectWithPropAggregations = "collectSet" | "collectList";
|
|
2
|
-
export type BaseWithPropAggregations = "approximateDistinct" | "exactDistinct"
|
|
2
|
+
export type BaseWithPropAggregations = "approximateDistinct" | "exactDistinct";
|
|
3
3
|
export type StringWithPropAggregateOption = BaseWithPropAggregations | CollectWithPropAggregations;
|
|
4
|
-
export type NumericWithPropAggregateOption = "min" | "max" | "sum" | "avg" | BaseWithPropAggregations | CollectWithPropAggregations;
|
|
4
|
+
export type NumericWithPropAggregateOption = "min" | "max" | "sum" | "avg" | "approximatePercentile" | BaseWithPropAggregations | CollectWithPropAggregations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,YAAY,8BAA8B,eAAe;AAEzD,YAAY,2BACR,wBACA
|
|
1
|
+
{"mappings":"AAgBA,YAAY,8BAA8B,eAAe;AAEzD,YAAY,2BACR,wBACA;AAEJ,YAAY,gCACR,2BACA;AAEJ,YAAY,iCACR,QACA,QACA,QACA,QACA,0BACA,2BACA","names":[],"sources":["../../../src/derivedProperties/WithPropertiesAggregationOptions.ts"],"version":3,"file":"WithPropertiesAggregationOptions.d.ts"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { DistanceUnitMapping } from "./aggregate/WhereClause.js";
|
|
|
12
12
|
export type { GeoFilter_Intersects, GeoFilter_Within, PossibleWhereClauseFilters, WhereClause } from "./aggregate/WhereClause.js";
|
|
13
13
|
export type { OsdkObjectPropertyType } from "./Definitions.js";
|
|
14
14
|
export type { OsdkObjectLinksObject, SingleLinkAccessor } from "./definitions/LinkDefinitions.js";
|
|
15
|
+
export type { DerivedProperty } from "./derivedProperties/DerivedProperty.js";
|
|
15
16
|
export { DurationMapping } from "./groupby/GroupByClause.js";
|
|
16
17
|
export type { AllGroupByValues, GroupByClause, GroupByRange } from "./groupby/GroupByClause.js";
|
|
17
18
|
export type { AllowedBucketKeyTypes, AllowedBucketTypes, DataValueClientToWire, DataValueWireToClient } from "./mapping/DataValueMapping.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,eAAc,kCAAkC;AAChD,eACE,oBACA,aACA,0BACA,oBACA,+BACK;AACP,eAAc,4BAA4B;AAC1C,eAAc,qBAAqB;AACnC,eAAc,sEAAsE;AACpF,eAAc,oCAAoC;AAClD,eAAc,uCAAuC;AACrD,eAAc,yBAAyB;AACvC,eAAc,2BAA2B;AACzC,eAAc,wBAAwB;AACtC,SAAS,2BAA2B;AACpC,eACE,sBACA,kBACA,4BACA,mBACK;AACP,eAAc,8BAA8B;AAC5C,eACE,uBACA,0BACK;AACP,SAAS,uBAAuB;AAChC,eACE,kBACA,eACA,oBACK;AACP,eACE,uBACA,oBACA,uBACA,6BACK;AACP,eACE,iCACK;AACP,eAAc,YAAY,wBAAwB;AAClD,eACE,eACA,SACA,UACA,eACA,sBACA,WACA,uBACK;AACP,eACE,iBACA,wBACK;AACP,eAAc,OAAO,eAAe,sBAAsB;AAC1D,SAAS,YAAY;AACrB,eAAc,cAAc;AAC5B,eAAc,qBAAqB;AACnC,eAAc,iBAAiB;AAC/B,eAAc,6BAA6B;AAC3C,eACE,kBACA,sBACK;AACP,eACE,qBACA,yBACK;AACP,eACE,6BACA,oBACK;AACP,eACE,qBACA,gBACA,sBACA,aACA,oBACK;AACP,eAAc,wBAAwB;AACtC,eAAc,uBAAuB;AACrC,eACE,qBACA,wBACA,yBACA,iBACA,eACA,0BACA,4CACA,gDACK;AACP,eACE,uBACA,yBACK;AACP,eAAc,UAAU,sBAAsB;AAC9C,eAAc,kBAAkB;AAChC,eAAc,cAAc,YAAY;AACxC,eAAc,kBAAkB;AAChC,eAAc,YAAY,mBAAmB;AAC7C,SAAS,iCAAiC;AAC1C,eACE,uBACA,iBACA,oBACA,uBACK;AACP,eAAc,YAAY,iBAAiB;AAE3C","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
1
|
+
{"mappings":"AAgBA,eAAc,kCAAkC;AAChD,eACE,oBACA,aACA,0BACA,oBACA,+BACK;AACP,eAAc,4BAA4B;AAC1C,eAAc,qBAAqB;AACnC,eAAc,sEAAsE;AACpF,eAAc,oCAAoC;AAClD,eAAc,uCAAuC;AACrD,eAAc,yBAAyB;AACvC,eAAc,2BAA2B;AACzC,eAAc,wBAAwB;AACtC,SAAS,2BAA2B;AACpC,eACE,sBACA,kBACA,4BACA,mBACK;AACP,eAAc,8BAA8B;AAC5C,eACE,uBACA,0BACK;AACP,eAAc,uBAAuB;AACrC,SAAS,uBAAuB;AAChC,eACE,kBACA,eACA,oBACK;AACP,eACE,uBACA,oBACA,uBACA,6BACK;AACP,eACE,iCACK;AACP,eAAc,YAAY,wBAAwB;AAClD,eACE,eACA,SACA,UACA,eACA,sBACA,WACA,uBACK;AACP,eACE,iBACA,wBACK;AACP,eAAc,OAAO,eAAe,sBAAsB;AAC1D,SAAS,YAAY;AACrB,eAAc,cAAc;AAC5B,eAAc,qBAAqB;AACnC,eAAc,iBAAiB;AAC/B,eAAc,6BAA6B;AAC3C,eACE,kBACA,sBACK;AACP,eACE,qBACA,yBACK;AACP,eACE,6BACA,oBACK;AACP,eACE,qBACA,gBACA,sBACA,aACA,oBACK;AACP,eAAc,wBAAwB;AACtC,eAAc,uBAAuB;AACrC,eACE,qBACA,wBACA,yBACA,iBACA,eACA,0BACA,4CACA,gDACK;AACP,eACE,uBACA,yBACK;AACP,eAAc,UAAU,sBAAsB;AAC9C,eAAc,kBAAkB;AAChC,eAAc,cAAc,YAAY;AACxC,eAAc,kBAAkB;AAChC,eAAc,YAAY,mBAAmB;AAC7C,SAAS,iCAAiC;AAC1C,eACE,uBACA,iBACA,oBACA,uBACK;AACP,eAAc,YAAY,iBAAiB;AAE3C","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -2,6 +2,7 @@ import type { AggregateOpts } from "../aggregate/AggregateOpts.js";
|
|
|
2
2
|
import type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from "../aggregate/AggregateOptsThatErrors.js";
|
|
3
3
|
import type { AggregationsResults } from "../aggregate/AggregationsResults.js";
|
|
4
4
|
import type { WhereClause } from "../aggregate/WhereClause.js";
|
|
5
|
+
import type { DerivedProperty } from "../derivedProperties/DerivedProperty.js";
|
|
5
6
|
import type { AsyncIterArgs, Augments, FetchPageArgs, NullabilityAdherence, SelectArg } from "../object/FetchPageArgs.js";
|
|
6
7
|
import type { Result } from "../object/Result.js";
|
|
7
8
|
import type { DerivedObjectOrInterfaceDefinition, ObjectOrInterfaceDefinition, PropertyKeys } from "../ontology/ObjectOrInterface.js";
|
|
@@ -100,6 +101,12 @@ interface AsyncIter<
|
|
|
100
101
|
S extends NullabilityAdherence = NullabilityAdherence.Default
|
|
101
102
|
>(args?: AsyncIterArgs<Q, L, R, A, S>) => AsyncIterableIterator<Osdk.Instance<Q, ExtractOptions<R, S>, PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L, { [K in Extract<keyof RDPs, L>] : RDPs[K] }>>;
|
|
102
103
|
}
|
|
104
|
+
interface WithProperties<
|
|
105
|
+
Q extends ObjectOrInterfaceDefinition = any,
|
|
106
|
+
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
107
|
+
> {
|
|
108
|
+
readonly withProperties: <NEW extends Record<string, SimplePropertyDef>>(clause: { [K in keyof NEW] : DerivedProperty.Selector<Q, NEW[K]> }) => ObjectSet<Q, { [NN in keyof NEW | keyof RDPs] : NN extends keyof NEW ? NEW[NN] : NN extends keyof RDPs ? RDPs[NN] : never }>;
|
|
109
|
+
}
|
|
103
110
|
export interface ObjectSet<
|
|
104
111
|
Q extends ObjectOrInterfaceDefinition = any,
|
|
105
112
|
UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> = ObjectSet<Q, any>
|
|
@@ -206,5 +213,5 @@ interface ObjectSetCleanedTypes<
|
|
|
206
213
|
Q extends ObjectOrInterfaceDefinition,
|
|
207
214
|
D extends Record<string, SimplePropertyDef>,
|
|
208
215
|
MERGED extends ObjectOrInterfaceDefinition
|
|
209
|
-
> extends MinimalObjectSet<Q, D>, Aggregate<MERGED>, SetArithmetic<MERGED>, PivotTo<MERGED>, FetchOne<Q, D>, Subscribe<MERGED> {}
|
|
216
|
+
> extends MinimalObjectSet<Q, D>, WithProperties<Q, D>, Aggregate<MERGED>, SetArithmetic<MERGED>, PivotTo<MERGED>, FetchOne<Q, D>, Subscribe<MERGED> {}
|
|
210
217
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qB;GAEjDD,YAAY,eAAe,IAC3BC,UAAU,UAAU,GAAG,GAAG,GAAG,OAC1B,QACH,OACE,KAAK,SACH,GACA,eAAe,GAAG,IAClB,aAAa,WAAW,IAAI,aAAa,KAAK,aAAa,KAAK,MAC7D,KAAK,cAAc,MAAM,MAAK,KAAK;AAK/C;UAGS,UACR,UAAU,6BACV;;;;;;;UAOS,kBACD,UAAU,aAAa,IAE7BC,UAAU,sBAAsB,SAAS,GAAG,IAC5CC,OAAO,sBAAsB,QAAQ,GAAG,OACrC;EAAE;CAAyB;AACjC;UAES;CACR,UAAU;CACV,UAAU,eAAe;CACzB,eAAe;UAEf,iBAAiB,GAAG,IACpB,eAAe,GAAG,IAClB,UAAU,SACV,cAAc,SACd,QAAQ,SACR,SAAS,GAAG,IACZ,UAAU,QACZ,CACC","names":["args?: FetchPageArgs<Q, L, R, A, S>","clause: WhereClause<MergeObjectSet<Q, RDPs>>","args?: AsyncIterArgs<Q, L, R, A, S>","clause: { [K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]> }","req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>","type: L","primaryKey: PrimaryKeyType<Q>","options?: SelectArg<Q, L, R, S>","listener: ObjectSetSubscription.Listener<Q, P>","opts?: ObjectSetSubscription.Options<Q, P>"],"sources":["../../../src/objectSet/ObjectSet.ts"],"version":3,"file":"ObjectSet.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-beta.2",
|
|
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.api-extractor": "~0.0.
|
|
52
|
-
"@osdk/monorepo.tsconfig": "~0.0.
|
|
51
|
+
"@osdk/monorepo.api-extractor": "~0.1.0-beta.1",
|
|
52
|
+
"@osdk/monorepo.tsconfig": "~0.1.0-beta.1"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|