cogfy-messenger 0.1.12 → 0.1.15
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 +6 -5
- package/dist/clients/contacts/contacts-client.js +6 -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/list-contacts.d.ts +11 -0
- package/dist/clients/contacts/types/update-contact.d.ts +4 -0
- package/dist/clients/messages/types/send-interactive-flow.d.ts +1 -1
- 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, ListContactsResult, UpdateContactCommand, UpdateContactResult, ListContactsParams } 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
|
|
@@ -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
|
/**
|
|
@@ -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.15",
|
|
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
|
}
|