@exode-team/kinescope.api 2.0.36 → 2.0.37

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.
@@ -11,16 +11,18 @@ export interface ProjectCreateRequest {
11
11
  }
12
12
 
13
13
  export interface ProjectCreateResponse {
14
- readonly id: string;
15
- readonly name: string;
16
- readonly folders: any[];
17
- readonly privacy_type: string;
18
- readonly privacy_domains: string[];
19
- readonly player_id: string;
20
- readonly favorite: boolean;
21
- readonly size: number;
22
- readonly items_count: number;
23
- readonly created_at: string;
24
- readonly updated_at: string | null;
25
- readonly encrypted: boolean;
14
+ readonly data: {
15
+ id: string;
16
+ name: string;
17
+ folders: any[];
18
+ privacy_type: string;
19
+ privacy_domains: string[];
20
+ player_id: string;
21
+ favorite: boolean;
22
+ size: number;
23
+ items_count: number;
24
+ created_at: string;
25
+ updated_at: string | null;
26
+ encrypted: boolean;
27
+ };
26
28
  }
@@ -3,5 +3,7 @@
3
3
  */
4
4
 
5
5
  export interface ProjectDeleteResponse {
6
- readonly projectId: string;
6
+ readonly data: {
7
+ success: boolean;
8
+ };
7
9
  }
@@ -7,17 +7,19 @@ export interface ProjectGetByIdRequest {
7
7
  }
8
8
 
9
9
  export interface ProjectGetByIdResponse {
10
- readonly id: string;
11
- readonly name: string;
12
- readonly created_at: string;
13
- readonly updated_at: string | null;
14
-
15
- folders: {
10
+ readonly data: {
16
11
  id: string;
17
12
  name: string;
18
- project_id: string;
19
13
  created_at: string;
20
14
  updated_at: string | null;
21
- deleted_at: string | null;
22
- }[];
15
+
16
+ folders: {
17
+ id: string;
18
+ name: string;
19
+ project_id: string;
20
+ created_at: string;
21
+ updated_at: string | null;
22
+ deleted_at: string | null;
23
+ }[];
24
+ };
23
25
  }
@@ -9,9 +9,11 @@ export interface ProjectUpdateRequest {
9
9
  }
10
10
 
11
11
  export interface ProjectUpdateResponse {
12
- readonly name: string;
13
- readonly privacy_type: string;
14
- readonly privacy_domains: string[];
15
- readonly apply_to_videos: boolean;
16
- readonly player_id: string;
12
+ readonly data: {
13
+ name: string;
14
+ privacy_type: string;
15
+ privacy_domains: string[];
16
+ apply_to_videos: boolean;
17
+ player_id: string;
18
+ };
17
19
  }
@@ -14,122 +14,118 @@ require('dotenv').config();
14
14
  const apiService = new ApiService(`${process.env.API_TOKEN}`);
15
15
 
16
16
  const createProject = await apiService.project.create({
17
- name: 'Мой тестовый проект',
17
+ name: 'Мой тестовый проект 2',
18
18
  privacy_type: 'custom',
19
19
  privacy_domains: [ 'exode.ru', 'staging.exode.ru' ],
20
- encrypted: true,
21
20
  });
22
21
 
23
22
  console.log('createProject', createProject);
24
23
  })();
25
24
 
