cogfy-messenger 0.1.13 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients/contacts/contacts-client.d.ts +12 -5
- package/dist/clients/contacts/contacts-client.js +16 -5
- package/dist/clients/contacts/types/create-contact.d.ts +4 -0
- package/dist/clients/contacts/types/get-contact.d.ts +4 -0
- package/dist/clients/contacts/types/index.d.ts +3 -2
- package/dist/clients/contacts/types/index.js +3 -2
- package/dist/clients/contacts/types/list-contacts.d.ts +11 -0
- package/dist/clients/contacts/types/update-contact-tags.d.ts +10 -0
- package/dist/clients/contacts/types/update-contact-tags.js +2 -0
- package/dist/clients/contacts/types/update-contact.d.ts +4 -0
- package/package.json +8 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from '../base-client';
|
|
2
|
-
import { CreateContactCommand, CreateContactResult, DeleteContactResult, GetContactResult, ListContactsResult, UpdateContactCommand, UpdateContactResult } from './types';
|
|
2
|
+
import { CreateContactCommand, CreateContactResult, DeleteContactResult, GetContactResult, ListContactsParams, ListContactsResult, UpdateContactCommand, UpdateContactResult, UpdateContactTagsCommand } from './types';
|
|
3
3
|
export declare class ContactsClient extends BaseClient {
|
|
4
4
|
/**
|
|
5
5
|
* Calls the POST /contacts endpoint
|
|
@@ -14,10 +14,11 @@ export declare class ContactsClient extends BaseClient {
|
|
|
14
14
|
*/
|
|
15
15
|
get(id: string): Promise<GetContactResult>;
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
* Calls the GET /contacts endpoint with support for cursor pagination and filters
|
|
18
|
+
* @param params Optional object containing 'cursor' for pagination or 'waId' for filtering
|
|
19
|
+
* @returns A list of contacts and cursor data for the next page
|
|
20
|
+
*/
|
|
21
|
+
list(params: ListContactsParams): Promise<ListContactsResult>;
|
|
21
22
|
/**
|
|
22
23
|
* Calls the PATCH /contacts/:id endpoint
|
|
23
24
|
* @param id The ID of the contact to update
|
|
@@ -25,6 +26,12 @@ export declare class ContactsClient extends BaseClient {
|
|
|
25
26
|
* @returns An object with the ID of the updated contact
|
|
26
27
|
*/
|
|
27
28
|
update(id: string, contact: UpdateContactCommand): Promise<UpdateContactResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Calls the POST /contacts/:id/tags endpoint
|
|
31
|
+
* @param id The ID of the contact to update tags for
|
|
32
|
+
* @param data The tags to add, remove, or set
|
|
33
|
+
*/
|
|
34
|
+
updateTags(id: string, data: UpdateContactTagsCommand): Promise<void>;
|
|
28
35
|
/**
|
|
29
36
|
* Calls the DELETE /contacts/:id endpoint
|
|
30
37
|
* @param id The ID of the contact to delete
|
|
@@ -33,12 +33,13 @@ class ContactsClient extends base_client_1.BaseClient {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
* Calls the GET /contacts endpoint with support for cursor pagination and filters
|
|
37
|
+
* @param params Optional object containing 'cursor' for pagination or 'waId' for filtering
|
|
38
|
+
* @returns A list of contacts and cursor data for the next page
|
|
39
|
+
*/
|
|
40
|
+
list(params) {
|
|
40
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
return (yield this.axios.get('/contacts')).data;
|
|
42
|
+
return (yield this.axios.get('/contacts', { params })).data;
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
@@ -52,6 +53,16 @@ class ContactsClient extends base_client_1.BaseClient {
|
|
|
52
53
|
return (yield this.axios.patch(`/contacts/${id}`, contact)).data;
|
|
53
54
|
});
|
|
54
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Calls the POST /contacts/:id/tags endpoint
|
|
58
|
+
* @param id The ID of the contact to update tags for
|
|
59
|
+
* @param data The tags to add, remove, or set
|
|
60
|
+
*/
|
|
61
|
+
updateTags(id, data) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
yield this.axios.post(`/contacts/${id}/tags`, data);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
55
66
|
/**
|
|
56
67
|
* Calls the DELETE /contacts/:id endpoint
|
|
57
68
|
* @param id The ID of the contact to delete
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './create-contact';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './delete-contact';
|
|
3
3
|
export * from './get-contact';
|
|
4
4
|
export * from './list-contacts';
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './update-contact';
|
|
6
|
+
export * from './update-contact-tags';
|
|
@@ -15,7 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./create-contact"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./delete-contact"), exports);
|
|
19
19
|
__exportStar(require("./get-contact"), exports);
|
|
20
20
|
__exportStar(require("./list-contacts"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./update-contact"), exports);
|
|
22
|
+
__exportStar(require("./update-contact-tags"), exports);
|
|
@@ -14,7 +14,18 @@ export type ListContactsResult = {
|
|
|
14
14
|
birthdate: string | null;
|
|
15
15
|
age: number | null;
|
|
16
16
|
notes: string | null;
|
|
17
|
+
tags: {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}[];
|
|
17
21
|
createDate: string;
|
|
18
22
|
updateDate: string;
|
|
19
23
|
}[];
|
|
24
|
+
cursors: {
|
|
25
|
+
next: string | null;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type ListContactsParams = {
|
|
29
|
+
waId?: string;
|
|
30
|
+
cursor?: string;
|
|
20
31
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cogfy-messenger",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/IndigoHive/cogfy-messenger-node"
|
|
8
|
+
},
|
|
5
9
|
"scripts": {
|
|
6
10
|
"build": "rimraf dist && tsc",
|
|
7
11
|
"prepublishOnly": "npm run build",
|
|
@@ -23,5 +27,8 @@
|
|
|
23
27
|
},
|
|
24
28
|
"dependencies": {
|
|
25
29
|
"axios": "^1.11.0"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
26
33
|
}
|
|
27
34
|
}
|