@salesforce/lds-runtime-mobile 1.462.0 → 1.463.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/main.js +52 -9
  2. package/package.json +33 -33
  3. package/sfdc/main.js +52 -9
package/dist/main.js CHANGED
@@ -58065,6 +58065,15 @@ function buildServiceDescriptor$m() {
58065
58065
  };
58066
58066
  }
58067
58067
 
58068
+ function applyOperationRequestOptions$1(init, operationType) {
58069
+ if (operationType === void 0) {
58070
+ return init;
58071
+ }
58072
+ return {
58073
+ ...init,
58074
+ onestore: { ...init?.onestore, retrySafe: operationType === "query" }
58075
+ };
58076
+ }
58068
58077
  class AuraNetworkCommand extends NetworkCommand$1 {
58069
58078
  constructor(services) {
58070
58079
  super(services);
@@ -58083,6 +58092,18 @@ class AuraNetworkCommand extends NetworkCommand$1 {
58083
58092
  "Fetch parameters must be specified when using HTTP transport on an Aura adapter"
58084
58093
  );
58085
58094
  }
58095
+ /**
58096
+ * The command's operation type. Generated command subclasses override this
58097
+ * getter with their concrete operation (see the generator's
58098
+ * `generateOperationType`); the base returns `undefined` for commands that
58099
+ * don't declare one. On the HTTP fallback path (`fetch`) it derives the
58100
+ * request's `onestore.retrySafe` — reads (`query`) are retry-safe, writes
58101
+ * (`mutation`) are not. Mirrors `FetchNetworkCommand.operationType`, which
58102
+ * this class does not inherit (it extends `NetworkCommand` directly).
58103
+ */
58104
+ get operationType() {
58105
+ return void 0;
58106
+ }
58086
58107
  coerceAuraErrors(auraErrors) {
58087
58108
  return new UserVisibleError(getFetchResponseFromAuraError(auraErrors[0]));
58088
58109
  }
@@ -58184,9 +58205,11 @@ class AuraNetworkCommand extends NetworkCommand$1 {
58184
58205
  this.coerceAuraErrors
58185
58206
  );
58186
58207
  } else if (this.shouldUseFetch()) {
58187
- const params = this.fetchParams;
58208
+ const [input, init] = this.fetchParams;
58209
+ const initWithOptions = applyOperationRequestOptions$1(init, this.operationType);
58188
58210
  try {
58189
- return this.convertFetchResponseToData(this.services.fetch(...params));
58211
+ const fetchCall = initWithOptions === void 0 ? this.services.fetch(input) : this.services.fetch(input, initWithOptions);
58212
+ return this.convertFetchResponseToData(fetchCall);
58190
58213
  } catch (reason) {
58191
58214
  return resolvedPromiseLike$2(err$1(toError(reason)));
58192
58215
  }
@@ -58933,6 +58956,15 @@ class NetworkCommand extends BaseCommand {
58933
58956
  async afterRequestHooks(_options) {
58934
58957
  }
58935
58958
  }
58959
+ function applyOperationRequestOptions(init, operationType) {
58960
+ if (operationType === void 0) {
58961
+ return init;
58962
+ }
58963
+ return {
58964
+ ...init,
58965
+ onestore: { ...init?.onestore, retrySafe: operationType === "query" }
58966
+ };
58967
+ }
58936
58968
  function isAbortableCommand(command) {
58937
58969
  return !!command && typeof command === "object" && "isAbortableCommand" in command && command.isAbortableCommand === true;
58938
58970
  }
@@ -59022,7 +59054,8 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
59022
59054
  * `generateOperationType`); the base returns `undefined` for commands that
59023
59055
  * don't declare one (e.g. hand-written commands). Transport-layer
59024
59056
  * interceptors use it to tell a read (`query`) apart from a write — see
59025
- * `fetch`, which folds it into the context seed.
59057
+ * `fetch`, which folds it into the context seed and derives
59058
+ * `onestore.retrySafe` from it.
59026
59059
  */
