@awesomate/sdk 0.65.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 +88 -2
- package/dist/index.js +28 -1
- package/package.json +1 -1
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.
|
|
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
|
}
|
|
@@ -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
|
|
@@ -1350,6 +1363,24 @@ export declare class AwesomateClient {
|
|
|
1350
1363
|
*/
|
|
1351
1364
|
setReplay: (id: number, url: string) => Promise<WebinarDetail>;
|
|
1352
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
|
+
};
|
|
1353
1384
|
/**
|
|
1354
1385
|
* The account's own support desk: the help inbox for its customers, under Contacts, Support in
|
|
1355
1386
|
* the hub. Read only, on purpose: every message here was written by someone outside the
|
|
@@ -2967,7 +2998,7 @@ export interface WhoAmI {
|
|
|
2967
2998
|
};
|
|
2968
2999
|
/** The account's plan (Essentials, Support Plus, Pro, Embedded), or null when it could not be read. */
|
|
2969
3000
|
plan: string | null;
|
|
2970
|
-
/** 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... */
|
|
2971
3002
|
scopes: string[];
|
|
2972
3003
|
/** When the token stops working, or null for a browser session. */
|
|
2973
3004
|
tokenExpiresAt: string | null;
|
|
@@ -3400,6 +3431,8 @@ export interface ContactErasureCounts {
|
|
|
3400
3431
|
sign_in_links: number;
|
|
3401
3432
|
/** Their rows in past imports. */
|
|
3402
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;
|
|
3403
3436
|
}
|
|
3404
3437
|
/** What contacts.erasurePreview() answers. Nothing has been erased. */
|
|
3405
3438
|
export interface ContactErasurePreview {
|
|
@@ -4000,6 +4033,44 @@ export interface ZoomHost {
|
|
|
4000
4033
|
/** How many a Zoom Webinar of theirs holds, when Zoom said. */
|
|
4001
4034
|
webinar_capacity: number | null;
|
|
4002
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
|
+
}
|
|
4003
4074
|
/** webinars.zoom(): the account's Zoom connection, never a Zoom value. */
|
|
4004
4075
|
export interface ZoomConnection {
|
|
4005
4076
|
/** Zoom is connected. */
|
|
@@ -4400,6 +4471,21 @@ export interface CompanySpec {
|
|
|
4400
4471
|
/** Other fields by key: website, phone, email, address, or the owner's own. */
|
|
4401
4472
|
data?: Record<string, unknown>;
|
|
4402
4473
|
}
|
|
4474
|
+
/** What companies.archive() and companies.restore() did. */
|
|
4475
|
+
export interface CompanyArchiveResult {
|
|
4476
|
+
id: string;
|
|
4477
|
+
/** True after archive(), false after restore(). */
|
|
4478
|
+
archived: boolean;
|
|
4479
|
+
/** How many people are still linked to the company. */
|
|
4480
|
+
people: number;
|
|
4481
|
+
}
|
|
4482
|
+
/** An archived company, from companies.archived(). */
|
|
4483
|
+
export interface ArchivedCompany {
|
|
4484
|
+
id: string;
|
|
4485
|
+
name: string | null;
|
|
4486
|
+
archived_at: string;
|
|
4487
|
+
people: number;
|
|
4488
|
+
}
|
|
4403
4489
|
/** What companies.upsert() did. */
|
|
4404
4490
|
export interface CompanyUpsertResult {
|
|
4405
4491
|
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.
|
|
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;
|
|
@@ -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
|
|
@@ -1049,6 +1058,24 @@ export class AwesomateClient {
|
|
|
1049
1058
|
return this.request('POST', `/api/my-crm/v1/webinars/${id}/replay`, { url }, false);
|
|
1050
1059
|
},
|
|
1051
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
|
+
};
|
|
1052
1079
|
/**
|
|
1053
1080
|
* The account's own support desk: the help inbox for its customers, under Contacts, Support in
|
|
1054
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.
|
|
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",
|