intercom-client 3.0.0 → 3.1.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/README.md +137 -5
- package/dist/admin/admin.types.d.ts +4 -2
- package/dist/admin/admin.types.d.ts.map +1 -1
- package/dist/admin/admin.types.js.map +1 -1
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js.map +1 -1
- 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 +12 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +110 -26
- package/dist/client.js.map +1 -1
- package/dist/common/common.types.d.ts +19 -41
- package/dist/common/common.types.d.ts.map +1 -1
- package/dist/common/common.types.js.map +1 -1
- package/dist/company/company.types.d.ts.map +1 -1
- package/dist/company/company.types.js.map +1 -1
- package/dist/company.d.ts +2 -6
- package/dist/company.d.ts.map +1 -1
- package/dist/company.js +4 -2
- package/dist/company.js.map +1 -1
- package/dist/contact/contact.types.d.ts.map +1 -1
- package/dist/contact/contact.types.js.map +1 -1
- package/dist/contact.d.ts +10 -20
- package/dist/contact.d.ts.map +1 -1
- package/dist/contact.js +3 -2
- package/dist/contact.js.map +1 -1
- package/dist/conversation/conversation.types.d.ts.map +1 -1
- package/dist/conversation/conversation.types.js.map +1 -1
- package/dist/conversation.d.ts +7 -5
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +1 -1
- package/dist/conversation.js.map +1 -1
- 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.map +1 -1
- package/dist/dataAttribute/dataAttribute.types.js.map +1 -1
- package/dist/dataAttribute.d.ts.map +1 -1
- package/dist/dataAttribute.js.map +1 -1
- package/dist/errors/badResponse.error.d.ts.map +1 -1
- package/dist/errors/badResponse.error.js +16 -2
- package/dist/errors/badResponse.error.js.map +1 -1
- package/dist/event/event.types.d.ts.map +1 -1
- package/dist/event/event.types.js.map +1 -1
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js.map +1 -1
- 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 +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -5
- package/dist/index.js.map +1 -1
- package/dist/message/message.types.d.ts.map +1 -1
- package/dist/message/message.types.js.map +1 -1
- package/dist/message.d.ts.map +1 -1
- package/dist/message.js.map +1 -1
- 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.map +1 -1
- package/dist/scroll.js +68 -8
- package/dist/scroll.js.map +1 -1
- package/dist/segment/segment.types.d.ts.map +1 -1
- package/dist/segment/segment.types.js.map +1 -1
- package/dist/segment.d.ts.map +1 -1
- package/dist/segment.js.map +1 -1
- package/dist/subscription/subscription.types.d.ts.map +1 -1
- package/dist/subscription/subscription.types.js.map +1 -1
- package/dist/tag/tag.types.d.ts.map +1 -1
- package/dist/tag/tag.types.js.map +1 -1
- package/dist/tag.d.ts.map +1 -1
- package/dist/tag.js.map +1 -1
- package/dist/team/team.types.d.ts.map +1 -1
- package/dist/team/team.types.js.map +1 -1
- package/dist/team.d.ts.map +1 -1
- package/dist/team.js.map +1 -1
- package/dist/util/time.d.ts.map +1 -1
- package/dist/util/time.js.map +1 -1
- package/dist/util/url.d.ts.map +1 -1
- package/dist/util/url.js.map +1 -1
- 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 +2 -2
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ The Node SDK has been updated to support latest API version (2.4). The update al
|
|
|
19
19
|
yarn add intercom-client
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
**This client is intended for server side use only. Please use the [Intercom Javascript SDK](https://developers.intercom.com/
|
|
22
|
+
**This client is intended for server side use only. Please use the [Intercom Javascript SDK](https://developers.intercom.com/installing-intercom/docs/intercom-for-web) for client-side operations.**
|
|
23
23
|
|
|
24
24
|
## Testing
|
|
25
25
|
|
|
@@ -746,6 +746,62 @@ const response = await client.conversations.redactConversationPart({
|
|
|
746
746
|
});
|
|
747
747
|
```
|
|
748
748
|
|
|
749
|
+
### Counts
|
|
750
|
+
|
|
751
|
+
#### [App Total Count](https://developers.intercom.com/intercom-api-reference/reference/company-user-counts)
|
|
752
|
+
|
|
753
|
+
```typescript
|
|
754
|
+
const response = await client.counts.forApp();
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
#### [Conversation Count Model](https://developers.intercom.com/intercom-api-reference/reference/conversation-counts)
|
|
758
|
+
|
|
759
|
+
```typescript
|
|
760
|
+
const response = await client.counts.countConversation();
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
#### [Admin Conversation Count Model](https://developers.intercom.com/intercom-api-reference/reference/admin-conversations)
|
|
764
|
+
|
|
765
|
+
```typescript
|
|
766
|
+
const response = await client.counts.countAdminConversation();
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
#### [User Segment/Tag Count Model](https://developers.intercom.com/intercom-api-reference/reference/user-tag-counts)
|
|
770
|
+
|
|
771
|
+
##### Count User Segment
|
|
772
|
+
|
|
773
|
+
```typescript
|
|
774
|
+
const response = await client.counts.countUserSegment();
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
##### Count User Tag
|
|
778
|
+
|
|
779
|
+
```typescript
|
|
780
|
+
const response = await client.counts.countUserTag();
|
|
781
|
+
```
|
|
782
|
+
|
|
783
|
+
#### [Company User/Segment/Tag Count Model](https://developers.intercom.com/intercom-api-reference/reference/company-tag-counts)
|
|
784
|
+
|
|
785
|
+
##### Count Company Segment
|
|
786
|
+
|
|
787
|
+
```typescript
|
|
788
|
+
const response = await client.counts.countCompanySegment();
|
|
789
|
+
const response = await client.counts.countCompanyTag();
|
|
790
|
+
const response = await client.counts.countCompanyUser();
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
##### Count Company Tag
|
|
794
|
+
|
|
795
|
+
```typescript
|
|
796
|
+
const response = await client.counts.countCompanyTag();
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
##### Count Company User
|
|
800
|
+
|
|
801
|
+
```typescript
|
|
802
|
+
const response = await client.counts.countCompanyUser();
|
|
803
|
+
```
|
|
804
|
+
|
|
749
805
|
### Data Attributes
|
|
750
806
|
|
|
751
807
|
#### [Create Data Attribute](https://developers.intercom.com/intercom-api-reference/reference/create-data-attributes)
|
|
@@ -845,7 +901,7 @@ const article = await client.helpCenter.collections.update({
|
|
|
845
901
|
id: '123',
|
|
846
902
|
name: 'Thanks for everything',
|
|
847
903
|
description: 'English description',
|
|
848
|
-
|
|
904
|
+
translatedContent: {
|
|
849
905
|
fr: {
|
|
850
906
|
name: 'Allez les verts',
|
|
851
907
|
description: 'French description',
|
|
@@ -878,7 +934,7 @@ const response = client.helpCenter.collections.list({
|
|
|
878
934
|
```typescript
|
|
879
935
|
const collection = await client.helpCenter.sections.create({
|
|
880
936
|
name: 'Thanks for everything',
|
|
881
|
-
|
|
937
|
+
parentId: '1234',
|
|
882
938
|
translatedContent: {
|
|
883
939
|
fr: {
|
|
884
940
|
name: 'Allez les verts',
|
|
@@ -900,8 +956,8 @@ const response = await client.helpCenter.sections.find({ id: '123' });
|
|
|
900
956
|
const article = await client.helpCenter.sections.update({
|
|
901
957
|
id: '123',
|
|
902
958
|
name: 'Thanks for everything',
|
|
903
|
-
|
|
904
|
-
|
|
959
|
+
parentId: '456',
|
|
960
|
+
translatedContent: {
|
|
905
961
|
fr: {
|
|
906
962
|
name: 'Allez les verts',
|
|
907
963
|
description: 'French description',
|
|
@@ -948,6 +1004,34 @@ const response = await client.messages.create({
|
|
|
948
1004
|
});
|
|
949
1005
|
```
|
|
950
1006
|
|
|
1007
|
+
### Notes
|
|
1008
|
+
|
|
1009
|
+
#### [Create a note](https://developers.intercom.com/intercom-api-reference/reference/create-note-for-contact)
|
|
1010
|
+
|
|
1011
|
+
```typescript
|
|
1012
|
+
const response = await client.notes.create({
|
|
1013
|
+
adminId: '12345',
|
|
1014
|
+
body: 'Shiny',
|
|
1015
|
+
contactId: '5678',
|
|
1016
|
+
});
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
#### [Retrieve a note](https://developers.intercom.com/intercom-api-reference/reference/view-a-note)
|
|
1020
|
+
|
|
1021
|
+
```typescript
|
|
1022
|
+
const response = await client.notes.find({ id: '123' });
|
|
1023
|
+
```
|
|
1024
|
+
|
|
1025
|
+
#### [List all notes](https://developers.intercom.com/intercom-api-reference/reference/list-notes-of-contact)
|
|
1026
|
+
|
|
1027
|
+
```typescript
|
|
1028
|
+
const response = await client.notes.list({
|
|
1029
|
+
contactId: '123',
|
|
1030
|
+
page: 2,
|
|
1031
|
+
perPage: 3,
|
|
1032
|
+
});
|
|
1033
|
+
```
|
|
1034
|
+
|
|
951
1035
|
### Segments
|
|
952
1036
|
|
|
953
1037
|
#### [Retrieve a segment](https://developers.intercom.com/intercom-api-reference/reference/view-a-segment)
|
|
@@ -1067,6 +1151,54 @@ const response = await client.teams.find({
|
|
|
1067
1151
|
const response = await client.teams.list();
|
|
1068
1152
|
```
|
|
1069
1153
|
|
|
1154
|
+
### Visitors
|
|
1155
|
+
|
|
1156
|
+
#### [Retrieve a Visitor](https://developers.intercom.com/intercom-api-reference/reference/view-a-visitor)
|
|
1157
|
+
|
|
1158
|
+
```typescript
|
|
1159
|
+
const response = await client.visitors.find({ id: '123' });
|
|
1160
|
+
```
|
|
1161
|
+
|
|
1162
|
+
OR
|
|
1163
|
+
|
|
1164
|
+
```typescript
|
|
1165
|
+
const response = await client.visitors.find({ userId: '123' });
|
|
1166
|
+
```
|
|
1167
|
+
|
|
1168
|
+
#### [Update a Visitor](https://developers.intercom.com/intercom-api-reference/reference/update-a-visitor)
|
|
1169
|
+
|
|
1170
|
+
```typescript
|
|
1171
|
+
const response = await client.visitors.update({
|
|
1172
|
+
userId: '123',
|
|
1173
|
+
name: 'anonymous bruh',
|
|
1174
|
+
customAttributes: {
|
|
1175
|
+
paid_subscriber: true,
|
|
1176
|
+
},
|
|
1177
|
+
});
|
|
1178
|
+
```
|
|
1179
|
+
|
|
1180
|
+
#### [Delete a Visitor](https://developers.intercom.com/intercom-api-reference/reference/delete-a-visitor)
|
|
1181
|
+
|
|
1182
|
+
```typescript
|
|
1183
|
+
const response = await client.visitors.delete({
|
|
1184
|
+
id,
|
|
1185
|
+
});
|
|
1186
|
+
```
|
|
1187
|
+
|
|
1188
|
+
#### [Convert a Visitor](https://developers.intercom.com/intercom-api-reference/reference/convert-a-visitor-to-a-user)
|
|
1189
|
+
|
|
1190
|
+
```typescript
|
|
1191
|
+
const response = await client.visitors.mergeToContact({
|
|
1192
|
+
visitor: {
|
|
1193
|
+
id: '123',
|
|
1194
|
+
},
|
|
1195
|
+
user: {
|
|
1196
|
+
userId: '123',
|
|
1197
|
+
},
|
|
1198
|
+
type: Role.USER,
|
|
1199
|
+
});
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1070
1202
|
### Identity verification
|
|
1071
1203
|
|
|
1072
1204
|
`intercom-node` provides a helper for using [identity verification](https://docs.intercom.com/configure-intercom-for-your-product-or-site/staying-secure/enable-identity-verification-on-your-web-product):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface AdminObject {
|
|
2
|
-
type:
|
|
2
|
+
type: 'admin';
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
email: string;
|
|
@@ -8,6 +8,8 @@ export interface AdminObject {
|
|
|
8
8
|
away_mode_reassign: boolean;
|
|
9
9
|
has_inbox_seat: boolean;
|
|
10
10
|
team_ids: Array<number>;
|
|
11
|
-
avatar: string
|
|
11
|
+
avatar: string | {
|
|
12
|
+
image_url: string;
|
|
13
|
+
};
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=admin.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.types.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"admin.types.d.ts","sourceRoot":"","sources":["../../../lib/admin/admin.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.types.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"admin.types.js","sourceRoot":"","sources":["../../../lib/admin/admin.types.ts"],"names":[],"mappings":""}
|
package/dist/admin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../lib/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,MAAM,CAAC,OAAO,OAAO,KAAK;IAGV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,YAAY;gBAEN,MAAM,EAAE,MAAM;IAI3C,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,gBAAgB;IAG7B,IAAI,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,gBAAgB;IAWtE,mBAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,uBAAuB;IAW9D,IAAI;CAGP;AAED,UAAU,gBAAgB;IACtB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,UAAU,gBAAgB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;CAC/B;AAED,UAAU,uBAAuB;IAC7B,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,UAAU,2BAA2B;IACjC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,cAAc;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACnD,YAAY,EAAE,WAAW,CAAC;CAC7B;AAED,UAAU,KAAK;IACX,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,eAAe;IACrB,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,WAAW,EAAE,CAAC;CACzB"}
|
package/dist/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../lib/admin.ts"],"names":[],"mappings":";;AAEA,oCAAkD;AAElD;IAGI,eAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,QAAQ,CAAC;QAG/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,oBAAI,GAAJ,UAAK,EAAwB;YAAtB,EAAE,QAAA;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,EAAE,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,oBAAI,GAAJ,UAAK,EAAiE;YAA/D,OAAO,aAAA,EAAE,cAAc,oBAAA,EAAE,kBAAkB,wBAAA;QAC9C,IAAM,IAAI,GAAG;YACT,iBAAiB,EAAE,cAAc;YACjC,kBAAkB,EAAE,kBAAkB;SACzC,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc;YAChC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,OAAO,UAAO;YACvC,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,mCAAmB,GAAnB,UAAoB,EAA0C;YAAxC,MAAM,YAAA,EAAE,KAAK,WAAA;QAC/B,IAAM,MAAM,GAAG;YACX,gBAAgB,EAAE,IAAA,0BAAmB,EAAC,KAAK,CAAC;YAC5C,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;SACtE,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8B;YAChD,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,mBAAgB;YACrC,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;IACD,oBAAI,GAAJ;QACI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAkB,EAAE,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE,EAAE,CAAC,CAAC;IACzE,CAAC;IACL,YAAC;AAAD,CAAC,AAnCD,IAmCC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Timestamp } from '../common/common.types';
|
|
2
|
+
export declare type ArticleObject = {
|
|
3
|
+
type: 'article';
|
|
4
|
+
id: string;
|
|
5
|
+
workspace_id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
body: string;
|
|
9
|
+
author_id: string;
|
|
10
|
+
state: string;
|
|
11
|
+
created_at: Timestamp;
|
|
12
|
+
updated_at: Timestamp;
|
|
13
|
+
url: string;
|
|
14
|
+
parent_id: string;
|
|
15
|
+
parent_type: string;
|
|
16
|
+
default_locale: string;
|
|
17
|
+
translated_content: TranslatedContentObject;
|
|
18
|
+
statistics: StatisticsObject;
|
|
19
|
+
};
|
|
20
|
+
export declare enum Locales {
|
|
21
|
+
ARABIC = "ar",
|
|
22
|
+
BULGARIAN = "bg",
|
|
23
|
+
BOSNIAN = "bs",
|
|
24
|
+
CATALAN = "ca",
|
|
25
|
+
CZECH = "cs",
|
|
26
|
+
DANISH = "da",
|
|
27
|
+
GERMAN = "de",
|
|
28
|
+
DE_FORM = "de-form",
|
|
29
|
+
GREEK = "el",
|
|
30
|
+
ENGLISH = "en",
|
|
31
|
+
SPANISH = "es",
|
|
32
|
+
ESTONIAN = "et",
|
|
33
|
+
FINNISH = "fi",
|
|
34
|
+
FRENCH = "fr",
|
|
35
|
+
HEBREW = "he",
|
|
36
|
+
CROATIAN = "hr",
|
|
37
|
+
HUNGARIAN = "hu",
|
|
38
|
+
INDONESIAN = "id",
|
|
39
|
+
ITALIAN = "it",
|
|
40
|
+
JAPANESE = "ja",
|
|
41
|
+
KOREAN = "ko",
|
|
42
|
+
LITHUANIAN = "lt",
|
|
43
|
+
LATVIAN = "lv",
|
|
44
|
+
MONGOLIAN = "mn",
|
|
45
|
+
NORWEGIAN = "nb",
|
|
46
|
+
DUTCH = "nl",
|
|
47
|
+
POLISH = "pl",
|
|
48
|
+
PORTUGUESE_BRAZIL = "pt-BR",
|
|
49
|
+
PORTUGUESE = "pt",
|
|
50
|
+
ROMANIAN = "ro",
|
|
51
|
+
RUSSIAN = "ru",
|
|
52
|
+
SLOVENIAN = "sl",
|
|
53
|
+
SERBIAN = "sr",
|
|
54
|
+
SWEDISH = "sv",
|
|
55
|
+
TURKISH = "tr",
|
|
56
|
+
VIETNAMESE = "vi",
|
|
57
|
+
CHINESE_S = "zh-CN",
|
|
58
|
+
CHINESE_T = "zh-TW"
|
|
59
|
+
}
|
|
60
|
+
export interface ContentObject {
|
|
61
|
+
type?: 'article_content';
|
|
62
|
+
title: string;
|
|
63
|
+
description: string;
|
|
64
|
+
body: string;
|
|
65
|
+
author?: string;
|
|
66
|
+
author_id?: number;
|
|
67
|
+
state: string;
|
|
68
|
+
created_at?: Timestamp;
|
|
69
|
+
updated_at?: Timestamp;
|
|
70
|
+
url?: string;
|
|
71
|
+
}
|
|
72
|
+
export declare type ArticleLocalesMapping = {
|
|
73
|
+
[key in Locales]: ContentObject;
|
|
74
|
+
};
|
|
75
|
+
export declare type TranslatedContentObject = {
|
|
76
|
+
type: 'article_translated_content';
|
|
77
|
+
} & Partial<ArticleLocalesMapping>;
|
|
78
|
+
export declare type StatisticsObject = {
|
|
79
|
+
type: 'article_statistics';
|
|
80
|
+
views: number;
|
|
81
|
+
conversations: number;
|
|
82
|
+
reactions: number;
|
|
83
|
+
happy_reaction_percentage: number;
|
|
84
|
+
neutral_reaction_percentage: number;
|
|
85
|
+
sad_reaction_percentage: number;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=article.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article.types.d.ts","sourceRoot":"","sources":["../../../lib/article/article.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,oBAAY,aAAa,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,UAAU,EAAE,gBAAgB,CAAC;CAChC,CAAC;AAEF,oBAAY,OAAO;IACf,MAAM,OAAO;IACb,SAAS,OAAO;IAChB,OAAO,OAAO;IACd,OAAO,OAAO;IACd,KAAK,OAAO;IACZ,MAAM,OAAO;IACb,MAAM,OAAO;IACb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AE,MAAM,CAAC;IAClB,yBAAyB,EAAE,MAAM,CAAC;IAClC,2BAA2B,EAAE,MAAM,CAAC;IACpC,uBAAuB,EAAE,MAAM,CAAC;CACnC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Locales = void 0;
|
|
4
|
+
var Locales;
|
|
5
|
+
(function (Locales) {
|
|
6
|
+
Locales["ARABIC"] = "ar";
|
|
7
|
+
Locales["BULGARIAN"] = "bg";
|
|
8
|
+
Locales["BOSNIAN"] = "bs";
|
|
9
|
+
Locales["CATALAN"] = "ca";
|
|
10
|
+
Locales["CZECH"] = "cs";
|
|
11
|
+
Locales["DANISH"] = "da";
|
|
12
|
+
Locales["GERMAN"] = "de";
|
|
13
|
+
Locales["DE_FORM"] = "de-form";
|
|
14
|
+
Locales["GREEK"] = "el";
|
|
15
|
+
Locales["ENGLISH"] = "en";
|
|
16
|
+
Locales["SPANISH"] = "es";
|
|
17
|
+
Locales["ESTONIAN"] = "et";
|
|
18
|
+
Locales["FINNISH"] = "fi";
|
|
19
|
+
Locales["FRENCH"] = "fr";
|
|
20
|
+
Locales["HEBREW"] = "he";
|
|
21
|
+
Locales["CROATIAN"] = "hr";
|
|
22
|
+
Locales["HUNGARIAN"] = "hu";
|
|
23
|
+
Locales["INDONESIAN"] = "id";
|
|
24
|
+
Locales["ITALIAN"] = "it";
|
|
25
|
+
Locales["JAPANESE"] = "ja";
|
|
26
|
+
Locales["KOREAN"] = "ko";
|
|
27
|
+
Locales["LITHUANIAN"] = "lt";
|
|
28
|
+
Locales["LATVIAN"] = "lv";
|
|
29
|
+
Locales["MONGOLIAN"] = "mn";
|
|
30
|
+
Locales["NORWEGIAN"] = "nb";
|
|
31
|
+
Locales["DUTCH"] = "nl";
|
|
32
|
+
Locales["POLISH"] = "pl";
|
|
33
|
+
Locales["PORTUGUESE_BRAZIL"] = "pt-BR";
|
|
34
|
+
Locales["PORTUGUESE"] = "pt";
|
|
35
|
+
Locales["ROMANIAN"] = "ro";
|
|
36
|
+
Locales["RUSSIAN"] = "ru";
|
|
37
|
+
Locales["SLOVENIAN"] = "sl";
|
|
38
|
+
Locales["SERBIAN"] = "sr";
|
|
39
|
+
Locales["SWEDISH"] = "sv";
|
|
40
|
+
Locales["TURKISH"] = "tr";
|
|
41
|
+
Locales["VIETNAMESE"] = "vi";
|
|
42
|
+
Locales["CHINESE_S"] = "zh-CN";
|
|
43
|
+
Locales["CHINESE_T"] = "zh-TW";
|
|
44
|
+
})(Locales = exports.Locales || (exports.Locales = {}));
|
|
45
|
+
//# sourceMappingURL=article.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article.types.js","sourceRoot":"","sources":["../../../lib/article/article.types.ts"],"names":[],"mappings":";;;AAqBA,IAAY,OAuCX;AAvCD,WAAY,OAAO;IACf,wBAAa,CAAA;IACb,2BAAgB,CAAA;IAChB,yBAAc,CAAA;IACd,yBAAc,CAAA;IACd,uBAAY,CAAA;IACZ,wBAAa,CAAA;IACb,wBAAa,CAAA;IACb,8BAAmB,CAAA;IACnB,uBAAY,CAAA;IACZ,yBAAc,CAAA;IACd,yBAAc,CAAA;IACd,0BAAe,CAAA;IACf,yBAAc,CAAA;IACd,wBAAa,CAAA;IACb,wBAAa,CAAA;IACb,0BAAe,CAAA;IACf,2BAAgB,CAAA;IAChB,4BAAiB,CAAA;IACjB,yBAAc,CAAA;IACd,0BAAe,CAAA;IACf,wBAAa,CAAA;IACb,4BAAiB,CAAA;IACjB,yBAAc,CAAA;IACd,2BAAgB,CAAA;IAChB,2BAAgB,CAAA;IAChB,uBAAY,CAAA;IACZ,wBAAa,CAAA;IACb,sCAA2B,CAAA;IAC3B,4BAAiB,CAAA;IACjB,0BAAe,CAAA;IACf,yBAAc,CAAA;IACd,2BAAgB,CAAA;IAChB,yBAAc,CAAA;IACd,yBAAc,CAAA;IACd,yBAAc,CAAA;IACd,4BAAiB,CAAA;IACjB,8BAAmB,CAAA;IACnB,8BAAmB,CAAA;AACvB,CAAC,EAvCW,OAAO,GAAP,eAAO,KAAP,eAAO,QAuClB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { ArticleObject, TranslatedContentObject } from './article/article.types';
|
|
3
|
+
import { GenericDeletedResponse, OperationById, Paginated } from './common/common.types';
|
|
4
|
+
export default class Article {
|
|
5
|
+
private readonly client;
|
|
6
|
+
readonly baseUrl = "articles";
|
|
7
|
+
constructor(client: Client);
|
|
8
|
+
create({ title, description, body, authorId, state, parentId, parentType, translatedContent, }: CreateArticleData): Promise<ArticleObject>;
|
|
9
|
+
find({ id }: ArticleFindByIdData): Promise<ArticleObject>;
|
|
10
|
+
update({ id, title, description, body, authorId, state, parentId, parentType, translatedContent, }: UpdateArticleData): Promise<ArticleObject>;
|
|
11
|
+
delete({ id }: ArticleDeleteByIdData): Promise<ArticleDeleteByIdResponse>;
|
|
12
|
+
list({ page, perPage: per_page }: ArticleListData): Promise<ArticleListResponse>;
|
|
13
|
+
}
|
|
14
|
+
interface CreateArticleData {
|
|
15
|
+
title: string;
|
|
16
|
+
authorId: number;
|
|
17
|
+
description?: string;
|
|
18
|
+
body?: string;
|
|
19
|
+
state?: string;
|
|
20
|
+
parentId?: number;
|
|
21
|
+
parentType?: string;
|
|
22
|
+
translatedContent?: Omit<TranslatedContentObject, 'type'>;
|
|
23
|
+
}
|
|
24
|
+
declare type ArticleFindByIdData = OperationById;
|
|
25
|
+
declare type UpdateArticleData = Partial<CreateArticleData> & OperationById;
|
|
26
|
+
declare type ArticleDeleteByIdData = OperationById;
|
|
27
|
+
declare type ArticleDeleteByIdResponse = GenericDeletedResponse<'article'>;
|
|
28
|
+
declare type ArticleListData = {
|
|
29
|
+
page?: number;
|
|
30
|
+
perPage?: number;
|
|
31
|
+
};
|
|
32
|
+
declare type ArticleListResponse = Paginated<ArticleObject>;
|
|
33
|
+
export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,CAAC,CAAC;CAC7D;AAED,aAAK,mBAAmB,GAAG,aAAa,CAAC;AAEzC,aAAK,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,GAAG,aAAa,CAAC;AAEpE,aAAK,qBAAqB,GAAG,aAAa,CAAC;AAE3C,aAAK,yBAAyB,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;AAEnE,aAAK,eAAe,GAAG;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,aAAK,mBAAmB,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC"}
|
package/dist/article.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Article = /** @class */ (function () {
|
|
4
|
+
function Article(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.baseUrl = 'articles';
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
Article.prototype.create = function (_a) {
|
|
10
|
+
var title = _a.title, description = _a.description, body = _a.body, authorId = _a.authorId, state = _a.state, parentId = _a.parentId, parentType = _a.parentType, translatedContent = _a.translatedContent;
|
|
11
|
+
var data = {
|
|
12
|
+
title: title,
|
|
13
|
+
description: description,
|
|
14
|
+
body: body,
|
|
15
|
+
author_id: authorId,
|
|
16
|
+
state: state,
|
|
17
|
+
parent_id: parentId,
|
|
18
|
+
parent_type: parentType,
|
|
19
|
+
translated_content: translatedContent,
|
|
20
|
+
};
|
|
21
|
+
return this.client.post({
|
|
22
|
+
url: "/".concat(this.baseUrl),
|
|
23
|
+
data: data,
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
Article.prototype.find = function (_a) {
|
|
27
|
+
var id = _a.id;
|
|
28
|
+
return this.client.get({
|
|
29
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
Article.prototype.update = function (_a) {
|
|
33
|
+
var id = _a.id, title = _a.title, description = _a.description, body = _a.body, authorId = _a.authorId, state = _a.state, parentId = _a.parentId, parentType = _a.parentType, translatedContent = _a.translatedContent;
|
|
34
|
+
var data = {
|
|
35
|
+
title: title,
|
|
36
|
+
description: description,
|
|
37
|
+
body: body,
|
|
38
|
+
author_id: authorId,
|
|
39
|
+
state: state,
|
|
40
|
+
parent_id: parentId,
|
|
41
|
+
parent_type: parentType,
|
|
42
|
+
translated_content: translatedContent,
|
|
43
|
+
};
|
|
44
|
+
return this.client.put({
|
|
45
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
46
|
+
data: data,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
Article.prototype.delete = function (_a) {
|
|
50
|
+
var id = _a.id;
|
|
51
|
+
return this.client.delete({
|
|
52
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
Article.prototype.list = function (_a) {
|
|
56
|
+
var page = _a.page, per_page = _a.perPage;
|
|
57
|
+
var params = {
|
|
58
|
+
page: page,
|
|
59
|
+
per_page: per_page,
|
|
60
|
+
};
|
|
61
|
+
return this.client.get({
|
|
62
|
+
url: "/".concat(this.baseUrl),
|
|
63
|
+
params: params,
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return Article;
|
|
67
|
+
}());
|
|
68
|
+
exports.default = Article;
|
|
69
|
+
//# sourceMappingURL=article.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article.js","sourceRoot":"","sources":["../../lib/article.ts"],"names":[],"mappings":";;AAWA;IAGI,iBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,UAAU,CAAC;QAGjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,wBAAM,GAAN,UAAO,EASa;YARhB,KAAK,WAAA,EACL,WAAW,iBA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O,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,AAjFD,IAiFC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Axios, AxiosDefaults } from 'axios';
|
|
2
|
+
import Article from './article';
|
|
2
3
|
import Admin from './admin';
|
|
3
4
|
import Company from './company';
|
|
4
|
-
import Conversation from './conversation';
|
|
5
5
|
import Contact from './contact';
|
|
6
|
+
import Conversation from './conversation';
|
|
7
|
+
import Count from './count';
|
|
6
8
|
import DataAttribute from './dataAttribute';
|
|
7
9
|
import Event from './event';
|
|
8
|
-
import
|
|
10
|
+
import HelpCenter from './helpCenter';
|
|
9
11
|
import Message from './message';
|
|
12
|
+
import Note from './note';
|
|
13
|
+
import Segment from './segment';
|
|
10
14
|
import Team from './team';
|
|
11
15
|
import Tag from './tag';
|
|
16
|
+
import Visitor from './visitor';
|
|
12
17
|
interface RequestOptions {
|
|
13
18
|
url: string;
|
|
14
19
|
data?: any;
|
|
@@ -31,14 +36,18 @@ declare type ApiKeyAuth = {
|
|
|
31
36
|
appApiKey: string;
|
|
32
37
|
};
|
|
33
38
|
export default class Client {
|
|
39
|
+
articles: Article;
|
|
34
40
|
admins: Admin;
|
|
35
41
|
axiosInstance: Axios;
|
|
36
42
|
companies: Company;
|
|
37
43
|
contacts: Contact;
|
|
38
44
|
conversations: Conversation;
|
|
45
|
+
counts: Count;
|
|
39
46
|
dataAttributes: DataAttribute;
|
|
40
47
|
events: Event;
|
|
48
|
+
helpCenter: HelpCenter;
|
|
41
49
|
messages: Message;
|
|
50
|
+
notes: Note;
|
|
42
51
|
segments: Segment;
|
|
43
52
|
passwordPart?: string;
|
|
44
53
|
propertiesToOmitInRequestOpts: string[];
|
|
@@ -47,6 +56,7 @@ export default class Client {
|
|
|
47
56
|
teams: Team;
|
|
48
57
|
usebaseURL: (baseURL: string) => this;
|
|
49
58
|
usernamePart?: string;
|
|
59
|
+
visitors: Visitor;
|
|
50
60
|
constructor(args: Constructor);
|
|
51
61
|
initiateAxiosInstance(): Axios;
|
|
52
62
|
useRequestOpts(opts: Partial<AxiosDefaults>): this;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../lib/client.ts"],"names":[],"mappings":"AACA,OAAc,EAAE,KAAK,EAAE,aAAa,EAAiB,MAAM,OAAO,CAAC;AAGnE,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,IAAI,MAAM,QAAQ,CAAC;A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