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.
@@ -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
- * Calls the GET /contacts endpoint
18
- * @returns A list of all contacts in the workspace
19
- */
20
- list(): Promise<ListContactsResult>;
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
- * Calls the GET /contacts endpoint
37
- * @returns A list of all contacts in the workspace
38
- */
39
- list() {
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
  /**
@@ -12,4 +12,8 @@ export type CreateContactCommand = {
12
12
  birthdate: string | null;
13
13
  age: number | null;
14
14
  notes: string | null;
15
+ tags: {
16
+ id: string;
17
+ name: string;
18
+ }[] | null;
15
19
  };
@@ -13,6 +13,10 @@ export type GetContactResult = {
13
13
  birthdate: string | null;
14
14
  age: number | null;
15
15
  notes: string | null;
16
+ tags: {
17
+ id: string;
18
+ name: string;
19
+ }[];
16
20
  createDate: string;
17
21
  updateDate: string;
18
22
  };
@@ -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
  };
@@ -8,6 +8,10 @@ export type UpdateContactCommand = {
8
8
  birthdate: string | null;
9
9
  age: number | null;
10
10
  notes: string | null;
11
+ tags: {
12
+ id: string;
13
+ name: string;
14
+ }[] | null;
11
15
  };
12
16
  export type UpdateContactResult = {
13
17
  id: string;
@@ -19,7 +19,7 @@ export type SendInteractiveFlowMessageCommand = {
19
19
  flow_name: string;
20
20
  flow_message_version?: number;
21
21
  flow_action?: 'navigate' | 'data_exchange';
22
- flow_action_payload?: string;
22
+ flow_action_payload?: object;
23
23
  flow_token?: string;
24
24
  };
25
25
  };
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "cogfy-messenger",
3
- "version": "0.1.12",
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
  }