26
- // (async () => {
27
- // const apiService = new ApiService(`${process.env.API_TOKEN}`);
28
- //
29
- // const getProject = await apiService.project.getMany({
30
- // per_page: 10,
31
- // page: 1,
32
- // });
33
- //
34
- // console.log('getProject', getProject);
35
- //
36
- // })();
37
-
38
- // (async () => {
39
- // const apiService = new ApiService(`${process.env.API_TOKEN}`);
40
- //
41
- // const getProjectById = await apiService.project.getById({
42
- // id: 'f95f15f3-f826-4af1-8641-cf5f8ce83231',
43
- // });
44
- //
45
- // console.log('getProjectById', getProjectById);
46
- // })();
47
- //
48
- // (async () => {
49
- // const apiService = new ApiService(`${process.env.API_TOKEN}`);
50
- //
51
- // const updateProject = await apiService.project.updateById(
52
- // 'f95f15f3-f826-4af1-8641-cf5f8ce83231',
53
- // {
54
- // name: 'new name of project',
55
- // privacy_type: 'custom',
56
- // privacy_domains: [ 'exode.ru', 'staging.exode.ru' ],
57
- // },
58
- // );
59
- //
60
- // console.log('updateProject', updateProject);
61
- // })();
62
- //
63
- // (async () => {
64
- // const apiService = new ApiService(`${process.env.API_TOKEN}`);
65
- //
66
- // const deleteProject = await apiService.project.deleteById(
67
- // 'f95f15f3-f826-4af1-8641-cf5f8ce83231',
68
- // );
69
- //
70
- // console.log('deleteProject', deleteProject);
71
- // })();
72
- //
73
- // (async () => {
74
- // const apiService = new ApiService(`${process.env.API_TOKEN}`);
75
- //
76
- // const getOverview = await apiService.analytics.getOverview({
77
- // from: '2020-08-30',
78
- // to: '2020-09-01',
79
- // group_time: 'day',
80
- // });
81
- //
82
- // console.log('getOverview', getOverview);
83
- // })();
84
- //
85
- // (async () => {
86
- // const apiService = new ApiService(`${process.env.API_TOKEN}`);
87
- //
88
- // const getCustom = await apiService.analytics.getCustom({
89
- // from: '2020-11-01T06:00:00Z',
90
- // to: '2020-11-01T06:00:00Z',
91
- // group: 'day',
92
- // group_entities: 'video_id',
93
- // fields: [ 'view', 'play' ],
94
- // });
95
- //
96
- // console.log('getCustom', getCustom);
97
- // })();
98
-
99
- // (async () => {
100
- // console.log(process.env.API_TOKEN);
101
- // const apiService = new ApiService(`${process.env.API_TOKEN}`);
102
- // const form = new FormData();
103
- //
104
- // form.append('file', fs.createReadStream('test.mp4'), {
105
- // filename: 'test.mp4',
106
- // contentType: 'video/mp4',
107
- // });
108
- //
109
- // const uploadVideo = await apiService.video.uploadVideoByFile(
110
- // fs.readFileSync('test.mp4'),
111
- // {
112
- // // 'X-Parent-ID': '8270802c-c632-403f-abe8-f26344088947',
113
- // 'X-Parent-ID': 'd875c211-0fa1-46eb-8596-4b1c1eeae56b',
114
- // 'X-Video-Title': 'Test video',
115
- // 'X-Video-Trim': JSON.stringify({ start: 1, length: 2 }),
116
- // ...form.getHeaders(),
117
- // },
118
- // );
119
- //
120
- // console.log('uploadVideo', uploadVideo.data);
121
- // })();
122
-
123
- // (async () => {
124
- // const apiService = new ApiService(`${process.env.API_TOKEN}`);
125
- //
126
- // const headers = {
127
- // 'X-Parent-ID': '8270802c-c632-403f-abe8-f26344088947',
128
- // 'X-Video-Title': 'testTwo',
129
- // 'X-Video-URL': 'https://www.youtube.com/watch?v=qzbtdclsJXw',
130
- // };
131
- //
132
- // const uploadVideo = await apiService.video.uploadVideoByUrl(headers);
133
- // console.log('uploadVideo', uploadVideo);
134
- //
135
- // })();
25
+ (async () => {
26
+ const apiService = new ApiService(`${process.env.API_TOKEN}`);
27
+
28
+ const getProject = await apiService.project.getMany({
29
+ per_page: 10,
30
+ page: 1,
31
+ });
32
+
33
+ console.log('getProject', getProject);
34
+
35
+ })();
36
+
37
+ (async () => {
38
+ const apiService = new ApiService(`${process.env.API_TOKEN}`);
39
+
40
+ const getProjectById = await apiService.project.getById({
41
+ id: 'f95f15f3-f826-4af1-8641-cf5f8ce83231',
42
+ });
43
+
44
+ console.log('getProjectById', getProjectById);
45
+ })();
46
+
47
+ (async () => {
48
+ const apiService = new ApiService(`${process.env.API_TOKEN}`);
49
+
50
+ const updateProject = await apiService.project.updateById(
51
+ 'f95f15f3-f826-4af1-8641-cf5f8ce83231',
52
+ {
53
+ name: 'new name of project',
54
+ privacy_type: 'custom',
55
+ privacy_domains: [ 'exode.ru', 'staging.exode.ru' ],
56
+ },
57
+ );
58
+
59
+ console.log('updateProject', updateProject);
60
+ })();
61
+
62
+ (async () => {
63
+ const apiService = new ApiService(`${process.env.API_TOKEN}`);
64
+
65
+ const deleteProject = await apiService.project.deleteById(
66
+ 'f95f15f3-f826-4af1-8641-cf5f8ce83231',
67
+ );
68
+
69
+ console.log('deleteProject', deleteProject);
70
+ })();
71
+
72
+ (async () => {
73
+ const apiService = new ApiService(`${process.env.API_TOKEN}`);
74
+
75
+ const getOverview = await apiService.analytics.getOverview({
76
+ from: '2020-08-30',
77
+ to: '2020-09-01',
78
+ group_time: 'day',
79
+ });
80
+
81
+ console.log('getOverview', getOverview);
82
+ })();
83
+
84
+ (async () => {
85
+ const apiService = new ApiService(`${process.env.API_TOKEN}`);
86
+
87
+ const getCustom = await apiService.analytics.getCustom({
88
+ from: '2020-11-01T06:00:00Z',
89
+ to: '2020-11-01T06:00:00Z',
90
+ group: 'day',
91
+ group_entities: 'video_id',
92
+ fields: [ 'view', 'play' ],
93
+ });
94
+
95
+ console.log('getCustom', getCustom);
96
+ })();
97
+
98
+ (async () => {
99
+ const apiService = new ApiService(`${process.env.API_TOKEN}`);
100
+ const form = new FormData();
101
+
102
+ form.append('file', fs.createReadStream('test.mp4'), {
103
+ filename: 'test.mp4',
104
+ contentType: 'video/mp4',
105
+ });
106
+ const uploadVideo = await apiService.video.uploadVideoByFile(
107
+ fs.readFileSync('test.mp4'),
108
+ {
109
+ 'X-Parent-ID': '92b93e72-27cc-49be-ac53-ca4a5f276f52',
110
+ 'X-Video-Title': 'testOne',
111
+ 'X-Video-Trim': JSON.stringify({ start: 1, length: 2 }),
112
+ ...form.getHeaders(),
113
+ },
114
+ );
115
+
116
+ console.log('uploadVideo', uploadVideo);
117
+ })();
118
+
119
+ (async () => {
120
+ const apiService = new ApiService(`${process.env.API_TOKEN}`);
121
+
122
+ const headers = {
123
+ 'X-Parent-ID': '92b93e72-27cc-49be-ac53-ca4a5f276f52',
124
+ 'X-Video-Title': 'testTwo',
125
+ 'X-Video-URL': 'https://www.youtube.com/watch?v=qzbtdclsJXw',
126
+ };
127
+
128
+ const uploadVideo = await apiService.video.uploadVideoByUrl(headers);
129
+ console.log('uploadVideo', uploadVideo);
130
+
131
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exode-team/kinescope.api",
3
- "version": "2.0.36",
3
+ "version": "2.0.37",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "aslanorlov <aslanorlov@gmail.com>",