@soga/entities 0.3.0 → 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/dist/download-file.d.ts +17 -11
- package/dist/download-file.d.ts.map +1 -0
- package/dist/download-file.js +220 -1
- package/dist/fetch-url.d.ts +1 -0
- package/dist/fetch-url.d.ts.map +1 -0
- package/dist/fetch-url.js +60 -1
- package/dist/host-token.d.ts +1 -0
- package/dist/host-token.d.ts.map +1 -0
- package/dist/host-token.js +62 -1
- package/dist/{main.d.ts → index.d.ts} +5 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/media-subtitles.d.ts +5 -2
- package/dist/media-subtitles.d.ts.map +1 -0
- package/dist/media-subtitles.js +141 -1
- package/dist/upload-file.d.ts +17 -8
- package/dist/upload-file.d.ts.map +1 -0
- package/dist/upload-file.js +270 -1
- package/dist/upload-part.d.ts +6 -3
- package/dist/upload-part.d.ts.map +1 -0
- package/dist/upload-part.js +112 -1
- package/dist/upload-running.d.ts +14 -0
- package/dist/upload-running.d.ts.map +1 -0
- package/dist/upload-running.js +68 -0
- package/dist/upload-success.d.ts +4 -2
- package/dist/upload-success.d.ts.map +1 -0
- package/dist/upload-success.js +101 -1
- package/package.json +17 -10
- package/dist/main.js +0 -1
package/dist/download-file.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { RecordFtype,
|
|
2
|
-
export declare enum
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { RecordFtype, RecordInfo, RecordType } from '@soga/types';
|
|
2
|
+
export declare enum DownloadFrom {
|
|
3
|
+
BAIDU = "baidu",
|
|
4
|
+
ALI = "ali",
|
|
5
|
+
ALL = "all"
|
|
5
6
|
}
|
|
6
7
|
export declare enum DownloadStatus {
|
|
7
8
|
NULL = 0,
|
|
@@ -11,25 +12,29 @@ export declare enum DownloadStatus {
|
|
|
11
12
|
}
|
|
12
13
|
export declare class DownloadFile {
|
|
13
14
|
id: number;
|
|
14
|
-
|
|
15
|
+
cloud_id: number;
|
|
16
|
+
title: string;
|
|
17
|
+
has_attachment: boolean;
|
|
18
|
+
attachment_uuid: string;
|
|
19
|
+
download_from: DownloadFrom;
|
|
20
|
+
baidu_host_id: number;
|
|
21
|
+
ali_host_id: number;
|
|
15
22
|
is_paused: boolean;
|
|
23
|
+
is_ready: boolean;
|
|
16
24
|
type: RecordType;
|
|
17
25
|
ftype: RecordFtype;
|
|
18
|
-
baidu_host_id: number;
|
|
19
|
-
ali_host_id: number;
|
|
20
26
|
routes: string[];
|
|
21
27
|
download_root: string;
|
|
22
|
-
|
|
23
|
-
download_name: string;
|
|
28
|
+
pid: number;
|
|
24
29
|
root_id: number;
|
|
25
30
|
space_id: number;
|
|
31
|
+
space_name: string;
|
|
26
32
|
uid: number;
|
|
27
|
-
|
|
33
|
+
detail: RecordInfo;
|
|
28
34
|
order: number;
|
|
29
35
|
status: DownloadStatus;
|
|
30
36
|
file_total: number;
|
|
31
37
|
file_successed: number;
|
|
32
|
-
file_size: number;
|
|
33
38
|
percent: number;
|
|
34
39
|
progress: DownloadProgressData;
|
|
35
40
|
error: Record<string, unknown>;
|
|
@@ -41,3 +46,4 @@ export type DownloadProgressData = Record<DownloadProgressStep, {
|
|
|
41
46
|
weight: number;
|
|
42
47
|
percent: number;
|
|
43
48
|
}>;
|
|
49
|
+
//# sourceMappingURL=download-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-file.d.ts","sourceRoot":"","sources":["../src/download-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAWlE,oBAAY,YAAY;IACtB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAMD,oBAAY,cAAc;IACxB,IAAI,IAAI;IACR,OAAO,IAAI;IACX,OAAO,IAAI;IACX,KAAK,IAAI;CACV;AAED,qBACa,YAAY;IAEvB,EAAE,EAAE,MAAM,CAAC;IAGX,QAAQ,EAAE,MAAM,CAAC;IAGjB,KAAK,EAAE,MAAM,CAAC;IAMd,cAAc,EAAE,OAAO,CAAC;IAGxB,eAAe,EAAE,MAAM,CAAC;IASxB,aAAa,EAAE,YAAY,CAAC;IAG5B,aAAa,EAAE,MAAM,CAAC;IAGtB,WAAW,EAAE,MAAM,CAAC;IAKpB,SAAS,EAAE,OAAO,CAAC;IAGnB,QAAQ,EAAE,OAAO,CAAC;IAMlB,IAAI,EAAE,UAAU,CAAC;IAOjB,KAAK,EAAE,WAAW,CAAC;IAGnB,MAAM,EAAE,MAAM,EAAE,CAAC;IAGjB,aAAa,EAAE,MAAM,CAAC;IAWtB,GAAG,EAAE,MAAM,CAAC;IAIZ,OAAO,EAAE,MAAM,CAAC;IAGhB,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,GAAG,EAAE,MAAM,CAAC;IAGZ,MAAM,EAAE,UAAU,CAAC;IAGnB,KAAK,EAAE,MAAM,CAAC;IAOd,MAAM,EAAE,cAAc,CAAC;IAGvB,UAAU,EAAE,MAAM,CAAC;IAGnB,cAAc,EAAE,MAAM,CAAC;IAavB,OAAO,EAAE,MAAM,CAAC;IAGhB,QAAQ,EAAE,oBAAoB,CAAC;IAG/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAG/B,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,IAAI,CAAC;CAClB;AAYD,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,gBAAgB,GAChB,eAAe,GACf,QAAQ,GACR,QAAQ,CAAC;AAEb,MAAM,MAAM,oBAAoB,GAAG,MAAM,CACvC,oBAAoB,EACpB;IACE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CACF,CAAC"}
|
package/dist/download-file.js
CHANGED
|
@@ -1 +1,220 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DownloadFile = exports.DownloadStatus = exports.DownloadFrom = void 0;
|
|
13
|
+
const types_1 = require("@soga/types");
|
|
14
|
+
// import { ErrorData } from 'src/libs/errors/code';
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
var DownloadFrom;
|
|
17
|
+
(function (DownloadFrom) {
|
|
18
|
+
DownloadFrom["BAIDU"] = "baidu";
|
|
19
|
+
DownloadFrom["ALI"] = "ali";
|
|
20
|
+
DownloadFrom["ALL"] = "all";
|
|
21
|
+
})(DownloadFrom || (exports.DownloadFrom = DownloadFrom = {}));
|
|
22
|
+
// export enum DownloadType {
|
|
23
|
+
// SOURCE = 'source',
|
|
24
|
+
// PREVIEW = 'preview',
|
|
25
|
+
// }
|
|
26
|
+
var DownloadStatus;
|
|
27
|
+
(function (DownloadStatus) {
|
|
28
|
+
DownloadStatus[DownloadStatus["NULL"] = 0] = "NULL";
|
|
29
|
+
DownloadStatus[DownloadStatus["PROCESS"] = 1] = "PROCESS";
|
|
30
|
+
DownloadStatus[DownloadStatus["SUCCESS"] = 2] = "SUCCESS";
|
|
31
|
+
DownloadStatus[DownloadStatus["ERROR"] = 4] = "ERROR";
|
|
32
|
+
})(DownloadStatus || (exports.DownloadStatus = DownloadStatus = {}));
|
|
33
|
+
let DownloadFile = class DownloadFile {
|
|
34
|
+
id;
|
|
35
|
+
cloud_id;
|
|
36
|
+
title;
|
|
37
|
+
// 是否含有附件
|
|
38
|
+
has_attachment;
|
|
39
|
+
attachment_uuid;
|
|
40
|
+
// @Column({
|
|
41
|
+
// type: 'simple-enum',
|
|
42
|
+
// enum: DownloadType,
|
|
43
|
+
// default: DownloadType.SOURCE,
|
|
44
|
+
// })
|
|
45
|
+
// download_type: DownloadType;
|
|
46
|
+
download_from;
|
|
47
|
+
baidu_host_id;
|
|
48
|
+
ali_host_id;
|
|
49
|
+
is_paused;
|
|
50
|
+
is_ready;
|
|
51
|
+
type;
|
|
52
|
+
ftype;
|
|
53
|
+
routes;
|
|
54
|
+
download_root;
|
|
55
|
+
// @Column({ default: '' })
|
|
56
|
+
// download_temp: string;
|
|
57
|
+
// @Column({ default: '' })
|
|
58
|
+
// download_name: string;
|
|
59
|
+
pid;
|
|
60
|
+
root_id;
|
|
61
|
+
space_id;
|
|
62
|
+
space_name;
|
|
63
|
+
uid;
|
|
64
|
+
detail;
|
|
65
|
+
order;
|
|
66
|
+
status;
|
|
67
|
+
file_total;
|
|
68
|
+
file_successed;
|
|
69
|
+
// @Column({
|
|
70
|
+
// type: 'simple-enum',
|
|
71
|
+
// enum: DownloadStage,
|
|
72
|
+
// default: DownloadStage.NULL,
|
|
73
|
+
// })
|
|
74
|
+
// stage: DownloadStage;
|
|
75
|
+
// @Column({ default: 0 })
|
|
76
|
+
// file_size: number;
|
|
77
|
+
percent;
|
|
78
|
+
progress;
|
|
79
|
+
error;
|
|
80
|
+
updated_at;
|
|
81
|
+
created_at;
|
|
82
|
+
};
|
|
83
|
+
exports.DownloadFile = DownloadFile;
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
86
|
+
__metadata("design:type", Number)
|
|
87
|
+
], DownloadFile.prototype, "id", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)(),
|
|
90
|
+
__metadata("design:type", Number)
|
|
91
|
+
], DownloadFile.prototype, "cloud_id", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)(),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], DownloadFile.prototype, "title", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({
|
|
98
|
+
default: false,
|
|
99
|
+
}),
|
|
100
|
+
__metadata("design:type", Boolean)
|
|
101
|
+
], DownloadFile.prototype, "has_attachment", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], DownloadFile.prototype, "attachment_uuid", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], DownloadFile.prototype, "download_from", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
112
|
+
__metadata("design:type", Number)
|
|
113
|
+
], DownloadFile.prototype, "baidu_host_id", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
116
|
+
__metadata("design:type", Number)
|
|
117
|
+
], DownloadFile.prototype, "ali_host_id", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, typeorm_1.Column)({
|
|
120
|
+
default: false,
|
|
121
|
+
}),
|
|
122
|
+
__metadata("design:type", Boolean)
|
|
123
|
+
], DownloadFile.prototype, "is_paused", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
126
|
+
__metadata("design:type", Boolean)
|
|
127
|
+
], DownloadFile.prototype, "is_ready", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, typeorm_1.Column)({
|
|
130
|
+
type: 'simple-enum',
|
|
131
|
+
enum: types_1.RecordType,
|
|
132
|
+
}),
|
|
133
|
+
__metadata("design:type", Number)
|
|
134
|
+
], DownloadFile.prototype, "type", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)({
|
|
137
|
+
type: 'simple-enum',
|
|
138
|
+
enum: types_1.RecordFtype,
|
|
139
|
+
default: types_1.RecordFtype.NONE,
|
|
140
|
+
}),
|
|
141
|
+
__metadata("design:type", Number)
|
|
142
|
+
], DownloadFile.prototype, "ftype", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, typeorm_1.Column)({ type: 'json', default: '[]' }),
|
|
145
|
+
__metadata("design:type", Array)
|
|
146
|
+
], DownloadFile.prototype, "routes", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, typeorm_1.Column)({ default: '' }),
|
|
149
|
+
__metadata("design:type", String)
|
|
150
|
+
], DownloadFile.prototype, "download_root", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, typeorm_1.Column)({
|
|
153
|
+
default: 0,
|
|
154
|
+
}),
|
|
155
|
+
__metadata("design:type", Number)
|
|
156
|
+
], DownloadFile.prototype, "pid", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, typeorm_1.Index)(),
|
|
159
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
160
|
+
__metadata("design:type", Number)
|
|
161
|
+
], DownloadFile.prototype, "root_id", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, typeorm_1.Column)(),
|
|
164
|
+
__metadata("design:type", Number)
|
|
165
|
+
], DownloadFile.prototype, "space_id", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, typeorm_1.Column)(),
|
|
168
|
+
__metadata("design:type", String)
|
|
169
|
+
], DownloadFile.prototype, "space_name", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
(0, typeorm_1.Column)(),
|
|
172
|
+
__metadata("design:type", Number)
|
|
173
|
+
], DownloadFile.prototype, "uid", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
(0, typeorm_1.Column)('json', { default: '{}' }),
|
|
176
|
+
__metadata("design:type", Object)
|
|
177
|
+
], DownloadFile.prototype, "detail", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
180
|
+
__metadata("design:type", Number)
|
|
181
|
+
], DownloadFile.prototype, "order", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0, typeorm_1.Column)({
|
|
184
|
+
type: 'simple-enum',
|
|
185
|
+
enum: DownloadStatus,
|
|
186
|
+
default: DownloadStatus.NULL,
|
|
187
|
+
}),
|
|
188
|
+
__metadata("design:type", Number)
|
|
189
|
+
], DownloadFile.prototype, "status", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
192
|
+
__metadata("design:type", Number)
|
|
193
|
+
], DownloadFile.prototype, "file_total", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
196
|
+
__metadata("design:type", Number)
|
|
197
|
+
], DownloadFile.prototype, "file_successed", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
(0, typeorm_1.Column)({ default: 0, type: 'decimal' }),
|
|
200
|
+
__metadata("design:type", Number)
|
|
201
|
+
], DownloadFile.prototype, "percent", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
(0, typeorm_1.Column)({ type: 'json', default: '{}' }),
|
|
204
|
+
__metadata("design:type", Object)
|
|
205
|
+
], DownloadFile.prototype, "progress", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
(0, typeorm_1.Column)({ type: 'json', default: '{}' }),
|
|
208
|
+
__metadata("design:type", Object)
|
|
209
|
+
], DownloadFile.prototype, "error", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
212
|
+
__metadata("design:type", Date)
|
|
213
|
+
], DownloadFile.prototype, "updated_at", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
216
|
+
__metadata("design:type", Date)
|
|
217
|
+
], DownloadFile.prototype, "created_at", void 0);
|
|
218
|
+
exports.DownloadFile = DownloadFile = __decorate([
|
|
219
|
+
(0, typeorm_1.Entity)()
|
|
220
|
+
], DownloadFile);
|
package/dist/fetch-url.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-url.d.ts","sourceRoot":"","sources":["../src/fetch-url.ts"],"names":[],"mappings":"AAQA,qBACa,QAAQ;IAEnB,EAAE,EAAE,MAAM,CAAC;IAKX,KAAK,EAAE,MAAM,CAAC;IAId,GAAG,EAAE,MAAM,CAAC;IAIZ,KAAK,EAAE,MAAM,CAAC;IAId,MAAM,EAAE,MAAM,CAAC;IAIf,IAAI,EAAE,MAAM,CAAC;IAGb,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
package/dist/fetch-url.js
CHANGED
|
@@ -1 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FetchUrl = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let FetchUrl = class FetchUrl {
|
|
15
|
+
id;
|
|
16
|
+
// 下载速率 Bytes/秒
|
|
17
|
+
speed;
|
|
18
|
+
key;
|
|
19
|
+
dlink;
|
|
20
|
+
expire;
|
|
21
|
+
fail;
|
|
22
|
+
created_at;
|
|
23
|
+
};
|
|
24
|
+
exports.FetchUrl = FetchUrl;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], FetchUrl.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Index)(),
|
|
31
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], FetchUrl.prototype, "speed", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Index)(),
|
|
36
|
+
(0, typeorm_1.Column)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], FetchUrl.prototype, "key", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Index)(),
|
|
41
|
+
(0, typeorm_1.Column)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], FetchUrl.prototype, "dlink", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Index)(),
|
|
46
|
+
(0, typeorm_1.Column)(),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], FetchUrl.prototype, "expire", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Index)(),
|
|
51
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], FetchUrl.prototype, "fail", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
56
|
+
__metadata("design:type", Date)
|
|
57
|
+
], FetchUrl.prototype, "created_at", void 0);
|
|
58
|
+
exports.FetchUrl = FetchUrl = __decorate([
|
|
59
|
+
(0, typeorm_1.Entity)()
|
|
60
|
+
], FetchUrl);
|
package/dist/host-token.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-token.d.ts","sourceRoot":"","sources":["../src/host-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AASF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CAKvB,CAAC;AAEF,qBAEa,SAAS;IAEpB,EAAE,EAAE,MAAM,CAAC;IAIX,GAAG,EAAE,MAAM,CAAC;IAIZ,OAAO,EAAE,MAAM,CAAC;IAMhB,SAAS,EAAE,aAAa,GAAG,WAAW,CAAC;IAOvC,IAAI,EAAE,QAAQ,CAAC;IAMf,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/host-token.js
CHANGED
|
@@ -1 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HostToken = void 0;
|
|
13
|
+
const types_1 = require("@soga/types");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
let HostToken = class HostToken {
|
|
16
|
+
id;
|
|
17
|
+
// 用户id
|
|
18
|
+
uid;
|
|
19
|
+
host_id;
|
|
20
|
+
auth_data;
|
|
21
|
+
type;
|
|
22
|
+
// @Column()
|
|
23
|
+
// token: string;
|
|
24
|
+
expired_at;
|
|
25
|
+
};
|
|
26
|
+
exports.HostToken = HostToken;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], HostToken.prototype, "id", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)(),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], HostToken.prototype, "uid", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Index)(),
|
|
37
|
+
(0, typeorm_1.Column)(),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], HostToken.prototype, "host_id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({
|
|
42
|
+
type: 'json',
|
|
43
|
+
nullable: true,
|
|
44
|
+
}),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], HostToken.prototype, "auth_data", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({
|
|
49
|
+
type: 'simple-enum',
|
|
50
|
+
default: types_1.HostType.BAIDU,
|
|
51
|
+
enum: types_1.HostType,
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], HostToken.prototype, "type", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)(),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], HostToken.prototype, "expired_at", void 0);
|
|
59
|
+
exports.HostToken = HostToken = __decorate([
|
|
60
|
+
(0, typeorm_1.Index)(['uid', 'host_id']),
|
|
61
|
+
(0, typeorm_1.Entity)()
|
|
62
|
+
], HostToken);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './download-file';
|
|
2
2
|
export * from './host-token';
|
|
3
|
-
export * from './upload-part';
|
|
4
|
-
export * from './upload-file';
|
|
5
|
-
export * from './upload-success';
|
|
6
3
|
export * from './fetch-url';
|
|
7
4
|
export * from './media-subtitles';
|
|
5
|
+
export * from './upload-file';
|
|
6
|
+
export * from './upload-part';
|
|
7
|
+
export * from './upload-running';
|
|
8
|
+
export * from './upload-success';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./download-file"), exports);
|
|
18
|
+
__exportStar(require("./host-token"), exports);
|
|
19
|
+
__exportStar(require("./fetch-url"), exports);
|
|
20
|
+
__exportStar(require("./media-subtitles"), exports);
|
|
21
|
+
__exportStar(require("./upload-file"), exports);
|
|
22
|
+
__exportStar(require("./upload-part"), exports);
|
|
23
|
+
__exportStar(require("./upload-running"), exports);
|
|
24
|
+
__exportStar(require("./upload-success"), exports);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { RecordDetail,
|
|
1
|
+
import { RecordDetail, NormalStatus } from '@soga/types';
|
|
2
2
|
export declare enum ActionType {
|
|
3
3
|
ADD = "add",
|
|
4
4
|
UPDATE = "update"
|
|
5
5
|
}
|
|
6
6
|
export declare class MediaSubtitles {
|
|
7
7
|
id: number;
|
|
8
|
+
is_attachment: boolean;
|
|
9
|
+
uuid: string;
|
|
8
10
|
uid: number;
|
|
9
11
|
space_id: number;
|
|
10
12
|
space_name: string;
|
|
@@ -26,7 +28,8 @@ export declare class MediaSubtitles {
|
|
|
26
28
|
size: number;
|
|
27
29
|
file_id: string;
|
|
28
30
|
};
|
|
29
|
-
status:
|
|
31
|
+
status: NormalStatus;
|
|
30
32
|
output_root: string;
|
|
31
33
|
created_at: Date;
|
|
32
34
|
}
|
|
35
|
+
//# sourceMappingURL=media-subtitles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-subtitles.d.ts","sourceRoot":"","sources":["../src/media-subtitles.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACzD,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AACD,qBACa,cAAc;IAEzB,EAAE,EAAE,MAAM,CAAC;IAKX,aAAa,EAAE,OAAO,CAAC;IAKvB,IAAI,EAAE,MAAM,CAAC;IAOb,GAAG,EAAE,MAAM,CAAC;IAGZ,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAInB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IAKpB,WAAW,EAAE,YAAY,CAAC;IAO1B,WAAW,EAAE,UAAU,CAAC;IAIxB,WAAW,EAAE,MAAM,CAAC;IAMpB,MAAM,EAAE,MAAM,EAAE,CAAC;IAMjB,mBAAmB,EAAE;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAMF,iBAAiB,EAAE;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAOF,MAAM,EAAE,YAAY,CAAC;IAIrB,WAAW,EAAE,MAAM,CAAC;IAIpB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
package/dist/media-subtitles.js
CHANGED
|
@@ -1 +1,141 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MediaSubtitles = exports.ActionType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const types_1 = require("@soga/types");
|
|
15
|
+
var ActionType;
|
|
16
|
+
(function (ActionType) {
|
|
17
|
+
ActionType["ADD"] = "add";
|
|
18
|
+
ActionType["UPDATE"] = "update";
|
|
19
|
+
})(ActionType || (exports.ActionType = ActionType = {}));
|
|
20
|
+
let MediaSubtitles = class MediaSubtitles {
|
|
21
|
+
id;
|
|
22
|
+
is_attachment;
|
|
23
|
+
uuid;
|
|
24
|
+
// 用户id
|
|
25
|
+
uid;
|
|
26
|
+
space_id;
|
|
27
|
+
space_name;
|
|
28
|
+
record_id;
|
|
29
|
+
record_name;
|
|
30
|
+
record_info;
|
|
31
|
+
action_type;
|
|
32
|
+
// 如果是更新字幕, 需要传入uuid
|
|
33
|
+
action_uuid;
|
|
34
|
+
inputs;
|
|
35
|
+
baidu_upload_result;
|
|
36
|
+
ali_upload_result;
|
|
37
|
+
status;
|
|
38
|
+
// 输出路径
|
|
39
|
+
output_root;
|
|
40
|
+
// 创建时间
|
|
41
|
+
created_at;
|
|
42
|
+
};
|
|
43
|
+
exports.MediaSubtitles = MediaSubtitles;
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], MediaSubtitles.prototype, "id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
default: false,
|
|
51
|
+
}),
|
|
52
|
+
__metadata("design:type", Boolean)
|
|
53
|
+
], MediaSubtitles.prototype, "is_attachment", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({
|
|
56
|
+
nullable: true,
|
|
57
|
+
}),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], MediaSubtitles.prototype, "uuid", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Index)(),
|
|
62
|
+
(0, typeorm_1.Column)({
|
|
63
|
+
default: 0,
|
|
64
|
+
}),
|
|
65
|
+
__metadata("design:type", Number)
|
|
66
|
+
], MediaSubtitles.prototype, "uid", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)(),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], MediaSubtitles.prototype, "space_id", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)(),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], MediaSubtitles.prototype, "space_name", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Index)(),
|
|
77
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
78
|
+
__metadata("design:type", Number)
|
|
79
|
+
], MediaSubtitles.prototype, "record_id", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)(),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], MediaSubtitles.prototype, "record_name", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.Column)({
|
|
86
|
+
type: 'json',
|
|
87
|
+
}),
|
|
88
|
+
__metadata("design:type", Object)
|
|
89
|
+
], MediaSubtitles.prototype, "record_info", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.Column)({
|
|
92
|
+
type: 'simple-enum',
|
|
93
|
+
enum: ActionType,
|
|
94
|
+
default: ActionType.ADD,
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], MediaSubtitles.prototype, "action_type", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({ default: '' }),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], MediaSubtitles.prototype, "action_uuid", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({
|
|
104
|
+
type: 'json',
|
|
105
|
+
nullable: true,
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Array)
|
|
108
|
+
], MediaSubtitles.prototype, "inputs", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, typeorm_1.Column)({
|
|
111
|
+
type: 'json',
|
|
112
|
+
nullable: true,
|
|
113
|
+
}),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], MediaSubtitles.prototype, "baidu_upload_result", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({
|
|
118
|
+
type: 'json',
|
|
119
|
+
nullable: true,
|
|
120
|
+
}),
|
|
121
|
+
__metadata("design:type", Object)
|
|
122
|
+
], MediaSubtitles.prototype, "ali_upload_result", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, typeorm_1.Column)({
|
|
125
|
+
type: 'simple-enum',
|
|
126
|
+
enum: types_1.NormalStatus,
|
|
127
|
+
default: types_1.NormalStatus.PROCESS,
|
|
128
|
+
}),
|
|
129
|
+
__metadata("design:type", Number)
|
|
130
|
+
], MediaSubtitles.prototype, "status", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, typeorm_1.Column)(),
|
|
133
|
+
__metadata("design:type", String)
|
|
134
|
+
], MediaSubtitles.prototype, "output_root", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
137
|
+
__metadata("design:type", Date)
|
|
138
|
+
], MediaSubtitles.prototype, "created_at", void 0);
|
|
139
|
+
exports.MediaSubtitles = MediaSubtitles = __decorate([
|
|
140
|
+
(0, typeorm_1.Entity)()
|
|
141
|
+
], MediaSubtitles);
|