@exode-team/kinescope.api 2.0.35 → 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
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
}
|
|
@@ -7,17 +7,19 @@ export interface ProjectGetByIdRequest {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export interface ProjectGetByIdResponse {
|
|
10
|
-
readonly
|
|
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
|
-
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
}
|
package/examples/api-test.ts
CHANGED
|
@@ -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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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.
|
|
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>",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"npm:publish": "npm run build && npm publish"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"axios": "^1.
|
|
19
|
+
"axios": "^1.7.7",
|
|
20
20
|
"dotenv": "^16.4.5",
|
|
21
21
|
"lodash": "^4.17.21"
|
|
22
22
|
},
|