offcourse 0.0.2 → 1.0.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/README.md +255 -20
- package/dist/cli/commands/config.d.ts +13 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +66 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/inspect.d.ts +11 -0
- package/dist/cli/commands/inspect.d.ts.map +1 -0
- package/dist/cli/commands/inspect.js +365 -0
- package/dist/cli/commands/inspect.js.map +1 -0
- package/dist/cli/commands/login.d.ts +12 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +55 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/status.d.ts +15 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +118 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +15 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +921 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/syncHighLevel.d.ts +23 -0
- package/dist/cli/commands/syncHighLevel.d.ts.map +1 -0
- package/dist/cli/commands/syncHighLevel.js +479 -0
- package/dist/cli/commands/syncHighLevel.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +106 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/configManager.d.ts +31 -0
- package/dist/config/configManager.d.ts.map +1 -0
- package/dist/config/configManager.js +68 -0
- package/dist/config/configManager.js.map +1 -0
- package/dist/config/paths.d.ts +21 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +33 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/schema.d.ts +60 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +50 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/downloader/hlsDownloader.d.ts +58 -0
- package/dist/downloader/hlsDownloader.d.ts.map +1 -0
- package/dist/downloader/hlsDownloader.js +263 -0
- package/dist/downloader/hlsDownloader.js.map +1 -0
- package/dist/downloader/hlsValidator.d.ts +35 -0
- package/dist/downloader/hlsValidator.d.ts.map +1 -0
- package/dist/downloader/hlsValidator.js +152 -0
- package/dist/downloader/hlsValidator.js.map +1 -0
- package/dist/downloader/index.d.ts +29 -0
- package/dist/downloader/index.d.ts.map +1 -0
- package/dist/downloader/index.js +55 -0
- package/dist/downloader/index.js.map +1 -0
- package/dist/downloader/loomDownloader.d.ts +56 -0
- package/dist/downloader/loomDownloader.d.ts.map +1 -0
- package/dist/downloader/loomDownloader.js +562 -0
- package/dist/downloader/loomDownloader.js.map +1 -0
- package/dist/downloader/queue.d.ts +56 -0
- package/dist/downloader/queue.d.ts.map +1 -0
- package/dist/downloader/queue.js +88 -0
- package/dist/downloader/queue.js.map +1 -0
- package/dist/downloader/vimeoDownloader.d.ts +52 -0
- package/dist/downloader/vimeoDownloader.d.ts.map +1 -0
- package/dist/downloader/vimeoDownloader.js +569 -0
- package/dist/downloader/vimeoDownloader.js.map +1 -0
- package/dist/scraper/extractor.d.ts +53 -0
- package/dist/scraper/extractor.d.ts.map +1 -0
- package/dist/scraper/extractor.js +627 -0
- package/dist/scraper/extractor.js.map +1 -0
- package/dist/scraper/highlevel/extractor.d.ts +89 -0
- package/dist/scraper/highlevel/extractor.d.ts.map +1 -0
- package/dist/scraper/highlevel/extractor.js +373 -0
- package/dist/scraper/highlevel/extractor.js.map +1 -0
- package/dist/scraper/highlevel/index.d.ts +3 -0
- package/dist/scraper/highlevel/index.d.ts.map +1 -0
- package/dist/scraper/highlevel/index.js +3 -0
- package/dist/scraper/highlevel/index.js.map +1 -0
- package/dist/scraper/highlevel/navigator.d.ts +86 -0
- package/dist/scraper/highlevel/navigator.d.ts.map +1 -0
- package/dist/scraper/highlevel/navigator.js +505 -0
- package/dist/scraper/highlevel/navigator.js.map +1 -0
- package/dist/scraper/highlevel/schemas.d.ts +188 -0
- package/dist/scraper/highlevel/schemas.d.ts.map +1 -0
- package/dist/scraper/highlevel/schemas.js +139 -0
- package/dist/scraper/highlevel/schemas.js.map +1 -0
- package/dist/scraper/navigator.d.ts +68 -0
- package/dist/scraper/navigator.d.ts.map +1 -0
- package/dist/scraper/navigator.js +257 -0
- package/dist/scraper/navigator.js.map +1 -0
- package/dist/scraper/schemas.d.ts +57 -0
- package/dist/scraper/schemas.d.ts.map +1 -0
- package/dist/scraper/schemas.js +135 -0
- package/dist/scraper/schemas.js.map +1 -0
- package/dist/scraper/videoInterceptor.d.ts +23 -0
- package/dist/scraper/videoInterceptor.d.ts.map +1 -0
- package/dist/scraper/videoInterceptor.js +330 -0
- package/dist/scraper/videoInterceptor.js.map +1 -0
- package/dist/shared/auth.d.ts +58 -0
- package/dist/shared/auth.d.ts.map +1 -0
- package/dist/shared/auth.js +197 -0
- package/dist/shared/auth.js.map +1 -0
- package/dist/shared/firebase.d.ts +60 -0
- package/dist/shared/firebase.d.ts.map +1 -0
- package/dist/shared/firebase.js +102 -0
- package/dist/shared/firebase.js.map +1 -0
- package/dist/shared/fs.d.ts +31 -0
- package/dist/shared/fs.d.ts.map +1 -0
- package/dist/shared/fs.js +77 -0
- package/dist/shared/fs.js.map +1 -0
- package/dist/shared/http.d.ts +15 -0
- package/dist/shared/http.d.ts.map +1 -0
- package/dist/shared/http.js +31 -0
- package/dist/shared/http.js.map +1 -0
- package/dist/shared/index.d.ts +7 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +7 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/slug.d.ts +11 -0
- package/dist/shared/slug.d.ts.map +1 -0
- package/dist/shared/slug.js +25 -0
- package/dist/shared/slug.js.map +1 -0
- package/dist/shared/url.d.ts +43 -0
- package/dist/shared/url.d.ts.map +1 -0
- package/dist/shared/url.js +54 -0
- package/dist/shared/url.js.map +1 -0
- package/dist/state/database.d.ts +246 -0
- package/dist/state/database.d.ts.map +1 -0
- package/dist/state/database.js +679 -0
- package/dist/state/database.js.map +1 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +2 -0
- package/dist/state/index.js.map +1 -0
- package/dist/storage/fileSystem.d.ts +56 -0
- package/dist/storage/fileSystem.d.ts.map +1 -0
- package/dist/storage/fileSystem.js +129 -0
- package/dist/storage/fileSystem.js.map +1 -0
- package/package.json +71 -11
- package/cli.js +0 -45
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic URL utilities for parsing and manipulation.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Extracts the query string from a URL (including the leading ?).
|
|
6
|
+
* Returns empty string if no query params exist.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* extractQueryParams("https://example.com/path?foo=bar&baz=1")
|
|
10
|
+
* // => "?foo=bar&baz=1"
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractQueryParams(url: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Gets the base URL (everything up to and including the last slash).
|
|
15
|
+
* Useful for resolving relative URLs.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* getBaseUrl("https://example.com/videos/playlist.m3u8")
|
|
19
|
+
* // => "https://example.com/videos/"
|
|
20
|
+
*/
|
|
21
|
+
export declare function getBaseUrl(url: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Resolves a potentially relative URI against a base URL.
|
|
24
|
+
* If the URI is already absolute (starts with http), returns it unchanged.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* resolveUrl("segment001.ts", "https://cdn.example.com/videos/")
|
|
28
|
+
* // => "https://cdn.example.com/videos/segment001.ts"
|
|
29
|
+
*
|
|
30
|
+
* resolveUrl("https://other.com/file.ts", "https://cdn.example.com/videos/")
|
|
31
|
+
* // => "https://other.com/file.ts"
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveUrl(uri: string, baseUrl: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Resolves a URI and appends query params for authentication.
|
|
36
|
+
* Useful for signed URLs where auth tokens need to be preserved.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* resolveUrlWithParams("segment.ts", "https://cdn.com/", "?token=abc")
|
|
40
|
+
* // => "https://cdn.com/segment.ts?token=abc"
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveUrlWithParams(uri: string, baseUrl: string, queryParams: string): string;
|
|
43
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/shared/url.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAI9F"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic URL utilities for parsing and manipulation.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Extracts the query string from a URL (including the leading ?).
|
|
6
|
+
* Returns empty string if no query params exist.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* extractQueryParams("https://example.com/path?foo=bar&baz=1")
|
|
10
|
+
* // => "?foo=bar&baz=1"
|
|
11
|
+
*/
|
|
12
|
+
export function extractQueryParams(url) {
|
|
13
|
+
const queryStart = url.indexOf("?");
|
|
14
|
+
return queryStart !== -1 ? url.substring(queryStart) : "";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Gets the base URL (everything up to and including the last slash).
|
|
18
|
+
* Useful for resolving relative URLs.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* getBaseUrl("https://example.com/videos/playlist.m3u8")
|
|
22
|
+
* // => "https://example.com/videos/"
|
|
23
|
+
*/
|
|
24
|
+
export function getBaseUrl(url) {
|
|
25
|
+
return url.substring(0, url.lastIndexOf("/") + 1);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolves a potentially relative URI against a base URL.
|
|
29
|
+
* If the URI is already absolute (starts with http), returns it unchanged.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* resolveUrl("segment001.ts", "https://cdn.example.com/videos/")
|
|
33
|
+
* // => "https://cdn.example.com/videos/segment001.ts"
|
|
34
|
+
*
|
|
35
|
+
* resolveUrl("https://other.com/file.ts", "https://cdn.example.com/videos/")
|
|
36
|
+
* // => "https://other.com/file.ts"
|
|
37
|
+
*/
|
|
38
|
+
export function resolveUrl(uri, baseUrl) {
|
|
39
|
+
return uri.startsWith("http") ? uri : baseUrl + uri;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolves a URI and appends query params for authentication.
|
|
43
|
+
* Useful for signed URLs where auth tokens need to be preserved.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* resolveUrlWithParams("segment.ts", "https://cdn.com/", "?token=abc")
|
|
47
|
+
* // => "https://cdn.com/segment.ts?token=abc"
|
|
48
|
+
*/
|
|
49
|
+
export function resolveUrlWithParams(uri, baseUrl, queryParams) {
|
|
50
|
+
const resolved = resolveUrl(uri, baseUrl);
|
|
51
|
+
// Don't add params if URL already has them
|
|
52
|
+
return resolved.includes("?") ? resolved : resolved + queryParams;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/shared/url.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,OAAe;IACrD,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW,EAAE,OAAe,EAAE,WAAmB;IACpF,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1C,2CAA2C;IAC3C,OAAO,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GAAG,WAAW,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lesson sync status.
|
|
3
|
+
*/
|
|
4
|
+
export declare const LessonStatus: {
|
|
5
|
+
readonly PENDING: "pending";
|
|
6
|
+
readonly SCANNED: "scanned";
|
|
7
|
+
readonly VALIDATED: "validated";
|
|
8
|
+
readonly DOWNLOADED: "downloaded";
|
|
9
|
+
readonly ERROR: "error";
|
|
10
|
+
readonly SKIPPED: "skipped";
|
|
11
|
+
};
|
|
12
|
+
export type LessonStatusType = (typeof LessonStatus)[keyof typeof LessonStatus];
|
|
13
|
+
/**
|
|
14
|
+
* Video types supported by the tool.
|
|
15
|
+
*/
|
|
16
|
+
export declare const VideoType: {
|
|
17
|
+
readonly LOOM: "loom";
|
|
18
|
+
readonly VIMEO: "vimeo";
|
|
19
|
+
readonly YOUTUBE: "youtube";
|
|
20
|
+
readonly WISTIA: "wistia";
|
|
21
|
+
readonly NATIVE: "native";
|
|
22
|
+
readonly UNKNOWN: "unknown";
|
|
23
|
+
};
|
|
24
|
+
export type VideoTypeValue = (typeof VideoType)[keyof typeof VideoType];
|
|
25
|
+
/**
|
|
26
|
+
* Module record from database.
|
|
27
|
+
*/
|
|
28
|
+
export interface ModuleRecord {
|
|
29
|
+
id: number;
|
|
30
|
+
slug: string;
|
|
31
|
+
name: string;
|
|
32
|
+
position: number;
|
|
33
|
+
isLocked: boolean;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Lesson record from database.
|
|
39
|
+
*/
|
|
40
|
+
export interface LessonRecord {
|
|
41
|
+
id: number;
|
|
42
|
+
moduleId: number;
|
|
43
|
+
slug: string;
|
|
44
|
+
name: string;
|
|
45
|
+
url: string;
|
|
46
|
+
position: number;
|
|
47
|
+
isLocked: boolean;
|
|
48
|
+
status: LessonStatusType;
|
|
49
|
+
videoType: VideoTypeValue | null;
|
|
50
|
+
videoUrl: string | null;
|
|
51
|
+
hlsUrl: string | null;
|
|
52
|
+
errorMessage: string | null;
|
|
53
|
+
errorCode: string | null;
|
|
54
|
+
retryCount: number;
|
|
55
|
+
lastScannedAt: string | null;
|
|
56
|
+
lastDownloadedAt: string | null;
|
|
57
|
+
videoFileSize: number | null;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Lesson with module info for display.
|
|
63
|
+
*/
|
|
64
|
+
export interface LessonWithModule extends LessonRecord {
|
|
65
|
+
moduleName: string;
|
|
66
|
+
moduleSlug: string;
|
|
67
|
+
modulePosition: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Course metadata stored in the database.
|
|
71
|
+
*/
|
|
72
|
+
export interface CourseMetadata {
|
|
73
|
+
name: string;
|
|
74
|
+
url: string;
|
|
75
|
+
lastSyncAt: string | null;
|
|
76
|
+
totalModules: number;
|
|
77
|
+
totalLessons: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the database directory path.
|
|
81
|
+
*/
|
|
82
|
+
export declare function getDbDir(): string;
|
|
83
|
+
/**
|
|
84
|
+
* Get the database file path for a course.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getDbPath(communitySlug: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Extract community slug from a Skool URL.
|
|
89
|
+
*/
|
|
90
|
+
export declare function extractCommunitySlug(url: string): string;
|
|
91
|
+
/**
|
|
92
|
+
* Database manager for course state persistence.
|
|
93
|
+
* SQLite operations - not unit testable without mocking.
|
|
94
|
+
*/
|
|
95
|
+
export declare class CourseDatabase {
|
|
96
|
+
private db;
|
|
97
|
+
constructor(communitySlug: string);
|
|
98
|
+
/**
|
|
99
|
+
* Initialize database schema.
|
|
100
|
+
*/
|
|
101
|
+
private initSchema;
|
|
102
|
+
/**
|
|
103
|
+
* Run database migrations for schema updates.
|
|
104
|
+
*/
|
|
105
|
+
private runMigrations;
|
|
106
|
+
/**
|
|
107
|
+
* Close the database connection.
|
|
108
|
+
*/
|
|
109
|
+
close(): void;
|
|
110
|
+
/**
|
|
111
|
+
* Set a metadata value.
|
|
112
|
+
*/
|
|
113
|
+
setMetadata(key: string, value: string): void;
|
|
114
|
+
/**
|
|
115
|
+
* Get a metadata value.
|
|
116
|
+
*/
|
|
117
|
+
getMetadata(key: string): string | null;
|
|
118
|
+
/**
|
|
119
|
+
* Get all course metadata.
|
|
120
|
+
*/
|
|
121
|
+
getCourseMetadata(): CourseMetadata;
|
|
122
|
+
/**
|
|
123
|
+
* Update course metadata after sync.
|
|
124
|
+
*/
|
|
125
|
+
updateCourseMetadata(name: string, url: string): void;
|
|
126
|
+
/**
|
|
127
|
+
* Upsert a module (insert or update).
|
|
128
|
+
*/
|
|
129
|
+
upsertModule(slug: string, name: string, position: number, isLocked?: boolean): ModuleRecord;
|
|
130
|
+
/**
|
|
131
|
+
* Get all modules.
|
|
132
|
+
*/
|
|
133
|
+
getModules(): ModuleRecord[];
|
|
134
|
+
/**
|
|
135
|
+
* Get module count.
|
|
136
|
+
*/
|
|
137
|
+
getModuleCount(): number;
|
|
138
|
+
/**
|
|
139
|
+
* Get module by slug.
|
|
140
|
+
*/
|
|
141
|
+
getModuleBySlug(slug: string): ModuleRecord | null;
|
|
142
|
+
private mapModuleRow;
|
|
143
|
+
/**
|
|
144
|
+
* Upsert a lesson (insert or update).
|
|
145
|
+
*/
|
|
146
|
+
upsertLesson(moduleId: number, slug: string, name: string, url: string, position: number, isLocked?: boolean): LessonRecord;
|
|
147
|
+
/**
|
|
148
|
+
* Update lesson scan results.
|
|
149
|
+
*/
|
|
150
|
+
updateLessonScan(lessonId: number, videoType: VideoTypeValue | null, videoUrl: string | null, hlsUrl: string | null, status: LessonStatusType, errorMessage?: string, errorCode?: string): void;
|
|
151
|
+
/**
|
|
152
|
+
* Mark lesson as downloaded.
|
|
153
|
+
*/
|
|
154
|
+
markLessonDownloaded(lessonId: number, fileSize?: number): void;
|
|
155
|
+
/**
|
|
156
|
+
* Mark lesson as error.
|
|
157
|
+
*/
|
|
158
|
+
markLessonError(lessonId: number, errorMessage: string, errorCode?: string): void;
|
|
159
|
+
/**
|
|
160
|
+
* Mark lesson as skipped (no video).
|
|
161
|
+
*/
|
|
162
|
+
markLessonSkipped(lessonId: number, reason?: string): void;
|
|
163
|
+
/**
|
|
164
|
+
* Update lesson video type.
|
|
165
|
+
*/
|
|
166
|
+
updateLessonVideoType(lessonId: number, videoType: string): void;
|
|
167
|
+
/**
|
|
168
|
+
* Increment retry count for a lesson.
|
|
169
|
+
*/
|
|
170
|
+
incrementRetryCount(lessonId: number): number;
|
|
171
|
+
/**
|
|
172
|
+
* Reset retry count for a lesson.
|
|
173
|
+
*/
|
|
174
|
+
resetRetryCount(lessonId: number): void;
|
|
175
|
+
/**
|
|
176
|
+
* Get lessons that failed but can still be retried (retry_count < maxRetries).
|
|
177
|
+
* Only returns retryable errors (not UNSUPPORTED_PROVIDER).
|
|
178
|
+
*/
|
|
179
|
+
getLessonsToRetry(maxRetries?: number): LessonWithModule[];
|
|
180
|
+
/**
|
|
181
|
+
* Mark a lesson for retry by setting it back to pending/validated status.
|
|
182
|
+
*/
|
|
183
|
+
queueForRetry(lessonId: number, targetStatus?: LessonStatusType): void;
|
|
184
|
+
/**
|
|
185
|
+
* Get all lessons.
|
|
186
|
+
*/
|
|
187
|
+
getLessons(): LessonRecord[];
|
|
188
|
+
/**
|
|
189
|
+
* Get lessons with module info.
|
|
190
|
+
*/
|
|
191
|
+
getLessonsWithModules(): LessonWithModule[];
|
|
192
|
+
/**
|
|
193
|
+
* Get lessons by status.
|
|
194
|
+
*/
|
|
195
|
+
getLessonsByStatus(status: LessonStatusType): LessonWithModule[];
|
|
196
|
+
/**
|
|
197
|
+
* Get lessons that need scanning (pending or never scanned).
|
|
198
|
+
*/
|
|
199
|
+
getLessonsToScan(): LessonWithModule[];
|
|
200
|
+
/**
|
|
201
|
+
* Get lessons that need validation (scanned but not validated, with video).
|
|
202
|
+
*/
|
|
203
|
+
getLessonsToValidate(): LessonWithModule[];
|
|
204
|
+
/**
|
|
205
|
+
* Get lessons that are ready for download (validated with HLS URL).
|
|
206
|
+
*/
|
|
207
|
+
getLessonsToDownload(): LessonWithModule[];
|
|
208
|
+
/**
|
|
209
|
+
* Get lesson count.
|
|
210
|
+
*/
|
|
211
|
+
getLessonCount(): number;
|
|
212
|
+
/**
|
|
213
|
+
* Get lesson by URL.
|
|
214
|
+
*/
|
|
215
|
+
getLessonByUrl(url: string): LessonRecord | null;
|
|
216
|
+
/**
|
|
217
|
+
* Get status summary.
|
|
218
|
+
*/
|
|
219
|
+
getStatusSummary(): Record<LessonStatusType, number> & {
|
|
220
|
+
locked: number;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Reset all error lessons to pending for retry.
|
|
224
|
+
*/
|
|
225
|
+
resetErrorLessons(): number;
|
|
226
|
+
/**
|
|
227
|
+
* Reset ALL lessons to pending (for --force full rescan).
|
|
228
|
+
* Preserves locked status.
|
|
229
|
+
*/
|
|
230
|
+
resetAllLessonsToPending(): number;
|
|
231
|
+
/**
|
|
232
|
+
* Reset error lessons to validated (for --resume --retry-errors).
|
|
233
|
+
* Only resets lessons that already have an HLS URL.
|
|
234
|
+
*/
|
|
235
|
+
resetErrorLessonsForResume(): number;
|
|
236
|
+
/**
|
|
237
|
+
* Get lessons by error code.
|
|
238
|
+
*/
|
|
239
|
+
getLessonsByErrorCode(errorCode: string): LessonWithModule[];
|
|
240
|
+
/**
|
|
241
|
+
* Get count of lessons grouped by video type.
|
|
242
|
+
*/
|
|
243
|
+
getVideoTypeSummary(): Record<string, number>;
|
|
244
|
+
private mapLessonRow;
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/state/database.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC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