@salesforce/nimbus-plugin-lds 1.233.0 → 1.235.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.
@@ -19,5 +19,6 @@ export declare class JsSqliteStorePlugin extends JsSqliteStorePluginBase impleme
19
19
  resetDatabase(): void;
20
20
  query(sql: string, params: SqliteType[], onResult: (result: SqliteResult) => void, onError: (message: string) => void): Promise<void>;
21
21
  batchOperations(operations: SqliteOperation[], onCompletion: (error: string | null) => void): Promise<void>;
22
+ supportsBatchUpdates(): boolean;
22
23
  }
23
24
  export {};
@@ -6,6 +6,7 @@ export declare abstract class JsSqliteStorePluginBase implements SqliteStorePlug
6
6
  protected listeners: ListenerMap;
7
7
  abstract query(sql: string, params: SqliteType[], onResult: (result: SqliteResult) => void, onError: (message: string) => void): Promise<void>;
8
8
  abstract batchOperations(operations: SqliteOperation[], onCompletion: (error: string | null) => void): Promise<void>;
9
+ abstract supportsBatchUpdates(): boolean;
9
10
  registerOnChangedListener(listener: (changes: SqliteStoreChange[]) => void): Promise<string>;
10
11
  unsubscribeOnChangedListener(id: string): Promise<void>;
11
12
  protected notifyListeners(operations: SqliteOperation[]): void;
@@ -9,4 +9,5 @@ export declare class JsSqliteStoreWebWorkerPlugin extends JsSqliteStorePluginBas
9
9
  constructor();
10
10
  query(sql: string, params: SqliteType[], onResult: (result: SqliteResult) => void, onError: (message: string) => void): Promise<void>;
11
11
  batchOperations(operations: SqliteOperation[], onCompletion: (error: string | null) => void): Promise<void>;
12
+ supportsBatchUpdates(): boolean;
12
13
  }
@@ -29,6 +29,10 @@ export interface SqliteStorePlugin {
29
29
  * @param id the identifier given from registerOnChangedListener
30
30
  */
31
31
  unsubscribeOnChangedListener(id: string): Promise<void>;
32
+ /**
33
+ * check for older native plugins that do not yet support the update batch operations
34
+ */
35
+ supportsBatchUpdates(): boolean;
32
36
  }
33
37
  /**
34
38
  * An operation to perform on the database.
@@ -98,8 +102,15 @@ interface SqliteDelete extends SqliteOperationBase {
98
102
  type: 'delete';
99
103
  ids: string[];
100
104
  }
101
- export type SqliteOperation = SqliteDelete | SqliteUpsert;
105
+ interface SqliteUpdate extends SqliteOperationBase {
106
+ type: 'update';
107
+ columns: string[];
108
+ values: Record<string, SqliteType[]>;
109
+ segment?: string;
110
+ }
111
+ export type SqliteOperation = SqliteDelete | SqliteUpsert | SqliteUpdate;
102
112
  export declare function isUpsertOperation(operation: SqliteOperation): operation is SqliteUpsert;
113
+ export declare function isUpdateOperation(operation: SqliteOperation): operation is SqliteUpdate;
103
114
  /**
104
115
  * Operations can pass any context object along with the operation.
105
116
  * This context is opaque to the plugin and will be included in any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/nimbus-plugin-lds",
3
- "version": "1.233.0",
3
+ "version": "1.235.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "Nimbus plugins for LDS on Mobile native integrations: durable store, networking, and draft queue.",
6
6
  "types": "dist/types/index.d.ts",