@salesforce/lds-worker-api 1.283.0 → 1.285.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.
@@ -47,15 +47,25 @@ export declare function buildAdapterRequestContext(nativeRequestContext: NativeA
47
47
  */
48
48
  export declare function subscribeToAdapter(adapterId: string, config: string, onSnapshot: NativeOnSnapshot, nativeAdapterRequestContext?: NativeAdapterRequestContext): Unsubscribe;
49
49
  /**
50
- * Executes the specified adapter with the given adapterId and config. Then
51
- * it replaces the draft with the given id with the draft generated
52
- * by the mutating adapter. Will call onResult callback once with data or error.
50
+ * @deprecated There is no situation in which any consumer actually wants to replace the draft.
51
+ * call {@link invokeAdapterWithDraftToMerge} instead`.
52
+ * Keep it for now for app back compatibility.
53
+ * Will be removed in future, ideally 2 releases later.
54
+ */
55
+ export declare function invokeAdapterWithDraftToReplace(adapterId: string, config: string, draftIdToReplace: string, onResponse: NativeOnResponse, nativeAdapterRequestContext?: NativeAdapterRequestContext): void;
56
+ /**
57
+ * Executes the specified adapter with the given @param dapterId and @param config. Then
58
+ * it merge the draft with the given id with the draft generated by
59
+ * the mutating adapter. Will call onResult callback once with data or error.
53
60
  *
54
61
  * This function throws an error if the given adapterId cannot be found, or if the
55
- * adapterId is not a mutating adapter, or if a draft isn't created, or if it
56
- * fails to parse the given config string.
62
+ * adapterId is not a mutating adapter if a draft isn't created, or
63
+ * if it fails to parse the given config string.
64
+ *
65
+ * If the @param adapterId is deleteRecod, the invocation of it will generate a delele draft.
66
+ * The newly generated delete draft will replace the draft specified by @param targetDraftId
57
67
  */
58
- export declare function invokeAdapterWithDraftToReplace(adapterId: string, config: string, draftIdToReplace: string, onResponse: NativeOnResponse, nativeAdapterRequestContext?: NativeAdapterRequestContext): void;
68
+ export declare function invokeAdapterWithDraftToMerge(adapterId: string, config: string, targetDraftId: string, onResponse: NativeOnResponse, nativeAdapterRequestContext?: NativeAdapterRequestContext): void;
59
69
  /**
60
70
  * Executes the specified adapter with the given adapterId and config. Then
61
71
  * it sets the given metadata on the draft created by the mutating adapter. Will call
@@ -1,4 +1,4 @@
1
- import { subscribeToAdapter, invokeAdapter, invokeAdapterWithMetadata, invokeAdapterWithDraftToReplace, executeAdapter, executeMutatingAdapter } from './executeAdapter';
1
+ import { subscribeToAdapter, invokeAdapter, invokeAdapterWithMetadata, invokeAdapterWithDraftToReplace, invokeAdapterWithDraftToMerge, executeAdapter, executeMutatingAdapter } from './executeAdapter';
2
2
  import { getImperativeAdapterNames } from './lightningAdapterApi';
3
3
  import { nimbusDraftQueue } from './nimbusDraftQueue';
4
4
  import { draftQueue, draftManager } from './draftQueueImplementation';
@@ -6,4 +6,4 @@ import { setUiApiRecordTTL, setMetadataTTL } from './ttl';
6
6
  import { registerReportObserver } from '@salesforce/lds-runtime-mobile';
7
7
  import { createPrimingSession } from './primingApi';
8
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, };
9
+ export { subscribeToAdapter, invokeAdapter, invokeAdapterWithMetadata, invokeAdapterWithDraftToReplace, invokeAdapterWithDraftToMerge, executeAdapter, executeMutatingAdapter, nimbusDraftQueue, draftQueue, draftManager, setUiApiRecordTTL, setMetadataTTL, registerReportObserver, getImperativeAdapterNames, createPrimingSession, evictCacheRecordsByIds, evictExpiredCacheEntries, stopEviction, };