@exode-team/kinescope.api 2.0.46 → 2.0.49

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.
@@ -4,8 +4,7 @@
4
4
  * @author: exode <hello@exode.ru>
5
5
  */
6
6
  import { BaseService } from './base-service';
7
- import { AnalyticsGetCustomRequest, AnalyticsGetCustomResponse } from './types';
8
- import { AnalyticsGetOverviewRequest, AnalyticsGetOverviewResponse } from './types';
7
+ import { AnalyticsGetCustomRequest, AnalyticsGetCustomResponse, AnalyticsGetOverviewRequest, AnalyticsGetOverviewResponse } from './types';
9
8
  export declare class AnalyticsService extends BaseService {
10
9
  /**
11
10
  * Get overview
@@ -32,15 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  * @returns {Promise<AnalyticsGetOverviewResponse>}
33
33
  */
34
34
  getOverview(params) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- try {
37
- return yield this.requestApi('https://api.kinescope.io/v1/analytics/overview', params, 'get');
38
- }
39
- catch (error) {
40
- console.error(`[PACKAGE:kinescope.api] ${error}`);
41
- throw error;
42
- }
43
- });
35
+ return this.requestApi('https://api.kinescope.io/v1/analytics/overview', params, 'get');
44
36
  }
45
37
  /**
46
38
  * Get custom
@@ -49,13 +41,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
49
41
  */
50
42
  getCustom(params) {
51
43
  return __awaiter(this, void 0, void 0, function* () {
52
- try {
53
- return yield this.requestApi('https://api.kinescope.io/v1/analytics', params, 'get');
54
- }
55
- catch (error) {
56
- console.error(`[PACKAGE:kinescope.api] ${error}`);
57
- throw error;
58
- }
44
+ return this.requestApi('https://api.kinescope.io/v1/analytics', params, 'get');
59
45
  });
60
46
  }
61
47
  }
@@ -3,15 +3,6 @@
3
3
  *
4
4
  * @author: exode <hello@exode.ru>
5
5
  */
6
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8
- return new (P || (P = Promise))(function (resolve, reject) {
9
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12
- step((generator = generator.apply(thisArg, _arguments || [])).next());
13
- });
14
- };
15
6
  (function (factory) {
16
7
  if (typeof module === "object" && typeof module.exports === "object") {
17
8
  var v = factory(require, exports);
@@ -32,15 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
23
  * @returns {Promise<ProjectCreateResponse>}
33
24
  */
34
25
  create(data) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- try {
37
- return yield this.requestApi('https://api.kinescope.io/v1/projects', data, 'post');
38
- }
39
- catch (error) {
40
- console.error(`[PACKAGE:kinescope.api] ${error}`);
41
- throw error;
42
- }
43
- });
26
+ return this.requestApi('https://api.kinescope.io/v1/projects', data, 'post');
44
27
  }
45
28
  /**
46
29
  * Get many projects
@@ -48,15 +31,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
31
  * @returns {Promise<ProjectGetResponse>}
49
32
  */
50
33
  getMany(params) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- try {
53
- return yield this.requestApi('https://api.kinescope.io/v1/projects', params, 'get');
54
- }
55
- catch (error) {
56
- console.error(`[PACKAGE:kinescope.api] ${error}`);
57
- throw error;
58
- }
59
- });
34
+ return this.requestApi('https://api.kinescope.io/v1/projects', params, 'get');
60
35
  }
61
36
  /**
62
37
  * Get project by id
@@ -64,15 +39,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
64
39
  * @returns {Promise<ProjectGetByIdResponse>}
65
40
  */
66
41
  getById(params) {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- try {
69
- return yield this.requestApi(`https://api.kinescope.io/v1/projects/${params.id}`, {}, 'get');
70
- }
71
- catch (error) {
72
- console.error(`[PACKAGE:kinescope.api] ${error}`);
73
- throw error;
74
- }
75
- });
42
+ return this.requestApi(`https://api.kinescope.io/v1/projects/${params.id}`, {}, 'get');
76
43
  }
77
44
  ;
78
45
  /**
@@ -82,15 +49,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
82
49
  * @returns {Promise<ProjectUpdateResponse>}
83
50
  */
84
51
  updateById(projectId, params) {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- try {
87
- return yield this.requestApi(`https://api.kinescope.io/v1/projects/${projectId}`, params, 'put');
88
- }
89
- catch (error) {
90
- console.error(`[PACKAGE:kinescope.api] ${error}`);
91
- throw error;
92
- }
93
- });
52
+ return this.requestApi(`https://api.kinescope.io/v1/projects/${projectId}`, params, 'put');
94
53
  }
