vidnavigator 0.1.6 → 1.0.0
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 +375 -77
- package/dist/errors.d.ts +19 -0
- package/dist/errors.js +35 -1
- package/dist/index.d.ts +110 -20
- package/dist/index.js +150 -31
- package/dist/models/Carousel.d.ts +30 -0
- package/dist/models/Carousel.js +21 -0
- package/dist/models/CarouselVideoResult.d.ts +28 -0
- package/dist/models/CarouselVideoResult.js +21 -0
- package/dist/models/Extraction.d.ts +27 -0
- package/dist/models/Extraction.js +14 -0
- package/dist/models/FileInfo.d.ts +5 -0
- package/dist/models/FileInfo.js +3 -0
- package/dist/models/Namespace.d.ts +29 -0
- package/dist/models/Namespace.js +37 -0
- package/dist/models/SearchResult.d.ts +29 -0
- package/dist/models/SearchResult.js +12 -0
- package/dist/models/TranscriptSegment.d.ts +7 -0
- package/dist/models/TranscriptSegment.js +11 -0
- package/dist/models/Usage.d.ts +43 -18
- package/dist/models/Usage.js +33 -11
- package/dist/models/VideoInfo.d.ts +6 -1
- package/dist/models/VideoInfo.js +9 -1
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/package.json +1 -1
- package/src/errors.ts +43 -0
- package/src/index.ts +450 -114
- package/src/models/Carousel.ts +45 -0
- package/src/models/CarouselVideoResult.ts +44 -0
- package/src/models/Extraction.ts +47 -0
- package/src/models/FileInfo.ts +8 -0
- package/src/models/Namespace.ts +60 -0
- package/src/models/SearchResult.ts +45 -1
- package/src/models/TranscriptSegment.ts +16 -0
- package/src/models/Usage.ts +180 -134
- package/src/models/VideoInfo.ts +15 -2
- package/src/models/index.ts +4 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface NamespaceRefJSON {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class NamespaceRef {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
constructor(data: NamespaceRefJSON);
|
|
9
|
+
static fromJSON(json: NamespaceRefJSON): NamespaceRef;
|
|
10
|
+
}
|
|
11
|
+
export interface NamespaceJSON {
|
|
12
|
+
id?: string;
|
|
13
|
+
_id?: string;
|
|
14
|
+
user_id?: string;
|
|
15
|
+
name: string;
|
|
16
|
+
created_at?: string;
|
|
17
|
+
updated_at?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class Namespace {
|
|
20
|
+
id?: string;
|
|
21
|
+
_id?: string;
|
|
22
|
+
user_id?: string;
|
|
23
|
+
name: string;
|
|
24
|
+
created_at?: string;
|
|
25
|
+
updated_at?: string;
|
|
26
|
+
constructor(data: NamespaceJSON);
|
|
27
|
+
static fromJSON(json: NamespaceJSON): Namespace;
|
|
28
|
+
toJSON(): NamespaceJSON;
|
|
29
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Namespace = exports.NamespaceRef = void 0;
|
|
4
|
+
class NamespaceRef {
|
|
5
|
+
constructor(data) {
|
|
6
|
+
this.id = data.id;
|
|
7
|
+
this.name = data.name;
|
|
8
|
+
}
|
|
9
|
+
static fromJSON(json) {
|
|
10
|
+
return new NamespaceRef(json);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.NamespaceRef = NamespaceRef;
|
|
14
|
+
class Namespace {
|
|
15
|
+
constructor(data) {
|
|
16
|
+
this.id = data.id;
|
|
17
|
+
this._id = data._id;
|
|
18
|
+
this.user_id = data.user_id;
|
|
19
|
+
this.name = data.name;
|
|
20
|
+
this.created_at = data.created_at;
|
|
21
|
+
this.updated_at = data.updated_at;
|
|
22
|
+
}
|
|
23
|
+
static fromJSON(json) {
|
|
24
|
+
return new Namespace(json);
|
|
25
|
+
}
|
|
26
|
+
toJSON() {
|
|
27
|
+
return {
|
|
28
|
+
id: this.id,
|
|
29
|
+
_id: this._id,
|
|
30
|
+
user_id: this.user_id,
|
|
31
|
+
name: this.name,
|
|
32
|
+
created_at: this.created_at,
|
|
33
|
+
updated_at: this.updated_at,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.Namespace = Namespace;
|
|
@@ -1,13 +1,30 @@
|
|
|
1
|
+
import { NamedEntity } from './AnalysisResult';
|
|
1
2
|
import { FileInfo, FileInfoJSON } from './FileInfo';
|
|
2
3
|
import { VideoInfo, VideoInfoJSON } from './VideoInfo';
|
|
4
|
+
export interface SearchKeySubject {
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
3
8
|
export interface BaseSearchResult {
|
|
4
9
|
relevance_score?: number;
|
|
5
10
|
transcript_summary?: string;
|
|
6
11
|
}
|
|
7
12
|
export interface VideoSearchResultJSON extends VideoInfoJSON, BaseSearchResult {
|
|
13
|
+
people?: NamedEntity[];
|
|
14
|
+
places?: NamedEntity[];
|
|
15
|
+
key_subjects?: SearchKeySubject[];
|
|
16
|
+
timestamp?: number;
|
|
17
|
+
relevant_text?: string;
|
|
18
|
+
query_relevance?: string;
|
|
8
19
|
}
|
|
9
20
|
export interface FileSearchResultJSON extends FileInfoJSON, BaseSearchResult {
|
|
10
21
|
file_url?: string;
|
|
22
|
+
people?: NamedEntity[];
|
|
23
|
+
places?: NamedEntity[];
|
|
24
|
+
key_subjects?: SearchKeySubject[];
|
|
25
|
+
timestamps?: number[];
|
|
26
|
+
relevant_text?: string;
|
|
27
|
+
query_answer?: string;
|
|
11
28
|
}
|
|
12
29
|
/**
|
|
13
30
|
* Represents a single video result from a search query.
|
|
@@ -15,6 +32,12 @@ export interface FileSearchResultJSON extends FileInfoJSON, BaseSearchResult {
|
|
|
15
32
|
export declare class VideoSearchResult extends VideoInfo implements BaseSearchResult {
|
|
16
33
|
relevance_score?: number;
|
|
17
34
|
transcript_summary?: string;
|
|
35
|
+
people?: NamedEntity[];
|
|
36
|
+
places?: NamedEntity[];
|
|
37
|
+
key_subjects?: SearchKeySubject[];
|
|
38
|
+
timestamp?: number;
|
|
39
|
+
relevant_text?: string;
|
|
40
|
+
query_relevance?: string;
|
|
18
41
|
constructor(data: Partial<VideoSearchResultJSON>);
|
|
19
42
|
static fromJSON(json: VideoSearchResultJSON): VideoSearchResult;
|
|
20
43
|
}
|
|
@@ -25,6 +48,12 @@ export declare class FileSearchResult extends FileInfo implements BaseSearchResu
|
|
|
25
48
|
relevance_score?: number;
|
|
26
49
|
transcript_summary?: string;
|
|
27
50
|
file_url?: string;
|
|
51
|
+
people?: NamedEntity[];
|
|
52
|
+
places?: NamedEntity[];
|
|
53
|
+
key_subjects?: SearchKeySubject[];
|
|
54
|
+
timestamps?: number[];
|
|
55
|
+
relevant_text?: string;
|
|
56
|
+
query_answer?: string;
|
|
28
57
|
constructor(data: FileSearchResultJSON);
|
|
29
58
|
static fromJSON(json: FileSearchResultJSON): FileSearchResult;
|
|
30
59
|
}
|
|
@@ -11,6 +11,12 @@ class VideoSearchResult extends VideoInfo_1.VideoInfo {
|
|
|
11
11
|
super(data);
|
|
12
12
|
this.relevance_score = data.relevance_score;
|
|
13
13
|
this.transcript_summary = data.transcript_summary;
|
|
14
|
+
this.people = data.people;
|
|
15
|
+
this.places = data.places;
|
|
16
|
+
this.key_subjects = data.key_subjects;
|
|
17
|
+
this.timestamp = data.timestamp;
|
|
18
|
+
this.relevant_text = data.relevant_text;
|
|
19
|
+
this.query_relevance = data.query_relevance;
|
|
14
20
|
}
|
|
15
21
|
static fromJSON(json) {
|
|
16
22
|
return new VideoSearchResult(json);
|
|
@@ -26,6 +32,12 @@ class FileSearchResult extends FileInfo_1.FileInfo {
|
|
|
26
32
|
this.relevance_score = data.relevance_score;
|
|
27
33
|
this.transcript_summary = data.transcript_summary;
|
|
28
34
|
this.file_url = data.file_url;
|
|
35
|
+
this.people = data.people;
|
|
36
|
+
this.places = data.places;
|
|
37
|
+
this.key_subjects = data.key_subjects;
|
|
38
|
+
this.timestamps = data.timestamps;
|
|
39
|
+
this.relevant_text = data.relevant_text;
|
|
40
|
+
this.query_answer = data.query_answer;
|
|
29
41
|
}
|
|
30
42
|
static fromJSON(json) {
|
|
31
43
|
return new FileSearchResult(json);
|
|
@@ -3,6 +3,13 @@ export interface TranscriptSegmentJSON {
|
|
|
3
3
|
start: number;
|
|
4
4
|
end: number;
|
|
5
5
|
}
|
|
6
|
+
/** Transcript from API: segment array (default) or plain string when transcript_text=true */
|
|
7
|
+
export type TranscriptOutput = TranscriptSegment[] | string;
|
|
8
|
+
export type TranscriptOutputJSON = TranscriptSegmentJSON[] | string;
|
|
9
|
+
/**
|
|
10
|
+
* Parse API transcript field (segments or plain text).
|
|
11
|
+
*/
|
|
12
|
+
export declare function transcriptFromJSON(raw: TranscriptOutputJSON | undefined): TranscriptOutput | undefined;
|
|
6
13
|
/**
|
|
7
14
|
* Represents a single segment of a video or audio transcript.
|
|
8
15
|
*/
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TranscriptSegment = void 0;
|
|
4
|
+
exports.transcriptFromJSON = transcriptFromJSON;
|
|
5
|
+
/**
|
|
6
|
+
* Parse API transcript field (segments or plain text).
|
|
7
|
+
*/
|
|
8
|
+
function transcriptFromJSON(raw) {
|
|
9
|
+
if (raw === undefined)
|
|
10
|
+
return undefined;
|
|
11
|
+
if (typeof raw === 'string')
|
|
12
|
+
return raw;
|
|
13
|
+
return raw.map((s) => TranscriptSegment.fromJSON(s));
|
|
14
|
+
}
|
|
4
15
|
/**
|
|
5
16
|
* Represents a single segment of a video or audio transcript.
|
|
6
17
|
*/
|
package/dist/models/Usage.d.ts
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type UnlimitedOrNumber = number | 'unlimited';
|
|
2
|
+
export interface CreditsInfoJSON {
|
|
3
|
+
monthly_total: UnlimitedOrNumber;
|
|
4
|
+
monthly_remaining: UnlimitedOrNumber;
|
|
5
|
+
purchased: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class CreditsInfo {
|
|
8
|
+
monthly_total: UnlimitedOrNumber;
|
|
9
|
+
monthly_remaining: UnlimitedOrNumber;
|
|
10
|
+
purchased: number;
|
|
11
|
+
constructor(data: CreditsInfoJSON);
|
|
12
|
+
static fromJSON(data: CreditsInfoJSON): CreditsInfo;
|
|
13
|
+
}
|
|
14
|
+
export interface ActivityCountJSON {
|
|
15
|
+
used: number;
|
|
16
|
+
unit?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class ActivityCount {
|
|
19
|
+
used: number;
|
|
20
|
+
unit?: string;
|
|
21
|
+
constructor(data: ActivityCountJSON);
|
|
22
|
+
static fromJSON(data: ActivityCountJSON): ActivityCount;
|
|
23
|
+
}
|
|
24
|
+
export interface CapacityMetricJSON {
|
|
2
25
|
used: number;
|
|
3
26
|
limit: number | 'unlimited';
|
|
4
27
|
remaining: number | 'unlimited';
|
|
5
28
|
percentage: number;
|
|
6
|
-
unit?: string;
|
|
7
29
|
}
|
|
8
|
-
export declare class
|
|
30
|
+
export declare class CapacityMetric {
|
|
9
31
|
used: number;
|
|
10
32
|
limit: number | 'unlimited';
|
|
11
33
|
remaining: number | 'unlimited';
|
|
12
34
|
percentage: number;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
static fromJSON(data: ServiceUsageJSON): ServiceUsage;
|
|
35
|
+
constructor(data: CapacityMetricJSON);
|
|
36
|
+
static fromJSON(data: CapacityMetricJSON): CapacityMetric;
|
|
16
37
|
}
|
|
17
38
|
export interface StorageUsageJSON {
|
|
18
39
|
used_bytes: number;
|
|
@@ -52,14 +73,16 @@ export interface UsageDataJSON {
|
|
|
52
73
|
status: string;
|
|
53
74
|
cancel_at_period_end: boolean;
|
|
54
75
|
};
|
|
76
|
+
credits: CreditsInfoJSON;
|
|
55
77
|
usage: {
|
|
56
|
-
video_transcripts:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
video_uploads:
|
|
78
|
+
video_transcripts: ActivityCountJSON;
|
|
79
|
+
youtube_transcripts: ActivityCountJSON;
|
|
80
|
+
video_searches: ActivityCountJSON;
|
|
81
|
+
video_analyses: ActivityCountJSON;
|
|
82
|
+
video_scene_analyses: ActivityCountJSON;
|
|
83
|
+
video_uploads: ActivityCountJSON;
|
|
62
84
|
};
|
|
85
|
+
channels_indexed: CapacityMetricJSON;
|
|
63
86
|
storage: StorageUsageJSON;
|
|
64
87
|
generated_at: string;
|
|
65
88
|
}
|
|
@@ -80,14 +103,16 @@ export declare class UsageData {
|
|
|
80
103
|
status: string;
|
|
81
104
|
cancelAtPeriodEnd: boolean;
|
|
82
105
|
};
|
|
106
|
+
credits: CreditsInfo;
|
|
83
107
|
usage: {
|
|
84
|
-
videoTranscripts:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
videoUploads:
|
|
108
|
+
videoTranscripts: ActivityCount;
|
|
109
|
+
youtubeTranscripts: ActivityCount;
|
|
110
|
+
videoSearches: ActivityCount;
|
|
111
|
+
videoAnalyses: ActivityCount;
|
|
112
|
+
videoSceneAnalyses: ActivityCount;
|
|
113
|
+
videoUploads: ActivityCount;
|
|
90
114
|
};
|
|
115
|
+
channelsIndexed: CapacityMetric;
|
|
91
116
|
storage: StorageUsage;
|
|
92
117
|
generatedAt: Date;
|
|
93
118
|
constructor(data: UsageDataJSON);
|
package/dist/models/Usage.js
CHANGED
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UsageData = exports.StorageUsage = exports.
|
|
4
|
-
class
|
|
3
|
+
exports.UsageData = exports.StorageUsage = exports.CapacityMetric = exports.ActivityCount = exports.CreditsInfo = void 0;
|
|
4
|
+
class CreditsInfo {
|
|
5
|
+
constructor(data) {
|
|
6
|
+
this.monthly_total = data.monthly_total;
|
|
7
|
+
this.monthly_remaining = data.monthly_remaining;
|
|
8
|
+
this.purchased = data.purchased;
|
|
9
|
+
}
|
|
10
|
+
static fromJSON(data) {
|
|
11
|
+
return new CreditsInfo(data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.CreditsInfo = CreditsInfo;
|
|
15
|
+
class ActivityCount {
|
|
16
|
+
constructor(data) {
|
|
17
|
+
this.used = data.used;
|
|
18
|
+
this.unit = data.unit;
|
|
19
|
+
}
|
|
20
|
+
static fromJSON(data) {
|
|
21
|
+
return new ActivityCount(data);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ActivityCount = ActivityCount;
|
|
25
|
+
class CapacityMetric {
|
|
5
26
|
constructor(data) {
|
|
6
27
|
this.used = data.used;
|
|
7
28
|
this.limit = data.limit;
|
|
8
29
|
this.remaining = data.remaining;
|
|
9
30
|
this.percentage = data.percentage;
|
|
10
|
-
this.unit = data.unit;
|
|
11
31
|
}
|
|
12
32
|
static fromJSON(data) {
|
|
13
|
-
return new
|
|
33
|
+
return new CapacityMetric(data);
|
|
14
34
|
}
|
|
15
35
|
}
|
|
16
|
-
exports.
|
|
36
|
+
exports.CapacityMetric = CapacityMetric;
|
|
17
37
|
class StorageUsage {
|
|
18
38
|
constructor(data) {
|
|
19
39
|
this.usedBytes = data.used_bytes;
|
|
@@ -47,14 +67,16 @@ class UsageData {
|
|
|
47
67
|
status: data.subscription.status,
|
|
48
68
|
cancelAtPeriodEnd: data.subscription.cancel_at_period_end,
|
|
49
69
|
};
|
|
70
|
+
this.credits = CreditsInfo.fromJSON(data.credits);
|
|
50
71
|
this.usage = {
|
|
51
|
-
videoTranscripts:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
videoUploads:
|
|
72
|
+
videoTranscripts: ActivityCount.fromJSON(data.usage.video_transcripts),
|
|
73
|
+
youtubeTranscripts: ActivityCount.fromJSON(data.usage.youtube_transcripts),
|
|
74
|
+
videoSearches: ActivityCount.fromJSON(data.usage.video_searches),
|
|
75
|
+
videoAnalyses: ActivityCount.fromJSON(data.usage.video_analyses),
|
|
76
|
+
videoSceneAnalyses: ActivityCount.fromJSON(data.usage.video_scene_analyses),
|
|
77
|
+
videoUploads: ActivityCount.fromJSON(data.usage.video_uploads),
|
|
57
78
|
};
|
|
79
|
+
this.channelsIndexed = CapacityMetric.fromJSON(data.channels_indexed);
|
|
58
80
|
this.storage = StorageUsage.fromJSON(data.storage);
|
|
59
81
|
this.generatedAt = new Date(data.generated_at);
|
|
60
82
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VideoCarouselInfo, VideoCarouselInfoJSON } from './Carousel';
|
|
1
2
|
export interface VideoInfoJSON {
|
|
2
3
|
title?: string;
|
|
3
4
|
description?: string;
|
|
@@ -13,6 +14,7 @@ export interface VideoInfoJSON {
|
|
|
13
14
|
category?: string;
|
|
14
15
|
available_languages?: string[];
|
|
15
16
|
selected_language?: string;
|
|
17
|
+
carousel_info?: VideoCarouselInfoJSON;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Represents detailed information about a video, typically from an online source like YouTube.
|
|
@@ -32,7 +34,10 @@ export declare class VideoInfo {
|
|
|
32
34
|
category?: string;
|
|
33
35
|
available_languages?: string[];
|
|
34
36
|
selected_language?: string;
|
|
35
|
-
|
|
37
|
+
carousel_info?: VideoCarouselInfo;
|
|
38
|
+
constructor(data: Partial<VideoInfoJSON> & {
|
|
39
|
+
carousel_info?: VideoCarouselInfo | VideoCarouselInfoJSON;
|
|
40
|
+
});
|
|
36
41
|
/**
|
|
37
42
|
* Creates a VideoInfo instance from a JSON object.
|
|
38
43
|
* @param json - The raw JSON object from the API.
|
package/dist/models/VideoInfo.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VideoInfo = void 0;
|
|
4
|
+
const Carousel_1 = require("./Carousel");
|
|
4
5
|
/**
|
|
5
6
|
* Represents detailed information about a video, typically from an online source like YouTube.
|
|
6
7
|
*/
|
|
7
8
|
class VideoInfo {
|
|
8
9
|
constructor(data) {
|
|
9
|
-
|
|
10
|
+
const { carousel_info, ...rest } = data;
|
|
11
|
+
Object.assign(this, rest);
|
|
12
|
+
if (carousel_info !== undefined) {
|
|
13
|
+
this.carousel_info =
|
|
14
|
+
carousel_info instanceof Carousel_1.VideoCarouselInfo
|
|
15
|
+
? carousel_info
|
|
16
|
+
: Carousel_1.VideoCarouselInfo.fromJSON(carousel_info);
|
|
17
|
+
}
|
|
10
18
|
}
|
|
11
19
|
/**
|
|
12
20
|
* Creates a VideoInfo instance from a JSON object.
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from './AnalysisResult';
|
|
2
|
+
export * from './Carousel';
|
|
3
|
+
export * from './CarouselVideoResult';
|
|
4
|
+
export * from './Extraction';
|
|
2
5
|
export * from './FileInfo';
|
|
6
|
+
export * from './Namespace';
|
|
3
7
|
export * from './SearchResult';
|
|
4
8
|
export * from './TranscriptSegment';
|
|
5
9
|
export * from './VideoInfo';
|
package/dist/models/index.js
CHANGED
|
@@ -15,7 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./AnalysisResult"), exports);
|
|
18
|
+
__exportStar(require("./Carousel"), exports);
|
|
19
|
+
__exportStar(require("./CarouselVideoResult"), exports);
|
|
20
|
+
__exportStar(require("./Extraction"), exports);
|
|
18
21
|
__exportStar(require("./FileInfo"), exports);
|
|
22
|
+
__exportStar(require("./Namespace"), exports);
|
|
19
23
|
__exportStar(require("./SearchResult"), exports);
|
|
20
24
|
__exportStar(require("./TranscriptSegment"), exports);
|
|
21
25
|
__exportStar(require("./VideoInfo"), exports);
|
package/package.json
CHANGED
package/src/errors.ts
CHANGED
|
@@ -104,4 +104,47 @@ export class ServerError extends VidNavigatorError {
|
|
|
104
104
|
this.name = 'ServerError';
|
|
105
105
|
Object.setPrototypeOf(this, ServerError.prototype);
|
|
106
106
|
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Raised when storage quota is exceeded (HTTP 413).
|
|
111
|
+
*/
|
|
112
|
+
export class StorageQuotaExceededError extends VidNavigatorError {
|
|
113
|
+
constructor(message: string, status_code?: number, error_code?: string, error_message?: string, details?: any) {
|
|
114
|
+
super(message, status_code, error_code, error_message, details);
|
|
115
|
+
this.name = 'StorageQuotaExceededError';
|
|
116
|
+
Object.setPrototypeOf(this, StorageQuotaExceededError.prototype);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Raised when content is not available in the user's region (HTTP 451).
|
|
122
|
+
*/
|
|
123
|
+
export class GeoRestrictedError extends VidNavigatorError {
|
|
124
|
+
constructor(message: string, status_code?: number, error_code?: string, error_message?: string, details?: any) {
|
|
125
|
+
super(message, status_code, error_code, error_message, details);
|
|
126
|
+
this.name = 'GeoRestrictedError';
|
|
127
|
+
Object.setPrototypeOf(this, GeoRestrictedError.prototype);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Raised when the system is temporarily overloaded (HTTP 503), e.g. extraction overload.
|
|
133
|
+
*/
|
|
134
|
+
export class SystemOverloadError extends VidNavigatorError {
|
|
135
|
+
public readonly retry_after_seconds?: number;
|
|
136
|
+
|
|
137
|
+
constructor(
|
|
138
|
+
message: string,
|
|
139
|
+
status_code?: number,
|
|
140
|
+
error_code?: string,
|
|
141
|
+
error_message?: string,
|
|
142
|
+
details?: any,
|
|
143
|
+
retry_after_seconds?: number
|
|
144
|
+
) {
|
|
145
|
+
super(message, status_code, error_code, error_message, details);
|
|
146
|
+
this.name = 'SystemOverloadError';
|
|
147
|
+
this.retry_after_seconds = retry_after_seconds;
|
|
148
|
+
Object.setPrototypeOf(this, SystemOverloadError.prototype);
|
|
149
|
+
}
|
|
107
150
|
}
|