@amigo-ai/platform-sdk 0.5.2 → 0.5.4
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/README.md +81 -7
- package/api.md +3 -0
- package/dist/index.cjs +42 -10
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +42 -10
- package/dist/index.mjs.map +2 -2
- package/dist/resources/base.js +7 -2
- package/dist/resources/base.js.map +1 -1
- package/dist/resources/operators.js.map +1 -1
- package/dist/resources/personas.js.map +1 -1
- package/dist/resources/webhook-destinations.js.map +1 -1
- package/dist/resources/workspaces.js +22 -0
- package/dist/resources/workspaces.js.map +1 -1
- package/dist/resources/world.js.map +1 -1
- package/dist/types/generated/api.d.ts +895 -6
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/resources/base.d.ts.map +1 -1
- package/dist/types/resources/functions.d.ts.map +1 -1
- package/dist/types/resources/operators.d.ts.map +1 -1
- package/dist/types/resources/personas.d.ts.map +1 -1
- package/dist/types/resources/settings.d.ts.map +1 -1
- package/dist/types/resources/webhook-destinations.d.ts.map +1 -1
- package/dist/types/resources/workspaces.d.ts +34 -0
- package/dist/types/resources/workspaces.d.ts.map +1 -1
- package/dist/types/resources/world.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,14 +36,21 @@ The SDK is the typed client boundary between your runtime and the workspace-scop
|
|
|
36
36
|
|
|
37
37
|
## Documentation
|
|
38
38
|
|
|
39
|
-
| Need | Best entry point
|
|
40
|
-
| ------------------------------------------- |
|
|
41
|
-
| Product architecture and deployment context | [docs.amigo.ai](https://docs.amigo.ai/)
|
|
39
|
+
| Need | Best entry point |
|
|
40
|
+
| ------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
41
|
+
| Product architecture and deployment context | [docs.amigo.ai](https://docs.amigo.ai/) |
|
|
42
42
|
| Tutorials and integration guidance | [Developer Guide](https://docs.amigo.ai/developer-guide/platform-api/platform-sdk) |
|
|
43
|
-
| Endpoint-by-endpoint REST reference | [API Reference](https://docs.amigo.ai/api-reference)
|
|
44
|
-
| Repo-local SDK examples | [examples/README.md](./examples/README.md)
|
|
45
|
-
| Generated package surface | [api.md](./api.md)
|
|
46
|
-
| Published release history | [CHANGELOG.md](./CHANGELOG.md)
|
|
43
|
+
| Endpoint-by-endpoint REST reference | [API Reference](https://docs.amigo.ai/api-reference) |
|
|
44
|
+
| Repo-local SDK examples | [examples/README.md](./examples/README.md) |
|
|
45
|
+
| Generated package surface | [api.md](./api.md) |
|
|
46
|
+
| Published release history | [CHANGELOG.md](./CHANGELOG.md) |
|
|
47
|
+
|
|
48
|
+
### Guides
|
|
49
|
+
|
|
50
|
+
| Guide | Description |
|
|
51
|
+
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
|
|
52
|
+
| [Build a Custom Patient Form](./docs/guides/build-a-form.md) | Create, deliver, and render patient intake forms using surfaces |
|
|
53
|
+
| [Build a Custom Clinical Copilot](./docs/guides/build-a-scribe.md) | Real-time ambient documentation with encounter review and voiceprint enrollment |
|
|
47
54
|
|
|
48
55
|
The docs site remains the primary reference. The repo-local examples stay close to the shipped package surface and are typechecked in CI to reduce drift.
|
|
49
56
|
|
|
@@ -429,6 +436,73 @@ const memory = await client.settings.memory.get()
|
|
|
429
436
|
console.log(memory.dimensions) // list of configured memory dimensions
|
|
430
437
|
```
|
|
431
438
|
|
|
439
|
+
### Surfaces (Patient Forms)
|
|
440
|
+
|
|
441
|
+
Surfaces are workspace-scoped form specs for collecting patient data. Create a form, deliver it via SMS or email, and track completion. See the full guide: [Build a Custom Patient Form](./docs/guides/build-a-form.md).
|
|
442
|
+
|
|
443
|
+
```typescript
|
|
444
|
+
// Create a patient intake form
|
|
445
|
+
const surface = await client.POST('/v1/{workspace_id}/surfaces', {
|
|
446
|
+
body: {
|
|
447
|
+
entity_id: patientId,
|
|
448
|
+
title: 'New Patient Intake',
|
|
449
|
+
channel: 'sms',
|
|
450
|
+
fields: [
|
|
451
|
+
{ key: 'full_name', label: 'Full Name', field_type: 'text', required: true },
|
|
452
|
+
{ key: 'date_of_birth', label: 'Date of Birth', field_type: 'date', required: true },
|
|
453
|
+
{
|
|
454
|
+
key: 'allergies',
|
|
455
|
+
label: 'Allergies',
|
|
456
|
+
field_type: 'multiselect',
|
|
457
|
+
options: ['Penicillin', 'Sulfa', 'None'],
|
|
458
|
+
},
|
|
459
|
+
],
|
|
460
|
+
},
|
|
461
|
+
})
|
|
462
|
+
console.log(surface.data.url) // Patient-facing token URL
|
|
463
|
+
|
|
464
|
+
// Deliver via SMS
|
|
465
|
+
await client.POST('/v1/{workspace_id}/surfaces/{surface_id}/deliver', {
|
|
466
|
+
params: { path: { surface_id: surface.data.id } },
|
|
467
|
+
body: { channel_address: '+15551234567' },
|
|
468
|
+
})
|
|
469
|
+
|
|
470
|
+
// Track completion
|
|
471
|
+
const { data: rates } = await client.GET(
|
|
472
|
+
'/v1/{workspace_id}/analytics/surfaces/completion-rates',
|
|
473
|
+
{},
|
|
474
|
+
)
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
Public token routes (`/s/{token}/spec`, `/s/{token}/submit`, etc.) require no API key -- use `openapi-fetch` with the SDK's `paths` type for full type safety on unauthenticated endpoints.
|
|
478
|
+
|
|
479
|
+
### Scribe (Clinical Copilot)
|
|
480
|
+
|
|
481
|
+
Build ambient clinical documentation tools. The SDK covers encounter review actions and scribe settings. The real-time copilot WebSocket (`/copilot-stream`) is documented in the full guide: [Build a Custom Clinical Copilot](./docs/guides/build-a-scribe.md).
|
|
482
|
+
|
|
483
|
+
```typescript
|
|
484
|
+
// Configure scribe settings
|
|
485
|
+
const settings = await client.settings.scribe.get()
|
|
486
|
+
await client.settings.scribe.update({ enabled: true, soap_style: 'detailed' })
|
|
487
|
+
|
|
488
|
+
// Approve ICD-10 codes after physician review
|
|
489
|
+
await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/icd10/approve', {
|
|
490
|
+
params: { path: { encounter_id: encounterId } },
|
|
491
|
+
body: { code: 'J06.9' },
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
// Edit SOAP notes
|
|
495
|
+
await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/soap/edit', {
|
|
496
|
+
params: { path: { encounter_id: encounterId } },
|
|
497
|
+
body: { section: 'assessment', content: 'Acute upper respiratory infection...' },
|
|
498
|
+
})
|
|
499
|
+
|
|
500
|
+
// Finalize for EHR sync
|
|
501
|
+
await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/finalize', {
|
|
502
|
+
params: { path: { encounter_id: encounterId } },
|
|
503
|
+
})
|
|
504
|
+
```
|
|
505
|
+
|
|
432
506
|
### Billing
|
|
433
507
|
|
|
434
508
|
```typescript
|
package/api.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -744,7 +744,10 @@ var WorkspaceScopedResource = class {
|
|
|
744
744
|
if (!page.has_more || page.continuation_token === null || page.continuation_token === void 0) {
|
|
745
745
|
break;
|
|
746
746
|
}
|
|
747
|
-
nextParams = {
|
|
747
|
+
nextParams = {
|
|
748
|
+
...nextParams,
|
|
749
|
+
continuation_token: page.continuation_token
|
|
750
|
+
};
|
|
748
751
|
}
|
|
749
752
|
}
|
|
750
753
|
async *iterateOffsetPaginatedList(fetchPage, selectItems, params) {
|
|
@@ -890,6 +893,34 @@ var WorkspacesResource = class extends WorkspaceScopedResource {
|
|
|
890
893
|
})
|
|
891
894
|
);
|
|
892
895
|
}
|
|
896
|
+
/** Provision a workspace (seed integrations, mark as provisioned) */
|
|
897
|
+
async provision(id) {
|
|
898
|
+
return extractData(
|
|
899
|
+
await this.client.POST("/v1/workspaces/{workspace_id}/provision", {
|
|
900
|
+
params: { path: { workspace_id: id ?? this.workspaceId } }
|
|
901
|
+
})
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
/** Pre-check environment conversion warnings */
|
|
905
|
+
async checkEnvironment(target, id) {
|
|
906
|
+
return extractData(
|
|
907
|
+
await this.client.GET("/v1/workspaces/{workspace_id}/environment-check", {
|
|
908
|
+
params: {
|
|
909
|
+
path: { workspace_id: id ?? this.workspaceId },
|
|
910
|
+
query: target ? { target } : void 0
|
|
911
|
+
}
|
|
912
|
+
})
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
/** Convert workspace between staging and production */
|
|
916
|
+
async convertEnvironment(body, id) {
|
|
917
|
+
return extractData(
|
|
918
|
+
await this.client.POST("/v1/workspaces/{workspace_id}/convert-environment", {
|
|
919
|
+
params: { path: { workspace_id: id ?? this.workspaceId } },
|
|
920
|
+
body
|
|
921
|
+
})
|
|
922
|
+
);
|
|
923
|
+
}
|
|
893
924
|
};
|
|
894
925
|
|
|
895
926
|
// src/resources/api-keys.ts
|
|
@@ -1143,7 +1174,11 @@ var OperatorsResource = class extends WorkspaceScopedResource {
|
|
|
1143
1174
|
);
|
|
1144
1175
|
}
|
|
1145
1176
|
listAutoPaging(params) {
|
|
1146
|
-
return this.iterateOffsetPaginatedList(
|
|
1177
|
+
return this.iterateOffsetPaginatedList(
|
|
1178
|
+
(pageParams) => this.list(pageParams),
|
|
1179
|
+
(page) => page.items,
|
|
1180
|
+
params
|
|
1181
|
+
);
|
|
1147
1182
|
}
|
|
1148
1183
|
async create(body) {
|
|
1149
1184
|
return extractData(
|
|
@@ -2736,15 +2771,12 @@ var WebhookDestinationsResource = class extends WorkspaceScopedResource {
|
|
|
2736
2771
|
}
|
|
2737
2772
|
async listDeliveries(destinationId, params) {
|
|
2738
2773
|
return extractData(
|
|
2739
|
-
await this.client.GET(
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
path: { workspace_id: this.workspaceId, destination_id: destinationId },
|
|
2744
|
-
query: params
|
|
2745
|
-
}
|
|
2774
|
+
await this.client.GET("/v1/{workspace_id}/webhook-destinations/{destination_id}/deliveries", {
|
|
2775
|
+
params: {
|
|
2776
|
+
path: { workspace_id: this.workspaceId, destination_id: destinationId },
|
|
2777
|
+
query: params
|
|
2746
2778
|
}
|
|
2747
|
-
)
|
|
2779
|
+
})
|
|
2748
2780
|
);
|
|
2749
2781
|
}
|
|
2750
2782
|
listDeliveriesAutoPaging(destinationId, params) {
|