@osdk/client 2.8.0-beta.25 → 2.8.0-beta.27
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 +28 -0
- package/build/browser/actions/applyAction.js +4 -4
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/fetchMetadata.js +1 -1
- package/build/browser/fetchMetadata.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +11 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/internal/conversions/toIntervalQuery.js +56 -0
- package/build/browser/internal/conversions/toIntervalQuery.js.map +1 -0
- package/build/browser/object/SimpleOsdkProperties.js.map +1 -1
- package/build/browser/observable/ObservableClient.js.map +1 -1
- package/build/browser/observable/internal/BulkObjectLoader.js +16 -11
- package/build/browser/observable/internal/BulkObjectLoader.js.map +1 -1
- package/build/browser/observable/internal/GenericCanonicalizer.js +72 -0
- package/build/browser/observable/internal/GenericCanonicalizer.js.map +1 -0
- package/build/browser/observable/internal/IntersectCanonicalizer.js +1 -1
- package/build/browser/observable/internal/IntersectCanonicalizer.js.map +1 -1
- package/build/browser/observable/internal/ObjectSetArrayCanonicalizer.js +34 -0
- package/build/browser/observable/internal/ObjectSetArrayCanonicalizer.js.map +1 -0
- package/build/browser/observable/internal/Store.js +21 -1
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/evaluateFilter.js +1 -0
- package/build/browser/observable/internal/evaluateFilter.js.map +1 -1
- package/build/browser/observable/internal/list/ListCacheKey.js +1 -0
- package/build/browser/observable/internal/list/ListCacheKey.js.map +1 -1
- package/build/browser/observable/internal/list/ListQuery.js +3 -0
- package/build/browser/observable/internal/list/ListQuery.js.map +1 -1
- package/build/browser/observable/internal/list/ListQueryOptions.js.map +1 -1
- package/build/browser/observable/internal/list/ListsHelper.js +3 -2
- package/build/browser/observable/internal/list/ListsHelper.js.map +1 -1
- package/build/browser/observable/internal/object/ObjectQuery.js +6 -3
- package/build/browser/observable/internal/object/ObjectQuery.js.map +1 -1
- package/build/browser/observable/internal/object/ObjectsHelper.js +3 -2
- package/build/browser/observable/internal/object/ObjectsHelper.js.map +1 -1
- package/build/browser/observable/internal/objectset/ObjectSetCacheKey.js.map +1 -1
- package/build/browser/observable/internal/objectset/ObjectSetHelper.js +8 -4
- package/build/browser/observable/internal/objectset/ObjectSetHelper.js.map +1 -1
- package/build/browser/observable/internal/objectset/ObjectSetQuery.js +183 -27
- package/build/browser/observable/internal/objectset/ObjectSetQuery.js.map +1 -1
- package/build/browser/observable/internal/objectset/ObjectSetQueryOptions.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-R7OP6A6S.cjs → chunk-BWOPPEUP.cjs} +82 -34
- package/build/cjs/chunk-BWOPPEUP.cjs.map +1 -0
- package/build/cjs/{chunk-3RY4ECUB.cjs → chunk-ZPGIIKEZ.cjs} +44 -44
- package/build/cjs/chunk-ZPGIIKEZ.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 +371 -114
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +12 -0
- package/build/esm/actions/applyAction.js +4 -4
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/fetchMetadata.js +1 -1
- package/build/esm/fetchMetadata.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +11 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/internal/conversions/toIntervalQuery.js +56 -0
- package/build/esm/internal/conversions/toIntervalQuery.js.map +1 -0
- package/build/esm/object/SimpleOsdkProperties.js.map +1 -1
- package/build/esm/observable/ObservableClient.js.map +1 -1
- package/build/esm/observable/internal/BulkObjectLoader.js +16 -11
- package/build/esm/observable/internal/BulkObjectLoader.js.map +1 -1
- package/build/esm/observable/internal/GenericCanonicalizer.js +72 -0
- package/build/esm/observable/internal/GenericCanonicalizer.js.map +1 -0
- package/build/esm/observable/internal/IntersectCanonicalizer.js +1 -1
- package/build/esm/observable/internal/IntersectCanonicalizer.js.map +1 -1
- package/build/esm/observable/internal/ObjectSetArrayCanonicalizer.js +34 -0
- package/build/esm/observable/internal/ObjectSetArrayCanonicalizer.js.map +1 -0
- package/build/esm/observable/internal/Store.js +21 -1
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/evaluateFilter.js +1 -0
- package/build/esm/observable/internal/evaluateFilter.js.map +1 -1
- package/build/esm/observable/internal/list/ListCacheKey.js +1 -0
- package/build/esm/observable/internal/list/ListCacheKey.js.map +1 -1
- package/build/esm/observable/internal/list/ListQuery.js +3 -0
- package/build/esm/observable/internal/list/ListQuery.js.map +1 -1
- package/build/esm/observable/internal/list/ListQueryOptions.js.map +1 -1
- package/build/esm/observable/internal/list/ListsHelper.js +3 -2
- package/build/esm/observable/internal/list/ListsHelper.js.map +1 -1
- package/build/esm/observable/internal/object/ObjectQuery.js +6 -3
- package/build/esm/observable/internal/object/ObjectQuery.js.map +1 -1
- package/build/esm/observable/internal/object/ObjectsHelper.js +3 -2
- package/build/esm/observable/internal/object/ObjectsHelper.js.map +1 -1
- package/build/esm/observable/internal/objectset/ObjectSetCacheKey.js.map +1 -1
- package/build/esm/observable/internal/objectset/ObjectSetHelper.js +8 -4
- package/build/esm/observable/internal/objectset/ObjectSetHelper.js.map +1 -1
- package/build/esm/observable/internal/objectset/ObjectSetQuery.js +183 -27
- package/build/esm/observable/internal/objectset/ObjectSetQuery.js.map +1 -1
- package/build/esm/observable/internal/objectset/ObjectSetQueryOptions.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/actions/applyAction.d.ts.map +1 -1
- package/build/types/internal/conversions/toIntervalQuery.d.ts +7 -0
- package/build/types/internal/conversions/toIntervalQuery.d.ts.map +1 -0
- package/build/types/observable/ObservableClient.d.ts +7 -0
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/internal/BulkObjectLoader.d.ts +1 -1
- package/build/types/observable/internal/BulkObjectLoader.d.ts.map +1 -1
- package/build/types/observable/internal/GenericCanonicalizer.d.ts +8 -0
- package/build/types/observable/internal/GenericCanonicalizer.d.ts.map +1 -0
- package/build/types/observable/internal/IntersectCanonicalizer.d.ts.map +1 -1
- package/build/types/observable/internal/ObjectSetArrayCanonicalizer.d.ts +7 -0
- package/build/types/observable/internal/ObjectSetArrayCanonicalizer.d.ts.map +1 -0
- package/build/types/observable/internal/Store.d.ts +4 -0
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/observable/internal/list/ListCacheKey.d.ts +2 -1
- package/build/types/observable/internal/list/ListCacheKey.d.ts.map +1 -1
- package/build/types/observable/internal/list/ListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/list/ListQueryOptions.d.ts +1 -0
- package/build/types/observable/internal/list/ListQueryOptions.d.ts.map +1 -1
- package/build/types/observable/internal/list/ListsHelper.d.ts.map +1 -1
- package/build/types/observable/internal/object/ObjectQuery.d.ts +1 -1
- package/build/types/observable/internal/object/ObjectQuery.d.ts.map +1 -1
- package/build/types/observable/internal/object/ObjectsHelper.d.ts.map +1 -1
- package/build/types/observable/internal/objectset/ObjectSetCacheKey.d.ts +1 -0
- package/build/types/observable/internal/objectset/ObjectSetCacheKey.d.ts.map +1 -1
- package/build/types/observable/internal/objectset/ObjectSetHelper.d.ts +3 -1
- package/build/types/observable/internal/objectset/ObjectSetHelper.d.ts.map +1 -1
- package/build/types/observable/internal/objectset/ObjectSetQuery.d.ts +4 -1
- package/build/types/observable/internal/objectset/ObjectSetQuery.d.ts.map +1 -1
- package/build/types/observable/internal/objectset/ObjectSetQueryOptions.d.ts +6 -0
- package/build/types/observable/internal/objectset/ObjectSetQueryOptions.d.ts.map +1 -1
- package/package.json +8 -8
- package/build/cjs/chunk-3RY4ECUB.cjs.map +0 -1
- package/build/cjs/chunk-R7OP6A6S.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkZPGIIKEZ_cjs = require('../chunk-ZPGIIKEZ.cjs');
|
|
4
|
+
var chunkBWOPPEUP_cjs = require('../chunk-BWOPPEUP.cjs');
|
|
5
5
|
require('../chunk-GSVXEVM4.cjs');
|
|
6
6
|
require('../chunk-D26YLHTV.cjs');
|
|
7
7
|
require('../chunk-YJG67XL4.cjs');
|
|
@@ -139,7 +139,7 @@ var WhereClauseCanonicalizer = class {
|
|
|
139
139
|
var whereCanonicalizer = new WhereClauseCanonicalizer();
|
|
140
140
|
var orderByCanonicalizer = new OrderByCanonicalizer();
|
|
141
141
|
function computeObjectSetCacheKey(objectSet, options) {
|
|
142
|
-
const keyParts = ["objectSet",
|
|
142
|
+
const keyParts = ["objectSet", chunkBWOPPEUP_cjs.getWireObjectSet(objectSet)];
|
|
143
143
|
if (!options) {
|
|
144
144
|
return JSON.stringify(keyParts);
|
|
145
145
|
}
|
|
@@ -151,13 +151,13 @@ function computeObjectSetCacheKey(objectSet, options) {
|
|
|
151
151
|
keyParts.push("props", propKeys);
|
|
152
152
|
}
|
|
153
153
|
if (options.union && options.union.length > 0) {
|
|
154
|
-
keyParts.push("union", options.union.map((os) =>
|
|
154
|
+
keyParts.push("union", options.union.map((os) => chunkBWOPPEUP_cjs.getWireObjectSet(os)));
|
|
155
155
|
}
|
|
156
156
|
if (options.intersect && options.intersect.length > 0) {
|
|
157
|
-
keyParts.push("intersect", options.intersect.map((os) =>
|
|
157
|
+
keyParts.push("intersect", options.intersect.map((os) => chunkBWOPPEUP_cjs.getWireObjectSet(os)));
|
|
158
158
|
}
|
|
159
159
|
if (options.subtract && options.subtract.length > 0) {
|
|
160
|
-
keyParts.push("subtract", options.subtract.map((os) =>
|
|
160
|
+
keyParts.push("subtract", options.subtract.map((os) => chunkBWOPPEUP_cjs.getWireObjectSet(os)));
|
|
161
161
|
}
|
|
162
162
|
if (options.pivotTo) {
|
|
163
163
|
keyParts.push("pivotTo", options.pivotTo);
|
|
@@ -221,8 +221,8 @@ var ObservableClientImpl = class {
|
|
|
221
221
|
const instances = [];
|
|
222
222
|
const objectSetWires = [];
|
|
223
223
|
for (const item of options.dependsOnObjects ?? []) {
|
|
224
|
-
if (
|
|
225
|
-
objectSetWires.push(
|
|
224
|
+
if (chunkBWOPPEUP_cjs.isObjectSet(item)) {
|
|
225
|
+
objectSetWires.push(chunkBWOPPEUP_cjs.getWireObjectSet(item));
|
|
226
226
|
} else {
|
|
227
227
|
instances.push({
|
|
228
228
|
$apiName: item.$objectType ?? item.$apiName,
|
|
@@ -230,7 +230,7 @@ var ObservableClientImpl = class {
|
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
const objectSetTypesPromise = objectSetWires.length > 0 ? Promise.all(objectSetWires.map((wire) =>
|
|
233
|
+
const objectSetTypesPromise = objectSetWires.length > 0 ? Promise.all(objectSetWires.map((wire) => chunkBWOPPEUP_cjs.extractObjectOrInterfaceType(this.__experimentalStore.client[chunkBWOPPEUP_cjs.additionalContext], wire))).then((types) => types.filter((t) => t != null).map((t) => t.apiName)) : void 0;
|
|
234
234
|
return this.__experimentalStore.functions.observe({
|
|
235
235
|
...options,
|
|
236
236
|
queryDef,
|
|
@@ -459,7 +459,7 @@ var OptimisticJob = class {
|
|
|
459
459
|
return this;
|
|
460
460
|
},
|
|
461
461
|
createObject(type, pk, properties) {
|
|
462
|
-
const create = store.client[
|
|
462
|
+
const create = store.client[chunkBWOPPEUP_cjs.additionalContext].objectFactory2(store.client[chunkBWOPPEUP_cjs.additionalContext], [{
|
|
463
463
|
$primaryKey: pk,
|
|
464
464
|
$apiName: type.apiName,
|
|
465
465
|
$objectType: type.apiName,
|
|
@@ -917,7 +917,7 @@ var Query = class {
|
|
|
917
917
|
this.store = store;
|
|
918
918
|
this.cacheKeys = store.cacheKeys;
|
|
919
919
|
this.#subject = observable;
|
|
920
|
-
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[
|
|
920
|
+
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkBWOPPEUP_cjs.additionalContext].logger : store.client[chunkBWOPPEUP_cjs.additionalContext].logger?.child({}, {
|
|
921
921
|
msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
|
|
922
922
|
}));
|
|
923
923
|
}
|
|
@@ -1079,7 +1079,7 @@ var AggregationQuery = class extends Query {
|
|
|
1079
1079
|
#invalidationTypes;
|
|
1080
1080
|
#invalidationTypesPromise;
|
|
1081
1081
|
constructor(store, subject, cacheKey, opts) {
|
|
1082
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1082
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkBWOPPEUP_cjs.additionalContext].logger?.child({}, {
|
|
1083
1083
|
msgPrefix: `AggregationQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1084
1084
|
}) : void 0);
|
|
1085
1085
|
this.apiName = cacheKey.otherKeys[API_NAME_IDX];
|
|
@@ -1097,7 +1097,7 @@ var AggregationQuery = class extends Query {
|
|
|
1097
1097
|
try {
|
|
1098
1098
|
const {
|
|
1099
1099
|
invalidationSet
|
|
1100
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
1100
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkBWOPPEUP_cjs.additionalContext], wireObjectSet);
|
|
1101
1101
|
return /* @__PURE__ */ new Set([this.apiName, ...invalidationSet]);
|
|
1102
1102
|
} catch (error) {
|
|
1103
1103
|
this.store.logger?.error("Failed to compute invalidation types for aggregation, falling back to base type only", error);
|
|
@@ -1168,7 +1168,7 @@ var ObjectAggregationQuery = class extends AggregationQuery {
|
|
|
1168
1168
|
};
|
|
1169
1169
|
let objectSet;
|
|
1170
1170
|
if (this.parsedWireObjectSet) {
|
|
1171
|
-
objectSet =
|
|
1171
|
+
objectSet = chunkBWOPPEUP_cjs.createObjectSet(objectTypeDef, this.store.client[chunkBWOPPEUP_cjs.additionalContext], this.parsedWireObjectSet);
|
|
1172
1172
|
} else {
|
|
1173
1173
|
objectSet = this.store.client(objectTypeDef);
|
|
1174
1174
|
}
|
|
@@ -1210,7 +1210,7 @@ var AggregationsHelper = class extends AbstractHelper {
|
|
|
1210
1210
|
return this.getOrCreateQuery(options, void 0);
|
|
1211
1211
|
}
|
|
1212
1212
|
getQueryWithObjectSet(options) {
|
|
1213
|
-
const serializedObjectSet = JSON.stringify(
|
|
1213
|
+
const serializedObjectSet = JSON.stringify(chunkBWOPPEUP_cjs.getWireObjectSet(options.objectSet));
|
|
1214
1214
|
return this.getOrCreateQuery(options, serializedObjectSet);
|
|
1215
1215
|
}
|
|
1216
1216
|
getOrCreateQuery(options, serializedObjectSet) {
|
|
@@ -1533,7 +1533,7 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1533
1533
|
path.push("$:map_end");
|
|
1534
1534
|
return arr;
|
|
1535
1535
|
}
|
|
1536
|
-
if (
|
|
1536
|
+
if (chunkZPGIIKEZ_cjs.isObjectSpecifiersObject(value)) {
|
|
1537
1537
|
const objectType = value.$objectType ?? value.$apiName;
|
|
1538
1538
|
path.push("$:osdk", objectType, value.$primaryKey);
|
|
1539
1539
|
return {
|
|
@@ -1541,8 +1541,8 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1541
1541
|
$primaryKey: value.$primaryKey
|
|
1542
1542
|
};
|
|
1543
1543
|
}
|
|
1544
|
-
if (
|
|
1545
|
-
const wire =
|
|
1544
|
+
if (chunkBWOPPEUP_cjs.isObjectSet(value)) {
|
|
1545
|
+
const wire = chunkBWOPPEUP_cjs.getWireObjectSet(value);
|
|
1546
1546
|
path.push("$:objectset", wire);
|
|
1547
1547
|
return wire;
|
|
1548
1548
|
}
|
|
@@ -1602,7 +1602,7 @@ var FunctionQuery = class extends Query {
|
|
|
1602
1602
|
#dependsOnObjects;
|
|
1603
1603
|
#queryDef;
|
|
1604
1604
|
constructor(store, subject, queryDef, params, cacheKey, opts, objectSetTypesPromise) {
|
|
1605
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1605
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkBWOPPEUP_cjs.additionalContext].logger?.child({}, {
|
|
1606
1606
|
msgPrefix: `FunctionQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1607
1607
|
}) : void 0);
|
|
1608
1608
|
this.#apiName = queryDef.apiName;
|
|
@@ -1659,7 +1659,7 @@ var FunctionQuery = class extends Query {
|
|
|
1659
1659
|
}).debug("calling _fetchAndStore");
|
|
1660
1660
|
}
|
|
1661
1661
|
try {
|
|
1662
|
-
const result = await
|
|
1662
|
+
const result = await chunkZPGIIKEZ_cjs.applyQuery(this.store.client[chunkBWOPPEUP_cjs.additionalContext], this.#queryDef, this.#params);
|
|
1663
1663
|
const executedAt = Date.now();
|
|
1664
1664
|
this.store.batch({}, (batch) => {
|
|
1665
1665
|
this.writeToStore({
|
|
@@ -1824,6 +1824,56 @@ var CachingCanonicalizer = class {
|
|
|
1824
1824
|
}
|
|
1825
1825
|
};
|
|
1826
1826
|
|
|
1827
|
+
// src/observable/internal/GenericCanonicalizer.ts
|
|
1828
|
+
var MAX_FINGERPRINT_DEPTH = 5;
|
|
1829
|
+
var GenericCanonicalizer = class extends CachingCanonicalizer {
|
|
1830
|
+
#trie = new trie.Trie();
|
|
1831
|
+
#existingValues = /* @__PURE__ */ new Map();
|
|
1832
|
+
canonicalize(input) {
|
|
1833
|
+
return super.canonicalize(input);
|
|
1834
|
+
}
|
|
1835
|
+
lookupOrCreate(input) {
|
|
1836
|
+
const structuralKey = this.#collectSortedKeys(input);
|
|
1837
|
+
const cacheKey = this.#trie.lookupArray(structuralKey);
|
|
1838
|
+
const entry = this.#existingValues.get(cacheKey) ?? {
|
|
1839
|
+
values: []
|
|
1840
|
+
};
|
|
1841
|
+
this.#existingValues.set(cacheKey, entry);
|
|
1842
|
+
for (let i = entry.values.length - 1; i >= 0; i--) {
|
|
1843
|
+
const existing = entry.values[i].deref();
|
|
1844
|
+
if (!existing) {
|
|
1845
|
+
entry.values.splice(i, 1);
|
|
1846
|
+
continue;
|
|
1847
|
+
}
|
|
1848
|
+
if (deepEqual__default.default(existing, input)) {
|
|
1849
|
+
return existing;
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
const canonical = input;
|
|
1853
|
+
entry.values.push(new WeakRef(canonical));
|
|
1854
|
+
return canonical;
|
|
1855
|
+
}
|
|
1856
|
+
#collectSortedKeys(obj, depth = 0) {
|
|
1857
|
+
if (depth > MAX_FINGERPRINT_DEPTH || !obj || typeof obj !== "object") {
|
|
1858
|
+
return [];
|
|
1859
|
+
}
|
|
1860
|
+
if (Array.isArray(obj)) {
|
|
1861
|
+
const result2 = ["[]", String(obj.length)];
|
|
1862
|
+
for (const item of obj) {
|
|
1863
|
+
result2.push(...this.#collectSortedKeys(item, depth + 1));
|
|
1864
|
+
}
|
|
1865
|
+
return result2;
|
|
1866
|
+
}
|
|
1867
|
+
const record = obj;
|
|
1868
|
+
const result = [];
|
|
1869
|
+
for (const key of Object.keys(record).sort()) {
|
|
1870
|
+
result.push(key);
|
|
1871
|
+
result.push(...this.#collectSortedKeys(record[key], depth + 1));
|
|
1872
|
+
}
|
|
1873
|
+
return result;
|
|
1874
|
+
}
|
|
1875
|
+
};
|
|
1876
|
+
|
|
1827
1877
|
// src/observable/internal/IntersectCanonicalizer.ts
|
|
1828
1878
|
var IntersectCanonicalizer = class extends CachingCanonicalizer {
|
|
1829
1879
|
structuralCache = /* @__PURE__ */ new Map();
|
|
@@ -1833,7 +1883,7 @@ var IntersectCanonicalizer = class extends CachingCanonicalizer {
|
|
|
1833
1883
|
}
|
|
1834
1884
|
lookupOrCreate(intersectWith) {
|
|
1835
1885
|
const canonicalClauses = intersectWith.map((item) => this.whereCanonicalizer.canonicalize(item.where ?? {}));
|
|
1836
|
-
const structuralKey = canonicalClauses.map((clause) => JSON.stringify(clause)).join("||");
|
|
1886
|
+
const structuralKey = canonicalClauses.map((clause) => JSON.stringify(clause)).sort().join("||");
|
|
1837
1887
|
let canonical = this.structuralCache.get(structuralKey);
|
|
1838
1888
|
if (!canonical) {
|
|
1839
1889
|
canonical = canonicalClauses;
|
|
@@ -2823,7 +2873,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2823
2873
|
batch.changes.modified.add(this.cacheKey);
|
|
2824
2874
|
}
|
|
2825
2875
|
constructor(store, subject, cacheKey, opts) {
|
|
2826
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
2876
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkBWOPPEUP_cjs.additionalContext].logger?.child({}, {
|
|
2827
2877
|
msgPrefix: `SpecificLinkQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
2828
2878
|
}) : void 0);
|
|
2829
2879
|
[this.#sourceApiName, this.#sourceTypeKind, this.#sourceUnderlyingObjectType, this.#sourcePk, this.#linkName, this.#whereClause, this.#orderBy] = cacheKey.otherKeys;
|
|
@@ -2837,7 +2887,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2837
2887
|
*/
|
|
2838
2888
|
async fetchPageData(signal) {
|
|
2839
2889
|
const client = this.store.client;
|
|
2840
|
-
const ontologyProvider = client[
|
|
2890
|
+
const ontologyProvider = client[chunkBWOPPEUP_cjs.additionalContext].ontologyProvider;
|
|
2841
2891
|
const isInterface = this.#sourceTypeKind === "interface";
|
|
2842
2892
|
if (this.#orderBy && Object.keys(this.#orderBy).length > 0) {
|
|
2843
2893
|
let targetTypeApiName;
|
|
@@ -2948,7 +2998,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2948
2998
|
}
|
|
2949
2999
|
return (async () => {
|
|
2950
3000
|
try {
|
|
2951
|
-
const ontologyProvider = this.store.client[
|
|
3001
|
+
const ontologyProvider = this.store.client[chunkBWOPPEUP_cjs.additionalContext].ontologyProvider;
|
|
2952
3002
|
if (this.#sourceTypeKind === "interface") {
|
|
2953
3003
|
const objectMetadata = await ontologyProvider.getObjectDefinition(objectType);
|
|
2954
3004
|
if (this.#sourceApiName in objectMetadata.interfaceMap) {
|
|
@@ -3038,6 +3088,7 @@ function evaluateFilter(f, realValue, expected, strict) {
|
|
|
3038
3088
|
case "$containsAllTerms":
|
|
3039
3089
|
case "$containsAllTermsInOrder":
|
|
3040
3090
|
case "$containsAnyTerm":
|
|
3091
|
+
case "$interval":
|
|
3041
3092
|
case "$intersects":
|
|
3042
3093
|
case "$within":
|
|
3043
3094
|
return !strict;
|
|
@@ -3123,7 +3174,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3123
3174
|
batch.changes.registerList(this.cacheKey);
|
|
3124
3175
|
}
|
|
3125
3176
|
constructor(store, subject, apiName, cacheKey, opts) {
|
|
3126
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
3177
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkBWOPPEUP_cjs.additionalContext].logger?.child({}, {
|
|
3127
3178
|
msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
3128
3179
|
}) : void 0);
|
|
3129
3180
|
this.apiName = apiName;
|
|
@@ -3166,10 +3217,10 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3166
3217
|
async fetchPageData(signal) {
|
|
3167
3218
|
const needsResultType = Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy) || this.#pivotInfo != null && this.#intersectWith != null && this.#intersectWith.length > 0 && !this.#pivotIntersectApplied;
|
|
3168
3219
|
if (needsResultType) {
|
|
3169
|
-
const wireObjectSet =
|
|
3220
|
+
const wireObjectSet = chunkBWOPPEUP_cjs.getWireObjectSet(this.#objectSet);
|
|
3170
3221
|
const {
|
|
3171
3222
|
resultType
|
|
3172
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
3223
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkBWOPPEUP_cjs.additionalContext], wireObjectSet);
|
|
3173
3224
|
if (Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
3174
3225
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#orderBy);
|
|
3175
3226
|
}
|
|
@@ -3206,6 +3257,9 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3206
3257
|
// but shouldn't be needed ideally
|
|
3207
3258
|
...Object.keys(this.#orderBy).length > 0 ? {
|
|
3208
3259
|
$orderBy: this.#orderBy
|
|
3260
|
+
} : {},
|
|
3261
|
+
...this.options.$loadPropertySecurityMetadata ? {
|
|
3262
|
+
$loadPropertySecurityMetadata: true
|
|
3209
3263
|
} : {}
|
|
3210
3264
|
});
|
|
3211
3265
|
if (signal?.aborted) {
|
|
@@ -3441,7 +3495,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3441
3495
|
type,
|
|
3442
3496
|
apiName: this.apiName
|
|
3443
3497
|
};
|
|
3444
|
-
const clientCtx = store.client[
|
|
3498
|
+
const clientCtx = store.client[chunkBWOPPEUP_cjs.additionalContext];
|
|
3445
3499
|
let objectSet;
|
|
3446
3500
|
if (rids != null) {
|
|
3447
3501
|
objectSet = clientCtx.objectSetFactory(objectTypeDef, clientCtx, {
|
|
@@ -3484,7 +3538,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3484
3538
|
}
|
|
3485
3539
|
extractRelevantObjects(changes) {
|
|
3486
3540
|
const matchesApiName = ([, object]) => {
|
|
3487
|
-
return this.apiName in object[
|
|
3541
|
+
return this.apiName in object[chunkZPGIIKEZ_cjs.ObjectDefRef].interfaceMap;
|
|
3488
3542
|
};
|
|
3489
3543
|
const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
3490
3544
|
const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
@@ -3503,7 +3557,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3503
3557
|
}
|
|
3504
3558
|
};
|
|
3505
3559
|
function createSourceSetForPivot(store, pivotInfo, rids) {
|
|
3506
|
-
const clientCtx = store.client[
|
|
3560
|
+
const clientCtx = store.client[chunkBWOPPEUP_cjs.additionalContext];
|
|
3507
3561
|
if (rids != null) {
|
|
3508
3562
|
return clientCtx.objectSetFactory({
|
|
3509
3563
|
type: "object",
|
|
@@ -3558,7 +3612,7 @@ var ObjectListQuery = class extends ListQuery {
|
|
|
3558
3612
|
const intersectWith = this.cacheKey.otherKeys[INTERSECT_IDX2];
|
|
3559
3613
|
const pivotInfo = this.cacheKey.otherKeys[PIVOT_IDX];
|
|
3560
3614
|
const rids = this.cacheKey.otherKeys[RIDS_IDX];
|
|
3561
|
-
const clientCtx = store.client[
|
|
3615
|
+
const clientCtx = store.client[chunkBWOPPEUP_cjs.additionalContext];
|
|
3562
3616
|
const typeDefinition = {
|
|
3563
3617
|
type: "object",
|
|
3564
3618
|
apiName: this.apiName
|
|
@@ -3671,7 +3725,8 @@ var ListsHelper = class extends AbstractHelper {
|
|
|
3671
3725
|
intersectWith,
|
|
3672
3726
|
pivotTo,
|
|
3673
3727
|
rids,
|
|
3674
|
-
select
|
|
3728
|
+
select,
|
|
3729
|
+
$loadPropertySecurityMetadata
|
|
3675
3730
|
} = options;
|
|
3676
3731
|
const {
|
|
3677
3732
|
apiName,
|
|
@@ -3684,7 +3739,7 @@ var ListsHelper = class extends AbstractHelper {
|
|
|
3684
3739
|
const canonPivot = pivotTo ? this.pivotCanonicalizer.canonicalize(apiName, type, pivotTo) : void 0;
|
|
3685
3740
|
const canonRids = rids != null ? this.ridListCanonicalizer.canonicalize(rids) : void 0;
|
|
3686
3741
|
const canonSelect = select && select.length > 0 ? this.selectCanonicalizer.canonicalize(select) : void 0;
|
|
3687
|
-
const listCacheKey = this.cacheKeys.get("list", type, apiName, canonWhere, canonOrderBy, canonRdp, canonIntersect, canonPivot, canonRids, canonSelect);
|
|
3742
|
+
const listCacheKey = this.cacheKeys.get("list", type, apiName, canonWhere, canonOrderBy, canonRdp, canonIntersect, canonPivot, canonRids, canonSelect, $loadPropertySecurityMetadata ? true : void 0);
|
|
3688
3743
|
return this.store.queries.get(listCacheKey, () => {
|
|
3689
3744
|
const QueryClass = type === "object" ? ObjectListQuery : InterfaceListQuery;
|
|
3690
3745
|
return new QueryClass(this.store, this.store.subjects.get(listCacheKey), apiName, listCacheKey, options);
|
|
@@ -3703,8 +3758,8 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3703
3758
|
if (rdpFields.size === 0) {
|
|
3704
3759
|
return value;
|
|
3705
3760
|
}
|
|
3706
|
-
const underlying = value[
|
|
3707
|
-
const objectDef = value[
|
|
3761
|
+
const underlying = value[chunkZPGIIKEZ_cjs.UnderlyingOsdkObject];
|
|
3762
|
+
const objectDef = value[chunkZPGIIKEZ_cjs.ObjectDefRef];
|
|
3708
3763
|
const newProps = {
|
|
3709
3764
|
$apiName: underlying.$apiName,
|
|
3710
3765
|
$objectType: underlying.$objectType,
|
|
@@ -3717,7 +3772,7 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3717
3772
|
newProps[key] = underlying[key];
|
|
3718
3773
|
}
|
|
3719
3774
|
}
|
|
3720
|
-
return
|
|
3775
|
+
return chunkZPGIIKEZ_cjs.createOsdkObject(value[chunkZPGIIKEZ_cjs.ClientRef], objectDef, newProps);
|
|
3721
3776
|
}
|
|
3722
3777
|
function isSuperset(superset, subset) {
|
|
3723
3778
|
for (const field of subset) {
|
|
@@ -3728,8 +3783,8 @@ function isSuperset(superset, subset) {
|
|
|
3728
3783
|
return true;
|
|
3729
3784
|
}
|
|
3730
3785
|
function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
3731
|
-
const underlying = value[
|
|
3732
|
-
const objectDef = value[
|
|
3786
|
+
const underlying = value[chunkZPGIIKEZ_cjs.UnderlyingOsdkObject];
|
|
3787
|
+
const objectDef = value[chunkZPGIIKEZ_cjs.ObjectDefRef];
|
|
3733
3788
|
const newProps = {
|
|
3734
3789
|
$apiName: underlying.$apiName,
|
|
3735
3790
|
$objectType: underlying.$objectType,
|
|
@@ -3745,12 +3800,12 @@ function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
|
3745
3800
|
}
|
|
3746
3801
|
}
|
|
3747
3802
|
}
|
|
3748
|
-
return
|
|
3803
|
+
return chunkZPGIIKEZ_cjs.createOsdkObject(value[chunkZPGIIKEZ_cjs.ClientRef], objectDef, newProps);
|
|
3749
3804
|
}
|
|
3750
3805
|
function mergeSelectFields(sourceValue, selectFields, existingValue) {
|
|
3751
|
-
const sourceUnderlying = sourceValue[
|
|
3752
|
-
const existingUnderlying = existingValue[
|
|
3753
|
-
const objectDef = sourceValue[
|
|
3806
|
+
const sourceUnderlying = sourceValue[chunkZPGIIKEZ_cjs.UnderlyingOsdkObject];
|
|
3807
|
+
const existingUnderlying = existingValue[chunkZPGIIKEZ_cjs.UnderlyingOsdkObject];
|
|
3808
|
+
const objectDef = sourceValue[chunkZPGIIKEZ_cjs.ObjectDefRef];
|
|
3754
3809
|
const newProps = {
|
|
3755
3810
|
$apiName: sourceUnderlying.$apiName,
|
|
3756
3811
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3768,7 +3823,7 @@ function mergeSelectFields(sourceValue, selectFields, existingValue) {
|
|
|
3768
3823
|
newProps[key] = sourceUnderlying[key];
|
|
3769
3824
|
}
|
|
3770
3825
|
}
|
|
3771
|
-
return
|
|
3826
|
+
return chunkZPGIIKEZ_cjs.createOsdkObject(sourceValue[chunkZPGIIKEZ_cjs.ClientRef], objectDef, newProps);
|
|
3772
3827
|
}
|
|
3773
3828
|
function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, targetCurrentValue) {
|
|
3774
3829
|
if (targetRdpFields.size === 0) {
|
|
@@ -3780,8 +3835,8 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3780
3835
|
}
|
|
3781
3836
|
return filterToRdpFields(sourceValue, targetRdpFields, sourceRdpFields);
|
|
3782
3837
|
}
|
|
3783
|
-
const sourceUnderlying = sourceValue[
|
|
3784
|
-
const objectDef = sourceValue[
|
|
3838
|
+
const sourceUnderlying = sourceValue[chunkZPGIIKEZ_cjs.UnderlyingOsdkObject];
|
|
3839
|
+
const objectDef = sourceValue[chunkZPGIIKEZ_cjs.ObjectDefRef];
|
|
3785
3840
|
const newProps = {
|
|
3786
3841
|
$apiName: sourceUnderlying.$apiName,
|
|
3787
3842
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3795,7 +3850,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3795
3850
|
}
|
|
3796
3851
|
}
|
|
3797
3852
|
if (targetCurrentValue) {
|
|
3798
|
-
const targetUnderlying = targetCurrentValue[
|
|
3853
|
+
const targetUnderlying = targetCurrentValue[chunkZPGIIKEZ_cjs.UnderlyingOsdkObject];
|
|
3799
3854
|
for (const field of targetRdpFields) {
|
|
3800
3855
|
if (field in targetUnderlying) {
|
|
3801
3856
|
if (!sourceRdpFields.has(field) || newProps[field] === void 0) {
|
|
@@ -3804,7 +3859,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3804
3859
|
}
|
|
3805
3860
|
}
|
|
3806
3861
|
}
|
|
3807
|
-
return
|
|
3862
|
+
return chunkZPGIIKEZ_cjs.createOsdkObject(sourceValue[chunkZPGIIKEZ_cjs.ClientRef], objectDef, newProps);
|
|
3808
3863
|
}
|
|
3809
3864
|
|
|
3810
3865
|
// src/observable/internal/object/ObjectCacheKeyRegistry.ts
|
|
@@ -3959,13 +4014,14 @@ var BulkObjectLoader = class {
|
|
|
3959
4014
|
#maxEntries;
|
|
3960
4015
|
constructor(client, maxWait = 25, maxEntries = 100) {
|
|
3961
4016
|
this.#client = client;
|
|
3962
|
-
this.#logger = client[
|
|
4017
|
+
this.#logger = client[chunkBWOPPEUP_cjs.additionalContext].logger;
|
|
3963
4018
|
this.#maxWait = maxWait;
|
|
3964
4019
|
this.#maxEntries = maxEntries;
|
|
3965
4020
|
}
|
|
3966
|
-
async fetch(apiName, primaryKey, defType = "object", select) {
|
|
4021
|
+
async fetch(apiName, primaryKey, defType = "object", select, loadPropertySecurityMetadata) {
|
|
3967
4022
|
const deferred = pDefer();
|
|
3968
|
-
const
|
|
4023
|
+
const securitySuffix = loadPropertySecurityMetadata ? "\0sec" : "";
|
|
4024
|
+
const selectKey = select && select.length > 0 ? `${apiName}\0${[...select].sort().join(",")}${securitySuffix}` : `${apiName}${securitySuffix}`;
|
|
3969
4025
|
const entry = this.#m.get(selectKey);
|
|
3970
4026
|
entry.data.push({
|
|
3971
4027
|
primaryKey,
|
|
@@ -3974,25 +4030,27 @@ var BulkObjectLoader = class {
|
|
|
3974
4030
|
if (entry.defType === void 0) {
|
|
3975
4031
|
entry.defType = defType;
|
|
3976
4032
|
entry.select = select;
|
|
4033
|
+
entry.loadPropertySecurityMetadata = loadPropertySecurityMetadata;
|
|
3977
4034
|
} else if (entry.defType !== defType) {
|
|
3978
4035
|
deferred.reject(new shared_net_errors.PalantirApiError(`Conflicting defType for ${apiName}: existing=${entry.defType}, new=${defType}`));
|
|
3979
4036
|
return deferred.promise;
|
|
3980
4037
|
}
|
|
3981
4038
|
if (!entry.timer) {
|
|
3982
4039
|
entry.timer = setTimeout(() => {
|
|
3983
|
-
this.#loadObjects(apiName, entry.data, entry.defType ?? "object", entry.select);
|
|
4040
|
+
this.#loadObjects(apiName, entry.data, entry.defType ?? "object", entry.select, entry.loadPropertySecurityMetadata);
|
|
3984
4041
|
}, this.#maxWait);
|
|
3985
4042
|
}
|
|
3986
4043
|
if (entry.data.length >= this.#maxEntries) {
|
|
3987
4044
|
clearTimeout(entry.timer);
|
|
3988
|
-
this.#loadObjects(apiName, entry.data, entry.defType ?? "object", entry.select);
|
|
4045
|
+
this.#loadObjects(apiName, entry.data, entry.defType ?? "object", entry.select, entry.loadPropertySecurityMetadata);
|
|
3989
4046
|
}
|
|
3990
4047
|
return await deferred.promise;
|
|
3991
4048
|
}
|
|
3992
|
-
#loadObjects(apiName, arr, defType, select) {
|
|
3993
|
-
const
|
|
4049
|
+
#loadObjects(apiName, arr, defType, select, loadPropertySecurityMetadata) {
|
|
4050
|
+
const securitySuffix = loadPropertySecurityMetadata ? "\0sec" : "";
|
|
4051
|
+
const selectKey = select && select.length > 0 ? `${apiName}\0${[...select].sort().join(",")}${securitySuffix}` : `${apiName}${securitySuffix}`;
|
|
3994
4052
|
this.#m.delete(selectKey);
|
|
3995
|
-
const loadFn = defType === "interface" ? this.#loadInterfaceObjects(apiName, arr, select) : this.#loadObjectTypeObjects(apiName, arr, select);
|
|
4053
|
+
const loadFn = defType === "interface" ? this.#loadInterfaceObjects(apiName, arr, select, loadPropertySecurityMetadata) : this.#loadObjectTypeObjects(apiName, arr, select, loadPropertySecurityMetadata);
|
|
3996
4054
|
loadFn.catch((e) => {
|
|
3997
4055
|
this.#logger?.error("Unhandled exception", e);
|
|
3998
4056
|
for (const {
|
|
@@ -4004,7 +4062,7 @@ var BulkObjectLoader = class {
|
|
|
4004
4062
|
}
|
|
4005
4063
|
});
|
|
4006
4064
|
}
|
|
4007
|
-
async #loadObjectTypeObjects(apiName, arr, select) {
|
|
4065
|
+
async #loadObjectTypeObjects(apiName, arr, select, loadPropertySecurityMetadata) {
|
|
4008
4066
|
const objectDef = {
|
|
4009
4067
|
type: "object",
|
|
4010
4068
|
apiName
|
|
@@ -4027,7 +4085,8 @@ var BulkObjectLoader = class {
|
|
|
4027
4085
|
$includeRid: true,
|
|
4028
4086
|
...select && select.length > 0 ? {
|
|
4029
4087
|
$select: select
|
|
4030
|
-
} : {}
|
|
4088
|
+
} : {},
|
|
4089
|
+
$loadPropertySecurityMetadata: loadPropertySecurityMetadata ?? false
|
|
4031
4090
|
});
|
|
4032
4091
|
for (const {
|
|
4033
4092
|
primaryKey,
|
|
@@ -4041,7 +4100,7 @@ var BulkObjectLoader = class {
|
|
|
4041
4100
|
}
|
|
4042
4101
|
}
|
|
4043
4102
|
}
|
|
4044
|
-
async #loadInterfaceObjects(apiName, arr, select) {
|
|
4103
|
+
async #loadInterfaceObjects(apiName, arr, select, loadPropertySecurityMetadata) {
|
|
4045
4104
|
const pks = arr.map((x) => x.primaryKey);
|
|
4046
4105
|
const interfaceDef = {
|
|
4047
4106
|
type: "interface",
|
|
@@ -4075,7 +4134,8 @@ var BulkObjectLoader = class {
|
|
|
4075
4134
|
$pageSize: remainingPks.length,
|
|
4076
4135
|
...select && select.length > 0 ? {
|
|
4077
4136
|
$select: select
|
|
4078
|
-
} : {}
|
|
4137
|
+
} : {},
|
|
4138
|
+
$loadPropertySecurityMetadata: loadPropertySecurityMetadata ?? false
|
|
4079
4139
|
});
|
|
4080
4140
|
for (const obj of data) {
|
|
4081
4141
|
foundObjects.set(obj.$primaryKey, obj);
|
|
@@ -4101,15 +4161,17 @@ var ObjectQuery = class extends Query {
|
|
|
4101
4161
|
#pk;
|
|
4102
4162
|
#defType;
|
|
4103
4163
|
#select;
|
|
4164
|
+
#loadPropertySecurityMetadata;
|
|
4104
4165
|
#implementingTypes;
|
|
4105
|
-
constructor(store, subject, type, pk, cacheKey, opts, defType = "object", select) {
|
|
4106
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
4166
|
+
constructor(store, subject, type, pk, cacheKey, opts, defType = "object", select, loadPropertySecurityMetadata) {
|
|
4167
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkBWOPPEUP_cjs.additionalContext].logger?.child({}, {
|
|
4107
4168
|
msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
4108
4169
|
}) : void 0);
|
|
4109
4170
|
this.#apiName = type;
|
|
4110
4171
|
this.#pk = pk;
|
|
4111
4172
|
this.#defType = defType;
|
|
4112
4173
|
this.#select = select;
|
|
4174
|
+
this.#loadPropertySecurityMetadata = loadPropertySecurityMetadata ?? false;
|
|
4113
4175
|
}
|
|
4114
4176
|
_createConnectable(subject) {
|
|
4115
4177
|
return rxjs.connectable(subject.pipe(rxjs.map((x) => {
|
|
@@ -4145,11 +4207,12 @@ var ObjectQuery = class extends Query {
|
|
|
4145
4207
|
$includeRid: true,
|
|
4146
4208
|
...this.#select && this.#select.length > 0 ? {
|
|
4147
4209
|
$select: this.#select
|
|
4148
|
-
} : {}
|
|
4210
|
+
} : {},
|
|
4211
|
+
$loadPropertySecurityMetadata: this.#loadPropertySecurityMetadata
|
|
4149
4212
|
});
|
|
4150
4213
|
obj = fetched;
|
|
4151
4214
|
} else {
|
|
4152
|
-
obj = await getBulkObjectLoader(this.store.client).fetch(this.#apiName, this.#pk, this.#defType, this.#select);
|
|
4215
|
+
obj = await getBulkObjectLoader(this.store.client).fetch(this.#apiName, this.#pk, this.#defType, this.#select, this.#loadPropertySecurityMetadata);
|
|
4153
4216
|
}
|
|
4154
4217
|
this.store.batch({}, (batch) => {
|
|
4155
4218
|
this.writeToStore(obj, "loaded", batch, this.#select ? new Set(this.#select) : void 0);
|
|
@@ -4200,13 +4263,14 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4200
4263
|
const apiName = typeof options.apiName === "string" ? options.apiName : options.apiName.apiName;
|
|
4201
4264
|
const {
|
|
4202
4265
|
pk,
|
|
4203
|
-
select
|
|
4266
|
+
select,
|
|
4267
|
+
$loadPropertySecurityMetadata
|
|
4204
4268
|
} = options;
|
|
4205
|
-
const defType =
|
|
4269
|
+
const defType = chunkZPGIIKEZ_cjs.getDefType(options.apiName);
|
|
4206
4270
|
const objectCacheKey = this.cacheKeys.get("object", apiName, pk, rdpConfig ?? void 0);
|
|
4207
4271
|
return this.store.queries.get(objectCacheKey, () => new ObjectQuery(this.store, this.store.subjects.get(objectCacheKey), apiName, pk, objectCacheKey, {
|
|
4208
4272
|
dedupeInterval: 0
|
|
4209
|
-
}, defType, select));
|
|
4273
|
+
}, defType, select, $loadPropertySecurityMetadata));
|
|
4210
4274
|
}
|
|
4211
4275
|
/**
|
|
4212
4276
|
* Internal helper method for writing objects to the store and returning their
|
|
@@ -4240,7 +4304,7 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4240
4304
|
if (valueToWrite !== tombstone && existing?.value && this.isObjectHolder(existing.value)) {
|
|
4241
4305
|
const expectedRdpFields = this.store.objectCacheKeyRegistry.getRdpFieldSet(sourceCacheKey);
|
|
4242
4306
|
if (expectedRdpFields.size > 0) {
|
|
4243
|
-
const underlying = valueToWrite[
|
|
4307
|
+
const underlying = valueToWrite[chunkZPGIIKEZ_cjs.UnderlyingOsdkObject];
|
|
4244
4308
|
const actualRdpFields = /* @__PURE__ */ new Set();
|
|
4245
4309
|
for (const field of expectedRdpFields) {
|
|
4246
4310
|
if (underlying && field in underlying) {
|
|
@@ -4302,19 +4366,24 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4302
4366
|
};
|
|
4303
4367
|
|
|
4304
4368
|
// src/observable/internal/objectset/ObjectSetQuery.ts
|
|
4305
|
-
var ObjectSetQuery = class extends BaseListQuery {
|
|
4369
|
+
var ObjectSetQuery = class _ObjectSetQuery extends BaseListQuery {
|
|
4306
4370
|
#baseObjectSetWire;
|
|
4307
4371
|
#operations;
|
|
4308
4372
|
#composedObjectSet;
|
|
4309
4373
|
#objectTypes;
|
|
4374
|
+
#requiresServerEvaluation;
|
|
4375
|
+
#resultTypeApiName;
|
|
4310
4376
|
constructor(store, subject, baseObjectSetWire, operations, cacheKey, opts) {
|
|
4311
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
4377
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkBWOPPEUP_cjs.additionalContext].logger?.child({}, {
|
|
4312
4378
|
msgPrefix: `ObjectSetQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
4313
4379
|
}) : void 0);
|
|
4314
4380
|
this.#baseObjectSetWire = baseObjectSetWire;
|
|
4315
4381
|
this.#operations = operations;
|
|
4316
4382
|
this.#composedObjectSet = this.#composeObjectSet(opts);
|
|
4317
|
-
|
|
4383
|
+
const baseWire = JSON.parse(baseObjectSetWire);
|
|
4384
|
+
this.#objectTypes = this.#extractObjectTypes(baseWire, opts);
|
|
4385
|
+
this.#requiresServerEvaluation = !!(operations.pivotTo || operations.union && operations.union.length > 0 || operations.intersect && operations.intersect.length > 0 || operations.subtract && operations.subtract.length > 0);
|
|
4386
|
+
this.#resultTypeApiName = _ObjectSetQuery.#extractTypeFromWireObjectSet(baseWire) ?? "";
|
|
4318
4387
|
if (opts.autoFetchMore === true) {
|
|
4319
4388
|
this.minResultsToLoad = Number.MAX_SAFE_INTEGER;
|
|
4320
4389
|
} else if (typeof opts.autoFetchMore === "number") {
|
|
@@ -4323,6 +4392,9 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
4323
4392
|
this.minResultsToLoad = opts.pageSize || 0;
|
|
4324
4393
|
}
|
|
4325
4394
|
}
|
|
4395
|
+
get objectTypes() {
|
|
4396
|
+
return this.#objectTypes;
|
|
4397
|
+
}
|
|
4326
4398
|
get rdpConfig() {
|
|
4327
4399
|
return this.#operations.withProperties ?? null;
|
|
4328
4400
|
}
|
|
@@ -4354,37 +4426,36 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
4354
4426
|
}
|
|
4355
4427
|
return result;
|
|
4356
4428
|
}
|
|
4357
|
-
#extractObjectTypes(opts) {
|
|
4429
|
+
#extractObjectTypes(baseWire, opts) {
|
|
4358
4430
|
const types = /* @__PURE__ */ new Set();
|
|
4359
|
-
const
|
|
4360
|
-
if (
|
|
4361
|
-
types.add(
|
|
4362
|
-
}
|
|
4363
|
-
if (opts.union) {
|
|
4364
|
-
for (const os of opts.union) {
|
|
4365
|
-
const wire = chunkR7OP6A6S_cjs.getWireObjectSet(os);
|
|
4366
|
-
if (wire.type) {
|
|
4367
|
-
types.add(wire.type);
|
|
4368
|
-
}
|
|
4369
|
-
}
|
|
4431
|
+
const baseTypeName = _ObjectSetQuery.#extractTypeFromWireObjectSet(baseWire);
|
|
4432
|
+
if (baseTypeName) {
|
|
4433
|
+
types.add(baseTypeName);
|
|
4370
4434
|
}
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4435
|
+
_ObjectSetQuery.#addTypesFromObjectSets(opts.union, types);
|
|
4436
|
+
_ObjectSetQuery.#addTypesFromObjectSets(opts.intersect, types);
|
|
4437
|
+
_ObjectSetQuery.#addTypesFromObjectSets(opts.subtract, types);
|
|
4438
|
+
return types;
|
|
4439
|
+
}
|
|
4440
|
+
static #addTypesFromObjectSets(sets, types) {
|
|
4441
|
+
if (!sets) {
|
|
4442
|
+
return;
|
|
4378
4443
|
}
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
types.add(wire.type);
|
|
4384
|
-
}
|
|
4444
|
+
for (const os of sets) {
|
|
4445
|
+
const typeName = _ObjectSetQuery.#extractTypeFromWireObjectSet(chunkBWOPPEUP_cjs.getWireObjectSet(os));
|
|
4446
|
+
if (typeName) {
|
|
4447
|
+
types.add(typeName);
|
|
4385
4448
|
}
|
|
4386
4449
|
}
|
|
4387
|
-
|
|
4450
|
+
}
|
|
4451
|
+
static #extractTypeFromWireObjectSet(wire) {
|
|
4452
|
+
if (wire.type === "base") {
|
|
4453
|
+
return wire.objectType;
|
|
4454
|
+
}
|
|
4455
|
+
if (wire.type === "interfaceBase") {
|
|
4456
|
+
return wire.interfaceType;
|
|
4457
|
+
}
|
|
4458
|
+
return void 0;
|
|
4388
4459
|
}
|
|
4389
4460
|
/**
|
|
4390
4461
|
* Register changes to the cache specific to ObjectSetQuery
|
|
@@ -4398,10 +4469,10 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
4398
4469
|
*/
|
|
4399
4470
|
async fetchPageData(signal) {
|
|
4400
4471
|
if (this.#operations.orderBy && Object.keys(this.#operations.orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
4401
|
-
const wireObjectSet =
|
|
4472
|
+
const wireObjectSet = chunkBWOPPEUP_cjs.getWireObjectSet(this.#composedObjectSet);
|
|
4402
4473
|
const {
|
|
4403
4474
|
resultType
|
|
4404
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
4475
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkBWOPPEUP_cjs.additionalContext], wireObjectSet);
|
|
4405
4476
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#operations.orderBy);
|
|
4406
4477
|
}
|
|
4407
4478
|
const resp = await this.#composedObjectSet.fetchPage({
|
|
@@ -4414,6 +4485,9 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
4414
4485
|
// OrderBy is already applied in the composed ObjectSet
|
|
4415
4486
|
...this.#operations.orderBy && Object.keys(this.#operations.orderBy).length > 0 ? {
|
|
4416
4487
|
$orderBy: this.#operations.orderBy
|
|
4488
|
+
} : {},
|
|
4489
|
+
...this.options.$loadPropertySecurityMetadata ? {
|
|
4490
|
+
$loadPropertySecurityMetadata: true
|
|
4417
4491
|
} : {}
|
|
4418
4492
|
});
|
|
4419
4493
|
if (signal?.aborted) {
|
|
@@ -4434,6 +4508,119 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
4434
4508
|
registerStreamUpdates(sub) {
|
|
4435
4509
|
this.createWebsocketSubscription(this.#composedObjectSet, sub, "observeObjectSet");
|
|
4436
4510
|
}
|
|
4511
|
+
maybeUpdateAndRevalidate = (changes, optimisticId) => {
|
|
4512
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4513
|
+
this.logger?.child({
|
|
4514
|
+
methodName: "maybeUpdateAndRevalidate"
|
|
4515
|
+
}).debug(DEBUG_ONLY__changesToString(changes));
|
|
4516
|
+
this.logger?.child({
|
|
4517
|
+
methodName: "maybeUpdateAndRevalidate"
|
|
4518
|
+
}).debug(`Already in changes? ${changes.modified.has(this.cacheKey)}`);
|
|
4519
|
+
}
|
|
4520
|
+
if (changes.modified.has(this.cacheKey)) {
|
|
4521
|
+
return;
|
|
4522
|
+
}
|
|
4523
|
+
changes.modified.add(this.cacheKey);
|
|
4524
|
+
try {
|
|
4525
|
+
if (this.#requiresServerEvaluation) {
|
|
4526
|
+
return this.#handleServerRevalidation(changes);
|
|
4527
|
+
}
|
|
4528
|
+
return this.#handleLocalUpdate(changes, optimisticId);
|
|
4529
|
+
} finally {
|
|
4530
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4531
|
+
this.logger?.child({
|
|
4532
|
+
methodName: "maybeUpdateAndRevalidate"
|
|
4533
|
+
}).debug("in finally");
|
|
4534
|
+
}
|
|
4535
|
+
}
|
|
4536
|
+
};
|
|
4537
|
+
#handleServerRevalidation(changes) {
|
|
4538
|
+
for (const objectType of this.#objectTypes) {
|
|
4539
|
+
const added = changes.addedObjects.get(objectType);
|
|
4540
|
+
const modified = changes.modifiedObjects.get(objectType);
|
|
4541
|
+
if (added && added.length > 0 || modified && modified.length > 0) {
|
|
4542
|
+
return this.revalidate(true);
|
|
4543
|
+
}
|
|
4544
|
+
}
|
|
4545
|
+
for (const deletedKey of changes.deleted) {
|
|
4546
|
+
if (deletedKey.type === "object" && this.#objectTypes.has(deletedKey.otherKeys[API_NAME_IDX3])) {
|
|
4547
|
+
return this.revalidate(true);
|
|
4548
|
+
}
|
|
4549
|
+
}
|
|
4550
|
+
return void 0;
|
|
4551
|
+
}
|
|
4552
|
+
#getRelevantChanges(changes) {
|
|
4553
|
+
const resultApiName = this.#resultTypeApiName;
|
|
4554
|
+
const addedObjects = changes.addedObjects.get(resultApiName) ?? [];
|
|
4555
|
+
const modifiedObjects = changes.modifiedObjects.get(resultApiName) ?? [];
|
|
4556
|
+
let hasRelevantDeletions = false;
|
|
4557
|
+
for (const key of changes.deleted) {
|
|
4558
|
+
if (key.type === "object" && key.otherKeys[API_NAME_IDX3] === resultApiName) {
|
|
4559
|
+
hasRelevantDeletions = true;
|
|
4560
|
+
break;
|
|
4561
|
+
}
|
|
4562
|
+
}
|
|
4563
|
+
if (addedObjects.length === 0 && modifiedObjects.length === 0 && !hasRelevantDeletions) {
|
|
4564
|
+
return void 0;
|
|
4565
|
+
}
|
|
4566
|
+
return {
|
|
4567
|
+
addedObjects,
|
|
4568
|
+
modifiedObjects
|
|
4569
|
+
};
|
|
4570
|
+
}
|
|
4571
|
+
#handleLocalUpdate(changes, optimisticId) {
|
|
4572
|
+
const whereClause = this.#operations.where;
|
|
4573
|
+
const effectiveWhere = whereClause ?? this.store.whereCanonicalizer.canonicalize({
|
|
4574
|
+
$and: []
|
|
4575
|
+
});
|
|
4576
|
+
const relevant = this.#getRelevantChanges(changes);
|
|
4577
|
+
if (!relevant) {
|
|
4578
|
+
return void 0;
|
|
4579
|
+
}
|
|
4580
|
+
const addedMatches = this.#classifyByWhereMatch(relevant.addedObjects, effectiveWhere);
|
|
4581
|
+
const modifiedMatches = this.#classifyByWhereMatch(relevant.modifiedObjects, effectiveWhere);
|
|
4582
|
+
const status = optimisticId || addedMatches.uncertain.size > 0 || modifiedMatches.uncertain.size > 0 ? "loading" : "loaded";
|
|
4583
|
+
const {
|
|
4584
|
+
retVal: needsRevalidation
|
|
4585
|
+
} = this.store.batch({
|
|
4586
|
+
optimisticId,
|
|
4587
|
+
changes
|
|
4588
|
+
}, (batch) => {
|
|
4589
|
+
const existingKeys = new Set(batch.read(this.cacheKey)?.value?.data);
|
|
4590
|
+
const {
|
|
4591
|
+
newList,
|
|
4592
|
+
needsRevalidation: needsRevalidation2
|
|
4593
|
+
} = reconcileListChanges(existingKeys, addedMatches.definite, relevant.modifiedObjects, modifiedMatches, changes.deleted, batch.optimisticWrite, (obj) => this.#getObjectCacheKey(obj));
|
|
4594
|
+
const existingTotalCount = batch.read(this.cacheKey)?.value?.totalCount;
|
|
4595
|
+
this._updateList(newList, status, batch, {
|
|
4596
|
+
type: "clientOrdered"
|
|
4597
|
+
}, existingTotalCount);
|
|
4598
|
+
return needsRevalidation2;
|
|
4599
|
+
});
|
|
4600
|
+
if (needsRevalidation) {
|
|
4601
|
+
return this.revalidate(true);
|
|
4602
|
+
}
|
|
4603
|
+
return void 0;
|
|
4604
|
+
}
|
|
4605
|
+
#classifyByWhereMatch(objects, whereClause) {
|
|
4606
|
+
const definite = /* @__PURE__ */ new Set();
|
|
4607
|
+
const uncertain = /* @__PURE__ */ new Set();
|
|
4608
|
+
for (const obj of objects) {
|
|
4609
|
+
if (objectSortaMatchesWhereClause(obj, whereClause, true)) {
|
|
4610
|
+
definite.add(obj);
|
|
4611
|
+
} else if (objectSortaMatchesWhereClause(obj, whereClause, false)) {
|
|
4612
|
+
uncertain.add(obj);
|
|
4613
|
+
}
|
|
4614
|
+
}
|
|
4615
|
+
return {
|
|
4616
|
+
definite,
|
|
4617
|
+
uncertain
|
|
4618
|
+
};
|
|
4619
|
+
}
|
|
4620
|
+
#getObjectCacheKey(obj) {
|
|
4621
|
+
const pk = obj.$primaryKey;
|
|
4622
|
+
return this.cacheKeys.get("object", obj.$objectType, pk, this.rdpConfig ?? void 0);
|
|
4623
|
+
}
|
|
4437
4624
|
invalidateObjectType = async (objectType, changes) => {
|
|
4438
4625
|
if (this.#objectTypes.has(objectType)) {
|
|
4439
4626
|
changes?.modified.add(this.cacheKey);
|
|
@@ -4454,15 +4641,46 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
4454
4641
|
};
|
|
4455
4642
|
}
|
|
4456
4643
|
};
|
|
4644
|
+
function reconcileListChanges(existingKeys, addedDefiniteMatches, modifiedObjects, modifiedMatches, deleted, isOptimistic, getObjectCacheKey) {
|
|
4645
|
+
const objectsToInsert = new Set(addedDefiniteMatches);
|
|
4646
|
+
const keysToRemove = new Set(deleted);
|
|
4647
|
+
let needsRevalidation = false;
|
|
4648
|
+
for (const obj of modifiedObjects) {
|
|
4649
|
+
if (modifiedMatches.definite.has(obj)) {
|
|
4650
|
+
if (!existingKeys.has(getObjectCacheKey(obj))) {
|
|
4651
|
+
objectsToInsert.add(obj);
|
|
4652
|
+
}
|
|
4653
|
+
} else if (!isOptimistic) {
|
|
4654
|
+
keysToRemove.add(getObjectCacheKey(obj));
|
|
4655
|
+
if (modifiedMatches.uncertain.has(obj)) {
|
|
4656
|
+
needsRevalidation = true;
|
|
4657
|
+
}
|
|
4658
|
+
}
|
|
4659
|
+
}
|
|
4660
|
+
const newList = [];
|
|
4661
|
+
for (const key of existingKeys) {
|
|
4662
|
+
if (!keysToRemove.has(key)) {
|
|
4663
|
+
newList.push(key);
|
|
4664
|
+
}
|
|
4665
|
+
}
|
|
4666
|
+
for (const obj of objectsToInsert) {
|
|
4667
|
+
newList.push(getObjectCacheKey(obj));
|
|
4668
|
+
}
|
|
4669
|
+
return {
|
|
4670
|
+
newList,
|
|
4671
|
+
needsRevalidation
|
|
4672
|
+
};
|
|
4673
|
+
}
|
|
4457
4674
|
|
|
4458
4675
|
// src/observable/internal/objectset/ObjectSetHelper.ts
|
|
4459
4676
|
var ObjectSetHelper = class extends AbstractHelper {
|
|
4460
|
-
constructor(store, cacheKeys, whereCanonicalizer2, orderByCanonicalizer2, rdpCanonicalizer, selectCanonicalizer) {
|
|
4677
|
+
constructor(store, cacheKeys, whereCanonicalizer2, orderByCanonicalizer2, rdpCanonicalizer, selectCanonicalizer, objectSetArrayCanonicalizer) {
|
|
4461
4678
|
super(store, cacheKeys);
|
|
4462
4679
|
this.whereCanonicalizer = whereCanonicalizer2;
|
|
4463
4680
|
this.orderByCanonicalizer = orderByCanonicalizer2;
|
|
4464
4681
|
this.rdpCanonicalizer = rdpCanonicalizer;
|
|
4465
4682
|
this.selectCanonicalizer = selectCanonicalizer;
|
|
4683
|
+
this.objectSetArrayCanonicalizer = objectSetArrayCanonicalizer;
|
|
4466
4684
|
}
|
|
4467
4685
|
observe(options, subFn) {
|
|
4468
4686
|
const ret = super.observe(options, subFn);
|
|
@@ -4475,7 +4693,7 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
4475
4693
|
const {
|
|
4476
4694
|
baseObjectSet
|
|
4477
4695
|
} = options;
|
|
4478
|
-
const baseObjectSetWire = JSON.stringify(
|
|
4696
|
+
const baseObjectSetWire = JSON.stringify(chunkBWOPPEUP_cjs.getWireObjectSet(baseObjectSet));
|
|
4479
4697
|
const operations = this.buildCanonicalizedOperations(options);
|
|
4480
4698
|
const objectSetCacheKey = this.cacheKeys.get("objectSet", baseObjectSetWire, operations);
|
|
4481
4699
|
return this.store.queries.get(objectSetCacheKey, () => {
|
|
@@ -4491,13 +4709,13 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
4491
4709
|
operations.withProperties = this.rdpCanonicalizer.canonicalize(options.withProperties);
|
|
4492
4710
|
}
|
|
4493
4711
|
if (options.union && options.union.length > 0) {
|
|
4494
|
-
operations.union = options.union.map((os) => JSON.stringify(
|
|
4712
|
+
operations.union = this.objectSetArrayCanonicalizer.canonicalizeUnion(options.union.map((os) => JSON.stringify(chunkBWOPPEUP_cjs.getWireObjectSet(os))));
|
|
4495
4713
|
}
|
|
4496
4714
|
if (options.intersect && options.intersect.length > 0) {
|
|
4497
|
-
operations.intersect = options.intersect.map((os) => JSON.stringify(
|
|
4715
|
+
operations.intersect = this.objectSetArrayCanonicalizer.canonicalizeIntersect(options.intersect.map((os) => JSON.stringify(chunkBWOPPEUP_cjs.getWireObjectSet(os))));
|
|
4498
4716
|
}
|
|
4499
4717
|
if (options.subtract && options.subtract.length > 0) {
|
|
4500
|
-
operations.subtract = options.subtract.map((os) => JSON.stringify(
|
|
4718
|
+
operations.subtract = this.objectSetArrayCanonicalizer.canonicalizeSubtract(options.subtract.map((os) => JSON.stringify(chunkBWOPPEUP_cjs.getWireObjectSet(os))));
|
|
4501
4719
|
}
|
|
4502
4720
|
if (options.pivotTo) {
|
|
4503
4721
|
operations.pivotTo = options.pivotTo;
|
|
@@ -4511,10 +4729,31 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
4511
4729
|
if (options.pageSize) {
|
|
4512
4730
|
operations.pageSize = options.pageSize;
|
|
4513
4731
|
}
|
|
4732
|
+
if (options.$loadPropertySecurityMetadata) {
|
|
4733
|
+
operations.loadPropertySecurity = true;
|
|
4734
|
+
}
|
|
4514
4735
|
return operations;
|
|
4515
4736
|
}
|
|
4516
4737
|
};
|
|
4517
4738
|
|
|
4739
|
+
// src/observable/internal/ObjectSetArrayCanonicalizer.ts
|
|
4740
|
+
var ObjectSetArrayCanonicalizer = class {
|
|
4741
|
+
#unionTrie = new WeakRefTrie();
|
|
4742
|
+
#intersectTrie = new WeakRefTrie();
|
|
4743
|
+
#subtractTrie = new WeakRefTrie();
|
|
4744
|
+
canonicalizeUnion(items) {
|
|
4745
|
+
const sorted = [...items].sort();
|
|
4746
|
+
return this.#unionTrie.lookupArray(sorted);
|
|
4747
|
+
}
|
|
4748
|
+
canonicalizeIntersect(items) {
|
|
4749
|
+
const sorted = [...items].sort();
|
|
4750
|
+
return this.#intersectTrie.lookupArray(sorted);
|
|
4751
|
+
}
|
|
4752
|
+
canonicalizeSubtract(items) {
|
|
4753
|
+
return this.#subtractTrie.lookupArray(items);
|
|
4754
|
+
}
|
|
4755
|
+
};
|
|
4756
|
+
|
|
4518
4757
|
// src/observable/internal/PivotCanonicalizer.ts
|
|
4519
4758
|
var PivotCanonicalizer = class {
|
|
4520
4759
|
#cache = /* @__PURE__ */ new Map();
|
|
@@ -4569,7 +4808,7 @@ var RdpCanonicalizer = class extends CachingCanonicalizer {
|
|
|
4569
4808
|
apiName: "__rdp_canonicalizer_holder__"
|
|
4570
4809
|
};
|
|
4571
4810
|
for (const [key, rdpFunction] of Object.entries(rdp)) {
|
|
4572
|
-
const builder =
|
|
4811
|
+
const builder = chunkBWOPPEUP_cjs.createWithPropertiesObjectSet(
|
|
4573
4812
|
objectTypeHolder,
|
|
4574
4813
|
{
|
|
4575
4814
|
type: "methodInput"
|
|
@@ -4642,6 +4881,8 @@ var Store = class {
|
|
|
4642
4881
|
pivotCanonicalizer = new PivotCanonicalizer();
|
|
4643
4882
|
ridListCanonicalizer = new RidListCanonicalizer();
|
|
4644
4883
|
selectCanonicalizer = new SelectCanonicalizer();
|
|
4884
|
+
objectSetArrayCanonicalizer = new ObjectSetArrayCanonicalizer();
|
|
4885
|
+
genericCanonicalizer = new GenericCanonicalizer();
|
|
4645
4886
|
/** @internal */
|
|
4646
4887
|
queries = new Queries();
|
|
4647
4888
|
/**
|
|
@@ -4663,7 +4904,7 @@ var Store = class {
|
|
|
4663
4904
|
subjects = this.layers.subjects;
|
|
4664
4905
|
// these are hopefully temporary
|
|
4665
4906
|
constructor(client) {
|
|
4666
|
-
this.logger = client[
|
|
4907
|
+
this.logger = client[chunkBWOPPEUP_cjs.additionalContext].logger?.child({}, {
|
|
4667
4908
|
msgPrefix: "Store"
|
|
4668
4909
|
});
|
|
4669
4910
|
this.client = client;
|
|
@@ -4675,7 +4916,7 @@ var Store = class {
|
|
|
4675
4916
|
this.lists = new ListsHelper(this, this.cacheKeys, this.whereCanonicalizer, this.orderByCanonicalizer, this.rdpCanonicalizer, this.intersectCanonicalizer, this.pivotCanonicalizer, this.ridListCanonicalizer, this.selectCanonicalizer);
|
|
4676
4917
|
this.objects = new ObjectsHelper(this, this.cacheKeys);
|
|
4677
4918
|
this.links = new LinksHelper(this, this.cacheKeys, this.whereCanonicalizer, this.orderByCanonicalizer, this.selectCanonicalizer);
|
|
4678
|
-
this.objectSets = new ObjectSetHelper(this, this.cacheKeys, this.whereCanonicalizer, this.orderByCanonicalizer, this.rdpCanonicalizer, this.selectCanonicalizer);
|
|
4919
|
+
this.objectSets = new ObjectSetHelper(this, this.cacheKeys, this.whereCanonicalizer, this.orderByCanonicalizer, this.rdpCanonicalizer, this.selectCanonicalizer, this.objectSetArrayCanonicalizer);
|
|
4679
4920
|
}
|
|
4680
4921
|
/**
|
|
4681
4922
|
* Called after a key is no longer retained and the timeout has elapsed
|
|
@@ -4807,6 +5048,17 @@ var Store = class {
|
|
|
4807
5048
|
* @returns true if the query should be notified based on object type changes
|
|
4808
5049
|
*/
|
|
4809
5050
|
#shouldPropagateForObjectTypeChanges(cacheKey, changes) {
|
|
5051
|
+
if (cacheKey.type === "objectSet") {
|
|
5052
|
+
const query = this.queries.peek(cacheKey);
|
|
5053
|
+
if (query) {
|
|
5054
|
+
for (const objectType of query.objectTypes) {
|
|
5055
|
+
if (this.#changesAffectObjectType(changes, objectType)) {
|
|
5056
|
+
return true;
|
|
5057
|
+
}
|
|
5058
|
+
}
|
|
5059
|
+
}
|
|
5060
|
+
return false;
|
|
5061
|
+
}
|
|
4810
5062
|
const queryObjectType = this.#getQueryObjectType(cacheKey);
|
|
4811
5063
|
if (!queryObjectType) {
|
|
4812
5064
|
return false;
|
|
@@ -4880,6 +5132,11 @@ var Store = class {
|
|
|
4880
5132
|
if (modifiedForType && modifiedForType.length > 0) {
|
|
4881
5133
|
return true;
|
|
4882
5134
|
}
|
|
5135
|
+
for (const deletedKey of changes.deleted) {
|
|
5136
|
+
if (deletedKey.type === "object" && deletedKey.otherKeys[API_NAME_IDX3] === objectType) {
|
|
5137
|
+
return true;
|
|
5138
|
+
}
|
|
5139
|
+
}
|
|
4883
5140
|
return false;
|
|
4884
5141
|
}
|
|
4885
5142
|
/**
|
|
@@ -4941,10 +5198,10 @@ var Store = class {
|
|
|
4941
5198
|
|
|
4942
5199
|
// src/observable/ObservableClient.ts
|
|
4943
5200
|
function createObservableClient(client) {
|
|
4944
|
-
const tweakedClient =
|
|
4945
|
-
...client[
|
|
4946
|
-
fetch: shared_net_fetch.createFetchHeaderMutator(client[
|
|
4947
|
-
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"),
|
|
5201
|
+
const tweakedClient = chunkZPGIIKEZ_cjs.createClientFromContext({
|
|
5202
|
+
...client[chunkBWOPPEUP_cjs.additionalContext],
|
|
5203
|
+
fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkBWOPPEUP_cjs.additionalContext].fetch, (headers) => {
|
|
5204
|
+
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkZPGIIKEZ_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
|
|
4948
5205
|
return headers;
|
|
4949
5206
|
})
|
|
4950
5207
|
});
|
|
@@ -4987,19 +5244,19 @@ function getOsdkConfig(ontologyRid) {
|
|
|
4987
5244
|
|
|
4988
5245
|
Object.defineProperty(exports, "createClientWithTransaction", {
|
|
4989
5246
|
enumerable: true,
|
|
4990
|
-
get: function () { return
|
|
5247
|
+
get: function () { return chunkZPGIIKEZ_cjs.createClientWithTransaction; }
|
|
4991
5248
|
});
|
|
4992
5249
|
Object.defineProperty(exports, "augment", {
|
|
4993
5250
|
enumerable: true,
|
|
4994
|
-
get: function () { return
|
|
5251
|
+
get: function () { return chunkBWOPPEUP_cjs.augment; }
|
|
4995
5252
|
});
|
|
4996
5253
|
Object.defineProperty(exports, "getWireObjectSet", {
|
|
4997
5254
|
enumerable: true,
|
|
4998
|
-
get: function () { return
|
|
5255
|
+
get: function () { return chunkBWOPPEUP_cjs.getWireObjectSet; }
|
|
4999
5256
|
});
|
|
5000
5257
|
Object.defineProperty(exports, "isObjectSet", {
|
|
5001
5258
|
enumerable: true,
|
|
5002
|
-
get: function () { return
|
|
5259
|
+
get: function () { return chunkBWOPPEUP_cjs.isObjectSet; }
|
|
5003
5260
|
});
|
|
5004
5261
|
exports.computeObjectSetCacheKey = computeObjectSetCacheKey;
|
|
5005
5262
|
exports.createObservableClient = createObservableClient;
|