@salesforce/lds-runtime-mobile 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.
Files changed (3) hide show
  1. package/dist/main.js +155 -39
  2. package/package.json +34 -34
  3. package/sfdc/main.js +155 -39
package/dist/main.js CHANGED
@@ -57804,6 +57804,7 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
57804
57804
  constructor(services) {
57805
57805
  super(services);
57806
57806
  this.services = services;
57807
+ this.additionalNullResponses = [];
57807
57808
  }
57808
57809
  fetch() {
57809
57810
  try {
@@ -57812,6 +57813,15 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
57812
57813
  return resolvedPromiseLike$2(err$1(toError(reason)));
57813
57814
  }
57814
57815
  }
57816
+ isSemanticNullResponse(response) {
57817
+ return this.additionalNullResponses.includes(response.status);
57818
+ }
57819
+ isProtocolNoBodyStatus(status) {
57820
+ return status === 204 || status === 205;
57821
+ }
57822
+ isUndeclaredNoBodyResponse(response) {
57823
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
57824
+ }
57815
57825
  async coerceError(errorResponse) {
57816
57826
  return toError(errorResponse.statusText);
57817
57827
  }
@@ -57819,10 +57829,24 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
57819
57829
  return response.then(
57820
57830
  (response2) => {
57821
57831
  if (response2.ok) {
57822
- return response2.json().then(
57823
- (json) => ok$1(json),
57824
- (reason) => err$1(toError(reason))
57825
- ).finally(() => {
57832
+ let resultPromise;
57833
+ if (this.isSemanticNullResponse(response2)) {
57834
+ resultPromise = Promise.resolve(ok$1(null));
57835
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
57836
+ resultPromise = Promise.resolve(
57837
+ err$1(
57838
+ toError(
57839
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
57840
+ )
57841
+ )
57842
+ );
57843
+ } else {
57844
+ resultPromise = response2.json().then(
57845
+ (json) => ok$1(json),
57846
+ (reason) => err$1(toError(reason))
57847
+ );
57848
+ }
57849
+ return resultPromise.finally(() => {
57826
57850
  try {
57827
57851
  this.afterRequestHooks({ statusCode: response2.status });
57828
57852
  } catch {
@@ -57869,6 +57893,7 @@ class HttpCacheControlCommand extends CacheControlCommand {
57869
57893
  constructor(services) {
57870
57894
  super(services);
57871
57895
  this.services = services;
57896
+ this.additionalNullResponses = [];
57872
57897
  }
57873
57898
  requestFromNetwork() {
57874
57899
  return this.fetch();
@@ -57880,6 +57905,15 @@ class HttpCacheControlCommand extends CacheControlCommand {
57880
57905
  return resolvedPromiseLike$2(err$1(toError(reason)));
57881
57906
  }
57882
57907
  }
57908
+ isSemanticNullResponse(response) {
57909
+ return this.additionalNullResponses.includes(response.status);
57910
+ }
57911
+ isProtocolNoBodyStatus(status) {
57912
+ return status === 204 || status === 205;
57913
+ }
57914
+ isUndeclaredNoBodyResponse(response) {
57915
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
57916
+ }
57883
57917
  async coerceError(errorResponse) {
57884
57918
  return toError(errorResponse.statusText);
57885
57919
  }
@@ -57890,12 +57924,26 @@ class HttpCacheControlCommand extends CacheControlCommand {
57890
57924
  return response.then(
57891
57925
  (response2) => {
57892
57926
  if (response2.ok) {
57893
- return response2.json().then(
57894
- (json) => {
57895
- return this.processFetchReturnValue(json);
57896
- },
57897
- (reason) => err$1(toError(reason))
57898
- ).finally(() => {
57927
+ let resultPromise;
57928
+ if (this.isSemanticNullResponse(response2)) {
57929
+ resultPromise = Promise.resolve(ok$1(null));
57930
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
57931
+ resultPromise = Promise.resolve(
57932
+ err$1(
57933
+ toError(
57934
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
57935
+ )
57936
+ )
57937
+ );
57938
+ } else {
57939
+ resultPromise = response2.json().then(
57940
+ (json) => {
57941
+ return this.processFetchReturnValue(json);
57942
+ },
57943
+ (reason) => err$1(toError(reason))
57944
+ );
57945
+ }
57946
+ return resultPromise.finally(() => {
57899
57947
  try {
57900
57948
  this.afterRequestHooks({ statusCode: response2.status });
57901
57949
  } catch {
@@ -58883,7 +58931,7 @@ function buildServiceDescriptor$b(luvio) {
58883
58931
  },
58884
58932
  };
58885
58933
  }
58886
- // version: 1.428.0-dev1-52205c6c54
58934
+ // version: 1.428.0-dev11-659d2de2fa
58887
58935
 
58888
58936
  /**
58889
58937
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -58909,7 +58957,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
58909
58957
  },
58910
58958
  };
58911
58959
  }
58912
- // version: 1.428.0-dev1-52205c6c54
58960
+ // version: 1.428.0-dev11-659d2de2fa
58913
58961
 
58914
58962
  /*!
58915
58963
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -59394,6 +59442,9 @@ function invalidSchemaResponseWithError(error) {
59394
59442
  return err$1([error]);
59395
59443
  }
59396
59444
  function validateJsonSchema(data, schema, path = "$", document = schema) {
59445
+ return validateJsonSchemaInternal(data, schema, path, document, /* @__PURE__ */ new Map());
59446
+ }
59447
+ function validateJsonSchemaInternal(data, schema, path, document, visited) {
59397
59448
  if (schema === true) return validSchemaResponse();
59398
59449
  if (schema === false)
59399
59450
  return invalidSchemaResponseWithError(
@@ -59402,22 +59453,22 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
59402
59453
  const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
59403
59454
  const errorCollector = new JsonSchemaErrorCollector();
59404
59455
  if ("anyOf" in schema) {
59405
- errorCollector.append(validateAnyOf(data, schema, path, document));
59456
+ errorCollector.append(validateAnyOf(data, schema, path, document, visited));
59406
59457
  } else if ("oneOf" in schema) {
59407
- errorCollector.append(validateOneOf(data, schema, path, document));
59458
+ errorCollector.append(validateOneOf(data, schema, path, document, visited));
59408
59459
  } else if ("allOf" in schema) {
59409
- errorCollector.append(validateAllOf(data, schema, path, document));
59460
+ errorCollector.append(validateAllOf(data, schema, path, document, visited));
59410
59461
  } else if ("not" in schema) {
59411
- errorCollector.append(validateNot(data, schema, path, document));
59462
+ errorCollector.append(validateNot(data, schema, path, document, visited));
59412
59463
  } else if ("$ref" in schema) {
59413
- errorCollector.append(validateRef(data, schema, path, document));
59464
+ errorCollector.append(validateRef(data, schema, path, document, visited));
59414
59465
  } else if ("type" in schema) {
59415
59466
  if (schema.type === "object") {
59416
59467
  if (dataType !== "object") {
59417
59468
  errorCollector.add(incorrectTypeError("object", dataType, path));
59418
59469
  } else {
59419
59470
  errorCollector.append(
59420
- validateObject(data, schema, path, document)
59471
+ validateObject(data, schema, path, document, visited)
59421
59472
  );
59422
59473
  }
59423
59474
  } else if (schema.type === "array") {
@@ -59425,7 +59476,7 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
59425
59476
  errorCollector.add(incorrectTypeError("array", dataType, path));
59426
59477
  } else {
59427
59478
  errorCollector.append(
59428
- validateArray(data, schema, path, document)
59479
+ validateArray(data, schema, path, document, visited)
59429
59480
  );
59430
59481
  }
59431
59482
  } else {
@@ -59442,16 +59493,17 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
59442
59493
  }
59443
59494
  return errorCollector.toValidationResponse();
59444
59495
  }
59445
- function validateAnyOf(data, schema, path, document) {
59496
+ function validateAnyOf(data, schema, path, document, visited) {
59446
59497
  let isValid = false;
59447
59498
  const errorCollector = new JsonSchemaErrorCollector();
59448
59499
  for (let i = 0, { length } = schema.anyOf; i < length; i++) {
59449
59500
  const element = schema.anyOf[i];
59450
- const validationResponse = validateJsonSchema(
59501
+ const validationResponse = validateJsonSchemaInternal(
59451
59502
  data,
59452
59503
  element,
59453
59504
  `${path}.anyOf[${i}]`,
59454
- document
59505
+ document,
59506
+ visited
59455
59507
  );
59456
59508
  if (validationResponse.isOk()) {
59457
59509
  isValid = true;
@@ -59468,13 +59520,22 @@ function validateAnyOf(data, schema, path, document) {
59468
59520
  }
59469
59521
  return validSchemaResponse();
59470
59522
  }
59471
- function validateOneOf(data, schema, path, document) {
59523
+ function validateOneOf(data, schema, path, document, visited) {
59524
+ if (schema.discriminator !== void 0) {
59525
+ return validateDiscriminatedOneOf(data, schema.discriminator, path, document, visited);
59526
+ }
59472
59527
  let validSubShemaPaths = [];
59473
59528
  const errorCollector = new JsonSchemaErrorCollector();
59474
59529
  for (let i = 0, { length } = schema.oneOf; i < length; i++) {
59475
59530
  const element = schema.oneOf[i];
59476
59531
  const oneOfPath = `${path}.oneOf[${i}]`;
59477
- const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
59532
+ const validationResponse = validateJsonSchemaInternal(
59533
+ data,
59534
+ element,
59535
+ oneOfPath,
59536
+ document,
59537
+ visited
59538
+ );
59478
59539
  if (validationResponse.isOk()) {
59479
59540
  validSubShemaPaths.push(oneOfPath);
59480
59541
  } else {
@@ -59496,16 +59557,45 @@ function validateOneOf(data, schema, path, document) {
59496
59557
  }
59497
59558
  return validSchemaResponse();
59498
59559
  }
59499
- function validateAllOf(data, schema, path, document) {
59560
+ function validateDiscriminatedOneOf(data, discriminator, path, document, visited) {
59561
+ if (data === null || typeof data !== "object" || Array.isArray(data)) {
59562
+ return invalidSchemaResponseWithError(incorrectTypeError("object", typeof data, path));
59563
+ }
59564
+ const { propertyName, mapping } = discriminator;
59565
+ const discriminatorValue = data[propertyName];
59566
+ if (discriminatorValue === void 0) {
59567
+ return invalidSchemaResponseWithError(
59568
+ new MissingRequiredPropertyError(
59569
+ `Object at path '${path}' is missing required discriminator property '${propertyName}'.`
59570
+ )
59571
+ );
59572
+ }
59573
+ if (typeof discriminatorValue !== "string") {
59574
+ return invalidSchemaResponseWithError(
59575
+ incorrectTypeError("string", typeof discriminatorValue, `${path}.${propertyName}`)
59576
+ );
59577
+ }
59578
+ const targetRef = mapping[discriminatorValue];
59579
+ if (targetRef === void 0) {
59580
+ return invalidSchemaResponseWithError(
59581
+ new JsonSchemaViolationError(
59582
+ `Discriminator value '${discriminatorValue}' at '${path}.${propertyName}' is not in the mapping. Expected one of: [${Object.keys(mapping).join(", ")}].`
59583
+ )
59584
+ );
59585
+ }
59586
+ return validateJsonSchemaInternal(data, { $ref: targetRef }, path, document, visited);
59587
+ }
59588
+ function validateAllOf(data, schema, path, document, visited) {
59500
59589
  let isValid = true;
59501
59590
  const errorCollector = new JsonSchemaErrorCollector();
59502
59591
  for (let i = 0, { length } = schema.allOf; i < length; i++) {
59503
59592
  const element = schema.allOf[i];
59504
- const validationResponse = validateJsonSchema(
59593
+ const validationResponse = validateJsonSchemaInternal(
59505
59594
  data,
59506
59595
  element,
59507
59596
  `${path}.allOf[${i}]`,
59508
- document
59597
+ document,
59598
+ visited
59509
59599
  );
59510
59600
  if (!validationResponse.isOk()) {
59511
59601
  errorCollector.append(validationResponse);
@@ -59519,8 +59609,14 @@ function validateAllOf(data, schema, path, document) {
59519
59609
  }
59520
59610
  return errorCollector.toValidationResponse();
59521
59611
  }
59522
- function validateNot(data, schema, path, document) {
59523
- const validationResponse = validateJsonSchema(data, schema.not, path, document);
59612
+ function validateNot(data, schema, path, document, visited) {
59613
+ const validationResponse = validateJsonSchemaInternal(
59614
+ data,
59615
+ schema.not,
59616
+ path,
59617
+ document,
59618
+ visited
59619
+ );
59524
59620
  if (validationResponse.isOk()) {
59525
59621
  return invalidSchemaResponseWithError(
59526
59622
  new JsonSchemaViolationError(
@@ -59530,7 +59626,7 @@ function validateNot(data, schema, path, document) {
59530
59626
  }
59531
59627
  return validSchemaResponse();
59532
59628
  }
59533
- function validateObject(data, schema, path, document) {
59629
+ function validateObject(data, schema, path, document, visited) {
59534
59630
  const schemaKeys = Object.keys(schema.properties);
59535
59631
  const requiredKeys = new Set(schema.required);
59536
59632
  const schemaKeySet = new Set(schemaKeys);
@@ -59538,11 +59634,12 @@ function validateObject(data, schema, path, document) {
59538
59634
  Object.keys(data).forEach((key) => {
59539
59635
  if (!schemaKeySet.has(key)) {
59540
59636
  errorCollector.append(
59541
- validateJsonSchema(
59637
+ validateJsonSchemaInternal(
59542
59638
  data[key],
59543
59639
  schema.additionalProperties,
59544
59640
  `${path}.additionalProperties[${key}]`,
59545
- document
59641
+ document,
59642
+ visited
59546
59643
  )
59547
59644
  );
59548
59645
  }
@@ -59559,18 +59656,19 @@ function validateObject(data, schema, path, document) {
59559
59656
  }
59560
59657
  if (keyInData) {
59561
59658
  errorCollector.append(
59562
- validateJsonSchema(
59659
+ validateJsonSchemaInternal(
59563
59660
  data[key],
59564
59661
  schema.properties[key],
59565
59662
  `${path}.${key}`,
59566
- document
59663
+ document,
59664
+ visited
59567
59665
  )
59568
59666
  );
59569
59667
  }
59570
59668
  }
59571
59669
  return errorCollector.toValidationResponse();
59572
59670
  }
59573
- function validateArray(data, schema, path, document) {
59671
+ function validateArray(data, schema, path, document, visited) {
59574
59672
  if (schema.minItems !== void 0 && data.length < schema.minItems) {
59575
59673
  return invalidSchemaResponseWithError(
59576
59674
  new MinItemsViolationError(
@@ -59588,7 +59686,13 @@ function validateArray(data, schema, path, document) {
59588
59686
  const errorCollector = new JsonSchemaErrorCollector();
59589
59687
  data.forEach(
59590
59688
  (element, index) => errorCollector.append(
59591
- validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
59689
+ validateJsonSchemaInternal(
59690
+ element,
59691
+ schema.items,
59692
+ `${path}[${index}]`,
59693
+ document,
59694
+ visited
59695
+ )
59592
59696
  )
59593
59697
  );
59594
59698
  return errorCollector.toValidationResponse();
@@ -59623,7 +59727,7 @@ function validateScalar(data, schema, path) {
59623
59727
  }
59624
59728
  return validSchemaResponse();
59625
59729
  }
59626
- function validateRef(data, schema, path, document) {
59730
+ function validateRef(data, schema, path, document, visited) {
59627
59731
  if (!schema.$ref.startsWith("#")) {
59628
59732
  return invalidSchemaResponseWithError(
59629
59733
  new InvalidRefError(
@@ -59631,11 +59735,23 @@ function validateRef(data, schema, path, document) {
59631
59735
  )
59632
59736
  );
59633
59737
  }
59738
+ let refsForData = visited.get(data);
59739
+ if (refsForData !== void 0 && refsForData.has(schema.$ref)) {
59740
+ return validSchemaResponse();
59741
+ }
59742
+ if (refsForData === void 0) {
59743
+ refsForData = /* @__PURE__ */ new Set();
59744
+ visited.set(data, refsForData);
59745
+ }
59746
+ refsForData.add(schema.$ref);
59634
59747
  try {
59635
59748
  const schemaToValidate = findSchemaAtPath(document, schema.$ref);
59636
- return validateJsonSchema(data, schemaToValidate, path, document);
59749
+ return validateJsonSchemaInternal(data, schemaToValidate, path, document, visited);
59637
59750
  } catch (e) {
59638
59751
  return invalidSchemaResponseWithError(e);
59752
+ } finally {
59753
+ refsForData.delete(schema.$ref);
59754
+ if (refsForData.size === 0) visited.delete(data);
59639
59755
  }
59640
59756
  }
59641
59757
  function validateEnum(data, enumValue, path) {
@@ -61569,4 +61685,4 @@ register({
61569
61685
  });
61570
61686
 
61571
61687
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, initializeOneStore, registerReportObserver, reportGraphqlQueryParseError };
61572
- // version: 1.428.0-dev1-c95a813572
61688
+ // version: 1.428.0-dev11-b4d8cf1aec
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.428.0-dev1",
3
+ "version": "1.428.0-dev11",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
@@ -32,44 +32,44 @@
32
32
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
33
33
  },
34
34
  "dependencies": {
35
- "@conduit-client/service-bindings-imperative": "3.18.0",
36
- "@conduit-client/service-bindings-lwc": "3.18.0",
37
- "@conduit-client/service-provisioner": "3.18.0",
38
- "@salesforce/lds-adapters-uiapi": "^1.428.0-dev1",
39
- "@salesforce/lds-bindings": "^1.428.0-dev1",
40
- "@salesforce/lds-instrumentation": "^1.428.0-dev1",
41
- "@salesforce/lds-luvio-service": "^1.428.0-dev1",
42
- "@salesforce/lds-luvio-uiapi-records-service": "^1.428.0-dev1",
35
+ "@conduit-client/service-bindings-imperative": "3.18.1-dev2",
36
+ "@conduit-client/service-bindings-lwc": "3.18.1-dev2",
37
+ "@conduit-client/service-provisioner": "3.18.1-dev2",
38
+ "@salesforce/lds-adapters-uiapi": "^1.428.0-dev11",
39
+ "@salesforce/lds-bindings": "^1.428.0-dev11",
40
+ "@salesforce/lds-instrumentation": "^1.428.0-dev11",
41
+ "@salesforce/lds-luvio-service": "^1.428.0-dev11",
42
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.428.0-dev11",
43
43
  "@salesforce/user": "0.0.21",
44
44
  "o11y": "250.7.0",
45
45
  "o11y_schema": "256.126.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@conduit-client/command-aura-network": "3.18.0",
49
- "@conduit-client/command-aura-normalized-cache-control": "3.18.0",
50
- "@conduit-client/command-aura-resource-cache-control": "3.18.0",
51
- "@conduit-client/command-fetch-network": "3.18.0",
52
- "@conduit-client/command-http-normalized-cache-control": "3.18.0",
53
- "@conduit-client/command-network": "3.18.0",
54
- "@conduit-client/service-cache": "3.18.0",
55
- "@conduit-client/service-cache-control": "3.18.0",
56
- "@conduit-client/service-cache-inclusion-policy": "3.18.0",
57
- "@conduit-client/service-fetch-network": "3.18.0",
58
- "@conduit-client/service-instrument-command": "3.18.0",
59
- "@conduit-client/service-instrumentation": "3.18.0",
60
- "@conduit-client/service-pubsub": "3.18.0",
61
- "@conduit-client/service-store": "3.18.0",
62
- "@conduit-client/utils": "3.18.0",
63
- "@salesforce/lds-adapters-graphql": "^1.428.0-dev1",
64
- "@salesforce/lds-drafts": "^1.428.0-dev1",
65
- "@salesforce/lds-durable-records": "^1.428.0-dev1",
66
- "@salesforce/lds-network-adapter": "^1.428.0-dev1",
67
- "@salesforce/lds-network-nimbus": "^1.428.0-dev1",
68
- "@salesforce/lds-store-binary": "^1.428.0-dev1",
69
- "@salesforce/lds-store-nimbus": "^1.428.0-dev1",
70
- "@salesforce/lds-store-sql": "^1.428.0-dev1",
71
- "@salesforce/lds-utils-adapters": "^1.428.0-dev1",
72
- "@salesforce/nimbus-plugin-lds": "^1.428.0-dev1",
48
+ "@conduit-client/command-aura-network": "3.18.1-dev2",
49
+ "@conduit-client/command-aura-normalized-cache-control": "3.18.1-dev2",
50
+ "@conduit-client/command-aura-resource-cache-control": "3.18.1-dev2",
51
+ "@conduit-client/command-fetch-network": "3.18.1-dev2",
52
+ "@conduit-client/command-http-normalized-cache-control": "3.18.1-dev2",
53
+ "@conduit-client/command-network": "3.18.1-dev2",
54
+ "@conduit-client/service-cache": "3.18.1-dev2",
55
+ "@conduit-client/service-cache-control": "3.18.1-dev2",
56
+ "@conduit-client/service-cache-inclusion-policy": "3.18.1-dev2",
57
+ "@conduit-client/service-fetch-network": "3.18.1-dev2",
58
+ "@conduit-client/service-instrument-command": "3.18.1-dev2",
59
+ "@conduit-client/service-instrumentation": "3.18.1-dev2",
60
+ "@conduit-client/service-pubsub": "3.18.1-dev2",
61
+ "@conduit-client/service-store": "3.18.1-dev2",
62
+ "@conduit-client/utils": "3.18.1-dev2",
63
+ "@salesforce/lds-adapters-graphql": "^1.428.0-dev11",
64
+ "@salesforce/lds-drafts": "^1.428.0-dev11",
65
+ "@salesforce/lds-durable-records": "^1.428.0-dev11",
66
+ "@salesforce/lds-network-adapter": "^1.428.0-dev11",
67
+ "@salesforce/lds-network-nimbus": "^1.428.0-dev11",
68
+ "@salesforce/lds-store-binary": "^1.428.0-dev11",
69
+ "@salesforce/lds-store-nimbus": "^1.428.0-dev11",
70
+ "@salesforce/lds-store-sql": "^1.428.0-dev11",
71
+ "@salesforce/lds-utils-adapters": "^1.428.0-dev11",
72
+ "@salesforce/nimbus-plugin-lds": "^1.428.0-dev11",
73
73
  "babel-plugin-dynamic-import-node": "^2.3.3",
74
74
  "wait-for-expect": "^3.0.2"
75
75
  },
package/sfdc/main.js CHANGED
@@ -57804,6 +57804,7 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
57804
57804
  constructor(services) {
57805
57805
  super(services);
57806
57806
  this.services = services;
57807
+ this.additionalNullResponses = [];
57807
57808
  }
57808
57809
  fetch() {
57809
57810
  try {
@@ -57812,6 +57813,15 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
57812
57813
  return resolvedPromiseLike$2(err$1(toError(reason)));
57813
57814
  }
57814
57815
  }
57816
+ isSemanticNullResponse(response) {
57817
+ return this.additionalNullResponses.includes(response.status);
57818
+ }
57819
+ isProtocolNoBodyStatus(status) {
57820
+ return status === 204 || status === 205;
57821
+ }
57822
+ isUndeclaredNoBodyResponse(response) {
57823
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
57824
+ }
57815
57825
  async coerceError(errorResponse) {
57816
57826
  return toError(errorResponse.statusText);
57817
57827
  }
@@ -57819,10 +57829,24 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
57819
57829
  return response.then(
57820
57830
  (response2) => {
57821
57831
  if (response2.ok) {
57822
- return response2.json().then(
57823
- (json) => ok$1(json),
57824
- (reason) => err$1(toError(reason))
57825
- ).finally(() => {
57832
+ let resultPromise;
57833
+ if (this.isSemanticNullResponse(response2)) {
57834
+ resultPromise = Promise.resolve(ok$1(null));
57835
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
57836
+ resultPromise = Promise.resolve(
57837
+ err$1(
57838
+ toError(
57839
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
57840
+ )
57841
+ )
57842
+ );
57843
+ } else {
57844
+ resultPromise = response2.json().then(
57845
+ (json) => ok$1(json),
57846
+ (reason) => err$1(toError(reason))
57847
+ );
57848
+ }
57849
+ return resultPromise.finally(() => {
57826
57850
  try {
57827
57851
  this.afterRequestHooks({ statusCode: response2.status });
57828
57852
  } catch {
@@ -57869,6 +57893,7 @@ class HttpCacheControlCommand extends CacheControlCommand {
57869
57893
  constructor(services) {
57870
57894
  super(services);
57871
57895
  this.services = services;
57896
+ this.additionalNullResponses = [];
57872
57897
  }
57873
57898
  requestFromNetwork() {
57874
57899
  return this.fetch();
@@ -57880,6 +57905,15 @@ class HttpCacheControlCommand extends CacheControlCommand {
57880
57905
  return resolvedPromiseLike$2(err$1(toError(reason)));
57881
57906
  }
57882
57907
  }
57908
+ isSemanticNullResponse(response) {
57909
+ return this.additionalNullResponses.includes(response.status);
57910
+ }
57911
+ isProtocolNoBodyStatus(status) {
57912
+ return status === 204 || status === 205;
57913
+ }
57914
+ isUndeclaredNoBodyResponse(response) {
57915
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
57916
+ }
57883
57917
  async coerceError(errorResponse) {
57884
57918
  return toError(errorResponse.statusText);
57885
57919
  }
@@ -57890,12 +57924,26 @@ class HttpCacheControlCommand extends CacheControlCommand {
57890
57924
  return response.then(
57891
57925
  (response2) => {
57892
57926
  if (response2.ok) {
57893
- return response2.json().then(
57894
- (json) => {
57895
- return this.processFetchReturnValue(json);
57896
- },
57897
- (reason) => err$1(toError(reason))
57898
- ).finally(() => {
57927
+ let resultPromise;
57928
+ if (this.isSemanticNullResponse(response2)) {
57929
+ resultPromise = Promise.resolve(ok$1(null));
57930
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
57931
+ resultPromise = Promise.resolve(
57932
+ err$1(
57933
+ toError(
57934
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
57935
+ )
57936
+ )
57937
+ );
57938
+ } else {
57939
+ resultPromise = response2.json().then(
57940
+ (json) => {
57941
+ return this.processFetchReturnValue(json);
57942
+ },
57943
+ (reason) => err$1(toError(reason))
57944
+ );
57945
+ }
57946
+ return resultPromise.finally(() => {
57899
57947
  try {
57900
57948
  this.afterRequestHooks({ statusCode: response2.status });
57901
57949
  } catch {
@@ -58883,7 +58931,7 @@ function buildServiceDescriptor$b(luvio) {
58883
58931
  },
58884
58932
  };
58885
58933
  }
58886
- // version: 1.428.0-dev1-52205c6c54
58934
+ // version: 1.428.0-dev11-659d2de2fa
58887
58935
 
58888
58936
  /**
58889
58937
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -58909,7 +58957,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
58909
58957
  },
58910
58958
  };
58911
58959
  }
58912
- // version: 1.428.0-dev1-52205c6c54
58960
+ // version: 1.428.0-dev11-659d2de2fa
58913
58961
 
58914
58962
  /*!
58915
58963
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -59394,6 +59442,9 @@ function invalidSchemaResponseWithError(error) {
59394
59442
  return err$1([error]);
59395
59443
  }
59396
59444
  function validateJsonSchema(data, schema, path = "$", document = schema) {
59445
+ return validateJsonSchemaInternal(data, schema, path, document, /* @__PURE__ */ new Map());
59446
+ }
59447
+ function validateJsonSchemaInternal(data, schema, path, document, visited) {
59397
59448
  if (schema === true) return validSchemaResponse();
59398
59449
  if (schema === false)
59399
59450
  return invalidSchemaResponseWithError(
@@ -59402,22 +59453,22 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
59402
59453
  const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
59403
59454
  const errorCollector = new JsonSchemaErrorCollector();
59404
59455
  if ("anyOf" in schema) {
59405
- errorCollector.append(validateAnyOf(data, schema, path, document));
59456
+ errorCollector.append(validateAnyOf(data, schema, path, document, visited));
59406
59457
  } else if ("oneOf" in schema) {
59407
- errorCollector.append(validateOneOf(data, schema, path, document));
59458
+ errorCollector.append(validateOneOf(data, schema, path, document, visited));
59408
59459
  } else if ("allOf" in schema) {
59409
- errorCollector.append(validateAllOf(data, schema, path, document));
59460
+ errorCollector.append(validateAllOf(data, schema, path, document, visited));
59410
59461
  } else if ("not" in schema) {
59411
- errorCollector.append(validateNot(data, schema, path, document));
59462
+ errorCollector.append(validateNot(data, schema, path, document, visited));
59412
59463
  } else if ("$ref" in schema) {
59413
- errorCollector.append(validateRef(data, schema, path, document));
59464
+ errorCollector.append(validateRef(data, schema, path, document, visited));
59414
59465
  } else if ("type" in schema) {
59415
59466
  if (schema.type === "object") {
59416
59467
  if (dataType !== "object") {
59417
59468
  errorCollector.add(incorrectTypeError("object", dataType, path));
59418
59469
  } else {
59419
59470
  errorCollector.append(
59420
- validateObject(data, schema, path, document)
59471
+ validateObject(data, schema, path, document, visited)
59421
59472
  );
59422
59473
  }
59423
59474
  } else if (schema.type === "array") {
@@ -59425,7 +59476,7 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
59425
59476
  errorCollector.add(incorrectTypeError("array", dataType, path));
59426
59477
  } else {
59427
59478
  errorCollector.append(
59428
- validateArray(data, schema, path, document)
59479
+ validateArray(data, schema, path, document, visited)
59429
59480
  );
59430
59481
  }
59431
59482
  } else {
@@ -59442,16 +59493,17 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
59442
59493
  }
59443
59494
  return errorCollector.toValidationResponse();
59444
59495
  }
59445
- function validateAnyOf(data, schema, path, document) {
59496
+ function validateAnyOf(data, schema, path, document, visited) {
59446
59497
  let isValid = false;
59447
59498
  const errorCollector = new JsonSchemaErrorCollector();
59448
59499
  for (let i = 0, { length } = schema.anyOf; i < length; i++) {
59449
59500
  const element = schema.anyOf[i];
59450
- const validationResponse = validateJsonSchema(
59501
+ const validationResponse = validateJsonSchemaInternal(
59451
59502
  data,
59452
59503
  element,
59453
59504
  `${path}.anyOf[${i}]`,
59454
- document
59505
+ document,
59506
+ visited
59455
59507
  );
59456
59508
  if (validationResponse.isOk()) {
59457
59509
  isValid = true;
@@ -59468,13 +59520,22 @@ function validateAnyOf(data, schema, path, document) {
59468
59520
  }
59469
59521
  return validSchemaResponse();
59470
59522
  }
59471
- function validateOneOf(data, schema, path, document) {
59523
+ function validateOneOf(data, schema, path, document, visited) {
59524
+ if (schema.discriminator !== void 0) {
59525
+ return validateDiscriminatedOneOf(data, schema.discriminator, path, document, visited);
59526
+ }
59472
59527
  let validSubShemaPaths = [];
59473
59528
  const errorCollector = new JsonSchemaErrorCollector();
59474
59529
  for (let i = 0, { length } = schema.oneOf; i < length; i++) {
59475
59530
  const element = schema.oneOf[i];
59476
59531
  const oneOfPath = `${path}.oneOf[${i}]`;
59477
- const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
59532
+ const validationResponse = validateJsonSchemaInternal(
59533
+ data,
59534
+ element,
59535
+ oneOfPath,
59536
+ document,
59537
+ visited
59538
+ );
59478
59539
  if (validationResponse.isOk()) {
59479
59540
  validSubShemaPaths.push(oneOfPath);
59480
59541
  } else {
@@ -59496,16 +59557,45 @@ function validateOneOf(data, schema, path, document) {
59496
59557
  }
59497
59558
  return validSchemaResponse();
59498
59559
  }
59499
- function validateAllOf(data, schema, path, document) {
59560
+ function validateDiscriminatedOneOf(data, discriminator, path, document, visited) {
59561
+ if (data === null || typeof data !== "object" || Array.isArray(data)) {
59562
+ return invalidSchemaResponseWithError(incorrectTypeError("object", typeof data, path));
59563
+ }
59564
+ const { propertyName, mapping } = discriminator;
59565
+ const discriminatorValue = data[propertyName];
59566
+ if (discriminatorValue === void 0) {
59567
+ return invalidSchemaResponseWithError(
59568
+ new MissingRequiredPropertyError(
59569
+ `Object at path '${path}' is missing required discriminator property '${propertyName}'.`
59570
+ )
59571
+ );
59572
+ }
59573
+ if (typeof discriminatorValue !== "string") {
59574
+ return invalidSchemaResponseWithError(
59575
+ incorrectTypeError("string", typeof discriminatorValue, `${path}.${propertyName}`)
59576
+ );
59577
+ }
59578
+ const targetRef = mapping[discriminatorValue];
59579
+ if (targetRef === void 0) {
59580
+ return invalidSchemaResponseWithError(
59581
+ new JsonSchemaViolationError(
59582
+ `Discriminator value '${discriminatorValue}' at '${path}.${propertyName}' is not in the mapping. Expected one of: [${Object.keys(mapping).join(", ")}].`
59583
+ )
59584
+ );
59585
+ }
59586
+ return validateJsonSchemaInternal(data, { $ref: targetRef }, path, document, visited);
59587
+ }
59588
+ function validateAllOf(data, schema, path, document, visited) {
59500
59589
  let isValid = true;
59501
59590
  const errorCollector = new JsonSchemaErrorCollector();
59502
59591
  for (let i = 0, { length } = schema.allOf; i < length; i++) {
59503
59592
  const element = schema.allOf[i];
59504
- const validationResponse = validateJsonSchema(
59593
+ const validationResponse = validateJsonSchemaInternal(
59505
59594
  data,
59506
59595
  element,
59507
59596
  `${path}.allOf[${i}]`,
59508
- document
59597
+ document,
59598
+ visited
59509
59599
  );
59510
59600
  if (!validationResponse.isOk()) {
59511
59601
  errorCollector.append(validationResponse);
@@ -59519,8 +59609,14 @@ function validateAllOf(data, schema, path, document) {
59519
59609
  }
59520
59610
  return errorCollector.toValidationResponse();
59521
59611
  }
59522
- function validateNot(data, schema, path, document) {
59523
- const validationResponse = validateJsonSchema(data, schema.not, path, document);
59612
+ function validateNot(data, schema, path, document, visited) {
59613
+ const validationResponse = validateJsonSchemaInternal(
59614
+ data,
59615
+ schema.not,
59616
+ path,
59617
+ document,
59618
+ visited
59619
+ );
59524
59620
  if (validationResponse.isOk()) {
59525
59621
  return invalidSchemaResponseWithError(
59526
59622
  new JsonSchemaViolationError(
@@ -59530,7 +59626,7 @@ function validateNot(data, schema, path, document) {
59530
59626
  }
59531
59627
  return validSchemaResponse();
59532
59628
  }
59533
- function validateObject(data, schema, path, document) {
59629
+ function validateObject(data, schema, path, document, visited) {
59534
59630
  const schemaKeys = Object.keys(schema.properties);
59535
59631
  const requiredKeys = new Set(schema.required);
59536
59632
  const schemaKeySet = new Set(schemaKeys);
@@ -59538,11 +59634,12 @@ function validateObject(data, schema, path, document) {
59538
59634
  Object.keys(data).forEach((key) => {
59539
59635
  if (!schemaKeySet.has(key)) {
59540
59636
  errorCollector.append(
59541
- validateJsonSchema(
59637
+ validateJsonSchemaInternal(
59542
59638
  data[key],
59543
59639
  schema.additionalProperties,
59544
59640
  `${path}.additionalProperties[${key}]`,
59545
- document
59641
+ document,
59642
+ visited
59546
59643
  )
59547
59644
  );
59548
59645
  }
@@ -59559,18 +59656,19 @@ function validateObject(data, schema, path, document) {
59559
59656
  }
59560
59657
  if (keyInData) {
59561
59658
  errorCollector.append(
59562
- validateJsonSchema(
59659
+ validateJsonSchemaInternal(
59563
59660
  data[key],
59564
59661
  schema.properties[key],
59565
59662
  `${path}.${key}`,
59566
- document
59663
+ document,
59664
+ visited
59567
59665
  )
59568
59666
  );
59569
59667
  }
59570
59668
  }
59571
59669
  return errorCollector.toValidationResponse();
59572
59670
  }
59573
- function validateArray(data, schema, path, document) {
59671
+ function validateArray(data, schema, path, document, visited) {
59574
59672
  if (schema.minItems !== void 0 && data.length < schema.minItems) {
59575
59673
  return invalidSchemaResponseWithError(
59576
59674
  new MinItemsViolationError(
@@ -59588,7 +59686,13 @@ function validateArray(data, schema, path, document) {
59588
59686
  const errorCollector = new JsonSchemaErrorCollector();
59589
59687
  data.forEach(
59590
59688
  (element, index) => errorCollector.append(
59591
- validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
59689
+ validateJsonSchemaInternal(
59690
+ element,
59691
+ schema.items,
59692
+ `${path}[${index}]`,
59693
+ document,
59694
+ visited
59695
+ )
59592
59696
  )
59593
59697
  );
59594
59698
  return errorCollector.toValidationResponse();
@@ -59623,7 +59727,7 @@ function validateScalar(data, schema, path) {
59623
59727
  }
59624
59728
  return validSchemaResponse();
59625
59729
  }
59626
- function validateRef(data, schema, path, document) {
59730
+ function validateRef(data, schema, path, document, visited) {
59627
59731
  if (!schema.$ref.startsWith("#")) {
59628
59732
  return invalidSchemaResponseWithError(
59629
59733
  new InvalidRefError(
@@ -59631,11 +59735,23 @@ function validateRef(data, schema, path, document) {
59631
59735
  )
59632
59736
  );
59633
59737
  }
59738
+ let refsForData = visited.get(data);
59739
+ if (refsForData !== void 0 && refsForData.has(schema.$ref)) {
59740
+ return validSchemaResponse();
59741
+ }
59742
+ if (refsForData === void 0) {
59743
+ refsForData = /* @__PURE__ */ new Set();
59744
+ visited.set(data, refsForData);
59745
+ }
59746
+ refsForData.add(schema.$ref);
59634
59747
  try {
59635
59748
  const schemaToValidate = findSchemaAtPath(document, schema.$ref);
59636
- return validateJsonSchema(data, schemaToValidate, path, document);
59749
+ return validateJsonSchemaInternal(data, schemaToValidate, path, document, visited);
59637
59750
  } catch (e) {
59638
59751
  return invalidSchemaResponseWithError(e);
59752
+ } finally {
59753
+ refsForData.delete(schema.$ref);
59754
+ if (refsForData.size === 0) visited.delete(data);
59639
59755
  }
59640
59756
  }
59641
59757
  function validateEnum(data, enumValue, path) {
@@ -61569,4 +61685,4 @@ register({
61569
61685
  });
61570
61686
 
61571
61687
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, initializeOneStore, registerReportObserver, reportGraphqlQueryParseError };
61572
- // version: 1.428.0-dev1-c95a813572
61688
+ // version: 1.428.0-dev11-b4d8cf1aec