@salesforce/lds-worker-api 1.428.0-dev4 → 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.
@@ -1371,4 +1371,4 @@ if (process.env.NODE_ENV !== 'production') {
1371
1371
  }
1372
1372
 
1373
1373
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1374
- // version: 1.428.0-dev4-fee7d2eeee
1374
+ // version: 1.428.0-dev6-7d0a2d506f
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
4274
4274
  }
4275
4275
  callbacks.push(callback);
4276
4276
  }
4277
- // version: 1.428.0-dev4-fee7d2eeee
4277
+ // version: 1.428.0-dev6-7d0a2d506f
4278
4278
 
4279
4279
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4280
4280
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5318,7 +5318,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
5318
5318
  const { apiFamily, name } = metadata;
5319
5319
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5320
5320
  }
5321
- // version: 1.428.0-dev4-fee7d2eeee
5321
+ // version: 1.428.0-dev6-7d0a2d506f
5322
5322
 
5323
5323
  function isSupportedEntity(_objectApiName) {
5324
5324
  return true;
@@ -32610,7 +32610,7 @@ withDefaultLuvio((luvio) => {
32610
32610
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
32611
32611
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
32612
32612
  });
32613
- // version: 1.428.0-dev4-42af22299b
32613
+ // version: 1.428.0-dev6-f96161ab92
32614
32614
 
32615
32615
  var allowUpdatesForNonCachedRecords = {
32616
32616
  isOpen: function (e) {
@@ -96239,7 +96239,7 @@ function buildServiceDescriptor$b(luvio) {
96239
96239
  },
96240
96240
  };
96241
96241
  }
96242
- // version: 1.428.0-dev4-42af22299b
96242
+ // version: 1.428.0-dev6-f96161ab92
96243
96243
 
96244
96244
  /**
96245
96245
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96265,7 +96265,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
96265
96265
  },
96266
96266
  };
96267
96267
  }
96268
- // version: 1.428.0-dev4-42af22299b
96268
+ // version: 1.428.0-dev6-f96161ab92
96269
96269
 
96270
96270
  /*!
96271
96271
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96750,6 +96750,9 @@ function invalidSchemaResponseWithError$1(error) {
96750
96750
  return err$1([error]);
96751
96751
  }
96752
96752
  function validateJsonSchema$1(data, schema, path = "$", document = schema) {
96753
+ return validateJsonSchemaInternal$1(data, schema, path, document, /* @__PURE__ */ new Map());
96754
+ }
96755
+ function validateJsonSchemaInternal$1(data, schema, path, document, visited) {
96753
96756
  if (schema === true) return validSchemaResponse$1();
96754
96757
  if (schema === false)
96755
96758
  return invalidSchemaResponseWithError$1(
@@ -96758,22 +96761,22 @@ function validateJsonSchema$1(data, schema, path = "$", document = schema) {
96758
96761
  const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
96759
96762
  const errorCollector = new JsonSchemaErrorCollector$1();
96760
96763
  if ("anyOf" in schema) {
96761
- errorCollector.append(validateAnyOf$1(data, schema, path, document));
96764
+ errorCollector.append(validateAnyOf$1(data, schema, path, document, visited));
96762
96765
  } else if ("oneOf" in schema) {
96763
- errorCollector.append(validateOneOf$1(data, schema, path, document));
96766
+ errorCollector.append(validateOneOf$1(data, schema, path, document, visited));
96764
96767
  } else if ("allOf" in schema) {
96765
- errorCollector.append(validateAllOf$1(data, schema, path, document));
96768
+ errorCollector.append(validateAllOf$1(data, schema, path, document, visited));
96766
96769
  } else if ("not" in schema) {
96767
- errorCollector.append(validateNot$1(data, schema, path, document));
96770
+ errorCollector.append(validateNot$1(data, schema, path, document, visited));
96768
96771
  } else if ("$ref" in schema) {
96769
- errorCollector.append(validateRef$1(data, schema, path, document));
96772
+ errorCollector.append(validateRef$1(data, schema, path, document, visited));
96770
96773
  } else if ("type" in schema) {
96771
96774
  if (schema.type === "object") {
96772
96775
  if (dataType !== "object") {
96773
96776
  errorCollector.add(incorrectTypeError$1("object", dataType, path));
96774
96777
  } else {
96775
96778
  errorCollector.append(
96776
- validateObject$1(data, schema, path, document)
96779
+ validateObject$1(data, schema, path, document, visited)
96777
96780
  );
96778
96781
  }
96779
96782
  } else if (schema.type === "array") {
@@ -96781,7 +96784,7 @@ function validateJsonSchema$1(data, schema, path = "$", document = schema) {
96781
96784
  errorCollector.add(incorrectTypeError$1("array", dataType, path));
96782
96785
  } else {
96783
96786
  errorCollector.append(
96784
- validateArray$1(data, schema, path, document)
96787
+ validateArray$1(data, schema, path, document, visited)
96785
96788
  );
96786
96789
  }
96787
96790
  } else {
@@ -96798,16 +96801,17 @@ function validateJsonSchema$1(data, schema, path = "$", document = schema) {
96798
96801
  }
96799
96802
  return errorCollector.toValidationResponse();
96800
96803
  }
96801
- function validateAnyOf$1(data, schema, path, document) {
96804
+ function validateAnyOf$1(data, schema, path, document, visited) {
96802
96805
  let isValid = false;
96803
96806
  const errorCollector = new JsonSchemaErrorCollector$1();
96804
96807
  for (let i = 0, { length } = schema.anyOf; i < length; i++) {
96805
96808
  const element = schema.anyOf[i];
96806
- const validationResponse = validateJsonSchema$1(
96809
+ const validationResponse = validateJsonSchemaInternal$1(
96807
96810
  data,
96808
96811
  element,
96809
96812
  `${path}.anyOf[${i}]`,
96810
- document
96813
+ document,
96814
+ visited
96811
96815
  );
96812
96816
  if (validationResponse.isOk()) {
96813
96817
  isValid = true;
@@ -96824,13 +96828,22 @@ function validateAnyOf$1(data, schema, path, document) {
96824
96828
  }
96825
96829
  return validSchemaResponse$1();
96826
96830
  }
96827
- function validateOneOf$1(data, schema, path, document) {
96831
+ function validateOneOf$1(data, schema, path, document, visited) {
96832
+ if (schema.discriminator !== void 0) {
96833
+ return validateDiscriminatedOneOf$1(data, schema.discriminator, path, document, visited);
96834
+ }
96828
96835
  let validSubShemaPaths = [];
96829
96836
  const errorCollector = new JsonSchemaErrorCollector$1();
96830
96837
  for (let i = 0, { length } = schema.oneOf; i < length; i++) {
96831
96838
  const element = schema.oneOf[i];
96832
96839
  const oneOfPath = `${path}.oneOf[${i}]`;
96833
- const validationResponse = validateJsonSchema$1(data, element, oneOfPath, document);
96840
+ const validationResponse = validateJsonSchemaInternal$1(
96841
+ data,
96842
+ element,
96843
+ oneOfPath,
96844
+ document,
96845
+ visited
96846
+ );
96834
96847
  if (validationResponse.isOk()) {
96835
96848
  validSubShemaPaths.push(oneOfPath);
96836
96849
  } else {
@@ -96852,16 +96865,45 @@ function validateOneOf$1(data, schema, path, document) {
96852
96865
  }
96853
96866
  return validSchemaResponse$1();
96854
96867
  }
96855
- function validateAllOf$1(data, schema, path, document) {
96868
+ function validateDiscriminatedOneOf$1(data, discriminator, path, document, visited) {
96869
+ if (data === null || typeof data !== "object" || Array.isArray(data)) {
96870
+ return invalidSchemaResponseWithError$1(incorrectTypeError$1("object", typeof data, path));
96871
+ }
96872
+ const { propertyName, mapping } = discriminator;
96873
+ const discriminatorValue = data[propertyName];
96874
+ if (discriminatorValue === void 0) {
96875
+ return invalidSchemaResponseWithError$1(
96876
+ new MissingRequiredPropertyError$1(
96877
+ `Object at path '${path}' is missing required discriminator property '${propertyName}'.`
96878
+ )
96879
+ );
96880
+ }
96881
+ if (typeof discriminatorValue !== "string") {
96882
+ return invalidSchemaResponseWithError$1(
96883
+ incorrectTypeError$1("string", typeof discriminatorValue, `${path}.${propertyName}`)
96884
+ );
96885
+ }
96886
+ const targetRef = mapping[discriminatorValue];
96887
+ if (targetRef === void 0) {
96888
+ return invalidSchemaResponseWithError$1(
96889
+ new JsonSchemaViolationError$1(
96890
+ `Discriminator value '${discriminatorValue}' at '${path}.${propertyName}' is not in the mapping. Expected one of: [${Object.keys(mapping).join(", ")}].`
96891
+ )
96892
+ );
96893
+ }
96894
+ return validateJsonSchemaInternal$1(data, { $ref: targetRef }, path, document, visited);
96895
+ }
96896
+ function validateAllOf$1(data, schema, path, document, visited) {
96856
96897
  let isValid = true;
96857
96898
  const errorCollector = new JsonSchemaErrorCollector$1();
96858
96899
  for (let i = 0, { length } = schema.allOf; i < length; i++) {
96859
96900
  const element = schema.allOf[i];
96860
- const validationResponse = validateJsonSchema$1(
96901
+ const validationResponse = validateJsonSchemaInternal$1(
96861
96902
  data,
96862
96903
  element,
96863
96904
  `${path}.allOf[${i}]`,
96864
- document
96905
+ document,
96906
+ visited
96865
96907
  );
96866
96908
  if (!validationResponse.isOk()) {
96867
96909
  errorCollector.append(validationResponse);
@@ -96875,8 +96917,14 @@ function validateAllOf$1(data, schema, path, document) {
96875
96917
  }
96876
96918
  return errorCollector.toValidationResponse();
96877
96919
  }
96878
- function validateNot$1(data, schema, path, document) {
96879
- const validationResponse = validateJsonSchema$1(data, schema.not, path, document);
96920
+ function validateNot$1(data, schema, path, document, visited) {
96921
+ const validationResponse = validateJsonSchemaInternal$1(
96922
+ data,
96923
+ schema.not,
96924
+ path,
96925
+ document,
96926
+ visited
96927
+ );
96880
96928
  if (validationResponse.isOk()) {
96881
96929
  return invalidSchemaResponseWithError$1(
96882
96930
  new JsonSchemaViolationError$1(
@@ -96886,7 +96934,7 @@ function validateNot$1(data, schema, path, document) {
96886
96934
  }
96887
96935
  return validSchemaResponse$1();
96888
96936
  }
96889
- function validateObject$1(data, schema, path, document) {
96937
+ function validateObject$1(data, schema, path, document, visited) {
96890
96938
  const schemaKeys = Object.keys(schema.properties);
96891
96939
  const requiredKeys = new Set(schema.required);
96892
96940
  const schemaKeySet = new Set(schemaKeys);
@@ -96894,11 +96942,12 @@ function validateObject$1(data, schema, path, document) {
96894
96942
  Object.keys(data).forEach((key) => {
96895
96943
  if (!schemaKeySet.has(key)) {
96896
96944
  errorCollector.append(
96897
- validateJsonSchema$1(
96945
+ validateJsonSchemaInternal$1(
96898
96946
  data[key],
96899
96947
  schema.additionalProperties,
96900
96948
  `${path}.additionalProperties[${key}]`,
96901
- document
96949
+ document,
96950
+ visited
96902
96951
  )
96903
96952
  );
96904
96953
  }
@@ -96915,18 +96964,19 @@ function validateObject$1(data, schema, path, document) {
96915
96964
  }
96916
96965
  if (keyInData) {
96917
96966
  errorCollector.append(
96918
- validateJsonSchema$1(
96967
+ validateJsonSchemaInternal$1(
96919
96968
  data[key],
96920
96969
  schema.properties[key],
96921
96970
  `${path}.${key}`,
96922
- document
96971
+ document,
96972
+ visited
96923
96973
  )
96924
96974
  );
96925
96975
  }
96926
96976
  }
96927
96977
  return errorCollector.toValidationResponse();
96928
96978
  }
96929
- function validateArray$1(data, schema, path, document) {
96979
+ function validateArray$1(data, schema, path, document, visited) {
96930
96980
  if (schema.minItems !== void 0 && data.length < schema.minItems) {
96931
96981
  return invalidSchemaResponseWithError$1(
96932
96982
  new MinItemsViolationError$1(
@@ -96944,7 +96994,13 @@ function validateArray$1(data, schema, path, document) {
96944
96994
  const errorCollector = new JsonSchemaErrorCollector$1();
96945
96995
  data.forEach(
96946
96996
  (element, index) => errorCollector.append(
96947
- validateJsonSchema$1(element, schema.items, `${path}[${index}]`, document)
96997
+ validateJsonSchemaInternal$1(
96998
+ element,
96999
+ schema.items,
97000
+ `${path}[${index}]`,
97001
+ document,
97002
+ visited
97003
+ )
96948
97004
  )
96949
97005
  );
96950
97006
  return errorCollector.toValidationResponse();
@@ -96979,7 +97035,7 @@ function validateScalar$1(data, schema, path) {
96979
97035
  }
96980
97036
  return validSchemaResponse$1();
96981
97037
  }
96982
- function validateRef$1(data, schema, path, document) {
97038
+ function validateRef$1(data, schema, path, document, visited) {
96983
97039
  if (!schema.$ref.startsWith("#")) {
96984
97040
  return invalidSchemaResponseWithError$1(
96985
97041
  new InvalidRefError$1(
@@ -96987,11 +97043,23 @@ function validateRef$1(data, schema, path, document) {
96987
97043
  )
96988
97044
  );
96989
97045
  }
97046
+ let refsForData = visited.get(data);
97047
+ if (refsForData !== void 0 && refsForData.has(schema.$ref)) {
97048
+ return validSchemaResponse$1();
97049
+ }
97050
+ if (refsForData === void 0) {
97051
+ refsForData = /* @__PURE__ */ new Set();
97052
+ visited.set(data, refsForData);
97053
+ }
97054
+ refsForData.add(schema.$ref);
96990
97055
  try {
96991
97056
  const schemaToValidate = findSchemaAtPath$1(document, schema.$ref);
96992
- return validateJsonSchema$1(data, schemaToValidate, path, document);
97057
+ return validateJsonSchemaInternal$1(data, schemaToValidate, path, document, visited);
96993
97058
  } catch (e) {
96994
97059
  return invalidSchemaResponseWithError$1(e);
97060
+ } finally {
97061
+ refsForData.delete(schema.$ref);
97062
+ if (refsForData.size === 0) visited.delete(data);
96995
97063
  }
96996
97064
  }
96997
97065
  function validateEnum$1(data, enumValue, path) {
@@ -98922,7 +98990,7 @@ register$1({
98922
98990
  id: '@salesforce/lds-network-adapter',
98923
98991
  instrument: instrument$2,
98924
98992
  });
98925
- // version: 1.428.0-dev4-fee7d2eeee
98993
+ // version: 1.428.0-dev6-7d0a2d506f
98926
98994
 
98927
98995
  const { create: create$2, keys: keys$2 } = Object;
98928
98996
  const { stringify, parse } = JSON;
@@ -99013,6 +99081,9 @@ function invalidSchemaResponseWithError(error) {
99013
99081
  return err$4([error]);
99014
99082
  }
99015
99083
  function validateJsonSchema(data, schema, path = "$", document = schema) {
99084
+ return validateJsonSchemaInternal(data, schema, path, document, /* @__PURE__ */ new Map());
99085
+ }
99086
+ function validateJsonSchemaInternal(data, schema, path, document, visited) {
99016
99087
  if (schema === true) return validSchemaResponse();
99017
99088
  if (schema === false)
99018
99089
  return invalidSchemaResponseWithError(
@@ -99021,22 +99092,22 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
99021
99092
  const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
99022
99093
  const errorCollector = new JsonSchemaErrorCollector();
99023
99094
  if ("anyOf" in schema) {
99024
- errorCollector.append(validateAnyOf(data, schema, path, document));
99095
+ errorCollector.append(validateAnyOf(data, schema, path, document, visited));
99025
99096
  } else if ("oneOf" in schema) {
99026
- errorCollector.append(validateOneOf(data, schema, path, document));
99097
+ errorCollector.append(validateOneOf(data, schema, path, document, visited));
99027
99098
  } else if ("allOf" in schema) {
99028
- errorCollector.append(validateAllOf(data, schema, path, document));
99099
+ errorCollector.append(validateAllOf(data, schema, path, document, visited));
99029
99100
  } else if ("not" in schema) {
99030
- errorCollector.append(validateNot(data, schema, path, document));
99101
+ errorCollector.append(validateNot(data, schema, path, document, visited));
99031
99102
  } else if ("$ref" in schema) {
99032
- errorCollector.append(validateRef(data, schema, path, document));
99103
+ errorCollector.append(validateRef(data, schema, path, document, visited));
99033
99104
  } else if ("type" in schema) {
99034
99105
  if (schema.type === "object") {
99035
99106
  if (dataType !== "object") {
99036
99107
  errorCollector.add(incorrectTypeError("object", dataType, path));
99037
99108
  } else {
99038
99109
  errorCollector.append(
99039
- validateObject(data, schema, path, document)
99110
+ validateObject(data, schema, path, document, visited)
99040
99111
  );
99041
99112
  }
99042
99113
  } else if (schema.type === "array") {
@@ -99044,7 +99115,7 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
99044
99115
  errorCollector.add(incorrectTypeError("array", dataType, path));
99045
99116
  } else {
99046
99117
  errorCollector.append(
99047
- validateArray(data, schema, path, document)
99118
+ validateArray(data, schema, path, document, visited)
99048
99119
  );
99049
99120
  }
99050
99121
  } else {
@@ -99061,16 +99132,17 @@ function validateJsonSchema(data, schema, path = "$", document = schema) {
99061
99132
  }
99062
99133
  return errorCollector.toValidationResponse();
99063
99134
  }
99064
- function validateAnyOf(data, schema, path, document) {
99135
+ function validateAnyOf(data, schema, path, document, visited) {
99065
99136
  let isValid = false;
99066
99137
  const errorCollector = new JsonSchemaErrorCollector();
99067
99138
  for (let i = 0, { length } = schema.anyOf; i < length; i++) {
99068
99139
  const element = schema.anyOf[i];
99069
- const validationResponse = validateJsonSchema(
99140
+ const validationResponse = validateJsonSchemaInternal(
99070
99141
  data,
99071
99142
  element,
99072
99143
  `${path}.anyOf[${i}]`,
99073
- document
99144
+ document,
99145
+ visited
99074
99146
  );
99075
99147
  if (validationResponse.isOk()) {
99076
99148
  isValid = true;
@@ -99087,13 +99159,22 @@ function validateAnyOf(data, schema, path, document) {
99087
99159
  }
99088
99160
  return validSchemaResponse();
99089
99161
  }
99090
- function validateOneOf(data, schema, path, document) {
99162
+ function validateOneOf(data, schema, path, document, visited) {
99163
+ if (schema.discriminator !== void 0) {
99164
+ return validateDiscriminatedOneOf(data, schema.discriminator, path, document, visited);
99165
+ }
99091
99166
  let validSubShemaPaths = [];
99092
99167
  const errorCollector = new JsonSchemaErrorCollector();
99093
99168
  for (let i = 0, { length } = schema.oneOf; i < length; i++) {
99094
99169
  const element = schema.oneOf[i];
99095
99170
  const oneOfPath = `${path}.oneOf[${i}]`;
99096
- const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
99171
+ const validationResponse = validateJsonSchemaInternal(
99172
+ data,
99173
+ element,
99174
+ oneOfPath,
99175
+ document,
99176
+ visited
99177
+ );
99097
99178
  if (validationResponse.isOk()) {
99098
99179
  validSubShemaPaths.push(oneOfPath);
99099
99180
  } else {
@@ -99115,16 +99196,45 @@ function validateOneOf(data, schema, path, document) {
99115
99196
  }
99116
99197
  return validSchemaResponse();
99117
99198
  }
99118
- function validateAllOf(data, schema, path, document) {
99199
+ function validateDiscriminatedOneOf(data, discriminator, path, document, visited) {
99200
+ if (data === null || typeof data !== "object" || Array.isArray(data)) {
99201
+ return invalidSchemaResponseWithError(incorrectTypeError("object", typeof data, path));
99202
+ }
99203
+ const { propertyName, mapping } = discriminator;
99204
+ const discriminatorValue = data[propertyName];
99205
+ if (discriminatorValue === void 0) {
99206
+ return invalidSchemaResponseWithError(
99207
+ new MissingRequiredPropertyError(
99208
+ `Object at path '${path}' is missing required discriminator property '${propertyName}'.`
99209
+ )
99210
+ );
99211
+ }
99212
+ if (typeof discriminatorValue !== "string") {
99213
+ return invalidSchemaResponseWithError(
99214
+ incorrectTypeError("string", typeof discriminatorValue, `${path}.${propertyName}`)
99215
+ );
99216
+ }
99217
+ const targetRef = mapping[discriminatorValue];
99218
+ if (targetRef === void 0) {
99219
+ return invalidSchemaResponseWithError(
99220
+ new JsonSchemaViolationError(
99221
+ `Discriminator value '${discriminatorValue}' at '${path}.${propertyName}' is not in the mapping. Expected one of: [${Object.keys(mapping).join(", ")}].`
99222
+ )
99223
+ );
99224
+ }
99225
+ return validateJsonSchemaInternal(data, { $ref: targetRef }, path, document, visited);
99226
+ }
99227
+ function validateAllOf(data, schema, path, document, visited) {
99119
99228
  let isValid = true;
99120
99229
  const errorCollector = new JsonSchemaErrorCollector();
99121
99230
  for (let i = 0, { length } = schema.allOf; i < length; i++) {
99122
99231
  const element = schema.allOf[i];
99123
- const validationResponse = validateJsonSchema(
99232
+ const validationResponse = validateJsonSchemaInternal(
99124
99233
  data,
99125
99234
  element,
99126
99235
  `${path}.allOf[${i}]`,
99127
- document
99236
+ document,
99237
+ visited
99128
99238
  );
99129
99239
  if (!validationResponse.isOk()) {
99130
99240
  errorCollector.append(validationResponse);
@@ -99138,8 +99248,14 @@ function validateAllOf(data, schema, path, document) {
99138
99248
  }
99139
99249
  return errorCollector.toValidationResponse();
99140
99250
  }
99141
- function validateNot(data, schema, path, document) {
99142
- const validationResponse = validateJsonSchema(data, schema.not, path, document);
99251
+ function validateNot(data, schema, path, document, visited) {
99252
+ const validationResponse = validateJsonSchemaInternal(
99253
+ data,
99254
+ schema.not,
99255
+ path,
99256
+ document,
99257
+ visited
99258
+ );
99143
99259
  if (validationResponse.isOk()) {
99144
99260
  return invalidSchemaResponseWithError(
99145
99261
  new JsonSchemaViolationError(
@@ -99149,7 +99265,7 @@ function validateNot(data, schema, path, document) {
99149
99265
  }
99150
99266
  return validSchemaResponse();
99151
99267
  }
99152
- function validateObject(data, schema, path, document) {
99268
+ function validateObject(data, schema, path, document, visited) {
99153
99269
  const schemaKeys = Object.keys(schema.properties);
99154
99270
  const requiredKeys = new Set(schema.required);
99155
99271
  const schemaKeySet = new Set(schemaKeys);
@@ -99157,11 +99273,12 @@ function validateObject(data, schema, path, document) {
99157
99273
  Object.keys(data).forEach((key) => {
99158
99274
  if (!schemaKeySet.has(key)) {
99159
99275
  errorCollector.append(
99160
- validateJsonSchema(
99276
+ validateJsonSchemaInternal(
99161
99277
  data[key],
99162
99278
  schema.additionalProperties,
99163
99279
  `${path}.additionalProperties[${key}]`,
99164
- document
99280
+ document,
99281
+ visited
99165
99282
  )
99166
99283
  );
99167
99284
  }
@@ -99178,18 +99295,19 @@ function validateObject(data, schema, path, document) {
99178
99295
  }
99179
99296
  if (keyInData) {
99180
99297
  errorCollector.append(
99181
- validateJsonSchema(
99298
+ validateJsonSchemaInternal(
99182
99299
  data[key],
99183
99300
  schema.properties[key],
99184
99301
  `${path}.${key}`,
99185
- document
99302
+ document,
99303
+ visited
99186
99304
  )
99187
99305
  );
99188
99306
  }
99189
99307
  }
99190
99308
  return errorCollector.toValidationResponse();
99191
99309
  }
99192
- function validateArray(data, schema, path, document) {
99310
+ function validateArray(data, schema, path, document, visited) {
99193
99311
  if (schema.minItems !== void 0 && data.length < schema.minItems) {
99194
99312
  return invalidSchemaResponseWithError(
99195
99313
  new MinItemsViolationError(
@@ -99207,7 +99325,13 @@ function validateArray(data, schema, path, document) {
99207
99325
  const errorCollector = new JsonSchemaErrorCollector();
99208
99326
  data.forEach(
99209
99327
  (element, index) => errorCollector.append(
99210
- validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
99328
+ validateJsonSchemaInternal(
99329
+ element,
99330
+ schema.items,
99331
+ `${path}[${index}]`,
99332
+ document,
99333
+ visited
99334
+ )
99211
99335
  )
99212
99336
  );
99213
99337
  return errorCollector.toValidationResponse();
@@ -99242,7 +99366,7 @@ function validateScalar(data, schema, path) {
99242
99366
  }
99243
99367
  return validSchemaResponse();
99244
99368
  }
99245
- function validateRef(data, schema, path, document) {
99369
+ function validateRef(data, schema, path, document, visited) {
99246
99370
  if (!schema.$ref.startsWith("#")) {
99247
99371
  return invalidSchemaResponseWithError(
99248
99372
  new InvalidRefError(
@@ -99250,11 +99374,23 @@ function validateRef(data, schema, path, document) {
99250
99374
  )
99251
99375
  );
99252
99376
  }
99377
+ let refsForData = visited.get(data);
99378
+ if (refsForData !== void 0 && refsForData.has(schema.$ref)) {
99379
+ return validSchemaResponse();
99380
+ }
99381
+ if (refsForData === void 0) {
99382
+ refsForData = /* @__PURE__ */ new Set();
99383
+ visited.set(data, refsForData);
99384
+ }
99385
+ refsForData.add(schema.$ref);
99253
99386
  try {
99254
99387
  const schemaToValidate = findSchemaAtPath(document, schema.$ref);
99255
- return validateJsonSchema(data, schemaToValidate, path, document);
99388
+ return validateJsonSchemaInternal(data, schemaToValidate, path, document, visited);
99256
99389
  } catch (e) {
99257
99390
  return invalidSchemaResponseWithError(e);
99391
+ } finally {
99392
+ refsForData.delete(schema.$ref);
99393
+ if (refsForData.size === 0) visited.delete(data);
99258
99394
  }
99259
99395
  }
99260
99396
  function validateEnum(data, enumValue, path) {
@@ -106860,7 +106996,7 @@ getServices(serviceRequirements).then((services) => {
106860
106996
  _(config, CONFIG_SCHEMA);
106861
106997
  const baseCommand = new graphql_imperative_ctor(config, documentRootType, services);
106862
106998
  return applyDecorators(baseCommand, [services.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);
106863
- }, false);
106999
+ }, true);
106864
107000
  graphql_imperative_legacy = services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
106865
107001
  const _ = assertIsValid;
106866
107002
  _(config, CONFIG_SCHEMA);
@@ -106913,7 +107049,7 @@ function registerCallback(cb) {
106913
107049
  cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
106914
107050
  }
106915
107051
  }
106916
- // version: 1.428.0-dev4-42af22299b
107052
+ // version: 1.428.0-dev6-f96161ab92
106917
107053
 
106918
107054
  function createFragmentMap(documentNode) {
106919
107055
  const fragments = {};
@@ -136150,7 +136286,7 @@ register$1({
136150
136286
  configuration: { ...configurationForGraphQLAdapters$1 },
136151
136287
  instrument: instrument$1,
136152
136288
  });
136153
- // version: 1.428.0-dev4-42af22299b
136289
+ // version: 1.428.0-dev6-f96161ab92
136154
136290
 
136155
136291
  // On core the unstable adapters are re-exported with different names,
136156
136292
  // we want to match them here.
@@ -136302,7 +136438,7 @@ withDefaultLuvio((luvio) => {
136302
136438
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
136303
136439
  graphQLImperative = ldsAdapter;
136304
136440
  });
136305
- // version: 1.428.0-dev4-42af22299b
136441
+ // version: 1.428.0-dev6-f96161ab92
136306
136442
 
136307
136443
  var gqlApi = /*#__PURE__*/Object.freeze({
136308
136444
  __proto__: null,
@@ -137101,7 +137237,7 @@ const callbacks$1 = [];
137101
137237
  function register(r) {
137102
137238
  callbacks$1.forEach((callback) => callback(r));
137103
137239
  }
137104
- // version: 1.428.0-dev4-fee7d2eeee
137240
+ // version: 1.428.0-dev6-7d0a2d506f
137105
137241
 
137106
137242
  /**
137107
137243
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -138417,4 +138553,4 @@ const { luvio } = getRuntime();
138417
138553
  setDefaultLuvio({ luvio });
138418
138554
 
138419
138555
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
138420
- // version: 1.428.0-dev4-fee7d2eeee
138556
+ // version: 1.428.0-dev6-7d0a2d506f
@@ -4280,7 +4280,7 @@
4280
4280
  }
4281
4281
  callbacks.push(callback);
4282
4282
  }
4283
- // version: 1.428.0-dev4-fee7d2eeee
4283
+ // version: 1.428.0-dev6-7d0a2d506f
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-dev4-fee7d2eeee
5327
+ // version: 1.428.0-dev6-7d0a2d506f
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-dev4-42af22299b
32619
+ // version: 1.428.0-dev6-f96161ab92
32620
32620
 
32621
32621
  var allowUpdatesForNonCachedRecords = {
32622
32622
  isOpen: function (e) {
@@ -96245,7 +96245,7 @@
96245
96245
  },
96246
96246
  };
96247
96247
  }
96248
- // version: 1.428.0-dev4-42af22299b
96248
+ // version: 1.428.0-dev6-f96161ab92
96249
96249
 
96250
96250
  /**
96251
96251
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96271,7 +96271,7 @@
96271
96271
  },
96272
96272
  };
96273
96273
  }
96274
- // version: 1.428.0-dev4-42af22299b
96274
+ // version: 1.428.0-dev6-f96161ab92
96275
96275
 
96276
96276
  /*!
96277
96277
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96756,6 +96756,9 @@
96756
96756
  return err$1([error]);
96757
96757
  }
96758
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) {
96759
96762
  if (schema === true) return validSchemaResponse$1();
96760
96763
  if (schema === false)
96761
96764
  return invalidSchemaResponseWithError$1(
@@ -96764,22 +96767,22 @@
96764
96767
  const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
96765
96768
  const errorCollector = new JsonSchemaErrorCollector$1();
96766
96769
  if ("anyOf" in schema) {
96767
- errorCollector.append(validateAnyOf$1(data, schema, path, document));
96770
+ errorCollector.append(validateAnyOf$1(data, schema, path, document, visited));
96768
96771
  } else if ("oneOf" in schema) {
96769
- errorCollector.append(validateOneOf$1(data, schema, path, document));
96772
+ errorCollector.append(validateOneOf$1(data, schema, path, document, visited));
96770
96773
  } else if ("allOf" in schema) {
96771
- errorCollector.append(validateAllOf$1(data, schema, path, document));
96774
+ errorCollector.append(validateAllOf$1(data, schema, path, document, visited));
96772
96775
  } else if ("not" in schema) {
96773
- errorCollector.append(validateNot$1(data, schema, path, document));
96776
+ errorCollector.append(validateNot$1(data, schema, path, document, visited));
96774
96777
  } else if ("$ref" in schema) {
96775
- errorCollector.append(validateRef$1(data, schema, path, document));
96778
+ errorCollector.append(validateRef$1(data, schema, path, document, visited));
96776
96779
  } else if ("type" in schema) {
96777
96780
  if (schema.type === "object") {
96778
96781
  if (dataType !== "object") {
96779
96782
  errorCollector.add(incorrectTypeError$1("object", dataType, path));
96780
96783
  } else {
96781
96784
  errorCollector.append(
96782
- validateObject$1(data, schema, path, document)
96785
+ validateObject$1(data, schema, path, document, visited)
96783
96786
  );
96784
96787
  }
96785
96788
  } else if (schema.type === "array") {
@@ -96787,7 +96790,7 @@
96787
96790
  errorCollector.add(incorrectTypeError$1("array", dataType, path));
96788
96791
  } else {
96789
96792
  errorCollector.append(
96790
- validateArray$1(data, schema, path, document)
96793
+ validateArray$1(data, schema, path, document, visited)
96791
96794
  );
96792
96795
  }
96793
96796
  } else {
@@ -96804,16 +96807,17 @@
96804
96807
  }
96805
96808
  return errorCollector.toValidationResponse();
96806
96809
  }
96807
- function validateAnyOf$1(data, schema, path, document) {
96810
+ function validateAnyOf$1(data, schema, path, document, visited) {
96808
96811
  let isValid = false;
96809
96812
  const errorCollector = new JsonSchemaErrorCollector$1();
96810
96813
  for (let i = 0, { length } = schema.anyOf; i < length; i++) {
96811
96814
  const element = schema.anyOf[i];
96812
- const validationResponse = validateJsonSchema$1(
96815
+ const validationResponse = validateJsonSchemaInternal$1(
96813
96816
  data,
96814
96817
  element,
96815
96818
  `${path}.anyOf[${i}]`,
96816
- document
96819
+ document,
96820
+ visited
96817
96821
  );
96818
96822
  if (validationResponse.isOk()) {
96819
96823
  isValid = true;
@@ -96830,13 +96834,22 @@
96830
96834
  }
96831
96835
  return validSchemaResponse$1();
96832
96836
  }
96833
- 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
+ }
96834
96841
  let validSubShemaPaths = [];
96835
96842
  const errorCollector = new JsonSchemaErrorCollector$1();
96836
96843
  for (let i = 0, { length } = schema.oneOf; i < length; i++) {
96837
96844
  const element = schema.oneOf[i];
96838
96845
  const oneOfPath = `${path}.oneOf[${i}]`;
96839
- const validationResponse = validateJsonSchema$1(data, element, oneOfPath, document);
96846
+ const validationResponse = validateJsonSchemaInternal$1(
96847
+ data,
96848
+ element,
96849
+ oneOfPath,
96850
+ document,
96851
+ visited
96852
+ );
96840
96853
  if (validationResponse.isOk()) {
96841
96854
  validSubShemaPaths.push(oneOfPath);
96842
96855
  } else {
@@ -96858,16 +96871,45 @@
96858
96871
  }
96859
96872
  return validSchemaResponse$1();
96860
96873
  }
96861
- function validateAllOf$1(data, schema, path, document) {
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) {
96862
96903
  let isValid = true;
96863
96904
  const errorCollector = new JsonSchemaErrorCollector$1();
96864
96905
  for (let i = 0, { length } = schema.allOf; i < length; i++) {
96865
96906
  const element = schema.allOf[i];
96866
- const validationResponse = validateJsonSchema$1(
96907
+ const validationResponse = validateJsonSchemaInternal$1(
96867
96908
  data,
96868
96909
  element,
96869
96910
  `${path}.allOf[${i}]`,
96870
- document
96911
+ document,
96912
+ visited
96871
96913
  );
96872
96914
  if (!validationResponse.isOk()) {
96873
96915
  errorCollector.append(validationResponse);
@@ -96881,8 +96923,14 @@
96881
96923
  }
96882
96924
  return errorCollector.toValidationResponse();
96883
96925
  }
96884
- function validateNot$1(data, schema, path, document) {
96885
- const validationResponse = validateJsonSchema$1(data, schema.not, path, document);
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
+ );
96886
96934
  if (validationResponse.isOk()) {
96887
96935
  return invalidSchemaResponseWithError$1(
96888
96936
  new JsonSchemaViolationError$1(
@@ -96892,7 +96940,7 @@
96892
96940
  }
96893
96941
  return validSchemaResponse$1();
96894
96942
  }
96895
- function validateObject$1(data, schema, path, document) {
96943
+ function validateObject$1(data, schema, path, document, visited) {
96896
96944
  const schemaKeys = Object.keys(schema.properties);
96897
96945
  const requiredKeys = new Set(schema.required);
96898
96946
  const schemaKeySet = new Set(schemaKeys);
@@ -96900,11 +96948,12 @@
96900
96948
  Object.keys(data).forEach((key) => {
96901
96949
  if (!schemaKeySet.has(key)) {
96902
96950
  errorCollector.append(
96903
- validateJsonSchema$1(
96951
+ validateJsonSchemaInternal$1(
96904
96952
  data[key],
96905
96953
  schema.additionalProperties,
96906
96954
  `${path}.additionalProperties[${key}]`,
96907
- document
96955
+ document,
96956
+ visited
96908
96957
  )
96909
96958
  );
96910
96959
  }
@@ -96921,18 +96970,19 @@
96921
96970
  }
96922
96971
  if (keyInData) {
96923
96972
  errorCollector.append(
96924
- validateJsonSchema$1(
96973
+ validateJsonSchemaInternal$1(
96925
96974
  data[key],
96926
96975
  schema.properties[key],
96927
96976
  `${path}.${key}`,
96928
- document
96977
+ document,
96978
+ visited
96929
96979
  )
96930
96980
  );
96931
96981
  }
96932
96982
  }
96933
96983
  return errorCollector.toValidationResponse();
96934
96984
  }
96935
- function validateArray$1(data, schema, path, document) {
96985
+ function validateArray$1(data, schema, path, document, visited) {
96936
96986
  if (schema.minItems !== void 0 && data.length < schema.minItems) {
96937
96987
  return invalidSchemaResponseWithError$1(
96938
96988
  new MinItemsViolationError$1(
@@ -96950,7 +97000,13 @@
96950
97000
  const errorCollector = new JsonSchemaErrorCollector$1();
96951
97001
  data.forEach(
96952
97002
  (element, index) => errorCollector.append(
96953
- validateJsonSchema$1(element, schema.items, `${path}[${index}]`, document)
97003
+ validateJsonSchemaInternal$1(
97004
+ element,
97005
+ schema.items,
97006
+ `${path}[${index}]`,
97007
+ document,
97008
+ visited
97009
+ )
96954
97010
  )
96955
97011
  );
96956
97012
  return errorCollector.toValidationResponse();
@@ -96985,7 +97041,7 @@
96985
97041
  }
96986
97042
  return validSchemaResponse$1();
96987
97043
  }
96988
- function validateRef$1(data, schema, path, document) {
97044
+ function validateRef$1(data, schema, path, document, visited) {
96989
97045
  if (!schema.$ref.startsWith("#")) {
96990
97046
  return invalidSchemaResponseWithError$1(
96991
97047
  new InvalidRefError$1(
@@ -96993,11 +97049,23 @@
96993
97049
  )
96994
97050
  );
96995
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);
96996
97061
  try {
96997
97062
  const schemaToValidate = findSchemaAtPath$1(document, schema.$ref);
96998
- return validateJsonSchema$1(data, schemaToValidate, path, document);
97063
+ return validateJsonSchemaInternal$1(data, schemaToValidate, path, document, visited);
96999
97064
  } catch (e) {
97000
97065
  return invalidSchemaResponseWithError$1(e);
97066
+ } finally {
97067
+ refsForData.delete(schema.$ref);
97068
+ if (refsForData.size === 0) visited.delete(data);
97001
97069
  }
97002
97070
  }
97003
97071
  function validateEnum$1(data, enumValue, path) {
@@ -98928,7 +98996,7 @@
98928
98996
  id: '@salesforce/lds-network-adapter',
98929
98997
  instrument: instrument$2,
98930
98998
  });
98931
- // version: 1.428.0-dev4-fee7d2eeee
98999
+ // version: 1.428.0-dev6-7d0a2d506f
98932
99000
 
98933
99001
  const { create: create$2, keys: keys$2 } = Object;
98934
99002
  const { stringify, parse } = JSON;
@@ -99019,6 +99087,9 @@
99019
99087
  return err$4([error]);
99020
99088
  }
99021
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) {
99022
99093
  if (schema === true) return validSchemaResponse();
99023
99094
  if (schema === false)
99024
99095
  return invalidSchemaResponseWithError(
@@ -99027,22 +99098,22 @@
99027
99098
  const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
99028
99099
  const errorCollector = new JsonSchemaErrorCollector();
99029
99100
  if ("anyOf" in schema) {
99030
- errorCollector.append(validateAnyOf(data, schema, path, document));
99101
+ errorCollector.append(validateAnyOf(data, schema, path, document, visited));
99031
99102
  } else if ("oneOf" in schema) {
99032
- errorCollector.append(validateOneOf(data, schema, path, document));
99103
+ errorCollector.append(validateOneOf(data, schema, path, document, visited));
99033
99104
  } else if ("allOf" in schema) {
99034
- errorCollector.append(validateAllOf(data, schema, path, document));
99105
+ errorCollector.append(validateAllOf(data, schema, path, document, visited));
99035
99106
  } else if ("not" in schema) {
99036
- errorCollector.append(validateNot(data, schema, path, document));
99107
+ errorCollector.append(validateNot(data, schema, path, document, visited));
99037
99108
  } else if ("$ref" in schema) {
99038
- errorCollector.append(validateRef(data, schema, path, document));
99109
+ errorCollector.append(validateRef(data, schema, path, document, visited));
99039
99110
  } else if ("type" in schema) {
99040
99111
  if (schema.type === "object") {
99041
99112
  if (dataType !== "object") {
99042
99113
  errorCollector.add(incorrectTypeError("object", dataType, path));
99043
99114
  } else {
99044
99115
  errorCollector.append(
99045
- validateObject(data, schema, path, document)
99116
+ validateObject(data, schema, path, document, visited)
99046
99117
  );
99047
99118
  }
99048
99119
  } else if (schema.type === "array") {
@@ -99050,7 +99121,7 @@
99050
99121
  errorCollector.add(incorrectTypeError("array", dataType, path));
99051
99122
  } else {
99052
99123
  errorCollector.append(
99053
- validateArray(data, schema, path, document)
99124
+ validateArray(data, schema, path, document, visited)
99054
99125
  );
99055
99126
  }
99056
99127
  } else {
@@ -99067,16 +99138,17 @@
99067
99138
  }
99068
99139
  return errorCollector.toValidationResponse();
99069
99140
  }
99070
- function validateAnyOf(data, schema, path, document) {
99141
+ function validateAnyOf(data, schema, path, document, visited) {
99071
99142
  let isValid = false;
99072
99143
  const errorCollector = new JsonSchemaErrorCollector();
99073
99144
  for (let i = 0, { length } = schema.anyOf; i < length; i++) {
99074
99145
  const element = schema.anyOf[i];
99075
- const validationResponse = validateJsonSchema(
99146
+ const validationResponse = validateJsonSchemaInternal(
99076
99147
  data,
99077
99148
  element,
99078
99149
  `${path}.anyOf[${i}]`,
99079
- document
99150
+ document,
99151
+ visited
99080
99152
  );
99081
99153
  if (validationResponse.isOk()) {
99082
99154
  isValid = true;
@@ -99093,13 +99165,22 @@
99093
99165
  }
99094
99166
  return validSchemaResponse();
99095
99167
  }
99096
- 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
+ }
99097
99172
  let validSubShemaPaths = [];
99098
99173
  const errorCollector = new JsonSchemaErrorCollector();
99099
99174
  for (let i = 0, { length } = schema.oneOf; i < length; i++) {
99100
99175
  const element = schema.oneOf[i];
99101
99176
  const oneOfPath = `${path}.oneOf[${i}]`;
99102
- const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
99177
+ const validationResponse = validateJsonSchemaInternal(
99178
+ data,
99179
+ element,
99180
+ oneOfPath,
99181
+ document,
99182
+ visited
99183
+ );
99103
99184
  if (validationResponse.isOk()) {
99104
99185
  validSubShemaPaths.push(oneOfPath);
99105
99186
  } else {
@@ -99121,16 +99202,45 @@
99121
99202
  }
99122
99203
  return validSchemaResponse();
99123
99204
  }
99124
- function validateAllOf(data, schema, path, document) {
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) {
99125
99234
  let isValid = true;
99126
99235
  const errorCollector = new JsonSchemaErrorCollector();
99127
99236
  for (let i = 0, { length } = schema.allOf; i < length; i++) {
99128
99237
  const element = schema.allOf[i];
99129
- const validationResponse = validateJsonSchema(
99238
+ const validationResponse = validateJsonSchemaInternal(
99130
99239
  data,
99131
99240
  element,
99132
99241
  `${path}.allOf[${i}]`,
99133
- document
99242
+ document,
99243
+ visited
99134
99244
  );
99135
99245
  if (!validationResponse.isOk()) {
99136
99246
  errorCollector.append(validationResponse);
@@ -99144,8 +99254,14 @@
99144
99254
  }
99145
99255
  return errorCollector.toValidationResponse();
99146
99256
  }
99147
- function validateNot(data, schema, path, document) {
99148
- const validationResponse = validateJsonSchema(data, schema.not, path, document);
99257
+ function validateNot(data, schema, path, document, visited) {
99258
+ const validationResponse = validateJsonSchemaInternal(
99259
+ data,
99260
+ schema.not,
99261
+ path,
99262
+ document,
99263
+ visited
99264
+ );
99149
99265
  if (validationResponse.isOk()) {
99150
99266
  return invalidSchemaResponseWithError(
99151
99267
  new JsonSchemaViolationError(
@@ -99155,7 +99271,7 @@
99155
99271
  }
99156
99272
  return validSchemaResponse();
99157
99273
  }
99158
- function validateObject(data, schema, path, document) {
99274
+ function validateObject(data, schema, path, document, visited) {
99159
99275
  const schemaKeys = Object.keys(schema.properties);
99160
99276
  const requiredKeys = new Set(schema.required);
99161
99277
  const schemaKeySet = new Set(schemaKeys);
@@ -99163,11 +99279,12 @@
99163
99279
  Object.keys(data).forEach((key) => {
99164
99280
  if (!schemaKeySet.has(key)) {
99165
99281
  errorCollector.append(
99166
- validateJsonSchema(
99282
+ validateJsonSchemaInternal(
99167
99283
  data[key],
99168
99284
  schema.additionalProperties,
99169
99285
  `${path}.additionalProperties[${key}]`,
99170
- document
99286
+ document,
99287
+ visited
99171
99288
  )
99172
99289
  );
99173
99290
  }
@@ -99184,18 +99301,19 @@
99184
99301
  }
99185
99302
  if (keyInData) {
99186
99303
  errorCollector.append(
99187
- validateJsonSchema(
99304
+ validateJsonSchemaInternal(
99188
99305
  data[key],
99189
99306
  schema.properties[key],
99190
99307
  `${path}.${key}`,
99191
- document
99308
+ document,
99309
+ visited
99192
99310
  )
99193
99311
  );
99194
99312
  }
99195
99313
  }
99196
99314
  return errorCollector.toValidationResponse();
99197
99315
  }
99198
- function validateArray(data, schema, path, document) {
99316
+ function validateArray(data, schema, path, document, visited) {
99199
99317
  if (schema.minItems !== void 0 && data.length < schema.minItems) {
99200
99318
  return invalidSchemaResponseWithError(
99201
99319
  new MinItemsViolationError(
@@ -99213,7 +99331,13 @@
99213
99331
  const errorCollector = new JsonSchemaErrorCollector();
99214
99332
  data.forEach(
99215
99333
  (element, index) => errorCollector.append(
99216
- validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
99334
+ validateJsonSchemaInternal(
99335
+ element,
99336
+ schema.items,
99337
+ `${path}[${index}]`,
99338
+ document,
99339
+ visited
99340
+ )
99217
99341
  )
99218
99342
  );
99219
99343
  return errorCollector.toValidationResponse();
@@ -99248,7 +99372,7 @@
99248
99372
  }
99249
99373
  return validSchemaResponse();
99250
99374
  }
99251
- function validateRef(data, schema, path, document) {
99375
+ function validateRef(data, schema, path, document, visited) {
99252
99376
  if (!schema.$ref.startsWith("#")) {
99253
99377
  return invalidSchemaResponseWithError(
99254
99378
  new InvalidRefError(
@@ -99256,11 +99380,23 @@
99256
99380
  )
99257
99381
  );
99258
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);
99259
99392
  try {
99260
99393
  const schemaToValidate = findSchemaAtPath(document, schema.$ref);
99261
- return validateJsonSchema(data, schemaToValidate, path, document);
99394
+ return validateJsonSchemaInternal(data, schemaToValidate, path, document, visited);
99262
99395
  } catch (e) {
99263
99396
  return invalidSchemaResponseWithError(e);
99397
+ } finally {
99398
+ refsForData.delete(schema.$ref);
99399
+ if (refsForData.size === 0) visited.delete(data);
99264
99400
  }
99265
99401
  }
99266
99402
  function validateEnum(data, enumValue, path) {
@@ -106866,7 +107002,7 @@
106866
107002
  _(config, CONFIG_SCHEMA);
106867
107003
  const baseCommand = new graphql_imperative_ctor(config, documentRootType, services);
106868
107004
  return applyDecorators(baseCommand, [services.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);
106869
- }, false);
107005
+ }, true);
106870
107006
  graphql_imperative_legacy = services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
106871
107007
  const _ = assertIsValid;
106872
107008
  _(config, CONFIG_SCHEMA);
@@ -106919,7 +107055,7 @@
106919
107055
  cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
106920
107056
  }
106921
107057
  }
106922
- // version: 1.428.0-dev4-42af22299b
107058
+ // version: 1.428.0-dev6-f96161ab92
106923
107059
 
106924
107060
  function createFragmentMap(documentNode) {
106925
107061
  const fragments = {};
@@ -136156,7 +136292,7 @@
136156
136292
  configuration: { ...configurationForGraphQLAdapters$1 },
136157
136293
  instrument: instrument$1,
136158
136294
  });
136159
- // version: 1.428.0-dev4-42af22299b
136295
+ // version: 1.428.0-dev6-f96161ab92
136160
136296
 
136161
136297
  // On core the unstable adapters are re-exported with different names,
136162
136298
  // we want to match them here.
@@ -136308,7 +136444,7 @@
136308
136444
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
136309
136445
  graphQLImperative = ldsAdapter;
136310
136446
  });
136311
- // version: 1.428.0-dev4-42af22299b
136447
+ // version: 1.428.0-dev6-f96161ab92
136312
136448
 
136313
136449
  var gqlApi = /*#__PURE__*/Object.freeze({
136314
136450
  __proto__: null,
@@ -137107,7 +137243,7 @@
137107
137243
  function register(r) {
137108
137244
  callbacks$1.forEach((callback) => callback(r));
137109
137245
  }
137110
- // version: 1.428.0-dev4-fee7d2eeee
137246
+ // version: 1.428.0-dev6-7d0a2d506f
137111
137247
 
137112
137248
  /**
137113
137249
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -138444,4 +138580,4 @@
138444
138580
  exports.subscribeToAdapter = subscribeToAdapter;
138445
138581
 
138446
138582
  }));
138447
- // version: 1.428.0-dev4-fee7d2eeee
138583
+ // version: 1.428.0-dev6-7d0a2d506f
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.428.0-dev4",
3
+ "version": "1.428.0-dev6",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,14 +35,14 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.428.0-dev4",
39
- "@salesforce/lds-adapters-uiapi": "^1.428.0-dev4",
40
- "@salesforce/lds-default-luvio": "^1.428.0-dev4",
41
- "@salesforce/lds-drafts": "^1.428.0-dev4",
42
- "@salesforce/lds-graphql-parser": "^1.428.0-dev4",
43
- "@salesforce/lds-luvio-engine": "^1.428.0-dev4",
44
- "@salesforce/lds-runtime-mobile": "^1.428.0-dev4",
45
- "@salesforce/nimbus-plugin-lds": "^1.428.0-dev4",
38
+ "@salesforce/lds-adapters-graphql": "^1.428.0-dev6",
39
+ "@salesforce/lds-adapters-uiapi": "^1.428.0-dev6",
40
+ "@salesforce/lds-default-luvio": "^1.428.0-dev6",
41
+ "@salesforce/lds-drafts": "^1.428.0-dev6",
42
+ "@salesforce/lds-graphql-parser": "^1.428.0-dev6",
43
+ "@salesforce/lds-luvio-engine": "^1.428.0-dev6",
44
+ "@salesforce/lds-runtime-mobile": "^1.428.0-dev6",
45
+ "@salesforce/nimbus-plugin-lds": "^1.428.0-dev6",
46
46
  "ajv": "^8.11.0",
47
47
  "glob": "^7.1.5",
48
48
  "nimbus-types": "^2.0.0-alpha1",