95
54
  ;
96
55
  /**
@@ -99,15 +58,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
99
58
  * @returns {Promise<ProjectDeleteResponse>}
100
59
  */
101
60
  deleteById(projectId) {
102
- return __awaiter(this, void 0, void 0, function* () {
103
- try {
104
- return yield this.requestApi(`https://api.kinescope.io/v1/projects/${projectId}`, {}, 'delete');
105
- }
106
- catch (error) {
107
- console.error(`[PACKAGE:kinescope.api] ${error}`);
108
- throw error;
109
- }
110
- });
61
+ return this.requestApi(`https://api.kinescope.io/v1/projects/${projectId}`, {}, 'delete');
111
62
  }
112
63
  }
113
64
  exports.ProjectService = ProjectService;
@@ -3,15 +3,6 @@
3
3
  *
4
4
  * @author: exode <hello@exode.ru>
5
5
  */
6
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8
- return new (P || (P = Promise))(function (resolve, reject) {
9
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12
- step((generator = generator.apply(thisArg, _arguments || [])).next());
13
- });
14
- };
15
6
  (function (factory) {
16
7
  if (typeof module === "object" && typeof module.exports === "object") {
17
8
  var v = factory(require, exports);
@@ -33,15 +24,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
24
  * @returns {Promise<VideoUploadResponse>}
34
25
  */
35
26
  uploadVideoByFile(data, headers) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- try {
38
- return yield this.requestApi('https://uploader.kinescope.io/v2/video', data, 'post', Object.assign(Object.assign({}, headers), { 'X-Video-Title': encodeURI(headers['X-Video-Title']) }));
39
- }
40
- catch (error) {
41
- console.error(`[PACKAGE:kinescope.api] ${error}`);
42
- throw error;
43
- }
44
- });
27
+ return this.requestApi('https://uploader.kinescope.io/v2/video', data, 'post', Object.assign(Object.assign({}, headers), { 'X-Video-Title': encodeURI(headers['X-Video-Title']) }));
45
28
  }
46
29
  /**
47
30
  * Upload video by url
@@ -49,15 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
49
32
  * @returns {Promise<VideoUploadResponse>}
50
33
  */
51
34
  uploadVideoByUrl(headers) {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- try {
54
- return yield this.requestApi('https://uploader.kinescope.io/v2/video', {}, 'post', Object.assign(Object.assign({}, headers), { 'X-Video-Title': encodeURI(headers['X-Video-Title']) }));
55
- }
56
- catch (error) {
57
- console.error(`[PACKAGE:kinescope.api] ${error}`);
58
- throw error;
59
- }
60
- });
35
+ return this.requestApi('https://uploader.kinescope.io/v2/video', {}, 'post', Object.assign(Object.assign({}, headers), { 'X-Video-Title': encodeURI(headers['X-Video-Title']) }));
61
36
  }
62
37
  /**
63
38
  * Upload video poster
@@ -65,15 +40,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
65
40
  * @returns {Promise<VideoPosterUploadResponse>}
66
41
  */
67
42
  uploadVideoPoster(headers) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- try {
70
- return yield this.requestApi('https://uploader.kinescope.io/v2/poster', {}, 'post', headers);
71
- }
72
- catch (error) {
73
- console.error(`[PACKAGE:kinescope.api] ${error}`);
74
- throw error;
75
- }
76
- });
43
+ return this.requestApi('https://uploader.kinescope.io/v2/poster', {}, 'post', headers);
77
44
  }
78
45
  /**
79
46
  * Get video information
@@ -81,15 +48,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
81
48
  * @returns {Promise<VideoGetResponse>}
82
49
  */
83
50
  getVideo(videoId) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- try {
86
- return yield this.requestApi(`https://api.kinescope.io/v1/videos/${videoId}`, {}, 'get');
87
- }
88
- catch (error) {
89
- console.error(`[PACKAGE:kinescope.api] ${error}`);
90
- throw error;
91
- }
92
- });
51
+ return this.requestApi(`https://api.kinescope.io/v1/videos/${videoId}`, {}, 'get');
93
52
  }
94
53
  }
95
54
  exports.VideoService = VideoService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exode-team/kinescope.api",
3
- "version": "2.0.46",
3
+ "version": "2.0.49",
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.8.1",
19
+ "axios": "^1.8.4",
20
20
  "dotenv": "^16.4.5",
21
21
  "lodash": "^4.17.21"
22
22
  },