@delta-comic/db 3.0.0-next.10 → 3.0.0-next.11

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/index.d.mts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { isTauri } from "@tauri-apps/api/core";
2
- import { JSONColumnType, Kysely, SelectQueryBuilder, Selectable } from "kysely";
2
+ import { InsertObject, JSONColumnType, Kysely, Kysely as Kysely$1, SelectQueryBuilder, Selectable } from "kysely";
3
+ import { EntryKey } from "@pinia/colada";
3
4
  import { FormResult, FormSingleConfigure, PluginManifest, SourcedKeyType, SourcedValue, UniEpRaw, UniItem, UniItemAuthor, UniItemRaw } from "@delta-comic/model";
4
5
  import { MaybeRefOrGetter, Ref } from "vue";
5
6
  declare namespace utils_d_exports {
6
7
  export { CommonQueryKey, countDb, withTransition };
7
8
  }
8
- declare const withTransition: <T>(handler: (trx: Kysely<DB>) => Promise<T>, trx?: Kysely<DB>) => Promise<T>;
9
- declare function countDb(sql: SelectQueryBuilder<DB, any, object>): Promise<number>;
9
+ declare const withTransition: <T>(handler: (trx: Kysely$1<DB>) => Promise<T>, trx?: Kysely$1<DB>) => Promise<T>;
10
+ declare function countDb<TB extends keyof DB, O extends object>(sql: SelectQueryBuilder<DB, TB, O>): Promise<number>;
10
11
  declare enum CommonQueryKey {
11
12
  common = "db"
12
13
  }
