intercom-client 3.1.4 → 3.2.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 +72 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/admin/admin.types.d.ts +0 -15
- package/dist/admin/admin.types.d.ts.map +0 -1
- package/dist/admin/admin.types.js +0 -3
- package/dist/admin/admin.types.js.map +0 -1
- package/dist/admin.d.ts +0 -48
- package/dist/admin.d.ts.map +0 -1
- package/dist/admin.js +0 -42
- package/dist/admin.js.map +0 -1
- package/dist/article/article.types.d.ts +0 -87
- package/dist/article/article.types.d.ts.map +0 -1
- package/dist/article/article.types.js +0 -45
- package/dist/article/article.types.js.map +0 -1
- package/dist/article.d.ts +0 -34
- package/dist/article.d.ts.map +0 -1
- package/dist/article.js +0 -69
- package/dist/article.js.map +0 -1
- package/dist/client.d.ts +0 -76
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -319
- package/dist/client.js.map +0 -1
- package/dist/common/common.types.d.ts +0 -69
- package/dist/common/common.types.d.ts.map +0 -1
- package/dist/common/common.types.js +0 -29
- package/dist/common/common.types.js.map +0 -1
- package/dist/company/company.types.d.ts +0 -37
- package/dist/company/company.types.d.ts.map +0 -1
- package/dist/company/company.types.js +0 -3
- package/dist/company/company.types.js.map +0 -1
- package/dist/company.d.ts +0 -63
- package/dist/company.d.ts.map +0 -1
- package/dist/company.js +0 -114
- package/dist/company.js.map +0 -1
- package/dist/contact/contact.types.d.ts +0 -80
- package/dist/contact/contact.types.d.ts.map +0 -1
- package/dist/contact/contact.types.js +0 -3
- package/dist/contact/contact.types.js.map +0 -1
- package/dist/contact.d.ts +0 -120
- package/dist/contact.d.ts.map +0 -1
- package/dist/contact.js +0 -158
- package/dist/contact.js.map +0 -1
- package/dist/conversation/conversation.types.d.ts +0 -144
- package/dist/conversation/conversation.types.d.ts.map +0 -1
- package/dist/conversation/conversation.types.js +0 -50
- package/dist/conversation/conversation.types.js.map +0 -1
- package/dist/conversation.d.ts +0 -178
- package/dist/conversation.d.ts.map +0 -1
- package/dist/conversation.js +0 -289
- package/dist/conversation.js.map +0 -1
- package/dist/count/count.types.d.ts +0 -89
- package/dist/count/count.types.d.ts.map +0 -1
- package/dist/count/count.types.js +0 -17
- package/dist/count/count.types.js.map +0 -1
- package/dist/count.d.ts +0 -18
- package/dist/count.d.ts.map +0 -1
- package/dist/count.js +0 -72
- package/dist/count.js.map +0 -1
- package/dist/dataAttribute/dataAttribute.types.d.ts +0 -32
- package/dist/dataAttribute/dataAttribute.types.d.ts.map +0 -1
- package/dist/dataAttribute/dataAttribute.types.js +0 -18
- package/dist/dataAttribute/dataAttribute.types.js.map +0 -1
- package/dist/dataAttribute.d.ts +0 -33
- package/dist/dataAttribute.d.ts.map +0 -1
- package/dist/dataAttribute.js +0 -49
- package/dist/dataAttribute.js.map +0 -1
- package/dist/errors/badResponse.error.d.ts +0 -9
- package/dist/errors/badResponse.error.d.ts.map +0 -1
- package/dist/errors/badResponse.error.js +0 -35
- package/dist/errors/badResponse.error.js.map +0 -1
- package/dist/event/event.types.d.ts +0 -29
- package/dist/event/event.types.d.ts.map +0 -1
- package/dist/event/event.types.js +0 -3
- package/dist/event/event.types.js.map +0 -1
- package/dist/event.d.ts +0 -41
- package/dist/event.d.ts.map +0 -1
- package/dist/event.js +0 -44
- package/dist/event.js.map +0 -1
- package/dist/helpCenter/helpCenter.types.d.ts +0 -23
- package/dist/helpCenter/helpCenter.types.d.ts.map +0 -1
- package/dist/helpCenter/helpCenter.types.js +0 -3
- package/dist/helpCenter/helpCenter.types.js.map +0 -1
- package/dist/helpCenter.d.ts +0 -58
- package/dist/helpCenter.d.ts.map +0 -1
- package/dist/helpCenter.js +0 -121
- package/dist/helpCenter.js.map +0 -1
- package/dist/index.d.ts +0 -29
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -74
- package/dist/index.js.map +0 -1
- package/dist/message/message.types.d.ts +0 -17
- package/dist/message/message.types.d.ts.map +0 -1
- package/dist/message/message.types.js +0 -11
- package/dist/message/message.types.js.map +0 -1
- package/dist/message.d.ts +0 -30
- package/dist/message.d.ts.map +0 -1
- package/dist/message.js +0 -34
- package/dist/message.js.map +0 -1
- package/dist/note/note.types.d.ts +0 -13
- package/dist/note/note.types.d.ts.map +0 -1
- package/dist/note/note.types.js +0 -3
- package/dist/note/note.types.js.map +0 -1
- package/dist/note.d.ts +0 -24
- package/dist/note.d.ts.map +0 -1
- package/dist/note.js +0 -40
- package/dist/note.js.map +0 -1
- package/dist/scroll.d.ts +0 -24
- package/dist/scroll.d.ts.map +0 -1
- package/dist/scroll.js +0 -131
- package/dist/scroll.js.map +0 -1
- package/dist/segment/segment.types.d.ts +0 -11
- package/dist/segment/segment.types.d.ts.map +0 -1
- package/dist/segment/segment.types.js +0 -3
- package/dist/segment/segment.types.js.map +0 -1
- package/dist/segment.d.ts +0 -22
- package/dist/segment.d.ts.map +0 -1
- package/dist/segment.js +0 -28
- package/dist/segment.js.map +0 -1
- package/dist/subscription/subscription.types.d.ts +0 -19
- package/dist/subscription/subscription.types.d.ts.map +0 -1
- package/dist/subscription/subscription.types.js +0 -10
- package/dist/subscription/subscription.types.js.map +0 -1
- package/dist/tag/tag.types.d.ts +0 -6
- package/dist/tag/tag.types.d.ts.map +0 -1
- package/dist/tag/tag.types.js +0 -3
- package/dist/tag/tag.types.js.map +0 -1
- package/dist/tag.d.ts +0 -52
- package/dist/tag.d.ts.map +0 -1
- package/dist/tag.js +0 -95
- package/dist/tag.js.map +0 -1
- package/dist/team/team.types.d.ts +0 -7
- package/dist/team/team.types.d.ts.map +0 -1
- package/dist/team/team.types.js +0 -3
- package/dist/team/team.types.js.map +0 -1
- package/dist/team.d.ts +0 -18
- package/dist/team.d.ts.map +0 -1
- package/dist/team.js +0 -23
- package/dist/team.js.map +0 -1
- package/dist/util/time.d.ts +0 -3
- package/dist/util/time.d.ts.map +0 -1
- package/dist/util/time.js +0 -6
- package/dist/util/time.js.map +0 -1
- package/dist/util/url.d.ts +0 -3
- package/dist/util/url.d.ts.map +0 -1
- package/dist/util/url.js +0 -9
- package/dist/util/url.js.map +0 -1
- package/dist/visitor/visitor.types.d.ts +0 -20
- package/dist/visitor/visitor.types.d.ts.map +0 -1
- package/dist/visitor/visitor.types.js +0 -3
- package/dist/visitor/visitor.types.js.map +0 -1
- package/dist/visitor.d.ts +0 -50
- package/dist/visitor.d.ts.map +0 -1
- package/dist/visitor.js +0 -60
- package/dist/visitor.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://circleci.com/gh/intercom/intercom-node)
|
|
4
4
|
[](https://www.npmjs.com/package/intercom-client)
|
|
5
|
-

|
|
6
6
|

|
|
7
7
|
|
|
8
8
|
> Official Node bindings to the [Intercom API](https://api.intercom.io/docs)
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
## Breaking changes
|
|
13
13
|
|
|
14
|
-
The Node SDK has been updated to support latest API version (2.
|
|
14
|
+
The Node SDK has been updated to support latest API version (2.5). The update also contains requested features, such like Typescript support. You can find more information on how-to migrate and what has changed in the [migration guide](https://github.com/intercom/intercom-node/wiki/Migration-guide).
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
@@ -75,6 +75,17 @@ client.useRequestOpts({
|
|
|
75
75
|
});
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
### Setting the API base url
|
|
79
|
+
|
|
80
|
+
If you are using the european instance of intercom and would like to call it directly and not be redirected through our US instance, you can set the `baseUrl` as follows:
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
const client = new Client({ tokenAuth: { token: 'my_token' } });
|
|
84
|
+
client.useRequestOpts({
|
|
85
|
+
baseUrl: 'https://api.eu.intercom.io',
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
78
89
|
## Examples
|
|
79
90
|
|
|
80
91
|
### Admins
|
|
@@ -834,6 +845,29 @@ const response = await client.dataAttributes.list({
|
|
|
834
845
|
});
|
|
835
846
|
```
|
|
836
847
|
|
|
848
|
+
### Data Exports
|
|
849
|
+
|
|
850
|
+
#### [Create a export job](https://developers.intercom.com/intercom-api-reference/reference/creating-an-export-job)
|
|
851
|
+
|
|
852
|
+
```typescript
|
|
853
|
+
const response = await client.dataExport.create({
|
|
854
|
+
createdAtAfter: 1527811200,
|
|
855
|
+
createdAtBefore: 1530316800,
|
|
856
|
+
});
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
#### [Retrieve a job status](https://developers.intercom.com/intercom-api-reference/reference/retrieve-a-job-status)
|
|
860
|
+
|
|
861
|
+
```typescript
|
|
862
|
+
const response = await client.dataExport.find({id: export.id})
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
#### [Cancel a job](https://developers.intercom.com/intercom-api-reference/reference/the-export-job-model)
|
|
866
|
+
|
|
867
|
+
```typescript
|
|
868
|
+
const response = await client.dataExport.cancel({id: export.id})
|
|
869
|
+
```
|
|
870
|
+
|
|
837
871
|
### Events
|
|
838
872
|
|
|
839
873
|
#### [Submit a data event](https://developers.intercom.com/intercom-api-reference/reference/list-data-attributes)
|
|
@@ -1002,6 +1036,24 @@ const response = await client.messages.create({
|
|
|
1002
1036
|
});
|
|
1003
1037
|
```
|
|
1004
1038
|
|
|
1039
|
+
#### [Create conversation without contact reply](https://developers.intercom.com/intercom-api-reference/reference/admin-initiated-conversation)
|
|
1040
|
+
|
|
1041
|
+
```typescript
|
|
1042
|
+
const response = await client.messages.create({
|
|
1043
|
+
messageType: 'inapp',
|
|
1044
|
+
body: 'Look at me, I am a conversation now',
|
|
1045
|
+
from: {
|
|
1046
|
+
type: 'admin',
|
|
1047
|
+
id: '394051',
|
|
1048
|
+
},
|
|
1049
|
+
to: {
|
|
1050
|
+
type: 'user',
|
|
1051
|
+
id: '536e564f316c83104c000020',
|
|
1052
|
+
},
|
|
1053
|
+
createConversationWithoutContactReply: true,
|
|
1054
|
+
});
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1005
1057
|
### Notes
|
|
1006
1058
|
|
|
1007
1059
|
#### [Create a note](https://developers.intercom.com/intercom-api-reference/reference/create-note-for-contact)
|
|
@@ -1049,6 +1101,24 @@ const response = await client.segments.list({
|
|
|
1049
1101
|
});
|
|
1050
1102
|
```
|
|
1051
1103
|
|
|
1104
|
+
|
|
1105
|
+
### Subscriptions
|
|
1106
|
+
|
|
1107
|
+
#### [List all subscription types](https://developers.intercom.com/intercom-api-reference/reference/list-all-subscription-types)
|
|
1108
|
+
|
|
1109
|
+
```typescript
|
|
1110
|
+
const response = await client.subscriptions.listTypes();
|
|
1111
|
+
```
|
|
1112
|
+
### PhoneCallRedirects
|
|
1113
|
+
|
|
1114
|
+
#### [Create a phone call redirect](https://developers.intercom.com/intercom-api-reference/reference/create-a-phone-switch)
|
|
1115
|
+
|
|
1116
|
+
```typescript
|
|
1117
|
+
const response = await client.phoneCallRedirect.create({
|
|
1118
|
+
phone: '+353871234567',
|
|
1119
|
+
});
|
|
1120
|
+
```
|
|
1121
|
+
|
|
1052
1122
|
### Tags
|
|
1053
1123
|
|
|
1054
1124
|
#### [Create or update a tag](https://developers.intercom.com/intercom-api-reference/reference/create-and-update-tags)
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface AdminObject {
|
|
2
|
-
type: 'admin';
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
email: string;
|
|
6
|
-
job_title: string;
|
|
7
|
-
away_mode_enabled: boolean;
|
|
8
|
-
away_mode_reassign: boolean;
|
|
9
|
-
has_inbox_seat: boolean;
|
|
10
|
-
team_ids: Array<number>;
|
|
11
|
-
avatar: string | {
|
|
12
|
-
image_url: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=admin.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin.types.js","sourceRoot":"","sources":["../../../lib/admin/admin.types.ts"],"names":[],"mappings":""}
|
package/dist/admin.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Client } from '.';
|
|
2
|
-
import { AdminObject } from './admin/admin.types';
|
|
3
|
-
export default class Admin {
|
|
4
|
-
private readonly client;
|
|
5
|
-
readonly baseUrl = "admins";
|
|
6
|
-
constructor(client: Client);
|
|
7
|
-
find({ id }: AdminGetByIdData): Promise<AdminObject>;
|
|
8
|
-
away({ adminId, enableAwayMode, enableReassignMode }: SetAdminAwayData): Promise<AdminObject>;
|
|
9
|
-
listAllActivityLogs({ before, after }: ListAllActivityLogsData): Promise<ListAllActivityLogsResponse>;
|
|
10
|
-
list(): Promise<ListAllResponse>;
|
|
11
|
-
}
|
|
12
|
-
interface AdminGetByIdData {
|
|
13
|
-
id: string;
|
|
14
|
-
}
|
|
15
|
-
interface SetAdminAwayData {
|
|
16
|
-
adminId: string;
|
|
17
|
-
enableAwayMode: boolean;
|
|
18
|
-
enableReassignMode: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface ListAllActivityLogsData {
|
|
21
|
-
after: Date;
|
|
22
|
-
before?: Date;
|
|
23
|
-
}
|
|
24
|
-
interface ListAllActivityLogsResponse {
|
|
25
|
-
type: 'activity_log.list';
|
|
26
|
-
activityLogs: Array<ActivityObject>;
|
|
27
|
-
pages?: Pages;
|
|
28
|
-
}
|
|
29
|
-
interface ActivityObject {
|
|
30
|
-
id: string;
|
|
31
|
-
activity_type: string;
|
|
32
|
-
activity_description: string;
|
|
33
|
-
metadata: Record<string | number, string | number>;
|
|
34
|
-
performed_by: AdminObject;
|
|
35
|
-
}
|
|
36
|
-
interface Pages {
|
|
37
|
-
type: 'pages';
|
|
38
|
-
next: unknown | null;
|
|
39
|
-
page: number;
|
|
40
|
-
per_page: number;
|
|
41
|
-
total_pages: number;
|
|
42
|
-
}
|
|
43
|
-
interface ListAllResponse {
|
|
44
|
-
type: 'admin.list';
|
|
45
|
-
admins: AdminObject[];
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=admin.d.ts.map
|
package/dist/admin.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var time_1 = require("./util/time");
|
|
4
|
-
var Admin = /** @class */ (function () {
|
|
5
|
-
function Admin(client) {
|
|
6
|
-
this.client = client;
|
|
7
|
-
this.baseUrl = 'admins';
|
|
8
|
-
this.client = client;
|
|
9
|
-
}
|
|
10
|
-
Admin.prototype.find = function (_a) {
|
|
11
|
-
var id = _a.id;
|
|
12
|
-
return this.client.get({ url: "/".concat(this.baseUrl, "/").concat(id) });
|
|
13
|
-
};
|
|
14
|
-
Admin.prototype.away = function (_a) {
|
|
15
|
-
var adminId = _a.adminId, enableAwayMode = _a.enableAwayMode, enableReassignMode = _a.enableReassignMode;
|
|
16
|
-
var data = {
|
|
17
|
-
away_mode_enabled: enableAwayMode,
|
|
18
|
-
away_mode_reassign: enableReassignMode,
|
|
19
|
-
};
|
|
20
|
-
return this.client.put({
|
|
21
|
-
url: "/".concat(this.baseUrl, "/").concat(adminId, "/away"),
|
|
22
|
-
data: data,
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
Admin.prototype.listAllActivityLogs = function (_a) {
|
|
26
|
-
var before = _a.before, after = _a.after;
|
|
27
|
-
var params = {
|
|
28
|
-
created_at_after: (0, time_1.dateToUnixTimestamp)(after),
|
|
29
|
-
created_at_before: before ? (0, time_1.dateToUnixTimestamp)(before) : undefined,
|
|
30
|
-
};
|
|
31
|
-
return this.client.get({
|
|
32
|
-
url: "/".concat(this.baseUrl, "/activity_logs"),
|
|
33
|
-
params: params,
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
Admin.prototype.list = function () {
|
|
37
|
-
return this.client.get({ url: "/".concat(this.baseUrl) });
|
|
38
|
-
};
|
|
39
|
-
return Admin;
|
|
40
|
-
}());
|
|
41
|
-
exports.default = Admin;
|
|
42
|
-
//# sourceMappingURL=admin.js.map
|
package/dist/admin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,87 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,C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;AAED,oBAAY,qBAAqB,GAAG;KAC/B,GAAG,IAAI,OAAO,GAAG,aAAa;CAClC,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IAClC,IAAI,EAAE,4BAA4B,CAAC;CACtC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEnC,oBAAY,gBAAgB,GAAG;IAC3B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB,EAAE,MAAM,CAAC;IAClC,2BAA2B,EAAE,MAAM,CAAC;IACpC,uBAAuB,EAAE,MAAM,CAAC;CACnC,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/article.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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 {};
|
|
34
|
-
//# sourceMappingURL=article.d.ts.map
|
package/dist/article.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"article.d.ts","sourceRoot":"","sources":["../../lib/article.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EACH,aAAa,EACb,uBAAuB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,sBAAsB,EACtB,aAAa,EACb,SAAS,EACZ,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,OAAO;IAGZ,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,cAAc;gBAER,MAAM,EAAE,MAAM;IAI3C,MAAM,CAAC,EACH,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACV,iBAAiB,GACpB,EAAE,iBAAiB;IAiBpB,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,mBAAmB;IAKhC,MAAM,CAAC,EACH,EAAE,EACF,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACV,iBAAiB,GACpB,EAAE,iBAAiB;IAiBpB,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,qBAAqB;IAKpC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe;CAWpD;AAED,UAAU,iBAAiB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,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
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
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
|
package/dist/article.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,iBAAA,EACX,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,UAAU,gBAAA,EACV,iBAAiB,uBAAA;QAEjB,IAAM,IAAI,GAAG;YACT,KAAK,OAAA;YACL,WAAW,aAAA;YACX,IAAI,MAAA;YACJ,SAAS,EAAE,QAAQ;YACnB,KAAK,OAAA;YACL,SAAS,EAAE,QAAQ;YACnB,WAAW,EAAE,UAAU;YACvB,kBAAkB,EAAE,iBAAiB;SACxC,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAgB;YACnC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;YACvB,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,sBAAI,GAAJ,UAAK,EAA2B;YAAzB,EAAE,QAAA;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB;YAClC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE;SAChC,CAAC,CAAC;IACP,CAAC;IACD,wBAAM,GAAN,UAAO,EAUa;YAThB,EAAE,QAAA,EACF,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,UAAU,gBAAA,EACV,iBAAiB,uBAAA;QAEjB,IAAM,IAAI,GAAG;YACT,KAAK,OAAA;YACL,WAAW,aAAA;YACX,IAAI,MAAA;YACJ,SAAS,EAAE,QAAQ;YACnB,KAAK,OAAA;YACL,SAAS,EAAE,QAAQ;YACnB,WAAW,EAAE,UAAU;YACvB,kBAAkB,EAAE,iBAAiB;SACxC,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB;YAClC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE;YAC7B,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,wBAAM,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,AAjFD,IAiFC"}
|
package/dist/client.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Axios, AxiosDefaults } from 'axios';
|
|
2
|
-
import Article from './article';
|
|
3
|
-
import Admin from './admin';
|
|
4
|
-
import Company from './company';
|
|
5
|
-
import Contact from './contact';
|
|
6
|
-
import Conversation from './conversation';
|
|
7
|
-
import Count from './count';
|
|
8
|
-
import DataAttribute from './dataAttribute';
|
|
9
|
-
import Event from './event';
|
|
10
|
-
import HelpCenter from './helpCenter';
|
|
11
|
-
import Message from './message';
|
|
12
|
-
import Note from './note';
|
|
13
|
-
import Segment from './segment';
|
|
14
|
-
import Team from './team';
|
|
15
|
-
import Tag from './tag';
|
|
16
|
-
import Visitor from './visitor';
|
|
17
|
-
interface RequestOptions {
|
|
18
|
-
url: string;
|
|
19
|
-
data?: any;
|
|
20
|
-
params?: any;
|
|
21
|
-
}
|
|
22
|
-
declare type Constructor = {
|
|
23
|
-
usernameAuth?: UsernameAuth;
|
|
24
|
-
tokenAuth?: TokenAuth;
|
|
25
|
-
apiKeyAuth?: ApiKeyAuth;
|
|
26
|
-
};
|
|
27
|
-
declare type UsernameAuth = {
|
|
28
|
-
username: string;
|
|
29
|
-
password: string;
|
|
30
|
-
};
|
|
31
|
-
declare type TokenAuth = {
|
|
32
|
-
token: string;
|
|
33
|
-
};
|
|
34
|
-
declare type ApiKeyAuth = {
|
|
35
|
-
appId: string;
|
|
36
|
-
appApiKey: string;
|
|
37
|
-
};
|
|
38
|
-
export default class Client {
|
|
39
|
-
articles: Article;
|
|
40
|
-
admins: Admin;
|
|
41
|
-
axiosInstance: Axios;
|
|
42
|
-
companies: Company;
|
|
43
|
-
contacts: Contact;
|
|
44
|
-
conversations: Conversation;
|
|
45
|
-
counts: Count;
|
|
46
|
-
dataAttributes: DataAttribute;
|
|
47
|
-
events: Event;
|
|
48
|
-
helpCenter: HelpCenter;
|
|
49
|
-
messages: Message;
|
|
50
|
-
notes: Note;
|
|
51
|
-
segments: Segment;
|
|
52
|
-
passwordPart?: string;
|
|
53
|
-
propertiesToOmitInRequestOpts: string[];
|
|
54
|
-
requestOpts: Partial<AxiosDefaults>;
|
|
55
|
-
tags: Tag;
|
|
56
|
-
teams: Team;
|
|
57
|
-
usernamePart?: string;
|
|
58
|
-
visitors: Visitor;
|
|
59
|
-
constructor(args: Constructor);
|
|
60
|
-
initiateAxiosInstance(): Axios;
|
|
61
|
-
useRequestOpts(opts: Partial<AxiosDefaults>): this;
|
|
62
|
-
updateAxiosInstanceDefaults(): void;
|
|
63
|
-
filterUnwantedProperties(opts: Partial<AxiosDefaults>): Partial<AxiosDefaults>;
|
|
64
|
-
ping<T>(): Promise<T>;
|
|
65
|
-
put<T>({ url, data }: RequestOptions): Promise<T>;
|
|
66
|
-
post<T>({ url, data }: RequestOptions): Promise<T>;
|
|
67
|
-
get<T>({ url, data, params }: RequestOptions): Promise<T>;
|
|
68
|
-
nextPage<T>(paginationObject: {
|
|
69
|
-
next: string;
|
|
70
|
-
}): Promise<T>;
|
|
71
|
-
delete<T>({ url, data, params }: RequestOptions): Promise<T>;
|
|
72
|
-
private checkOnErrorInResponse;
|
|
73
|
-
private static getAuthDetails;
|
|
74
|
-
}
|
|
75
|
-
export {};
|
|
76
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../lib/client.ts"],"names":[],"mappings":"AAAA,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;AAC1B,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,OAAO,MAAM,WAAW,CAAC;AAMhC,UAAU,cAAc;IACpB,GAAG,EAAE,MAAM,CAAC;IAEZ,IAA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