@salesforce/lds-runtime-mobile 1.312.1 → 1.313.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
|
@@ -14939,7 +14939,13 @@ class PrimingSession extends EventEmitter {
|
|
|
14939
14939
|
processFetchedRecords(result, abortController) {
|
|
14940
14940
|
if (result.ok === false) {
|
|
14941
14941
|
const { error } = result;
|
|
14942
|
-
|
|
14942
|
+
let primingError = 'unknown';
|
|
14943
|
+
if (error === 'service-protection-error') {
|
|
14944
|
+
primingError = 'service-protection-error';
|
|
14945
|
+
}
|
|
14946
|
+
else if (error === 'network-error') {
|
|
14947
|
+
primingError = 'service-unavailable';
|
|
14948
|
+
}
|
|
14943
14949
|
this.emit('error', {
|
|
14944
14950
|
ids: result.missingIds,
|
|
14945
14951
|
code: primingError,
|
|
@@ -15075,6 +15081,17 @@ class PrimingSession extends EventEmitter {
|
|
|
15075
15081
|
}
|
|
15076
15082
|
}
|
|
15077
15083
|
|
|
15084
|
+
class PrimingNetworkError extends Error {
|
|
15085
|
+
constructor(message, httpCode) {
|
|
15086
|
+
super(message);
|
|
15087
|
+
this.httpCode = httpCode;
|
|
15088
|
+
}
|
|
15089
|
+
isServiceProtectionError() {
|
|
15090
|
+
// When CSP kicks-in, we get 429/503 errors back - https://salesforce.quip.com/20HZA5BN5xgx
|
|
15091
|
+
return this.httpCode === 429 || this.httpCode === 503;
|
|
15092
|
+
}
|
|
15093
|
+
}
|
|
15094
|
+
|
|
15078
15095
|
const requiredPrefix = `required_`;
|
|
15079
15096
|
const requiredFieldMap = {
|
|
15080
15097
|
ApiName: 'ApiName',
|
|
@@ -15096,12 +15113,22 @@ class RecordLoaderGraphQL {
|
|
|
15096
15113
|
return this.generateFetchResult(rep, batch);
|
|
15097
15114
|
}
|
|
15098
15115
|
catch (e) {
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15116
|
+
if (e instanceof PrimingNetworkError && e.isServiceProtectionError()) {
|
|
15117
|
+
return {
|
|
15118
|
+
ok: false,
|
|
15119
|
+
error: 'service-protection-error',
|
|
15120
|
+
messages: ['Service Protection Error'],
|
|
15121
|
+
missingIds: batch.ids,
|
|
15122
|
+
};
|
|
15123
|
+
}
|
|
15124
|
+
else {
|
|
15125
|
+
return {
|
|
15126
|
+
ok: false,
|
|
15127
|
+
error: 'network-error',
|
|
15128
|
+
messages: ['Network Error'],
|
|
15129
|
+
missingIds: batch.ids,
|
|
15130
|
+
};
|
|
15131
|
+
}
|
|
15105
15132
|
}
|
|
15106
15133
|
}
|
|
15107
15134
|
async batchFetchRecordData(batchs, abortController) {
|
|
@@ -15117,14 +15144,26 @@ class RecordLoaderGraphQL {
|
|
|
15117
15144
|
const missingIds = batchs
|
|
15118
15145
|
.map((batch) => batch.ids)
|
|
15119
15146
|
.reduce((prev, curr) => prev.concat(curr), []);
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
|
|
15126
|
-
|
|
15127
|
-
|
|
15147
|
+
if (e instanceof PrimingNetworkError && e.isServiceProtectionError()) {
|
|
15148
|
+
return [
|
|
15149
|
+
{
|
|
15150
|
+
ok: false,
|
|
15151
|
+
error: 'service-protection-error',
|
|
15152
|
+
messages: [e.message],
|
|
15153
|
+
missingIds,
|
|
15154
|
+
},
|
|
15155
|
+
];
|
|
15156
|
+
}
|
|
15157
|
+
else {
|
|
15158
|
+
return [
|
|
15159
|
+
{
|
|
15160
|
+
ok: false,
|
|
15161
|
+
error: 'network-error',
|
|
15162
|
+
messages: ['Network Error'],
|
|
15163
|
+
missingIds,
|
|
15164
|
+
},
|
|
15165
|
+
];
|
|
15166
|
+
}
|
|
15128
15167
|
}
|
|
15129
15168
|
}
|
|
15130
15169
|
generateFetchResult(repResult, batchInput) {
|
|
@@ -15335,13 +15374,16 @@ class NimbusPrimingNetworkAdapter {
|
|
|
15335
15374
|
body: JSON.stringify({
|
|
15336
15375
|
batchQuery: configs,
|
|
15337
15376
|
}),
|
|
15338
|
-
headers: {
|
|
15377
|
+
headers: {
|
|
15378
|
+
// This header is needed to get back 429/503 error code when CSP kicks-in - https://salesforce.quip.com/20HZA5BN5xgx
|
|
15379
|
+
Cos: '0x04',
|
|
15380
|
+
},
|
|
15339
15381
|
queryParams: {},
|
|
15340
15382
|
priority: 'background',
|
|
15341
15383
|
observabilityContext: {},
|
|
15342
15384
|
}, abortController, (response) => {
|
|
15343
15385
|
if (response.status < 200 || response.status > 299) {
|
|
15344
|
-
reject(new
|
|
15386
|
+
reject(new PrimingNetworkError(response.body || 'Network error', response.status));
|
|
15345
15387
|
return;
|
|
15346
15388
|
}
|
|
15347
15389
|
try {
|
|
@@ -15381,7 +15423,7 @@ class NimbusPrimingNetworkAdapter {
|
|
|
15381
15423
|
observabilityContext: {},
|
|
15382
15424
|
}, abortController, (response) => {
|
|
15383
15425
|
if (response.status < 200 || response.status > 299) {
|
|
15384
|
-
reject(new
|
|
15426
|
+
reject(new PrimingNetworkError(response.body || 'Network error', response.status));
|
|
15385
15427
|
return;
|
|
15386
15428
|
}
|
|
15387
15429
|
try {
|
|
@@ -15413,7 +15455,7 @@ class NimbusPrimingNetworkAdapter {
|
|
|
15413
15455
|
observabilityContext: {},
|
|
15414
15456
|
}, abortController, (response) => {
|
|
15415
15457
|
if (response.status < 200 || response.status > 299) {
|
|
15416
|
-
reject(new
|
|
15458
|
+
reject(new PrimingNetworkError(response.body || 'Network error', response.status));
|
|
15417
15459
|
return;
|
|
15418
15460
|
}
|
|
15419
15461
|
try {
|
|
@@ -15449,7 +15491,7 @@ class NimbusPrimingNetworkAdapter {
|
|
|
15449
15491
|
observabilityContext: {},
|
|
15450
15492
|
}, abortController, (response) => {
|
|
15451
15493
|
if (response.status < 200 || response.status > 299) {
|
|
15452
|
-
reject(new
|
|
15494
|
+
reject(new PrimingNetworkError(response.body || 'Network error', response.status));
|
|
15453
15495
|
return;
|
|
15454
15496
|
}
|
|
15455
15497
|
try {
|
|
@@ -15970,4 +16012,4 @@ register({
|
|
|
15970
16012
|
});
|
|
15971
16013
|
|
|
15972
16014
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
15973
|
-
// version: 1.
|
|
16015
|
+
// version: 1.313.0-bf88d762e3
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PrimingNetworkAdapter } from '@salesforce/lds-priming';
|
|
2
2
|
import type { GraphQLRepresentation, GraphQLInputRepresentation, ObjectInfoRepresentation, ObjectInfoDirectoryRepresentation } from '@salesforce/lds-adapters-uiapi-mobile';
|
|
3
3
|
import type { LdsAbortController } from '@salesforce/lds-utils-adapters';
|
|
4
4
|
export declare class NimbusPrimingNetworkAdapter implements PrimingNetworkAdapter {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-mobile",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.313.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS runtime for mobile/hybrid environments.",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,26 +32,26 @@
|
|
|
32
32
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@salesforce/lds-adapters-uiapi-mobile": "^1.
|
|
36
|
-
"@salesforce/lds-bindings": "^1.
|
|
37
|
-
"@salesforce/lds-instrumentation": "^1.
|
|
38
|
-
"@salesforce/lds-priming": "^1.
|
|
35
|
+
"@salesforce/lds-adapters-uiapi-mobile": "^1.313.0",
|
|
36
|
+
"@salesforce/lds-bindings": "^1.313.0",
|
|
37
|
+
"@salesforce/lds-instrumentation": "^1.313.0",
|
|
38
|
+
"@salesforce/lds-priming": "^1.313.0",
|
|
39
39
|
"@salesforce/user": "0.0.21",
|
|
40
40
|
"o11y": "250.7.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@salesforce/lds-adapters-graphql": "^1.
|
|
44
|
-
"@salesforce/lds-drafts": "^1.
|
|
45
|
-
"@salesforce/lds-drafts-adapters-uiapi": "^1.
|
|
46
|
-
"@salesforce/lds-durable-records": "^1.
|
|
47
|
-
"@salesforce/lds-graphql-local-evaluation": "^1.
|
|
48
|
-
"@salesforce/lds-network-adapter": "^1.
|
|
49
|
-
"@salesforce/lds-network-nimbus": "^1.
|
|
50
|
-
"@salesforce/lds-store-binary": "^1.
|
|
51
|
-
"@salesforce/lds-store-nimbus": "^1.
|
|
52
|
-
"@salesforce/lds-store-sql": "^1.
|
|
53
|
-
"@salesforce/lds-utils-adapters": "^1.
|
|
54
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
43
|
+
"@salesforce/lds-adapters-graphql": "^1.313.0",
|
|
44
|
+
"@salesforce/lds-drafts": "^1.313.0",
|
|
45
|
+
"@salesforce/lds-drafts-adapters-uiapi": "^1.313.0",
|
|
46
|
+
"@salesforce/lds-durable-records": "^1.313.0",
|
|
47
|
+
"@salesforce/lds-graphql-local-evaluation": "^1.313.0",
|
|
48
|
+
"@salesforce/lds-network-adapter": "^1.313.0",
|
|
49
|
+
"@salesforce/lds-network-nimbus": "^1.313.0",
|
|
50
|
+
"@salesforce/lds-store-binary": "^1.313.0",
|
|
51
|
+
"@salesforce/lds-store-nimbus": "^1.313.0",
|
|
52
|
+
"@salesforce/lds-store-sql": "^1.313.0",
|
|
53
|
+
"@salesforce/lds-utils-adapters": "^1.313.0",
|
|
54
|
+
"@salesforce/nimbus-plugin-lds": "^1.313.0",
|
|
55
55
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
56
56
|
"wait-for-expect": "^3.0.2"
|
|
57
57
|
},
|
package/sfdc/main.js
CHANGED
|
@@ -14939,7 +14939,13 @@ class PrimingSession extends EventEmitter {
|
|
|
14939
14939
|
processFetchedRecords(result, abortController) {
|
|
14940
14940
|
if (result.ok === false) {
|
|
14941
14941
|
const { error } = result;
|
|
14942
|
-
|
|
14942
|
+
let primingError = 'unknown';
|
|
14943
|
+
if (error === 'service-protection-error') {
|
|
14944
|
+
primingError = 'service-protection-error';
|
|
14945
|
+
}
|
|
14946
|
+
else if (error === 'network-error') {
|
|
14947
|
+
primingError = 'service-unavailable';
|
|
14948
|
+
}
|
|
14943
14949
|
this.emit('error', {
|
|
14944
14950
|
ids: result.missingIds,
|
|
14945
14951
|
code: primingError,
|
|
@@ -15075,6 +15081,17 @@ class PrimingSession extends EventEmitter {
|
|
|
15075
15081
|
}
|
|
15076
15082
|
}
|
|
15077
15083
|
|
|
15084
|
+
class PrimingNetworkError extends Error {
|
|
15085
|
+
constructor(message, httpCode) {
|
|
15086
|
+
super(message);
|
|
15087
|
+
this.httpCode = httpCode;
|
|
15088
|
+
}
|
|
15089
|
+
isServiceProtectionError() {
|
|
15090
|
+
// When CSP kicks-in, we get 429/503 errors back - https://salesforce.quip.com/20HZA5BN5xgx
|
|
15091
|
+
return this.httpCode === 429 || this.httpCode === 503;
|
|
15092
|
+
}
|
|
15093
|
+
}
|
|
15094
|
+
|
|
15078
15095
|
const requiredPrefix = `required_`;
|
|
15079
15096
|
const requiredFieldMap = {
|
|
15080
15097
|
ApiName: 'ApiName',
|
|
@@ -15096,12 +15113,22 @@ class RecordLoaderGraphQL {
|
|
|
15096
15113
|
return this.generateFetchResult(rep, batch);
|
|
15097
15114
|
}
|
|
15098
15115
|
catch (e) {
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15116
|
+
if (e instanceof PrimingNetworkError && e.isServiceProtectionError()) {
|
|
15117
|
+
return {
|
|
15118
|
+
ok: false,
|
|
15119
|
+
error: 'service-protection-error',
|
|
15120
|
+
messages: ['Service Protection Error'],
|
|
15121
|
+
missingIds: batch.ids,
|
|
15122
|
+
};
|
|
15123
|
+
}
|
|
15124
|
+
else {
|
|
15125
|
+
return {
|
|
15126
|
+
ok: false,
|
|
15127
|
+
error: 'network-error',
|
|
15128
|
+
messages: ['Network Error'],
|
|
15129
|
+
missingIds: batch.ids,
|
|
15130
|
+
};
|
|
15131
|
+
}
|
|
15105
15132
|
}
|
|
15106
15133
|
}
|
|
15107
15134
|
async batchFetchRecordData(batchs, abortController) {
|
|
@@ -15117,14 +15144,26 @@ class RecordLoaderGraphQL {
|
|
|
15117
15144
|
const missingIds = batchs
|
|
15118
15145
|
.map((batch) => batch.ids)
|
|
15119
15146
|
.reduce((prev, curr) => prev.concat(curr), []);
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
|
|
15126
|
-
|
|
15127
|
-
|
|
15147
|
+
if (e instanceof PrimingNetworkError && e.isServiceProtectionError()) {
|
|
15148
|
+
return [
|
|
15149
|
+
{
|
|
15150
|
+
ok: false,
|
|
15151
|
+
error: 'service-protection-error',
|
|
15152
|
+
messages: [e.message],
|
|
15153
|
+
missingIds,
|
|
15154
|
+
},
|
|
15155
|
+
];
|
|
15156
|
+
}
|
|
15157
|
+
else {
|
|
15158
|
+
return [
|
|
15159
|
+
{
|
|
15160
|
+
ok: false,
|
|
15161
|
+
error: 'network-error',
|
|
15162
|
+
messages: ['Network Error'],
|
|
15163
|
+
missingIds,
|
|
15164
|
+
},
|
|
15165
|
+
];
|
|
15166
|
+
}
|
|
15128
15167
|
}
|
|
15129
15168
|
}
|
|
15130
15169
|
generateFetchResult(repResult, batchInput) {
|
|
@@ -15335,13 +15374,16 @@ class NimbusPrimingNetworkAdapter {
|
|
|
15335
15374
|
body: JSON.stringify({
|
|
15336
15375
|
batchQuery: configs,
|
|
15337
15376
|
}),
|
|
15338
|
-
headers: {
|
|
15377
|
+
headers: {
|
|
15378
|
+
// This header is needed to get back 429/503 error code when CSP kicks-in - https://salesforce.quip.com/20HZA5BN5xgx
|
|
15379
|
+
Cos: '0x04',
|
|
15380
|
+
},
|
|
15339
15381
|
queryParams: {},
|
|
15340
15382
|
priority: 'background',
|
|
15341
15383
|
observabilityContext: {},
|
|
15342
15384
|
}, abortController, (response) => {
|
|
15343
15385
|
if (response.status < 200 || response.status > 299) {
|
|
15344
|
-
reject(new
|
|
15386
|
+
reject(new PrimingNetworkError(response.body || 'Network error', response.status));
|
|
15345
15387
|
return;
|
|
15346
15388
|
}
|
|
15347
15389
|
try {
|
|
@@ -15381,7 +15423,7 @@ class NimbusPrimingNetworkAdapter {
|
|
|
15381
15423
|
observabilityContext: {},
|
|
15382
15424
|
}, abortController, (response) => {
|
|
15383
15425
|
if (response.status < 200 || response.status > 299) {
|
|
15384
|
-
reject(new
|
|
15426
|
+
reject(new PrimingNetworkError(response.body || 'Network error', response.status));
|
|
15385
15427
|
return;
|
|
15386
15428
|
}
|
|
15387
15429
|
try {
|
|
@@ -15413,7 +15455,7 @@ class NimbusPrimingNetworkAdapter {
|
|
|
15413
15455
|
observabilityContext: {},
|
|
15414
15456
|
}, abortController, (response) => {
|
|
15415
15457
|
if (response.status < 200 || response.status > 299) {
|
|
15416
|
-
reject(new
|
|
15458
|
+
reject(new PrimingNetworkError(response.body || 'Network error', response.status));
|
|
15417
15459
|
return;
|
|
15418
15460
|
}
|
|
15419
15461
|
try {
|
|
@@ -15449,7 +15491,7 @@ class NimbusPrimingNetworkAdapter {
|
|
|
15449
15491
|
observabilityContext: {},
|
|
15450
15492
|
}, abortController, (response) => {
|
|
15451
15493
|
if (response.status < 200 || response.status > 299) {
|
|
15452
|
-
reject(new
|
|
15494
|
+
reject(new PrimingNetworkError(response.body || 'Network error', response.status));
|
|
15453
15495
|
return;
|
|
15454
15496
|
}
|
|
15455
15497
|
try {
|
|
@@ -15970,4 +16012,4 @@ register({
|
|
|
15970
16012
|
});
|
|
15971
16013
|
|
|
15972
16014
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
15973
|
-
// version: 1.
|
|
16015
|
+
// version: 1.313.0-bf88d762e3
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PrimingNetworkAdapter } from '@salesforce/lds-priming';
|
|
2
2
|
import type { GraphQLRepresentation, GraphQLInputRepresentation, ObjectInfoRepresentation, ObjectInfoDirectoryRepresentation } from '@salesforce/lds-adapters-uiapi-mobile';
|
|
3
3
|
import type { LdsAbortController } from '@salesforce/lds-utils-adapters';
|
|
4
4
|
export declare class NimbusPrimingNetworkAdapter implements PrimingNetworkAdapter {
|