@30nama/sdk 1.4.1 → 1.4.2

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.
@@ -3,3 +3,4 @@ export * from './news';
3
3
  export * from './biography';
4
4
  export * from './soundtrack';
5
5
  export * from './support';
6
+ export * from './stream';
@@ -19,4 +19,5 @@ __exportStar(require("./news"), exports);
19
19
  __exportStar(require("./biography"), exports);
20
20
  __exportStar(require("./soundtrack"), exports);
21
21
  __exportStar(require("./support"), exports);
22
+ __exportStar(require("./stream"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,yCAAsB;AACtB,8CAA2B;AAC3B,+CAA4B;AAC5B,4CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,yCAAsB;AACtB,8CAA2B;AAC3B,+CAA4B;AAC5B,4CAAyB;AACzB,2CAAwB"}
@@ -0,0 +1,15 @@
1
+ import { BaseResponse } from '../types';
2
+ import { IContinueWatching, IStreamSeason } from '../../entities';
3
+ export declare function streamGetEpisodes(this: any, video_content_id: string): Promise<BaseResponse<{
4
+ _id: string;
5
+ video_content_id: string;
6
+ The_number_of_available_seasons_of_the_series: number;
7
+ seasons: IStreamSeason[];
8
+ }> | undefined>;
9
+ export declare function streamGetContinueWatching(this: any, type: 'all' | 'series' | 'movie', limit?: number): Promise<BaseResponse<{
10
+ amount: number;
11
+ archives: IContinueWatching[];
12
+ }> | undefined>;
13
+ export declare function streamDeleteContinueWatching(this: any, id: string): Promise<BaseResponse<void> | undefined>;
14
+ export declare function streamGenerateStreamLink(this: any, video_content_id: string, season_number?: number, episode_number?: number): Promise<BaseResponse<any> | undefined>;
15
+ export declare function streamSave(this: any, stream_content_id: string, time: number, duration: number, video_content_id: string, profile_id?: number): Promise<BaseResponse<any> | undefined>;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.streamSave = exports.streamGenerateStreamLink = exports.streamDeleteContinueWatching = exports.streamGetContinueWatching = exports.streamGetEpisodes = void 0;
13
+ const request_1 = require("../request");
14
+ const servicePath = 'stream';
15
+ function streamGetEpisodes(video_content_id) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const This = this;
18
+ This.log('info', 'Running action: streamGetEpisodes');
19
+ const req = new request_1.default(`stream-seasons-episodes/${video_content_id}`, this);
20
+ req.withService(servicePath);
21
+ req.withMethod('get');
22
+ const response = (yield req.execute());
23
+ return response;
24
+ });
25
+ }
26
+ exports.streamGetEpisodes = streamGetEpisodes;
27
+ function streamGetContinueWatching(type, limit) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ const This = this;
30
+ This.log('info', 'Running action: streamGetContinueWatching');
31
+ const req = new request_1.default(`show-archive-list`, this);
32
+ req.withService(servicePath);
33
+ req.withMethod('get');
34
+ const response = (yield req.execute({ type, limit }));
35
+ return response;
36
+ });
37
+ }
38
+ exports.streamGetContinueWatching = streamGetContinueWatching;
39
+ function streamDeleteContinueWatching(id) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const This = this;
42
+ This.log('info', 'Running action: streamDeleteContinueWatching');
43
+ const req = new request_1.default(`delete-content/${id}`, this);
44
+ req.withService(servicePath);
45
+ req.withMethod('put');
46
+ const response = (yield req.execute());
47
+ return response;
48
+ });
49
+ }
50
+ exports.streamDeleteContinueWatching = streamDeleteContinueWatching;
51
+ function streamGenerateStreamLink(video_content_id, season_number, episode_number) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const This = this;
54
+ This.log('info', 'Running action: streamGenerateStreamLink');
55
+ const req = new request_1.default(`generate-stream-link`, this);
56
+ req.withService(servicePath);
57
+ req.withMethod('get');
58
+ const response = (yield req.execute({
59
+ video_content_id,
60
+ season_number,
61
+ episode_number
62
+ }));
63
+ return response;
64
+ });
65
+ }
66
+ exports.streamGenerateStreamLink = streamGenerateStreamLink;
67
+ function streamSave(stream_content_id, time, duration, video_content_id, profile_id) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const This = this;
70
+ This.log('info', 'Running action: streamSave');
71
+ const req = new request_1.default(`save-stream-log`, this);
72
+ req.withService(servicePath);
73
+ req.withMethod('post');
74
+ const response = (yield req.execute({
75
+ stream_content_id,
76
+ time,
77
+ duration,
78
+ video_content_id,
79
+ profile_id
80
+ }));
81
+ return response;
82
+ });
83
+ }
84
+ exports.streamSave = streamSave;
85
+ //# sourceMappingURL=stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/api/services/stream.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,wCAAgC;AAGhC,MAAM,WAAW,GAAG,QAAQ,CAAA;AAE5B,SAAsB,iBAAiB,CAAY,gBAAwB;;QACvE,MAAM,IAAI,GAAG,IAAW,CAAA;QACxB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,mCAAmC,CAAC,CAAA;QACrD,MAAM,GAAG,GAAG,IAAI,iBAAO,CAAC,2BAA2B,gBAAgB,EAAE,EAAE,IAAI,CAAC,CAAA;QAC5E,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAA;QAC5B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AAC,MAAM,EAAE,0CAA0C,CAAC,CAAA;QAC5D,MAAM,GAAG,GAAG,IAAI,iBAAO,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAA;QACrD,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAA;QAC5B,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAErB,MAAM,QAAQ,GAAG,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC;YAChC,gBAAgB;YAChB,aAAa;YACb,cAAc;SACjB,CAAC,CAAkC,CAAA;QACpC,OAAO,QAAQ,CAAA;IACnB,CAAC;CAAA;AAbD,4DAaC;AAED,SAAsB,UAAU,CAAY,iBAAyB,EAAE,IAAY,EAAE,QAAgB,EAAE,gBAAwB,EAAE,UAAmB;;QAChJ,MAAM,IAAI,GAAG,IAAW,CAAA;QACxB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAA;QAC9C,MAAM,GAAG,GAAG,IAAI,iBAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAA;QAChD,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAA;QAC5B,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QAEtB,MAAM,QAAQ,GAAG,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC;YAChC,iBAAiB;YACjB,IAAI;YACJ,QAAQ;YACR,gBAAgB;YAChB,UAAU;SACb,CAAC,CAAkC,CAAA;QACpC,OAAO,QAAQ,CAAA;IACnB,CAAC;CAAA;AAfD,gCAeC"}
@@ -0,0 +1,23 @@
1
+ export interface IStreamEpisode {
2
+ _id: string;
3
+ stream_content_id: string;
4
+ episode_from: number;
5
+ episode_to?: number;
6
+ next_episode_id: string;
7
+ path: string;
8
+ }
9
+ export interface IStreamSeason {
10
+ _id: string;
11
+ season_number: number;
12
+ episods: IStreamEpisode[];
13
+ }
14
+ export interface IContinueWatching {
15
+ _id: string;
16
+ user_id: number;
17
+ stream_content_id: string;
18
+ profile_id?: number;
19
+ time: number;
20
+ duration: number;
21
+ dismissed: boolean;
22
+ watched_time?: number;
23
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IStream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IStream.js","sourceRoot":"","sources":["../../src/entities/IStream.ts"],"names":[],"mappings":""}
@@ -9,3 +9,4 @@ export * from './ITitle';
9
9
  export * from './IArticle';
10
10
  export * from './IBiography';
11
11
  export * from './ISoundTrack';
12
+ export * from './IStream';
@@ -25,4 +25,5 @@ __exportStar(require("./ITitle"), exports);
25
25
  __exportStar(require("./IArticle"), exports);
26
26
  __exportStar(require("./IBiography"), exports);
27
27
  __exportStar(require("./ISoundTrack"), exports);
28
+ __exportStar(require("./IStream"), exports);
28
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,4CAAyB;AACzB,gDAA6B;AAC7B,+CAA4B;AAC5B,gDAA6B;AAC7B,+CAA4B;AAC5B,4CAAyB;AACzB,2CAAwB;AACxB,6CAA0B;AAC1B,+CAA4B;AAC5B,gDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,4CAAyB;AACzB,gDAA6B;AAC7B,+CAA4B;AAC5B,gDAA6B;AAC7B,+CAA4B;AAC5B,4CAAyB;AACzB,2CAAwB;AACxB,6CAA0B;AAC1B,+CAA4B;AAC5B,gDAA6B;AAC7B,4CAAyB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@30nama/sdk",
3
3
  "description": "30nama SDK for Node.js",
4
- "version": "1.4.1",
4
+ "version": "1.4.2",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [