@osdk/client 2.8.0-beta.27 → 2.8.0-beta.29
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 +31 -0
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +4 -20
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/observable/ObservableClient/MediaObservableTypes.js +2 -0
- package/build/browser/observable/ObservableClient/MediaObservableTypes.js.map +1 -0
- package/build/browser/observable/ObservableClient/MediaTypes.js +2 -0
- package/build/browser/observable/ObservableClient/MediaTypes.js.map +1 -0
- package/build/browser/observable/ObservableClient.js.map +1 -1
- 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/ListQueryView.js +21 -9
- package/build/browser/observable/internal/ListQueryView.js.map +1 -1
- package/build/browser/observable/internal/ObservableClientImpl.js +32 -0
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/OrderByCanonicalizer.js +5 -2
- package/build/browser/observable/internal/OrderByCanonicalizer.js.map +1 -1
- package/build/browser/observable/internal/SelectCanonicalizer.js +3 -0
- package/build/browser/observable/internal/SelectCanonicalizer.js.map +1 -1
- package/build/browser/observable/internal/Store.js +5 -1
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/WhereClauseCanonicalizer.js +3 -0
- package/build/browser/observable/internal/WhereClauseCanonicalizer.js.map +1 -1
- package/build/browser/observable/internal/list/InterfaceListQuery.js +2 -6
- package/build/browser/observable/internal/list/InterfaceListQuery.js.map +1 -1
- package/build/browser/observable/internal/list/ListQuery.js +6 -9
- package/build/browser/observable/internal/list/ListQuery.js.map +1 -1
- package/build/browser/observable/internal/media/BlobMemoryManager.js +116 -0
- package/build/browser/observable/internal/media/BlobMemoryManager.js.map +1 -0
- package/build/browser/observable/internal/media/MediaMetadataCacheKey.js +2 -0
- package/build/browser/observable/internal/media/MediaMetadataCacheKey.js.map +1 -0
- package/build/browser/observable/internal/media/MediaMetadataQuery.js +159 -0
- package/build/browser/observable/internal/media/MediaMetadataQuery.js.map +1 -0
- package/build/browser/observable/internal/media/getMediaCacheKey.js +28 -0
- package/build/browser/observable/internal/media/getMediaCacheKey.js.map +1 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/queries/applyQuery.js +1 -1
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-BWOPPEUP.cjs → chunk-KGWUPXAM.cjs} +2 -19
- package/build/cjs/chunk-KGWUPXAM.cjs.map +1 -0
- package/build/cjs/{chunk-ZPGIIKEZ.cjs → chunk-XYZOCIVH.cjs} +40 -40
- package/build/cjs/chunk-XYZOCIVH.cjs.map +1 -0
- package/build/cjs/index.cjs +10 -10
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +137 -89
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +19 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +4 -20
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/observable/ObservableClient/MediaObservableTypes.js +2 -0
- package/build/esm/observable/ObservableClient/MediaObservableTypes.js.map +1 -0
- package/build/esm/observable/ObservableClient/MediaTypes.js +2 -0
- package/build/esm/observable/ObservableClient/MediaTypes.js.map +1 -0
- package/build/esm/observable/ObservableClient.js.map +1 -1
- 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/ListQueryView.js +21 -9
- package/build/esm/observable/internal/ListQueryView.js.map +1 -1
- package/build/esm/observable/internal/ObservableClientImpl.js +32 -0
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/OrderByCanonicalizer.js +5 -2
- package/build/esm/observable/internal/OrderByCanonicalizer.js.map +1 -1
- package/build/esm/observable/internal/SelectCanonicalizer.js +3 -0
- package/build/esm/observable/internal/SelectCanonicalizer.js.map +1 -1
- package/build/esm/observable/internal/Store.js +5 -1
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/WhereClauseCanonicalizer.js +3 -0
- package/build/esm/observable/internal/WhereClauseCanonicalizer.js.map +1 -1
- package/build/esm/observable/internal/list/InterfaceListQuery.js +2 -6
- package/build/esm/observable/internal/list/InterfaceListQuery.js.map +1 -1
- package/build/esm/observable/internal/list/ListQuery.js +6 -9
- package/build/esm/observable/internal/list/ListQuery.js.map +1 -1
- package/build/esm/observable/internal/media/BlobMemoryManager.js +116 -0
- package/build/esm/observable/internal/media/BlobMemoryManager.js.map +1 -0
- package/build/esm/observable/internal/media/MediaMetadataCacheKey.js +2 -0
- package/build/esm/observable/internal/media/MediaMetadataCacheKey.js.map +1 -0
- package/build/esm/observable/internal/media/MediaMetadataQuery.js +159 -0
- package/build/esm/observable/internal/media/MediaMetadataQuery.js.map +1 -0
- package/build/esm/observable/internal/media/getMediaCacheKey.js +28 -0
- package/build/esm/observable/internal/media/getMediaCacheKey.js.map +1 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/queries/applyQuery.js +1 -1
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/observable/ObservableClient/MediaObservableTypes.d.ts +35 -0
- package/build/types/observable/ObservableClient/MediaObservableTypes.d.ts.map +1 -0
- package/build/types/observable/ObservableClient/MediaTypes.d.ts +1 -0
- package/build/types/observable/ObservableClient/MediaTypes.d.ts.map +1 -0
- package/build/types/observable/ObservableClient.d.ts +19 -0
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/internal/Changes.d.ts +4 -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/ListQueryView.d.ts.map +1 -1
- package/build/types/observable/internal/OrderByCanonicalizer.d.ts +2 -1
- package/build/types/observable/internal/OrderByCanonicalizer.d.ts.map +1 -1
- package/build/types/observable/internal/SelectCanonicalizer.d.ts +2 -0
- package/build/types/observable/internal/SelectCanonicalizer.d.ts.map +1 -1
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts +1 -0
- package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts.map +1 -1
- package/build/types/observable/internal/list/InterfaceListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/list/ListQuery.d.ts +2 -0
- package/build/types/observable/internal/list/ListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/media/BlobMemoryManager.d.ts +10 -0
- package/build/types/observable/internal/media/BlobMemoryManager.d.ts.map +1 -0
- package/build/types/observable/internal/media/MediaMetadataCacheKey.d.ts +4 -0
- package/build/types/observable/internal/media/MediaMetadataCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/media/MediaMetadataQuery.d.ts +23 -0
- package/build/types/observable/internal/media/MediaMetadataQuery.d.ts.map +1 -0
- package/build/types/observable/internal/media/getMediaCacheKey.d.ts +2 -0
- package/build/types/observable/internal/media/getMediaCacheKey.d.ts.map +1 -0
- package/build/types/public/unstable-do-not-use.d.ts +1 -1
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/package.json +7 -7
- package/build/cjs/chunk-BWOPPEUP.cjs.map +0 -1
- package/build/cjs/chunk-ZPGIIKEZ.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkXYZOCIVH_cjs = require('../chunk-XYZOCIVH.cjs');
|
|
4
|
+
var chunkKGWUPXAM_cjs = require('../chunk-KGWUPXAM.cjs');
|
|
5
5
|
require('../chunk-GSVXEVM4.cjs');
|
|
6
6
|
require('../chunk-D26YLHTV.cjs');
|
|
7
7
|
require('../chunk-YJG67XL4.cjs');
|
|
@@ -65,10 +65,13 @@ var OrderByCanonicalizer = class {
|
|
|
65
65
|
const data = Object.fromEntries(pairs);
|
|
66
66
|
return data;
|
|
67
67
|
});
|
|
68
|
-
canonicalize
|
|
68
|
+
canonicalize(orderBy) {
|
|
69
|
+
if (orderBy == null) {
|
|
70
|
+
return void 0;
|
|
71
|
+
}
|
|
69
72
|
const strings = Object.entries(orderBy).flat();
|
|
70
73
|
return this.#trie.lookupArray(strings);
|
|
71
|
-
}
|
|
74
|
+
}
|
|
72
75
|
};
|
|
73
76
|
var WhereClauseCanonicalizer = class {
|
|
74
77
|
/**
|
|
@@ -92,6 +95,9 @@ var WhereClauseCanonicalizer = class {
|
|
|
92
95
|
*/
|
|
93
96
|
#existingOptions = /* @__PURE__ */ new Map();
|
|
94
97
|
canonicalize(where) {
|
|
98
|
+
if (where == null) {
|
|
99
|
+
return void 0;
|
|
100
|
+
}
|
|
95
101
|
if (this.#cache.has(where)) {
|
|
96
102
|
return this.#cache.get(where);
|
|
97
103
|
}
|
|
@@ -139,7 +145,7 @@ var WhereClauseCanonicalizer = class {
|
|
|
139
145
|
var whereCanonicalizer = new WhereClauseCanonicalizer();
|
|
140
146
|
var orderByCanonicalizer = new OrderByCanonicalizer();
|
|
141
147
|
function computeObjectSetCacheKey(objectSet, options) {
|
|
142
|
-
const keyParts = ["objectSet",
|
|
148
|
+
const keyParts = ["objectSet", chunkKGWUPXAM_cjs.getWireObjectSet(objectSet)];
|
|
143
149
|
if (!options) {
|
|
144
150
|
return JSON.stringify(keyParts);
|
|
145
151
|
}
|
|
@@ -151,13 +157,13 @@ function computeObjectSetCacheKey(objectSet, options) {
|
|
|
151
157
|
keyParts.push("props", propKeys);
|
|
152
158
|
}
|
|
153
159
|
if (options.union && options.union.length > 0) {
|
|
154
|
-
keyParts.push("union", options.union.map((os) =>
|
|
160
|
+
keyParts.push("union", options.union.map((os) => chunkKGWUPXAM_cjs.getWireObjectSet(os)));
|
|
155
161
|
}
|
|
156
162
|
if (options.intersect && options.intersect.length > 0) {
|
|
157
|
-
keyParts.push("intersect", options.intersect.map((os) =>
|
|
163
|
+
keyParts.push("intersect", options.intersect.map((os) => chunkKGWUPXAM_cjs.getWireObjectSet(os)));
|
|
158
164
|
}
|
|
159
165
|
if (options.subtract && options.subtract.length > 0) {
|
|
160
|
-
keyParts.push("subtract", options.subtract.map((os) =>
|
|
166
|
+
keyParts.push("subtract", options.subtract.map((os) => chunkKGWUPXAM_cjs.getWireObjectSet(os)));
|
|
161
167
|
}
|
|
162
168
|
if (options.pivotTo) {
|
|
163
169
|
keyParts.push("pivotTo", options.pivotTo);
|
|
@@ -187,6 +193,9 @@ var UnsubscribableWrapper = class {
|
|
|
187
193
|
|
|
188
194
|
// src/observable/internal/ObservableClientImpl.ts
|
|
189
195
|
var ObservableClientImpl = class {
|
|
196
|
+
#unionCache = /* @__PURE__ */ new WeakMap();
|
|
197
|
+
#intersectCache = /* @__PURE__ */ new WeakMap();
|
|
198
|
+
#subtractCache = /* @__PURE__ */ new WeakMap();
|
|
190
199
|
constructor(store) {
|
|
191
200
|
this.__experimentalStore = store;
|
|
192
201
|
this.applyAction = store.applyAction.bind(store);
|
|
@@ -221,8 +230,8 @@ var ObservableClientImpl = class {
|
|
|
221
230
|
const instances = [];
|
|
222
231
|
const objectSetWires = [];
|
|
223
232
|
for (const item of options.dependsOnObjects ?? []) {
|
|
224
|
-
if (
|
|
225
|
-
objectSetWires.push(
|
|
233
|
+
if (chunkKGWUPXAM_cjs.isObjectSet(item)) {
|
|
234
|
+
objectSetWires.push(chunkKGWUPXAM_cjs.getWireObjectSet(item));
|
|
226
235
|
} else {
|
|
227
236
|
instances.push({
|
|
228
237
|
$apiName: item.$objectType ?? item.$apiName,
|
|
@@ -230,7 +239,7 @@ var ObservableClientImpl = class {
|
|
|
230
239
|
});
|
|
231
240
|
}
|
|
232
241
|
}
|
|
233
|
-
const objectSetTypesPromise = objectSetWires.length > 0 ? Promise.all(objectSetWires.map((wire) =>
|
|
242
|
+
const objectSetTypesPromise = objectSetWires.length > 0 ? Promise.all(objectSetWires.map((wire) => chunkKGWUPXAM_cjs.extractObjectOrInterfaceType(this.__experimentalStore.client[chunkKGWUPXAM_cjs.additionalContext], wire))).then((types) => types.filter((t) => t != null).map((t) => t.apiName)) : void 0;
|
|
234
243
|
return this.__experimentalStore.functions.observe({
|
|
235
244
|
...options,
|
|
236
245
|
queryDef,
|
|
@@ -273,6 +282,35 @@ var ObservableClientImpl = class {
|
|
|
273
282
|
canonicalizeWhereClause(where) {
|
|
274
283
|
return this.__experimentalStore.whereCanonicalizer.canonicalize(where);
|
|
275
284
|
}
|
|
285
|
+
canonicalizeOptions(options) {
|
|
286
|
+
const store = this.__experimentalStore;
|
|
287
|
+
const result = {
|
|
288
|
+
...options
|
|
289
|
+
};
|
|
290
|
+
result.where = store.whereCanonicalizer.canonicalize(result.where);
|
|
291
|
+
result.withProperties = store.genericCanonicalizer.canonicalize(result.withProperties);
|
|
292
|
+
result.orderBy = store.orderByCanonicalizer.canonicalize(result.orderBy);
|
|
293
|
+
result.aggregate = store.genericCanonicalizer.canonicalize(result.aggregate);
|
|
294
|
+
result.intersectWith = store.genericCanonicalizer.canonicalize(result.intersectWith);
|
|
295
|
+
result.$select = store.selectCanonicalizer.canonicalize(result.$select);
|
|
296
|
+
result.union = this.#canonObjectSetArray(result.union, store.objectSetArrayCanonicalizer.canonicalizeUnion.bind(store.objectSetArrayCanonicalizer), this.#unionCache);
|
|
297
|
+
result.intersect = this.#canonObjectSetArray(result.intersect, store.objectSetArrayCanonicalizer.canonicalizeIntersect.bind(store.objectSetArrayCanonicalizer), this.#intersectCache);
|
|
298
|
+
result.subtract = this.#canonObjectSetArray(result.subtract, store.objectSetArrayCanonicalizer.canonicalizeSubtract.bind(store.objectSetArrayCanonicalizer), this.#subtractCache);
|
|
299
|
+
return result;
|
|
300
|
+
}
|
|
301
|
+
#canonObjectSetArray(arr, canonicalize, cache) {
|
|
302
|
+
if (!arr || arr.length === 0) {
|
|
303
|
+
return arr;
|
|
304
|
+
}
|
|
305
|
+
const wireStrings = arr.map((os) => JSON.stringify(chunkKGWUPXAM_cjs.getWireObjectSet(os)));
|
|
306
|
+
const canonKey = canonicalize(wireStrings);
|
|
307
|
+
let cached = cache.get(canonKey);
|
|
308
|
+
if (!cached) {
|
|
309
|
+
cached = arr;
|
|
310
|
+
cache.set(canonKey, cached);
|
|
311
|
+
}
|
|
312
|
+
return cached;
|
|
313
|
+
}
|
|
276
314
|
};
|
|
277
315
|
function observeSingleLink(store, objectsArray, linkName, options, observer) {
|
|
278
316
|
if (objectsArray.length === 0) {
|
|
@@ -459,7 +497,7 @@ var OptimisticJob = class {
|
|
|
459
497
|
return this;
|
|
460
498
|
},
|
|
461
499
|
createObject(type, pk, properties) {
|
|
462
|
-
const create = store.client[
|
|
500
|
+
const create = store.client[chunkKGWUPXAM_cjs.additionalContext].objectFactory2(store.client[chunkKGWUPXAM_cjs.additionalContext], [{
|
|
463
501
|
$primaryKey: pk,
|
|
464
502
|
$apiName: type.apiName,
|
|
465
503
|
$objectType: type.apiName,
|
|
@@ -597,7 +635,7 @@ var ListQueryView = class {
|
|
|
597
635
|
#viewLimit;
|
|
598
636
|
#pageSize;
|
|
599
637
|
#viewId;
|
|
600
|
-
#
|
|
638
|
+
#autoFetchMinimum;
|
|
601
639
|
#fetchMore;
|
|
602
640
|
#pendingFetchMore;
|
|
603
641
|
#lastPayload;
|
|
@@ -606,8 +644,8 @@ var ListQueryView = class {
|
|
|
606
644
|
this.#query = query;
|
|
607
645
|
this.#pageSize = pageSize;
|
|
608
646
|
this.#viewId = `view_${++viewIdCounter}`;
|
|
609
|
-
this.#
|
|
610
|
-
this.#viewLimit = this.#
|
|
647
|
+
this.#autoFetchMinimum = autoFetchMore === true ? Number.MAX_SAFE_INTEGER : typeof autoFetchMore === "number" && autoFetchMore > 0 ? autoFetchMore : 0;
|
|
648
|
+
this.#viewLimit = this.#autoFetchMinimum > 0 ? Number.MAX_SAFE_INTEGER : pageSize;
|
|
611
649
|
this.#fetchMore = this.#createFetchMore();
|
|
612
650
|
query.registerFetchPageSize(this.#viewId, pageSize);
|
|
613
651
|
}
|
|
@@ -616,8 +654,10 @@ var ListQueryView = class {
|
|
|
616
654
|
const sub = this.#query.subscribe({
|
|
617
655
|
next: (payload) => {
|
|
618
656
|
this.#lastPayload = payload;
|
|
619
|
-
observer
|
|
620
|
-
|
|
657
|
+
this.#observer?.next?.(this.#transformPayload(payload));
|
|
658
|
+
const loadedCount = payload.resolvedList?.length ?? 0;
|
|
659
|
+
const fetchThreshold = this.#autoFetchMinimum > 0 ? this.#autoFetchMinimum : this.#viewLimit;
|
|
660
|
+
if (payload.status === "loaded" && this.#query.hasMorePages() && loadedCount < fetchThreshold) {
|
|
621
661
|
void this.#query.fetchMore();
|
|
622
662
|
}
|
|
623
663
|
},
|
|
@@ -639,12 +679,19 @@ var ListQueryView = class {
|
|
|
639
679
|
#transformPayload(payload) {
|
|
640
680
|
const resolvedList = payload.resolvedList;
|
|
641
681
|
const loadedCount = resolvedList?.length ?? 0;
|
|
682
|
+
let status = payload.status;
|
|
683
|
+
if (this.#autoFetchMinimum > 0 && status === "loaded" && this.#query.hasMorePages() && loadedCount < this.#autoFetchMinimum) {
|
|
684
|
+
status = "loading";
|
|
685
|
+
}
|
|
686
|
+
if (loadedCount >= this.#viewLimit && status === "loading") {
|
|
687
|
+
status = "loaded";
|
|
688
|
+
}
|
|
642
689
|
return {
|
|
643
690
|
...payload,
|
|
644
691
|
resolvedList: resolvedList?.slice(0, this.#viewLimit),
|
|
645
692
|
hasMore: this.#viewLimit < loadedCount || payload.hasMore,
|
|
646
693
|
fetchMore: this.#fetchMore,
|
|
647
|
-
status
|
|
694
|
+
status
|
|
648
695
|
};
|
|
649
696
|
}
|
|
650
697
|
#createFetchMore() {
|
|
@@ -917,7 +964,7 @@ var Query = class {
|
|
|
917
964
|
this.store = store;
|
|
918
965
|
this.cacheKeys = store.cacheKeys;
|
|
919
966
|
this.#subject = observable;
|
|
920
|
-
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[
|
|
967
|
+
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkKGWUPXAM_cjs.additionalContext].logger : store.client[chunkKGWUPXAM_cjs.additionalContext].logger?.child({}, {
|
|
921
968
|
msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
|
|
922
969
|
}));
|
|
923
970
|
}
|
|
@@ -1079,7 +1126,7 @@ var AggregationQuery = class extends Query {
|
|
|
1079
1126
|
#invalidationTypes;
|
|
1080
1127
|
#invalidationTypesPromise;
|
|
1081
1128
|
constructor(store, subject, cacheKey, opts) {
|
|
1082
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1129
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkKGWUPXAM_cjs.additionalContext].logger?.child({}, {
|
|
1083
1130
|
msgPrefix: `AggregationQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1084
1131
|
}) : void 0);
|
|
1085
1132
|
this.apiName = cacheKey.otherKeys[API_NAME_IDX];
|
|
@@ -1097,7 +1144,7 @@ var AggregationQuery = class extends Query {
|
|
|
1097
1144
|
try {
|
|
1098
1145
|
const {
|
|
1099
1146
|
invalidationSet
|
|
1100
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
1147
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkKGWUPXAM_cjs.additionalContext], wireObjectSet);
|
|
1101
1148
|
return /* @__PURE__ */ new Set([this.apiName, ...invalidationSet]);
|
|
1102
1149
|
} catch (error) {
|
|
1103
1150
|
this.store.logger?.error("Failed to compute invalidation types for aggregation, falling back to base type only", error);
|
|
@@ -1168,7 +1215,7 @@ var ObjectAggregationQuery = class extends AggregationQuery {
|
|
|
1168
1215
|
};
|
|
1169
1216
|
let objectSet;
|
|
1170
1217
|
if (this.parsedWireObjectSet) {
|
|
1171
|
-
objectSet =
|
|
1218
|
+
objectSet = chunkKGWUPXAM_cjs.createObjectSet(objectTypeDef, this.store.client[chunkKGWUPXAM_cjs.additionalContext], this.parsedWireObjectSet);
|
|
1172
1219
|
} else {
|
|
1173
1220
|
objectSet = this.store.client(objectTypeDef);
|
|
1174
1221
|
}
|
|
@@ -1210,7 +1257,7 @@ var AggregationsHelper = class extends AbstractHelper {
|
|
|
1210
1257
|
return this.getOrCreateQuery(options, void 0);
|
|
1211
1258
|
}
|
|
1212
1259
|
getQueryWithObjectSet(options) {
|
|
1213
|
-
const serializedObjectSet = JSON.stringify(
|
|
1260
|
+
const serializedObjectSet = JSON.stringify(chunkKGWUPXAM_cjs.getWireObjectSet(options.objectSet));
|
|
1214
1261
|
return this.getOrCreateQuery(options, serializedObjectSet);
|
|
1215
1262
|
}
|
|
1216
1263
|
getOrCreateQuery(options, serializedObjectSet) {
|
|
@@ -1533,7 +1580,7 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1533
1580
|
path.push("$:map_end");
|
|
1534
1581
|
return arr;
|
|
1535
1582
|
}
|
|
1536
|
-
if (
|
|
1583
|
+
if (chunkXYZOCIVH_cjs.isObjectSpecifiersObject(value)) {
|
|
1537
1584
|
const objectType = value.$objectType ?? value.$apiName;
|
|
1538
1585
|
path.push("$:osdk", objectType, value.$primaryKey);
|
|
1539
1586
|
return {
|
|
@@ -1541,8 +1588,8 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1541
1588
|
$primaryKey: value.$primaryKey
|
|
1542
1589
|
};
|
|
1543
1590
|
}
|
|
1544
|
-
if (
|
|
1545
|
-
const wire =
|
|
1591
|
+
if (chunkKGWUPXAM_cjs.isObjectSet(value)) {
|
|
1592
|
+
const wire = chunkKGWUPXAM_cjs.getWireObjectSet(value);
|
|
1546
1593
|
path.push("$:objectset", wire);
|
|
1547
1594
|
return wire;
|
|
1548
1595
|
}
|
|
@@ -1602,7 +1649,7 @@ var FunctionQuery = class extends Query {
|
|
|
1602
1649
|
#dependsOnObjects;
|
|
1603
1650
|
#queryDef;
|
|
1604
1651
|
constructor(store, subject, queryDef, params, cacheKey, opts, objectSetTypesPromise) {
|
|
1605
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1652
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkKGWUPXAM_cjs.additionalContext].logger?.child({}, {
|
|
1606
1653
|
msgPrefix: `FunctionQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1607
1654
|
}) : void 0);
|
|
1608
1655
|
this.#apiName = queryDef.apiName;
|
|
@@ -1659,7 +1706,7 @@ var FunctionQuery = class extends Query {
|
|
|
1659
1706
|
}).debug("calling _fetchAndStore");
|
|
1660
1707
|
}
|
|
1661
1708
|
try {
|
|
1662
|
-
const result = await
|
|
1709
|
+
const result = await chunkXYZOCIVH_cjs.applyQuery(this.store.client[chunkKGWUPXAM_cjs.additionalContext], this.#queryDef, this.#params);
|
|
1663
1710
|
const executedAt = Date.now();
|
|
1664
1711
|
this.store.batch({}, (batch) => {
|
|
1665
1712
|
this.writeToStore({
|
|
@@ -2873,7 +2920,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2873
2920
|
batch.changes.modified.add(this.cacheKey);
|
|
2874
2921
|
}
|
|
2875
2922
|
constructor(store, subject, cacheKey, opts) {
|
|
2876
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
2923
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkKGWUPXAM_cjs.additionalContext].logger?.child({}, {
|
|
2877
2924
|
msgPrefix: `SpecificLinkQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
2878
2925
|
}) : void 0);
|
|
2879
2926
|
[this.#sourceApiName, this.#sourceTypeKind, this.#sourceUnderlyingObjectType, this.#sourcePk, this.#linkName, this.#whereClause, this.#orderBy] = cacheKey.otherKeys;
|
|
@@ -2887,7 +2934,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2887
2934
|
*/
|
|
2888
2935
|
async fetchPageData(signal) {
|
|
2889
2936
|
const client = this.store.client;
|
|
2890
|
-
const ontologyProvider = client[
|
|
2937
|
+
const ontologyProvider = client[chunkKGWUPXAM_cjs.additionalContext].ontologyProvider;
|
|
2891
2938
|
const isInterface = this.#sourceTypeKind === "interface";
|
|
2892
2939
|
if (this.#orderBy && Object.keys(this.#orderBy).length > 0) {
|
|
2893
2940
|
let targetTypeApiName;
|
|
@@ -2998,7 +3045,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2998
3045
|
}
|
|
2999
3046
|
return (async () => {
|
|
3000
3047
|
try {
|
|
3001
|
-
const ontologyProvider = this.store.client[
|
|
3048
|
+
const ontologyProvider = this.store.client[chunkKGWUPXAM_cjs.additionalContext].ontologyProvider;
|
|
3002
3049
|
if (this.#sourceTypeKind === "interface") {
|
|
3003
3050
|
const objectMetadata = await ontologyProvider.getObjectDefinition(objectType);
|
|
3004
3051
|
if (this.#sourceApiName in objectMetadata.interfaceMap) {
|
|
@@ -3160,7 +3207,6 @@ function objectSortaMatchesWhereClause(o, whereClause, strict) {
|
|
|
3160
3207
|
var ListQuery = class extends BaseListQuery {
|
|
3161
3208
|
// pageSize?: number; // this is the internal page size. we need to track this properly
|
|
3162
3209
|
#whereClause;
|
|
3163
|
-
// Using base class minResultsToLoad instead of a private property
|
|
3164
3210
|
#orderBy;
|
|
3165
3211
|
#select;
|
|
3166
3212
|
#intersectWith;
|
|
@@ -3174,7 +3220,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3174
3220
|
batch.changes.registerList(this.cacheKey);
|
|
3175
3221
|
}
|
|
3176
3222
|
constructor(store, subject, apiName, cacheKey, opts) {
|
|
3177
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
3223
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkKGWUPXAM_cjs.additionalContext].logger?.child({}, {
|
|
3178
3224
|
msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
3179
3225
|
}) : void 0);
|
|
3180
3226
|
this.apiName = apiName;
|
|
@@ -3187,13 +3233,6 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3187
3233
|
if (!this.#pivotInfo) {
|
|
3188
3234
|
this.sortingStrategy = new OrderBySortingStrategy(this.apiName, this.#orderBy);
|
|
3189
3235
|
}
|
|
3190
|
-
if (opts.autoFetchMore === true) {
|
|
3191
|
-
this.minResultsToLoad = Number.MAX_SAFE_INTEGER;
|
|
3192
|
-
} else if (typeof opts.autoFetchMore === "number") {
|
|
3193
|
-
this.minResultsToLoad = Math.max(0, opts.autoFetchMore);
|
|
3194
|
-
} else {
|
|
3195
|
-
this.minResultsToLoad = 0;
|
|
3196
|
-
}
|
|
3197
3236
|
}
|
|
3198
3237
|
get canonicalWhere() {
|
|
3199
3238
|
return this.#whereClause;
|
|
@@ -3210,6 +3249,12 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3210
3249
|
get canonicalPivotInfo() {
|
|
3211
3250
|
return this.#pivotInfo;
|
|
3212
3251
|
}
|
|
3252
|
+
createPayload(params) {
|
|
3253
|
+
return {
|
|
3254
|
+
...super.createPayload(params),
|
|
3255
|
+
objectSet: this.#objectSet
|
|
3256
|
+
};
|
|
3257
|
+
}
|
|
3213
3258
|
/**
|
|
3214
3259
|
* Implements fetchPageData from BaseCollectionQuery template method
|
|
3215
3260
|
* Fetches a page of data
|
|
@@ -3217,10 +3262,10 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3217
3262
|
async fetchPageData(signal) {
|
|
3218
3263
|
const needsResultType = Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy) || this.#pivotInfo != null && this.#intersectWith != null && this.#intersectWith.length > 0 && !this.#pivotIntersectApplied;
|
|
3219
3264
|
if (needsResultType) {
|
|
3220
|
-
const wireObjectSet =
|
|
3265
|
+
const wireObjectSet = chunkKGWUPXAM_cjs.getWireObjectSet(this.#objectSet);
|
|
3221
3266
|
const {
|
|
3222
3267
|
resultType
|
|
3223
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
3268
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkKGWUPXAM_cjs.additionalContext], wireObjectSet);
|
|
3224
3269
|
if (Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
3225
3270
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#orderBy);
|
|
3226
3271
|
}
|
|
@@ -3495,7 +3540,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3495
3540
|
type,
|
|
3496
3541
|
apiName: this.apiName
|
|
3497
3542
|
};
|
|
3498
|
-
const clientCtx = store.client[
|
|
3543
|
+
const clientCtx = store.client[chunkKGWUPXAM_cjs.additionalContext];
|
|
3499
3544
|
let objectSet;
|
|
3500
3545
|
if (rids != null) {
|
|
3501
3546
|
objectSet = clientCtx.objectSetFactory(objectTypeDef, clientCtx, {
|
|
@@ -3528,17 +3573,13 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3528
3573
|
createPayload(params) {
|
|
3529
3574
|
const resolvedList = params.resolvedData?.map((obj) => obj.$as(this.apiName));
|
|
3530
3575
|
return {
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
fetchMore: this.fetchMore,
|
|
3534
|
-
hasMore: this.nextPageToken != null,
|
|
3535
|
-
status: params.status,
|
|
3536
|
-
lastUpdated: params.lastUpdated
|
|
3576
|
+
...super.createPayload(params),
|
|
3577
|
+
resolvedList
|
|
3537
3578
|
};
|
|
3538
3579
|
}
|
|
3539
3580
|
extractRelevantObjects(changes) {
|
|
3540
3581
|
const matchesApiName = ([, object]) => {
|
|
3541
|
-
return this.apiName in object[
|
|
3582
|
+
return this.apiName in object[chunkXYZOCIVH_cjs.ObjectDefRef].interfaceMap;
|
|
3542
3583
|
};
|
|
3543
3584
|
const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
3544
3585
|
const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
@@ -3557,7 +3598,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3557
3598
|
}
|
|
3558
3599
|
};
|
|
3559
3600
|
function createSourceSetForPivot(store, pivotInfo, rids) {
|
|
3560
|
-
const clientCtx = store.client[
|
|
3601
|
+
const clientCtx = store.client[chunkKGWUPXAM_cjs.additionalContext];
|
|
3561
3602
|
if (rids != null) {
|
|
3562
3603
|
return clientCtx.objectSetFactory({
|
|
3563
3604
|
type: "object",
|
|
@@ -3612,7 +3653,7 @@ var ObjectListQuery = class extends ListQuery {
|
|
|
3612
3653
|
const intersectWith = this.cacheKey.otherKeys[INTERSECT_IDX2];
|
|
3613
3654
|
const pivotInfo = this.cacheKey.otherKeys[PIVOT_IDX];
|
|
3614
3655
|
const rids = this.cacheKey.otherKeys[RIDS_IDX];
|
|
3615
|
-
const clientCtx = store.client[
|
|
3656
|
+
const clientCtx = store.client[chunkKGWUPXAM_cjs.additionalContext];
|
|
3616
3657
|
const typeDefinition = {
|
|
3617
3658
|
type: "object",
|
|
3618
3659
|
apiName: this.apiName
|
|
@@ -3758,8 +3799,8 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3758
3799
|
if (rdpFields.size === 0) {
|
|
3759
3800
|
return value;
|
|
3760
3801
|
}
|
|
3761
|
-
const underlying = value[
|
|
3762
|
-
const objectDef = value[
|
|
3802
|
+
const underlying = value[chunkXYZOCIVH_cjs.UnderlyingOsdkObject];
|
|
3803
|
+
const objectDef = value[chunkXYZOCIVH_cjs.ObjectDefRef];
|
|
3763
3804
|
const newProps = {
|
|
3764
3805
|
$apiName: underlying.$apiName,
|
|
3765
3806
|
$objectType: underlying.$objectType,
|
|
@@ -3772,7 +3813,7 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3772
3813
|
newProps[key] = underlying[key];
|
|
3773
3814
|
}
|
|
3774
3815
|
}
|
|
3775
|
-
return
|
|
3816
|
+
return chunkXYZOCIVH_cjs.createOsdkObject(value[chunkXYZOCIVH_cjs.ClientRef], objectDef, newProps);
|
|
3776
3817
|
}
|
|
3777
3818
|
function isSuperset(superset, subset) {
|
|
3778
3819
|
for (const field of subset) {
|
|
@@ -3783,8 +3824,8 @@ function isSuperset(superset, subset) {
|
|
|
3783
3824
|
return true;
|
|
3784
3825
|
}
|
|
3785
3826
|
function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
3786
|
-
const underlying = value[
|
|
3787
|
-
const objectDef = value[
|
|
3827
|
+
const underlying = value[chunkXYZOCIVH_cjs.UnderlyingOsdkObject];
|
|
3828
|
+
const objectDef = value[chunkXYZOCIVH_cjs.ObjectDefRef];
|
|
3788
3829
|
const newProps = {
|
|
3789
3830
|
$apiName: underlying.$apiName,
|
|
3790
3831
|
$objectType: underlying.$objectType,
|
|
@@ -3800,12 +3841,12 @@ function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
|
3800
3841
|
}
|
|
3801
3842
|
}
|
|
3802
3843
|
}
|
|
3803
|
-
return
|
|
3844
|
+
return chunkXYZOCIVH_cjs.createOsdkObject(value[chunkXYZOCIVH_cjs.ClientRef], objectDef, newProps);
|
|
3804
3845
|
}
|
|
3805
3846
|
function mergeSelectFields(sourceValue, selectFields, existingValue) {
|
|
3806
|
-
const sourceUnderlying = sourceValue[
|
|
3807
|
-
const existingUnderlying = existingValue[
|
|
3808
|
-
const objectDef = sourceValue[
|
|
3847
|
+
const sourceUnderlying = sourceValue[chunkXYZOCIVH_cjs.UnderlyingOsdkObject];
|
|
3848
|
+
const existingUnderlying = existingValue[chunkXYZOCIVH_cjs.UnderlyingOsdkObject];
|
|
3849
|
+
const objectDef = sourceValue[chunkXYZOCIVH_cjs.ObjectDefRef];
|
|
3809
3850
|
const newProps = {
|
|
3810
3851
|
$apiName: sourceUnderlying.$apiName,
|
|
3811
3852
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3823,7 +3864,7 @@ function mergeSelectFields(sourceValue, selectFields, existingValue) {
|
|
|
3823
3864
|
newProps[key] = sourceUnderlying[key];
|
|
3824
3865
|
}
|
|
3825
3866
|
}
|
|
3826
|
-
return
|
|
3867
|
+
return chunkXYZOCIVH_cjs.createOsdkObject(sourceValue[chunkXYZOCIVH_cjs.ClientRef], objectDef, newProps);
|
|
3827
3868
|
}
|
|
3828
3869
|
function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, targetCurrentValue) {
|
|
3829
3870
|
if (targetRdpFields.size === 0) {
|
|
@@ -3835,8 +3876,8 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3835
3876
|
}
|
|
3836
3877
|
return filterToRdpFields(sourceValue, targetRdpFields, sourceRdpFields);
|
|
3837
3878
|
}
|
|
3838
|
-
const sourceUnderlying = sourceValue[
|
|
3839
|
-
const objectDef = sourceValue[
|
|
3879
|
+
const sourceUnderlying = sourceValue[chunkXYZOCIVH_cjs.UnderlyingOsdkObject];
|
|
3880
|
+
const objectDef = sourceValue[chunkXYZOCIVH_cjs.ObjectDefRef];
|
|
3840
3881
|
const newProps = {
|
|
3841
3882
|
$apiName: sourceUnderlying.$apiName,
|
|
3842
3883
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3850,7 +3891,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3850
3891
|
}
|
|
3851
3892
|
}
|
|
3852
3893
|
if (targetCurrentValue) {
|
|
3853
|
-
const targetUnderlying = targetCurrentValue[
|
|
3894
|
+
const targetUnderlying = targetCurrentValue[chunkXYZOCIVH_cjs.UnderlyingOsdkObject];
|
|
3854
3895
|
for (const field of targetRdpFields) {
|
|
3855
3896
|
if (field in targetUnderlying) {
|
|
3856
3897
|
if (!sourceRdpFields.has(field) || newProps[field] === void 0) {
|
|
@@ -3859,7 +3900,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3859
3900
|
}
|
|
3860
3901
|
}
|
|
3861
3902
|
}
|
|
3862
|
-
return
|
|
3903
|
+
return chunkXYZOCIVH_cjs.createOsdkObject(sourceValue[chunkXYZOCIVH_cjs.ClientRef], objectDef, newProps);
|
|
3863
3904
|
}
|
|
3864
3905
|
|
|
3865
3906
|
// src/observable/internal/object/ObjectCacheKeyRegistry.ts
|
|
@@ -4014,7 +4055,7 @@ var BulkObjectLoader = class {
|
|
|
4014
4055
|
#maxEntries;
|
|
4015
4056
|
constructor(client, maxWait = 25, maxEntries = 100) {
|
|
4016
4057
|
this.#client = client;
|
|
4017
|
-
this.#logger = client[
|
|
4058
|
+
this.#logger = client[chunkKGWUPXAM_cjs.additionalContext].logger;
|
|
4018
4059
|
this.#maxWait = maxWait;
|
|
4019
4060
|
this.#maxEntries = maxEntries;
|
|
4020
4061
|
}
|
|
@@ -4164,7 +4205,7 @@ var ObjectQuery = class extends Query {
|
|
|
4164
4205
|
#loadPropertySecurityMetadata;
|
|
4165
4206
|
#implementingTypes;
|
|
4166
4207
|
constructor(store, subject, type, pk, cacheKey, opts, defType = "object", select, loadPropertySecurityMetadata) {
|
|
4167
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
4208
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkKGWUPXAM_cjs.additionalContext].logger?.child({}, {
|
|
4168
4209
|
msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
4169
4210
|
}) : void 0);
|
|
4170
4211
|
this.#apiName = type;
|
|
@@ -4266,7 +4307,7 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4266
4307
|
select,
|
|
4267
4308
|
$loadPropertySecurityMetadata
|
|
4268
4309
|
} = options;
|
|
4269
|
-
const defType =
|
|
4310
|
+
const defType = chunkXYZOCIVH_cjs.getDefType(options.apiName);
|
|
4270
4311
|
const objectCacheKey = this.cacheKeys.get("object", apiName, pk, rdpConfig ?? void 0);
|
|
4271
4312
|
return this.store.queries.get(objectCacheKey, () => new ObjectQuery(this.store, this.store.subjects.get(objectCacheKey), apiName, pk, objectCacheKey, {
|
|
4272
4313
|
dedupeInterval: 0
|
|
@@ -4304,7 +4345,7 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4304
4345
|
if (valueToWrite !== tombstone && existing?.value && this.isObjectHolder(existing.value)) {
|
|
4305
4346
|
const expectedRdpFields = this.store.objectCacheKeyRegistry.getRdpFieldSet(sourceCacheKey);
|
|
4306
4347
|
if (expectedRdpFields.size > 0) {
|
|
4307
|
-
const underlying = valueToWrite[
|
|
4348
|
+
const underlying = valueToWrite[chunkXYZOCIVH_cjs.UnderlyingOsdkObject];
|
|
4308
4349
|
const actualRdpFields = /* @__PURE__ */ new Set();
|
|
4309
4350
|
for (const field of expectedRdpFields) {
|
|
4310
4351
|
if (underlying && field in underlying) {
|
|
@@ -4374,7 +4415,7 @@ var ObjectSetQuery = class _ObjectSetQuery extends BaseListQuery {
|
|
|
4374
4415
|
#requiresServerEvaluation;
|
|
4375
4416
|
#resultTypeApiName;
|
|
4376
4417
|
constructor(store, subject, baseObjectSetWire, operations, cacheKey, opts) {
|
|
4377
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
4418
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkKGWUPXAM_cjs.additionalContext].logger?.child({}, {
|
|
4378
4419
|
msgPrefix: `ObjectSetQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
4379
4420
|
}) : void 0);
|
|
4380
4421
|
this.#baseObjectSetWire = baseObjectSetWire;
|
|
@@ -4442,7 +4483,7 @@ var ObjectSetQuery = class _ObjectSetQuery extends BaseListQuery {
|
|
|
4442
4483
|
return;
|
|
4443
4484
|
}
|
|
4444
4485
|
for (const os of sets) {
|
|
4445
|
-
const typeName = _ObjectSetQuery.#extractTypeFromWireObjectSet(
|
|
4486
|
+
const typeName = _ObjectSetQuery.#extractTypeFromWireObjectSet(chunkKGWUPXAM_cjs.getWireObjectSet(os));
|
|
4446
4487
|
if (typeName) {
|
|
4447
4488
|
types.add(typeName);
|
|
4448
4489
|
}
|
|
@@ -4469,10 +4510,10 @@ var ObjectSetQuery = class _ObjectSetQuery extends BaseListQuery {
|
|
|
4469
4510
|
*/
|
|
4470
4511
|
async fetchPageData(signal) {
|
|
4471
4512
|
if (this.#operations.orderBy && Object.keys(this.#operations.orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
4472
|
-
const wireObjectSet =
|
|
4513
|
+
const wireObjectSet = chunkKGWUPXAM_cjs.getWireObjectSet(this.#composedObjectSet);
|
|
4473
4514
|
const {
|
|
4474
4515
|
resultType
|
|
4475
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
4516
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkKGWUPXAM_cjs.additionalContext], wireObjectSet);
|
|
4476
4517
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#operations.orderBy);
|
|
4477
4518
|
}
|
|
4478
4519
|
const resp = await this.#composedObjectSet.fetchPage({
|
|
@@ -4693,7 +4734,7 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
4693
4734
|
const {
|
|
4694
4735
|
baseObjectSet
|
|
4695
4736
|
} = options;
|
|
4696
|
-
const baseObjectSetWire = JSON.stringify(
|
|
4737
|
+
const baseObjectSetWire = JSON.stringify(chunkKGWUPXAM_cjs.getWireObjectSet(baseObjectSet));
|
|
4697
4738
|
const operations = this.buildCanonicalizedOperations(options);
|
|
4698
4739
|
const objectSetCacheKey = this.cacheKeys.get("objectSet", baseObjectSetWire, operations);
|
|
4699
4740
|
return this.store.queries.get(objectSetCacheKey, () => {
|
|
@@ -4709,13 +4750,13 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
4709
4750
|
operations.withProperties = this.rdpCanonicalizer.canonicalize(options.withProperties);
|
|
4710
4751
|
}
|
|
4711
4752
|
if (options.union && options.union.length > 0) {
|
|
4712
|
-
operations.union = this.objectSetArrayCanonicalizer.canonicalizeUnion(options.union.map((os) => JSON.stringify(
|
|
4753
|
+
operations.union = this.objectSetArrayCanonicalizer.canonicalizeUnion(options.union.map((os) => JSON.stringify(chunkKGWUPXAM_cjs.getWireObjectSet(os))));
|
|
4713
4754
|
}
|
|
4714
4755
|
if (options.intersect && options.intersect.length > 0) {
|
|
4715
|
-
operations.intersect = this.objectSetArrayCanonicalizer.canonicalizeIntersect(options.intersect.map((os) => JSON.stringify(
|
|
4756
|
+
operations.intersect = this.objectSetArrayCanonicalizer.canonicalizeIntersect(options.intersect.map((os) => JSON.stringify(chunkKGWUPXAM_cjs.getWireObjectSet(os))));
|
|
4716
4757
|
}
|
|
4717
4758
|
if (options.subtract && options.subtract.length > 0) {
|
|
4718
|
-
operations.subtract = this.objectSetArrayCanonicalizer.canonicalizeSubtract(options.subtract.map((os) => JSON.stringify(
|
|
4759
|
+
operations.subtract = this.objectSetArrayCanonicalizer.canonicalizeSubtract(options.subtract.map((os) => JSON.stringify(chunkKGWUPXAM_cjs.getWireObjectSet(os))));
|
|
4719
4760
|
}
|
|
4720
4761
|
if (options.pivotTo) {
|
|
4721
4762
|
operations.pivotTo = options.pivotTo;
|
|
@@ -4808,7 +4849,7 @@ var RdpCanonicalizer = class extends CachingCanonicalizer {
|
|
|
4808
4849
|
apiName: "__rdp_canonicalizer_holder__"
|
|
4809
4850
|
};
|
|
4810
4851
|
for (const [key, rdpFunction] of Object.entries(rdp)) {
|
|
4811
|
-
const builder =
|
|
4852
|
+
const builder = chunkKGWUPXAM_cjs.createWithPropertiesObjectSet(
|
|
4812
4853
|
objectTypeHolder,
|
|
4813
4854
|
{
|
|
4814
4855
|
type: "methodInput"
|
|
@@ -4861,6 +4902,9 @@ var RidListCanonicalizer = class {
|
|
|
4861
4902
|
var SelectCanonicalizer = class {
|
|
4862
4903
|
cache = /* @__PURE__ */ new Map();
|
|
4863
4904
|
canonicalize(select) {
|
|
4905
|
+
if (select == null) {
|
|
4906
|
+
return void 0;
|
|
4907
|
+
}
|
|
4864
4908
|
const sorted = [...new Set(select)].sort();
|
|
4865
4909
|
const key = sorted.join("\0");
|
|
4866
4910
|
let canonical = this.cache.get(key);
|
|
@@ -4904,7 +4948,7 @@ var Store = class {
|
|
|
4904
4948
|
subjects = this.layers.subjects;
|
|
4905
4949
|
// these are hopefully temporary
|
|
4906
4950
|
constructor(client) {
|
|
4907
|
-
this.logger = client[
|
|
4951
|
+
this.logger = client[chunkKGWUPXAM_cjs.additionalContext].logger?.child({}, {
|
|
4908
4952
|
msgPrefix: "Store"
|
|
4909
4953
|
});
|
|
4910
4954
|
this.client = client;
|
|
@@ -5094,6 +5138,8 @@ var Store = class {
|
|
|
5094
5138
|
if (query) {
|
|
5095
5139
|
return query.rdpConfig;
|
|
5096
5140
|
}
|
|
5141
|
+
} else if (cacheKey.type === "mediaMetadata") {
|
|
5142
|
+
return void 0;
|
|
5097
5143
|
}
|
|
5098
5144
|
}
|
|
5099
5145
|
return void 0;
|
|
@@ -5112,6 +5158,8 @@ var Store = class {
|
|
|
5112
5158
|
return cacheKey.otherKeys[API_NAME_IDX2];
|
|
5113
5159
|
} else if (cacheKey.type === "aggregation") {
|
|
5114
5160
|
return cacheKey.otherKeys[API_NAME_IDX];
|
|
5161
|
+
} else if (cacheKey.type === "mediaMetadata") {
|
|
5162
|
+
return cacheKey.otherKeys[0];
|
|
5115
5163
|
}
|
|
5116
5164
|
}
|
|
5117
5165
|
return void 0;
|
|
@@ -5161,7 +5209,7 @@ var Store = class {
|
|
|
5161
5209
|
}
|
|
5162
5210
|
const promises = [];
|
|
5163
5211
|
for (const cacheKey of this.layers.truth.keys()) {
|
|
5164
|
-
if (changes && changes.modified.has(cacheKey)) {
|
|
5212
|
+
if (cacheKey.type !== "mediaMetadata" && changes && changes.modified.has(cacheKey)) {
|
|
5165
5213
|
continue;
|
|
5166
5214
|
}
|
|
5167
5215
|
const query = this.queries.peek(cacheKey);
|
|
@@ -5198,10 +5246,10 @@ var Store = class {
|
|
|
5198
5246
|
|
|
5199
5247
|
// src/observable/ObservableClient.ts
|
|
5200
5248
|
function createObservableClient(client) {
|
|
5201
|
-
const tweakedClient =
|
|
5202
|
-
...client[
|
|
5203
|
-
fetch: shared_net_fetch.createFetchHeaderMutator(client[
|
|
5204
|
-
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"),
|
|
5249
|
+
const tweakedClient = chunkXYZOCIVH_cjs.createClientFromContext({
|
|
5250
|
+
...client[chunkKGWUPXAM_cjs.additionalContext],
|
|
5251
|
+
fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkKGWUPXAM_cjs.additionalContext].fetch, (headers) => {
|
|
5252
|
+
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkXYZOCIVH_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
|
|
5205
5253
|
return headers;
|
|
5206
5254
|
})
|
|
5207
5255
|
});
|
|
@@ -5244,19 +5292,19 @@ function getOsdkConfig(ontologyRid) {
|
|
|
5244
5292
|
|
|
5245
5293
|
Object.defineProperty(exports, "createClientWithTransaction", {
|
|
5246
5294
|
enumerable: true,
|
|
5247
|
-
get: function () { return
|
|
5295
|
+
get: function () { return chunkXYZOCIVH_cjs.createClientWithTransaction; }
|
|
5248
5296
|
});
|
|
5249
5297
|
Object.defineProperty(exports, "augment", {
|
|
5250
5298
|
enumerable: true,
|
|
5251
|
-
get: function () { return
|
|
5299
|
+
get: function () { return chunkKGWUPXAM_cjs.augment; }
|
|
5252
5300
|
});
|
|
5253
5301
|
Object.defineProperty(exports, "getWireObjectSet", {
|
|
5254
5302
|
enumerable: true,
|
|
5255
|
-
get: function () { return
|
|
5303
|
+
get: function () { return chunkKGWUPXAM_cjs.getWireObjectSet; }
|
|
5256
5304
|
});
|
|
5257
5305
|
Object.defineProperty(exports, "isObjectSet", {
|
|
5258
5306
|
enumerable: true,
|
|
5259
|
-
get: function () { return
|
|
5307
|
+
get: function () { return chunkKGWUPXAM_cjs.isObjectSet; }
|
|
5260
5308
|
});
|
|
5261
5309
|
exports.computeObjectSetCacheKey = computeObjectSetCacheKey;
|
|
5262
5310
|
exports.createObservableClient = createObservableClient;
|