59027
59060
  get operationType() {
59028
59061
  return void 0;
@@ -59031,8 +59064,9 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
59031
59064
  try {
59032
59065
  const [input, init] = this.fetchParams;
59033
59066
  const operationType = this.operationType;
59067
+ const initWithOptions = applyOperationRequestOptions(init, operationType);
59034
59068
  const seed = operationType === void 0 ? contextSeed : { operationType, ...contextSeed };
59035
- const initWithSeed = seed === void 0 ? init : { ...init, __contextSeed: seed };
59069
+ const initWithSeed = seed === void 0 ? initWithOptions : { ...initWithOptions, __contextSeed: seed };
59036
59070
  const fetchCall = initWithSeed === void 0 ? this.services.fetch(input) : this.services.fetch(input, initWithSeed);
59037
59071
  return this.convertFetchResponseToData(fetchCall);
59038
59072
  } catch (reason) {
@@ -60126,7 +60160,7 @@ function buildServiceDescriptor$b(luvio) {
60126
60160
  },
60127
60161
  };
60128
60162
  }
60129
- // version: 1.462.0-50d9a13ba4
60163
+ // version: 1.463.0-ea9ecd17fc
60130
60164
 
60131
60165
  /**
60132
60166
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -60152,7 +60186,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
60152
60186
  },
60153
60187
  };
60154
60188
  }
60155
- // version: 1.462.0-50d9a13ba4
60189
+ // version: 1.463.0-ea9ecd17fc
60156
60190
 
60157
60191
  function findExecutableOperation(input) {
60158
60192
  const operations = input.query.definitions.filter(
@@ -60733,9 +60767,18 @@ function validateDiscriminatedOneOf(data, discriminator, path, document, visited
60733
60767
  if (data === null || typeof data !== "object" || Array.isArray(data)) {
60734
60768
  return invalidSchemaResponseWithError(incorrectTypeError("object", typeof data, path));
60735
60769
  }
60736
- const { propertyName, mapping } = discriminator;
60770
+ const { propertyName, mapping, defaultMapping } = discriminator;
60737
60771
  const discriminatorValue = data[propertyName];
60738
60772
  if (discriminatorValue === void 0) {
60773
+ if (defaultMapping !== void 0) {
60774
+ return validateJsonSchemaInternal(
60775
+ data,
60776
+ { $ref: defaultMapping },
60777
+ path,
60778
+ document,
60779
+ visited
60780
+ );
60781
+ }
60739
60782
  return invalidSchemaResponseWithError(
60740
60783
  new MissingRequiredPropertyError(
60741
60784
  `Object at path '${path}' is missing required discriminator property '${propertyName}'.`
@@ -60747,7 +60790,7 @@ function validateDiscriminatedOneOf(data, discriminator, path, document, visited
60747
60790
  incorrectTypeError("string", typeof discriminatorValue, `${path}.${propertyName}`)
60748
60791
  );
60749
60792
  }
60750
- const targetRef = mapping[discriminatorValue];
60793
+ const targetRef = mapping[discriminatorValue] ?? defaultMapping;
60751
60794
  if (targetRef === void 0) {
60752
60795
  return invalidSchemaResponseWithError(
60753
60796
  new JsonSchemaViolationError(
@@ -62860,4 +62903,4 @@ register({
62860
62903
  });
62861
62904
 
62862
62905
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, initializeOneStore, registerReportObserver, reportGraphqlQueryParseError };
62863
- // version: 1.462.0-50d9a13ba4
62906
+ // version: 1.463.0-ea9ecd17fc
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.462.0",
3
+ "version": "1.463.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
@@ -32,43 +32,43 @@
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.29.0",
36
- "@conduit-client/service-bindings-lwc": "3.29.0",
37
- "@conduit-client/service-provisioner": "3.29.0",
38
- "@salesforce/lds-adapters-uiapi": "^1.462.0",
39
- "@salesforce/lds-bindings": "^1.462.0",
40
- "@salesforce/lds-instrumentation": "^1.462.0",
41
- "@salesforce/lds-luvio-service": "^1.462.0",
42
- "@salesforce/lds-luvio-uiapi-records-service": "^1.462.0",
35
+ "@conduit-client/service-bindings-imperative": "3.30.0",
36
+ "@conduit-client/service-bindings-lwc": "3.30.0",
37
+ "@conduit-client/service-provisioner": "3.30.0",
38
+ "@salesforce/lds-adapters-uiapi": "^1.463.0",
39
+ "@salesforce/lds-bindings": "^1.463.0",
40
+ "@salesforce/lds-instrumentation": "^1.463.0",
41
+ "@salesforce/lds-luvio-service": "^1.463.0",
42
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.463.0",
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.29.0",
49
- "@conduit-client/command-aura-normalized-cache-control": "3.29.0",
50
- "@conduit-client/command-fetch-network": "3.29.0",
51
- "@conduit-client/command-http-normalized-cache-control": "3.29.0",
52
- "@conduit-client/command-network": "3.29.0",
53
- "@conduit-client/service-cache": "3.29.0",
54
- "@conduit-client/service-cache-control": "3.29.0",
55
- "@conduit-client/service-cache-inclusion-policy": "3.29.0",
56
- "@conduit-client/service-fetch-network": "3.29.0",
57
- "@conduit-client/service-instrument-command": "3.29.0",
58
- "@conduit-client/service-instrumentation": "3.29.0",
59
- "@conduit-client/service-pubsub": "3.29.0",
60
- "@conduit-client/service-store": "3.29.0",
61
- "@conduit-client/utils": "3.29.0",
62
- "@salesforce/lds-adapters-graphql": "^1.462.0",
63
- "@salesforce/lds-drafts": "^1.462.0",
64
- "@salesforce/lds-durable-records": "^1.462.0",
65
- "@salesforce/lds-network-adapter": "^1.462.0",
66
- "@salesforce/lds-network-nimbus": "^1.462.0",
67
- "@salesforce/lds-store-binary": "^1.462.0",
68
- "@salesforce/lds-store-nimbus": "^1.462.0",
69
- "@salesforce/lds-store-sql": "^1.462.0",
70
- "@salesforce/lds-utils-adapters": "^1.462.0",
71
- "@salesforce/nimbus-plugin-lds": "^1.462.0",
48
+ "@conduit-client/command-aura-network": "3.30.0",
49
+ "@conduit-client/command-aura-normalized-cache-control": "3.30.0",
50
+ "@conduit-client/command-fetch-network": "3.30.0",
51
+ "@conduit-client/command-http-normalized-cache-control": "3.30.0",
52
+ "@conduit-client/command-network": "3.30.0",
53
+ "@conduit-client/service-cache": "3.30.0",
54
+ "@conduit-client/service-cache-control": "3.30.0",
55
+ "@conduit-client/service-cache-inclusion-policy": "3.30.0",
56
+ "@conduit-client/service-fetch-network": "3.30.0",
57
+ "@conduit-client/service-instrument-command": "3.30.0",
58
+ "@conduit-client/service-instrumentation": "3.30.0",
59
+ "@conduit-client/service-pubsub": "3.30.0",
60
+ "@conduit-client/service-store": "3.30.0",
61
+ "@conduit-client/utils": "3.30.0",
62
+ "@salesforce/lds-adapters-graphql": "^1.463.0",
63
+ "@salesforce/lds-drafts": "^1.463.0",
64
+ "@salesforce/lds-durable-records": "^1.463.0",
65
+ "@salesforce/lds-network-adapter": "^1.463.0",
66
+ "@salesforce/lds-network-nimbus": "^1.463.0",
67
+ "@salesforce/lds-store-binary": "^1.463.0",
68
+ "@salesforce/lds-store-nimbus": "^1.463.0",
69
+ "@salesforce/lds-store-sql": "^1.463.0",
70
+ "@salesforce/lds-utils-adapters": "^1.463.0",
71
+ "@salesforce/nimbus-plugin-lds": "^1.463.0",
72
72
  "babel-plugin-dynamic-import-node": "^2.3.3",
73
73
  "wait-for-expect": "^3.0.2"
74
74
  },
package/sfdc/main.js CHANGED
@@ -58065,6 +58065,15 @@ function buildServiceDescriptor$m() {
58065
58065
  };
58066
58066
  }
58067
58067
 
58068
+ function applyOperationRequestOptions$1(init, operationType) {
58069
+ if (operationType === void 0) {
58070
+ return init;
58071
+ }
58072
+ return {
58073
+ ...init,
58074
+ onestore: { ...init?.onestore, retrySafe: operationType === "query" }
58075
+ };
58076
+ }
58068
58077
  class AuraNetworkCommand extends NetworkCommand$1 {
58069
58078
  constructor(services) {
58070
58079
  super(services);
@@ -58083,6 +58092,18 @@ class AuraNetworkCommand extends NetworkCommand$1 {
58083
58092
  "Fetch parameters must be specified when using HTTP transport on an Aura adapter"
58084
58093
  );
58085
58094
  }
58095
+ /**
58096
+ * The command's operation type. Generated command subclasses override this
58097
+ * getter with their concrete operation (see the generator's
58098
+ * `generateOperationType`); the base returns `undefined` for commands that
58099
+ * don't declare one. On the HTTP fallback path (`fetch`) it derives the
58100
+ * request's `onestore.retrySafe` — reads (`query`) are retry-safe, writes
58101
+ * (`mutation`) are not. Mirrors `FetchNetworkCommand.operationType`, which
58102
+ * this class does not inherit (it extends `NetworkCommand` directly).
58103
+ */
58104
+ get operationType() {
58105
+ return void 0;
58106
+ }
58086
58107
  coerceAuraErrors(auraErrors) {
58087
58108
  return new UserVisibleError(getFetchResponseFromAuraError(auraErrors[0]));
58088
58109
  }
