@salesforce/lds-worker-api 1.428.0-dev1 → 1.428.0-dev11
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.
|
@@ -4280,7 +4280,7 @@
|
|
|
4280
4280
|
}
|
|
4281
4281
|
callbacks.push(callback);
|
|
4282
4282
|
}
|
|
4283
|
-
// version: 1.428.0-
|
|
4283
|
+
// version: 1.428.0-dev11-b4d8cf1aec
|
|
4284
4284
|
|
|
4285
4285
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4286
4286
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -5324,7 +5324,7 @@
|
|
|
5324
5324
|
const { apiFamily, name } = metadata;
|
|
5325
5325
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5326
5326
|
}
|
|
5327
|
-
// version: 1.428.0-
|
|
5327
|
+
// version: 1.428.0-dev11-b4d8cf1aec
|
|
5328
5328
|
|
|
5329
5329
|
function isSupportedEntity(_objectApiName) {
|
|
5330
5330
|
return true;
|
|
@@ -32616,7 +32616,7 @@
|
|
|
32616
32616
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
32617
32617
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
32618
32618
|
});
|
|
32619
|
-
// version: 1.428.0-
|
|
32619
|
+
// version: 1.428.0-dev11-659d2de2fa
|
|
32620
32620
|
|
|
32621
32621
|
var allowUpdatesForNonCachedRecords = {
|
|
32622
32622
|
isOpen: function (e) {
|
|
@@ -95118,6 +95118,7 @@
|
|
|
95118
95118
|
constructor(services) {
|
|
95119
95119
|
super(services);
|
|
95120
95120
|
this.services = services;
|
|
95121
|
+
this.additionalNullResponses = [];
|
|
95121
95122
|
}
|
|
95122
95123
|
fetch() {
|
|
95123
95124
|
try {
|
|
@@ -95126,6 +95127,15 @@
|
|
|
95126
95127
|
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
95127
95128
|
}
|
|
95128
95129
|
}
|
|
95130
|
+
isSemanticNullResponse(response) {
|
|
95131
|
+
return this.additionalNullResponses.includes(response.status);
|
|
95132
|
+
}
|
|
95133
|
+
isProtocolNoBodyStatus(status) {
|
|
95134
|
+
return status === 204 || status === 205;
|
|
95135
|
+
}
|
|
95136
|
+
isUndeclaredNoBodyResponse(response) {
|
|
95137
|
+
return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
|
|
95138
|
+
}
|
|
95129
95139
|
async coerceError(errorResponse) {
|
|
95130
95140
|
return toError(errorResponse.statusText);
|
|
95131
95141
|
}
|
|
@@ -95133,10 +95143,24 @@
|
|
|
95133
95143
|
return response.then(
|
|
95134
95144
|
(response2) => {
|
|
95135
95145
|
if (response2.ok) {
|
|
95136
|
-
|
|
95137
|
-
|
|
95138
|
-
|
|
95139
|
-
|
|
95146
|
+
let resultPromise;
|
|
95147
|
+
if (this.isSemanticNullResponse(response2)) {
|
|
95148
|
+
resultPromise = Promise.resolve(ok$1(null));
|
|
95149
|
+
} else if (this.isUndeclaredNoBodyResponse(response2)) {
|
|
95150
|
+
resultPromise = Promise.resolve(
|
|
95151
|
+
err$1(
|
|
95152
|
+
toError(
|
|
95153
|
+
`Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
|
|
95154
|
+
)
|
|
95155
|
+
)
|
|
95156
|
+
);
|
|
95157
|
+
} else {
|
|
95158
|
+
resultPromise = response2.json().then(
|
|
95159
|
+
(json) => ok$1(json),
|
|
95160
|
+
(reason) => err$1(toError(reason))
|
|
95161
|
+
);
|
|
95162
|
+
}
|
|
95163
|
+
return resultPromise.finally(() => {
|
|
95140
95164
|
try {
|
|
95141
95165
|
this.afterRequestHooks({ statusCode: response2.status });
|
|
95142
95166
|
} catch {
|
|
@@ -95183,6 +95207,7 @@
|
|
|
95183
95207
|
constructor(services) {
|
|
95184
95208
|
super(services);
|
|
95185
95209
|
this.services = services;
|
|
95210
|
+
this.additionalNullResponses = [];
|
|
95186
95211
|
}
|
|
95187
95212
|
requestFromNetwork() {
|
|
95188
95213
|
return this.fetch();
|
|
@@ -95194,6 +95219,15 @@
|
|
|
95194
95219
|
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
95195
95220
|
}
|
|
95196
95221
|
}
|
|
95222
|
+
isSemanticNullResponse(response) {
|
|
95223
|
+
return this.additionalNullResponses.includes(response.status);
|
|
95224
|
+
}
|
|
95225
|
+
isProtocolNoBodyStatus(status) {
|
|
95226
|
+
return status === 204 || status === 205;
|
|
95227
|
+
}
|
|
95228
|
+
isUndeclaredNoBodyResponse(response) {
|
|
95229
|
+
return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
|
|
95230
|
+
}
|
|
95197
95231
|
async coerceError(errorResponse) {
|
|
95198
95232
|
return toError(errorResponse.statusText);
|
|
95199
95233
|
}
|
|
@@ -95204,12 +95238,26 @@
|
|
|
95204
95238
|
return response.then(
|
|
95205
95239
|
(response2) => {
|
|
95206
95240
|
if (response2.ok) {
|
|
95207
|
-
|
|
95208
|
-
|
|
95209
|
-
|
|
95210
|
-
|
|
95211
|
-
|
|
95212
|
-
|
|
95241
|
+
let resultPromise;
|
|
95242
|
+
if (this.isSemanticNullResponse(response2)) {
|
|
95243
|
+
resultPromise = Promise.resolve(ok$1(null));
|
|
95244
|
+
} else if (this.isUndeclaredNoBodyResponse(response2)) {
|
|
95245
|
+
resultPromise = Promise.resolve(
|
|
95246
|
+
err$1(
|
|
95247
|
+
toError(
|
|
95248
|
+
`Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
|
|
95249
|
+
)
|
|
95250
|
+
)
|
|
95251
|
+
);
|
|
95252
|
+
} else {
|
|
95253
|
+
resultPromise = response2.json().then(
|
|
95254
|
+
(json) => {
|
|
95255
|
+
return this.processFetchReturnValue(json);
|
|
95256
|
+
},
|
|
95257
|
+
(reason) => err$1(toError(reason))
|
|
95258
|
+
);
|
|
95259
|
+
}
|
|
95260
|
+
return resultPromise.finally(() => {
|
|
95213
95261
|
try {
|
|
95214
95262
|
this.afterRequestHooks({ statusCode: response2.status });
|
|
95215
95263
|
} catch {
|
|
@@ -96197,7 +96245,7 @@
|
|
|
96197
96245
|
},
|
|
96198
96246
|
};
|
|
96199
96247
|
}
|
|
96200
|
-
// version: 1.428.0-
|
|
96248
|
+
// version: 1.428.0-dev11-659d2de2fa
|
|
96201
96249
|
|
|
96202
96250
|
/**
|
|
96203
96251
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96223,7 +96271,7 @@
|
|
|
96223
96271
|
},
|
|
96224
96272
|
};
|
|
96225
96273
|
}
|
|
96226
|
-
// version: 1.428.0-
|
|
96274
|
+
// version: 1.428.0-dev11-659d2de2fa
|
|
96227
96275
|
|
|
96228
96276
|
/*!
|
|
96229
96277
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96708,6 +96756,9 @@
|
|
|
96708
96756
|
return err$1([error]);
|
|
96709
96757
|
}
|
|
96710
96758
|
function validateJsonSchema$1(data, schema, path = "$", document = schema) {
|
|
96759
|
+
return validateJsonSchemaInternal$1(data, schema, path, document, /* @__PURE__ */ new Map());
|
|
96760
|
+
}
|
|
96761
|
+
function validateJsonSchemaInternal$1(data, schema, path, document, visited) {
|
|
96711
96762
|
if (schema === true) return validSchemaResponse$1();
|
|
96712
96763
|
if (schema === false)
|
|
96713
96764
|
return invalidSchemaResponseWithError$1(
|
|
@@ -96716,22 +96767,22 @@
|
|
|
96716
96767
|
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
96717
96768
|
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
96718
96769
|
if ("anyOf" in schema) {
|
|
96719
|
-
errorCollector.append(validateAnyOf$1(data, schema, path, document));
|
|
96770
|
+
errorCollector.append(validateAnyOf$1(data, schema, path, document, visited));
|
|
96720
96771
|
} else if ("oneOf" in schema) {
|
|
96721
|
-
errorCollector.append(validateOneOf$1(data, schema, path, document));
|
|
96772
|
+
errorCollector.append(validateOneOf$1(data, schema, path, document, visited));
|
|
96722
96773
|
} else if ("allOf" in schema) {
|
|
96723
|
-
errorCollector.append(validateAllOf$1(data, schema, path, document));
|
|
96774
|
+
errorCollector.append(validateAllOf$1(data, schema, path, document, visited));
|
|
96724
96775
|
} else if ("not" in schema) {
|
|
96725
|
-
errorCollector.append(validateNot$1(data, schema, path, document));
|
|
96776
|
+
errorCollector.append(validateNot$1(data, schema, path, document, visited));
|
|
96726
96777
|
} else if ("$ref" in schema) {
|
|
96727
|
-
errorCollector.append(validateRef$1(data, schema, path, document));
|
|
96778
|
+
errorCollector.append(validateRef$1(data, schema, path, document, visited));
|
|
96728
96779
|
} else if ("type" in schema) {
|
|
96729
96780
|
if (schema.type === "object") {
|
|
96730
96781
|
if (dataType !== "object") {
|
|
96731
96782
|
errorCollector.add(incorrectTypeError$1("object", dataType, path));
|
|
96732
96783
|
} else {
|
|
96733
96784
|
errorCollector.append(
|
|
96734
|
-
validateObject$1(data, schema, path, document)
|
|
96785
|
+
validateObject$1(data, schema, path, document, visited)
|
|
96735
96786
|
);
|
|
96736
96787
|
}
|
|
96737
96788
|
} else if (schema.type === "array") {
|
|
@@ -96739,7 +96790,7 @@
|
|
|
96739
96790
|
errorCollector.add(incorrectTypeError$1("array", dataType, path));
|
|
96740
96791
|
} else {
|
|
96741
96792
|
errorCollector.append(
|
|
96742
|
-
validateArray$1(data, schema, path, document)
|
|
96793
|
+
validateArray$1(data, schema, path, document, visited)
|
|
96743
96794
|
);
|
|
96744
96795
|
}
|
|
96745
96796
|
} else {
|
|
@@ -96756,16 +96807,17 @@
|
|
|
96756
96807
|
}
|
|
96757
96808
|
return errorCollector.toValidationResponse();
|
|
96758
96809
|
}
|
|
96759
|
-
function validateAnyOf$1(data, schema, path, document) {
|
|
96810
|
+
function validateAnyOf$1(data, schema, path, document, visited) {
|
|
96760
96811
|
let isValid = false;
|
|
96761
96812
|
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
96762
96813
|
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
96763
96814
|
const element = schema.anyOf[i];
|
|
96764
|
-
const validationResponse =
|
|
96815
|
+
const validationResponse = validateJsonSchemaInternal$1(
|
|
96765
96816
|
data,
|
|
96766
96817
|
element,
|
|
96767
96818
|
`${path}.anyOf[${i}]`,
|
|
96768
|
-
document
|
|
96819
|
+
document,
|
|
96820
|
+
visited
|
|
96769
96821
|
);
|
|
96770
96822
|
if (validationResponse.isOk()) {
|
|
96771
96823
|
isValid = true;
|
|
@@ -96782,13 +96834,22 @@
|
|
|
96782
96834
|
}
|
|
96783
96835
|
return validSchemaResponse$1();
|
|
96784
96836
|
}
|
|
96785
|
-
function validateOneOf$1(data, schema, path, document) {
|
|
96837
|
+
function validateOneOf$1(data, schema, path, document, visited) {
|
|
96838
|
+
if (schema.discriminator !== void 0) {
|
|
96839
|
+
return validateDiscriminatedOneOf$1(data, schema.discriminator, path, document, visited);
|
|
96840
|
+
}
|
|
96786
96841
|
let validSubShemaPaths = [];
|
|
96787
96842
|
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
96788
96843
|
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
96789
96844
|
const element = schema.oneOf[i];
|
|
96790
96845
|
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
96791
|
-
const validationResponse =
|
|
96846
|
+
const validationResponse = validateJsonSchemaInternal$1(
|
|
96847
|
+
data,
|
|
96848
|
+
element,
|
|
96849
|
+
oneOfPath,
|
|
96850
|
+
document,
|
|
96851
|
+
visited
|
|
96852
|
+
);
|
|
96792
96853
|
if (validationResponse.isOk()) {
|
|
96793
96854
|
validSubShemaPaths.push(oneOfPath);
|
|
96794
96855
|
} else {
|
|
@@ -96810,16 +96871,45 @@
|
|
|
96810
96871
|
}
|
|
96811
96872
|
return validSchemaResponse$1();
|
|
96812
96873
|
}
|
|
96813
|
-
function
|
|
96874
|
+
function validateDiscriminatedOneOf$1(data, discriminator, path, document, visited) {
|
|
96875
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
96876
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("object", typeof data, path));
|
|
96877
|
+
}
|
|
96878
|
+
const { propertyName, mapping } = discriminator;
|
|
96879
|
+
const discriminatorValue = data[propertyName];
|
|
96880
|
+
if (discriminatorValue === void 0) {
|
|
96881
|
+
return invalidSchemaResponseWithError$1(
|
|
96882
|
+
new MissingRequiredPropertyError$1(
|
|
96883
|
+
`Object at path '${path}' is missing required discriminator property '${propertyName}'.`
|
|
96884
|
+
)
|
|
96885
|
+
);
|
|
96886
|
+
}
|
|
96887
|
+
if (typeof discriminatorValue !== "string") {
|
|
96888
|
+
return invalidSchemaResponseWithError$1(
|
|
96889
|
+
incorrectTypeError$1("string", typeof discriminatorValue, `${path}.${propertyName}`)
|
|
96890
|
+
);
|
|
96891
|
+
}
|
|
96892
|
+
const targetRef = mapping[discriminatorValue];
|
|
96893
|
+
if (targetRef === void 0) {
|
|
96894
|
+
return invalidSchemaResponseWithError$1(
|
|
96895
|
+
new JsonSchemaViolationError$1(
|
|
96896
|
+
`Discriminator value '${discriminatorValue}' at '${path}.${propertyName}' is not in the mapping. Expected one of: [${Object.keys(mapping).join(", ")}].`
|
|
96897
|
+
)
|
|
96898
|
+
);
|
|
96899
|
+
}
|
|
96900
|
+
return validateJsonSchemaInternal$1(data, { $ref: targetRef }, path, document, visited);
|
|
96901
|
+
}
|
|
96902
|
+
function validateAllOf$1(data, schema, path, document, visited) {
|
|
96814
96903
|
let isValid = true;
|
|
96815
96904
|
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
96816
96905
|
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
96817
96906
|
const element = schema.allOf[i];
|
|
96818
|
-
const validationResponse =
|
|
96907
|
+
const validationResponse = validateJsonSchemaInternal$1(
|
|
96819
96908
|
data,
|
|
96820
96909
|
element,
|
|
96821
96910
|
`${path}.allOf[${i}]`,
|
|
96822
|
-
document
|
|
96911
|
+
document,
|
|
96912
|
+
visited
|
|
96823
96913
|
);
|
|
96824
96914
|
if (!validationResponse.isOk()) {
|
|
96825
96915
|
errorCollector.append(validationResponse);
|
|
@@ -96833,8 +96923,14 @@
|
|
|
96833
96923
|
}
|
|
96834
96924
|
return errorCollector.toValidationResponse();
|
|
96835
96925
|
}
|
|
96836
|
-
function validateNot$1(data, schema, path, document) {
|
|
96837
|
-
const validationResponse =
|
|
96926
|
+
function validateNot$1(data, schema, path, document, visited) {
|
|
96927
|
+
const validationResponse = validateJsonSchemaInternal$1(
|
|
96928
|
+
data,
|
|
96929
|
+
schema.not,
|
|
96930
|
+
path,
|
|
96931
|
+
document,
|
|
96932
|
+
visited
|
|
96933
|
+
);
|
|
96838
96934
|
if (validationResponse.isOk()) {
|
|
96839
96935
|
return invalidSchemaResponseWithError$1(
|
|
96840
96936
|
new JsonSchemaViolationError$1(
|
|
@@ -96844,7 +96940,7 @@
|
|
|
96844
96940
|
}
|
|
96845
96941
|
return validSchemaResponse$1();
|
|
96846
96942
|
}
|
|
96847
|
-
function validateObject$1(data, schema, path, document) {
|
|
96943
|
+
function validateObject$1(data, schema, path, document, visited) {
|
|
96848
96944
|
const schemaKeys = Object.keys(schema.properties);
|
|
96849
96945
|
const requiredKeys = new Set(schema.required);
|
|
96850
96946
|
const schemaKeySet = new Set(schemaKeys);
|
|
@@ -96852,11 +96948,12 @@
|
|
|
96852
96948
|
Object.keys(data).forEach((key) => {
|
|
96853
96949
|
if (!schemaKeySet.has(key)) {
|
|
96854
96950
|
errorCollector.append(
|
|
96855
|
-
|
|
96951
|
+
validateJsonSchemaInternal$1(
|
|
96856
96952
|
data[key],
|
|
96857
96953
|
schema.additionalProperties,
|
|
96858
96954
|
`${path}.additionalProperties[${key}]`,
|
|
96859
|
-
document
|
|
96955
|
+
document,
|
|
96956
|
+
visited
|
|
96860
96957
|
)
|
|
96861
96958
|
);
|
|
96862
96959
|
}
|
|
@@ -96873,18 +96970,19 @@
|
|
|
96873
96970
|
}
|
|
96874
96971
|
if (keyInData) {
|
|
96875
96972
|
errorCollector.append(
|
|
96876
|
-
|
|
96973
|
+
validateJsonSchemaInternal$1(
|
|
96877
96974
|
data[key],
|
|
96878
96975
|
schema.properties[key],
|
|
96879
96976
|
`${path}.${key}`,
|
|
96880
|
-
document
|
|
96977
|
+
document,
|
|
96978
|
+
visited
|
|
96881
96979
|
)
|
|
96882
96980
|
);
|
|
96883
96981
|
}
|
|
96884
96982
|
}
|
|
96885
96983
|
return errorCollector.toValidationResponse();
|
|
96886
96984
|
}
|
|
96887
|
-
function validateArray$1(data, schema, path, document) {
|
|
96985
|
+
function validateArray$1(data, schema, path, document, visited) {
|
|
96888
96986
|
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
96889
96987
|
return invalidSchemaResponseWithError$1(
|
|
96890
96988
|
new MinItemsViolationError$1(
|
|
@@ -96902,7 +97000,13 @@
|
|
|
96902
97000
|
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
96903
97001
|
data.forEach(
|
|
96904
97002
|
(element, index) => errorCollector.append(
|
|
96905
|
-
|
|
97003
|
+
validateJsonSchemaInternal$1(
|
|
97004
|
+
element,
|
|
97005
|
+
schema.items,
|
|
97006
|
+
`${path}[${index}]`,
|
|
97007
|
+
document,
|
|
97008
|
+
visited
|
|
97009
|
+
)
|
|
96906
97010
|
)
|
|
96907
97011
|
);
|
|
96908
97012
|
return errorCollector.toValidationResponse();
|
|
@@ -96937,7 +97041,7 @@
|
|
|
96937
97041
|
}
|
|
96938
97042
|
return validSchemaResponse$1();
|
|
96939
97043
|
}
|
|
96940
|
-
function validateRef$1(data, schema, path, document) {
|
|
97044
|
+
function validateRef$1(data, schema, path, document, visited) {
|
|
96941
97045
|
if (!schema.$ref.startsWith("#")) {
|
|
96942
97046
|
return invalidSchemaResponseWithError$1(
|
|
96943
97047
|
new InvalidRefError$1(
|
|
@@ -96945,11 +97049,23 @@
|
|
|
96945
97049
|
)
|
|
96946
97050
|
);
|
|
96947
97051
|
}
|
|
97052
|
+
let refsForData = visited.get(data);
|
|
97053
|
+
if (refsForData !== void 0 && refsForData.has(schema.$ref)) {
|
|
97054
|
+
return validSchemaResponse$1();
|
|
97055
|
+
}
|
|
97056
|
+
if (refsForData === void 0) {
|
|
97057
|
+
refsForData = /* @__PURE__ */ new Set();
|
|
97058
|
+
visited.set(data, refsForData);
|
|
97059
|
+
}
|
|
97060
|
+
refsForData.add(schema.$ref);
|
|
96948
97061
|
try {
|
|
96949
97062
|
const schemaToValidate = findSchemaAtPath$1(document, schema.$ref);
|
|
96950
|
-
return
|
|
97063
|
+
return validateJsonSchemaInternal$1(data, schemaToValidate, path, document, visited);
|
|
96951
97064
|
} catch (e) {
|
|
96952
97065
|
return invalidSchemaResponseWithError$1(e);
|
|
97066
|
+
} finally {
|
|
97067
|
+
refsForData.delete(schema.$ref);
|
|
97068
|
+
if (refsForData.size === 0) visited.delete(data);
|
|
96953
97069
|
}
|
|
96954
97070
|
}
|
|
96955
97071
|
function validateEnum$1(data, enumValue, path) {
|
|
@@ -98880,7 +98996,7 @@
|
|
|
98880
98996
|
id: '@salesforce/lds-network-adapter',
|
|
98881
98997
|
instrument: instrument$2,
|
|
98882
98998
|
});
|
|
98883
|
-
// version: 1.428.0-
|
|
98999
|
+
// version: 1.428.0-dev11-b4d8cf1aec
|
|
98884
99000
|
|
|
98885
99001
|
const { create: create$2, keys: keys$2 } = Object;
|
|
98886
99002
|
const { stringify, parse } = JSON;
|
|
@@ -98971,6 +99087,9 @@
|
|
|
98971
99087
|
return err$4([error]);
|
|
98972
99088
|
}
|
|
98973
99089
|
function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
99090
|
+
return validateJsonSchemaInternal(data, schema, path, document, /* @__PURE__ */ new Map());
|
|
99091
|
+
}
|
|
99092
|
+
function validateJsonSchemaInternal(data, schema, path, document, visited) {
|
|
98974
99093
|
if (schema === true) return validSchemaResponse();
|
|
98975
99094
|
if (schema === false)
|
|
98976
99095
|
return invalidSchemaResponseWithError(
|
|
@@ -98979,22 +99098,22 @@
|
|
|
98979
99098
|
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
98980
99099
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
98981
99100
|
if ("anyOf" in schema) {
|
|
98982
|
-
errorCollector.append(validateAnyOf(data, schema, path, document));
|
|
99101
|
+
errorCollector.append(validateAnyOf(data, schema, path, document, visited));
|
|
98983
99102
|
} else if ("oneOf" in schema) {
|
|
98984
|
-
errorCollector.append(validateOneOf(data, schema, path, document));
|
|
99103
|
+
errorCollector.append(validateOneOf(data, schema, path, document, visited));
|
|
98985
99104
|
} else if ("allOf" in schema) {
|
|
98986
|
-
errorCollector.append(validateAllOf(data, schema, path, document));
|
|
99105
|
+
errorCollector.append(validateAllOf(data, schema, path, document, visited));
|
|
98987
99106
|
} else if ("not" in schema) {
|
|
98988
|
-
errorCollector.append(validateNot(data, schema, path, document));
|
|
99107
|
+
errorCollector.append(validateNot(data, schema, path, document, visited));
|
|
98989
99108
|
} else if ("$ref" in schema) {
|
|
98990
|
-
errorCollector.append(validateRef(data, schema, path, document));
|
|
99109
|
+
errorCollector.append(validateRef(data, schema, path, document, visited));
|
|
98991
99110
|
} else if ("type" in schema) {
|
|
98992
99111
|
if (schema.type === "object") {
|
|
98993
99112
|
if (dataType !== "object") {
|
|
98994
99113
|
errorCollector.add(incorrectTypeError("object", dataType, path));
|
|
98995
99114
|
} else {
|
|
98996
99115
|
errorCollector.append(
|
|
98997
|
-
validateObject(data, schema, path, document)
|
|
99116
|
+
validateObject(data, schema, path, document, visited)
|
|
98998
99117
|
);
|
|
98999
99118
|
}
|
|
99000
99119
|
} else if (schema.type === "array") {
|
|
@@ -99002,7 +99121,7 @@
|
|
|
99002
99121
|
errorCollector.add(incorrectTypeError("array", dataType, path));
|
|
99003
99122
|
} else {
|
|
99004
99123
|
errorCollector.append(
|
|
99005
|
-
validateArray(data, schema, path, document)
|
|
99124
|
+
validateArray(data, schema, path, document, visited)
|
|
99006
99125
|
);
|
|
99007
99126
|
}
|
|
99008
99127
|
} else {
|
|
@@ -99019,16 +99138,17 @@
|
|
|
99019
99138
|
}
|
|
99020
99139
|
return errorCollector.toValidationResponse();
|
|
99021
99140
|
}
|
|
99022
|
-
function validateAnyOf(data, schema, path, document) {
|
|
99141
|
+
function validateAnyOf(data, schema, path, document, visited) {
|
|
99023
99142
|
let isValid = false;
|
|
99024
99143
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
99025
99144
|
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
99026
99145
|
const element = schema.anyOf[i];
|
|
99027
|
-
const validationResponse =
|
|
99146
|
+
const validationResponse = validateJsonSchemaInternal(
|
|
99028
99147
|
data,
|
|
99029
99148
|
element,
|
|
99030
99149
|
`${path}.anyOf[${i}]`,
|
|
99031
|
-
document
|
|
99150
|
+
document,
|
|
99151
|
+
visited
|
|
99032
99152
|
);
|
|
99033
99153
|
if (validationResponse.isOk()) {
|
|
99034
99154
|
isValid = true;
|
|
@@ -99045,13 +99165,22 @@
|
|
|
99045
99165
|
}
|
|
99046
99166
|
return validSchemaResponse();
|
|
99047
99167
|
}
|
|
99048
|
-
function validateOneOf(data, schema, path, document) {
|
|
99168
|
+
function validateOneOf(data, schema, path, document, visited) {
|
|
99169
|
+
if (schema.discriminator !== void 0) {
|
|
99170
|
+
return validateDiscriminatedOneOf(data, schema.discriminator, path, document, visited);
|
|
99171
|
+
}
|
|
99049
99172
|
let validSubShemaPaths = [];
|
|
99050
99173
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
99051
99174
|
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
99052
99175
|
const element = schema.oneOf[i];
|
|
99053
99176
|
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
99054
|
-
const validationResponse =
|
|
99177
|
+
const validationResponse = validateJsonSchemaInternal(
|
|
99178
|
+
data,
|
|
99179
|
+
element,
|
|
99180
|
+
oneOfPath,
|
|
99181
|
+
document,
|
|
99182
|
+
visited
|
|
99183
|
+
);
|
|
99055
99184
|
if (validationResponse.isOk()) {
|
|
99056
99185
|
validSubShemaPaths.push(oneOfPath);
|
|
99057
99186
|
} else {
|
|
@@ -99073,16 +99202,45 @@
|
|
|
99073
99202
|
}
|
|
99074
99203
|
return validSchemaResponse();
|
|
99075
99204
|
}
|
|
99076
|
-
function
|
|
99205
|
+
function validateDiscriminatedOneOf(data, discriminator, path, document, visited) {
|
|
99206
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
99207
|
+
return invalidSchemaResponseWithError(incorrectTypeError("object", typeof data, path));
|
|
99208
|
+
}
|
|
99209
|
+
const { propertyName, mapping } = discriminator;
|
|
99210
|
+
const discriminatorValue = data[propertyName];
|
|
99211
|
+
if (discriminatorValue === void 0) {
|
|
99212
|
+
return invalidSchemaResponseWithError(
|
|
99213
|
+
new MissingRequiredPropertyError(
|
|
99214
|
+
`Object at path '${path}' is missing required discriminator property '${propertyName}'.`
|
|
99215
|
+
)
|
|
99216
|
+
);
|
|
99217
|
+
}
|
|
99218
|
+
if (typeof discriminatorValue !== "string") {
|
|
99219
|
+
return invalidSchemaResponseWithError(
|
|
99220
|
+
incorrectTypeError("string", typeof discriminatorValue, `${path}.${propertyName}`)
|
|
99221
|
+
);
|
|
99222
|
+
}
|
|
99223
|
+
const targetRef = mapping[discriminatorValue];
|
|
99224
|
+
if (targetRef === void 0) {
|
|
99225
|
+
return invalidSchemaResponseWithError(
|
|
99226
|
+
new JsonSchemaViolationError(
|
|
99227
|
+
`Discriminator value '${discriminatorValue}' at '${path}.${propertyName}' is not in the mapping. Expected one of: [${Object.keys(mapping).join(", ")}].`
|
|
99228
|
+
)
|
|
99229
|
+
);
|
|
99230
|
+
}
|
|
99231
|
+
return validateJsonSchemaInternal(data, { $ref: targetRef }, path, document, visited);
|
|
99232
|
+
}
|
|
99233
|
+
function validateAllOf(data, schema, path, document, visited) {
|
|
99077
99234
|
let isValid = true;
|
|
99078
99235
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
99079
99236
|
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
99080
99237
|
const element = schema.allOf[i];
|
|
99081
|
-
const validationResponse =
|
|
99238
|
+
const validationResponse = validateJsonSchemaInternal(
|
|
99082
99239
|
data,
|
|
99083
99240
|
element,
|
|
99084
99241
|
`${path}.allOf[${i}]`,
|
|
99085
|
-
document
|
|
99242
|
+
document,
|
|
99243
|
+
visited
|
|
99086
99244
|
);
|
|
99087
99245
|
if (!validationResponse.isOk()) {
|
|
99088
99246
|
errorCollector.append(validationResponse);
|
|
@@ -99096,8 +99254,14 @@
|
|
|
99096
99254
|
}
|
|
99097
99255
|
return errorCollector.toValidationResponse();
|
|
99098
99256
|
}
|
|
99099
|
-
function validateNot(data, schema, path, document) {
|
|
99100
|
-
const validationResponse =
|
|
99257
|
+
function validateNot(data, schema, path, document, visited) {
|
|
99258
|
+
const validationResponse = validateJsonSchemaInternal(
|
|
99259
|
+
data,
|
|
99260
|
+
schema.not,
|
|
99261
|
+
path,
|
|
99262
|
+
document,
|
|
99263
|
+
visited
|
|
99264
|
+
);
|
|
99101
99265
|
if (validationResponse.isOk()) {
|
|
99102
99266
|
return invalidSchemaResponseWithError(
|
|
99103
99267
|
new JsonSchemaViolationError(
|
|
@@ -99107,7 +99271,7 @@
|
|
|
99107
99271
|
}
|
|
99108
99272
|
return validSchemaResponse();
|
|
99109
99273
|
}
|
|
99110
|
-
function validateObject(data, schema, path, document) {
|
|
99274
|
+
function validateObject(data, schema, path, document, visited) {
|
|
99111
99275
|
const schemaKeys = Object.keys(schema.properties);
|
|
99112
99276
|
const requiredKeys = new Set(schema.required);
|
|
99113
99277
|
const schemaKeySet = new Set(schemaKeys);
|
|
@@ -99115,11 +99279,12 @@
|
|
|
99115
99279
|
Object.keys(data).forEach((key) => {
|
|
99116
99280
|
if (!schemaKeySet.has(key)) {
|
|
99117
99281
|
errorCollector.append(
|
|
99118
|
-
|
|
99282
|
+
validateJsonSchemaInternal(
|
|
99119
99283
|
data[key],
|
|
99120
99284
|
schema.additionalProperties,
|
|
99121
99285
|
`${path}.additionalProperties[${key}]`,
|
|
99122
|
-
document
|
|
99286
|
+
document,
|
|
99287
|
+
visited
|
|
99123
99288
|
)
|
|
99124
99289
|
);
|
|
99125
99290
|
}
|
|
@@ -99136,18 +99301,19 @@
|
|
|
99136
99301
|
}
|
|
99137
99302
|
if (keyInData) {
|
|
99138
99303
|
errorCollector.append(
|
|
99139
|
-
|
|
99304
|
+
validateJsonSchemaInternal(
|
|
99140
99305
|
data[key],
|
|
99141
99306
|
schema.properties[key],
|
|
99142
99307
|
`${path}.${key}`,
|
|
99143
|
-
document
|
|
99308
|
+
document,
|
|
99309
|
+
visited
|
|
99144
99310
|
)
|
|
99145
99311
|
);
|
|
99146
99312
|
}
|
|
99147
99313
|
}
|
|
99148
99314
|
return errorCollector.toValidationResponse();
|
|
99149
99315
|
}
|
|
99150
|
-
function validateArray(data, schema, path, document) {
|
|
99316
|
+
function validateArray(data, schema, path, document, visited) {
|
|
99151
99317
|
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
99152
99318
|
return invalidSchemaResponseWithError(
|
|
99153
99319
|
new MinItemsViolationError(
|
|
@@ -99165,7 +99331,13 @@
|
|
|
99165
99331
|
const errorCollector = new JsonSchemaErrorCollector();
|
|
99166
99332
|
data.forEach(
|
|
99167
99333
|
(element, index) => errorCollector.append(
|
|
99168
|
-
|
|
99334
|
+
validateJsonSchemaInternal(
|
|
99335
|
+
element,
|
|
99336
|
+
schema.items,
|
|
99337
|
+
`${path}[${index}]`,
|
|
99338
|
+
document,
|
|
99339
|
+
visited
|
|
99340
|
+
)
|
|
99169
99341
|
)
|
|
99170
99342
|
);
|
|
99171
99343
|
return errorCollector.toValidationResponse();
|
|
@@ -99200,7 +99372,7 @@
|
|
|
99200
99372
|
}
|
|
99201
99373
|
return validSchemaResponse();
|
|
99202
99374
|
}
|
|
99203
|
-
function validateRef(data, schema, path, document) {
|
|
99375
|
+
function validateRef(data, schema, path, document, visited) {
|
|
99204
99376
|
if (!schema.$ref.startsWith("#")) {
|
|
99205
99377
|
return invalidSchemaResponseWithError(
|
|
99206
99378
|
new InvalidRefError(
|
|
@@ -99208,11 +99380,23 @@
|
|
|
99208
99380
|
)
|
|
99209
99381
|
);
|
|
99210
99382
|
}
|
|
99383
|
+
let refsForData = visited.get(data);
|
|
99384
|
+
if (refsForData !== void 0 && refsForData.has(schema.$ref)) {
|
|
99385
|
+
return validSchemaResponse();
|
|
99386
|
+
}
|
|
99387
|
+
if (refsForData === void 0) {
|
|
99388
|
+
refsForData = /* @__PURE__ */ new Set();
|
|
99389
|
+
visited.set(data, refsForData);
|
|
99390
|
+
}
|
|
99391
|
+
refsForData.add(schema.$ref);
|
|
99211
99392
|
try {
|
|
99212
99393
|
const schemaToValidate = findSchemaAtPath(document, schema.$ref);
|
|
99213
|
-
return
|
|
99394
|
+
return validateJsonSchemaInternal(data, schemaToValidate, path, document, visited);
|
|
99214
99395
|
} catch (e) {
|
|
99215
99396
|
return invalidSchemaResponseWithError(e);
|
|
99397
|
+
} finally {
|
|
99398
|
+
refsForData.delete(schema.$ref);
|
|
99399
|
+
if (refsForData.size === 0) visited.delete(data);
|
|
99216
99400
|
}
|
|
99217
99401
|
}
|
|
99218
99402
|
function validateEnum(data, enumValue, path) {
|
|
@@ -106818,7 +107002,7 @@
|
|
|
106818
107002
|
_(config, CONFIG_SCHEMA);
|
|
106819
107003
|
const baseCommand = new graphql_imperative_ctor(config, documentRootType, services);
|
|
106820
107004
|
return applyDecorators(baseCommand, [services.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);
|
|
106821
|
-
},
|
|
107005
|
+
}, true);
|
|
106822
107006
|
graphql_imperative_legacy = services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
|
|
106823
107007
|
const _ = assertIsValid;
|
|
106824
107008
|
_(config, CONFIG_SCHEMA);
|
|
@@ -106871,7 +107055,7 @@
|
|
|
106871
107055
|
cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
|
|
106872
107056
|
}
|
|
106873
107057
|
}
|
|
106874
|
-
// version: 1.428.0-
|
|
107058
|
+
// version: 1.428.0-dev11-659d2de2fa
|
|
106875
107059
|
|
|
106876
107060
|
function createFragmentMap(documentNode) {
|
|
106877
107061
|
const fragments = {};
|
|
@@ -136108,7 +136292,7 @@
|
|
|
136108
136292
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
136109
136293
|
instrument: instrument$1,
|
|
136110
136294
|
});
|
|
136111
|
-
// version: 1.428.0-
|
|
136295
|
+
// version: 1.428.0-dev11-659d2de2fa
|
|
136112
136296
|
|
|
136113
136297
|
// On core the unstable adapters are re-exported with different names,
|
|
136114
136298
|
// we want to match them here.
|
|
@@ -136260,7 +136444,7 @@
|
|
|
136260
136444
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
136261
136445
|
graphQLImperative = ldsAdapter;
|
|
136262
136446
|
});
|
|
136263
|
-
// version: 1.428.0-
|
|
136447
|
+
// version: 1.428.0-dev11-659d2de2fa
|
|
136264
136448
|
|
|
136265
136449
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
136266
136450
|
__proto__: null,
|
|
@@ -137059,7 +137243,7 @@
|
|
|
137059
137243
|
function register(r) {
|
|
137060
137244
|
callbacks$1.forEach((callback) => callback(r));
|
|
137061
137245
|
}
|
|
137062
|
-
// version: 1.428.0-
|
|
137246
|
+
// version: 1.428.0-dev11-b4d8cf1aec
|
|
137063
137247
|
|
|
137064
137248
|
/**
|
|
137065
137249
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -138396,4 +138580,4 @@
|
|
|
138396
138580
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
138397
138581
|
|
|
138398
138582
|
}));
|
|
138399
|
-
// version: 1.428.0-
|
|
138583
|
+
// version: 1.428.0-dev11-b4d8cf1aec
|