@osdk/client 2.8.0-beta.14 → 2.8.0-beta.15
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 +12 -0
- package/build/browser/observable/internal/object/ObjectsHelper.js +22 -1
- package/build/browser/observable/internal/object/ObjectsHelper.js.map +1 -1
- package/build/browser/observable/internal/object/ObjectsHelper.test.js +132 -0
- package/build/browser/observable/internal/object/ObjectsHelper.test.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-4HVAJSMV.cjs → chunk-RTSJQAWK.cjs} +4 -4
- package/build/cjs/{chunk-4HVAJSMV.cjs.map → chunk-RTSJQAWK.cjs.map} +1 -1
- package/build/cjs/index.cjs +7 -7
- package/build/cjs/public/unstable-do-not-use.cjs +34 -19
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/esm/observable/internal/object/ObjectsHelper.js +22 -1
- package/build/esm/observable/internal/object/ObjectsHelper.js.map +1 -1
- package/build/esm/observable/internal/object/ObjectsHelper.test.js +132 -0
- package/build/esm/observable/internal/object/ObjectsHelper.test.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/observable/internal/object/ObjectsHelper.d.ts.map +1 -1
- package/package.json +6 -6
package/build/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRTSJQAWK_cjs = require('./chunk-RTSJQAWK.cjs');
|
|
4
4
|
var chunkQ2XRNNC7_cjs = require('./chunk-Q2XRNNC7.cjs');
|
|
5
5
|
var chunkQPPKY7HT_cjs = require('./chunk-QPPKY7HT.cjs');
|
|
6
6
|
var api = require('@osdk/api');
|
|
@@ -18,7 +18,7 @@ chunkQPPKY7HT_cjs.init_cjs_shims();
|
|
|
18
18
|
// src/createPlatformClient.ts
|
|
19
19
|
chunkQPPKY7HT_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, chunkRTSJQAWK_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 chunkRTSJQAWK_cjs.ActionValidationError; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "createAttachmentUpload", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkRTSJQAWK_cjs.createAttachmentUpload; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "createClient", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkRTSJQAWK_cjs.createClient; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "createObjectSpecifierFromPrimaryKey", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkRTSJQAWK_cjs.createObjectSpecifierFromPrimaryKey; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "extractPrimaryKeyFromObjectSpecifier", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkRTSJQAWK_cjs.extractPrimaryKeyFromObjectSpecifier; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "getWireObjectSet", {
|
|
67
67
|
enumerable: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRTSJQAWK_cjs = require('../chunk-RTSJQAWK.cjs');
|
|
4
4
|
var chunkQ2XRNNC7_cjs = require('../chunk-Q2XRNNC7.cjs');
|
|
5
5
|
var chunkQPPKY7HT_cjs = require('../chunk-QPPKY7HT.cjs');
|
|
6
6
|
var trie = require('@wry/trie');
|
|
@@ -1551,7 +1551,7 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1551
1551
|
path.push("$:map_end");
|
|
1552
1552
|
return arr;
|
|
1553
1553
|
}
|
|
1554
|
-
if (
|
|
1554
|
+
if (chunkRTSJQAWK_cjs.isObjectSpecifiersObject(value)) {
|
|
1555
1555
|
const objectType = value.$objectType ?? value.$apiName;
|
|
1556
1556
|
path.push("$:osdk", objectType, value.$primaryKey);
|
|
1557
1557
|
return {
|
|
@@ -1680,7 +1680,7 @@ var FunctionQuery = class extends Query {
|
|
|
1680
1680
|
}).debug("calling _fetchAndStore");
|
|
1681
1681
|
}
|
|
1682
1682
|
try {
|
|
1683
|
-
const result = await
|
|
1683
|
+
const result = await chunkRTSJQAWK_cjs.applyQuery(this.store.client[chunkQ2XRNNC7_cjs.additionalContext], this.#queryDef, this.#params);
|
|
1684
1684
|
const executedAt = Date.now();
|
|
1685
1685
|
this.store.batch({}, (batch) => {
|
|
1686
1686
|
this.writeToStore({
|
|
@@ -3496,7 +3496,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3496
3496
|
}
|
|
3497
3497
|
extractRelevantObjects(changes) {
|
|
3498
3498
|
const matchesApiName = ([, object]) => {
|
|
3499
|
-
return this.apiName in object[
|
|
3499
|
+
return this.apiName in object[chunkRTSJQAWK_cjs.ObjectDefRef].interfaceMap;
|
|
3500
3500
|
};
|
|
3501
3501
|
const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
3502
3502
|
const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
@@ -3722,8 +3722,8 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3722
3722
|
if (rdpFields.size === 0) {
|
|
3723
3723
|
return value;
|
|
3724
3724
|
}
|
|
3725
|
-
const underlying = value[
|
|
3726
|
-
const objectDef = value[
|
|
3725
|
+
const underlying = value[chunkRTSJQAWK_cjs.UnderlyingOsdkObject];
|
|
3726
|
+
const objectDef = value[chunkRTSJQAWK_cjs.ObjectDefRef];
|
|
3727
3727
|
const newProps = {
|
|
3728
3728
|
$apiName: underlying.$apiName,
|
|
3729
3729
|
$objectType: underlying.$objectType,
|
|
@@ -3736,7 +3736,7 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3736
3736
|
newProps[key] = underlying[key];
|
|
3737
3737
|
}
|
|
3738
3738
|
}
|
|
3739
|
-
return
|
|
3739
|
+
return chunkRTSJQAWK_cjs.createOsdkObject(value[chunkRTSJQAWK_cjs.ClientRef], objectDef, newProps);
|
|
3740
3740
|
}
|
|
3741
3741
|
function isSuperset(superset, subset) {
|
|
3742
3742
|
for (const field of subset) {
|
|
@@ -3747,8 +3747,8 @@ function isSuperset(superset, subset) {
|
|
|
3747
3747
|
return true;
|
|
3748
3748
|
}
|
|
3749
3749
|
function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
3750
|
-
const underlying = value[
|
|
3751
|
-
const objectDef = value[
|
|
3750
|
+
const underlying = value[chunkRTSJQAWK_cjs.UnderlyingOsdkObject];
|
|
3751
|
+
const objectDef = value[chunkRTSJQAWK_cjs.ObjectDefRef];
|
|
3752
3752
|
const newProps = {
|
|
3753
3753
|
$apiName: underlying.$apiName,
|
|
3754
3754
|
$objectType: underlying.$objectType,
|
|
@@ -3764,7 +3764,7 @@ function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
|
3764
3764
|
}
|
|
3765
3765
|
}
|
|
3766
3766
|
}
|
|
3767
|
-
return
|
|
3767
|
+
return chunkRTSJQAWK_cjs.createOsdkObject(value[chunkRTSJQAWK_cjs.ClientRef], objectDef, newProps);
|
|
3768
3768
|
}
|
|
3769
3769
|
function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, targetCurrentValue) {
|
|
3770
3770
|
if (targetRdpFields.size === 0) {
|
|
@@ -3776,8 +3776,8 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3776
3776
|
}
|
|
3777
3777
|
return filterToRdpFields(sourceValue, targetRdpFields, sourceRdpFields);
|
|
3778
3778
|
}
|
|
3779
|
-
const sourceUnderlying = sourceValue[
|
|
3780
|
-
const objectDef = sourceValue[
|
|
3779
|
+
const sourceUnderlying = sourceValue[chunkRTSJQAWK_cjs.UnderlyingOsdkObject];
|
|
3780
|
+
const objectDef = sourceValue[chunkRTSJQAWK_cjs.ObjectDefRef];
|
|
3781
3781
|
const newProps = {
|
|
3782
3782
|
$apiName: sourceUnderlying.$apiName,
|
|
3783
3783
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3791,7 +3791,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3791
3791
|
}
|
|
3792
3792
|
}
|
|
3793
3793
|
if (targetCurrentValue) {
|
|
3794
|
-
const targetUnderlying = targetCurrentValue[
|
|
3794
|
+
const targetUnderlying = targetCurrentValue[chunkRTSJQAWK_cjs.UnderlyingOsdkObject];
|
|
3795
3795
|
for (const field of targetRdpFields) {
|
|
3796
3796
|
if (field in targetUnderlying) {
|
|
3797
3797
|
if (!sourceRdpFields.has(field) || newProps[field] === void 0) {
|
|
@@ -3800,7 +3800,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3800
3800
|
}
|
|
3801
3801
|
}
|
|
3802
3802
|
}
|
|
3803
|
-
return
|
|
3803
|
+
return chunkRTSJQAWK_cjs.createOsdkObject(sourceValue[chunkRTSJQAWK_cjs.ClientRef], objectDef, newProps);
|
|
3804
3804
|
}
|
|
3805
3805
|
|
|
3806
3806
|
// src/observable/internal/object/ObjectCacheKeyRegistry.ts
|
|
@@ -4163,7 +4163,7 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4163
4163
|
const {
|
|
4164
4164
|
pk
|
|
4165
4165
|
} = options;
|
|
4166
|
-
const defType =
|
|
4166
|
+
const defType = chunkRTSJQAWK_cjs.getDefType(options.apiName);
|
|
4167
4167
|
const objectCacheKey = this.cacheKeys.get("object", apiName, pk, rdpConfig ?? void 0);
|
|
4168
4168
|
return this.store.queries.get(objectCacheKey, () => new ObjectQuery(this.store, this.store.subjects.get(objectCacheKey), apiName, pk, objectCacheKey, {
|
|
4169
4169
|
dedupeInterval: 0
|
|
@@ -4192,7 +4192,22 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4192
4192
|
if (!dataChanged && !statusChanged) {
|
|
4193
4193
|
return;
|
|
4194
4194
|
}
|
|
4195
|
-
|
|
4195
|
+
let valueToWrite = !dataChanged && existing ? existing.value : value;
|
|
4196
|
+
if (valueToWrite !== tombstone && existing?.value && this.isObjectHolder(existing.value)) {
|
|
4197
|
+
const expectedRdpFields = this.store.objectCacheKeyRegistry.getRdpFieldSet(sourceCacheKey);
|
|
4198
|
+
if (expectedRdpFields.size > 0) {
|
|
4199
|
+
const underlying = valueToWrite[chunkRTSJQAWK_cjs.UnderlyingOsdkObject];
|
|
4200
|
+
const actualRdpFields = /* @__PURE__ */ new Set();
|
|
4201
|
+
for (const field of expectedRdpFields) {
|
|
4202
|
+
if (underlying && field in underlying) {
|
|
4203
|
+
actualRdpFields.add(field);
|
|
4204
|
+
}
|
|
4205
|
+
}
|
|
4206
|
+
if (actualRdpFields.size !== expectedRdpFields.size) {
|
|
4207
|
+
valueToWrite = mergeObjectFields(valueToWrite, actualRdpFields, expectedRdpFields, existing.value);
|
|
4208
|
+
}
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4196
4211
|
batch.write(sourceCacheKey, valueToWrite, status);
|
|
4197
4212
|
if (value !== tombstone) {
|
|
4198
4213
|
batch.changes.registerObject(sourceCacheKey, value, !existing);
|
|
@@ -4861,10 +4876,10 @@ var Store = class {
|
|
|
4861
4876
|
|
|
4862
4877
|
// src/observable/ObservableClient.ts
|
|
4863
4878
|
function createObservableClient(client) {
|
|
4864
|
-
const tweakedClient =
|
|
4879
|
+
const tweakedClient = chunkRTSJQAWK_cjs.createClientFromContext({
|
|
4865
4880
|
...client[chunkQ2XRNNC7_cjs.additionalContext],
|
|
4866
4881
|
fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkQ2XRNNC7_cjs.additionalContext].fetch, (headers) => {
|
|
4867
|
-
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"),
|
|
4882
|
+
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkRTSJQAWK_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
|
|
4868
4883
|
return headers;
|
|
4869
4884
|
})
|
|
4870
4885
|
});
|
|
@@ -4908,7 +4923,7 @@ function getOsdkConfig(ontologyRid) {
|
|
|
4908
4923
|
|
|
4909
4924
|
Object.defineProperty(exports, "createClientWithTransaction", {
|
|
4910
4925
|
enumerable: true,
|
|
4911
|
-
get: function () { return
|
|
4926
|
+
get: function () { return chunkRTSJQAWK_cjs.createClientWithTransaction; }
|
|
4912
4927
|
});
|
|
4913
4928
|
Object.defineProperty(exports, "augment", {
|
|
4914
4929
|
enumerable: true,
|