@osdk/api 2.3.0-beta.8 → 2.3.0-rc.11
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 +10 -0
- package/build/browser/derivedProperties/DerivedProperty.js +16 -1
- package/build/browser/derivedProperties/DerivedProperty.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/mapping/DataValueMapping.js.map +1 -1
- package/build/browser/object/Media.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +4 -205
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/cjs/{ObjectSet-C67LQ5JX.d.cts → ObjectSet-C3Ud9v-e.d.cts} +6 -57
- package/build/cjs/index.d.cts +4 -4
- package/build/cjs/public/unstable.d.cts +2 -2
- package/build/esm/derivedProperties/DerivedProperty.js +16 -1
- package/build/esm/derivedProperties/DerivedProperty.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/mapping/DataValueMapping.js.map +1 -1
- package/build/esm/object/Media.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +4 -205
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/types/derivedProperties/DerivedProperty.d.ts +6 -32
- package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/mapping/DataValueMapping.d.ts +2 -2
- package/build/types/mapping/DataValueMapping.d.ts.map +1 -1
- package/build/types/object/Media.d.ts +0 -7
- package/build/types/object/Media.d.ts.map +1 -1
- package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
- package/package.json +1 -1
- package/build/browser/derivedProperties/Expressions.js +0 -2
- package/build/browser/derivedProperties/Expressions.js.map +0 -1
- package/build/esm/derivedProperties/Expressions.js +0 -2
- package/build/esm/derivedProperties/Expressions.js.map +0 -1
- package/build/types/derivedProperties/Expressions.d.ts +0 -53
- package/build/types/derivedProperties/Expressions.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -13,5 +13,20 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export let DerivedProperty;
|
|
16
|
+
export let DerivedProperty; // type Selectable<Q extends ObjectOrInterfaceDefinition> = {
|
|
17
|
+
// readonly selectProperty: <R extends PropertyKeys<Q>>(
|
|
18
|
+
// propertyName: R,
|
|
19
|
+
// ) => DefinitionForType<
|
|
20
|
+
// Q,
|
|
21
|
+
// SimplePropertyDef.Make<
|
|
22
|
+
// CompileTimeMetadata<Q>["properties"][R]["type"],
|
|
23
|
+
// CompileTimeMetadata<Q>["properties"][R]["nullable"] extends true
|
|
24
|
+
// ? "nullable"
|
|
25
|
+
// : "non-nullable",
|
|
26
|
+
// CompileTimeMetadata<Q>["properties"][R]["multiplicity"] extends true
|
|
27
|
+
// ? "array"
|
|
28
|
+
// : "single"
|
|
29
|
+
// >
|
|
30
|
+
// >;
|
|
31
|
+
// };
|
|
17
32
|
//# sourceMappingURL=DerivedProperty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DerivedProperty.js","names":["DerivedProperty"],"sources":["DerivedProperty.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ValidAggregationKeys } from \"../aggregate/AggregatableKeys.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n
|
|
1
|
+
{"version":3,"file":"DerivedProperty.js","names":["DerivedProperty"],"sources":["DerivedProperty.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ValidAggregationKeys } from \"../aggregate/AggregatableKeys.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type {\n CollectWithPropAggregations,\n MinMaxWithPropAggregateOption,\n} from \"./WithPropertiesAggregationOptions.js\";\n\ndeclare const DerivedPropertyDefinitionBrand: unique symbol;\n\nexport namespace DerivedProperty {\n export interface Definition<\n T extends SimplePropertyDef,\n Q extends ObjectOrInterfaceDefinition,\n > {\n readonly [DerivedPropertyDefinitionBrand]: true;\n }\n\n export type Clause<\n Q extends ObjectOrInterfaceDefinition,\n > = {\n [key: string]: DerivedPropertyCreator<Q, SimplePropertyDef>;\n };\n\n interface BaseBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {\n }\n\n export interface Builder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends BaseBuilder<Q, CONSTRAINED> {\n }\n\n export interface AggregateBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends BaseBuilder<Q, CONSTRAINED>, Aggregatable<Q> {\n }\n\n // export interface SelectPropertyBuilder<\n // Q extends ObjectOrInterfaceDefinition,\n // CONSTRAINED extends boolean,\n // > extends AggregateBuilder<Q, CONSTRAINED> {\n // }\n}\n\nexport type DerivedPropertyCreator<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n> = (\n baseObjectSet: DerivedProperty.Builder<Q, false>,\n) => DerivedProperty.Definition<T, Q>;\n\ntype BuilderTypeFromConstraint<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true>\n : DerivedProperty.AggregateBuilder<Q, false>;\n\ntype Filterable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly where: (\n clause: WhereClause<Q>,\n ) => BuilderTypeFromConstraint<Q, CONSTRAINED>;\n};\n\ntype Pivotable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CONSTRAINED extends true\n ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : NonNullable<CompileTimeMetadata<Q>[\"links\"][L][\"multiplicity\"]> extends\n true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : DerivedProperty.AggregateBuilder<LinkedType<Q, L>, false>;\n};\n\ntype Aggregatable<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n readonly aggregate: <\n V extends ValidAggregationKeys<\n Q,\n \"withPropertiesAggregate\"\n >,\n >(\n aggregationSpecifier: V,\n opts?: V extends `${any}:${infer P}`\n ? P extends CollectWithPropAggregations ? { limit: number }\n : P extends \"approximatePercentile\" ? { percentile: number }\n : never\n : never,\n ) => DerivedProperty.Definition<\n V extends `${infer N}:${infer P}`\n ? P extends CollectWithPropAggregations ? SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][N][\"type\"],\n \"nullable\",\n \"array\"\n >\n : P extends MinMaxWithPropAggregateOption ? SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][N][\"type\"],\n \"nullable\",\n \"single\"\n >\n : P extends \"approximateDistinct\" | \"exactDistinct\"\n ? SimplePropertyDef.Make<\n \"integer\",\n \"non-nullable\",\n \"single\"\n >\n : SimplePropertyDef.Make<\n \"double\",\n \"nullable\",\n \"single\"\n >\n : V extends \"$count\" ? SimplePropertyDef.Make<\n \"integer\",\n \"non-nullable\",\n \"single\"\n >\n : never,\n Q\n >;\n};\n\n// type Selectable<Q extends ObjectOrInterfaceDefinition> = {\n// readonly selectProperty: <R extends PropertyKeys<Q>>(\n// propertyName: R,\n// ) => DefinitionForType<\n// Q,\n// SimplePropertyDef.Make<\n// CompileTimeMetadata<Q>[\"properties\"][R][\"type\"],\n// CompileTimeMetadata<Q>[\"properties\"][R][\"nullable\"] extends true\n// ? \"nullable\"\n// : \"non-nullable\",\n// CompileTimeMetadata<Q>[\"properties\"][R][\"multiplicity\"] extends true\n// ? \"array\"\n// : \"single\"\n// >\n// >;\n// };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA+BiBA,eAAe,EA0HhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport type { DerivedProperty } from \"./derivedProperties/DerivedProperty.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type {
|
|
1
|
+
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport type { DerivedProperty } from \"./derivedProperties/DerivedProperty.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type { Media, MediaMetadata, MediaReference } from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type { ObjectSpecifier } from \"./ontology/ObjectSpecifier.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type {\n ObjectIdentifiers,\n OsdkBase,\n PrimaryKeyType,\n} from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type {\n Range,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"./queries/Aggregations.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\nexport {};\nexport type { Logger } from \"./Logger.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,mBAAmB,QAAQ,4BAA4B;AAahE,SAASC,eAAe,QAAQ,4BAA4B;AA8B5D,SAASC,IAAI,QAAQ,oBAAoB;AAuDzC,SAASC,yBAAyB,QAAQ,4BAA4B;AAQtE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataValueMapping.js","names":[],"sources":["DataValueMapping.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Attachment, AttachmentUpload } from \"../object/Attachment.js\";\nimport type { MediaReference
|
|
1
|
+
{"version":3,"file":"DataValueMapping.js","names":[],"sources":["DataValueMapping.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Attachment, AttachmentUpload } from \"../object/Attachment.js\";\nimport type { MediaReference } from \"../object/Media.js\";\n\n/**\n * Map from the DataValue type to the typescript type that we return\n */\nexport interface DataValueWireToClient {\n attachment: Attachment;\n boolean: boolean;\n byte: number;\n datetime: string;\n date: string;\n decimal: string;\n float: number;\n double: number;\n integer: number;\n long: string;\n marking: string;\n null: null;\n short: number;\n string: string;\n timestamp: string;\n mediaReference: MediaReference;\n twoDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[];\n threeDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[];\n struct: Record<string, any>;\n set: Set<any>;\n objectType: string;\n geohash: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n}\n\n/**\n * Map from the DataValue type to the typescript type that we accept\n */\nexport interface DataValueClientToWire {\n attachment: string | AttachmentUpload | Blob & { readonly name: string };\n boolean: boolean;\n byte: number;\n datetime: string;\n date: string;\n decimal: string | number;\n float: number;\n double: number;\n integer: number;\n long: string | number;\n marking: string;\n null: null;\n short: number;\n string: string;\n timestamp: string;\n set: Set<any>;\n mediaReference: MediaReference;\n twoDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[];\n threeDimensionalAggregation: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[];\n struct: Record<string, any>;\n objectType: string;\n geohash: GeoJSON.Point;\n geoshape: GeoJSON.GeoJSON;\n}\n\nexport type AllowedBucketTypes = string | number | boolean;\nexport type AllowedBucketKeyTypes =\n | AllowedBucketTypes\n | {\n startValue: AllowedBucketTypes;\n endValue: AllowedBucketTypes;\n };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Media.js","names":[],"sources":["Media.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Media {\n /**\n * Fetches metadata for media reference property\n */\n fetchMetadata(): Promise<MediaMetadata>;\n /**\n * Fetches content of a media reference property\n */\n fetchContents(): Promise<Response>;\n /**\n * Returns the media reference\n */\n getMediaReference(): MediaReference;\n}\n\n/**\n * Unique identifier of a media item in Foundry.\n */\nexport interface MediaReference {\n mimeType: string;\n reference: {\n type: \"mediaSetViewItem\";\n mediaSetViewItem: {\n mediaItemRid: string;\n mediaSetRid: string;\n mediaSetViewRid: string;\n readToken?: string;\n };\n };\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"Media.js","names":[],"sources":["Media.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Media {\n /**\n * Fetches metadata for media reference property\n */\n fetchMetadata(): Promise<MediaMetadata>;\n /**\n * Fetches content of a media reference property\n */\n fetchContents(): Promise<Response>;\n /**\n * Returns the media reference\n */\n getMediaReference(): MediaReference;\n}\n\n/**\n * Unique identifier of a media item in Foundry.\n */\nexport interface MediaReference {\n mimeType: string;\n reference: {\n type: \"mediaSetViewItem\";\n mediaSetViewItem: {\n mediaItemRid: string;\n mediaSetRid: string;\n mediaSetViewRid: string;\n readToken?: string;\n };\n };\n}\n\n/**\n * Metadata of a media item\n */\nexport interface MediaMetadata {\n path?: string;\n sizeBytes: number;\n mediaType: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -151,7 +151,7 @@ describe("ObjectSet", () => {
|
|
|
151
151
|
});
|
|
152
152
|
it("can be sub-selected", () => {
|
|
153
153
|
fauxObjectSet.withProperties({
|
|
154
|
-
"derivedPropertyName": base => base.pivotTo("lead").
|
|
154
|
+
"derivedPropertyName": base => base.pivotTo("lead").aggregate("dateOfJoining:max")
|
|
155
155
|
}).fetchOne(3, {
|
|
156
156
|
$select: ["derivedPropertyName"]
|
|
157
157
|
});
|
|
@@ -159,7 +159,7 @@ describe("ObjectSet", () => {
|
|
|
159
159
|
test("multiple properties", async () => {
|
|
160
160
|
const withFamily = fauxObjectSet.withProperties({
|
|
161
161
|
"mom": base => base.pivotTo("lead").aggregate("$count"),
|
|
162
|
-
"dad": base => base.pivotTo("lead").
|
|
162
|
+
"dad": base => base.pivotTo("lead").aggregate("dateOfJoining:max"),
|
|
163
163
|
"sister": base => base.pivotTo("lead").aggregate("class:collectList")
|
|
164
164
|
});
|
|
165
165
|
expectTypeOf(withFamily).toEqualTypeOf();
|
|
@@ -175,7 +175,7 @@ describe("ObjectSet", () => {
|
|
|
175
175
|
"mom": base => base.pivotTo("lead").aggregate("$count")
|
|
176
176
|
});
|
|
177
177
|
const withParents = withMom.withProperties({
|
|
178
|
-
"dad": base => base.pivotTo("lead").
|
|
178
|
+
"dad": base => base.pivotTo("lead").aggregate("fullName:approximateDistinct")
|
|
179
179
|
});
|
|
180
180
|
expectTypeOf(withParents).toEqualTypeOf();
|
|
181
181
|
});
|
|
@@ -194,7 +194,6 @@ describe("ObjectSet", () => {
|
|
|
194
194
|
it("collectToSet, collectToList, selectProperty, and numeric aggregations are nullable", async () => {
|
|
195
195
|
const withAggregations = fauxObjectSet.withProperties({
|
|
196
196
|
"collectSet": base => base.pivotTo("lead").aggregate("class:collectSet"),
|
|
197
|
-
"select": base => base.pivotTo("lead").selectProperty("fullName"),
|
|
198
197
|
"collectList": base => base.pivotTo("lead").aggregate("class:collectList"),
|
|
199
198
|
"min": base => base.pivotTo("lead").aggregate("employeeId:max"),
|
|
200
199
|
"max": base => base.pivotTo("lead").aggregate("employeeId:min"),
|
|
@@ -209,7 +208,6 @@ describe("ObjectSet", () => {
|
|
|
209
208
|
describe("fetch functions return correct Osdk.Instance", () => {
|
|
210
209
|
const withFamily = fauxObjectSet.withProperties({
|
|
211
210
|
"mom": base => base.pivotTo("lead").aggregate("$count"),
|
|
212
|
-
"dad": base => base.pivotTo("lead").selectProperty("fullName"),
|
|
213
211
|
"sister": base => base.pivotTo("lead").aggregate("class:collectList")
|
|
214
212
|
});
|
|
215
213
|
it("works with .where", async () => {
|
|
@@ -244,7 +242,7 @@ describe("ObjectSet", () => {
|
|
|
244
242
|
});
|
|
245
243
|
it("Works with selecting all RDPs", async () => {
|
|
246
244
|
await withFamily.fetchPage({
|
|
247
|
-
$select: ["mom", "
|
|
245
|
+
$select: ["mom", "sister"]
|
|
248
246
|
});
|
|
249
247
|
expectTypeOf().toEqualTypeOf();
|
|
250
248
|
expectTypeOf().toEqualTypeOf();
|
|
@@ -372,204 +370,5 @@ describe("ObjectSet", () => {
|
|
|
372
370
|
});
|
|
373
371
|
});
|
|
374
372
|
});
|
|
375
|
-
describe("expressions", () => {
|
|
376
|
-
"Test all property types";
|
|
377
|
-
|
|
378
|
-
describe("numeric expressions", () => {
|
|
379
|
-
it("provides correct methods off of selected numeric derived property definitions", () => {
|
|
380
|
-
fauxObjectSet.withProperties({
|
|
381
|
-
"myProp1": base => {
|
|
382
|
-
const selectedInteger = base.pivotTo("lead").selectProperty("employeeId");
|
|
383
|
-
expectTypeOf(selectedInteger).toEqualTypeOf;
|
|
384
|
-
selectedInteger.add(1);
|
|
385
|
-
selectedInteger.subtract(1);
|
|
386
|
-
selectedInteger.multiply(1);
|
|
387
|
-
selectedInteger.divide(1);
|
|
388
|
-
selectedInteger.abs();
|
|
389
|
-
selectedInteger.negate();
|
|
390
|
-
selectedInteger.max(1);
|
|
391
|
-
selectedInteger.min(1);
|
|
392
|
-
|
|
393
|
-
// @ts-expect-error
|
|
394
|
-
selectedInteger.extractPart("1");
|
|
395
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("performanceScore")).toEqualTypeOf();
|
|
396
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("rank")).toEqualTypeOf();
|
|
397
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("yearsOfExperience")).toEqualTypeOf();
|
|
398
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("hourlyRate")).toEqualTypeOf();
|
|
399
|
-
return selectedInteger;
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
});
|
|
403
|
-
it("provides correct methods off of selection definitions", () => {
|
|
404
|
-
fauxObjectSet.withProperties({
|
|
405
|
-
"myProp1": base => {
|
|
406
|
-
const selectedInteger = base.pivotTo("lead").selectProperty("employeeId");
|
|
407
|
-
expectTypeOf(selectedInteger).toEqualTypeOf;
|
|
408
|
-
selectedInteger.add(1);
|
|
409
|
-
selectedInteger.subtract(1);
|
|
410
|
-
selectedInteger.multiply(1);
|
|
411
|
-
selectedInteger.divide(1);
|
|
412
|
-
selectedInteger.abs();
|
|
413
|
-
selectedInteger.negate();
|
|
414
|
-
selectedInteger.max(1);
|
|
415
|
-
selectedInteger.min(1);
|
|
416
|
-
|
|
417
|
-
// @ts-expect-error
|
|
418
|
-
selectedInteger.extractPart("1");
|
|
419
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("performanceScore")).toEqualTypeOf();
|
|
420
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("rank")).toEqualTypeOf();
|
|
421
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("yearsOfExperience")).toEqualTypeOf();
|
|
422
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("hourlyRate")).toEqualTypeOf();
|
|
423
|
-
return selectedInteger;
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
});
|
|
427
|
-
it("provides correct methods off of aggregated properties", () => {
|
|
428
|
-
fauxObjectSet.withProperties({
|
|
429
|
-
"myProp1": base => {
|
|
430
|
-
const maxAggregation = base.pivotTo("lead").aggregate("employeeId:max");
|
|
431
|
-
expectTypeOf(maxAggregation).toEqualTypeOf;
|
|
432
|
-
maxAggregation.add(1);
|
|
433
|
-
maxAggregation.subtract(1);
|
|
434
|
-
maxAggregation.multiply(1);
|
|
435
|
-
maxAggregation.divide(1);
|
|
436
|
-
maxAggregation.abs();
|
|
437
|
-
maxAggregation.negate();
|
|
438
|
-
maxAggregation.max(1);
|
|
439
|
-
maxAggregation.min(1);
|
|
440
|
-
expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:sum")).toEqualTypeOf();
|
|
441
|
-
expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:avg")).toEqualTypeOf();
|
|
442
|
-
expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:min")).toEqualTypeOf();
|
|
443
|
-
const collectList = base.pivotTo("peeps").aggregate("employeeId:collectList");
|
|
444
|
-
expectTypeOf(collectList).toEqualTypeOf();
|
|
445
|
-
|
|
446
|
-
// @ts-expect-error
|
|
447
|
-
collectList.plus(1);
|
|
448
|
-
expectTypeOf(base.pivotTo("peeps").aggregate("employeeId:collectList")).toEqualTypeOf();
|
|
449
|
-
return maxAggregation;
|
|
450
|
-
}
|
|
451
|
-
});
|
|
452
|
-
});
|
|
453
|
-
it("correctly coerces numeric types", () => {
|
|
454
|
-
fauxObjectSet.withProperties({
|
|
455
|
-
"myProp1": base => {
|
|
456
|
-
const intAndLong = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("yearsOfExperience")).add(base.selectProperty("employeeId"));
|
|
457
|
-
expectTypeOf(intAndLong).toEqualTypeOf();
|
|
458
|
-
const intAndDouble = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("performanceScore")).add(base.selectProperty("employeeId"));
|
|
459
|
-
expectTypeOf(intAndDouble).toEqualTypeOf();
|
|
460
|
-
const longAndDouble = base.pivotTo("lead").selectProperty("yearsOfExperience").add(base.selectProperty("performanceScore")).add(base.selectProperty("yearsOfExperience"));
|
|
461
|
-
expectTypeOf(longAndDouble).toEqualTypeOf();
|
|
462
|
-
const longAndLong = base.pivotTo("lead").selectProperty("yearsOfExperience").add(base.selectProperty("yearsOfExperience"));
|
|
463
|
-
expectTypeOf(longAndLong).toEqualTypeOf();
|
|
464
|
-
const intAndInt = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("employeeId"));
|
|
465
|
-
expectTypeOf(intAndInt).toEqualTypeOf();
|
|
466
|
-
const intLongDoubleChain = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("yearsOfExperience")).add(base.selectProperty("employeeId")).add(base.selectProperty("performanceScore")).add(base.selectProperty("employeeId"));
|
|
467
|
-
expectTypeOf(intLongDoubleChain).toEqualTypeOf();
|
|
468
|
-
const shortAndIntReturnsInt = base.pivotTo("lead").selectProperty("rank").add(base.selectProperty("employeeId"));
|
|
469
|
-
expectTypeOf(shortAndIntReturnsInt).toEqualTypeOf();
|
|
470
|
-
const shortAndFloatReturnsDouble = base.pivotTo("lead").selectProperty("rank").add(base.selectProperty("hourlyRate"));
|
|
471
|
-
expectTypeOf(shortAndFloatReturnsDouble).toEqualTypeOf();
|
|
472
|
-
return intLongDoubleChain;
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
});
|
|
476
|
-
it("allows adding number literals as a double", () => {
|
|
477
|
-
fauxObjectSet.withProperties({
|
|
478
|
-
"myProp1": base => {
|
|
479
|
-
const plus = base.pivotTo("lead").selectProperty("employeeId").add(1);
|
|
480
|
-
expectTypeOf(plus).toEqualTypeOf();
|
|
481
|
-
return plus;
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
});
|
|
485
|
-
it("allows adding literals via base.constant", () => {
|
|
486
|
-
fauxObjectSet.withProperties({
|
|
487
|
-
"myProp1": base => {
|
|
488
|
-
const plus = base.pivotTo("lead").selectProperty("employeeId").add(base.constant.double(1));
|
|
489
|
-
expectTypeOf(plus).toEqualTypeOf();
|
|
490
|
-
const intPlusIntReturnsInt = base.pivotTo("lead").selectProperty("employeeId").add(base.constant.integer(1));
|
|
491
|
-
expectTypeOf(intPlusIntReturnsInt).toEqualTypeOf();
|
|
492
|
-
return plus;
|
|
493
|
-
}
|
|
494
|
-
});
|
|
495
|
-
});
|
|
496
|
-
it("allows correctly typed nested property definitions", () => {
|
|
497
|
-
fauxObjectSet.withProperties({
|
|
498
|
-
"myProp1": base => {
|
|
499
|
-
const nested = base.pivotTo("lead").selectProperty("employeeId").add(base.pivotTo("peeps").aggregate("employeeId:sum"));
|
|
500
|
-
expectTypeOf(nested).toEqualTypeOf();
|
|
501
|
-
return nested;
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
});
|
|
505
|
-
it("allows correctly types property keys off the linked OT", () => {
|
|
506
|
-
fauxObjectSet.withProperties({
|
|
507
|
-
"myProp1": base => {
|
|
508
|
-
const nested = base.pivotTo("lead").selectProperty("employeeId").add(base.selectProperty("performanceScore"));
|
|
509
|
-
expectTypeOf(nested).toEqualTypeOf();
|
|
510
|
-
return nested;
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
// it("allows correctly types property keys off the base OT", () => {});
|
|
516
|
-
});
|
|
517
|
-
describe("datetime expressions", () => {
|
|
518
|
-
it("provides correct methods off of datetime selections", () => {
|
|
519
|
-
fauxObjectSet.withProperties({
|
|
520
|
-
"myProp1": base => {
|
|
521
|
-
const selectedDatetime = base.pivotTo("lead").selectProperty("dateOfJoining");
|
|
522
|
-
expectTypeOf(selectedDatetime).toEqualTypeOf();
|
|
523
|
-
selectedDatetime.max(base.selectProperty("dateOfJoining"));
|
|
524
|
-
selectedDatetime.min(base.selectProperty("lastUpdated"));
|
|
525
|
-
expectTypeOf(base.pivotTo("lead").selectProperty("lastUpdated")).toEqualTypeOf();
|
|
526
|
-
return selectedDatetime;
|
|
527
|
-
}
|
|
528
|
-
});
|
|
529
|
-
});
|
|
530
|
-
it("correctly coerces datetime types", () => {
|
|
531
|
-
fauxObjectSet.withProperties({
|
|
532
|
-
"myProp1": base => {
|
|
533
|
-
const max = base.pivotTo("lead").selectProperty("dateOfJoining").max(base.selectProperty("lastUpdated"));
|
|
534
|
-
expectTypeOf(max).toEqualTypeOf();
|
|
535
|
-
const min = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.selectProperty("dateOfJoining"));
|
|
536
|
-
expectTypeOf(min).toEqualTypeOf();
|
|
537
|
-
return max;
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
});
|
|
541
|
-
it("allows adding literals via base.constant", () => {
|
|
542
|
-
fauxObjectSet.withProperties({
|
|
543
|
-
"myProp1": base => {
|
|
544
|
-
const dateAndDateReturnDate = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.constant.datetime("2025-01-01T00:00:00Z"));
|
|
545
|
-
expectTypeOf(dateAndDateReturnDate).toEqualTypeOf();
|
|
546
|
-
const dateAndTimeReturnTime = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.constant.timestamp("2025-01-01T00:00:00Z"));
|
|
547
|
-
expectTypeOf(dateAndTimeReturnTime).toEqualTypeOf();
|
|
548
|
-
return dateAndTimeReturnTime;
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
});
|
|
552
|
-
it("allows correctly typed nested property definitions", () => {
|
|
553
|
-
fauxObjectSet.withProperties({
|
|
554
|
-
"myProp1": base => {
|
|
555
|
-
const nested = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.pivotTo("lead").pivotTo("lead").selectProperty("lastUpdated"));
|
|
556
|
-
expectTypeOf(nested).toEqualTypeOf();
|
|
557
|
-
return nested;
|
|
558
|
-
}
|
|
559
|
-
});
|
|
560
|
-
});
|
|
561
|
-
it("allows correctly typed property keys off the linked OT", () => {
|
|
562
|
-
fauxObjectSet.withProperties({
|
|
563
|
-
"myProp1": base => {
|
|
564
|
-
const nested = base.pivotTo("lead").selectProperty("dateOfJoining").min(base.selectProperty("lastUpdated"));
|
|
565
|
-
expectTypeOf(nested).toEqualTypeOf();
|
|
566
|
-
return nested;
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
|
-
});
|
|
570
|
-
|
|
571
|
-
// it("allows correctly typed property keys off the base OT", () => {});
|
|
572
|
-
});
|
|
573
|
-
});
|
|
574
373
|
});
|
|
575
374
|
//# sourceMappingURL=ObjectSet.test.js.map
|