cogfy-messenger 0.1.15 → 0.1.17

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, ListContactsParams } from './types';
2
+ import { CreateContactCommand, CreateContactResult, DeleteContactResult, GetContactResult, ListContactsParams, ListContactsResult, UpdateContactCommand, UpdateContactTagsCommand } from './types';
3
3
  export declare class ContactsClient extends BaseClient {
4
4
  /**
5
5
  * Calls the POST /contacts endpoint
@@ -25,7 +25,13 @@ export declare class ContactsClient extends BaseClient {
25
25
  * @param contact The updated contact data
26
26
  * @returns An object with the ID of the updated contact
27
27
  */
28
- update(id: string, contact: UpdateContactCommand): Promise<UpdateContactResult>;
28
+ update(id: string, contact: UpdateContactCommand): Promise<void>;
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>;
29
35
  /**
30
36
  * Calls the DELETE /contacts/:id endpoint
31
37
  * @param id The ID of the contact to delete
@@ -50,7 +50,17 @@ class ContactsClient extends base_client_1.BaseClient {
50
50
  */
51
51
  update(id, contact) {
52
52
  return __awaiter(this, void 0, void 0, function* () {
53
- return (yield this.axios.patch(`/contacts/${id}`, contact)).data;
53
+ yield this.axios.patch(`/contacts/${id}`, contact);
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);
54
64
  });
55
65
  }
56
66
  /**
@@ -1,5 +1,6 @@
1
1
  export * from './create-contact';
2
- export * from './update-contact';
2
+ export * from './delete-contact';
3
3
  export * from './get-contact';
4
4
  export * from './list-contacts';
5
- export * from './delete-contact';
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("./update-contact"), exports);
18
+ __exportStar(require("./delete-contact"), exports);
19
19
  __exportStar(require("./get-contact"), exports);
20
20
  __exportStar(require("./list-contacts"), exports);
21
- __exportStar(require("./delete-contact"), exports);
21
+ __exportStar(require("./update-contact"), exports);
22
+ __exportStar(require("./update-contact-tags"), exports);
@@ -0,0 +1,10 @@
1
+ type Tag = {
2
+ id?: string;
3
+ name?: string;
4
+ };
5
+ export type UpdateContactTagsCommand = {
6
+ add?: Tag[];
7
+ remove?: Tag[];
8
+ set?: Tag[];
9
+ };
10
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +1,16 @@
1
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
- tags: {
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
+ tags?: {
12
12
  id: string;
13
13
  name: string;
14
- }[] | null;
15
- };
16
- export type UpdateContactResult = {
17
- id: string;
14
+ }[];
15
+ customProperties?: Record<string, string | number>;
18
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogfy-messenger",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "main": "dist/index.js",
5
5
  "repository": {
6
6
  "type": "git",