cogfy-messenger 0.1.0 → 0.1.1

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.
Files changed (84) hide show
  1. package/dist/clients/base-client.d.ts +8 -0
  2. package/dist/clients/base-client.js +9 -0
  3. package/dist/clients/contacts/contacts-client.d.ts +34 -0
  4. package/dist/clients/contacts/contacts-client.js +66 -0
  5. package/dist/clients/contacts/index.d.ts +2 -0
  6. package/dist/clients/contacts/index.js +18 -0
  7. package/dist/clients/contacts/types/create-contact.d.ts +15 -0
  8. package/dist/clients/contacts/types/create-contact.js +2 -0
  9. package/{src/clients/contacts/types/delete-contact.ts → dist/clients/contacts/types/delete-contact.d.ts} +2 -2
  10. package/dist/clients/contacts/types/delete-contact.js +2 -0
  11. package/dist/clients/contacts/types/get-contact.d.ts +18 -0
  12. package/dist/clients/contacts/types/get-contact.js +2 -0
  13. package/dist/clients/contacts/types/index.d.ts +5 -0
  14. package/dist/clients/contacts/types/index.js +21 -0
  15. package/dist/clients/contacts/types/list-contacts.d.ts +20 -0
  16. package/dist/clients/contacts/types/list-contacts.js +2 -0
  17. package/dist/clients/contacts/types/update-contact.d.ts +14 -0
  18. package/dist/clients/contacts/types/update-contact.js +2 -0
  19. package/dist/clients/conversations/conversations-client.d.ts +24 -0
  20. package/dist/clients/conversations/conversations-client.js +57 -0
  21. package/dist/clients/conversations/index.d.ts +2 -0
  22. package/dist/clients/conversations/index.js +18 -0
  23. package/dist/clients/conversations/types/get-conversation.d.ts +11 -0
  24. package/dist/clients/conversations/types/get-conversation.js +2 -0
  25. package/dist/clients/conversations/types/get-messages.d.ts +35 -0
  26. package/dist/clients/conversations/types/get-messages.js +2 -0
  27. package/dist/clients/conversations/types/index.d.ts +4 -0
  28. package/dist/clients/conversations/types/index.js +20 -0
  29. package/dist/clients/conversations/types/list-conversations.d.ts +30 -0
  30. package/dist/clients/conversations/types/list-conversations.js +2 -0
  31. package/dist/clients/conversations/types/send-message.d.ts +12 -0
  32. package/dist/clients/conversations/types/send-message.js +2 -0
  33. package/dist/clients/index.d.ts +2 -0
  34. package/dist/clients/index.js +18 -0
  35. package/dist/clients/tags/index.d.ts +2 -0
  36. package/dist/clients/tags/index.js +18 -0
  37. package/dist/clients/tags/tags-client.d.ts +34 -0
  38. package/dist/clients/tags/tags-client.js +66 -0
  39. package/{src/clients/tags/types/create-tag.ts → dist/clients/tags/types/create-tag.d.ts} +5 -6
  40. package/dist/clients/tags/types/create-tag.js +2 -0
  41. package/dist/clients/tags/types/delete-tag.d.ts +4 -0
  42. package/dist/clients/tags/types/delete-tag.js +2 -0
  43. package/dist/clients/tags/types/get-tag.d.ts +4 -0
  44. package/dist/clients/tags/types/get-tag.js +2 -0
  45. package/dist/clients/tags/types/index.d.ts +5 -0
  46. package/dist/clients/tags/types/index.js +21 -0
  47. package/dist/clients/tags/types/list-tags.d.ts +6 -0
  48. package/dist/clients/tags/types/list-tags.js +2 -0
  49. package/{src/clients/tags/types/update-tag.ts → dist/clients/tags/types/update-tag.d.ts} +5 -6
  50. package/dist/clients/tags/types/update-tag.js +2 -0
  51. package/dist/cogfy-messenger.d.ts +13 -0
  52. package/dist/cogfy-messenger.js +27 -0
  53. package/dist/index.d.ts +2 -0
  54. package/dist/index.js +18 -0
  55. package/package.json +5 -2
  56. package/.github/workflows/tests.yml +0 -18
  57. package/src/clients/base-client.ts +0 -13
  58. package/src/clients/contacts/contacts-client.test.ts +0 -89
  59. package/src/clients/contacts/contacts-client.ts +0 -49
  60. package/src/clients/contacts/index.ts +0 -2
  61. package/src/clients/contacts/types/create-contact.ts +0 -16
  62. package/src/clients/contacts/types/get-contact.ts +0 -18
  63. package/src/clients/contacts/types/index.ts +0 -5
  64. package/src/clients/contacts/types/list-contacts.ts +0 -20
  65. package/src/clients/contacts/types/update-contact.ts +0 -15
  66. package/src/clients/conversations/conversations-client.test.ts +0 -56
  67. package/src/clients/conversations/conversations-client.ts +0 -41
  68. package/src/clients/conversations/index.ts +0 -2
  69. package/src/clients/conversations/types/get-conversation.ts +0 -11
  70. package/src/clients/conversations/types/get-messages.ts +0 -35
  71. package/src/clients/conversations/types/index.ts +0 -4
  72. package/src/clients/conversations/types/list-conversations.ts +0 -37
  73. package/src/clients/conversations/types/send-message.ts +0 -13
  74. package/src/clients/index.ts +0 -2
  75. package/src/clients/tags/index.ts +0 -2
  76. package/src/clients/tags/tags-client.test.ts +0 -80
  77. package/src/clients/tags/tags-client.ts +0 -49
  78. package/src/clients/tags/types/delete-tag.ts +0 -4
  79. package/src/clients/tags/types/get-tag.ts +0 -4
  80. package/src/clients/tags/types/index.ts +0 -5
  81. package/src/clients/tags/types/list-tags.ts +0 -6
  82. package/src/cogfy-messenger.ts +0 -33
  83. package/src/index.ts +0 -2
  84. package/tsconfig.json +0 -16
