@dugjason/front-node 0.1.0 → 0.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/{LICENSE.md → LICENSE} +2 -2
- package/README.md +40 -297
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11907 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +11907 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +67 -32
- package/dist/src/client.d.ts +0 -48
- package/dist/src/client.d.ts.map +0 -1
- package/dist/src/client.js +0 -218
- package/dist/src/client.js.map +0 -1
- package/dist/src/front.d.ts +0 -29
- package/dist/src/front.d.ts.map +0 -1
- package/dist/src/front.js +0 -44
- package/dist/src/front.js.map +0 -1
- package/dist/src/index.d.ts +0 -8
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -10
- package/dist/src/index.js.map +0 -1
- package/dist/src/oauth.d.ts +0 -28
- package/dist/src/oauth.d.ts.map +0 -1
- package/dist/src/oauth.js +0 -82
- package/dist/src/oauth.js.map +0 -1
- package/dist/src/resources/accounts.d.ts +0 -39
- package/dist/src/resources/accounts.d.ts.map +0 -1
- package/dist/src/resources/accounts.js +0 -57
- package/dist/src/resources/accounts.js.map +0 -1
- package/dist/src/resources/conversations.d.ts +0 -41
- package/dist/src/resources/conversations.d.ts.map +0 -1
- package/dist/src/resources/conversations.js +0 -55
- package/dist/src/resources/conversations.js.map +0 -1
- package/dist/src/resources/teammates.d.ts +0 -29
- package/dist/src/resources/teammates.d.ts.map +0 -1
- package/dist/src/resources/teammates.js +0 -37
- package/dist/src/resources/teammates.js.map +0 -1
- package/dist/src/types.d.ts +0 -147
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/types.js.map +0 -1
- package/dist/tests/client.test.d.ts +0 -2
- package/dist/tests/client.test.d.ts.map +0 -1
- package/dist/tests/client.test.js +0 -226
- package/dist/tests/client.test.js.map +0 -1
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { FrontClient } from "../client";
|
|
2
|
-
import type { Account, AccountContactsParams, CreateAccountData, ListResponse, PaginationParams, UpdateAccountData } from "../types";
|
|
3
|
-
export declare class Accounts {
|
|
4
|
-
private client;
|
|
5
|
-
constructor(client: FrontClient);
|
|
6
|
-
/**
|
|
7
|
-
* List all accounts
|
|
8
|
-
*/
|
|
9
|
-
list(params?: PaginationParams): Promise<ListResponse<Account>>;
|
|
10
|
-
/**
|
|
11
|
-
* Create a new account
|
|
12
|
-
*/
|
|
13
|
-
create(data: CreateAccountData): Promise<Account>;
|
|
14
|
-
/**
|
|
15
|
-
* Fetch a specific account by ID
|
|
16
|
-
*/
|
|
17
|
-
fetch(accountId: string): Promise<Account>;
|
|
18
|
-
/**
|
|
19
|
-
* Update an account
|
|
20
|
-
*/
|
|
21
|
-
update(accountId: string, data: UpdateAccountData): Promise<Account>;
|
|
22
|
-
/**
|
|
23
|
-
* Delete an account
|
|
24
|
-
*/
|
|
25
|
-
delete(accountId: string): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* List contacts associated with an account
|
|
28
|
-
*/
|
|
29
|
-
getContacts(accountId: string, params?: AccountContactsParams): Promise<unknown>;
|
|
30
|
-
/**
|
|
31
|
-
* Add a contact to an account
|
|
32
|
-
*/
|
|
33
|
-
addContact(accountId: string, contactIds: string[]): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Remove a contact from an account
|
|
36
|
-
*/
|
|
37
|
-
removeContact(accountId: string, contactId: string): Promise<void>;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../src/resources/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EACV,OAAO,EACP,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAEjB,qBAAa,QAAQ;IACP,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEvC;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAIrE;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD;;OAEG;IACG,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhD;;OAEG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1E;;OAEG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C;;OAEG;IACG,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,qBAAqB;IAInE;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxE;;OAEG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAKzE"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export class Accounts {
|
|
2
|
-
client;
|
|
3
|
-
constructor(client) {
|
|
4
|
-
this.client = client;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* List all accounts
|
|
8
|
-
*/
|
|
9
|
-
async list(params) {
|
|
10
|
-
return this.client.get("/accounts", params);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Create a new account
|
|
14
|
-
*/
|
|
15
|
-
async create(data) {
|
|
16
|
-
return this.client.post("/accounts", data);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Fetch a specific account by ID
|
|
20
|
-
*/
|
|
21
|
-
async fetch(accountId) {
|
|
22
|
-
return this.client.get(`/accounts/${accountId}`);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Update an account
|
|
26
|
-
*/
|
|
27
|
-
async update(accountId, data) {
|
|
28
|
-
return this.client.patch(`/accounts/${accountId}`, data);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Delete an account
|
|
32
|
-
*/
|
|
33
|
-
async delete(accountId) {
|
|
34
|
-
return this.client.delete(`/accounts/${accountId}`);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* List contacts associated with an account
|
|
38
|
-
*/
|
|
39
|
-
async getContacts(accountId, params) {
|
|
40
|
-
return this.client.get(`/accounts/${accountId}/contacts`, params);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Add a contact to an account
|
|
44
|
-
*/
|
|
45
|
-
async addContact(accountId, contactIds) {
|
|
46
|
-
return this.client.post(`/accounts/${accountId}/contacts`, {
|
|
47
|
-
contact_ids: contactIds,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Remove a contact from an account
|
|
52
|
-
*/
|
|
53
|
-
async removeContact(accountId, contactId) {
|
|
54
|
-
return this.client.delete(`/accounts/${accountId}/contacts/${contactId}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=accounts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../src/resources/accounts.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,QAAQ;IACC;IAApB,YAAoB,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,I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0,0 @@
|
|
|
1
|
-
import type { FrontClient } from "../client";
|
|
2
|
-
import type { Conversation, ListResponse, PaginationParams } from "../types";
|
|
3
|
-
export declare class Conversations {
|
|
4
|
-
private client;
|
|
5
|
-
constructor(client: FrontClient);
|
|
6
|
-
/**
|
|
7
|
-
* List conversations
|
|
8
|
-
*/
|
|
9
|
-
list(params?: PaginationParams & {
|
|
10
|
-
q?: string;
|
|
11
|
-
}): Promise<ListResponse<Conversation>>;
|
|
12
|
-
/**
|
|
13
|
-
* Fetch a specific conversation by ID
|
|
14
|
-
*/
|
|
15
|
-
fetch(conversationId: string): Promise<Conversation>;
|
|
16
|
-
/**
|
|
17
|
-
* Update a conversation
|
|
18
|
-
*/
|
|
19
|
-
update(conversationId: string, data: Partial<Pick<Conversation, "assignee" | "status" | "tags">>): Promise<Conversation>;
|
|
20
|
-
/**
|
|
21
|
-
* Get conversation messages
|
|
22
|
-
*/
|
|
23
|
-
getMessages(conversationId: string, params?: PaginationParams): Promise<unknown>;
|
|
24
|
-
/**
|
|
25
|
-
* Get conversation events
|
|
26
|
-
*/
|
|
27
|
-
getEvents(conversationId: string, params?: PaginationParams): Promise<unknown>;
|
|
28
|
-
/**
|
|
29
|
-
* Get conversation comments
|
|
30
|
-
*/
|
|
31
|
-
getComments(conversationId: string, params?: PaginationParams): Promise<unknown>;
|
|
32
|
-
/**
|
|
33
|
-
* Get conversation followers
|
|
34
|
-
*/
|
|
35
|
-
getFollowers(conversationId: string): Promise<unknown>;
|
|
36
|
-
/**
|
|
37
|
-
* Get conversation inboxes
|
|
38
|
-
*/
|
|
39
|
-
getInboxes(conversationId: string): Promise<unknown>;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/resources/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE5E,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEvC;;OAEG;IACG,IAAI,CACR,MAAM,CAAC,EAAE,gBAAgB,GAAG;QAAE,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GACzC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAItC;;OAEG;IACG,KAAK,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAI1D;;OAEG;IACG,MAAM,CACV,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC,GAChE,OAAO,CAAC,YAAY,CAAC;IAOxB;;OAEG;IACG,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB;IAInE;;OAEG;IACG,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB;IAIjE;;OAEG;IACG,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB;IAInE;;OAEG;IACG,YAAY,CAAC,cAAc,EAAE,MAAM;IAIzC;;OAEG;IACG,UAAU,CAAC,cAAc,EAAE,MAAM;CAGxC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export class Conversations {
|
|
2
|
-
client;
|
|
3
|
-
constructor(client) {
|
|
4
|
-
this.client = client;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* List conversations
|
|
8
|
-
*/
|
|
9
|
-
async list(params) {
|
|
10
|
-
return this.client.get("/conversations", params);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Fetch a specific conversation by ID
|
|
14
|
-
*/
|
|
15
|
-
async fetch(conversationId) {
|
|
16
|
-
return this.client.get(`/conversations/${conversationId}`);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Update a conversation
|
|
20
|
-
*/
|
|
21
|
-
async update(conversationId, data) {
|
|
22
|
-
return this.client.patch(`/conversations/${conversationId}`, data);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Get conversation messages
|
|
26
|
-
*/
|
|
27
|
-
async getMessages(conversationId, params) {
|
|
28
|
-
return this.client.get(`/conversations/${conversationId}/messages`, params);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get conversation events
|
|
32
|
-
*/
|
|
33
|
-
async getEvents(conversationId, params) {
|
|
34
|
-
return this.client.get(`/conversations/${conversationId}/events`, params);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Get conversation comments
|
|
38
|
-
*/
|
|
39
|
-
async getComments(conversationId, params) {
|
|
40
|
-
return this.client.get(`/conversations/${conversationId}/comments`, params);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Get conversation followers
|
|
44
|
-
*/
|
|
45
|
-
async getFollowers(conversationId) {
|
|
46
|
-
return this.client.get(`/conversations/${conversationId}/followers`);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Get conversation inboxes
|
|
50
|
-
*/
|
|
51
|
-
async getInboxes(conversationId) {
|
|
52
|
-
return this.client.get(`/conversations/${conversationId}/inboxes`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=conversations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/resources/conversations.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,aAAa;IACJ;IAApB,YAAoB,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,MAA0C;QAE1C,OAAO,IAAI,CAAC,MAAM,CAAC,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ponse, PaginationParams, Teammate, UpdateTeammateData } from "../types";
|
|
3
|
-
export declare class Teammates {
|
|
4
|
-
private client;
|
|
5
|
-
constructor(client: FrontClient);
|
|
6
|
-
/**
|
|
7
|
-
* List all teammates
|
|
8
|
-
*/
|
|
9
|
-
list(params?: PaginationParams): Promise<ListResponse<Teammate>>;
|
|
10
|
-
/**
|
|
11
|
-
* Fetch a specific teammate by ID
|
|
12
|
-
*/
|
|
13
|
-
fetch(teammateId: string): Promise<Teammate>;
|
|
14
|
-
/**
|
|
15
|
-
* Update a teammate
|
|
16
|
-
*/
|
|
17
|
-
update(teammateId: string, data: UpdateTeammateData): Promise<Teammate>;
|
|
18
|
-
/**
|
|
19
|
-
* Get teammate's inboxes
|
|
20
|
-
*/
|
|
21
|
-
getInboxes(teammateId: string, params?: PaginationParams): Promise<unknown>;
|
|
22
|
-
/**
|
|
23
|
-
* Get teammate's conversations
|
|
24
|
-
*/
|
|
25
|
-
getConversations(teammateId: string, params?: PaginationParams & {
|
|
26
|
-
q?: string;
|
|
27
|
-
}): Promise<unknown>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=teammates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"teammates.d.ts","sourceRoot":"","sources":["../../../src/resources/teammates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAEjB,qBAAa,SAAS;IACR,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEvC;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAItE;;OAEG;IACG,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIlD;;OAEG;IACG,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,QAAQ,CAAC;IAIpB;;OAEG;IACG,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB;IAI9D;;OAEG;IACG,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,gBAAgB,GAAG;QAAE,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE;CAI7C"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export class Teammates {
|
|
2
|
-
client;
|
|
3
|
-
constructor(client) {
|
|
4
|
-
this.client = client;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* List all teammates
|
|
8
|
-
*/
|
|
9
|
-
async list(params) {
|
|
10
|
-
return this.client.get("/teammates", params);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Fetch a specific teammate by ID
|
|
14
|
-
*/
|
|
15
|
-
async fetch(teammateId) {
|
|
16
|
-
return this.client.get(`/teammates/${teammateId}`);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Update a teammate
|
|
20
|
-
*/
|
|
21
|
-
async update(teammateId, data) {
|
|
22
|
-
return this.client.patch(`/teammates/${teammateId}`, data);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Get teammate's inboxes
|
|
26
|
-
*/
|
|
27
|
-
async getInboxes(teammateId, params) {
|
|
28
|
-
return this.client.get(`/teammates/${teammateId}/inboxes`, params);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get teammate's conversations
|
|
32
|
-
*/
|
|
33
|
-
async getConversations(teammateId, params) {
|
|
34
|
-
return this.client.get(`/teammates/${teammateId}/conversations`, params);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=teammates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"teammates.js","sourceRoot":"","sources":["../../../src/resources/teammates.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,SAAS;IACA;IAApB,YAAoB,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAAyB;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,YAAY,EAAE,MAAM,CAAC,CAAA;IACtE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,UAAkB;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAW,cAAc,UAAU,EAAE,CAAC,CAAA;IAC9D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,UAAkB,EAClB,IAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAW,cAAc,UAAU,EAAE,EAAE,IAAI,CAAC,CAAA;IACtE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,UAAkB,EAAE,MAAyB;QAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,UAAU,UAAU,EAAE,MAAM,CAAC,CAAA;IACpE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CACpB,UAAkB,EAClB,MAA0C;QAE1C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,UAAU,gBAAgB,EAAE,MAAM,CAAC,CAAA;IAC1E,CAAC;CACF"}
|
package/dist/src/types.d.ts
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
export type FrontConfig = {
|
|
2
|
-
apiKey: string;
|
|
3
|
-
baseUrl?: string;
|
|
4
|
-
oauth?: never;
|
|
5
|
-
} | {
|
|
6
|
-
apiKey?: never;
|
|
7
|
-
baseUrl?: string;
|
|
8
|
-
oauth: OAuthConfig;
|
|
9
|
-
};
|
|
10
|
-
export interface OAuthConfig {
|
|
11
|
-
clientId: string;
|
|
12
|
-
clientSecret: string;
|
|
13
|
-
accessToken: string;
|
|
14
|
-
refreshToken: string;
|
|
15
|
-
onTokenRefresh?: (tokens: OAuthTokens) => void | Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export interface OAuthTokens {
|
|
18
|
-
access_token: string;
|
|
19
|
-
refresh_token: string;
|
|
20
|
-
}
|
|
21
|
-
export interface RequestOptions {
|
|
22
|
-
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
23
|
-
path: string;
|
|
24
|
-
body?: unknown;
|
|
25
|
-
params?: Record<string, unknown>;
|
|
26
|
-
}
|
|
27
|
-
export interface FrontError {
|
|
28
|
-
message: string;
|
|
29
|
-
status?: number;
|
|
30
|
-
code?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface PaginationParams extends Record<string, unknown> {
|
|
33
|
-
limit?: number;
|
|
34
|
-
page_token?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface ListResponse<T> {
|
|
37
|
-
_results: T[];
|
|
38
|
-
_pagination?: {
|
|
39
|
-
next?: string;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export interface Teammate {
|
|
43
|
-
_links: {
|
|
44
|
-
self: string;
|
|
45
|
-
related: {
|
|
46
|
-
inboxes: string;
|
|
47
|
-
conversations: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
id: string;
|
|
51
|
-
email: string;
|
|
52
|
-
username: string;
|
|
53
|
-
first_name: string;
|
|
54
|
-
last_name: string;
|
|
55
|
-
is_admin: boolean;
|
|
56
|
-
is_available: boolean;
|
|
57
|
-
is_blocked: boolean;
|
|
58
|
-
custom_fields?: Record<string, unknown>;
|
|
59
|
-
}
|
|
60
|
-
export interface UpdateTeammateData {
|
|
61
|
-
first_name?: string;
|
|
62
|
-
last_name?: string;
|
|
63
|
-
is_available?: boolean;
|
|
64
|
-
custom_fields?: Record<string, unknown>;
|
|
65
|
-
}
|
|
66
|
-
export interface Conversation {
|
|
67
|
-
_links: {
|
|
68
|
-
self: string;
|
|
69
|
-
related: {
|
|
70
|
-
events: string;
|
|
71
|
-
followers: string;
|
|
72
|
-
messages: string;
|
|
73
|
-
comments: string;
|
|
74
|
-
inboxes: string;
|
|
75
|
-
last_message: string;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
id: string;
|
|
79
|
-
subject: string;
|
|
80
|
-
status: string;
|
|
81
|
-
status_id: string;
|
|
82
|
-
status_category: string;
|
|
83
|
-
ticket_ids?: string[];
|
|
84
|
-
assignee?: Teammate;
|
|
85
|
-
recipient: {
|
|
86
|
-
_links: {
|
|
87
|
-
related: {
|
|
88
|
-
contact: string;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
handle: string;
|
|
92
|
-
role: string;
|
|
93
|
-
};
|
|
94
|
-
tags: Array<{
|
|
95
|
-
_links: {
|
|
96
|
-
self: string;
|
|
97
|
-
related: {
|
|
98
|
-
conversations: string;
|
|
99
|
-
owner: string;
|
|
100
|
-
children: string;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
id: string;
|
|
104
|
-
name: string;
|
|
105
|
-
highlight: string;
|
|
106
|
-
is_private: boolean;
|
|
107
|
-
created_at: number;
|
|
108
|
-
updated_at: number;
|
|
109
|
-
}>;
|
|
110
|
-
created_at: number;
|
|
111
|
-
is_private: boolean;
|
|
112
|
-
}
|
|
113
|
-
export interface Account {
|
|
114
|
-
_links: {
|
|
115
|
-
self: string;
|
|
116
|
-
related: {
|
|
117
|
-
contacts: string;
|
|
118
|
-
conversations: string;
|
|
119
|
-
owner: string;
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
id: string;
|
|
123
|
-
name: string;
|
|
124
|
-
description?: string;
|
|
125
|
-
domains: string[];
|
|
126
|
-
external_id?: string;
|
|
127
|
-
custom_fields?: Record<string, unknown>;
|
|
128
|
-
created_at: number;
|
|
129
|
-
updated_at: number;
|
|
130
|
-
}
|
|
131
|
-
export interface CreateAccountData {
|
|
132
|
-
name: string;
|
|
133
|
-
description?: string;
|
|
134
|
-
domains?: string[];
|
|
135
|
-
external_id?: string;
|
|
136
|
-
custom_fields?: Record<string, unknown>;
|
|
137
|
-
}
|
|
138
|
-
export interface UpdateAccountData {
|
|
139
|
-
name?: string;
|
|
140
|
-
description?: string;
|
|
141
|
-
domains?: string[];
|
|
142
|
-
custom_fields?: Record<string, unknown>;
|
|
143
|
-
}
|
|
144
|
-
export interface AccountContactsParams extends PaginationParams {
|
|
145
|
-
q?: string;
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GACnB;IACE,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GACD;IACE,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,WAAW,CAAA;CACnB,CAAA;AAEL,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/D;AAED,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAA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CAAA;YAChB,aAAa,EAAE,MAAM,CAAA;YACrB,KAAK,EAAE,MAAM,CAAA;SACd,CAAA;KACF,CAAA;IACD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACxC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACxC;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,CAAC,CAAC,EAAE,MAAM,CAAA;CACX"}
|
package/dist/src/types.js
DELETED
package/dist/src/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.test.d.ts","sourceRoot":"","sources":["../../tests/client.test.ts"],"names":[],"mappings":""}
|