@@ -58184,9 +58205,11 @@ class AuraNetworkCommand extends NetworkCommand$1 {
58184
58205
  this.coerceAuraErrors
58185
58206
  );
58186
58207
  } else if (this.shouldUseFetch()) {
58187
- const params = this.fetchParams;
58208
+ const [input, init] = this.fetchParams;
58209
+ const initWithOptions = applyOperationRequestOptions$1(init, this.operationType);
58188
58210
  try {
58189
- return this.convertFetchResponseToData(this.services.fetch(...params));
58211
+ const fetchCall = initWithOptions === void 0 ? this.services.fetch(input) : this.services.fetch(input, initWithOptions);
58212
+ return this.convertFetchResponseToData(fetchCall);
58190
58213
  } catch (reason) {
58191
58214
  return resolvedPromiseLike$2(err$1(toError(reason)));
58192
58215
  }
@@ -58933,6 +58956,15 @@ class NetworkCommand extends BaseCommand {
58933
58956
  async afterRequestHooks(_options) {
58934
58957
  }
58935
58958
  }
58959
+ function applyOperationRequestOptions(init, operationType) {
58960
+ if (operationType === void 0) {
58961
+ return init;
58962
+ }
58963
+ return {
58964
+ ...init,
58965
+ onestore: { ...init?.onestore, retrySafe: operationType === "query" }
58966
+ };
58967
+ }
58936
58968
  function isAbortableCommand(command) {
58937
58969
  return !!command && typeof command === "object" && "isAbortableCommand" in command && command.isAbortableCommand === true;
58938
58970
  }
@@ -59022,7 +59054,8 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
59022
59054
  * `generateOperationType`); the base returns `undefined` for commands that
