@neuralinnovations/dataisland-sdk 0.6.23 → 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/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/package.json +1 -1
- package/src/dto/instaResponse.ts +16 -5
- 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/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"}
|
@@ -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,O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AC1B,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,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S,EAAE,CAMvB;IAEK,kBAAkB;IAkBlB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IA+CvB,GAAG,CACP,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA4C5B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BjC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBpC,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,SAA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AE,CAAC,CAAA;QAEpD,4BAA4B;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,cAAc,EAAE,gCAAgC,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAA;QACzF,CAAC;QAED,oCAAoC;QACpC,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,mBAAmB,EACnC,WAAW,CAAC,QAAQ,EAAE,EAAE,EACxB,UAAU,EAAE,CAAA,CAAA;QAEf,wBAAwB;QACxB,IAAI,6BAAa,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"}
|
package/package.json
CHANGED
package/src/dto/instaResponse.ts
CHANGED
@@ -3,18 +3,22 @@
|
|
3
3
|
|
4
4
|
export interface InstaAccountDto {
|
5
5
|
id: string
|
6
|
-
name: string
|
7
|
-
enabled: boolean
|
8
6
|
organizationId: string
|
9
|
-
|
10
|
-
|
7
|
+
status: AccountStatus
|
8
|
+
enabled: boolean
|
9
|
+
username: string
|
10
|
+
twoFactorKey: string
|
11
|
+
proxy: string
|
11
12
|
additionalContext: string
|
12
13
|
folderId: string
|
14
|
+
error: string
|
13
15
|
}
|
14
16
|
|
17
|
+
|
15
18
|
export interface InstaCutAccountDto {
|
16
19
|
id: string
|
17
|
-
|
20
|
+
status: AccountStatus
|
21
|
+
username: string
|
18
22
|
enabled: boolean
|
19
23
|
}
|
20
24
|
|
@@ -45,3 +49,10 @@ export enum ContentStatus {
|
|
45
49
|
Finished = 1,
|
46
50
|
Error = 2
|
47
51
|
}
|
52
|
+
|
53
|
+
export enum AccountStatus {
|
54
|
+
None = 0,
|
55
|
+
Created = 1,
|
56
|
+
Authenticated = 2,
|
57
|
+
Error = 3
|
58
|
+
}
|
@@ -1,56 +1,75 @@
|
|
1
1
|
import {InstaAccount, InstaAccountId} from "./instaAccount"
|
2
|
-
import {InstaAccountDto} from "../../dto/instaResponse"
|
2
|
+
import {AccountStatus, InstaAccountDto,InstaCutAccountDto} from "../../dto/instaResponse"
|
3
3
|
import {RpcService} from "../../services/rpcService"
|
4
4
|
import {ResponseUtils} from "../../services/responseUtils"
|
5
5
|
import {Context} from "../../context"
|
6
6
|
|
7
7
|
|
8
8
|
export class InstaAccountImpl extends InstaAccount {
|
9
|
-
private readonly
|
9
|
+
private readonly _cutData: InstaCutAccountDto
|
10
10
|
|
11
|
-
constructor(private readonly context: Context,
|
11
|
+
constructor(private readonly context: Context, accountCut: InstaCutAccountDto) {
|
12
12
|
super()
|
13
13
|
|
14
|
-
this.
|
14
|
+
this._cutData = accountCut
|
15
15
|
}
|
16
16
|
|
17
17
|
get id(): InstaAccountId{
|
18
|
-
return this.
|
18
|
+
return this._cutData.id
|
19
|
+
}
|
20
|
+
|
21
|
+
get username(): InstaAccountId{
|
22
|
+
return this._cutData.username
|
23
|
+
}
|
24
|
+
|
25
|
+
get status(): AccountStatus{
|
26
|
+
return this._cutData.status
|
19
27
|
}
|
20
28
|
|
21
29
|
async data(): Promise<InstaAccountDto> {
|
22
30
|
const response = await this.context
|
23
31
|
.resolve(RpcService)
|
24
32
|
?.requestBuilder("api/v1/Insta")
|
25
|
-
.searchParam("instaId", this.
|
33
|
+
.searchParam("instaId", this._cutData.id)
|
26
34
|
.sendGet()
|
27
35
|
|
28
36
|
// check response status
|
29
37
|
if (ResponseUtils.isFail(response)) {
|
30
|
-
await ResponseUtils.throwError(`Failed to get insta account data with id ${this.
|
38
|
+
await ResponseUtils.throwError(`Failed to get insta account data with id ${this._cutData.id}`, response)
|
31
39
|
}
|
32
40
|
|
33
41
|
return (await response!.json() as { instaAccount: InstaAccountDto }).instaAccount
|
34
42
|
}
|
35
43
|
|
36
|
-
async update(
|
44
|
+
async update(
|
45
|
+
enabled: boolean,
|
46
|
+
relogin: boolean,
|
47
|
+
username: string,
|
48
|
+
password: string,
|
49
|
+
twoFactorKey: string,
|
50
|
+
proxy: string,
|
51
|
+
additionalContext: string,
|
52
|
+
folderId: string
|
53
|
+
): Promise<InstaAccountDto> {
|
37
54
|
// send request to the server
|
38
55
|
const response = await this.context
|
39
56
|
.resolve(RpcService)
|
40
57
|
?.requestBuilder("api/v1/Insta")
|
41
58
|
.sendPutJson({
|
42
|
-
instaId: this.
|
59
|
+
instaId: this._cutData.id,
|
43
60
|
enabled: enabled,
|
44
|
-
|
61
|
+
relogin: relogin,
|
62
|
+
username: username,
|
63
|
+
password: password,
|
64
|
+
twoFactorKey: twoFactorKey,
|
65
|
+
proxy: proxy,
|
45
66
|
additionalContext: additionalContext,
|
46
|
-
folderId: folderId
|
47
|
-
token: token,
|
48
|
-
proxy: proxy
|
67
|
+
folderId: folderId
|
49
68
|
})
|
50
69
|
|
51
70
|
// check response status
|
52
71
|
if (ResponseUtils.isFail(response)) {
|
53
|
-
await ResponseUtils.throwError(`Failed to update insta account with ID: ${this.
|
72
|
+
await ResponseUtils.throwError(`Failed to update insta account with ID: ${this._cutData.id}`, response)
|
54
73
|
}
|
55
74
|
|
56
75
|
return await this.data()
|
@@ -10,7 +10,16 @@ export abstract class InstaAccount {
|
|
10
10
|
|
11
11
|
abstract data(): Promise<InstaAccountDto>
|
12
12
|
|
13
|
-
abstract update(
|
13
|
+
abstract update(
|
14
|
+
enabled: boolean,
|
15
|
+
relogin: boolean,
|
16
|
+
username: string,
|
17
|
+
password: string,
|
18
|
+
twoFactorKey: string,
|
19
|
+
proxy: string,
|
20
|
+
additionalContext: string,
|
21
|
+
folderId: string
|
22
|
+
): Promise<InstaAccountDto>
|
14
23
|
|
15
24
|
}
|
16
25
|
|
@@ -81,7 +81,7 @@ export class InstaAccountsImpl extends InstaAccounts {
|
|
81
81
|
|
82
82
|
this._accounts = []
|
83
83
|
const accounts = (await response!.json() as {instaAccounts: InstaCutAccountDto[]}).instaAccounts
|
84
|
-
this._accounts = accounts.map(acc => new InstaAccountImpl(this.context, acc
|
84
|
+
this._accounts = accounts.map(acc => new InstaAccountImpl(this.context, acc))
|
85
85
|
|
86
86
|
const postsResponse = await this.context
|
87
87
|
.resolve(RpcService)
|
@@ -111,15 +111,21 @@ export class InstaAccountsImpl extends InstaAccounts {
|
|
111
111
|
}
|
112
112
|
}
|
113
113
|
|
114
|
-
async add(
|
115
|
-
|
116
|
-
|
114
|
+
async add(
|
115
|
+
username: string,
|
116
|
+
password: string,
|
117
|
+
twoFactorKey: string,
|
118
|
+
proxy: string,
|
119
|
+
additionalContext: string,
|
120
|
+
folderId: string): Promise<void> {
|
121
|
+
if (username === undefined || username === null || username.trim() === "") {
|
122
|
+
throw new Error("Add insta account, username can not be null or empty")
|
117
123
|
}
|
118
|
-
if (
|
119
|
-
throw new Error("Add insta account,
|
124
|
+
if (password === undefined || password === null || password.trim() === "") {
|
125
|
+
throw new Error("Add insta account, password can not be null or empty")
|
120
126
|
}
|
121
|
-
if (
|
122
|
-
throw new Error("Add insta account,
|
127
|
+
if (twoFactorKey === undefined || twoFactorKey === null || twoFactorKey.trim() === "") {
|
128
|
+
throw new Error("Add insta account, twoFactorKey can not be null or empty")
|
123
129
|
}
|
124
130
|
if (proxy === undefined || proxy === null) {
|
125
131
|
throw new Error("Add insta account, proxy can not be null or empty")
|
@@ -136,10 +142,10 @@ export class InstaAccountsImpl extends InstaAccounts {
|
|
136
142
|
.resolve(RpcService)
|
137
143
|
?.requestBuilder("api/v1/Insta")
|
138
144
|
.sendPostJson({
|
139
|
-
name: name,
|
140
145
|
organizationId: this.organization.id,
|
141
|
-
|
142
|
-
|
146
|
+
username: username,
|
147
|
+
password: password,
|
148
|
+
twoFactorKey: twoFactorKey,
|
143
149
|
proxy: proxy,
|
144
150
|
additionalContext: additionalContext,
|
145
151
|
folderId: folderId
|
@@ -11,7 +11,14 @@ export abstract class InstaAccounts {
|
|
11
11
|
|
12
12
|
abstract update(): Promise<void>
|
13
13
|
|
14
|
-
abstract add(
|
14
|
+
abstract add(
|
15
|
+
username: string,
|
16
|
+
password: string,
|
17
|
+
twoFactorKey: string,
|
18
|
+
proxy: string,
|
19
|
+
additionalContext: string,
|
20
|
+
folderId: string
|
21
|
+
): Promise<void>
|
15
22
|
|
16
23
|
abstract delete(id: string): Promise<void>
|
17
24
|
|