@delta-comic/db 0.0.0-semantically-released
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/LICENSE +661 -0
- package/README.md +42 -0
- package/dist/esm-CT_qsGIx.js +7812 -0
- package/dist/esm-CT_qsGIx.js.map +1 -0
- package/dist/esm-EM3zjw1B.js +2 -0
- package/dist/index.js +785 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/favourite.d.ts +17 -0
- package/dist/lib/history.d.ts +10 -0
- package/dist/lib/index.d.ts +28 -0
- package/dist/lib/itemStore.d.ts +10 -0
- package/dist/lib/migrations/1_initial.d.ts +8 -0
- package/dist/lib/migrations/2_fix-display_name.d.ts +8 -0
- package/dist/lib/migrations/3_fix_fvi_foreign_key.d.ts +8 -0
- package/dist/lib/plugin.d.ts +31 -0
- package/dist/lib/recentView.d.ts +9 -0
- package/dist/lib/subscribe.d.ts +25 -0
- package/dist/pack.tgz +0 -0
- package/package.json +57 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Selectable } from 'kysely';
|
|
2
|
+
import * as ItemStoreDB from './itemStore';
|
|
3
|
+
export interface CardTable {
|
|
4
|
+
title: string;
|
|
5
|
+
private: boolean;
|
|
6
|
+
description: string;
|
|
7
|
+
createAt: number;
|
|
8
|
+
}
|
|
9
|
+
export type Card = Selectable<CardTable>;
|
|
10
|
+
export interface ItemTable {
|
|
11
|
+
itemKey: string;
|
|
12
|
+
belongTo: CardTable['createAt'];
|
|
13
|
+
addTime: number;
|
|
14
|
+
}
|
|
15
|
+
export type Item = Selectable<ItemTable>;
|
|
16
|
+
export declare function upsertItem(item: ItemStoreDB.StorableItem, ...belongTos: Item['belongTo'][]): Promise<void>;
|
|
17
|
+
export declare function moveItem(item: ItemStoreDB.StorableItem, from: Item['belongTo'], ...tos: Item['belongTo'][]): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSONColumnType, Selectable } from 'kysely';
|
|
2
|
+
import { uni } from '@delta-comic/model';
|
|
3
|
+
import * as ItemStoreDB from './itemStore';
|
|
4
|
+
export interface Table {
|
|
5
|
+
timestamp: number;
|
|
6
|
+
itemKey: string;
|
|
7
|
+
ep: JSONColumnType<uni.ep.RawEp>;
|
|
8
|
+
}
|
|
9
|
+
export type Item = Selectable<Table>;
|
|
10
|
+
export declare function upsert(item: ItemStoreDB.StorableItem): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Kysely, SelectQueryBuilder } from 'kysely';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import type * as PluginArchiveDB from './plugin';
|
|
4
|
+
export * as PluginArchiveDB from './plugin';
|
|
5
|
+
import type * as FavouriteDB from './favourite';
|
|
6
|
+
export * as FavouriteDB from './favourite';
|
|
7
|
+
import type * as HistoryDB from './history';
|
|
8
|
+
export * as HistoryDB from './history';
|
|
9
|
+
import type * as ItemStoreDB from './itemStore';
|
|
10
|
+
export * as ItemStoreDB from './itemStore';
|
|
11
|
+
import type * as SubscribeDB from './subscribe';
|
|
12
|
+
export * as SubscribeDB from './subscribe';
|
|
13
|
+
import type * as RecentDB from './recentView';
|
|
14
|
+
export * as RecentDB from './recentView';
|
|
15
|
+
export interface DB {
|
|
16
|
+
itemStore: ItemStoreDB.Table;
|
|
17
|
+
favouriteCard: FavouriteDB.CardTable;
|
|
18
|
+
favouriteItem: FavouriteDB.ItemTable;
|
|
19
|
+
history: HistoryDB.Table;
|
|
20
|
+
recentView: RecentDB.Table;
|
|
21
|
+
subscribe: SubscribeDB.Table;
|
|
22
|
+
plugin: PluginArchiveDB.Table;
|
|
23
|
+
}
|
|
24
|
+
export declare const db: import('vue').ShallowRef<Kysely<DB>, Kysely<DB>>;
|
|
25
|
+
export declare namespace DBUtils {
|
|
26
|
+
function countDb(sql: SelectQueryBuilder<DB, any, object>): Promise<number>;
|
|
27
|
+
}
|
|
28
|
+
export declare const useNativeStore: <T extends object>(namespace: string, key: MaybeRefOrGetter<string>, defaultValue: MaybeRefOrGetter<T>) => import('@vueuse/core').RemovableRef<T> & Promise<import('@vueuse/core').RemovableRef<T>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSONColumnType, Selectable } from 'kysely';
|
|
2
|
+
import { SourcedValue, uni } from '@delta-comic/model';
|
|
3
|
+
export interface Table {
|
|
4
|
+
key: string;
|
|
5
|
+
item: JSONColumnType<uni.item.RawItem>;
|
|
6
|
+
}
|
|
7
|
+
export type StorableItem = uni.item.Item | uni.item.RawItem;
|
|
8
|
+
export type StoredItem = Selectable<Table>;
|
|
9
|
+
export declare const key: SourcedValue<[string, string]>;
|
|
10
|
+
export declare function upsert(item: StorableItem): Promise<string>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PluginMeta } from '@delta-comic/plugin';
|
|
2
|
+
import { JSONColumnType, Selectable } from 'kysely';
|
|
3
|
+
export interface Table {
|
|
4
|
+
installerName: string;
|
|
5
|
+
loaderName: string;
|
|
6
|
+
pluginName: string;
|
|
7
|
+
meta: JSONColumnType<PluginMeta>;
|
|
8
|
+
enable: boolean;
|
|
9
|
+
installInput: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export type Meta = Selectable<Table>;
|
|
13
|
+
export declare function getByEnabled(isEnabled: boolean): Promise<{
|
|
14
|
+
installerName: string;
|
|
15
|
+
loaderName: string;
|
|
16
|
+
pluginName: string;
|
|
17
|
+
meta: PluginMeta;
|
|
18
|
+
enable: boolean;
|
|
19
|
+
installInput: string;
|
|
20
|
+
displayName: string;
|
|
21
|
+
}[]>;
|
|
22
|
+
export declare function get(pluginName: string): Promise<{
|
|
23
|
+
installerName: string;
|
|
24
|
+
loaderName: string;
|
|
25
|
+
pluginName: string;
|
|
26
|
+
meta: PluginMeta;
|
|
27
|
+
enable: boolean;
|
|
28
|
+
installInput: string;
|
|
29
|
+
displayName: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare function toggleEnable(pluginName: string): Promise<import('kysely').UpdateResult[]>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Selectable } from 'kysely';
|
|
2
|
+
import * as ItemStoreDB from './itemStore';
|
|
3
|
+
export interface Table {
|
|
4
|
+
timestamp: number;
|
|
5
|
+
itemKey: string;
|
|
6
|
+
isViewed: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type Item = Selectable<Table>;
|
|
9
|
+
export declare function upsert(item: ItemStoreDB.StorableItem): Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { JSONColumnType, Selectable } from 'kysely';
|
|
2
|
+
import { SourcedValue, SourcedKeyType, uni } from '@delta-comic/model';
|
|
3
|
+
export declare const key: SourcedValue<[plugin: string, label: string]>;
|
|
4
|
+
export type Key_ = SourcedKeyType<typeof key>;
|
|
5
|
+
export type Key = Exclude<Key_, string>;
|
|
6
|
+
export interface AuthorTable {
|
|
7
|
+
author: JSONColumnType<uni.item.Author>;
|
|
8
|
+
itemKey: null;
|
|
9
|
+
type: 'author';
|
|
10
|
+
key: string;
|
|
11
|
+
plugin: string;
|
|
12
|
+
}
|
|
13
|
+
export type AuthorItem = Selectable<AuthorTable>;
|
|
14
|
+
export interface EpTable {
|
|
15
|
+
author: null;
|
|
16
|
+
itemKey: string;
|
|
17
|
+
type: 'ep';
|
|
18
|
+
key: string;
|
|
19
|
+
plugin: string;
|
|
20
|
+
}
|
|
21
|
+
export type EpItem = Selectable<EpTable>;
|
|
22
|
+
export type Table = AuthorTable | EpTable;
|
|
23
|
+
export type Item = AuthorItem | EpItem;
|
|
24
|
+
export declare function getAll(): Promise<Item[]>;
|
|
25
|
+
export declare function upsert(item: Item): Promise<import('kysely').InsertResult[]>;
|
package/dist/pack.tgz
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@delta-comic/db",
|
|
3
|
+
"version": "0.0.0-semantically-released",
|
|
4
|
+
"description": "空阙虱楼",
|
|
5
|
+
"homepage": "https://github.com/delta-comic/delta-comic-core",
|
|
6
|
+
"license": "AGPL-3.0-only",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "wenxig",
|
|
9
|
+
"email": "wenxinguo12@gmail.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/delta-comic/delta-comic-core.git"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/lib/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/lib/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@tauri-apps/plugin-sql": "^2.3.2",
|
|
33
|
+
"@tauri-apps/plugin-store": "^2.4.2",
|
|
34
|
+
"@vueuse/core": "^14.2.1",
|
|
35
|
+
"kysely-dialect-tauri": "^1.2.1",
|
|
36
|
+
"kysely-plugin-serialize": "^0.8.2",
|
|
37
|
+
"mitt": "^3.0.1",
|
|
38
|
+
"@delta-comic/plugin": "0.0.0-semantically-released",
|
|
39
|
+
"@delta-comic/model": "0.0.0-semantically-released",
|
|
40
|
+
"@delta-comic/utils": "0.0.0-semantically-released"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"kysely": "^0.28",
|
|
44
|
+
"vue": "^3.5"
|
|
45
|
+
},
|
|
46
|
+
"release": {
|
|
47
|
+
"extends": "../../release.config.js",
|
|
48
|
+
"tagFormat": "model-${version}"
|
|
49
|
+
},
|
|
50
|
+
"dist": {
|
|
51
|
+
"tarball": "./dist/pack.tgz"
|
|
52
|
+
},
|
|
53
|
+
"readme": "./README.md",
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "vite build && pnpm pack --out ./dist/pack.tgz"
|
|
56
|
+
}
|
|
57
|
+
}
|