59023
59055
  * don't declare one (e.g. hand-written commands). Transport-layer
59024
59056
  * interceptors use it to tell a read (`query`) apart from a write — see
59025
- * `fetch`, which folds it into the context seed.
59057
+ * `fetch`, which folds it into the context seed and derives
59058
+ * `onestore.retrySafe` from it.
59026
59059
  */
59027
59060
  get operationType() {
59028
59061
  return void 0;
@@ -59031,8 +59064,9 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
59031
59064
  try {
59032
59065
  const [input, init] = this.fetchParams;
59033
59066
  const operationType = this.operationType;
59067
+ const initWithOptions = applyOperationRequestOptions(init, operationType);
59034
59068
  const seed = operationType === void 0 ? contextSeed : { operationType, ...contextSeed };
59035
- const initWithSeed = seed === void 0 ? init : { ...init, __contextSeed: seed };
59069
+ const initWithSeed = seed === void 0 ? initWithOptions : { ...initWithOptions, __contextSeed: seed };
59036
59070
  const fetchCall = initWithSeed === void 0 ? this.services.fetch(input) : this.services.fetch(input, initWithSeed);
59037
59071
  return this.convertFetchResponseToData(fetchCall);
59038
59072
  } catch (reason) {
@@ -60126,7 +60160,7 @@ function buildServiceDescriptor$b(luvio) {
60126
60160
  },
60127
60161
  };
60128
60162
  }