@@ -0,0 +1,8 @@
1
+ import { AxiosInstance } from 'axios';
2
+ export type BaseClientOptions = {
3
+ axios: AxiosInstance;
4
+ };
5
+ export declare abstract class BaseClient {
6
+ protected axios: AxiosInstance;
7
+ constructor(options: BaseClientOptions);
8
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseClient = void 0;
4
+ class BaseClient {
5
+ constructor(options) {
6
+ this.axios = options.axios;
7
+ }
8
+ }
9
+ exports.BaseClient = BaseClient;
@@ -0,0 +1,34 @@
1
+ import { BaseClient } from '../base-client';
2
+ import { CreateContactCommand, CreateContactResult, DeleteContactResult, GetContactResult, ListContactsResult, UpdateContactCommand, UpdateContactResult } from './types';
3
+ export declare class ContactsClient extends BaseClient {
4
+ /**
5
+ * Calls the POST /contacts endpoint
6
+ * @param contact The contact data to create
7
+ * @returns An object with the ID of the newly created contact
8
+ */
9
+ create(contact: CreateContactCommand): Promise<CreateContactResult>;
10
+ /**
11
+ * Calls the GET /contacts/:id endpoint
12
+ * @param id The ID of the contact to retrieve
13
+ * @returns The contact with the specified ID
14
+ */
15
+ get(id: string): Promise<GetContactResult>;
16
+ /**
17
+ * Calls the GET /contacts endpoint
18
+ * @returns A list of all contacts in the workspace
19
+ */
20
+ list(): Promise<ListContactsResult>;
21
+ /**
22
+ * Calls the PATCH /contacts/:id endpoint
23
+ * @param id The ID of the contact to update
24
+ * @param contact The updated contact data
25
+ * @returns An object with the ID of the updated contact
26
+ */
27
+ update(id: string, contact: UpdateContactCommand): Promise<UpdateContactResult>;
28
+ /**
29
+ * Calls the DELETE /contacts/:id endpoint
30
+ * @param id The ID of the contact to delete
31
+ * @returns An object with the ID of the deleted contact
32
+ */
33
+ delete(id: string): Promise<DeleteContactResult>;
34
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContactsClient = void 0;
13
+ const base_client_1 = require("../base-client");
14
+ class ContactsClient extends base_client_1.BaseClient {
15
+ /**
16
+ * Calls the POST /contacts endpoint
17
+ * @param contact The contact data to create
18
+ * @returns An object with the ID of the newly created contact
19
+ */
20
+ create(contact) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ return (yield this.axios.post('/contacts', contact)).data;
23
+ });
24
+ }
25
+ /**
26
+ * Calls the GET /contacts/:id endpoint
27
+ * @param id The ID of the contact to retrieve
28
+ * @returns The contact with the specified ID
29
+ */
30
+ get(id) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ return (yield this.axios.get(`/contacts/${id}`)).data;
33
+ });
34
+ }
35
+ /**
36
+ * Calls the GET /contacts endpoint
37
+ * @returns A list of all contacts in the workspace
38
+ */
39
+ list() {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ return (yield this.axios.get('/contacts')).data;
42
+ });
43
+ }
44
+ /**
45
+ * Calls the PATCH /contacts/:id endpoint
46
+ * @param id The ID of the contact to update
47
+ * @param contact The updated contact data
48
+ * @returns An object with the ID of the updated contact
49
+ */
50
+ update(id, contact) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ return (yield this.axios.patch(`/contacts/${id}`, contact)).data;
53
+ });
54
+ }
55
+ /**
56
+ * Calls the DELETE /contacts/:id endpoint
57
+ * @param id The ID of the contact to delete
58
+ * @returns An object with the ID of the deleted contact
59
+ */
60
+ delete(id) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ return (yield this.axios.delete(`/contacts/${id}`)).data;
63
+ });
64
+ }
65
+ }
66
+ exports.ContactsClient = ContactsClient;
@@ -0,0 +1,2 @@
1
+ export * from './contacts-client';
2
+ export * from './types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./contacts-client"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,15 @@
1
+ export type CreateContactResult = {
2
+ id: string;
3
+ };
4
+ export type CreateContactCommand = {
5
+ waProfileName: string | null;
6
+ firstName: string | null;
7
+ lastName: string | null;
8
+ email: string | null;
9
+ phone: string | null;
10
+ occupation: string | null;
11
+ gender: string | null;
12
+ birthdate: string | null;
13
+ age: number | null;
14
+ notes: string | null;
15
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,3 @@
1
1
  export type DeleteContactResult = {
2
- id: string
3
- }
2
+ id: string;
3
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ export type GetContactResult = {
2
+ id: string;
3
+ workspaceId: string;
4
+ statusId: string | null;
5
+ waId: string | null;
6
+ waProfileName: string | null;
7
+ firstName: string | null;
8
+ lastName: string | null;
9
+ email: string | null;
10
+ phone: string | null;
11
+ occupation: string | null;
12
+ gender: string | null;
13
+ birthdate: string | null;
14
+ age: number | null;
15
+ notes: string | null;
16
+ createDate: string;
17
+ updateDate: string;
18
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export * from './create-contact';
2
+ export * from './update-contact';
3
+ export * from './get-contact';
4
+ export * from './list-contacts';
5
+ export * from './delete-contact';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./create-contact"), exports);
18
+ __exportStar(require("./update-contact"), exports);
19
+ __exportStar(require("./get-contact"), exports);
20
+ __exportStar(require("./list-contacts"), exports);
21
+ __exportStar(require("./delete-contact"), exports);
@@ -0,0 +1,20 @@
1
+ export type ListContactsResult = {
2
+ data: {
3
+ id: string;
4
+ workspaceId: string;
5
+ statusId: string | null;
6
+ waId: string | null;
7
+ waProfileName: string | null;
8
+ firstName: string | null;
9
+ lastName: string | null;
10
+ email: string | null;
11
+ phone: string | null;
12
+ occupation: string | null;
13
+ gender: string | null;
14
+ birthdate: string | null;
15
+ age: number | null;
16
+ notes: string | null;
17
+ createDate: string;
18
+ updateDate: string;
19
+ }[];
20
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ export type UpdateContactCommand = {
2
+ firstName: string | null;
3
+ lastName: string | null;
4
+ email: string | null;
5
+ phone: string | null;
6
+ occupation: string | null;
7
+ gender: string | null;
8
+ birthdate: string | null;
9
+ age: number | null;
10
+ notes: string | null;
11
+ };
12
+ export type UpdateContactResult = {
13
+ id: string;
14
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import { BaseClient } from '../base-client';
2
+ import { SendMessageCommand } from './types/send-message';
3
+ import { GetConversationResult, GetMessagesResult, ListConversationsParams, ListConversationsResult, ListMessagesParams } from './types';
4
+ export declare class ConversationsClient extends BaseClient {
5
+ /**
6
+ * Calls the GET /conversations/:id endpoint
7
+ * @param id The ID of the conversation to retrieve
8
+ * @returns The conversation with the specified ID
9
+ */
10
+ get(id: string): Promise<GetConversationResult>;
11
+ /**
12
+ * Calls the GET /conversations endpoint
13
+ * @param params Params for listing conversations, such as pagination cursors
14
+ * @returns A list of all conversations in the workspace
15
+ */
16
+ list(params: ListConversationsParams): Promise<ListConversationsResult>;
17
+ /**
18
+ * Calls the GET /conversations/:id/messages endpoint
19
+ * @param params Params for listing messages in a conversation, such as pagination cursors
20
+ * @returns A list of all messages in the specified conversation
21
+ */
22
+ getMessages(params: ListMessagesParams): Promise<GetMessagesResult>;
23
+ sendMessage(id: string, payload: SendMessageCommand): Promise<any>;
24
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ConversationsClient = void 0;
13
+ const base_client_1 = require("../base-client");
14
+ class ConversationsClient extends base_client_1.BaseClient {
15
+ /**
16
+ * Calls the GET /conversations/:id endpoint
17
+ * @param id The ID of the conversation to retrieve
18
+ * @returns The conversation with the specified ID
19
+ */
20
+ get(id) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ return (yield this.axios.get(`/conversations/${id}`)).data;
23
+ });
24
+ }
25
+ /**
26
+ * Calls the GET /conversations endpoint
27
+ * @param params Params for listing conversations, such as pagination cursors
28
+ * @returns A list of all conversations in the workspace
29
+ */
30
+ list(params) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ const axiosResponse = yield this.axios.get(`/conversations`, {
33
+ params,
34
+ });
35
+ return axiosResponse.data;
36
+ });
37
+ }
38
+ /**
39
+ * Calls the GET /conversations/:id/messages endpoint
40
+ * @param params Params for listing messages in a conversation, such as pagination cursors
41
+ * @returns A list of all messages in the specified conversation
42
+ */
43
+ getMessages(params) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ const axiosResponse = yield this.axios.get(`/conversations/${params.conversationId}/messages`, {
46
+ params
47
+ });
48
+ return axiosResponse.data;
49
+ });
50
+ }
51
+ sendMessage(id, payload) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ return (yield this.axios.post(`/conversations/${id}/messages`, payload)).data;
54
+ });
55
+ }
56
+ }
57
+ exports.ConversationsClient = ConversationsClient;
@@ -0,0 +1,2 @@
1
+ export * from './conversations-client';
2
+ export * from './types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./conversations-client"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,11 @@
1
+ export type GetConversationResult = {
2
+ id: string;
3
+ workspaceId: string;
4
+ phoneNumberId: string | null;
5
+ recipientId: string | null;
6
+ assigneeId: string | null;
7
+ lastMessageId: string | null;
8
+ data: any | null;
9
+ createDate: string;
10
+ serviceWindowExpireDate: string | null;
11
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ export type GetMessagesResult = {
2
+ data: {
3
+ id: string;
4
+ workspaceId: string;
5
+ conversationId: string | null;
6
+ assistantId: string | null;
7
+ userId: string | null;
8
+ broadcastId: string | null;
9
+ whatsappMessageId: string | null;
10
+ from: string | null;
11
+ to: string | null;
12
+ role: string;
13
+ status: string | null;
14
+ type: string | null;
15
+ content: string | null;
16
+ contentData: string | null;
17
+ toolCallId: string | null;
18
+ toolCalls: string | null;
19
+ data: string | null;
20
+ contextId: string | null;
21
+ contextFrom: string | null;
22
+ createDate: Date;
23
+ sendDate: Date;
24
+ deliverDate: Date | null;
25
+ readDate: Date | null;
26
+ promptTokens: number | null;
27
+ completionTokens: number | null;
28
+ order: number;
29
+ traceId: string | null;
30
+ }[];
31
+ cursors: {
32
+ next: string | null;
33
+ prev: string | null;
34
+ };
35
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export * from './get-conversation';
2
+ export * from './get-messages';
3
+ export * from './send-message';
4
+ export * from './list-conversations';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-conversation"), exports);
18
+ __exportStar(require("./get-messages"), exports);
19
+ __exportStar(require("./send-message"), exports);
20
+ __exportStar(require("./list-conversations"), exports);
@@ -0,0 +1,30 @@
1
+ export type ListConversationsParams = {
2
+ phoneNumberId: string;
3
+ cursor?: never;
4
+ } | {
5
+ phoneNumberId?: never;
6
+ cursor: string;
7
+ };
8
+ export type ListMessagesParams = {
9
+ conversationId: string;
10
+ cursor?: never;
11
+ } | {
12
+ conversationId?: never;
13
+ cursor: string;
14
+ };
15
+ export type ListConversationsResult = {
16
+ data: ListConversationsResultData[];
17
+ cursors: {
18
+ next: string | null;
19
+ };
20
+ };
21
+ export type ListConversationsResultData = {
22
+ id: string;
23
+ workspaceId: string;
24
+ phoneNumberId: string | null;
25
+ recipientId: string | null;
26
+ assigneeId: string | null;
27
+ lastMessageId: string | null;
28
+ createDate: string;
29
+ serviceWindowExpireDate: string | null;
30
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export type SendMessageCommand = {
2
+ type: 'text' | 'image' | 'document';
3
+ content?: string | null;
4
+ media?: {
5
+ name: string | null;
6
+ mimeType: string;
7
+ base64: string;
8
+ } | null;
9
+ };
10
+ export type SendMessageResult = {
11
+ id: string;
12
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './contacts/types';
2
+ export * from './tags/types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./contacts/types"), exports);
18
+ __exportStar(require("./tags/types"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './tags-client';
2
+ export * from './types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./tags-client"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,34 @@
1
+ import { BaseClient } from '../base-client';
2
+ import { CreateTagCommand, CreateTagResult, DeleteTagResult, GetTagResult, ListTagsResult, UpdateTagCommand, UpdateTagResult } from './types';
3
+ export declare class TagsClient extends BaseClient {
4
+ /**
5
+ * Calls the POST /tags endpoint
6
+ * @param payload The tag data to create
7
+ * @returns An object with the ID and the name of the newly created tag
8
+ */
9
+ create(payload: CreateTagCommand): Promise<CreateTagResult>;
10
+ /**
11
+ * Calls the DELETE /tags/:id endpoint
12
+ * @param id The ID of the tag to delete
13
+ * @returns An object with the ID and the name of the deleted tag
14
+ */
15
+ delete(id: string): Promise<DeleteTagResult>;
16
+ /**
17
+ * Calls the GET /tags/:id endpoint
18
+ * @param id The ID of the tag to retrieve
19
+ * @returns The tag with the specified ID
20
+ */
21
+ get(id: string): Promise<GetTagResult>;
22
+ /**
23
+ * Calls the GET /tags endpoint
24
+ * @returns A list of all tags in the workspace
25
+ */
26
+ list(): Promise<ListTagsResult>;
27
+ /**
28
+ * Calls the PATCH /tags/:id endpoint
29
+ * @param id The ID of the tag to update
30
+ * @param payload The updated tag data
31
+ * @returns An object with the ID and the name of the updated tag
32
+ */
33
+ update(id: string, payload: UpdateTagCommand): Promise<UpdateTagResult>;
34
+ }