intercom-client 3.0.0-0 → 3.1.0
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 +317 -3
- package/dist/admin/admin.types.d.ts +15 -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 +42 -0
- 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 +34 -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 +77 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +249 -0
- package/dist/client.js.map +1 -0
- package/dist/common/common.types.d.ts +67 -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 +112 -0
- 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 +157 -0
- 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 +289 -0
- package/dist/conversation.js.map +1 -0
- package/dist/count/count.types.d.ts +89 -0
- package/dist/count/count.types.d.ts.map +1 -0
- package/dist/count/count.types.js +17 -0
- package/dist/count/count.types.js.map +1 -0
- package/dist/count.d.ts +18 -0
- package/dist/count.d.ts.map +1 -0
- package/dist/count.js +72 -0
- package/dist/count.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 +44 -0
- 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 +58 -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 +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- 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 +34 -0
- package/dist/message.js.map +1 -0
- package/dist/note/note.types.d.ts +13 -0
- package/dist/note/note.types.d.ts.map +1 -0
- package/dist/note/note.types.js +3 -0
- package/dist/note/note.types.js.map +1 -0
- package/dist/note.d.ts +24 -0
- package/dist/note.d.ts.map +1 -0
- package/dist/note.js +40 -0
- package/dist/note.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 +70 -0
- 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 +28 -0
- 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 +95 -0
- 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/dist/visitor/visitor.types.d.ts +20 -0
- package/dist/visitor/visitor.types.d.ts.map +1 -0
- package/dist/visitor/visitor.types.js +3 -0
- package/dist/visitor/visitor.types.js.map +1 -0
- package/dist/visitor.d.ts +50 -0
- package/dist/visitor.d.ts.map +1 -0
- package/dist/visitor.js +60 -0
- package/dist/visitor.js.map +1 -0
- package/package.json +15 -23
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var HelpCenter = /** @class */ (function () {
|
|
4
|
+
function HelpCenter(client) {
|
|
5
|
+
this.collections = new Collection(client);
|
|
6
|
+
this.sections = new Section(client);
|
|
7
|
+
}
|
|
8
|
+
return HelpCenter;
|
|
9
|
+
}());
|
|
10
|
+
exports.default = HelpCenter;
|
|
11
|
+
var Collection = /** @class */ (function () {
|
|
12
|
+
function Collection(client) {
|
|
13
|
+
this.client = client;
|
|
14
|
+
this.baseUrl = 'help_center/collections';
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
Collection.prototype.create = function (_a) {
|
|
18
|
+
var name = _a.name, description = _a.description, translatedContent = _a.translatedContent;
|
|
19
|
+
var data = {
|
|
20
|
+
name: name,
|
|
21
|
+
description: description,
|
|
22
|
+
translated_content: translatedContent,
|
|
23
|
+
};
|
|
24
|
+
return this.client.post({
|
|
25
|
+
url: "/".concat(this.baseUrl),
|
|
26
|
+
data: data,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
Collection.prototype.find = function (_a) {
|
|
30
|
+
var id = _a.id;
|
|
31
|
+
return this.client.get({
|
|
32
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
Collection.prototype.update = function (_a) {
|
|
36
|
+
var id = _a.id, name = _a.name, description = _a.description, translatedContent = _a.translatedContent;
|
|
37
|
+
var data = {
|
|
38
|
+
name: name,
|
|
39
|
+
description: description,
|
|
40
|
+
translated_content: translatedContent,
|
|
41
|
+
};
|
|
42
|
+
return this.client.put({
|
|
43
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
44
|
+
data: data,
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
Collection.prototype.delete = function (_a) {
|
|
48
|
+
var id = _a.id;
|
|
49
|
+
return this.client.delete({
|
|
50
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
Collection.prototype.list = function (_a) {
|
|
54
|
+
var page = _a.page, per_page = _a.perPage;
|
|
55
|
+
var params = {
|
|
56
|
+
page: page,
|
|
57
|
+
per_page: per_page,
|
|
58
|
+
};
|
|
59
|
+
return this.client.get({
|
|
60
|
+
url: "/".concat(this.baseUrl),
|
|
61
|
+
params: params,
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
return Collection;
|
|
65
|
+
}());
|
|
66
|
+
var Section = /** @class */ (function () {
|
|
67
|
+
function Section(client) {
|
|
68
|
+
this.client = client;
|
|
69
|
+
this.baseUrl = 'help_center/sections';
|
|
70
|
+
this.client = client;
|
|
71
|
+
}
|
|
72
|
+
Section.prototype.create = function (_a) {
|
|
73
|
+
var name = _a.name, parentId = _a.parentId, translatedContent = _a.translatedContent;
|
|
74
|
+
var data = {
|
|
75
|
+
name: name,
|
|
76
|
+
parent_id: parentId,
|
|
77
|
+
translated_content: translatedContent,
|
|
78
|
+
};
|
|
79
|
+
return this.client.post({
|
|
80
|
+
url: "/".concat(this.baseUrl),
|
|
81
|
+
data: data,
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
Section.prototype.find = function (_a) {
|
|
85
|
+
var id = _a.id;
|
|
86
|
+
return this.client.get({
|
|
87
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
Section.prototype.update = function (_a) {
|
|
91
|
+
var id = _a.id, name = _a.name, parentId = _a.parentId, translatedContent = _a.translatedContent;
|
|
92
|
+
var data = {
|
|
93
|
+
name: name,
|
|
94
|
+
parent_id: parentId,
|
|
95
|
+
translated_content: translatedContent,
|
|
96
|
+
};
|
|
97
|
+
return this.client.put({
|
|
98
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
99
|
+
data: data,
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
Section.prototype.delete = function (_a) {
|
|
103
|
+
var id = _a.id;
|
|
104
|
+
return this.client.delete({
|
|
105
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
Section.prototype.list = function (_a) {
|
|
109
|
+
var page = _a.page, per_page = _a.perPage;
|
|
110
|
+
var params = {
|
|
111
|
+
page: page,
|
|
112
|
+
per_page: per_page,
|
|
113
|
+
};
|
|
114
|
+
return this.client.get({
|
|
115
|
+
url: "/".concat(this.baseUrl),
|
|
116
|
+
params: params,
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
return Section;
|
|
120
|
+
}());
|
|
121
|
+
//# sourceMappingURL=helpCenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpCenter.js","sourceRoot":"","sources":["../../lib/helpCenter.ts"],"names":[],"mappings":";;AAYA;IAII,oBAAY,MAAc;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IACL,iBAAC;AAAD,CAAC,AARD,IAQC;;AAED;IAGI,oBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,yBAAyB,CAAC;QAGhD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;I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GAAN,UAAO,EAA6B;YAA3B,EAAE,QAAA;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAA4B;YACjD,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE;SAChC,CAAC,CAAC;IACP,CAAC;IACD,sBAAI,GAAJ,UAAK,EAA4C;YAA1C,IAAI,UAAA,EAAW,QAAQ,aAAA;QAC1B,IAAM,MAAM,GAAG;YACX,IAAI,MAAA;YACJ,QAAQ,UAAA;SACX,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAsB;YACxC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;YACvB,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;IACL,cAAC;AAAD,CAAC,AApDD,IAoDC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare class IdentityVerification {
|
|
2
|
+
static userHash({ secretKey, identifier, }: {
|
|
3
|
+
secretKey?: string;
|
|
4
|
+
identifier?: string;
|
|
5
|
+
}): string;
|
|
6
|
+
}
|
|
7
|
+
export { default as Client } from './client';
|
|
8
|
+
export * from './admin/admin.types';
|
|
9
|
+
export * from './article/article.types';
|
|
10
|
+
export * from './common/common.types';
|
|
11
|
+
export * from './company/company.types';
|
|
12
|
+
export * from './contact/contact.types';
|
|
13
|
+
export * from './conversation/conversation.types';
|
|
14
|
+
export * from './count/count.types';
|
|
15
|
+
export * from './dataAttribute/dataAttribute.types';
|
|
16
|
+
export * from './event/event.types';
|
|
17
|
+
export * from './helpCenter/helpCenter.types';
|
|
18
|
+
export * from './message/message.types';
|
|
19
|
+
export * from './note/note.types';
|
|
20
|
+
export * from './segment/segment.types';
|
|
21
|
+
export * from './subscription/subscription.types';
|
|
22
|
+
export * from './tag/tag.types';
|
|
23
|
+
export * from './team/team.types';
|
|
24
|
+
export * from './visitor/visitor.types';
|
|
25
|
+
export { SearchContactOrderBy } from './contact';
|
|
26
|
+
export { ReplyToConversationMessageType, ReplyToConversationUserType, AssignToConversationMessageType, AssignToConversationUserType, SnoozeConversationMessageType, CloseConversationMessageType, CloseConversationType, OpenConversationMessageType, SearchConversationOrderBy, SortBy, RedactConversationPartType, } from './conversation';
|
|
27
|
+
export { RecepientType } from './message';
|
|
28
|
+
export { ContactObjectForMerge, MergeVisitorToContactData, VisitorObjectForMerge, IdentificationForVisitor, } from './visitor';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAEA,qBAAa,oBAAoB;IAC7B,MAAM,CAAC,QAAQ,CAAC,EACZ,SAAS,EACT,UAAU,GACb,EAAE;QACC,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACvB;CAYJ;AAED,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAG7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AAGxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACH,8BAA8B,EAC9B,2BAA2B,EAC3B,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,EACrB,2BAA2B,EAC3B,yBAAyB,EACzB,MAAM,EACN,0BAA0B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RecepientType = exports.RedactConversationPartType = exports.SortBy = exports.SearchConversationOrderBy = exports.OpenConversationMessageType = exports.CloseConversationType = exports.CloseConversationMessageType = exports.SnoozeConversationMessageType = exports.AssignToConversationUserType = exports.AssignToConversationMessageType = exports.ReplyToConversationUserType = exports.ReplyToConversationMessageType = exports.SearchContactOrderBy = exports.Client = exports.IdentityVerification = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var crypto_1 = (0, tslib_1.__importDefault)(require("crypto"));
|
|
6
|
+
var IdentityVerification = /** @class */ (function () {
|
|
7
|
+
function IdentityVerification() {
|
|
8
|
+
}
|
|
9
|
+
IdentityVerification.userHash = function (_a) {
|
|
10
|
+
var secretKey = _a.secretKey, identifier = _a.identifier;
|
|
11
|
+
if (!secretKey) {
|
|
12
|
+
throw new Error('secretKey must be provided');
|
|
13
|
+
}
|
|
14
|
+
if (!identifier) {
|
|
15
|
+
throw new Error('identifier must be provided');
|
|
16
|
+
}
|
|
17
|
+
return crypto_1.default
|
|
18
|
+
.createHmac('sha256', secretKey)
|
|
19
|
+
.update(identifier)
|
|
20
|
+
.digest('hex');
|
|
21
|
+
};
|
|
22
|
+
return IdentityVerification;
|
|
23
|
+
}());
|
|
24
|
+
exports.IdentityVerification = IdentityVerification;
|
|
25
|
+
var client_1 = require("./client");
|
|
26
|
+
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(client_1).default; } });
|
|
27
|
+
// Export model types
|
|
28
|
+
(0, tslib_1.__exportStar)(require("./admin/admin.types"), exports);
|
|
29
|
+
(0, tslib_1.__exportStar)(require("./article/article.types"), exports);
|
|
30
|
+
(0, tslib_1.__exportStar)(require("./common/common.types"), exports);
|
|
31
|
+
(0, tslib_1.__exportStar)(require("./company/company.types"), exports);
|
|
32
|
+
(0, tslib_1.__exportStar)(require("./contact/contact.types"), exports);
|
|
33
|
+
(0, tslib_1.__exportStar)(require("./conversation/conversation.types"), exports);
|
|
34
|
+
(0, tslib_1.__exportStar)(require("./count/count.types"), exports);
|
|
35
|
+
(0, tslib_1.__exportStar)(require("./dataAttribute/dataAttribute.types"), exports);
|
|
36
|
+
(0, tslib_1.__exportStar)(require("./event/event.types"), exports);
|
|
37
|
+
(0, tslib_1.__exportStar)(require("./helpCenter/helpCenter.types"), exports);
|
|
38
|
+
(0, tslib_1.__exportStar)(require("./message/message.types"), exports);
|
|
39
|
+
(0, tslib_1.__exportStar)(require("./note/note.types"), exports);
|
|
40
|
+
(0, tslib_1.__exportStar)(require("./segment/segment.types"), exports);
|
|
41
|
+
(0, tslib_1.__exportStar)(require("./subscription/subscription.types"), exports);
|
|
42
|
+
(0, tslib_1.__exportStar)(require("./tag/tag.types"), exports);
|
|
43
|
+
(0, tslib_1.__exportStar)(require("./team/team.types"), exports);
|
|
44
|
+
(0, tslib_1.__exportStar)(require("./visitor/visitor.types"), exports);
|
|
45
|
+
// Export enums needed for requests
|
|
46
|
+
var contact_1 = require("./contact");
|
|
47
|
+
Object.defineProperty(exports, "SearchContactOrderBy", { enumerable: true, get: function () { return contact_1.SearchContactOrderBy; } });
|
|
48
|
+
var conversation_1 = require("./conversation");
|
|
49
|
+
Object.defineProperty(exports, "ReplyToConversationMessageType", { enumerable: true, get: function () { return conversation_1.ReplyToConversationMessageType; } });
|
|
50
|
+
Object.defineProperty(exports, "ReplyToConversationUserType", { enumerable: true, get: function () { return conversation_1.ReplyToConversationUserType; } });
|
|
51
|
+
Object.defineProperty(exports, "AssignToConversationMessageType", { enumerable: true, get: function () { return conversation_1.AssignToConversationMessageType; } });
|
|
52
|
+
Object.defineProperty(exports, "AssignToConversationUserType", { enumerable: true, get: function () { return conversation_1.AssignToConversationUserType; } });
|
|
53
|
+
Object.defineProperty(exports, "SnoozeConversationMessageType", { enumerable: true, get: function () { return conversation_1.SnoozeConversationMessageType; } });
|
|
54
|
+
Object.defineProperty(exports, "CloseConversationMessageType", { enumerable: true, get: function () { return conversation_1.CloseConversationMessageType; } });
|
|
55
|
+
Object.defineProperty(exports, "CloseConversationType", { enumerable: true, get: function () { return conversation_1.CloseConversationType; } });
|
|
56
|
+
Object.defineProperty(exports, "OpenConversationMessageType", { enumerable: true, get: function () { return conversation_1.OpenConversationMessageType; } });
|
|
57
|
+
Object.defineProperty(exports, "SearchConversationOrderBy", { enumerable: true, get: function () { return conversation_1.SearchConversationOrderBy; } });
|
|
58
|
+
Object.defineProperty(exports, "SortBy", { enumerable: true, get: function () { return conversation_1.SortBy; } });
|
|
59
|
+
Object.defineProperty(exports, "RedactConversationPartType", { enumerable: true, get: function () { return conversation_1.RedactConversationPartType; } });
|
|
60
|
+
var message_1 = require("./message");
|
|
61
|
+
Object.defineProperty(exports, "RecepientType", { enumerable: true, get: function () { return message_1.RecepientType; } });
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;;AAAA,+DAA4B;AAE5B;IAAA;IAmBA,CAAC;IAlBU,6BAAQ,GAAf,UAAgB,EAMf;YALG,SAAS,eAAA,EACT,UAAU,gBAAA;QAKV,IAAI,CAAC,SAAS,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;SACjD;QACD,IAAI,CAAC,UAAU,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAClD;QACD,OAAO,gBAAM;aACR,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;aAC/B,MAAM,CAAC,UAAU,CAAC;aAClB,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACL,2BAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,oDAAoB;AAqBjC,mCAA6C;AAApC,8HAAA,OAAO,OAAU;AAE1B,qBAAqB;AACrB,mEAAoC;AACpC,uEAAwC;AACxC,qEAAsC;AACtC,uEAAwC;AACxC,uEAAwC;AACxC,iFAAkD;AAClD,mEAAoC;AACpC,mFAAoD;AACpD,mEAAoC;AACpC,6EAA8C;AAC9C,uEAAwC;AACxC,iEAAkC;AAClC,uEAAwC;AACxC,iFAAkD;AAClD,+DAAgC;AAChC,iEAAkC;AAClC,uEAAwC;AAExC,mCAAmC;AACnC,qCAAiD;AAAxC,+GAAA,oBAAoB,OAAA;AAC7B,+CAYwB;AAXpB,8HAAA,8BAA8B,OAAA;AAC9B,2HAAA,2BAA2B,OAAA;AAC3B,+HAAA,+BAA+B,OAAA;AAC/B,4HAAA,4BAA4B,OAAA;AAC5B,6HAAA,6BAA6B,OAAA;AAC7B,4HAAA,4BAA4B,OAAA;AAC5B,qHAAA,qBAAqB,OAAA;AACrB,2HAAA,2BAA2B,OAAA;AAC3B,yHAAA,yBAAyB,OAAA;AACzB,sGAAA,MAAM,OAAA;AACN,0HAAA,0BAA0B,OAAA;AAE9B,qCAA0C;AAAjC,wGAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Timestamp } from '../common/common.types';
|
|
2
|
+
export interface MessageObject {
|
|
3
|
+
type: string;
|
|
4
|
+
id: string;
|
|
5
|
+
created_at: Timestamp;
|
|
6
|
+
subject?: string;
|
|
7
|
+
body: string;
|
|
8
|
+
message_type: MessageType;
|
|
9
|
+
conversation_id?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare enum MessageType {
|
|
12
|
+
EMAIL = "email",
|
|
13
|
+
INAPP = "inapp",
|
|
14
|
+
FACEBOOK = "facebook",
|
|
15
|
+
TWITTER = "twitter"
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=message.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.types.d.ts","sourceRoot":"","sources":["../../../lib/message/message.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,oBAAY,WAAW;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,OAAO,YAAY;CACtB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageType = void 0;
|
|
4
|
+
var MessageType;
|
|
5
|
+
(function (MessageType) {
|
|
6
|
+
MessageType["EMAIL"] = "email";
|
|
7
|
+
MessageType["INAPP"] = "inapp";
|
|
8
|
+
MessageType["FACEBOOK"] = "facebook";
|
|
9
|
+
MessageType["TWITTER"] = "twitter";
|
|
10
|
+
})(MessageType = exports.MessageType || (exports.MessageType = {}));
|
|
11
|
+
//# sourceMappingURL=message.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.types.js","sourceRoot":"","sources":["../../../lib/message/message.types.ts"],"names":[],"mappings":";;;AAYA,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,oCAAqB,CAAA;IACrB,kCAAmB,CAAA;AACvB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { MessageObject, MessageType } from './message/message.types';
|
|
3
|
+
export default class Message {
|
|
4
|
+
private readonly client;
|
|
5
|
+
private messagesBaseUrl;
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
create({ messageType: message_type, subject, body, template, from, to, }: CreateMessageBody): Promise<MessageObject>;
|
|
8
|
+
}
|
|
9
|
+
interface CreateMessageRequest {
|
|
10
|
+
message_type: MessageType;
|
|
11
|
+
body: string;
|
|
12
|
+
from: Recepient;
|
|
13
|
+
to: Recepient;
|
|
14
|
+
subject?: string;
|
|
15
|
+
template?: string;
|
|
16
|
+
}
|
|
17
|
+
interface CreateMessageBody extends Omit<CreateMessageRequest, 'message_type'> {
|
|
18
|
+
messageType: MessageType;
|
|
19
|
+
}
|
|
20
|
+
declare type Recepient = {
|
|
21
|
+
id: string;
|
|
22
|
+
type: RecepientType;
|
|
23
|
+
};
|
|
24
|
+
export declare enum RecepientType {
|
|
25
|
+
ADMIN = "admin",
|
|
26
|
+
USER = "user",
|
|
27
|
+
LEAD = "lead"
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../lib/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,CAAC,OAAO,OAAO,OAAO;IAGZ,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,eAAe,CAAc;gBAER,MAAM,EAAE,MAAM;IAI3C,MAAM,CAAC,EACH,WAAW,EAAE,YAAY,EACzB,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,EAAE,GACL,EAAE,iBAAiB;CAevB;AAED,UAAU,oBAAoB;IAC1B,YAAY,EAAE,WAAW,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,SAAS,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,iBAAkB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,cAAc,CAAC;IAC1E,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,aAAK,SAAS,GAAG;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,oBAAY,aAAa;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CAChB"}
|
package/dist/message.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RecepientType = void 0;
|
|
4
|
+
var Message = /** @class */ (function () {
|
|
5
|
+
function Message(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.messagesBaseUrl = 'messages';
|
|
8
|
+
this.client = client;
|
|
9
|
+
}
|
|
10
|
+
Message.prototype.create = function (_a) {
|
|
11
|
+
var message_type = _a.messageType, subject = _a.subject, body = _a.body, template = _a.template, from = _a.from, to = _a.to;
|
|
12
|
+
var data = {
|
|
13
|
+
message_type: message_type,
|
|
14
|
+
subject: subject,
|
|
15
|
+
body: body,
|
|
16
|
+
template: template,
|
|
17
|
+
from: from,
|
|
18
|
+
to: to,
|
|
19
|
+
};
|
|
20
|
+
return this.client.post({
|
|
21
|
+
url: "/".concat(this.messagesBaseUrl),
|
|
22
|
+
data: data,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
return Message;
|
|
26
|
+
}());
|
|
27
|
+
exports.default = Message;
|
|
28
|
+
var RecepientType;
|
|
29
|
+
(function (RecepientType) {
|
|
30
|
+
RecepientType["ADMIN"] = "admin";
|
|
31
|
+
RecepientType["USER"] = "user";
|
|
32
|
+
RecepientType["LEAD"] = "lead";
|
|
33
|
+
})(RecepientType = exports.RecepientType || (exports.RecepientType = {}));
|
|
34
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../lib/message.ts"],"names":[],"mappings":";;;AAGA;IAGI,iBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAFnC,oBAAe,GAAG,UAAU,CAAC;QAGjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,wBAAM,GAAN,UAAO,EAOa;YANH,YAAY,iBAAA,EACzB,OAAO,aAAA,EACP,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,EAAE,QAAA;QAEF,IAAM,IAAI,GAAyB;YAC/B,YAAY,cAAA;YACZ,OAAO,SAAA;YACP,IAAI,MAAA;YACJ,QAAQ,UAAA;YACR,IAAI,MAAA;YACJ,EAAE,IAAA;SACL,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAgB;YACnC,GAAG,EAAE,WAAI,IAAI,CAAC,eAAe,CAAE;YAC/B,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACL,cAAC;AAAD,CAAC,AA7BD,IA6BC;;AAoBD,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,gCAAe,CAAA;IACf,8BAAa,CAAA;IACb,8BAAa,CAAA;AACjB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AdminObject, Timestamp } from '..';
|
|
2
|
+
export declare type NoteObject = {
|
|
3
|
+
type: 'note';
|
|
4
|
+
id: string;
|
|
5
|
+
created_at: Timestamp;
|
|
6
|
+
contact: {
|
|
7
|
+
type: 'contact';
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
author?: Pick<AdminObject, 'type' | 'id' | 'name' | 'email' | 'away_mode_enabled' | 'away_mode_reassign' | 'avatar'>;
|
|
11
|
+
body: string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=note.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note.types.d.ts","sourceRoot":"","sources":["../../../lib/note/note.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE5C,oBAAY,UAAU,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,SAAS,CAAC;IACtB,OAAO,EAAE;QACL,IAAI,EAAE,SAAS,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,CAAC,EAAE,IAAI,CACT,WAAW,EACT,MAAM,GACN,IAAI,GACJ,MAAM,GACN,OAAO,GACP,mBAAmB,GACnB,oBAAoB,GACpB,QAAQ,CACb,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note.types.js","sourceRoot":"","sources":["../../../lib/note/note.types.ts"],"names":[],"mappings":""}
|
package/dist/note.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Client, NoteObject } from '.';
|
|
2
|
+
import { OperationById, Paginated } from './common/common.types';
|
|
3
|
+
export default class Note {
|
|
4
|
+
private readonly client;
|
|
5
|
+
readonly baseUrl = "notes";
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
create({ adminId, body, contactId }: CreateNoteData): Promise<NoteObject>;
|
|
8
|
+
find({ id }: FindNoteByIdData): Promise<NoteObject>;
|
|
9
|
+
list({ contactId, page, perPage: per_page }: ListNotesData): Promise<ListNotesResponse>;
|
|
10
|
+
}
|
|
11
|
+
interface CreateNoteData {
|
|
12
|
+
adminId: string;
|
|
13
|
+
body: string;
|
|
14
|
+
contactId: string;
|
|
15
|
+
}
|
|
16
|
+
declare type FindNoteByIdData = OperationById;
|
|
17
|
+
declare type ListNotesData = {
|
|
18
|
+
contactId: string;
|
|
19
|
+
page?: number;
|
|
20
|
+
perPage?: number;
|
|
21
|
+
};
|
|
22
|
+
declare type ListNotesResponse = Paginated<NoteObject>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../lib/note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,CAAC,OAAO,OAAO,IAAI;IAGT,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,WAAW;gBAEL,MAAM,EAAE,MAAM;IAI3C,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,cAAc;IAWnD,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,gBAAgB;IAK7B,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,aAAa;CAW7D;AAED,UAAU,cAAc;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,aAAK,gBAAgB,GAAG,aAAa,CAAC;AAEtC,aAAK,aAAa,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,aAAK,iBAAiB,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC"}
|
package/dist/note.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Note = /** @class */ (function () {
|
|
4
|
+
function Note(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.baseUrl = 'notes';
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
Note.prototype.create = function (_a) {
|
|
10
|
+
var adminId = _a.adminId, body = _a.body, contactId = _a.contactId;
|
|
11
|
+
var data = {
|
|
12
|
+
admin_id: adminId,
|
|
13
|
+
body: body,
|
|
14
|
+
};
|
|
15
|
+
return this.client.post({
|
|
16
|
+
url: "/".concat(this.client.contacts.baseUrl, "/").concat(contactId, "/").concat(this.baseUrl),
|
|
17
|
+
data: data,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
Note.prototype.find = function (_a) {
|
|
21
|
+
var id = _a.id;
|
|
22
|
+
return this.client.get({
|
|
23
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
Note.prototype.list = function (_a) {
|
|
27
|
+
var contactId = _a.contactId, page = _a.page, per_page = _a.perPage;
|
|
28
|
+
var params = {
|
|
29
|
+
page: page,
|
|
30
|
+
per_page: per_page,
|
|
31
|
+
};
|
|
32
|
+
return this.client.get({
|
|
33
|
+
url: "/".concat(this.client.contacts.baseUrl, "/").concat(contactId, "/").concat(this.baseUrl),
|
|
34
|
+
params: params,
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return Note;
|
|
38
|
+
}());
|
|
39
|
+
exports.default = Note;
|
|
40
|
+
//# sourceMappingURL=note.js.map
|
package/dist/note.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../lib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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
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
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;
|
|
11
|
+
}
|
|
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()];
|
|
18
|
+
});
|
|
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;gBAEnD,sBAAO,IAAI,CAAC,YAAY,EAAE,EAAC;;;KAC9B;IAEK,6BAAY,GAAlB,UAAmB,UAA6B;QAA7B,2BAAA,EAAA,eAA6B;;;;;4BAC3B,qBAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAiC;4BACnE,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE;yBACxB,CAAC,EAAA;;wBAFI,QAAQ,GAAG,SAEf;wBACI,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC;wBACjC,YAAY,iFAAO,gBAAgB,+BAAK,UAAU,SAAC,CAAC;wBAE1D,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;4BAC7B,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,YAAY,CAAC;4BACzC,sBAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAC;yBAC1C;wBAED,sBAAO,YAAY,EAAC;;;;KACvB;IAEK,qBAAI,GAAV,UAAW,EAEA;YADP,WAAW,iBAAA;;;;;;wBAEX,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;wBAEd,qBAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAiC;gCACnE,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE;6BACxB,CAAC,EAAA;;wBAFI,QAAQ,GAAG,SAEf;wBAEF,sBAAO,QAAQ,EAAC;;;;KACnB;IAED,0BAAS,GAAT;QACI,IAAM,aAAa,GAAG,WAAI,IAAI,CAAC,iBAAiB,YAAS,CAAC;QAE1D,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC;YAClD,CAAC,CAAC,UAAG,aAAa,2BAAiB,IAAI,CAAC,WAAW,CAAE;YACrD,CAAC,CAAC,aAAa,CAAC;IACxB,CAAC;IACL,aAAC;AAAD,CAAC,AAlDD,IAkDC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Role, Timestamp } from '../common/common.types';
|
|
2
|
+
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":""}
|