@osdk/api 2.14.0-main-5dc557e9e321d23e8e150e8015c41ebe3b6f387c → 2.14.0
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 +5 -1
- package/build/browser/Definitions.js.map +1 -1
- package/build/browser/object/PropertySecurity.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.js.map +1 -1
- package/build/browser/timeseries/timeseries.js.map +1 -1
- package/build/cjs/{ObjectSet-BNv0WzWd.d.cts → ObjectSet-UryvRSlB.d.cts} +118 -94
- package/build/cjs/index.d.cts +2 -2
- package/build/cjs/public/shapes-internal.d.cts +2 -2
- package/build/cjs/public/unstable.d.cts +4 -4
- package/build/cjs/{shapes-internal-Ba7pyRdk.d.cts → shapes-internal-DoJuuU1_.d.cts} +1 -1
- package/build/esm/Definitions.js.map +1 -1
- package/build/esm/object/PropertySecurity.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.js.map +1 -1
- package/build/esm/timeseries/timeseries.js.map +1 -1
- package/build/types/Definitions.d.ts +5 -5
- package/build/types/object/PropertySecurity.d.ts +1 -1
- package/build/types/objectSet/ObjectSet.d.ts +58 -42
- package/build/types/objectSet/ObjectSet.d.ts.map +1 -1
- package/build/types/timeseries/timeseries.d.ts +30 -22
- package/build/types/timeseries/timeseries.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# @osdk/api
|
|
2
2
|
|
|
3
|
-
## 2.14.0
|
|
3
|
+
## 2.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 20e9678: Wrap `@example` JSDoc blocks in fenced ts/tsx code blocks so VS Code's Markdown renderer preserves whitespace and applies syntax highlighting.
|
|
4
8
|
|
|
5
9
|
## 2.13.0
|
|
6
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Definitions.js","names":[],"sources":["Definitions.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n GetClientPropertyValueFromWire,\n GetCreatePropertyValueFromWire,\n} from \"./mapping/PropertyValueMapping.js\";\nimport type { ObjectMetadata } from \"./ontology/ObjectTypeDefinition.js\";\n\ntype MaybeArray<T extends { multiplicity?: boolean | undefined }, U> =\n T[\"multiplicity\"] extends true ? Array<U> : U;\n\ntype MaybeNullable<T extends ObjectMetadata.Property, U> = T[\"nullable\"] extends\n true ? U | undefined\n : U;\n\n/**\n * @param
|
|
1
|
+
{"version":3,"file":"Definitions.js","names":[],"sources":["Definitions.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n GetClientPropertyValueFromWire,\n GetCreatePropertyValueFromWire,\n} from \"./mapping/PropertyValueMapping.js\";\nimport type { ObjectMetadata } from \"./ontology/ObjectTypeDefinition.js\";\n\ntype MaybeArray<T extends { multiplicity?: boolean | undefined }, U> =\n T[\"multiplicity\"] extends true ? Array<U> : U;\n\ntype MaybeNullable<T extends ObjectMetadata.Property, U> = T[\"nullable\"] extends\n true ? U | undefined\n : U;\n\n/**\n * @param T - ObjectMetadata.Property in literal form\n * @param STRICTLY_ENFORCE_NULLABLE - S for strict. If false, always `|undefined`\n */\nexport type OsdkObjectPropertyType<\n T extends ObjectMetadata.Property,\n STRICTLY_ENFORCE_NULLABLE extends boolean = true,\n> = STRICTLY_ENFORCE_NULLABLE extends false ?\n | MaybeArray<T, GetClientPropertyValueFromWire<T[\"type\"]>>\n | undefined\n : MaybeNullable<\n T,\n MaybeArray<T, GetClientPropertyValueFromWire<T[\"type\"]>>\n >;\n\n/**\n * @param T - ObjectMetadata.Property in literal form\n */\nexport type OsdkObjectPropertyTypeNotUndefined<\n T extends ObjectMetadata.Property,\n> = MaybeArray<T, GetClientPropertyValueFromWire<T[\"type\"]>>;\n\n/**\n * @param T - ObjectMetadata.Property in literal form\n * @param STRICTLY_ENFORCE_NULLABLE - S for strict. If false, always `|undefined`\n */\nexport type OsdkObjectCreatePropertyType<\n T extends ObjectMetadata.Property,\n STRICTLY_ENFORCE_NULLABLE extends boolean = true,\n> = STRICTLY_ENFORCE_NULLABLE extends false ?\n | MaybeArray<T, GetCreatePropertyValueFromWire<T[\"type\"]>>\n | undefined\n : MaybeNullable<\n T,\n MaybeArray<T, GetCreatePropertyValueFromWire<T[\"type\"]>>\n >;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertySecurity.js","names":[],"sources":["PropertySecurity.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A discriminated union representing different types of property security outcomes.\n *\n *
|
|
1
|
+
{"version":3,"file":"PropertySecurity.js","names":[],"sources":["PropertySecurity.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A discriminated union representing different types of property security outcomes.\n *\n * The type field determines which security outcome is represented:\n * - \"propertyMarkings\": Successfully computed security markings for the property\n * - \"unsupportedPolicy\": The property is backed by a restricted view that doesn't support property securities\n * - \"errorComputingSecurity\": The server was unable to load the securities of the property\n */\nexport type PropertySecurity =\n | ({\n type: \"propertyMarkings\";\n } & PropertyMarkings)\n | ({\n type: \"unsupportedPolicy\";\n })\n | ({\n type: \"errorComputingSecurity\";\n });\n\n/**\n * All marking requirements applicable to a property value.\n *\n * Markings represent security classifications or access control requirements\n * that must be satisfied to access the property value.\n */\nexport interface PropertyMarkings {\n /**\n * The conjunctive set of markings required to access the property value.\n * All markings from a conjunctive set must be met for access.\n */\n conjunctive?: Array<MarkingId>;\n /**\n * The disjunctive set of markings required to access the property value.\n *\n * Disjunctive markings are represented as a conjunctive list of disjunctive sets.\n * The top-level array is a conjunction of sets, where each inner array should be\n * treated as a unit where any marking within the set can satisfy the set.\n * All sets within the top level array must be satisfied.\n */\n disjunctive?: Array<Array<MarkingId>>;\n /**\n * The conjunctive set of markings for the container of this property value,\n * such as the project of a dataset. These markings may differ from the marking\n * on the actual property value, but still must be satisfied for accessing the property.\n *\n * All markings from a conjunctive set must be met for access.\n */\n containerConjunctive?: Array<MarkingId>;\n /**\n * The disjunctive set of markings for the container of this property value,\n * such as the project of a dataset. These markings may differ from the marking\n * on the actual property value, but still must be satisfied for accessing the property.\n *\n * Disjunctive markings are represented as a conjunctive list of disjunctive sets.\n * The top-level array is a conjunction of sets, where each inner array should be\n * treated as a unit where any marking within the set can satisfy the set.\n * All sets within the top level array must be satisfied.\n */\n containerDisjunctive?: Array<Array<MarkingId>>;\n}\n\n/**\n * A unique identifier for a security marking.\n * Markings represent security classifications or access control requirements.\n */\nexport type MarkingId = string;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedProperty } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n ObjectSetArgs,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { 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 {\n ExtractAllPropertiesOption,\n ExtractOptions,\n ExtractRidOption,\n MaybeScore,\n Osdk,\n} from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type {\n LinkTypeApiNamesFor,\n MinimalDirectedObjectLinkInstance,\n} from \"./ObjectSetLinks.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef> = {},\n> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;\n\ntype ExtractRdp<\n D extends\n | BaseObjectSet<any>\n | Record<string, SimplePropertyDef>,\n> = [D] extends [never] ? {}\n : D extends BaseObjectSet<any> ? {}\n : D extends Record<string, SimplePropertyDef> ? D\n : {};\n\ntype MaybeSimplifyPropertyKeys<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;\n\ntype SubSelectKeysHelper<\n Q extends ObjectOrInterfaceDefinition,\n L extends string,\n> = [L] extends [never] ? PropertyKeys<Q>\n : PropertyKeys<Q> extends L ? PropertyKeys<Q>\n : L & PropertyKeys<Q>;\n\ntype SubSelectKeys<\n Q extends ObjectOrInterfaceDefinition,\n X extends SelectArg<Q, PropertyKeys<Q>, any, any, any, any> = never,\n> = SubSelectKeysHelper<Q, Extract$Select<X>>;\n\ntype NOOP<T> = T extends (...args: any[]) => any ? T\n : T extends abstract new(...args: any[]) => any ? T\n : { [K in keyof T]: T[K] };\n\ntype SubSelectRDPsHelper<\n X extends ValidFetchPageArgs<any, any, any> | ValidAsyncIterArgs<any, any>,\n DEFAULT extends string,\n> = [X] extends [never] ? DEFAULT\n : (X[\"$select\"] & string[])[number] & DEFAULT;\n\ntype SubSelectRDPs<\n RDPs extends Record<string, SimplePropertyDef>,\n X extends ValidFetchPageArgs<any, RDPs, any> | ValidAsyncIterArgs<any, RDPs>,\n> = [RDPs] extends [never] ? never\n : NOOP<{ [K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K] }>;\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs, ORDER_BY_OPTIONS>,\n Where<Q, RDPs>,\n AsyncIterLinks<Q>,\n Subscribe<MergeObjectSet<Q, RDPs>>\n{\n}\n\nexport type ExtractOptions2<\n X extends FetchPageArgs<any, any, any, any, any, any, any>,\n> = [X] extends [never] ? never\n :\n | ExtractRidOption<X[\"$includeRid\"] extends true ? true : false>\n | ExtractAllPropertiesOption<\n X[\"$includeAllBaseObjectProperties\"] extends true ? true : false\n >;\n\ntype Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<\n X[\"$select\"]\n>[number];\n\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly fetchPage: FetchPageSignature<Q, RDPs>;\n readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;\n}\n\ntype ValidFetchPageArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>>,\n> = ObjectSetArgs.FetchPage<\n Q,\n PropertyKeys<Q>,\n boolean,\n string & keyof RDPs,\n ORDER_BY_OPTIONS\n>;\n\ntype ValidAsyncIterArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> =\n | ObjectSetArgs.AsyncIter<\n Q,\n PropertyKeys<Q>,\n false,\n string & keyof RDPs\n >\n | AsyncIterArgs<\n Q,\n never,\n any,\n any,\n any,\n true,\n string & keyof RDPs\n >;\n\ninterface FetchPageSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {},\n PROPERTY_SECURITIES extends boolean = false,\n >(\n args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): Promise<\n PageResult<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >\n >;\n}\n\ninterface NearestNeighbors<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Finds the nearest neighbors for a given text or vector within the object set.\n *\n * @param query - Queries support either a vector matching the embedding model defined on the property, or text that is\n automatically embedded.\n * @param numNeighbors - The number of objects to return. If the number of documents in the objectType is less than the provided\n value, all objects will be returned. This value is limited to 1 ≤ numNeighbors ≥ 500.\n * @param property - The property key with a defined embedding model to search over.\n *\n * @returns An object set containing the `numNeighbors` nearest neighbors. To return the objects ordered by relevance and each\n * objects associated score, specify \"relevance\" in the orderBy.\n */\n\n readonly nearestNeighbors: (\n query: string | number[],\n numNeighbors: number,\n property: PropertyKeys.Filtered<Q, \"vector\">,\n ) => this;\n}\n\ninterface FetchPageWithErrorsSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n PROPERTY_SECURITIES extends boolean = false,\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {},\n >(\n args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): Promise<\n Result<\n PageResult<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIterSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n PROPERTY_SECURITIES extends boolean = false,\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n <X extends ValidAsyncIterArgs<Q, RDPs> = never>(\n args?: X,\n ): AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions2<X>,\n SubSelectKeys<Q, X>,\n SubSelectRDPs<RDPs, X>\n >\n >;\n\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n >(\n args?: AsyncIterArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): AsyncIterableIterator<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> {\n asyncIter: AsyncIterSignature<Q, RDPs, ORDER_BY_OPTIONS>;\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.Creator<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends\n | BaseObjectSet<Q>\n | Record<string, SimplePropertyDef> = never,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, ExtractRdp<UNUSED_OR_RDP>>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOneSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n PROPERTY_SECURITIES extends boolean = false,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>,\n ): Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, false, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >;\n}\n\ninterface FetchOneWithErrorsSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n PROPERTY_SECURITIES extends boolean = false,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>,\n ): Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, false, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >\n >;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;\n fetchOneWithErrors: Q extends ObjectTypeDefinition\n ? FetchOneWithErrorsSignature<Q, RDPs>\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n const R extends boolean = false,\n >(\n listener: ObjectSetSubscription.Listener<Q, P, R>,\n opts?: ObjectSetSubscription.Options<Q, P, R>,\n ) => { unsubscribe: () => void };\n}\n\ninterface NarrowToType<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Casts the object set to the specified object type or interface type.\n * Any downstream object set operations (e.g. where, fetchPage, aggregate) will be\n * performed on the specified type. Objects from the original object set that do not\n * implement the specified interface or match the specified object set will be filtered out.\n * @param type - The object type you want to cast to.\n * @returns an object set of the specified type.\n */\n readonly narrowToType: <\n CONVERT_TO extends RestrictToImplementingObjectTypes<Q>,\n >(\n type: CONVERT_TO,\n ) => ObjectSet<CONVERT_TO>;\n}\n\ntype RestrictToImplementingObjectTypes<T extends ObjectOrInterfaceDefinition> =\n T extends ObjectTypeDefinition ? ExtractImplementedInterfaces<T>\n : T extends InterfaceDefinition ? ExtractImplementingTypes<T>\n : never;\n\ntype ExtractImplementedInterfaces<T extends ObjectTypeDefinition> =\n CompileTimeMetadata<T> extends { implements: ReadonlyArray<infer API_NAME> }\n ? API_NAME extends string ? InterfaceDefinition & { apiName: API_NAME }\n : never\n : never;\n\ntype ExtractImplementingTypes<T extends InterfaceDefinition> =\n CompileTimeMetadata<T> extends\n { implementedBy: ReadonlyArray<infer API_NAME extends string> }\n ? (ObjectTypeDefinition & { apiName: API_NAME }) | InterfaceDefinition\n : InterfaceDefinition;\n\ninterface AsyncIterLinks<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Batch load links on an object set. This is an experimental method that may change while in beta.\n * Use this method in conjunction with `.asyncIter()` and `.pivotTo(...).asyncIter()` to build an\n * object graph in memory.\n *\n * Please keep these limitations in mind:\n * - Links returned may be stale. For example, primary keys returned by this endpoint may not exist anymore.\n * - The backend API fetches pages of *n* objects at a time. If, for any page of *n* objects, there are more\n * than 100,000 links present, results are limited to 100,000 links and should be considered partial.\n * - This method does not support OSv1 links and will throw an exception if links provided are backed by OSv1.\n * - This method currently does not support interface links, but support will be added in the near future.\n */\n readonly experimental_asyncIterLinks: <\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n links: LINK_TYPE_API_NAME[],\n ) => AsyncIterableIterator<\n MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>\n >;\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition & Q,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> extends\n MinimalObjectSet<Q, D, ORDER_BY_OPTIONS>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<Q>,\n FetchOne<Q, D>,\n NearestNeighbors<Q>,\n NarrowToType<Q>\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 ObjectSetArgs,\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 {\n ExtractAllPropertiesOption,\n ExtractOptions,\n ExtractRidOption,\n MaybeScore,\n Osdk,\n} from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type {\n LinkTypeApiNamesFor,\n MinimalDirectedObjectLinkInstance,\n} from \"./ObjectSetLinks.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef> = {},\n> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;\n\ntype ExtractRdp<\n D extends\n | BaseObjectSet<any>\n | Record<string, SimplePropertyDef>,\n> = [D] extends [never] ? {}\n : D extends BaseObjectSet<any> ? {}\n : D extends Record<string, SimplePropertyDef> ? D\n : {};\n\ntype MaybeSimplifyPropertyKeys<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;\n\ntype SubSelectKeysHelper<\n Q extends ObjectOrInterfaceDefinition,\n L extends string,\n> = [L] extends [never] ? PropertyKeys<Q>\n : PropertyKeys<Q> extends L ? PropertyKeys<Q>\n : L & PropertyKeys<Q>;\n\ntype SubSelectKeys<\n Q extends ObjectOrInterfaceDefinition,\n X extends SelectArg<Q, PropertyKeys<Q>, any, any, any, any> = never,\n> = SubSelectKeysHelper<Q, Extract$Select<X>>;\n\ntype NOOP<T> = T extends (...args: any[]) => any ? T\n : T extends abstract new(...args: any[]) => any ? T\n : { [K in keyof T]: T[K] };\n\ntype SubSelectRDPsHelper<\n X extends ValidFetchPageArgs<any, any, any> | ValidAsyncIterArgs<any, any>,\n DEFAULT extends string,\n> = [X] extends [never] ? DEFAULT\n : (X[\"$select\"] & string[])[number] & DEFAULT;\n\ntype SubSelectRDPs<\n RDPs extends Record<string, SimplePropertyDef>,\n X extends ValidFetchPageArgs<any, RDPs, any> | ValidAsyncIterArgs<any, RDPs>,\n> = [RDPs] extends [never] ? never\n : NOOP<{ [K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K] }>;\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs, ORDER_BY_OPTIONS>,\n Where<Q, RDPs>,\n AsyncIterLinks<Q>,\n Subscribe<MergeObjectSet<Q, RDPs>>\n{\n}\n\nexport type ExtractOptions2<\n X extends FetchPageArgs<any, any, any, any, any, any, any>,\n> = [X] extends [never] ? never\n :\n | ExtractRidOption<X[\"$includeRid\"] extends true ? true : false>\n | ExtractAllPropertiesOption<\n X[\"$includeAllBaseObjectProperties\"] extends true ? true : false\n >;\n\ntype Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<\n X[\"$select\"]\n>[number];\n\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly fetchPage: FetchPageSignature<Q, RDPs>;\n readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;\n}\n\ntype ValidFetchPageArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>>,\n> = ObjectSetArgs.FetchPage<\n Q,\n PropertyKeys<Q>,\n boolean,\n string & keyof RDPs,\n ORDER_BY_OPTIONS\n>;\n\ntype ValidAsyncIterArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> =\n | ObjectSetArgs.AsyncIter<\n Q,\n PropertyKeys<Q>,\n false,\n string & keyof RDPs\n >\n | AsyncIterArgs<\n Q,\n never,\n any,\n any,\n any,\n true,\n string & keyof RDPs\n >;\n\ninterface FetchPageSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * ```ts\n * const myObjs = await objectSet.fetchPage({\n * $pageSize: 10,\n * $nextPageToken: \"nextPage\",\n * });\n * const myObjsResult = myObjs.data;\n * ```\n * @returns a page of objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {},\n PROPERTY_SECURITIES extends boolean = false,\n >(\n args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): Promise<\n PageResult<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >\n >;\n}\n\ninterface NearestNeighbors<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Finds the nearest neighbors for a given text or vector within the object set.\n *\n * @param query - Queries support either a vector matching the embedding model defined on the property, or text that is\n automatically embedded.\n * @param numNeighbors - The number of objects to return. If the number of documents in the objectType is less than the provided\n value, all objects will be returned. This value is limited to 1 ≤ numNeighbors ≥ 500.\n * @param property - The property key with a defined embedding model to search over.\n *\n * @returns An object set containing the `numNeighbors` nearest neighbors. To return the objects ordered by relevance and each\n * objects associated score, specify \"relevance\" in the orderBy.\n */\n\n readonly nearestNeighbors: (\n query: string | number[],\n numNeighbors: number,\n property: PropertyKeys.Filtered<Q, \"vector\">,\n ) => this;\n}\n\ninterface FetchPageWithErrorsSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n PROPERTY_SECURITIES extends boolean = false,\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 * ```ts\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 * ```\n * @returns a page of objects, wrapped in a result wrapper\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {},\n >(\n args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): Promise<\n Result<\n PageResult<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\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 * ```ts\n * await client(Office).where({\n * meetingRooms: { $contains: \"Grand Central\" },\n * meetingRoomCapacities: { $contains: 30 },\n * });\n * ```\n * @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIterSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n PROPERTY_SECURITIES extends boolean = false,\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * ```ts\n * for await (const obj of myObjectSet.asyncIter()) {\n * // Handle obj\n * }\n * ```\n * @returns an async iterator to load all objects\n */\n <X extends ValidAsyncIterArgs<Q, RDPs> = never>(\n args?: X,\n ): AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions2<X>,\n SubSelectKeys<Q, X>,\n SubSelectRDPs<RDPs, X>\n >\n >;\n\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * ```ts\n * for await (const obj of myObjectSet.asyncIter()) {\n * // Handle obj\n * }\n * ```\n * @returns an async iterator to load all objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n >(\n args?: AsyncIterArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): AsyncIterableIterator<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> {\n asyncIter: AsyncIterSignature<Q, RDPs, ORDER_BY_OPTIONS>;\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.Creator<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends\n | BaseObjectSet<Q>\n | Record<string, SimplePropertyDef> = never,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, ExtractRdp<UNUSED_OR_RDP>>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * ```ts\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 * ```ts\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n * simpleFilteredEmployeeObjectSet,\n * );\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 * ```ts\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n * simpleFilteredEmployeeObjectSet,\n * );\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 * ```ts\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n * simpleFilteredEmployeeObjectSet,\n * );\n * ```\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOneSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n PROPERTY_SECURITIES extends boolean = false,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>,\n ): Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, false, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >;\n}\n\ninterface FetchOneWithErrorsSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n PROPERTY_SECURITIES extends boolean = false,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>,\n ): Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, false, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >\n >;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;\n fetchOneWithErrors: Q extends ObjectTypeDefinition\n ? FetchOneWithErrorsSignature<Q, RDPs>\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n const R extends boolean = false,\n >(\n listener: ObjectSetSubscription.Listener<Q, P, R>,\n opts?: ObjectSetSubscription.Options<Q, P, R>,\n ) => { unsubscribe: () => void };\n}\n\ninterface NarrowToType<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Casts the object set to the specified object type or interface type.\n * Any downstream object set operations (e.g. where, fetchPage, aggregate) will be\n * performed on the specified type. Objects from the original object set that do not\n * implement the specified interface or match the specified object set will be filtered out.\n * @param type - The object type you want to cast to.\n * @returns an object set of the specified type.\n */\n readonly narrowToType: <\n CONVERT_TO extends RestrictToImplementingObjectTypes<Q>,\n >(\n type: CONVERT_TO,\n ) => ObjectSet<CONVERT_TO>;\n}\n\ntype RestrictToImplementingObjectTypes<T extends ObjectOrInterfaceDefinition> =\n T extends ObjectTypeDefinition ? ExtractImplementedInterfaces<T>\n : T extends InterfaceDefinition ? ExtractImplementingTypes<T>\n : never;\n\ntype ExtractImplementedInterfaces<T extends ObjectTypeDefinition> =\n CompileTimeMetadata<T> extends { implements: ReadonlyArray<infer API_NAME> }\n ? API_NAME extends string ? InterfaceDefinition & { apiName: API_NAME }\n : never\n : never;\n\ntype ExtractImplementingTypes<T extends InterfaceDefinition> =\n CompileTimeMetadata<T> extends\n { implementedBy: ReadonlyArray<infer API_NAME extends string> }\n ? (ObjectTypeDefinition & { apiName: API_NAME }) | InterfaceDefinition\n : InterfaceDefinition;\n\ninterface AsyncIterLinks<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Batch load links on an object set. This is an experimental method that may change while in beta.\n * Use this method in conjunction with `.asyncIter()` and `.pivotTo(...).asyncIter()` to build an\n * object graph in memory.\n *\n * Please keep these limitations in mind:\n * - Links returned may be stale. For example, primary keys returned by this endpoint may not exist anymore.\n * - The backend API fetches pages of *n* objects at a time. If, for any page of *n* objects, there are more\n * than 100,000 links present, results are limited to 100,000 links and should be considered partial.\n * - This method does not support OSv1 links and will throw an exception if links provided are backed by OSv1.\n * - This method currently does not support interface links, but support will be added in the near future.\n */\n readonly experimental_asyncIterLinks: <\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n links: LINK_TYPE_API_NAME[],\n ) => AsyncIterableIterator<\n MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>\n >;\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition & Q,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> extends\n MinimalObjectSet<Q, D, ORDER_BY_OPTIONS>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<Q>,\n FetchOne<Q, D>,\n NearestNeighbors<Q>,\n NarrowToType<Q>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeseries.js","names":["TimeDurationMapping","TimeseriesDurationMapping"],"sources":["timeseries.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 { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\n\nexport type TimeSeriesQuery =\n | {\n $before: number;\n $unit: keyof typeof TimeseriesDurationMapping;\n $after?: never;\n $startTime?: never;\n $endTime?: never;\n }\n | {\n $after: number;\n $unit: keyof typeof TimeseriesDurationMapping;\n $before?: never;\n $startTime?: never;\n $endTime?: never;\n }\n | {\n $startTime: string;\n $endTime?: string;\n $before?: never;\n $after?: never;\n $unit?: never;\n }\n | {\n $startTime?: string;\n $endTime: string;\n $before?: never;\n $after?: never;\n $unit?: never;\n };\n\nexport type TimeseriesDurationUnits =\n | \"YEARS\"\n | \"MONTHS\"\n | \"WEEKS\"\n | \"DAYS\"\n | \"HOURS\"\n | \"MINUTES\"\n | \"SECONDS\"\n | \"MILLISECONDS\";\n\nexport const TimeseriesDurationMapping: {\n sec: \"SECONDS\";\n seconds: \"SECONDS\";\n min: \"MINUTES\";\n minute: \"MINUTES\";\n minutes: \"MINUTES\";\n hr: \"HOURS\";\n hrs: \"HOURS\";\n hour: \"HOURS\";\n hours: \"HOURS\";\n day: \"DAYS\";\n days: \"DAYS\";\n wk: \"WEEKS\";\n week: \"WEEKS\";\n weeks: \"WEEKS\";\n mos: \"MONTHS\";\n month: \"MONTHS\";\n months: \"MONTHS\";\n yr: \"YEARS\";\n year: \"YEARS\";\n years: \"YEARS\";\n ms: \"MILLISECONDS\";\n milliseconds: \"MILLISECONDS\";\n} = {\n \"ms\": \"MILLISECONDS\",\n \"milliseconds\": \"MILLISECONDS\",\n ...TimeDurationMapping,\n} satisfies Record<string, TimeseriesDurationUnits>;\n\nexport interface TimeSeriesPoint<T extends string | number | GeoJSON.Point> {\n time: string;\n value: T;\n}\n\nexport interface TimeSeriesProperty<T extends number | string> {\n /**\n * Queries the first point of the Timeseries\n */\n readonly getFirstPoint: () => Promise<TimeSeriesPoint<T>>;\n /**\n * Queries the last point of the Timeseries\n */\n readonly getLastPoint: () => Promise<TimeSeriesPoint<T>>;\n /**\n
|
|
1
|
+
{"version":3,"file":"timeseries.js","names":["TimeDurationMapping","TimeseriesDurationMapping"],"sources":["timeseries.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 { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\n\nexport type TimeSeriesQuery =\n | {\n $before: number;\n $unit: keyof typeof TimeseriesDurationMapping;\n $after?: never;\n $startTime?: never;\n $endTime?: never;\n }\n | {\n $after: number;\n $unit: keyof typeof TimeseriesDurationMapping;\n $before?: never;\n $startTime?: never;\n $endTime?: never;\n }\n | {\n $startTime: string;\n $endTime?: string;\n $before?: never;\n $after?: never;\n $unit?: never;\n }\n | {\n $startTime?: string;\n $endTime: string;\n $before?: never;\n $after?: never;\n $unit?: never;\n };\n\nexport type TimeseriesDurationUnits =\n | \"YEARS\"\n | \"MONTHS\"\n | \"WEEKS\"\n | \"DAYS\"\n | \"HOURS\"\n | \"MINUTES\"\n | \"SECONDS\"\n | \"MILLISECONDS\";\n\nexport const TimeseriesDurationMapping: {\n sec: \"SECONDS\";\n seconds: \"SECONDS\";\n min: \"MINUTES\";\n minute: \"MINUTES\";\n minutes: \"MINUTES\";\n hr: \"HOURS\";\n hrs: \"HOURS\";\n hour: \"HOURS\";\n hours: \"HOURS\";\n day: \"DAYS\";\n days: \"DAYS\";\n wk: \"WEEKS\";\n week: \"WEEKS\";\n weeks: \"WEEKS\";\n mos: \"MONTHS\";\n month: \"MONTHS\";\n months: \"MONTHS\";\n yr: \"YEARS\";\n year: \"YEARS\";\n years: \"YEARS\";\n ms: \"MILLISECONDS\";\n milliseconds: \"MILLISECONDS\";\n} = {\n \"ms\": \"MILLISECONDS\",\n \"milliseconds\": \"MILLISECONDS\",\n ...TimeDurationMapping,\n} satisfies Record<string, TimeseriesDurationUnits>;\n\nexport interface TimeSeriesPoint<T extends string | number | GeoJSON.Point> {\n time: string;\n value: T;\n}\n\nexport interface TimeSeriesProperty<T extends number | string> {\n /**\n * Queries the first point of the Timeseries\n */\n readonly getFirstPoint: () => Promise<TimeSeriesPoint<T>>;\n /**\n * Queries the last point of the Timeseries\n */\n readonly getLastPoint: () => Promise<TimeSeriesPoint<T>>;\n /**\n * Loads all points, within the given time range if that's provided\n * @param query - a query representing either an absolute or relative range of time\n * @example\n * ```ts\n * const points = await employee.employeeStatus?.getAllPoints({\n * $after: 1,\n * $unit: \"month\",\n * });\n * ```\n */\n readonly getAllPoints: (\n query?: TimeSeriesQuery,\n ) => Promise<Array<TimeSeriesPoint<T>>>;\n /**\n * Returns an async iterator to load all points\n * within the given time range if that's provided\n * @param query - a query representing either an absolute or relative range of time\n * @example\n * ```ts\n * const iterator = employee.employeeStatus?.asyncIter({\n * $after: 1,\n * $unit: \"month\",\n * });\n * for await (const point of iterator) {\n * // Handle time series point\n * }\n * ```\n */\n readonly asyncIterPoints: (\n query?: TimeSeriesQuery,\n ) => AsyncGenerator<TimeSeriesPoint<T>>;\n}\n\nexport interface GeotimeSeriesProperty<T extends GeoJSON.Point> {\n /**\n * Queries the last point of the Geotime series\n */\n readonly getLatestValue: () => Promise<TimeSeriesPoint<T> | undefined>;\n /**\n * Loads all points, within the given time range if that's provided\n * @param query - a query representing either an absolute or relative range of time\n * @example\n * ```ts\n * const points = await employee.employeeStatus?.getAllPoints({\n * $after: 1,\n * $unit: \"month\",\n * });\n * ```\n */\n readonly getAllValues: (\n query?: TimeSeriesQuery,\n ) => Promise<Array<TimeSeriesPoint<T>>>;\n /**\n * Returns an async iterator to load all points\n * within the given time range if that's provided\n * @param query - a query representing either an absolute or relative range of time\n * @example\n * ```ts\n * const iterator = employee.employeeStatus?.asyncIter({\n * $after: 1,\n * $unit: \"month\",\n * });\n * for await (const point of iterator) {\n * // Handle time series point\n * }\n * ```\n */\n readonly asyncIterValues: (\n query?: TimeSeriesQuery,\n ) => AsyncGenerator<TimeSeriesPoint<T>>;\n\n /**\n * The most recently fetched value for the latest point in the GTSR.\n * This will not be loaded automatically upon object load, but will be refreshed every time\n * getLatestValue() is called\n */\n readonly lastFetchedValue: TimeSeriesPoint<T> | undefined;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,+BAA+B;AA0CnE,OAAO,MAAMC,yBAuBZ,GAAG;EACF,IAAI,EAAE,cAAc;EACpB,cAAc,EAAE,cAAc;EAC9B,GAAGD;AACL,CAAmD","ignoreList":[]}
|
|
@@ -155,28 +155,32 @@ interface TimeSeriesProperty<T extends number | string> {
|
|
|
155
155
|
*/
|
|
156
156
|
readonly getLastPoint: () => Promise<TimeSeriesPoint<T>>;
|
|
157
157
|
/**
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
* Loads all points, within the given time range if that's provided
|
|
159
|
+
* @param query - a query representing either an absolute or relative range of time
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* const points = await employee.employeeStatus?.getAllPoints({
|
|
163
|
+
* $after: 1,
|
|
164
|
+
* $unit: "month",
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
166
168
|
readonly getAllPoints: (query?: TimeSeriesQuery) => Promise<Array<TimeSeriesPoint<T>>>;
|
|
167
169
|
/**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
170
|
+
* Returns an async iterator to load all points
|
|
171
|
+
* within the given time range if that's provided
|
|
172
|
+
* @param query - a query representing either an absolute or relative range of time
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* const iterator = employee.employeeStatus?.asyncIter({
|
|
176
|
+
* $after: 1,
|
|
177
|
+
* $unit: "month",
|
|
178
|
+
* });
|
|
179
|
+
* for await (const point of iterator) {
|
|
180
|
+
* // Handle time series point
|
|
181
|
+
* }
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
180
184
|
readonly asyncIterPoints: (query?: TimeSeriesQuery) => AsyncGenerator<TimeSeriesPoint<T>>;
|
|
181
185
|
}
|
|
182
186
|
interface GeotimeSeriesProperty<T extends GeoJSON.Point> {
|
|
@@ -185,28 +189,32 @@ interface GeotimeSeriesProperty<T extends GeoJSON.Point> {
|
|
|
185
189
|
*/
|
|
186
190
|
readonly getLatestValue: () => Promise<TimeSeriesPoint<T> | undefined>;
|
|
187
191
|
/**
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
* Loads all points, within the given time range if that's provided
|
|
193
|
+
* @param query - a query representing either an absolute or relative range of time
|
|
194
|
+
* @example
|
|
195
|
+
* ```ts
|
|
196
|
+
* const points = await employee.employeeStatus?.getAllPoints({
|
|
197
|
+
* $after: 1,
|
|
198
|
+
* $unit: "month",
|
|
199
|
+
* });
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
196
202
|
readonly getAllValues: (query?: TimeSeriesQuery) => Promise<Array<TimeSeriesPoint<T>>>;
|
|
197
203
|
/**
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
204
|
+
* Returns an async iterator to load all points
|
|
205
|
+
* within the given time range if that's provided
|
|
206
|
+
* @param query - a query representing either an absolute or relative range of time
|
|
207
|
+
* @example
|
|
208
|
+
* ```ts
|
|
209
|
+
* const iterator = employee.employeeStatus?.asyncIter({
|
|
210
|
+
* $after: 1,
|
|
211
|
+
* $unit: "month",
|
|
212
|
+
* });
|
|
213
|
+
* for await (const point of iterator) {
|
|
214
|
+
* // Handle time series point
|
|
215
|
+
* }
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
210
218
|
readonly asyncIterValues: (query?: TimeSeriesQuery) => AsyncGenerator<TimeSeriesPoint<T>>;
|
|
211
219
|
/**
|
|
212
220
|
* The most recently fetched value for the latest point in the GTSR.
|
|
@@ -786,17 +794,17 @@ type MaybeArray<T extends {
|
|
|
786
794
|
}, U> = T["multiplicity"] extends true ? Array<U> : U;
|
|
787
795
|
type MaybeNullable$1<T extends ObjectMetadata.Property, U> = T["nullable"] extends true ? U | undefined : U;
|
|
788
796
|
/**
|
|
789
|
-
* @param
|
|
790
|
-
* @param
|
|
797
|
+
* @param T - ObjectMetadata.Property in literal form
|
|
798
|
+
* @param STRICTLY_ENFORCE_NULLABLE - S for strict. If false, always `|undefined`
|
|
791
799
|
*/
|
|
792
800
|
type OsdkObjectPropertyType<T extends ObjectMetadata.Property, STRICTLY_ENFORCE_NULLABLE extends boolean = true> = STRICTLY_ENFORCE_NULLABLE extends false ? MaybeArray<T, GetClientPropertyValueFromWire<T["type"]>> | undefined : MaybeNullable$1<T, MaybeArray<T, GetClientPropertyValueFromWire<T["type"]>>>;
|
|
793
801
|
/**
|
|
794
|
-
* @param
|
|
802
|
+
* @param T - ObjectMetadata.Property in literal form
|
|
795
803
|
*/
|
|
796
804
|
type OsdkObjectPropertyTypeNotUndefined<T extends ObjectMetadata.Property> = MaybeArray<T, GetClientPropertyValueFromWire<T["type"]>>;
|
|
797
805
|
/**
|
|
798
|
-
* @param
|
|
799
|
-
* @param
|
|
806
|
+
* @param T - ObjectMetadata.Property in literal form
|
|
807
|
+
* @param STRICTLY_ENFORCE_NULLABLE - S for strict. If false, always `|undefined`
|
|
800
808
|
*/
|
|
801
809
|
type OsdkObjectCreatePropertyType<T extends ObjectMetadata.Property, STRICTLY_ENFORCE_NULLABLE extends boolean = true> = STRICTLY_ENFORCE_NULLABLE extends false ? MaybeArray<T, GetCreatePropertyValueFromWire<T["type"]>> | undefined : MaybeNullable$1<T, MaybeArray<T, GetCreatePropertyValueFromWire<T["type"]>>>;
|
|
802
810
|
|
|
@@ -924,7 +932,7 @@ type SingleOsdkResult<Q extends ObjectOrInterfaceDefinition, L extends PropertyK
|
|
|
924
932
|
/**
|
|
925
933
|
* A discriminated union representing different types of property security outcomes.
|
|
926
934
|
*
|
|
927
|
-
*
|
|
935
|
+
* The type field determines which security outcome is represented:
|
|
928
936
|
* - "propertyMarkings": Successfully computed security markings for the property
|
|
929
937
|
* - "unsupportedPolicy": The property is backed by a restricted view that doesn't support property securities
|
|
930
938
|
* - "errorComputingSecurity": The server was unable to load the securities of the property
|
|
@@ -1592,12 +1600,13 @@ interface FetchPageSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends
|
|
|
1592
1600
|
* Gets a page of objects of this type, with a result wrapper
|
|
1593
1601
|
* @param args - Args to specify next page token and page size, if applicable
|
|
1594
1602
|
* @example
|
|
1595
|
-
*
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1603
|
+
* ```ts
|
|
1604
|
+
* const myObjs = await objectSet.fetchPage({
|
|
1605
|
+
* $pageSize: 10,
|
|
1606
|
+
* $nextPageToken: "nextPage",
|
|
1607
|
+
* });
|
|
1608
|
+
* const myObjsResult = myObjs.data;
|
|
1609
|
+
* ```
|
|
1601
1610
|
* @returns a page of objects
|
|
1602
1611
|
*/
|
|
1603
1612
|
<L extends PropertyKeys<Q> | (string & keyof RDPs), R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false, ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {}, PROPERTY_SECURITIES extends boolean = false>(args?: FetchPageArgs<Q, L, R, A, S, T, never, ORDER_BY_OPTIONS, PROPERTY_SECURITIES>): Promise<PageResult<MaybeScore<Osdk.Instance<Q, ExtractOptions<R, S, T, PROPERTY_SECURITIES>, NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>, SubSelectRDPs<RDPs, NonNullable<typeof args>>>, ORDER_BY_OPTIONS>>>;
|
|
@@ -1622,47 +1631,55 @@ interface FetchPageWithErrorsSignature<Q extends ObjectOrInterfaceDefinition, RD
|
|
|
1622
1631
|
* Gets a page of objects of this type, with a result wrapper
|
|
1623
1632
|
* @param args - Args to specify next page token and page size, if applicable
|
|
1624
1633
|
* @example
|
|
1625
|
-
*
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1634
|
+
* ```ts
|
|
1635
|
+
* const myObjs = await objectSet.fetchPage({
|
|
1636
|
+
* $pageSize: 10,
|
|
1637
|
+
* $nextPageToken: "nextPage",
|
|
1638
|
+
* });
|
|
1639
|
+
*
|
|
1640
|
+
* if (isOk(myObjs)) {
|
|
1641
|
+
* const myObjsResult = myObjs.value.data;
|
|
1642
|
+
* }
|
|
1643
|
+
* ```
|
|
1633
1644
|
* @returns a page of objects, wrapped in a result wrapper
|
|
1634
1645
|
*/
|
|
1635
1646
|
<L extends PropertyKeys<Q> | (string & keyof RDPs), R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false, ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {}>(args?: FetchPageArgs<Q, L, R, A, S, T, never, ORDER_BY_OPTIONS, PROPERTY_SECURITIES>): Promise<Result<PageResult<MaybeScore<Osdk.Instance<Q, ExtractOptions<R, S, T, PROPERTY_SECURITIES>, NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>, SubSelectRDPs<RDPs, NonNullable<typeof args>>>, ORDER_BY_OPTIONS>>>>;
|
|
1636
1647
|
}
|
|
1637
1648
|
interface Where<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1638
1649
|
/**
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1650
|
+
* Allows you to filter an object set with a given clause
|
|
1651
|
+
* @param clause - Takes a filter clause
|
|
1652
|
+
* @example
|
|
1653
|
+
* ```ts
|
|
1654
|
+
* await client(Office).where({
|
|
1655
|
+
* meetingRooms: { $contains: "Grand Central" },
|
|
1656
|
+
* meetingRoomCapacities: { $contains: 30 },
|
|
1657
|
+
* });
|
|
1658
|
+
* ```
|
|
1659
|
+
* @returns an objectSet
|
|
1660
|
+
*/
|
|
1648
1661
|
readonly where: (clause: WhereClause<MergeObjectSet<Q, RDPs>>) => this;
|
|
1649
1662
|
}
|
|
1650
1663
|
interface AsyncIterSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}, ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {}, PROPERTY_SECURITIES extends boolean = false> {
|
|
1651
1664
|
/**
|
|
1652
1665
|
* Returns an async iterator to load all objects of this type
|
|
1653
1666
|
* @example
|
|
1654
|
-
*
|
|
1655
|
-
*
|
|
1667
|
+
* ```ts
|
|
1668
|
+
* for await (const obj of myObjectSet.asyncIter()) {
|
|
1669
|
+
* // Handle obj
|
|
1656
1670
|
* }
|
|
1671
|
+
* ```
|
|
1657
1672
|
* @returns an async iterator to load all objects
|
|
1658
1673
|
*/
|
|
1659
1674
|
<X extends ValidAsyncIterArgs<Q, RDPs> = never>(args?: X): AsyncIterableIterator<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>;
|
|
1660
1675
|
/**
|
|
1661
1676
|
* Returns an async iterator to load all objects of this type
|
|
1662
1677
|
* @example
|
|
1663
|
-
*
|
|
1664
|
-
*
|
|
1678
|
+
* ```ts
|
|
1679
|
+
* for await (const obj of myObjectSet.asyncIter()) {
|
|
1680
|
+
* // Handle obj
|
|
1665
1681
|
* }
|
|
1682
|
+
* ```
|
|
1666
1683
|
* @returns an async iterator to load all objects
|
|
1667
1684
|
*/
|
|
1668
1685
|
<L extends PropertyKeys<Q> | (string & keyof RDPs), R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false, ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {}>(args?: AsyncIterArgs<Q, L, R, A, S, T, never, ORDER_BY_OPTIONS, PROPERTY_SECURITIES>): AsyncIterableIterator<MaybeScore<Osdk.Instance<Q, ExtractOptions<R, S, T, PROPERTY_SECURITIES>, NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>, SubSelectRDPs<RDPs, NonNullable<typeof args>>>, ORDER_BY_OPTIONS>>;
|
|
@@ -1685,22 +1702,23 @@ interface Aggregate<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1685
1702
|
* @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose
|
|
1686
1703
|
* whether or not you order your results. You can also specify a groupBy field to group your aggregations
|
|
1687
1704
|
* @example
|
|
1705
|
+
* ```ts
|
|
1688
1706
|
* const testAggregateCountWithGroups = await client(BoundariesUsState)
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1707
|
+
* .aggregate({
|
|
1708
|
+
* $select: {
|
|
1709
|
+
* $count: "unordered",
|
|
1710
|
+
* "latitude:max": "unordered",
|
|
1711
|
+
* "latitude:min": "unordered",
|
|
1712
|
+
* "latitude:avg": "unordered",
|
|
1713
|
+
* },
|
|
1714
|
+
* $groupBy: {
|
|
1715
|
+
* usState: "exact",
|
|
1716
|
+
* longitude: {
|
|
1717
|
+
* $fixedWidth: 10,
|
|
1718
|
+
* },
|
|
1719
|
+
* },
|
|
1720
|
+
* });
|
|
1721
|
+
* ```
|
|
1704
1722
|
* @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)
|
|
1705
1723
|
*/
|
|
1706
1724
|
readonly aggregate: <AO extends AggregateOpts<Q>>(req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>) => Promise<AggregationsResults<Q, AO>>;
|
|
@@ -1710,9 +1728,11 @@ interface SetArithmetic<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1710
1728
|
* Unions object sets together
|
|
1711
1729
|
* @param objectSets - objectSets you want to union with
|
|
1712
1730
|
* @example
|
|
1731
|
+
* ```ts
|
|
1713
1732
|
* const unionObjectSet = complexFilteredEmployeeObjectSet.union(
|
|
1714
|
-
|
|
1715
|
-
|
|
1733
|
+
* simpleFilteredEmployeeObjectSet,
|
|
1734
|
+
* );
|
|
1735
|
+
* ```
|
|
1716
1736
|
* @returns the unioned object set
|
|
1717
1737
|
*/
|
|
1718
1738
|
readonly union: (...objectSets: ReadonlyArray<CompileTimeMetadata<Q>["objectSet"]>) => this;
|
|
@@ -1720,9 +1740,11 @@ interface SetArithmetic<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1720
1740
|
* Computes the intersection of object sets
|
|
1721
1741
|
* @param objectSets - objectSets you want to intersect with
|
|
1722
1742
|
* @example
|
|
1743
|
+
* ```ts
|
|
1723
1744
|
* const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(
|
|
1724
|
-
|
|
1725
|
-
|
|
1745
|
+
* simpleFilteredEmployeeObjectSet,
|
|
1746
|
+
* );
|
|
1747
|
+
* ```
|
|
1726
1748
|
* @returns the intersected object set
|
|
1727
1749
|
*/
|
|
1728
1750
|
readonly intersect: (...objectSets: ReadonlyArray<CompileTimeMetadata<Q>["objectSet"]>) => this;
|
|
@@ -1730,9 +1752,11 @@ interface SetArithmetic<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1730
1752
|
* Computes the subtraction of object sets
|
|
1731
1753
|
* @param objectSets - objectSets you want to subtract from
|
|
1732
1754
|
* @example
|
|
1755
|
+
* ```ts
|
|
1733
1756
|
* const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(
|
|
1734
|
-
|
|
1735
|
-
|
|
1757
|
+
* simpleFilteredEmployeeObjectSet,
|
|
1758
|
+
* );
|
|
1759
|
+
* ```
|
|
1736
1760
|
* @returns the subtract object set
|
|
1737
1761
|
*/
|
|
1738
1762
|
readonly subtract: (...objectSets: ReadonlyArray<CompileTimeMetadata<Q>["objectSet"]>) => this;
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AttachmentUpload, M as MediaReference, a as MediaUpload, b as Media, c as Attachment, O as ObjectTypeDefinition, d as ObjectIdentifiers, e as OsdkObjectPrimaryKeyType, f as ObjectSet, I as InterfaceDefinition, C as CompileTimeMetadata, g as OsdkMetadata, R as ReleaseStatus, h as ObjectOrInterfaceDefinition, P as PropertyValueWireToClient, i as PrimaryKeyTypes, j as OsdkBase } from './ObjectSet-
|
|
2
|
-
export { k as Affix, l as AggregateOpts, m as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, n as AggregationClause, o as AggregationResultsWithGroups, p as AggregationResultsWithoutGroups, q as AggregationsResults, r as AllGroupByValues, s as AndWhereClause, t as AsyncIterArgs, u as AttachmentMetadata, v as Augment, w as Augments, B as BaseObjectSet, x as BaseWirePropertyTypes, y as ConvertProps, D as DatetimeFormat, z as DatetimeLocalizedFormat, E as DatetimeLocalizedFormatType, F as DatetimeStringFormat, G as DatetimeTimezone, H as DatetimeTimezoneStatic, J as DatetimeTimezoneUser, K as DerivedProperty, L as DistanceUnitMapping, N as DurationBaseValue, Q as DurationFormatStyle, S as DurationMapping, T as DurationPrecision, U as FetchLinksPageResult, V as FetchPageArgs, W as FetchPageResult, X as GeoFilterOptions, Y as GeoFilter_Intersects, Z as GeoFilter_Within, _ as GeotimeSeriesProperty, $ as GroupByClause, a0 as GroupByRange, a1 as HumanReadableFormat, a2 as InterfaceMetadata, a3 as IntervalRule, a4 as KnownType, a5 as LinkNames, a6 as LinkTypeApiNamesFor, a7 as LinkedType, a8 as MaybeScore, a9 as MediaMetadata, aa as MediaPropertyLocation, ab as MinimalDirectedObjectLinkInstance, ac as NotWhereClause, ad as NullabilityAdherence, ae as NumberFormatAffix, af as NumberFormatCurrency, ag as NumberFormatCurrencyStyle, ah as NumberFormatCustomUnit, ai as NumberFormatDuration, aj as NumberFormatFixedValues, ak as NumberFormatNotation, al as NumberFormatOptions, am as NumberFormatRatio, an as NumberFormatScale, ao as NumberFormatStandard, ap as NumberFormatStandardUnit, aq as NumberRatioType, ar as NumberRoundingMode, as as NumberScaleType, at as ObjectMetadata, au as ObjectSetArgs, av as ObjectSetSubscription, aw as ObjectSpecifier, ax as OrWhereClause, ay as Osdk, az as OsdkObjectCreatePropertyType, aA as OsdkObjectLinksObject, aB as OsdkObjectPropertyType, aC as PageResult, aD as PossibleWhereClauseFilters, aE as PrimaryKeyType, aF as PropertyBooleanFormattingRule, aG as PropertyDateFormattingRule, aH as PropertyDef, aI as PropertyKeys, aJ as PropertyKnownTypeFormattingRule, aK as PropertyMarkings, aL as PropertyNumberFormattingRule, aM as PropertyNumberFormattingRuleType, aN as PropertySecurity, aO as PropertyTimestampFormattingRule, aP as PropertyTypeReference, aQ as PropertyTypeReferenceOrStringConstant, aR as PropertyValueFormattingRule, aS as Result, aT as SelectArg, aU as SelectArgToKeys, aV as SimplePropertyDef, aW as SingleLinkAccessor, aX as SingleOsdkResult, aY as StringConstant, aZ as TimeCodeFormat, a_ as TimeSeriesPoint, a$ as TimeSeriesProperty, b0 as TimeSeriesQuery, b1 as TimeseriesDurationMapping, b2 as ValidAggregationKeys, b3 as VersionBound, b4 as WhereClause, b5 as WirePropertyTypes, b6 as isOk } from './ObjectSet-
|
|
1
|
+
import { A as AttachmentUpload, M as MediaReference, a as MediaUpload, b as Media, c as Attachment, O as ObjectTypeDefinition, d as ObjectIdentifiers, e as OsdkObjectPrimaryKeyType, f as ObjectSet, I as InterfaceDefinition, C as CompileTimeMetadata, g as OsdkMetadata, R as ReleaseStatus, h as ObjectOrInterfaceDefinition, P as PropertyValueWireToClient, i as PrimaryKeyTypes, j as OsdkBase } from './ObjectSet-UryvRSlB.cjs';
|
|
2
|
+
export { k as Affix, l as AggregateOpts, m as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, n as AggregationClause, o as AggregationResultsWithGroups, p as AggregationResultsWithoutGroups, q as AggregationsResults, r as AllGroupByValues, s as AndWhereClause, t as AsyncIterArgs, u as AttachmentMetadata, v as Augment, w as Augments, B as BaseObjectSet, x as BaseWirePropertyTypes, y as ConvertProps, D as DatetimeFormat, z as DatetimeLocalizedFormat, E as DatetimeLocalizedFormatType, F as DatetimeStringFormat, G as DatetimeTimezone, H as DatetimeTimezoneStatic, J as DatetimeTimezoneUser, K as DerivedProperty, L as DistanceUnitMapping, N as DurationBaseValue, Q as DurationFormatStyle, S as DurationMapping, T as DurationPrecision, U as FetchLinksPageResult, V as FetchPageArgs, W as FetchPageResult, X as GeoFilterOptions, Y as GeoFilter_Intersects, Z as GeoFilter_Within, _ as GeotimeSeriesProperty, $ as GroupByClause, a0 as GroupByRange, a1 as HumanReadableFormat, a2 as InterfaceMetadata, a3 as IntervalRule, a4 as KnownType, a5 as LinkNames, a6 as LinkTypeApiNamesFor, a7 as LinkedType, a8 as MaybeScore, a9 as MediaMetadata, aa as MediaPropertyLocation, ab as MinimalDirectedObjectLinkInstance, ac as NotWhereClause, ad as NullabilityAdherence, ae as NumberFormatAffix, af as NumberFormatCurrency, ag as NumberFormatCurrencyStyle, ah as NumberFormatCustomUnit, ai as NumberFormatDuration, aj as NumberFormatFixedValues, ak as NumberFormatNotation, al as NumberFormatOptions, am as NumberFormatRatio, an as NumberFormatScale, ao as NumberFormatStandard, ap as NumberFormatStandardUnit, aq as NumberRatioType, ar as NumberRoundingMode, as as NumberScaleType, at as ObjectMetadata, au as ObjectSetArgs, av as ObjectSetSubscription, aw as ObjectSpecifier, ax as OrWhereClause, ay as Osdk, az as OsdkObjectCreatePropertyType, aA as OsdkObjectLinksObject, aB as OsdkObjectPropertyType, aC as PageResult, aD as PossibleWhereClauseFilters, aE as PrimaryKeyType, aF as PropertyBooleanFormattingRule, aG as PropertyDateFormattingRule, aH as PropertyDef, aI as PropertyKeys, aJ as PropertyKnownTypeFormattingRule, aK as PropertyMarkings, aL as PropertyNumberFormattingRule, aM as PropertyNumberFormattingRuleType, aN as PropertySecurity, aO as PropertyTimestampFormattingRule, aP as PropertyTypeReference, aQ as PropertyTypeReferenceOrStringConstant, aR as PropertyValueFormattingRule, aS as Result, aT as SelectArg, aU as SelectArgToKeys, aV as SimplePropertyDef, aW as SingleLinkAccessor, aX as SingleOsdkResult, aY as StringConstant, aZ as TimeCodeFormat, a_ as TimeSeriesPoint, a$ as TimeSeriesProperty, b0 as TimeSeriesQuery, b1 as TimeseriesDurationMapping, b2 as ValidAggregationKeys, b3 as VersionBound, b4 as WhereClause, b5 as WirePropertyTypes, b6 as isOk } from './ObjectSet-UryvRSlB.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DerivedLinkConfig, k as NullabilityOp, l as ShapeDerivedLinkDef, m as ShapeLinkObjectSetDef, n as ShapeLinkOrderBy, o as ShapeLinkSegment, p as ShapeLinkSetOperation, q as ShapePropertyConfig } from '../shapes-internal-
|
|
2
|
-
import '../ObjectSet-
|
|
1
|
+
export { D as DerivedLinkConfig, k as NullabilityOp, l as ShapeDerivedLinkDef, m as ShapeLinkObjectSetDef, n as ShapeLinkOrderBy, o as ShapeLinkSegment, p as ShapeLinkSetOperation, q as ShapePropertyConfig } from '../shapes-internal-DoJuuU1_.cjs';
|
|
2
|
+
import '../ObjectSet-UryvRSlB.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { h as ObjectOrInterfaceDefinition, aI as PropertyKeys, M as MediaReference, ad as NullabilityAdherence, aT as SelectArg, ay as Osdk, b7 as ExtractOptions, V as FetchPageArgs, W as FetchPageResult, j as OsdkBase, b8 as Just } from '../ObjectSet-
|
|
2
|
-
export { b9 as MinimalObjectSet } from '../ObjectSet-
|
|
3
|
-
import { P as PropertyType, S as ShapeLinkBuilder, a as ShapeDefinition, R as RequiredProperty, b as ShapeBuilder } from '../shapes-internal-
|
|
4
|
-
export { L as LinkLoadConfig, c as LinkStatus, N as NullabilityViolation, d as ShapeBaseType, e as ShapeDerivedLinks, f as ShapeInstance, g as ShapeLinkResult, h as ShapeNullabilityError, i as SourcePrimaryKeySymbol, j as isSourcePkSymbol } from '../shapes-internal-
|
|
1
|
+
import { h as ObjectOrInterfaceDefinition, aI as PropertyKeys, M as MediaReference, ad as NullabilityAdherence, aT as SelectArg, ay as Osdk, b7 as ExtractOptions, V as FetchPageArgs, W as FetchPageResult, j as OsdkBase, b8 as Just } from '../ObjectSet-UryvRSlB.cjs';
|
|
2
|
+
export { b9 as MinimalObjectSet } from '../ObjectSet-UryvRSlB.cjs';
|
|
3
|
+
import { P as PropertyType, S as ShapeLinkBuilder, a as ShapeDefinition, R as RequiredProperty, b as ShapeBuilder } from '../shapes-internal-DoJuuU1_.cjs';
|
|
4
|
+
export { L as LinkLoadConfig, c as LinkStatus, N as NullabilityViolation, d as ShapeBaseType, e as ShapeDerivedLinks, f as ShapeInstance, g as ShapeLinkResult, h as ShapeNullabilityError, i as SourcePrimaryKeySymbol, j as isSourcePkSymbol } from '../shapes-internal-DoJuuU1_.cjs';
|
|
5
5
|
import 'type-fest';
|
|
6
6
|
import 'geojson';
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as ObjectOrInterfaceDefinition, b4 as WhereClause, aI as PropertyKeys, C as CompileTimeMetadata, a5 as LinkNames, a7 as LinkedType, j as OsdkBase } from './ObjectSet-
|
|
1
|
+
import { h as ObjectOrInterfaceDefinition, b4 as WhereClause, aI as PropertyKeys, C as CompileTimeMetadata, a5 as LinkNames, a7 as LinkedType, j as OsdkBase } from './ObjectSet-UryvRSlB.cjs';
|
|
2
2
|
|
|
3
3
|
declare const SourcePrimaryKeySymbol: unique symbol;
|
|
4
4
|
declare function isSourcePkSymbol(value: unknown): value is symbol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Definitions.js","names":[],"sources":["Definitions.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n GetClientPropertyValueFromWire,\n GetCreatePropertyValueFromWire,\n} from \"./mapping/PropertyValueMapping.js\";\nimport type { ObjectMetadata } from \"./ontology/ObjectTypeDefinition.js\";\n\ntype MaybeArray<T extends { multiplicity?: boolean | undefined }, U> =\n T[\"multiplicity\"] extends true ? Array<U> : U;\n\ntype MaybeNullable<T extends ObjectMetadata.Property, U> = T[\"nullable\"] extends\n true ? U | undefined\n : U;\n\n/**\n * @param
|
|
1
|
+
{"version":3,"file":"Definitions.js","names":[],"sources":["Definitions.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n GetClientPropertyValueFromWire,\n GetCreatePropertyValueFromWire,\n} from \"./mapping/PropertyValueMapping.js\";\nimport type { ObjectMetadata } from \"./ontology/ObjectTypeDefinition.js\";\n\ntype MaybeArray<T extends { multiplicity?: boolean | undefined }, U> =\n T[\"multiplicity\"] extends true ? Array<U> : U;\n\ntype MaybeNullable<T extends ObjectMetadata.Property, U> = T[\"nullable\"] extends\n true ? U | undefined\n : U;\n\n/**\n * @param T - ObjectMetadata.Property in literal form\n * @param STRICTLY_ENFORCE_NULLABLE - S for strict. If false, always `|undefined`\n */\nexport type OsdkObjectPropertyType<\n T extends ObjectMetadata.Property,\n STRICTLY_ENFORCE_NULLABLE extends boolean = true,\n> = STRICTLY_ENFORCE_NULLABLE extends false ?\n | MaybeArray<T, GetClientPropertyValueFromWire<T[\"type\"]>>\n | undefined\n : MaybeNullable<\n T,\n MaybeArray<T, GetClientPropertyValueFromWire<T[\"type\"]>>\n >;\n\n/**\n * @param T - ObjectMetadata.Property in literal form\n */\nexport type OsdkObjectPropertyTypeNotUndefined<\n T extends ObjectMetadata.Property,\n> = MaybeArray<T, GetClientPropertyValueFromWire<T[\"type\"]>>;\n\n/**\n * @param T - ObjectMetadata.Property in literal form\n * @param STRICTLY_ENFORCE_NULLABLE - S for strict. If false, always `|undefined`\n */\nexport type OsdkObjectCreatePropertyType<\n T extends ObjectMetadata.Property,\n STRICTLY_ENFORCE_NULLABLE extends boolean = true,\n> = STRICTLY_ENFORCE_NULLABLE extends false ?\n | MaybeArray<T, GetCreatePropertyValueFromWire<T[\"type\"]>>\n | undefined\n : MaybeNullable<\n T,\n MaybeArray<T, GetCreatePropertyValueFromWire<T[\"type\"]>>\n >;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertySecurity.js","names":[],"sources":["PropertySecurity.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A discriminated union representing different types of property security outcomes.\n *\n *
|
|
1
|
+
{"version":3,"file":"PropertySecurity.js","names":[],"sources":["PropertySecurity.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A discriminated union representing different types of property security outcomes.\n *\n * The type field determines which security outcome is represented:\n * - \"propertyMarkings\": Successfully computed security markings for the property\n * - \"unsupportedPolicy\": The property is backed by a restricted view that doesn't support property securities\n * - \"errorComputingSecurity\": The server was unable to load the securities of the property\n */\nexport type PropertySecurity =\n | ({\n type: \"propertyMarkings\";\n } & PropertyMarkings)\n | ({\n type: \"unsupportedPolicy\";\n })\n | ({\n type: \"errorComputingSecurity\";\n });\n\n/**\n * All marking requirements applicable to a property value.\n *\n * Markings represent security classifications or access control requirements\n * that must be satisfied to access the property value.\n */\nexport interface PropertyMarkings {\n /**\n * The conjunctive set of markings required to access the property value.\n * All markings from a conjunctive set must be met for access.\n */\n conjunctive?: Array<MarkingId>;\n /**\n * The disjunctive set of markings required to access the property value.\n *\n * Disjunctive markings are represented as a conjunctive list of disjunctive sets.\n * The top-level array is a conjunction of sets, where each inner array should be\n * treated as a unit where any marking within the set can satisfy the set.\n * All sets within the top level array must be satisfied.\n */\n disjunctive?: Array<Array<MarkingId>>;\n /**\n * The conjunctive set of markings for the container of this property value,\n * such as the project of a dataset. These markings may differ from the marking\n * on the actual property value, but still must be satisfied for accessing the property.\n *\n * All markings from a conjunctive set must be met for access.\n */\n containerConjunctive?: Array<MarkingId>;\n /**\n * The disjunctive set of markings for the container of this property value,\n * such as the project of a dataset. These markings may differ from the marking\n * on the actual property value, but still must be satisfied for accessing the property.\n *\n * Disjunctive markings are represented as a conjunctive list of disjunctive sets.\n * The top-level array is a conjunction of sets, where each inner array should be\n * treated as a unit where any marking within the set can satisfy the set.\n * All sets within the top level array must be satisfied.\n */\n containerDisjunctive?: Array<Array<MarkingId>>;\n}\n\n/**\n * A unique identifier for a security marking.\n * Markings represent security classifications or access control requirements.\n */\nexport type MarkingId = string;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedProperty } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n ObjectSetArgs,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { 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 {\n ExtractAllPropertiesOption,\n ExtractOptions,\n ExtractRidOption,\n MaybeScore,\n Osdk,\n} from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type {\n LinkTypeApiNamesFor,\n MinimalDirectedObjectLinkInstance,\n} from \"./ObjectSetLinks.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef> = {},\n> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;\n\ntype ExtractRdp<\n D extends\n | BaseObjectSet<any>\n | Record<string, SimplePropertyDef>,\n> = [D] extends [never] ? {}\n : D extends BaseObjectSet<any> ? {}\n : D extends Record<string, SimplePropertyDef> ? D\n : {};\n\ntype MaybeSimplifyPropertyKeys<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;\n\ntype SubSelectKeysHelper<\n Q extends ObjectOrInterfaceDefinition,\n L extends string,\n> = [L] extends [never] ? PropertyKeys<Q>\n : PropertyKeys<Q> extends L ? PropertyKeys<Q>\n : L & PropertyKeys<Q>;\n\ntype SubSelectKeys<\n Q extends ObjectOrInterfaceDefinition,\n X extends SelectArg<Q, PropertyKeys<Q>, any, any, any, any> = never,\n> = SubSelectKeysHelper<Q, Extract$Select<X>>;\n\ntype NOOP<T> = T extends (...args: any[]) => any ? T\n : T extends abstract new(...args: any[]) => any ? T\n : { [K in keyof T]: T[K] };\n\ntype SubSelectRDPsHelper<\n X extends ValidFetchPageArgs<any, any, any> | ValidAsyncIterArgs<any, any>,\n DEFAULT extends string,\n> = [X] extends [never] ? DEFAULT\n : (X[\"$select\"] & string[])[number] & DEFAULT;\n\ntype SubSelectRDPs<\n RDPs extends Record<string, SimplePropertyDef>,\n X extends ValidFetchPageArgs<any, RDPs, any> | ValidAsyncIterArgs<any, RDPs>,\n> = [RDPs] extends [never] ? never\n : NOOP<{ [K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K] }>;\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs, ORDER_BY_OPTIONS>,\n Where<Q, RDPs>,\n AsyncIterLinks<Q>,\n Subscribe<MergeObjectSet<Q, RDPs>>\n{\n}\n\nexport type ExtractOptions2<\n X extends FetchPageArgs<any, any, any, any, any, any, any>,\n> = [X] extends [never] ? never\n :\n | ExtractRidOption<X[\"$includeRid\"] extends true ? true : false>\n | ExtractAllPropertiesOption<\n X[\"$includeAllBaseObjectProperties\"] extends true ? true : false\n >;\n\ntype Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<\n X[\"$select\"]\n>[number];\n\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly fetchPage: FetchPageSignature<Q, RDPs>;\n readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;\n}\n\ntype ValidFetchPageArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>>,\n> = ObjectSetArgs.FetchPage<\n Q,\n PropertyKeys<Q>,\n boolean,\n string & keyof RDPs,\n ORDER_BY_OPTIONS\n>;\n\ntype ValidAsyncIterArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> =\n | ObjectSetArgs.AsyncIter<\n Q,\n PropertyKeys<Q>,\n false,\n string & keyof RDPs\n >\n | AsyncIterArgs<\n Q,\n never,\n any,\n any,\n any,\n true,\n string & keyof RDPs\n >;\n\ninterface FetchPageSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {},\n PROPERTY_SECURITIES extends boolean = false,\n >(\n args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): Promise<\n PageResult<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >\n >;\n}\n\ninterface NearestNeighbors<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Finds the nearest neighbors for a given text or vector within the object set.\n *\n * @param query - Queries support either a vector matching the embedding model defined on the property, or text that is\n automatically embedded.\n * @param numNeighbors - The number of objects to return. If the number of documents in the objectType is less than the provided\n value, all objects will be returned. This value is limited to 1 ≤ numNeighbors ≥ 500.\n * @param property - The property key with a defined embedding model to search over.\n *\n * @returns An object set containing the `numNeighbors` nearest neighbors. To return the objects ordered by relevance and each\n * objects associated score, specify \"relevance\" in the orderBy.\n */\n\n readonly nearestNeighbors: (\n query: string | number[],\n numNeighbors: number,\n property: PropertyKeys.Filtered<Q, \"vector\">,\n ) => this;\n}\n\ninterface FetchPageWithErrorsSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n PROPERTY_SECURITIES extends boolean = false,\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {},\n >(\n args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): Promise<\n Result<\n PageResult<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIterSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n PROPERTY_SECURITIES extends boolean = false,\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n <X extends ValidAsyncIterArgs<Q, RDPs> = never>(\n args?: X,\n ): AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions2<X>,\n SubSelectKeys<Q, X>,\n SubSelectRDPs<RDPs, X>\n >\n >;\n\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n >(\n args?: AsyncIterArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): AsyncIterableIterator<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> {\n asyncIter: AsyncIterSignature<Q, RDPs, ORDER_BY_OPTIONS>;\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.Creator<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends\n | BaseObjectSet<Q>\n | Record<string, SimplePropertyDef> = never,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, ExtractRdp<UNUSED_OR_RDP>>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOneSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n PROPERTY_SECURITIES extends boolean = false,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>,\n ): Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, false, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >;\n}\n\ninterface FetchOneWithErrorsSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n PROPERTY_SECURITIES extends boolean = false,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>,\n ): Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, false, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >\n >;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;\n fetchOneWithErrors: Q extends ObjectTypeDefinition\n ? FetchOneWithErrorsSignature<Q, RDPs>\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n const R extends boolean = false,\n >(\n listener: ObjectSetSubscription.Listener<Q, P, R>,\n opts?: ObjectSetSubscription.Options<Q, P, R>,\n ) => { unsubscribe: () => void };\n}\n\ninterface NarrowToType<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Casts the object set to the specified object type or interface type.\n * Any downstream object set operations (e.g. where, fetchPage, aggregate) will be\n * performed on the specified type. Objects from the original object set that do not\n * implement the specified interface or match the specified object set will be filtered out.\n * @param type - The object type you want to cast to.\n * @returns an object set of the specified type.\n */\n readonly narrowToType: <\n CONVERT_TO extends RestrictToImplementingObjectTypes<Q>,\n >(\n type: CONVERT_TO,\n ) => ObjectSet<CONVERT_TO>;\n}\n\ntype RestrictToImplementingObjectTypes<T extends ObjectOrInterfaceDefinition> =\n T extends ObjectTypeDefinition ? ExtractImplementedInterfaces<T>\n : T extends InterfaceDefinition ? ExtractImplementingTypes<T>\n : never;\n\ntype ExtractImplementedInterfaces<T extends ObjectTypeDefinition> =\n CompileTimeMetadata<T> extends { implements: ReadonlyArray<infer API_NAME> }\n ? API_NAME extends string ? InterfaceDefinition & { apiName: API_NAME }\n : never\n : never;\n\ntype ExtractImplementingTypes<T extends InterfaceDefinition> =\n CompileTimeMetadata<T> extends\n { implementedBy: ReadonlyArray<infer API_NAME extends string> }\n ? (ObjectTypeDefinition & { apiName: API_NAME }) | InterfaceDefinition\n : InterfaceDefinition;\n\ninterface AsyncIterLinks<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Batch load links on an object set. This is an experimental method that may change while in beta.\n * Use this method in conjunction with `.asyncIter()` and `.pivotTo(...).asyncIter()` to build an\n * object graph in memory.\n *\n * Please keep these limitations in mind:\n * - Links returned may be stale. For example, primary keys returned by this endpoint may not exist anymore.\n * - The backend API fetches pages of *n* objects at a time. If, for any page of *n* objects, there are more\n * than 100,000 links present, results are limited to 100,000 links and should be considered partial.\n * - This method does not support OSv1 links and will throw an exception if links provided are backed by OSv1.\n * - This method currently does not support interface links, but support will be added in the near future.\n */\n readonly experimental_asyncIterLinks: <\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n links: LINK_TYPE_API_NAME[],\n ) => AsyncIterableIterator<\n MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>\n >;\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition & Q,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> extends\n MinimalObjectSet<Q, D, ORDER_BY_OPTIONS>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<Q>,\n FetchOne<Q, D>,\n NearestNeighbors<Q>,\n NarrowToType<Q>\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 ObjectSetArgs,\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 {\n ExtractAllPropertiesOption,\n ExtractOptions,\n ExtractRidOption,\n MaybeScore,\n Osdk,\n} from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type {\n LinkTypeApiNamesFor,\n MinimalDirectedObjectLinkInstance,\n} from \"./ObjectSetLinks.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef> = {},\n> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;\n\ntype ExtractRdp<\n D extends\n | BaseObjectSet<any>\n | Record<string, SimplePropertyDef>,\n> = [D] extends [never] ? {}\n : D extends BaseObjectSet<any> ? {}\n : D extends Record<string, SimplePropertyDef> ? D\n : {};\n\ntype MaybeSimplifyPropertyKeys<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;\n\ntype SubSelectKeysHelper<\n Q extends ObjectOrInterfaceDefinition,\n L extends string,\n> = [L] extends [never] ? PropertyKeys<Q>\n : PropertyKeys<Q> extends L ? PropertyKeys<Q>\n : L & PropertyKeys<Q>;\n\ntype SubSelectKeys<\n Q extends ObjectOrInterfaceDefinition,\n X extends SelectArg<Q, PropertyKeys<Q>, any, any, any, any> = never,\n> = SubSelectKeysHelper<Q, Extract$Select<X>>;\n\ntype NOOP<T> = T extends (...args: any[]) => any ? T\n : T extends abstract new(...args: any[]) => any ? T\n : { [K in keyof T]: T[K] };\n\ntype SubSelectRDPsHelper<\n X extends ValidFetchPageArgs<any, any, any> | ValidAsyncIterArgs<any, any>,\n DEFAULT extends string,\n> = [X] extends [never] ? DEFAULT\n : (X[\"$select\"] & string[])[number] & DEFAULT;\n\ntype SubSelectRDPs<\n RDPs extends Record<string, SimplePropertyDef>,\n X extends ValidFetchPageArgs<any, RDPs, any> | ValidAsyncIterArgs<any, RDPs>,\n> = [RDPs] extends [never] ? never\n : NOOP<{ [K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K] }>;\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs, ORDER_BY_OPTIONS>,\n Where<Q, RDPs>,\n AsyncIterLinks<Q>,\n Subscribe<MergeObjectSet<Q, RDPs>>\n{\n}\n\nexport type ExtractOptions2<\n X extends FetchPageArgs<any, any, any, any, any, any, any>,\n> = [X] extends [never] ? never\n :\n | ExtractRidOption<X[\"$includeRid\"] extends true ? true : false>\n | ExtractAllPropertiesOption<\n X[\"$includeAllBaseObjectProperties\"] extends true ? true : false\n >;\n\ntype Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<\n X[\"$select\"]\n>[number];\n\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly fetchPage: FetchPageSignature<Q, RDPs>;\n readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;\n}\n\ntype ValidFetchPageArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>>,\n> = ObjectSetArgs.FetchPage<\n Q,\n PropertyKeys<Q>,\n boolean,\n string & keyof RDPs,\n ORDER_BY_OPTIONS\n>;\n\ntype ValidAsyncIterArgs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> =\n | ObjectSetArgs.AsyncIter<\n Q,\n PropertyKeys<Q>,\n false,\n string & keyof RDPs\n >\n | AsyncIterArgs<\n Q,\n never,\n any,\n any,\n any,\n true,\n string & keyof RDPs\n >;\n\ninterface FetchPageSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * ```ts\n * const myObjs = await objectSet.fetchPage({\n * $pageSize: 10,\n * $nextPageToken: \"nextPage\",\n * });\n * const myObjsResult = myObjs.data;\n * ```\n * @returns a page of objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {},\n PROPERTY_SECURITIES extends boolean = false,\n >(\n args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): Promise<\n PageResult<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >\n >;\n}\n\ninterface NearestNeighbors<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Finds the nearest neighbors for a given text or vector within the object set.\n *\n * @param query - Queries support either a vector matching the embedding model defined on the property, or text that is\n automatically embedded.\n * @param numNeighbors - The number of objects to return. If the number of documents in the objectType is less than the provided\n value, all objects will be returned. This value is limited to 1 ≤ numNeighbors ≥ 500.\n * @param property - The property key with a defined embedding model to search over.\n *\n * @returns An object set containing the `numNeighbors` nearest neighbors. To return the objects ordered by relevance and each\n * objects associated score, specify \"relevance\" in the orderBy.\n */\n\n readonly nearestNeighbors: (\n query: string | number[],\n numNeighbors: number,\n property: PropertyKeys.Filtered<Q, \"vector\">,\n ) => this;\n}\n\ninterface FetchPageWithErrorsSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n PROPERTY_SECURITIES extends boolean = false,\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 * ```ts\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 * ```\n * @returns a page of objects, wrapped in a result wrapper\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<L> = {},\n >(\n args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): Promise<\n Result<\n PageResult<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\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 * ```ts\n * await client(Office).where({\n * meetingRooms: { $contains: \"Grand Central\" },\n * meetingRoomCapacities: { $contains: 30 },\n * });\n * ```\n * @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIterSignature<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n PROPERTY_SECURITIES extends boolean = false,\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * ```ts\n * for await (const obj of myObjectSet.asyncIter()) {\n * // Handle obj\n * }\n * ```\n * @returns an async iterator to load all objects\n */\n <X extends ValidAsyncIterArgs<Q, RDPs> = never>(\n args?: X,\n ): AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions2<X>,\n SubSelectKeys<Q, X>,\n SubSelectRDPs<RDPs, X>\n >\n >;\n\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * ```ts\n * for await (const obj of myObjectSet.asyncIter()) {\n * // Handle obj\n * }\n * ```\n * @returns an async iterator to load all objects\n */\n <\n L extends PropertyKeys<Q> | (string & keyof RDPs),\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n >(\n args?: AsyncIterArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >,\n ): AsyncIterableIterator<\n MaybeScore<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, T, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, NonNullable<typeof args>>>,\n SubSelectRDPs<RDPs, NonNullable<typeof args>>\n >,\n ORDER_BY_OPTIONS\n >\n >;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> {\n asyncIter: AsyncIterSignature<Q, RDPs, ORDER_BY_OPTIONS>;\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.Creator<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends\n | BaseObjectSet<Q>\n | Record<string, SimplePropertyDef> = never,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, ExtractRdp<UNUSED_OR_RDP>>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * ```ts\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 * ```ts\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n * simpleFilteredEmployeeObjectSet,\n * );\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 * ```ts\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n * simpleFilteredEmployeeObjectSet,\n * );\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 * ```ts\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n * simpleFilteredEmployeeObjectSet,\n * );\n * ```\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOneSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n PROPERTY_SECURITIES extends boolean = false,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>,\n ): Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, false, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >;\n}\n\ninterface FetchOneWithErrorsSignature<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n <\n const L extends PropertyKeys<Q> | (string & keyof RDPs),\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n PROPERTY_SECURITIES extends boolean = false,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>,\n ): Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S, false, PROPERTY_SECURITIES>,\n NoInfer<SubSelectKeys<Q, { $select: Array<L> }>>,\n SubSelectRDPs<RDPs, { $select: Array<L> }>\n >\n >\n >;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;\n fetchOneWithErrors: Q extends ObjectTypeDefinition\n ? FetchOneWithErrorsSignature<Q, RDPs>\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n const R extends boolean = false,\n >(\n listener: ObjectSetSubscription.Listener<Q, P, R>,\n opts?: ObjectSetSubscription.Options<Q, P, R>,\n ) => { unsubscribe: () => void };\n}\n\ninterface NarrowToType<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Casts the object set to the specified object type or interface type.\n * Any downstream object set operations (e.g. where, fetchPage, aggregate) will be\n * performed on the specified type. Objects from the original object set that do not\n * implement the specified interface or match the specified object set will be filtered out.\n * @param type - The object type you want to cast to.\n * @returns an object set of the specified type.\n */\n readonly narrowToType: <\n CONVERT_TO extends RestrictToImplementingObjectTypes<Q>,\n >(\n type: CONVERT_TO,\n ) => ObjectSet<CONVERT_TO>;\n}\n\ntype RestrictToImplementingObjectTypes<T extends ObjectOrInterfaceDefinition> =\n T extends ObjectTypeDefinition ? ExtractImplementedInterfaces<T>\n : T extends InterfaceDefinition ? ExtractImplementingTypes<T>\n : never;\n\ntype ExtractImplementedInterfaces<T extends ObjectTypeDefinition> =\n CompileTimeMetadata<T> extends { implements: ReadonlyArray<infer API_NAME> }\n ? API_NAME extends string ? InterfaceDefinition & { apiName: API_NAME }\n : never\n : never;\n\ntype ExtractImplementingTypes<T extends InterfaceDefinition> =\n CompileTimeMetadata<T> extends\n { implementedBy: ReadonlyArray<infer API_NAME extends string> }\n ? (ObjectTypeDefinition & { apiName: API_NAME }) | InterfaceDefinition\n : InterfaceDefinition;\n\ninterface AsyncIterLinks<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Batch load links on an object set. This is an experimental method that may change while in beta.\n * Use this method in conjunction with `.asyncIter()` and `.pivotTo(...).asyncIter()` to build an\n * object graph in memory.\n *\n * Please keep these limitations in mind:\n * - Links returned may be stale. For example, primary keys returned by this endpoint may not exist anymore.\n * - The backend API fetches pages of *n* objects at a time. If, for any page of *n* objects, there are more\n * than 100,000 links present, results are limited to 100,000 links and should be considered partial.\n * - This method does not support OSv1 links and will throw an exception if links provided are backed by OSv1.\n * - This method currently does not support interface links, but support will be added in the near future.\n */\n readonly experimental_asyncIterLinks: <\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n links: LINK_TYPE_API_NAME[],\n ) => AsyncIterableIterator<\n MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>\n >;\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition & Q,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<PropertyKeys<Q>> = {},\n> extends\n MinimalObjectSet<Q, D, ORDER_BY_OPTIONS>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<Q>,\n FetchOne<Q, D>,\n NearestNeighbors<Q>,\n NarrowToType<Q>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeseries.js","names":["TimeDurationMapping","TimeseriesDurationMapping"],"sources":["timeseries.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 { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\n\nexport type TimeSeriesQuery =\n | {\n $before: number;\n $unit: keyof typeof TimeseriesDurationMapping;\n $after?: never;\n $startTime?: never;\n $endTime?: never;\n }\n | {\n $after: number;\n $unit: keyof typeof TimeseriesDurationMapping;\n $before?: never;\n $startTime?: never;\n $endTime?: never;\n }\n | {\n $startTime: string;\n $endTime?: string;\n $before?: never;\n $after?: never;\n $unit?: never;\n }\n | {\n $startTime?: string;\n $endTime: string;\n $before?: never;\n $after?: never;\n $unit?: never;\n };\n\nexport type TimeseriesDurationUnits =\n | \"YEARS\"\n | \"MONTHS\"\n | \"WEEKS\"\n | \"DAYS\"\n | \"HOURS\"\n | \"MINUTES\"\n | \"SECONDS\"\n | \"MILLISECONDS\";\n\nexport const TimeseriesDurationMapping: {\n sec: \"SECONDS\";\n seconds: \"SECONDS\";\n min: \"MINUTES\";\n minute: \"MINUTES\";\n minutes: \"MINUTES\";\n hr: \"HOURS\";\n hrs: \"HOURS\";\n hour: \"HOURS\";\n hours: \"HOURS\";\n day: \"DAYS\";\n days: \"DAYS\";\n wk: \"WEEKS\";\n week: \"WEEKS\";\n weeks: \"WEEKS\";\n mos: \"MONTHS\";\n month: \"MONTHS\";\n months: \"MONTHS\";\n yr: \"YEARS\";\n year: \"YEARS\";\n years: \"YEARS\";\n ms: \"MILLISECONDS\";\n milliseconds: \"MILLISECONDS\";\n} = {\n \"ms\": \"MILLISECONDS\",\n \"milliseconds\": \"MILLISECONDS\",\n ...TimeDurationMapping,\n} satisfies Record<string, TimeseriesDurationUnits>;\n\nexport interface TimeSeriesPoint<T extends string | number | GeoJSON.Point> {\n time: string;\n value: T;\n}\n\nexport interface TimeSeriesProperty<T extends number | string> {\n /**\n * Queries the first point of the Timeseries\n */\n readonly getFirstPoint: () => Promise<TimeSeriesPoint<T>>;\n /**\n * Queries the last point of the Timeseries\n */\n readonly getLastPoint: () => Promise<TimeSeriesPoint<T>>;\n /**\n
|
|
1
|
+
{"version":3,"file":"timeseries.js","names":["TimeDurationMapping","TimeseriesDurationMapping"],"sources":["timeseries.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 { TimeDurationMapping } from \"../mapping/DurationMapping.js\";\n\nexport type TimeSeriesQuery =\n | {\n $before: number;\n $unit: keyof typeof TimeseriesDurationMapping;\n $after?: never;\n $startTime?: never;\n $endTime?: never;\n }\n | {\n $after: number;\n $unit: keyof typeof TimeseriesDurationMapping;\n $before?: never;\n $startTime?: never;\n $endTime?: never;\n }\n | {\n $startTime: string;\n $endTime?: string;\n $before?: never;\n $after?: never;\n $unit?: never;\n }\n | {\n $startTime?: string;\n $endTime: string;\n $before?: never;\n $after?: never;\n $unit?: never;\n };\n\nexport type TimeseriesDurationUnits =\n | \"YEARS\"\n | \"MONTHS\"\n | \"WEEKS\"\n | \"DAYS\"\n | \"HOURS\"\n | \"MINUTES\"\n | \"SECONDS\"\n | \"MILLISECONDS\";\n\nexport const TimeseriesDurationMapping: {\n sec: \"SECONDS\";\n seconds: \"SECONDS\";\n min: \"MINUTES\";\n minute: \"MINUTES\";\n minutes: \"MINUTES\";\n hr: \"HOURS\";\n hrs: \"HOURS\";\n hour: \"HOURS\";\n hours: \"HOURS\";\n day: \"DAYS\";\n days: \"DAYS\";\n wk: \"WEEKS\";\n week: \"WEEKS\";\n weeks: \"WEEKS\";\n mos: \"MONTHS\";\n month: \"MONTHS\";\n months: \"MONTHS\";\n yr: \"YEARS\";\n year: \"YEARS\";\n years: \"YEARS\";\n ms: \"MILLISECONDS\";\n milliseconds: \"MILLISECONDS\";\n} = {\n \"ms\": \"MILLISECONDS\",\n \"milliseconds\": \"MILLISECONDS\",\n ...TimeDurationMapping,\n} satisfies Record<string, TimeseriesDurationUnits>;\n\nexport interface TimeSeriesPoint<T extends string | number | GeoJSON.Point> {\n time: string;\n value: T;\n}\n\nexport interface TimeSeriesProperty<T extends number | string> {\n /**\n * Queries the first point of the Timeseries\n */\n readonly getFirstPoint: () => Promise<TimeSeriesPoint<T>>;\n /**\n * Queries the last point of the Timeseries\n */\n readonly getLastPoint: () => Promise<TimeSeriesPoint<T>>;\n /**\n * Loads all points, within the given time range if that's provided\n * @param query - a query representing either an absolute or relative range of time\n * @example\n * ```ts\n * const points = await employee.employeeStatus?.getAllPoints({\n * $after: 1,\n * $unit: \"month\",\n * });\n * ```\n */\n readonly getAllPoints: (\n query?: TimeSeriesQuery,\n ) => Promise<Array<TimeSeriesPoint<T>>>;\n /**\n * Returns an async iterator to load all points\n * within the given time range if that's provided\n * @param query - a query representing either an absolute or relative range of time\n * @example\n * ```ts\n * const iterator = employee.employeeStatus?.asyncIter({\n * $after: 1,\n * $unit: \"month\",\n * });\n * for await (const point of iterator) {\n * // Handle time series point\n * }\n * ```\n */\n readonly asyncIterPoints: (\n query?: TimeSeriesQuery,\n ) => AsyncGenerator<TimeSeriesPoint<T>>;\n}\n\nexport interface GeotimeSeriesProperty<T extends GeoJSON.Point> {\n /**\n * Queries the last point of the Geotime series\n */\n readonly getLatestValue: () => Promise<TimeSeriesPoint<T> | undefined>;\n /**\n * Loads all points, within the given time range if that's provided\n * @param query - a query representing either an absolute or relative range of time\n * @example\n * ```ts\n * const points = await employee.employeeStatus?.getAllPoints({\n * $after: 1,\n * $unit: \"month\",\n * });\n * ```\n */\n readonly getAllValues: (\n query?: TimeSeriesQuery,\n ) => Promise<Array<TimeSeriesPoint<T>>>;\n /**\n * Returns an async iterator to load all points\n * within the given time range if that's provided\n * @param query - a query representing either an absolute or relative range of time\n * @example\n * ```ts\n * const iterator = employee.employeeStatus?.asyncIter({\n * $after: 1,\n * $unit: \"month\",\n * });\n * for await (const point of iterator) {\n * // Handle time series point\n * }\n * ```\n */\n readonly asyncIterValues: (\n query?: TimeSeriesQuery,\n ) => AsyncGenerator<TimeSeriesPoint<T>>;\n\n /**\n * The most recently fetched value for the latest point in the GTSR.\n * This will not be loaded automatically upon object load, but will be refreshed every time\n * getLatestValue() is called\n */\n readonly lastFetchedValue: TimeSeriesPoint<T> | undefined;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,+BAA+B;AA0CnE,OAAO,MAAMC,yBAuBZ,GAAG;EACF,IAAI,EAAE,cAAc;EACpB,cAAc,EAAE,cAAc;EAC9B,GAAGD;AACL,CAAmD","ignoreList":[]}
|
|
@@ -11,20 +11,20 @@ type MaybeNullable<
|
|
|
11
11
|
U
|
|
12
12
|
> = T["nullable"] extends true ? U | undefined : U;
|
|
13
13
|
/**
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
14
|
+
* @param T - ObjectMetadata.Property in literal form
|
|
15
|
+
* @param STRICTLY_ENFORCE_NULLABLE - S for strict. If false, always `|undefined`
|
|
16
16
|
*/
|
|
17
17
|
export type OsdkObjectPropertyType<
|
|
18
18
|
T extends ObjectMetadata.Property,
|
|
19
19
|
STRICTLY_ENFORCE_NULLABLE extends boolean = true
|
|
20
20
|
> = STRICTLY_ENFORCE_NULLABLE extends false ? MaybeArray<T, GetClientPropertyValueFromWire<T["type"]>> | undefined : MaybeNullable<T, MaybeArray<T, GetClientPropertyValueFromWire<T["type"]>>>;
|
|
21
21
|
/**
|
|
22
|
-
* @param
|
|
22
|
+
* @param T - ObjectMetadata.Property in literal form
|
|
23
23
|
*/
|
|
24
24
|
export type OsdkObjectPropertyTypeNotUndefined<T extends ObjectMetadata.Property> = MaybeArray<T, GetClientPropertyValueFromWire<T["type"]>>;
|
|
25
25
|
/**
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
26
|
+
* @param T - ObjectMetadata.Property in literal form
|
|
27
|
+
* @param STRICTLY_ENFORCE_NULLABLE - S for strict. If false, always `|undefined`
|
|
28
28
|
*/
|
|
29
29
|
export type OsdkObjectCreatePropertyType<
|
|
30
30
|
T extends ObjectMetadata.Property,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A discriminated union representing different types of property security outcomes.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* The type field determines which security outcome is represented:
|
|
5
5
|
* - "propertyMarkings": Successfully computed security markings for the property
|
|
6
6
|
* - "unsupportedPolicy": The property is backed by a restricted view that doesn't support property securities
|
|
7
7
|
* - "errorComputingSecurity": The server was unable to load the securities of the property
|
|
@@ -69,12 +69,13 @@ interface FetchPageSignature<
|
|
|
69
69
|
* Gets a page of objects of this type, with a result wrapper
|
|
70
70
|
* @param args - Args to specify next page token and page size, if applicable
|
|
71
71
|
* @example
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
$
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
* ```ts
|
|
73
|
+
* const myObjs = await objectSet.fetchPage({
|
|
74
|
+
* $pageSize: 10,
|
|
75
|
+
* $nextPageToken: "nextPage",
|
|
76
|
+
* });
|
|
77
|
+
* const myObjsResult = myObjs.data;
|
|
78
|
+
* ```
|
|
78
79
|
* @returns a page of objects
|
|
79
80
|
*/
|
|
80
81
|
<
|
|
@@ -111,14 +112,16 @@ interface FetchPageWithErrorsSignature<
|
|
|
111
112
|
* Gets a page of objects of this type, with a result wrapper
|
|
112
113
|
* @param args - Args to specify next page token and page size, if applicable
|
|
113
114
|
* @example
|
|
114
|
-
*
|
|
115
|
-
|
|
116
|
-
$
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
* ```ts
|
|
116
|
+
* const myObjs = await objectSet.fetchPage({
|
|
117
|
+
* $pageSize: 10,
|
|
118
|
+
* $nextPageToken: "nextPage",
|
|
119
|
+
* });
|
|
120
|
+
*
|
|
121
|
+
* if (isOk(myObjs)) {
|
|
122
|
+
* const myObjsResult = myObjs.value.data;
|
|
123
|
+
* }
|
|
124
|
+
* ```
|
|
122
125
|
* @returns a page of objects, wrapped in a result wrapper
|
|
123
126
|
*/
|
|
124
127
|
<
|
|
@@ -138,10 +141,12 @@ interface Where<
|
|
|
138
141
|
* Allows you to filter an object set with a given clause
|
|
139
142
|
* @param clause - Takes a filter clause
|
|
140
143
|
* @example
|
|
144
|
+
* ```ts
|
|
141
145
|
* await client(Office).where({
|
|
142
|
-
meetingRooms: { $contains: "Grand Central" },
|
|
143
|
-
meetingRoomCapacities: { $contains: 30 },
|
|
144
|
-
});
|
|
146
|
+
* meetingRooms: { $contains: "Grand Central" },
|
|
147
|
+
* meetingRoomCapacities: { $contains: 30 },
|
|
148
|
+
* });
|
|
149
|
+
* ```
|
|
145
150
|
* @returns an objectSet
|
|
146
151
|
*/
|
|
147
152
|
readonly where: (clause: WhereClause<MergeObjectSet<Q, RDPs>>) => this;
|
|
@@ -155,18 +160,22 @@ interface AsyncIterSignature<
|
|
|
155
160
|
/**
|
|
156
161
|
* Returns an async iterator to load all objects of this type
|
|
157
162
|
* @example
|
|
158
|
-
*
|
|
159
|
-
*
|
|
163
|
+
* ```ts
|
|
164
|
+
* for await (const obj of myObjectSet.asyncIter()) {
|
|
165
|
+
* // Handle obj
|
|
160
166
|
* }
|
|
167
|
+
* ```
|
|
161
168
|
* @returns an async iterator to load all objects
|
|
162
169
|
*/
|
|
163
170
|
<X extends ValidAsyncIterArgs<Q, RDPs> = never>(args?: X): AsyncIterableIterator<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>;
|
|
164
171
|
/**
|
|
165
172
|
* Returns an async iterator to load all objects of this type
|
|
166
173
|
* @example
|
|
167
|
-
*
|
|
168
|
-
*
|
|
174
|
+
* ```ts
|
|
175
|
+
* for await (const obj of myObjectSet.asyncIter()) {
|
|
176
|
+
* // Handle obj
|
|
169
177
|
* }
|
|
178
|
+
* ```
|
|
170
179
|
* @returns an async iterator to load all objects
|
|
171
180
|
*/
|
|
172
181
|
<
|
|
@@ -201,22 +210,23 @@ interface Aggregate<Q extends ObjectOrInterfaceDefinition> {
|
|
|
201
210
|
* @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose
|
|
202
211
|
* whether or not you order your results. You can also specify a groupBy field to group your aggregations
|
|
203
212
|
* @example
|
|
213
|
+
* ```ts
|
|
204
214
|
* const testAggregateCountWithGroups = await client(BoundariesUsState)
|
|
205
|
-
.aggregate({
|
|
206
|
-
$select: {
|
|
207
|
-
$count: "unordered",
|
|
208
|
-
"latitude:max": "unordered",
|
|
209
|
-
"latitude:min": "unordered",
|
|
210
|
-
"latitude:avg": "unordered",
|
|
211
|
-
},
|
|
212
|
-
$groupBy: {
|
|
213
|
-
usState: "exact",
|
|
214
|
-
longitude: {
|
|
215
|
-
$fixedWidth: 10,
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
});
|
|
219
|
-
|
|
215
|
+
* .aggregate({
|
|
216
|
+
* $select: {
|
|
217
|
+
* $count: "unordered",
|
|
218
|
+
* "latitude:max": "unordered",
|
|
219
|
+
* "latitude:min": "unordered",
|
|
220
|
+
* "latitude:avg": "unordered",
|
|
221
|
+
* },
|
|
222
|
+
* $groupBy: {
|
|
223
|
+
* usState: "exact",
|
|
224
|
+
* longitude: {
|
|
225
|
+
* $fixedWidth: 10,
|
|
226
|
+
* },
|
|
227
|
+
* },
|
|
228
|
+
* });
|
|
229
|
+
* ```
|
|
220
230
|
* @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)
|
|
221
231
|
*/
|
|
222
232
|
readonly aggregate: <AO extends AggregateOpts<Q>>(req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>) => Promise<AggregationsResults<Q, AO>>;
|
|
@@ -226,9 +236,11 @@ interface SetArithmetic<Q extends ObjectOrInterfaceDefinition> {
|
|
|
226
236
|
* Unions object sets together
|
|
227
237
|
* @param objectSets - objectSets you want to union with
|
|
228
238
|
* @example
|
|
239
|
+
* ```ts
|
|
229
240
|
* const unionObjectSet = complexFilteredEmployeeObjectSet.union(
|
|
230
|
-
simpleFilteredEmployeeObjectSet,
|
|
231
|
-
);
|
|
241
|
+
* simpleFilteredEmployeeObjectSet,
|
|
242
|
+
* );
|
|
243
|
+
* ```
|
|
232
244
|
* @returns the unioned object set
|
|
233
245
|
*/
|
|
234
246
|
readonly union: (...objectSets: ReadonlyArray<CompileTimeMetadata<Q>["objectSet"]>) => this;
|
|
@@ -236,9 +248,11 @@ interface SetArithmetic<Q extends ObjectOrInterfaceDefinition> {
|
|
|
236
248
|
* Computes the intersection of object sets
|
|
237
249
|
* @param objectSets - objectSets you want to intersect with
|
|
238
250
|
* @example
|
|
251
|
+
* ```ts
|
|
239
252
|
* const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(
|
|
240
|
-
simpleFilteredEmployeeObjectSet,
|
|
241
|
-
);
|
|
253
|
+
* simpleFilteredEmployeeObjectSet,
|
|
254
|
+
* );
|
|
255
|
+
* ```
|
|
242
256
|
* @returns the intersected object set
|
|
243
257
|
*/
|
|
244
258
|
readonly intersect: (...objectSets: ReadonlyArray<CompileTimeMetadata<Q>["objectSet"]>) => this;
|
|
@@ -246,9 +260,11 @@ interface SetArithmetic<Q extends ObjectOrInterfaceDefinition> {
|
|
|
246
260
|
* Computes the subtraction of object sets
|
|
247
261
|
* @param objectSets - objectSets you want to subtract from
|
|
248
262
|
* @example
|
|
263
|
+
* ```ts
|
|
249
264
|
* const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(
|
|
250
|
-
simpleFilteredEmployeeObjectSet,
|
|
251
|
-
);
|
|
265
|
+
* simpleFilteredEmployeeObjectSet,
|
|
266
|
+
* );
|
|
267
|
+
* ```
|
|
252
268
|
* @returns the subtract object set
|
|
253
269
|
*/
|
|
254
270
|
readonly subtract: (...objectSets: ReadonlyArray<CompileTimeMetadata<Q>["objectSet"]>) => this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,qBAAqB,+BAAgC;AACnE,cAAc,sEAAsE,yCAA0C;AAC9H,cAAc,2BAA2B,qCAAsC;AAC/E,cAAc,mBAAmB,6BAA8B;AAC/D,cAAc,uBAAuB,yCAA0C;AAC/E,cACE,eACA,UACA,eACA,sBACA,eACA,iBACK,4BAA6B;AACpC,cAAc,cAAc,qBAAsB;AAClD,cAAc,2BAA2B,oCAAqC;AAC9E,cACE,oCACA,6BACA,oBACK,kCAAmC;AAC1C,cACE,qBACA,4BACK,qCAAsC;AAC7C,cAAc,yBAAyB,kCAAmC;AAC1E,cAAc,sBAAsB,gBAAiB;AACrD,cACE,4BACA,gBACA,kBACA,YACA,YACK,sBAAuB;AAC9B,cAAc,kBAAkB,kBAAmB;AACnD,cAAc,YAAY,iBAAiB,sBAAuB;AAClE,cAAc,qBAAqB,oBAAqB;AACxD,cACE,qBACA,yCACK,qBAAsB;AAC7B,cAAc,6BAA6B,wBAAyB;KAE/D;CACH,UAAU;CACV,UAAU,eAAe,qBAAqB,CAAE;IAC9C,mCAAmC,sBAAsB,GAAG;KAE3D,WACH,UACI,qBACA,eAAe,uBAChB,qBAAqB,CAAE,IACxB,UAAU,qBAAqB,CAAE,IACjC,UAAU,eAAe,qBAAqB,IAC9C,CAAE;KAOD;CACH,UAAU;CACV;KACG,qBAAqB,aAAa,KACnC,aAAa,WAAW,IAAI,aAAa,KACzC,IAAI,aAAa;KAEhB;CACH,UAAU;CACV,UAAU,UAAU,GAAG,aAAa;IAClC,oBAAoB,GAAG,eAAe;KAErC,KAAK,KAAK,WAAW,GAAG,sBAAsB,IAC/C,wBAAuB,GAAG,sBAAsB,OAC7C,WAAW,KAAI,EAAE;KAEnB;CACH,UAAU,oCAAoC;CAC9C;KACG,qBAAqB,WACrB,EAAE,iCAAiC;KAEnC;CACH,aAAa,eAAe;CAC5B,UAAU,wBAAwB,aAAa,wBAAwB;KACpE,gCACD,QAAQ,KAAK,oBAAoB,kBAAkB,SAAQ,KAAK;AAEpE,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,yBAAyB,cAAc,eAAe,aAAa,MAAM,CAAE;UAE3E,cAAc,IACd,UAAU,GAAG,OACb,UAAU,GAAG,MAAM,mBACnB,MAAM,GAAG,OACT,eAAe,IACf,UAAU,eAAe,GAAG,OAC9B,CACC;AAED,YAAY,gBACV,UAAU,qDACP,6BAEC,iBAAiB,EAAE,uBAAuB,OAAO,OAAO,SACxD,2BACA,EAAE,2CAA2C,OAAO,OAAO;KAG5D,eAAe,UAAU,2BAA2B,YACvD,EAAE;UAGM;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;UACS,WAAW,mBAAmB,GAAG;UACjC,qBAAqB,6BAA6B,GAAG;AAC/D;KAEI;CACH,UAAU;CACV,aAAa,eAAe;CAC5B,yBAAyB,cAAc,eAAe,aAAa;IACjE,cAAc,UAChB,GACA,aAAa,4BAEE,MACf;KAGG;CACH,UAAU;CACV,aAAa,eAAe;IAE1B,cAAc,UACd,GACA,aAAa,IACb,sBACe,QAEf,cACA,yBAKA,qBACe;UAGT;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD
|
|
1
|
+
{"mappings":"AAgBA,cAAc,qBAAqB,+BAAgC;AACnE,cAAc,sEAAsE,yCAA0C;AAC9H,cAAc,2BAA2B,qCAAsC;AAC/E,cAAc,mBAAmB,6BAA8B;AAC/D,cAAc,uBAAuB,yCAA0C;AAC/E,cACE,eACA,UACA,eACA,sBACA,eACA,iBACK,4BAA6B;AACpC,cAAc,cAAc,qBAAsB;AAClD,cAAc,2BAA2B,oCAAqC;AAC9E,cACE,oCACA,6BACA,oBACK,kCAAmC;AAC1C,cACE,qBACA,4BACK,qCAAsC;AAC7C,cAAc,yBAAyB,kCAAmC;AAC1E,cAAc,sBAAsB,gBAAiB;AACrD,cACE,4BACA,gBACA,kBACA,YACA,YACK,sBAAuB;AAC9B,cAAc,kBAAkB,kBAAmB;AACnD,cAAc,YAAY,iBAAiB,sBAAuB;AAClE,cAAc,qBAAqB,oBAAqB;AACxD,cACE,qBACA,yCACK,qBAAsB;AAC7B,cAAc,6BAA6B,wBAAyB;KAE/D;CACH,UAAU;CACV,UAAU,eAAe,qBAAqB,CAAE;IAC9C,mCAAmC,sBAAsB,GAAG;KAE3D,WACH,UACI,qBACA,eAAe,uBAChB,qBAAqB,CAAE,IACxB,UAAU,qBAAqB,CAAE,IACjC,UAAU,eAAe,qBAAqB,IAC9C,CAAE;KAOD;CACH,UAAU;CACV;KACG,qBAAqB,aAAa,KACnC,aAAa,WAAW,IAAI,aAAa,KACzC,IAAI,aAAa;KAEhB;CACH,UAAU;CACV,UAAU,UAAU,GAAG,aAAa;IAClC,oBAAoB,GAAG,eAAe;KAErC,KAAK,KAAK,WAAW,GAAG,sBAAsB,IAC/C,wBAAuB,GAAG,sBAAsB,OAC7C,WAAW,KAAI,EAAE;KAEnB;CACH,UAAU,oCAAoC;CAC9C;KACG,qBAAqB,WACrB,EAAE,iCAAiC;KAEnC;CACH,aAAa,eAAe;CAC5B,UAAU,wBAAwB,aAAa,wBAAwB;KACpE,gCACD,QAAQ,KAAK,oBAAoB,kBAAkB,SAAQ,KAAK;AAEpE,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,yBAAyB,cAAc,eAAe,aAAa,MAAM,CAAE;UAE3E,cAAc,IACd,UAAU,GAAG,OACb,UAAU,GAAG,MAAM,mBACnB,MAAM,GAAG,OACT,eAAe,IACf,UAAU,eAAe,GAAG,OAC9B,CACC;AAED,YAAY,gBACV,UAAU,qDACP,6BAEC,iBAAiB,EAAE,uBAAuB,OAAO,OAAO,SACxD,2BACA,EAAE,2CAA2C,OAAO,OAAO;KAG5D,eAAe,UAAU,2BAA2B,YACvD,EAAE;UAGM;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;UACS,WAAW,mBAAmB,GAAG;UACjC,qBAAqB,6BAA6B,GAAG;AAC/D;KAEI;CACH,UAAU;CACV,aAAa,eAAe;CAC5B,yBAAyB,cAAc,eAAe,aAAa;IACjE,cAAc,UAChB,GACA,aAAa,4BAEE,MACf;KAGG;CACH,UAAU;CACV,aAAa,eAAe;IAE1B,cAAc,UACd,GACA,aAAa,IACb,sBACe,QAEf,cACA,yBAKA,qBACe;UAGT;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;;;;;;;;;;;;EAeE,UAAU,aAAa,qBAAqB;EAC5C;QACM,UAAU;EAChB,UAAU,uBAAuB,qBAAqB;EACtD,oBAAoB;EACpB,yBAAyB,cAAc,eAAe,KAAK,CAAE;EAC7D,sCAAsC;GAEtCA,OAAO,cACL,GACA,GACA,GACA,GACA,GACA,UAEA,kBACA,uBAED,QACD,WACE,WACE,KAAK,SACH,GACA,eAAe,GAAG,GAAG,GAAG,sBACxB,QAAQ,cAAc,GAAG,mBAAmB,SAC5C,cAAc,MAAM,mBAAmB,SAEzC;AAIP;UAES,iBAAiB,UAAU,6BAA6B;;;;;;;;;;;;;UAcvD,mBACPC,0BACAC,sBACAC,UAAU,aAAa,SAAS,GAAG;AAEtC;UAES;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,sCAAsC;EACtC;;;;;;;;;;;;;;;;;;EAkBE,UAAU,aAAa,qBAAqB;EAC5C;QACM,UAAU;EAChB,UAAU,uBAAuB,qBAAqB;EACtD,oBAAoB;EACpB,yBAAyB,cAAc,eAAe,KAAK,CAAE;GAE7DH,OAAO,cACL,GACA,GACA,GACA,GACA,GACA,UAEA,kBACA,uBAED,QACD,OACE,WACE,WACE,KAAK,SACH,GACA,eAAe,GAAG,GAAG,GAAG,sBACxB,QAAQ,cAAc,GAAG,mBAAmB,SAC5C,cAAc,MAAM,mBAAmB,SAEzC;AAKT;UAGS;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;;;;;;;;;;UAaS,QACPI,QAAQ,YAAY,eAAe,GAAG;AAEzC;UAES;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,yBAAyB,cAAc,eAAe,aAAa,MAAM,CAAE;CAC3E,sCAAsC;EACtC;;;;;;;;;;;EAWC,UAAU,mBAAmB,GAAG,eAC/BC,OAAO,IACN,sBACD,KAAK,SACH,GACA,gBAAgB,IAChB,cAAc,GAAG,IACjB,cAAc,MAAM;;;;;;;;;;;;EAetB,UAAU,aAAa,qBAAqB;EAC5C;QACM,UAAU;EAChB,UAAU,uBAAuB,qBAAqB;EACtD,oBAAoB;EACpB,yBAAyB,cAAc,eAAe,aAAa,MAAM,CAAE;GAE3EC,OAAO,cACL,GACA,GACA,GACA,GACA,GACA,UAEA,kBACA,uBAED,sBACD,WACE,KAAK,SACH,GACA,eAAe,GAAG,GAAG,GAAG,sBACxB,QAAQ,cAAc,GAAG,mBAAmB,SAC5C,cAAc,MAAM,mBAAmB,SAEzC;AAGL;UAES;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,yBAAyB,cAAc,eAAe,aAAa,MAAM,CAAE;EAC3E;CACA,WAAW,mBAAmB,GAAG,MAAM;AACxC;UAES;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;UACS,iBACP,YAAY,eAAe,oBAE3BC,WAAW,WAAW,OAAM,gBAAgB,QAAQ,GAAG,IAAI,UACxD,UACH,MAEG,YAAY,YAAY,QAAO,iBAAiB,MAAM,IAAI,MACvD,iBAAiB,OAAO,KAAK;AAItC;AAED,iBAAiB;CACf,UAAU;CAGV,sBACI,cAAc,KACd,eAAe;UAEnB,sBACE,GACA,WAAW,gBACX,eAAe,GAAG,WAAW,iBAEjC,CACC;UAGS,UACR,UAAU,6BACV;;;;;;;;;;;;;;;;;;;;;;;;;UAyBS,YAAY,WAAW,cAAc,IAC5CC,KAAK,+DAA+D,GAAG,QACpE,QAAQ,oBAAoB,GAAG;AACrC;UAGS,cACR,UAAU,6BACV;;;;;;;;;;;;UAYS,QACP,GAAG,YAAY,cAAc,oBAAoB,GAAG;;;;;;;;;;;;UAc7C,YACP,GAAG,YAAY,cAAc,oBAAoB,GAAG;;;;;;;;;;;;UAc7C,WACP,GAAG,YAAY,cAAc,oBAAoB,GAAG;AAEvD;UAGS,QACR,UAAU,6BACV;;;;;;UAMS,UAAU,UAAU,UAAU,IACrCC,MAAM,MACH,UAAU,WAAW,GAAG;AAC9B;UAES;CACR,UAAU;CACV,aAAa,eAAe;EAC5B;;;;;QAKQ,UAAU,aAAa,qBAAqB;QAC5C;QACA,UAAU,QAAQ,UAAU,qBAAqB;EACvD,sCAAsC;GAEtCC,YAAY,eAAe,IAC3BC,UAAU,UAAU,GAAG,GAAG,GAAG,UAAU,uBACtC,QACD,KAAK,SACH,GACA,eAAe,GAAG,GAAG,OAAO,sBAC5B,QAAQ,cAAc,GAAG;EAAE,SAAS,MAAM;CAAI,KAC9C,cAAc,MAAM;EAAE,SAAS,MAAM;CAAI;AAG9C;UAES;CACR,UAAU;CACV,aAAa,eAAe;EAC5B;;;;;QAKQ,UAAU,aAAa,qBAAqB;QAC5C;QACA,UAAU,QAAQ,UAAU,qBAAqB;EACvD,sCAAsC;GAEtCD,YAAY,eAAe,IAC3BC,UAAU,UAAU,GAAG,GAAG,GAAG,UAAU,uBACtC,QACD,OACE,KAAK,SACH,GACA,eAAe,GAAG,GAAG,OAAO,sBAC5B,QAAQ,cAAc,GAAG;EAAE,SAAS,MAAM;CAAI,KAC9C,cAAc,MAAM;EAAE,SAAS,MAAM;CAAI;AAIhD;UAES;CACR,UAAU;CACV,aAAa,eAAe;EAC5B;CACA,UAAU,UAAU,uBAAuB,kBAAkB,GAAG;CAChE,oBAAoB,UAAU,uBAC1B,4BAA4B,GAAG;AAEpC;UAGS,UACR,UAAU,6BACV;;;;;;;UAOS;QACD,UAAU,aAAa;QACvB,oBAAoB;GAE1BC,UAAU,sBAAsB,SAAS,GAAG,GAAG,IAC/CC,OAAO,sBAAsB,QAAQ,GAAG,GAAG,OACxC;EAAE;CAAyB;AACjC;UAES,aAAa,UAAU,6BAA6B;;;;;;;;;UASnD,eACP,mBAAmB,kCAAkC,IAErDC,MAAM,eACH,UAAU;AAChB;KAEI,kCAAkC,UAAU,+BAC/C,UAAU,uBAAuB,6BAA6B,KAC1D,UAAU,sBAAsB,yBAAyB;KAG1D,6BAA6B,UAAU,wBAC1C,oBAAoB,WAAW;CAAE,YAAY,oBAAoB;AAAW,IACxE,0BAA0B,sBAAsB;CAAE,SAAS;AAAU;KAItE,yBAAyB,UAAU,uBACtC,oBAAoB,WAClB;CAAE,eAAe,oBAAoB;AAA0B,KAC5D,uBAAuB;CAAE,SAAS;AAAU,KAAI,sBACjD;UAEI,eAAe,UAAU,6BAA6B;;;;;;;;;;;;;UAarD,8BACP,2BAA2B,oBAAoB,IAE/CC,OAAO,yBACJ,sBACH,kCAAkC,GAAG;AAExC;UAES;CACR,UAAU;CACV,UAAU,eAAe;CACzB,eAAe,8BAA8B;CAC7C,yBAAyB,cAAc,eAAe,aAAa,MAAM,CAAE;UAE3E,iBAAiB,GAAG,GAAG,mBACvB,eAAe,GAAG,IAClB,UAAU,SACV,cAAc,SACd,QAAQ,IACR,SAAS,GAAG,IACZ,iBAAiB,IACjB,aAAa,GACf,CACC","names":["args?: FetchPageArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >","query: string | number[]","numNeighbors: number","property: PropertyKeys.Filtered<Q, \"vector\">","clause: WhereClause<MergeObjectSet<Q, RDPs>>","args?: X","args?: AsyncIterArgs<\n Q,\n L,\n R,\n A,\n S,\n T,\n never,\n ORDER_BY_OPTIONS,\n PROPERTY_SECURITIES\n >","clause: { [K in keyof NEW]: DerivedProperty.Creator<Q, NEW[K]> }","req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>","type: L","primaryKey: PrimaryKeyType<Q>","options?: SelectArg<Q, L, R, S, never, PROPERTY_SECURITIES>","listener: ObjectSetSubscription.Listener<Q, P, R>","opts?: ObjectSetSubscription.Options<Q, P, R>","type: CONVERT_TO","links: LINK_TYPE_API_NAME[]"],"sources":["../../../src/objectSet/ObjectSet.ts"],"version":3,"file":"ObjectSet.d.ts"}
|
|
@@ -65,10 +65,12 @@ export interface TimeSeriesProperty<T extends number | string> {
|
|
|
65
65
|
* Loads all points, within the given time range if that's provided
|
|
66
66
|
* @param query - a query representing either an absolute or relative range of time
|
|
67
67
|
* @example
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
$
|
|
71
|
-
|
|
68
|
+
* ```ts
|
|
69
|
+
* const points = await employee.employeeStatus?.getAllPoints({
|
|
70
|
+
* $after: 1,
|
|
71
|
+
* $unit: "month",
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
72
74
|
*/
|
|
73
75
|
readonly getAllPoints: (query?: TimeSeriesQuery) => Promise<Array<TimeSeriesPoint<T>>>;
|
|
74
76
|
/**
|
|
@@ -76,13 +78,15 @@ export interface TimeSeriesProperty<T extends number | string> {
|
|
|
76
78
|
* within the given time range if that's provided
|
|
77
79
|
* @param query - a query representing either an absolute or relative range of time
|
|
78
80
|
* @example
|
|
79
|
-
*
|
|
80
|
-
|
|
81
|
-
$
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
* ```ts
|
|
82
|
+
* const iterator = employee.employeeStatus?.asyncIter({
|
|
83
|
+
* $after: 1,
|
|
84
|
+
* $unit: "month",
|
|
85
|
+
* });
|
|
86
|
+
* for await (const point of iterator) {
|
|
87
|
+
* // Handle time series point
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
86
90
|
*/
|
|
87
91
|
readonly asyncIterPoints: (query?: TimeSeriesQuery) => AsyncGenerator<TimeSeriesPoint<T>>;
|
|
88
92
|
}
|
|
@@ -95,10 +99,12 @@ export interface GeotimeSeriesProperty<T extends GeoJSON.Point> {
|
|
|
95
99
|
* Loads all points, within the given time range if that's provided
|
|
96
100
|
* @param query - a query representing either an absolute or relative range of time
|
|
97
101
|
* @example
|
|
98
|
-
*
|
|
99
|
-
|
|
100
|
-
$
|
|
101
|
-
|
|
102
|
+
* ```ts
|
|
103
|
+
* const points = await employee.employeeStatus?.getAllPoints({
|
|
104
|
+
* $after: 1,
|
|
105
|
+
* $unit: "month",
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
102
108
|
*/
|
|
103
109
|
readonly getAllValues: (query?: TimeSeriesQuery) => Promise<Array<TimeSeriesPoint<T>>>;
|
|
104
110
|
/**
|
|
@@ -106,13 +112,15 @@ export interface GeotimeSeriesProperty<T extends GeoJSON.Point> {
|
|
|
106
112
|
* within the given time range if that's provided
|
|
107
113
|
* @param query - a query representing either an absolute or relative range of time
|
|
108
114
|
* @example
|
|
109
|
-
*
|
|
110
|
-
|
|
111
|
-
$
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
* ```ts
|
|
116
|
+
* const iterator = employee.employeeStatus?.asyncIter({
|
|
117
|
+
* $after: 1,
|
|
118
|
+
* $unit: "month",
|
|
119
|
+
* });
|
|
120
|
+
* for await (const point of iterator) {
|
|
121
|
+
* // Handle time series point
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
116
124
|
*/
|
|
117
125
|
readonly asyncIterValues: (query?: TimeSeriesQuery) => AsyncGenerator<TimeSeriesPoint<T>>;
|
|
118
126
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAkBA,YAAY,kBACR;CACA;CACA,oBAAoB;CACpB;CACA;CACA;AACD,IACC;CACA;CACA,oBAAoB;CACpB;CACA;CACA;AACD,IACC;CACA;CACA;CACA;CACA;CACA;AACD,IACC;CACA;CACA;CACA;CACA;CACA;AACD;AAEH,YAAY,0BACR,UACA,WACA,UACA,SACA,UACA,YACA,YACA;AAEJ,OAAO,cAAMA,2BAA2B;CACtC,KAAK;CACL,SAAS;CACT,KAAK;CACL,QAAQ;CACR,SAAS;CACT,IAAI;CACJ,KAAK;CACL,MAAM;CACN,OAAO;CACP,KAAK;CACL,MAAM;CACN,IAAI;CACJ,MAAM;CACN,OAAO;CACP,KAAK;CACL,OAAO;CACP,QAAQ;CACR,IAAI;CACJ,MAAM;CACN,OAAO;CACP,IAAI;CACJ,cAAc;AACf;AAMD,iBAAiB,gBAAgB,4BAA4B,QAAQ,OAAO;CAC1E;CACA,OAAO;AACR;AAED,iBAAiB,mBAAmB,2BAA2B;;;;UAIpD,qBAAqB,QAAQ,gBAAgB;;;;UAI7C,oBAAoB,QAAQ,gBAAgB
|
|
1
|
+
{"mappings":"AAkBA,YAAY,kBACR;CACA;CACA,oBAAoB;CACpB;CACA;CACA;AACD,IACC;CACA;CACA,oBAAoB;CACpB;CACA;CACA;AACD,IACC;CACA;CACA;CACA;CACA;CACA;AACD,IACC;CACA;CACA;CACA;CACA;CACA;AACD;AAEH,YAAY,0BACR,UACA,WACA,UACA,SACA,UACA,YACA,YACA;AAEJ,OAAO,cAAMA,2BAA2B;CACtC,KAAK;CACL,SAAS;CACT,KAAK;CACL,QAAQ;CACR,SAAS;CACT,IAAI;CACJ,KAAK;CACL,MAAM;CACN,OAAO;CACP,KAAK;CACL,MAAM;CACN,IAAI;CACJ,MAAM;CACN,OAAO;CACP,KAAK;CACL,OAAO;CACP,QAAQ;CACR,IAAI;CACJ,MAAM;CACN,OAAO;CACP,IAAI;CACJ,cAAc;AACf;AAMD,iBAAiB,gBAAgB,4BAA4B,QAAQ,OAAO;CAC1E;CACA,OAAO;AACR;AAED,iBAAiB,mBAAmB,2BAA2B;;;;UAIpD,qBAAqB,QAAQ,gBAAgB;;;;UAI7C,oBAAoB,QAAQ,gBAAgB;;;;;;;;;;;;UAY5C,eACPC,QAAQ,oBACL,QAAQ,MAAM,gBAAgB;;;;;;;;;;;;;;;;UAgB1B,kBACPA,QAAQ,oBACL,eAAe,gBAAgB;AACrC;AAED,iBAAiB,sBAAsB,UAAU,QAAQ,OAAO;;;;UAIrD,sBAAsB,QAAQ,gBAAgB;;;;;;;;;;;;UAY9C,eACPA,QAAQ,oBACL,QAAQ,MAAM,gBAAgB;;;;;;;;;;;;;;;;UAgB1B,kBACPA,QAAQ,oBACL,eAAe,gBAAgB;;;;;;UAO3B,kBAAkB,gBAAgB;AAC5C","names":["TimeseriesDurationMapping: {\n sec: \"SECONDS\";\n seconds: \"SECONDS\";\n min: \"MINUTES\";\n minute: \"MINUTES\";\n minutes: \"MINUTES\";\n hr: \"HOURS\";\n hrs: \"HOURS\";\n hour: \"HOURS\";\n hours: \"HOURS\";\n day: \"DAYS\";\n days: \"DAYS\";\n wk: \"WEEKS\";\n week: \"WEEKS\";\n weeks: \"WEEKS\";\n mos: \"MONTHS\";\n month: \"MONTHS\";\n months: \"MONTHS\";\n yr: \"YEARS\";\n year: \"YEARS\";\n years: \"YEARS\";\n ms: \"MILLISECONDS\";\n milliseconds: \"MILLISECONDS\";\n}","query?: TimeSeriesQuery"],"sources":["../../../src/timeseries/timeseries.ts"],"version":3,"file":"timeseries.d.ts"}
|