@awesomate/sdk 0.65.0 → 0.66.0

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.d.ts CHANGED
@@ -26,7 +26,7 @@
26
26
  * Docs: https://hub.awesomate.ai/docs/sdk/
27
27
  */
28
28
  /** This package's version, sent to the hub with every server call. */
29
- export declare const VERSION = "0.65.0";
29
+ export declare const VERSION = "0.66.0";
30
30
  /** Augmented by the generated awesomate.d.ts, so each kind's rows are typed. */
31
31
  export interface Kinds {
32
32
  }
@@ -1036,6 +1036,19 @@ export declare class AwesomateClient {
1036
1036
  * `abn`); `abn: null` clears it.
1037
1037
  */
1038
1038
  upsert: (spec: CompanySpec) => Promise<CompanyUpsertResult>;
1039
+ /**
1040
+ * Hide a company from every list, search and picker. Nothing is deleted: the people at it keep
1041
+ * their company link, and `restore` brings it back. Answers how many people are still linked.
1042
+ */
1043
+ archive: (id: string) => Promise<CompanyArchiveResult>;
1044
+ /** Bring an archived company back, under its current name, for the people still linked to it. */
1045
+ restore: (id: string) => Promise<CompanyArchiveResult>;
1046
+ /** The archived companies, newest first (up to 200; `more` says there are older ones), with how many people are still linked to each. */
1047
+ archived: () => Promise<{
1048
+ companies: ArchivedCompany[];
1049
+ more: boolean;
1050
+ note?: string;
1051
+ }>;
1039
1052
  };
1040
1053
  /**
1041
1054
  * Calls: the calls the account's phone agents took, read by person. Needs the account's token
@@ -4400,6 +4413,21 @@ export interface CompanySpec {
4400
4413
  /** Other fields by key: website, phone, email, address, or the owner's own. */
4401
4414
  data?: Record<string, unknown>;
4402
4415
  }
4416
+ /** What companies.archive() and companies.restore() did. */
4417
+ export interface CompanyArchiveResult {
4418
+ id: string;
4419
+ /** True after archive(), false after restore(). */
4420
+ archived: boolean;
4421
+ /** How many people are still linked to the company. */
4422
+ people: number;
4423
+ }
4424
+ /** An archived company, from companies.archived(). */
4425
+ export interface ArchivedCompany {
4426
+ id: string;
4427
+ name: string | null;
4428
+ archived_at: string;
4429
+ people: number;
4430
+ }
4403
4431
  /** What companies.upsert() did. */
4404
4432
  export interface CompanyUpsertResult {
4405
4433
  id: string;
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@
26
26
  * Docs: https://hub.awesomate.ai/docs/sdk/
27
27
  */
28
28
  /** This package's version, sent to the hub with every server call. */
29
- export const VERSION = '0.65.0';
29
+ export const VERSION = '0.66.0';
30
30
  const DEFAULT_BASE = 'https://hub.awesomate.ai';
31
31
  /** The one check for a platform `watch_url` (mirrored in the hub's awesomate-knowledge.ts and its MCP). */
32
32
  const WATCH_URL = /^https:\/\/[^\s"'<>]+$/i;
@@ -720,6 +720,15 @@ export class AwesomateClient {
720
720
  * `abn`); `abn: null` clears it.
721
721
  */
722
722
  upsert: (spec) => this.request('POST', '/api/my-crm/v1/companies', spec, false),
723
+ /**
724
+ * Hide a company from every list, search and picker. Nothing is deleted: the people at it keep
725
+ * their company link, and `restore` brings it back. Answers how many people are still linked.
726
+ */
727
+ archive: (id) => this.request('POST', `/api/my-crm/v1/companies/${encodeURIComponent(String(id))}/archive`, {}, false),
728
+ /** Bring an archived company back, under its current name, for the people still linked to it. */
729
+ restore: (id) => this.request('POST', `/api/my-crm/v1/companies/${encodeURIComponent(String(id))}/restore`, {}, false),
730
+ /** The archived companies, newest first (up to 200; `more` says there are older ones), with how many people are still linked to each. */
731
+ archived: () => this.request('GET', '/api/my-crm/v1/companies/archived'),
723
732
  };
724
733
  /**
725
734
  * Calls: the calls the account's phone agents took, read by person. Needs the account's token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomate/sdk",
3
- "version": "0.65.0",
3
+ "version": "0.66.0",
4
4
  "description": "Your own Awesomate data from Node and the browser: query contacts and app data with generated types, and sign your app's own users in",
5
5
  "license": "MIT",
6
6
  "type": "module",