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