@salesforce/lds-worker-api 1.308.0 → 1.310.0
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.
|
@@ -1071,4 +1071,4 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
1073
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
1074
|
-
// version: 1.
|
|
1074
|
+
// version: 1.310.0-6f61f12f95
|
|
@@ -4265,7 +4265,7 @@ function withDefaultLuvio(callback) {
|
|
|
4265
4265
|
}
|
|
4266
4266
|
callbacks.push(callback);
|
|
4267
4267
|
}
|
|
4268
|
-
// version: 1.
|
|
4268
|
+
// version: 1.310.0-6f61f12f95
|
|
4269
4269
|
|
|
4270
4270
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4271
4271
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15764,7 +15764,7 @@ function gql(literals, ...subs) {
|
|
|
15764
15764
|
}
|
|
15765
15765
|
return superResult;
|
|
15766
15766
|
}
|
|
15767
|
-
// version: 1.
|
|
15767
|
+
// version: 1.310.0-6f61f12f95
|
|
15768
15768
|
|
|
15769
15769
|
function unwrap(data) {
|
|
15770
15770
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16693,7 +16693,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
16693
16693
|
const { apiFamily, name } = metadata;
|
|
16694
16694
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16695
16695
|
}
|
|
16696
|
-
// version: 1.
|
|
16696
|
+
// version: 1.310.0-6f61f12f95
|
|
16697
16697
|
|
|
16698
16698
|
/**
|
|
16699
16699
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -40966,7 +40966,7 @@ const performUpdateRecordQuickAction_ConfigPropertyMetadata = [
|
|
|
40966
40966
|
generateParamConfigMetadata$2('actionApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
40967
40967
|
generateParamConfigMetadata$2('allowSaveOnDuplicate', false, 2 /* Body */, 1 /* Boolean */),
|
|
40968
40968
|
generateParamConfigMetadata$2('apiName', true, 2 /* Body */, 0 /* String */),
|
|
40969
|
-
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String
|
|
40969
|
+
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String */, false, getRecordId18),
|
|
40970
40970
|
generateParamConfigMetadata$2('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
40971
40971
|
];
|
|
40972
40972
|
const performUpdateRecordQuickAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$8, performUpdateRecordQuickAction_ConfigPropertyMetadata);
|
|
@@ -41012,7 +41012,8 @@ function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
|
|
|
41012
41012
|
if (!untrustedIsObject$2(untrustedConfig)) {
|
|
41013
41013
|
return null;
|
|
41014
41014
|
}
|
|
41015
|
-
const
|
|
41015
|
+
const coercedConfig = coerceConfig$1(untrustedConfig, performUpdateRecordQuickAction_ConfigPropertyMetadata);
|
|
41016
|
+
const config = typeCheckConfig$d(coercedConfig);
|
|
41016
41017
|
if (!areRequiredParametersPresent$1(config, configPropertyNames)) {
|
|
41017
41018
|
return null;
|
|
41018
41019
|
}
|
|
@@ -41086,7 +41087,7 @@ const performQuickAction_ConfigPropertyMetadata = [
|
|
|
41086
41087
|
generateParamConfigMetadata$2('actionApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
41087
41088
|
generateParamConfigMetadata$2('allowSaveOnDuplicate', false, 2 /* Body */, 1 /* Boolean */),
|
|
41088
41089
|
generateParamConfigMetadata$2('apiName', true, 2 /* Body */, 0 /* String */),
|
|
41089
|
-
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String
|
|
41090
|
+
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String */, false, getRecordId18),
|
|
41090
41091
|
generateParamConfigMetadata$2('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
41091
41092
|
];
|
|
41092
41093
|
const performQuickAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$7, performQuickAction_ConfigPropertyMetadata);
|
|
@@ -41132,7 +41133,8 @@ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
|
|
|
41132
41133
|
if (!untrustedIsObject$2(untrustedConfig)) {
|
|
41133
41134
|
return null;
|
|
41134
41135
|
}
|
|
41135
|
-
const
|
|
41136
|
+
const coercedConfig = coerceConfig$1(untrustedConfig, performQuickAction_ConfigPropertyMetadata);
|
|
41137
|
+
const config = typeCheckConfig$c(coercedConfig);
|
|
41136
41138
|
if (!areRequiredParametersPresent$1(config, configPropertyNames)) {
|
|
41137
41139
|
return null;
|
|
41138
41140
|
}
|
|
@@ -44798,7 +44800,7 @@ withDefaultLuvio((luvio) => {
|
|
|
44798
44800
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44799
44801
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44800
44802
|
});
|
|
44801
|
-
// version: 1.
|
|
44803
|
+
// version: 1.310.0-51b4ab090c
|
|
44802
44804
|
|
|
44803
44805
|
var ldsIdempotencyWriteDisabled = {
|
|
44804
44806
|
isOpen: function (e) {
|
|
@@ -50184,7 +50186,8 @@ function buildLuvioOverrideForDraftAdapters(luvio, handler, extractTargetIdFromC
|
|
|
50184
50186
|
resourceRequestCopy.headers[HTTP_HEADER_IDEMPOTENCY_KEY] = uuidv4();
|
|
50185
50187
|
}
|
|
50186
50188
|
// enable return extra fields for record creation and record update http call
|
|
50187
|
-
if (resourceRequest.basePath === '
|
|
50189
|
+
if (typeof resourceRequest.basePath === 'string' &&
|
|
50190
|
+
resourceRequest.basePath.startsWith('/ui-api/records') &&
|
|
50188
50191
|
(resourceRequest.method === 'post' || resourceRequest.method === 'patch')) {
|
|
50189
50192
|
resourceRequestCopy.queryParams = resourceRequestCopy.queryParams || {};
|
|
50190
50193
|
resourceRequestCopy.queryParams['includeFieldsInBody'] = true;
|
|
@@ -51993,10 +51996,49 @@ const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
|
51993
51996
|
const { shift } = Array.prototype;
|
|
51994
51997
|
const { isArray: isArray$2$1, from: from$2 } = Array;
|
|
51995
51998
|
|
|
51999
|
+
/**
|
|
52000
|
+
* Retrieves a denormalized record from the store
|
|
52001
|
+
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52002
|
+
* @param recordKey record key
|
|
52003
|
+
* @param durableStore the durable store
|
|
52004
|
+
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52005
|
+
*/
|
|
52006
|
+
function getDenormalizedRecord(recordKey, durableStore) {
|
|
52007
|
+
return durableStore
|
|
52008
|
+
.getEntries([recordKey], DefaultDurableSegment)
|
|
52009
|
+
.then((entries) => {
|
|
52010
|
+
if (entries === undefined) {
|
|
52011
|
+
return undefined;
|
|
52012
|
+
}
|
|
52013
|
+
const denormalizedEntry = entries[recordKey];
|
|
52014
|
+
if (denormalizedEntry === undefined) {
|
|
52015
|
+
return undefined;
|
|
52016
|
+
}
|
|
52017
|
+
// don't include link information
|
|
52018
|
+
const denormalizedRecord = denormalizedEntry.data;
|
|
52019
|
+
if (isStoreRecordError(denormalizedRecord)) {
|
|
52020
|
+
return undefined;
|
|
52021
|
+
}
|
|
52022
|
+
return denormalizedRecord;
|
|
52023
|
+
});
|
|
52024
|
+
}
|
|
52025
|
+
function isStoreRecordError(storeRecord) {
|
|
52026
|
+
return storeRecord.__type === 'error';
|
|
52027
|
+
}
|
|
52028
|
+
function isDraftFieldPending(field) {
|
|
52029
|
+
return !!(field.__state && field.__state.pending === true);
|
|
52030
|
+
}
|
|
52031
|
+
function isDraftFieldMissing(field) {
|
|
52032
|
+
return !!(field.__state && field.__state.isMissing === true);
|
|
52033
|
+
}
|
|
52034
|
+
|
|
51996
52035
|
function isFieldLink(field) {
|
|
51997
52036
|
const { value } = field;
|
|
51998
52037
|
return value !== null && typeof value === 'object' && value.__ref !== undefined;
|
|
51999
52038
|
}
|
|
52039
|
+
function isPendingOrMissing(field) {
|
|
52040
|
+
return isDraftFieldMissing(field) || isDraftFieldPending(field);
|
|
52041
|
+
}
|
|
52000
52042
|
|
|
52001
52043
|
const RECORD_ENDPOINT_REGEX$1 = /^\/ui-api\/records\/?(([a-zA-Z0-9]+))?$/;
|
|
52002
52044
|
/**
|
|
@@ -52053,12 +52095,12 @@ function getRecordKeyForId(luvio, recordId) {
|
|
|
52053
52095
|
* @param record draft record representation
|
|
52054
52096
|
* @returns flattened record representation
|
|
52055
52097
|
*/
|
|
52056
|
-
function
|
|
52098
|
+
function filterOutReferenceNonScalarFields(record) {
|
|
52057
52099
|
const filteredFields = {};
|
|
52058
52100
|
const fieldNames = keys$5(record.fields);
|
|
52059
52101
|
for (const fieldName of fieldNames) {
|
|
52060
52102
|
const field = record.fields[fieldName];
|
|
52061
|
-
if (isFieldLink(field) === false) {
|
|
52103
|
+
if (isFieldLink(field) === false && isPendingOrMissing(field) === false) {
|
|
52062
52104
|
filteredFields[fieldName] = field;
|
|
52063
52105
|
}
|
|
52064
52106
|
}
|
|
@@ -52072,42 +52114,6 @@ function filterOutReferenceFieldsAndLinks(record) {
|
|
|
52072
52114
|
return filteredRecords;
|
|
52073
52115
|
}
|
|
52074
52116
|
|
|
52075
|
-
/**
|
|
52076
|
-
* Retrieves a denormalized record from the store
|
|
52077
|
-
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52078
|
-
* @param recordKey record key
|
|
52079
|
-
* @param durableStore the durable store
|
|
52080
|
-
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52081
|
-
*/
|
|
52082
|
-
function getDenormalizedRecord(recordKey, durableStore) {
|
|
52083
|
-
return durableStore
|
|
52084
|
-
.getEntries([recordKey], DefaultDurableSegment)
|
|
52085
|
-
.then((entries) => {
|
|
52086
|
-
if (entries === undefined) {
|
|
52087
|
-
return undefined;
|
|
52088
|
-
}
|
|
52089
|
-
const denormalizedEntry = entries[recordKey];
|
|
52090
|
-
if (denormalizedEntry === undefined) {
|
|
52091
|
-
return undefined;
|
|
52092
|
-
}
|
|
52093
|
-
// don't include link information
|
|
52094
|
-
const denormalizedRecord = denormalizedEntry.data;
|
|
52095
|
-
if (isStoreRecordError(denormalizedRecord)) {
|
|
52096
|
-
return undefined;
|
|
52097
|
-
}
|
|
52098
|
-
return denormalizedRecord;
|
|
52099
|
-
});
|
|
52100
|
-
}
|
|
52101
|
-
function isStoreRecordError(storeRecord) {
|
|
52102
|
-
return storeRecord.__type === 'error';
|
|
52103
|
-
}
|
|
52104
|
-
function isDraftFieldPending(field) {
|
|
52105
|
-
return !!(field.__state && field.__state.pending === true);
|
|
52106
|
-
}
|
|
52107
|
-
function isDraftFieldMissing(field) {
|
|
52108
|
-
return !!(field.__state && field.__state.isMissing === true);
|
|
52109
|
-
}
|
|
52110
|
-
|
|
52111
52117
|
/**
|
|
52112
52118
|
* Checks if a resource request is a GET method on the record endpoint
|
|
52113
52119
|
* @param request the resource request
|
|
@@ -52184,7 +52190,7 @@ function getRecordDraftEnvironment(luvio, env, { isDraftId, durableStore }) {
|
|
|
52184
52190
|
}));
|
|
52185
52191
|
}
|
|
52186
52192
|
return Promise.reject(createBadRequestResponse({
|
|
52187
|
-
message: '
|
|
52193
|
+
message: 'Cannot fetch draft-created record from network',
|
|
52188
52194
|
}));
|
|
52189
52195
|
}
|
|
52190
52196
|
// a canonical mapping exists for the draft id passed in, we can create a new resource
|
|
@@ -52691,14 +52697,22 @@ function buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, fie
|
|
|
52691
52697
|
if (fieldInfo !== undefined) {
|
|
52692
52698
|
const { dataType } = fieldInfo;
|
|
52693
52699
|
recordFields[fieldName].displayValue = formatDisplayValue(draftField, dataType);
|
|
52700
|
+
// for a DateTime field, we are going to convert the string to an ISOString value.
|
|
52694
52701
|
if (dataType === 'DateTime' &&
|
|
52695
52702
|
draftField !== null &&
|
|
52696
52703
|
typeof draftField === 'string') {
|
|
52697
|
-
|
|
52698
|
-
|
|
52704
|
+
// if it is empty string, then convert it to null.
|
|
52705
|
+
if (draftField === '') {
|
|
52706
|
+
recordFields[fieldName].value = null;
|
|
52699
52707
|
}
|
|
52700
|
-
|
|
52701
|
-
|
|
52708
|
+
else {
|
|
52709
|
+
// attempt to convert it to ISO string value
|
|
52710
|
+
try {
|
|
52711
|
+
recordFields[fieldName].value = new Date(draftField).toISOString();
|
|
52712
|
+
}
|
|
52713
|
+
catch (e) {
|
|
52714
|
+
throw Error('date field value not valid');
|
|
52715
|
+
}
|
|
52702
52716
|
}
|
|
52703
52717
|
}
|
|
52704
52718
|
}
|
|
@@ -53145,7 +53159,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
53145
53159
|
if (recordWithDrafts === undefined) {
|
|
53146
53160
|
return undefined;
|
|
53147
53161
|
}
|
|
53148
|
-
return
|
|
53162
|
+
return filterOutReferenceNonScalarFields(recordWithDrafts);
|
|
53149
53163
|
}
|
|
53150
53164
|
const record = await getDenormalizedRecord(key, this.durableStore);
|
|
53151
53165
|
if (record === undefined) {
|
|
@@ -53156,7 +53170,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
53156
53170
|
if (recordWithDrafts === undefined) {
|
|
53157
53171
|
return recordWithDrafts;
|
|
53158
53172
|
}
|
|
53159
|
-
return
|
|
53173
|
+
return filterOutReferenceNonScalarFields(recordWithDrafts);
|
|
53160
53174
|
}
|
|
53161
53175
|
applyDraftsToIncomingData(key, data, draftMetadata, publishData) {
|
|
53162
53176
|
if (draftMetadata === undefined) {
|
|
@@ -54052,9 +54066,9 @@ class ContentDocumentCompositeRepresentationActionHandler extends AbstractResour
|
|
|
54052
54066
|
return undefined;
|
|
54053
54067
|
}
|
|
54054
54068
|
// finally we resolve all references for each record
|
|
54055
|
-
const contentDocResolved = await
|
|
54056
|
-
const contentDocLinkResolved = await
|
|
54057
|
-
const contentVersionResolved = await
|
|
54069
|
+
const contentDocResolved = await filterOutReferenceNonScalarFields(contentDocRecord);
|
|
54070
|
+
const contentDocLinkResolved = await filterOutReferenceNonScalarFields(contentDocLink);
|
|
54071
|
+
const contentVersionResolved = await filterOutReferenceNonScalarFields(contentVersion);
|
|
54058
54072
|
return {
|
|
54059
54073
|
contentDocument: contentDocResolved,
|
|
54060
54074
|
contentDocumentLinks: [contentDocLinkResolved],
|
|
@@ -63926,7 +63940,7 @@ register$1({
|
|
|
63926
63940
|
id: '@salesforce/lds-network-adapter',
|
|
63927
63941
|
instrument: instrument$2,
|
|
63928
63942
|
});
|
|
63929
|
-
// version: 1.
|
|
63943
|
+
// version: 1.310.0-6f61f12f95
|
|
63930
63944
|
|
|
63931
63945
|
const { create: create$3, keys: keys$3 } = Object;
|
|
63932
63946
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -83962,7 +83976,7 @@ register$1({
|
|
|
83962
83976
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
83963
83977
|
instrument: instrument$1,
|
|
83964
83978
|
});
|
|
83965
|
-
// version: 1.
|
|
83979
|
+
// version: 1.310.0-51b4ab090c
|
|
83966
83980
|
|
|
83967
83981
|
// On core the unstable adapters are re-exported with different names,
|
|
83968
83982
|
// we want to match them here.
|
|
@@ -86218,7 +86232,7 @@ withDefaultLuvio((luvio) => {
|
|
|
86218
86232
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
86219
86233
|
graphQLImperative = ldsAdapter;
|
|
86220
86234
|
});
|
|
86221
|
-
// version: 1.
|
|
86235
|
+
// version: 1.310.0-51b4ab090c
|
|
86222
86236
|
|
|
86223
86237
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
86224
86238
|
__proto__: null,
|
|
@@ -86953,7 +86967,7 @@ const callbacks$1 = [];
|
|
|
86953
86967
|
function register(r) {
|
|
86954
86968
|
callbacks$1.forEach((callback) => callback(r));
|
|
86955
86969
|
}
|
|
86956
|
-
// version: 1.
|
|
86970
|
+
// version: 1.310.0-6f61f12f95
|
|
86957
86971
|
|
|
86958
86972
|
/**
|
|
86959
86973
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -91915,4 +91929,4 @@ const { luvio } = getRuntime();
|
|
|
91915
91929
|
setDefaultLuvio({ luvio });
|
|
91916
91930
|
|
|
91917
91931
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
91918
|
-
// version: 1.
|
|
91932
|
+
// version: 1.310.0-6f61f12f95
|
|
@@ -4271,7 +4271,7 @@
|
|
|
4271
4271
|
}
|
|
4272
4272
|
callbacks.push(callback);
|
|
4273
4273
|
}
|
|
4274
|
-
// version: 1.
|
|
4274
|
+
// version: 1.310.0-6f61f12f95
|
|
4275
4275
|
|
|
4276
4276
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4277
4277
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15770,7 +15770,7 @@
|
|
|
15770
15770
|
}
|
|
15771
15771
|
return superResult;
|
|
15772
15772
|
}
|
|
15773
|
-
// version: 1.
|
|
15773
|
+
// version: 1.310.0-6f61f12f95
|
|
15774
15774
|
|
|
15775
15775
|
function unwrap(data) {
|
|
15776
15776
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16699,7 +16699,7 @@
|
|
|
16699
16699
|
const { apiFamily, name } = metadata;
|
|
16700
16700
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16701
16701
|
}
|
|
16702
|
-
// version: 1.
|
|
16702
|
+
// version: 1.310.0-6f61f12f95
|
|
16703
16703
|
|
|
16704
16704
|
/**
|
|
16705
16705
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -40972,7 +40972,7 @@
|
|
|
40972
40972
|
generateParamConfigMetadata$2('actionApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
40973
40973
|
generateParamConfigMetadata$2('allowSaveOnDuplicate', false, 2 /* Body */, 1 /* Boolean */),
|
|
40974
40974
|
generateParamConfigMetadata$2('apiName', true, 2 /* Body */, 0 /* String */),
|
|
40975
|
-
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String
|
|
40975
|
+
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String */, false, getRecordId18),
|
|
40976
40976
|
generateParamConfigMetadata$2('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
40977
40977
|
];
|
|
40978
40978
|
const performUpdateRecordQuickAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$8, performUpdateRecordQuickAction_ConfigPropertyMetadata);
|
|
@@ -41018,7 +41018,8 @@
|
|
|
41018
41018
|
if (!untrustedIsObject$2(untrustedConfig)) {
|
|
41019
41019
|
return null;
|
|
41020
41020
|
}
|
|
41021
|
-
const
|
|
41021
|
+
const coercedConfig = coerceConfig$1(untrustedConfig, performUpdateRecordQuickAction_ConfigPropertyMetadata);
|
|
41022
|
+
const config = typeCheckConfig$d(coercedConfig);
|
|
41022
41023
|
if (!areRequiredParametersPresent$1(config, configPropertyNames)) {
|
|
41023
41024
|
return null;
|
|
41024
41025
|
}
|
|
@@ -41092,7 +41093,7 @@
|
|
|
41092
41093
|
generateParamConfigMetadata$2('actionApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
41093
41094
|
generateParamConfigMetadata$2('allowSaveOnDuplicate', false, 2 /* Body */, 1 /* Boolean */),
|
|
41094
41095
|
generateParamConfigMetadata$2('apiName', true, 2 /* Body */, 0 /* String */),
|
|
41095
|
-
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String
|
|
41096
|
+
generateParamConfigMetadata$2('contextId', false, 2 /* Body */, 0 /* String */, false, getRecordId18),
|
|
41096
41097
|
generateParamConfigMetadata$2('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
41097
41098
|
];
|
|
41098
41099
|
const performQuickAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig$2(adapterName$7, performQuickAction_ConfigPropertyMetadata);
|
|
@@ -41138,7 +41139,8 @@
|
|
|
41138
41139
|
if (!untrustedIsObject$2(untrustedConfig)) {
|
|
41139
41140
|
return null;
|
|
41140
41141
|
}
|
|
41141
|
-
const
|
|
41142
|
+
const coercedConfig = coerceConfig$1(untrustedConfig, performQuickAction_ConfigPropertyMetadata);
|
|
41143
|
+
const config = typeCheckConfig$c(coercedConfig);
|
|
41142
41144
|
if (!areRequiredParametersPresent$1(config, configPropertyNames)) {
|
|
41143
41145
|
return null;
|
|
41144
41146
|
}
|
|
@@ -44804,7 +44806,7 @@
|
|
|
44804
44806
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44805
44807
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44806
44808
|
});
|
|
44807
|
-
// version: 1.
|
|
44809
|
+
// version: 1.310.0-51b4ab090c
|
|
44808
44810
|
|
|
44809
44811
|
var ldsIdempotencyWriteDisabled = {
|
|
44810
44812
|
isOpen: function (e) {
|
|
@@ -50190,7 +50192,8 @@
|
|
|
50190
50192
|
resourceRequestCopy.headers[HTTP_HEADER_IDEMPOTENCY_KEY] = uuidv4();
|
|
50191
50193
|
}
|
|
50192
50194
|
// enable return extra fields for record creation and record update http call
|
|
50193
|
-
if (resourceRequest.basePath === '
|
|
50195
|
+
if (typeof resourceRequest.basePath === 'string' &&
|
|
50196
|
+
resourceRequest.basePath.startsWith('/ui-api/records') &&
|
|
50194
50197
|
(resourceRequest.method === 'post' || resourceRequest.method === 'patch')) {
|
|
50195
50198
|
resourceRequestCopy.queryParams = resourceRequestCopy.queryParams || {};
|
|
50196
50199
|
resourceRequestCopy.queryParams['includeFieldsInBody'] = true;
|
|
@@ -51999,10 +52002,49 @@
|
|
|
51999
52002
|
const { shift } = Array.prototype;
|
|
52000
52003
|
const { isArray: isArray$2$1, from: from$2 } = Array;
|
|
52001
52004
|
|
|
52005
|
+
/**
|
|
52006
|
+
* Retrieves a denormalized record from the store
|
|
52007
|
+
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52008
|
+
* @param recordKey record key
|
|
52009
|
+
* @param durableStore the durable store
|
|
52010
|
+
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52011
|
+
*/
|
|
52012
|
+
function getDenormalizedRecord(recordKey, durableStore) {
|
|
52013
|
+
return durableStore
|
|
52014
|
+
.getEntries([recordKey], DefaultDurableSegment)
|
|
52015
|
+
.then((entries) => {
|
|
52016
|
+
if (entries === undefined) {
|
|
52017
|
+
return undefined;
|
|
52018
|
+
}
|
|
52019
|
+
const denormalizedEntry = entries[recordKey];
|
|
52020
|
+
if (denormalizedEntry === undefined) {
|
|
52021
|
+
return undefined;
|
|
52022
|
+
}
|
|
52023
|
+
// don't include link information
|
|
52024
|
+
const denormalizedRecord = denormalizedEntry.data;
|
|
52025
|
+
if (isStoreRecordError(denormalizedRecord)) {
|
|
52026
|
+
return undefined;
|
|
52027
|
+
}
|
|
52028
|
+
return denormalizedRecord;
|
|
52029
|
+
});
|
|
52030
|
+
}
|
|
52031
|
+
function isStoreRecordError(storeRecord) {
|
|
52032
|
+
return storeRecord.__type === 'error';
|
|
52033
|
+
}
|
|
52034
|
+
function isDraftFieldPending(field) {
|
|
52035
|
+
return !!(field.__state && field.__state.pending === true);
|
|
52036
|
+
}
|
|
52037
|
+
function isDraftFieldMissing(field) {
|
|
52038
|
+
return !!(field.__state && field.__state.isMissing === true);
|
|
52039
|
+
}
|
|
52040
|
+
|
|
52002
52041
|
function isFieldLink(field) {
|
|
52003
52042
|
const { value } = field;
|
|
52004
52043
|
return value !== null && typeof value === 'object' && value.__ref !== undefined;
|
|
52005
52044
|
}
|
|
52045
|
+
function isPendingOrMissing(field) {
|
|
52046
|
+
return isDraftFieldMissing(field) || isDraftFieldPending(field);
|
|
52047
|
+
}
|
|
52006
52048
|
|
|
52007
52049
|
const RECORD_ENDPOINT_REGEX$1 = /^\/ui-api\/records\/?(([a-zA-Z0-9]+))?$/;
|
|
52008
52050
|
/**
|
|
@@ -52059,12 +52101,12 @@
|
|
|
52059
52101
|
* @param record draft record representation
|
|
52060
52102
|
* @returns flattened record representation
|
|
52061
52103
|
*/
|
|
52062
|
-
function
|
|
52104
|
+
function filterOutReferenceNonScalarFields(record) {
|
|
52063
52105
|
const filteredFields = {};
|
|
52064
52106
|
const fieldNames = keys$5(record.fields);
|
|
52065
52107
|
for (const fieldName of fieldNames) {
|
|
52066
52108
|
const field = record.fields[fieldName];
|
|
52067
|
-
if (isFieldLink(field) === false) {
|
|
52109
|
+
if (isFieldLink(field) === false && isPendingOrMissing(field) === false) {
|
|
52068
52110
|
filteredFields[fieldName] = field;
|
|
52069
52111
|
}
|
|
52070
52112
|
}
|
|
@@ -52078,42 +52120,6 @@
|
|
|
52078
52120
|
return filteredRecords;
|
|
52079
52121
|
}
|
|
52080
52122
|
|
|
52081
|
-
/**
|
|
52082
|
-
* Retrieves a denormalized record from the store
|
|
52083
|
-
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52084
|
-
* @param recordKey record key
|
|
52085
|
-
* @param durableStore the durable store
|
|
52086
|
-
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52087
|
-
*/
|
|
52088
|
-
function getDenormalizedRecord(recordKey, durableStore) {
|
|
52089
|
-
return durableStore
|
|
52090
|
-
.getEntries([recordKey], DefaultDurableSegment)
|
|
52091
|
-
.then((entries) => {
|
|
52092
|
-
if (entries === undefined) {
|
|
52093
|
-
return undefined;
|
|
52094
|
-
}
|
|
52095
|
-
const denormalizedEntry = entries[recordKey];
|
|
52096
|
-
if (denormalizedEntry === undefined) {
|
|
52097
|
-
return undefined;
|
|
52098
|
-
}
|
|
52099
|
-
// don't include link information
|
|
52100
|
-
const denormalizedRecord = denormalizedEntry.data;
|
|
52101
|
-
if (isStoreRecordError(denormalizedRecord)) {
|
|
52102
|
-
return undefined;
|
|
52103
|
-
}
|
|
52104
|
-
return denormalizedRecord;
|
|
52105
|
-
});
|
|
52106
|
-
}
|
|
52107
|
-
function isStoreRecordError(storeRecord) {
|
|
52108
|
-
return storeRecord.__type === 'error';
|
|
52109
|
-
}
|
|
52110
|
-
function isDraftFieldPending(field) {
|
|
52111
|
-
return !!(field.__state && field.__state.pending === true);
|
|
52112
|
-
}
|
|
52113
|
-
function isDraftFieldMissing(field) {
|
|
52114
|
-
return !!(field.__state && field.__state.isMissing === true);
|
|
52115
|
-
}
|
|
52116
|
-
|
|
52117
52123
|
/**
|
|
52118
52124
|
* Checks if a resource request is a GET method on the record endpoint
|
|
52119
52125
|
* @param request the resource request
|
|
@@ -52190,7 +52196,7 @@
|
|
|
52190
52196
|
}));
|
|
52191
52197
|
}
|
|
52192
52198
|
return Promise.reject(createBadRequestResponse({
|
|
52193
|
-
message: '
|
|
52199
|
+
message: 'Cannot fetch draft-created record from network',
|
|
52194
52200
|
}));
|
|
52195
52201
|
}
|
|
52196
52202
|
// a canonical mapping exists for the draft id passed in, we can create a new resource
|
|
@@ -52697,14 +52703,22 @@
|
|
|
52697
52703
|
if (fieldInfo !== undefined) {
|
|
52698
52704
|
const { dataType } = fieldInfo;
|
|
52699
52705
|
recordFields[fieldName].displayValue = formatDisplayValue(draftField, dataType);
|
|
52706
|
+
// for a DateTime field, we are going to convert the string to an ISOString value.
|
|
52700
52707
|
if (dataType === 'DateTime' &&
|
|
52701
52708
|
draftField !== null &&
|
|
52702
52709
|
typeof draftField === 'string') {
|
|
52703
|
-
|
|
52704
|
-
|
|
52710
|
+
// if it is empty string, then convert it to null.
|
|
52711
|
+
if (draftField === '') {
|
|
52712
|
+
recordFields[fieldName].value = null;
|
|
52705
52713
|
}
|
|
52706
|
-
|
|
52707
|
-
|
|
52714
|
+
else {
|
|
52715
|
+
// attempt to convert it to ISO string value
|
|
52716
|
+
try {
|
|
52717
|
+
recordFields[fieldName].value = new Date(draftField).toISOString();
|
|
52718
|
+
}
|
|
52719
|
+
catch (e) {
|
|
52720
|
+
throw Error('date field value not valid');
|
|
52721
|
+
}
|
|
52708
52722
|
}
|
|
52709
52723
|
}
|
|
52710
52724
|
}
|
|
@@ -53151,7 +53165,7 @@
|
|
|
53151
53165
|
if (recordWithDrafts === undefined) {
|
|
53152
53166
|
return undefined;
|
|
53153
53167
|
}
|
|
53154
|
-
return
|
|
53168
|
+
return filterOutReferenceNonScalarFields(recordWithDrafts);
|
|
53155
53169
|
}
|
|
53156
53170
|
const record = await getDenormalizedRecord(key, this.durableStore);
|
|
53157
53171
|
if (record === undefined) {
|
|
@@ -53162,7 +53176,7 @@
|
|
|
53162
53176
|
if (recordWithDrafts === undefined) {
|
|
53163
53177
|
return recordWithDrafts;
|
|
53164
53178
|
}
|
|
53165
|
-
return
|
|
53179
|
+
return filterOutReferenceNonScalarFields(recordWithDrafts);
|
|
53166
53180
|
}
|
|
53167
53181
|
applyDraftsToIncomingData(key, data, draftMetadata, publishData) {
|
|
53168
53182
|
if (draftMetadata === undefined) {
|
|
@@ -54058,9 +54072,9 @@
|
|
|
54058
54072
|
return undefined;
|
|
54059
54073
|
}
|
|
54060
54074
|
// finally we resolve all references for each record
|
|
54061
|
-
const contentDocResolved = await
|
|
54062
|
-
const contentDocLinkResolved = await
|
|
54063
|
-
const contentVersionResolved = await
|
|
54075
|
+
const contentDocResolved = await filterOutReferenceNonScalarFields(contentDocRecord);
|
|
54076
|
+
const contentDocLinkResolved = await filterOutReferenceNonScalarFields(contentDocLink);
|
|
54077
|
+
const contentVersionResolved = await filterOutReferenceNonScalarFields(contentVersion);
|
|
54064
54078
|
return {
|
|
54065
54079
|
contentDocument: contentDocResolved,
|
|
54066
54080
|
contentDocumentLinks: [contentDocLinkResolved],
|
|
@@ -63932,7 +63946,7 @@
|
|
|
63932
63946
|
id: '@salesforce/lds-network-adapter',
|
|
63933
63947
|
instrument: instrument$2,
|
|
63934
63948
|
});
|
|
63935
|
-
// version: 1.
|
|
63949
|
+
// version: 1.310.0-6f61f12f95
|
|
63936
63950
|
|
|
63937
63951
|
const { create: create$3, keys: keys$3 } = Object;
|
|
63938
63952
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -83968,7 +83982,7 @@
|
|
|
83968
83982
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
83969
83983
|
instrument: instrument$1,
|
|
83970
83984
|
});
|
|
83971
|
-
// version: 1.
|
|
83985
|
+
// version: 1.310.0-51b4ab090c
|
|
83972
83986
|
|
|
83973
83987
|
// On core the unstable adapters are re-exported with different names,
|
|
83974
83988
|
// we want to match them here.
|
|
@@ -86224,7 +86238,7 @@
|
|
|
86224
86238
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
86225
86239
|
graphQLImperative = ldsAdapter;
|
|
86226
86240
|
});
|
|
86227
|
-
// version: 1.
|
|
86241
|
+
// version: 1.310.0-51b4ab090c
|
|
86228
86242
|
|
|
86229
86243
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
86230
86244
|
__proto__: null,
|
|
@@ -86959,7 +86973,7 @@
|
|
|
86959
86973
|
function register(r) {
|
|
86960
86974
|
callbacks$1.forEach((callback) => callback(r));
|
|
86961
86975
|
}
|
|
86962
|
-
// version: 1.
|
|
86976
|
+
// version: 1.310.0-6f61f12f95
|
|
86963
86977
|
|
|
86964
86978
|
/**
|
|
86965
86979
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -91940,4 +91954,4 @@
|
|
|
91940
91954
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
91941
91955
|
|
|
91942
91956
|
}));
|
|
91943
|
-
// version: 1.
|
|
91957
|
+
// version: 1.310.0-6f61f12f95
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-worker-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.310.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/standalone/es/lds-worker-api.js",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
|
|
38
|
-
"@salesforce/lds-adapters-graphql": "^1.
|
|
39
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
40
|
-
"@salesforce/lds-default-luvio": "^1.
|
|
41
|
-
"@salesforce/lds-drafts": "^1.
|
|
42
|
-
"@salesforce/lds-graphql-parser": "^1.
|
|
43
|
-
"@salesforce/lds-luvio-engine": "^1.
|
|
44
|
-
"@salesforce/lds-priming": "^1.
|
|
45
|
-
"@salesforce/lds-runtime-mobile": "^1.
|
|
46
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
38
|
+
"@salesforce/lds-adapters-graphql": "^1.310.0",
|
|
39
|
+
"@salesforce/lds-adapters-uiapi": "^1.310.0",
|
|
40
|
+
"@salesforce/lds-default-luvio": "^1.310.0",
|
|
41
|
+
"@salesforce/lds-drafts": "^1.310.0",
|
|
42
|
+
"@salesforce/lds-graphql-parser": "^1.310.0",
|
|
43
|
+
"@salesforce/lds-luvio-engine": "^1.310.0",
|
|
44
|
+
"@salesforce/lds-priming": "^1.310.0",
|
|
45
|
+
"@salesforce/lds-runtime-mobile": "^1.310.0",
|
|
46
|
+
"@salesforce/nimbus-plugin-lds": "^1.310.0",
|
|
47
47
|
"ajv": "^8.11.0",
|
|
48
48
|
"glob": "^7.1.5",
|
|
49
49
|
"nimbus-types": "^2.0.0-alpha1",
|