@soga/entities 0.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 +1 -0
- package/dist/data-cache.d.ts +15 -0
- package/dist/data-cache.js +1 -0
- package/dist/dlink.d.ts +10 -0
- package/dist/dlink.js +1 -0
- package/dist/download-chunk.d.ts +18 -0
- package/dist/download-chunk.js +1 -0
- package/dist/download-file.d.ts +46 -0
- package/dist/download-file.js +1 -0
- package/dist/host-token.d.ts +19 -0
- package/dist/host-token.js +1 -0
- package/dist/main.d.ts +10 -0
- package/dist/main.js +1 -0
- package/dist/mediainfo.types.d.ts +248 -0
- package/dist/mediainfo.types.js +1 -0
- package/dist/net-success.d.ts +22 -0
- package/dist/net-success.js +1 -0
- package/dist/system.d.ts +11 -0
- package/dist/system.js +1 -0
- package/dist/upload-file.d.ts +397 -0
- package/dist/upload-file.js +1 -0
- package/dist/upload-success.d.ts +14 -0
- package/dist/upload-success.js +1 -0
- package/dist/user.d.ts +13 -0
- package/dist/user.js +1 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# entities
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum CacheScope {
|
|
2
|
+
DOWNLOAD = "download",
|
|
3
|
+
UPLOAD = "upload",
|
|
4
|
+
ENCODE = "encode"
|
|
5
|
+
}
|
|
6
|
+
export declare class DataCache {
|
|
7
|
+
id: number;
|
|
8
|
+
scope: CacheScope;
|
|
9
|
+
group: string;
|
|
10
|
+
sn: number;
|
|
11
|
+
data: unknown;
|
|
12
|
+
can_clean: boolean;
|
|
13
|
+
updated_at: Date;
|
|
14
|
+
created_at: Date;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,a,o){var r,p=arguments.length,c=p<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,a):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,a,o);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(c=(p<3?r(c):p>3?r(t,a,c):r(t,a))||c);return p>3&&c&&Object.defineProperty(t,a,c),c},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataCache=exports.CacheScope=void 0;const typeorm_1=require("typeorm");var CacheScope;!function(e){e.DOWNLOAD="download",e.UPLOAD="upload",e.ENCODE="encode"}(CacheScope||(exports.CacheScope=CacheScope={}));let DataCache=class{id;scope;group;sn;data;can_clean;updated_at;created_at};exports.DataCache=DataCache,__decorate([(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],DataCache.prototype,"id",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({type:"simple-enum",enum:CacheScope}),__metadata("design:type",String)],DataCache.prototype,"scope",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({nullable:!0}),__metadata("design:type",String)],DataCache.prototype,"group",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)(),__metadata("design:type",Number)],DataCache.prototype,"sn",void 0),__decorate([(0,typeorm_1.Column)({type:"json"}),__metadata("design:type",Object)],DataCache.prototype,"data",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({default:!0}),__metadata("design:type",Boolean)],DataCache.prototype,"can_clean",void 0),__decorate([(0,typeorm_1.UpdateDateColumn)(),__metadata("design:type",Date)],DataCache.prototype,"updated_at",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.CreateDateColumn)(),__metadata("design:type",Date)],DataCache.prototype,"created_at",void 0),exports.DataCache=DataCache=__decorate([(0,typeorm_1.Index)(["can_clean","created_at"]),(0,typeorm_1.Index)(["scope","group","sn"],{unique:!0}),(0,typeorm_1.Index)(["scope","sn"]),(0,typeorm_1.Entity)()],DataCache);
|
package/dist/dlink.d.ts
ADDED
package/dist/dlink.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,o,r){var a,i=arguments.length,_=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)_=Reflect.decorate(e,t,o,r);else for(var d=e.length-1;d>=0;d--)(a=e[d])&&(_=(i<3?a(_):i>3?a(t,o,_):a(t,o))||_);return i>3&&_&&Object.defineProperty(t,o,_),_},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Dlink=void 0;const typeorm_1=require("typeorm");let Dlink=class{id;timeout;key;dlink;expire;success;fail;created_at};exports.Dlink=Dlink,__decorate([(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],Dlink.prototype,"id",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],Dlink.prototype,"timeout",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)(),__metadata("design:type",String)],Dlink.prototype,"key",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],Dlink.prototype,"dlink",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)(),__metadata("design:type",Number)],Dlink.prototype,"expire",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],Dlink.prototype,"success",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],Dlink.prototype,"fail",void 0),__decorate([(0,typeorm_1.CreateDateColumn)(),__metadata("design:type",Date)],Dlink.prototype,"created_at",void 0),exports.Dlink=Dlink=__decorate([(0,typeorm_1.Entity)()],Dlink);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum ChunkStatus {
|
|
2
|
+
NULL = 0,
|
|
3
|
+
PROCESS = 1,
|
|
4
|
+
SUCCESS = 2,
|
|
5
|
+
ERROR = 4
|
|
6
|
+
}
|
|
7
|
+
export declare class DownloadChunk {
|
|
8
|
+
id: number;
|
|
9
|
+
download_id: number;
|
|
10
|
+
type: number;
|
|
11
|
+
status: ChunkStatus;
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
chunk_name: string;
|
|
15
|
+
path: string;
|
|
16
|
+
updated_at: Date;
|
|
17
|
+
created_at: Date;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(t,e,o,a){var n,d=arguments.length,r=d<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,o,a);else for(var _=t.length-1;_>=0;_--)(n=t[_])&&(r=(d<3?n(r):d>3?n(e,o,r):n(e,o))||r);return d>3&&r&&Object.defineProperty(e,o,r),r},__metadata=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DownloadChunk=exports.ChunkStatus=void 0;const typeorm_1=require("typeorm");var ChunkStatus;!function(t){t[t.NULL=0]="NULL",t[t.PROCESS=1]="PROCESS",t[t.SUCCESS=2]="SUCCESS",t[t.ERROR=4]="ERROR"}(ChunkStatus||(exports.ChunkStatus=ChunkStatus={}));let DownloadChunk=class{id;download_id;type;status;start;end;chunk_name;path;updated_at;created_at};exports.DownloadChunk=DownloadChunk,__decorate([(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],DownloadChunk.prototype,"id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],DownloadChunk.prototype,"download_id",void 0),__decorate([(0,typeorm_1.Column)({default:1}),__metadata("design:type",Number)],DownloadChunk.prototype,"type",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:ChunkStatus,default:ChunkStatus.NULL}),__metadata("design:type",Number)],DownloadChunk.prototype,"status",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],DownloadChunk.prototype,"start",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],DownloadChunk.prototype,"end",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],DownloadChunk.prototype,"chunk_name",void 0),__decorate([(0,typeorm_1.Column)({default:""}),__metadata("design:type",String)],DownloadChunk.prototype,"path",void 0),__decorate([(0,typeorm_1.UpdateDateColumn)(),__metadata("design:type",Date)],DownloadChunk.prototype,"updated_at",void 0),__decorate([(0,typeorm_1.CreateDateColumn)(),__metadata("design:type",Date)],DownloadChunk.prototype,"created_at",void 0),exports.DownloadChunk=DownloadChunk=__decorate([(0,typeorm_1.Entity)()],DownloadChunk);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { RecordFtype, RecordListItem, RecordType } from '@soga/types';
|
|
2
|
+
export declare enum DownloadStatus {
|
|
3
|
+
NULL = 0,
|
|
4
|
+
PROCESS = 1,
|
|
5
|
+
SUCCESS = 2,
|
|
6
|
+
ERROR = 4
|
|
7
|
+
}
|
|
8
|
+
export declare class DownloadFile {
|
|
9
|
+
id: number;
|
|
10
|
+
is_affix: boolean;
|
|
11
|
+
is_paused: boolean;
|
|
12
|
+
type: RecordType;
|
|
13
|
+
ftype: RecordFtype;
|
|
14
|
+
routes: string[];
|
|
15
|
+
download_root: string;
|
|
16
|
+
download_temp: string;
|
|
17
|
+
download_name: string;
|
|
18
|
+
pid: number;
|
|
19
|
+
root_id: number;
|
|
20
|
+
space_id: number;
|
|
21
|
+
uid: number;
|
|
22
|
+
record: RecordListItem;
|
|
23
|
+
order: number;
|
|
24
|
+
status: DownloadStatus;
|
|
25
|
+
file_total: number;
|
|
26
|
+
file_successed: number;
|
|
27
|
+
file_size: number;
|
|
28
|
+
percent: number;
|
|
29
|
+
progress: DownloadProgressData;
|
|
30
|
+
updated_at: Date;
|
|
31
|
+
created_at: Date;
|
|
32
|
+
}
|
|
33
|
+
export declare const getDownloadResetFields: () => {
|
|
34
|
+
error: {};
|
|
35
|
+
is_paused: boolean;
|
|
36
|
+
status: DownloadStatus;
|
|
37
|
+
progress: any;
|
|
38
|
+
percent: number;
|
|
39
|
+
download_temp: string;
|
|
40
|
+
download_root: string;
|
|
41
|
+
};
|
|
42
|
+
export type DownloadProgressStep = 'PREPARE' | 'DOWNLOAD_CHUNK' | 'COMBINE_CHUNK' | 'UNPACK' | 'ENDING';
|
|
43
|
+
export type DownloadProgressData = Record<DownloadProgressStep, {
|
|
44
|
+
weight: number;
|
|
45
|
+
percent: number;
|
|
46
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,o,a){var d,r=arguments.length,_=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)_=Reflect.decorate(e,t,o,a);else for(var l=e.length-1;l>=0;l--)(d=e[l])&&(_=(r<3?d(_):r>3?d(t,o,_):d(t,o))||_);return r>3&&_&&Object.defineProperty(t,o,_),_},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDownloadResetFields=exports.DownloadFile=exports.DownloadStatus=void 0;const types_1=require("@soga/types"),typeorm_1=require("typeorm");var DownloadStatus;!function(e){e[e.NULL=0]="NULL",e[e.PROCESS=1]="PROCESS",e[e.SUCCESS=2]="SUCCESS",e[e.ERROR=4]="ERROR"}(DownloadStatus||(exports.DownloadStatus=DownloadStatus={}));let DownloadFile=class{id;is_affix;is_paused;type;ftype;routes;download_root;download_temp;download_name;pid;root_id;space_id;uid;record;order;status;file_total;file_successed;file_size;percent;progress;updated_at;created_at};exports.DownloadFile=DownloadFile,__decorate([(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],DownloadFile.prototype,"id",void 0),__decorate([(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],DownloadFile.prototype,"is_affix",void 0),__decorate([(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],DownloadFile.prototype,"is_paused",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RecordType}),__metadata("design:type",Number)],DownloadFile.prototype,"type",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RecordFtype,default:types_1.RecordFtype.NONE}),__metadata("design:type",Number)],DownloadFile.prototype,"ftype",void 0),__decorate([(0,typeorm_1.Column)({type:"json",default:"[]"}),__metadata("design:type",Array)],DownloadFile.prototype,"routes",void 0),__decorate([(0,typeorm_1.Column)({default:""}),__metadata("design:type",String)],DownloadFile.prototype,"download_root",void 0),__decorate([(0,typeorm_1.Column)({default:""}),__metadata("design:type",String)],DownloadFile.prototype,"download_temp",void 0),__decorate([(0,typeorm_1.Column)({default:""}),__metadata("design:type",String)],DownloadFile.prototype,"download_name",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],DownloadFile.prototype,"pid",void 0),__decorate([(0,typeorm_1.Column)({nullable:!0}),__metadata("design:type",Number)],DownloadFile.prototype,"root_id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],DownloadFile.prototype,"space_id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],DownloadFile.prototype,"uid",void 0),__decorate([(0,typeorm_1.Column)("json",{default:"{}"}),__metadata("design:type",Object)],DownloadFile.prototype,"record",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],DownloadFile.prototype,"order",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:DownloadStatus,default:DownloadStatus.NULL}),__metadata("design:type",Number)],DownloadFile.prototype,"status",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],DownloadFile.prototype,"file_total",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],DownloadFile.prototype,"file_successed",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],DownloadFile.prototype,"file_size",void 0),__decorate([(0,typeorm_1.Column)({default:0,type:"decimal"}),__metadata("design:type",Number)],DownloadFile.prototype,"percent",void 0),__decorate([(0,typeorm_1.Column)({type:"json",nullable:!0}),__metadata("design:type",Object)],DownloadFile.prototype,"progress",void 0),__decorate([(0,typeorm_1.UpdateDateColumn)(),__metadata("design:type",Date)],DownloadFile.prototype,"updated_at",void 0),__decorate([(0,typeorm_1.CreateDateColumn)(),__metadata("design:type",Date)],DownloadFile.prototype,"created_at",void 0),exports.DownloadFile=DownloadFile=__decorate([(0,typeorm_1.Entity)()],DownloadFile);const getDownloadResetFields=()=>({error:{},is_paused:!1,status:DownloadStatus.NULL,progress:null,percent:0,download_temp:"",download_root:""});exports.getDownloadResetFields=getDownloadResetFields;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HostType } from '@soga/types';
|
|
2
|
+
export type BaiduAuthData = {
|
|
3
|
+
token: string;
|
|
4
|
+
};
|
|
5
|
+
export type AliAuthData = {
|
|
6
|
+
token: string;
|
|
7
|
+
drive_id: string;
|
|
8
|
+
dpan_file_id: string;
|
|
9
|
+
cache_file_id: string;
|
|
10
|
+
space_file_id: string;
|
|
11
|
+
};
|
|
12
|
+
export declare class HostToken {
|
|
13
|
+
id: number;
|
|
14
|
+
uid: number;
|
|
15
|
+
host_id: number;
|
|
16
|
+
auth_data: BaiduAuthData | AliAuthData;
|
|
17
|
+
type: HostType;
|
|
18
|
+
expired_at: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,o,r){var a,_=arguments.length,p=_<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(e,t,o,r);else for(var d=e.length-1;d>=0;d--)(a=e[d])&&(p=(_<3?a(p):_>3?a(t,o,p):a(t,o))||p);return _>3&&p&&Object.defineProperty(t,o,p),p},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HostToken=void 0;const types_1=require("@soga/types"),typeorm_1=require("typeorm");let HostToken=class{id;uid;host_id;auth_data;type;expired_at};exports.HostToken=HostToken,__decorate([(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],HostToken.prototype,"id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],HostToken.prototype,"uid",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)(),__metadata("design:type",Number)],HostToken.prototype,"host_id",void 0),__decorate([(0,typeorm_1.Column)({type:"json",nullable:!0}),__metadata("design:type",Object)],HostToken.prototype,"auth_data",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",default:types_1.HostType.BAIDU,enum:types_1.HostType}),__metadata("design:type",String)],HostToken.prototype,"type",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],HostToken.prototype,"expired_at",void 0),exports.HostToken=HostToken=__decorate([(0,typeorm_1.Index)(["uid","host_id"]),(0,typeorm_1.Entity)()],HostToken);
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './data-cache';
|
|
2
|
+
export * from './dlink';
|
|
3
|
+
export * from './download-chunk';
|
|
4
|
+
export * from './download-file';
|
|
5
|
+
export * from './host-token';
|
|
6
|
+
export * from './net-success';
|
|
7
|
+
export * from './system';
|
|
8
|
+
export * from './upload-file';
|
|
9
|
+
export * from './upload-success';
|
|
10
|
+
export * from './user';
|
package/dist/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&!("get"in i?!r.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,i)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./data-cache"),exports),__exportStar(require("./dlink"),exports),__exportStar(require("./download-chunk"),exports),__exportStar(require("./download-file"),exports),__exportStar(require("./host-token"),exports),__exportStar(require("./net-success"),exports),__exportStar(require("./system"),exports),__exportStar(require("./upload-file"),exports),__exportStar(require("./upload-success"),exports),__exportStar(require("./user"),exports);
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
export type GeneralInfo = {
|
|
2
|
+
audioCount: number;
|
|
3
|
+
videoCount: number;
|
|
4
|
+
textCount: number;
|
|
5
|
+
fileSize: number;
|
|
6
|
+
codec: string;
|
|
7
|
+
title: string;
|
|
8
|
+
duration: number;
|
|
9
|
+
extra?: {
|
|
10
|
+
duration: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type AudioTrackInfo = {
|
|
14
|
+
is_default: boolean;
|
|
15
|
+
order: number;
|
|
16
|
+
codec: string;
|
|
17
|
+
bitrate: number;
|
|
18
|
+
framerate: number;
|
|
19
|
+
channels: number;
|
|
20
|
+
duration: number;
|
|
21
|
+
lossless: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type VideoTrackInfo = {
|
|
24
|
+
is_default: boolean;
|
|
25
|
+
order: number;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
codec: string;
|
|
29
|
+
framerate: number;
|
|
30
|
+
bitrate: number;
|
|
31
|
+
duration: number;
|
|
32
|
+
bitdepth: number;
|
|
33
|
+
};
|
|
34
|
+
export type TextTrackInfo = {
|
|
35
|
+
is_default: boolean;
|
|
36
|
+
codec: string;
|
|
37
|
+
order: number;
|
|
38
|
+
duration: number;
|
|
39
|
+
language?: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
is_vtt?: boolean;
|
|
42
|
+
};
|
|
43
|
+
export type TracksMap = {
|
|
44
|
+
general?: GeneralInfo;
|
|
45
|
+
audio?: AudioTrackInfo[];
|
|
46
|
+
video?: VideoTrackInfo[];
|
|
47
|
+
text?: TextTrackInfo[];
|
|
48
|
+
};
|
|
49
|
+
export type RawGeneralInfo = {
|
|
50
|
+
'@type': 'General';
|
|
51
|
+
AudioCount: string;
|
|
52
|
+
Duration: string;
|
|
53
|
+
Encoded_Application: string;
|
|
54
|
+
Encoded_Date: string;
|
|
55
|
+
Encoded_Library: string;
|
|
56
|
+
FileSize: string;
|
|
57
|
+
Format: string;
|
|
58
|
+
Format_Version: string;
|
|
59
|
+
FrameCount: string;
|
|
60
|
+
FrameRate: string;
|
|
61
|
+
IsStreamable: 'Yes' | 'No';
|
|
62
|
+
OverallBitRate: string;
|
|
63
|
+
StreamSize: string;
|
|
64
|
+
TextCount: string;
|
|
65
|
+
UniqueID: string;
|
|
66
|
+
VideoCount: string;
|
|
67
|
+
[key: string]: string;
|
|
68
|
+
};
|
|
69
|
+
export type RawAudioInfo = {
|
|
70
|
+
'@type': 'Audio';
|
|
71
|
+
'@typeorder': string;
|
|
72
|
+
BitRate: string;
|
|
73
|
+
BitRate_Mode: string;
|
|
74
|
+
ChannelLayout: string;
|
|
75
|
+
ChannelPositions: string;
|
|
76
|
+
Channels: string;
|
|
77
|
+
CodecID: string;
|
|
78
|
+
Compression_Mode: 'Lossy' | 'Lossless';
|
|
79
|
+
Default: 'Yes' | 'No';
|
|
80
|
+
Delay: string;
|
|
81
|
+
Delay_Source: string;
|
|
82
|
+
Duration: string;
|
|
83
|
+
Forced: string;
|
|
84
|
+
Format: string;
|
|
85
|
+
Format_Commercial_IfAny: string;
|
|
86
|
+
Format_Settings_Endianness: string;
|
|
87
|
+
FrameRate: string;
|
|
88
|
+
ID: string;
|
|
89
|
+
Language: string;
|
|
90
|
+
SamplesPerFrame: string;
|
|
91
|
+
SamplingCount: string;
|
|
92
|
+
SamplingRate: string;
|
|
93
|
+
ServiceKind: string;
|
|
94
|
+
StreamOrder: string;
|
|
95
|
+
StreamSize: string;
|
|
96
|
+
StreamSize_Proportion: string;
|
|
97
|
+
UniqueID: string;
|
|
98
|
+
[key: string]: string;
|
|
99
|
+
};
|
|
100
|
+
export type RawVideoInfo = {
|
|
101
|
+
'@type': 'Video';
|
|
102
|
+
Default: 'Yes' | 'No';
|
|
103
|
+
StreamOrder: string;
|
|
104
|
+
Width: string;
|
|
105
|
+
Height: string;
|
|
106
|
+
Language: string;
|
|
107
|
+
BitDepth: string;
|
|
108
|
+
BitRate: string;
|
|
109
|
+
BitRate_Nominal: string;
|
|
110
|
+
ChromaSubsampling: string;
|
|
111
|
+
CodecID: string;
|
|
112
|
+
ColorSpace: string;
|
|
113
|
+
Delay: string;
|
|
114
|
+
DisplayAspectRatio: string;
|
|
115
|
+
Duration: string;
|
|
116
|
+
Encoded_Library: string;
|
|
117
|
+
Encoded_Library_Name: string;
|
|
118
|
+
Encoded_Library_Settings: string;
|
|
119
|
+
Encoded_Library_Version: string;
|
|
120
|
+
Forced: string;
|
|
121
|
+
Format: string;
|
|
122
|
+
Format_Level: string;
|
|
123
|
+
Format_Profile: string;
|
|
124
|
+
Format_Settings_CABAC: string;
|
|
125
|
+
Format_Settings_RefFrames: string;
|
|
126
|
+
FrameCount: string;
|
|
127
|
+
FrameRate: string;
|
|
128
|
+
FrameRate_Mode: string;
|
|
129
|
+
ID: string;
|
|
130
|
+
PixelAspectRatio: string;
|
|
131
|
+
Sampled_Height: string;
|
|
132
|
+
Sampled_Width: string;
|
|
133
|
+
ScanType: string;
|
|
134
|
+
StreamSize: string;
|
|
135
|
+
UniqueID: string;
|
|
136
|
+
[key: string]: string;
|
|
137
|
+
};
|
|
138
|
+
export type RawTextInfo = {
|
|
139
|
+
'@type': 'Text';
|
|
140
|
+
'@typeorder': string;
|
|
141
|
+
CodecID: string;
|
|
142
|
+
Compression_Mode: string;
|
|
143
|
+
Default: 'Yes' | 'No';
|
|
144
|
+
Forced: string;
|
|
145
|
+
Format: string;
|
|
146
|
+
ID: string;
|
|
147
|
+
StreamOrder: string;
|
|
148
|
+
UniqueID: string;
|
|
149
|
+
Duration: string;
|
|
150
|
+
[key: string]: string;
|
|
151
|
+
};
|
|
152
|
+
export type MediaTrackItem = RawGeneralInfo | RawAudioInfo | RawVideoInfo | RawTextInfo;
|
|
153
|
+
export type RawMediainfo = {
|
|
154
|
+
creatingLibrary: {
|
|
155
|
+
name: string;
|
|
156
|
+
version: string;
|
|
157
|
+
url: string;
|
|
158
|
+
};
|
|
159
|
+
media: {
|
|
160
|
+
track: MediaTrackItem[];
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
export type StandardKey = 'h_p360' | 'h_p540' | 'h_p720' | 'h_p1080' | 'h_p1440' | 'h_k4' | 'h_k8' | 'h_k16' | 'h_k32' | 'h_k32plus' | 'v_p360' | 'v_p540' | 'v_p720' | 'v_p1080' | 'v_p1440' | 'v_k4' | 'v_k8' | 'v_k16' | 'v_k32' | 'v_k32plus';
|
|
164
|
+
export type StandardItem = {
|
|
165
|
+
key: StandardKey;
|
|
166
|
+
is_horizontal: boolean;
|
|
167
|
+
width: number;
|
|
168
|
+
height: number;
|
|
169
|
+
label: string;
|
|
170
|
+
tag: string;
|
|
171
|
+
edge: 'width' | 'height';
|
|
172
|
+
codec: string;
|
|
173
|
+
};
|
|
174
|
+
export type Mp4boxVideoInfo = {
|
|
175
|
+
id: number;
|
|
176
|
+
name?: 'VideoHandler';
|
|
177
|
+
references: any[];
|
|
178
|
+
edits: {
|
|
179
|
+
segment_duration: number;
|
|
180
|
+
media_time: number;
|
|
181
|
+
media_rate_integer: number;
|
|
182
|
+
media_rate_fraction: number;
|
|
183
|
+
}[];
|
|
184
|
+
created: string;
|
|
185
|
+
modified: string;
|
|
186
|
+
movie_duration: number;
|
|
187
|
+
movie_timescale: number;
|
|
188
|
+
layer: number;
|
|
189
|
+
alternate_group: number;
|
|
190
|
+
volume: number;
|
|
191
|
+
track_width: number;
|
|
192
|
+
track_height: number;
|
|
193
|
+
timescale: number;
|
|
194
|
+
duration: number;
|
|
195
|
+
samples_duration: number;
|
|
196
|
+
codec: string;
|
|
197
|
+
kind: {
|
|
198
|
+
schemeURI: string;
|
|
199
|
+
value: string;
|
|
200
|
+
};
|
|
201
|
+
language: string;
|
|
202
|
+
nb_samples: number;
|
|
203
|
+
size: number;
|
|
204
|
+
bitrate: number;
|
|
205
|
+
type: 'video';
|
|
206
|
+
video: {
|
|
207
|
+
width: number;
|
|
208
|
+
height: number;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
export type Mp4boxAudioInfo = {
|
|
212
|
+
id: number;
|
|
213
|
+
name?: 'SoundHandler';
|
|
214
|
+
references: any[];
|
|
215
|
+
edits: {
|
|
216
|
+
segment_duration: number;
|
|
217
|
+
media_time: number;
|
|
218
|
+
media_rate_integer: number;
|
|
219
|
+
media_rate_fraction: number;
|
|
220
|
+
}[];
|
|
221
|
+
created: string;
|
|
222
|
+
modified: string;
|
|
223
|
+
movie_duration: number;
|
|
224
|
+
movie_timescale: number;
|
|
225
|
+
layer: number;
|
|
226
|
+
alternate_group: number;
|
|
227
|
+
volume: number;
|
|
228
|
+
track_width: number;
|
|
229
|
+
track_height: number;
|
|
230
|
+
timescale: number;
|
|
231
|
+
duration: number;
|
|
232
|
+
samples_duration: number;
|
|
233
|
+
codec: string;
|
|
234
|
+
kind: {
|
|
235
|
+
schemeURI: string;
|
|
236
|
+
value: string;
|
|
237
|
+
};
|
|
238
|
+
language: string;
|
|
239
|
+
nb_samples: number;
|
|
240
|
+
size: number;
|
|
241
|
+
bitrate: number;
|
|
242
|
+
type: 'audio';
|
|
243
|
+
audio: {
|
|
244
|
+
sample_rate: number;
|
|
245
|
+
channel_count: number;
|
|
246
|
+
sample_size: number;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RecordFtype, RecordType } from '@soga/types';
|
|
2
|
+
export declare enum NetType {
|
|
3
|
+
DOWNLOAD = "download",
|
|
4
|
+
UPLOAD = "upload",
|
|
5
|
+
CACHE = "cache"
|
|
6
|
+
}
|
|
7
|
+
export declare class NetSuccess {
|
|
8
|
+
id: number;
|
|
9
|
+
uid: number;
|
|
10
|
+
net_type: NetType;
|
|
11
|
+
is_affix: boolean;
|
|
12
|
+
type: RecordType;
|
|
13
|
+
ftype: RecordFtype;
|
|
14
|
+
space_id: number;
|
|
15
|
+
title: string;
|
|
16
|
+
local_path: string;
|
|
17
|
+
record_id: number;
|
|
18
|
+
file_total: number;
|
|
19
|
+
file_size: number;
|
|
20
|
+
updated_at: Date;
|
|
21
|
+
created_at: Date;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,o,a){var p,_=arguments.length,r=_<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,a);else for(var d=e.length-1;d>=0;d--)(p=e[d])&&(r=(_<3?p(r):_>3?p(t,o,r):p(t,o))||r);return _>3&&r&&Object.defineProperty(t,o,r),r},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.NetSuccess=exports.NetType=void 0;const types_1=require("@soga/types"),typeorm_1=require("typeorm");var NetType;!function(e){e.DOWNLOAD="download",e.UPLOAD="upload",e.CACHE="cache"}(NetType||(exports.NetType=NetType={}));let NetSuccess=class{id;uid;net_type;is_affix;type;ftype;space_id;title;local_path;record_id;file_total;file_size;updated_at;created_at};exports.NetSuccess=NetSuccess,__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],NetSuccess.prototype,"id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],NetSuccess.prototype,"uid",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:NetType}),__metadata("design:type",String)],NetSuccess.prototype,"net_type",void 0),__decorate([(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],NetSuccess.prototype,"is_affix",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RecordType}),__metadata("design:type",Number)],NetSuccess.prototype,"type",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RecordFtype,default:types_1.RecordFtype.NONE}),__metadata("design:type",Number)],NetSuccess.prototype,"ftype",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],NetSuccess.prototype,"space_id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],NetSuccess.prototype,"title",void 0),__decorate([(0,typeorm_1.Column)({default:""}),__metadata("design:type",String)],NetSuccess.prototype,"local_path",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],NetSuccess.prototype,"record_id",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],NetSuccess.prototype,"file_total",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],NetSuccess.prototype,"file_size",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Date)],NetSuccess.prototype,"updated_at",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Date)],NetSuccess.prototype,"created_at",void 0),exports.NetSuccess=NetSuccess=__decorate([(0,typeorm_1.Entity)()],NetSuccess);
|
package/dist/system.d.ts
ADDED
package/dist/system.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,o,r){var a,_=arguments.length,d=_<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,o,r);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(d=(_<3?a(d):_>3?a(t,o,d):a(t,o))||d);return _>3&&d&&Object.defineProperty(t,o,d),d},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.System=void 0;const os_1=require("os"),path_1=require("path"),typeorm_1=require("typeorm");let System=class{id;uid;root;updated_at;created_at;get temp_root(){return(0,path_1.resolve)(this.root,"Temp")}get download_root(){return(0,path_1.resolve)(this.root,"Download")}get encode_root(){return(0,path_1.resolve)(this.root,"Encode")}get cache_root(){return(0,path_1.resolve)(this.root,"Cache")}};exports.System=System,__decorate([(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],System.prototype,"id",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)(),__metadata("design:type",Number)],System.prototype,"uid",void 0),__decorate([(0,typeorm_1.Column)({default:(0,os_1.homedir)(),unique:!0}),__metadata("design:type",String)],System.prototype,"root",void 0),__decorate([(0,typeorm_1.UpdateDateColumn)(),__metadata("design:type",Date)],System.prototype,"updated_at",void 0),__decorate([(0,typeorm_1.CreateDateColumn)(),__metadata("design:type",Date)],System.prototype,"created_at",void 0),exports.System=System=__decorate([(0,typeorm_1.Entity)()],System);
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { AudioTrackInfo, GeneralInfo, TextTrackInfo, VideoTrackInfo } from './mediainfo.types';
|
|
2
|
+
type CommonManifest = {
|
|
3
|
+
version: number;
|
|
4
|
+
targetDuration: number;
|
|
5
|
+
mediaSequence: number;
|
|
6
|
+
endList: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type SegmentInfo = {
|
|
9
|
+
index: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
init_uri: string;
|
|
12
|
+
uri: string;
|
|
13
|
+
file_path: string;
|
|
14
|
+
folder: string;
|
|
15
|
+
size: number;
|
|
16
|
+
start_time: number;
|
|
17
|
+
end_time: number;
|
|
18
|
+
};
|
|
19
|
+
export type M3U8Manifest = CommonManifest & {
|
|
20
|
+
init: {
|
|
21
|
+
uri: string;
|
|
22
|
+
file_path: string;
|
|
23
|
+
size: number;
|
|
24
|
+
};
|
|
25
|
+
segments: SegmentInfo[];
|
|
26
|
+
};
|
|
27
|
+
import { HostType, RecordType, RecordFolderConfig, ManifestVideoMetaInfo, ManifestAudioMetaInfo, ManifestTextItem, SubtitleType, RecordFtype, EncodeStatus, UploadStatus, RootStatus } from '@soga/types';
|
|
28
|
+
export type UploadProgressStep = 'PREPARE' | 'SEPARATE_VIDEO_TRACK' | 'SEPARATE_AUDIO_TRACK' | 'SEPARATE_TEXT_TRACK' | 'ENCODE_VIDEO_TRACK' | 'ENCODE_AUDIO_TRACK' | 'ENCODE_THUMBNAIL' | 'ENCODE_SOURCE' | 'ENCODE_TXT' | 'UPLOAD_BAIDU' | 'UPLOAD_ALI' | 'ENDING';
|
|
29
|
+
export declare class UploadFile {
|
|
30
|
+
id: number;
|
|
31
|
+
root_id: number;
|
|
32
|
+
root_status: RootStatus;
|
|
33
|
+
space_id: number;
|
|
34
|
+
space_name: string;
|
|
35
|
+
is_folder: boolean;
|
|
36
|
+
task_id: number;
|
|
37
|
+
is_affix: boolean;
|
|
38
|
+
is_paused: boolean;
|
|
39
|
+
config: RecordFolderConfig;
|
|
40
|
+
can_stop: boolean;
|
|
41
|
+
stop_checker: {
|
|
42
|
+
can_stop: boolean;
|
|
43
|
+
code: number;
|
|
44
|
+
message: string;
|
|
45
|
+
};
|
|
46
|
+
uid: number;
|
|
47
|
+
aid: number;
|
|
48
|
+
file_total: number;
|
|
49
|
+
file_successed: number;
|
|
50
|
+
encode_status: EncodeStatus;
|
|
51
|
+
upload_status: UploadStatus;
|
|
52
|
+
baidu_host_id: number;
|
|
53
|
+
ali_host_id: number;
|
|
54
|
+
pid: number;
|
|
55
|
+
type: RecordType;
|
|
56
|
+
ftype: RecordFtype;
|
|
57
|
+
path: string;
|
|
58
|
+
filename: string;
|
|
59
|
+
title: string;
|
|
60
|
+
size: number;
|
|
61
|
+
local_birthtime: number;
|
|
62
|
+
local_ctime: number;
|
|
63
|
+
local_mtime: number;
|
|
64
|
+
task_record_id: number;
|
|
65
|
+
record_folder_info: RecordFolderInfo;
|
|
66
|
+
output_root: string;
|
|
67
|
+
external_texts: BuiltinTextFieldData[];
|
|
68
|
+
progress: ProgressData;
|
|
69
|
+
percent: number;
|
|
70
|
+
error: Record<string, unknown>;
|
|
71
|
+
prepare_data: {
|
|
72
|
+
default_general?: GeneralInfo;
|
|
73
|
+
default_videos?: VideoTrackInfo[];
|
|
74
|
+
default_audios?: AudioTrackInfo[];
|
|
75
|
+
default_texts?: TextTrackInfo[];
|
|
76
|
+
video_default?: PrepareVideoTrackInfo;
|
|
77
|
+
video_adapts?: PrepareVideoTrackInfo[];
|
|
78
|
+
audios?: AudioTrackData[];
|
|
79
|
+
builtin_texts?: BuiltinTextTrackData[];
|
|
80
|
+
external_texts?: ExternalTextTrackData[];
|
|
81
|
+
thumbnail_timeout?: number;
|
|
82
|
+
};
|
|
83
|
+
media_data: MediaDataField;
|
|
84
|
+
txt_data: TxtDataField;
|
|
85
|
+
file_data: FileDataField;
|
|
86
|
+
baidu_data: Record<string, {
|
|
87
|
+
fs_id: number;
|
|
88
|
+
md4: string;
|
|
89
|
+
}>;
|
|
90
|
+
ali_data: Record<string, {
|
|
91
|
+
drive_id: string;
|
|
92
|
+
file_id: string;
|
|
93
|
+
sha1: string;
|
|
94
|
+
}>;
|
|
95
|
+
order: number;
|
|
96
|
+
updated_at: Date;
|
|
97
|
+
created_at: Date;
|
|
98
|
+
}
|
|
99
|
+
export type TextInfo = {
|
|
100
|
+
file: string;
|
|
101
|
+
file_path: string;
|
|
102
|
+
size: number;
|
|
103
|
+
lang: string;
|
|
104
|
+
title: string;
|
|
105
|
+
builtin: boolean;
|
|
106
|
+
type: SubtitleType;
|
|
107
|
+
source: {
|
|
108
|
+
file: string;
|
|
109
|
+
file_path: string;
|
|
110
|
+
size: number;
|
|
111
|
+
type: SubtitleType;
|
|
112
|
+
} | null;
|
|
113
|
+
};
|
|
114
|
+
export declare const getUploadResetFields: () => {
|
|
115
|
+
error: {};
|
|
116
|
+
is_paused: boolean;
|
|
117
|
+
output_root: string;
|
|
118
|
+
encode_status: EncodeStatus;
|
|
119
|
+
upload_status: UploadStatus;
|
|
120
|
+
progress: any;
|
|
121
|
+
percent: number;
|
|
122
|
+
prepare_data: {};
|
|
123
|
+
media_data: {};
|
|
124
|
+
txt_data: {};
|
|
125
|
+
file_data: {};
|
|
126
|
+
baidu_data: {};
|
|
127
|
+
ali_data: {};
|
|
128
|
+
};
|
|
129
|
+
type SuccessFileInfo = {
|
|
130
|
+
start: number;
|
|
131
|
+
end: number;
|
|
132
|
+
size: number;
|
|
133
|
+
file: string;
|
|
134
|
+
};
|
|
135
|
+
type VideoMetaType = {
|
|
136
|
+
duration: number;
|
|
137
|
+
audio_codec: string;
|
|
138
|
+
audio_framerate: number;
|
|
139
|
+
audio_bitrate: number;
|
|
140
|
+
video_codec: string;
|
|
141
|
+
video_bitrate: number;
|
|
142
|
+
video_framerate: number;
|
|
143
|
+
video_width: number;
|
|
144
|
+
video_height: number;
|
|
145
|
+
};
|
|
146
|
+
export type MediaGrouperData = {
|
|
147
|
+
parts: {
|
|
148
|
+
file: string;
|
|
149
|
+
path: string;
|
|
150
|
+
size: number;
|
|
151
|
+
md5: string;
|
|
152
|
+
start: number;
|
|
153
|
+
end: number;
|
|
154
|
+
md4?: string;
|
|
155
|
+
sha1?: string;
|
|
156
|
+
}[];
|
|
157
|
+
meta: VideoMetaType;
|
|
158
|
+
m3u8: SuccessFileInfo;
|
|
159
|
+
subtitles: VideoSubtitleListType;
|
|
160
|
+
thumbnails?: VideoThumbnailsInfoType;
|
|
161
|
+
};
|
|
162
|
+
type ProgressData = Record<UploadProgressStep, {
|
|
163
|
+
weight: number;
|
|
164
|
+
percent: number;
|
|
165
|
+
}>;
|
|
166
|
+
export type RecordFolderInfo = {
|
|
167
|
+
record_id?: number;
|
|
168
|
+
[HostType.ALI]?: string;
|
|
169
|
+
[HostType.BAIDU]?: string;
|
|
170
|
+
};
|
|
171
|
+
export type MediaTrackQualityInfo = {
|
|
172
|
+
codec: string;
|
|
173
|
+
codec_name: string;
|
|
174
|
+
channels: number;
|
|
175
|
+
language: string;
|
|
176
|
+
order: number;
|
|
177
|
+
m3u8: M3U8Manifest;
|
|
178
|
+
m3u8_path: string;
|
|
179
|
+
bandwidth: number;
|
|
180
|
+
average_bandwidth: number;
|
|
181
|
+
};
|
|
182
|
+
export type AudioTrackItem = {
|
|
183
|
+
high?: MediaTrackQualityInfo;
|
|
184
|
+
adapt: MediaTrackQualityInfo;
|
|
185
|
+
};
|
|
186
|
+
export type VideoTrackItem = {
|
|
187
|
+
m3u8: M3U8Manifest;
|
|
188
|
+
m3u8_path: string;
|
|
189
|
+
bandwidth: number;
|
|
190
|
+
average_bandwidth: number;
|
|
191
|
+
codec: string;
|
|
192
|
+
codec_name: string;
|
|
193
|
+
width: number;
|
|
194
|
+
height: number;
|
|
195
|
+
bitdepth: number;
|
|
196
|
+
framerate: number;
|
|
197
|
+
bitrate: number;
|
|
198
|
+
label: string;
|
|
199
|
+
};
|
|
200
|
+
export type MediaThumbnailInfo = {
|
|
201
|
+
row: number;
|
|
202
|
+
col: number;
|
|
203
|
+
width: number;
|
|
204
|
+
height: number;
|
|
205
|
+
tile_list: {
|
|
206
|
+
file: string;
|
|
207
|
+
file_path: string;
|
|
208
|
+
size: number;
|
|
209
|
+
}[];
|
|
210
|
+
sprite_list: {
|
|
211
|
+
file: string;
|
|
212
|
+
st: number;
|
|
213
|
+
et: number;
|
|
214
|
+
x: number;
|
|
215
|
+
y: number;
|
|
216
|
+
w: number;
|
|
217
|
+
h: number;
|
|
218
|
+
}[];
|
|
219
|
+
};
|
|
220
|
+
export type FileDataField = {
|
|
221
|
+
size: number;
|
|
222
|
+
head: string;
|
|
223
|
+
parts: FilePartItem[];
|
|
224
|
+
};
|
|
225
|
+
export type MediaDataField = {
|
|
226
|
+
video_tracks: VideoTrackItem[] | null;
|
|
227
|
+
audio_tracks: AudioTrackItem[] | null;
|
|
228
|
+
text_tracks: TextInfo[] | null;
|
|
229
|
+
thumbnail_info: MediaThumbnailInfo | null;
|
|
230
|
+
cover_list: {
|
|
231
|
+
file: string;
|
|
232
|
+
file_path: string;
|
|
233
|
+
size: number;
|
|
234
|
+
width: number;
|
|
235
|
+
height: number;
|
|
236
|
+
start_time: number;
|
|
237
|
+
end_time: number;
|
|
238
|
+
}[];
|
|
239
|
+
media_group: MediaGroupData;
|
|
240
|
+
};
|
|
241
|
+
type GroupFileInfo = {
|
|
242
|
+
file: string;
|
|
243
|
+
size: number;
|
|
244
|
+
start: number;
|
|
245
|
+
end: number;
|
|
246
|
+
hash?: string;
|
|
247
|
+
};
|
|
248
|
+
export type MediaGroupQualityAudioItem = {
|
|
249
|
+
average_band: number;
|
|
250
|
+
band: number;
|
|
251
|
+
channels: number;
|
|
252
|
+
codec: string;
|
|
253
|
+
codec_name: string;
|
|
254
|
+
language: string;
|
|
255
|
+
order: number;
|
|
256
|
+
} & GroupFileInfo;
|
|
257
|
+
export type MediaGroupAudioItem = MediaGroupQualityAudioItem & {
|
|
258
|
+
high?: MediaGroupQualityAudioItem;
|
|
259
|
+
};
|
|
260
|
+
export type MediaGroupThumbnailInfo = {
|
|
261
|
+
row: number;
|
|
262
|
+
col: number;
|
|
263
|
+
width: number;
|
|
264
|
+
height: number;
|
|
265
|
+
} & GroupFileInfo;
|
|
266
|
+
export type MediaGroupCoverInfo = {
|
|
267
|
+
width: number;
|
|
268
|
+
height: number;
|
|
269
|
+
start_time: number;
|
|
270
|
+
} & GroupFileInfo;
|
|
271
|
+
export type MediaGroupVideoItem = {
|
|
272
|
+
label: string;
|
|
273
|
+
average_band: number;
|
|
274
|
+
band: number;
|
|
275
|
+
codec: string;
|
|
276
|
+
codec_name: string;
|
|
277
|
+
framerate: number;
|
|
278
|
+
bitdepth: number;
|
|
279
|
+
width: number;
|
|
280
|
+
height: number;
|
|
281
|
+
} & GroupFileInfo;
|
|
282
|
+
export type FilePartItem = {
|
|
283
|
+
start: number;
|
|
284
|
+
end: number;
|
|
285
|
+
size: number;
|
|
286
|
+
file: string;
|
|
287
|
+
path: string;
|
|
288
|
+
index?: number;
|
|
289
|
+
md4?: string;
|
|
290
|
+
md5?: string;
|
|
291
|
+
sha1?: string;
|
|
292
|
+
};
|
|
293
|
+
export type MediaGroupData = {
|
|
294
|
+
video_meta: ManifestVideoMetaInfo;
|
|
295
|
+
audio_meta: ManifestAudioMetaInfo;
|
|
296
|
+
audios: MediaGroupAudioItem[];
|
|
297
|
+
videos: MediaGroupVideoItem[];
|
|
298
|
+
texts: ManifestTextItem[];
|
|
299
|
+
thumbnail: MediaGroupThumbnailInfo;
|
|
300
|
+
cover: MediaGroupCoverInfo;
|
|
301
|
+
parts: FilePartItem[];
|
|
302
|
+
};
|
|
303
|
+
export type VideoSubtitleItemType = {
|
|
304
|
+
file: string;
|
|
305
|
+
title: string;
|
|
306
|
+
lang: string;
|
|
307
|
+
start: number;
|
|
308
|
+
end: number;
|
|
309
|
+
size: number;
|
|
310
|
+
type: string;
|
|
311
|
+
source: null | {
|
|
312
|
+
file: string;
|
|
313
|
+
size: number;
|
|
314
|
+
start: number;
|
|
315
|
+
end: number;
|
|
316
|
+
type: string;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
export type VideoSubtitleListType = VideoSubtitleItemType[];
|
|
320
|
+
export type VideoThumbnailsInfoType = {
|
|
321
|
+
file: string;
|
|
322
|
+
row: number;
|
|
323
|
+
col: number;
|
|
324
|
+
duration: number;
|
|
325
|
+
width: number;
|
|
326
|
+
height: number;
|
|
327
|
+
start: number;
|
|
328
|
+
end: number;
|
|
329
|
+
size: number;
|
|
330
|
+
};
|
|
331
|
+
export type AudioTrackData = {
|
|
332
|
+
adapt: {
|
|
333
|
+
need: boolean;
|
|
334
|
+
codec: string;
|
|
335
|
+
channels: number;
|
|
336
|
+
need_transcode: boolean;
|
|
337
|
+
weight: number;
|
|
338
|
+
info?: AudioTrackInfo;
|
|
339
|
+
};
|
|
340
|
+
high: {
|
|
341
|
+
need: boolean;
|
|
342
|
+
codec: string;
|
|
343
|
+
channels: number;
|
|
344
|
+
need_transcode: boolean;
|
|
345
|
+
weight: number;
|
|
346
|
+
info?: AudioTrackInfo;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
export type TextTrackData = {
|
|
350
|
+
adapt: {
|
|
351
|
+
need: boolean;
|
|
352
|
+
codec: string;
|
|
353
|
+
weight: number;
|
|
354
|
+
info?: TextTrackInfo;
|
|
355
|
+
};
|
|
356
|
+
high: {
|
|
357
|
+
need: boolean;
|
|
358
|
+
codec: string;
|
|
359
|
+
weight: number;
|
|
360
|
+
info?: TextTrackInfo;
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
export type BuiltinTextFieldData = {
|
|
364
|
+
lang: string;
|
|
365
|
+
title: string;
|
|
366
|
+
path: string;
|
|
367
|
+
};
|
|
368
|
+
export type BuiltinTextTrackData = {
|
|
369
|
+
lang: string;
|
|
370
|
+
title: string;
|
|
371
|
+
weight: number;
|
|
372
|
+
index: number;
|
|
373
|
+
info?: TextInfo;
|
|
374
|
+
};
|
|
375
|
+
export type ExternalTextTrackData = BuiltinTextTrackData & {
|
|
376
|
+
path: string;
|
|
377
|
+
};
|
|
378
|
+
export type PrepareVideoTrackInfo = {
|
|
379
|
+
need_transcode: boolean;
|
|
380
|
+
codec: string;
|
|
381
|
+
label: string;
|
|
382
|
+
width: number;
|
|
383
|
+
height: number;
|
|
384
|
+
weight: number;
|
|
385
|
+
info?: VideoTrackInfo;
|
|
386
|
+
};
|
|
387
|
+
export type TxtDataField = {
|
|
388
|
+
pages: number;
|
|
389
|
+
pad: number;
|
|
390
|
+
map: {
|
|
391
|
+
file: string;
|
|
392
|
+
start: number;
|
|
393
|
+
end: number;
|
|
394
|
+
};
|
|
395
|
+
parts: FilePartItem[];
|
|
396
|
+
};
|
|
397
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,o,a){var d,p=arguments.length,_=p<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)_=Reflect.decorate(e,t,o,a);else for(var l=e.length-1;l>=0;l--)(d=e[l])&&(_=(p<3?d(_):p>3?d(t,o,_):d(t,o))||_);return p>3&&_&&Object.defineProperty(t,o,_),_},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getUploadResetFields=exports.UploadFile=void 0;const typeorm_1=require("typeorm"),types_1=require("@soga/types");let UploadFile=class{id;root_id;root_status;space_id;space_name;is_folder;task_id;is_affix;is_paused;config;can_stop;stop_checker;uid;aid;file_total;file_successed;encode_status;upload_status;baidu_host_id;ali_host_id;pid;type;ftype;path;filename;title;size;local_birthtime;local_ctime;local_mtime;task_record_id;record_folder_info;output_root;external_texts;progress;percent;error;prepare_data;media_data;txt_data;file_data;baidu_data;ali_data;order;updated_at;created_at};exports.UploadFile=UploadFile,__decorate([(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],UploadFile.prototype,"id",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({nullable:!0}),__metadata("design:type",Number)],UploadFile.prototype,"root_id",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RootStatus,default:types_1.RootStatus.NULL}),__metadata("design:type",Number)],UploadFile.prototype,"root_status",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],UploadFile.prototype,"space_id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],UploadFile.prototype,"space_name",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)(),__metadata("design:type",Boolean)],UploadFile.prototype,"is_folder",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"task_id",void 0),__decorate([(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],UploadFile.prototype,"is_affix",void 0),__decorate([(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],UploadFile.prototype,"is_paused",void 0),__decorate([(0,typeorm_1.Column)("json",{default:"{}"}),__metadata("design:type",Object)],UploadFile.prototype,"config",void 0),__decorate([(0,typeorm_1.Column)({default:!0}),__metadata("design:type",Boolean)],UploadFile.prototype,"can_stop",void 0),__decorate([(0,typeorm_1.Column)({type:"json",default:JSON.stringify({can_stop:!0,message:"",code:0})}),__metadata("design:type",Object)],UploadFile.prototype,"stop_checker",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"uid",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"aid",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"file_total",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"file_successed",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.EncodeStatus,default:types_1.EncodeStatus.NULL}),__metadata("design:type",Number)],UploadFile.prototype,"encode_status",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.UploadStatus,default:types_1.UploadStatus.NULL}),__metadata("design:type",Number)],UploadFile.prototype,"upload_status",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"baidu_host_id",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"ali_host_id",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"pid",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RecordType}),__metadata("design:type",Number)],UploadFile.prototype,"type",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RecordFtype,default:types_1.RecordFtype.NONE}),__metadata("design:type",Number)],UploadFile.prototype,"ftype",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],UploadFile.prototype,"path",void 0),__decorate([(0,typeorm_1.Column)({default:""}),__metadata("design:type",String)],UploadFile.prototype,"filename",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],UploadFile.prototype,"title",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"size",void 0),__decorate([(0,typeorm_1.Column)({default:()=>Date.now()}),__metadata("design:type",Number)],UploadFile.prototype,"local_birthtime",void 0),__decorate([(0,typeorm_1.Column)({default:()=>Date.now()}),__metadata("design:type",Number)],UploadFile.prototype,"local_ctime",void 0),__decorate([(0,typeorm_1.Column)({default:()=>Date.now()}),__metadata("design:type",Number)],UploadFile.prototype,"local_mtime",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"task_record_id",void 0),__decorate([(0,typeorm_1.Column)({type:"json",nullable:!0}),__metadata("design:type",Object)],UploadFile.prototype,"record_folder_info",void 0),__decorate([(0,typeorm_1.Column)({default:""}),__metadata("design:type",String)],UploadFile.prototype,"output_root",void 0),__decorate([(0,typeorm_1.Column)("json",{default:"[]"}),__metadata("design:type",Array)],UploadFile.prototype,"external_texts",void 0),__decorate([(0,typeorm_1.Column)({type:"json",nullable:!0}),__metadata("design:type",Object)],UploadFile.prototype,"progress",void 0),__decorate([(0,typeorm_1.Column)({default:0,type:"decimal"}),__metadata("design:type",Number)],UploadFile.prototype,"percent",void 0),__decorate([(0,typeorm_1.Column)({type:"json",default:"{}"}),__metadata("design:type",Object)],UploadFile.prototype,"error",void 0),__decorate([(0,typeorm_1.Column)({type:"json",nullable:!0}),__metadata("design:type",Object)],UploadFile.prototype,"prepare_data",void 0),__decorate([(0,typeorm_1.Column)({type:"json",nullable:!0}),(0,typeorm_1.Column)({type:"json",default:"{}"}),__metadata("design:type",Object)],UploadFile.prototype,"media_data",void 0),__decorate([(0,typeorm_1.Column)({type:"json",default:"{}"}),__metadata("design:type",Object)],UploadFile.prototype,"txt_data",void 0),__decorate([(0,typeorm_1.Column)({type:"json",default:"{}"}),__metadata("design:type",Object)],UploadFile.prototype,"file_data",void 0),__decorate([(0,typeorm_1.Column)({type:"json",default:"{}"}),__metadata("design:type",Object)],UploadFile.prototype,"baidu_data",void 0),__decorate([(0,typeorm_1.Column)({type:"json",default:"{}"}),__metadata("design:type",Object)],UploadFile.prototype,"ali_data",void 0),__decorate([(0,typeorm_1.Column)({default:0}),__metadata("design:type",Number)],UploadFile.prototype,"order",void 0),__decorate([(0,typeorm_1.UpdateDateColumn)(),__metadata("design:type",Date)],UploadFile.prototype,"updated_at",void 0),__decorate([(0,typeorm_1.CreateDateColumn)(),__metadata("design:type",Date)],UploadFile.prototype,"created_at",void 0),exports.UploadFile=UploadFile=__decorate([(0,typeorm_1.Index)(["uid","is_folder"]),(0,typeorm_1.Entity)()],UploadFile);const getUploadResetFields=()=>({error:{},is_paused:!1,output_root:"",encode_status:types_1.EncodeStatus.NULL,upload_status:types_1.UploadStatus.NULL,progress:null,percent:0,prepare_data:{},media_data:{},txt_data:{},file_data:{},baidu_data:{},ali_data:{}});exports.getUploadResetFields=getUploadResetFields;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RecordFtype, RecordType } from '@soga/types';
|
|
2
|
+
export declare class UploadSuccess {
|
|
3
|
+
id: number;
|
|
4
|
+
space_id: number;
|
|
5
|
+
space_name: string;
|
|
6
|
+
uid: number;
|
|
7
|
+
title: string;
|
|
8
|
+
path: string;
|
|
9
|
+
cloud_id: number;
|
|
10
|
+
type: RecordType;
|
|
11
|
+
ftype: RecordFtype;
|
|
12
|
+
updated_at: Date;
|
|
13
|
+
created_at: Date;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,o,a){var p,d=arguments.length,r=d<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,a);else for(var _=e.length-1;_>=0;_--)(p=e[_])&&(r=(d<3?p(r):d>3?p(t,o,r):p(t,o))||r);return d>3&&r&&Object.defineProperty(t,o,r),r},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.UploadSuccess=void 0;const types_1=require("@soga/types"),typeorm_1=require("typeorm");let UploadSuccess=class{id;space_id;space_name;uid;title;path;cloud_id;type;ftype;updated_at;created_at};exports.UploadSuccess=UploadSuccess,__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],UploadSuccess.prototype,"id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],UploadSuccess.prototype,"space_id",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],UploadSuccess.prototype,"space_name",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],UploadSuccess.prototype,"uid",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],UploadSuccess.prototype,"title",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",String)],UploadSuccess.prototype,"path",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],UploadSuccess.prototype,"cloud_id",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RecordType}),__metadata("design:type",Number)],UploadSuccess.prototype,"type",void 0),__decorate([(0,typeorm_1.Column)({type:"simple-enum",enum:types_1.RecordFtype}),__metadata("design:type",Number)],UploadSuccess.prototype,"ftype",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Date)],UploadSuccess.prototype,"updated_at",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Date)],UploadSuccess.prototype,"created_at",void 0),exports.UploadSuccess=UploadSuccess=__decorate([(0,typeorm_1.Entity)()],UploadSuccess);
|
package/dist/user.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class User {
|
|
2
|
+
id: number;
|
|
3
|
+
uid: number;
|
|
4
|
+
is_current: boolean;
|
|
5
|
+
username: string;
|
|
6
|
+
upload_paused: boolean;
|
|
7
|
+
download_paused: boolean;
|
|
8
|
+
cache_paused: boolean;
|
|
9
|
+
access_token: string;
|
|
10
|
+
access_expired: number;
|
|
11
|
+
updated_at: Date;
|
|
12
|
+
created_at: Date;
|
|
13
|
+
}
|
package/dist/user.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(e,t,o,a){var r,d=arguments.length,_=d<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)_=Reflect.decorate(e,t,o,a);else for(var p=e.length-1;p>=0;p--)(r=e[p])&&(_=(d<3?r(_):d>3?r(t,o,_):r(t,o))||_);return d>3&&_&&Object.defineProperty(t,o,_),_},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.User=void 0;const typeorm_1=require("typeorm");let User=class{id;uid;is_current;username;upload_paused;download_paused;cache_paused;access_token;access_expired;updated_at;created_at};exports.User=User,__decorate([(0,typeorm_1.PrimaryGeneratedColumn)(),__metadata("design:type",Number)],User.prototype,"id",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)(),__metadata("design:type",Number)],User.prototype,"uid",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],User.prototype,"is_current",void 0),__decorate([(0,typeorm_1.Column)({nullable:!0}),__metadata("design:type",String)],User.prototype,"username",void 0),__decorate([(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],User.prototype,"upload_paused",void 0),__decorate([(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],User.prototype,"download_paused",void 0),__decorate([(0,typeorm_1.Column)({default:!1}),__metadata("design:type",Boolean)],User.prototype,"cache_paused",void 0),__decorate([(0,typeorm_1.Index)(),(0,typeorm_1.Column)(),__metadata("design:type",String)],User.prototype,"access_token",void 0),__decorate([(0,typeorm_1.Column)(),__metadata("design:type",Number)],User.prototype,"access_expired",void 0),__decorate([(0,typeorm_1.UpdateDateColumn)(),__metadata("design:type",Date)],User.prototype,"updated_at",void 0),__decorate([(0,typeorm_1.CreateDateColumn)(),__metadata("design:type",Date)],User.prototype,"created_at",void 0),exports.User=User=__decorate([(0,typeorm_1.Entity)()],User);
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@soga/entities",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "",
|
|
8
|
+
"main": "dist/main.js",
|
|
9
|
+
"types": "dist/main.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "rimraf dist && tsc && ts-node ./scripts/minify",
|
|
15
|
+
"minify": "ts-node ./scripts/minify",
|
|
16
|
+
"demo": "ts-node ./demo/demo.ts",
|
|
17
|
+
"test": "jest",
|
|
18
|
+
"dev": "ts-node ./src/main.ts",
|
|
19
|
+
"lint": "eslint . --ext .ts",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/glob": "^8.1.0",
|
|
24
|
+
"@types/jest": "^29.5.4",
|
|
25
|
+
"@types/node": "^20.8.7",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
|
27
|
+
"@typescript-eslint/parser": "^6.4.1",
|
|
28
|
+
"eslint": "^8.47.0",
|
|
29
|
+
"eslint-config-prettier": "^9.0.0",
|
|
30
|
+
"eslint-plugin-jest": "^27.2.3",
|
|
31
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
32
|
+
"glob": "^10.3.3",
|
|
33
|
+
"jest": "^29.6.3",
|
|
34
|
+
"prettier": "^3.0.2",
|
|
35
|
+
"terser": "^5.19.2",
|
|
36
|
+
"ts-jest": "^29.1.1",
|
|
37
|
+
"ts-node": "^10.9.1",
|
|
38
|
+
"typeorm": "^0.3.20",
|
|
39
|
+
"typescript": "^5.1.6"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [],
|
|
42
|
+
"author": "",
|
|
43
|
+
"license": "ISC",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@soga/types": "^0.0.57"
|
|
46
|
+
}
|
|
47
|
+
}
|