@@ -27,7 +28,7 @@ declare enum QueryKey$5 {
27
28
  declare const useUpsert$4: () => {
28
29
  upsert: (vars: {
29
30
  item: StorableItem;
30
- trx?: Kysely<DB>;
31
+ trx?: Kysely$1<DB>;
31
32
  }) => Promise<string>;
32
33
  key: (CommonQueryKey | QueryKey$5)[];
33
34
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<string, Error, undefined>>;
@@ -38,11 +39,11 @@ declare const useUpsert$4: () => {
38
39
  isLoading: import("vue").ComputedRef<boolean>;
39
40
  variables: import("vue").ShallowRef<{
40
41
  item: StorableItem;
41
- trx?: Kysely<DB>;
42
+ trx?: Kysely$1<DB>;
42
43
  } | undefined>;
43
44
  mutate: (vars: {
44
45
  item: StorableItem;
45
- trx?: Kysely<DB>;
46
+ trx?: Kysely$1<DB>;
46
47
  }) => void;
47
48
  reset: () => void;
48
49
  };
@@ -72,9 +73,9 @@ declare const useUpsertItem: () => {
72
73
  upsert: (vars: {
73
74
  item: StorableItem;
74
75
  belongTos: Item$3["belongTo"][];
75
- trx?: Kysely<DB>;
76
+ trx?: Kysely$1<DB>;
76
77
  }) => Promise<void>;
77
- key: (CommonQueryKey | QueryKey$5 | QueryKey$4)[];
78
+ key: (CommonQueryKey | QueryKey$4 | QueryKey$5)[];
78
79
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
79
80
  status: import("vue").ShallowRef<import("@pinia/colada").DataStateStatus>;
80
81
  asyncStatus: import("vue").ShallowRef<import("@pinia/colada").AsyncStatus>;
@@ -84,12 +85,12 @@ declare const useUpsertItem: () => {
84
85
  variables: import("vue").ShallowRef<{
85
86
  item: StorableItem;
86
87
  belongTos: Item$3["belongTo"][];
87
- trx?: Kysely<DB>;
88
+ trx?: Kysely$1<DB>;
88
89
  } | undefined>;
89
90
  mutate: (vars: {
90
91
  item: StorableItem;
91
92
  belongTos: Item$3["belongTo"][];
92
- trx?: Kysely<DB>;
93
+ trx?: Kysely$1<DB>;
93
94
  }) => void;
94
95
  reset: () => void;
95
96
  };
@@ -98,7 +99,7 @@ declare const useMoveItem: () => {
98
99
  item: StorableItem;
99
100
  from: Item$3["belongTo"];
100
101
  aims: Item$3["belongTo"][];
101
- trx?: Kysely<DB>;
102
+ trx?: Kysely$1<DB>;
102
103
  }) => Promise<void>;
103
104
  key: QueryKey$4[];
104
105
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -111,20 +112,20 @@ declare const useMoveItem: () => {
111
112
  item: StorableItem;
112
113
  from: Item$3["belongTo"];
113
114
  aims: Item$3["belongTo"][];
114
- trx?: Kysely<DB>;
115
+ trx?: Kysely$1<DB>;
115
116
  } | undefined>;
116
117
  mutate: (vars: {
117
118
  item: StorableItem;
118
119
  from: Item$3["belongTo"];
119
120
  aims: Item$3["belongTo"][];
120
- trx?: Kysely<DB>;
121
+ trx?: Kysely$1<DB>;
121
122
  }) => void;
122
123
  reset: () => void;
123
124
  };
124
125
  declare const useCreateCard: () => {
125
126
  createCard: (vars: {
126
127
  card: Card;
127
- trx?: Kysely<DB>;
128
+ trx?: Kysely$1<DB>;
128
129
  }) => Promise<void>;
129
130
  key: QueryKey$4[];
130
131
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -135,18 +136,18 @@ declare const useCreateCard: () => {
135
136
  isLoading: import("vue").ComputedRef<boolean>;
136
137
  variables: import("vue").ShallowRef<{
137
138
  card: Card;
138
- trx?: Kysely<DB>;
139
+ trx?: Kysely$1<DB>;
139
140
  } | undefined>;
140
141
  mutate: (vars: {
141
142
  card: Card;
142
- trx?: Kysely<DB>;
143
+ trx?: Kysely$1<DB>;
143
144
  }) => void;
144
145
  reset: () => void;
145
146
  };
146
- declare const useQueryItem: <T>(query: (db: SelectQueryBuilder<DB, "favouriteItem", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
147
- declare const useQueryCard: <T>(query: (db: SelectQueryBuilder<DB, "favouriteCard", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
147
+ declare const useQueryItem: <T>(query: (db: SelectQueryBuilder<DB, "favouriteItem", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
148
+ declare const useQueryCard: <T>(query: (db: SelectQueryBuilder<DB, "favouriteCard", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
148
149
  declare namespace plugin_d_exports {
149
- export { Archive, Meta, QueryKey$3 as QueryKey, Table$5 as Table, removeByNames, useQuery$3 as useQuery, useRemove$3 as useRemove, useSetKind, useToggleEnable, useUpsert$3 as useUpsert };
150
+ export { Archive, Meta, QueryKey$3 as QueryKey, Table$5 as Table, removeByNames, useQuery$4 as useQuery, useRemove$3 as useRemove, useToggleEnable, useUpsert$3 as useUpsert };
150
151
  }
151
152
  type Meta = PluginManifest;
152
153
  interface Table$5 {
@@ -164,11 +165,11 @@ type Archive = Selectable<Table$5>;
164
165
  declare enum QueryKey$3 {
165
166
  item = "db:plugin:"
166
167
  }
167
- declare const removeByNames: (keys: Archive["pluginName"][], trx: Kysely<DB>) => Promise<void>;
168
+ declare const removeByNames: (keys: Archive["pluginName"][], trx: Kysely$1<DB>) => Promise<void>;
168
169
  declare const useUpsert$3: () => {
169
170
  upsert: (vars: {
170
171
  archives: Archive[];
171
- trx?: Kysely<DB>;
172
+ trx?: Kysely$1<DB>;
172
173
  }) => Promise<void>;
173
174
  key: (CommonQueryKey | QueryKey$3)[];
174
175
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -179,18 +180,18 @@ declare const useUpsert$3: () => {
179
180
  isLoading: import("vue").ComputedRef<boolean>;
180
181
  variables: import("vue").ShallowRef<{
181
182
  archives: Archive[];
182
- trx?: Kysely<DB>;
183
+ trx?: Kysely$1<DB>;
183
184
  } | undefined>;
184
185
  mutate: (vars: {
185
186
  archives: Archive[];
186
- trx?: Kysely<DB>;
187
+ trx?: Kysely$1<DB>;
187
188
  }) => void;
188
189
  reset: () => void;
189
190
  };
190
191
  declare const useRemove$3: () => {
191
192
  remove: (vars: {
192
193
  keys: Archive["pluginName"][];
193
- trx?: Kysely<DB>;
194
+ trx?: Kysely$1<DB>;
194
195
  }) => Promise<void>;
195
196
  key: (CommonQueryKey | QueryKey$3)[];
196
197
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -201,18 +202,18 @@ declare const useRemove$3: () => {
201
202
  isLoading: import("vue").ComputedRef<boolean>;
202
203
  variables: import("vue").ShallowRef<{
203
204
  keys: Archive["pluginName"][];
204
- trx?: Kysely<DB>;
205
+ trx?: Kysely$1<DB>;
205
206
  } | undefined>;
206
207
  mutate: (vars: {
207
208
  keys: Archive["pluginName"][];
208
- trx?: Kysely<DB>;
209
+ trx?: Kysely$1<DB>;
209
210
  }) => void;
210
211
  reset: () => void;
211
212
  };
212
213
  declare const useToggleEnable: () => {
213
214
  toggle: (vars: {
214
215
  keys: Archive["pluginName"][];
215
- trx?: Kysely<DB>;
216
+ trx?: Kysely$1<DB>;
216
217
  }) => Promise<import("kysely").UpdateResult[] | undefined>;
217
218
  key: (CommonQueryKey | QueryKey$3)[];
218
219
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<import("kysely").UpdateResult[] | undefined, Error, undefined>>;
@@ -223,39 +224,17 @@ declare const useToggleEnable: () => {
223
224
  isLoading: import("vue").ComputedRef<boolean>;
224
225
  variables: import("vue").ShallowRef<{
225
226
  keys: Archive["pluginName"][];
226
- trx?: Kysely<DB>;
227
+ trx?: Kysely$1<DB>;
227
228
  } | undefined>;
228
229
  mutate: (vars: {
229
230
  keys: Archive["pluginName"][];
230
- trx?: Kysely<DB>;
231
+ trx?: Kysely$1<DB>;
231
232
  }) => void;
232
233
  reset: () => void;
233
234
  };
234
- declare const useSetKind: () => {
235
- setKind: (vars: {
236
- pluginName: string;
237
- kind: NonNullable<Meta["kind"]>;
238
- }) => Promise<void>;
239
- key: (CommonQueryKey | QueryKey$3)[];
240
- state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
241
- status: import("vue").ShallowRef<import("@pinia/colada").DataStateStatus>;
242
- asyncStatus: import("vue").ShallowRef<import("@pinia/colada").AsyncStatus>;
243
- data: import("vue").ShallowRef<void | undefined>;
244
- error: import("vue").ShallowRef<Error | null>;
245
- isLoading: import("vue").ComputedRef<boolean>;
246
- variables: import("vue").ShallowRef<{
247
- pluginName: string;
248
- kind: NonNullable<Meta["kind"]>;
249
- } | undefined>;
250
- mutate: (vars: {
251
- pluginName: string;
252
- kind: NonNullable<Meta["kind"]>;
253
- }) => void;
254
- reset: () => void;
255
- };
256
- declare const useQuery$3: <T>(query: (db: SelectQueryBuilder<DB, "plugin", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
235
+ declare const useQuery$4: <T>(query: (db: SelectQueryBuilder<DB, "plugin", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
257
236
  declare namespace history_d_exports {
258
- export { Item$2 as Item, QueryKey$2 as QueryKey, Table$4 as Table, useQuery$2 as useQuery, useRemove$2 as useRemove, useUpsert$2 as useUpsert };
237
+ export { Item$2 as Item, QueryKey$2 as QueryKey, Table$4 as Table, useQuery$3 as useQuery, useRemove$2 as useRemove, useUpsert$2 as useUpsert };
259
238
  }
260
239
  interface Table$4 {
261
240
  /** @description primary key */
@@ -270,9 +249,9 @@ declare enum QueryKey$2 {
270
249
  declare const useUpsert$2: () => {
271
250
  upsert: (vars: {
272
251
  item: StorableItem;
273
- trx?: Kysely<DB>;
252
+ trx?: Kysely$1<DB>;
274
253
  }) => Promise<void>;
275
- key: (CommonQueryKey | QueryKey$2 | QueryKey$5)[];
254
+ key: (CommonQueryKey | QueryKey$5 | QueryKey$2)[];
276
255
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
277
256
  status: import("vue").ShallowRef<import("@pinia/colada").DataStateStatus>;
278
257
  asyncStatus: import("vue").ShallowRef<import("@pinia/colada").AsyncStatus>;
@@ -281,18 +260,18 @@ declare const useUpsert$2: () => {
281
260
  isLoading: import("vue").ComputedRef<boolean>;
282
261
  variables: import("vue").ShallowRef<{
283
262
  item: StorableItem;
284
- trx?: Kysely<DB>;
263
+ trx?: Kysely$1<DB>;
285
264
  } | undefined>;
286
265
  mutate: (vars: {
287
266
  item: StorableItem;
288
- trx?: Kysely<DB>;
267
+ trx?: Kysely$1<DB>;
289
268
  }) => void;
290
269
  reset: () => void;
291
270
  };
292
271
  declare const useRemove$2: () => {
293
272
  remove: (vars: {
294
273
  keys: Item$2["timestamp"][];
295
- trx?: Kysely<DB>;
274
+ trx?: Kysely$1<DB>;
296
275
  }) => Promise<void>;
297
276
  key: (CommonQueryKey | QueryKey$2)[];
298
277
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -303,15 +282,15 @@ declare const useRemove$2: () => {
303
282
  isLoading: import("vue").ComputedRef<boolean>;
304
283
  variables: import("vue").ShallowRef<{
305
284
  keys: Item$2["timestamp"][];
306
- trx?: Kysely<DB>;
285
+ trx?: Kysely$1<DB>;
307
286
  } | undefined>;
308
287
  mutate: (vars: {
309
288
  keys: Item$2["timestamp"][];
310
- trx?: Kysely<DB>;
289
+ trx?: Kysely$1<DB>;
311
290
  }) => void;
312
291
  reset: () => void;
313
292
  };
314
- declare const useQuery$2: <T>(query: (db: SelectQueryBuilder<DB, "history", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
293
+ declare const useQuery$3: <T>(query: (db: SelectQueryBuilder<DB, "history", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
315
294
  declare namespace config_d_exports {
316
295
  export { ConfigDescription, ConfigRef, Table$3 as Table, useConfig };
317
296
  }
@@ -337,7 +316,7 @@ interface Table {
337
316
  }
338
317
  declare const useNativeStore: <T extends object>(namespace: string, key: MaybeRefOrGetter<string>, defaultValue: MaybeRefOrGetter<T>) => Ref<T, T>;
339
318
  declare namespace recentView_d_exports {
340
- export { Item$1 as Item, QueryKey$1 as QueryKey, Table$2 as Table, useQuery$1 as useQuery, useRemove$1 as useRemove, useUpsert$1 as useUpsert };
319
+ export { Item$1 as Item, QueryKey$1 as QueryKey, Table$2 as Table, useQuery$2 as useQuery, useRemove$1 as useRemove, useUpsert$1 as useUpsert };
341
320
  }
342
321
  interface Table$2 {
343
322
  /** @description primary key */
@@ -352,7 +331,7 @@ declare enum QueryKey$1 {
352
331
  declare const useUpsert$1: () => {
353
332
  upsert: (vars: {
354
333
  item: StorableItem;
355
- trx?: Kysely<DB>;
334
+ trx?: Kysely$1<DB>;
356
335
  }) => Promise<void>;
357
336
  key: (CommonQueryKey | QueryKey$5 | QueryKey$1)[];
358
337
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -363,18 +342,18 @@ declare const useUpsert$1: () => {
363
342
  isLoading: import("vue").ComputedRef<boolean>;
364
343
  variables: import("vue").ShallowRef<{
365
344
  item: StorableItem;
366
- trx?: Kysely<DB>;
345
+ trx?: Kysely$1<DB>;
367
346
  } | undefined>;
368
347
  mutate: (vars: {
369
348
  item: StorableItem;
370
- trx?: Kysely<DB>;
349
+ trx?: Kysely$1<DB>;
371
350
  }) => void;
372
351
  reset: () => void;
373
352
  };
374
353
  declare const useRemove$1: () => {
375
354
  remove: (vars: {
376
355
  items: Item$1["timestamp"][];
377
- trx?: Kysely<DB>;
356
+ trx?: Kysely$1<DB>;
378
357
  }) => Promise<void>;
379
358
  key: (CommonQueryKey | QueryKey$1)[];
380
359
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -385,17 +364,17 @@ declare const useRemove$1: () => {
385
364
  isLoading: import("vue").ComputedRef<boolean>;
386
365
  variables: import("vue").ShallowRef<{
387
366
  items: Item$1["timestamp"][];
388
- trx?: Kysely<DB>;
367
+ trx?: Kysely$1<DB>;
389
368
  } | undefined>;
390
369
  mutate: (vars: {
391
370
  items: Item$1["timestamp"][];
392
- trx?: Kysely<DB>;
371
+ trx?: Kysely$1<DB>;
393
372
  }) => void;
394
373
  reset: () => void;
395
374
  };
396
- declare const useQuery$1: <T>(query: (db: SelectQueryBuilder<DB, "recentView", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
375
+ declare const useQuery$2: <T>(query: (db: SelectQueryBuilder<DB, "recentView", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
397
376
  declare namespace subscribe_d_exports {
398
- export { AuthorItem, AuthorTable, EpItem, EpTable, Item, Key, Key_, QueryKey, Table$1 as Table, key, useQuery, useRemove, useUpsert };
377
+ export { AuthorItem, AuthorTable, EpItem, EpTable, Item, Key, Key_, QueryKey, Table$1 as Table, key, useQuery$1 as useQuery, useRemove, useUpsert };
399
378
  }
400
379
  declare const key: SourcedValue<[plugin: string, label: string]>;
401
380
  type Key_ = SourcedKeyType<typeof key>;
@@ -426,7 +405,7 @@ declare enum QueryKey {
426
405
  declare const useUpsert: () => {
427
406
  upsert: (vars: {
428
407
  items: Item[];
429
- trx?: Kysely<DB>;
408
+ trx?: Kysely$1<DB>;
430
409
  }) => Promise<void>;
431
410
  key: (CommonQueryKey | QueryKey)[];
432
411
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -437,18 +416,18 @@ declare const useUpsert: () => {
437
416
  isLoading: import("vue").ComputedRef<boolean>;
438
417
  variables: import("vue").ShallowRef<{
439
418
  items: Item[];
440
- trx?: Kysely<DB>;
419
+ trx?: Kysely$1<DB>;
441
420
  } | undefined>;
442
421
  mutate: (vars: {
443
422
  items: Item[];
444
- trx?: Kysely<DB>;
423
+ trx?: Kysely$1<DB>;
445
424
  }) => void;
446
425
  reset: () => void;
447
426
  };
448
427
  declare const useRemove: () => {
449
428
  remove: (vars: {
450
429
  keys: Item["key"][];
451
- trx?: Kysely<DB>;
430
+ trx?: Kysely$1<DB>;
452
431
  }) => Promise<void>;
453
432
  key: (CommonQueryKey | QueryKey)[];
454
433
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
@@ -459,15 +438,15 @@ declare const useRemove: () => {
459
438
  isLoading: import("vue").ComputedRef<boolean>;
460
439
  variables: import("vue").ShallowRef<{
461
440
  keys: Item["key"][];
462
- trx?: Kysely<DB>;
441
+ trx?: Kysely$1<DB>;
463
442
  } | undefined>;
464
443
  mutate: (vars: {
465
444
  keys: Item["key"][];
466
- trx?: Kysely<DB>;
445
+ trx?: Kysely$1<DB>;
467
446
  }) => void;
468
447
  reset: () => void;
469
448
  };
470
- declare const useQuery: <T>(query: (db: SelectQueryBuilder<DB, "subscribe", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
449
+ declare const useQuery$1: <T>(query: (db: SelectQueryBuilder<DB, "subscribe", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
471
450
  //#endregion
472
451
  //#region lib/index.d.ts
473
452
  interface DB {
@@ -482,7 +461,7 @@ interface DB {
482
461
  config: Table$3;
483
462
  }
484
463
  declare const isTauriRuntime: typeof isTauri;
485
- declare const db: Kysely<DB>;
464
+ declare const db: Kysely$1<DB>;
486
465
  //#endregion
487
- export { config_d_exports as ConfigDB, DB, utils_d_exports as DBUtils, favourite_d_exports as FavouriteDB, history_d_exports as HistoryDB, itemStore_d_exports as ItemStoreDB, plugin_d_exports as PluginArchiveDB, recentView_d_exports as RecentDB, subscribe_d_exports as SubscribeDB, Table, db, isTauriRuntime, useConfig, useNativeStore };
466
+ export { config_d_exports as ConfigDB, DB, utils_d_exports as DBUtils, favourite_d_exports as FavouriteDB, history_d_exports as HistoryDB, type InsertObject, itemStore_d_exports as ItemStoreDB, type Kysely, plugin_d_exports as PluginArchiveDB, recentView_d_exports as RecentDB, subscribe_d_exports as SubscribeDB, Table, db, isTauriRuntime, useConfig, useNativeStore };
488
467
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -43,7 +43,6 @@ var plugin_exports = /* @__PURE__ */ __exportAll({
43
43
  removeByNames: () => removeByNames,
44
44
  useQuery: () => useQuery$4,
45
45
  useRemove: () => useRemove$3,
46
- useSetKind: () => useSetKind,
47
46
  useToggleEnable: () => useToggleEnable,
48
47
  useUpsert: () => useUpsert$4
49
48
  });
@@ -115,29 +114,6 @@ const useToggleEnable = defineMutation(() => {
115
114
  key
116
115
  };
117
116
  });
118
- const useSetKind = defineMutation(() => {
119
- const queryCache = useQueryCache();
120
- const key = ["db", "db:plugin:"];
121
- const { mutateAsync, ...mutation } = useMutation({
122
- mutation: async ({ pluginName, kind }) => withTransition(async (trx) => {
123
- const plugin = await trx.selectFrom("plugin").select(["loaderName", "meta"]).where("pluginName", "=", pluginName).executeTakeFirstOrThrow();
124
- if (plugin.loaderName === "builtin") throw new Error("built-in plugin kind cannot be changed");
125
- await trx.updateTable("plugin").set({ meta: JSON.stringify({
126
- ...plugin.meta,
127
- kind
128
- }) }).where("pluginName", "=", pluginName).execute();
129
- }),
130
- onSettled: () => {
131
- queryCache.invalidateQueries({ key });
132
- },
133
- key
134
- });
135
- return {
136
- ...mutation,
137
- setKind: mutateAsync,
138
- key
139
- };
140
- });
141
117
  const useQuery$4 = (query, otherKeys = [], initialData) => useQuery({
142
118
  query: async () => {
143
119
  const { db } = await import("./index.mjs");
@@ -146,8 +122,9 @@ const useQuery$4 = (query, otherKeys = [], initialData) => useQuery({
146
122
  key: () => [
147
123
  "db",
148
124
  "db:plugin:",
149
- query
150
- ].concat(otherKeys),
125
+ query,
126
+ ...otherKeys
127
+ ],
151
128
  staleTime: 15e3,
152
129
  refetchOnMount: "always",
153
130
  initialData,
@@ -283,8 +260,9 @@ const useQueryItem = (query, otherKeys = [], initialData) => useQuery({
283
260
  key: () => [
284
261
  "db:favouriteItem:",
285
262
  "db:favouriteCard:",
286
- query
287
- ].concat(otherKeys),
263
+ query,
264
+ ...otherKeys
265
+ ],
288
266
  staleTime: 15e3,
289
267
  initialData,
290
268
  initialDataUpdatedAt: 0
@@ -294,7 +272,11 @@ const useQueryCard = (query, otherKeys = [], initialData) => useQuery({
294
272
  const { db } = await import("./index.mjs");
295
273
  return await query(db.selectFrom("favouriteCard"));
296
274
  },
297
- key: () => ["db:favouriteCard:", query].concat(otherKeys),
275
+ key: () => [
276
+ "db:favouriteCard:",
277
+ query,
278
+ ...otherKeys
279
+ ],
298
280
  staleTime: 15e3,
299
281
  refetchOnMount: "always",
300
282
  initialData,
@@ -369,8 +351,9 @@ const useQuery$3 = (query, otherKeys = [], initialData) => useQuery({
369
351
  key: () => [
370
352
  "db",
371
353
  "db:history:",
372
- query
373
- ].concat(otherKeys),
354
+ query,
355
+ ...otherKeys
356
+ ],
374
357
  staleTime: 15e3,
375
358
  refetchOnMount: "always",
376
359
  initialData,
@@ -437,8 +420,9 @@ const useQuery$2 = (query, otherKeys = [], initialData) => useQuery({
437
420
  key: () => [
438
421
  "db",
439
422
  "db:subscribe:",
440
- query
441
- ].concat(otherKeys),
423
+ query,
424
+ ...otherKeys
425
+ ],
442
426
  staleTime: 15e3,
443
427
  refetchOnMount: "always",
444
428
  initialData,
@@ -513,8 +497,9 @@ const useQuery$1 = (query, otherKeys = [], initialData) => useQuery({
513
497
  key: () => [
514
498
  "db",
515
499
  "db:recentView:",
516
- query
517
- ].concat(otherKeys),
500
+ query,
501
+ ...otherKeys
502
+ ],
518
503
  staleTime: 15e3,
519
504
  refetchOnMount: "always",
520
505
  initialData,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["QueryKey","useUpsert","useRemove","useQuery","useColadaQuery","QueryKey","useUpsert","QueryKey","ItemStoreDB.useUpsert","useColadaQuery","QueryKey","useUpsert","ItemStoreDB.useUpsert","useRemove","useQuery","useColadaQuery","QueryKey","useUpsert","useRemove","useQuery","useColadaQuery","ItemStoreDB.useUpsert","useQuery","useColadaQuery"],"sources":["../lib/utils.ts","../lib/plugin.ts","../lib/itemStore.ts","../lib/favourite.ts","../lib/history.ts","../lib/subscribe.ts","../lib/recentView.ts","../lib/config.ts","../lib/nativeStore/index.ts","../lib/index.ts"],"sourcesContent":["import { logger } from '@delta-comic/logger'\nimport type { Kysely, SelectQueryBuilder } from 'kysely'\n\nimport type { DB } from '.'\n\nconst transactionLogger = logger.scoped('db:transaction')\n\nexport const withTransition = async <T>(\n handler: (trx: Kysely<DB>) => Promise<T>,\n trx?: Kysely<DB>,\n) => {\n if (trx) return await handler(trx)\n else {\n const { db } = await import('.')\n transactionLogger.trace('database transaction started')\n try {\n const result = await db\n .transaction()\n .setAccessMode('read write')\n .setIsolationLevel('read committed')\n .execute(handler)\n transactionLogger.trace('database transaction committed')\n return result\n } catch (error) {\n transactionLogger.error('database transaction failed', error)\n throw error\n }\n }\n}\n\nexport async function countDb(sql: SelectQueryBuilder<DB, any, object>) {\n const v = await sql.select(db => db.fn.countAll<number>().as('count')).executeTakeFirstOrThrow()\n return v.count\n}\n\nexport enum CommonQueryKey {\n common = 'db',\n}","import type { PluginManifest } from '@delta-comic/model'\nimport {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n} from '@pinia/colada'\nimport type { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport type Meta = PluginManifest\n\nexport interface Table {\n installerName: string\n loaderName: string\n /** @description primary key */\n pluginName: string\n meta: JSONColumnType<Meta>\n enable: boolean\n installInput: string\n displayName: string\n}\n\n/** @description Not Blue */\nexport type Archive = Selectable<Table>\n\nexport enum QueryKey {\n item = 'db:plugin:',\n}\n\nexport const removeByNames = async (keys: Archive['pluginName'][], trx: Kysely<DB>) => {\n if (keys.length === 0) return\n await trx.deleteFrom('plugin').where('plugin.pluginName', 'in', keys).execute()\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ archives, trx }: { archives: Archive[]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx\n .replaceInto('plugin')\n .values(archives.map(a => ({ ...a, meta: JSON.stringify(a.meta) })))\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useRemove = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ keys, trx }: { keys: Archive['pluginName'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await removeByNames(keys, trx)\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, remove: mutateAsync, key }\n})\n\nexport const useToggleEnable = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ keys, trx }: { keys: Archive['pluginName'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n for (const key of keys) {\n const isEnable = await trx\n .selectFrom('plugin')\n .where('pluginName', '=', key)\n .select('enable')\n .executeTakeFirstOrThrow()\n return trx\n .updateTable('plugin')\n .where('pluginName', '=', key)\n .set({ enable: !isEnable.enable })\n .execute()\n }\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, toggle: mutateAsync, key }\n})\n\nexport const useSetKind = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({\n pluginName,\n kind,\n }: {\n pluginName: string\n kind: NonNullable<Meta['kind']>\n }) =>\n withTransition(async trx => {\n const plugin = await trx\n .selectFrom('plugin')\n .select(['loaderName', 'meta'])\n .where('pluginName', '=', pluginName)\n .executeTakeFirstOrThrow()\n if (plugin.loaderName === 'builtin')\n throw new Error('built-in plugin kind cannot be changed')\n await trx\n .updateTable('plugin')\n .set({ meta: JSON.stringify({ ...plugin.meta, kind }) })\n .where('pluginName', '=', pluginName)\n .execute()\n }),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, setKind: mutateAsync, key }\n})\n\nexport const useQuery = <T>(\n query: (db: SelectQueryBuilder<DB, 'plugin', {}>) => Promise<T>,\n otherKeys: any[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('plugin'))\n },\n key: () => [CommonQueryKey.common, QueryKey.item, query].concat(otherKeys),\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import {\n SourcedValue,\n Struct,\n UniContentPage,\n type UniItem,\n type UniItemRaw,\n} from '@delta-comic/model'\nimport { defineMutation, useMutation, useQueryCache } from '@pinia/colada'\nimport type { JSONColumnType, Kysely, Selectable } from 'kysely'\n\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport interface Table {\n /** @description primary key */\n key: string\n item: JSONColumnType<UniItemRaw>\n}\nexport type StorableItem = UniItem | UniItemRaw\nexport type StoredItem = Selectable<Table>\nexport const itemKey = new SourcedValue('*')\n\nexport enum QueryKey {\n item = 'db:itemStore:',\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ item, trx }: { item: StorableItem; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n const k = itemKey.toString([\n UniContentPage.contentPages.key.toString(item.contentType),\n item.id,\n ])\n await trx\n .replaceInto('itemStore')\n .values({ item: Struct.toRaw(item), key: k })\n .execute()\n return k\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})","import {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n} from '@pinia/colada'\nimport type { Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport * as ItemStoreDB from './itemStore'\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport interface CardTable {\n title: string\n private: boolean\n description: string\n /** @description primary key */\n createAt: number\n}\n\nexport type Card = Selectable<CardTable>\n\nexport interface ItemTable {\n itemKey: string\n /** @description foreign key */\n belongTo: CardTable['createAt']\n addTime: number\n}\n\nexport type Item = Selectable<ItemTable>\n\nexport enum QueryKey {\n item = 'db:favouriteItem:',\n card = 'db:favouriteCard:',\n}\n\nexport const useUpsertItem = defineMutation(() => {\n const queryCache = useQueryCache()\n const { key: iKey, upsert } = ItemStoreDB.useUpsert()\n const key = [CommonQueryKey.common, QueryKey.item, ...iKey]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({\n item,\n belongTos,\n trx,\n }: {\n item: ItemStoreDB.StorableItem\n belongTos: Item['belongTo'][]\n trx?: Kysely<DB>\n }) =>\n withTransition(async trx => {\n const itemKey = await upsert({ item, trx })\n await trx\n .replaceInto('favouriteItem')\n .values(belongTos.map(belongTo => ({ addTime: Date.now(), itemKey, belongTo })))\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useMoveItem = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({\n item,\n from,\n aims,\n trx,\n }: {\n item: ItemStoreDB.StorableItem\n from: Item['belongTo']\n aims: Item['belongTo'][]\n trx?: Kysely<DB>\n }) =>\n withTransition(async trx => {\n await trx\n .deleteFrom('favouriteItem')\n .where('itemKey', '=', item.id)\n .where('belongTo', '=', from)\n .execute()\n await trx\n .replaceInto('favouriteItem')\n .values(aims.map(to => ({ addTime: Date.now(), itemKey: item.id, belongTo: to })))\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, move: mutateAsync, key }\n})\n\nexport const useCreateCard = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [QueryKey.card, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ card, trx }: { card: Card; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx.replaceInto('favouriteCard').values(card).execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, createCard: mutateAsync, key }\n})\n\nexport const useQueryItem = <T>(\n query: (db: SelectQueryBuilder<DB, 'favouriteItem', {}>) => Promise<T>,\n otherKeys: any[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('favouriteItem'))\n },\n key: () => [QueryKey.item, QueryKey.card, query].concat(otherKeys),\n staleTime: 15000,\n initialData,\n initialDataUpdatedAt: 0,\n })\n\nexport const useQueryCard = <T>(\n query: (db: SelectQueryBuilder<DB, 'favouriteCard', {}>) => Promise<T>,\n otherKeys: any[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('favouriteCard'))\n },\n key: () => [QueryKey.card, query].concat(otherKeys),\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import { Struct, type UniEpRaw } from '@delta-comic/model'\nimport {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n} from '@pinia/colada'\nimport type { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport * as ItemStoreDB from './itemStore'\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport interface Table {\n /** @description primary key */\n timestamp: number\n itemKey: string\n ep: JSONColumnType<UniEpRaw>\n}\n\nexport type Item = Selectable<Table>\n\nexport enum QueryKey {\n item = 'db:history:',\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const { key: iKey, upsert } = ItemStoreDB.useUpsert()\n const key = [CommonQueryKey.common, QueryKey.item, ...iKey]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ item, trx }: { item: ItemStoreDB.StorableItem; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n const itemKey = await upsert({ item, trx })\n await trx\n .replaceInto('history')\n .values({ itemKey, timestamp: Date.now(), ep: Struct.toRaw(item) })\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useRemove = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: ({ keys, trx }: { keys: Item['timestamp'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx.deleteFrom('history').where('history.timestamp', 'is', keys).execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, remove: mutateAsync, key }\n})\n\nexport const useQuery = <T>(\n query: (db: SelectQueryBuilder<DB, 'history', {}>) => Promise<T>,\n otherKeys: any[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('history'))\n },\n key: () => [CommonQueryKey.common, QueryKey.item, query].concat(otherKeys),\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import { SourcedValue, type SourcedKeyType, type UniItemAuthor } from '@delta-comic/model'\nimport {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n} from '@pinia/colada'\nimport type { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport const key = new SourcedValue<[plugin: string, label: string]>()\nexport type Key_ = SourcedKeyType<typeof key>\nexport type Key = Exclude<Key_, string>\n\nexport interface AuthorTable {\n author: JSONColumnType<UniItemAuthor>\n itemKey: null\n type: 'author'\n /** @description primary key */\n key: string\n plugin: string\n}\nexport type AuthorItem = Selectable<AuthorTable>\n\nexport interface EpTable {\n author: null\n itemKey: string // not f key\n type: 'ep'\n /** @description primary key */\n key: string\n plugin: string\n}\nexport type EpItem = Selectable<EpTable>\n\nexport type Table = AuthorTable | EpTable\nexport type Item = AuthorItem | EpItem\n\nexport enum QueryKey {\n item = 'db:subscribe:',\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ items, trx }: { items: Item[]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx\n .replaceInto('subscribe')\n .values(items.map(item => ({ ...item, author: JSON.stringify(item.author) })))\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useRemove = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ keys, trx }: { keys: Item['key'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx.deleteFrom('subscribe').where('subscribe.key', 'is', keys).execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, remove: mutateAsync, key }\n})\n\nexport const useQuery = <T>(\n query: (db: SelectQueryBuilder<DB, 'subscribe', {}>) => Promise<T>,\n otherKeys: any[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('subscribe'))\n },\n key: () => [CommonQueryKey.common, QueryKey.item, query].concat(otherKeys),\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n} from '@pinia/colada'\nimport type { Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport * as ItemStoreDB from './itemStore'\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport interface Table {\n /** @description primary key */\n timestamp: number\n itemKey: string\n isViewed: boolean\n}\nexport type Item = Selectable<Table>\n\nexport enum QueryKey {\n item = 'db:recentView:',\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const { key: iKey, upsert } = ItemStoreDB.useUpsert()\n const key = [CommonQueryKey.common, QueryKey.item, ...iKey]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ item, trx }: { item: ItemStoreDB.StorableItem; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n const itemKey = await upsert({ item, trx })\n await trx\n .replaceInto('recentView')\n .values({ isViewed: false, itemKey, timestamp: Date.now() })\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useRemove = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ items, trx }: { items: Item['timestamp'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx.deleteFrom('recentView').where('recentView.timestamp', 'is', items).execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, remove: mutateAsync, key }\n})\n\nexport const useQuery = <T>(\n query: (db: SelectQueryBuilder<DB, 'recentView', {}>) => Promise<T>,\n otherKeys: any[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('recentView'))\n },\n key: () => [CommonQueryKey.common, QueryKey.item, query].concat(otherKeys),\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import { logger } from '@delta-comic/logger'\nimport type { FormResult, FormSingleConfigure } from '@delta-comic/model'\nimport { fromPairs } from 'es-toolkit/compat'\nimport { ref, watch, type Ref } from 'vue'\n\nconst configLogger = logger.scoped('db:config')\n\nexport interface Table {\n /** @description config owner, usually plugin name */\n belongTo: string\n /** @description serialized form structure */\n form: string\n /** @description serialized config data */\n data: string\n}\n\nexport type ConfigRef<T> = Ref<T> & { readonly ready: Promise<void> }\n\nexport type ConfigDescription = Record<\n string,\n Required<Pick<FormSingleConfigure, 'defaultValue'>> & FormSingleConfigure\n>\n\nconst cloneValue = <T>(value: T): T => {\n if (typeof structuredClone === 'function') return structuredClone(value)\n return JSON.parse(JSON.stringify(value)) as T\n}\n\nconst createDefaultData = <T extends ConfigDescription>(config: T): FormResult<T> =>\n fromPairs(\n Object.entries(config).map(([name, desc]) => [name, desc.defaultValue]),\n ) as FormResult<T>\n\nconst parseJson = <T>(value: unknown, fallback: T): T => {\n if (!value) return cloneValue(fallback)\n if (typeof value !== 'string') return cloneValue(value as T)\n try {\n return JSON.parse(value) as T\n } catch (error) {\n configLogger.warn('failed to parse config value', error)\n return cloneValue(fallback)\n }\n}\n\nconst upsertConfig = async (belongTo: string, form: any, data: unknown) => {\n const { db } = await import('.')\n await db\n .replaceInto('config')\n .values({ belongTo, form: JSON.stringify(form), data: JSON.stringify(data) })\n .execute()\n configLogger.debug('config persisted', { belongTo })\n}\n\nexport const useConfig = <T extends ConfigDescription>(\n belongTo: string,\n form: T,\n): ConfigRef<FormResult<T>> => {\n const defaultData = createDefaultData(form)\n const data = ref(cloneValue(defaultData)) as Ref<FormResult<T>>\n let hydrated = false\n let saveTimer: ReturnType<typeof setTimeout> | undefined\n\n const persist = () => {\n if (saveTimer) clearTimeout(saveTimer)\n saveTimer = setTimeout(() => {\n void upsertConfig(belongTo, form, data.value).catch(error => {\n configLogger.warn('failed to persist config value', { belongTo }, error)\n })\n }, 100)\n }\n\n const ready = (async () => {\n try {\n const { db } = await import('.')\n const stored = await db\n .selectFrom('config')\n .select(['form', 'data'])\n .where('belongTo', '=', belongTo)\n .executeTakeFirst()\n data.value = parseJson(stored?.data, defaultData)\n configLogger.debug('config hydrated', { belongTo, found: Boolean(stored) })\n hydrated = true\n const storedForm =\n typeof stored?.form === 'string' ? stored.form : JSON.stringify(stored?.form)\n if (!stored || storedForm !== JSON.stringify(form)) persist()\n } catch (error) {\n configLogger.warn('failed to load config value', { belongTo }, error)\n data.value = cloneValue(defaultData)\n hydrated = true\n }\n })()\n\n watch(\n data,\n () => {\n if (!hydrated) return\n persist()\n },\n { deep: true, flush: 'sync' },\n )\n\n return Object.assign(data, { ready })\n}","import { logger } from '@delta-comic/logger'\nimport { SourcedValue } from '@delta-comic/model'\nimport { ref, toValue, watch, type MaybeRefOrGetter, type Ref } from 'vue'\n\nconst nativeStoreLogger = logger.scoped('db:native-store')\n\nexport interface Table {\n namespace: string\n key: string\n value: string\n}\n\nconst saveKey = new SourcedValue<[namespace: string, key: string]>()\n\nconst cloneDefault = <T extends object>(defaultValue: MaybeRefOrGetter<T>): T => {\n const value = toValue(defaultValue)\n if (typeof structuredClone === 'function') return structuredClone(value)\n return JSON.parse(JSON.stringify(value)) as T\n}\n\nconst legacyValue = (namespace: string, key: string) => {\n try {\n return globalThis.localStorage?.getItem(saveKey.toString([namespace, key])) ?? null\n } catch {\n return null\n }\n}\n\nconst parseValue = <T extends object>(value: unknown, defaultValue: MaybeRefOrGetter<T>): T => {\n if (value === null || value === '') return cloneDefault(defaultValue)\n if (typeof value !== 'string') {\n if (typeof structuredClone === 'function') return structuredClone(value as T)\n return JSON.parse(JSON.stringify(value)) as T\n }\n try {\n return JSON.parse(value) as T\n } catch (error) {\n nativeStoreLogger.warn('failed to parse native store value', error)\n return cloneDefault(defaultValue)\n }\n}\n\nconst getStoreValue = async (namespace: string, key: string) => {\n const { db } = await import('../index')\n return (\n (\n await db\n .selectFrom('nativeStore')\n .select('value')\n .where('namespace', '=', namespace)\n .where('key', '=', key)\n .executeTakeFirst()\n )?.value ?? null\n )\n}\n\nconst setStoreValue = async (namespace: string, key: string, value: string) => {\n const { db } = await import('../index')\n await db.replaceInto('nativeStore').values({ namespace, key, value }).execute()\n}\n\nexport const useNativeStore = <T extends object>(\n namespace: string,\n key: MaybeRefOrGetter<string>,\n defaultValue: MaybeRefOrGetter<T>,\n) => {\n const state = ref(cloneDefault(defaultValue)) as Ref<T>\n let version = 0\n let hydrated = false\n let saveTimer: ReturnType<typeof setTimeout> | undefined\n\n const persist = (resolvedKey: string, value: T) => {\n if (saveTimer) clearTimeout(saveTimer)\n const encoded = JSON.stringify(value)\n saveTimer = setTimeout(() => {\n void setStoreValue(namespace, resolvedKey, encoded).catch(error => {\n nativeStoreLogger.warn(\n 'failed to persist native store value',\n { key: resolvedKey, namespace },\n error,\n )\n })\n }, 100)\n }\n\n const load = async () => {\n const current = ++version\n const resolvedKey = toValue(key)\n hydrated = false\n try {\n const storeValue = await getStoreValue(namespace, resolvedKey)\n const storedValue = storeValue ?? legacyValue(namespace, resolvedKey)\n if (current !== version) return\n state.value = parseValue(storedValue, defaultValue)\n nativeStoreLogger.debug('native store value hydrated', {\n key: resolvedKey,\n namespace,\n source: storeValue === null ? 'legacy-or-default' : 'database',\n })\n hydrated = true\n if (storeValue === null) persist(resolvedKey, state.value)\n } catch (error) {\n nativeStoreLogger.warn(\n 'failed to load native store value',\n { key: resolvedKey, namespace },\n error,\n )\n if (current !== version) return\n state.value = cloneDefault(defaultValue)\n hydrated = true\n }\n }\n\n watch(\n () => toValue(key),\n () => void load(),\n { immediate: true },\n )\n watch(\n state,\n value => {\n if (!hydrated) return\n persist(toValue(key), value)\n },\n { deep: true },\n )\n\n return state\n}","import { logger } from '@delta-comic/logger'\nimport { isTauri } from '@tauri-apps/api/core'\nimport { CamelCasePlugin, type Dialect, Kysely } from 'kysely'\nimport { SerializePlugin } from 'kysely-plugin-serialize'\n\nimport type * as FavouriteDB from './favourite'\nexport * as PluginArchiveDB from './plugin'\nimport type * as HistoryDB from './history'\nexport * as FavouriteDB from './favourite'\nimport type * as ConfigDB from './config'\nimport type * as ItemStoreDB from './itemStore'\nimport type * as NativeStoreDB from './nativeStore'\nexport * as HistoryDB from './history'\nimport type * as PluginArchiveDB from './plugin'\nexport * as ItemStoreDB from './itemStore'\nimport type * as RecentDB from './recentView'\nexport * as SubscribeDB from './subscribe'\nimport type * as SubscribeDB from './subscribe'\nexport * as RecentDB from './recentView'\nexport * as ConfigDB from './config'\n\nexport interface DB {\n itemStore: ItemStoreDB.Table\n favouriteCard: FavouriteDB.CardTable\n favouriteItem: FavouriteDB.ItemTable\n history: HistoryDB.Table\n recentView: RecentDB.Table\n subscribe: SubscribeDB.Table\n plugin: PluginArchiveDB.Table\n nativeStore: NativeStoreDB.Table\n config: ConfigDB.Table\n}\n\nconst databaseLogger = logger.scoped('db:lifecycle')\n\ndatabaseLogger.info('database initialization started')\n\nexport const isTauriRuntime = isTauri\n\nconst createDialect = async (): Promise<Dialect> => {\n if (isTauriRuntime()) {\n const [{ default: Database }, { TauriSqliteDialect }] = await Promise.all([\n import('@tauri-apps/plugin-sql'),\n import('kysely-dialect-tauri'),\n ])\n const database = await Database.load('sqlite:app.db')\n databaseLogger.info('native sqlite dialect initialized')\n return new TauriSqliteDialect({ database })\n }\n\n const { createWebDialect } = await import('./web')\n databaseLogger.info('web sqlite dialect initialized')\n return createWebDialect()\n}\n\nexport const db = new Kysely<DB>({\n dialect: await createDialect(),\n plugins: [new CamelCasePlugin(), new SerializePlugin()],\n})\n\nexport * as DBUtils from './utils'\n\nexport * from './nativeStore'\nexport { useConfig } from './config'"],"mappings":";;;;;;;;;;;;;;;AAKA,MAAM,oBAAoB,OAAO,OAAO,gBAAgB;AAExD,MAAa,iBAAiB,OAC5B,SACA,QACG;CACH,IAAI,KAAK,OAAO,MAAM,QAAQ,GAAG;MAC5B;EACH,MAAM,EAAE,OAAO,MAAM,OAAO;EAC5B,kBAAkB,MAAM,8BAA8B;EACtD,IAAI;GACF,MAAM,SAAS,MAAM,GACl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D,OAAO,IAAI,mBAAmB,EAAE,SAAS,CAAC;CAC5C;CAEA,MAAM,EAAE,qBAAqB,MAAM,OAAO;CAC1C,eAAe,KAAK,gCAAgC;CACpD,OAAO,iBAAiB;AAC1B;AAEA,MAAa,KAAK,IAAI,OAAW;CAC/B,SAAS,MAAM,cAAc;CAC7B,SAAS,CAAC,IAAI,gBAAgB,GAAG,IAAI,gBAAgB,CAAC;AACxD,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["QueryKey","useUpsert","useRemove","useQuery","useColadaQuery","QueryKey","useUpsert","QueryKey","ItemStoreDB.useUpsert","useColadaQuery","QueryKey","useUpsert","ItemStoreDB.useUpsert","useRemove","useQuery","useColadaQuery","QueryKey","useUpsert","useRemove","useQuery","useColadaQuery","ItemStoreDB.useUpsert","useQuery","useColadaQuery"],"sources":["../lib/utils.ts","../lib/plugin.ts","../lib/itemStore.ts","../lib/favourite.ts","../lib/history.ts","../lib/subscribe.ts","../lib/recentView.ts","../lib/config.ts","../lib/nativeStore/index.ts","../lib/index.ts"],"sourcesContent":["import { logger } from '@delta-comic/logger'\nimport type { Kysely, SelectQueryBuilder } from 'kysely'\n\nimport type { DB } from '.'\n\nconst transactionLogger = logger.scoped('db:transaction')\n\nexport const withTransition = async <T>(\n handler: (trx: Kysely<DB>) => Promise<T>,\n trx?: Kysely<DB>,\n) => {\n if (trx) return await handler(trx)\n else {\n const { db } = await import('.')\n transactionLogger.trace('database transaction started')\n try {\n const result = await db\n .transaction()\n .setAccessMode('read write')\n .setIsolationLevel('read committed')\n .execute(handler)\n transactionLogger.trace('database transaction committed')\n return result\n } catch (error) {\n transactionLogger.error('database transaction failed', error)\n throw error\n }\n }\n}\n\nexport async function countDb<TB extends keyof DB, O extends object>(\n sql: SelectQueryBuilder<DB, TB, O>,\n) {\n const v = await sql.select(db => db.fn.countAll<number>().as('count')).executeTakeFirstOrThrow()\n return v.count\n}\n\nexport enum CommonQueryKey {\n common = 'db',\n}","import type { PluginManifest } from '@delta-comic/model'\nimport {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n type EntryKey,\n} from '@pinia/colada'\nimport type { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport type Meta = PluginManifest\n\nexport interface Table {\n installerName: string\n loaderName: string\n /** @description primary key */\n pluginName: string\n meta: JSONColumnType<Meta>\n enable: boolean\n installInput: string\n displayName: string\n}\n\n/** @description Not Blue */\nexport type Archive = Selectable<Table>\n\nexport enum QueryKey {\n item = 'db:plugin:',\n}\n\nexport const removeByNames = async (keys: Archive['pluginName'][], trx: Kysely<DB>) => {\n if (keys.length === 0) return\n await trx.deleteFrom('plugin').where('plugin.pluginName', 'in', keys).execute()\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ archives, trx }: { archives: Archive[]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx\n .replaceInto('plugin')\n .values(archives.map(a => ({ ...a, meta: JSON.stringify(a.meta) })))\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useRemove = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ keys, trx }: { keys: Archive['pluginName'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await removeByNames(keys, trx)\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, remove: mutateAsync, key }\n})\n\nexport const useToggleEnable = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ keys, trx }: { keys: Archive['pluginName'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n for (const key of keys) {\n const isEnable = await trx\n .selectFrom('plugin')\n .where('pluginName', '=', key)\n .select('enable')\n .executeTakeFirstOrThrow()\n return trx\n .updateTable('plugin')\n .where('pluginName', '=', key)\n .set({ enable: !isEnable.enable })\n .execute()\n }\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, toggle: mutateAsync, key }\n})\n\nexport const useQuery = <T>(\n query: (db: SelectQueryBuilder<DB, 'plugin', {}>) => Promise<T>,\n otherKeys: readonly EntryKey[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('plugin'))\n },\n key: () => [CommonQueryKey.common, QueryKey.item, query, ...otherKeys],\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import {\n SourcedValue,\n Struct,\n UniContentPage,\n type UniItem,\n type UniItemRaw,\n} from '@delta-comic/model'\nimport { defineMutation, useMutation, useQueryCache } from '@pinia/colada'\nimport type { JSONColumnType, Kysely, Selectable } from 'kysely'\n\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport interface Table {\n /** @description primary key */\n key: string\n item: JSONColumnType<UniItemRaw>\n}\nexport type StorableItem = UniItem | UniItemRaw\nexport type StoredItem = Selectable<Table>\nexport const itemKey = new SourcedValue('*')\n\nexport enum QueryKey {\n item = 'db:itemStore:',\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ item, trx }: { item: StorableItem; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n const k = itemKey.toString([\n UniContentPage.contentPages.key.toString(item.contentType),\n item.id,\n ])\n await trx\n .replaceInto('itemStore')\n .values({ item: Struct.toRaw(item), key: k })\n .execute()\n return k\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})","import {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n type EntryKey,\n} from '@pinia/colada'\nimport type { Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport * as ItemStoreDB from './itemStore'\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport interface CardTable {\n title: string\n private: boolean\n description: string\n /** @description primary key */\n createAt: number\n}\n\nexport type Card = Selectable<CardTable>\n\nexport interface ItemTable {\n itemKey: string\n /** @description foreign key */\n belongTo: CardTable['createAt']\n addTime: number\n}\n\nexport type Item = Selectable<ItemTable>\n\nexport enum QueryKey {\n item = 'db:favouriteItem:',\n card = 'db:favouriteCard:',\n}\n\nexport const useUpsertItem = defineMutation(() => {\n const queryCache = useQueryCache()\n const { key: iKey, upsert } = ItemStoreDB.useUpsert()\n const key = [CommonQueryKey.common, QueryKey.item, ...iKey]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({\n item,\n belongTos,\n trx,\n }: {\n item: ItemStoreDB.StorableItem\n belongTos: Item['belongTo'][]\n trx?: Kysely<DB>\n }) =>\n withTransition(async trx => {\n const itemKey = await upsert({ item, trx })\n await trx\n .replaceInto('favouriteItem')\n .values(belongTos.map(belongTo => ({ addTime: Date.now(), itemKey, belongTo })))\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useMoveItem = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({\n item,\n from,\n aims,\n trx,\n }: {\n item: ItemStoreDB.StorableItem\n from: Item['belongTo']\n aims: Item['belongTo'][]\n trx?: Kysely<DB>\n }) =>\n withTransition(async trx => {\n await trx\n .deleteFrom('favouriteItem')\n .where('itemKey', '=', item.id)\n .where('belongTo', '=', from)\n .execute()\n await trx\n .replaceInto('favouriteItem')\n .values(aims.map(to => ({ addTime: Date.now(), itemKey: item.id, belongTo: to })))\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, move: mutateAsync, key }\n})\n\nexport const useCreateCard = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [QueryKey.card, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ card, trx }: { card: Card; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx.replaceInto('favouriteCard').values(card).execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, createCard: mutateAsync, key }\n})\n\nexport const useQueryItem = <T>(\n query: (db: SelectQueryBuilder<DB, 'favouriteItem', {}>) => Promise<T>,\n otherKeys: readonly EntryKey[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('favouriteItem'))\n },\n key: () => [QueryKey.item, QueryKey.card, query, ...otherKeys],\n staleTime: 15000,\n initialData,\n initialDataUpdatedAt: 0,\n })\n\nexport const useQueryCard = <T>(\n query: (db: SelectQueryBuilder<DB, 'favouriteCard', {}>) => Promise<T>,\n otherKeys: readonly EntryKey[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('favouriteCard'))\n },\n key: () => [QueryKey.card, query, ...otherKeys],\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import { Struct, type UniEpRaw } from '@delta-comic/model'\nimport {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n type EntryKey,\n} from '@pinia/colada'\nimport type { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport * as ItemStoreDB from './itemStore'\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport interface Table {\n /** @description primary key */\n timestamp: number\n itemKey: string\n ep: JSONColumnType<UniEpRaw>\n}\n\nexport type Item = Selectable<Table>\n\nexport enum QueryKey {\n item = 'db:history:',\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const { key: iKey, upsert } = ItemStoreDB.useUpsert()\n const key = [CommonQueryKey.common, QueryKey.item, ...iKey]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ item, trx }: { item: ItemStoreDB.StorableItem; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n const itemKey = await upsert({ item, trx })\n await trx\n .replaceInto('history')\n .values({ itemKey, timestamp: Date.now(), ep: Struct.toRaw(item) })\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useRemove = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: ({ keys, trx }: { keys: Item['timestamp'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx.deleteFrom('history').where('history.timestamp', 'is', keys).execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, remove: mutateAsync, key }\n})\n\nexport const useQuery = <T>(\n query: (db: SelectQueryBuilder<DB, 'history', {}>) => Promise<T>,\n otherKeys: readonly EntryKey[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('history'))\n },\n key: () => [CommonQueryKey.common, QueryKey.item, query, ...otherKeys],\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import { SourcedValue, type SourcedKeyType, type UniItemAuthor } from '@delta-comic/model'\nimport {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n type EntryKey,\n} from '@pinia/colada'\nimport type { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport const key = new SourcedValue<[plugin: string, label: string]>()\nexport type Key_ = SourcedKeyType<typeof key>\nexport type Key = Exclude<Key_, string>\n\nexport interface AuthorTable {\n author: JSONColumnType<UniItemAuthor>\n itemKey: null\n type: 'author'\n /** @description primary key */\n key: string\n plugin: string\n}\nexport type AuthorItem = Selectable<AuthorTable>\n\nexport interface EpTable {\n author: null\n itemKey: string // not f key\n type: 'ep'\n /** @description primary key */\n key: string\n plugin: string\n}\nexport type EpItem = Selectable<EpTable>\n\nexport type Table = AuthorTable | EpTable\nexport type Item = AuthorItem | EpItem\n\nexport enum QueryKey {\n item = 'db:subscribe:',\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ items, trx }: { items: Item[]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx\n .replaceInto('subscribe')\n .values(items.map(item => ({ ...item, author: JSON.stringify(item.author) })))\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useRemove = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ keys, trx }: { keys: Item['key'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx.deleteFrom('subscribe').where('subscribe.key', 'is', keys).execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, remove: mutateAsync, key }\n})\n\nexport const useQuery = <T>(\n query: (db: SelectQueryBuilder<DB, 'subscribe', {}>) => Promise<T>,\n otherKeys: readonly EntryKey[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('subscribe'))\n },\n key: () => [CommonQueryKey.common, QueryKey.item, query, ...otherKeys],\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import {\n defineMutation,\n useMutation,\n useQueryCache,\n useQuery as useColadaQuery,\n type EntryKey,\n} from '@pinia/colada'\nimport type { Kysely, Selectable, SelectQueryBuilder } from 'kysely'\n\nimport * as ItemStoreDB from './itemStore'\nimport { CommonQueryKey, withTransition } from './utils'\n\nimport type { DB } from '.'\n\nexport interface Table {\n /** @description primary key */\n timestamp: number\n itemKey: string\n isViewed: boolean\n}\nexport type Item = Selectable<Table>\n\nexport enum QueryKey {\n item = 'db:recentView:',\n}\n\nexport const useUpsert = defineMutation(() => {\n const queryCache = useQueryCache()\n const { key: iKey, upsert } = ItemStoreDB.useUpsert()\n const key = [CommonQueryKey.common, QueryKey.item, ...iKey]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ item, trx }: { item: ItemStoreDB.StorableItem; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n const itemKey = await upsert({ item, trx })\n await trx\n .replaceInto('recentView')\n .values({ isViewed: false, itemKey, timestamp: Date.now() })\n .execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, upsert: mutateAsync, key }\n})\n\nexport const useRemove = defineMutation(() => {\n const queryCache = useQueryCache()\n const key = [CommonQueryKey.common, QueryKey.item]\n const { mutateAsync, ...mutation } = useMutation({\n mutation: async ({ items, trx }: { items: Item['timestamp'][]; trx?: Kysely<DB> }) =>\n withTransition(async trx => {\n await trx.deleteFrom('recentView').where('recentView.timestamp', 'is', items).execute()\n }, trx),\n onSettled: () => {\n void queryCache.invalidateQueries({ key })\n },\n key,\n })\n return { ...mutation, remove: mutateAsync, key }\n})\n\nexport const useQuery = <T>(\n query: (db: SelectQueryBuilder<DB, 'recentView', {}>) => Promise<T>,\n otherKeys: readonly EntryKey[] = [],\n initialData?: () => T,\n) =>\n useColadaQuery({\n query: async () => {\n const { db } = await import('.')\n return await query(db.selectFrom('recentView'))\n },\n key: () => [CommonQueryKey.common, QueryKey.item, query, ...otherKeys],\n staleTime: 15000,\n refetchOnMount: 'always',\n initialData,\n initialDataUpdatedAt: 0,\n })","import { logger } from '@delta-comic/logger'\nimport type { FormResult, FormSingleConfigure } from '@delta-comic/model'\nimport { fromPairs } from 'es-toolkit/compat'\nimport { ref, watch, type Ref } from 'vue'\n\nconst configLogger = logger.scoped('db:config')\n\nexport interface Table {\n /** @description config owner, usually plugin name */\n belongTo: string\n /** @description serialized form structure */\n form: string\n /** @description serialized config data */\n data: string\n}\n\nexport type ConfigRef<T> = Ref<T> & { readonly ready: Promise<void> }\n\nexport type ConfigDescription = Record<\n string,\n Required<Pick<FormSingleConfigure, 'defaultValue'>> & FormSingleConfigure\n>\n\nconst cloneValue = <T>(value: T): T => {\n if (typeof structuredClone === 'function') return structuredClone(value)\n return JSON.parse(JSON.stringify(value)) as T\n}\n\nconst createDefaultData = <T extends ConfigDescription>(config: T): FormResult<T> =>\n fromPairs(\n Object.entries(config).map(([name, desc]) => [name, desc.defaultValue]),\n ) as FormResult<T>\n\nconst parseJson = <T>(value: unknown, fallback: T): T => {\n if (!value) return cloneValue(fallback)\n if (typeof value !== 'string') return cloneValue(value as T)\n try {\n return JSON.parse(value) as T\n } catch (error) {\n configLogger.warn('failed to parse config value', error)\n return cloneValue(fallback)\n }\n}\n\nconst upsertConfig = async (belongTo: string, form: ConfigDescription, data: unknown) => {\n const { db } = await import('.')\n await db\n .replaceInto('config')\n .values({ belongTo, form: JSON.stringify(form), data: JSON.stringify(data) })\n .execute()\n configLogger.debug('config persisted', { belongTo })\n}\n\nexport const useConfig = <T extends ConfigDescription>(\n belongTo: string,\n form: T,\n): ConfigRef<FormResult<T>> => {\n const defaultData = createDefaultData(form)\n const data = ref(cloneValue(defaultData)) as Ref<FormResult<T>>\n let hydrated = false\n let saveTimer: ReturnType<typeof setTimeout> | undefined\n\n const persist = () => {\n if (saveTimer) clearTimeout(saveTimer)\n saveTimer = setTimeout(() => {\n void upsertConfig(belongTo, form, data.value).catch(error => {\n configLogger.warn('failed to persist config value', { belongTo }, error)\n })\n }, 100)\n }\n\n const ready = (async () => {\n try {\n const { db } = await import('.')\n const stored = await db\n .selectFrom('config')\n .select(['form', 'data'])\n .where('belongTo', '=', belongTo)\n .executeTakeFirst()\n data.value = parseJson(stored?.data, defaultData)\n configLogger.debug('config hydrated', { belongTo, found: Boolean(stored) })\n hydrated = true\n const storedForm =\n typeof stored?.form === 'string' ? stored.form : JSON.stringify(stored?.form)\n if (!stored || storedForm !== JSON.stringify(form)) persist()\n } catch (error) {\n configLogger.warn('failed to load config value', { belongTo }, error)\n data.value = cloneValue(defaultData)\n hydrated = true\n }\n })()\n\n watch(\n data,\n () => {\n if (!hydrated) return\n persist()\n },\n { deep: true, flush: 'sync' },\n )\n\n return Object.assign(data, { ready })\n}","import { logger } from '@delta-comic/logger'\nimport { SourcedValue } from '@delta-comic/model'\nimport { ref, toValue, watch, type MaybeRefOrGetter, type Ref } from 'vue'\n\nconst nativeStoreLogger = logger.scoped('db:native-store')\n\nexport interface Table {\n namespace: string\n key: string\n value: string\n}\n\nconst saveKey = new SourcedValue<[namespace: string, key: string]>()\n\nconst cloneDefault = <T extends object>(defaultValue: MaybeRefOrGetter<T>): T => {\n const value = toValue(defaultValue)\n if (typeof structuredClone === 'function') return structuredClone(value)\n return JSON.parse(JSON.stringify(value)) as T\n}\n\nconst legacyValue = (namespace: string, key: string) => {\n try {\n return globalThis.localStorage?.getItem(saveKey.toString([namespace, key])) ?? null\n } catch {\n return null\n }\n}\n\nconst parseValue = <T extends object>(value: unknown, defaultValue: MaybeRefOrGetter<T>): T => {\n if (value === null || value === '') return cloneDefault(defaultValue)\n if (typeof value !== 'string') {\n if (typeof structuredClone === 'function') return structuredClone(value as T)\n return JSON.parse(JSON.stringify(value)) as T\n }\n try {\n return JSON.parse(value) as T\n } catch (error) {\n nativeStoreLogger.warn('failed to parse native store value', error)\n return cloneDefault(defaultValue)\n }\n}\n\nconst getStoreValue = async (namespace: string, key: string) => {\n const { db } = await import('../index')\n return (\n (\n await db\n .selectFrom('nativeStore')\n .select('value')\n .where('namespace', '=', namespace)\n .where('key', '=', key)\n .executeTakeFirst()\n )?.value ?? null\n )\n}\n\nconst setStoreValue = async (namespace: string, key: string, value: string) => {\n const { db } = await import('../index')\n await db.replaceInto('nativeStore').values({ namespace, key, value }).execute()\n}\n\nexport const useNativeStore = <T extends object>(\n namespace: string,\n key: MaybeRefOrGetter<string>,\n defaultValue: MaybeRefOrGetter<T>,\n) => {\n const state = ref(cloneDefault(defaultValue)) as Ref<T>\n let version = 0\n let hydrated = false\n let saveTimer: ReturnType<typeof setTimeout> | undefined\n\n const persist = (resolvedKey: string, value: T) => {\n if (saveTimer) clearTimeout(saveTimer)\n const encoded = JSON.stringify(value)\n saveTimer = setTimeout(() => {\n void setStoreValue(namespace, resolvedKey, encoded).catch(error => {\n nativeStoreLogger.warn(\n 'failed to persist native store value',\n { key: resolvedKey, namespace },\n error,\n )\n })\n }, 100)\n }\n\n const load = async () => {\n const current = ++version\n const resolvedKey = toValue(key)\n hydrated = false\n try {\n const storeValue = await getStoreValue(namespace, resolvedKey)\n const storedValue = storeValue ?? legacyValue(namespace, resolvedKey)\n if (current !== version) return\n state.value = parseValue(storedValue, defaultValue)\n nativeStoreLogger.debug('native store value hydrated', {\n key: resolvedKey,\n namespace,\n source: storeValue === null ? 'legacy-or-default' : 'database',\n })\n hydrated = true\n if (storeValue === null) persist(resolvedKey, state.value)\n } catch (error) {\n nativeStoreLogger.warn(\n 'failed to load native store value',\n { key: resolvedKey, namespace },\n error,\n )\n if (current !== version) return\n state.value = cloneDefault(defaultValue)\n hydrated = true\n }\n }\n\n watch(\n () => toValue(key),\n () => void load(),\n { immediate: true },\n )\n watch(\n state,\n value => {\n if (!hydrated) return\n persist(toValue(key), value)\n },\n { deep: true },\n )\n\n return state\n}","import { logger } from '@delta-comic/logger'\nimport { isTauri } from '@tauri-apps/api/core'\nimport { CamelCasePlugin, type Dialect, Kysely } from 'kysely'\nimport { SerializePlugin } from 'kysely-plugin-serialize'\n\nimport type * as FavouriteDB from './favourite'\nexport * as PluginArchiveDB from './plugin'\nimport type * as HistoryDB from './history'\nexport * as FavouriteDB from './favourite'\nimport type * as ConfigDB from './config'\nimport type * as ItemStoreDB from './itemStore'\nimport type * as NativeStoreDB from './nativeStore'\nexport * as HistoryDB from './history'\nimport type * as PluginArchiveDB from './plugin'\nexport * as ItemStoreDB from './itemStore'\nimport type * as RecentDB from './recentView'\nexport * as SubscribeDB from './subscribe'\nimport type * as SubscribeDB from './subscribe'\nexport * as RecentDB from './recentView'\nexport * as ConfigDB from './config'\n\nexport interface DB {\n itemStore: ItemStoreDB.Table\n favouriteCard: FavouriteDB.CardTable\n favouriteItem: FavouriteDB.ItemTable\n history: HistoryDB.Table\n recentView: RecentDB.Table\n subscribe: SubscribeDB.Table\n plugin: PluginArchiveDB.Table\n nativeStore: NativeStoreDB.Table\n config: ConfigDB.Table\n}\n\nconst databaseLogger = logger.scoped('db:lifecycle')\n\ndatabaseLogger.info('database initialization started')\n\nexport const isTauriRuntime = isTauri\n\nconst createDialect = async (): Promise<Dialect> => {\n if (isTauriRuntime()) {\n const [{ default: Database }, { TauriSqliteDialect }] = await Promise.all([\n import('@tauri-apps/plugin-sql'),\n import('kysely-dialect-tauri'),\n ])\n const database = await Database.load('sqlite:app.db')\n databaseLogger.info('native sqlite dialect initialized')\n return new TauriSqliteDialect({ database })\n }\n\n const { createWebDialect } = await import('./web')\n databaseLogger.info('web sqlite dialect initialized')\n return createWebDialect()\n}\n\nexport const db = new Kysely<DB>({\n dialect: await createDialect(),\n plugins: [new CamelCasePlugin(), new SerializePlugin()],\n})\n\nexport * as DBUtils from './utils'\n\nexport type { InsertObject, Kysely } from 'k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GACD,WAAW;GACX,IAAI,eAAe,MAAM,QAAQ,aAAa,MAAM,KAAK;EAC3D,SAAS,OAAO;GACd,kBAAkB,KAChB,qCACA;IAAE,KAAK;IAAa;GAAU,GAC9B,KACF;GACA,IAAI,YAAY,SAAS;GACzB,MAAM,QAAQ,aAAa,YAAY;GACvC,WAAW;EACb;CACF;CAEA,YACQ,QAAQ,GAAG,SACX,KAAK,KAAK,GAChB,EAAE,WAAW,KAAK,CACpB;CACA,MACE,QACA,UAAS;EACP,IAAI,CAAC,UAAU;EACf,QAAQ,QAAQ,GAAG,GAAG,KAAK;CAC7B,GACA,EAAE,MAAM,KAAK,CACf;CAEA,OAAO;AACT;;;AC/FA,MAAM,iBAAiB,OAAO,OAAO,cAAc;AAEnD,eAAe,KAAK,iCAAiC;AAErD,MAAa,iBAAiB;AAE9B,MAAM,gBAAgB,YAA8B;CAClD,IAAI,eAAe,GAAG;EACpB,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,wBAAwB,MAAM,QAAQ,IAAI,CACxE,OAAO,2BACP,OAAO,uBACT,CAAC;EACD,MAAM,WAAW,MAAM,SAAS,KAAK,eAAe;EACpD,eAAe,KAAK,mCAAmC;EACvD,OAAO,IAAI,mBAAmB,EAAE,SAAS,CAAC;CAC5C;CAEA,MAAM,EAAE,qBAAqB,MAAM,OAAO;CAC1C,eAAe,KAAK,gCAAgC;CACpD,OAAO,iBAAiB;AAC1B;AAEA,MAAa,KAAK,IAAI,OAAW;CAC/B,SAAS,MAAM,cAAc;CAC7B,SAAS,CAAC,IAAI,gBAAgB,GAAG,IAAI,gBAAgB,CAAC;AACxD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delta-comic/db",
3
- "version": "3.0.0-next.10",
3
+ "version": "3.0.0-next.11",
4
4
  "description": "空阙虱楼",
5
5
  "homepage": "https://github.com/delta-comic/delta-comic",
6
6
  "license": "AGPL-3.0-only",
@@ -29,6 +29,7 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
+ "@delta-comic/logger": "3.0.0-next.11",
32
33
  "@subframe7536/sqlite-wasm": "^1.3.1",
33
34
  "@tauri-apps/api": "^2.11.1",
34
35
  "@tauri-apps/plugin-sql": "^2.4.0",
@@ -37,21 +38,16 @@
37
38
  "kysely-dialect-tauri": "^2.0.1",
38
39
  "kysely-plugin-serialize": "^0.8.2",
39
40
  "kysely-wasqlite-worker": "^2.0.1",
40
- "mitt": "^3.0.1",
41
- "@delta-comic/logger": "3.0.0-next.10"
41
+ "mitt": "^3.0.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "typescript": "npm:typescript-native-bridge@6.0.3-bridge.8.tsgo.7.0.2",
45
45
  "vite": "npm:@voidzero-dev/vite-plus-core@latest",
46
- "vite-plus": "^0.2.7"
46
+ "vite-plus": "^0.2.9"
47
47
  },
48
48
  "peerDependencies": {
49
+ "@delta-comic/model": "3.0.0-next.11",
49
50
  "@pinia/colada": "^1.4.2",
50
- "vue": "^3.6.0-rc.2",
51
- "@delta-comic/model": "3.0.0-next.10"
52
- },
53
- "scripts": {
54
- "build": "vp pack",
55
- "typecheck": "tsc -p tsconfig.app.json --noEmit && tsc -p tsconfig.node.json --noEmit"
51
+ "vue": "^3.6.0-rc.4"
56
52
  }
57
53
  }