@neuralinnovations/dataisland-sdk 0.6.22 → 0.6.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/package.json +1 -1
- package/dist/src/dto/instaResponse.d.ts +14 -5
- package/dist/src/dto/instaResponse.d.ts.map +1 -1
- package/dist/src/dto/instaResponse.js +8 -1
- package/dist/src/dto/instaResponse.js.map +1 -1
- package/dist/src/dto/messengerResponse.d.ts +13 -0
- package/dist/src/dto/messengerResponse.d.ts.map +1 -0
- package/dist/src/dto/messengerResponse.js +3 -0
- package/dist/src/dto/messengerResponse.js.map +1 -0
- package/dist/src/storages/insta/instaAccount.d.ts +1 -1
- package/dist/src/storages/insta/instaAccount.d.ts.map +1 -1
- package/dist/src/storages/insta/instaAccount.impl.d.ts +6 -4
- package/dist/src/storages/insta/instaAccount.impl.d.ts.map +1 -1
- package/dist/src/storages/insta/instaAccount.impl.js +20 -12
- package/dist/src/storages/insta/instaAccount.impl.js.map +1 -1
- package/dist/src/storages/insta/instaAccount.js.map +1 -1
- package/dist/src/storages/insta/instaAccounts.d.ts +1 -1
- package/dist/src/storages/insta/instaAccounts.d.ts.map +1 -1
- package/dist/src/storages/insta/instaAccounts.impl.d.ts +1 -1
- package/dist/src/storages/insta/instaAccounts.impl.d.ts.map +1 -1
- package/dist/src/storages/insta/instaAccounts.impl.js +11 -11
- package/dist/src/storages/insta/instaAccounts.impl.js.map +1 -1
- package/dist/src/storages/insta/instaAccounts.js.map +1 -1
- package/dist/src/storages/messenger/messengerAccount.d.ts +9 -0
- package/dist/src/storages/messenger/messengerAccount.d.ts.map +1 -0
- package/dist/src/storages/messenger/messengerAccount.impl.d.ts +14 -0
- package/dist/src/storages/messenger/messengerAccount.impl.d.ts.map +1 -0
- package/dist/src/storages/messenger/messengerAccount.impl.js +49 -0
- package/dist/src/storages/messenger/messengerAccount.impl.js.map +1 -0
- package/dist/src/storages/messenger/messengerAccount.js +7 -0
- package/dist/src/storages/messenger/messengerAccount.js.map +1 -0
- package/dist/src/storages/messenger/messengerAccounts.d.ts +8 -0
- package/dist/src/storages/messenger/messengerAccounts.d.ts.map +1 -0
- package/dist/src/storages/messenger/messengerAccounts.impl.d.ts +15 -0
- package/dist/src/storages/messenger/messengerAccounts.impl.d.ts.map +1 -0
- package/dist/src/storages/messenger/messengerAccounts.impl.js +85 -0
- package/dist/src/storages/messenger/messengerAccounts.impl.js.map +1 -0
- package/dist/src/storages/messenger/messengerAccounts.js +7 -0
- package/dist/src/storages/messenger/messengerAccounts.js.map +1 -0
- package/dist/src/storages/organizations/organization.d.ts +5 -0
- package/dist/src/storages/organizations/organization.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.impl.d.ts +3 -0
- package/dist/src/storages/organizations/organization.impl.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.impl.js +5 -0
- package/dist/src/storages/organizations/organization.impl.js.map +1 -1
- package/dist/src/storages/organizations/organization.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/instaResponse.ts +16 -5
- package/src/dto/messengerResponse.ts +16 -0
- package/src/storages/insta/instaAccount.impl.ts +33 -14
- package/src/storages/insta/instaAccount.ts +10 -1
- package/src/storages/insta/instaAccounts.impl.ts +17 -11
- package/src/storages/insta/instaAccounts.ts +8 -1
- package/src/storages/messenger/messengerAccount.impl.ts +64 -0
- package/src/storages/messenger/messengerAccount.ts +16 -0
- package/src/storages/messenger/messengerAccounts.impl.ts +115 -0
- package/src/storages/messenger/messengerAccounts.ts +13 -0
- package/src/storages/organizations/organization.impl.ts +8 -0
- package/src/storages/organizations/organization.ts +6 -0
package/dist/package.json
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
export interface InstaAccountDto {
|
2
2
|
id: string;
|
3
|
-
name: string;
|
4
|
-
enabled: boolean;
|
5
3
|
organizationId: string;
|
6
|
-
|
7
|
-
|
4
|
+
status: AccountStatus;
|
5
|
+
enabled: boolean;
|
6
|
+
username: string;
|
7
|
+
twoFactorKey: string;
|
8
|
+
proxy: string;
|
8
9
|
additionalContext: string;
|
9
10
|
folderId: string;
|
11
|
+
error: string;
|
10
12
|
}
|
11
13
|
export interface InstaCutAccountDto {
|
12
14
|
id: string;
|
13
|
-
|
15
|
+
status: AccountStatus;
|
16
|
+
username: string;
|
14
17
|
enabled: boolean;
|
15
18
|
}
|
16
19
|
export interface InstaPostDto {
|
@@ -37,4 +40,10 @@ export declare enum ContentStatus {
|
|
37
40
|
Finished = 1,
|
38
41
|
Error = 2
|
39
42
|
}
|
43
|
+
export declare enum AccountStatus {
|
44
|
+
None = 0,
|
45
|
+
Created = 1,
|
46
|
+
Authenticated = 2,
|
47
|
+
Error = 3
|
48
|
+
}
|
40
49
|
//# sourceMappingURL=instaResponse.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaResponse.d.ts","sourceRoot":"","sources":["../../../src/dto/instaResponse.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,
|
1
|
+
{"version":3,"file":"instaResponse.d.ts","sourceRoot":"","sources":["../../../src/dto/instaResponse.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAGD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,aAAa,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,eAAe,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,oBAAY,UAAU;IACpB,UAAU,IAAI;IACd,QAAQ,IAAI;CACb;AAED,oBAAY,aAAa;IACvB,UAAU,IAAI;IACd,QAAQ,IAAI;IACZ,KAAK,IAAI;CACV;AAED,oBAAY,aAAa;IACvB,IAAI,IAAI;IACR,OAAO,IAAI;IACX,aAAa,IAAI;IACjB,KAAK,IAAI;CACV"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.ContentStatus = exports.PostStatus = void 0;
|
3
|
+
exports.AccountStatus = exports.ContentStatus = exports.PostStatus = void 0;
|
4
4
|
var PostStatus;
|
5
5
|
(function (PostStatus) {
|
6
6
|
PostStatus[PostStatus["Generation"] = 0] = "Generation";
|
@@ -12,4 +12,11 @@ var ContentStatus;
|
|
12
12
|
ContentStatus[ContentStatus["Finished"] = 1] = "Finished";
|
13
13
|
ContentStatus[ContentStatus["Error"] = 2] = "Error";
|
14
14
|
})(ContentStatus || (exports.ContentStatus = ContentStatus = {}));
|
15
|
+
var AccountStatus;
|
16
|
+
(function (AccountStatus) {
|
17
|
+
AccountStatus[AccountStatus["None"] = 0] = "None";
|
18
|
+
AccountStatus[AccountStatus["Created"] = 1] = "Created";
|
19
|
+
AccountStatus[AccountStatus["Authenticated"] = 2] = "Authenticated";
|
20
|
+
AccountStatus[AccountStatus["Error"] = 3] = "Error";
|
21
|
+
})(AccountStatus || (exports.AccountStatus = AccountStatus = {}));
|
15
22
|
//# sourceMappingURL=instaResponse.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaResponse.js","sourceRoot":"","sources":["../../../src/dto/instaResponse.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"instaResponse.js","sourceRoot":"","sources":["../../../src/dto/instaResponse.ts"],"names":[],"mappings":";;;AAyCA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,uDAAc,CAAA;IACd,mDAAY,CAAA;AACd,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,6DAAc,CAAA;IACd,yDAAY,CAAA;IACZ,mDAAS,CAAA;AACX,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,iDAAQ,CAAA;IACR,uDAAW,CAAA;IACX,mEAAiB,CAAA;IACjB,mDAAS,CAAA;AACX,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export interface MessengerAccountDto {
|
2
|
+
organizationId: string;
|
3
|
+
name: string;
|
4
|
+
accountId: string;
|
5
|
+
token: string;
|
6
|
+
accountContext: string;
|
7
|
+
referralUrl: string;
|
8
|
+
}
|
9
|
+
export interface MessengerAccountCutDto {
|
10
|
+
id: string;
|
11
|
+
name: string;
|
12
|
+
}
|
13
|
+
//# sourceMappingURL=messengerResponse.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerResponse.d.ts","sourceRoot":"","sources":["../../../src/dto/messengerResponse.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerResponse.js","sourceRoot":"","sources":["../../../src/dto/messengerResponse.ts"],"names":[],"mappings":""}
|
@@ -3,6 +3,6 @@ export type InstaAccountId = string;
|
|
3
3
|
export declare abstract class InstaAccount {
|
4
4
|
abstract get id(): InstaAccountId;
|
5
5
|
abstract data(): Promise<InstaAccountDto>;
|
6
|
-
abstract update(enabled: boolean,
|
6
|
+
abstract update(enabled: boolean, relogin: boolean, username: string, password: string, twoFactorKey: string, proxy: string, additionalContext: string, folderId: string): Promise<InstaAccountDto>;
|
7
7
|
}
|
8
8
|
//# sourceMappingURL=instaAccount.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaAccount.d.ts","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAGvD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAA;AAGnC,8BAAsB,YAAY;IAEhC,QAAQ,KAAK,EAAE,IAAI,cAAc,CAAA;IAEjC,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;IAEzC,QAAQ,CAAC,MAAM,
|
1
|
+
{"version":3,"file":"instaAccount.d.ts","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAGvD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAA;AAGnC,8BAAsB,YAAY;IAEhC,QAAQ,KAAK,EAAE,IAAI,cAAc,CAAA;IAEjC,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;IAEzC,QAAQ,CAAC,MAAM,CACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,CAAC;CAE5B"}
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import { InstaAccount, InstaAccountId } from "./instaAccount";
|
2
|
-
import { InstaAccountDto } from "../../dto/instaResponse";
|
2
|
+
import { AccountStatus, InstaAccountDto, InstaCutAccountDto } from "../../dto/instaResponse";
|
3
3
|
import { Context } from "../../context";
|
4
4
|
export declare class InstaAccountImpl extends InstaAccount {
|
5
5
|
private readonly context;
|
6
|
-
private readonly
|
7
|
-
constructor(context: Context,
|
6
|
+
private readonly _cutData;
|
7
|
+
constructor(context: Context, accountCut: InstaCutAccountDto);
|
8
8
|
get id(): InstaAccountId;
|
9
|
+
get username(): InstaAccountId;
|
10
|
+
get status(): AccountStatus;
|
9
11
|
data(): Promise<InstaAccountDto>;
|
10
|
-
update(enabled: boolean,
|
12
|
+
update(enabled: boolean, relogin: boolean, username: string, password: string, twoFactorKey: string, proxy: string, additionalContext: string, folderId: string): Promise<InstaAccountDto>;
|
11
13
|
}
|
12
14
|
//# sourceMappingURL=instaAccount.impl.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaAccount.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccount.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;
|
1
|
+
{"version":3,"file":"instaAccount.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccount.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAC,aAAa,EAAE,eAAe,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAA;AAGzF,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAA;AAGrC,qBAAa,gBAAiB,SAAQ,YAAY;IAGpC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;gBAEhB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,kBAAkB;IAM7E,IAAI,EAAE,IAAI,cAAc,CAEvB;IAED,IAAI,QAAQ,IAAI,cAAc,CAE7B;IAED,IAAI,MAAM,IAAI,aAAa,CAE1B;IAEK,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;IAehC,MAAM,CACV,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,CAAC;CAyB5B"}
|
@@ -5,40 +5,48 @@ const instaAccount_1 = require("./instaAccount");
|
|
5
5
|
const rpcService_1 = require("../../services/rpcService");
|
6
6
|
const responseUtils_1 = require("../../services/responseUtils");
|
7
7
|
class InstaAccountImpl extends instaAccount_1.InstaAccount {
|
8
|
-
constructor(context,
|
8
|
+
constructor(context, accountCut) {
|
9
9
|
super();
|
10
10
|
this.context = context;
|
11
|
-
this.
|
11
|
+
this._cutData = accountCut;
|
12
12
|
}
|
13
13
|
get id() {
|
14
|
-
return this.
|
14
|
+
return this._cutData.id;
|
15
|
+
}
|
16
|
+
get username() {
|
17
|
+
return this._cutData.username;
|
18
|
+
}
|
19
|
+
get status() {
|
20
|
+
return this._cutData.status;
|
15
21
|
}
|
16
22
|
async data() {
|
17
23
|
var _a;
|
18
24
|
const response = await ((_a = this.context
|
19
|
-
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Insta").searchParam("instaId", this.
|
25
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Insta").searchParam("instaId", this._cutData.id).sendGet());
|
20
26
|
// check response status
|
21
27
|
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
22
|
-
await responseUtils_1.ResponseUtils.throwError(`Failed to get insta account data with id ${this.
|
28
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to get insta account data with id ${this._cutData.id}`, response);
|
23
29
|
}
|
24
30
|
return (await response.json()).instaAccount;
|
25
31
|
}
|
26
|
-
async update(enabled,
|
32
|
+
async update(enabled, relogin, username, password, twoFactorKey, proxy, additionalContext, folderId) {
|
27
33
|
var _a;
|
28
34
|
// send request to the server
|
29
35
|
const response = await ((_a = this.context
|
30
36
|
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Insta").sendPutJson({
|
31
|
-
instaId: this.
|
37
|
+
instaId: this._cutData.id,
|
32
38
|
enabled: enabled,
|
33
|
-
|
39
|
+
relogin: relogin,
|
40
|
+
username: username,
|
41
|
+
password: password,
|
42
|
+
twoFactorKey: twoFactorKey,
|
43
|
+
proxy: proxy,
|
34
44
|
additionalContext: additionalContext,
|
35
|
-
folderId: folderId
|
36
|
-
token: token,
|
37
|
-
proxy: proxy
|
45
|
+
folderId: folderId
|
38
46
|
}));
|
39
47
|
// check response status
|
40
48
|
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
41
|
-
await responseUtils_1.ResponseUtils.throwError(`Failed to update insta account with ID: ${this.
|
49
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to update insta account with ID: ${this._cutData.id}`, response);
|
42
50
|
}
|
43
51
|
return await this.data();
|
44
52
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaAccount.impl.js","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccount.impl.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAE3D,0DAAoD;AACpD,gEAA0D;AAI1D,MAAa,gBAAiB,SAAQ,2BAAY;IAGhD,YAA6B,OAAgB,EAAE,
|
1
|
+
{"version":3,"file":"instaAccount.impl.js","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccount.impl.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAE3D,0DAAoD;AACpD,gEAA0D;AAI1D,MAAa,gBAAiB,SAAQ,2BAAY;IAGhD,YAA6B,OAAgB,EAAE,UAA8B;QAC3E,KAAK,EAAE,CAAA;QADoB,YAAO,GAAP,OAAO,CAAS;QAG3C,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAA;IAC5B,CAAC;IAED,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAA;IACzB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAA;IAC/B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAA;IAC7B,CAAC;IAED,KAAK,CAAC,IAAI;;QACR,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,cAAc,EAC9B,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,EACvC,OAAO,EAAE,CAAA,CAAA;QAEZ,wBAAwB;QACxB,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,4CAA4C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC1G,CAAC;QAED,OAAO,CAAC,MAAM,QAAS,CAAC,IAAI,EAAwC,CAAA,CAAC,YAAY,CAAA;IACnF,CAAC;IAED,KAAK,CAAC,MAAM,CACV,OAAgB,EAChB,OAAgB,EAChB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,KAAa,EACb,iBAAyB,EACzB,QAAgB;;QAEhB,6BAA6B;QAC7B,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,cAAc,EAC9B,WAAW,CAAC;YACX,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;YACzB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO;YAChB,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,YAAY;YAC1B,KAAK,EAAE,KAAK;YACZ,iBAAiB,EAAE,iBAAiB;YACpC,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAA,CAAA;QAEJ,wBAAwB;QACxB,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,2CAA2C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;QACzG,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;IAC1B,CAAC;CAEF;AAtED,4CAsEC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaAccount.js","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccount.ts"],"names":[],"mappings":";;;AAMA,MAAsB,YAAY;
|
1
|
+
{"version":3,"file":"instaAccount.js","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccount.ts"],"names":[],"mappings":";;;AAMA,MAAsB,YAAY;CAiBjC;AAjBD,oCAiBC"}
|
@@ -4,7 +4,7 @@ export declare abstract class InstaAccounts {
|
|
4
4
|
abstract get accounts(): InstaAccount[];
|
5
5
|
abstract get posts(): InstaPost[];
|
6
6
|
abstract update(): Promise<void>;
|
7
|
-
abstract add(
|
7
|
+
abstract add(username: string, password: string, twoFactorKey: string, proxy: string, additionalContext: string, folderId: string): Promise<void>;
|
8
8
|
abstract delete(id: string): Promise<void>;
|
9
9
|
abstract deletePost(id: string): Promise<void>;
|
10
10
|
abstract post(message: string): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaAccounts.d.ts","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccounts.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AAGrC,8BAAsB,aAAa;IAEjC,QAAQ,KAAK,QAAQ,IAAI,YAAY,EAAE,CAAA;IAEvC,QAAQ,KAAK,KAAK,IAAI,SAAS,EAAE,CAAA;IAEjC,QAAQ,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC,QAAQ,CAAC,GAAG,
|
1
|
+
{"version":3,"file":"instaAccounts.d.ts","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccounts.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AAGrC,8BAAsB,aAAa;IAEjC,QAAQ,KAAK,QAAQ,IAAI,YAAY,EAAE,CAAA;IAEvC,QAAQ,KAAK,KAAK,IAAI,SAAS,EAAE,CAAA;IAEjC,QAAQ,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC,QAAQ,CAAC,GAAG,CACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAEhB,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1C,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE9C,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAE9C"}
|
@@ -15,7 +15,7 @@ export declare class InstaAccountsImpl extends InstaAccounts {
|
|
15
15
|
get posts(): InstaPost[];
|
16
16
|
internalFetchPosts(): Promise<void>;
|
17
17
|
update(): Promise<void>;
|
18
|
-
add(
|
18
|
+
add(username: string, password: string, twoFactorKey: string, proxy: string, additionalContext: string, folderId: string): Promise<void>;
|
19
19
|
delete(id: string): Promise<void>;
|
20
20
|
post(message: string): Promise<void>;
|
21
21
|
deletePost(id: string): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaAccounts.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccounts.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAQ7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oCAAoC,CAAA;AACnE,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAA;AAErC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AAGrC,qBAAa,iBAAkB,SAAQ,aAAa;aAUhC,YAAY,EAAE,gBAAgB;aAC9B,OAAO,EAAE,OAAO;IAVlC,OAAO,CAAC,SAAS,CAAC,CAAoB;IACtC,OAAO,CAAC,MAAM,CAAC,CAAiB;IAGhC,OAAO,CAAC,WAAW,CAAsB;IAEzC,OAAO,CAAC,aAAa,CAAC,CAAgB;gBAGpB,YAAY,EAAE,gBAAgB,EAC9B,OAAO,EAAE,OAAO;IAKlC,IAAI,QAAQ,IAAI,YAAY,EAAE,CAM7B;IAED,IAA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BpC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA2B5C"}
|
@@ -54,7 +54,7 @@ class InstaAccountsImpl extends instaAccounts_1.InstaAccounts {
|
|
54
54
|
}
|
55
55
|
this._accounts = [];
|
56
56
|
const accounts = (await response.json()).instaAccounts;
|
57
|
-
this._accounts = accounts.map(acc => new instaAccount_impl_1.InstaAccountImpl(this.context, acc
|
57
|
+
this._accounts = accounts.map(acc => new instaAccount_impl_1.InstaAccountImpl(this.context, acc));
|
58
58
|
const postsResponse = await ((_b = this.context
|
59
59
|
.resolve(rpcService_1.RpcService)) === null || _b === void 0 ? void 0 : _b.requestBuilder("api/v1/Insta/post/list").searchParam("organizationId", this.organization.id).sendGet());
|
60
60
|
// check response status
|
@@ -71,16 +71,16 @@ class InstaAccountsImpl extends instaAccounts_1.InstaAccounts {
|
|
71
71
|
this._fetchTimeout = setTimeout(async () => await this.internalFetchPosts(), 2000);
|
72
72
|
}
|
73
73
|
}
|
74
|
-
async add(
|
74
|
+
async add(username, password, twoFactorKey, proxy, additionalContext, folderId) {
|
75
75
|
var _a;
|
76
|
-
if (
|
77
|
-
throw new Error("Add insta account,
|
76
|
+
if (username === undefined || username === null || username.trim() === "") {
|
77
|
+
throw new Error("Add insta account, username can not be null or empty");
|
78
78
|
}
|
79
|
-
if (
|
80
|
-
throw new Error("Add insta account,
|
79
|
+
if (password === undefined || password === null || password.trim() === "") {
|
80
|
+
throw new Error("Add insta account, password can not be null or empty");
|
81
81
|
}
|
82
|
-
if (
|
83
|
-
throw new Error("Add insta account,
|
82
|
+
if (twoFactorKey === undefined || twoFactorKey === null || twoFactorKey.trim() === "") {
|
83
|
+
throw new Error("Add insta account, twoFactorKey can not be null or empty");
|
84
84
|
}
|
85
85
|
if (proxy === undefined || proxy === null) {
|
86
86
|
throw new Error("Add insta account, proxy can not be null or empty");
|
@@ -94,10 +94,10 @@ class InstaAccountsImpl extends instaAccounts_1.InstaAccounts {
|
|
94
94
|
// send create request to the server
|
95
95
|
const response = await ((_a = this.context
|
96
96
|
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Insta").sendPostJson({
|
97
|
-
name: name,
|
98
97
|
organizationId: this.organization.id,
|
99
|
-
|
100
|
-
|
98
|
+
username: username,
|
99
|
+
password: password,
|
100
|
+
twoFactorKey: twoFactorKey,
|
101
101
|
proxy: proxy,
|
102
102
|
additionalContext: additionalContext,
|
103
103
|
folderId: folderId
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaAccounts.impl.js","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccounts.impl.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,2DAIgC;AAChC,0DAAoD;AACpD,gEAA0D;AAG1D,2DAAoD;AAEpD,qDAA8C;AAI9C,MAAa,iBAAkB,SAAQ,6BAAa;IASlD,YACkB,YAA8B,EAC9B,OAAgB;QAChC,KAAK,EAAE,CAAA;QAFS,iBAAY,GAAZ,YAAY,CAAkB;QAC9B,YAAO,GAAP,OAAO,CAAS;QAN1B,gBAAW,GAAoB,EAAE,CAAA;IAQzC,CAAC;IAGD,IAAI,QAAQ;QACV,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,SAAS,CAAA;QACvB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAA;QACpF,CAAC;IACH,CAAC;IAED,IAAI,KAAK;QACP,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,MAAM,CAAA;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAA;QACjF,CAAC;IACH,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,qCAAqC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,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AAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAC5B,gCAAgC,EAAE,mBAAmB,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAC3E,QAAQ,CACT,CAAA;QACH,CAAC;QAED,MAAM,IAAI,CAAC,MAAM,EAAE,CAAA;IACrB,CAAC;CAGF;AA/ND,8CA+NC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"instaAccounts.js","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccounts.ts"],"names":[],"mappings":";;;AAKA,MAAsB,aAAa;
|
1
|
+
{"version":3,"file":"instaAccounts.js","sourceRoot":"","sources":["../../../../src/storages/insta/instaAccounts.ts"],"names":[],"mappings":";;;AAKA,MAAsB,aAAa;CAuBlC;AAvBD,sCAuBC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { MessengerAccountDto } from "../../dto/messengerResponse";
|
2
|
+
export type MessengerAccountId = string;
|
3
|
+
export declare abstract class MessengerAccount {
|
4
|
+
abstract get id(): MessengerAccountId;
|
5
|
+
abstract get name(): string;
|
6
|
+
abstract data(): Promise<MessengerAccountDto>;
|
7
|
+
abstract update(name: string, accountId: string, token: string, accountContext: string, referralUrl: string): Promise<MessengerAccountDto>;
|
8
|
+
}
|
9
|
+
//# sourceMappingURL=messengerAccount.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerAccount.d.ts","sourceRoot":"","sources":["../../../../src/storages/messenger/messengerAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAA;AAG/D,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC,8BAAsB,gBAAgB;IAEpC,QAAQ,KAAK,EAAE,IAAI,kBAAkB,CAAA;IAErC,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAA;IAE3B,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAE7C,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAE3I"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { MessengerAccount, MessengerAccountId } from "./messengerAccount";
|
2
|
+
import { MessengerAccountDto } from "../../dto/messengerResponse";
|
3
|
+
import { Context } from "../../context";
|
4
|
+
export declare class MessengerAccountImpl extends MessengerAccount {
|
5
|
+
private readonly context;
|
6
|
+
private readonly _id;
|
7
|
+
private readonly _name;
|
8
|
+
constructor(context: Context, id: string, name: string);
|
9
|
+
get id(): MessengerAccountId;
|
10
|
+
get name(): string;
|
11
|
+
data(): Promise<MessengerAccountDto>;
|
12
|
+
update(name: string, accountId: string, token: string, accountContext: string, referralUrl: string): Promise<MessengerAccountDto>;
|
13
|
+
}
|
14
|
+
//# sourceMappingURL=messengerAccount.impl.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerAccount.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/messenger/messengerAccount.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAA;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAA;AAKrC,qBAAa,oBAAqB,SAAQ,gBAAgB;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAED,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAOvE,IAAI,EAAE,IAAI,kBAAkB,CAE3B;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAGK,IAAI,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAepC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAqBxI"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.MessengerAccountImpl = void 0;
|
4
|
+
const messengerAccount_1 = require("./messengerAccount");
|
5
|
+
const rpcService_1 = require("../../services/rpcService");
|
6
|
+
const responseUtils_1 = require("../../services/responseUtils");
|
7
|
+
class MessengerAccountImpl extends messengerAccount_1.MessengerAccount {
|
8
|
+
constructor(context, id, name) {
|
9
|
+
super();
|
10
|
+
this.context = context;
|
11
|
+
this._id = id;
|
12
|
+
this._name = name;
|
13
|
+
}
|
14
|
+
get id() {
|
15
|
+
return this._id;
|
16
|
+
}
|
17
|
+
get name() {
|
18
|
+
return this._name;
|
19
|
+
}
|
20
|
+
async data() {
|
21
|
+
var _a;
|
22
|
+
const response = await ((_a = this.context
|
23
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Messenger").searchParam("id", this._id).sendGet());
|
24
|
+
// check response status
|
25
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
26
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to get messenger account data with id ${this._id}`, response);
|
27
|
+
}
|
28
|
+
return (await response.json()).account;
|
29
|
+
}
|
30
|
+
async update(name, accountId, token, accountContext, referralUrl) {
|
31
|
+
var _a;
|
32
|
+
// send request to the server
|
33
|
+
const response = await ((_a = this.context
|
34
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Messenger").sendPutJson({
|
35
|
+
id: this._id,
|
36
|
+
name: name,
|
37
|
+
token: token,
|
38
|
+
accountContext: accountContext,
|
39
|
+
referralUrl: referralUrl,
|
40
|
+
}));
|
41
|
+
// check response status
|
42
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
43
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to update messenger account with ID: ${this._id}`, response);
|
44
|
+
}
|
45
|
+
return await this.data();
|
46
|
+
}
|
47
|
+
}
|
48
|
+
exports.MessengerAccountImpl = MessengerAccountImpl;
|
49
|
+
//# sourceMappingURL=messengerAccount.impl.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerAccount.impl.js","sourceRoot":"","sources":["../../../../src/storages/messenger/messengerAccount.impl.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AAGvE,0DAAoD;AACpD,gEAA0D;AAG1D,MAAa,oBAAqB,SAAQ,mCAAgB;IAIxD,YAA6B,OAAgB,EAAE,EAAU,EAAE,IAAY;QACrE,KAAK,EAAE,CAAA;QADoB,YAAO,GAAP,OAAO,CAAS;QAG3C,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,CAAC;IAED,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAGD,KAAK,CAAC,IAAI;;QACR,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,kBAAkB,EAClC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAC1B,OAAO,EAAE,CAAA,CAAA;QAEZ,wBAAwB;QACxB,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,gDAAgD,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAA;QACtG,CAAC;QAED,OAAO,CAAC,MAAM,QAAS,CAAC,IAAI,EAAuC,CAAA,CAAC,OAAO,CAAA;IAC7E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,SAAiB,EAAE,KAAa,EAAE,cAAsB,EAAE,WAAmB;;QACtG,6BAA6B;QAC7B,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,kBAAkB,EAClC,WAAW,CAAC;YACX,EAAE,EAAE,IAAI,CAAC,GAAG;YACZ,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,cAAc,EAAE,cAAc;YAC9B,WAAW,EAAE,WAAW;SACzB,CAAC,CAAA,CAAA;QAEJ,wBAAwB;QACxB,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,+CAA+C,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAA;QACrG,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;IAC1B,CAAC;CAEF;AAxDD,oDAwDC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerAccount.js","sourceRoot":"","sources":["../../../../src/storages/messenger/messengerAccount.ts"],"names":[],"mappings":";;;AAKA,MAAsB,gBAAgB;CAUrC;AAVD,4CAUC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { MessengerAccount } from "./messengerAccount";
|
2
|
+
export declare abstract class MessengerAccounts {
|
3
|
+
abstract get collection(): MessengerAccount[];
|
4
|
+
abstract update(): Promise<void>;
|
5
|
+
abstract add(name: string, accountId: string, token: string, accountContext: string, referralUrl: string): Promise<void>;
|
6
|
+
abstract delete(id: string): Promise<void>;
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=messengerAccounts.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerAccounts.d.ts","sourceRoot":"","sources":["../../../../src/storages/messenger/messengerAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAGnD,8BAAsB,iBAAiB;IAErC,QAAQ,KAAK,UAAU,IAAI,gBAAgB,EAAE,CAAA;IAE7C,QAAQ,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAExH,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAC3C"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { MessengerAccounts } from "./messengerAccounts";
|
2
|
+
import { OrganizationImpl } from "../organizations/organization.impl";
|
3
|
+
import { Context } from "../../context";
|
4
|
+
import { MessengerAccount } from "./messengerAccount";
|
5
|
+
export declare class MessengerAccountsImpl extends MessengerAccounts {
|
6
|
+
readonly organization: OrganizationImpl;
|
7
|
+
readonly context: Context;
|
8
|
+
private _collection?;
|
9
|
+
constructor(organization: OrganizationImpl, context: Context);
|
10
|
+
get collection(): MessengerAccount[];
|
11
|
+
update(): Promise<void>;
|
12
|
+
add(name: string, accountId: string, token: string, accountContext: string, referralUrl: string): Promise<void>;
|
13
|
+
delete(id: string): Promise<void>;
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=messengerAccounts.impl.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerAccounts.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/messenger/messengerAccounts.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAC,gBAAgB,EAAC,MAAM,oCAAoC,CAAA;AACnE,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAA;AACrC,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAMnD,qBAAa,qBAAsB,SAAQ,iBAAiB;aAIxC,YAAY,EAAE,gBAAgB;aAC9B,OAAO,EAAE,OAAO;IAJlC,OAAO,CAAC,WAAW,CAAC,CAAwB;gBAG1B,YAAY,EAAE,gBAAgB,EAC9B,OAAO,EAAE,OAAO;IAIlC,IAAI,UAAU,IAAI,gBAAgB,EAAE,CAMnC;IAGK,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBvB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC/G,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA2BxC"}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.MessengerAccountsImpl = void 0;
|
4
|
+
const messengerAccounts_1 = require("./messengerAccounts");
|
5
|
+
const messengerAccount_impl_1 = require("./messengerAccount.impl");
|
6
|
+
const rpcService_1 = require("../../services/rpcService");
|
7
|
+
const responseUtils_1 = require("../../services/responseUtils");
|
8
|
+
class MessengerAccountsImpl extends messengerAccounts_1.MessengerAccounts {
|
9
|
+
constructor(organization, context) {
|
10
|
+
super();
|
11
|
+
this.organization = organization;
|
12
|
+
this.context = context;
|
13
|
+
}
|
14
|
+
get collection() {
|
15
|
+
if (this._collection !== undefined) {
|
16
|
+
return this._collection;
|
17
|
+
}
|
18
|
+
else {
|
19
|
+
throw new Error("Messenger accounts collection is not loaded, please update it first");
|
20
|
+
}
|
21
|
+
}
|
22
|
+
async update() {
|
23
|
+
var _a;
|
24
|
+
const response = await ((_a = this.context
|
25
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Messenger/list").searchParam("organizationId", this.organization.id).sendGet());
|
26
|
+
// check response status
|
27
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
28
|
+
await responseUtils_1.ResponseUtils.throwError(`Messenger accounts list for organization ${this.organization.id} failed`, response);
|
29
|
+
}
|
30
|
+
this._collection = [];
|
31
|
+
const accounts = (await response.json()).accounts;
|
32
|
+
this._collection = accounts.map(acc => new messengerAccount_impl_1.MessengerAccountImpl(this.context, acc.id, acc.name));
|
33
|
+
}
|
34
|
+
async add(name, accountId, token, accountContext, referralUrl) {
|
35
|
+
var _a;
|
36
|
+
if (name === undefined || name === null || name.trim() === "") {
|
37
|
+
throw new Error("Add messenger account, name can not be null or empty");
|
38
|
+
}
|
39
|
+
if (accountId === undefined || accountId === null || accountId.trim() === "") {
|
40
|
+
throw new Error("Add messenger account, accountId can not be null or empty");
|
41
|
+
}
|
42
|
+
if (token === undefined || token === null || token.trim() === "") {
|
43
|
+
throw new Error("Add messenger account, token can not be null or empty");
|
44
|
+
}
|
45
|
+
if (accountContext === undefined || accountContext === null) {
|
46
|
+
throw new Error("Add messenger account, accountContext can not be null or empty");
|
47
|
+
}
|
48
|
+
if (referralUrl === undefined || referralUrl === null) {
|
49
|
+
throw new Error("Add messenger account, referralUrl can not be null");
|
50
|
+
}
|
51
|
+
// send create request to the server
|
52
|
+
const response = await ((_a = this.context
|
53
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Messenger").sendPostJson({
|
54
|
+
name: name,
|
55
|
+
organizationId: this.organization.id,
|
56
|
+
token: token,
|
57
|
+
accountId: accountId,
|
58
|
+
accountContext: accountContext,
|
59
|
+
referralUrl: referralUrl
|
60
|
+
}));
|
61
|
+
// check response status
|
62
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
63
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to add messenger account in organization ${this.organization.id}`, response);
|
64
|
+
}
|
65
|
+
await this.update();
|
66
|
+
}
|
67
|
+
async delete(id) {
|
68
|
+
var _a, _b;
|
69
|
+
const account = (_a = this._collection) === null || _a === void 0 ? void 0 : _a.find(acc => acc.id === id);
|
70
|
+
// check if account is found
|
71
|
+
if (!account) {
|
72
|
+
throw new Error(`Messenger account ${id} is not found, organization: ${this.organization.id}`);
|
73
|
+
}
|
74
|
+
// send delete request to the server
|
75
|
+
const response = await ((_b = this.context
|
76
|
+
.resolve(rpcService_1.RpcService)) === null || _b === void 0 ? void 0 : _b.requestBuilder("api/v1/Messenger").searchParam("id", id).sendDelete());
|
77
|
+
// check response status
|
78
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
79
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to delete messenger account: ${id}, organization: ${this.organization.id}`, response);
|
80
|
+
}
|
81
|
+
await this.update();
|
82
|
+
}
|
83
|
+
}
|
84
|
+
exports.MessengerAccountsImpl = MessengerAccountsImpl;
|
85
|
+
//# sourceMappingURL=messengerAccounts.impl.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messengerAccounts.impl.js","sourceRoot":"","sources":["../../../../src/storages/messenger/messengerAccounts.impl.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AACrD,mEAA4D;AAI5D,0DAAoD;AACpD,gEAA0D;AAI1D,MAAa,qBAAsB,SAAQ,qCAAiB;IAG1D,YACkB,YAA8B,EAC9B,OAAgB;QAChC,KAAK,EAAE,CAAA;QAFS,iBAAY,GAAZ,YAAY,CAAkB;QAC9B,YAAO,GAAP,OAAO,CAAS;IAElC,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO,IAAI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