@salesforce/lds-worker-api 1.247.0 → 1.249.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.
@@ -1,11 +1,20 @@
1
1
  declare enum EvictStatus {
2
- InProgress = "InProgress",
2
+ Started = "Started",
3
+ Running = "Running",
4
+ Evicted = "Evicted",
3
5
  Succeeded = "Succeeded",
4
6
  Error = "Error",
5
- Cancelled = "Cancelled"
7
+ Canceled = "Canceled"
6
8
  }
7
- interface EvictInProgress {
8
- status: EvictStatus.InProgress;
9
+ interface EvictStarted {
10
+ status: EvictStatus.Started;
11
+ }
12
+ interface EvictRunning {
13
+ status: EvictStatus.Running;
14
+ message: string;
15
+ }
16
+ interface BatchEvicted {
17
+ status: EvictStatus.Evicted;
9
18
  skippedEntries?: string[];
10
19
  evictedEntries?: string[];
11
20
  }
@@ -17,35 +26,33 @@ interface EvictError {
17
26
  message: string;
18
27
  }
19
28
  interface EvictCancelled {
20
- status: EvictStatus.Cancelled;
29
+ status: EvictStatus.Canceled;
21
30
  }
22
- export type EvictProgress = EvictInProgress | EvictSucceeded | EvictError | EvictCancelled;
31
+ export type EvictProgress = BatchEvicted | EvictSucceeded | EvictError | EvictCancelled;
23
32
  export type ProgressUpdateCallback = (progess: EvictProgress) => void;
24
33
  /**
25
34
  * Purging records specified by an array of record id from durable store
26
35
  * @param recordIds record id array
27
36
  * @onProgressUpdate call back to report evict progress
28
37
  *
29
- * @returns evictId, call cancelEviction with it to abort the eviction.
38
+ * @returns started or already running based whether there's an active eviction going on or not.
30
39
  *
31
40
  * The record will not be purged if the record has draft.
32
41
  */
33
- export declare function evictCacheRecordsByIds(recordIds: string[], onProgressUpdate: ProgressUpdateCallback): string;
42
+ export declare function evictCacheRecordsByIds(recordIds: string[], onProgressUpdate: ProgressUpdateCallback): EvictStarted | EvictRunning;
34
43
  /**
35
44
  * Purging the db entries which passed expired time by specified days
36
45
  * from durable store.
37
46
  * @param expiredByDays
38
47
  * @param onProgressUpdate
39
48
  *
40
- * @returns an evictId, call cancelEviction with it to abort the eviction.
49
+ * @returns started or already running based whether there's an active eviction going on or not.
41
50
  *
42
51
  * Important: records with draft, objectInfo entries will not be purged even expired by the specified days.
43
52
  */
44
- export declare function evictExpiredCacheEntries(expiredByDays: number, onProgressUpdate: ProgressUpdateCallback): string;
53
+ export declare function evictExpiredCacheEntries(expiredByDays: number, onProgressUpdate: ProgressUpdateCallback): EvictStarted | EvictRunning;
45
54
  /**
46
- * Cancel the eviction by specified id.
47
- * Signal to cancel the eviction if the eviction is going on.
48
- * @param evictionId
55
+ * Signal to stop current eviction if there's an active eviction going on.
49
56
  */
50
- export declare function cancelEviction(evictionId: string): void;
57
+ export declare function stopEviction(): void;
51
58
  export {};
@@ -5,5 +5,5 @@ import { draftQueue, draftManager } from './draftQueueImplementation';
5
5
  import { setUiApiRecordTTL, setMetadataTTL } from './ttl';
6
6
  import { registerReportObserver } from '@salesforce/lds-runtime-mobile';
7
7
  import { createPrimingSession } from './primingApi';
8
- import { evictCacheRecordsByIds, evictExpiredCacheEntries, cancelEviction } from './cachePurging';
9
- export { subscribeToAdapter, invokeAdapter, invokeAdapterWithMetadata, invokeAdapterWithDraftToReplace, executeAdapter, executeMutatingAdapter, nimbusDraftQueue, draftQueue, draftManager, setUiApiRecordTTL, setMetadataTTL, registerReportObserver, getImperativeAdapterNames, createPrimingSession, evictCacheRecordsByIds, evictExpiredCacheEntries, cancelEviction, };
8
+ import { evictCacheRecordsByIds, evictExpiredCacheEntries, stopEviction } from './cachePurging';
9
+ export { subscribeToAdapter, invokeAdapter, invokeAdapterWithMetadata, invokeAdapterWithDraftToReplace, executeAdapter, executeMutatingAdapter, nimbusDraftQueue, draftQueue, draftManager, setUiApiRecordTTL, setMetadataTTL, registerReportObserver, getImperativeAdapterNames, createPrimingSession, evictCacheRecordsByIds, evictExpiredCacheEntries, stopEviction, };