@osdk/client 2.5.0-beta.9 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +132 -0
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/actions/applyAction.js +0 -4
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js +1 -2
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createMinimalClient.js +1 -2
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/definitions/LinkDefinitions.test.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +0 -17
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +4 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/object/aggregate.js +0 -2
- package/build/browser/object/aggregate.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +5 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.js +5 -7
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/mediaUpload.js +0 -3
- package/build/browser/object/mediaUpload.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +31 -9
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +69 -4
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/ObjectSetPayload.js +2 -0
- package/build/browser/observable/ObjectSetPayload.js.map +1 -0
- package/build/browser/observable/ObservableClient.js.map +1 -1
- package/build/browser/observable/computeObjectSetCacheKey.js +64 -0
- package/build/browser/observable/computeObjectSetCacheKey.js.map +1 -0
- package/build/browser/observable/internal/Changes.js +3 -0
- package/build/browser/observable/internal/Changes.js.map +1 -1
- package/build/browser/observable/internal/KnownCacheKey.js.map +1 -1
- package/build/browser/observable/internal/ObservableClientImpl.js +17 -0
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/Query.js +18 -1
- package/build/browser/observable/internal/Query.js.map +1 -1
- package/build/browser/observable/internal/Store.invalidation.test.js +165 -0
- package/build/browser/observable/internal/Store.invalidation.test.js.map +1 -1
- package/build/browser/observable/internal/Store.js +23 -0
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/objectset/ObjectSetCacheKey.js +2 -0
- package/build/browser/observable/internal/objectset/ObjectSetCacheKey.js.map +1 -0
- package/build/browser/observable/internal/objectset/ObjectSetHelper.js +69 -0
- package/build/browser/observable/internal/objectset/ObjectSetHelper.js.map +1 -0
- package/build/browser/observable/internal/objectset/ObjectSetQuery.js +151 -0
- package/build/browser/observable/internal/objectset/ObjectSetQuery.js.map +1 -0
- package/build/browser/observable/internal/objectset/ObjectSetQueryOptions.js +2 -0
- package/build/browser/observable/internal/objectset/ObjectSetQueryOptions.js.map +1 -0
- package/build/browser/ontology/loadActionMetadata.js +1 -3
- package/build/browser/ontology/loadActionMetadata.js.map +1 -1
- package/build/browser/ontology/loadFullObjectMetadata.js +1 -2
- package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/browser/ontology/loadInterfaceMetadata.js +1 -2
- package/build/browser/ontology/loadInterfaceMetadata.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +1 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/exponentialBackoff.js +51 -0
- package/build/browser/util/exponentialBackoff.js.map +1 -0
- package/build/browser/util/exponentialBackoff.test.js +81 -0
- package/build/browser/util/exponentialBackoff.test.js.map +1 -0
- package/build/browser/util/toDataValue.js +1 -15
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +2 -42
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/cjs/{chunk-MKL3HEQ5.cjs → chunk-KODTFRP3.cjs} +105 -71
- package/build/cjs/chunk-KODTFRP3.cjs.map +1 -0
- package/build/cjs/{chunk-HCCGD2AP.cjs → chunk-UMET26AF.cjs} +68 -91
- package/build/cjs/chunk-UMET26AF.cjs.map +1 -0
- package/build/cjs/{createClient-mOlFts15.d.cts → createClient-BJo8T7Js.d.cts} +0 -1
- package/build/cjs/index.cjs +7 -11
- package/build/cjs/index.d.cts +2 -2
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +429 -156
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +79 -7
- package/build/esm/MinimalClientContext.js.map +1 -1
- package/build/esm/actions/applyAction.js +0 -4
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js +1 -2
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createMinimalClient.js +1 -2
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/definitions/LinkDefinitions.test.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +0 -17
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +4 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/object/aggregate.js +0 -2
- package/build/esm/object/aggregate.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +5 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.js +5 -7
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/mediaUpload.js +0 -3
- package/build/esm/object/mediaUpload.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +31 -9
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +69 -4
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/ObjectSetPayload.js +2 -0
- package/build/esm/observable/ObjectSetPayload.js.map +1 -0
- package/build/esm/observable/ObservableClient.js.map +1 -1
- package/build/esm/observable/computeObjectSetCacheKey.js +64 -0
- package/build/esm/observable/computeObjectSetCacheKey.js.map +1 -0
- package/build/esm/observable/internal/Changes.js +3 -0
- package/build/esm/observable/internal/Changes.js.map +1 -1
- package/build/esm/observable/internal/KnownCacheKey.js.map +1 -1
- package/build/esm/observable/internal/ObservableClientImpl.js +17 -0
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/Query.js +18 -1
- package/build/esm/observable/internal/Query.js.map +1 -1
- package/build/esm/observable/internal/Store.invalidation.test.js +165 -0
- package/build/esm/observable/internal/Store.invalidation.test.js.map +1 -1
- package/build/esm/observable/internal/Store.js +23 -0
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/objectset/ObjectSetCacheKey.js +2 -0
- package/build/esm/observable/internal/objectset/ObjectSetCacheKey.js.map +1 -0
- package/build/esm/observable/internal/objectset/ObjectSetHelper.js +69 -0
- package/build/esm/observable/internal/objectset/ObjectSetHelper.js.map +1 -0
- package/build/esm/observable/internal/objectset/ObjectSetQuery.js +151 -0
- package/build/esm/observable/internal/objectset/ObjectSetQuery.js.map +1 -0
- package/build/esm/observable/internal/objectset/ObjectSetQueryOptions.js +2 -0
- package/build/esm/observable/internal/objectset/ObjectSetQueryOptions.js.map +1 -0
- package/build/esm/ontology/loadActionMetadata.js +1 -3
- package/build/esm/ontology/loadActionMetadata.js.map +1 -1
- package/build/esm/ontology/loadFullObjectMetadata.js +1 -2
- package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/esm/ontology/loadInterfaceMetadata.js +1 -2
- package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +1 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/exponentialBackoff.js +51 -0
- package/build/esm/util/exponentialBackoff.js.map +1 -0
- package/build/esm/util/exponentialBackoff.test.js +81 -0
- package/build/esm/util/exponentialBackoff.test.js.map +1 -0
- package/build/esm/util/toDataValue.js +1 -15
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +2 -42
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/types/MinimalClientContext.d.ts +0 -1
- package/build/types/MinimalClientContext.d.ts.map +1 -1
- package/build/types/actions/applyAction.d.ts.map +1 -1
- package/build/types/createClient.d.ts +0 -1
- package/build/types/createClient.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/object/fetchPage.d.ts.map +1 -1
- package/build/types/object/mediaUpload.d.ts +1 -2
- package/build/types/object/mediaUpload.d.ts.map +1 -1
- package/build/types/observable/ObjectSetPayload.d.ts +5 -0
- package/build/types/observable/ObjectSetPayload.d.ts.map +1 -0
- package/build/types/observable/ObservableClient.d.ts +54 -1
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/computeObjectSetCacheKey.d.ts +16 -0
- package/build/types/observable/computeObjectSetCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/Changes.d.ts +5 -3
- package/build/types/observable/internal/Changes.d.ts.map +1 -1
- package/build/types/observable/internal/KnownCacheKey.d.ts +2 -1
- package/build/types/observable/internal/KnownCacheKey.d.ts.map +1 -1
- package/build/types/observable/internal/Query.d.ts.map +1 -1
- package/build/types/observable/internal/Store.d.ts +5 -1
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/observable/internal/objectset/ObjectSetCacheKey.d.ts +16 -0
- package/build/types/observable/internal/objectset/ObjectSetCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/objectset/ObjectSetHelper.d.ts +19 -0
- package/build/types/observable/internal/objectset/ObjectSetHelper.d.ts.map +1 -0
- package/build/types/observable/internal/objectset/ObjectSetQuery.d.ts +34 -0
- package/build/types/observable/internal/objectset/ObjectSetQuery.d.ts.map +1 -0
- package/build/types/observable/internal/objectset/ObjectSetQueryOptions.d.ts +18 -0
- package/build/types/observable/internal/objectset/ObjectSetQueryOptions.d.ts.map +1 -0
- package/build/types/public/unstable-do-not-use.d.ts +2 -1
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/types/util/exponentialBackoff.d.ts +14 -0
- package/build/types/util/exponentialBackoff.d.ts.map +1 -0
- package/build/types/util/exponentialBackoff.test.d.ts +1 -0
- package/build/types/util/exponentialBackoff.test.d.ts.map +1 -0
- package/package.json +11 -11
- package/build/cjs/chunk-HCCGD2AP.cjs.map +0 -1
- package/build/cjs/chunk-MKL3HEQ5.cjs.map +0 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 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
|
+
import { additionalContext } from "../../../Client.js";
|
|
18
|
+
import { getWireObjectSet } from "../../../objectSet/createObjectSet.js";
|
|
19
|
+
import { BaseListQuery } from "../base-list/BaseListQuery.js";
|
|
20
|
+
import { OrderBySortingStrategy } from "../sorting/SortingStrategy.js";
|
|
21
|
+
export class ObjectSetQuery extends BaseListQuery {
|
|
22
|
+
#baseObjectSetWire;
|
|
23
|
+
#operations;
|
|
24
|
+
#composedObjectSet;
|
|
25
|
+
#objectTypes;
|
|
26
|
+
constructor(store, subject, baseObjectSetWire, operations, cacheKey, opts) {
|
|
27
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[additionalContext].logger?.child({}, {
|
|
28
|
+
msgPrefix: `ObjectSetQuery<${cacheKey.otherKeys.map(x => JSON.stringify(x)).join(", ")}>`
|
|
29
|
+
}) : undefined);
|
|
30
|
+
this.#baseObjectSetWire = baseObjectSetWire;
|
|
31
|
+
this.#operations = operations;
|
|
32
|
+
this.#composedObjectSet = this.#composeObjectSet(opts);
|
|
33
|
+
this.#objectTypes = this.#extractObjectTypes(opts);
|
|
34
|
+
if (operations.orderBy && Object.keys(operations.orderBy).length > 0) {
|
|
35
|
+
const firstType = Array.from(this.#objectTypes)[0];
|
|
36
|
+
this.sortingStrategy = new OrderBySortingStrategy(firstType, operations.orderBy);
|
|
37
|
+
}
|
|
38
|
+
this.minResultsToLoad = opts.pageSize || 0;
|
|
39
|
+
}
|
|
40
|
+
#composeObjectSet(opts) {
|
|
41
|
+
let result = opts.baseObjectSet;
|
|
42
|
+
if (opts.withProperties) {
|
|
43
|
+
result = result.withProperties(opts.withProperties);
|
|
44
|
+
}
|
|
45
|
+
if (opts.where) {
|
|
46
|
+
result = result.where(opts.where);
|
|
47
|
+
}
|
|
48
|
+
if (opts.union && opts.union.length > 0) {
|
|
49
|
+
result = result.union(...opts.union);
|
|
50
|
+
}
|
|
51
|
+
if (opts.intersect && opts.intersect.length > 0) {
|
|
52
|
+
result = result.intersect(...opts.intersect);
|
|
53
|
+
}
|
|
54
|
+
if (opts.subtract && opts.subtract.length > 0) {
|
|
55
|
+
result = result.subtract(...opts.subtract);
|
|
56
|
+
}
|
|
57
|
+
if (opts.pivotTo) {
|
|
58
|
+
result = result.pivotTo(opts.pivotTo);
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
#extractObjectTypes(opts) {
|
|
63
|
+
const types = new Set();
|
|
64
|
+
const baseWire = JSON.parse(this.#baseObjectSetWire);
|
|
65
|
+
if (baseWire.type) {
|
|
66
|
+
types.add(baseWire.type);
|
|
67
|
+
}
|
|
68
|
+
if (opts.union) {
|
|
69
|
+
for (const os of opts.union) {
|
|
70
|
+
const wire = getWireObjectSet(os);
|
|
71
|
+
if (wire.type) {
|
|
72
|
+
types.add(wire.type);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (opts.intersect) {
|
|
77
|
+
for (const os of opts.intersect) {
|
|
78
|
+
const wire = getWireObjectSet(os);
|
|
79
|
+
if (wire.type) {
|
|
80
|
+
types.add(wire.type);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (opts.subtract) {
|
|
85
|
+
for (const os of opts.subtract) {
|
|
86
|
+
const wire = getWireObjectSet(os);
|
|
87
|
+
if (wire.type) {
|
|
88
|
+
types.add(wire.type);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// TODO: support pivotTo, requires resolving the target type from link metadata
|
|
94
|
+
|
|
95
|
+
return types;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Register changes to the cache specific to ObjectSetQuery
|
|
100
|
+
*/
|
|
101
|
+
registerCacheChanges(batch) {
|
|
102
|
+
batch.changes.registerObjectSet(this.cacheKey);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Implements fetchPageData from BaseListQuery template method
|
|
107
|
+
* Fetches a page of data from the composed ObjectSet
|
|
108
|
+
*/
|
|
109
|
+
async fetchPageData(signal) {
|
|
110
|
+
// Fetch the data with pagination
|
|
111
|
+
const resp = await this.#composedObjectSet.fetchPage({
|
|
112
|
+
$nextPageToken: this.nextPageToken,
|
|
113
|
+
$pageSize: this.options.pageSize,
|
|
114
|
+
// OrderBy is already applied in the composed ObjectSet
|
|
115
|
+
...(this.#operations.orderBy && Object.keys(this.#operations.orderBy).length > 0 ? {
|
|
116
|
+
$orderBy: this.#operations.orderBy
|
|
117
|
+
} : {})
|
|
118
|
+
});
|
|
119
|
+
if (signal?.aborted) {
|
|
120
|
+
throw new Error("Aborted");
|
|
121
|
+
}
|
|
122
|
+
this.nextPageToken = resp.nextPageToken;
|
|
123
|
+
return resp;
|
|
124
|
+
}
|
|
125
|
+
handleFetchError(error, _status, batch) {
|
|
126
|
+
this.logger?.error("error", error);
|
|
127
|
+
this.store.subjects.get(this.cacheKey).error(error);
|
|
128
|
+
return this.writeToStore({
|
|
129
|
+
data: []
|
|
130
|
+
}, "error", batch);
|
|
131
|
+
}
|
|
132
|
+
invalidateObjectType = async (objectType, changes) => {
|
|
133
|
+
if (this.#objectTypes.has(objectType)) {
|
|
134
|
+
changes?.modified.add(this.cacheKey);
|
|
135
|
+
return this.revalidate(true);
|
|
136
|
+
}
|
|
137
|
+
return Promise.resolve();
|
|
138
|
+
};
|
|
139
|
+
createPayload(params) {
|
|
140
|
+
return {
|
|
141
|
+
resolvedList: params.resolvedData,
|
|
142
|
+
isOptimistic: params.isOptimistic,
|
|
143
|
+
fetchMore: this.fetchMore,
|
|
144
|
+
hasMore: this.nextPageToken != null,
|
|
145
|
+
status: params.status,
|
|
146
|
+
lastUpdated: params.lastUpdated,
|
|
147
|
+
objectSet: this.#composedObjectSet
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=ObjectSetQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectSetQuery.js","names":["additionalContext","getWireObjectSet","BaseListQuery","OrderBySortingStrategy","ObjectSetQuery","baseObjectSetWire","operations","composedObjectSet","objectTypes","constructor","store","subject","cacheKey","opts","process","env","NODE_ENV","client","logger","child","msgPrefix","otherKeys","map","x","JSON","stringify","join","undefined","composeObjectSet","extractObjectTypes","orderBy","Object","keys","length","firstType","Array","from","sortingStrategy","minResultsToLoad","pageSize","#composeObjectSet","result","baseObjectSet","withProperties","where","union","intersect","subtract","pivotTo","#extractObjectTypes","types","Set","baseWire","parse","type","add","os","wire","registerCacheChanges","batch","changes","registerObjectSet","fetchPageData","signal","resp","fetchPage","$nextPageToken","nextPageToken","$pageSize","options","$orderBy","aborted","Error","handleFetchError","error","_status","subjects","get","writeToStore","data","invalidateObjectType","objectType","has","modified","revalidate","Promise","resolve","createPayload","params","resolvedList","resolvedData","isOptimistic","fetchMore","hasMore","status","lastUpdated","objectSet"],"sources":["ObjectSetQuery.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectSet, Osdk, PageResult } from \"@osdk/api\";\nimport type { Observable } from \"rxjs\";\nimport { additionalContext } from \"../../../Client.js\";\nimport { getWireObjectSet } from \"../../../objectSet/createObjectSet.js\";\nimport type { ObjectSetPayload } from \"../../ObjectSetPayload.js\";\nimport type { Status } from \"../../ObservableClient/common.js\";\nimport { BaseListQuery } from \"../base-list/BaseListQuery.js\";\nimport type { BatchContext } from \"../BatchContext.js\";\nimport type { Canonical } from \"../Canonical.js\";\nimport type { Changes } from \"../Changes.js\";\nimport type { Entry } from \"../Layer.js\";\nimport { OrderBySortingStrategy } from \"../sorting/SortingStrategy.js\";\nimport type { Store } from \"../Store.js\";\nimport type { SubjectPayload } from \"../SubjectPayload.js\";\nimport type {\n ObjectSetCacheKey,\n ObjectSetOperations,\n} from \"./ObjectSetCacheKey.js\";\nimport type { ObjectSetQueryOptions } from \"./ObjectSetQueryOptions.js\";\n\nexport class ObjectSetQuery extends BaseListQuery<\n ObjectSetCacheKey,\n ObjectSetPayload,\n ObjectSetQueryOptions\n> {\n #baseObjectSetWire: string;\n #operations: Canonical<ObjectSetOperations>;\n #composedObjectSet: ObjectSet<any, any>;\n #objectTypes: Set<string>;\n\n constructor(\n store: Store,\n subject: Observable<SubjectPayload<ObjectSetCacheKey>>,\n baseObjectSetWire: string,\n operations: Canonical<ObjectSetOperations>,\n cacheKey: ObjectSetCacheKey,\n opts: ObjectSetQueryOptions,\n ) {\n super(\n store,\n subject,\n opts,\n cacheKey,\n process.env.NODE_ENV !== \"production\"\n ? (\n store.client[additionalContext].logger?.child({}, {\n msgPrefix: `ObjectSetQuery<${\n cacheKey.otherKeys.map(x => JSON.stringify(x)).join(\", \")\n }>`,\n })\n )\n : undefined,\n );\n\n this.#baseObjectSetWire = baseObjectSetWire;\n this.#operations = operations;\n this.#composedObjectSet = this.#composeObjectSet(opts);\n this.#objectTypes = this.#extractObjectTypes(opts);\n\n if (operations.orderBy && Object.keys(operations.orderBy).length > 0) {\n const firstType = Array.from(this.#objectTypes)[0];\n this.sortingStrategy = new OrderBySortingStrategy(\n firstType,\n operations.orderBy,\n );\n }\n\n this.minResultsToLoad = opts.pageSize || 0;\n }\n\n #composeObjectSet(opts: ObjectSetQueryOptions): ObjectSet<any, any> {\n let result = opts.baseObjectSet;\n\n if (opts.withProperties) {\n result = result.withProperties(opts.withProperties);\n }\n if (opts.where) {\n result = result.where(opts.where);\n }\n if (opts.union && opts.union.length > 0) {\n result = result.union(...opts.union);\n }\n if (opts.intersect && opts.intersect.length > 0) {\n result = result.intersect(...opts.intersect);\n }\n if (opts.subtract && opts.subtract.length > 0) {\n result = result.subtract(...opts.subtract);\n }\n if (opts.pivotTo) {\n result = result.pivotTo(opts.pivotTo);\n }\n\n return result;\n }\n\n #extractObjectTypes(opts: ObjectSetQueryOptions): Set<string> {\n const types = new Set<string>();\n const baseWire = JSON.parse(this.#baseObjectSetWire);\n if (baseWire.type) {\n types.add(baseWire.type);\n }\n\n if (opts.union) {\n for (const os of opts.union) {\n const wire = getWireObjectSet(os);\n if (wire.type) {\n types.add(wire.type);\n }\n }\n }\n\n if (opts.intersect) {\n for (const os of opts.intersect) {\n const wire = getWireObjectSet(os);\n if (wire.type) {\n types.add(wire.type);\n }\n }\n }\n\n if (opts.subtract) {\n for (const os of opts.subtract) {\n const wire = getWireObjectSet(os);\n if (wire.type) {\n types.add(wire.type);\n }\n }\n }\n\n // TODO: support pivotTo, requires resolving the target type from link metadata\n\n return types;\n }\n\n /**\n * Register changes to the cache specific to ObjectSetQuery\n */\n protected registerCacheChanges(batch: BatchContext): void {\n batch.changes.registerObjectSet(this.cacheKey);\n }\n\n /**\n * Implements fetchPageData from BaseListQuery template method\n * Fetches a page of data from the composed ObjectSet\n */\n protected async fetchPageData(\n signal: AbortSignal | undefined,\n ): Promise<PageResult<Osdk.Instance<any>>> {\n // Fetch the data with pagination\n const resp = await this.#composedObjectSet.fetchPage({\n $nextPageToken: this.nextPageToken,\n $pageSize: this.options.pageSize,\n // OrderBy is already applied in the composed ObjectSet\n ...(this.#operations.orderBy\n && Object.keys(this.#operations.orderBy).length > 0\n ? { $orderBy: this.#operations.orderBy }\n : {}),\n });\n\n if (signal?.aborted) {\n throw new Error(\"Aborted\");\n }\n\n this.nextPageToken = resp.nextPageToken;\n\n return resp;\n }\n\n protected handleFetchError(\n error: unknown,\n _status: Status,\n batch: BatchContext,\n ): Entry<ObjectSetCacheKey> {\n this.logger?.error(\"error\", error);\n this.store.subjects.get(this.cacheKey).error(error);\n\n return this.writeToStore({ data: [] }, \"error\", batch);\n }\n\n invalidateObjectType = async (\n objectType: string,\n changes: Changes | undefined,\n ): Promise<void> => {\n if (this.#objectTypes.has(objectType)) {\n changes?.modified.add(this.cacheKey);\n return this.revalidate(true);\n }\n return Promise.resolve();\n };\n\n protected createPayload(\n params: {\n resolvedData: any[];\n isOptimistic: boolean;\n status: Status;\n lastUpdated: number;\n },\n ): ObjectSetPayload {\n return {\n resolvedList: params.resolvedData,\n isOptimistic: params.isOptimistic,\n fetchMore: this.fetchMore,\n hasMore: this.nextPageToken != null,\n status: params.status,\n lastUpdated: params.lastUpdated,\n objectSet: this.#composedObjectSet,\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,gBAAgB,QAAQ,uCAAuC;AAGxE,SAASC,aAAa,QAAQ,+BAA+B;AAK7D,SAASC,sBAAsB,QAAQ,+BAA+B;AAStE,OAAO,MAAMC,cAAc,SAASF,aAAa,CAI/C;EACA,CAACG,iBAAiB;EAClB,CAACC,UAAU;EACX,CAACC,iBAAiB;EAClB,CAACC,WAAW;EAEZC,WAAWA,CACTC,KAAY,EACZC,OAAsD,EACtDN,iBAAyB,EACzBC,UAA0C,EAC1CM,QAA2B,EAC3BC,IAA2B,EAC3B;IACA,KAAK,CACHH,KAAK,EACLC,OAAO,EACPE,IAAI,EACJD,QAAQ,EACRE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAEjCN,KAAK,CAACO,MAAM,CAACjB,iBAAiB,CAAC,CAACkB,MAAM,EAAEC,KAAK,CAAC,CAAC,CAAC,EAAE;MAChDC,SAAS,EAAE,kBACTR,QAAQ,CAACS,SAAS,CAACC,GAAG,CAACC,CAAC,IAAIC,IAAI,CAACC,SAAS,CAACF,CAAC,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC;IAE7D,CAAC,CAAC,GAEFC,SACN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AAK,CAAC,OAAO,EAAEA,KAAK,CAAC;IAClC,IAAI,CAAChE,KAAK,CAACkE,QAAQ,CAACC,GAAG,CAAC,IAAI,CAACjE,QAAQ,CAAC,CAAC8D,KAAK,CAACA,KAAK,CAAC;IAEnD,OAAO,IAAI,CAACI,YAAY,CAAC;MAAEC,IAAI,EAAE;IAAG,CAAC,EAAE,OAAO,EAAEpB,KAAK,CAAC;EACxD;EAEAqB,oBAAoB,GAAG,MAAAA,CACrBC,UAAkB,EAClBrB,OAA4B,KACV;IAClB,IAAI,IAAI,CAAC,CAACpD,WAAW,CAAC0E,GAAG,CAACD,UAAU,CAAC,EAAE;MACrCrB,OAAO,EAAEuB,QAAQ,CAAC5B,GAAG,CAAC,IAAI,CAAC3C,QAAQ,CAAC;MACpC,OAAO,IAAI,CAACwE,UAAU,CAAC,IAAI,CAAC;IAC9B;IACA,OAAOC,OAAO,CAACC,OAAO,CAAC,CAAC;EAC1B,CAAC;EAESC,aAAaA,CACrBC,MAKC,EACiB;IAClB,OAAO;MACLC,YAAY,EAAED,MAAM,CAACE,YAAY;MACjCC,YAAY,EAAEH,MAAM,CAACG,YAAY;MACjCC,SAAS,EAAE,IAAI,CAACA,SAAS;MACzBC,OAAO,EAAE,IAAI,CAAC1B,aAAa,IAAI,IAAI;MACnC2B,MAAM,EAAEN,MAAM,CAACM,MAAM;MACrBC,WAAW,EAAEP,MAAM,CAACO,WAAW;MAC/BC,SAAS,EAAE,IAAI,CAAC,CAACzF;IACnB,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectSetQueryOptions.js","names":[],"sources":["ObjectSetQueryOptions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n DerivedProperty,\n LinkNames,\n ObjectSet,\n ObjectTypeDefinition,\n PropertyKeys,\n WhereClause,\n WirePropertyTypes,\n} from \"@osdk/api\";\nimport type { CommonObserveOptions } from \"../../ObservableClient/common.js\";\n\nexport interface ObserveObjectSetOptions<\n Q extends ObjectTypeDefinition,\n RDPs extends Record<\n string,\n WirePropertyTypes | undefined | Array<WirePropertyTypes>\n > = {},\n> extends CommonObserveOptions {\n where?: WhereClause<Q>;\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<Q, RDPs[K]> };\n union?: ObjectSet<Q>[];\n intersect?: ObjectSet<Q>[];\n subtract?: ObjectSet<Q>[];\n pivotTo?: LinkNames<Q>;\n pageSize?: number;\n orderBy?: { [K in PropertyKeys<Q>]?: \"asc\" | \"desc\" };\n}\n\nexport interface ObjectSetQueryOptions\n extends ObserveObjectSetOptions<any, any>\n{\n baseObjectSet: ObjectSet<any>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
import * as OntologiesV2 from "@osdk/foundry.ontologies";
|
|
18
18
|
import { wireActionTypeV2ToSdkActionMetadata } from "@osdk/generator-converters";
|
|
19
19
|
export async function loadActionMetadata(client, actionType) {
|
|
20
|
-
const r = await OntologiesV2.ActionTypesV2.get(client, await client.ontologyRid, actionType
|
|
21
|
-
branch: client.branch
|
|
22
|
-
});
|
|
20
|
+
const r = await OntologiesV2.ActionTypesV2.get(client, await client.ontologyRid, actionType);
|
|
23
21
|
return wireActionTypeV2ToSdkActionMetadata(r);
|
|
24
22
|
}
|
|
25
23
|
//# sourceMappingURL=loadActionMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadActionMetadata.js","names":["OntologiesV2","wireActionTypeV2ToSdkActionMetadata","loadActionMetadata","client","actionType","r","ActionTypesV2","get","ontologyRid"
|
|
1
|
+
{"version":3,"file":"loadActionMetadata.js","names":["OntologiesV2","wireActionTypeV2ToSdkActionMetadata","loadActionMetadata","client","actionType","r","ActionTypesV2","get","ontologyRid"],"sources":["loadActionMetadata.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 { ActionMetadata } from \"@osdk/api\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport {\n wireActionTypeV2ToSdkActionMetadata,\n} from \"@osdk/generator-converters\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\nexport async function loadActionMetadata(\n client: MinimalClient,\n actionType: string,\n): Promise<ActionMetadata> {\n const r = await OntologiesV2.ActionTypesV2.get(\n client,\n await client.ontologyRid,\n actionType,\n );\n\n return wireActionTypeV2ToSdkActionMetadata(r);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAO,KAAKA,YAAY,MAAM,0BAA0B;AACxD,SACEC,mCAAmC,QAC9B,4BAA4B;AAGnC,OAAO,eAAeC,kBAAkBA,CACtCC,MAAqB,EACrBC,UAAkB,EACO;EACzB,MAAMC,CAAC,GAAG,MAAML,YAAY,CAACM,aAAa,CAACC,GAAG,CAC5CJ,MAAM,EACN,MAAMA,MAAM,CAACK,WAAW,EACxBJ,UACF,CAAC;EAED,OAAOH,mCAAmC,CAACI,CAAC,CAAC;AAC/C","ignoreList":[]}
|
|
@@ -18,8 +18,7 @@ import * as OntologiesV2 from "@osdk/foundry.ontologies";
|
|
|
18
18
|
import { wireObjectTypeFullMetadataToSdkObjectMetadata } from "@osdk/generator-converters";
|
|
19
19
|
export async function loadFullObjectMetadata(client, objectType) {
|
|
20
20
|
const full = await OntologiesV2.ObjectTypesV2.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
21
|
-
preview: true
|
|
22
|
-
branch: client.branch
|
|
21
|
+
preview: true
|
|
23
22
|
});
|
|
24
23
|
const ret = wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
25
24
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadFullObjectMetadata.js","names":["OntologiesV2","wireObjectTypeFullMetadataToSdkObjectMetadata","loadFullObjectMetadata","client","objectType","full","ObjectTypesV2","getFullMetadata","ontologyRid","preview","
|
|
1
|
+
{"version":3,"file":"loadFullObjectMetadata.js","names":["OntologiesV2","wireObjectTypeFullMetadataToSdkObjectMetadata","loadFullObjectMetadata","client","objectType","full","ObjectTypesV2","getFullMetadata","ontologyRid","preview","ret"],"sources":["loadFullObjectMetadata.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 { ObjectMetadata } from \"@osdk/api\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"@osdk/generator-converters\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\nexport async function loadFullObjectMetadata(\n client: MinimalClient,\n objectType: string,\n): Promise<ObjectMetadata & { rid: string }> {\n const full = await OntologiesV2.ObjectTypesV2.getFullMetadata(\n client,\n await client.ontologyRid,\n objectType,\n { preview: true },\n );\n const ret = wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);\n return { ...ret };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAO,KAAKA,YAAY,MAAM,0BAA0B;AACxD,SAASC,6CAA6C,QAAQ,4BAA4B;AAG1F,OAAO,eAAeC,sBAAsBA,CAC1CC,MAAqB,EACrBC,UAAkB,EACyB;EAC3C,MAAMC,IAAI,GAAG,MAAML,YAAY,CAACM,aAAa,CAACC,eAAe,CAC3DJ,MAAM,EACN,MAAMA,MAAM,CAACK,WAAW,EACxBJ,UAAU,EACV;IAAEK,OAAO,EAAE;EAAK,CAClB,CAAC;EACD,MAAMC,GAAG,GAAGT,6CAA6C,CAACI,IAAI,EAAE,IAAI,CAAC;EACrE,OAAO;IAAE,GAAGK;EAAI,CAAC;AACnB","ignoreList":[]}
|
|
@@ -18,8 +18,7 @@ import * as OntologiesV2 from "@osdk/foundry.ontologies";
|
|
|
18
18
|
import { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "@osdk/generator-converters";
|
|
19
19
|
export async function loadInterfaceMetadata(client, objectType) {
|
|
20
20
|
const r = await OntologiesV2.OntologyInterfaces.get(client, await client.ontologyRid, objectType, {
|
|
21
|
-
preview: true
|
|
22
|
-
branch: client.branch
|
|
21
|
+
preview: true
|
|
23
22
|
});
|
|
24
23
|
return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
25
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadInterfaceMetadata.js","names":["OntologiesV2","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","loadInterfaceMetadata","client","objectType","r","OntologyInterfaces","get","ontologyRid","preview"
|
|
1
|
+
{"version":3,"file":"loadInterfaceMetadata.js","names":["OntologiesV2","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","loadInterfaceMetadata","client","objectType","r","OntologyInterfaces","get","ontologyRid","preview"],"sources":["loadInterfaceMetadata.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 { InterfaceMetadata } from \"@osdk/api\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\nexport async function loadInterfaceMetadata(\n client: MinimalClient,\n objectType: string,\n): Promise<InterfaceMetadata> {\n const r = await OntologiesV2.OntologyInterfaces.get(\n client,\n await client.ontologyRid,\n objectType,\n { preview: true },\n );\n\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAO,KAAKA,YAAY,MAAM,0BAA0B;AACxD,SAASC,mDAAmD,QAAQ,4BAA4B;AAGhG,OAAO,eAAeC,qBAAqBA,CACzCC,MAAqB,EACrBC,UAAkB,EACU;EAC5B,MAAMC,CAAC,GAAG,MAAML,YAAY,CAACM,kBAAkB,CAACC,GAAG,CACjDJ,MAAM,EACN,MAAMA,MAAM,CAACK,WAAW,EACxBJ,UAAU,EACV;IAAEK,OAAO,EAAE;EAAK,CAClB,CAAC;EAED,OAAOR,mDAAmD,CAACI,CAAC,EAAE,IAAI,CAAC;AACrE","ignoreList":[]}
|
|
@@ -18,6 +18,7 @@ export { augment } from "../object/fetchPage.js";
|
|
|
18
18
|
|
|
19
19
|
// THIS IS NOT THE FINAL NAME DO NOT SHIP LIKE THIS
|
|
20
20
|
|
|
21
|
+
export { computeObjectSetCacheKey } from "../observable/computeObjectSetCacheKey.js";
|
|
21
22
|
export { createObservableClient } from "../observable/ObservableClient.js";
|
|
22
23
|
export { getMetaTagContent, getOsdkConfig } from "../public-utils/osdkConfig.js";
|
|
23
24
|
export { createClientWithTransaction } from "../createClient.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unstable-do-not-use.js","names":["augment","createObservableClient","getMetaTagContent","getOsdkConfig","createClientWithTransaction"],"sources":["unstable-do-not-use.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 { augment } from \"../object/fetchPage.js\";\n\n// THIS IS NOT THE FINAL NAME DO NOT SHIP LIKE THIS\nexport type { ActionSignatureFromDef } from \"../actions/applyAction.js\";\nexport { createObservableClient } from \"../observable/ObservableClient.js\";\nexport type {\n ObservableClient,\n ObserveObjectArgs,\n ObserveObjectsArgs,\n Unsubscribable,\n} from \"../observable/ObservableClient.js\";\nexport type { Observer } from \"../observable/ObservableClient/common.js\";\nexport type { ObserveLinks } from \"../observable/ObservableClient/ObserveLink.js\";\nexport {\n getMetaTagContent,\n getOsdkConfig,\n} from \"../public-utils/osdkConfig.js\";\nexport type { OsdkConfig } from \"../public-utils/osdkConfig.js\";\n\nexport { createClientWithTransaction } from \"../createClient.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,wBAAwB;;AAEhD;;AAEA,SAASC,sBAAsB,QAAQ,mCAAmC;
|
|
1
|
+
{"version":3,"file":"unstable-do-not-use.js","names":["augment","computeObjectSetCacheKey","createObservableClient","getMetaTagContent","getOsdkConfig","createClientWithTransaction"],"sources":["unstable-do-not-use.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 { augment } from \"../object/fetchPage.js\";\n\n// THIS IS NOT THE FINAL NAME DO NOT SHIP LIKE THIS\nexport type { ActionSignatureFromDef } from \"../actions/applyAction.js\";\nexport { computeObjectSetCacheKey } from \"../observable/computeObjectSetCacheKey.js\";\nexport { createObservableClient } from \"../observable/ObservableClient.js\";\nexport type {\n ObservableClient,\n ObserveObjectArgs,\n ObserveObjectsArgs,\n ObserveObjectSetArgs,\n Unsubscribable,\n} from \"../observable/ObservableClient.js\";\nexport type { Observer } from \"../observable/ObservableClient/common.js\";\nexport type { ObserveLinks } from \"../observable/ObservableClient/ObserveLink.js\";\nexport {\n getMetaTagContent,\n getOsdkConfig,\n} from \"../public-utils/osdkConfig.js\";\nexport type { OsdkConfig } from \"../public-utils/osdkConfig.js\";\n\nexport { createClientWithTransaction } from \"../createClient.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,wBAAwB;;AAEhD;;AAEA,SAASC,wBAAwB,QAAQ,2CAA2C;AACpF,SAASC,sBAAsB,QAAQ,mCAAmC;AAU1E,SACEC,iBAAiB,EACjBC,aAAa,QACR,+BAA+B;AAGtC,SAASC,2BAA2B,QAAQ,oBAAoB","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export const USER_AGENT = `osdk-client/${"2.5.0
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.5.0
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.5.0"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.5.0"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.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 const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.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 const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,wBAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,mCAAuD","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
const DEFAULT_OPTIONS = {
|
|
18
|
+
initialDelayMs: 1000,
|
|
19
|
+
maxDelayMs: 60000,
|
|
20
|
+
multiplier: 2,
|
|
21
|
+
jitterFactor: 0.3
|
|
22
|
+
};
|
|
23
|
+
export class ExponentialBackoff {
|
|
24
|
+
attempt = 0;
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
this.options = {
|
|
27
|
+
...DEFAULT_OPTIONS,
|
|
28
|
+
...options
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
calculateDelay() {
|
|
32
|
+
const {
|
|
33
|
+
initialDelayMs,
|
|
34
|
+
maxDelayMs,
|
|
35
|
+
multiplier,
|
|
36
|
+
jitterFactor
|
|
37
|
+
} = this.options;
|
|
38
|
+
const baseDelay = Math.min(initialDelayMs * Math.pow(multiplier, this.attempt), maxDelayMs);
|
|
39
|
+
const jitter = baseDelay * jitterFactor * (Math.random() * 2 - 1);
|
|
40
|
+
const delayWithJitter = Math.max(0, baseDelay + jitter);
|
|
41
|
+
this.attempt++;
|
|
42
|
+
return Math.round(delayWithJitter);
|
|
43
|
+
}
|
|
44
|
+
reset() {
|
|
45
|
+
this.attempt = 0;
|
|
46
|
+
}
|
|
47
|
+
getAttempt() {
|
|
48
|
+
return this.attempt;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=exponentialBackoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exponentialBackoff.js","names":["DEFAULT_OPTIONS","initialDelayMs","maxDelayMs","multiplier","jitterFactor","ExponentialBackoff","attempt","constructor","options","calculateDelay","baseDelay","Math","min","pow","jitter","random","delayWithJitter","max","round","reset","getAttempt"],"sources":["exponentialBackoff.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface ExponentialBackoffOptions {\n initialDelayMs?: number;\n maxDelayMs?: number;\n multiplier?: number;\n jitterFactor?: number;\n}\n\nconst DEFAULT_OPTIONS: Required<ExponentialBackoffOptions> = {\n initialDelayMs: 1000,\n maxDelayMs: 60000,\n multiplier: 2,\n jitterFactor: 0.3,\n};\n\nexport class ExponentialBackoff {\n private attempt = 0;\n private readonly options: Required<ExponentialBackoffOptions>;\n\n constructor(options: ExponentialBackoffOptions = {}) {\n this.options = { ...DEFAULT_OPTIONS, ...options };\n }\n\n calculateDelay(): number {\n const { initialDelayMs, maxDelayMs, multiplier, jitterFactor } =\n this.options;\n\n const baseDelay = Math.min(\n initialDelayMs * Math.pow(multiplier, this.attempt),\n maxDelayMs,\n );\n\n const jitter = baseDelay * jitterFactor * (Math.random() * 2 - 1);\n const delayWithJitter = Math.max(0, baseDelay + jitter);\n\n this.attempt++;\n\n return Math.round(delayWithJitter);\n }\n\n reset(): void {\n this.attempt = 0;\n }\n\n getAttempt(): number {\n return this.attempt;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,MAAMA,eAAoD,GAAG;EAC3DC,cAAc,EAAE,IAAI;EACpBC,UAAU,EAAE,KAAK;EACjBC,UAAU,EAAE,CAAC;EACbC,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,kBAAkB,CAAC;EACtBC,OAAO,GAAG,CAAC;EAGnBC,WAAWA,CAACC,OAAkC,GAAG,CAAC,CAAC,EAAE;IACnD,IAAI,CAACA,OAAO,GAAG;MAAE,GAAGR,eAAe;MAAE,GAAGQ;IAAQ,CAAC;EACnD;EAEAC,cAAcA,CAAA,EAAW;IACvB,MAAM;MAAER,cAAc;MAAEC,UAAU;MAAEC,UAAU;MAAEC;IAAa,CAAC,GAC5D,IAAI,CAACI,OAAO;IAEd,MAAME,SAAS,GAAGC,IAAI,CAACC,GAAG,CACxBX,cAAc,GAAGU,IAAI,CAACE,GAAG,CAACV,UAAU,EAAE,IAAI,CAACG,OAAO,CAAC,EACnDJ,UACF,CAAC;IAED,MAAMY,MAAM,GAAGJ,SAAS,GAAGN,YAAY,IAAIO,IAAI,CAACI,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjE,MAAMC,eAAe,GAAGL,IAAI,CAACM,GAAG,CAAC,CAAC,EAAEP,SAAS,GAAGI,MAAM,CAAC;IAEvD,IAAI,CAACR,OAAO,EAAE;IAEd,OAAOK,IAAI,CAACO,KAAK,CAACF,eAAe,CAAC;EACpC;EAEAG,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACb,OAAO,GAAG,CAAC;EAClB;EAEAc,UAAUA,CAAA,EAAW;IACnB,OAAO,IAAI,CAACd,OAAO;EACrB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
import { describe, expect, it } from "vitest";
|
|
18
|
+
import { ExponentialBackoff } from "./exponentialBackoff.js";
|
|
19
|
+
describe("ExponentialBackoff", () => {
|
|
20
|
+
it("should exponentially increase delay", () => {
|
|
21
|
+
const backoff = new ExponentialBackoff({
|
|
22
|
+
initialDelayMs: 1000,
|
|
23
|
+
multiplier: 2,
|
|
24
|
+
jitterFactor: 0
|
|
25
|
+
});
|
|
26
|
+
expect(backoff.calculateDelay()).toBe(1000); // 1000 * 2^0
|
|
27
|
+
expect(backoff.calculateDelay()).toBe(2000); // 1000 * 2^1
|
|
28
|
+
expect(backoff.calculateDelay()).toBe(4000); // 1000 * 2^2
|
|
29
|
+
expect(backoff.calculateDelay()).toBe(8000); // 1000 * 2^3
|
|
30
|
+
});
|
|
31
|
+
it("should respect max delay", () => {
|
|
32
|
+
const backoff = new ExponentialBackoff({
|
|
33
|
+
initialDelayMs: 1000,
|
|
34
|
+
maxDelayMs: 5000,
|
|
35
|
+
multiplier: 2,
|
|
36
|
+
jitterFactor: 0
|
|
37
|
+
});
|
|
38
|
+
expect(backoff.calculateDelay()).toBe(1000);
|
|
39
|
+
expect(backoff.calculateDelay()).toBe(2000);
|
|
40
|
+
expect(backoff.calculateDelay()).toBe(4000);
|
|
41
|
+
expect(backoff.calculateDelay()).toBe(5000); // capped at max
|
|
42
|
+
expect(backoff.calculateDelay()).toBe(5000); // still capped
|
|
43
|
+
});
|
|
44
|
+
it("should add jitter", () => {
|
|
45
|
+
new ExponentialBackoff({
|
|
46
|
+
initialDelayMs: 1000,
|
|
47
|
+
jitterFactor: 0.5
|
|
48
|
+
});
|
|
49
|
+
const delays = new Set();
|
|
50
|
+
for (let i = 0; i < 10; i++) {
|
|
51
|
+
const b = new ExponentialBackoff({
|
|
52
|
+
initialDelayMs: 1000,
|
|
53
|
+
jitterFactor: 0.5
|
|
54
|
+
});
|
|
55
|
+
delays.add(b.calculateDelay());
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// With jitter, we should get different values
|
|
59
|
+
expect(delays.size).toBeGreaterThan(1);
|
|
60
|
+
|
|
61
|
+
// All values should be within jitter range
|
|
62
|
+
for (const delay of delays) {
|
|
63
|
+
expect(delay).toBeGreaterThanOrEqual(500); // 1000 - (1000 * 0.5)
|
|
64
|
+
expect(delay).toBeLessThanOrEqual(1500); // 1000 + (1000 * 0.5)
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
it("should reset attempt counter", () => {
|
|
68
|
+
const backoff = new ExponentialBackoff({
|
|
69
|
+
initialDelayMs: 1000,
|
|
70
|
+
multiplier: 2,
|
|
71
|
+
jitterFactor: 0
|
|
72
|
+
});
|
|
73
|
+
expect(backoff.calculateDelay()).toBe(1000);
|
|
74
|
+
expect(backoff.calculateDelay()).toBe(2000);
|
|
75
|
+
expect(backoff.getAttempt()).toBe(2);
|
|
76
|
+
backoff.reset();
|
|
77
|
+
expect(backoff.getAttempt()).toBe(0);
|
|
78
|
+
expect(backoff.calculateDelay()).toBe(1000); // back to initial
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=exponentialBackoff.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exponentialBackoff.test.js","names":["describe","expect","it","ExponentialBackoff","backoff","initialDelayMs","multiplier","jitterFactor","calculateDelay","toBe","maxDelayMs","delays","Set","i","b","add","size","toBeGreaterThan","delay","toBeGreaterThanOrEqual","toBeLessThanOrEqual","getAttempt","reset"],"sources":["exponentialBackoff.test.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 { describe, expect, it } from \"vitest\";\nimport { ExponentialBackoff } from \"./exponentialBackoff.js\";\n\ndescribe(\"ExponentialBackoff\", () => {\n it(\"should exponentially increase delay\", () => {\n const backoff = new ExponentialBackoff({\n initialDelayMs: 1000,\n multiplier: 2,\n jitterFactor: 0,\n });\n\n expect(backoff.calculateDelay()).toBe(1000); // 1000 * 2^0\n expect(backoff.calculateDelay()).toBe(2000); // 1000 * 2^1\n expect(backoff.calculateDelay()).toBe(4000); // 1000 * 2^2\n expect(backoff.calculateDelay()).toBe(8000); // 1000 * 2^3\n });\n\n it(\"should respect max delay\", () => {\n const backoff = new ExponentialBackoff({\n initialDelayMs: 1000,\n maxDelayMs: 5000,\n multiplier: 2,\n jitterFactor: 0,\n });\n\n expect(backoff.calculateDelay()).toBe(1000);\n expect(backoff.calculateDelay()).toBe(2000);\n expect(backoff.calculateDelay()).toBe(4000);\n expect(backoff.calculateDelay()).toBe(5000); // capped at max\n expect(backoff.calculateDelay()).toBe(5000); // still capped\n });\n\n it(\"should add jitter\", () => {\n const backoff = new ExponentialBackoff({\n initialDelayMs: 1000,\n jitterFactor: 0.5,\n });\n\n const delays = new Set<number>();\n for (let i = 0; i < 10; i++) {\n const b = new ExponentialBackoff({\n initialDelayMs: 1000,\n jitterFactor: 0.5,\n });\n delays.add(b.calculateDelay());\n }\n\n // With jitter, we should get different values\n expect(delays.size).toBeGreaterThan(1);\n\n // All values should be within jitter range\n for (const delay of delays) {\n expect(delay).toBeGreaterThanOrEqual(500); // 1000 - (1000 * 0.5)\n expect(delay).toBeLessThanOrEqual(1500); // 1000 + (1000 * 0.5)\n }\n });\n\n it(\"should reset attempt counter\", () => {\n const backoff = new ExponentialBackoff({\n initialDelayMs: 1000,\n multiplier: 2,\n jitterFactor: 0,\n });\n\n expect(backoff.calculateDelay()).toBe(1000);\n expect(backoff.calculateDelay()).toBe(2000);\n expect(backoff.getAttempt()).toBe(2);\n\n backoff.reset();\n expect(backoff.getAttempt()).toBe(0);\n expect(backoff.calculateDelay()).toBe(1000); // back to initial\n });\n});\n"],"mappings":"AAAA;AACA;AACA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AC,IAAI,CAAC;IAC3CR,MAAM,CAACG,OAAO,CAACI,cAAc,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;IAC3CR,MAAM,CAACG,OAAO,CAACiB,UAAU,CAAC,CAAC,CAAC,CAACZ,IAAI,CAAC,CAAC,CAAC;IAEpCL,OAAO,CAACkB,KAAK,CAAC,CAAC;IACfrB,MAAM,CAACG,OAAO,CAACiB,UAAU,CAAC,CAAC,CAAC,CAACZ,IAAI,CAAC,CAAC,CAAC;IACpCR,MAAM,CAACG,OAAO,CAACI,cAAc,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;EAC/C,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { NULL_VALUE } from "@osdk/api";
|
|
18
17
|
import * as OntologiesV2 from "@osdk/foundry.ontologies";
|
|
19
18
|
import { isAttachmentFile, isAttachmentUpload } from "../object/AttachmentUpload.js";
|
|
20
|
-
import { isMediaReference
|
|
19
|
+
import { isMediaReference } from "../object/mediaUpload.js";
|
|
21
20
|
import { getWireObjectSet, isObjectSet } from "../objectSet/createObjectSet.js";
|
|
22
21
|
import { isInterfaceActionParam } from "./interfaceUtils.js";
|
|
23
22
|
import { isObjectSpecifiersObject } from "./isObjectSpecifiersObject.js";
|
|
@@ -38,9 +37,6 @@ export async function toDataValue(value, client, actionMetadata) {
|
|
|
38
37
|
// Null values are not allowed with OSDK types, but leaving here as an override.
|
|
39
38
|
return value;
|
|
40
39
|
}
|
|
41
|
-
if (value === NULL_VALUE) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
40
|
|
|
45
41
|
// arrays and sets are both sent over the wire as arrays
|
|
46
42
|
if (Array.isArray(value) || value instanceof Set) {
|
|
@@ -70,16 +66,6 @@ export async function toDataValue(value, client, actionMetadata) {
|
|
|
70
66
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
71
67
|
}
|
|
72
68
|
|
|
73
|
-
// new media item upload interface, very similar to how attachments work above
|
|
74
|
-
|
|
75
|
-
if (isMediaUpload(value)) {
|
|
76
|
-
const mediaRef = await OntologiesV2.MediaReferenceProperties.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
|
|
77
|
-
mediaItemPath: value.path,
|
|
78
|
-
preview: true
|
|
79
|
-
});
|
|
80
|
-
return await toDataValue(mediaRef, client, actionMetadata);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
69
|
// objects just send the JSON'd primaryKey
|
|
84
70
|
if (isOntologyObjectV2(value)) {
|
|
85
71
|
return await toDataValue(value.__primaryKey, client, actionMetadata);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDataValue.js","names":["
|
|
1
|
+
{"version":3,"file":"toDataValue.js","names":["OntologiesV2","isAttachmentFile","isAttachmentUpload","isMediaReference","getWireObjectSet","isObjectSet","isInterfaceActionParam","isObjectSpecifiersObject","isOntologyObjectV2","isPoint","isWireObjectSet","toDataValue","value","client","actionMetadata","Array","isArray","Set","values","from","some","dataValue","converted","push","promiseArray","innerValue","Promise","all","attachment","Attachments","upload","data","filename","name","rid","__primaryKey","$primaryKey","coordinates","objectTypeApiName","$objectType","primaryKeyValue","Object","entries","reduce","promisedAcc","key","structValue","acc","resolve"],"sources":["toDataValue.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 { ActionMetadata } from \"@osdk/api\";\nimport { type DataValue } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n isAttachmentFile,\n isAttachmentUpload,\n} from \"../object/AttachmentUpload.js\";\nimport { isMediaReference } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isInterfaceActionParam } from \"./interfaceUtils.js\";\nimport { isObjectSpecifiersObject } from \"./isObjectSpecifiersObject.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isPoint } from \"./isPoint.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n * @internal\n */\nexport async function toDataValue(\n value: unknown,\n client: MinimalClient,\n actionMetadata: ActionMetadata,\n): Promise<DataValue> {\n if (value == null) {\n // typeof null is 'object' so do this first\n // Sending null over the wire clears the data, whereas undefined is dropped at request time.\n // Null values are not allowed with OSDK types, but leaving here as an override.\n return value;\n }\n\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n const values = Array.from(value);\n if (\n values.some((dataValue) =>\n isAttachmentUpload(dataValue) || isAttachmentFile(dataValue)\n )\n ) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValue(value, client, actionMetadata));\n }\n return converted;\n }\n const promiseArray = Array.from(\n value,\n async (innerValue) =>\n await toDataValue(innerValue, client, actionMetadata),\n );\n return Promise.all(promiseArray);\n }\n\n // For uploads, we need to upload ourselves first to get the RID of the attachment\n if (isAttachmentUpload(value)) {\n const attachment = await OntologiesV2.Attachments.upload(\n client,\n value.data,\n {\n filename: value.name,\n },\n );\n return await toDataValue(attachment.rid, client, actionMetadata);\n }\n\n if (isAttachmentFile(value)) {\n const attachment = await OntologiesV2.Attachments.upload(\n client,\n value,\n {\n filename: value.name as string,\n },\n );\n return await toDataValue(attachment.rid, client, actionMetadata);\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return await toDataValue(value.__primaryKey, client, actionMetadata);\n }\n\n if (isObjectSpecifiersObject(value)) {\n return await toDataValue(value.$primaryKey, client, actionMetadata);\n }\n\n if (isPoint(value)) {\n return await toDataValue(\n `${value.coordinates[1]},${value.coordinates[0]}`,\n client,\n actionMetadata,\n );\n }\n\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n\n if (isMediaReference(value)) {\n return value;\n }\n\n if (isInterfaceActionParam(value)) {\n return {\n objectTypeApiName: value.$objectType,\n primaryKeyValue: value.$primaryKey,\n };\n }\n\n // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce(\n async (promisedAcc, [key, structValue]) => {\n const acc = await promisedAcc;\n acc[key] = await toDataValue(structValue, client, actionMetadata);\n return acc;\n },\n Promise.resolve({} as { [key: string]: DataValue }),\n );\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp, object type reference\n return value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,KAAKA,YAAY,MAAM,0BAA0B;AAExD,SACEC,gBAAgB,EAChBC,kBAAkB,QACb,+BAA+B;AACtC,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,iCAAiC;AAC/E,SAASC,sBAAsB,QAAQ,qBAAqB;AAC5D,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,OAAO,QAAQ,cAAc;AACtC,SAASC,eAAe,QAAQ,oBAAoB;;AAEpD;AACA;AACA;AACA;AACA;AACA;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