@osdk/client 2.8.0-beta.2 → 2.8.0-beta.3
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 +13 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +0 -4
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/ObservableClient.js.map +1 -1
- package/build/browser/observable/internal/ObservableClientImpl.js +23 -5
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/function/FunctionQuery.js +27 -1
- package/build/browser/observable/internal/function/FunctionQuery.js.map +1 -1
- package/build/browser/observable/internal/function/FunctionsHelper.js +2 -1
- package/build/browser/observable/internal/function/FunctionsHelper.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +1 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-XUFF6M4V.cjs → chunk-O22QYBFF.cjs} +132 -131
- package/build/cjs/chunk-O22QYBFF.cjs.map +1 -0
- package/build/cjs/{chunk-II23HDVV.cjs → chunk-W5MGPHBY.cjs} +65 -65
- package/build/cjs/{chunk-II23HDVV.cjs.map → chunk-W5MGPHBY.cjs.map} +1 -1
- package/build/cjs/index.cjs +8 -8
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +101 -59
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +13 -5
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +0 -4
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/ObservableClient.js.map +1 -1
- package/build/esm/observable/internal/ObservableClientImpl.js +23 -5
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/function/FunctionQuery.js +27 -1
- package/build/esm/observable/internal/function/FunctionQuery.js.map +1 -1
- package/build/esm/observable/internal/function/FunctionsHelper.js +2 -1
- package/build/esm/observable/internal/function/FunctionsHelper.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +1 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/objectSet/createObjectSet.d.ts +5 -1
- package/build/types/objectSet/createObjectSet.d.ts.map +1 -1
- package/build/types/observable/ObservableClient.d.ts +6 -2
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/internal/function/FunctionQuery.d.ts +1 -1
- package/build/types/observable/internal/function/FunctionQuery.d.ts.map +1 -1
- package/build/types/observable/internal/function/FunctionsHelper.d.ts +1 -0
- package/build/types/observable/internal/function/FunctionsHelper.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +1 -0
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/package.json +8 -8
- package/build/cjs/chunk-XUFF6M4V.cjs.map +0 -1
package/build/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkW5MGPHBY_cjs = require('./chunk-W5MGPHBY.cjs');
|
|
4
|
+
require('./chunk-O22QYBFF.cjs');
|
|
5
5
|
var chunkLDTMSHUZ_cjs = require('./chunk-LDTMSHUZ.cjs');
|
|
6
6
|
var api = require('@osdk/api');
|
|
7
7
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
@@ -18,7 +18,7 @@ chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
|
18
18
|
// src/createPlatformClient.ts
|
|
19
19
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
20
20
|
function createPlatformClient(baseUrl, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
21
|
-
return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider,
|
|
21
|
+
return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, chunkW5MGPHBY_cjs.USER_AGENT, fetchFn);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// src/util/datetimeConverters.ts
|
|
@@ -45,23 +45,23 @@ var extractDateFromIsoString = (dateTime) => {
|
|
|
45
45
|
|
|
46
46
|
Object.defineProperty(exports, "ActionValidationError", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkW5MGPHBY_cjs.ActionValidationError; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "createAttachmentUpload", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkW5MGPHBY_cjs.createAttachmentUpload; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "createClient", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkW5MGPHBY_cjs.createClient; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "createObjectSpecifierFromPrimaryKey", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkW5MGPHBY_cjs.createObjectSpecifierFromPrimaryKey; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "extractPrimaryKeyFromObjectSpecifier", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkW5MGPHBY_cjs.extractPrimaryKeyFromObjectSpecifier; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "isOk", {
|
|
67
67
|
enumerable: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO22QYBFF_cjs = require('../chunk-O22QYBFF.cjs');
|
|
4
4
|
var chunkLDTMSHUZ_cjs = require('../chunk-LDTMSHUZ.cjs');
|
|
5
5
|
|
|
6
6
|
// src/public/internal.ts
|
|
@@ -9,8 +9,8 @@ chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
|
9
9
|
// src/public-utils/createAndFetchTempObjectSetRid.ts
|
|
10
10
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
11
11
|
async function createAndFetchTempObjectSetRid(client, objectSet) {
|
|
12
|
-
const response = await
|
|
13
|
-
objectSet:
|
|
12
|
+
const response = await chunkO22QYBFF_cjs.OntologyObjectSet_exports.createTemporary(client, await client[chunkO22QYBFF_cjs.additionalContext].ontologyRid, {
|
|
13
|
+
objectSet: chunkO22QYBFF_cjs.getWireObjectSet(objectSet)
|
|
14
14
|
});
|
|
15
15
|
return response.objectSetRid;
|
|
16
16
|
}
|
|
@@ -18,7 +18,7 @@ async function createAndFetchTempObjectSetRid(client, objectSet) {
|
|
|
18
18
|
// src/public-utils/hydrateObjectSetFromObjectRids.ts
|
|
19
19
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
20
20
|
function hydrateObjectSetFromObjectRids(client, definition, rids) {
|
|
21
|
-
return
|
|
21
|
+
return chunkO22QYBFF_cjs.createObjectSet(definition, client[chunkO22QYBFF_cjs.additionalContext], {
|
|
22
22
|
type: "intersect",
|
|
23
23
|
objectSets: [definition.type === "interface" ? {
|
|
24
24
|
type: "interfaceBase",
|
|
@@ -39,7 +39,7 @@ function asMutableArray(array) {
|
|
|
39
39
|
// src/public-utils/hydrateObjectSetFromRid.ts
|
|
40
40
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
41
41
|
function hydrateObjectSetFromRid(client, definition, rid) {
|
|
42
|
-
return
|
|
42
|
+
return chunkO22QYBFF_cjs.createObjectSet(definition, client[chunkO22QYBFF_cjs.additionalContext], {
|
|
43
43
|
type: "intersect",
|
|
44
44
|
objectSets: [definition.type === "interface" ? {
|
|
45
45
|
type: "interfaceBase",
|
|
@@ -81,7 +81,7 @@ var levelStyles = {
|
|
|
81
81
|
color: "orange"
|
|
82
82
|
})
|
|
83
83
|
};
|
|
84
|
-
var BrowserLogger = class _BrowserLogger extends
|
|
84
|
+
var BrowserLogger = class _BrowserLogger extends chunkO22QYBFF_cjs.BaseLogger {
|
|
85
85
|
constructor(bindings = {}, options = {}) {
|
|
86
86
|
super(bindings, {
|
|
87
87
|
...options,
|
|
@@ -107,11 +107,11 @@ var BrowserLogger = class _BrowserLogger extends chunkXUFF6M4V_cjs.BaseLogger {
|
|
|
107
107
|
|
|
108
108
|
Object.defineProperty(exports, "MinimalLogger", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkO22QYBFF_cjs.MinimalLogger; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "hydrateAttachmentFromRid", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkO22QYBFF_cjs.hydrateAttachmentFromRid; }
|
|
115
115
|
});
|
|
116
116
|
exports.BrowserLogger = BrowserLogger;
|
|
117
117
|
exports.createAndFetchTempObjectSetRid = createAndFetchTempObjectSetRid;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkW5MGPHBY_cjs = require('../chunk-W5MGPHBY.cjs');
|
|
4
|
+
var chunkO22QYBFF_cjs = require('../chunk-O22QYBFF.cjs');
|
|
5
5
|
var chunkLDTMSHUZ_cjs = require('../chunk-LDTMSHUZ.cjs');
|
|
6
6
|
var trie = require('@wry/trie');
|
|
7
7
|
var deepEqual = require('fast-deep-equal');
|
|
@@ -153,7 +153,7 @@ var WhereClauseCanonicalizer = class {
|
|
|
153
153
|
var whereCanonicalizer = new WhereClauseCanonicalizer();
|
|
154
154
|
var orderByCanonicalizer = new OrderByCanonicalizer();
|
|
155
155
|
function computeObjectSetCacheKey(objectSet, options) {
|
|
156
|
-
const keyParts = ["objectSet",
|
|
156
|
+
const keyParts = ["objectSet", chunkO22QYBFF_cjs.getWireObjectSet(objectSet)];
|
|
157
157
|
if (!options) {
|
|
158
158
|
return JSON.stringify(keyParts);
|
|
159
159
|
}
|
|
@@ -165,13 +165,13 @@ function computeObjectSetCacheKey(objectSet, options) {
|
|
|
165
165
|
keyParts.push("props", propKeys);
|
|
166
166
|
}
|
|
167
167
|
if (options.union && options.union.length > 0) {
|
|
168
|
-
keyParts.push("union", options.union.map((os) =>
|
|
168
|
+
keyParts.push("union", options.union.map((os) => chunkO22QYBFF_cjs.getWireObjectSet(os)));
|
|
169
169
|
}
|
|
170
170
|
if (options.intersect && options.intersect.length > 0) {
|
|
171
|
-
keyParts.push("intersect", options.intersect.map((os) =>
|
|
171
|
+
keyParts.push("intersect", options.intersect.map((os) => chunkO22QYBFF_cjs.getWireObjectSet(os)));
|
|
172
172
|
}
|
|
173
173
|
if (options.subtract && options.subtract.length > 0) {
|
|
174
|
-
keyParts.push("subtract", options.subtract.map((os) =>
|
|
174
|
+
keyParts.push("subtract", options.subtract.map((os) => chunkO22QYBFF_cjs.getWireObjectSet(os)));
|
|
175
175
|
}
|
|
176
176
|
if (options.pivotTo) {
|
|
177
177
|
keyParts.push("pivotTo", options.pivotTo);
|
|
@@ -233,16 +233,26 @@ var ObservableClientImpl = class {
|
|
|
233
233
|
};
|
|
234
234
|
observeFunction = (queryDef, params, options, subFn) => {
|
|
235
235
|
const dependsOn = options.dependsOn?.map((dep) => typeof dep === "string" ? dep : dep.apiName);
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
const instances = [];
|
|
237
|
+
const objectSetWires = [];
|
|
238
|
+
for (const item of options.dependsOnObjects ?? []) {
|
|
239
|
+
if (chunkO22QYBFF_cjs.isObjectSet(item)) {
|
|
240
|
+
objectSetWires.push(chunkO22QYBFF_cjs.getWireObjectSet(item));
|
|
241
|
+
} else {
|
|
242
|
+
instances.push({
|
|
243
|
+
$apiName: item.$objectType ?? item.$apiName,
|
|
244
|
+
$primaryKey: item.$primaryKey
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const objectSetTypesPromise = objectSetWires.length > 0 ? Promise.all(objectSetWires.map((wire) => chunkO22QYBFF_cjs.extractObjectOrInterfaceType(this.__experimentalStore.client[chunkO22QYBFF_cjs.additionalContext], wire))).then((types) => types.filter((t) => t != null).map((t) => t.apiName)) : void 0;
|
|
240
249
|
return this.__experimentalStore.functions.observe({
|
|
241
250
|
...options,
|
|
242
251
|
queryDef,
|
|
243
252
|
params,
|
|
244
253
|
dependsOn,
|
|
245
|
-
dependsOnObjects
|
|
254
|
+
dependsOnObjects: instances,
|
|
255
|
+
objectSetTypesPromise
|
|
246
256
|
}, subFn);
|
|
247
257
|
};
|
|
248
258
|
observeLinks = (objects, linkName, options, subFn) => {
|
|
@@ -371,7 +381,7 @@ var OptimisticJob = class {
|
|
|
371
381
|
return this;
|
|
372
382
|
},
|
|
373
383
|
createObject(type, pk, properties) {
|
|
374
|
-
const create = store.client[
|
|
384
|
+
const create = store.client[chunkO22QYBFF_cjs.additionalContext].objectFactory2(store.client[chunkO22QYBFF_cjs.additionalContext], [{
|
|
375
385
|
$primaryKey: pk,
|
|
376
386
|
$apiName: type.apiName,
|
|
377
387
|
$objectType: type.apiName,
|
|
@@ -593,7 +603,7 @@ var Query = class {
|
|
|
593
603
|
this.store = store;
|
|
594
604
|
this.cacheKeys = store.cacheKeys;
|
|
595
605
|
this.#subject = observable;
|
|
596
|
-
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[
|
|
606
|
+
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkO22QYBFF_cjs.additionalContext].logger : store.client[chunkO22QYBFF_cjs.additionalContext].logger?.child({}, {
|
|
597
607
|
msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
|
|
598
608
|
}));
|
|
599
609
|
}
|
|
@@ -751,7 +761,7 @@ var Query = class {
|
|
|
751
761
|
// src/observable/internal/aggregation/AggregationQuery.ts
|
|
752
762
|
var AggregationQuery = class extends Query {
|
|
753
763
|
constructor(store, subject, cacheKey, opts) {
|
|
754
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
764
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkO22QYBFF_cjs.additionalContext].logger?.child({}, {
|
|
755
765
|
msgPrefix: `AggregationQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
756
766
|
}) : void 0);
|
|
757
767
|
this.apiName = cacheKey.otherKeys[API_NAME_IDX];
|
|
@@ -1122,7 +1132,7 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1122
1132
|
path.push("$:map_end");
|
|
1123
1133
|
return arr;
|
|
1124
1134
|
}
|
|
1125
|
-
if (
|
|
1135
|
+
if (chunkW5MGPHBY_cjs.isObjectSpecifiersObject(value)) {
|
|
1126
1136
|
const objectType = value.$objectType ?? value.$apiName;
|
|
1127
1137
|
path.push("$:osdk", objectType, value.$primaryKey);
|
|
1128
1138
|
return {
|
|
@@ -1130,8 +1140,8 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1130
1140
|
$primaryKey: value.$primaryKey
|
|
1131
1141
|
};
|
|
1132
1142
|
}
|
|
1133
|
-
if (
|
|
1134
|
-
const wire =
|
|
1143
|
+
if (chunkO22QYBFF_cjs.isObjectSet(value)) {
|
|
1144
|
+
const wire = chunkO22QYBFF_cjs.getWireObjectSet(value);
|
|
1135
1145
|
path.push("$:objectset", wire);
|
|
1136
1146
|
return wire;
|
|
1137
1147
|
}
|
|
@@ -1193,8 +1203,8 @@ var FunctionQuery = class extends Query {
|
|
|
1193
1203
|
#dependsOn;
|
|
1194
1204
|
#dependsOnObjects;
|
|
1195
1205
|
#queryDef;
|
|
1196
|
-
constructor(store, subject, queryDef, params, cacheKey, opts) {
|
|
1197
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1206
|
+
constructor(store, subject, queryDef, params, cacheKey, opts, objectSetTypesPromise) {
|
|
1207
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkO22QYBFF_cjs.additionalContext].logger?.child({}, {
|
|
1198
1208
|
msgPrefix: `FunctionQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1199
1209
|
}) : void 0);
|
|
1200
1210
|
this.#apiName = queryDef.apiName;
|
|
@@ -1203,6 +1213,29 @@ var FunctionQuery = class extends Query {
|
|
|
1203
1213
|
this.#dependsOn = opts.dependsOn;
|
|
1204
1214
|
this.#dependsOnObjects = opts.dependsOnObjects;
|
|
1205
1215
|
this.#queryDef = queryDef;
|
|
1216
|
+
if (objectSetTypesPromise) {
|
|
1217
|
+
objectSetTypesPromise.then((types) => {
|
|
1218
|
+
if (this.abortController?.signal.aborted) return;
|
|
1219
|
+
let addedNewTypes = false;
|
|
1220
|
+
for (const type of types) {
|
|
1221
|
+
if (!this.#dependsOn) {
|
|
1222
|
+
this.#dependsOn = [];
|
|
1223
|
+
}
|
|
1224
|
+
if (!this.#dependsOn.includes(type)) {
|
|
1225
|
+
this.#dependsOn.push(type);
|
|
1226
|
+
addedNewTypes = true;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
if (addedNewTypes) {
|
|
1230
|
+
void this.revalidate(true);
|
|
1231
|
+
}
|
|
1232
|
+
}).catch((error) => {
|
|
1233
|
+
if (this.abortController?.signal.aborted) return;
|
|
1234
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1235
|
+
this.logger?.error("Failed to extract ObjectSet types", error);
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1206
1239
|
}
|
|
1207
1240
|
_createConnectable(subject) {
|
|
1208
1241
|
return rxjs.connectable(subject.pipe(rxjs.map((x) => {
|
|
@@ -1228,7 +1261,7 @@ var FunctionQuery = class extends Query {
|
|
|
1228
1261
|
}).debug("calling _fetchAndStore");
|
|
1229
1262
|
}
|
|
1230
1263
|
try {
|
|
1231
|
-
const result = await
|
|
1264
|
+
const result = await chunkW5MGPHBY_cjs.applyQuery(this.store.client[chunkO22QYBFF_cjs.additionalContext], this.#queryDef, this.#params);
|
|
1232
1265
|
const executedAt = Date.now();
|
|
1233
1266
|
this.store.batch({}, (batch) => {
|
|
1234
1267
|
this.writeToStore({
|
|
@@ -1311,13 +1344,14 @@ var FunctionsHelper = class extends AbstractHelper {
|
|
|
1311
1344
|
const {
|
|
1312
1345
|
queryDef,
|
|
1313
1346
|
params,
|
|
1347
|
+
objectSetTypesPromise,
|
|
1314
1348
|
...observeOpts
|
|
1315
1349
|
} = options;
|
|
1316
1350
|
const apiName = queryDef.apiName;
|
|
1317
1351
|
const version = queryDef.isFixedVersion ? queryDef.version : void 0;
|
|
1318
1352
|
const canonicalParams = this.paramsCanonicalizer.canonicalize(params);
|
|
1319
1353
|
const functionCacheKey = this.cacheKeys.get("function", apiName, version, canonicalParams);
|
|
1320
|
-
return this.store.queries.get(functionCacheKey, () => new FunctionQuery(this.store, this.store.subjects.get(functionCacheKey), queryDef, params, functionCacheKey, observeOpts));
|
|
1354
|
+
return this.store.queries.get(functionCacheKey, () => new FunctionQuery(this.store, this.store.subjects.get(functionCacheKey), queryDef, params, functionCacheKey, observeOpts, objectSetTypesPromise));
|
|
1321
1355
|
}
|
|
1322
1356
|
async invalidateFunction(apiName, params) {
|
|
1323
1357
|
const functionApiName = typeof apiName === "string" ? apiName : apiName.apiName;
|
|
@@ -2335,7 +2369,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2335
2369
|
batch.changes.modified.add(this.cacheKey);
|
|
2336
2370
|
}
|
|
2337
2371
|
constructor(store, subject, cacheKey, opts) {
|
|
2338
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
2372
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkO22QYBFF_cjs.additionalContext].logger?.child({}, {
|
|
2339
2373
|
msgPrefix: `SpecificLinkQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
2340
2374
|
}) : void 0);
|
|
2341
2375
|
[this.#sourceApiName, this.#sourcePk, this.#linkName, this.#whereClause, this.#orderBy] = cacheKey.otherKeys;
|
|
@@ -2351,7 +2385,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2351
2385
|
type: "object",
|
|
2352
2386
|
apiName: this.#sourceApiName
|
|
2353
2387
|
};
|
|
2354
|
-
const sourceMetadata = await client[
|
|
2388
|
+
const sourceMetadata = await client[chunkO22QYBFF_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
|
|
2355
2389
|
if (this.#orderBy && Object.keys(this.#orderBy).length > 0) {
|
|
2356
2390
|
const linkDef = sourceMetadata.links?.[this.#linkName];
|
|
2357
2391
|
if (!linkDef?.targetType) {
|
|
@@ -2423,7 +2457,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2423
2457
|
return this.revalidate(true);
|
|
2424
2458
|
} else {
|
|
2425
2459
|
return (async () => {
|
|
2426
|
-
const sourceMetadata = await this.store.client[
|
|
2460
|
+
const sourceMetadata = await this.store.client[chunkO22QYBFF_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
|
|
2427
2461
|
const linkDef = sourceMetadata.links?.[this.#linkName];
|
|
2428
2462
|
if (!linkDef || linkDef.targetType !== objectType) return;
|
|
2429
2463
|
const promise = this.revalidate(true);
|
|
@@ -2731,7 +2765,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
2731
2765
|
batch.changes.registerList(this.cacheKey);
|
|
2732
2766
|
}
|
|
2733
2767
|
constructor(store, subject, apiName, cacheKey, opts) {
|
|
2734
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
2768
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkO22QYBFF_cjs.additionalContext].logger?.child({}, {
|
|
2735
2769
|
msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
2736
2770
|
}) : void 0);
|
|
2737
2771
|
this.apiName = apiName;
|
|
@@ -2769,10 +2803,10 @@ var ListQuery = class extends BaseListQuery {
|
|
|
2769
2803
|
*/
|
|
2770
2804
|
async fetchPageData(signal) {
|
|
2771
2805
|
if (Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
2772
|
-
const wireObjectSet =
|
|
2806
|
+
const wireObjectSet = chunkO22QYBFF_cjs.getWireObjectSet(this.#objectSet);
|
|
2773
2807
|
const {
|
|
2774
2808
|
resultType
|
|
2775
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
2809
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkO22QYBFF_cjs.additionalContext], wireObjectSet);
|
|
2776
2810
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#orderBy);
|
|
2777
2811
|
}
|
|
2778
2812
|
const resp = await this.#objectSet.fetchPage({
|
|
@@ -3038,7 +3072,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3038
3072
|
}
|
|
3039
3073
|
extractRelevantObjects(changes) {
|
|
3040
3074
|
const matchesApiName = ([, object]) => {
|
|
3041
|
-
return this.apiName in object[
|
|
3075
|
+
return this.apiName in object[chunkW5MGPHBY_cjs.ObjectDefRef].interfaceMap;
|
|
3042
3076
|
};
|
|
3043
3077
|
const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
3044
3078
|
const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
@@ -3091,7 +3125,7 @@ var ObjectListQuery = class extends ListQuery {
|
|
|
3091
3125
|
const intersectWith = this.cacheKey.otherKeys[INTERSECT_IDX];
|
|
3092
3126
|
const pivotInfo = this.cacheKey.otherKeys[PIVOT_IDX];
|
|
3093
3127
|
const rids = this.cacheKey.otherKeys[RIDS_IDX];
|
|
3094
|
-
const clientCtx = store.client[
|
|
3128
|
+
const clientCtx = store.client[chunkO22QYBFF_cjs.additionalContext];
|
|
3095
3129
|
const typeDefinition = {
|
|
3096
3130
|
type: "object",
|
|
3097
3131
|
apiName: this.apiName
|
|
@@ -3242,8 +3276,8 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3242
3276
|
if (rdpFields.size === 0) {
|
|
3243
3277
|
return value;
|
|
3244
3278
|
}
|
|
3245
|
-
const underlying = value[
|
|
3246
|
-
const objectDef = value[
|
|
3279
|
+
const underlying = value[chunkW5MGPHBY_cjs.UnderlyingOsdkObject];
|
|
3280
|
+
const objectDef = value[chunkW5MGPHBY_cjs.ObjectDefRef];
|
|
3247
3281
|
const newProps = {
|
|
3248
3282
|
$apiName: underlying.$apiName,
|
|
3249
3283
|
$objectType: underlying.$objectType,
|
|
@@ -3256,7 +3290,7 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3256
3290
|
newProps[key] = underlying[key];
|
|
3257
3291
|
}
|
|
3258
3292
|
}
|
|
3259
|
-
return
|
|
3293
|
+
return chunkW5MGPHBY_cjs.createOsdkObject(value[chunkW5MGPHBY_cjs.ClientRef], objectDef, newProps);
|
|
3260
3294
|
}
|
|
3261
3295
|
function isSuperset(superset, subset) {
|
|
3262
3296
|
for (const field of subset) {
|
|
@@ -3267,8 +3301,8 @@ function isSuperset(superset, subset) {
|
|
|
3267
3301
|
return true;
|
|
3268
3302
|
}
|
|
3269
3303
|
function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
3270
|
-
const underlying = value[
|
|
3271
|
-
const objectDef = value[
|
|
3304
|
+
const underlying = value[chunkW5MGPHBY_cjs.UnderlyingOsdkObject];
|
|
3305
|
+
const objectDef = value[chunkW5MGPHBY_cjs.ObjectDefRef];
|
|
3272
3306
|
const newProps = {
|
|
3273
3307
|
$apiName: underlying.$apiName,
|
|
3274
3308
|
$objectType: underlying.$objectType,
|
|
@@ -3284,7 +3318,7 @@ function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
|
3284
3318
|
}
|
|
3285
3319
|
}
|
|
3286
3320
|
}
|
|
3287
|
-
return
|
|
3321
|
+
return chunkW5MGPHBY_cjs.createOsdkObject(value[chunkW5MGPHBY_cjs.ClientRef], objectDef, newProps);
|
|
3288
3322
|
}
|
|
3289
3323
|
function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, targetCurrentValue) {
|
|
3290
3324
|
if (targetRdpFields.size === 0) {
|
|
@@ -3296,8 +3330,8 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3296
3330
|
}
|
|
3297
3331
|
return filterToRdpFields(sourceValue, targetRdpFields, sourceRdpFields);
|
|
3298
3332
|
}
|
|
3299
|
-
const sourceUnderlying = sourceValue[
|
|
3300
|
-
const objectDef = sourceValue[
|
|
3333
|
+
const sourceUnderlying = sourceValue[chunkW5MGPHBY_cjs.UnderlyingOsdkObject];
|
|
3334
|
+
const objectDef = sourceValue[chunkW5MGPHBY_cjs.ObjectDefRef];
|
|
3301
3335
|
const newProps = {
|
|
3302
3336
|
$apiName: sourceUnderlying.$apiName,
|
|
3303
3337
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3311,14 +3345,14 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3311
3345
|
}
|
|
3312
3346
|
}
|
|
3313
3347
|
if (targetCurrentValue) {
|
|
3314
|
-
const targetUnderlying = targetCurrentValue[
|
|
3348
|
+
const targetUnderlying = targetCurrentValue[chunkW5MGPHBY_cjs.UnderlyingOsdkObject];
|
|
3315
3349
|
for (const field of targetRdpFields) {
|
|
3316
3350
|
if (!sourceRdpFields.has(field) && field in targetUnderlying) {
|
|
3317
3351
|
newProps[field] = targetUnderlying[field];
|
|
3318
3352
|
}
|
|
3319
3353
|
}
|
|
3320
3354
|
}
|
|
3321
|
-
return
|
|
3355
|
+
return chunkW5MGPHBY_cjs.createOsdkObject(sourceValue[chunkW5MGPHBY_cjs.ClientRef], objectDef, newProps);
|
|
3322
3356
|
}
|
|
3323
3357
|
|
|
3324
3358
|
// src/observable/internal/object/ObjectCacheKeyRegistry.ts
|
|
@@ -3453,7 +3487,7 @@ var BulkObjectLoader = class {
|
|
|
3453
3487
|
#maxEntries;
|
|
3454
3488
|
constructor(client, maxWait = 25, maxEntries = 100) {
|
|
3455
3489
|
this.#client = client;
|
|
3456
|
-
this.#logger = client[
|
|
3490
|
+
this.#logger = client[chunkO22QYBFF_cjs.additionalContext].logger;
|
|
3457
3491
|
this.#maxWait = maxWait;
|
|
3458
3492
|
this.#maxEntries = maxEntries;
|
|
3459
3493
|
}
|
|
@@ -3522,7 +3556,7 @@ var ObjectQuery = class extends Query {
|
|
|
3522
3556
|
#apiName;
|
|
3523
3557
|
#pk;
|
|
3524
3558
|
constructor(store, subject, type, pk, cacheKey, opts) {
|
|
3525
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
3559
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkO22QYBFF_cjs.additionalContext].logger?.child({}, {
|
|
3526
3560
|
msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
3527
3561
|
}) : void 0);
|
|
3528
3562
|
this.#apiName = type;
|
|
@@ -3683,7 +3717,7 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3683
3717
|
#composedObjectSet;
|
|
3684
3718
|
#objectTypes;
|
|
3685
3719
|
constructor(store, subject, baseObjectSetWire, operations, cacheKey, opts) {
|
|
3686
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
3720
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkO22QYBFF_cjs.additionalContext].logger?.child({}, {
|
|
3687
3721
|
msgPrefix: `ObjectSetQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
3688
3722
|
}) : void 0);
|
|
3689
3723
|
this.#baseObjectSetWire = baseObjectSetWire;
|
|
@@ -3728,7 +3762,7 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3728
3762
|
}
|
|
3729
3763
|
if (opts.union) {
|
|
3730
3764
|
for (const os of opts.union) {
|
|
3731
|
-
const wire =
|
|
3765
|
+
const wire = chunkO22QYBFF_cjs.getWireObjectSet(os);
|
|
3732
3766
|
if (wire.type) {
|
|
3733
3767
|
types.add(wire.type);
|
|
3734
3768
|
}
|
|
@@ -3736,7 +3770,7 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3736
3770
|
}
|
|
3737
3771
|
if (opts.intersect) {
|
|
3738
3772
|
for (const os of opts.intersect) {
|
|
3739
|
-
const wire =
|
|
3773
|
+
const wire = chunkO22QYBFF_cjs.getWireObjectSet(os);
|
|
3740
3774
|
if (wire.type) {
|
|
3741
3775
|
types.add(wire.type);
|
|
3742
3776
|
}
|
|
@@ -3744,7 +3778,7 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3744
3778
|
}
|
|
3745
3779
|
if (opts.subtract) {
|
|
3746
3780
|
for (const os of opts.subtract) {
|
|
3747
|
-
const wire =
|
|
3781
|
+
const wire = chunkO22QYBFF_cjs.getWireObjectSet(os);
|
|
3748
3782
|
if (wire.type) {
|
|
3749
3783
|
types.add(wire.type);
|
|
3750
3784
|
}
|
|
@@ -3764,10 +3798,10 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3764
3798
|
*/
|
|
3765
3799
|
async fetchPageData(signal) {
|
|
3766
3800
|
if (this.#operations.orderBy && Object.keys(this.#operations.orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
3767
|
-
const wireObjectSet =
|
|
3801
|
+
const wireObjectSet = chunkO22QYBFF_cjs.getWireObjectSet(this.#composedObjectSet);
|
|
3768
3802
|
const {
|
|
3769
3803
|
resultType
|
|
3770
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
3804
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkO22QYBFF_cjs.additionalContext], wireObjectSet);
|
|
3771
3805
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#operations.orderBy);
|
|
3772
3806
|
}
|
|
3773
3807
|
const resp = await this.#composedObjectSet.fetchPage({
|
|
@@ -3836,7 +3870,7 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
3836
3870
|
const {
|
|
3837
3871
|
baseObjectSet
|
|
3838
3872
|
} = options;
|
|
3839
|
-
const baseObjectSetWire = JSON.stringify(
|
|
3873
|
+
const baseObjectSetWire = JSON.stringify(chunkO22QYBFF_cjs.getWireObjectSet(baseObjectSet));
|
|
3840
3874
|
const operations = this.buildCanonicalizedOperations(options);
|
|
3841
3875
|
const objectSetCacheKey = this.cacheKeys.get("objectSet", baseObjectSetWire, operations);
|
|
3842
3876
|
return this.store.queries.get(objectSetCacheKey, () => {
|
|
@@ -3852,13 +3886,13 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
3852
3886
|
operations.withProperties = Object.keys(options.withProperties).sort();
|
|
3853
3887
|
}
|
|
3854
3888
|
if (options.union && options.union.length > 0) {
|
|
3855
|
-
operations.union = options.union.map((os) => JSON.stringify(
|
|
3889
|
+
operations.union = options.union.map((os) => JSON.stringify(chunkO22QYBFF_cjs.getWireObjectSet(os)));
|
|
3856
3890
|
}
|
|
3857
3891
|
if (options.intersect && options.intersect.length > 0) {
|
|
3858
|
-
operations.intersect = options.intersect.map((os) => JSON.stringify(
|
|
3892
|
+
operations.intersect = options.intersect.map((os) => JSON.stringify(chunkO22QYBFF_cjs.getWireObjectSet(os)));
|
|
3859
3893
|
}
|
|
3860
3894
|
if (options.subtract && options.subtract.length > 0) {
|
|
3861
|
-
operations.subtract = options.subtract.map((os) => JSON.stringify(
|
|
3895
|
+
operations.subtract = options.subtract.map((os) => JSON.stringify(chunkO22QYBFF_cjs.getWireObjectSet(os)));
|
|
3862
3896
|
}
|
|
3863
3897
|
if (options.pivotTo) {
|
|
3864
3898
|
operations.pivotTo = options.pivotTo;
|
|
@@ -3930,7 +3964,7 @@ var RdpCanonicalizer = class extends CachingCanonicalizer {
|
|
|
3930
3964
|
apiName: "__rdp_canonicalizer_holder__"
|
|
3931
3965
|
};
|
|
3932
3966
|
for (const [key, rdpFunction] of Object.entries(rdp)) {
|
|
3933
|
-
const builder =
|
|
3967
|
+
const builder = chunkO22QYBFF_cjs.createWithPropertiesObjectSet(
|
|
3934
3968
|
objectTypeHolder,
|
|
3935
3969
|
{
|
|
3936
3970
|
type: "methodInput"
|
|
@@ -3998,7 +4032,7 @@ var Store = class {
|
|
|
3998
4032
|
subjects = this.layers.subjects;
|
|
3999
4033
|
// these are hopefully temporary
|
|
4000
4034
|
constructor(client) {
|
|
4001
|
-
this.logger = client[
|
|
4035
|
+
this.logger = client[chunkO22QYBFF_cjs.additionalContext].logger?.child({}, {
|
|
4002
4036
|
msgPrefix: "Store"
|
|
4003
4037
|
});
|
|
4004
4038
|
this.client = client;
|
|
@@ -4271,10 +4305,10 @@ var Store = class {
|
|
|
4271
4305
|
|
|
4272
4306
|
// src/observable/ObservableClient.ts
|
|
4273
4307
|
function createObservableClient(client) {
|
|
4274
|
-
const tweakedClient =
|
|
4275
|
-
...client[
|
|
4276
|
-
fetch: shared_net_fetch.createFetchHeaderMutator(client[
|
|
4277
|
-
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"),
|
|
4308
|
+
const tweakedClient = chunkW5MGPHBY_cjs.createClientFromContext({
|
|
4309
|
+
...client[chunkO22QYBFF_cjs.additionalContext],
|
|
4310
|
+
fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkO22QYBFF_cjs.additionalContext].fetch, (headers) => {
|
|
4311
|
+
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkW5MGPHBY_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
|
|
4278
4312
|
return headers;
|
|
4279
4313
|
})
|
|
4280
4314
|
});
|
|
@@ -4318,11 +4352,19 @@ function getOsdkConfig(ontologyRid) {
|
|
|
4318
4352
|
|
|
4319
4353
|
Object.defineProperty(exports, "createClientWithTransaction", {
|
|
4320
4354
|
enumerable: true,
|
|
4321
|
-
get: function () { return
|
|
4355
|
+
get: function () { return chunkW5MGPHBY_cjs.createClientWithTransaction; }
|
|
4322
4356
|
});
|
|
4323
4357
|
Object.defineProperty(exports, "augment", {
|
|
4324
4358
|
enumerable: true,
|
|
4325
|
-
get: function () { return
|
|
4359
|
+
get: function () { return chunkO22QYBFF_cjs.augment; }
|
|
4360
|
+
});
|
|
4361
|
+
Object.defineProperty(exports, "getWireObjectSet", {
|
|
4362
|
+
enumerable: true,
|
|
4363
|
+
get: function () { return chunkO22QYBFF_cjs.getWireObjectSet; }
|
|
4364
|
+
});
|
|
4365
|
+
Object.defineProperty(exports, "isObjectSet", {
|
|
4366
|
+
enumerable: true,
|
|
4367
|
+
get: function () { return chunkO22QYBFF_cjs.isObjectSet; }
|
|
4326
4368
|
});
|
|
4327
4369
|
exports.computeObjectSetCacheKey = computeObjectSetCacheKey;
|
|
4328
4370
|
exports.createObservableClient = createObservableClient;
|