@salesforce/lds-network-nimbus 1.326.0 → 1.327.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.
package/dist/main.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
import { idleDetector } from 'o11y/client';
|
|
8
8
|
import { HttpStatusCode } from '@luvio/engine';
|
|
9
|
-
import ldsUseShortUrlGate from '@salesforce/gate/lds.useShortUrl';
|
|
10
9
|
|
|
11
10
|
const { keys, create, assign, entries } = Object;
|
|
12
11
|
const { stringify, parse } = JSON;
|
|
@@ -267,7 +266,7 @@ class ScopedFieldsCollection {
|
|
|
267
266
|
* which there max fields list length will not exceeded the specified maxLength
|
|
268
267
|
* @param maxLength
|
|
269
268
|
*/
|
|
270
|
-
split(maxLength =
|
|
269
|
+
split(maxLength = MAX_URL_LENGTH) {
|
|
271
270
|
const size = this.size();
|
|
272
271
|
if (size > maxLength) {
|
|
273
272
|
const fieldsArray = [];
|
|
@@ -354,7 +353,6 @@ class ScopedFieldsCollection {
|
|
|
354
353
|
}
|
|
355
354
|
}
|
|
356
355
|
|
|
357
|
-
const MAX_STRING_LENGTH_PER_CHUNK = 10000;
|
|
358
356
|
//Salesforce/Akamai cdn uri max size is 8898 bytes, short than normal. Per
|
|
359
357
|
//https://help.salesforce.com/s/articleView?id=sf.community_builder_cdn_considerations.htm&type=5
|
|
360
358
|
//Due to we don't know the domain ResourceRequest, here we give 8000
|
|
@@ -589,22 +587,18 @@ function arrayOrEmpty(array) {
|
|
|
589
587
|
return array !== undefined && isArray(array) ? array : [];
|
|
590
588
|
}
|
|
591
589
|
/**
|
|
592
|
-
* Calculate the max
|
|
593
|
-
*
|
|
594
|
-
*
|
|
590
|
+
* Calculate the max length per chunk.
|
|
591
|
+
* Max chunk size is MAX_URL_LENGTH - the url without fields and optional fields.
|
|
592
|
+
*
|
|
595
593
|
* @param resourceRequest
|
|
596
594
|
* @returns
|
|
597
595
|
*/
|
|
598
596
|
function getMaxLengthPerChunkAllowed(request) {
|
|
599
|
-
if (!ldsUseShortUrlGate.isOpen({ fallback: false })) {
|
|
600
|
-
return MAX_STRING_LENGTH_PER_CHUNK;
|
|
601
|
-
}
|
|
602
597
|
// Too much work to get exact length of the final url, so use stringified json to get the rough length.
|
|
603
598
|
const roughUrlLengthWithoutFieldsAndOptionFields = request.basePath.length +
|
|
604
599
|
request.baseUri.length +
|
|
605
600
|
(request.urlParams ? stringify(request.urlParams).length : 0) +
|
|
606
601
|
stringify({ ...request.queryParams, fields: {}, optionalFields: {} }).length;
|
|
607
|
-
// MAX_URL_LENGTH - full lenght without fields, optionalFields
|
|
608
602
|
return MAX_URL_LENGTH - roughUrlLengthWithoutFieldsAndOptionFields;
|
|
609
603
|
}
|
|
610
604
|
// we don't have access to the host so we cannot calculate the exact length of the url
|
|
@@ -3,7 +3,6 @@ import { HttpStatusCode } from '@luvio/engine';
|
|
|
3
3
|
import type { RecordRepresentation, BatchRepresentation, RelatedListRecordCollectionRepresentation, RelatedListRecordCollectionBatchRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
4
|
import type { GetRecordResult } from './makeNetworkChunkFieldsGetRecord';
|
|
5
5
|
import { ScopedFieldsCollection } from './ScopedFields';
|
|
6
|
-
export declare const MAX_STRING_LENGTH_PER_CHUNK = 10000;
|
|
7
6
|
export declare const MAX_URL_LENGTH = 8000;
|
|
8
7
|
export interface CompositeRequest {
|
|
9
8
|
url: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-network-nimbus",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.327.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "A nimbus-plugin-based implementation of the Luvio NetworkAdapter.",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@luvio/engine": "0.156.5",
|
|
29
|
-
"@salesforce/lds-instrumentation": "^1.
|
|
29
|
+
"@salesforce/lds-instrumentation": "^1.327.0",
|
|
30
30
|
"o11y": "250.7.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
34
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
33
|
+
"@salesforce/lds-adapters-uiapi": "^1.327.0",
|
|
34
|
+
"@salesforce/nimbus-plugin-lds": "^1.327.0"
|
|
35
35
|
},
|
|
36
36
|
"luvioBundlesize": [
|
|
37
37
|
{
|