@awesomate/sdk 0.13.0 → 0.15.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
@@ -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.13.0";
27
+ export declare const VERSION = "0.15.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,162 @@ 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
+ /** The tag this job's procedures carry in 1Brain, such as 'job:quotes'. The map keeps no procedure text. */
412
+ proceduresTag: string;
413
+ }
414
+ /** One step of the customer's path. */
415
+ export interface BusinessMapPathStep {
416
+ position: number;
417
+ label: string;
418
+ divisionNo: 1 | 2 | 3 | 4 | 5 | 6 | 7;
419
+ verb: string;
420
+ /** The job that looks after the step, when the owner named one. */
421
+ job: {
422
+ id: number;
423
+ slug: string;
424
+ title: string;
425
+ } | null;
426
+ /** Who looks after it: the job's holder, else whoever runs the division (byDefault). */
427
+ owner: {
428
+ name: string;
429
+ byDefault: boolean;
430
+ };
431
+ /** Where this step hands over to the next, in the owner's words. */
432
+ handoffRule: string | null;
433
+ }
434
+ /** One of the seven divisions, in board order (7 first). */
435
+ export interface BusinessMapDivision {
436
+ no: 1 | 2 | 3 | 4 | 5 | 6 | 7;
437
+ /** Envision, Form, Promise, Balance, Fulfil, Refine, Share. */
438
+ verb: string;
439
+ name: string;
440
+ purpose: string;
441
+ stage: 'survive' | 'grow' | 'scale';
442
+ /** Who runs it. byDefault: nobody else has been given it, so the owner does. */
443
+ runBy: {
444
+ name: string;
445
+ byDefault: boolean;
446
+ };
447
+ jobs: BusinessMapJob[];
448
+ /** Helping here but not yet put on a job, with how they were placed, in words. */
449
+ helpers: Array<BusinessMapHelper & {
450
+ placedBy: string;
451
+ }>;
452
+ departments: Array<{
453
+ no: number;
454
+ name: string;
455
+ gloss: string;
456
+ }>;
457
+ ideas: Array<{
458
+ label: string;
459
+ what: string;
460
+ status: 'live' | 'library' | 'coming' | 'building' | 'planned';
461
+ path?: string;
462
+ }>;
463
+ numbers: Array<{
464
+ label: string;
465
+ kind: 'lead' | 'result';
466
+ }>;
467
+ question: string;
468
+ /** 1Brain departments whose procedures belong in this division. */
469
+ oneBrainDepartments: string[];
470
+ }
471
+ /** The business map, as businessMap() returns it. No email addresses. */
472
+ export interface BusinessMap {
473
+ business: {
474
+ name: string | null;
475
+ ownerName: string;
476
+ };
477
+ /** false: the owner has not started the map, so it is worked out from what the account runs. */
478
+ stored: boolean;
479
+ people: Array<{
480
+ id: number | null;
481
+ name: string;
482
+ kind: 'owner' | 'staff' | 'contractor' | 'adviser' | null;
483
+ role: 'owner' | 'full' | 'view' | null;
484
+ location: string | null;
485
+ fromTeamAccess: boolean;
486
+ }>;
487
+ divisions: BusinessMapDivision[];
488
+ /** Helpers we could not place on a division. */
489
+ unplaced: Array<BusinessMapHelper & {
490
+ placedBy: string;
491
+ }>;
492
+ /** How a customer moves through the business. stored false: suggested for its kind of business, not set by the owner yet. */
493
+ path: {
494
+ stored: boolean;
495
+ template: {
496
+ key: string;
497
+ label: string;
498
+ } | null;
499
+ steps: BusinessMapPathStep[];
500
+ };
501
+ /** What is missing, most important first. */
502
+ gaps: Array<{
503
+ kind: 'procedure_first' | 'no_helper' | 'job_open' | 'path_missing' | 'path_unowned' | 'owner_everywhere' | 'unplaced';
504
+ division: number | null;
505
+ title: string;
506
+ detail: string;
507
+ action: {
508
+ label: string;
509
+ path: string;
510
+ } | null;
511
+ }>;
512
+ settings: {
513
+ adviser: string | null;
514
+ runsWeek: string | null;
515
+ };
516
+ counts: {
517
+ people: number;
518
+ helpers: number;
519
+ placed: number;
520
+ divisionsWithHelpers: number;
521
+ jobs: number;
522
+ };
523
+ /** Sources that could not be read just now: a missing helper may simply not have been read. */
524
+ unavailable: string[];
525
+ }
363
526
  /** A detail waiting for the owner's yes. */
364
527
  export interface BusinessSuggestion {
365
528
  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.13.0';
27
+ export const VERSION = '0.15.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.13.0",
3
+ "version": "0.15.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
  }