@osdk/api 2.1.0-beta.29 → 2.1.0-beta.30
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/aggregate/WhereClause.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListener.js +16 -1
- package/build/browser/objectSet/ObjectSetListener.js.map +1 -1
- package/build/browser/ontology/ActionDefinition.js.map +1 -1
- package/build/browser/ontology/ObjectOrInterface.js +1 -1
- package/build/browser/ontology/ObjectOrInterface.js.map +1 -1
- package/build/browser/ontology/WirePropertyTypes.js.map +1 -1
- package/build/browser/public/unstable.js +0 -1
- package/build/browser/public/unstable.js.map +1 -1
- package/build/cjs/{ObjectSet-0c-4-xgY.d.cts → ObjectSet-CLjcq5Mq.d.cts} +39 -37
- package/build/cjs/index.d.cts +6 -6
- package/build/cjs/public/unstable.cjs +0 -8
- package/build/cjs/public/unstable.cjs.map +1 -1
- package/build/cjs/public/unstable.d.cts +3 -10
- package/build/esm/aggregate/WhereClause.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListener.js +16 -1
- package/build/esm/objectSet/ObjectSetListener.js.map +1 -1
- package/build/esm/ontology/ActionDefinition.js.map +1 -1
- package/build/esm/ontology/ObjectOrInterface.js +1 -1
- package/build/esm/ontology/ObjectOrInterface.js.map +1 -1
- package/build/esm/ontology/WirePropertyTypes.js.map +1 -1
- package/build/esm/public/unstable.js +0 -1
- package/build/esm/public/unstable.js.map +1 -1
- package/build/types/aggregate/WhereClause.d.ts +4 -4
- package/build/types/index.d.ts +3 -4
- package/build/types/objectSet/ObjectSet.d.ts +4 -4
- package/build/types/objectSet/ObjectSetListener.d.ts +32 -36
- package/build/types/ontology/ActionDefinition.d.ts +3 -3
- package/build/types/ontology/ObjectOrInterface.d.ts +1 -1
- package/build/types/ontology/WirePropertyTypes.d.ts +2 -2
- package/build/types/public/unstable.d.ts +0 -1
- package/package.json +1 -1
- package/build/browser/experimental/subscribe.js +0 -22
- package/build/browser/experimental/subscribe.js.map +0 -1
- package/build/esm/experimental/subscribe.js +0 -22
- package/build/esm/experimental/subscribe.js.map +0 -1
- package/build/types/experimental/subscribe.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @osdk/api
|
|
2
2
|
|
|
3
|
+
## 2.1.0-beta.30
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 966d408: Rename type for base action parameter types.
|
|
8
|
+
- f03e39f: Add a namespace type for listeners.
|
|
9
|
+
- 1591f04: Rename base property types.
|
|
10
|
+
- 785f663: Rename namespace so not exported from api package.
|
|
11
|
+
- 2d5e648: Remove subscribe from experimental gate.
|
|
12
|
+
|
|
3
13
|
## 2.1.0-beta.29
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WhereClause.js","names":["DistanceUnitMapping"],"sources":["WhereClause.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 { BBox, Point, Polygon } from \"geojson\";\nimport type {\n ObjectOrInterfaceDefinition,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectMetadata,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"WhereClause.js","names":["DistanceUnitMapping"],"sources":["WhereClause.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 { BBox, Point, Polygon } from \"geojson\";\nimport type {\n ObjectOrInterfaceDefinition,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectMetadata,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { BaseWirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\nimport type { IsNever } from \"../OsdkObjectFrom.js\";\nimport type { ArrayFilter } from \"./ArrayFilter.js\";\nimport type { BaseFilter } from \"./BaseFilter.js\";\nimport type { BooleanFilter } from \"./BooleanFilter.js\";\nimport type { DatetimeFilter } from \"./DatetimeFilter.js\";\nimport type { GeoFilter } from \"./GeoFilter.js\";\nimport type { Just } from \"./Just.js\";\nimport type { NumberFilter } from \"./NumberFilter.js\";\nimport type { StringFilter } from \"./StringFilter.js\";\n\nexport type PossibleWhereClauseFilters =\n | \"$gt\"\n | \"$eq\"\n | \"$ne\"\n | \"$isNull\"\n | \"$contains\"\n | \"$gte\"\n | \"$lt\"\n | \"$lte\"\n | \"$within\"\n | \"$in\"\n | \"$intersects\"\n | \"$startsWith\"\n | \"$containsAllTermsInOrder\"\n | \"$containsAnyTerm\"\n | \"$containsAllTerms\";\n\n// the value side of this needs to match DistanceUnit from @osdk/internal.foundry but we don't\n// want the dependency\nexport const DistanceUnitMapping: {\n centimeter: \"CENTIMETERS\";\n centimeters: \"CENTIMETERS\";\n cm: \"CENTIMETERS\";\n meter: \"METERS\";\n meters: \"METERS\";\n m: \"METERS\";\n kilometer: \"KILOMETERS\";\n kilometers: \"KILOMETERS\";\n km: \"KILOMETERS\";\n inch: \"INCHES\";\n inches: \"INCHES\";\n foot: \"FEET\";\n feet: \"FEET\";\n yard: \"YARDS\";\n yards: \"YARDS\";\n mile: \"MILES\";\n miles: \"MILES\";\n nautical_mile: \"NAUTICAL_MILES\";\n nauticalMile: \"NAUTICAL_MILES\";\n \"nautical miles\": \"NAUTICAL_MILES\";\n} = {\n \"centimeter\": \"CENTIMETERS\",\n \"centimeters\": \"CENTIMETERS\",\n \"cm\": \"CENTIMETERS\",\n \"meter\": \"METERS\",\n \"meters\": \"METERS\",\n \"m\": \"METERS\",\n \"kilometer\": \"KILOMETERS\",\n \"kilometers\": \"KILOMETERS\",\n \"km\": \"KILOMETERS\",\n \"inch\": \"INCHES\",\n \"inches\": \"INCHES\",\n \"foot\": \"FEET\",\n \"feet\": \"FEET\",\n \"yard\": \"YARDS\",\n \"yards\": \"YARDS\",\n \"mile\": \"MILES\",\n \"miles\": \"MILES\",\n \"nautical_mile\": \"NAUTICAL_MILES\",\n \"nauticalMile\": \"NAUTICAL_MILES\",\n \"nautical miles\": \"NAUTICAL_MILES\",\n} satisfies Record<\n string,\n | \"CENTIMETERS\"\n | \"METERS\"\n | \"KILOMETERS\"\n | \"INCHES\"\n | \"FEET\"\n | \"YARDS\"\n | \"MILES\"\n | \"NAUTICAL_MILES\"\n>;\n\nexport type GeoFilter_Within = {\n \"$within\":\n | {\n $distance: [number, keyof typeof DistanceUnitMapping];\n $of: [number, number] | Readonly<Point>;\n $bbox?: never;\n $polygon?: never;\n }\n | {\n $bbox: BBox;\n $distance?: never;\n $of?: never;\n $polygon?: never;\n }\n | BBox\n | {\n $polygon: Polygon[\"coordinates\"];\n $bbox?: never;\n $distance?: never;\n $of?: never;\n }\n | Polygon;\n};\n\nexport type GeoFilter_Intersects = {\n \"$intersects\":\n | {\n $bbox: BBox;\n $polygon?: never;\n }\n | BBox\n | {\n $polygon: Polygon[\"coordinates\"];\n $bbox?: never;\n }\n | Polygon;\n};\n\ntype FilterFor<PD extends ObjectMetadata.Property> = PD[\"multiplicity\"] extends\n true\n ? (PD[\"type\"] extends\n \"string\" | \"geopoint\" | \"geoshape\" | \"datetime\" | \"timestamp\"\n ? ArrayFilter<string>\n : (PD[\"type\"] extends boolean ? ArrayFilter<boolean>\n : ArrayFilter<number>))\n : PD[\"type\"] extends Record<string, BaseWirePropertyTypes> ?\n | StructFilter<PD[\"type\"]>\n | BaseFilter<string>\n : (PD[\"type\"] extends \"string\" ? StringFilter\n : PD[\"type\"] extends \"geopoint\" | \"geoshape\" ? GeoFilter\n : PD[\"type\"] extends \"datetime\" | \"timestamp\" ? DatetimeFilter\n : PD[\"type\"] extends \"boolean\" ? BooleanFilter\n : PD[\"type\"] extends\n \"double\" | \"integer\" | \"long\" | \"float\" | \"decimal\" | \"byte\"\n ? NumberFilter\n : BaseFilter<string>); // FIXME we need to represent all types\n\ntype StructFilterOpts<ST extends Record<string, BaseWirePropertyTypes>> = {\n [K in keyof ST]?: FilterFor<{ \"type\": ST[K] }>;\n};\ntype StructFilter<ST extends Record<string, BaseWirePropertyTypes>> = {\n [K in keyof ST]: Just<K, StructFilterOpts<ST>>;\n}[keyof ST];\n\nexport interface AndWhereClause<\n T extends ObjectOrInterfaceDefinition,\n> {\n $and: WhereClause<T>[];\n}\n\nexport interface OrWhereClause<\n T extends ObjectOrInterfaceDefinition,\n> {\n $or: WhereClause<T>[];\n}\n\nexport interface NotWhereClause<\n T extends ObjectOrInterfaceDefinition,\n> {\n $not: WhereClause<T>;\n}\n\nexport type WhereClause<\n T extends ObjectOrInterfaceDefinition,\n> =\n | OrWhereClause<T>\n | AndWhereClause<T>\n | NotWhereClause<T>\n | (IsNever<keyof CompileTimeMetadata<T>[\"properties\"]> extends true\n ? Record<string, never>\n : {\n [P in keyof CompileTimeMetadata<T>[\"properties\"]]?: FilterFor<\n CompileTimeMetadata<T>[\"properties\"][P]\n >;\n });\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsCA;AACA;AACA,OAAO,MAAMA,mBAqBZ,GAAG;EACF,YAAY,EAAE,aAAa;EAC3B,aAAa,EAAE,aAAa;EAC5B,IAAI,EAAE,aAAa;EACnB,OAAO,EAAE,QAAQ;EACjB,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,QAAQ;EACb,WAAW,EAAE,YAAY;EACzB,YAAY,EAAE,YAAY;EAC1B,IAAI,EAAE,YAAY;EAClB,MAAM,EAAE,QAAQ;EAChB,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,MAAM;EACd,MAAM,EAAE,MAAM;EACd,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,OAAO;EAChB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,OAAO;EAChB,eAAe,EAAE,gBAAgB;EACjC,cAAc,EAAE,gBAAgB;EAChC,gBAAgB,EAAE;AACpB,CAUC;;AAyD0B","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 { 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 {
|
|
1
|
+
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport type { DerivedProperty } from \"./derivedProperties/DerivedProperty.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type { Media, MediaMetadata, MediaReference } from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type { OsdkBase, PrimaryKeyType } from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\n\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,mBAAmB,QAAQ,4BAA4B;AAahE,SAASC,eAAe,QAAQ,4BAA4B;AA8B5D,SAASC,IAAI,QAAQ,oBAAoB;AA6CzC,SAASC,yBAAyB,QAAQ,4BAA4B;AAStE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedProperty } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type { ExtractOptions, Osdk } from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type {\n ObjectSetListener,\n ObjectSetListenerOptions,\n} from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {},\n> = D extends Record<string, SimplePropertyDef>\n ? ObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>\n : Q;\n\ntype ExtractRdp<\n D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>,\n> = D extends Record<string, SimplePropertyDef> ? D : {};\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\n// TODO MOVE THIS\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n readonly fetchPage: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >;\n\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n readonly fetchPageWithErrors: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n readonly asyncIter: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S>,\n ) => AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >;\n}\n\ninterface InterfaceObjectSet<\n Q extends InterfaceDefinition,\n> extends MinimalObjectSet<Q> {\n}\n\ninterface WithProperties<\n Q extends ObjectOrInterfaceDefinition = any,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly withProperties: <\n NEW extends Record<string, SimplePropertyDef>,\n >(\n clause: { [K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> =\n ObjectSet<Q, any>,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, UNUSED_OR_RDP>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CompileTimeMetadata<LinkedType<Q, L>>[\"objectSet\"]; // ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n readonly fetchOne: Q extends ObjectTypeDefinition ? <\n const L extends PropertyKeys<Q, RDPs>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n : never;\n\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetListener<Q, P>,\n opts?: ObjectSetListenerOptions<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition,\n> extends\n MinimalObjectSet<Q, D>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<MERGED>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedProperty } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n DerivedObjectOrInterfaceDefinition,\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type { ExtractOptions, Osdk } from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {},\n> = D extends Record<string, SimplePropertyDef>\n ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>\n : Q;\n\ntype ExtractRdp<\n D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>,\n> = D extends Record<string, SimplePropertyDef> ? D : {};\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\n// TODO MOVE THIS\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n readonly fetchPage: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >;\n\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n readonly fetchPageWithErrors: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n readonly asyncIter: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S>,\n ) => AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >;\n}\n\ninterface InterfaceObjectSet<\n Q extends InterfaceDefinition,\n> extends MinimalObjectSet<Q> {\n}\n\ninterface WithProperties<\n Q extends ObjectOrInterfaceDefinition = any,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly withProperties: <\n NEW extends Record<string, SimplePropertyDef>,\n >(\n clause: { [K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> =\n ObjectSet<Q, any>,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, UNUSED_OR_RDP>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CompileTimeMetadata<LinkedType<Q, L>>[\"objectSet\"]; // ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n readonly fetchOne: Q extends ObjectTypeDefinition ? <\n const L extends PropertyKeys<Q, RDPs>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n : never;\n\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetSubscription.Listener<Q, P>,\n opts?: ObjectSetSubscription.Options<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition,\n> extends\n MinimalObjectSet<Q, D>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<MERGED>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export let ObjectSetSubscription;
|
|
2
17
|
//# sourceMappingURL=ObjectSetListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSetListener.js","names":[],"sources":["ObjectSetListener.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 {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Osdk } from \"../OsdkObjectFrom.js\";\n\nexport interface
|
|
1
|
+
{"version":3,"file":"ObjectSetListener.js","names":["ObjectSetSubscription"],"sources":["ObjectSetListener.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 {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Osdk } from \"../OsdkObjectFrom.js\";\n\nexport namespace ObjectSetSubscription {\n export interface Listener<\n O extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<O> = PropertyKeys<O>,\n > {\n /**\n * Specific objects have changed and can be immediately updated\n */\n onChange?: (\n objectUpdate: ObjectUpdate<O, P>,\n ) => void;\n\n /**\n * The subscription has been successfully established and updates can be expected to be received.\n */\n onSuccessfulSubscription?: () => void;\n\n /**\n * The ObjectSet has become outdated and should be re-fetched in its entirety.\n * This is also sent when the subscription is first initialized.\n */\n onOutOfDate?: () => void;\n\n /**\n * There was a fatal error with the subscription process. The subscription will close or will not be established.\n */\n onError?: (errors: { subscriptionClosed: boolean; error: any }) => void;\n }\n\n /**\n * Options for subscribing to an ObjectSet.\n *\n * properties - The properties to request a subscription for. Requesting specific properties limits the possible properties\n * that can be returned from the subscription. If not provided, all properties will be requested and potentially be returned on updates.\n */\n export interface Options<\n O extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<O> = PropertyKeys<O>,\n > {\n properties?: Array<P>;\n }\n}\n\ntype ObjectUpdate<\n O extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<O>,\n> = {\n object: Osdk.Instance<O, never, P>;\n state: \"ADDED_OR_UPDATED\" | \"REMOVED\";\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAsBiBA,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionDefinition.js","names":["ActionMetadata"],"sources":["ActionDefinition.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 { OsdkMetadata } from \"../OsdkMetadata.js\";\nimport type { InterfaceDefinition } from \"./InterfaceDefinition.js\";\nimport type {\n ObjectTypeDefinition,\n ReleaseStatus,\n} from \"./ObjectTypeDefinition.js\";\n\nexport interface ActionMetadata {\n type: \"action\";\n apiName: string;\n description?: string;\n displayName?: string;\n parameters: Record<any, ActionMetadata.Parameter<any>>;\n modifiedEntities?: Partial<\n Record<any, {\n created: boolean;\n modified: boolean;\n }>\n >;\n status: ReleaseStatus;\n rid: string;\n}\n\nexport namespace ActionMetadata {\n export interface Parameter<\n T_Target extends ObjectTypeDefinition = never,\n > {\n type:\n |
|
|
1
|
+
{"version":3,"file":"ActionDefinition.js","names":["ActionMetadata"],"sources":["ActionDefinition.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 { OsdkMetadata } from \"../OsdkMetadata.js\";\nimport type { InterfaceDefinition } from \"./InterfaceDefinition.js\";\nimport type {\n ObjectTypeDefinition,\n ReleaseStatus,\n} from \"./ObjectTypeDefinition.js\";\n\nexport interface ActionMetadata {\n type: \"action\";\n apiName: string;\n description?: string;\n displayName?: string;\n parameters: Record<any, ActionMetadata.Parameter<any>>;\n modifiedEntities?: Partial<\n Record<any, {\n created: boolean;\n modified: boolean;\n }>\n >;\n status: ReleaseStatus;\n rid: string;\n}\n\nexport namespace ActionMetadata {\n export interface Parameter<\n T_Target extends ObjectTypeDefinition = never,\n > {\n type:\n | DataType.BaseActionParameterTypes\n | DataType.Object<any>\n | DataType.ObjectSet<any>\n | DataType.Interface<any>\n | DataType.Struct<any>;\n description?: string;\n multiplicity?: boolean;\n nullable?: boolean;\n }\n\n export namespace DataType {\n export type BaseActionParameterTypes =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\";\n\n export interface Object<\n T_Target extends ObjectTypeDefinition = never,\n > {\n __OsdkTargetType?: T_Target;\n type: \"object\";\n object: T_Target[\"apiName\"];\n }\n\n export interface Interface<T_Target extends InterfaceDefinition = never> {\n __OsdkTargetType?: T_Target;\n type: \"interface\";\n interface: T_Target[\"apiName\"];\n }\n\n export interface ObjectSet<\n T_Target extends ObjectTypeDefinition = never,\n > {\n __OsdkTargetType?: T_Target;\n type: \"objectSet\";\n objectSet: T_Target[\"apiName\"];\n }\n\n export interface Struct<\n T extends Record<string, DataType.BaseActionParameterTypes>,\n > {\n type: \"struct\";\n struct: T;\n }\n }\n}\n\nexport interface ActionCompileTimeMetadata<T> {\n signatures: T;\n}\n\nexport interface ActionDefinition<\n T_signatures = never,\n> {\n type: \"action\";\n apiName: string;\n osdkMetadata?: OsdkMetadata;\n __DefinitionMetadata?:\n & ActionCompileTimeMetadata<T_signatures>\n & ActionMetadata;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAuCiBA,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectOrInterface.js","names":["
|
|
1
|
+
{"version":3,"file":"ObjectOrInterface.js","names":["DerivedObjectOrInterfaceDefinition"],"sources":["ObjectOrInterface.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 { InterfaceDefinition } from \"./InterfaceDefinition.js\";\nimport type { ObjectTypeDefinition } from \"./ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"./SimplePropertyDef.js\";\n\nexport type ObjectOrInterfaceDefinition =\n | ObjectTypeDefinition\n | InterfaceDefinition;\n\nexport namespace DerivedObjectOrInterfaceDefinition {\n export type WithDerivedProperties<\n K extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n > = {\n __DefinitionMetadata: {\n properties: {\n [T in keyof D]: SimplePropertyDef.ToPropertyDef<D[T]>;\n };\n props: {\n [T in keyof D]: SimplePropertyDef.ToRuntimeProperty<D[T]>;\n };\n };\n } & K;\n}\n\nexport type PropertyKeys<\n O extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> =\n & (keyof NonNullable<O[\"__DefinitionMetadata\"]>[\"properties\"] | keyof RDPs)\n & string;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAwBiBA,kCAAkC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WirePropertyTypes.js","names":[],"sources":["WirePropertyTypes.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 WirePropertyTypes =\n |
|
|
1
|
+
{"version":3,"file":"WirePropertyTypes.js","names":[],"sources":["WirePropertyTypes.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 WirePropertyTypes =\n | BaseWirePropertyTypes\n | Record<string, BaseWirePropertyTypes>;\n\nexport type BaseWirePropertyTypes =\n | \"string\"\n | \"datetime\"\n | \"double\"\n | \"boolean\"\n | \"integer\"\n | \"timestamp\"\n | \"short\"\n | \"long\"\n | \"float\"\n | \"decimal\"\n | \"byte\"\n | \"marking\"\n | \"mediaReference\"\n | \"numericTimeseries\"\n | \"stringTimeseries\"\n | \"sensorTimeseries\"\n | \"attachment\"\n | \"geopoint\"\n | \"geoshape\"\n | \"geotimeSeriesReference\";\n"],"mappings":"","ignoreList":[]}
|
|
@@ -17,5 +17,4 @@
|
|
|
17
17
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from "../experimental/createMediaReference.js";
|
|
18
18
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from "../experimental/fetchOneByRid.js";
|
|
19
19
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from "../experimental/getBulkLinks.js";
|
|
20
|
-
export { __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe } from "../experimental/subscribe.js";
|
|
21
20
|
//# sourceMappingURL=unstable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unstable.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks"
|
|
1
|
+
{"version":3,"file":"unstable.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks"],"sources":["unstable.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 type { Experiment, ExperimentFns } from \"../experimental/Experiment.js\";\n\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"../experimental/createMediaReference.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from \"../experimental/fetchOneByRid.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from \"../experimental/getBulkLinks.js\";\n\nexport type { EXPERIMENTAL_BulkLinkResult } from \"../objectSet/BulkLinkResult.js\";\nexport type { MinimalObjectSet } from \"../objectSet/ObjectSet.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,uDAAuD,QAAQ,yCAAyC;AACjH,SAASC,gDAAgD,QAAQ,kCAAkC;AACnG,SAASC,+CAA+C,QAAQ,iCAAiC","ignoreList":[]}
|
|
@@ -252,8 +252,8 @@ type PrimaryKeyTypes = "string" | "datetime" | "double" | "boolean" | "integer"
|
|
|
252
252
|
|
|
253
253
|
type VersionString<Major extends number, Minor extends number, Patch extends number> = `${Major}.${Minor}.${Patch}`;
|
|
254
254
|
|
|
255
|
-
type WirePropertyTypes =
|
|
256
|
-
type
|
|
255
|
+
type WirePropertyTypes = BaseWirePropertyTypes | Record<string, BaseWirePropertyTypes>;
|
|
256
|
+
type BaseWirePropertyTypes = "string" | "datetime" | "double" | "boolean" | "integer" | "timestamp" | "short" | "long" | "float" | "decimal" | "byte" | "marking" | "mediaReference" | "numericTimeseries" | "stringTimeseries" | "sensorTimeseries" | "attachment" | "geopoint" | "geoshape" | "geotimeSeriesReference";
|
|
257
257
|
|
|
258
258
|
type CompileTimeMetadata<T extends {
|
|
259
259
|
__DefinitionMetadata?: {};
|
|
@@ -355,7 +355,7 @@ declare namespace SimplePropertyDef {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
type ObjectOrInterfaceDefinition = ObjectTypeDefinition | InterfaceDefinition;
|
|
358
|
-
declare namespace
|
|
358
|
+
declare namespace DerivedObjectOrInterfaceDefinition {
|
|
359
359
|
type WithDerivedProperties<K extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef>> = {
|
|
360
360
|
__DefinitionMetadata: {
|
|
361
361
|
properties: {
|
|
@@ -871,13 +871,13 @@ type GeoFilter_Intersects = {
|
|
|
871
871
|
$bbox?: never;
|
|
872
872
|
} | Polygon;
|
|
873
873
|
};
|
|
874
|
-
type FilterFor<PD extends ObjectMetadata.Property> = PD["multiplicity"] extends true ? (PD["type"] extends "string" | "geopoint" | "geoshape" | "datetime" | "timestamp" ? ArrayFilter<string> : (PD["type"] extends boolean ? ArrayFilter<boolean> : ArrayFilter<number>)) : PD["type"] extends Record<string,
|
|
875
|
-
type StructFilterOpts<ST extends Record<string,
|
|
874
|
+
type FilterFor<PD extends ObjectMetadata.Property> = PD["multiplicity"] extends true ? (PD["type"] extends "string" | "geopoint" | "geoshape" | "datetime" | "timestamp" ? ArrayFilter<string> : (PD["type"] extends boolean ? ArrayFilter<boolean> : ArrayFilter<number>)) : PD["type"] extends Record<string, BaseWirePropertyTypes> ? StructFilter<PD["type"]> | BaseFilter<string> : (PD["type"] extends "string" ? StringFilter : PD["type"] extends "geopoint" | "geoshape" ? GeoFilter : PD["type"] extends "datetime" | "timestamp" ? DatetimeFilter : PD["type"] extends "boolean" ? BooleanFilter : PD["type"] extends "double" | "integer" | "long" | "float" | "decimal" | "byte" ? NumberFilter : BaseFilter<string>);
|
|
875
|
+
type StructFilterOpts<ST extends Record<string, BaseWirePropertyTypes>> = {
|
|
876
876
|
[K in keyof ST]?: FilterFor<{
|
|
877
877
|
"type": ST[K];
|
|
878
878
|
}>;
|
|
879
879
|
};
|
|
880
|
-
type StructFilter<ST extends Record<string,
|
|
880
|
+
type StructFilter<ST extends Record<string, BaseWirePropertyTypes>> = {
|
|
881
881
|
[K in keyof ST]: Just<K, StructFilterOpts<ST>>;
|
|
882
882
|
}[keyof ST];
|
|
883
883
|
interface AndWhereClause<T extends ObjectOrInterfaceDefinition> {
|
|
@@ -935,43 +935,45 @@ interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
|
|
|
935
935
|
};
|
|
936
936
|
}
|
|
937
937
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
938
|
+
declare namespace ObjectSetSubscription {
|
|
939
|
+
interface Listener<O extends ObjectOrInterfaceDefinition, P extends PropertyKeys<O> = PropertyKeys<O>> {
|
|
940
|
+
/**
|
|
941
|
+
* Specific objects have changed and can be immediately updated
|
|
942
|
+
*/
|
|
943
|
+
onChange?: (objectUpdate: ObjectUpdate<O, P>) => void;
|
|
944
|
+
/**
|
|
945
|
+
* The subscription has been successfully established and updates can be expected to be received.
|
|
946
|
+
*/
|
|
947
|
+
onSuccessfulSubscription?: () => void;
|
|
948
|
+
/**
|
|
949
|
+
* The ObjectSet has become outdated and should be re-fetched in its entirety.
|
|
950
|
+
* This is also sent when the subscription is first initialized.
|
|
951
|
+
*/
|
|
952
|
+
onOutOfDate?: () => void;
|
|
953
|
+
/**
|
|
954
|
+
* There was a fatal error with the subscription process. The subscription will close or will not be established.
|
|
955
|
+
*/
|
|
956
|
+
onError?: (errors: {
|
|
957
|
+
subscriptionClosed: boolean;
|
|
958
|
+
error: any;
|
|
959
|
+
}) => void;
|
|
960
|
+
}
|
|
952
961
|
/**
|
|
953
|
-
*
|
|
962
|
+
* Options for subscribing to an ObjectSet.
|
|
963
|
+
*
|
|
964
|
+
* properties - The properties to request a subscription for. Requesting specific properties limits the possible properties
|
|
965
|
+
* that can be returned from the subscription. If not provided, all properties will be requested and potentially be returned on updates.
|
|
954
966
|
*/
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
}) => void;
|
|
967
|
+
interface Options<O extends ObjectOrInterfaceDefinition, P extends PropertyKeys<O> = PropertyKeys<O>> {
|
|
968
|
+
properties?: Array<P>;
|
|
969
|
+
}
|
|
959
970
|
}
|
|
960
971
|
type ObjectUpdate<O extends ObjectOrInterfaceDefinition, P extends PropertyKeys<O>> = {
|
|
961
972
|
object: Osdk.Instance<O, never, P>;
|
|
962
973
|
state: "ADDED_OR_UPDATED" | "REMOVED";
|
|
963
974
|
};
|
|
964
|
-
/**
|
|
965
|
-
* Options for subscribing to an ObjectSet.
|
|
966
|
-
*
|
|
967
|
-
* properties - The properties to request a subscription for. Requesting specific properties limits the possible properties
|
|
968
|
-
* that can be returned from the subscription. If not provided, all properties will be requested and potentially be returned on updates.
|
|
969
|
-
*/
|
|
970
|
-
interface ObjectSetListenerOptions<O extends ObjectOrInterfaceDefinition, P extends PropertyKeys<O> = PropertyKeys<O>> {
|
|
971
|
-
properties?: Array<P>;
|
|
972
|
-
}
|
|
973
975
|
|
|
974
|
-
type MergeObjectSet<Q extends ObjectOrInterfaceDefinition, D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {}> = D extends Record<string, SimplePropertyDef> ?
|
|
976
|
+
type MergeObjectSet<Q extends ObjectOrInterfaceDefinition, D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {}> = D extends Record<string, SimplePropertyDef> ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D> : Q;
|
|
975
977
|
type ExtractRdp<D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>> = D extends Record<string, SimplePropertyDef> ? D : {};
|
|
976
978
|
interface MinimalObjectSet<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> extends BaseObjectSet<Q>, FetchPage<Q, RDPs>, AsyncIter<Q, RDPs>, Where<Q, RDPs> {
|
|
977
979
|
}
|
|
@@ -1131,11 +1133,11 @@ interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1131
1133
|
* @param opts - Options to modify what properties are returned on subscription updates.
|
|
1132
1134
|
* @returns an object containing a function to unsubscribe.
|
|
1133
1135
|
*/
|
|
1134
|
-
readonly subscribe: <const P extends PropertyKeys<Q>>(listener:
|
|
1136
|
+
readonly subscribe: <const P extends PropertyKeys<Q>>(listener: ObjectSetSubscription.Listener<Q, P>, opts?: ObjectSetSubscription.Options<Q, P>) => {
|
|
1135
1137
|
unsubscribe: () => void;
|
|
1136
1138
|
};
|
|
1137
1139
|
}
|
|
1138
1140
|
interface ObjectSetCleanedTypes<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef>, MERGED extends ObjectOrInterfaceDefinition> extends MinimalObjectSet<Q, D>, WithProperties<Q, D>, Aggregate<MERGED>, SetArithmetic<MERGED>, PivotTo<MERGED>, FetchOne<Q, D>, Subscribe<MERGED> {
|
|
1139
1141
|
}
|
|
1140
1142
|
|
|
1141
|
-
export {
|
|
1143
|
+
export { type PropertyDef as $, type Attachment as A, type SelectArgToKeys as B, type FetchPageResult as C, DistanceUnitMapping as D, type SingleOsdkResult as E, type FetchPageArgs as F, type GeoFilterOptions as G, type Media as H, type InterfaceDefinition as I, type MediaMetadata as J, isOk as K, type Result as L, type MediaReference as M, NullabilityAdherence as N, type ObjectTypeDefinition as O, type PropertyValueWireToClient as P, type BaseObjectSet as Q, type ReleaseStatus as R, type SingleLinkAccessor as S, ObjectSetSubscription as T, type InterfaceMetadata as U, type ValidAggregationKeys as V, type WhereClause as W, type ObjectOrInterfaceDefinition as X, type PropertyKeys as Y, type CompileTimeMetadata as Z, ObjectMetadata as _, type AttachmentUpload as a, type VersionBound as a0, type BaseWirePropertyTypes as a1, type WirePropertyTypes as a2, type PrimaryKeyType as a3, type ConvertProps as a4, Osdk as a5, type PageResult as a6, TimeseriesDurationMapping as a7, type GeotimeSeriesProperty as a8, type TimeSeriesPoint as a9, type TimeSeriesProperty as aa, type TimeSeriesQuery as ab, type LinkedType as ac, type LinkNames as ad, type ExtractOptions as ae, type MinimalObjectSet as af, type OsdkBase as b, type OsdkObjectPrimaryKeyType as c, type ObjectSet as d, type OsdkMetadata as e, type PrimaryKeyTypes as f, type AggregateOpts as g, type AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy as h, type AggregationResultsWithGroups as i, type AggregationResultsWithoutGroups as j, type AggregationClause as k, type AggregationsResults as l, type GeoFilter_Intersects as m, type GeoFilter_Within as n, type PossibleWhereClauseFilters as o, type OsdkObjectPropertyType as p, type OsdkObjectLinksObject as q, DerivedProperty as r, DurationMapping as s, type AllGroupByValues as t, type GroupByClause as u, type GroupByRange as v, type AsyncIterArgs as w, type Augment as x, type Augments as y, type SelectArg as z };
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Attachment, M as MediaReference, a as AttachmentUpload, O as ObjectTypeDefinition, b as OsdkBase, c as OsdkObjectPrimaryKeyType, d as ObjectSet, I as InterfaceDefinition, R as ReleaseStatus, e as OsdkMetadata, P as PropertyValueWireToClient, f as PrimaryKeyTypes } from './ObjectSet-
|
|
2
|
-
export { g as AggregateOpts, h as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, k as AggregationClause, i as AggregationResultsWithGroups, j as AggregationResultsWithoutGroups, l as AggregationsResults, t as AllGroupByValues, w as AsyncIterArgs, x as Augment, y as Augments, Q as BaseObjectSet,
|
|
1
|
+
import { A as Attachment, M as MediaReference, a as AttachmentUpload, O as ObjectTypeDefinition, b as OsdkBase, c as OsdkObjectPrimaryKeyType, d as ObjectSet, I as InterfaceDefinition, R as ReleaseStatus, e as OsdkMetadata, P as PropertyValueWireToClient, f as PrimaryKeyTypes } from './ObjectSet-CLjcq5Mq.cjs';
|
|
2
|
+
export { g as AggregateOpts, h as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, k as AggregationClause, i as AggregationResultsWithGroups, j as AggregationResultsWithoutGroups, l as AggregationsResults, t as AllGroupByValues, w as AsyncIterArgs, x as Augment, y as Augments, Q as BaseObjectSet, a1 as BaseWirePropertyTypes, Z as CompileTimeMetadata, a4 as ConvertProps, r as DerivedProperty, D as DistanceUnitMapping, s as DurationMapping, F as FetchPageArgs, C as FetchPageResult, G as GeoFilterOptions, m as GeoFilter_Intersects, n as GeoFilter_Within, a8 as GeotimeSeriesProperty, u as GroupByClause, v as GroupByRange, U as InterfaceMetadata, ad as LinkNames, ac as LinkedType, H as Media, J as MediaMetadata, N as NullabilityAdherence, _ as ObjectMetadata, X as ObjectOrInterfaceDefinition, T as ObjectSetSubscription, a5 as Osdk, q as OsdkObjectLinksObject, p as OsdkObjectPropertyType, a6 as PageResult, o as PossibleWhereClauseFilters, a3 as PrimaryKeyType, $ as PropertyDef, Y as PropertyKeys, L as Result, z as SelectArg, B as SelectArgToKeys, S as SingleLinkAccessor, E as SingleOsdkResult, a9 as TimeSeriesPoint, aa as TimeSeriesProperty, ab as TimeSeriesQuery, a7 as TimeseriesDurationMapping, V as ValidAggregationKeys, a0 as VersionBound, W as WhereClause, a2 as WirePropertyTypes, K as isOk } from './ObjectSet-CLjcq5Mq.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -222,12 +222,13 @@ interface ActionMetadata {
|
|
|
222
222
|
}
|
|
223
223
|
declare namespace ActionMetadata {
|
|
224
224
|
interface Parameter<T_Target extends ObjectTypeDefinition = never> {
|
|
225
|
-
type:
|
|
225
|
+
type: DataType.BaseActionParameterTypes | DataType.Object<any> | DataType.ObjectSet<any> | DataType.Interface<any> | DataType.Struct<any>;
|
|
226
226
|
description?: string;
|
|
227
227
|
multiplicity?: boolean;
|
|
228
228
|
nullable?: boolean;
|
|
229
229
|
}
|
|
230
230
|
namespace DataType {
|
|
231
|
+
type BaseActionParameterTypes = "boolean" | "string" | "integer" | "long" | "double" | "datetime" | "timestamp" | "attachment" | "marking" | "mediaReference" | "objectType";
|
|
231
232
|
interface Object<T_Target extends ObjectTypeDefinition = never> {
|
|
232
233
|
__OsdkTargetType?: T_Target;
|
|
233
234
|
type: "object";
|
|
@@ -243,7 +244,7 @@ declare namespace ActionMetadata {
|
|
|
243
244
|
type: "objectSet";
|
|
244
245
|
objectSet: T_Target["apiName"];
|
|
245
246
|
}
|
|
246
|
-
interface Struct<T extends Record<string,
|
|
247
|
+
interface Struct<T extends Record<string, DataType.BaseActionParameterTypes>> {
|
|
247
248
|
type: "struct";
|
|
248
249
|
struct: T;
|
|
249
250
|
}
|
|
@@ -258,7 +259,6 @@ interface ActionDefinition<T_signatures = never> {
|
|
|
258
259
|
osdkMetadata?: OsdkMetadata;
|
|
259
260
|
__DefinitionMetadata?: ActionCompileTimeMetadata<T_signatures> & ActionMetadata;
|
|
260
261
|
}
|
|
261
|
-
type ValidBaseActionParameterTypes = "boolean" | "string" | "integer" | "long" | "double" | "datetime" | "timestamp" | "attachment" | "marking" | "mediaReference" | "objectType";
|
|
262
262
|
|
|
263
263
|
interface OntologyMetadata<_NEVER_USED_KEPT_FOR_BACKCOMPAT = any> {
|
|
264
264
|
expectsClientVersion?: _NEVER_USED_KEPT_FOR_BACKCOMPAT;
|
|
@@ -377,4 +377,4 @@ declare namespace QueryResult {
|
|
|
377
377
|
type ObjectSetType<T extends ObjectTypeDefinition> = ObjectSet<T>;
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
-
export { type ActionDefinition, type ActionEditResponse, ActionMetadata, ActionParam, type ActionReturnTypeForOptions, type ActionValidationResponse, type AllowedBucketKeyTypes, type AllowedBucketTypes, type ApplyActionOptions, type ApplyBatchActionOptions, Attachment, AttachmentUpload, type DataValueClientToWire, type DataValueWireToClient, InterfaceDefinition, MediaReference, type ObjectQueryDataType, type ObjectSet, type ObjectSetQueryDataType, ObjectTypeDefinition, type OntologyMetadata, OsdkBase, type OsdkObject, PrimaryKeyTypes, PropertyValueWireToClient, type QueryDataTypeDefinition, type QueryDefinition, type QueryMetadata, QueryParam, type QueryParameterDefinition, QueryResult, type ThreeDimensionalQueryAggregationDefinition, type TwoDimensionalQueryAggregationDefinition
|
|
380
|
+
export { type ActionDefinition, type ActionEditResponse, ActionMetadata, ActionParam, type ActionReturnTypeForOptions, type ActionValidationResponse, type AllowedBucketKeyTypes, type AllowedBucketTypes, type ApplyActionOptions, type ApplyBatchActionOptions, Attachment, AttachmentUpload, type DataValueClientToWire, type DataValueWireToClient, InterfaceDefinition, MediaReference, type ObjectQueryDataType, type ObjectSet, type ObjectSetQueryDataType, ObjectTypeDefinition, type OntologyMetadata, OsdkBase, type OsdkObject, PrimaryKeyTypes, PropertyValueWireToClient, type QueryDataTypeDefinition, type QueryDefinition, type QueryMetadata, QueryParam, type QueryParameterDefinition, QueryResult, type ThreeDimensionalQueryAggregationDefinition, type TwoDimensionalQueryAggregationDefinition };
|
|
@@ -21,16 +21,8 @@ var __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks = {
|
|
|
21
21
|
version: "2.0.8"
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// src/experimental/subscribe.ts
|
|
25
|
-
var __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe = {
|
|
26
|
-
name: "__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe",
|
|
27
|
-
type: "experiment",
|
|
28
|
-
version: "2.1.0"
|
|
29
|
-
};
|
|
30
|
-
|
|
31
24
|
exports.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference = __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference;
|
|
32
25
|
exports.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid = __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid;
|
|
33
26
|
exports.__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks = __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks;
|
|
34
|
-
exports.__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe = __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe;
|
|
35
27
|
//# sourceMappingURL=unstable.cjs.map
|
|
36
28
|
//# sourceMappingURL=unstable.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/experimental/createMediaReference.ts","../../../src/experimental/fetchOneByRid.ts","../../../src/experimental/getBulkLinks.ts"
|
|
1
|
+
{"version":3,"sources":["../../../src/experimental/createMediaReference.ts","../../../src/experimental/fetchOneByRid.ts","../../../src/experimental/getBulkLinks.ts"],"names":[],"mappings":";;;AA6BO,IAAM,uDAA0D,GAAA;AAAA,EACrE,IAAM,EAAA,yDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX;;;ACjBO,IAAM,gDAAmD,GAAA;AAAA,EAC9D,IAAM,EAAA,kDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX;;;ACJO,IAAM,+CAAkD,GAAA;AAAA,EAC7D,IAAM,EAAA,iDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX","file":"unstable.cjs","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\n/**\n * @experimental This feature is experimental and might change in the future.\n *\n * Uploads a media item to the media property of the specified object type.\n *\n * @param data - Data to upload as media item\n * @param fileName - Name that will be assigned as path to the uploaded media item.\n * @param objectTypeApi - Api name of the object type to which the media item will be uploaded.\n * @param propertyTypeApi - Api name of the media reference property of the corresponding object type to which the media item will be uploaded.\n *\n * @returns media reference of the uploaded media item.\n */\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference\",\n type: \"experiment\",\n version: \"2.1.0\"\n};","/*\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 const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid\",\n type: \"experiment\",\n version: \"2.1.0\"\n};","/*\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 const __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks\",\n type: \"experiment\",\n version: \"2.0.8\"\n};"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MediaReference, O as ObjectTypeDefinition,
|
|
2
|
-
export {
|
|
1
|
+
import { M as MediaReference, O as ObjectTypeDefinition, Y as PropertyKeys, N as NullabilityAdherence, z as SelectArg, a5 as Osdk, ae as ExtractOptions, b as OsdkBase, X as ObjectOrInterfaceDefinition } from '../ObjectSet-CLjcq5Mq.cjs';
|
|
2
|
+
export { af as MinimalObjectSet } from '../ObjectSet-CLjcq5Mq.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -50,11 +50,4 @@ declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks: Experiment<"2.0.8
|
|
|
50
50
|
getBulkLinks: getBulkLinksFn;
|
|
51
51
|
}>;
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
unsubscribe: () => void;
|
|
55
|
-
};
|
|
56
|
-
declare const __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe: Experiment<"2.1.0", "__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe", {
|
|
57
|
-
subscribe: subscribeFn;
|
|
58
|
-
}>;
|
|
59
|
-
|
|
60
|
-
export { type EXPERIMENTAL_BulkLinkResult, type Experiment, type ExperimentFns, __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe };
|
|
53
|
+
export { type EXPERIMENTAL_BulkLinkResult, type Experiment, type ExperimentFns, __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WhereClause.js","names":["DistanceUnitMapping"],"sources":["WhereClause.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 { BBox, Point, Polygon } from \"geojson\";\nimport type {\n ObjectOrInterfaceDefinition,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectMetadata,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"WhereClause.js","names":["DistanceUnitMapping"],"sources":["WhereClause.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 { BBox, Point, Polygon } from \"geojson\";\nimport type {\n ObjectOrInterfaceDefinition,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectMetadata,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { BaseWirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\nimport type { IsNever } from \"../OsdkObjectFrom.js\";\nimport type { ArrayFilter } from \"./ArrayFilter.js\";\nimport type { BaseFilter } from \"./BaseFilter.js\";\nimport type { BooleanFilter } from \"./BooleanFilter.js\";\nimport type { DatetimeFilter } from \"./DatetimeFilter.js\";\nimport type { GeoFilter } from \"./GeoFilter.js\";\nimport type { Just } from \"./Just.js\";\nimport type { NumberFilter } from \"./NumberFilter.js\";\nimport type { StringFilter } from \"./StringFilter.js\";\n\nexport type PossibleWhereClauseFilters =\n | \"$gt\"\n | \"$eq\"\n | \"$ne\"\n | \"$isNull\"\n | \"$contains\"\n | \"$gte\"\n | \"$lt\"\n | \"$lte\"\n | \"$within\"\n | \"$in\"\n | \"$intersects\"\n | \"$startsWith\"\n | \"$containsAllTermsInOrder\"\n | \"$containsAnyTerm\"\n | \"$containsAllTerms\";\n\n// the value side of this needs to match DistanceUnit from @osdk/internal.foundry but we don't\n// want the dependency\nexport const DistanceUnitMapping: {\n centimeter: \"CENTIMETERS\";\n centimeters: \"CENTIMETERS\";\n cm: \"CENTIMETERS\";\n meter: \"METERS\";\n meters: \"METERS\";\n m: \"METERS\";\n kilometer: \"KILOMETERS\";\n kilometers: \"KILOMETERS\";\n km: \"KILOMETERS\";\n inch: \"INCHES\";\n inches: \"INCHES\";\n foot: \"FEET\";\n feet: \"FEET\";\n yard: \"YARDS\";\n yards: \"YARDS\";\n mile: \"MILES\";\n miles: \"MILES\";\n nautical_mile: \"NAUTICAL_MILES\";\n nauticalMile: \"NAUTICAL_MILES\";\n \"nautical miles\": \"NAUTICAL_MILES\";\n} = {\n \"centimeter\": \"CENTIMETERS\",\n \"centimeters\": \"CENTIMETERS\",\n \"cm\": \"CENTIMETERS\",\n \"meter\": \"METERS\",\n \"meters\": \"METERS\",\n \"m\": \"METERS\",\n \"kilometer\": \"KILOMETERS\",\n \"kilometers\": \"KILOMETERS\",\n \"km\": \"KILOMETERS\",\n \"inch\": \"INCHES\",\n \"inches\": \"INCHES\",\n \"foot\": \"FEET\",\n \"feet\": \"FEET\",\n \"yard\": \"YARDS\",\n \"yards\": \"YARDS\",\n \"mile\": \"MILES\",\n \"miles\": \"MILES\",\n \"nautical_mile\": \"NAUTICAL_MILES\",\n \"nauticalMile\": \"NAUTICAL_MILES\",\n \"nautical miles\": \"NAUTICAL_MILES\",\n} satisfies Record<\n string,\n | \"CENTIMETERS\"\n | \"METERS\"\n | \"KILOMETERS\"\n | \"INCHES\"\n | \"FEET\"\n | \"YARDS\"\n | \"MILES\"\n | \"NAUTICAL_MILES\"\n>;\n\nexport type GeoFilter_Within = {\n \"$within\":\n | {\n $distance: [number, keyof typeof DistanceUnitMapping];\n $of: [number, number] | Readonly<Point>;\n $bbox?: never;\n $polygon?: never;\n }\n | {\n $bbox: BBox;\n $distance?: never;\n $of?: never;\n $polygon?: never;\n }\n | BBox\n | {\n $polygon: Polygon[\"coordinates\"];\n $bbox?: never;\n $distance?: never;\n $of?: never;\n }\n | Polygon;\n};\n\nexport type GeoFilter_Intersects = {\n \"$intersects\":\n | {\n $bbox: BBox;\n $polygon?: never;\n }\n | BBox\n | {\n $polygon: Polygon[\"coordinates\"];\n $bbox?: never;\n }\n | Polygon;\n};\n\ntype FilterFor<PD extends ObjectMetadata.Property> = PD[\"multiplicity\"] extends\n true\n ? (PD[\"type\"] extends\n \"string\" | \"geopoint\" | \"geoshape\" | \"datetime\" | \"timestamp\"\n ? ArrayFilter<string>\n : (PD[\"type\"] extends boolean ? ArrayFilter<boolean>\n : ArrayFilter<number>))\n : PD[\"type\"] extends Record<string, BaseWirePropertyTypes> ?\n | StructFilter<PD[\"type\"]>\n | BaseFilter<string>\n : (PD[\"type\"] extends \"string\" ? StringFilter\n : PD[\"type\"] extends \"geopoint\" | \"geoshape\" ? GeoFilter\n : PD[\"type\"] extends \"datetime\" | \"timestamp\" ? DatetimeFilter\n : PD[\"type\"] extends \"boolean\" ? BooleanFilter\n : PD[\"type\"] extends\n \"double\" | \"integer\" | \"long\" | \"float\" | \"decimal\" | \"byte\"\n ? NumberFilter\n : BaseFilter<string>); // FIXME we need to represent all types\n\ntype StructFilterOpts<ST extends Record<string, BaseWirePropertyTypes>> = {\n [K in keyof ST]?: FilterFor<{ \"type\": ST[K] }>;\n};\ntype StructFilter<ST extends Record<string, BaseWirePropertyTypes>> = {\n [K in keyof ST]: Just<K, StructFilterOpts<ST>>;\n}[keyof ST];\n\nexport interface AndWhereClause<\n T extends ObjectOrInterfaceDefinition,\n> {\n $and: WhereClause<T>[];\n}\n\nexport interface OrWhereClause<\n T extends ObjectOrInterfaceDefinition,\n> {\n $or: WhereClause<T>[];\n}\n\nexport interface NotWhereClause<\n T extends ObjectOrInterfaceDefinition,\n> {\n $not: WhereClause<T>;\n}\n\nexport type WhereClause<\n T extends ObjectOrInterfaceDefinition,\n> =\n | OrWhereClause<T>\n | AndWhereClause<T>\n | NotWhereClause<T>\n | (IsNever<keyof CompileTimeMetadata<T>[\"properties\"]> extends true\n ? Record<string, never>\n : {\n [P in keyof CompileTimeMetadata<T>[\"properties\"]]?: FilterFor<\n CompileTimeMetadata<T>[\"properties\"][P]\n >;\n });\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsCA;AACA;AACA,OAAO,MAAMA,mBAqBZ,GAAG;EACF,YAAY,EAAE,aAAa;EAC3B,aAAa,EAAE,aAAa;EAC5B,IAAI,EAAE,aAAa;EACnB,OAAO,EAAE,QAAQ;EACjB,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,QAAQ;EACb,WAAW,EAAE,YAAY;EACzB,YAAY,EAAE,YAAY;EAC1B,IAAI,EAAE,YAAY;EAClB,MAAM,EAAE,QAAQ;EAChB,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,MAAM;EACd,MAAM,EAAE,MAAM;EACd,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,OAAO;EAChB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,OAAO;EAChB,eAAe,EAAE,gBAAgB;EACjC,cAAc,EAAE,gBAAgB;EAChC,gBAAgB,EAAE;AACpB,CAUC;;AAyD0B","ignoreList":[]}
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport 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 {
|
|
1
|
+
{"version":3,"file":"index.js","names":["DistanceUnitMapping","DurationMapping","isOk","TimeseriesDurationMapping"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { ActionReturnTypeForOptions } from \"./actions/ActionReturnTypeForOptions.js\";\nexport type {\n ActionEditResponse,\n ActionParam,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n} from \"./actions/Actions.js\";\nexport type { ValidAggregationKeys } from \"./aggregate/AggregatableKeys.js\";\nexport type { AggregateOpts } from \"./aggregate/AggregateOpts.js\";\nexport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"./aggregate/AggregateOptsThatErrors.js\";\nexport type { AggregationResultsWithGroups } from \"./aggregate/AggregationResultsWithGroups.js\";\nexport type { AggregationResultsWithoutGroups } from \"./aggregate/AggregationResultsWithoutGroups.js\";\nexport type { AggregationClause } from \"./aggregate/AggregationsClause.js\";\nexport type { AggregationsResults } from \"./aggregate/AggregationsResults.js\";\nexport type { GeoFilterOptions } from \"./aggregate/GeoFilter.js\";\nexport { DistanceUnitMapping } from \"./aggregate/WhereClause.js\";\nexport type {\n GeoFilter_Intersects,\n GeoFilter_Within,\n PossibleWhereClauseFilters,\n WhereClause,\n} from \"./aggregate/WhereClause.js\";\nexport type { OsdkObjectPropertyType } from \"./Definitions.js\";\nexport type {\n OsdkObjectLinksObject,\n SingleLinkAccessor,\n} from \"./definitions/LinkDefinitions.js\";\nexport type { DerivedProperty } from \"./derivedProperties/DerivedProperty.js\";\nexport { DurationMapping } from \"./groupby/GroupByClause.js\";\nexport type {\n AllGroupByValues,\n GroupByClause,\n GroupByRange,\n} from \"./groupby/GroupByClause.js\";\nexport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n DataValueClientToWire,\n DataValueWireToClient,\n} from \"./mapping/DataValueMapping.js\";\nexport type {\n PropertyValueWireToClient,\n} from \"./mapping/PropertyValueMapping.js\";\nexport type { Attachment, AttachmentUpload } from \"./object/Attachment.js\";\nexport type {\n AsyncIterArgs,\n Augment,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n SelectArgToKeys,\n} from \"./object/FetchPageArgs.js\";\nexport type {\n FetchPageResult,\n SingleOsdkResult,\n} from \"./object/FetchPageResult.js\";\nexport type { Media, MediaMetadata, MediaReference } from \"./object/Media.js\";\nexport { isOk } from \"./object/Result.js\";\nexport type { Result } from \"./object/Result.js\";\nexport type { BaseObjectSet } from \"./objectSet/BaseObjectSet.js\";\nexport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nexport type { ObjectSetSubscription } from \"./objectSet/ObjectSetListener.js\";\nexport type {\n ActionDefinition,\n ActionMetadata,\n} from \"./ontology/ActionDefinition.js\";\nexport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nexport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nexport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n PropertyDef,\n VersionBound,\n} from \"./ontology/ObjectTypeDefinition.js\";\nexport type { OntologyMetadata } from \"./ontology/OntologyMetadata.js\";\nexport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nexport type {\n ObjectQueryDataType,\n ObjectSetQueryDataType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n ThreeDimensionalQueryAggregationDefinition,\n TwoDimensionalQueryAggregationDefinition,\n} from \"./ontology/QueryDefinition.js\";\nexport type {\n BaseWirePropertyTypes,\n WirePropertyTypes,\n} from \"./ontology/WirePropertyTypes.js\";\nexport type { OsdkBase, PrimaryKeyType } from \"./OsdkBase.js\";\nexport type { OsdkObject } from \"./OsdkObject.js\";\nexport type { ConvertProps, Osdk } from \"./OsdkObjectFrom.js\";\nexport type { PageResult } from \"./PageResult.js\";\nexport type { QueryParam, QueryResult } from \"./queries/Queries.js\";\nexport { TimeseriesDurationMapping } from \"./timeseries/timeseries.js\";\nexport type {\n GeotimeSeriesProperty,\n TimeSeriesPoint,\n TimeSeriesProperty,\n TimeSeriesQuery,\n} from \"./timeseries/timeseries.js\";\nexport type { LinkedType, LinkNames } from \"./util/LinkUtils.js\";\n\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,mBAAmB,QAAQ,4BAA4B;AAahE,SAASC,eAAe,QAAQ,4BAA4B;AA8B5D,SAASC,IAAI,QAAQ,oBAAoB;AA6CzC,SAASC,yBAAyB,QAAQ,4BAA4B;AAStE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedProperty } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type { ExtractOptions, Osdk } from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type {\n ObjectSetListener,\n ObjectSetListenerOptions,\n} from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {},\n> = D extends Record<string, SimplePropertyDef>\n ? ObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>\n : Q;\n\ntype ExtractRdp<\n D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>,\n> = D extends Record<string, SimplePropertyDef> ? D : {};\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\n// TODO MOVE THIS\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n readonly fetchPage: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >;\n\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n readonly fetchPageWithErrors: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n readonly asyncIter: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S>,\n ) => AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >;\n}\n\ninterface InterfaceObjectSet<\n Q extends InterfaceDefinition,\n> extends MinimalObjectSet<Q> {\n}\n\ninterface WithProperties<\n Q extends ObjectOrInterfaceDefinition = any,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly withProperties: <\n NEW extends Record<string, SimplePropertyDef>,\n >(\n clause: { [K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> =\n ObjectSet<Q, any>,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, UNUSED_OR_RDP>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CompileTimeMetadata<LinkedType<Q, L>>[\"objectSet\"]; // ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n readonly fetchOne: Q extends ObjectTypeDefinition ? <\n const L extends PropertyKeys<Q, RDPs>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n : never;\n\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetListener<Q, P>,\n opts?: ObjectSetListenerOptions<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition,\n> extends\n MinimalObjectSet<Q, D>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<MERGED>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSet.js","names":[],"sources":["ObjectSet.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AggregateOpts } from \"../aggregate/AggregateOpts.js\";\nimport type { AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy } from \"../aggregate/AggregateOptsThatErrors.js\";\nimport type { AggregationsResults } from \"../aggregate/AggregationsResults.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type { DerivedProperty } from \"../derivedProperties/DerivedProperty.js\";\nimport type {\n AsyncIterArgs,\n Augments,\n FetchPageArgs,\n NullabilityAdherence,\n SelectArg,\n} from \"../object/FetchPageArgs.js\";\nimport type { Result } from \"../object/Result.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n DerivedObjectOrInterfaceDefinition,\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { PrimaryKeyType } from \"../OsdkBase.js\";\nimport type { ExtractOptions, Osdk } from \"../OsdkObjectFrom.js\";\nimport type { PageResult } from \"../PageResult.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { BaseObjectSet } from \"./BaseObjectSet.js\";\nimport type { ObjectSetSubscription } from \"./ObjectSetListener.js\";\n\ntype MergeObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {},\n> = D extends Record<string, SimplePropertyDef>\n ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>\n : Q;\n\ntype ExtractRdp<\n D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>,\n> = D extends Record<string, SimplePropertyDef> ? D : {};\n\nexport interface MinimalObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends\n BaseObjectSet<Q>,\n FetchPage<Q, RDPs>,\n AsyncIter<Q, RDPs>,\n Where<Q, RDPs>\n{\n}\n\n// TODO MOVE THIS\ninterface FetchPage<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n const myObjsResult = myObjs.data;\n\n * @returns a page of objects\n */\n readonly fetchPage: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >;\n\n /**\n * Gets a page of objects of this type, with a result wrapper\n * @param args - Args to specify next page token and page size, if applicable\n * @example\n * const myObjs = await objectSet.fetchPage({\n $pageSize: 10,\n $nextPageToken: \"nextPage\"\n });\n\n if(isOk(myObjs)){\n const myObjsResult = myObjs.value.data;\n }\n * @returns a page of objects, wrapped in a result wrapper\n */\n readonly fetchPageWithErrors: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: FetchPageArgs<Q, L, R, A, S>,\n ) => Promise<\n Result<\n PageResult<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n >;\n}\n\n// TODO MOVE THIS\ninterface Where<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Allows you to filter an object set with a given clause\n * @param clause - Takes a filter clause\n * @example\n * await client(Office).where({\n meetingRooms: { $contains: \"Grand Central\" },\n meetingRoomCapacities: { $contains: 30 },\n});\n* @returns an objectSet\n */\n readonly where: (\n clause: WhereClause<MergeObjectSet<Q, RDPs>>,\n ) => this;\n}\n\ninterface AsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Returns an async iterator to load all objects of this type\n * @example\n * for await (const obj of myObjectSet.asyncIter()){\n * // Handle obj\n * }\n * @returns an async iterator to load all objects\n */\n readonly asyncIter: <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n const A extends Augments,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n >(\n args?: AsyncIterArgs<Q, L, R, A, S>,\n ) => AsyncIterableIterator<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >;\n}\n\ninterface InterfaceObjectSet<\n Q extends InterfaceDefinition,\n> extends MinimalObjectSet<Q> {\n}\n\ninterface WithProperties<\n Q extends ObjectOrInterfaceDefinition = any,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n readonly withProperties: <\n NEW extends Record<string, SimplePropertyDef>,\n >(\n clause: { [K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]> },\n ) => ObjectSet<\n Q,\n {\n [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN]\n : NN extends keyof RDPs ? RDPs[NN]\n : never;\n }\n >;\n}\n\nexport interface ObjectSet<\n Q extends ObjectOrInterfaceDefinition = any,\n // Generated code has what is basically ObjectSet<Q> set in here\n // but we never used it so I am repurposing it for RDP\n UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> =\n ObjectSet<Q, any>,\n> extends\n ObjectSetCleanedTypes<\n Q,\n ExtractRdp<UNUSED_OR_RDP>,\n MergeObjectSet<Q, UNUSED_OR_RDP>\n >\n{\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Aggregate<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Aggregate on a field in an object type\n * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose\n * whether or not you order your results. You can also specify a groupBy field to group your aggregations\n * @example\n * const testAggregateCountWithGroups = await client(BoundariesUsState)\n .aggregate({\n $select: {\n $count: \"unordered\",\n \"latitude:max\": \"unordered\",\n \"latitude:min\": \"unordered\",\n \"latitude:avg\": \"unordered\",\n },\n $groupBy: {\n usState: \"exact\",\n longitude: {\n $fixedWidth: 10,\n },\n },\n });\n\n * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable)\n */\n readonly aggregate: <AO extends AggregateOpts<Q>>(\n req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<Q, AO>,\n ) => Promise<AggregationsResults<Q, AO>>;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface SetArithmetic<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Unions object sets together\n * @param objectSets - objectSets you want to union with\n * @example\n * const unionObjectSet = complexFilteredEmployeeObjectSet.union(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the unioned object set\n */\n readonly union: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the intersection of object sets\n * @param objectSets - objectSets you want to intersect with\n * @example\n * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the intersected object set\n */\n readonly intersect: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n\n /**\n * Computes the subtraction of object sets\n * @param objectSets - objectSets you want to subtract from\n * @example\n * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract(\n simpleFilteredEmployeeObjectSet,\n );\n * @returns the subtract object set\n */\n readonly subtract: (\n ...objectSets: ReadonlyArray<CompileTimeMetadata<Q>[\"objectSet\"]>\n ) => this;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface PivotTo<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Pivots the object set over to all its linked objects of the specified type\n * @param type - The linked object type you want to pivot to\n * @returns an object set of the specified linked type\n */\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CompileTimeMetadata<LinkedType<Q, L>>[\"objectSet\"]; // ObjectSet<LinkedType<Q, L>>;\n}\n\ninterface FetchOne<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n> {\n /**\n * Fetches one object with the specified primary key, without a result wrapper\n */\n readonly fetchOne: Q extends ObjectTypeDefinition ? <\n const L extends PropertyKeys<Q, RDPs>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n : never;\n\n /**\n * Fetches one object with the specified primary key, with a result wrapper\n */\n readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <\n L extends PropertyKeys<Q, RDPs>,\n R extends boolean,\n S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n primaryKey: PrimaryKeyType<Q>,\n options?: SelectArg<Q, L, R, S>,\n ) => Promise<\n Result<\n Osdk.Instance<\n Q,\n ExtractOptions<R, S>,\n PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L,\n { [K in Extract<keyof RDPs, L>]: RDPs[K] }\n >\n >\n >\n : never;\n}\n\n// Q is the merged type here! Not renaming to keep diff small. Rename in follow up\ninterface Subscribe<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Request updates when the objects in an object set are added, updated, or removed.\n * @param listener - The handlers to be executed during the lifecycle of the subscription.\n * @param opts - Options to modify what properties are returned on subscription updates.\n * @returns an object containing a function to unsubscribe.\n */\n readonly subscribe: <\n const P extends PropertyKeys<Q>,\n >(\n listener: ObjectSetSubscription.Listener<Q, P>,\n opts?: ObjectSetSubscription.Options<Q, P>,\n ) => { unsubscribe: () => void };\n}\n\ninterface ObjectSetCleanedTypes<\n Q extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n MERGED extends ObjectOrInterfaceDefinition,\n> extends\n MinimalObjectSet<Q, D>,\n WithProperties<Q, D>,\n Aggregate<MERGED>,\n SetArithmetic<MERGED>,\n PivotTo<MERGED>,\n FetchOne<Q, D>,\n Subscribe<MERGED>\n{\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export let ObjectSetSubscription;
|
|
2
17
|
//# sourceMappingURL=ObjectSetListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSetListener.js","names":[],"sources":["ObjectSetListener.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 {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Osdk } from \"../OsdkObjectFrom.js\";\n\nexport interface
|
|
1
|
+
{"version":3,"file":"ObjectSetListener.js","names":["ObjectSetSubscription"],"sources":["ObjectSetListener.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 {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Osdk } from \"../OsdkObjectFrom.js\";\n\nexport namespace ObjectSetSubscription {\n export interface Listener<\n O extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<O> = PropertyKeys<O>,\n > {\n /**\n * Specific objects have changed and can be immediately updated\n */\n onChange?: (\n objectUpdate: ObjectUpdate<O, P>,\n ) => void;\n\n /**\n * The subscription has been successfully established and updates can be expected to be received.\n */\n onSuccessfulSubscription?: () => void;\n\n /**\n * The ObjectSet has become outdated and should be re-fetched in its entirety.\n * This is also sent when the subscription is first initialized.\n */\n onOutOfDate?: () => void;\n\n /**\n * There was a fatal error with the subscription process. The subscription will close or will not be established.\n */\n onError?: (errors: { subscriptionClosed: boolean; error: any }) => void;\n }\n\n /**\n * Options for subscribing to an ObjectSet.\n *\n * properties - The properties to request a subscription for. Requesting specific properties limits the possible properties\n * that can be returned from the subscription. If not provided, all properties will be requested and potentially be returned on updates.\n */\n export interface Options<\n O extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<O> = PropertyKeys<O>,\n > {\n properties?: Array<P>;\n }\n}\n\ntype ObjectUpdate<\n O extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<O>,\n> = {\n object: Osdk.Instance<O, never, P>;\n state: \"ADDED_OR_UPDATED\" | \"REMOVED\";\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAsBiBA,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionDefinition.js","names":["ActionMetadata"],"sources":["ActionDefinition.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 { OsdkMetadata } from \"../OsdkMetadata.js\";\nimport type { InterfaceDefinition } from \"./InterfaceDefinition.js\";\nimport type {\n ObjectTypeDefinition,\n ReleaseStatus,\n} from \"./ObjectTypeDefinition.js\";\n\nexport interface ActionMetadata {\n type: \"action\";\n apiName: string;\n description?: string;\n displayName?: string;\n parameters: Record<any, ActionMetadata.Parameter<any>>;\n modifiedEntities?: Partial<\n Record<any, {\n created: boolean;\n modified: boolean;\n }>\n >;\n status: ReleaseStatus;\n rid: string;\n}\n\nexport namespace ActionMetadata {\n export interface Parameter<\n T_Target extends ObjectTypeDefinition = never,\n > {\n type:\n |
|
|
1
|
+
{"version":3,"file":"ActionDefinition.js","names":["ActionMetadata"],"sources":["ActionDefinition.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 { OsdkMetadata } from \"../OsdkMetadata.js\";\nimport type { InterfaceDefinition } from \"./InterfaceDefinition.js\";\nimport type {\n ObjectTypeDefinition,\n ReleaseStatus,\n} from \"./ObjectTypeDefinition.js\";\n\nexport interface ActionMetadata {\n type: \"action\";\n apiName: string;\n description?: string;\n displayName?: string;\n parameters: Record<any, ActionMetadata.Parameter<any>>;\n modifiedEntities?: Partial<\n Record<any, {\n created: boolean;\n modified: boolean;\n }>\n >;\n status: ReleaseStatus;\n rid: string;\n}\n\nexport namespace ActionMetadata {\n export interface Parameter<\n T_Target extends ObjectTypeDefinition = never,\n > {\n type:\n | DataType.BaseActionParameterTypes\n | DataType.Object<any>\n | DataType.ObjectSet<any>\n | DataType.Interface<any>\n | DataType.Struct<any>;\n description?: string;\n multiplicity?: boolean;\n nullable?: boolean;\n }\n\n export namespace DataType {\n export type BaseActionParameterTypes =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\";\n\n export interface Object<\n T_Target extends ObjectTypeDefinition = never,\n > {\n __OsdkTargetType?: T_Target;\n type: \"object\";\n object: T_Target[\"apiName\"];\n }\n\n export interface Interface<T_Target extends InterfaceDefinition = never> {\n __OsdkTargetType?: T_Target;\n type: \"interface\";\n interface: T_Target[\"apiName\"];\n }\n\n export interface ObjectSet<\n T_Target extends ObjectTypeDefinition = never,\n > {\n __OsdkTargetType?: T_Target;\n type: \"objectSet\";\n objectSet: T_Target[\"apiName\"];\n }\n\n export interface Struct<\n T extends Record<string, DataType.BaseActionParameterTypes>,\n > {\n type: \"struct\";\n struct: T;\n }\n }\n}\n\nexport interface ActionCompileTimeMetadata<T> {\n signatures: T;\n}\n\nexport interface ActionDefinition<\n T_signatures = never,\n> {\n type: \"action\";\n apiName: string;\n osdkMetadata?: OsdkMetadata;\n __DefinitionMetadata?:\n & ActionCompileTimeMetadata<T_signatures>\n & ActionMetadata;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAuCiBA,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectOrInterface.js","names":["
|
|
1
|
+
{"version":3,"file":"ObjectOrInterface.js","names":["DerivedObjectOrInterfaceDefinition"],"sources":["ObjectOrInterface.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 { InterfaceDefinition } from \"./InterfaceDefinition.js\";\nimport type { ObjectTypeDefinition } from \"./ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"./SimplePropertyDef.js\";\n\nexport type ObjectOrInterfaceDefinition =\n | ObjectTypeDefinition\n | InterfaceDefinition;\n\nexport namespace DerivedObjectOrInterfaceDefinition {\n export type WithDerivedProperties<\n K extends ObjectOrInterfaceDefinition,\n D extends Record<string, SimplePropertyDef>,\n > = {\n __DefinitionMetadata: {\n properties: {\n [T in keyof D]: SimplePropertyDef.ToPropertyDef<D[T]>;\n };\n props: {\n [T in keyof D]: SimplePropertyDef.ToRuntimeProperty<D[T]>;\n };\n };\n } & K;\n}\n\nexport type PropertyKeys<\n O extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> =\n & (keyof NonNullable<O[\"__DefinitionMetadata\"]>[\"properties\"] | keyof RDPs)\n & string;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAwBiBA,kCAAkC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WirePropertyTypes.js","names":[],"sources":["WirePropertyTypes.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 WirePropertyTypes =\n |
|
|
1
|
+
{"version":3,"file":"WirePropertyTypes.js","names":[],"sources":["WirePropertyTypes.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 WirePropertyTypes =\n | BaseWirePropertyTypes\n | Record<string, BaseWirePropertyTypes>;\n\nexport type BaseWirePropertyTypes =\n | \"string\"\n | \"datetime\"\n | \"double\"\n | \"boolean\"\n | \"integer\"\n | \"timestamp\"\n | \"short\"\n | \"long\"\n | \"float\"\n | \"decimal\"\n | \"byte\"\n | \"marking\"\n | \"mediaReference\"\n | \"numericTimeseries\"\n | \"stringTimeseries\"\n | \"sensorTimeseries\"\n | \"attachment\"\n | \"geopoint\"\n | \"geoshape\"\n | \"geotimeSeriesReference\";\n"],"mappings":"","ignoreList":[]}
|
|
@@ -17,5 +17,4 @@
|
|
|
17
17
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from "../experimental/createMediaReference.js";
|
|
18
18
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from "../experimental/fetchOneByRid.js";
|
|
19
19
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from "../experimental/getBulkLinks.js";
|
|
20
|
-
export { __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe } from "../experimental/subscribe.js";
|
|
21
20
|
//# sourceMappingURL=unstable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unstable.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks"
|
|
1
|
+
{"version":3,"file":"unstable.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks"],"sources":["unstable.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 type { Experiment, ExperimentFns } from \"../experimental/Experiment.js\";\n\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"../experimental/createMediaReference.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from \"../experimental/fetchOneByRid.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from \"../experimental/getBulkLinks.js\";\n\nexport type { EXPERIMENTAL_BulkLinkResult } from \"../objectSet/BulkLinkResult.js\";\nexport type { MinimalObjectSet } from \"../objectSet/ObjectSet.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,uDAAuD,QAAQ,yCAAyC;AACjH,SAASC,gDAAgD,QAAQ,kCAAkC;AACnG,SAASC,+CAA+C,QAAQ,iCAAiC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BBox, Point, Polygon } from "geojson";
|
|
2
2
|
import type { ObjectOrInterfaceDefinition } from "../ontology/ObjectOrInterface.js";
|
|
3
3
|
import type { CompileTimeMetadata, ObjectMetadata } from "../ontology/ObjectTypeDefinition.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { BaseWirePropertyTypes } from "../ontology/WirePropertyTypes.js";
|
|
5
5
|
import type { IsNever } from "../OsdkObjectFrom.js";
|
|
6
6
|
import type { ArrayFilter } from "./ArrayFilter.js";
|
|
7
7
|
import type { BaseFilter } from "./BaseFilter.js";
|
|
@@ -57,9 +57,9 @@ export type GeoFilter_Intersects = { "$intersects": {
|
|
|
57
57
|
$polygon: Polygon["coordinates"];
|
|
58
58
|
$bbox?: never;
|
|
59
59
|
} | Polygon };
|
|
60
|
-
type FilterFor<PD extends ObjectMetadata.Property> = PD["multiplicity"] extends true ? (PD["type"] extends "string" | "geopoint" | "geoshape" | "datetime" | "timestamp" ? ArrayFilter<string> : (PD["type"] extends boolean ? ArrayFilter<boolean> : ArrayFilter<number>)) : PD["type"] extends Record<string,
|
|
61
|
-
type StructFilterOpts<ST extends Record<string,
|
|
62
|
-
type StructFilter<ST extends Record<string,
|
|
60
|
+
type FilterFor<PD extends ObjectMetadata.Property> = PD["multiplicity"] extends true ? (PD["type"] extends "string" | "geopoint" | "geoshape" | "datetime" | "timestamp" ? ArrayFilter<string> : (PD["type"] extends boolean ? ArrayFilter<boolean> : ArrayFilter<number>)) : PD["type"] extends Record<string, BaseWirePropertyTypes> ? StructFilter<PD["type"]> | BaseFilter<string> : (PD["type"] extends "string" ? StringFilter : PD["type"] extends "geopoint" | "geoshape" ? GeoFilter : PD["type"] extends "datetime" | "timestamp" ? DatetimeFilter : PD["type"] extends "boolean" ? BooleanFilter : PD["type"] extends "double" | "integer" | "long" | "float" | "decimal" | "byte" ? NumberFilter : BaseFilter<string>);
|
|
61
|
+
type StructFilterOpts<ST extends Record<string, BaseWirePropertyTypes>> = { [K in keyof ST]? : FilterFor<{ "type": ST[K] }> };
|
|
62
|
+
type StructFilter<ST extends Record<string, BaseWirePropertyTypes>> = { [K in keyof ST] : Just<K, StructFilterOpts<ST>> }[keyof ST];
|
|
63
63
|
export interface AndWhereClause<T extends ObjectOrInterfaceDefinition> {
|
|
64
64
|
$and: WhereClause<T>[];
|
|
65
65
|
}
|
package/build/types/index.d.ts
CHANGED
|
@@ -25,16 +25,15 @@ export { isOk } from "./object/Result.js";
|
|
|
25
25
|
export type { Result } from "./object/Result.js";
|
|
26
26
|
export type { BaseObjectSet } from "./objectSet/BaseObjectSet.js";
|
|
27
27
|
export type { ObjectSet } from "./objectSet/ObjectSet.js";
|
|
28
|
-
export type {
|
|
29
|
-
export type {
|
|
30
|
-
export type { ActionDefinition, ActionMetadata, ValidBaseActionParameterTypes } from "./ontology/ActionDefinition.js";
|
|
28
|
+
export type { ObjectSetSubscription } from "./objectSet/ObjectSetListener.js";
|
|
29
|
+
export type { ActionDefinition, ActionMetadata } from "./ontology/ActionDefinition.js";
|
|
31
30
|
export type { InterfaceDefinition, InterfaceMetadata } from "./ontology/InterfaceDefinition.js";
|
|
32
31
|
export type { ObjectOrInterfaceDefinition, PropertyKeys } from "./ontology/ObjectOrInterface.js";
|
|
33
32
|
export type { CompileTimeMetadata, ObjectMetadata, ObjectTypeDefinition, PropertyDef, VersionBound } from "./ontology/ObjectTypeDefinition.js";
|
|
34
33
|
export type { OntologyMetadata } from "./ontology/OntologyMetadata.js";
|
|
35
34
|
export type { PrimaryKeyTypes } from "./ontology/PrimaryKeyTypes.js";
|
|
36
35
|
export type { ObjectQueryDataType, ObjectSetQueryDataType, QueryDataTypeDefinition, QueryDefinition, QueryMetadata, QueryParameterDefinition, ThreeDimensionalQueryAggregationDefinition, TwoDimensionalQueryAggregationDefinition } from "./ontology/QueryDefinition.js";
|
|
37
|
-
export type {
|
|
36
|
+
export type { BaseWirePropertyTypes, WirePropertyTypes } from "./ontology/WirePropertyTypes.js";
|
|
38
37
|
export type { OsdkBase, PrimaryKeyType } from "./OsdkBase.js";
|
|
39
38
|
export type { OsdkObject } from "./OsdkObject.js";
|
|
40
39
|
export type { ConvertProps, Osdk } from "./OsdkObjectFrom.js";
|
|
@@ -5,7 +5,7 @@ import type { WhereClause } from "../aggregate/WhereClause.js";
|
|
|
5
5
|
import type { DerivedProperty } from "../derivedProperties/DerivedProperty.js";
|
|
6
6
|
import type { AsyncIterArgs, Augments, FetchPageArgs, NullabilityAdherence, SelectArg } from "../object/FetchPageArgs.js";
|
|
7
7
|
import type { Result } from "../object/Result.js";
|
|
8
|
-
import type { ObjectOrInterfaceDefinition, PropertyKeys } from "../ontology/ObjectOrInterface.js";
|
|
8
|
+
import type { DerivedObjectOrInterfaceDefinition, ObjectOrInterfaceDefinition, PropertyKeys } from "../ontology/ObjectOrInterface.js";
|
|
9
9
|
import type { CompileTimeMetadata, ObjectTypeDefinition } from "../ontology/ObjectTypeDefinition.js";
|
|
10
10
|
import type { SimplePropertyDef } from "../ontology/SimplePropertyDef.js";
|
|
11
11
|
import type { PrimaryKeyType } from "../OsdkBase.js";
|
|
@@ -13,11 +13,11 @@ import type { ExtractOptions, Osdk } from "../OsdkObjectFrom.js";
|
|
|
13
13
|
import type { PageResult } from "../PageResult.js";
|
|
14
14
|
import type { LinkedType, LinkNames } from "../util/LinkUtils.js";
|
|
15
15
|
import type { BaseObjectSet } from "./BaseObjectSet.js";
|
|
16
|
-
import type {
|
|
16
|
+
import type { ObjectSetSubscription } from "./ObjectSetListener.js";
|
|
17
17
|
type MergeObjectSet<
|
|
18
18
|
Q extends ObjectOrInterfaceDefinition,
|
|
19
19
|
D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {}
|
|
20
|
-
> = D extends Record<string, SimplePropertyDef> ?
|
|
20
|
+
> = D extends Record<string, SimplePropertyDef> ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D> : Q;
|
|
21
21
|
type ExtractRdp<D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>> = D extends Record<string, SimplePropertyDef> ? D : {};
|
|
22
22
|
export interface MinimalObjectSet<
|
|
23
23
|
Q extends ObjectOrInterfaceDefinition,
|
|
@@ -205,7 +205,7 @@ interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
|
|
|
205
205
|
* @param opts - Options to modify what properties are returned on subscription updates.
|
|
206
206
|
* @returns an object containing a function to unsubscribe.
|
|
207
207
|
*/
|
|
208
|
-
readonly subscribe: <const P extends PropertyKeys<Q>>(listener:
|
|
208
|
+
readonly subscribe: <const P extends PropertyKeys<Q>>(listener: ObjectSetSubscription.Listener<Q, P>, opts?: ObjectSetSubscription.Options<Q, P>) => { unsubscribe: () => void };
|
|
209
209
|
}
|
|
210
210
|
interface ObjectSetCleanedTypes<
|
|
211
211
|
Q extends ObjectOrInterfaceDefinition,
|
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
import type { ObjectOrInterfaceDefinition, PropertyKeys } from "../ontology/ObjectOrInterface.js";
|
|
2
2
|
import type { Osdk } from "../OsdkObjectFrom.js";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
3
|
+
export declare namespace ObjectSetSubscription {
|
|
4
|
+
interface Listener<
|
|
5
|
+
O extends ObjectOrInterfaceDefinition,
|
|
6
|
+
P extends PropertyKeys<O> = PropertyKeys<O>
|
|
7
|
+
> {
|
|
8
|
+
/**
|
|
9
|
+
* Specific objects have changed and can be immediately updated
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (objectUpdate: ObjectUpdate<O, P>) => void;
|
|
12
|
+
/**
|
|
13
|
+
* The subscription has been successfully established and updates can be expected to be received.
|
|
14
|
+
*/
|
|
15
|
+
onSuccessfulSubscription?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* The ObjectSet has become outdated and should be re-fetched in its entirety.
|
|
18
|
+
* This is also sent when the subscription is first initialized.
|
|
19
|
+
*/
|
|
20
|
+
onOutOfDate?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* There was a fatal error with the subscription process. The subscription will close or will not be established.
|
|
23
|
+
*/
|
|
24
|
+
onError?: (errors: {
|
|
25
|
+
subscriptionClosed: boolean;
|
|
26
|
+
error: any;
|
|
27
|
+
}) => void;
|
|
28
|
+
}
|
|
29
|
+
interface Options<
|
|
30
|
+
O extends ObjectOrInterfaceDefinition,
|
|
31
|
+
P extends PropertyKeys<O> = PropertyKeys<O>
|
|
32
|
+
> {
|
|
33
|
+
properties?: Array<P>;
|
|
34
|
+
}
|
|
27
35
|
}
|
|
28
36
|
type ObjectUpdate<
|
|
29
37
|
O extends ObjectOrInterfaceDefinition,
|
|
@@ -32,16 +40,4 @@ type ObjectUpdate<
|
|
|
32
40
|
object: Osdk.Instance<O, never, P>;
|
|
33
41
|
state: "ADDED_OR_UPDATED" | "REMOVED";
|
|
34
42
|
};
|
|
35
|
-
/**
|
|
36
|
-
* Options for subscribing to an ObjectSet.
|
|
37
|
-
*
|
|
38
|
-
* properties - The properties to request a subscription for. Requesting specific properties limits the possible properties
|
|
39
|
-
* that can be returned from the subscription. If not provided, all properties will be requested and potentially be returned on updates.
|
|
40
|
-
*/
|
|
41
|
-
export interface ObjectSetListenerOptions<
|
|
42
|
-
O extends ObjectOrInterfaceDefinition,
|
|
43
|
-
P extends PropertyKeys<O> = PropertyKeys<O>
|
|
44
|
-
> {
|
|
45
|
-
properties?: Array<P>;
|
|
46
|
-
}
|
|
47
43
|
export {};
|
|
@@ -16,12 +16,13 @@ export interface ActionMetadata {
|
|
|
16
16
|
}
|
|
17
17
|
export declare namespace ActionMetadata {
|
|
18
18
|
interface Parameter<T_Target extends ObjectTypeDefinition = never> {
|
|
19
|
-
type:
|
|
19
|
+
type: DataType.BaseActionParameterTypes | DataType.Object<any> | DataType.ObjectSet<any> | DataType.Interface<any> | DataType.Struct<any>;
|
|
20
20
|
description?: string;
|
|
21
21
|
multiplicity?: boolean;
|
|
22
22
|
nullable?: boolean;
|
|
23
23
|
}
|
|
24
24
|
namespace DataType {
|
|
25
|
+
type BaseActionParameterTypes = "boolean" | "string" | "integer" | "long" | "double" | "datetime" | "timestamp" | "attachment" | "marking" | "mediaReference" | "objectType";
|
|
25
26
|
interface Object<T_Target extends ObjectTypeDefinition = never> {
|
|
26
27
|
__OsdkTargetType?: T_Target;
|
|
27
28
|
type: "object";
|
|
@@ -37,7 +38,7 @@ export declare namespace ActionMetadata {
|
|
|
37
38
|
type: "objectSet";
|
|
38
39
|
objectSet: T_Target["apiName"];
|
|
39
40
|
}
|
|
40
|
-
interface Struct<T extends Record<string,
|
|
41
|
+
interface Struct<T extends Record<string, DataType.BaseActionParameterTypes>> {
|
|
41
42
|
type: "struct";
|
|
42
43
|
struct: T;
|
|
43
44
|
}
|
|
@@ -52,4 +53,3 @@ export interface ActionDefinition<T_signatures = never> {
|
|
|
52
53
|
osdkMetadata?: OsdkMetadata;
|
|
53
54
|
__DefinitionMetadata?: ActionCompileTimeMetadata<T_signatures> & ActionMetadata;
|
|
54
55
|
}
|
|
55
|
-
export type ValidBaseActionParameterTypes = "boolean" | "string" | "integer" | "long" | "double" | "datetime" | "timestamp" | "attachment" | "marking" | "mediaReference" | "objectType";
|
|
@@ -2,7 +2,7 @@ import type { InterfaceDefinition } from "./InterfaceDefinition.js";
|
|
|
2
2
|
import type { ObjectTypeDefinition } from "./ObjectTypeDefinition.js";
|
|
3
3
|
import type { SimplePropertyDef } from "./SimplePropertyDef.js";
|
|
4
4
|
export type ObjectOrInterfaceDefinition = ObjectTypeDefinition | InterfaceDefinition;
|
|
5
|
-
export declare namespace
|
|
5
|
+
export declare namespace DerivedObjectOrInterfaceDefinition {
|
|
6
6
|
type WithDerivedProperties<
|
|
7
7
|
K extends ObjectOrInterfaceDefinition,
|
|
8
8
|
D extends Record<string, SimplePropertyDef>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type WirePropertyTypes =
|
|
2
|
-
export type
|
|
1
|
+
export type WirePropertyTypes = BaseWirePropertyTypes | Record<string, BaseWirePropertyTypes>;
|
|
2
|
+
export type BaseWirePropertyTypes = "string" | "datetime" | "double" | "boolean" | "integer" | "timestamp" | "short" | "long" | "float" | "decimal" | "byte" | "marking" | "mediaReference" | "numericTimeseries" | "stringTimeseries" | "sensorTimeseries" | "attachment" | "geopoint" | "geoshape" | "geotimeSeriesReference";
|
|
@@ -2,6 +2,5 @@ export type { Experiment, ExperimentFns } from "../experimental/Experiment.js";
|
|
|
2
2
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from "../experimental/createMediaReference.js";
|
|
3
3
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from "../experimental/fetchOneByRid.js";
|
|
4
4
|
export { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from "../experimental/getBulkLinks.js";
|
|
5
|
-
export { __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe } from "../experimental/subscribe.js";
|
|
6
5
|
export type { EXPERIMENTAL_BulkLinkResult } from "../objectSet/BulkLinkResult.js";
|
|
7
6
|
export type { MinimalObjectSet } from "../objectSet/ObjectSet.js";
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export const __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe = {
|
|
18
|
-
name: "__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe",
|
|
19
|
-
type: "experiment",
|
|
20
|
-
version: "2.1.0"
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=subscribe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe","name","type","version"],"sources":["subscribe.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 { ObjectSet } from \"../objectSet/ObjectSet.js\";\nimport type {\n ObjectSetListener,\n ObjectSetListenerOptions,\n} from \"../objectSet/ObjectSetListener.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Experiment } from \"./Experiment.js\";\n\ntype subscribeFn = <\n Q extends ObjectOrInterfaceDefinition,\n const P extends PropertyKeys<Q>,\n>(\n objectSet: ObjectSet<Q>,\n listener: ObjectSetListener<Q, P>,\n opts?: ObjectSetListenerOptions<Q, P>,\n) => { unsubscribe: () => void };\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe: Experiment<\n \"2.1.0\",\n \"__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe\",\n { subscribe: subscribeFn }\n> = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe\",\n type: \"experiment\",\n version: \"2.1.0\",\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBA,OAAO,MAAMA,2CAIZ,GAAG;EACFC,IAAI,EAAE,6CAA6C;EACnDC,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export const __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe = {
|
|
18
|
-
name: "__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe",
|
|
19
|
-
type: "experiment",
|
|
20
|
-
version: "2.1.0"
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=subscribe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe","name","type","version"],"sources":["subscribe.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 { ObjectSet } from \"../objectSet/ObjectSet.js\";\nimport type {\n ObjectSetListener,\n ObjectSetListenerOptions,\n} from \"../objectSet/ObjectSetListener.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Experiment } from \"./Experiment.js\";\n\ntype subscribeFn = <\n Q extends ObjectOrInterfaceDefinition,\n const P extends PropertyKeys<Q>,\n>(\n objectSet: ObjectSet<Q>,\n listener: ObjectSetListener<Q, P>,\n opts?: ObjectSetListenerOptions<Q, P>,\n) => { unsubscribe: () => void };\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe: Experiment<\n \"2.1.0\",\n \"__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe\",\n { subscribe: subscribeFn }\n> = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe\",\n type: \"experiment\",\n version: \"2.1.0\",\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBA,OAAO,MAAMA,2CAIZ,GAAG;EACFC,IAAI,EAAE,6CAA6C;EACnDC,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ObjectSet } from "../objectSet/ObjectSet.js";
|
|
2
|
-
import type { ObjectSetListener, ObjectSetListenerOptions } from "../objectSet/ObjectSetListener.js";
|
|
3
|
-
import type { ObjectOrInterfaceDefinition, PropertyKeys } from "../ontology/ObjectOrInterface.js";
|
|
4
|
-
import type { Experiment } from "./Experiment.js";
|
|
5
|
-
type subscribeFn = <
|
|
6
|
-
Q extends ObjectOrInterfaceDefinition,
|
|
7
|
-
const P extends PropertyKeys<Q>
|
|
8
|
-
>(objectSet: ObjectSet<Q>, listener: ObjectSetListener<Q, P>, opts?: ObjectSetListenerOptions<Q, P>) => { unsubscribe: () => void };
|
|
9
|
-
export declare const __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe: Experiment<"2.1.0", "__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe", { subscribe: subscribeFn }>;
|
|
10
|
-
export {};
|