@awesomate/sdk 0.13.0 → 0.14.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 +131 -1
- package/dist/index.js +10 -1
- package/package.json +1 -3
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* Docs: https://hub.awesomate.ai/docs/sdk/
|
|
25
25
|
*/
|
|
26
26
|
/** This package's version, sent to the hub with every server call. */
|
|
27
|
-
export declare const VERSION = "0.
|
|
27
|
+
export declare const VERSION = "0.14.0";
|
|
28
28
|
/** Augmented by the generated awesomate.d.ts, so each kind's rows are typed. */
|
|
29
29
|
export interface Kinds {
|
|
30
30
|
}
|
|
@@ -298,6 +298,13 @@ export declare class AwesomateClient {
|
|
|
298
298
|
* token (hosting:read, every plan), never an app key.
|
|
299
299
|
*/
|
|
300
300
|
business(): Promise<BusinessIdentity>;
|
|
301
|
+
/**
|
|
302
|
+
* The business map: the seven divisions every business has, the jobs in each and who holds them,
|
|
303
|
+
* which agents and automations help which job and how far each may go, and what is missing, most
|
|
304
|
+
* important first. Read only: the owner changes the map in the hub. Needs the account's token
|
|
305
|
+
* (hosting:read, every plan), never an app key, and the account must have the business map.
|
|
306
|
+
*/
|
|
307
|
+
businessMap(): Promise<BusinessMap>;
|
|
301
308
|
/** Details waiting for the owner's yes on Your business: from the website, the account, a team member or a file. */
|
|
302
309
|
businessSuggestions(): Promise<BusinessSuggestion[]>;
|
|
303
310
|
/** Grouped numbers (counts, sums) in the Business Data API's shape. */
|
|
@@ -360,6 +367,129 @@ export interface BusinessIdentity {
|
|
|
360
367
|
/** Where the owner changes these details, in words. */
|
|
361
368
|
how_to_change: string;
|
|
362
369
|
}
|
|
370
|
+
/** How far someone, or an agent, decides alone: 1 find out, 2 suggest options, 3 recommend and wait, 4 do it then tell, 5 report only the exceptions. */
|
|
371
|
+
export type BusinessMapLevel = 1 | 2 | 3 | 4 | 5;
|
|
372
|
+
/** Something that helps: an agent, a library install, an automation Awesomate built, or a tool outside Awesomate. */
|
|
373
|
+
export interface BusinessMapHelper {
|
|
374
|
+
kind: 'agent' | 'bundle' | 'template' | 'build' | 'external';
|
|
375
|
+
ref: string;
|
|
376
|
+
label: string;
|
|
377
|
+
}
|
|
378
|
+
/** A job on the map. `slug` is its stable name for routing work: "whoever holds quotes". */
|
|
379
|
+
export interface BusinessMapJob {
|
|
380
|
+
id: number;
|
|
381
|
+
slug: string;
|
|
382
|
+
title: string;
|
|
383
|
+
mission: string | null;
|
|
384
|
+
/** active: someone holds it. open: nobody does. hire_next: the owner's next hire. */
|
|
385
|
+
state: 'active' | 'open' | 'hire_next';
|
|
386
|
+
isOwnerJob: boolean;
|
|
387
|
+
headsDivision: boolean;
|
|
388
|
+
departmentNo: number | null;
|
|
389
|
+
reportsTo: {
|
|
390
|
+
id: number;
|
|
391
|
+
title: string;
|
|
392
|
+
} | null;
|
|
393
|
+
holders: Array<{
|
|
394
|
+
membershipId: number;
|
|
395
|
+
name: string;
|
|
396
|
+
accountable: boolean;
|
|
397
|
+
timeSharePct: number | null;
|
|
398
|
+
}>;
|
|
399
|
+
responsibilities: Array<{
|
|
400
|
+
text: string;
|
|
401
|
+
level: BusinessMapLevel;
|
|
402
|
+
exceptions: string | null;
|
|
403
|
+
}>;
|
|
404
|
+
helpers: Array<BusinessMapHelper & {
|
|
405
|
+
id: number;
|
|
406
|
+
supervisor: string;
|
|
407
|
+
level: BusinessMapLevel | null;
|
|
408
|
+
exceptions: string | null;
|
|
409
|
+
minutesSavedPerRun: number | null;
|
|
410
|
+
}>;
|
|
411
|
+
}
|
|
412
|
+
/** One of the seven divisions, in board order (7 first). */
|
|
413
|
+
export interface BusinessMapDivision {
|
|
414
|
+
no: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
415
|
+
/** Envision, Form, Promise, Balance, Fulfil, Refine, Share. */
|
|
416
|
+
verb: string;
|
|
417
|
+
name: string;
|
|
418
|
+
purpose: string;
|
|
419
|
+
stage: 'survive' | 'grow' | 'scale';
|
|
420
|
+
/** Who runs it. byDefault: nobody else has been given it, so the owner does. */
|
|
421
|
+
runBy: {
|
|
422
|
+
name: string;
|
|
423
|
+
byDefault: boolean;
|
|
424
|
+
};
|
|
425
|
+
jobs: BusinessMapJob[];
|
|
426
|
+
/** Helping here but not yet put on a job, with how they were placed, in words. */
|
|
427
|
+
helpers: Array<BusinessMapHelper & {
|
|
428
|
+
placedBy: string;
|
|
429
|
+
}>;
|
|
430
|
+
departments: Array<{
|
|
431
|
+
no: number;
|
|
432
|
+
name: string;
|
|
433
|
+
gloss: string;
|
|
434
|
+
}>;
|
|
435
|
+
ideas: Array<{
|
|
436
|
+
label: string;
|
|
437
|
+
what: string;
|
|
438
|
+
status: 'live' | 'library' | 'coming' | 'building' | 'planned';
|
|
439
|
+
path?: string;
|
|
440
|
+
}>;
|
|
441
|
+
numbers: Array<{
|
|
442
|
+
label: string;
|
|
443
|
+
kind: 'lead' | 'result';
|
|
444
|
+
}>;
|
|
445
|
+
question: string;
|
|
446
|
+
}
|
|
447
|
+
/** The business map, as businessMap() returns it. No email addresses. */
|
|
448
|
+
export interface BusinessMap {
|
|
449
|
+
business: {
|
|
450
|
+
name: string | null;
|
|
451
|
+
ownerName: string;
|
|
452
|
+
};
|
|
453
|
+
/** false: the owner has not started the map, so it is worked out from what the account runs. */
|
|
454
|
+
stored: boolean;
|
|
455
|
+
people: Array<{
|
|
456
|
+
id: number | null;
|
|
457
|
+
name: string;
|
|
458
|
+
kind: 'owner' | 'staff' | 'contractor' | 'adviser' | null;
|
|
459
|
+
role: 'owner' | 'full' | 'view' | null;
|
|
460
|
+
location: string | null;
|
|
461
|
+
fromTeamAccess: boolean;
|
|
462
|
+
}>;
|
|
463
|
+
divisions: BusinessMapDivision[];
|
|
464
|
+
/** Helpers we could not place on a division. */
|
|
465
|
+
unplaced: Array<BusinessMapHelper & {
|
|
466
|
+
placedBy: string;
|
|
467
|
+
}>;
|
|
468
|
+
/** What is missing, most important first. */
|
|
469
|
+
gaps: Array<{
|
|
470
|
+
kind: 'no_helper' | 'job_open' | 'owner_everywhere' | 'unplaced';
|
|
471
|
+
division: number | null;
|
|
472
|
+
title: string;
|
|
473
|
+
detail: string;
|
|
474
|
+
action: {
|
|
475
|
+
label: string;
|
|
476
|
+
path: string;
|
|
477
|
+
} | null;
|
|
478
|
+
}>;
|
|
479
|
+
settings: {
|
|
480
|
+
adviser: string | null;
|
|
481
|
+
runsWeek: string | null;
|
|
482
|
+
};
|
|
483
|
+
counts: {
|
|
484
|
+
people: number;
|
|
485
|
+
helpers: number;
|
|
486
|
+
placed: number;
|
|
487
|
+
divisionsWithHelpers: number;
|
|
488
|
+
jobs: number;
|
|
489
|
+
};
|
|
490
|
+
/** Sources that could not be read just now: a missing helper may simply not have been read. */
|
|
491
|
+
unavailable: string[];
|
|
492
|
+
}
|
|
363
493
|
/** A detail waiting for the owner's yes. */
|
|
364
494
|
export interface BusinessSuggestion {
|
|
365
495
|
id: number;
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* Docs: https://hub.awesomate.ai/docs/sdk/
|
|
25
25
|
*/
|
|
26
26
|
/** This package's version, sent to the hub with every server call. */
|
|
27
|
-
export const VERSION = '0.
|
|
27
|
+
export const VERSION = '0.14.0';
|
|
28
28
|
const DEFAULT_BASE = 'https://hub.awesomate.ai';
|
|
29
29
|
const ERROR_CODES = ['unauthenticated', 'forbidden', 'not_found', 'validation', 'consent_blocked', 'rate_limited', 'conflict', 'unavailable'];
|
|
30
30
|
/**
|
|
@@ -254,6 +254,15 @@ export class AwesomateClient {
|
|
|
254
254
|
business() {
|
|
255
255
|
return this.request('GET', '/api/my-business/v1/identity?format=json');
|
|
256
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* The business map: the seven divisions every business has, the jobs in each and who holds them,
|
|
259
|
+
* which agents and automations help which job and how far each may go, and what is missing, most
|
|
260
|
+
* important first. Read only: the owner changes the map in the hub. Needs the account's token
|
|
261
|
+
* (hosting:read, every plan), never an app key, and the account must have the business map.
|
|
262
|
+
*/
|
|
263
|
+
async businessMap() {
|
|
264
|
+
return (await this.request('GET', '/api/my-business/v1/map?format=json')).map;
|
|
265
|
+
}
|
|
257
266
|
/** Details waiting for the owner's yes on Your business: from the website, the account, a team member or a file. */
|
|
258
267
|
async businessSuggestions() {
|
|
259
268
|
return (await this.request('GET', '/api/my-business/v1/proposals')).proposals;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awesomate/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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",
|
|
@@ -35,8 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^20.17.0",
|
|
38
|
-
"marked": "^18.0.14",
|
|
39
|
-
"shiki": "^4.5.0",
|
|
40
38
|
"typedoc": "^0.28.20",
|
|
41
39
|
"typescript": "^5.7.2"
|
|
42
40
|
}
|