@soga/types 0.1.13 → 0.1.24

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/host.d.ts CHANGED
@@ -6,12 +6,11 @@ export declare enum CloudType {
6
6
  BAIDU = 1,
7
7
  ALI = 2
8
8
  }
9
- export type HostListItem = {
9
+ interface CommonHostDetail {
10
10
  id: number;
11
11
  access_token: string;
12
12
  account_level: string;
13
13
  account_name: string;
14
- api_info: string;
15
14
  avatar_url: string;
16
15
  cloud_type: CloudType;
17
16
  created_at: string;
@@ -23,4 +22,20 @@ export type HostListItem = {
23
22
  remark: string;
24
23
  uk: string;
25
24
  is_save: number;
26
- };
25
+ }
26
+ export interface BaiduHostDetail extends CommonHostDetail {
27
+ cloud_type: CloudType.BAIDU;
28
+ api_info: null;
29
+ }
30
+ export interface AliHostDetail extends CommonHostDetail {
31
+ cloud_type: CloudType.ALI;
32
+ api_info: {
33
+ drive_id: string;
34
+ dpan_file_id: string;
35
+ cache_file_id: string;
36
+ space_file_id: string;
37
+ };
38
+ }
39
+ export type HostDetail = BaiduHostDetail | AliHostDetail;
40
+ export type HostListItem = HostDetail;
41
+ export {};
package/dist/member.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  export type MemberInfo = {
2
2
  id: number;
3
3
  name: string;
4
+ phone: string;
4
5
  email: string;
5
6
  nick: string;
6
7
  avatar: string;
8
+ invite_code: string;
9
+ points: number;
10
+ private_space_id: number;
7
11
  created_at: string;
8
12
  updated_at: string;
9
- private_space_id: number;
10
13
  };
@@ -45,11 +45,11 @@ export type ManifestImgType = {
45
45
  parts: string[];
46
46
  };
47
47
  export type ManifestMetaType = {
48
- birthtime: number;
48
+ btime: number;
49
49
  ctime: number;
50
+ mtime: number;
50
51
  filename: string;
51
52
  filesize: number;
52
- mtime: number;
53
53
  host_size: number;
54
54
  preview_size: number;
55
55
  source_size: number;
package/dist/record.d.ts CHANGED
@@ -6,7 +6,8 @@ export declare enum RecordType {
6
6
  IMAGE = 3,
7
7
  TXT = 4,
8
8
  TEXT = 5,
9
- OTHER = 6
9
+ OTHER = 6,
10
+ AFFIX = 127
10
11
  }
11
12
  export declare enum RecordFtype {
12
13
  NONE = 0,
package/dist/record.js CHANGED
@@ -10,6 +10,7 @@ var RecordType;
10
10
  RecordType[RecordType["TXT"] = 4] = "TXT";
11
11
  RecordType[RecordType["TEXT"] = 5] = "TEXT";
12
12
  RecordType[RecordType["OTHER"] = 6] = "OTHER";
13
+ RecordType[RecordType["AFFIX"] = 127] = "AFFIX";
13
14
  })(RecordType || (exports.RecordType = RecordType = {}));
14
15
  var RecordFtype;
15
16
  (function (RecordFtype) {
@@ -1,3 +1,4 @@
1
+ import { HostType } from './host';
1
2
  import { ManifestAudioMetaInfo, ManifestTextItem, ManifestVideoMetaInfo } from './record-manifest';
2
3
  export declare enum UploadProcessStep {
3
4
  prepare = "PREPARE",
@@ -10,18 +11,19 @@ export declare enum UploadProcessStep {
10
11
  transcode_source = "TRANSCODE_SOURCE",
11
12
  transcode_txt = "TRANSCODE_TXT",
12
13
  transcode_img = "TRANSCODE_IMG",
14
+ transcode_affix = "TRANSCODE_AFFIX",
13
15
  group_media = "GROUP_MEDIA",
14
16
  upload_baidu = "UPLOAD_BAIDU",
15
17
  upload_ali = "UPLOAD_ALI",
16
18
  end = "END"
17
19
  }
18
- export type UploadPrepareData = Record<UploadProcessStep, {
20
+ export type UploadPrepareData = Partial<Record<UploadProcessStep, {
19
21
  weight: number;
20
22
  percent: number;
21
- }>;
23
+ }>>;
22
24
  export type UploadPrepareOptions = {
23
- keep_preview: boolean;
24
- keep_source: boolean;
25
+ keep_preview?: boolean;
26
+ keep_source?: boolean;
25
27
  };
26
28
  export type PrepareResult = {
27
29
  options: UploadPrepareOptions;
@@ -91,6 +93,20 @@ export type MediaGroupData = {
91
93
  export type SourceGroupData = {
92
94
  size: number;
93
95
  head: string;
96
+ filename: string;
97
+ btime: number;
98
+ ctime: number;
99
+ mtime: number;
100
+ parts: FilePartItem[];
101
+ };
102
+ export type AffixItemData = {
103
+ filename: string;
104
+ uuid: string;
105
+ size: number;
106
+ head: string;
107
+ btime: number;
108
+ ctime: number;
109
+ mtime: number;
94
110
  parts: FilePartItem[];
95
111
  };
96
112
  export type TxtGroupData = {
@@ -107,12 +123,24 @@ export type EncoderResult = {
107
123
  source?: SourceGroupData;
108
124
  media?: MediaGroupData;
109
125
  };
110
- export type WorkerEncodePrepare = {
111
- id: number;
112
- type: 'prepare';
113
- data: PrepareResult;
126
+ export type ImgGroupData = {
127
+ meta: {
128
+ width: number;
129
+ height: number;
130
+ size: number;
131
+ t_width: number;
132
+ t_height: number;
133
+ t_size: number;
134
+ };
135
+ parts: FilePartItem[];
114
136
  };
115
- export type WorkerPercent = {
137
+ export type EncodeResult = {
138
+ source?: SourceGroupData;
139
+ media?: MediaGroupData;
140
+ txt?: TxtGroupData;
141
+ img?: ImgGroupData;
142
+ };
143
+ export type EncodeWorkerPercent = {
116
144
  id: number;
117
145
  type: 'percent';
118
146
  data: {
@@ -120,6 +148,15 @@ export type WorkerPercent = {
120
148
  percent: number;
121
149
  };
122
150
  };
151
+ export type UploadWorkerPercent = {
152
+ id: number;
153
+ type: 'percent';
154
+ data: {
155
+ part_id: number;
156
+ host_type: HostType;
157
+ percent: number;
158
+ };
159
+ };
123
160
  export type WorkerError = {
124
161
  id: number;
125
162
  type: 'error';
@@ -130,21 +167,6 @@ export type WorkerError = {
130
167
  stack?: string;
131
168
  };
132
169
  };
133
- export type ImgGroupData = {
134
- meta: {
135
- width: number;
136
- height: number;
137
- size: number;
138
- t_width: number;
139
- t_height: number;
140
- t_size: number;
141
- };
142
- parts: FilePartItem[];
143
- };
144
- export type EncodeResult = {
145
- source?: SourceGroupData;
146
- media?: MediaGroupData;
147
- txt?: TxtGroupData;
148
- img?: ImgGroupData;
149
- };
170
+ export type EncodeWorkerMessage = EncodeWorkerPercent | WorkerError;
171
+ export type UploadWorkerMessage = UploadWorkerPercent | WorkerError;
150
172
  export {};
@@ -13,6 +13,7 @@ var UploadProcessStep;
13
13
  UploadProcessStep["transcode_source"] = "TRANSCODE_SOURCE";
14
14
  UploadProcessStep["transcode_txt"] = "TRANSCODE_TXT";
15
15
  UploadProcessStep["transcode_img"] = "TRANSCODE_IMG";
16
+ UploadProcessStep["transcode_affix"] = "TRANSCODE_AFFIX";
16
17
  UploadProcessStep["group_media"] = "GROUP_MEDIA";
17
18
  UploadProcessStep["upload_baidu"] = "UPLOAD_BAIDU";
18
19
  UploadProcessStep["upload_ali"] = "UPLOAD_ALI";
package/dist/upload.d.ts CHANGED
@@ -1,130 +1,74 @@
1
- import { RecordType } from './record';
2
- export declare enum UploadFileStage {
3
- ALL = 0,
4
- NULL = 1,
5
- ENCODE_READY = 2,
6
- ENCODING = 3,
7
- ENCODE_PAUSED = 4,
8
- UPLOAD_READY = 5,
9
- UPLOADING = 6,
10
- UPLOAD_PAUSED = 7,
11
- SUCCESS = 8,
12
- ERROR = 9
13
- }
1
+ import { HostType } from './host';
2
+ import { CloudInfoField, RecordFolderConfig, RecordType } from './record';
3
+ import { AffixItemData, ImgGroupData, MediaGroupData, SourceGroupData, TxtGroupData, UploadPrepareData } from './upload-process';
14
4
  export declare enum EncodeStatus {
15
- NULL = 0,
5
+ NULL,
16
6
  PROCESS = 1,
17
7
  SUCCESS = 2,
18
8
  ERROR = 4
19
9
  }
20
10
  export declare enum UploadStatus {
21
- NULL = 0,
11
+ NULL,
22
12
  PROCESS = 1,
23
- SUCCESS = 2,
13
+ PAUSED = 2,
14
+ SUCCESS = 3,
24
15
  ERROR = 4
25
16
  }
26
- export declare enum RootStatus {
27
- NULL = 0,
17
+ export declare enum GroupStatus {
18
+ NULL,
28
19
  PROCESS = 1,
29
20
  SUCCESS = 2,
30
21
  ERROR = 4
31
22
  }
32
- export declare enum UploadStep {
33
- NULL = 0,
34
- PROCESS = 1,
35
- PRESUCCESS = 2,
36
- SUCCESS = 3,
37
- ERROR = 4
38
- }
39
- export declare enum UploadTaskStage {
40
- ALL = 0,
41
- NULL = 1,
42
- READY = 2,
43
- PROCESS = 3,
44
- SUCCESS = 8,
45
- ERROR = 9
46
- }
47
- export type UploadControlConfig = {
48
- id: number;
49
- uid: number;
50
- encode_id: number;
51
- upload_id: number;
52
- encoder_manual_stop: boolean;
53
- uploader_manual_stop: boolean;
54
- created_at: string;
55
- updated_at: string;
23
+ export type UploadInputItem = {
24
+ filename: string;
25
+ filepath: string;
26
+ filesize: number;
27
+ local_btime: number;
28
+ local_ctime: number;
29
+ local_mtime: number;
56
30
  };
57
- export type UploadTaskItem = {
58
- aid: number;
59
- created_at: string;
60
- id: number;
61
- paths: {
62
- name: string;
63
- path: string;
64
- is_folder: boolean;
65
- type: RecordType;
66
- }[];
67
- record_id: number;
68
- record_navs: {
69
- id: number;
70
- title: string;
71
- }[];
72
- space_id: number;
73
- space_name: string;
74
- stage: UploadTaskStage;
75
- uid: number;
31
+ export type EncodedData = {
32
+ media?: MediaGroupData;
33
+ txt?: TxtGroupData;
34
+ img?: ImgGroupData;
35
+ source?: SourceGroupData;
36
+ affix?: AffixItemData[];
76
37
  };
38
+ export type UploadedData = Record<HostType, Record<string, object>>;
77
39
  export type UploadFileItem = {
78
40
  id: number;
79
- is_paused: boolean;
80
- file_total: number;
81
- file_successed: number;
82
- encode_status: EncodeStatus;
83
- upload_status: UploadStatus;
84
- root_status: RootStatus;
85
- is_folder: boolean;
86
- keep_source: boolean;
41
+ group_id: number;
42
+ group_status: GroupStatus;
43
+ space_id: number;
44
+ space_name: string;
45
+ task_id: string;
46
+ handle_paused: boolean;
47
+ config: RecordFolderConfig;
48
+ can_stop: boolean;
87
49
  uid: number;
88
50
  aid: number;
89
- task_id: number;
90
- stage: UploadFileStage;
51
+ encode_status: EncodeStatus;
91
52
  baidu_host_id: number;
53
+ baidu_upload_status: UploadStatus;
92
54
  ali_host_id: number;
55
+ ali_upload_status: UploadStatus;
93
56
  pid: number;
94
57
  type: RecordType;
95
- path: string;
96
- filename: string;
97
- title: string;
98
- size: number;
99
- local_birthtime: number;
100
- local_ctime: number;
101
- percent: number;
102
- local_mtime: number;
58
+ inputs: UploadInputItem[];
103
59
  task_record_id: number;
104
- text_tracks: unknown;
105
- record_folder_info: unknown;
106
- output_root: string | null;
107
- encode_paused: boolean;
108
- upload_paused: boolean;
109
- external_texts: {
110
- lang: string;
111
- title: string;
112
- path: string;
113
- }[];
114
- progress: unknown;
115
- error: unknown;
116
- mediainfo: unknown;
117
- m3u8_info: unknown;
118
- media_thumbnailer: unknown;
119
- media_grouper: unknown;
120
- file_processor: unknown;
121
- baidu_data: unknown;
122
- ali_data: unknown;
60
+ cloud_info: CloudInfoField;
61
+ output_root: string;
62
+ external_texts: string[];
63
+ progress: UploadPrepareData;
64
+ percent: number;
65
+ encoded: EncodedData;
66
+ uploaded: UploadedData;
67
+ first_order: number;
68
+ second_order: number;
123
69
  updated_at: string;
124
70
  created_at: string;
125
- order: number;
126
- space_id: number;
127
- space_name: string;
71
+ is_paused: boolean;
128
72
  };
129
73
  export type UploadFileSuceessItem = {
130
74
  id: number;
package/dist/upload.js CHANGED
@@ -1,54 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UploadTaskStage = exports.UploadStep = exports.RootStatus = exports.UploadStatus = exports.EncodeStatus = exports.UploadFileStage = void 0;
4
- var UploadFileStage;
5
- (function (UploadFileStage) {
6
- UploadFileStage[UploadFileStage["ALL"] = 0] = "ALL";
7
- UploadFileStage[UploadFileStage["NULL"] = 1] = "NULL";
8
- UploadFileStage[UploadFileStage["ENCODE_READY"] = 2] = "ENCODE_READY";
9
- UploadFileStage[UploadFileStage["ENCODING"] = 3] = "ENCODING";
10
- UploadFileStage[UploadFileStage["ENCODE_PAUSED"] = 4] = "ENCODE_PAUSED";
11
- UploadFileStage[UploadFileStage["UPLOAD_READY"] = 5] = "UPLOAD_READY";
12
- UploadFileStage[UploadFileStage["UPLOADING"] = 6] = "UPLOADING";
13
- UploadFileStage[UploadFileStage["UPLOAD_PAUSED"] = 7] = "UPLOAD_PAUSED";
14
- UploadFileStage[UploadFileStage["SUCCESS"] = 8] = "SUCCESS";
15
- UploadFileStage[UploadFileStage["ERROR"] = 9] = "ERROR";
16
- })(UploadFileStage || (exports.UploadFileStage = UploadFileStage = {}));
3
+ exports.GroupStatus = exports.UploadStatus = exports.EncodeStatus = void 0;
17
4
  var EncodeStatus;
18
5
  (function (EncodeStatus) {
19
- EncodeStatus[EncodeStatus["NULL"] = 0] = "NULL";
6
+ EncodeStatus[EncodeStatus["NULL"] = null] = "NULL";
20
7
  EncodeStatus[EncodeStatus["PROCESS"] = 1] = "PROCESS";
21
8
  EncodeStatus[EncodeStatus["SUCCESS"] = 2] = "SUCCESS";
22
9
  EncodeStatus[EncodeStatus["ERROR"] = 4] = "ERROR";
23
10
  })(EncodeStatus || (exports.EncodeStatus = EncodeStatus = {}));
24
11
  var UploadStatus;
25
12
  (function (UploadStatus) {
26
- UploadStatus[UploadStatus["NULL"] = 0] = "NULL";
13
+ UploadStatus[UploadStatus["NULL"] = null] = "NULL";
27
14
  UploadStatus[UploadStatus["PROCESS"] = 1] = "PROCESS";
28
- UploadStatus[UploadStatus["SUCCESS"] = 2] = "SUCCESS";
15
+ UploadStatus[UploadStatus["PAUSED"] = 2] = "PAUSED";
16
+ UploadStatus[UploadStatus["SUCCESS"] = 3] = "SUCCESS";
29
17
  UploadStatus[UploadStatus["ERROR"] = 4] = "ERROR";
30
18
  })(UploadStatus || (exports.UploadStatus = UploadStatus = {}));
31
- var RootStatus;
32
- (function (RootStatus) {
33
- RootStatus[RootStatus["NULL"] = 0] = "NULL";
34
- RootStatus[RootStatus["PROCESS"] = 1] = "PROCESS";
35
- RootStatus[RootStatus["SUCCESS"] = 2] = "SUCCESS";
36
- RootStatus[RootStatus["ERROR"] = 4] = "ERROR";
37
- })(RootStatus || (exports.RootStatus = RootStatus = {}));
38
- var UploadStep;
39
- (function (UploadStep) {
40
- UploadStep[UploadStep["NULL"] = 0] = "NULL";
41
- UploadStep[UploadStep["PROCESS"] = 1] = "PROCESS";
42
- UploadStep[UploadStep["PRESUCCESS"] = 2] = "PRESUCCESS";
43
- UploadStep[UploadStep["SUCCESS"] = 3] = "SUCCESS";
44
- UploadStep[UploadStep["ERROR"] = 4] = "ERROR";
45
- })(UploadStep || (exports.UploadStep = UploadStep = {}));
46
- var UploadTaskStage;
47
- (function (UploadTaskStage) {
48
- UploadTaskStage[UploadTaskStage["ALL"] = 0] = "ALL";
49
- UploadTaskStage[UploadTaskStage["NULL"] = 1] = "NULL";
50
- UploadTaskStage[UploadTaskStage["READY"] = 2] = "READY";
51
- UploadTaskStage[UploadTaskStage["PROCESS"] = 3] = "PROCESS";
52
- UploadTaskStage[UploadTaskStage["SUCCESS"] = 8] = "SUCCESS";
53
- UploadTaskStage[UploadTaskStage["ERROR"] = 9] = "ERROR";
54
- })(UploadTaskStage || (exports.UploadTaskStage = UploadTaskStage = {}));
19
+ var GroupStatus;
20
+ (function (GroupStatus) {
21
+ GroupStatus[GroupStatus["NULL"] = null] = "NULL";
22
+ GroupStatus[GroupStatus["PROCESS"] = 1] = "PROCESS";
23
+ GroupStatus[GroupStatus["SUCCESS"] = 2] = "SUCCESS";
24
+ GroupStatus[GroupStatus["ERROR"] = 4] = "ERROR";
25
+ })(GroupStatus || (exports.GroupStatus = GroupStatus = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soga/types",
3
- "version": "0.1.13",
3
+ "version": "0.1.24",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -31,5 +31,5 @@
31
31
  "keywords": [],
32
32
  "author": "",
33
33
  "license": "ISC",
34
- "gitHead": "fd0b51d9ccc8001c61e746974666be04e72e5665"
34
+ "gitHead": "97c8d6fe761d40f44e885b5a2bd75d66419c62c9"
35
35
  }