@salesforce/lwc-adapters-uiapi 1.114.2 → 1.114.5
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/dist/main.js +46 -5
- package/package.json +3 -4
package/dist/main.js
CHANGED
|
@@ -12289,15 +12289,24 @@ function createFieldsIngestSuccess$3(params) {
|
|
|
12289
12289
|
|
|
12290
12290
|
function fulfill(existing, incoming) {
|
|
12291
12291
|
// early out if incoming isn't a request only for fields and optionalFields
|
|
12292
|
-
const { queryParams, headers, basePath, baseUri } = incoming;
|
|
12293
|
-
const { basePath: existingBasePath, baseUri: existingBaseUri, headers: existingHeaders, } = existing;
|
|
12292
|
+
const { queryParams, headers, basePath, baseUri, urlParams } = incoming;
|
|
12293
|
+
const { basePath: existingBasePath, baseUri: existingBaseUri, headers: existingHeaders, urlParams: existingUrlParams, } = existing;
|
|
12294
12294
|
const path = `${baseUri}${basePath}`;
|
|
12295
|
-
const existingPath = `${
|
|
12295
|
+
const existingPath = `${existingBaseUri}${existingBasePath}`;
|
|
12296
12296
|
if (queryParams.layoutTypes !== undefined) {
|
|
12297
12297
|
return false;
|
|
12298
12298
|
}
|
|
12299
12299
|
if (existingPath !== path) {
|
|
12300
|
-
|
|
12300
|
+
// W-11964675 - Correlate an incoming single record request to an existing batch record
|
|
12301
|
+
// request requesting the same single record
|
|
12302
|
+
const incomingUrlRecords = getRecordIdsFromUrlParams(urlParams);
|
|
12303
|
+
const existingUrlRecords = getRecordIdsFromUrlParams(existingUrlParams);
|
|
12304
|
+
const batchRequestWithSingleRequest = isSingleBatchRecordRequest(existingUrlParams) &&
|
|
12305
|
+
isSingleRecordRequest(urlParams) &&
|
|
12306
|
+
incomingUrlRecords[0] === existingUrlRecords[0];
|
|
12307
|
+
if (!batchRequestWithSingleRequest) {
|
|
12308
|
+
return false;
|
|
12309
|
+
}
|
|
12301
12310
|
}
|
|
12302
12311
|
const headersKeys = keys(headers);
|
|
12303
12312
|
const headersKeyLength = headersKeys.length;
|
|
@@ -12321,6 +12330,22 @@ function unionFields(fields, optionalFields) {
|
|
|
12321
12330
|
const fieldsArray = isArray(fields) ? fields : [];
|
|
12322
12331
|
const optionalFieldsArray = isArray(optionalFields) ? optionalFields : [];
|
|
12323
12332
|
return [...fieldsArray, ...optionalFieldsArray];
|
|
12333
|
+
}
|
|
12334
|
+
function getRecordIdsFromUrlParams(urlParams) {
|
|
12335
|
+
if (hasOwnProperty.call(urlParams, 'recordId')) {
|
|
12336
|
+
return [urlParams.recordId];
|
|
12337
|
+
}
|
|
12338
|
+
else if (hasOwnProperty.call(urlParams, 'recordIds')) {
|
|
12339
|
+
return urlParams.recordIds;
|
|
12340
|
+
}
|
|
12341
|
+
return [];
|
|
12342
|
+
}
|
|
12343
|
+
function isSingleBatchRecordRequest(urlParams) {
|
|
12344
|
+
return (hasOwnProperty.call(urlParams, 'recordIds') &&
|
|
12345
|
+
urlParams.recordIds.length === 1);
|
|
12346
|
+
}
|
|
12347
|
+
function isSingleRecordRequest(urlParams) {
|
|
12348
|
+
return hasOwnProperty.call(urlParams, 'recordId');
|
|
12324
12349
|
}
|
|
12325
12350
|
|
|
12326
12351
|
const createResourceRequest$14 = function getUiApiRecordsByRecordIdCreateResourceRequest(config) {
|
|
@@ -12636,7 +12661,19 @@ function onResourceError(luvio, config, key, err) {
|
|
|
12636
12661
|
function buildNetworkSnapshot$$(luvio, config, serverRequestCount = 0, options) {
|
|
12637
12662
|
const { request, key, allTrackedFields, resourceParams } = prepareRequest$6(luvio, config);
|
|
12638
12663
|
return luvio.dispatchResourceRequest(request, options).then((response) => {
|
|
12639
|
-
return luvio.handleSuccessResponse(() =>
|
|
12664
|
+
return luvio.handleSuccessResponse(() => {
|
|
12665
|
+
// W-11964675 - Condition to dedupe a very specific set of requests for
|
|
12666
|
+
// Komaci - a batch record request with a single record followed by a single
|
|
12667
|
+
// record request. The fulfill logic sends the same network response, so
|
|
12668
|
+
// there is some TypeScript massaging to extract the RecordRepresentation
|
|
12669
|
+
if (isSingleBatchRecordResponse(response.body)) {
|
|
12670
|
+
let recordResponse = response;
|
|
12671
|
+
recordResponse.body = response.body.results[0]
|
|
12672
|
+
.result;
|
|
12673
|
+
return onResourceSuccess(luvio, config, key, allTrackedFields, recordResponse, serverRequestCount + 1);
|
|
12674
|
+
}
|
|
12675
|
+
return onResourceSuccess(luvio, config, key, allTrackedFields, response, serverRequestCount + 1);
|
|
12676
|
+
}, () => getResponseCacheKeys$X(luvio, resourceParams, response.body));
|
|
12640
12677
|
}, (err) => {
|
|
12641
12678
|
return luvio.handleErrorResponse(() => {
|
|
12642
12679
|
return onResourceError(luvio, config, key, err);
|
|
@@ -12675,6 +12712,10 @@ function buildNetworkSnapshotCachePolicy$P(context, coercedAdapterRequestContext
|
|
|
12675
12712
|
}
|
|
12676
12713
|
function getRecordByFields(luvio, config, requestContext) {
|
|
12677
12714
|
return luvio.applyCachePolicy(requestContext || {}, { config, luvio }, buildCachedSnapshotCachePolicy$O, buildNetworkSnapshotCachePolicy$P);
|
|
12715
|
+
}
|
|
12716
|
+
function isSingleBatchRecordResponse(response) {
|
|
12717
|
+
return (isArray(response.results) &&
|
|
12718
|
+
response.results.length === 1);
|
|
12678
12719
|
}
|
|
12679
12720
|
|
|
12680
12721
|
const VERSION$1Q = "98cce53b8d13b1883d001bbdaab24383";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lwc-adapters-uiapi",
|
|
3
|
-
"version": "1.114.
|
|
3
|
+
"version": "1.114.5",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "UIAPI adapters with LWC bindings",
|
|
6
6
|
"module": "dist/main.js",
|
|
@@ -31,11 +31,10 @@
|
|
|
31
31
|
"clean": "rm -rf dist src/generated"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@salesforce/lds-adapters-uiapi": "^1.114.2"
|
|
34
|
+
"@salesforce/lds-adapters-uiapi": "*"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
37
|
"@luvio/lwc-luvio": "0.137.1",
|
|
39
|
-
"@salesforce/lds-default-luvio": "
|
|
38
|
+
"@salesforce/lds-default-luvio": "*"
|
|
40
39
|
}
|
|
41
40
|
}
|