@workglow/indexeddb 0.3.11 → 0.3.13
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/job-queue/IndexedDbQueueStorage.d.ts +3 -98
- package/dist/job-queue/IndexedDbQueueStorage.d.ts.map +1 -1
- package/dist/job-queue/IndexedDbRateLimiterStorage.d.ts +0 -14
- package/dist/job-queue/IndexedDbRateLimiterStorage.d.ts.map +1 -1
- package/dist/job-queue/browser.js.map +3 -3
- package/dist/job-queue/node.js.map +3 -3
- package/dist/storage/IndexedDbKvStorage.d.ts +0 -11
- package/dist/storage/IndexedDbKvStorage.d.ts.map +1 -1
- package/dist/storage/IndexedDbTable.d.ts +0 -3
- package/dist/storage/IndexedDbTable.d.ts.map +1 -1
- package/dist/storage/IndexedDbTabularStorage.d.ts +2 -77
- package/dist/storage/IndexedDbTabularStorage.d.ts.map +1 -1
- package/dist/storage/IndexedDbVectorStorage.d.ts +0 -15
- package/dist/storage/IndexedDbVectorStorage.d.ts.map +1 -1
- package/dist/storage/browser.js +2 -2
- package/dist/storage/browser.js.map +6 -6
- package/dist/storage/node.js +2 -2
- package/dist/storage/node.js.map +6 -6
- package/package.json +7 -7
|
@@ -33,8 +33,5 @@ export interface MigrationOptions {
|
|
|
33
33
|
* Performs migrations as needed without data loss when possible.
|
|
34
34
|
*/
|
|
35
35
|
export declare function ensureIndexedDbTable(tableName: string, primaryKey: string | string[], expectedIndexes?: ExpectedIndexDefinition[], options?: MigrationOptions, autoIncrement?: boolean): Promise<IDBDatabase>;
|
|
36
|
-
/**
|
|
37
|
-
* Utility function to delete a database (for testing or cleanup)
|
|
38
|
-
*/
|
|
39
36
|
export declare function dropIndexedDbTable(tableName: string): Promise<void>;
|
|
40
37
|
//# sourceMappingURL=IndexedDbTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedDbTable.d.ts","sourceRoot":"","sources":["../../src/storage/IndexedDbTable.ts"],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AO,CAAC,IAAI,CAAC,CAEzE"}
|
|
@@ -15,7 +15,6 @@ export declare const IDB_TABULAR_REPOSITORY: import("@workglow/util").ServiceTok
|
|
|
15
15
|
*/
|
|
16
16
|
export declare class IndexedDbTabularStorage<Schema extends DataPortSchemaObject, PrimaryKeyNames extends ReadonlyArray<keyof Schema["properties"]>, Entity = FromSchema<Schema, TypedArraySchemaOptions>, PrimaryKey = SimplifyPrimaryKey<Entity, PrimaryKeyNames>, Value = Omit<Entity, PrimaryKeyNames[number] & keyof Entity>, InsertType extends InsertEntity<Entity, AutoGeneratedKeys<Schema>> = InsertEntity<Entity, AutoGeneratedKeys<Schema>>> extends BaseTabularStorage<Schema, PrimaryKeyNames, Entity, PrimaryKey, Value, InsertType> {
|
|
17
17
|
table: string;
|
|
18
|
-
/** Promise that resolves to the IndexedDB database instance */
|
|
19
18
|
private db;
|
|
20
19
|
/**
|
|
21
20
|
* True between `setupDatabase`'s call to `applyTabularMigrations` and its
|
|
@@ -26,13 +25,9 @@ export declare class IndexedDbTabularStorage<Schema extends DataPortSchemaObject
|
|
|
26
25
|
* orchestrator, or migrations will be replayed mid-flight.
|
|
27
26
|
*/
|
|
28
27
|
private applyingMigrations;
|
|
29
|
-
/** Promise to track ongoing database setup to prevent concurrent setup calls */
|
|
30
28
|
private setupPromise;
|
|
31
|
-
/** Migration options for database schema changes */
|
|
32
29
|
private migrationOptions;
|
|
33
|
-
/** Shared hybrid subscription manager */
|
|
34
30
|
private hybridManager;
|
|
35
|
-
/** Hybrid subscription options */
|
|
36
31
|
private readonly hybridOptions;
|
|
37
32
|
/**
|
|
38
33
|
* Indexes safe for cursor-based narrowing. An IDB index excludes records
|
|
@@ -56,10 +51,6 @@ export declare class IndexedDbTabularStorage<Schema extends DataPortSchemaObject
|
|
|
56
51
|
readonly useBroadcastChannel?: boolean;
|
|
57
52
|
readonly backupPollingIntervalMs?: number;
|
|
58
53
|
}, clientProvidedKeys?: ClientProvidedKeysOption, tabularMigrations?: ReadonlyArray<ITabularMigration>);
|
|
59
|
-
/**
|
|
60
|
-
* Internal method to get the database, setting it up if needed.
|
|
61
|
-
* This ensures lazy initialization of the database.
|
|
62
|
-
*/
|
|
63
54
|
private getDb;
|
|
64
55
|
/**
|
|
65
56
|
* Sets up the IndexedDB database table with the required schema and indexes.
|
|
@@ -81,62 +72,33 @@ export declare class IndexedDbTabularStorage<Schema extends DataPortSchemaObject
|
|
|
81
72
|
* Delegates to the shared `idbObjectStoreExists` helper.
|
|
82
73
|
*/
|
|
83
74
|
private probeObjectStoreExists;
|
|
84
|
-
/**
|
|
85
|
-
* Internal method to perform the actual database setup
|
|
86
|
-
*/
|
|
87
75
|
private performSetup;
|
|
88
76
|
getMigrationApplier(): ITabularMigrationApplier | null;
|
|
89
77
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* @param columnName - Name of the column to generate a key for
|
|
93
|
-
* @param strategy - The generation strategy to use
|
|
94
|
-
* @returns The generated key value
|
|
78
|
+
* Integer autoincrement keys are handled by IndexedDB's autoIncrement; this
|
|
79
|
+
* only generates UUID keys client-side.
|
|
95
80
|
*/
|
|
96
81
|
protected generateKeyValue(columnName: string, strategy: KeyGenerationStrategy): string | number;
|
|
97
82
|
/**
|
|
98
|
-
* Stores a row in the repository.
|
|
99
|
-
* @param record - The entity to store (may be missing auto-generated keys).
|
|
100
|
-
* @returns The stored entity
|
|
101
83
|
* @emits put - Emitted when the value is successfully stored
|
|
102
84
|
*/
|
|
103
85
|
put(record: InsertType): Promise<Entity>;
|
|
104
86
|
/**
|
|
105
|
-
* Stores multiple rows in the repository in a bulk operation.
|
|
106
|
-
* @param records - Array of entities to store (may be missing auto-generated keys).
|
|
107
|
-
* @returns Array of stored entities
|
|
108
87
|
* @emits put - Emitted for each record successfully stored
|
|
109
88
|
*/
|
|
110
89
|
putBulk(records: InsertType[]): Promise<Entity[]>;
|
|
111
90
|
protected getPrimaryKeyAsOrderedArray(key: PrimaryKey): (string | number | boolean | Uint8Array<ArrayBufferLike> | null)[];
|
|
112
91
|
private getIndexedKey;
|
|
113
92
|
/**
|
|
114
|
-
* Retrieves a value from the repository by its key.
|
|
115
|
-
* @param key - The key object.
|
|
116
|
-
* @returns The value object or undefined if not found.
|
|
117
93
|
* @emits get - Emitted when the value is successfully retrieved
|
|
118
94
|
*/
|
|
119
95
|
get(key: PrimaryKey): Promise<Entity | undefined>;
|
|
120
|
-
/**
|
|
121
|
-
* Returns an array of all entries in the repository, with optional ordering, offset, and limit.
|
|
122
|
-
* @param options - Optional ordering, limit, and offset options
|
|
123
|
-
* @returns Array of all entries in the repository.
|
|
124
|
-
*/
|
|
125
96
|
getAll(options?: QueryOptions<Entity>): Promise<Entity[] | undefined>;
|
|
126
|
-
/**
|
|
127
|
-
* Deletes a row from the repository.
|
|
128
|
-
* @param key - The key object to delete.
|
|
129
|
-
*/
|
|
130
97
|
delete(key: PrimaryKey): Promise<void>;
|
|
131
98
|
/**
|
|
132
|
-
* Deletes all records from the repository.
|
|
133
99
|
* @emits clearall - Emitted when all values are deleted
|
|
134
100
|
*/
|
|
135
101
|
deleteAll(): Promise<void>;
|
|
136
|
-
/**
|
|
137
|
-
* Returns the total number of rows in the repository.
|
|
138
|
-
* @returns Count of stored items.
|
|
139
|
-
*/
|
|
140
102
|
size(): Promise<number>;
|
|
141
103
|
/**
|
|
142
104
|
* Returns the subset of configured indexes safe to use for cursor-based
|
|
@@ -167,37 +129,12 @@ export declare class IndexedDbTabularStorage<Schema extends DataPortSchemaObject
|
|
|
167
129
|
* full store scan only when no index applies.
|
|
168
130
|
*/
|
|
169
131
|
count(criteria?: SearchCriteria<Entity>): Promise<number>;
|
|
170
|
-
/**
|
|
171
|
-
* Fetches a page of records from the repository.
|
|
172
|
-
* @param offset - Number of records to skip
|
|
173
|
-
* @param limit - Maximum number of records to return
|
|
174
|
-
* @returns Array of entities or undefined if no records found
|
|
175
|
-
*/
|
|
176
132
|
getOffsetPage(offset: number, limit: number): Promise<Entity[] | undefined>;
|
|
177
|
-
/**
|
|
178
|
-
* Checks if a record matches all criteria conditions.
|
|
179
|
-
* @param record - The record to check
|
|
180
|
-
* @param criteria - The search criteria
|
|
181
|
-
* @returns true if all conditions match
|
|
182
|
-
*/
|
|
183
133
|
private matchesCriteria;
|
|
184
|
-
/**
|
|
185
|
-
* Deletes all entries matching the specified search criteria.
|
|
186
|
-
* Supports multiple columns with optional comparison operators.
|
|
187
|
-
*
|
|
188
|
-
* @param criteria - Object with column names as keys and values or SearchConditions
|
|
189
|
-
*/
|
|
190
134
|
deleteSearch(criteria: DeleteSearchCriteria<Entity>): Promise<void>;
|
|
191
135
|
private getEqualityCriterionValue;
|
|
192
136
|
private compareByOrder;
|
|
193
137
|
private createIndexedQuery;
|
|
194
|
-
/**
|
|
195
|
-
* Queries entries matching the specified search criteria with optional ordering, limit, and offset.
|
|
196
|
-
*
|
|
197
|
-
* @param criteria - Object with column names as keys and values or SearchConditions
|
|
198
|
-
* @param options - Optional ordering, limit, and offset options
|
|
199
|
-
* @returns Array of matching entities or undefined if no matches found
|
|
200
|
-
*/
|
|
201
138
|
query(criteria: SearchCriteria<Entity>, options?: QueryOptions<Entity>): Promise<Entity[] | undefined>;
|
|
202
139
|
/**
|
|
203
140
|
* Strict, projected query served entirely by a covering compound index.
|
|
@@ -208,23 +145,11 @@ export declare class IndexedDbTabularStorage<Schema extends DataPortSchemaObject
|
|
|
208
145
|
* the request (i.e. the index does not cover all select + orderBy columns).
|
|
209
146
|
*/
|
|
210
147
|
queryIndex<K extends keyof Entity & string>(criteria: SearchCriteria<Entity>, options: CoveringIndexQueryOptions<Entity, K>): Promise<Pick<Entity, K>[]>;
|
|
211
|
-
/**
|
|
212
|
-
* Gets or creates the shared hybrid subscription manager.
|
|
213
|
-
* This ensures all subscriptions share a single manager.
|
|
214
|
-
*/
|
|
215
148
|
private getHybridManager;
|
|
216
149
|
/**
|
|
217
|
-
* Subscribes to changes in the repository.
|
|
218
150
|
* Uses polling since IndexedDB has no native cross-tab change notifications.
|
|
219
|
-
*
|
|
220
|
-
* @param callback - Function called when a change occurs
|
|
221
|
-
* @param options - Optional subscription options including polling interval
|
|
222
|
-
* @returns Unsubscribe function
|
|
223
151
|
*/
|
|
224
152
|
subscribeToChanges(callback: (change: TabularChangePayload<Entity>) => void, options?: TabularSubscribeOptions): () => void;
|
|
225
|
-
/**
|
|
226
|
-
* Destroys this repository and frees up resources.
|
|
227
|
-
*/
|
|
228
153
|
destroy(): void;
|
|
229
154
|
}
|
|
230
155
|
//# sourceMappingURL=IndexedDbTabularStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedDbTabularStorage.d.ts","sourceRoot":"","sources":["../../src/storage/IndexedDbTabularStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EAEpB,YAAY,EAEZ,qBAAqB,EAErB,YAAY,EACZ,cAAc,EAEd,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAiD,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAMnG,eAAO,MAAM,sBAAsB,0DAElC,CAAC;AA0BF;;;;;GAKG;AACH,qBAAa,uBAAuB,CAClC,MAAM,SAAS,oBAAoB,EACnC,eAAe,SAAS,aAAa,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,EAEjE,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,uBAAuB,CAAC,EACpD,UAAU,GAAG,kBAAkB,CAAC,MAAM,EAAE,eAAe,CAAC,EACxD,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,CAA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,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,EAChC,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,GAC7B,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAsD/B;IAED;;;;;;;OAOG;IACY,UAAU,CAAC,CAAC,SAAS,MAAM,MAAM,GAAG,MAAM,EACvD,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,EAChC,OAAO,EAAE,yBAAyB,CAAC,MAAM,EAAE,CAAC,CAAC,GAC5C,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAkI5B;IAED,OAAO,CAAC,gBAAgB;IAwCxB;;OAEG;IACa,kBAAkB,CAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,IAAI,EACxD,OAAO,CAAC,EAAE,uBAAuB,GAChC,MAAM,IAAI,CAMZ;IAEe,OAAO,IAAI,IAAI,CAM9B;CACF"}
|
|
@@ -25,22 +25,7 @@ export declare class IndexedDbVectorStorage<Schema extends DataPortSchemaObject,
|
|
|
25
25
|
private vectorDimensions;
|
|
26
26
|
private vectorPropertyName;
|
|
27
27
|
private metadataPropertyName;
|
|
28
|
-
/**
|
|
29
|
-
* Creates a new IndexedDB vector storage
|
|
30
|
-
* @param table - The name of the IndexedDB store (defaults to 'vectors')
|
|
31
|
-
* @param schema - The schema definition for the entity
|
|
32
|
-
* @param primaryKeyNames - Array of property names that form the primary key
|
|
33
|
-
* @param indexes - Array of columns or column arrays to make searchable
|
|
34
|
-
* @param dimensions - The number of dimensions of the vector
|
|
35
|
-
* @param _vectorCtor - TypedArray constructor (unused, IndexedDB stores typed arrays natively)
|
|
36
|
-
* @param migrationOptions - Options for handling database schema migrations
|
|
37
|
-
* @param clientProvidedKeys - How to handle client-provided values for auto-generated keys
|
|
38
|
-
*/
|
|
39
28
|
constructor(table: string | undefined, schema: Schema, primaryKeyNames: PrimaryKeyNames, indexes: readonly (keyof NoInfer<Entity> | readonly (keyof NoInfer<Entity>)[])[] | undefined, dimensions: number, _vectorCtor?: TypedArrayConstructor, migrationOptions?: MigrationOptions, clientProvidedKeys?: ClientProvidedKeysOption);
|
|
40
|
-
/**
|
|
41
|
-
* Get the vector dimensions
|
|
42
|
-
* @returns The vector dimensions
|
|
43
|
-
*/
|
|
44
29
|
getVectorDimensions(): number;
|
|
45
30
|
similaritySearch(query: TypedArray, options?: VectorSearchOptions<Record<string, unknown>>): Promise<(Entity & {
|
|
46
31
|
score: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedDbVectorStorage.d.ts","sourceRoot":"","sources":["../../src/storage/IndexedDbVectorStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,eAAO,MAAM,qBAAqB,yDAEjC,CAAC;
|
|
1
|
+
{"version":3,"file":"IndexedDbVectorStorage.d.ts","sourceRoot":"","sources":["../../src/storage/IndexedDbVectorStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OA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ction(this.table, "readwrite");
|
|
1175
1175
|
const store = transaction.objectStore(this.table);
|
|
1176
1176
|
transaction.oncomplete = () => {
|
|
1177
|
-
this.events.emit("delete",
|
|
1177
|
+
this.events.emit("delete", this.deleteIdentity(criteria));
|
|
1178
1178
|
this.hybridManager?.notifyLocalChange();
|
|
1179
1179
|
resolve();
|
|
1180
1180
|
};
|
|
@@ -1577,4 +1577,4 @@ export {
|
|
|
1577
1577
|
IDB_KV_REPOSITORY
|
|
1578
1578
|
};
|
|
1579
1579
|
|
|
1580
|
-
//# debugId=
|
|
1580
|
+
//# debugId=638D72A774579A8B64756E2164756E21
|