@awesomate/sdk 0.66.0 → 0.67.1

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.66.0";
29
+ export declare const VERSION = "0.67.1";
30
30
  /** Augmented by the generated awesomate.d.ts, so each kind's rows are typed. */
31
31
  export interface Kinds {
32
32
  }
@@ -1363,6 +1363,24 @@ export declare class AwesomateClient {
1363
1363
  */
1364
1364
  setReplay: (id: number, url: string) => Promise<WebinarDetail>;
1365
1365
  };
1366
+ /**
1367
+ * Payments into the business's own Stripe account (never Awesomate's), connected in the hub.
1368
+ * `status()` says where that account stands: connected or not, ready to take payments, live or
1369
+ * test, what Stripe still needs, and the connected account's id and Stripe Dashboard. Connecting,
1370
+ * finishing set-up and disconnecting are done by the account owner in the hub (`settings_url`);
1371
+ * no method here starts them, and nothing here takes a Stripe key. Needs the account owner's own
1372
+ * token with payments:read (never a team member's key, like the Stripe card in the hub) and the
1373
+ * account's payments feature, a part of Contacts.
1374
+ *
1375
+ * @example
1376
+ * const pay = await db.payments.status();
1377
+ * if (!pay.ready) console.log(pay.next, pay.settings_url);
1378
+ * else console.log(`Payments go to ${pay.account?.display_name} (${pay.account?.account_id})`);
1379
+ */
1380
+ readonly payments: {
1381
+ /** Where the business's Stripe account stands, with one sentence (`next`) saying what happens next. */
1382
+ status: () => Promise<PaymentsStatus>;
1383
+ };
1366
1384
  /**
1367
1385
  * The account's own support desk: the help inbox for its customers, under Contacts, Support in
1368
1386
  * the hub. Read only, on purpose: every message here was written by someone outside the
@@ -2980,7 +2998,7 @@ export interface WhoAmI {
2980
2998
  };
2981
2999
  /** The account's plan (Essentials, Support Plus, Pro, Embedded), or null when it could not be read. */
2982
3000
  plan: string | null;
2983
- /** What the token may do: crm:read, crm:write, files:read, knowledge:read, hosting:read... */
3001
+ /** What the token may do: crm:read, crm:write, files:read, knowledge:read, payments:read, hosting:read... */
2984
3002
  scopes: string[];
2985
3003
  /** When the token stops working, or null for a browser session. */
2986
3004
  tokenExpiresAt: string | null;
@@ -3413,6 +3431,8 @@ export interface ContactErasureCounts {
3413
3431
  sign_in_links: number;
3414
3432
  /** Their rows in past imports. */
3415
3433
  import_rows: number;
3434
+ /** Lines of their conversation with an app's assistant: deleted, with its settings and drafts. Absent on accounts that never switched it on. */
3435
+ assistant_chat?: number;
3416
3436
  }
3417
3437
  /** What contacts.erasurePreview() answers. Nothing has been erased. */
3418
3438
  export interface ContactErasurePreview {
@@ -4013,6 +4033,44 @@ export interface ZoomHost {
4013
4033
  /** How many a Zoom Webinar of theirs holds, when Zoom said. */
4014
4034
  webinar_capacity: number | null;
4015
4035
  }
4036
+ /** payments.status(): where the business's own Stripe account stands. */
4037
+ export interface PaymentsStatus {
4038
+ /** Payments are open on this hub. */
4039
+ available: boolean;
4040
+ /** 'live' on production, 'test' on staging; null while payments are not open. */
4041
+ mode: 'live' | 'test' | null;
4042
+ /** Where it stands, in one word. */
4043
+ state: 'not_available' | 'not_connected' | 'finish_setting_up' | 'stripe_needs_more' | 'ready';
4044
+ /** A Stripe account is connected. */
4045
+ connected: boolean;
4046
+ /** Stripe can take payments for it. */
4047
+ ready: boolean;
4048
+ /** The connected account, or null when there is none. */
4049
+ account: null | {
4050
+ /** Stripe's id for the account (acct_...); not a secret. */
4051
+ account_id: string;
4052
+ display_name: string | null;
4053
+ /** Two letters, such as AU. */
4054
+ country: string | null;
4055
+ /** Lower case, such as aud. */
4056
+ default_currency: string | null;
4057
+ livemode: boolean;
4058
+ charges_enabled: boolean;
4059
+ payouts_enabled: boolean;
4060
+ details_submitted: boolean;
4061
+ /** How many things Stripe still needs from the business. */
4062
+ requirements_due: number;
4063
+ /** Stripe's own reason the account is paused, when it is. */
4064
+ disabled_reason: string | null;
4065
+ connected_at: string;
4066
+ /** The account's own Stripe Dashboard. */
4067
+ dashboard_url: string;
4068
+ };
4069
+ /** The hub page where the account owner connects or finishes setting up Stripe. */
4070
+ settings_url: string;
4071
+ /** What happens next, in one sentence to pass on. */
4072
+ next: string;
4073
+ }
4016
4074
  /** webinars.zoom(): the account's Zoom connection, never a Zoom value. */
4017
4075
  export interface ZoomConnection {
4018
4076
  /** Zoom is connected. */
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.66.0';
29
+ export const VERSION = '0.67.1';
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;
@@ -1058,6 +1058,24 @@ export class AwesomateClient {
1058
1058
  return this.request('POST', `/api/my-crm/v1/webinars/${id}/replay`, { url }, false);
1059
1059
  },
1060
1060
  };
1061
+ /**
1062
+ * Payments into the business's own Stripe account (never Awesomate's), connected in the hub.
1063
+ * `status()` says where that account stands: connected or not, ready to take payments, live or
1064
+ * test, what Stripe still needs, and the connected account's id and Stripe Dashboard. Connecting,
1065
+ * finishing set-up and disconnecting are done by the account owner in the hub (`settings_url`);
1066
+ * no method here starts them, and nothing here takes a Stripe key. Needs the account owner's own
1067
+ * token with payments:read (never a team member's key, like the Stripe card in the hub) and the
1068
+ * account's payments feature, a part of Contacts.
1069
+ *
1070
+ * @example
1071
+ * const pay = await db.payments.status();
1072
+ * if (!pay.ready) console.log(pay.next, pay.settings_url);
1073
+ * else console.log(`Payments go to ${pay.account?.display_name} (${pay.account?.account_id})`);
1074
+ */
1075
+ payments = {
1076
+ /** Where the business's Stripe account stands, with one sentence (`next`) saying what happens next. */
1077
+ status: () => this.request('GET', '/api/my-crm/v1/payments/status'),
1078
+ };
1061
1079
  /**
1062
1080
  * The account's own support desk: the help inbox for its customers, under Contacts, Support in
1063
1081
  * the hub. Read only, on purpose: every message here was written by someone outside the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomate/sdk",
3
- "version": "0.66.0",
3
+ "version": "0.67.1",
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",