intercom-client 3.0.0-0 → 3.0.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +42 -0
- package/dist/admin.js.map +1 -0
- package/dist/client.d.ts +67 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +238 -0
- package/dist/client.js.map +1 -0
- package/dist/common/common.types.d.ts +91 -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 +67 -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 +130 -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/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/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -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/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/package.json +13 -23
|
@@ -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
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
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;
|
|
8
|
+
}
|
|
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,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AK,CAAC,SAAS,CAAC,CAAC;CAC1B"}
|
package/dist/tag.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
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;
|
|
8
|
+
}
|
|
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,MAAM,CAAC;QAGzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,oBAAM,GAAN,UAAO,IAAmB;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAY;YAC/B,GAAG,EAAE,WAAI,IAAI,CAAC,WAAW,CAAE;YAC3B,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,oBAAM,GAAN,UAAO,IAAmB;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAY;YAC/B,GAAG,EAAE,WAAI,IAAI,CAAC,WAAW,CAAE;YAC3B,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,oBAAM,GAAN,UAAO,EAAqB;YAAnB,EAAE,QAAA;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAY;YACjC,GAAG,EAAE,WAAI,IAAI,CAAC,WAAW,cAAI,EAAE,CAAE;SACpC,CAAC,CAAC;IACP,CAAC;IACD,wBAAU,GAAV,UAAW,EAAoC;YAAlC,SAAS,eAAA,EAAE,KAAK,WAAA;QACzB,IAAM,IAAI,GAAG;YACT,EAAE,EAAE,KAAK;SACZ,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAY;YAC/B,GAAG,EAAE,WAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,cAAI,SAAS,cAAI,IAAI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QAAQ,UAAA;SACX,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAY;YACjC,GAAG,EAAE,WAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,cAAI,cAAc,cAAI,IAAI,CAAC,WAAW,cAAI,KAAK,CAAE;YAC3F,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,4BAAc,GAAd,UAAe,EAAmD;YAAxC,IAAI,aAAA,EAAE,YAAY,kBAAA;QACxC,IAAM,IAAI,GAAG;YACT,IAAI,MAAA;YACJ,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC,UAAC,EAAE,IAAK,OAAA,CAAC,EAAE,EAAE,IAAA,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAArB,CAAqB,CAAC;SAC7D,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAY;YAC/B,GAAG,EAAE,WAAI,IAAI,CAAC,WAAW,CAAE;YAC3B,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,kBAAI,GAAJ;QACI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAsB;YACxC,GAAG,EAAE,WAAI,IAAI,CAAC,WAAW,CAAE;SAC9B,CAAC,CAAC;IACP,CAAC;IACL,UAAC;AAAD,CAAC,AA/FD,IA+FC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.types.d.ts","sourceRoot":"","sources":["../../lib/team/team.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.types.js","sourceRoot":"","sources":["../../lib/team/team.types.ts"],"names":[],"mappings":""}
|
package/dist/team.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { TeamObject } from './team/team.types';
|
|
3
|
+
export default class Team {
|
|
4
|
+
private readonly client;
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
find({ id }: FindTeamData): Promise<TeamObject>;
|
|
8
|
+
list(): Promise<ListTeamsResponse>;
|
|
9
|
+
}
|
|
10
|
+
interface FindTeamData {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
interface ListTeamsResponse {
|
|
14
|
+
type: 'team.list';
|
|
15
|
+
teams: TeamObject[];
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=team.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../lib/team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,IAAI;IAGT,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;gBAEN,MAAM,EAAE,MAAM;IAI3C,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,YAAY;IAMzB,IAAI;CAKP;AAED,UAAU,YAAY;IAClB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,UAAU,iBAAiB;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,UAAU,EAAE,CAAC;CACvB"}
|
package/dist/team.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Team = /** @class */ (function () {
|
|
4
|
+
function Team(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.baseUrl = 'teams';
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
Team.prototype.find = function (_a) {
|
|
10
|
+
var id = _a.id;
|
|
11
|
+
return this.client.get({
|
|
12
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
Team.prototype.list = function () {
|
|
16
|
+
return this.client.get({
|
|
17
|
+
url: "/".concat(this.baseUrl),
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
return Team;
|
|
21
|
+
}());
|
|
22
|
+
exports.default = Team;
|
|
23
|
+
//# sourceMappingURL=team.js.map
|
package/dist/team.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../lib/team.ts"],"names":[],"mappings":";;AAGA;IAGI,cAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF1B,YAAO,GAAG,OAAO,CAAC;QAG/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,mBAAI,GAAJ,UAAK,EAAoB;YAAlB,EAAE,QAAA;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAa;YAC/B,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE;SAChC,CAAC,CAAC;IACP,CAAC;IAED,mBAAI,GAAJ;QACI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAoB;YACtC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;SAC1B,CAAC,CAAC;IACP,CAAC;IACL,WAAC;AAAD,CAAC,AAlBD,IAkBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../lib/util/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,mBAAmB,SAAU,IAAI,KAAG,SAA8C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateToUnixTimestamp = void 0;
|
|
4
|
+
var dateToUnixTimestamp = function (date) { return Math.floor(date.getTime() / 1000); };
|
|
5
|
+
exports.dateToUnixTimestamp = dateToUnixTimestamp;
|
|
6
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../lib/util/time.ts"],"names":[],"mappings":";;;AAEO,IAAM,mBAAmB,GAAG,UAAC,IAAU,IAAgB,OAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAjC,CAAiC,CAAC;AAAnF,QAAA,mBAAmB,uBAAgE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../lib/util/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGtC,eAAO,MAAM,kBAAkB,WACnB,OAAO,MAAM,EAAE,MAAM,GAAG,cAAc,MAAM,CAAC,CAAC,KACvD,eAAmE,CAAC"}
|
package/dist/util/url.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encodeParamsForURL = void 0;
|
|
4
|
+
var url_1 = require("url");
|
|
5
|
+
var lodash_1 = require("lodash");
|
|
6
|
+
var encodeParamsForURL = function (params) { return new url_1.URLSearchParams(purifyFromEmptiness(params)); };
|
|
7
|
+
exports.encodeParamsForURL = encodeParamsForURL;
|
|
8
|
+
var purifyFromEmptiness = function (object) { return (0, lodash_1.omitBy)(object, lodash_1.isEmpty); };
|
|
9
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../lib/util/url.ts"],"names":[],"mappings":";;;AAAA,2BAAsC;AACtC,iCAAyC;AAElC,IAAM,kBAAkB,GAAG,UAC9B,MAAsD,IACpC,OAAA,IAAI,qBAAe,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,EAAhD,CAAgD,CAAC;AAF1D,QAAA,kBAAkB,sBAEwC;AAEvE,IAAM,mBAAmB,GAAG,UACxB,MAAsD,IACL,OAAA,IAAA,eAAM,EAAC,MAAM,EAAE,gBAAO,CAAC,EAAvB,CAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intercom-client",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-2",
|
|
4
4
|
"description": "Official Node bindings to the Intercom API",
|
|
5
5
|
"homepage": "https://github.com/intercom/intercom-node",
|
|
6
6
|
"bugs:": "https://github.com/intercom/intercom-node/issues",
|
|
@@ -23,45 +23,35 @@
|
|
|
23
23
|
"lodash": "^4.17.21"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@babel/eslint-parser": "^7.16.0",
|
|
28
|
-
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
29
|
-
"@babel/polyfill": "^7.12.1",
|
|
30
|
-
"@babel/preset-env": "^7.13.15",
|
|
31
|
-
"@babel/preset-typescript": "^7.16.0",
|
|
32
|
-
"@babel/register": "^7.13.16",
|
|
26
|
+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
33
27
|
"@types/lodash": "^4.14.176",
|
|
34
|
-
"@types/mocha": "^9.
|
|
28
|
+
"@types/mocha": "^9.1.0",
|
|
35
29
|
"@types/node": "^16.11.6",
|
|
36
30
|
"@types/sinon": "^10.0.6",
|
|
37
31
|
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
|
38
32
|
"@typescript-eslint/parser": "^5.7.0",
|
|
39
33
|
"eslint": "^8.2.0",
|
|
40
34
|
"eslint-config-prettier": "^8.3.0",
|
|
41
|
-
"gulp": "^4.0.2",
|
|
42
|
-
"gulp-babel": "^8.0.0",
|
|
43
|
-
"gulp-cli": "^2.2.0",
|
|
44
|
-
"gulp-eslint": "^6.0.0",
|
|
45
|
-
"gulp-exclude-gitignore": "^1.0.0",
|
|
46
|
-
"gulp-istanbul": "^1.1.3",
|
|
47
|
-
"gulp-mocha": "^6.0.0",
|
|
48
|
-
"gulp-plumber": "^1.2.1",
|
|
49
|
-
"gulp-sourcemaps": "^3.0.0",
|
|
50
|
-
"gulp-typescript": "^6.0.0-alpha.1",
|
|
51
35
|
"merge2": "^1.4.1",
|
|
36
|
+
"mocha": "^9.2.0",
|
|
52
37
|
"nock": "^13.0.11",
|
|
38
|
+
"nyc": "^15.1.0",
|
|
53
39
|
"prettier": "^2.5.1",
|
|
54
40
|
"sinon": "^7.3.2",
|
|
41
|
+
"ts-node": "^10.4.0",
|
|
55
42
|
"tslib": "^2.3.1",
|
|
56
43
|
"typescript": "^4.5.3"
|
|
57
44
|
},
|
|
58
45
|
"scripts": {
|
|
59
|
-
"
|
|
60
|
-
"
|
|
46
|
+
"static": "eslint .",
|
|
47
|
+
"compile_ts": "tsc",
|
|
48
|
+
"prepublish": "yarn static && yarn compile_ts",
|
|
49
|
+
"test": "mocha -r ts-node/register test/*.ts",
|
|
50
|
+
"coverage": "nyc yarn test"
|
|
61
51
|
},
|
|
62
52
|
"engines": {
|
|
63
|
-
"node": ">=
|
|
53
|
+
"node": ">= v8.0.0"
|
|
64
54
|
},
|
|
65
55
|
"license": "Apache-2.0",
|
|
66
|
-
"packageManager": "yarn@3.1.
|
|
56
|
+
"packageManager": "yarn@3.1.1"
|
|
67
57
|
}
|