@salesforce/lds-drafts 1.327.0 → 1.329.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.
package/dist/ldsDrafts.js CHANGED
@@ -392,6 +392,12 @@ class DurableDraftQueue {
392
392
  draftCount: this.draftStore.getCount(),
393
393
  });
394
394
  }
395
+ stopQueueWhileRunning(action) {
396
+ this.stopQueueManually(true);
397
+ return action().finally(() => {
398
+ this.startQueueSafe();
399
+ });
400
+ }
395
401
  /**
396
402
  * Used to stop the queue within DraftQueue without user interaction
397
403
  */
@@ -1176,6 +1182,14 @@ class DraftManager {
1176
1182
  stopQueue() {
1177
1183
  return this.draftQueue.stopQueue();
1178
1184
  }
1185
+ /**
1186
+ * Stops the draft queue manually without notifying the user and then runs the passed action.
1187
+ * After the action is completed it will safely start the queue if the user had set it to be
1188
+ * started.
1189
+ */
1190
+ stopQueueWhileRunning(action) {
1191
+ return this.draftQueue.stopQueueWhileRunning(action);
1192
+ }
1179
1193
  /**
1180
1194
  * Subscribes the listener to changes to the draft queue.
1181
1195
  *
@@ -118,6 +118,12 @@ export declare class DraftManager {
118
118
  * in progress items are finished.
119
119
  */
120
120
  stopQueue(): Promise<void>;
121
+ /**
122
+ * Stops the draft queue manually without notifying the user and then runs the passed action.
123
+ * After the action is completed it will safely start the queue if the user had set it to be
124
+ * started.
125
+ */
126
+ stopQueueWhileRunning(action: () => Promise<void>): Promise<void>;
121
127
  /**
122
128
  * Subscribes the listener to changes to the draft queue.
123
129
  *
@@ -248,6 +248,12 @@ export interface DraftQueue {
248
248
  startQueue(): Promise<void>;
249
249
  /** Set the draft queue state to Stopped and don't let another item begin */
250
250
  stopQueue(): Promise<void>;
251
+ /**
252
+ * Perform an action the queue is stopped.
253
+ * It then starts the queue back up again if the user had it on.
254
+ * @param action
255
+ */
256
+ stopQueueWhileRunning(action: () => Promise<void>): Promise<void>;
251
257
  /**
252
258
  * Sets the metadata object of the specified action to the
253
259
  * provided metadata
@@ -27,6 +27,7 @@ export declare class DurableDraftQueue implements DraftQueue {
27
27
  getQueueState(): DraftQueueState;
28
28
  startQueue(): Promise<void>;
29
29
  stopQueue(): Promise<void>;
30
+ stopQueueWhileRunning(action: () => Promise<void>): Promise<void>;
30
31
  /**
31
32
  * Used to stop the queue within DraftQueue without user interaction
32
33
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-drafts",
3
- "version": "1.327.0",
3
+ "version": "1.329.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS Drafts",
6
6
  "main": "dist/ldsDrafts.js",
@@ -26,10 +26,10 @@
26
26
  "dependencies": {
27
27
  "@luvio/engine": "0.156.5",
28
28
  "@luvio/environments": "0.156.5",
29
- "@salesforce/lds-utils-adapters": "^1.327.0"
29
+ "@salesforce/lds-utils-adapters": "^1.329.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@salesforce/nimbus-plugin-lds": "^1.327.0"
32
+ "@salesforce/nimbus-plugin-lds": "^1.329.0"
33
33
  },
34
34
  "volta": {
35
35
  "extends": "../../package.json"