@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/upload-file.d.ts
CHANGED
|
@@ -1,40 +1,49 @@
|
|
|
1
|
-
import { RecordType, RecordFolderConfig,
|
|
1
|
+
import { RecordType, RecordFolderConfig, UploadStatus, CloudInfoField, RecordFtype, NormalStatus } from '@soga/types';
|
|
2
|
+
import { EncodePrepareResult, EncodeResult, UploadInputItem } from '@soga/node-types';
|
|
3
|
+
export interface ErrorType {
|
|
4
|
+
type: 'encode' | 'upload';
|
|
5
|
+
message: string;
|
|
6
|
+
stack?: string;
|
|
7
|
+
details?: string[];
|
|
8
|
+
cause?: any;
|
|
9
|
+
}
|
|
2
10
|
export declare class UploadFile {
|
|
3
11
|
id: number;
|
|
12
|
+
is_attachment: boolean;
|
|
4
13
|
total_count: number;
|
|
5
14
|
completed_count: number;
|
|
6
|
-
|
|
15
|
+
input: UploadInputItem;
|
|
7
16
|
filepath: string;
|
|
8
17
|
root_id: number;
|
|
9
|
-
root_status:
|
|
18
|
+
root_status: NormalStatus;
|
|
10
19
|
space_id: number;
|
|
11
20
|
space_name: string;
|
|
12
21
|
is_ready: boolean;
|
|
13
22
|
config: RecordFolderConfig;
|
|
14
23
|
uid: number;
|
|
15
24
|
aid: number;
|
|
16
|
-
encode_status: EncodeStatus;
|
|
17
25
|
baidu_host_id: number;
|
|
18
|
-
baidu_upload_status: UploadStatus | null;
|
|
19
26
|
baidu_upload_result: Record<string, {
|
|
20
27
|
md4: string;
|
|
21
28
|
fs_id: number;
|
|
22
29
|
}>;
|
|
23
30
|
ali_host_id: number;
|
|
24
|
-
ali_upload_status: UploadStatus | null;
|
|
25
31
|
ali_upload_result: Record<string, object>;
|
|
26
32
|
upload_status: UploadStatus;
|
|
27
33
|
is_paused: boolean;
|
|
28
34
|
pid: number;
|
|
29
35
|
type: RecordType;
|
|
36
|
+
ftype: RecordFtype;
|
|
30
37
|
task_record_id: number;
|
|
31
38
|
cloud_info: CloudInfoField;
|
|
32
39
|
output_root: string;
|
|
33
40
|
external_texts: string[];
|
|
34
|
-
progress:
|
|
41
|
+
progress: EncodePrepareResult;
|
|
35
42
|
percent: number;
|
|
36
|
-
encoded:
|
|
43
|
+
encoded: EncodeResult;
|
|
44
|
+
error: ErrorType | null;
|
|
37
45
|
order: number;
|
|
38
46
|
updated_at: Date;
|
|
39
47
|
created_at: Date;
|
|
40
48
|
}
|
|
49
|
+
//# sourceMappingURL=upload-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../src/upload-file.ts"],"names":[],"mappings":"AASA,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,SAAS;IAGxB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AACD,qBACa,UAAU;IAErB,EAAE,EAAE,MAAM,CAAC;IAKX,aAAa,EAAE,OAAO,CAAC;IAGvB,WAAW,EAAE,MAAM,CAAC;IAGpB,eAAe,EAAE,MAAM,CAAC;IAcxB,KAAK,EAAE,eAAe,CAAC;IAIvB,QAAQ,EAAE,MAAM,CAAC;IAKjB,OAAO,EAAE,MAAM,CAAC;IAQhB,WAAW,EAAE,YAAY,CAAC;IAG1B,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,EAAE,OAAO,CAAC;IAOlB,MAAM,EAAE,kBAAkB,CAAC;IAO3B,GAAG,EAAE,MAAM,CAAC;IAMZ,GAAG,EAAE,MAAM,CAAC;IAIZ,aAAa,EAAE,MAAM,CAAC;IAMtB,mBAAmB,EAAE,MAAM,CACzB,MAAM,EACN;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;KACf,CACF,CAAC;IAIF,WAAW,EAAE,MAAM,CAAC;IAMpB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAY1C,aAAa,EAAE,YAAY,CAAC;IAI5B,SAAS,EAAE,OAAO,CAAC;IAOnB,GAAG,EAAE,MAAM,CAAC;IAQZ,IAAI,EAAE,UAAU,CAAC;IAOjB,KAAK,EAAE,WAAW,CAAC;IAInB,cAAc,EAAE,MAAM,CAAC;IAMvB,UAAU,EAAE,cAAc,CAAC;IAI3B,WAAW,EAAE,MAAM,CAAC;IAGpB,cAAc,EAAE,MAAM,EAAE,CAAC;IAGzB,QAAQ,EAAE,mBAAmB,CAAC;IAG9B,OAAO,EAAE,MAAM,CAAC;IAOhB,OAAO,EAAE,YAAY,CAAC;IAMtB,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IASxB,KAAK,EAAE,MAAM,CAAC;IAId,UAAU,EAAE,IAAI,CAAC;IAIjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
package/dist/upload-file.js
CHANGED
|
@@ -1 +1,270 @@
|
|
|
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.UploadFile = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const types_1 = require("@soga/types");
|
|
15
|
+
let UploadFile = class UploadFile {
|
|
16
|
+
id;
|
|
17
|
+
is_attachment;
|
|
18
|
+
total_count;
|
|
19
|
+
completed_count;
|
|
20
|
+
// @Index()
|
|
21
|
+
// @Column({ nullable: true })
|
|
22
|
+
// filename: string;
|
|
23
|
+
// @Index()
|
|
24
|
+
// @Column({ nullable: true })
|
|
25
|
+
// filepath: string;
|
|
26
|
+
input;
|
|
27
|
+
filepath;
|
|
28
|
+
// 上传的如果是一个文件夹,则文件夹为一个root,文件夹下全部文件的root_id都为这个值,该文件夹的root_id为0
|
|
29
|
+
root_id;
|
|
30
|
+
root_status;
|
|
31
|
+
space_id;
|
|
32
|
+
space_name;
|
|
33
|
+
is_ready;
|
|
34
|
+
// @Index()
|
|
35
|
+
// @Column({ default: '' })
|
|
36
|
+
// task_id: string;
|
|
37
|
+
config;
|
|
38
|
+
// 用户id
|
|
39
|
+
uid;
|
|
40
|
+
// 专辑id
|
|
41
|
+
aid;
|
|
42
|
+
baidu_host_id;
|
|
43
|
+
baidu_upload_result;
|
|
44
|
+
ali_host_id;
|
|
45
|
+
ali_upload_result;
|
|
46
|
+
// // 是否有些part已经上传完成。主要用在单个片段都上传成功,但是整体的状态失败的场景
|
|
47
|
+
// @Column({ default: false })
|
|
48
|
+
// some_host_uploaded: boolean;
|
|
49
|
+
upload_status;
|
|
50
|
+
is_paused;
|
|
51
|
+
// 上级目录id
|
|
52
|
+
pid;
|
|
53
|
+
// 文件类型
|
|
54
|
+
type;
|
|
55
|
+
ftype;
|
|
56
|
+
// 上传任务上传到的record_id
|
|
57
|
+
task_record_id;
|
|
58
|
+
cloud_info;
|
|
59
|
+
// 输出路径
|
|
60
|
+
output_root;
|
|
61
|
+
external_texts;
|
|
62
|
+
progress;
|
|
63
|
+
percent;
|
|
64
|
+
// encoded: EncodedData;
|
|
65
|
+
encoded;
|
|
66
|
+
error;
|
|
67
|
+
// @Column({
|
|
68
|
+
// type: 'json',
|
|
69
|
+
// default: '{}',
|
|
70
|
+
// })
|
|
71
|
+
// uploaded: UploadedData;
|
|
72
|
+
order;
|
|
73
|
+
// 最后一次更新时间
|
|
74
|
+
updated_at;
|
|
75
|
+
// 创建时间
|
|
76
|
+
created_at;
|
|
77
|
+
};
|
|
78
|
+
exports.UploadFile = UploadFile;
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], UploadFile.prototype, "id", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({
|
|
85
|
+
default: false,
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Boolean)
|
|
88
|
+
], UploadFile.prototype, "is_attachment", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
91
|
+
__metadata("design:type", Number)
|
|
92
|
+
], UploadFile.prototype, "total_count", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
95
|
+
__metadata("design:type", Number)
|
|
96
|
+
], UploadFile.prototype, "completed_count", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.Column)({
|
|
99
|
+
type: 'json',
|
|
100
|
+
nullable: true,
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], UploadFile.prototype, "input", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Index)(),
|
|
106
|
+
(0, typeorm_1.Column)({ default: '' }),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], UploadFile.prototype, "filepath", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, typeorm_1.Index)(),
|
|
111
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
112
|
+
__metadata("design:type", Number)
|
|
113
|
+
], UploadFile.prototype, "root_id", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Index)(),
|
|
116
|
+
(0, typeorm_1.Column)({
|
|
117
|
+
type: 'simple-enum',
|
|
118
|
+
enum: types_1.NormalStatus,
|
|
119
|
+
nullable: true,
|
|
120
|
+
}),
|
|
121
|
+
__metadata("design:type", Number)
|
|
122
|
+
], UploadFile.prototype, "root_status", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, typeorm_1.Column)(),
|
|
125
|
+
__metadata("design:type", Number)
|
|
126
|
+
], UploadFile.prototype, "space_id", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, typeorm_1.Column)(),
|
|
129
|
+
__metadata("design:type", String)
|
|
130
|
+
], UploadFile.prototype, "space_name", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, typeorm_1.Column)({ default: true }),
|
|
133
|
+
__metadata("design:type", Boolean)
|
|
134
|
+
], UploadFile.prototype, "is_ready", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)('json', { default: '{}' }),
|
|
137
|
+
__metadata("design:type", Object)
|
|
138
|
+
], UploadFile.prototype, "config", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, typeorm_1.Index)(),
|
|
141
|
+
(0, typeorm_1.Column)({
|
|
142
|
+
default: 0,
|
|
143
|
+
}),
|
|
144
|
+
__metadata("design:type", Number)
|
|
145
|
+
], UploadFile.prototype, "uid", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, typeorm_1.Column)({
|
|
148
|
+
default: 0,
|
|
149
|
+
}),
|
|
150
|
+
__metadata("design:type", Number)
|
|
151
|
+
], UploadFile.prototype, "aid", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, typeorm_1.Index)(),
|
|
154
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
155
|
+
__metadata("design:type", Number)
|
|
156
|
+
], UploadFile.prototype, "baidu_host_id", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, typeorm_1.Column)({
|
|
159
|
+
type: 'json',
|
|
160
|
+
nullable: true,
|
|
161
|
+
}),
|
|
162
|
+
__metadata("design:type", Object)
|
|
163
|
+
], UploadFile.prototype, "baidu_upload_result", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, typeorm_1.Index)(),
|
|
166
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
167
|
+
__metadata("design:type", Number)
|
|
168
|
+
], UploadFile.prototype, "ali_host_id", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, typeorm_1.Column)({
|
|
171
|
+
type: 'json',
|
|
172
|
+
nullable: true,
|
|
173
|
+
}),
|
|
174
|
+
__metadata("design:type", Object)
|
|
175
|
+
], UploadFile.prototype, "ali_upload_result", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, typeorm_1.Index)(),
|
|
178
|
+
(0, typeorm_1.Column)({
|
|
179
|
+
type: 'simple-enum',
|
|
180
|
+
enum: types_1.UploadStatus,
|
|
181
|
+
default: types_1.UploadStatus.NULL,
|
|
182
|
+
}),
|
|
183
|
+
__metadata("design:type", Number)
|
|
184
|
+
], UploadFile.prototype, "upload_status", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, typeorm_1.Index)(),
|
|
187
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
188
|
+
__metadata("design:type", Boolean)
|
|
189
|
+
], UploadFile.prototype, "is_paused", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, typeorm_1.Index)(),
|
|
192
|
+
(0, typeorm_1.Column)({
|
|
193
|
+
default: 0,
|
|
194
|
+
}),
|
|
195
|
+
__metadata("design:type", Number)
|
|
196
|
+
], UploadFile.prototype, "pid", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, typeorm_1.Index)(),
|
|
199
|
+
(0, typeorm_1.Column)({
|
|
200
|
+
type: 'simple-enum',
|
|
201
|
+
enum: types_1.RecordType,
|
|
202
|
+
}),
|
|
203
|
+
__metadata("design:type", Number)
|
|
204
|
+
], UploadFile.prototype, "type", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
(0, typeorm_1.Index)(),
|
|
207
|
+
(0, typeorm_1.Column)({
|
|
208
|
+
type: 'simple-enum',
|
|
209
|
+
enum: types_1.RecordFtype,
|
|
210
|
+
}),
|
|
211
|
+
__metadata("design:type", Number)
|
|
212
|
+
], UploadFile.prototype, "ftype", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
215
|
+
__metadata("design:type", Number)
|
|
216
|
+
], UploadFile.prototype, "task_record_id", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
(0, typeorm_1.Column)({
|
|
219
|
+
type: 'json',
|
|
220
|
+
default: '{}',
|
|
221
|
+
}),
|
|
222
|
+
__metadata("design:type", Object)
|
|
223
|
+
], UploadFile.prototype, "cloud_info", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
(0, typeorm_1.Column)({ default: '' }),
|
|
226
|
+
__metadata("design:type", String)
|
|
227
|
+
], UploadFile.prototype, "output_root", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, typeorm_1.Column)('json', { default: '[]' }),
|
|
230
|
+
__metadata("design:type", Array)
|
|
231
|
+
], UploadFile.prototype, "external_texts", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, typeorm_1.Column)({ type: 'json', default: '{}' }),
|
|
234
|
+
__metadata("design:type", Object)
|
|
235
|
+
], UploadFile.prototype, "progress", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
(0, typeorm_1.Column)({ default: 0, type: 'decimal' }),
|
|
238
|
+
__metadata("design:type", Number)
|
|
239
|
+
], UploadFile.prototype, "percent", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, typeorm_1.Column)({
|
|
242
|
+
type: 'json',
|
|
243
|
+
default: '{}',
|
|
244
|
+
})
|
|
245
|
+
// encoded: EncodedData;
|
|
246
|
+
,
|
|
247
|
+
__metadata("design:type", Object)
|
|
248
|
+
], UploadFile.prototype, "encoded", void 0);
|
|
249
|
+
__decorate([
|
|
250
|
+
(0, typeorm_1.Column)({
|
|
251
|
+
nullable: true,
|
|
252
|
+
type: 'json',
|
|
253
|
+
}),
|
|
254
|
+
__metadata("design:type", Object)
|
|
255
|
+
], UploadFile.prototype, "error", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
258
|
+
__metadata("design:type", Number)
|
|
259
|
+
], UploadFile.prototype, "order", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
262
|
+
__metadata("design:type", Date)
|
|
263
|
+
], UploadFile.prototype, "updated_at", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
266
|
+
__metadata("design:type", Date)
|
|
267
|
+
], UploadFile.prototype, "created_at", void 0);
|
|
268
|
+
exports.UploadFile = UploadFile = __decorate([
|
|
269
|
+
(0, typeorm_1.Entity)()
|
|
270
|
+
], UploadFile);
|
package/dist/upload-part.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PartItem } from '@soga/node-types';
|
|
2
|
+
import { HostType, NormalStatus } from '@soga/types';
|
|
2
3
|
export declare class UploadPart {
|
|
3
4
|
id: number;
|
|
4
5
|
uid: number;
|
|
5
6
|
file_id: number;
|
|
7
|
+
root_id: number;
|
|
6
8
|
part_name: string;
|
|
7
9
|
is_paused: boolean;
|
|
8
10
|
output_root: string;
|
|
9
|
-
info:
|
|
11
|
+
info: PartItem;
|
|
10
12
|
host_id: number;
|
|
11
13
|
host_type: HostType;
|
|
12
|
-
upload_status:
|
|
14
|
+
upload_status: NormalStatus;
|
|
13
15
|
upload_percent: number;
|
|
14
16
|
upload_result: UploadResult;
|
|
15
17
|
updated_at: Date;
|
|
@@ -25,3 +27,4 @@ type UploadResult = {
|
|
|
25
27
|
};
|
|
26
28
|
};
|
|
27
29
|
export {};
|
|
30
|
+
//# sourceMappingURL=upload-part.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-part.d.ts","sourceRoot":"","sources":["../src/upload-part.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUrD,qBACa,UAAU;IAErB,EAAE,EAAE,MAAM,CAAC;IAIX,GAAG,EAAE,MAAM,CAAC;IAIZ,OAAO,EAAE,MAAM,CAAC;IAIhB,OAAO,EAAE,MAAM,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,OAAO,CAAC;IAGnB,WAAW,EAAE,MAAM,CAAC;IAGpB,IAAI,EAAE,QAAQ,CAAC;IAIf,OAAO,EAAE,MAAM,CAAC;IAOhB,SAAS,EAAE,QAAQ,CAAC;IAQpB,aAAa,EAAE,YAAY,CAAC;IAG5B,cAAc,EAAE,MAAM,CAAC;IAMvB,aAAa,EAAE,YAAY,CAAC;IAG5B,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,IAAI,CAAC;CAClB;AAED,KAAK,YAAY,GAAG;IAClB,GAAG,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3B,CAAC"}
|
package/dist/upload-part.js
CHANGED
|
@@ -1 +1,112 @@
|
|
|
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.UploadPart = void 0;
|
|
13
|
+
const types_1 = require("@soga/types");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
let UploadPart = class UploadPart {
|
|
16
|
+
id;
|
|
17
|
+
uid;
|
|
18
|
+
file_id;
|
|
19
|
+
root_id;
|
|
20
|
+
part_name;
|
|
21
|
+
is_paused;
|
|
22
|
+
output_root;
|
|
23
|
+
info;
|
|
24
|
+
host_id;
|
|
25
|
+
host_type;
|
|
26
|
+
upload_status;
|
|
27
|
+
upload_percent;
|
|
28
|
+
upload_result;
|
|
29
|
+
updated_at;
|
|
30
|
+
created_at;
|
|
31
|
+
};
|
|
32
|
+
exports.UploadPart = UploadPart;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], UploadPart.prototype, "id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Index)(),
|
|
39
|
+
(0, typeorm_1.Column)(),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], UploadPart.prototype, "uid", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Index)(),
|
|
44
|
+
(0, typeorm_1.Column)(),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], UploadPart.prototype, "file_id", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Index)(),
|
|
49
|
+
(0, typeorm_1.Column)(),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], UploadPart.prototype, "root_id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Index)(),
|
|
54
|
+
(0, typeorm_1.Column)({ default: '' }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], UploadPart.prototype, "part_name", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
59
|
+
__metadata("design:type", Boolean)
|
|
60
|
+
], UploadPart.prototype, "is_paused", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], UploadPart.prototype, "output_root", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)('json'),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], UploadPart.prototype, "info", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Index)(),
|
|
71
|
+
(0, typeorm_1.Column)(),
|
|
72
|
+
__metadata("design:type", Number)
|
|
73
|
+
], UploadPart.prototype, "host_id", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Index)(),
|
|
76
|
+
(0, typeorm_1.Column)({
|
|
77
|
+
type: 'simple-enum',
|
|
78
|
+
enum: types_1.HostType,
|
|
79
|
+
}),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], UploadPart.prototype, "host_type", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, typeorm_1.Index)(),
|
|
84
|
+
(0, typeorm_1.Column)({
|
|
85
|
+
type: 'simple-enum',
|
|
86
|
+
enum: types_1.NormalStatus,
|
|
87
|
+
default: types_1.NormalStatus.NULL,
|
|
88
|
+
}),
|
|
89
|
+
__metadata("design:type", Number)
|
|
90
|
+
], UploadPart.prototype, "upload_status", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ default: 0, type: 'decimal' }),
|
|
93
|
+
__metadata("design:type", Number)
|
|
94
|
+
], UploadPart.prototype, "upload_percent", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({
|
|
97
|
+
type: 'json',
|
|
98
|
+
default: '{}',
|
|
99
|
+
}),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], UploadPart.prototype, "upload_result", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
104
|
+
__metadata("design:type", Date)
|
|
105
|
+
], UploadPart.prototype, "updated_at", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
108
|
+
__metadata("design:type", Date)
|
|
109
|
+
], UploadPart.prototype, "created_at", void 0);
|
|
110
|
+
exports.UploadPart = UploadPart = __decorate([
|
|
111
|
+
(0, typeorm_1.Entity)()
|
|
112
|
+
], UploadPart);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum UploadRunningType {
|
|
2
|
+
ENCODE = "encode",
|
|
3
|
+
UPLOAD = "upload"
|
|
4
|
+
}
|
|
5
|
+
export declare class UploadRunning {
|
|
6
|
+
id: number;
|
|
7
|
+
uid: number;
|
|
8
|
+
type: UploadRunningType;
|
|
9
|
+
root_id: number;
|
|
10
|
+
file_id: number;
|
|
11
|
+
part_id: number;
|
|
12
|
+
created_at: Date;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=upload-running.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-running.d.ts","sourceRoot":"","sources":["../src/upload-running.ts"],"names":[],"mappings":"AASA,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,qBACa,aAAa;IAExB,EAAE,EAAE,MAAM,CAAC;IAGX,GAAG,EAAE,MAAM,CAAC;IAQZ,IAAI,EAAE,iBAAiB,CAAC;IAKxB,OAAO,EAAE,MAAM,CAAC;IAGhB,OAAO,EAAE,MAAM,CAAC;IAKhB,OAAO,EAAE,MAAM,CAAC;IAGhB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.UploadRunning = exports.UploadRunningType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
var UploadRunningType;
|
|
15
|
+
(function (UploadRunningType) {
|
|
16
|
+
UploadRunningType["ENCODE"] = "encode";
|
|
17
|
+
UploadRunningType["UPLOAD"] = "upload";
|
|
18
|
+
})(UploadRunningType || (exports.UploadRunningType = UploadRunningType = {}));
|
|
19
|
+
let UploadRunning = class UploadRunning {
|
|
20
|
+
id;
|
|
21
|
+
uid;
|
|
22
|
+
type;
|
|
23
|
+
root_id;
|
|
24
|
+
file_id;
|
|
25
|
+
part_id;
|
|
26
|
+
created_at;
|
|
27
|
+
};
|
|
28
|
+
exports.UploadRunning = UploadRunning;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], UploadRunning.prototype, "id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)(),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], UploadRunning.prototype, "uid", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Index)(),
|
|
39
|
+
(0, typeorm_1.Column)({
|
|
40
|
+
type: 'simple-enum',
|
|
41
|
+
enum: UploadRunningType,
|
|
42
|
+
nullable: true,
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], UploadRunning.prototype, "type", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({
|
|
48
|
+
default: 0,
|
|
49
|
+
}),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], UploadRunning.prototype, "root_id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)(),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], UploadRunning.prototype, "file_id", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({
|
|
58
|
+
default: 0,
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], UploadRunning.prototype, "part_id", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], UploadRunning.prototype, "created_at", void 0);
|
|
66
|
+
exports.UploadRunning = UploadRunning = __decorate([
|
|
67
|
+
(0, typeorm_1.Entity)()
|
|
68
|
+
], UploadRunning);
|
package/dist/upload-success.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { RecordType } from '@soga/types';
|
|
2
2
|
export declare class UploadSuccess {
|
|
3
3
|
id: number;
|
|
4
|
+
is_attachment: boolean;
|
|
4
5
|
root_id: number;
|
|
5
6
|
pid: number;
|
|
6
7
|
space_id: number;
|
|
7
8
|
space_name: string;
|
|
8
9
|
uid: number;
|
|
9
|
-
|
|
10
|
+
input: {
|
|
10
11
|
filename: string;
|
|
11
12
|
filepath: string;
|
|
12
13
|
filesize: number;
|
|
13
|
-
}
|
|
14
|
+
};
|
|
14
15
|
cloud_id: number;
|
|
15
16
|
cloud_name: string;
|
|
16
17
|
type: RecordType;
|
|
17
18
|
updated_at: Date;
|
|
18
19
|
created_at: Date;
|
|
19
20
|
}
|
|
21
|
+
//# sourceMappingURL=upload-success.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-success.d.ts","sourceRoot":"","sources":["../src/upload-success.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUzC,qBACa,aAAa;IAGxB,EAAE,EAAE,MAAM,CAAC;IAKX,aAAa,EAAE,OAAO,CAAC;IAIvB,OAAO,EAAE,MAAM,CAAC;IAMhB,GAAG,EAAE,MAAM,CAAC;IAGZ,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,GAAG,EAAE,MAAM,CAAC;IAMZ,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IAGF,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAOnB,IAAI,EAAE,UAAU,CAAC;IAIjB,UAAU,EAAE,IAAI,CAAC;IAIjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|