@osdk/client 2.7.0-beta.11 → 2.7.0-beta.13
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 +27 -0
- package/build/browser/actions/actions.test.js +0 -8
- package/build/browser/actions/actions.test.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +14 -9
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +74 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +13 -4
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +46 -2
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +1 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/internal/Changes.js +1 -1
- package/build/browser/observable/internal/Changes.js.map +1 -1
- package/build/browser/observable/internal/ObservableClientImpl.js +2 -2
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +48 -1
- package/build/browser/observable/internal/Store.test.js.map +1 -1
- package/build/browser/observable/internal/base-list/BaseListQuery.js +1 -1
- package/build/browser/observable/internal/base-list/BaseListQuery.js.map +1 -1
- package/build/browser/observable/internal/function/FunctionParamsCanonicalizer.js +3 -2
- package/build/browser/observable/internal/function/FunctionParamsCanonicalizer.js.map +1 -1
- package/build/browser/observable/internal/list/InterfaceListQuery.js +24 -9
- package/build/browser/observable/internal/list/InterfaceListQuery.js.map +1 -1
- package/build/browser/observable/internal/object/ObjectsHelper.js +1 -3
- package/build/browser/observable/internal/object/ObjectsHelper.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/isObjectSpecifiersObject.js.map +1 -1
- package/build/cjs/{chunk-RDZ5NKAI.cjs → chunk-VVKEXIIO.cjs} +30 -14
- package/build/cjs/chunk-VVKEXIIO.cjs.map +1 -0
- package/build/cjs/{chunk-666JN2DO.cjs → chunk-ZFL7RPT6.cjs} +65 -65
- package/build/cjs/{chunk-666JN2DO.cjs.map → chunk-ZFL7RPT6.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 +81 -63
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/esm/actions/actions.test.js +0 -8
- package/build/esm/actions/actions.test.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +14 -9
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +74 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +13 -4
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +46 -2
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +1 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/internal/Changes.js +1 -1
- package/build/esm/observable/internal/Changes.js.map +1 -1
- package/build/esm/observable/internal/ObservableClientImpl.js +2 -2
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +48 -1
- package/build/esm/observable/internal/Store.test.js.map +1 -1
- package/build/esm/observable/internal/base-list/BaseListQuery.js +1 -1
- package/build/esm/observable/internal/base-list/BaseListQuery.js.map +1 -1
- package/build/esm/observable/internal/function/FunctionParamsCanonicalizer.js +3 -2
- package/build/esm/observable/internal/function/FunctionParamsCanonicalizer.js.map +1 -1
- package/build/esm/observable/internal/list/InterfaceListQuery.js +24 -9
- package/build/esm/observable/internal/list/InterfaceListQuery.js.map +1 -1
- package/build/esm/observable/internal/object/ObjectsHelper.js +1 -3
- package/build/esm/observable/internal/object/ObjectsHelper.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/isObjectSpecifiersObject.js.map +1 -1
- package/build/types/observable/internal/Changes.d.ts.map +1 -1
- package/build/types/observable/internal/Store.test.d.ts.map +1 -1
- package/build/types/observable/internal/function/FunctionParamsCanonicalizer.d.ts.map +1 -1
- package/build/types/observable/internal/list/InterfaceListQuery.d.ts +3 -0
- package/build/types/observable/internal/list/InterfaceListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/object/ObjectsHelper.d.ts.map +1 -1
- package/build/types/util/isObjectSpecifiersObject.d.ts +1 -0
- package/build/types/util/isObjectSpecifiersObject.d.ts.map +1 -1
- package/package.json +9 -9
- package/build/cjs/chunk-RDZ5NKAI.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 chunkZFL7RPT6_cjs = require('./chunk-ZFL7RPT6.cjs');
|
|
4
|
+
require('./chunk-VVKEXIIO.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, chunkZFL7RPT6_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 chunkZFL7RPT6_cjs.ActionValidationError; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "createAttachmentUpload", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkZFL7RPT6_cjs.createAttachmentUpload; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "createClient", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkZFL7RPT6_cjs.createClient; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "createObjectSpecifierFromPrimaryKey", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkZFL7RPT6_cjs.createObjectSpecifierFromPrimaryKey; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "extractPrimaryKeyFromObjectSpecifier", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkZFL7RPT6_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 chunkVVKEXIIO_cjs = require('../chunk-VVKEXIIO.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 chunkVVKEXIIO_cjs.OntologyObjectSet_exports.createTemporary(client, await client[chunkVVKEXIIO_cjs.additionalContext].ontologyRid, {
|
|
13
|
+
objectSet: chunkVVKEXIIO_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 chunkVVKEXIIO_cjs.createObjectSet(definition, client[chunkVVKEXIIO_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 chunkVVKEXIIO_cjs.createObjectSet(definition, client[chunkVVKEXIIO_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 chunkVVKEXIIO_cjs.BaseLogger {
|
|
85
85
|
constructor(bindings = {}, options = {}) {
|
|
86
86
|
super(bindings, {
|
|
87
87
|
...options,
|
|
@@ -107,11 +107,11 @@ var BrowserLogger = class _BrowserLogger extends chunkRDZ5NKAI_cjs.BaseLogger {
|
|
|
107
107
|
|
|
108
108
|
Object.defineProperty(exports, "MinimalLogger", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkVVKEXIIO_cjs.MinimalLogger; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "hydrateAttachmentFromRid", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkVVKEXIIO_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 chunkZFL7RPT6_cjs = require('../chunk-ZFL7RPT6.cjs');
|
|
4
|
+
var chunkVVKEXIIO_cjs = require('../chunk-VVKEXIIO.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", chunkVVKEXIIO_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) => chunkVVKEXIIO_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) => chunkVVKEXIIO_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) => chunkVVKEXIIO_cjs.getWireObjectSet(os)));
|
|
175
175
|
}
|
|
176
176
|
if (options.pivotTo) {
|
|
177
177
|
keyParts.push("pivotTo", options.pivotTo);
|
|
@@ -234,7 +234,7 @@ var ObservableClientImpl = class {
|
|
|
234
234
|
observeFunction = (queryDef, params, options, subFn) => {
|
|
235
235
|
const dependsOn = options.dependsOn?.map((dep) => typeof dep === "string" ? dep : dep.apiName);
|
|
236
236
|
const dependsOnObjects = options.dependsOnObjects?.map((obj) => ({
|
|
237
|
-
$apiName: obj.$apiName,
|
|
237
|
+
$apiName: obj.$objectType ?? obj.$apiName,
|
|
238
238
|
$primaryKey: obj.$primaryKey
|
|
239
239
|
}));
|
|
240
240
|
return this.__experimentalStore.functions.observe({
|
|
@@ -254,7 +254,7 @@ var ObservableClientImpl = class {
|
|
|
254
254
|
...options,
|
|
255
255
|
srcType: {
|
|
256
256
|
type: "object",
|
|
257
|
-
apiName: obj.$apiName
|
|
257
|
+
apiName: obj.$objectType ?? obj.$apiName
|
|
258
258
|
},
|
|
259
259
|
linkName,
|
|
260
260
|
pk: obj.$primaryKey
|
|
@@ -371,7 +371,7 @@ var OptimisticJob = class {
|
|
|
371
371
|
return this;
|
|
372
372
|
},
|
|
373
373
|
createObject(type, pk, properties) {
|
|
374
|
-
const create = store.client[
|
|
374
|
+
const create = store.client[chunkVVKEXIIO_cjs.additionalContext].objectFactory2(store.client[chunkVVKEXIIO_cjs.additionalContext], [{
|
|
375
375
|
$primaryKey: pk,
|
|
376
376
|
$apiName: type.apiName,
|
|
377
377
|
$objectType: type.apiName,
|
|
@@ -593,7 +593,7 @@ var Query = class {
|
|
|
593
593
|
this.store = store;
|
|
594
594
|
this.cacheKeys = store.cacheKeys;
|
|
595
595
|
this.#subject = observable;
|
|
596
|
-
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[
|
|
596
|
+
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger : store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
|
|
597
597
|
msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
|
|
598
598
|
}));
|
|
599
599
|
}
|
|
@@ -751,7 +751,7 @@ var Query = class {
|
|
|
751
751
|
// src/observable/internal/aggregation/AggregationQuery.ts
|
|
752
752
|
var AggregationQuery = class extends Query {
|
|
753
753
|
constructor(store, subject, cacheKey, opts) {
|
|
754
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
754
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
|
|
755
755
|
msgPrefix: `AggregationQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
756
756
|
}) : void 0);
|
|
757
757
|
this.apiName = cacheKey.otherKeys[API_NAME_IDX];
|
|
@@ -998,7 +998,7 @@ var Changes = class {
|
|
|
998
998
|
modified = /* @__PURE__ */ new Set();
|
|
999
999
|
deleted = /* @__PURE__ */ new Set();
|
|
1000
1000
|
registerObject = (cacheKey, data, isNew) => {
|
|
1001
|
-
this[isNew ? "addedObjects" : "modifiedObjects"].set(data.$apiName, data);
|
|
1001
|
+
this[isNew ? "addedObjects" : "modifiedObjects"].set(data.$objectType ?? data.$apiName, data);
|
|
1002
1002
|
this[isNew ? "added" : "modified"].add(cacheKey);
|
|
1003
1003
|
};
|
|
1004
1004
|
deleteObject = (cacheKey) => {
|
|
@@ -1122,15 +1122,16 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1122
1122
|
path.push("$:map_end");
|
|
1123
1123
|
return arr;
|
|
1124
1124
|
}
|
|
1125
|
-
if (
|
|
1126
|
-
|
|
1125
|
+
if (chunkZFL7RPT6_cjs.isObjectSpecifiersObject(value)) {
|
|
1126
|
+
const objectType = value.$objectType ?? value.$apiName;
|
|
1127
|
+
path.push("$:osdk", objectType, value.$primaryKey);
|
|
1127
1128
|
return {
|
|
1128
|
-
$apiName:
|
|
1129
|
+
$apiName: objectType,
|
|
1129
1130
|
$primaryKey: value.$primaryKey
|
|
1130
1131
|
};
|
|
1131
1132
|
}
|
|
1132
|
-
if (
|
|
1133
|
-
const wire =
|
|
1133
|
+
if (chunkVVKEXIIO_cjs.isObjectSet(value)) {
|
|
1134
|
+
const wire = chunkVVKEXIIO_cjs.getWireObjectSet(value);
|
|
1134
1135
|
path.push("$:objectset", wire);
|
|
1135
1136
|
return wire;
|
|
1136
1137
|
}
|
|
@@ -1193,7 +1194,7 @@ var FunctionQuery = class extends Query {
|
|
|
1193
1194
|
#dependsOnObjects;
|
|
1194
1195
|
#queryDef;
|
|
1195
1196
|
constructor(store, subject, queryDef, params, cacheKey, opts) {
|
|
1196
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1197
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
|
|
1197
1198
|
msgPrefix: `FunctionQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1198
1199
|
}) : void 0);
|
|
1199
1200
|
this.#apiName = queryDef.apiName;
|
|
@@ -1227,7 +1228,7 @@ var FunctionQuery = class extends Query {
|
|
|
1227
1228
|
}).debug("calling _fetchAndStore");
|
|
1228
1229
|
}
|
|
1229
1230
|
try {
|
|
1230
|
-
const result = await
|
|
1231
|
+
const result = await chunkZFL7RPT6_cjs.applyQuery(this.store.client[chunkVVKEXIIO_cjs.additionalContext], this.#queryDef, this.#params);
|
|
1231
1232
|
const executedAt = Date.now();
|
|
1232
1233
|
this.store.batch({}, (batch) => {
|
|
1233
1234
|
this.writeToStore({
|
|
@@ -2303,7 +2304,7 @@ var BaseListQuery = class extends Query {
|
|
|
2303
2304
|
}).debug("Removing object", object);
|
|
2304
2305
|
}
|
|
2305
2306
|
this.store.batch({}, (batch) => {
|
|
2306
|
-
const objectCacheKey = this.store.cacheKeys.get("object", object.$apiName, object.$primaryKey);
|
|
2307
|
+
const objectCacheKey = this.store.cacheKeys.get("object", object.$objectType ?? object.$apiName, object.$primaryKey);
|
|
2307
2308
|
batch.delete(objectCacheKey, "loaded");
|
|
2308
2309
|
});
|
|
2309
2310
|
}
|
|
@@ -2323,7 +2324,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2323
2324
|
batch.changes.modified.add(this.cacheKey);
|
|
2324
2325
|
}
|
|
2325
2326
|
constructor(store, subject, cacheKey, opts) {
|
|
2326
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
2327
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
|
|
2327
2328
|
msgPrefix: `SpecificLinkQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
2328
2329
|
}) : void 0);
|
|
2329
2330
|
[this.#sourceApiName, this.#sourcePk, this.#linkName, this.#whereClause, this.#orderBy] = cacheKey.otherKeys;
|
|
@@ -2339,7 +2340,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2339
2340
|
type: "object",
|
|
2340
2341
|
apiName: this.#sourceApiName
|
|
2341
2342
|
};
|
|
2342
|
-
const sourceMetadata = await client[
|
|
2343
|
+
const sourceMetadata = await client[chunkVVKEXIIO_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
|
|
2343
2344
|
if (this.#orderBy && Object.keys(this.#orderBy).length > 0) {
|
|
2344
2345
|
const linkDef = sourceMetadata.links?.[this.#linkName];
|
|
2345
2346
|
if (!linkDef?.targetType) {
|
|
@@ -2410,7 +2411,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2410
2411
|
return this.revalidate(true);
|
|
2411
2412
|
} else {
|
|
2412
2413
|
return (async () => {
|
|
2413
|
-
const sourceMetadata = await this.store.client[
|
|
2414
|
+
const sourceMetadata = await this.store.client[chunkVVKEXIIO_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
|
|
2414
2415
|
const linkDef = sourceMetadata.links?.[this.#linkName];
|
|
2415
2416
|
if (!linkDef || linkDef.targetType !== objectType) return;
|
|
2416
2417
|
const promise = this.revalidate(true);
|
|
@@ -2718,7 +2719,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
2718
2719
|
batch.changes.registerList(this.cacheKey);
|
|
2719
2720
|
}
|
|
2720
2721
|
constructor(store, subject, apiName, cacheKey, opts) {
|
|
2721
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
2722
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
|
|
2722
2723
|
msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
2723
2724
|
}) : void 0);
|
|
2724
2725
|
this.apiName = apiName;
|
|
@@ -2756,10 +2757,10 @@ var ListQuery = class extends BaseListQuery {
|
|
|
2756
2757
|
*/
|
|
2757
2758
|
async fetchPageData(signal) {
|
|
2758
2759
|
if (Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
2759
|
-
const wireObjectSet =
|
|
2760
|
+
const wireObjectSet = chunkVVKEXIIO_cjs.getWireObjectSet(this.#objectSet);
|
|
2760
2761
|
const {
|
|
2761
2762
|
resultType
|
|
2762
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
2763
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkVVKEXIIO_cjs.additionalContext], wireObjectSet);
|
|
2763
2764
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#orderBy);
|
|
2764
2765
|
}
|
|
2765
2766
|
const resp = await this.#objectSet.fetchPage({
|
|
@@ -3005,9 +3006,20 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3005
3006
|
async postProcessFetchedData(data) {
|
|
3006
3007
|
return reloadDataAsFullObjects(this.store.client, data);
|
|
3007
3008
|
}
|
|
3009
|
+
createPayload(params) {
|
|
3010
|
+
const resolvedList = params.resolvedData.map((obj) => obj.$as(this.apiName));
|
|
3011
|
+
return {
|
|
3012
|
+
resolvedList,
|
|
3013
|
+
isOptimistic: params.isOptimistic,
|
|
3014
|
+
fetchMore: this.fetchMore,
|
|
3015
|
+
hasMore: this.nextPageToken != null,
|
|
3016
|
+
status: params.status,
|
|
3017
|
+
lastUpdated: params.lastUpdated
|
|
3018
|
+
};
|
|
3019
|
+
}
|
|
3008
3020
|
extractRelevantObjects(changes) {
|
|
3009
3021
|
const matchesApiName = ([, object]) => {
|
|
3010
|
-
return this.apiName in object[
|
|
3022
|
+
return this.apiName in object[chunkZFL7RPT6_cjs.ObjectDefRef].interfaceMap;
|
|
3011
3023
|
};
|
|
3012
3024
|
const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
3013
3025
|
const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
@@ -3026,9 +3038,15 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3026
3038
|
}
|
|
3027
3039
|
};
|
|
3028
3040
|
async function reloadDataAsFullObjects(client, data) {
|
|
3041
|
+
if (data.length === 0) {
|
|
3042
|
+
return data;
|
|
3043
|
+
}
|
|
3029
3044
|
const groups = groupBy__default.default(data, (x) => x.$objectType);
|
|
3030
3045
|
const objectTypeToPrimaryKeyToObject = Object.fromEntries(await Promise.all(Object.entries(groups).map(async ([apiName, objects]) => {
|
|
3031
|
-
const objectDef =
|
|
3046
|
+
const objectDef = await client.fetchMetadata({
|
|
3047
|
+
type: "object",
|
|
3048
|
+
apiName
|
|
3049
|
+
});
|
|
3032
3050
|
const where = {
|
|
3033
3051
|
[objectDef.primaryKeyApiName]: {
|
|
3034
3052
|
$in: objects.map((x) => x.$primaryKey)
|
|
@@ -3037,11 +3055,11 @@ async function reloadDataAsFullObjects(client, data) {
|
|
|
3037
3055
|
const result = await client(objectDef).where(where).fetchPage();
|
|
3038
3056
|
return [apiName, Object.fromEntries(result.data.map((x) => [x.$primaryKey, x]))];
|
|
3039
3057
|
})));
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3058
|
+
return data.map((obj) => {
|
|
3059
|
+
const fullObject = objectTypeToPrimaryKeyToObject[obj.$objectType][obj.$primaryKey];
|
|
3060
|
+
!fullObject ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Could not find object ${obj.$objectType} ${obj.$primaryKey}`) : invariant5__default.default(false) : void 0;
|
|
3061
|
+
return fullObject;
|
|
3043
3062
|
});
|
|
3044
|
-
return data;
|
|
3045
3063
|
}
|
|
3046
3064
|
|
|
3047
3065
|
// src/observable/internal/list/ObjectListQuery.ts
|
|
@@ -3189,8 +3207,8 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3189
3207
|
if (rdpFields.size === 0) {
|
|
3190
3208
|
return value;
|
|
3191
3209
|
}
|
|
3192
|
-
const underlying = value[
|
|
3193
|
-
const objectDef = value[
|
|
3210
|
+
const underlying = value[chunkZFL7RPT6_cjs.UnderlyingOsdkObject];
|
|
3211
|
+
const objectDef = value[chunkZFL7RPT6_cjs.ObjectDefRef];
|
|
3194
3212
|
const newProps = {
|
|
3195
3213
|
$apiName: underlying.$apiName,
|
|
3196
3214
|
$objectType: underlying.$objectType,
|
|
@@ -3202,7 +3220,7 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3202
3220
|
newProps[key] = underlying[key];
|
|
3203
3221
|
}
|
|
3204
3222
|
}
|
|
3205
|
-
return
|
|
3223
|
+
return chunkZFL7RPT6_cjs.createOsdkObject(value[chunkZFL7RPT6_cjs.ClientRef], objectDef, newProps);
|
|
3206
3224
|
}
|
|
3207
3225
|
function isSuperset(superset, subset) {
|
|
3208
3226
|
for (const field of subset) {
|
|
@@ -3213,8 +3231,8 @@ function isSuperset(superset, subset) {
|
|
|
3213
3231
|
return true;
|
|
3214
3232
|
}
|
|
3215
3233
|
function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
3216
|
-
const underlying = value[
|
|
3217
|
-
const objectDef = value[
|
|
3234
|
+
const underlying = value[chunkZFL7RPT6_cjs.UnderlyingOsdkObject];
|
|
3235
|
+
const objectDef = value[chunkZFL7RPT6_cjs.ObjectDefRef];
|
|
3218
3236
|
const newProps = {
|
|
3219
3237
|
$apiName: underlying.$apiName,
|
|
3220
3238
|
$objectType: underlying.$objectType,
|
|
@@ -3229,7 +3247,7 @@ function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
|
3229
3247
|
}
|
|
3230
3248
|
}
|
|
3231
3249
|
}
|
|
3232
|
-
return
|
|
3250
|
+
return chunkZFL7RPT6_cjs.createOsdkObject(value[chunkZFL7RPT6_cjs.ClientRef], objectDef, newProps);
|
|
3233
3251
|
}
|
|
3234
3252
|
function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, targetCurrentValue) {
|
|
3235
3253
|
if (targetRdpFields.size === 0) {
|
|
@@ -3241,8 +3259,8 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3241
3259
|
}
|
|
3242
3260
|
return filterToRdpFields(sourceValue, targetRdpFields, sourceRdpFields);
|
|
3243
3261
|
}
|
|
3244
|
-
const sourceUnderlying = sourceValue[
|
|
3245
|
-
const objectDef = sourceValue[
|
|
3262
|
+
const sourceUnderlying = sourceValue[chunkZFL7RPT6_cjs.UnderlyingOsdkObject];
|
|
3263
|
+
const objectDef = sourceValue[chunkZFL7RPT6_cjs.ObjectDefRef];
|
|
3246
3264
|
const newProps = {
|
|
3247
3265
|
$apiName: sourceUnderlying.$apiName,
|
|
3248
3266
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3255,14 +3273,14 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3255
3273
|
}
|
|
3256
3274
|
}
|
|
3257
3275
|
if (targetCurrentValue) {
|
|
3258
|
-
const targetUnderlying = targetCurrentValue[
|
|
3276
|
+
const targetUnderlying = targetCurrentValue[chunkZFL7RPT6_cjs.UnderlyingOsdkObject];
|
|
3259
3277
|
for (const field of targetRdpFields) {
|
|
3260
3278
|
if (!sourceRdpFields.has(field) && field in targetUnderlying) {
|
|
3261
3279
|
newProps[field] = targetUnderlying[field];
|
|
3262
3280
|
}
|
|
3263
3281
|
}
|
|
3264
3282
|
}
|
|
3265
|
-
return
|
|
3283
|
+
return chunkZFL7RPT6_cjs.createOsdkObject(sourceValue[chunkZFL7RPT6_cjs.ClientRef], objectDef, newProps);
|
|
3266
3284
|
}
|
|
3267
3285
|
|
|
3268
3286
|
// src/observable/internal/object/ObjectCacheKeyRegistry.ts
|
|
@@ -3397,7 +3415,7 @@ var BulkObjectLoader = class {
|
|
|
3397
3415
|
#maxEntries;
|
|
3398
3416
|
constructor(client, maxWait = 25, maxEntries = 100) {
|
|
3399
3417
|
this.#client = client;
|
|
3400
|
-
this.#logger = client[
|
|
3418
|
+
this.#logger = client[chunkVVKEXIIO_cjs.additionalContext].logger;
|
|
3401
3419
|
this.#maxWait = maxWait;
|
|
3402
3420
|
this.#maxEntries = maxEntries;
|
|
3403
3421
|
}
|
|
@@ -3465,7 +3483,7 @@ var ObjectQuery = class extends Query {
|
|
|
3465
3483
|
#apiName;
|
|
3466
3484
|
#pk;
|
|
3467
3485
|
constructor(store, subject, type, pk, cacheKey, opts) {
|
|
3468
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
3486
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
|
|
3469
3487
|
msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
3470
3488
|
}) : void 0);
|
|
3471
3489
|
this.#apiName = type;
|
|
@@ -3544,7 +3562,7 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
3544
3562
|
*/
|
|
3545
3563
|
storeOsdkInstances(values, batch, rdpConfig) {
|
|
3546
3564
|
return values.map((v) => this.getQuery({
|
|
3547
|
-
apiName: v.$apiName,
|
|
3565
|
+
apiName: v.$objectType ?? v.$apiName,
|
|
3548
3566
|
pk: v.$primaryKey
|
|
3549
3567
|
}, rdpConfig).writeToStore(v, "loaded", batch).cacheKey);
|
|
3550
3568
|
}
|
|
@@ -3613,7 +3631,7 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3613
3631
|
#composedObjectSet;
|
|
3614
3632
|
#objectTypes;
|
|
3615
3633
|
constructor(store, subject, baseObjectSetWire, operations, cacheKey, opts) {
|
|
3616
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
3634
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
|
|
3617
3635
|
msgPrefix: `ObjectSetQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
3618
3636
|
}) : void 0);
|
|
3619
3637
|
this.#baseObjectSetWire = baseObjectSetWire;
|
|
@@ -3658,7 +3676,7 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3658
3676
|
}
|
|
3659
3677
|
if (opts.union) {
|
|
3660
3678
|
for (const os of opts.union) {
|
|
3661
|
-
const wire =
|
|
3679
|
+
const wire = chunkVVKEXIIO_cjs.getWireObjectSet(os);
|
|
3662
3680
|
if (wire.type) {
|
|
3663
3681
|
types.add(wire.type);
|
|
3664
3682
|
}
|
|
@@ -3666,7 +3684,7 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3666
3684
|
}
|
|
3667
3685
|
if (opts.intersect) {
|
|
3668
3686
|
for (const os of opts.intersect) {
|
|
3669
|
-
const wire =
|
|
3687
|
+
const wire = chunkVVKEXIIO_cjs.getWireObjectSet(os);
|
|
3670
3688
|
if (wire.type) {
|
|
3671
3689
|
types.add(wire.type);
|
|
3672
3690
|
}
|
|
@@ -3674,7 +3692,7 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3674
3692
|
}
|
|
3675
3693
|
if (opts.subtract) {
|
|
3676
3694
|
for (const os of opts.subtract) {
|
|
3677
|
-
const wire =
|
|
3695
|
+
const wire = chunkVVKEXIIO_cjs.getWireObjectSet(os);
|
|
3678
3696
|
if (wire.type) {
|
|
3679
3697
|
types.add(wire.type);
|
|
3680
3698
|
}
|
|
@@ -3694,10 +3712,10 @@ var ObjectSetQuery = class extends BaseListQuery {
|
|
|
3694
3712
|
*/
|
|
3695
3713
|
async fetchPageData(signal) {
|
|
3696
3714
|
if (this.#operations.orderBy && Object.keys(this.#operations.orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
3697
|
-
const wireObjectSet =
|
|
3715
|
+
const wireObjectSet = chunkVVKEXIIO_cjs.getWireObjectSet(this.#composedObjectSet);
|
|
3698
3716
|
const {
|
|
3699
3717
|
resultType
|
|
3700
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
3718
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkVVKEXIIO_cjs.additionalContext], wireObjectSet);
|
|
3701
3719
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#operations.orderBy);
|
|
3702
3720
|
}
|
|
3703
3721
|
const resp = await this.#composedObjectSet.fetchPage({
|
|
@@ -3762,7 +3780,7 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
3762
3780
|
const {
|
|
3763
3781
|
baseObjectSet
|
|
3764
3782
|
} = options;
|
|
3765
|
-
const baseObjectSetWire = JSON.stringify(
|
|
3783
|
+
const baseObjectSetWire = JSON.stringify(chunkVVKEXIIO_cjs.getWireObjectSet(baseObjectSet));
|
|
3766
3784
|
const operations = this.buildCanonicalizedOperations(options);
|
|
3767
3785
|
const objectSetCacheKey = this.cacheKeys.get("objectSet", baseObjectSetWire, operations);
|
|
3768
3786
|
return this.store.queries.get(objectSetCacheKey, () => {
|
|
@@ -3778,13 +3796,13 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
3778
3796
|
operations.withProperties = Object.keys(options.withProperties).sort();
|
|
3779
3797
|
}
|
|
3780
3798
|
if (options.union && options.union.length > 0) {
|
|
3781
|
-
operations.union = options.union.map((os) => JSON.stringify(
|
|
3799
|
+
operations.union = options.union.map((os) => JSON.stringify(chunkVVKEXIIO_cjs.getWireObjectSet(os)));
|
|
3782
3800
|
}
|
|
3783
3801
|
if (options.intersect && options.intersect.length > 0) {
|
|
3784
|
-
operations.intersect = options.intersect.map((os) => JSON.stringify(
|
|
3802
|
+
operations.intersect = options.intersect.map((os) => JSON.stringify(chunkVVKEXIIO_cjs.getWireObjectSet(os)));
|
|
3785
3803
|
}
|
|
3786
3804
|
if (options.subtract && options.subtract.length > 0) {
|
|
3787
|
-
operations.subtract = options.subtract.map((os) => JSON.stringify(
|
|
3805
|
+
operations.subtract = options.subtract.map((os) => JSON.stringify(chunkVVKEXIIO_cjs.getWireObjectSet(os)));
|
|
3788
3806
|
}
|
|
3789
3807
|
if (options.pivotTo) {
|
|
3790
3808
|
operations.pivotTo = options.pivotTo;
|
|
@@ -3856,7 +3874,7 @@ var RdpCanonicalizer = class extends CachingCanonicalizer {
|
|
|
3856
3874
|
apiName: "__rdp_canonicalizer_holder__"
|
|
3857
3875
|
};
|
|
3858
3876
|
for (const [key, rdpFunction] of Object.entries(rdp)) {
|
|
3859
|
-
const builder =
|
|
3877
|
+
const builder = chunkVVKEXIIO_cjs.createWithPropertiesObjectSet(
|
|
3860
3878
|
objectTypeHolder,
|
|
3861
3879
|
{
|
|
3862
3880
|
type: "methodInput"
|
|
@@ -3907,7 +3925,7 @@ var Store = class {
|
|
|
3907
3925
|
subjects = this.layers.subjects;
|
|
3908
3926
|
// these are hopefully temporary
|
|
3909
3927
|
constructor(client) {
|
|
3910
|
-
this.logger = client[
|
|
3928
|
+
this.logger = client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
|
|
3911
3929
|
msgPrefix: "Store"
|
|
3912
3930
|
});
|
|
3913
3931
|
this.client = client;
|
|
@@ -4180,10 +4198,10 @@ var Store = class {
|
|
|
4180
4198
|
|
|
4181
4199
|
// src/observable/ObservableClient.ts
|
|
4182
4200
|
function createObservableClient(client) {
|
|
4183
|
-
const tweakedClient =
|
|
4184
|
-
...client[
|
|
4185
|
-
fetch: shared_net_fetch.createFetchHeaderMutator(client[
|
|
4186
|
-
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"),
|
|
4201
|
+
const tweakedClient = chunkZFL7RPT6_cjs.createClientFromContext({
|
|
4202
|
+
...client[chunkVVKEXIIO_cjs.additionalContext],
|
|
4203
|
+
fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkVVKEXIIO_cjs.additionalContext].fetch, (headers) => {
|
|
4204
|
+
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkZFL7RPT6_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
|
|
4187
4205
|
return headers;
|
|
4188
4206
|
})
|
|
4189
4207
|
});
|
|
@@ -4227,11 +4245,11 @@ function getOsdkConfig(ontologyRid) {
|
|
|
4227
4245
|
|
|
4228
4246
|
Object.defineProperty(exports, "createClientWithTransaction", {
|
|
4229
4247
|
enumerable: true,
|
|
4230
|
-
get: function () { return
|
|
4248
|
+
get: function () { return chunkZFL7RPT6_cjs.createClientWithTransaction; }
|
|
4231
4249
|
});
|
|
4232
4250
|
Object.defineProperty(exports, "augment", {
|
|
4233
4251
|
enumerable: true,
|
|
4234
|
-
get: function () { return
|
|
4252
|
+
get: function () { return chunkVVKEXIIO_cjs.augment; }
|
|
4235
4253
|
});
|
|
4236
4254
|
exports.computeObjectSetCacheKey = computeObjectSetCacheKey;
|
|
4237
4255
|
exports.createObservableClient = createObservableClient;
|