alphatheta-connect 0.18.0 → 0.19.1
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/lib/cli.js +0 -0
- package/lib/index.js +1 -12
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/localdb/onelibrary/adapter.d.ts +0 -110
- package/lib/localdb/onelibrary/connection.d.ts +0 -8
- package/lib/localdb/onelibrary/encryption.d.ts +0 -10
- package/lib/localdb/onelibrary/types.d.ts +0 -67
- package/lib/localdb/onelibrary-schema.d.ts +0 -250
package/package.json
CHANGED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OneLibrary Database Adapter
|
|
3
|
-
*
|
|
4
|
-
* Provides an interface for reading the OneLibrary (exportLibrary.db) SQLite database
|
|
5
|
-
* used by modern rekordbox versions and Pioneer DJ devices.
|
|
6
|
-
*/
|
|
7
|
-
import { Album, Artist, Artwork, Color, EntityFK, Genre, Key, Label, Playlist, PlaylistEntry, Track } from "../../entities";
|
|
8
|
-
import { CueAndLoop } from "../../types";
|
|
9
|
-
import { DatabaseAdapter, DatabaseType } from '../database-adapter';
|
|
10
|
-
import type { Category, DeviceProperty, HistorySession, HotCueBankList, MenuItem, MyTag, SortOption } from './types';
|
|
11
|
-
/**
|
|
12
|
-
* Adapter for OneLibrary database that matches the ORM interface.
|
|
13
|
-
* Queries the SQLite file directly instead of hydrating into memory.
|
|
14
|
-
*/
|
|
15
|
-
export declare class OneLibraryAdapter implements DatabaseAdapter {
|
|
16
|
-
#private;
|
|
17
|
-
readonly type: DatabaseType;
|
|
18
|
-
constructor(dbPath: string);
|
|
19
|
-
/**
|
|
20
|
-
* Close the database connection
|
|
21
|
-
*/
|
|
22
|
-
close(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Find a track by ID
|
|
25
|
-
*/
|
|
26
|
-
findTrack(id: number): Track | null;
|
|
27
|
-
/**
|
|
28
|
-
* Find all tracks in the database
|
|
29
|
-
*/
|
|
30
|
-
findAllTracks(): Track[];
|
|
31
|
-
/**
|
|
32
|
-
* Find cue points for a track
|
|
33
|
-
*/
|
|
34
|
-
findCues(trackId: number): CueAndLoop[];
|
|
35
|
-
/**
|
|
36
|
-
* Find a playlist by ID
|
|
37
|
-
*/
|
|
38
|
-
findPlaylistById(playlistId: number): Playlist | null;
|
|
39
|
-
/**
|
|
40
|
-
* Query for a list of {folders, playlists, tracks} given a playlist ID.
|
|
41
|
-
* If no ID is provided the root list is queried.
|
|
42
|
-
*/
|
|
43
|
-
findPlaylist(playlistId?: number): {
|
|
44
|
-
folders: Playlist[];
|
|
45
|
-
playlists: Playlist[];
|
|
46
|
-
trackEntries: PlaylistEntry<EntityFK.WithFKs>[];
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Get track IDs for a playlist in order
|
|
50
|
-
*/
|
|
51
|
-
findPlaylistContents(playlistId: number): number[];
|
|
52
|
-
findArtist(artistId: number): Artist | null;
|
|
53
|
-
findAlbum(albumId: number): Album | null;
|
|
54
|
-
findGenre(genreId: number): Genre | null;
|
|
55
|
-
findKey(keyId: number): Key | null;
|
|
56
|
-
findColor(colorId: number): Color | null;
|
|
57
|
-
findLabel(labelId: number): Label | null;
|
|
58
|
-
findArtwork(imageId: number): Artwork | null;
|
|
59
|
-
/**
|
|
60
|
-
* Find all root-level MyTags (folders and tags with no parent)
|
|
61
|
-
*/
|
|
62
|
-
findMyTags(parentId?: number): {
|
|
63
|
-
folders: MyTag[];
|
|
64
|
-
tags: MyTag[];
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Find a MyTag by ID
|
|
68
|
-
*/
|
|
69
|
-
findMyTagById(myTagId: number): MyTag | null;
|
|
70
|
-
/**
|
|
71
|
-
* Get track IDs for a MyTag
|
|
72
|
-
*/
|
|
73
|
-
findMyTagContents(myTagId: number): number[];
|
|
74
|
-
/**
|
|
75
|
-
* Get all MyTags assigned to a track
|
|
76
|
-
*/
|
|
77
|
-
findMyTagsForTrack(trackId: number): MyTag[];
|
|
78
|
-
/**
|
|
79
|
-
* Find all history sessions
|
|
80
|
-
*/
|
|
81
|
-
findHistorySessions(): HistorySession[];
|
|
82
|
-
/**
|
|
83
|
-
* Get track IDs for a history session in order
|
|
84
|
-
*/
|
|
85
|
-
findHistoryContents(historyId: number): number[];
|
|
86
|
-
/**
|
|
87
|
-
* Find all hot cue bank lists
|
|
88
|
-
*/
|
|
89
|
-
findHotCueBankLists(): HotCueBankList[];
|
|
90
|
-
/**
|
|
91
|
-
* Get cue IDs for a hot cue bank list
|
|
92
|
-
*/
|
|
93
|
-
findHotCueBankListCues(bankListId: number): number[];
|
|
94
|
-
/**
|
|
95
|
-
* Get all menu items (browse categories)
|
|
96
|
-
*/
|
|
97
|
-
findMenuItems(): MenuItem[];
|
|
98
|
-
/**
|
|
99
|
-
* Get visible categories with their menu item info
|
|
100
|
-
*/
|
|
101
|
-
findVisibleCategories(): Category[];
|
|
102
|
-
/**
|
|
103
|
-
* Get visible sort options
|
|
104
|
-
*/
|
|
105
|
-
findVisibleSortOptions(): SortOption[];
|
|
106
|
-
/**
|
|
107
|
-
* Get device properties
|
|
108
|
-
*/
|
|
109
|
-
getProperty(): DeviceProperty | null;
|
|
110
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OneLibrary Database Encryption
|
|
3
|
-
*
|
|
4
|
-
* The database is encrypted with SQLCipher 4. The encryption key is derived from
|
|
5
|
-
* a hardcoded obfuscated blob.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Get the SQLCipher encryption key for OneLibrary databases
|
|
9
|
-
*/
|
|
10
|
-
export declare function getEncryptionKey(): string;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OneLibrary Entity Types
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* User-created tag (MyTag)
|
|
6
|
-
*/
|
|
7
|
-
export interface MyTag {
|
|
8
|
-
id: number;
|
|
9
|
-
name: string;
|
|
10
|
-
isFolder: boolean;
|
|
11
|
-
parentId: number | null;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* History session
|
|
15
|
-
*/
|
|
16
|
-
export interface HistorySession {
|
|
17
|
-
id: number;
|
|
18
|
-
name: string;
|
|
19
|
-
parentId: number | null;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Hot cue bank list
|
|
23
|
-
*/
|
|
24
|
-
export interface HotCueBankList {
|
|
25
|
-
id: number;
|
|
26
|
-
name: string;
|
|
27
|
-
parentId: number | null;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Menu item for browsing
|
|
31
|
-
*/
|
|
32
|
-
export interface MenuItem {
|
|
33
|
-
id: number;
|
|
34
|
-
kind: number;
|
|
35
|
-
name: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Browse category
|
|
39
|
-
*/
|
|
40
|
-
export interface Category {
|
|
41
|
-
id: number;
|
|
42
|
-
menuItemId: number;
|
|
43
|
-
name: string;
|
|
44
|
-
kind: number;
|
|
45
|
-
isVisible: boolean;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Sort option
|
|
49
|
-
*/
|
|
50
|
-
export interface SortOption {
|
|
51
|
-
id: number;
|
|
52
|
-
menuItemId: number;
|
|
53
|
-
name: string;
|
|
54
|
-
kind: number;
|
|
55
|
-
isVisible: boolean;
|
|
56
|
-
isSelectedAsSubColumn: boolean;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Device property
|
|
60
|
-
*/
|
|
61
|
-
export interface DeviceProperty {
|
|
62
|
-
deviceName: string;
|
|
63
|
-
dbVersion: string;
|
|
64
|
-
numberOfContents: number;
|
|
65
|
-
createdDate: string;
|
|
66
|
-
backgroundColorType: number;
|
|
67
|
-
}
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript interfaces for the OneLibrary (exportLibrary.db) SQLite schema.
|
|
3
|
-
*
|
|
4
|
-
* These match the actual column names in the SQLite database,
|
|
5
|
-
* which differ from the legacy PDB format.
|
|
6
|
-
*
|
|
7
|
-
* Note: Column names use camelCase in the database (e.g., bpmx100, titleForSearch)
|
|
8
|
-
*/
|
|
9
|
-
export interface ContentRow {
|
|
10
|
-
content_id: number;
|
|
11
|
-
title: string | null;
|
|
12
|
-
titleForSearch: string | null;
|
|
13
|
-
subtitle: string | null;
|
|
14
|
-
bpmx100: number | null;
|
|
15
|
-
length: number | null;
|
|
16
|
-
trackNo: number | null;
|
|
17
|
-
discNo: number | null;
|
|
18
|
-
artist_id_artist: number | null;
|
|
19
|
-
artist_id_remixer: number | null;
|
|
20
|
-
artist_id_originalArtist: number | null;
|
|
21
|
-
artist_id_composer: number | null;
|
|
22
|
-
artist_id_lyricist: number | null;
|
|
23
|
-
album_id: number | null;
|
|
24
|
-
genre_id: number | null;
|
|
25
|
-
label_id: number | null;
|
|
26
|
-
key_id: number | null;
|
|
27
|
-
color_id: number | null;
|
|
28
|
-
image_id: number | null;
|
|
29
|
-
djComment: string | null;
|
|
30
|
-
rating: number | null;
|
|
31
|
-
releaseYear: number | null;
|
|
32
|
-
releaseDate: string | null;
|
|
33
|
-
dateCreated: string | null;
|
|
34
|
-
dateAdded: string | null;
|
|
35
|
-
path: string | null;
|
|
36
|
-
fileName: string | null;
|
|
37
|
-
fileSize: number | null;
|
|
38
|
-
fileType: number | null;
|
|
39
|
-
bitrate: number | null;
|
|
40
|
-
bitDepth: number | null;
|
|
41
|
-
samplingRate: number | null;
|
|
42
|
-
isrc: string | null;
|
|
43
|
-
djPlayCount: number | null;
|
|
44
|
-
isHotCueAutoLoadOn: number | null;
|
|
45
|
-
isKuvoDeliverStatusOn: number | null;
|
|
46
|
-
kuvoDeliveryComment: string | null;
|
|
47
|
-
masterDbId: number | null;
|
|
48
|
-
masterContentId: number | null;
|
|
49
|
-
analysisDataFilePath: string | null;
|
|
50
|
-
analysedBits: number | null;
|
|
51
|
-
contentLink: number | null;
|
|
52
|
-
hasModified: number | null;
|
|
53
|
-
cueUpdateCount: number | null;
|
|
54
|
-
analysisDataUpdateCount: number | null;
|
|
55
|
-
informationUpdateCount: number | null;
|
|
56
|
-
}
|
|
57
|
-
export interface ArtistRow {
|
|
58
|
-
artist_id: number;
|
|
59
|
-
name: string | null;
|
|
60
|
-
nameForSearch: string | null;
|
|
61
|
-
}
|
|
62
|
-
export interface AlbumRow {
|
|
63
|
-
album_id: number;
|
|
64
|
-
name: string | null;
|
|
65
|
-
artist_id: number | null;
|
|
66
|
-
image_id: number | null;
|
|
67
|
-
isComplation: number | null;
|
|
68
|
-
nameForSearch: string | null;
|
|
69
|
-
}
|
|
70
|
-
export interface GenreRow {
|
|
71
|
-
genre_id: number;
|
|
72
|
-
name: string | null;
|
|
73
|
-
}
|
|
74
|
-
export interface KeyRow {
|
|
75
|
-
key_id: number;
|
|
76
|
-
name: string | null;
|
|
77
|
-
}
|
|
78
|
-
export interface ColorRow {
|
|
79
|
-
color_id: number;
|
|
80
|
-
name: string | null;
|
|
81
|
-
}
|
|
82
|
-
export interface LabelRow {
|
|
83
|
-
label_id: number;
|
|
84
|
-
name: string | null;
|
|
85
|
-
}
|
|
86
|
-
export interface ImageRow {
|
|
87
|
-
image_id: number;
|
|
88
|
-
path: string | null;
|
|
89
|
-
}
|
|
90
|
-
export interface CueRow {
|
|
91
|
-
cue_id: number;
|
|
92
|
-
content_id: number | null;
|
|
93
|
-
kind: number | null;
|
|
94
|
-
colorTableIndex: number | null;
|
|
95
|
-
cueComment: string | null;
|
|
96
|
-
isActiveLoop: number | null;
|
|
97
|
-
beatLoopNumerator: number | null;
|
|
98
|
-
beatLoopDenominator: number | null;
|
|
99
|
-
inUsec: number | null;
|
|
100
|
-
outUsec: number | null;
|
|
101
|
-
in150FramePerSec: number | null;
|
|
102
|
-
out150FramePerSec: number | null;
|
|
103
|
-
inMpegFrameNumber: number | null;
|
|
104
|
-
outMpegFrameNumber: number | null;
|
|
105
|
-
inMpegAbs: number | null;
|
|
106
|
-
outMpegAbs: number | null;
|
|
107
|
-
inDecodingStartFramePosition: number | null;
|
|
108
|
-
outDecodingStartFramePosition: number | null;
|
|
109
|
-
inFileOffsetInBlock: number | null;
|
|
110
|
-
OutFileOffsetInBlock: number | null;
|
|
111
|
-
inNumberOfSampleInBlock: number | null;
|
|
112
|
-
outNumberOfSampleInBlock: number | null;
|
|
113
|
-
}
|
|
114
|
-
export interface PlaylistRow {
|
|
115
|
-
playlist_id: number;
|
|
116
|
-
sequenceNo: number | null;
|
|
117
|
-
name: string | null;
|
|
118
|
-
image_id: number | null;
|
|
119
|
-
attribute: number | null;
|
|
120
|
-
playlist_id_parent: number | null;
|
|
121
|
-
}
|
|
122
|
-
export interface PlaylistContentRow {
|
|
123
|
-
playlist_id: number;
|
|
124
|
-
content_id: number;
|
|
125
|
-
sequenceNo: number;
|
|
126
|
-
}
|
|
127
|
-
export interface PropertyRow {
|
|
128
|
-
deviceName: string | null;
|
|
129
|
-
dbVersion: string | null;
|
|
130
|
-
numberOfContents: number | null;
|
|
131
|
-
createdDate: string | null;
|
|
132
|
-
backGroundColorType: number | null;
|
|
133
|
-
myTagMasterDBID: number | null;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Cue point types based on the 'kind' field in the cue table.
|
|
137
|
-
*
|
|
138
|
-
* Note: These values may vary. Verify with actual data.
|
|
139
|
-
*/
|
|
140
|
-
export declare const CueKind: {
|
|
141
|
-
readonly MEMORY_CUE: 0;
|
|
142
|
-
readonly HOT_CUE: 1;
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Playlist attribute types based on the 'attribute' field.
|
|
146
|
-
*/
|
|
147
|
-
export declare const PlaylistAttribute: {
|
|
148
|
-
readonly PLAYLIST: 0;
|
|
149
|
-
readonly FOLDER: 1;
|
|
150
|
-
};
|
|
151
|
-
export interface MyTagRow {
|
|
152
|
-
myTag_id: number;
|
|
153
|
-
sequenceNo: number | null;
|
|
154
|
-
name: string | null;
|
|
155
|
-
attribute: number | null;
|
|
156
|
-
myTag_id_parent: number | null;
|
|
157
|
-
}
|
|
158
|
-
export interface MyTagContentRow {
|
|
159
|
-
myTag_id: number;
|
|
160
|
-
content_id: number;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* MyTag attribute types based on the 'attribute' field.
|
|
164
|
-
*/
|
|
165
|
-
export declare const MyTagAttribute: {
|
|
166
|
-
readonly TAG: 0;
|
|
167
|
-
readonly FOLDER: 1;
|
|
168
|
-
};
|
|
169
|
-
export interface HistoryRow {
|
|
170
|
-
history_id: number;
|
|
171
|
-
sequenceNo: number | null;
|
|
172
|
-
name: string | null;
|
|
173
|
-
attribute: number | null;
|
|
174
|
-
history_id_parent: number | null;
|
|
175
|
-
}
|
|
176
|
-
export interface HistoryContentRow {
|
|
177
|
-
history_id: number;
|
|
178
|
-
content_id: number;
|
|
179
|
-
sequenceNo: number;
|
|
180
|
-
}
|
|
181
|
-
export interface HotCueBankListRow {
|
|
182
|
-
hotCueBankList_id: number;
|
|
183
|
-
sequenceNo: number | null;
|
|
184
|
-
name: string | null;
|
|
185
|
-
image_id: number | null;
|
|
186
|
-
attribute: number | null;
|
|
187
|
-
hotCueBankList_id_parent: number | null;
|
|
188
|
-
}
|
|
189
|
-
export interface HotCueBankListCueRow {
|
|
190
|
-
hotCueBankList_id: number;
|
|
191
|
-
cue_id: number;
|
|
192
|
-
sequenceNo: number;
|
|
193
|
-
}
|
|
194
|
-
export interface MenuItemRow {
|
|
195
|
-
menuItem_id: number;
|
|
196
|
-
kind: number | null;
|
|
197
|
-
name: string | null;
|
|
198
|
-
}
|
|
199
|
-
export interface CategoryRow {
|
|
200
|
-
category_id: number;
|
|
201
|
-
menuItem_id: number | null;
|
|
202
|
-
sequenceNo: number | null;
|
|
203
|
-
isVisible: number | null;
|
|
204
|
-
}
|
|
205
|
-
export interface SortRow {
|
|
206
|
-
sort_id: number;
|
|
207
|
-
menuItem_id: number | null;
|
|
208
|
-
sequenceNo: number | null;
|
|
209
|
-
isVisible: number | null;
|
|
210
|
-
isSelectedAsSubColumn: number | null;
|
|
211
|
-
}
|
|
212
|
-
export interface RecommendedLikeRow {
|
|
213
|
-
content_id_1: number;
|
|
214
|
-
content_id_2: number;
|
|
215
|
-
rating: number | null;
|
|
216
|
-
createdDate: number | null;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Menu item kinds for browsing categories.
|
|
220
|
-
* These match the 'kind' field in the menuItem table.
|
|
221
|
-
*/
|
|
222
|
-
export declare const MenuItemKind: {
|
|
223
|
-
readonly GENRE: 128;
|
|
224
|
-
readonly ARTIST: 129;
|
|
225
|
-
readonly ALBUM: 130;
|
|
226
|
-
readonly TRACK: 131;
|
|
227
|
-
readonly PLAYLIST: 132;
|
|
228
|
-
readonly BPM: 133;
|
|
229
|
-
readonly RATING: 134;
|
|
230
|
-
readonly YEAR: 135;
|
|
231
|
-
readonly REMIXER: 136;
|
|
232
|
-
readonly LABEL: 137;
|
|
233
|
-
readonly ORIGINAL_ARTIST: 138;
|
|
234
|
-
readonly KEY: 139;
|
|
235
|
-
readonly DATE_ADDED: 140;
|
|
236
|
-
readonly CUE: 141;
|
|
237
|
-
readonly COLOR: 142;
|
|
238
|
-
readonly FOLDER: 144;
|
|
239
|
-
readonly SEARCH: 145;
|
|
240
|
-
readonly TIME: 146;
|
|
241
|
-
readonly BITRATE: 147;
|
|
242
|
-
readonly FILE_NAME: 148;
|
|
243
|
-
readonly HISTORY: 149;
|
|
244
|
-
readonly COMMENTS: 150;
|
|
245
|
-
readonly DJ_PLAY_COUNT: 151;
|
|
246
|
-
readonly HOT_CUE_BANK: 152;
|
|
247
|
-
readonly DEFAULT: 161;
|
|
248
|
-
readonly ALPHABET: 162;
|
|
249
|
-
readonly MATCHING: 170;
|
|
250
|
-
};
|