@salesforce/lds-worker-api 1.428.0-dev2 → 1.428.0-dev4

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-dev2-ad2109c7a1
1374
+ // version: 1.428.0-dev4-fee7d2eeee
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
4274
4274
  }
4275
4275
  callbacks.push(callback);
4276
4276
  }
4277
- // version: 1.428.0-dev2-ad2109c7a1
4277
+ // version: 1.428.0-dev4-fee7d2eeee
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-dev2-ad2109c7a1
5321
+ // version: 1.428.0-dev4-fee7d2eeee
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-dev2-2d5e0a6e5f
32613
+ // version: 1.428.0-dev4-42af22299b
32614
32614
 
32615
32615
  var allowUpdatesForNonCachedRecords = {
32616
32616
  isOpen: function (e) {
@@ -95112,6 +95112,7 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
95112
95112
  constructor(services) {
95113
95113
  super(services);
95114
95114
  this.services = services;
95115
+ this.additionalNullResponses = [];
95115
95116
  }
95116
95117
  fetch() {
95117
95118
  try {
@@ -95120,6 +95121,15 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
95120
95121
  return resolvedPromiseLike$2(err$1(toError(reason)));
95121
95122
  }
95122
95123
  }
95124
+ isSemanticNullResponse(response) {
95125
+ return this.additionalNullResponses.includes(response.status);
95126
+ }
95127
+ isProtocolNoBodyStatus(status) {
95128
+ return status === 204 || status === 205;
95129
+ }
95130
+ isUndeclaredNoBodyResponse(response) {
95131
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
95132
+ }
95123
95133
  async coerceError(errorResponse) {
95124
95134
  return toError(errorResponse.statusText);
95125
95135
  }
@@ -95127,10 +95137,24 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
95127
95137
  return response.then(
95128
95138
  (response2) => {
95129
95139
  if (response2.ok) {
95130
- return response2.json().then(
95131
- (json) => ok$1(json),
95132
- (reason) => err$1(toError(reason))
95133
- ).finally(() => {
95140
+ let resultPromise;
95141
+ if (this.isSemanticNullResponse(response2)) {
95142
+ resultPromise = Promise.resolve(ok$1(null));
95143
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
95144
+ resultPromise = Promise.resolve(
95145
+ err$1(
95146
+ toError(
95147
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
95148
+ )
95149
+ )
95150
+ );
95151
+ } else {
95152
+ resultPromise = response2.json().then(
95153
+ (json) => ok$1(json),
95154
+ (reason) => err$1(toError(reason))
95155
+ );
95156
+ }
95157
+ return resultPromise.finally(() => {
95134
95158
  try {
95135
95159
  this.afterRequestHooks({ statusCode: response2.status });
95136
95160
  } catch {
@@ -95177,6 +95201,7 @@ class HttpCacheControlCommand extends CacheControlCommand {
95177
95201
  constructor(services) {
95178
95202
  super(services);
95179
95203
  this.services = services;
95204
+ this.additionalNullResponses = [];
95180
95205
  }
95181
95206
  requestFromNetwork() {
95182
95207
  return this.fetch();
@@ -95188,6 +95213,15 @@ class HttpCacheControlCommand extends CacheControlCommand {
95188
95213
  return resolvedPromiseLike$2(err$1(toError(reason)));
95189
95214
  }
95190
95215
  }
95216
+ isSemanticNullResponse(response) {
95217
+ return this.additionalNullResponses.includes(response.status);
95218
+ }
95219
+ isProtocolNoBodyStatus(status) {
95220
+ return status === 204 || status === 205;
95221
+ }
95222
+ isUndeclaredNoBodyResponse(response) {
95223
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
95224
+ }
95191
95225
  async coerceError(errorResponse) {
95192
95226
  return toError(errorResponse.statusText);
95193
95227
  }
@@ -95198,12 +95232,26 @@ class HttpCacheControlCommand extends CacheControlCommand {
95198
95232
  return response.then(
95199
95233
  (response2) => {
95200
95234
  if (response2.ok) {
95201
- return response2.json().then(
95202
- (json) => {
95203
- return this.processFetchReturnValue(json);
95204
- },
95205
- (reason) => err$1(toError(reason))
95206
- ).finally(() => {
95235
+ let resultPromise;
95236
+ if (this.isSemanticNullResponse(response2)) {
95237
+ resultPromise = Promise.resolve(ok$1(null));
95238
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
95239
+ resultPromise = Promise.resolve(
95240
+ err$1(
95241
+ toError(
95242
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
95243
+ )
95244
+ )
95245
+ );
95246
+ } else {
95247
+ resultPromise = response2.json().then(
95248
+ (json) => {
95249
+ return this.processFetchReturnValue(json);
95250
+ },
95251
+ (reason) => err$1(toError(reason))
95252
+ );
95253
+ }
95254
+ return resultPromise.finally(() => {
95207
95255
  try {
95208
95256
  this.afterRequestHooks({ statusCode: response2.status });
95209
95257
  } catch {
@@ -96191,7 +96239,7 @@ function buildServiceDescriptor$b(luvio) {
96191
96239
  },
96192
96240
  };
96193
96241
  }
96194
- // version: 1.428.0-dev2-2d5e0a6e5f
96242
+ // version: 1.428.0-dev4-42af22299b
96195
96243
 
96196
96244
  /**
96197
96245
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96217,7 +96265,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
96217
96265
  },
96218
96266
  };
96219
96267
  }
96220
- // version: 1.428.0-dev2-2d5e0a6e5f
96268
+ // version: 1.428.0-dev4-42af22299b
96221
96269
 
96222
96270
  /*!
96223
96271
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -98874,7 +98922,7 @@ register$1({
98874
98922
  id: '@salesforce/lds-network-adapter',
98875
98923
  instrument: instrument$2,
98876
98924
  });
98877
- // version: 1.428.0-dev2-ad2109c7a1
98925
+ // version: 1.428.0-dev4-fee7d2eeee
98878
98926
 
98879
98927
  const { create: create$2, keys: keys$2 } = Object;
98880
98928
  const { stringify, parse } = JSON;
@@ -106865,7 +106913,7 @@ function registerCallback(cb) {
106865
106913
  cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
106866
106914
  }
106867
106915
  }
106868
- // version: 1.428.0-dev2-2d5e0a6e5f
106916
+ // version: 1.428.0-dev4-42af22299b
106869
106917
 
106870
106918
  function createFragmentMap(documentNode) {
106871
106919
  const fragments = {};
@@ -136102,7 +136150,7 @@ register$1({
136102
136150
  configuration: { ...configurationForGraphQLAdapters$1 },
136103
136151
  instrument: instrument$1,
136104
136152
  });
136105
- // version: 1.428.0-dev2-2d5e0a6e5f
136153
+ // version: 1.428.0-dev4-42af22299b
136106
136154
 
136107
136155
  // On core the unstable adapters are re-exported with different names,
136108
136156
  // we want to match them here.
@@ -136254,7 +136302,7 @@ withDefaultLuvio((luvio) => {
136254
136302
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
136255
136303
  graphQLImperative = ldsAdapter;
136256
136304
  });
136257
- // version: 1.428.0-dev2-2d5e0a6e5f
136305
+ // version: 1.428.0-dev4-42af22299b
136258
136306
 
136259
136307
  var gqlApi = /*#__PURE__*/Object.freeze({
136260
136308
  __proto__: null,
@@ -137053,7 +137101,7 @@ const callbacks$1 = [];
137053
137101
  function register(r) {
137054
137102
  callbacks$1.forEach((callback) => callback(r));
137055
137103
  }
137056
- // version: 1.428.0-dev2-ad2109c7a1
137104
+ // version: 1.428.0-dev4-fee7d2eeee
137057
137105
 
137058
137106
  /**
137059
137107
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -138369,4 +138417,4 @@ const { luvio } = getRuntime();
138369
138417
  setDefaultLuvio({ luvio });
138370
138418
 
138371
138419
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
138372
- // version: 1.428.0-dev2-ad2109c7a1
138420
+ // version: 1.428.0-dev4-fee7d2eeee
@@ -4280,7 +4280,7 @@
4280
4280
  }
4281
4281
  callbacks.push(callback);
4282
4282
  }
4283
- // version: 1.428.0-dev2-ad2109c7a1
4283
+ // version: 1.428.0-dev4-fee7d2eeee
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-dev2-ad2109c7a1
5327
+ // version: 1.428.0-dev4-fee7d2eeee
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-dev2-2d5e0a6e5f
32619
+ // version: 1.428.0-dev4-42af22299b
32620
32620
 
32621
32621
  var allowUpdatesForNonCachedRecords = {
32622
32622
  isOpen: function (e) {
@@ -95118,6 +95118,7 @@
95118
95118
  constructor(services) {
95119
95119
  super(services);
95120
95120
  this.services = services;
95121
+ this.additionalNullResponses = [];
95121
95122
  }
95122
95123
  fetch() {
95123
95124
  try {
@@ -95126,6 +95127,15 @@
95126
95127
  return resolvedPromiseLike$2(err$1(toError(reason)));
95127
95128
  }
95128
95129
  }
95130
+ isSemanticNullResponse(response) {
95131
+ return this.additionalNullResponses.includes(response.status);
95132
+ }
95133
+ isProtocolNoBodyStatus(status) {
95134
+ return status === 204 || status === 205;
95135
+ }
95136
+ isUndeclaredNoBodyResponse(response) {
95137
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
95138
+ }
95129
95139
  async coerceError(errorResponse) {
95130
95140
  return toError(errorResponse.statusText);
95131
95141
  }
@@ -95133,10 +95143,24 @@
95133
95143
  return response.then(
95134
95144
  (response2) => {
95135
95145
  if (response2.ok) {
95136
- return response2.json().then(
95137
- (json) => ok$1(json),
95138
- (reason) => err$1(toError(reason))
95139
- ).finally(() => {
95146
+ let resultPromise;
95147
+ if (this.isSemanticNullResponse(response2)) {
95148
+ resultPromise = Promise.resolve(ok$1(null));
95149
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
95150
+ resultPromise = Promise.resolve(
95151
+ err$1(
95152
+ toError(
95153
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
95154
+ )
95155
+ )
95156
+ );
95157
+ } else {
95158
+ resultPromise = response2.json().then(
95159
+ (json) => ok$1(json),
95160
+ (reason) => err$1(toError(reason))
95161
+ );
95162
+ }
95163
+ return resultPromise.finally(() => {
95140
95164
  try {
95141
95165
  this.afterRequestHooks({ statusCode: response2.status });
95142
95166
  } catch {
@@ -95183,6 +95207,7 @@
95183
95207
  constructor(services) {
95184
95208
  super(services);
95185
95209
  this.services = services;
95210
+ this.additionalNullResponses = [];
95186
95211
  }
95187
95212
  requestFromNetwork() {
95188
95213
  return this.fetch();
@@ -95194,6 +95219,15 @@
95194
95219
  return resolvedPromiseLike$2(err$1(toError(reason)));
95195
95220
  }
95196
95221
  }
95222
+ isSemanticNullResponse(response) {
95223
+ return this.additionalNullResponses.includes(response.status);
95224
+ }
95225
+ isProtocolNoBodyStatus(status) {
95226
+ return status === 204 || status === 205;
95227
+ }
95228
+ isUndeclaredNoBodyResponse(response) {
95229
+ return this.isProtocolNoBodyStatus(response.status) && !this.isSemanticNullResponse(response);
95230
+ }
95197
95231
  async coerceError(errorResponse) {
95198
95232
  return toError(errorResponse.statusText);
95199
95233
  }
@@ -95204,12 +95238,26 @@
95204
95238
  return response.then(
95205
95239
  (response2) => {
95206
95240
  if (response2.ok) {
95207
- return response2.json().then(
95208
- (json) => {
95209
- return this.processFetchReturnValue(json);
95210
- },
95211
- (reason) => err$1(toError(reason))
95212
- ).finally(() => {
95241
+ let resultPromise;
95242
+ if (this.isSemanticNullResponse(response2)) {
95243
+ resultPromise = Promise.resolve(ok$1(null));
95244
+ } else if (this.isUndeclaredNoBodyResponse(response2)) {
95245
+ resultPromise = Promise.resolve(
95246
+ err$1(
95247
+ toError(
95248
+ `Unexpected ${response2.status} response: no-content status was not declared in the API specification. Declare this response in your OAS without a content property.`
95249
+ )
95250
+ )
95251
+ );
95252
+ } else {
95253
+ resultPromise = response2.json().then(
95254
+ (json) => {
95255
+ return this.processFetchReturnValue(json);
95256
+ },
95257
+ (reason) => err$1(toError(reason))
95258
+ );
95259
+ }
95260
+ return resultPromise.finally(() => {
95213
95261
  try {
95214
95262
  this.afterRequestHooks({ statusCode: response2.status });
95215
95263
  } catch {
@@ -96197,7 +96245,7 @@
96197
96245
  },
96198
96246
  };
96199
96247
  }
96200
- // version: 1.428.0-dev2-2d5e0a6e5f
96248
+ // version: 1.428.0-dev4-42af22299b
96201
96249
 
96202
96250
  /**
96203
96251
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96223,7 +96271,7 @@
96223
96271
  },
96224
96272
  };
96225
96273
  }
96226
- // version: 1.428.0-dev2-2d5e0a6e5f
96274
+ // version: 1.428.0-dev4-42af22299b
96227
96275
 
96228
96276
  /*!
96229
96277
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -98880,7 +98928,7 @@
98880
98928
  id: '@salesforce/lds-network-adapter',
98881
98929
  instrument: instrument$2,
98882
98930
  });
98883
- // version: 1.428.0-dev2-ad2109c7a1
98931
+ // version: 1.428.0-dev4-fee7d2eeee
98884
98932
 
98885
98933
  const { create: create$2, keys: keys$2 } = Object;
98886
98934
  const { stringify, parse } = JSON;
@@ -106871,7 +106919,7 @@
106871
106919
  cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
106872
106920
  }
106873
106921
  }
106874
- // version: 1.428.0-dev2-2d5e0a6e5f
106922
+ // version: 1.428.0-dev4-42af22299b
106875
106923
 
106876
106924
  function createFragmentMap(documentNode) {
106877
106925
  const fragments = {};
@@ -136108,7 +136156,7 @@
136108
136156
  configuration: { ...configurationForGraphQLAdapters$1 },
136109
136157
  instrument: instrument$1,
136110
136158
  });
136111
- // version: 1.428.0-dev2-2d5e0a6e5f
136159
+ // version: 1.428.0-dev4-42af22299b
136112
136160
 
136113
136161
  // On core the unstable adapters are re-exported with different names,
136114
136162
  // we want to match them here.
@@ -136260,7 +136308,7 @@
136260
136308
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
136261
136309
  graphQLImperative = ldsAdapter;
136262
136310
  });
136263
- // version: 1.428.0-dev2-2d5e0a6e5f
136311
+ // version: 1.428.0-dev4-42af22299b
136264
136312
 
136265
136313
  var gqlApi = /*#__PURE__*/Object.freeze({
136266
136314
  __proto__: null,
@@ -137059,7 +137107,7 @@
137059
137107
  function register(r) {
137060
137108
  callbacks$1.forEach((callback) => callback(r));
137061
137109
  }
137062
- // version: 1.428.0-dev2-ad2109c7a1
137110
+ // version: 1.428.0-dev4-fee7d2eeee
137063
137111
 
137064
137112
  /**
137065
137113
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -138396,4 +138444,4 @@
138396
138444
  exports.subscribeToAdapter = subscribeToAdapter;
138397
138445
 
138398
138446
  }));
138399
- // version: 1.428.0-dev2-ad2109c7a1
138447
+ // version: 1.428.0-dev4-fee7d2eeee
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.428.0-dev2",
3
+ "version": "1.428.0-dev4",
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-dev2",
39
- "@salesforce/lds-adapters-uiapi": "^1.428.0-dev2",
40
- "@salesforce/lds-default-luvio": "^1.428.0-dev2",
41
- "@salesforce/lds-drafts": "^1.428.0-dev2",
42
- "@salesforce/lds-graphql-parser": "^1.428.0-dev2",
43
- "@salesforce/lds-luvio-engine": "^1.428.0-dev2",
44
- "@salesforce/lds-runtime-mobile": "^1.428.0-dev2",
45
- "@salesforce/nimbus-plugin-lds": "^1.428.0-dev2",
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",
46
46
  "ajv": "^8.11.0",
47
47
  "glob": "^7.1.5",
48
48
  "nimbus-types": "^2.0.0-alpha1",