@salesforce/lds-runtime-webruntime 1.434.0 → 1.435.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/ldsWebruntimeOneStoreInit.js +97 -29
- package/package.json +29 -29
|
@@ -3382,7 +3382,7 @@ function buildServiceDescriptor$9(luvio) {
|
|
|
3382
3382
|
},
|
|
3383
3383
|
};
|
|
3384
3384
|
}
|
|
3385
|
-
// version: 1.
|
|
3385
|
+
// version: 1.435.0-5818ce3c48
|
|
3386
3386
|
|
|
3387
3387
|
/**
|
|
3388
3388
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -3408,7 +3408,7 @@ function buildServiceDescriptor$8(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
3408
3408
|
},
|
|
3409
3409
|
};
|
|
3410
3410
|
}
|
|
3411
|
-
// version: 1.
|
|
3411
|
+
// version: 1.435.0-5818ce3c48
|
|
3412
3412
|
|
|
3413
3413
|
/*!
|
|
3414
3414
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -3495,6 +3495,9 @@ function invalidSchemaResponseWithError(error) {
|
|
|
3495
3495
|
return err$1([error]);
|
|
3496
3496
|
}
|
|
3497
3497
|
function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
3498
|
+
return validateJsonSchemaInternal(data, schema, path, document, /* @__PURE__ */ new Map());
|
|
3499
|
+
}
|
|
3500
|
+
function validateJsonSchemaInternal(data, schema, path, document, visited) {
|
|
3498
3501
|
if (schema === true) return validSchemaResponse();
|
|
3499
3502
|
if (schema === false)
|
|
3500
3503
|
return invalidSchemaResponseWithError(
|
|
@@ -3503,22 +3506,22 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
|
3503
3506
|
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
3504
3507
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
3505
3508
|
if ("anyOf" in schema) {
|
|
3506
|
-
errorCollector.append(validateAnyOf(data, schema, path, document));
|
|
3509
|
+
errorCollector.append(validateAnyOf(data, schema, path, document, visited));
|
|
3507
3510
|
} else if ("oneOf" in schema) {
|
|
3508
|
-
errorCollector.append(validateOneOf(data, schema, path, document));
|
|
3511
|
+
errorCollector.append(validateOneOf(data, schema, path, document, visited));
|
|
3509
3512
|
} else if ("allOf" in schema) {
|
|
3510
|
-
errorCollector.append(validateAllOf(data, schema, path, document));
|
|
3513
|
+
errorCollector.append(validateAllOf(data, schema, path, document, visited));
|
|
3511
3514
|
} else if ("not" in schema) {
|
|
3512
|
-
errorCollector.append(validateNot(data, schema, path, document));
|
|
3515
|
+
errorCollector.append(validateNot(data, schema, path, document, visited));
|
|
3513
3516
|
} else if ("$ref" in schema) {
|
|
3514
|
-
errorCollector.append(validateRef(data, schema, path, document));
|
|
3517
|
+
errorCollector.append(validateRef(data, schema, path, document, visited));
|
|
3515
3518
|
} else if ("type" in schema) {
|
|
3516
3519
|
if (schema.type === "object") {
|
|
3517
3520
|
if (dataType !== "object") {
|
|
3518
3521
|
errorCollector.add(incorrectTypeError("object", dataType, path));
|
|
3519
3522
|
} else {
|
|
3520
3523
|
errorCollector.append(
|
|
3521
|
-
validateObject(data, schema, path, document)
|
|
3524
|
+
validateObject(data, schema, path, document, visited)
|
|
3522
3525
|
);
|
|
3523
3526
|
}
|
|
3524
3527
|
} else if (schema.type === "array") {
|
|
@@ -3526,7 +3529,7 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
|
3526
3529
|
errorCollector.add(incorrectTypeError("array", dataType, path));
|
|
3527
3530
|
} else {
|
|
3528
3531
|
errorCollector.append(
|
|
3529
|
-
validateArray(data, schema, path, document)
|
|
3532
|
+
validateArray(data, schema, path, document, visited)
|
|
3530
3533
|
);
|
|
3531
3534
|
}
|
|
3532
3535
|
} else {
|
|
@@ -3543,16 +3546,17 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
|
3543
3546
|
}
|
|
3544
3547
|
return errorCollector.toValidationResponse();
|
|
3545
3548
|
}
|
|
3546
|
-
function validateAnyOf(data, schema, path, document) {
|
|
3549
|
+
function validateAnyOf(data, schema, path, document, visited) {
|
|
3547
3550
|
let isValid = false;
|
|
3548
3551
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
3549
3552
|
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
3550
3553
|
const element = schema.anyOf[i];
|
|
3551
|
-
const validationResponse =
|
|
3554
|
+
const validationResponse = validateJsonSchemaInternal(
|
|
3552
3555
|
data,
|
|
3553
3556
|
element,
|
|
3554
3557
|
`${path}.anyOf[${i}]`,
|
|
3555
|
-
document
|
|
3558
|
+
document,
|
|
3559
|
+
visited
|
|
3556
3560
|
);
|
|
3557
3561
|
if (validationResponse.isOk()) {
|
|
3558
3562
|
isValid = true;
|
|
@@ -3569,13 +3573,22 @@ function validateAnyOf(data, schema, path, document) {
|
|
|
3569
3573
|
}
|
|
3570
3574
|
return validSchemaResponse();
|
|
3571
3575
|
}
|
|
3572
|
-
function validateOneOf(data, schema, path, document) {
|
|
3576
|
+
function validateOneOf(data, schema, path, document, visited) {
|
|
3577
|
+
if (schema.discriminator !== void 0) {
|
|
3578
|
+
return validateDiscriminatedOneOf(data, schema.discriminator, path, document, visited);
|
|
3579
|
+
}
|
|
3573
3580
|
let validSubShemaPaths = [];
|
|
3574
3581
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
3575
3582
|
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
3576
3583
|
const element = schema.oneOf[i];
|
|
3577
3584
|
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
3578
|
-
const validationResponse =
|
|
3585
|
+
const validationResponse = validateJsonSchemaInternal(
|
|
3586
|
+
data,
|
|
3587
|
+
element,
|
|
3588
|
+
oneOfPath,
|
|
3589
|
+
document,
|
|
3590
|
+
visited
|
|
3591
|
+
);
|
|
3579
3592
|
if (validationResponse.isOk()) {
|
|
3580
3593
|
validSubShemaPaths.push(oneOfPath);
|
|
3581
3594
|
} else {
|
|
@@ -3597,16 +3610,45 @@ function validateOneOf(data, schema, path, document) {
|
|
|
3597
3610
|
}
|
|
3598
3611
|
return validSchemaResponse();
|
|
3599
3612
|
}
|
|
3600
|
-
function
|
|
3613
|
+
function validateDiscriminatedOneOf(data, discriminator, path, document, visited) {
|
|
3614
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
3615
|
+
return invalidSchemaResponseWithError(incorrectTypeError("object", typeof data, path));
|
|
3616
|
+
}
|
|
3617
|
+
const { propertyName, mapping } = discriminator;
|
|
3618
|
+
const discriminatorValue = data[propertyName];
|
|
3619
|
+
if (discriminatorValue === void 0) {
|
|
3620
|
+
return invalidSchemaResponseWithError(
|
|
3621
|
+
new MissingRequiredPropertyError(
|
|
3622
|
+
`Object at path '${path}' is missing required discriminator property '${propertyName}'.`
|
|
3623
|
+
)
|
|
3624
|
+
);
|
|
3625
|
+
}
|
|
3626
|
+
if (typeof discriminatorValue !== "string") {
|
|
3627
|
+
return invalidSchemaResponseWithError(
|
|
3628
|
+
incorrectTypeError("string", typeof discriminatorValue, `${path}.${propertyName}`)
|
|
3629
|
+
);
|
|
3630
|
+
}
|
|
3631
|
+
const targetRef = mapping[discriminatorValue];
|
|
3632
|
+
if (targetRef === void 0) {
|
|
3633
|
+
return invalidSchemaResponseWithError(
|
|
3634
|
+
new JsonSchemaViolationError(
|
|
3635
|
+
`Discriminator value '${discriminatorValue}' at '${path}.${propertyName}' is not in the mapping. Expected one of: [${Object.keys(mapping).join(", ")}].`
|
|
3636
|
+
)
|
|
3637
|
+
);
|
|
3638
|
+
}
|
|
3639
|
+
return validateJsonSchemaInternal(data, { $ref: targetRef }, path, document, visited);
|
|
3640
|
+
}
|
|
3641
|
+
function validateAllOf(data, schema, path, document, visited) {
|
|
3601
3642
|
let isValid = true;
|
|
3602
3643
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
3603
3644
|
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
3604
3645
|
const element = schema.allOf[i];
|
|
3605
|
-
const validationResponse =
|
|
3646
|
+
const validationResponse = validateJsonSchemaInternal(
|
|
3606
3647
|
data,
|
|
3607
3648
|
element,
|
|
3608
3649
|
`${path}.allOf[${i}]`,
|
|
3609
|
-
document
|
|
3650
|
+
document,
|
|
3651
|
+
visited
|
|
3610
3652
|
);
|
|
3611
3653
|
if (!validationResponse.isOk()) {
|
|
3612
3654
|
errorCollector.append(validationResponse);
|
|
@@ -3620,8 +3662,14 @@ function validateAllOf(data, schema, path, document) {
|
|
|
3620
3662
|
}
|
|
3621
3663
|
return errorCollector.toValidationResponse();
|
|
3622
3664
|
}
|
|
3623
|
-
function validateNot(data, schema, path, document) {
|
|
3624
|
-
const validationResponse =
|
|
3665
|
+
function validateNot(data, schema, path, document, visited) {
|
|
3666
|
+
const validationResponse = validateJsonSchemaInternal(
|
|
3667
|
+
data,
|
|
3668
|
+
schema.not,
|
|
3669
|
+
path,
|
|
3670
|
+
document,
|
|
3671
|
+
visited
|
|
3672
|
+
);
|
|
3625
3673
|
if (validationResponse.isOk()) {
|
|
3626
3674
|
return invalidSchemaResponseWithError(
|
|
3627
3675
|
new JsonSchemaViolationError(
|
|
@@ -3631,7 +3679,7 @@ function validateNot(data, schema, path, document) {
|
|
|
3631
3679
|
}
|
|
3632
3680
|
return validSchemaResponse();
|
|
3633
3681
|
}
|
|
3634
|
-
function validateObject(data, schema, path, document) {
|
|
3682
|
+
function validateObject(data, schema, path, document, visited) {
|
|
3635
3683
|
const schemaKeys = Object.keys(schema.properties);
|
|
3636
3684
|
const requiredKeys = new Set(schema.required);
|
|
3637
3685
|
const schemaKeySet = new Set(schemaKeys);
|
|
@@ -3639,11 +3687,12 @@ function validateObject(data, schema, path, document) {
|
|
|
3639
3687
|
Object.keys(data).forEach((key) => {
|
|
3640
3688
|
if (!schemaKeySet.has(key)) {
|
|
3641
3689
|
errorCollector.append(
|
|
3642
|
-
|
|
3690
|
+
validateJsonSchemaInternal(
|
|
3643
3691
|
data[key],
|
|
3644
3692
|
schema.additionalProperties,
|
|
3645
3693
|
`${path}.additionalProperties[${key}]`,
|
|
3646
|
-
document
|
|
3694
|
+
document,
|
|
3695
|
+
visited
|
|
3647
3696
|
)
|
|
3648
3697
|
);
|
|
3649
3698
|
}
|
|
@@ -3660,18 +3709,19 @@ function validateObject(data, schema, path, document) {
|
|
|
3660
3709
|
}
|
|
3661
3710
|
if (keyInData) {
|
|
3662
3711
|
errorCollector.append(
|
|
3663
|
-
|
|
3712
|
+
validateJsonSchemaInternal(
|
|
3664
3713
|
data[key],
|
|
3665
3714
|
schema.properties[key],
|
|
3666
3715
|
`${path}.${key}`,
|
|
3667
|
-
document
|
|
3716
|
+
document,
|
|
3717
|
+
visited
|
|
3668
3718
|
)
|
|
3669
3719
|
);
|
|
3670
3720
|
}
|
|
3671
3721
|
}
|
|
3672
3722
|
return errorCollector.toValidationResponse();
|
|
3673
3723
|
}
|
|
3674
|
-
function validateArray(data, schema, path, document) {
|
|
3724
|
+
function validateArray(data, schema, path, document, visited) {
|
|
3675
3725
|
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
3676
3726
|
return invalidSchemaResponseWithError(
|
|
3677
3727
|
new MinItemsViolationError(
|
|
@@ -3689,7 +3739,13 @@ function validateArray(data, schema, path, document) {
|
|
|
3689
3739
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
3690
3740
|
data.forEach(
|
|
3691
3741
|
(element, index) => errorCollector.append(
|
|
3692
|
-
|
|
3742
|
+
validateJsonSchemaInternal(
|
|
3743
|
+
element,
|
|
3744
|
+
schema.items,
|
|
3745
|
+
`${path}[${index}]`,
|
|
3746
|
+
document,
|
|
3747
|
+
visited
|
|
3748
|
+
)
|
|
3693
3749
|
)
|
|
3694
3750
|
);
|
|
3695
3751
|
return errorCollector.toValidationResponse();
|
|
@@ -3724,7 +3780,7 @@ function validateScalar(data, schema, path) {
|
|
|
3724
3780
|
}
|
|
3725
3781
|
return validSchemaResponse();
|
|
3726
3782
|
}
|
|
3727
|
-
function validateRef(data, schema, path, document) {
|
|
3783
|
+
function validateRef(data, schema, path, document, visited) {
|
|
3728
3784
|
if (!schema.$ref.startsWith("#")) {
|
|
3729
3785
|
return invalidSchemaResponseWithError(
|
|
3730
3786
|
new InvalidRefError(
|
|
@@ -3732,11 +3788,23 @@ function validateRef(data, schema, path, document) {
|
|
|
3732
3788
|
)
|
|
3733
3789
|
);
|
|
3734
3790
|
}
|
|
3791
|
+
let refsForData = visited.get(data);
|
|
3792
|
+
if (refsForData !== void 0 && refsForData.has(schema.$ref)) {
|
|
3793
|
+
return validSchemaResponse();
|
|
3794
|
+
}
|
|
3795
|
+
if (refsForData === void 0) {
|
|
3796
|
+
refsForData = /* @__PURE__ */ new Set();
|
|
3797
|
+
visited.set(data, refsForData);
|
|
3798
|
+
}
|
|
3799
|
+
refsForData.add(schema.$ref);
|
|
3735
3800
|
try {
|
|
3736
3801
|
const schemaToValidate = findSchemaAtPath(document, schema.$ref);
|
|
3737
|
-
return
|
|
3802
|
+
return validateJsonSchemaInternal(data, schemaToValidate, path, document, visited);
|
|
3738
3803
|
} catch (e) {
|
|
3739
3804
|
return invalidSchemaResponseWithError(e);
|
|
3805
|
+
} finally {
|
|
3806
|
+
refsForData.delete(schema.$ref);
|
|
3807
|
+
if (refsForData.size === 0) visited.delete(data);
|
|
3740
3808
|
}
|
|
3741
3809
|
}
|
|
3742
3810
|
function validateEnum(data, enumValue, path) {
|
|
@@ -5264,4 +5332,4 @@ withDefaultLuvio((luvio) => {
|
|
|
5264
5332
|
];
|
|
5265
5333
|
setServices(services);
|
|
5266
5334
|
});
|
|
5267
|
-
// version: 1.
|
|
5335
|
+
// version: 1.435.0-5818ce3c48
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-webruntime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.435.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS engine for Webruntime runtime",
|
|
6
6
|
"main": "dist/ldsWebruntimeOneStoreInit.js",
|
|
@@ -35,46 +35,46 @@
|
|
|
35
35
|
"ready": "yarn build && jest --collectCoverage && yarn test:size && yarn release:corejar"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@conduit-client/service-provisioner": "3.19.
|
|
39
|
-
"@conduit-client/tools-core": "3.19.
|
|
38
|
+
"@conduit-client/service-provisioner": "3.19.5",
|
|
39
|
+
"@conduit-client/tools-core": "3.19.5",
|
|
40
40
|
"jwt-encode": "1.0.1"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@conduit-client/command-aura-network": "3.19.
|
|
44
|
-
"@conduit-client/command-aura-normalized-cache-control": "3.19.
|
|
45
|
-
"@conduit-client/command-aura-resource-cache-control": "3.19.
|
|
46
|
-
"@conduit-client/command-fetch-network": "3.19.
|
|
47
|
-
"@conduit-client/command-http-normalized-cache-control": "3.19.
|
|
48
|
-
"@conduit-client/command-ndjson": "3.19.
|
|
49
|
-
"@conduit-client/command-network": "3.19.
|
|
50
|
-
"@conduit-client/command-sse": "3.19.
|
|
51
|
-
"@conduit-client/command-streaming": "3.19.
|
|
52
|
-
"@conduit-client/jwt-manager": "3.19.
|
|
53
|
-
"@conduit-client/service-aura-network": "3.19.
|
|
54
|
-
"@conduit-client/service-bindings-imperative": "3.19.
|
|
55
|
-
"@conduit-client/service-bindings-lwc": "3.19.
|
|
56
|
-
"@conduit-client/service-cache": "3.19.
|
|
57
|
-
"@conduit-client/service-cache-control": "3.19.
|
|
58
|
-
"@conduit-client/service-cache-inclusion-policy": "3.19.
|
|
59
|
-
"@conduit-client/service-fetch-network": "3.19.
|
|
60
|
-
"@conduit-client/service-instrument-command": "3.19.
|
|
61
|
-
"@conduit-client/service-pubsub": "3.19.
|
|
62
|
-
"@conduit-client/service-store": "3.19.
|
|
63
|
-
"@conduit-client/utils": "3.19.
|
|
43
|
+
"@conduit-client/command-aura-network": "3.19.5",
|
|
44
|
+
"@conduit-client/command-aura-normalized-cache-control": "3.19.5",
|
|
45
|
+
"@conduit-client/command-aura-resource-cache-control": "3.19.5",
|
|
46
|
+
"@conduit-client/command-fetch-network": "3.19.5",
|
|
47
|
+
"@conduit-client/command-http-normalized-cache-control": "3.19.5",
|
|
48
|
+
"@conduit-client/command-ndjson": "3.19.5",
|
|
49
|
+
"@conduit-client/command-network": "3.19.5",
|
|
50
|
+
"@conduit-client/command-sse": "3.19.5",
|
|
51
|
+
"@conduit-client/command-streaming": "3.19.5",
|
|
52
|
+
"@conduit-client/jwt-manager": "3.19.5",
|
|
53
|
+
"@conduit-client/service-aura-network": "3.19.5",
|
|
54
|
+
"@conduit-client/service-bindings-imperative": "3.19.5",
|
|
55
|
+
"@conduit-client/service-bindings-lwc": "3.19.5",
|
|
56
|
+
"@conduit-client/service-cache": "3.19.5",
|
|
57
|
+
"@conduit-client/service-cache-control": "3.19.5",
|
|
58
|
+
"@conduit-client/service-cache-inclusion-policy": "3.19.5",
|
|
59
|
+
"@conduit-client/service-fetch-network": "3.19.5",
|
|
60
|
+
"@conduit-client/service-instrument-command": "3.19.5",
|
|
61
|
+
"@conduit-client/service-pubsub": "3.19.5",
|
|
62
|
+
"@conduit-client/service-store": "3.19.5",
|
|
63
|
+
"@conduit-client/utils": "3.19.5",
|
|
64
64
|
"@luvio/network-adapter-composable": "0.160.4",
|
|
65
65
|
"@luvio/network-adapter-fetch": "0.160.4",
|
|
66
66
|
"@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
|
|
67
|
-
"@salesforce/lds-default-luvio": "^1.
|
|
68
|
-
"@salesforce/lds-luvio-service": "^1.
|
|
69
|
-
"@salesforce/lds-luvio-uiapi-records-service": "^1.
|
|
67
|
+
"@salesforce/lds-default-luvio": "^1.435.0",
|
|
68
|
+
"@salesforce/lds-luvio-service": "^1.435.0",
|
|
69
|
+
"@salesforce/lds-luvio-uiapi-records-service": "^1.435.0"
|
|
70
70
|
},
|
|
71
71
|
"luvioBundlesize": [
|
|
72
72
|
{
|
|
73
73
|
"path": "./dist/ldsWebruntimeOneStoreInit.js",
|
|
74
74
|
"maxSize": {
|
|
75
|
-
"none": "
|
|
75
|
+
"none": "163 kB",
|
|
76
76
|
"min": "85 kB",
|
|
77
|
-
"compressed": "25 kB"
|
|
77
|
+
"compressed": "25.5 kB"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
],
|