intercom-client 2.11.2 → 3.0.1
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/README.md +863 -404
- package/dist/admin/admin.types.d.ts +13 -0
- package/dist/admin/admin.types.d.ts.map +1 -0
- package/dist/admin/admin.types.js +3 -0
- package/dist/admin/admin.types.js.map +1 -0
- package/dist/admin.d.ts +48 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +40 -44
- package/dist/admin.js.map +1 -0
- package/dist/article/article.types.d.ts +87 -0
- package/dist/article/article.types.d.ts.map +1 -0
- package/dist/article/article.types.js +45 -0
- package/dist/article/article.types.js.map +1 -0
- package/dist/article.d.ts +37 -0
- package/dist/article.d.ts.map +1 -0
- package/dist/article.js +69 -0
- package/dist/article.js.map +1 -0
- package/dist/client.d.ts +71 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +235 -237
- package/dist/client.js.map +1 -0
- package/dist/common/common.types.d.ts +64 -0
- package/dist/common/common.types.d.ts.map +1 -0
- package/dist/common/common.types.js +29 -0
- package/dist/common/common.types.js.map +1 -0
- package/dist/company/company.types.d.ts +37 -0
- package/dist/company/company.types.d.ts.map +1 -0
- package/dist/company/company.types.js +3 -0
- package/dist/company/company.types.js.map +1 -0
- package/dist/company.d.ts +63 -0
- package/dist/company.d.ts.map +1 -0
- package/dist/company.js +110 -81
- package/dist/company.js.map +1 -0
- package/dist/contact/contact.types.d.ts +80 -0
- package/dist/contact/contact.types.d.ts.map +1 -0
- package/dist/contact/contact.types.js +3 -0
- package/dist/contact/contact.types.js.map +1 -0
- package/dist/contact.d.ts +126 -0
- package/dist/contact.d.ts.map +1 -0
- package/dist/contact.js +155 -79
- package/dist/contact.js.map +1 -0
- package/dist/conversation/conversation.types.d.ts +144 -0
- package/dist/conversation/conversation.types.d.ts.map +1 -0
- package/dist/conversation/conversation.types.js +50 -0
- package/dist/conversation/conversation.types.js.map +1 -0
- package/dist/conversation.d.ts +176 -0
- package/dist/conversation.d.ts.map +1 -0
- package/dist/conversation.js +287 -46
- package/dist/conversation.js.map +1 -0
- package/dist/dataAttribute/dataAttribute.types.d.ts +32 -0
- package/dist/dataAttribute/dataAttribute.types.d.ts.map +1 -0
- package/dist/dataAttribute/dataAttribute.types.js +18 -0
- package/dist/dataAttribute/dataAttribute.types.js.map +1 -0
- package/dist/dataAttribute.d.ts +33 -0
- package/dist/dataAttribute.d.ts.map +1 -0
- package/dist/dataAttribute.js +49 -0
- package/dist/dataAttribute.js.map +1 -0
- package/dist/errors/badResponse.error.d.ts +9 -0
- package/dist/errors/badResponse.error.d.ts.map +1 -0
- package/dist/errors/badResponse.error.js +21 -0
- package/dist/errors/badResponse.error.js.map +1 -0
- package/dist/event/event.types.d.ts +29 -0
- package/dist/event/event.types.d.ts.map +1 -0
- package/dist/event/event.types.js +3 -0
- package/dist/event/event.types.js.map +1 -0
- package/dist/event.d.ts +41 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +42 -43
- package/dist/event.js.map +1 -0
- package/dist/helpCenter/helpCenter.types.d.ts +23 -0
- package/dist/helpCenter/helpCenter.types.d.ts.map +1 -0
- package/dist/helpCenter/helpCenter.types.js +3 -0
- package/dist/helpCenter/helpCenter.types.js.map +1 -0
- package/dist/helpCenter.d.ts +61 -0
- package/dist/helpCenter.d.ts.map +1 -0
- package/dist/helpCenter.js +121 -0
- package/dist/helpCenter.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -74
- package/dist/index.js.map +1 -0
- package/dist/message/message.types.d.ts +17 -0
- package/dist/message/message.types.d.ts.map +1 -0
- package/dist/message/message.types.js +11 -0
- package/dist/message/message.types.js.map +1 -0
- package/dist/message.d.ts +30 -0
- package/dist/message.d.ts.map +1 -0
- package/dist/message.js +32 -29
- package/dist/message.js.map +1 -0
- package/dist/package.json +59 -0
- package/dist/scroll.d.ts +24 -0
- package/dist/scroll.d.ts.map +1 -0
- package/dist/scroll.js +67 -77
- package/dist/scroll.js.map +1 -0
- package/dist/segment/segment.types.d.ts +11 -0
- package/dist/segment/segment.types.d.ts.map +1 -0
- package/dist/segment/segment.types.js +3 -0
- package/dist/segment/segment.types.js.map +1 -0
- package/dist/segment.d.ts +22 -0
- package/dist/segment.d.ts.map +1 -0
- package/dist/segment.js +26 -34
- package/dist/segment.js.map +1 -0
- package/dist/subscription/subscription.types.d.ts +19 -0
- package/dist/subscription/subscription.types.d.ts.map +1 -0
- package/dist/subscription/subscription.types.js +10 -0
- package/dist/subscription/subscription.types.js.map +1 -0
- package/dist/tag/tag.types.d.ts +6 -0
- package/dist/tag/tag.types.d.ts.map +1 -0
- package/dist/tag/tag.types.js +3 -0
- package/dist/tag/tag.types.js.map +1 -0
- package/dist/tag.d.ts +52 -0
- package/dist/tag.d.ts.map +1 -0
- package/dist/tag.js +93 -55
- package/dist/tag.js.map +1 -0
- package/dist/team/team.types.d.ts +7 -0
- package/dist/team/team.types.d.ts.map +1 -0
- package/dist/team/team.types.js +3 -0
- package/dist/team/team.types.js.map +1 -0
- package/dist/team.d.ts +18 -0
- package/dist/team.d.ts.map +1 -0
- package/dist/team.js +23 -0
- package/dist/team.js.map +1 -0
- package/dist/util/time.d.ts +3 -0
- package/dist/util/time.d.ts.map +1 -0
- package/dist/util/time.js +6 -0
- package/dist/util/time.js.map +1 -0
- package/dist/util/url.d.ts +3 -0
- package/dist/util/url.d.ts.map +1 -0
- package/dist/util/url.js +9 -0
- package/dist/util/url.js.map +1 -0
- package/package.json +57 -49
- package/dist/bulk.js +0 -53
- package/dist/counts.js +0 -86
- package/dist/customer.js +0 -31
- package/dist/note.js +0 -41
- package/dist/snippet.js +0 -119
- package/dist/user-data.js +0 -103
- package/dist/user.js +0 -118
- package/dist/visitor.js +0 -52
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "intercom-client",
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "Official Node bindings to the Intercom API",
|
|
5
|
+
"homepage": "https://github.com/intercom/intercom-node",
|
|
6
|
+
"bugs:": "https://github.com/intercom/intercom-node/issues",
|
|
7
|
+
"repository": "intercom/intercom-node",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Bob Long",
|
|
10
|
+
"email": "bob@intercom.io"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"intercom",
|
|
18
|
+
"api"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"axios": "^0.24.0",
|
|
22
|
+
"htmlencode": "^0.0.4",
|
|
23
|
+
"lodash": "^4.17.21"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
27
|
+
"@types/lodash": "^4.14.176",
|
|
28
|
+
"@types/mocha": "^9.1.0",
|
|
29
|
+
"@types/node": "^16.11.6",
|
|
30
|
+
"@types/sinon": "^10.0.6",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
|
32
|
+
"@typescript-eslint/parser": "^5.7.0",
|
|
33
|
+
"eslint": "^8.2.0",
|
|
34
|
+
"eslint-config-prettier": "^8.3.0",
|
|
35
|
+
"merge2": "^1.4.1",
|
|
36
|
+
"mocha": "^9.2.0",
|
|
37
|
+
"nock": "^13.0.11",
|
|
38
|
+
"nyc": "^15.1.0",
|
|
39
|
+
"prettier": "^2.5.1",
|
|
40
|
+
"sinon": "^7.3.2",
|
|
41
|
+
"ts-node": "^10.4.0",
|
|
42
|
+
"tslib": "^2.3.1",
|
|
43
|
+
"typescript": "^4.5.3"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"clean": "rm -r -f dist",
|
|
47
|
+
"static": "eslint .",
|
|
48
|
+
"compile_ts": "tsc",
|
|
49
|
+
"move_compiled_to_dist": "mv dist/lib/* dist && rmdir dist/lib",
|
|
50
|
+
"prepublish": "yarn clean && yarn static && yarn compile_ts && yarn move_compiled_to_dist",
|
|
51
|
+
"test": "mocha -r ts-node/register test/*.ts",
|
|
52
|
+
"coverage": "nyc yarn test"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">= v8.0.0"
|
|
56
|
+
},
|
|
57
|
+
"license": "Apache-2.0",
|
|
58
|
+
"packageManager": "yarn@3.1.1"
|
|
59
|
+
}
|
package/dist/scroll.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
export default class Scroll<EntityType> {
|
|
3
|
+
private readonly client;
|
|
4
|
+
private readonly scrollUrlDataType;
|
|
5
|
+
private scrollParam?;
|
|
6
|
+
constructor(client: Client, scrollUrlDataType: string, scrollParam?: string | undefined);
|
|
7
|
+
each(params: EachData): Promise<EntityType[]>;
|
|
8
|
+
eachInternal(storedData?: EntityType[]): Promise<EntityType[]>;
|
|
9
|
+
next({ scrollParam, }: NextData): Promise<ScrollableResponse<EntityType>>;
|
|
10
|
+
scrollUrl(): string;
|
|
11
|
+
}
|
|
12
|
+
interface ScrollableResponse<EntityType> {
|
|
13
|
+
type: 'list';
|
|
14
|
+
data: EntityType[];
|
|
15
|
+
pages: number | null;
|
|
16
|
+
total_count: number | null;
|
|
17
|
+
scroll_param?: string;
|
|
18
|
+
}
|
|
19
|
+
interface EachData {
|
|
20
|
+
scrollParam?: string;
|
|
21
|
+
}
|
|
22
|
+
declare type NextData = EachData;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../lib/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,MAAM,CAAC,UAAU;IAE9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,WAAW,CAAC;gBAFH,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,MAAM,EAClC,WAAW,CAAC,oBAAQ;IAM1B,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAM7C,YAAY,CAAC,UAAU,GAAE,UAAU,EAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAelE,IAAI,CAAC,EACP,WAAW,GACd,EAAE,QAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAUrD,SAAS;CAOZ;AAED,UAAU,kBAAkB,CAAC,UAAU;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,QAAQ;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,aAAK,QAAQ,GAAG,QAAQ,CAAC"}
|
package/dist/scroll.js
CHANGED
|
@@ -1,80 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
-
|
|
14
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
15
|
-
|
|
16
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
17
|
-
|
|
18
|
-
var Scroll = /*#__PURE__*/function () {
|
|
19
|
-
function Scroll(client, dataType) {
|
|
20
|
-
_classCallCheck(this, Scroll);
|
|
21
|
-
|
|
22
|
-
this.client = client;
|
|
23
|
-
this.dataType = dataType;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
_createClass(Scroll, [{
|
|
27
|
-
key: "each",
|
|
28
|
-
value: function each(params, f) {
|
|
29
|
-
var self = this;
|
|
30
|
-
this.scroll_param = undefined;
|
|
31
|
-
return new _bluebird["default"](function (resolve, reject) {
|
|
32
|
-
self.eachInternal(params, f, {
|
|
33
|
-
resolve: resolve,
|
|
34
|
-
reject: reject
|
|
35
|
-
});
|
|
36
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var Scroll = /** @class */ (function () {
|
|
5
|
+
function Scroll(client, scrollUrlDataType, scrollParam) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.scrollUrlDataType = scrollUrlDataType;
|
|
8
|
+
this.scrollParam = scrollParam;
|
|
9
|
+
this.client = client;
|
|
10
|
+
this.scrollParam = scrollParam;
|
|
37
11
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (response.body["".concat(self.dataType, "s")].length > 0) {
|
|
46
|
-
self.scroll_param = response.body.scroll_param;
|
|
47
|
-
|
|
48
|
-
if (result && 'then' in result && typeof result.then === 'function') {
|
|
49
|
-
result.then(function () {
|
|
50
|
-
self.eachInternal(params, f, promise);
|
|
51
|
-
}, function (error) {
|
|
52
|
-
promise.reject(error);
|
|
12
|
+
Scroll.prototype.each = function (params) {
|
|
13
|
+
var _a;
|
|
14
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
15
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
16
|
+
this.scrollParam = (_a = params.scrollParam) !== null && _a !== void 0 ? _a : undefined;
|
|
17
|
+
return [2 /*return*/, this.eachInternal()];
|
|
53
18
|
});
|
|
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
|
-
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
Scroll.prototype.eachInternal = function (storedData) {
|
|
22
|
+
if (storedData === void 0) { storedData = []; }
|
|
23
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
24
|
+
var response, dataFromResponse, combinedData;
|
|
25
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
26
|
+
switch (_a.label) {
|
|
27
|
+
case 0: return [4 /*yield*/, this.client.get({
|
|
28
|
+
url: this.scrollUrl(),
|
|
29
|
+
})];
|
|
30
|
+
case 1:
|
|
31
|
+
response = _a.sent();
|
|
32
|
+
dataFromResponse = response.data;
|
|
33
|
+
combinedData = (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(dataFromResponse), false), (0, tslib_1.__read)(storedData), false);
|
|
34
|
+
if (dataFromResponse.length > 0) {
|
|
35
|
+
this.scrollParam = response.scroll_param;
|
|
36
|
+
return [2 /*return*/, this.eachInternal(combinedData)];
|
|
37
|
+
}
|
|
38
|
+
return [2 /*return*/, combinedData];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
Scroll.prototype.next = function (_a) {
|
|
44
|
+
var scrollParam = _a.scrollParam;
|
|
45
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
46
|
+
var response;
|
|
47
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
48
|
+
switch (_b.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
this.scrollParam = scrollParam;
|
|
51
|
+
return [4 /*yield*/, this.client.get({
|
|
52
|
+
url: this.scrollUrl(),
|
|
53
|
+
})];
|
|
54
|
+
case 1:
|
|
55
|
+
response = _b.sent();
|
|
56
|
+
return [2 /*return*/, response];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
Scroll.prototype.scrollUrl = function () {
|
|
62
|
+
var baseScrollUrl = "/".concat(this.scrollUrlDataType, "/scroll");
|
|
63
|
+
return this.scrollParam && this.scrollParam.length > 0
|
|
64
|
+
? "".concat(baseScrollUrl, "?scroll_param=").concat(this.scrollParam)
|
|
65
|
+
: baseScrollUrl;
|
|
66
|
+
};
|
|
67
|
+
return Scroll;
|
|
68
|
+
}());
|
|
69
|
+
exports.default = Scroll;
|
|
70
|
+
//# sourceMappingURL=scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../lib/scroll.ts"],"names":[],"mappings":";;;AAEA;IACI,gBACqB,MAAc,EACd,iBAAyB,EAClC,WAAoB;QAFX,WAAM,GAAN,MAAM,CAAQ;QACd,sBAAiB,GAAjB,iBAAiB,CAAQ;QAClC,gBAAW,GAAX,WAAW,CAAS;QAE5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAEK,qBAAI,GAAV,UAAW,MAAgB;;;;gBACvB,IAAI,CAAC,WAAW,GAAG,MAAA,MAAM,CAAC,WAAW,mCAAI,SAAS,CAAC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+
export declare type SegmentObject = {
|
|
3
|
+
type: 'segment';
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
created_at: Timestamp;
|
|
7
|
+
updated_at: Timestamp;
|
|
8
|
+
person_type: Role;
|
|
9
|
+
count?: number;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=segment.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.types.d.ts","sourceRoot":"","sources":["../../../lib/segment/segment.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEzD,oBAAY,aAAa,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;IACtB,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.types.js","sourceRoot":"","sources":["../../../lib/segment/segment.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { SegmentObject } from './segment/segment.types';
|
|
3
|
+
export default class Segment {
|
|
4
|
+
private readonly client;
|
|
5
|
+
readonly baseUrl = "segments";
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
list({ includeCount: include_count }: ListData): Promise<ListResponse>;
|
|
8
|
+
find({ id, includeCount: include_count }: FindSegmentData): Promise<SegmentObject>;
|
|
9
|
+
}
|
|
10
|
+
interface ListData {
|
|
11
|
+
includeCount?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface ListResponse {
|
|
14
|
+
type: 'segment.list';
|
|
15
|
+
segments: SegmentObject[];
|
|
16
|
+
}
|
|
17
|
+
interface FindSegmentData {
|
|
18
|
+
id: string;
|
|
19
|
+
includeCount?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=segment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../lib/segment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,OAAO;IAGZ,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,cAAc;gBAER,MAAM,EAAE,MAAM;IAG3C,IAAI,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE,QAAQ;IAQ9C,IAAI,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE,eAAe;CAQ5D;AAED,UAAU,QAAQ;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AACD,UAAU,YAAY;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,UAAU,eAAe;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B"}
|
package/dist/segment.js
CHANGED
|
@@ -1,36 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
-
|
|
10
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
11
|
-
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
13
|
-
|
|
14
|
-
var Segment = /*#__PURE__*/function () {
|
|
15
|
-
function Segment(client) {
|
|
16
|
-
_classCallCheck(this, Segment);
|
|
17
|
-
|
|
18
|
-
this.client = client;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
_createClass(Segment, [{
|
|
22
|
-
key: "list",
|
|
23
|
-
value: function list(f) {
|
|
24
|
-
return this.client.get('/segments', {}, f);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Segment = /** @class */ (function () {
|
|
4
|
+
function Segment(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.baseUrl = 'segments';
|
|
7
|
+
this.client = client;
|
|
25
8
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
Segment.prototype.list = function (_a) {
|
|
10
|
+
var include_count = _a.includeCount;
|
|
11
|
+
var params = { include_count: include_count };
|
|
12
|
+
return this.client.get({
|
|
13
|
+
url: "/".concat(this.baseUrl),
|
|
14
|
+
params: params,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
Segment.prototype.find = function (_a) {
|
|
18
|
+
var id = _a.id, include_count = _a.includeCount;
|
|
19
|
+
var params = { include_count: include_count };
|
|
20
|
+
return this.client.get({
|
|
21
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
22
|
+
params: params,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
return Segment;
|
|
26
|
+
}());
|
|
27
|
+
exports.default = Segment;
|
|
28
|
+
//# sourceMappingURL=segment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.js","sourceRoot":"","sources":["../../lib/segment.ts"],"names":[],"mappings":";;AAGA;IAGI,iBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,UAAU,CAAC;QAGjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,sBAAI,GAAJ,UAAK,EAAyC;YAAzB,aAAa,kBAAA;QAC9B,IAAM,MAAM,GAAG,EAAE,aAAa,eAAA,EAAE,CAAC;QAEjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe;YACjC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;YACvB,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;IACD,sBAAI,GAAJ,UAAK,EAAoD;YAAlD,EAAE,QAAA,EAAgB,aAAa,kBAAA;QAClC,IAAM,MAAM,GAAG,EAAE,aAAa,eAAA,EAAE,CAAC;QAEjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB;YAClC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE;YAC7B,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;IACL,cAAC;AAAD,CAAC,AAtBD,IAsBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare type SubscriptionObject = {
|
|
2
|
+
type: 'subscription';
|
|
3
|
+
id: string;
|
|
4
|
+
state: SubscriptionState;
|
|
5
|
+
default_translation: TranslationObject;
|
|
6
|
+
translations: TranslationObject[];
|
|
7
|
+
consent_type: 'opt_out';
|
|
8
|
+
};
|
|
9
|
+
export declare enum SubscriptionState {
|
|
10
|
+
ARCHIVED = "archived",
|
|
11
|
+
DRAFT = "draft",
|
|
12
|
+
LIVE = "live"
|
|
13
|
+
}
|
|
14
|
+
export declare type TranslationObject = {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
locale: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=subscription.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.types.d.ts","sourceRoot":"","sources":["../../../lib/subscription/subscription.types.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB,GAAG;IAC7B,IAAI,EAAE,cAAc,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,iBAAiB,CAAC;IACzB,mBAAmB,EAAE,iBAAiB,CAAC;IACvC,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,YAAY,EAAE,SAAS,CAAC;CAC3B,CAAC;AAEF,oBAAY,iBAAiB;IACzB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;CAChB;AAED,oBAAY,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionState = void 0;
|
|
4
|
+
var SubscriptionState;
|
|
5
|
+
(function (SubscriptionState) {
|
|
6
|
+
SubscriptionState["ARCHIVED"] = "archived";
|
|
7
|
+
SubscriptionState["DRAFT"] = "draft";
|
|
8
|
+
SubscriptionState["LIVE"] = "live";
|
|
9
|
+
})(SubscriptionState = exports.SubscriptionState || (exports.SubscriptionState = {}));
|
|
10
|
+
//# sourceMappingURL=subscription.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.types.js","sourceRoot":"","sources":["../../../lib/subscription/subscription.types.ts"],"names":[],"mappings":";;;AASA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,0CAAqB,CAAA;IACrB,oCAAe,CAAA;IACf,kCAAa,CAAA;AACjB,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.types.d.ts","sourceRoot":"","sources":["../../../lib/tag/tag.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.types.js","sourceRoot":"","sources":["../../../lib/tag/tag.types.ts"],"names":[],"mappings":""}
|
package/dist/tag.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { TagObject } from './tag/tag.types';
|
|
3
|
+
export default class Tag {
|
|
4
|
+
private readonly client;
|
|
5
|
+
private tagsBaseUrl;
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
create(data: CreateTagData): Promise<TagObject>;
|
|
8
|
+
update(data: UpdateTagData): Promise<TagObject>;
|
|
9
|
+
delete({ id }: DeleteTagData): Promise<TagObject>;
|
|
10
|
+
tagContact({ contactId, tagId }: TagContactData): Promise<TagObject>;
|
|
11
|
+
tagConversation({ conversationId, tagId, adminId: admin_id, }: TagConversationData): Promise<TagObject>;
|
|
12
|
+
tagCompanies({ tagName: name, companiesIds }: TagCompaniesData): Promise<TagObject>;
|
|
13
|
+
untagContact({ contactId, tagId }: UntagContactData): Promise<TagObject>;
|
|
14
|
+
untagConversation({ conversationId, tagId, adminId: admin_id, }: UntagConversationData): Promise<TagObject>;
|
|
15
|
+
untagCompanies({ tagName: name, companiesIds }: UntagCompaniesData): Promise<TagObject>;
|
|
16
|
+
list(): Promise<ListAllTagsResponse>;
|
|
17
|
+
}
|
|
18
|
+
interface CreateTagData {
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
interface UpdateTagData extends CreateTagData {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
interface DeleteTagData {
|
|
25
|
+
id: string;
|
|
26
|
+
}
|
|
27
|
+
interface TagContactData {
|
|
28
|
+
contactId: string;
|
|
29
|
+
tagId: string;
|
|
30
|
+
}
|
|
31
|
+
interface TagConversationData {
|
|
32
|
+
conversationId: string;
|
|
33
|
+
tagId: string;
|
|
34
|
+
adminId: string;
|
|
35
|
+
}
|
|
36
|
+
interface TagCompaniesData {
|
|
37
|
+
tagName: string;
|
|
38
|
+
companiesIds: string[];
|
|
39
|
+
}
|
|
40
|
+
declare type UntagContactData = TagContactData;
|
|
41
|
+
interface UntagConversationData {
|
|
42
|
+
tagId: string;
|
|
43
|
+
conversationId: string;
|
|
44
|
+
adminId: string;
|
|
45
|
+
}
|
|
46
|
+
declare type UntagCompaniesData = TagCompaniesData;
|
|
47
|
+
interface ListAllTagsResponse {
|
|
48
|
+
type: 'list';
|
|
49
|
+
data: Array<TagObject>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../lib/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,GAAG;IAGR,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,WAAW,CAAU;gBAEA,MAAM,EAAE,MAAM;IAI3C,MAAM,CAAC,IAAI,EAAE,aAAa;IAM1B,MAAM,CAAC,IAAI,EAAE,aAAa;IAM1B,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,aAAa;IAK5B,UAAU,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,cAAc;IAS/C,eAAe,CAAC,EACZ,cAAc,EACd,KAAK,EACL,OAAO,EAAE,QAAQ,GACpB,EAAE,mBAAmB;IAWtB,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,gBAAgB;IAW9D,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,gBAAgB;IAKnD,iBAAiB,CAAC,EACd,cAAc,EACd,KAAK,EACL,OAAO,EAAE,QAAQ,GACpB,EAAE,qBAAqB;IAWxB,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,kBAAkB;IAWlE,IAAI;CAKP;AAED,UAAU,aAAa;IACnB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,aAAc,SAAQ,aAAa;IACzC,EAAE,EAAE,MAAM,CAAC;CACd;AAED,UAAU,aAAa;IACnB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,UAAU,cAAc;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,mBAAmB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,gBAAgB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,aAAK,gBAAgB,GAAG,cAAc,CAAC;AAEvC,UAAU,qBAAqB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,aAAK,kBAAkB,GAAG,gBAAgB,CAAC;AAE3C,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC1B"}
|
package/dist/tag.js
CHANGED
|
@@ -1,57 +1,95 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
-
|
|
10
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
11
|
-
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
13
|
-
|
|
14
|
-
var Tag = /*#__PURE__*/function () {
|
|
15
|
-
function Tag(client) {
|
|
16
|
-
_classCallCheck(this, Tag);
|
|
17
|
-
|
|
18
|
-
this.client = client;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
_createClass(Tag, [{
|
|
22
|
-
key: "create",
|
|
23
|
-
value: function create(data, f) {
|
|
24
|
-
return this.client.post('/tags', data, f);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Tag = /** @class */ (function () {
|
|
4
|
+
function Tag(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.tagsBaseUrl = 'tags';
|
|
7
|
+
this.client = client;
|
|
25
8
|
}
|
|
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
|
-
|
|
9
|
+
Tag.prototype.create = function (data) {
|
|
10
|
+
return this.client.post({
|
|
11
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
12
|
+
data: data,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
Tag.prototype.update = function (data) {
|
|
16
|
+
return this.client.post({
|
|
17
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
18
|
+
data: data,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
Tag.prototype.delete = function (_a) {
|
|
22
|
+
var id = _a.id;
|
|
23
|
+
return this.client.delete({
|
|
24
|
+
url: "/".concat(this.tagsBaseUrl, "/").concat(id),
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
Tag.prototype.tagContact = function (_a) {
|
|
28
|
+
var contactId = _a.contactId, tagId = _a.tagId;
|
|
29
|
+
var data = {
|
|
30
|
+
id: tagId,
|
|
31
|
+
};
|
|
32
|
+
return this.client.post({
|
|
33
|
+
url: "/".concat(this.client.contacts.baseUrl, "/").concat(contactId, "/").concat(this.tagsBaseUrl),
|
|
34
|
+
data: data,
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
Tag.prototype.tagConversation = function (_a) {
|
|
38
|
+
var conversationId = _a.conversationId, tagId = _a.tagId, admin_id = _a.adminId;
|
|
39
|
+
var data = {
|
|
40
|
+
id: tagId,
|
|
41
|
+
admin_id: admin_id,
|
|
42
|
+
};
|
|
43
|
+
return this.client.post({
|
|
44
|
+
url: "/".concat(this.client.conversations.baseUrl, "/").concat(conversationId, "/").concat(this.tagsBaseUrl),
|
|
45
|
+
data: data,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
Tag.prototype.tagCompanies = function (_a) {
|
|
49
|
+
var name = _a.tagName, companiesIds = _a.companiesIds;
|
|
50
|
+
var data = {
|
|
51
|
+
name: name,
|
|
52
|
+
companies: companiesIds.map(function (id) { return ({ id: id }); }),
|
|
53
|
+
};
|
|
54
|
+
return this.client.post({
|
|
55
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
56
|
+
data: data,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
Tag.prototype.untagContact = function (_a) {
|
|
60
|
+
var contactId = _a.contactId, tagId = _a.tagId;
|
|
61
|
+
return this.client.delete({
|
|
62
|
+
url: "/".concat(this.client.contacts.baseUrl, "/").concat(contactId, "/").concat(this.tagsBaseUrl, "/").concat(tagId),
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
Tag.prototype.untagConversation = function (_a) {
|
|
66
|
+
var conversationId = _a.conversationId, tagId = _a.tagId, admin_id = _a.adminId;
|
|
67
|
+
var data = {
|
|
68
|
+
id: tagId,
|
|
69
|
+
admin_id: admin_id,
|
|
70
|
+
};
|
|
71
|
+
return this.client.delete({
|
|
72
|
+
url: "/".concat(this.client.conversations.baseUrl, "/").concat(conversationId, "/").concat(this.tagsBaseUrl, "/").concat(tagId),
|
|
73
|
+
data: data,
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
Tag.prototype.untagCompanies = function (_a) {
|
|
77
|
+
var name = _a.tagName, companiesIds = _a.companiesIds;
|
|
78
|
+
var data = {
|
|
79
|
+
name: name,
|
|
80
|
+
companies: companiesIds.map(function (id) { return ({ id: id, untag: true }); }),
|
|
81
|
+
};
|
|
82
|
+
return this.client.post({
|
|
83
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
84
|
+
data: data,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
Tag.prototype.list = function () {
|
|
88
|
+
return this.client.get({
|
|
89
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
return Tag;
|
|
93
|
+
}());
|
|
94
|
+
exports.default = Tag;
|
|
95
|
+
//# sourceMappingURL=tag.js.map
|
package/dist/tag.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../lib/tag.ts"],"names":[],"mappings":";;AAGA;IAGI,aAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAFnC,gBAAW,GAAG,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