@gpt-platform/client 0.10.5 → 0.11.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/_internal/client/client.gen.d.ts +3 -0
- package/dist/_internal/client/client.gen.d.ts.map +1 -0
- package/dist/_internal/client/index.d.ts +9 -0
- package/dist/_internal/client/index.d.ts.map +1 -0
- package/dist/_internal/client/types.gen.d.ts +118 -0
- package/dist/_internal/client/types.gen.d.ts.map +1 -0
- package/dist/_internal/client/utils.gen.d.ts +34 -0
- package/dist/_internal/client/utils.gen.d.ts.map +1 -0
- package/dist/_internal/client.gen.d.ts +13 -0
- package/dist/_internal/client.gen.d.ts.map +1 -0
- package/dist/_internal/core/auth.gen.d.ts +19 -0
- package/dist/_internal/core/auth.gen.d.ts.map +1 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts +26 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/params.gen.d.ts +44 -0
- package/dist/_internal/core/params.gen.d.ts.map +1 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts +34 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/_internal/core/types.gen.d.ts +79 -0
- package/dist/_internal/core/types.gen.d.ts.map +1 -0
- package/dist/_internal/core/utils.gen.d.ts +20 -0
- package/dist/_internal/core/utils.gen.d.ts.map +1 -0
- package/dist/_internal/index.d.ts +3 -0
- package/dist/_internal/index.d.ts.map +1 -0
- package/dist/_internal/sdk.gen.d.ts +7053 -0
- package/dist/_internal/sdk.gen.d.ts.map +1 -0
- package/dist/_internal/types.gen.d.ts +146633 -0
- package/dist/_internal/types.gen.d.ts.map +1 -0
- package/dist/base-client.d.ts +199 -0
- package/dist/base-client.d.ts.map +1 -0
- package/dist/errors/index.d.ts +128 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/events.d.ts +69 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/execution-events.d.ts +95 -0
- package/dist/execution-events.d.ts.map +1 -0
- package/dist/gpt-client.d.ts +2175 -0
- package/dist/gpt-client.d.ts.map +1 -0
- package/dist/index.d.ts +51 -30734
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +311 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +311 -4
- package/dist/index.mjs.map +1 -1
- package/dist/json-api.d.ts +26 -0
- package/dist/json-api.d.ts.map +1 -0
- package/dist/logging.d.ts +22 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/namespace-types.d.ts +79 -0
- package/dist/namespace-types.d.ts.map +1 -0
- package/dist/namespaces/access-grants.d.ts +71 -0
- package/dist/namespaces/access-grants.d.ts.map +1 -0
- package/dist/namespaces/agents.d.ts +1406 -0
- package/dist/namespaces/agents.d.ts.map +1 -0
- package/dist/namespaces/ai.d.ts +407 -0
- package/dist/namespaces/ai.d.ts.map +1 -0
- package/dist/namespaces/audit.d.ts +83 -0
- package/dist/namespaces/audit.d.ts.map +1 -0
- package/dist/namespaces/billing.d.ts +854 -0
- package/dist/namespaces/billing.d.ts.map +1 -0
- package/dist/namespaces/campaigns.d.ts +973 -0
- package/dist/namespaces/campaigns.d.ts.map +1 -0
- package/dist/namespaces/catalog.d.ts +964 -0
- package/dist/namespaces/catalog.d.ts.map +1 -0
- package/dist/namespaces/channels.d.ts +162 -0
- package/dist/namespaces/channels.d.ts.map +1 -0
- package/dist/namespaces/clinical.d.ts +2443 -0
- package/dist/namespaces/clinical.d.ts.map +1 -0
- package/dist/namespaces/communication.d.ts +439 -0
- package/dist/namespaces/communication.d.ts.map +1 -0
- package/dist/namespaces/compliance.d.ts +2310 -0
- package/dist/namespaces/compliance.d.ts.map +1 -0
- package/dist/namespaces/connectors.d.ts +1368 -0
- package/dist/namespaces/connectors.d.ts.map +1 -0
- package/dist/namespaces/content.d.ts +188 -0
- package/dist/namespaces/content.d.ts.map +1 -0
- package/dist/namespaces/crawler.d.ts +408 -0
- package/dist/namespaces/crawler.d.ts.map +1 -0
- package/dist/namespaces/crm-clusters.d.ts +31 -0
- package/dist/namespaces/crm-clusters.d.ts.map +1 -0
- package/dist/namespaces/crm.d.ts +1539 -0
- package/dist/namespaces/crm.d.ts.map +1 -0
- package/dist/namespaces/documents.d.ts +136 -0
- package/dist/namespaces/documents.d.ts.map +1 -0
- package/dist/namespaces/email.d.ts +550 -0
- package/dist/namespaces/email.d.ts.map +1 -0
- package/dist/namespaces/extraction.d.ts +1249 -0
- package/dist/namespaces/extraction.d.ts.map +1 -0
- package/dist/namespaces/identity.d.ts +411 -0
- package/dist/namespaces/identity.d.ts.map +1 -0
- package/dist/namespaces/imports.d.ts +177 -0
- package/dist/namespaces/imports.d.ts.map +1 -0
- package/dist/namespaces/index.d.ts +119 -0
- package/dist/namespaces/index.d.ts.map +1 -0
- package/dist/namespaces/memory.d.ts +105 -0
- package/dist/namespaces/memory.d.ts.map +1 -0
- package/dist/namespaces/models.d.ts +75 -0
- package/dist/namespaces/models.d.ts.map +1 -0
- package/dist/namespaces/permissions.d.ts +75 -0
- package/dist/namespaces/permissions.d.ts.map +1 -0
- package/dist/namespaces/pipeline-executions.d.ts +130 -0
- package/dist/namespaces/pipeline-executions.d.ts.map +1 -0
- package/dist/namespaces/pipelines.d.ts +120 -0
- package/dist/namespaces/pipelines.d.ts.map +1 -0
- package/dist/namespaces/platform.d.ts +1430 -0
- package/dist/namespaces/platform.d.ts.map +1 -0
- package/dist/namespaces/portal.d.ts +198 -0
- package/dist/namespaces/portal.d.ts.map +1 -0
- package/dist/namespaces/projects.d.ts +553 -0
- package/dist/namespaces/projects.d.ts.map +1 -0
- package/dist/namespaces/roles.d.ts +65 -0
- package/dist/namespaces/roles.d.ts.map +1 -0
- package/dist/namespaces/scheduling.d.ts +944 -0
- package/dist/namespaces/scheduling.d.ts.map +1 -0
- package/dist/namespaces/search.d.ts +224 -0
- package/dist/namespaces/search.d.ts.map +1 -0
- package/dist/namespaces/session-notes.d.ts +67 -0
- package/dist/namespaces/session-notes.d.ts.map +1 -0
- package/dist/namespaces/social.d.ts +330 -0
- package/dist/namespaces/social.d.ts.map +1 -0
- package/dist/namespaces/storage.d.ts +378 -0
- package/dist/namespaces/storage.d.ts.map +1 -0
- package/dist/namespaces/support.d.ts +427 -0
- package/dist/namespaces/support.d.ts.map +1 -0
- package/dist/namespaces/threads.d.ts +596 -0
- package/dist/namespaces/threads.d.ts.map +1 -0
- package/dist/namespaces/training.d.ts +358 -0
- package/dist/namespaces/training.d.ts.map +1 -0
- package/dist/namespaces/voice.d.ts +752 -0
- package/dist/namespaces/voice.d.ts.map +1 -0
- package/dist/namespaces/watcher.d.ts +425 -0
- package/dist/namespaces/watcher.d.ts.map +1 -0
- package/dist/namespaces/webhooks-ns.d.ts +3 -0
- package/dist/namespaces/webhooks-ns.d.ts.map +1 -0
- package/dist/pagination.d.ts +57 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/request-builder.d.ts +95 -0
- package/dist/request-builder.d.ts.map +1 -0
- package/dist/security.d.ts +32 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/streaming.d.ts +135 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +63 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/webhook-signature.d.ts +109 -0
- package/dist/webhook-signature.d.ts.map +1 -0
- package/llms.txt +7 -1
- package/package.json +286 -36
- package/dist/index.d.mts +0 -30734
package/dist/index.mjs
CHANGED
|
@@ -1272,7 +1272,7 @@ function buildUserAgent(sdkVersion, appInfo) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
1274
1274
|
// src/version.ts
|
|
1275
|
-
var SDK_VERSION = "0.
|
|
1275
|
+
var SDK_VERSION = "0.11.0";
|
|
1276
1276
|
var DEFAULT_API_VERSION = "2026-03-23";
|
|
1277
1277
|
|
|
1278
1278
|
// src/base-client.ts
|
|
@@ -1796,6 +1796,15 @@ var postCatalogTaxonomyNodes = (options) => (options.client ?? client).post({
|
|
|
1796
1796
|
...options.headers
|
|
1797
1797
|
}
|
|
1798
1798
|
});
|
|
1799
|
+
var postConnectorsByIdHealthieAppointmentsSync = (options) => (options.client ?? client).post({
|
|
1800
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1801
|
+
url: "/connectors/{id}/healthie/appointments/sync",
|
|
1802
|
+
...options,
|
|
1803
|
+
headers: {
|
|
1804
|
+
"Content-Type": "application/vnd.api+json",
|
|
1805
|
+
...options.headers
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
1799
1808
|
var postCampaignsSequenceSteps = (options) => (options.client ?? client).post({
|
|
1800
1809
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1801
1810
|
url: "/campaigns/sequence-steps",
|
|
@@ -2534,6 +2543,15 @@ var getUsersMeDashboard = (options) => (options.client ?? client).get({
|
|
|
2534
2543
|
url: "/users/me/dashboard",
|
|
2535
2544
|
...options
|
|
2536
2545
|
});
|
|
2546
|
+
var postConnectorsByIdHealthiePatientsSync = (options) => (options.client ?? client).post({
|
|
2547
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2548
|
+
url: "/connectors/{id}/healthie/patients/sync",
|
|
2549
|
+
...options,
|
|
2550
|
+
headers: {
|
|
2551
|
+
"Content-Type": "application/vnd.api+json",
|
|
2552
|
+
...options.headers
|
|
2553
|
+
}
|
|
2554
|
+
});
|
|
2537
2555
|
var getBusinessAssociateAgreementsById = (options) => (options.client ?? client).get({
|
|
2538
2556
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2539
2557
|
url: "/business-associate-agreements/{id}",
|
|
@@ -3877,6 +3895,15 @@ var patchEmailInclusionsById = (options) => (options.client ?? client).patch({
|
|
|
3877
3895
|
...options.headers
|
|
3878
3896
|
}
|
|
3879
3897
|
});
|
|
3898
|
+
var postConnectorsByIdHealthieSyncAll = (options) => (options.client ?? client).post({
|
|
3899
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3900
|
+
url: "/connectors/{id}/healthie/sync-all",
|
|
3901
|
+
...options,
|
|
3902
|
+
headers: {
|
|
3903
|
+
"Content-Type": "application/vnd.api+json",
|
|
3904
|
+
...options.headers
|
|
3905
|
+
}
|
|
3906
|
+
});
|
|
3880
3907
|
var getUsersMe = (options) => (options.client ?? client).get({
|
|
3881
3908
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3882
3909
|
url: "/users/me",
|
|
@@ -5586,6 +5613,15 @@ var patchUserProfilesByIdDismissWelcome = (options) => (options.client ?? client
|
|
|
5586
5613
|
...options.headers
|
|
5587
5614
|
}
|
|
5588
5615
|
});
|
|
5616
|
+
var postConnectorsByIdHealthieAppointmentsList = (options) => (options.client ?? client).post({
|
|
5617
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5618
|
+
url: "/connectors/{id}/healthie/appointments/list",
|
|
5619
|
+
...options,
|
|
5620
|
+
headers: {
|
|
5621
|
+
"Content-Type": "application/vnd.api+json",
|
|
5622
|
+
...options.headers
|
|
5623
|
+
}
|
|
5624
|
+
});
|
|
5589
5625
|
var getClinicalHealthMetrics = (options) => (options.client ?? client).get({
|
|
5590
5626
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5591
5627
|
url: "/clinical/health-metrics",
|
|
@@ -6186,6 +6222,15 @@ var postAiEmbed = (options) => (options.client ?? client).post({
|
|
|
6186
6222
|
...options.headers
|
|
6187
6223
|
}
|
|
6188
6224
|
});
|
|
6225
|
+
var postConnectorsByIdHealthiePatientsList = (options) => (options.client ?? client).post({
|
|
6226
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6227
|
+
url: "/connectors/{id}/healthie/patients/list",
|
|
6228
|
+
...options,
|
|
6229
|
+
headers: {
|
|
6230
|
+
"Content-Type": "application/vnd.api+json",
|
|
6231
|
+
...options.headers
|
|
6232
|
+
}
|
|
6233
|
+
});
|
|
6189
6234
|
var patchConsentRecordsByIdWithdraw = (options) => (options.client ?? client).patch({
|
|
6190
6235
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6191
6236
|
url: "/consent-records/{id}/withdraw",
|
|
@@ -6271,6 +6316,11 @@ var getScanResultsById = (options) => (options.client ?? client).get({
|
|
|
6271
6316
|
url: "/scan-results/{id}",
|
|
6272
6317
|
...options
|
|
6273
6318
|
});
|
|
6319
|
+
var getConnectorsByIdHealthieStatus = (options) => (options.client ?? client).get({
|
|
6320
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6321
|
+
url: "/connectors/{id}/healthie/status",
|
|
6322
|
+
...options
|
|
6323
|
+
});
|
|
6274
6324
|
var getPolicyReviewSchedules = (options) => (options.client ?? client).get({
|
|
6275
6325
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6276
6326
|
url: "/policy-review-schedules",
|
|
@@ -19837,6 +19887,238 @@ function createConnectorsNamespace(rb) {
|
|
|
19837
19887
|
},
|
|
19838
19888
|
options
|
|
19839
19889
|
)
|
|
19890
|
+
},
|
|
19891
|
+
/**
|
|
19892
|
+
* Healthie EHR connector — patient and appointment sync.
|
|
19893
|
+
*
|
|
19894
|
+
* Provides typed methods for listing and syncing patient records and appointments
|
|
19895
|
+
* from Healthie EHR. Requires an active `ConnectorInstance` with `connector_type:
|
|
19896
|
+
* "healthie"` and a linked OAuth `Credential`.
|
|
19897
|
+
*
|
|
19898
|
+
* Typical flow:
|
|
19899
|
+
* 1. Authorize via OAuth using `oauth.connect('healthie', workspaceId)`.
|
|
19900
|
+
* 2. Check sync status with `healthie.getStatus(connectorId, workspaceId)`.
|
|
19901
|
+
* 3. List patients or appointments, optionally filtering by date.
|
|
19902
|
+
* 4. Trigger incremental or full syncs as needed.
|
|
19903
|
+
*/
|
|
19904
|
+
healthie: {
|
|
19905
|
+
/**
|
|
19906
|
+
* List patient records from Healthie EHR.
|
|
19907
|
+
*
|
|
19908
|
+
* Returns all patients from the Healthie account linked to the connector.
|
|
19909
|
+
* Optionally filter by `since` date to only get patients modified since
|
|
19910
|
+
* a given timestamp.
|
|
19911
|
+
*
|
|
19912
|
+
* @param connectorId - UUID of the Healthie `ConnectorInstance`.
|
|
19913
|
+
* @param workspaceId - UUID of the current workspace.
|
|
19914
|
+
* @param options - Optional list parameters including `since` (Date) filter.
|
|
19915
|
+
* @param requestOptions - Optional request options.
|
|
19916
|
+
* @returns An array of `HealthiePatient` records.
|
|
19917
|
+
*
|
|
19918
|
+
* @example
|
|
19919
|
+
* ```typescript
|
|
19920
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19921
|
+
* const patients = await client.connectors.healthie.listPatients(
|
|
19922
|
+
* 'ci_healthie_123',
|
|
19923
|
+
* 'ws_abc123',
|
|
19924
|
+
* { since: new Date('2025-01-01') },
|
|
19925
|
+
* );
|
|
19926
|
+
* patients.forEach(p => console.log(p.first_name, p.last_name));
|
|
19927
|
+
* ```
|
|
19928
|
+
*/
|
|
19929
|
+
listPatients: async (connectorId, workspaceId, options) => {
|
|
19930
|
+
const { since, ...requestOptions } = options || {};
|
|
19931
|
+
return rb.execute(
|
|
19932
|
+
postConnectorsByIdHealthiePatientsList,
|
|
19933
|
+
{
|
|
19934
|
+
path: { id: connectorId },
|
|
19935
|
+
body: {
|
|
19936
|
+
data: {
|
|
19937
|
+
connector_id: connectorId,
|
|
19938
|
+
workspace_id: workspaceId,
|
|
19939
|
+
...since ? { since: since.toISOString() } : {}
|
|
19940
|
+
}
|
|
19941
|
+
}
|
|
19942
|
+
},
|
|
19943
|
+
Object.keys(requestOptions).length > 0 ? requestOptions : void 0
|
|
19944
|
+
);
|
|
19945
|
+
},
|
|
19946
|
+
/**
|
|
19947
|
+
* Trigger a patient sync from Healthie EHR.
|
|
19948
|
+
*
|
|
19949
|
+
* Fetches patient records from Healthie and updates the local cache.
|
|
19950
|
+
* Returns a summary of sync statistics.
|
|
19951
|
+
*
|
|
19952
|
+
* @param connectorId - UUID of the Healthie `ConnectorInstance`.
|
|
19953
|
+
* @param workspaceId - UUID of the current workspace.
|
|
19954
|
+
* @param requestOptions - Optional request options.
|
|
19955
|
+
* @returns A `HealthieSyncResult` with sync count and any errors.
|
|
19956
|
+
*
|
|
19957
|
+
* @example
|
|
19958
|
+
* ```typescript
|
|
19959
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19960
|
+
* const result = await client.connectors.healthie.syncPatients(
|
|
19961
|
+
* 'ci_healthie_123',
|
|
19962
|
+
* 'ws_abc123',
|
|
19963
|
+
* );
|
|
19964
|
+
* console.log(`Synced ${result.synced} patients`);
|
|
19965
|
+
* ```
|
|
19966
|
+
*/
|
|
19967
|
+
syncPatients: async (connectorId, workspaceId, requestOptions) => rb.execute(
|
|
19968
|
+
postConnectorsByIdHealthiePatientsSync,
|
|
19969
|
+
{
|
|
19970
|
+
path: { id: connectorId },
|
|
19971
|
+
body: {
|
|
19972
|
+
data: {
|
|
19973
|
+
connector_id: connectorId,
|
|
19974
|
+
workspace_id: workspaceId
|
|
19975
|
+
}
|
|
19976
|
+
}
|
|
19977
|
+
},
|
|
19978
|
+
requestOptions
|
|
19979
|
+
),
|
|
19980
|
+
/**
|
|
19981
|
+
* List appointment records from Healthie EHR.
|
|
19982
|
+
*
|
|
19983
|
+
* Returns all appointments from the Healthie account linked to the connector.
|
|
19984
|
+
* Optionally filter by `since` date to only get appointments modified since
|
|
19985
|
+
* a given timestamp.
|
|
19986
|
+
*
|
|
19987
|
+
* @param connectorId - UUID of the Healthie `ConnectorInstance`.
|
|
19988
|
+
* @param workspaceId - UUID of the current workspace.
|
|
19989
|
+
* @param options - Optional list parameters including `since` (Date) filter.
|
|
19990
|
+
* @param requestOptions - Optional request options.
|
|
19991
|
+
* @returns An array of `HealthieAppointment` records.
|
|
19992
|
+
*
|
|
19993
|
+
* @example
|
|
19994
|
+
* ```typescript
|
|
19995
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19996
|
+
* const appointments = await client.connectors.healthie.listAppointments(
|
|
19997
|
+
* 'ci_healthie_123',
|
|
19998
|
+
* 'ws_abc123',
|
|
19999
|
+
* { since: new Date('2025-01-01') },
|
|
20000
|
+
* );
|
|
20001
|
+
* appointments.forEach(a => console.log(a.date, a.status));
|
|
20002
|
+
* ```
|
|
20003
|
+
*/
|
|
20004
|
+
listAppointments: async (connectorId, workspaceId, options) => {
|
|
20005
|
+
const { since, ...requestOptions } = options || {};
|
|
20006
|
+
return rb.execute(
|
|
20007
|
+
postConnectorsByIdHealthieAppointmentsList,
|
|
20008
|
+
{
|
|
20009
|
+
path: { id: connectorId },
|
|
20010
|
+
body: {
|
|
20011
|
+
data: {
|
|
20012
|
+
connector_id: connectorId,
|
|
20013
|
+
workspace_id: workspaceId,
|
|
20014
|
+
...since ? { since: since.toISOString() } : {}
|
|
20015
|
+
}
|
|
20016
|
+
}
|
|
20017
|
+
},
|
|
20018
|
+
Object.keys(requestOptions).length > 0 ? requestOptions : void 0
|
|
20019
|
+
);
|
|
20020
|
+
},
|
|
20021
|
+
/**
|
|
20022
|
+
* Trigger an appointment sync from Healthie EHR.
|
|
20023
|
+
*
|
|
20024
|
+
* Fetches appointment records from Healthie and updates the local cache.
|
|
20025
|
+
* Returns a summary of sync statistics.
|
|
20026
|
+
*
|
|
20027
|
+
* @param connectorId - UUID of the Healthie `ConnectorInstance`.
|
|
20028
|
+
* @param workspaceId - UUID of the current workspace.
|
|
20029
|
+
* @param requestOptions - Optional request options.
|
|
20030
|
+
* @returns A `HealthieSyncResult` with sync count and any errors.
|
|
20031
|
+
*
|
|
20032
|
+
* @example
|
|
20033
|
+
* ```typescript
|
|
20034
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
20035
|
+
* const result = await client.connectors.healthie.syncAppointments(
|
|
20036
|
+
* 'ci_healthie_123',
|
|
20037
|
+
* 'ws_abc123',
|
|
20038
|
+
* );
|
|
20039
|
+
* console.log(`Synced ${result.synced} appointments`);
|
|
20040
|
+
* ```
|
|
20041
|
+
*/
|
|
20042
|
+
syncAppointments: async (connectorId, workspaceId, requestOptions) => rb.execute(
|
|
20043
|
+
postConnectorsByIdHealthieAppointmentsSync,
|
|
20044
|
+
{
|
|
20045
|
+
path: { id: connectorId },
|
|
20046
|
+
body: {
|
|
20047
|
+
data: {
|
|
20048
|
+
connector_id: connectorId,
|
|
20049
|
+
workspace_id: workspaceId
|
|
20050
|
+
}
|
|
20051
|
+
}
|
|
20052
|
+
},
|
|
20053
|
+
requestOptions
|
|
20054
|
+
),
|
|
20055
|
+
/**
|
|
20056
|
+
* Trigger a full sync of both patients and appointments from Healthie EHR.
|
|
20057
|
+
*
|
|
20058
|
+
* Fetches all patient and appointment records from Healthie and updates
|
|
20059
|
+
* the local cache. Returns a summary of sync statistics for both types.
|
|
20060
|
+
*
|
|
20061
|
+
* @param connectorId - UUID of the Healthie `ConnectorInstance`.
|
|
20062
|
+
* @param workspaceId - UUID of the current workspace.
|
|
20063
|
+
* @param requestOptions - Optional request options.
|
|
20064
|
+
* @returns A `HealthieSyncAllResult` with patient and appointment sync counts.
|
|
20065
|
+
*
|
|
20066
|
+
* @example
|
|
20067
|
+
* ```typescript
|
|
20068
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
20069
|
+
* const result = await client.connectors.healthie.syncAll(
|
|
20070
|
+
* 'ci_healthie_123',
|
|
20071
|
+
* 'ws_abc123',
|
|
20072
|
+
* );
|
|
20073
|
+
* console.log(`Synced ${result.patients_synced} patients, ${result.appointments_synced} appointments`);
|
|
20074
|
+
* ```
|
|
20075
|
+
*/
|
|
20076
|
+
syncAll: async (connectorId, workspaceId, requestOptions) => rb.execute(
|
|
20077
|
+
postConnectorsByIdHealthieSyncAll,
|
|
20078
|
+
{
|
|
20079
|
+
path: { id: connectorId },
|
|
20080
|
+
body: {
|
|
20081
|
+
data: {
|
|
20082
|
+
connector_id: connectorId,
|
|
20083
|
+
workspace_id: workspaceId
|
|
20084
|
+
}
|
|
20085
|
+
}
|
|
20086
|
+
},
|
|
20087
|
+
requestOptions
|
|
20088
|
+
),
|
|
20089
|
+
/**
|
|
20090
|
+
* Get the current sync status for the Healthie connector.
|
|
20091
|
+
*
|
|
20092
|
+
* Returns summary statistics about the last sync, including patient
|
|
20093
|
+
* and appointment counts, last sync timestamp, and any errors.
|
|
20094
|
+
*
|
|
20095
|
+
* @param connectorId - UUID of the Healthie `ConnectorInstance`.
|
|
20096
|
+
* @param workspaceId - UUID of the current workspace.
|
|
20097
|
+
* @param requestOptions - Optional request options.
|
|
20098
|
+
* @returns A `HealthieSyncStatus` object with sync statistics.
|
|
20099
|
+
*
|
|
20100
|
+
* @example
|
|
20101
|
+
* ```typescript
|
|
20102
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
20103
|
+
* const status = await client.connectors.healthie.getStatus(
|
|
20104
|
+
* 'ci_healthie_123',
|
|
20105
|
+
* 'ws_abc123',
|
|
20106
|
+
* );
|
|
20107
|
+
* console.log(`Last synced: ${status.last_synced_at}`);
|
|
20108
|
+
* console.log(`Patients: ${status.patient_count}, Appointments: ${status.appointment_count}`);
|
|
20109
|
+
* ```
|
|
20110
|
+
*/
|
|
20111
|
+
getStatus: async (connectorId, workspaceId, requestOptions) => rb.execute(
|
|
20112
|
+
getConnectorsByIdHealthieStatus,
|
|
20113
|
+
{
|
|
20114
|
+
path: { id: connectorId },
|
|
20115
|
+
query: {
|
|
20116
|
+
connector_id: connectorId,
|
|
20117
|
+
workspace_id: workspaceId
|
|
20118
|
+
}
|
|
20119
|
+
},
|
|
20120
|
+
requestOptions
|
|
20121
|
+
)
|
|
19840
20122
|
}
|
|
19841
20123
|
};
|
|
19842
20124
|
}
|
|
@@ -33637,7 +33919,7 @@ function createSocialNamespace(rb) {
|
|
|
33637
33919
|
},
|
|
33638
33920
|
/** Generate AI master copy from the campaign's content brief. */
|
|
33639
33921
|
generateMasterCopy: async (id, workspaceId, options) => {
|
|
33640
|
-
return rb.
|
|
33922
|
+
return rb.executeDirect(
|
|
33641
33923
|
postSocialCampaignsByIdGenerateMasterCopy,
|
|
33642
33924
|
{
|
|
33643
33925
|
path: { id },
|
|
@@ -33653,7 +33935,7 @@ function createSocialNamespace(rb) {
|
|
|
33653
33935
|
},
|
|
33654
33936
|
/** Adapt master copy for target platforms and create SocialPost drafts. */
|
|
33655
33937
|
adaptForPlatforms: async (id, workspaceId, socialAccountId, options) => {
|
|
33656
|
-
return rb.
|
|
33938
|
+
return rb.executeDirect(
|
|
33657
33939
|
postSocialCampaignsByIdAdaptForPlatforms,
|
|
33658
33940
|
{
|
|
33659
33941
|
path: { id },
|
|
@@ -33680,7 +33962,7 @@ function createSocialNamespace(rb) {
|
|
|
33680
33962
|
* @returns `{ adaptations: [{ platform: string, content: string }] }`
|
|
33681
33963
|
*/
|
|
33682
33964
|
previewAdaptations: async (id, workspaceId, options) => {
|
|
33683
|
-
return rb.
|
|
33965
|
+
return rb.executeDirect(
|
|
33684
33966
|
postSocialCampaignsByIdPreviewAdaptations,
|
|
33685
33967
|
{
|
|
33686
33968
|
path: { id },
|
|
@@ -34927,6 +35209,31 @@ var RequestBuilder = class {
|
|
|
34927
35209
|
throw handleApiError(error);
|
|
34928
35210
|
}
|
|
34929
35211
|
}
|
|
35212
|
+
/**
|
|
35213
|
+
* Execute a generated SDK function that returns flat JSON (no JSON:API data wrapper).
|
|
35214
|
+
* Unlike execute() (which unwraps data.data for JSON:API envelopes), this returns
|
|
35215
|
+
* the parsed response body directly. Used for generic Ash actions that return maps.
|
|
35216
|
+
*/
|
|
35217
|
+
async executeDirect(fn, params, options) {
|
|
35218
|
+
const headers = buildHeaders(this.getHeaders, options);
|
|
35219
|
+
try {
|
|
35220
|
+
const result = await this.requestWithRetry(
|
|
35221
|
+
() => fn({
|
|
35222
|
+
client: this.clientInstance,
|
|
35223
|
+
headers,
|
|
35224
|
+
...params,
|
|
35225
|
+
...options?.signal && { signal: options.signal }
|
|
35226
|
+
})
|
|
35227
|
+
);
|
|
35228
|
+
const { data, error } = result;
|
|
35229
|
+
if (error) {
|
|
35230
|
+
throw enrichError(error, result);
|
|
35231
|
+
}
|
|
35232
|
+
return data;
|
|
35233
|
+
} catch (error) {
|
|
35234
|
+
throw handleApiError(error);
|
|
35235
|
+
}
|
|
35236
|
+
}
|
|
34930
35237
|
/**
|
|
34931
35238
|
* Execute a delete operation that returns true on success.
|
|
34932
35239
|
*/
|