60129
- // version: 1.462.0-50d9a13ba4
60163
+ // version: 1.463.0-ea9ecd17fc
60130
60164
 
60131
60165
  /**
60132
60166
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -60152,7 +60186,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
60152
60186
  },
60153
60187
  };
60154
60188
  }
60155
- // version: 1.462.0-50d9a13ba4
60189
+ // version: 1.463.0-ea9ecd17fc
60156
60190
 
60157
60191
  function findExecutableOperation(input) {
60158
60192
  const operations = input.query.definitions.filter(
@@ -60733,9 +60767,18 @@ function validateDiscriminatedOneOf(data, discriminator, path, document, visited
60733
60767
  if (data === null || typeof data !== "object" || Array.isArray(data)) {
60734
60768
  return invalidSchemaResponseWithError(incorrectTypeError("object", typeof data, path));
60735
60769
  }
60736
- const { propertyName, mapping } = discriminator;
60770
+ const { propertyName, mapping, defaultMapping } = discriminator;
60737
60771
  const discriminatorValue = data[propertyName];
60738
60772
  if (discriminatorValue === void 0) {
60773
+ if (defaultMapping !== void 0) {
60774
+ return validateJsonSchemaInternal(
60775
+ data,
60776
+ { $ref: defaultMapping },
60777
+ path,
60778
+ document,
60779
+ visited
60780
+ );
60781
+ }
60739
60782
  return invalidSchemaResponseWithError(
60740
60783
  new MissingRequiredPropertyError(
60741
60784
  `Object at path '${path}' is missing required discriminator property '${propertyName}'.`
@@ -60747,7 +60790,7 @@ function validateDiscriminatedOneOf(data, discriminator, path, document, visited
60747
60790
  incorrectTypeError("string", typeof discriminatorValue, `${path}.${propertyName}`)
60748
60791
  );
60749
60792
  }
60750
- const targetRef = mapping[discriminatorValue];
60793
+ const targetRef = mapping[discriminatorValue] ?? defaultMapping;
60751
60794
  if (targetRef === void 0) {
60752
60795
  return invalidSchemaResponseWithError(
60753
60796
  new JsonSchemaViolationError(
@@ -62860,4 +62903,4 @@ register({
62860
62903
  });
62861
62904
 
62862
62905
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, initializeOneStore, registerReportObserver, reportGraphqlQueryParseError };
62863
- // version: 1.462.0-50d9a13ba4
62906
+ // version: 1.463.0-ea9ecd17fc