@hasna/contacts 0.6.31 → 0.6.33

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/index.js CHANGED
@@ -5426,17 +5426,19 @@ class ApiStore {
5426
5426
  const res = await this.client.list("tags");
5427
5427
  return pick(res, "tags") ?? [];
5428
5428
  }
5429
- async getTagByName() {
5430
- return unavailable("getTagByName");
5429
+ async getTagByName(name) {
5430
+ const res = await this.client.list("tags", { query: { name } });
5431
+ const tags = pick(res, "tags") ?? [];
5432
+ return tags.find((tag) => tag?.name === name) ?? null;
5431
5433
  }
5432
5434
  async deleteTag(id) {
5433
5435
  await this.client.delete("tags", id);
5434
5436
  }
5435
- async addTagToContact() {
5436
- return unavailable("addTagToContact");
5437
+ async addTagToContact(contactId, tagId) {
5438
+ await this.client.transport.put(`/contacts/${this.enc(contactId)}/tags/${this.enc(tagId)}`);
5437
5439
  }
5438
- async removeTagFromContact() {
5439
- return unavailable("removeTagFromContact");
5440
+ async removeTagFromContact(contactId, tagId) {
5441
+ await this.del(`/contacts/${this.enc(contactId)}/tags/${this.enc(tagId)}`);
5440
5442
  }
5441
5443
  async addTagToCompany() {
5442
5444
  return unavailable("addTagToCompany");
@@ -6011,6 +6013,20 @@ class ContactsV1Client {
6011
6013
  init
6012
6014
  });
6013
6015
  }
6016
+ async addTagToContact(contactId, tagId, init) {
6017
+ return this.request("PUT", `/v1/contacts/${encodeURIComponent(String(contactId))}/tags/${encodeURIComponent(String(tagId))}`, {
6018
+ body: undefined,
6019
+ query: undefined,
6020
+ init
6021
+ });
6022
+ }
6023
+ async removeTagFromContact(contactId, tagId, init) {
6024
+ return this.request("DELETE", `/v1/contacts/${encodeURIComponent(String(contactId))}/tags/${encodeURIComponent(String(tagId))}`, {
6025
+ body: undefined,
6026
+ query: undefined,
6027
+ init
6028
+ });
6029
+ }
6014
6030
  async getContact(id, init) {
6015
6031
  return this.request("GET", `/v1/contacts/${encodeURIComponent(String(id))}`, {
6016
6032
  body: undefined,
@@ -6039,10 +6055,10 @@ class ContactsV1Client {
6039
6055
  init
6040
6056
  });
6041
6057
  }
6042
- async listTags(init) {
6058
+ async listTags(query, init) {
6043
6059
  return this.request("GET", `/v1/tags`, {
6044
6060
  body: undefined,
6045
- query: undefined,
6061
+ query,
6046
6062
  init
6047
6063
  });
6048
6064
  }
@@ -6363,6 +6379,7 @@ function buildV1OpenApiDocument(version = getPackageVersion()) {
6363
6379
  get: {
6364
6380
  operationId: "listTags",
6365
6381
  summary: "List tags",
6382
+ parameters: [{ name: "name", in: "query", schema: { type: "string" } }],
6366
6383
  responses: objResponse({
6367
6384
  tags: { type: "array", items: { $ref: "#/components/schemas/Tag" } },
6368
6385
  count: { type: "number" }
@@ -6410,6 +6427,34 @@ function buildV1OpenApiDocument(version = getPackageVersion()) {
6410
6427
  responses: objResponse({ deleted: { type: "boolean" }, id: { type: "string" } })
6411
6428
  }
6412
6429
  },
6430
+ "/v1/contacts/{contact_id}/tags/{tag_id}": {
6431
+ put: {
6432
+ operationId: "addTagToContact",
6433
+ summary: "Attach a tag to a contact idempotently",
6434
+ parameters: [
6435
+ { name: "contact_id", in: "path", required: true, schema: { type: "string" } },
6436
+ { name: "tag_id", in: "path", required: true, schema: { type: "string" } }
6437
+ ],
6438
+ responses: objResponse({
6439
+ attached: { type: "boolean" },
6440
+ contact_id: { type: "string" },
6441
+ tag_id: { type: "string" }
6442
+ })
6443
+ },
6444
+ delete: {
6445
+ operationId: "removeTagFromContact",
6446
+ summary: "Remove a tag from a contact",
6447
+ parameters: [
6448
+ { name: "contact_id", in: "path", required: true, schema: { type: "string" } },
6449
+ { name: "tag_id", in: "path", required: true, schema: { type: "string" } }
6450
+ ],
6451
+ responses: objResponse({
6452
+ removed: { type: "boolean" },
6453
+ contact_id: { type: "string" },
6454
+ tag_id: { type: "string" }
6455
+ })
6456
+ }
6457
+ },
6413
6458
  "/v1/stats": {
6414
6459
  get: {
6415
6460
  operationId: "getStats",
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bun
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  export declare function buildServer(): McpServer;
4
+ export declare function isDirectMcpEntry(entry?: string): boolean;
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAgBpE,wBAAgB,WAAW,IAAI,SAAS,CAKvC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAgBpE,wBAAgB,WAAW,IAAI,SAAS,CAKvC;AAkBD,wBAAgB,gBAAgB,CAAC,KAAK,SAAkB,GAAG,OAAO,CAIjE"}