@gravity-rail/sdk 0.8.0 → 0.10.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/README.md +38 -0
- package/dist/{chunk-ML55PVP7.js → chunk-2BJG4GYM.js} +641 -541
- package/dist/chunk-2BJG4GYM.js.map +1 -0
- package/dist/chunk-FSSXKQR5.js +471 -0
- package/dist/chunk-FSSXKQR5.js.map +1 -0
- package/dist/{chunk-QS6ZRQUZ.js → chunk-TJT7A4CO.js} +8 -1
- package/dist/{chunk-QS6ZRQUZ.js.map → chunk-TJT7A4CO.js.map} +1 -1
- package/dist/{client-C2aWAalu.d.cts → client-BffM3KcA.d.cts} +1190 -313
- package/dist/{client-CLGovEox.d.ts → client-DfjAYbt8.d.ts} +1190 -313
- package/dist/helpers.cjs +178 -2
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +82 -3
- package/dist/helpers.d.ts +82 -3
- package/dist/helpers.js +156 -1
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +851 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -8
- package/dist/index.d.ts +14 -8
- package/dist/index.js +144 -20
- package/dist/index.js.map +1 -1
- package/dist/{inquiries-CmECZnkl.d.cts → inquiries-UcWNYo-Q.d.cts} +564 -79
- package/dist/{inquiries-CmECZnkl.d.ts → inquiries-UcWNYo-Q.d.ts} +564 -79
- package/dist/internal.cjs +784 -153
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +241 -5
- package/dist/internal.d.ts +241 -5
- package/dist/internal.js +71 -7
- package/dist/internal.js.map +1 -1
- package/dist/realtime.cjs +1 -0
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.js +1 -0
- package/dist/realtime.js.map +1 -1
- package/dist/schemas.cjs +29 -7
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +106 -51
- package/dist/schemas.d.ts +106 -51
- package/dist/schemas.js +29 -8
- package/dist/schemas.js.map +1 -1
- package/dist/{scopes-D6a_Mvqr.d.ts → scopes-CjSvITpL.d.cts} +53 -8
- package/dist/{scopes-CDaJBQVT.d.cts → scopes-CmNKWrzb.d.ts} +53 -8
- package/package.json +5 -5
- package/dist/chunk-ML55PVP7.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -54,6 +54,7 @@ __export(src_exports, {
|
|
|
54
54
|
DEFAULT_VOICE_INFERENCE_MODEL: () => DEFAULT_VOICE_INFERENCE_MODEL,
|
|
55
55
|
DataCategory: () => DataCategory,
|
|
56
56
|
DataFieldType: () => DataFieldType,
|
|
57
|
+
DataRecordRetirementResponseReason: () => DataRecordRetirementResponseReason,
|
|
57
58
|
DataSensitivity: () => DataSensitivity,
|
|
58
59
|
DataTypeRecordScope: () => DataTypeRecordScope,
|
|
59
60
|
DriverMode: () => DriverMode,
|
|
@@ -77,6 +78,9 @@ __export(src_exports, {
|
|
|
77
78
|
McpServerState: () => McpServerState,
|
|
78
79
|
MemberFeature: () => MemberFeature,
|
|
79
80
|
MemberFilterBuilder: () => MemberFilterBuilder,
|
|
81
|
+
MemberImportMatchInfoMatchType: () => MemberImportMatchInfoMatchType,
|
|
82
|
+
MemberImportPreviewRowAction: () => MemberImportPreviewRowAction,
|
|
83
|
+
MemberImportValidationError: () => MemberImportValidationError,
|
|
80
84
|
MemberLabelBuilder: () => MemberLabelBuilder,
|
|
81
85
|
MemberType: () => MemberType,
|
|
82
86
|
MenuItemResponseItemType: () => MenuItemResponseItemType,
|
|
@@ -99,7 +103,11 @@ __export(src_exports, {
|
|
|
99
103
|
PERMISSION_NONE: () => PERMISSION_NONE,
|
|
100
104
|
PERMISSION_USE: () => PERMISSION_USE,
|
|
101
105
|
PERMISSION_VERIFY: () => PERMISSION_VERIFY,
|
|
106
|
+
PIDS_DISPOSITIONS: () => PIDS_DISPOSITIONS,
|
|
107
|
+
PIDS_SOURCES: () => PIDS_SOURCES,
|
|
102
108
|
ProductType: () => ProductType,
|
|
109
|
+
QUERY_VALUELESS_OPS: () => QUERY_VALUELESS_OPS,
|
|
110
|
+
QueriesApi: () => QueriesApi,
|
|
103
111
|
REALTIME_MODEL_CUSTOM: () => REALTIME_MODEL_CUSTOM,
|
|
104
112
|
REALTIME_MODEL_GEMINI: () => REALTIME_MODEL_GEMINI,
|
|
105
113
|
REALTIME_MODEL_GEMINI_VERTEX: () => REALTIME_MODEL_GEMINI_VERTEX,
|
|
@@ -129,7 +137,6 @@ __export(src_exports, {
|
|
|
129
137
|
TTS_MODEL_ELEVENLABS_FLASH: () => TTS_MODEL_ELEVENLABS_FLASH,
|
|
130
138
|
TTS_MODEL_ELEVENLABS_MULTILINGUAL: () => TTS_MODEL_ELEVENLABS_MULTILINGUAL,
|
|
131
139
|
TTS_MODEL_ELEVENLABS_TURBO: () => TTS_MODEL_ELEVENLABS_TURBO,
|
|
132
|
-
TTS_MODEL_POCKET: () => TTS_MODEL_POCKET,
|
|
133
140
|
TTS_PREVIEW_PROVIDERS: () => TTS_PREVIEW_PROVIDERS,
|
|
134
141
|
TaskBuilder: () => TaskBuilder,
|
|
135
142
|
TemplatesApi: () => TemplatesApi,
|
|
@@ -231,6 +238,22 @@ function parseOrgAuthChallenge(wwwAuthenticate) {
|
|
|
231
238
|
authUrl: authUrlMatch[1]
|
|
232
239
|
};
|
|
233
240
|
}
|
|
241
|
+
function getRequestOrgCookieName(cookieName) {
|
|
242
|
+
if (cookieName.startsWith("orgToken")) {
|
|
243
|
+
return cookieName.replace(/^orgToken/, "requestOrgToken");
|
|
244
|
+
}
|
|
245
|
+
if (cookieName.startsWith("orgSession")) {
|
|
246
|
+
return cookieName.replace(/^orgSession/, "requestOrgSession");
|
|
247
|
+
}
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
function orgAuthHeaderName(token) {
|
|
251
|
+
return token.startsWith("gr_sess_") ? "X-Org-Session" : "X-Org-Token";
|
|
252
|
+
}
|
|
253
|
+
function setOrgAuthHeader(headers, token) {
|
|
254
|
+
if (!token) return;
|
|
255
|
+
headers.set(orgAuthHeaderName(token), token);
|
|
256
|
+
}
|
|
234
257
|
var BaseApiClient = class {
|
|
235
258
|
baseUrl;
|
|
236
259
|
apiKey;
|
|
@@ -241,15 +264,15 @@ var BaseApiClient = class {
|
|
|
241
264
|
orgAuthHandler;
|
|
242
265
|
orgAuthInProgress = null;
|
|
243
266
|
actingMemberUuid;
|
|
244
|
-
|
|
267
|
+
orgSession;
|
|
245
268
|
/**
|
|
246
|
-
* The org_uuid that issued the current
|
|
269
|
+
* The org_uuid that issued the current org auth credential. Tracked so we can detect
|
|
247
270
|
* a 401 challenge from a *different* org and re-fire the handler — the
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
271
|
+
* credential is opaque to the client, so without this the original guard
|
|
272
|
+
* `!this.orgSession` would prevent re-auth across orgs and surface as a silent
|
|
273
|
+
* 401 in multi-org CLI workflows.
|
|
251
274
|
*/
|
|
252
|
-
|
|
275
|
+
orgSessionOrgUuid;
|
|
253
276
|
constructor(apiKey, baseUrl, customFetch) {
|
|
254
277
|
this.baseUrl = baseUrl;
|
|
255
278
|
this.apiKey = apiKey;
|
|
@@ -296,18 +319,25 @@ var BaseApiClient = class {
|
|
|
296
319
|
return this.actingMemberUuid;
|
|
297
320
|
}
|
|
298
321
|
/**
|
|
299
|
-
* Set the org
|
|
300
|
-
*
|
|
301
|
-
*
|
|
322
|
+
* Set the opaque org session credential for cross-domain requests.
|
|
323
|
+
* Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still
|
|
324
|
+
* use X-Org-Token through setOrgToken() during the migration window.
|
|
302
325
|
*
|
|
303
|
-
* `orgUuid` is the org that issued the
|
|
304
|
-
* handler detect a stale
|
|
326
|
+
* `orgUuid` is the org that issued the credential; passing it lets the 401
|
|
327
|
+
* handler detect a stale session when a subsequent request targets a
|
|
305
328
|
* different org and re-fire the org-auth handler instead of silently
|
|
306
329
|
* 401-ing. Callers without that context (legacy / unknown) may omit it.
|
|
307
330
|
*/
|
|
331
|
+
setOrgSession(session, orgUuid) {
|
|
332
|
+
this.orgSession = session;
|
|
333
|
+
this.orgSessionOrgUuid = session ? orgUuid : void 0;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* @deprecated Legacy compatibility for stateless orgToken JWE credentials.
|
|
337
|
+
* Prefer setOrgSession() for opaque org browser sessions.
|
|
338
|
+
*/
|
|
308
339
|
setOrgToken(token, orgUuid) {
|
|
309
|
-
this.
|
|
310
|
-
this.orgTokenOrgUuid = token ? orgUuid : void 0;
|
|
340
|
+
this.setOrgSession(token, orgUuid);
|
|
311
341
|
}
|
|
312
342
|
async fetch(endpoint, options) {
|
|
313
343
|
try {
|
|
@@ -328,9 +358,7 @@ var BaseApiClient = class {
|
|
|
328
358
|
if (this.actingMemberUuid) {
|
|
329
359
|
headers.set("X-Acting-Member", this.actingMemberUuid);
|
|
330
360
|
}
|
|
331
|
-
|
|
332
|
-
headers.set("X-Org-Token", this.orgToken);
|
|
333
|
-
}
|
|
361
|
+
setOrgAuthHeader(headers, this.orgSession);
|
|
334
362
|
const fullUrl = `${this.baseUrl}/api/v2/${endpoint}`;
|
|
335
363
|
const response = await this.fetchFunction(fullUrl, {
|
|
336
364
|
...options,
|
|
@@ -354,31 +382,28 @@ var BaseApiClient = class {
|
|
|
354
382
|
try {
|
|
355
383
|
return await this.fetch(endpoint, options);
|
|
356
384
|
} catch (retryError) {
|
|
357
|
-
this.
|
|
358
|
-
this.
|
|
385
|
+
this.orgSession = void 0;
|
|
386
|
+
this.orgSessionOrgUuid = void 0;
|
|
359
387
|
throw retryError;
|
|
360
388
|
}
|
|
361
389
|
}
|
|
362
390
|
if (response.status === 401) {
|
|
363
391
|
const orgAuthInfo = parseOrgAuthChallenge(response.headers.get("WWW-Authenticate"));
|
|
364
|
-
if (orgAuthInfo && this.
|
|
365
|
-
this.
|
|
366
|
-
this.
|
|
392
|
+
if (orgAuthInfo && this.orgSession && this.orgSessionOrgUuid && this.orgSessionOrgUuid !== orgAuthInfo.orgUuid) {
|
|
393
|
+
this.orgSession = void 0;
|
|
394
|
+
this.orgSessionOrgUuid = void 0;
|
|
367
395
|
}
|
|
368
|
-
if (orgAuthInfo && !this.
|
|
369
|
-
const requestCookieName = orgAuthInfo.cookieName
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
if (cachedOrgToken) {
|
|
375
|
-
this.orgToken = cachedOrgToken;
|
|
376
|
-
this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
|
|
396
|
+
if (orgAuthInfo && !this.orgSession) {
|
|
397
|
+
const requestCookieName = getRequestOrgCookieName(orgAuthInfo.cookieName);
|
|
398
|
+
const cachedOrgSession = requestCookieName ? getCookieValue(requestCookieName) : void 0;
|
|
399
|
+
if (cachedOrgSession) {
|
|
400
|
+
this.orgSession = cachedOrgSession;
|
|
401
|
+
this.orgSessionOrgUuid = orgAuthInfo.orgUuid;
|
|
377
402
|
try {
|
|
378
403
|
return await this.fetch(endpoint, options);
|
|
379
404
|
} catch (retryError) {
|
|
380
|
-
this.
|
|
381
|
-
this.
|
|
405
|
+
this.orgSession = void 0;
|
|
406
|
+
this.orgSessionOrgUuid = void 0;
|
|
382
407
|
throw retryError;
|
|
383
408
|
}
|
|
384
409
|
}
|
|
@@ -394,20 +419,20 @@ var BaseApiClient = class {
|
|
|
394
419
|
})();
|
|
395
420
|
}
|
|
396
421
|
await this.orgAuthInProgress;
|
|
397
|
-
const
|
|
398
|
-
if (!
|
|
422
|
+
const postHandlerSession = (requestCookieName ? getCookieValue(requestCookieName) : void 0) ?? this.orgSession;
|
|
423
|
+
if (!postHandlerSession) {
|
|
399
424
|
throw new ApiError(
|
|
400
|
-
"Organization authentication did not issue a
|
|
425
|
+
"Organization authentication did not issue a session",
|
|
401
426
|
401
|
|
402
427
|
);
|
|
403
428
|
}
|
|
404
|
-
this.
|
|
405
|
-
this.
|
|
429
|
+
this.orgSession = postHandlerSession;
|
|
430
|
+
this.orgSessionOrgUuid = orgAuthInfo.orgUuid;
|
|
406
431
|
try {
|
|
407
432
|
return await this.fetch(endpoint, options);
|
|
408
433
|
} catch (retryError) {
|
|
409
|
-
this.
|
|
410
|
-
this.
|
|
434
|
+
this.orgSession = void 0;
|
|
435
|
+
this.orgSessionOrgUuid = void 0;
|
|
411
436
|
throw retryError;
|
|
412
437
|
}
|
|
413
438
|
}
|
|
@@ -482,9 +507,7 @@ ${formattedErrors}`, response.status);
|
|
|
482
507
|
if (this.actingMemberUuid) {
|
|
483
508
|
headers.set("X-Acting-Member", this.actingMemberUuid);
|
|
484
509
|
}
|
|
485
|
-
|
|
486
|
-
headers.set("X-Org-Token", this.orgToken);
|
|
487
|
-
}
|
|
510
|
+
setOrgAuthHeader(headers, this.orgSession);
|
|
488
511
|
const response = await this.fetchFunction(`${this.baseUrl}/api/v2/${endpoint}`, {
|
|
489
512
|
...options,
|
|
490
513
|
...this.apiKey ? {} : { credentials: "include" },
|
|
@@ -507,31 +530,28 @@ ${formattedErrors}`, response.status);
|
|
|
507
530
|
try {
|
|
508
531
|
return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
|
|
509
532
|
} catch (retryError) {
|
|
510
|
-
this.
|
|
511
|
-
this.
|
|
533
|
+
this.orgSession = void 0;
|
|
534
|
+
this.orgSessionOrgUuid = void 0;
|
|
512
535
|
throw retryError;
|
|
513
536
|
}
|
|
514
537
|
}
|
|
515
538
|
if (response.status === 401) {
|
|
516
539
|
const orgAuthInfo = parseOrgAuthChallenge(response.headers.get("WWW-Authenticate"));
|
|
517
|
-
if (orgAuthInfo && this.
|
|
518
|
-
this.
|
|
519
|
-
this.
|
|
540
|
+
if (orgAuthInfo && this.orgSession && this.orgSessionOrgUuid && this.orgSessionOrgUuid !== orgAuthInfo.orgUuid) {
|
|
541
|
+
this.orgSession = void 0;
|
|
542
|
+
this.orgSessionOrgUuid = void 0;
|
|
520
543
|
}
|
|
521
|
-
if (orgAuthInfo && !this.
|
|
522
|
-
const requestCookieName = orgAuthInfo.cookieName
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
if (cachedOrgToken) {
|
|
528
|
-
this.orgToken = cachedOrgToken;
|
|
529
|
-
this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
|
|
544
|
+
if (orgAuthInfo && !this.orgSession) {
|
|
545
|
+
const requestCookieName = getRequestOrgCookieName(orgAuthInfo.cookieName);
|
|
546
|
+
const cachedOrgSession = requestCookieName ? getCookieValue(requestCookieName) : void 0;
|
|
547
|
+
if (cachedOrgSession) {
|
|
548
|
+
this.orgSession = cachedOrgSession;
|
|
549
|
+
this.orgSessionOrgUuid = orgAuthInfo.orgUuid;
|
|
530
550
|
try {
|
|
531
551
|
return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
|
|
532
552
|
} catch (retryError) {
|
|
533
|
-
this.
|
|
534
|
-
this.
|
|
553
|
+
this.orgSession = void 0;
|
|
554
|
+
this.orgSessionOrgUuid = void 0;
|
|
535
555
|
throw retryError;
|
|
536
556
|
}
|
|
537
557
|
}
|
|
@@ -547,20 +567,20 @@ ${formattedErrors}`, response.status);
|
|
|
547
567
|
})();
|
|
548
568
|
}
|
|
549
569
|
await this.orgAuthInProgress;
|
|
550
|
-
const
|
|
551
|
-
if (!
|
|
570
|
+
const postHandlerSession = (requestCookieName ? getCookieValue(requestCookieName) : void 0) ?? this.orgSession;
|
|
571
|
+
if (!postHandlerSession) {
|
|
552
572
|
throw new ApiError(
|
|
553
|
-
"Organization authentication did not issue a
|
|
573
|
+
"Organization authentication did not issue a session",
|
|
554
574
|
401
|
|
555
575
|
);
|
|
556
576
|
}
|
|
557
|
-
this.
|
|
558
|
-
this.
|
|
577
|
+
this.orgSession = postHandlerSession;
|
|
578
|
+
this.orgSessionOrgUuid = orgAuthInfo.orgUuid;
|
|
559
579
|
try {
|
|
560
580
|
return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
|
|
561
581
|
} catch (retryError) {
|
|
562
|
-
this.
|
|
563
|
-
this.
|
|
582
|
+
this.orgSession = void 0;
|
|
583
|
+
this.orgSessionOrgUuid = void 0;
|
|
564
584
|
throw retryError;
|
|
565
585
|
}
|
|
566
586
|
}
|
|
@@ -599,9 +619,7 @@ ${formattedErrors}`, response.status);
|
|
|
599
619
|
if (this.actingMemberUuid) {
|
|
600
620
|
headers.set("X-Acting-Member", this.actingMemberUuid);
|
|
601
621
|
}
|
|
602
|
-
|
|
603
|
-
headers.set("X-Org-Token", this.orgToken);
|
|
604
|
-
}
|
|
622
|
+
setOrgAuthHeader(headers, this.orgSession);
|
|
605
623
|
const fullUrl = `${this.baseUrl}/${path}`;
|
|
606
624
|
const response = await this.fetchFunction(fullUrl, {
|
|
607
625
|
...options,
|
|
@@ -1310,15 +1328,11 @@ var AuthApi = class extends BaseApiClient {
|
|
|
1310
1328
|
body: JSON.stringify({ email, organizationUuid, redirectUrl })
|
|
1311
1329
|
});
|
|
1312
1330
|
}
|
|
1313
|
-
/** Validate a magic link token
|
|
1314
|
-
async validateMagicLink(token
|
|
1315
|
-
const body = { token };
|
|
1316
|
-
if (otp) {
|
|
1317
|
-
body.otp = otp;
|
|
1318
|
-
}
|
|
1331
|
+
/** Validate a magic link token to complete authentication. */
|
|
1332
|
+
async validateMagicLink(token) {
|
|
1319
1333
|
return await this.fetch(`auth/validate-magic-link`, {
|
|
1320
1334
|
method: "POST",
|
|
1321
|
-
body: JSON.stringify(
|
|
1335
|
+
body: JSON.stringify({ token })
|
|
1322
1336
|
});
|
|
1323
1337
|
}
|
|
1324
1338
|
// ===== EMAIL VERIFICATION METHODS =====
|
|
@@ -1824,6 +1838,26 @@ var CallsApi = class extends BaseApiClient {
|
|
|
1824
1838
|
async getMessageTiming(wid, chatId) {
|
|
1825
1839
|
return this.fetch(`w/${wid}/recordings/chat/${chatId}/message-timing`);
|
|
1826
1840
|
}
|
|
1841
|
+
/** List the recorded audio chunks for a chat (metadata only). */
|
|
1842
|
+
async listChatRecordings(wid, chatId, options = {}) {
|
|
1843
|
+
const params = new URLSearchParams();
|
|
1844
|
+
if (options.role) params.set("role", options.role);
|
|
1845
|
+
return this.fetch(
|
|
1846
|
+
`w/${wid}/recordings/chat/${chatId}${params.toString() ? `?${params.toString()}` : ""}`
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Get a single short-lived presigned URL to download the complete call
|
|
1851
|
+
* recording as one WAV file. The first request assembles + caches the
|
|
1852
|
+
* full-call WAV; later requests reuse it.
|
|
1853
|
+
*/
|
|
1854
|
+
async getCallRecordingDownloadUrl(wid, chatId, options = {}) {
|
|
1855
|
+
const params = new URLSearchParams();
|
|
1856
|
+
if (options.expiresIn !== void 0) params.set("expires_in", String(options.expiresIn));
|
|
1857
|
+
return this.fetch(
|
|
1858
|
+
`w/${wid}/recordings/chat/${chatId}/download-url${params.toString() ? `?${params.toString()}` : ""}`
|
|
1859
|
+
);
|
|
1860
|
+
}
|
|
1827
1861
|
};
|
|
1828
1862
|
|
|
1829
1863
|
// src/api/cel.ts
|
|
@@ -1908,6 +1942,17 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
1908
1942
|
async getChatTokenUsage(wid, chatId) {
|
|
1909
1943
|
return this.fetch(`w/${wid}/chats/${chatId}/token-usage`);
|
|
1910
1944
|
}
|
|
1945
|
+
/** List scheduled callbacks for a chat (newest first). */
|
|
1946
|
+
async getChatCallbacks(wid, chatId) {
|
|
1947
|
+
return this.fetch(`w/${wid}/chats/${chatId}/callbacks`);
|
|
1948
|
+
}
|
|
1949
|
+
/** Cancel a pending scheduled callback on a chat. */
|
|
1950
|
+
async cancelChatCallback(wid, chatId, callbackId) {
|
|
1951
|
+
return this.fetch(
|
|
1952
|
+
`w/${wid}/chats/${chatId}/callbacks/${callbackId}/cancel`,
|
|
1953
|
+
{ method: "POST" }
|
|
1954
|
+
);
|
|
1955
|
+
}
|
|
1911
1956
|
/** Get todo items extracted from a chat. */
|
|
1912
1957
|
async getChatTodos(wid, chatId) {
|
|
1913
1958
|
return this.fetch(`w/${wid}/chats/${chatId}/todos`);
|
|
@@ -1946,9 +1991,11 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
1946
1991
|
}
|
|
1947
1992
|
/** Create a new chat. */
|
|
1948
1993
|
async createChat(wid, chat) {
|
|
1994
|
+
const { agentMemberId, ...rest } = chat;
|
|
1995
|
+
const payload = agentMemberId !== void 0 && rest.assistantMemberId === void 0 ? { ...rest, assistantMemberId: agentMemberId } : rest;
|
|
1949
1996
|
return this.fetch(`w/${wid}/chats`, {
|
|
1950
1997
|
method: "POST",
|
|
1951
|
-
body: JSON.stringify(
|
|
1998
|
+
body: JSON.stringify(payload)
|
|
1952
1999
|
});
|
|
1953
2000
|
}
|
|
1954
2001
|
/**
|
|
@@ -2011,7 +2058,8 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
2011
2058
|
}
|
|
2012
2059
|
);
|
|
2013
2060
|
}
|
|
2014
|
-
/** List messages in a chat with optional pagination.
|
|
2061
|
+
/** List messages in a chat with optional pagination.
|
|
2062
|
+
* ``id`` is the numeric chat id (documented) or the chat uuid (accepted). */
|
|
2015
2063
|
async getChatMessages(wid, id, limit, offset) {
|
|
2016
2064
|
const params = new URLSearchParams();
|
|
2017
2065
|
if (limit) params.append("limit", limit.toString());
|
|
@@ -2391,6 +2439,7 @@ var DataTypesApi = class extends BaseApiClient {
|
|
|
2391
2439
|
async getDataRecords(wid, dataTypeId, options) {
|
|
2392
2440
|
const params = new URLSearchParams();
|
|
2393
2441
|
if (options?.memberId !== void 0) params.append("member_id", options.memberId.toString());
|
|
2442
|
+
if (options?.memberIds?.length) params.append("member_ids", options.memberIds.join(","));
|
|
2394
2443
|
if (options?.search) params.append("search", options.search);
|
|
2395
2444
|
if (options?.searchField) params.append("search_field", options.searchField);
|
|
2396
2445
|
if (options?.page) params.append("page", options.page.toString());
|
|
@@ -2795,6 +2844,13 @@ var EventsApi = class extends BaseApiClient {
|
|
|
2795
2844
|
method: "DELETE"
|
|
2796
2845
|
});
|
|
2797
2846
|
}
|
|
2847
|
+
/** Send a one-off test webhook for an existing webhook event rule. */
|
|
2848
|
+
async testWebhook(wid, id, request) {
|
|
2849
|
+
return this.fetch(`w/${wid}/event-rules/${id}/test-webhook`, {
|
|
2850
|
+
method: "POST",
|
|
2851
|
+
body: JSON.stringify(request)
|
|
2852
|
+
});
|
|
2853
|
+
}
|
|
2798
2854
|
/** Reorder event rules by specifying the desired rule ID sequence. */
|
|
2799
2855
|
async reorderEventRules(wid, ruleIds) {
|
|
2800
2856
|
return this.fetch(`w/${wid}/event-rules/reorder`, {
|
|
@@ -3272,6 +3328,25 @@ var FhirConnectionsApi = class extends BaseApiClient {
|
|
|
3272
3328
|
}
|
|
3273
3329
|
};
|
|
3274
3330
|
|
|
3331
|
+
// src/api/patientsync-connections.ts
|
|
3332
|
+
var PatientSyncConnectionsApi = class extends BaseApiClient {
|
|
3333
|
+
/** Create or update the workspace's PatientSync connection (singleton). */
|
|
3334
|
+
async configurePatientSync(wid, data) {
|
|
3335
|
+
return this.fetch(
|
|
3336
|
+
`w/${wid}/app-connections/patientsync/configure`,
|
|
3337
|
+
{ method: "POST", body: JSON.stringify(data) }
|
|
3338
|
+
);
|
|
3339
|
+
}
|
|
3340
|
+
/** Read the PatientSync connection status (never returns the API key). */
|
|
3341
|
+
async getPatientSyncStatus(wid) {
|
|
3342
|
+
return this.fetch(`w/${wid}/app-connections/patientsync/status`);
|
|
3343
|
+
}
|
|
3344
|
+
/** Delete the workspace's PatientSync connection. */
|
|
3345
|
+
async deletePatientSyncConnection(wid) {
|
|
3346
|
+
return this.fetch(`w/${wid}/app-connections/patientsync/`, { method: "DELETE" });
|
|
3347
|
+
}
|
|
3348
|
+
};
|
|
3349
|
+
|
|
3275
3350
|
// src/api/healthie.ts
|
|
3276
3351
|
var HealthieApi = class extends BaseApiClient {
|
|
3277
3352
|
async configureHealthie(wid, data) {
|
|
@@ -3392,6 +3467,18 @@ var FilesApi = class extends BaseApiClient {
|
|
|
3392
3467
|
async getFile(wid, id) {
|
|
3393
3468
|
return this.fetch(`w/${wid}/files/${id}`);
|
|
3394
3469
|
}
|
|
3470
|
+
/**
|
|
3471
|
+
* Download the given files + folders (folders recursively) as a single ZIP.
|
|
3472
|
+
* Returns the raw archive bytes for the caller to save.
|
|
3473
|
+
*/
|
|
3474
|
+
async downloadFilesZip(wid, fileIds, folderIds) {
|
|
3475
|
+
const response = await this.fetchRaw(`w/${wid}/files/download/zip`, {
|
|
3476
|
+
method: "POST",
|
|
3477
|
+
headers: { "Content-Type": "application/json" },
|
|
3478
|
+
body: JSON.stringify({ file_ids: fileIds, folder_ids: folderIds })
|
|
3479
|
+
});
|
|
3480
|
+
return response.blob();
|
|
3481
|
+
}
|
|
3395
3482
|
/** Create a new file record in the workspace. */
|
|
3396
3483
|
async createFile(wid, file) {
|
|
3397
3484
|
return this.fetch(`w/${wid}/files`, {
|
|
@@ -4008,6 +4095,31 @@ var McpServersApi = class extends BaseApiClient {
|
|
|
4008
4095
|
};
|
|
4009
4096
|
|
|
4010
4097
|
// src/api/members.ts
|
|
4098
|
+
var MemberImportValidationError = class extends Error {
|
|
4099
|
+
validationErrors;
|
|
4100
|
+
constructor(message, validationErrors) {
|
|
4101
|
+
super(message);
|
|
4102
|
+
this.name = "MemberImportValidationError";
|
|
4103
|
+
this.validationErrors = validationErrors;
|
|
4104
|
+
}
|
|
4105
|
+
};
|
|
4106
|
+
function throwMemberImportError(errorBody, fallback) {
|
|
4107
|
+
let detail = errorBody?.detail;
|
|
4108
|
+
if (typeof detail === "string") {
|
|
4109
|
+
try {
|
|
4110
|
+
const parsed = JSON.parse(detail);
|
|
4111
|
+
if (parsed && typeof parsed === "object") detail = parsed;
|
|
4112
|
+
} catch {
|
|
4113
|
+
}
|
|
4114
|
+
}
|
|
4115
|
+
if (detail && typeof detail === "object") {
|
|
4116
|
+
const { message, errors } = detail;
|
|
4117
|
+
if (Array.isArray(errors)) {
|
|
4118
|
+
throw new MemberImportValidationError(message || fallback, errors);
|
|
4119
|
+
}
|
|
4120
|
+
}
|
|
4121
|
+
throw new Error(typeof detail === "string" ? detail : fallback);
|
|
4122
|
+
}
|
|
4011
4123
|
var MembersApi = class extends BaseApiClient {
|
|
4012
4124
|
/** Get the currently authenticated member for a workspace. */
|
|
4013
4125
|
async getCurrentMember(wid) {
|
|
@@ -4048,8 +4160,10 @@ var MembersApi = class extends BaseApiClient {
|
|
|
4048
4160
|
});
|
|
4049
4161
|
}
|
|
4050
4162
|
/** List workspace members with pagination, filtering, and sorting. */
|
|
4051
|
-
async getWorkspaceMembers(wid, page = 1, pageSize = 10, filters, search, role, sortBy, sortOrder, memberType, isArchived = false, isManager, memberTypes, hasAccount, excludeIds) {
|
|
4163
|
+
async getWorkspaceMembers(wid, page = 1, pageSize = 10, filters, search, role, sortBy, sortOrder, memberType, isArchived = false, isManager, memberTypes, hasAccount, excludeIds, memberFilterId, query) {
|
|
4052
4164
|
const params = new URLSearchParams();
|
|
4165
|
+
if (memberFilterId != null) params.append("memberFilterId", memberFilterId.toString());
|
|
4166
|
+
if (query != null) params.append("query", JSON.stringify(query));
|
|
4053
4167
|
if (page) params.append("page", page.toString());
|
|
4054
4168
|
if (pageSize) params.append("pageSize", pageSize.toString());
|
|
4055
4169
|
if (sortBy) params.append("sortBy", sortBy);
|
|
@@ -4122,6 +4236,17 @@ var MembersApi = class extends BaseApiClient {
|
|
|
4122
4236
|
method: "POST"
|
|
4123
4237
|
});
|
|
4124
4238
|
}
|
|
4239
|
+
/**
|
|
4240
|
+
* Send the member an SMS asking them to confirm their phone number. When they
|
|
4241
|
+
* reply, a trusted phone auth binding is created so they can use SMS as
|
|
4242
|
+
* themselves without an account (member-attested alternative to the
|
|
4243
|
+
* members:admin "Trusted" override).
|
|
4244
|
+
*/
|
|
4245
|
+
async sendMemberPhoneConfirmation(wid, memberId) {
|
|
4246
|
+
return this.fetch(`w/${wid}/members/${memberId}/phone-confirmation`, {
|
|
4247
|
+
method: "POST"
|
|
4248
|
+
});
|
|
4249
|
+
}
|
|
4125
4250
|
// Member Filter APIs
|
|
4126
4251
|
/** List all saved member filters for a workspace. */
|
|
4127
4252
|
async getMemberFilters(wid) {
|
|
@@ -4145,6 +4270,22 @@ var MembersApi = class extends BaseApiClient {
|
|
|
4145
4270
|
body: JSON.stringify(data)
|
|
4146
4271
|
});
|
|
4147
4272
|
}
|
|
4273
|
+
/**
|
|
4274
|
+
* Convert a legacy rules filter to a query-engine predicate. One-way and
|
|
4275
|
+
* transactional: on success the filter's legacy rules are gone and
|
|
4276
|
+
* `query` holds the equivalent IR predicate. 409 if already query-format;
|
|
4277
|
+
* 422 when rules have no engine equivalent.
|
|
4278
|
+
*
|
|
4279
|
+
* With `dryRun: true` the same validation runs but nothing persists: the
|
|
4280
|
+
* response previews the normalized predicate in `query` while `rules`
|
|
4281
|
+
* stay intact on the filter.
|
|
4282
|
+
*/
|
|
4283
|
+
async convertMemberFilterToQuery(wid, filterId, opts) {
|
|
4284
|
+
const suffix = opts?.dryRun ? "?dryRun=true" : "";
|
|
4285
|
+
return this.fetch(`w/${wid}/member-filters/${filterId}/convert${suffix}`, {
|
|
4286
|
+
method: "PUT"
|
|
4287
|
+
});
|
|
4288
|
+
}
|
|
4148
4289
|
/** Delete a saved member filter. */
|
|
4149
4290
|
async deleteMemberFilter(wid, filterId) {
|
|
4150
4291
|
return this.fetch(`w/${wid}/member-filters/${filterId}`, {
|
|
@@ -4222,48 +4363,98 @@ var MembersApi = class extends BaseApiClient {
|
|
|
4222
4363
|
});
|
|
4223
4364
|
}
|
|
4224
4365
|
// Import/Export Members API
|
|
4225
|
-
/**
|
|
4226
|
-
|
|
4366
|
+
/**
|
|
4367
|
+
* Read-only preview classifying each CSV row before any write (GRA-5545).
|
|
4368
|
+
*
|
|
4369
|
+
* Returns create/update/unchanged/conflict/error counts. For phone-only
|
|
4370
|
+
* identity conflicts it also returns existing vs incoming identity so the
|
|
4371
|
+
* operator can decide whether to skip or explicitly overwrite before
|
|
4372
|
+
* committing. Requires MEMBERS_ADMIN and is bulk-PHI audited server-side.
|
|
4373
|
+
*/
|
|
4374
|
+
async previewImportMembers(wid, file, newMemberRoleId, options) {
|
|
4227
4375
|
const formData = new FormData();
|
|
4228
4376
|
formData.append("file", file);
|
|
4229
4377
|
const params = new URLSearchParams();
|
|
4230
4378
|
params.append("new_member_role_id", newMemberRoleId.toString());
|
|
4231
|
-
|
|
4232
|
-
|
|
4379
|
+
if (options?.trustEmailAddresses) {
|
|
4380
|
+
params.append("trust_email_addresses", "true");
|
|
4381
|
+
}
|
|
4382
|
+
if (options?.trustPhoneNumbers) {
|
|
4383
|
+
params.append("trust_phone_numbers", "true");
|
|
4384
|
+
}
|
|
4385
|
+
const response = await this.fetchRaw(
|
|
4386
|
+
`w/${wid}/members/import/preview?${params.toString()}`,
|
|
4233
4387
|
{
|
|
4234
4388
|
method: "POST",
|
|
4235
|
-
body: formData
|
|
4236
|
-
|
|
4237
|
-
|
|
4389
|
+
body: formData
|
|
4390
|
+
},
|
|
4391
|
+
[400, 413]
|
|
4238
4392
|
);
|
|
4239
4393
|
if (!response.ok) {
|
|
4240
|
-
const error = await response.json();
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4394
|
+
const error = await response.json().catch(() => ({}));
|
|
4395
|
+
throwMemberImportError(error, "Import preview failed");
|
|
4396
|
+
}
|
|
4397
|
+
return response.json();
|
|
4398
|
+
}
|
|
4399
|
+
/**
|
|
4400
|
+
* Import members from a CSV file, streaming progress updates via callback.
|
|
4401
|
+
*
|
|
4402
|
+
* ``identityConflictPolicy`` (default 'skip') controls how a row matching an
|
|
4403
|
+
* existing member ONLY by phone with different identity fields is handled.
|
|
4404
|
+
* Send 'overwrite_identity_fields' only after the operator confirms a preview.
|
|
4405
|
+
*/
|
|
4406
|
+
async importMembers(wid, file, newMemberRoleId, onProgress, options) {
|
|
4407
|
+
const formData = new FormData();
|
|
4408
|
+
formData.append("file", file);
|
|
4409
|
+
const params = new URLSearchParams();
|
|
4410
|
+
params.append("new_member_role_id", newMemberRoleId.toString());
|
|
4411
|
+
if (options?.trustEmailAddresses) {
|
|
4412
|
+
params.append("trust_email_addresses", "true");
|
|
4413
|
+
}
|
|
4414
|
+
if (options?.trustPhoneNumbers) {
|
|
4415
|
+
params.append("trust_phone_numbers", "true");
|
|
4416
|
+
}
|
|
4417
|
+
if (options?.identityConflictPolicy) {
|
|
4418
|
+
params.append("identity_conflict_policy", options.identityConflictPolicy);
|
|
4419
|
+
}
|
|
4420
|
+
const response = await this.fetchRaw(
|
|
4421
|
+
`w/${wid}/members/import?${params.toString()}`,
|
|
4422
|
+
{
|
|
4423
|
+
method: "POST",
|
|
4424
|
+
body: formData
|
|
4425
|
+
},
|
|
4426
|
+
[400, 413]
|
|
4427
|
+
);
|
|
4428
|
+
if (!response.ok) {
|
|
4429
|
+
const error = await response.json().catch(() => ({}));
|
|
4430
|
+
throwMemberImportError(error, "Import failed");
|
|
4250
4431
|
}
|
|
4251
4432
|
if (onProgress && response.body) {
|
|
4252
4433
|
const reader = response.body.getReader();
|
|
4253
4434
|
const decoder = new TextDecoder();
|
|
4435
|
+
let buffer = "";
|
|
4254
4436
|
while (true) {
|
|
4255
4437
|
const { done, value } = await reader.read();
|
|
4256
4438
|
if (done) break;
|
|
4257
|
-
|
|
4258
|
-
const lines =
|
|
4439
|
+
buffer += decoder.decode(value, { stream: true });
|
|
4440
|
+
const lines = buffer.split("\n");
|
|
4441
|
+
buffer = lines.pop() ?? "";
|
|
4259
4442
|
for (const line of lines) {
|
|
4443
|
+
const trimmed = line.trim();
|
|
4444
|
+
if (!trimmed) continue;
|
|
4260
4445
|
try {
|
|
4261
|
-
|
|
4262
|
-
onProgress(progress);
|
|
4446
|
+
onProgress(JSON.parse(trimmed));
|
|
4263
4447
|
} catch {
|
|
4264
4448
|
}
|
|
4265
4449
|
}
|
|
4266
4450
|
}
|
|
4451
|
+
const tail = buffer.trim();
|
|
4452
|
+
if (tail) {
|
|
4453
|
+
try {
|
|
4454
|
+
onProgress(JSON.parse(tail));
|
|
4455
|
+
} catch {
|
|
4456
|
+
}
|
|
4457
|
+
}
|
|
4267
4458
|
}
|
|
4268
4459
|
return { success: true };
|
|
4269
4460
|
}
|
|
@@ -4455,6 +4646,17 @@ var MembersApi = class extends BaseApiClient {
|
|
|
4455
4646
|
{ method: "DELETE" }
|
|
4456
4647
|
);
|
|
4457
4648
|
}
|
|
4649
|
+
/** Bulk-create members in a workspace. */
|
|
4650
|
+
async bulkCreateMembers(wid, request) {
|
|
4651
|
+
return this.fetch(`w/${wid}/members/bulk`, {
|
|
4652
|
+
method: "POST",
|
|
4653
|
+
body: JSON.stringify(request)
|
|
4654
|
+
});
|
|
4655
|
+
}
|
|
4656
|
+
/** Get all sync links for a member across app connections. */
|
|
4657
|
+
async getMemberSyncLinks(wid, memberId) {
|
|
4658
|
+
return this.fetch(`w/${wid}/members/${memberId}/sync-links`);
|
|
4659
|
+
}
|
|
4458
4660
|
};
|
|
4459
4661
|
|
|
4460
4662
|
// src/api/milestones.ts
|
|
@@ -4951,6 +5153,7 @@ var OrgApi = class extends BaseApiClient {
|
|
|
4951
5153
|
*/
|
|
4952
5154
|
async searchPhoneNumbers(orgUuid, params) {
|
|
4953
5155
|
const query = new URLSearchParams();
|
|
5156
|
+
if (params?.country) query.set("country", params.country);
|
|
4954
5157
|
if (params?.numberType) query.set("number_type", params.numberType);
|
|
4955
5158
|
if (params?.areaCode) query.set("area_code", params.areaCode);
|
|
4956
5159
|
if (params?.contains) query.set("contains", params.contains);
|
|
@@ -4962,11 +5165,20 @@ var OrgApi = class extends BaseApiClient {
|
|
|
4962
5165
|
}
|
|
4963
5166
|
/**
|
|
4964
5167
|
* Purchase a phone number from Twilio for this org inventory (org admin only).
|
|
5168
|
+
*
|
|
5169
|
+
* Numbers in regulated countries (e.g. Australia) require a Twilio regulatory
|
|
5170
|
+
* bundle and an address — pass `bundleSid` and `addressSid` for those.
|
|
4965
5171
|
*/
|
|
4966
|
-
async purchasePhoneNumber(orgUuid, phoneNumber, numberType) {
|
|
5172
|
+
async purchasePhoneNumber(orgUuid, phoneNumber, numberType, opts) {
|
|
4967
5173
|
return this.fetch(`o/${orgUuid}/phone-numbers/purchase`, {
|
|
4968
5174
|
method: "POST",
|
|
4969
|
-
body: JSON.stringify({
|
|
5175
|
+
body: JSON.stringify({
|
|
5176
|
+
phoneNumber,
|
|
5177
|
+
numberType,
|
|
5178
|
+
country: opts?.country,
|
|
5179
|
+
bundleSid: opts?.bundleSid,
|
|
5180
|
+
addressSid: opts?.addressSid
|
|
5181
|
+
})
|
|
4970
5182
|
});
|
|
4971
5183
|
}
|
|
4972
5184
|
/**
|
|
@@ -5174,6 +5386,90 @@ var OrgApi = class extends BaseApiClient {
|
|
|
5174
5386
|
method: "POST"
|
|
5175
5387
|
});
|
|
5176
5388
|
}
|
|
5389
|
+
/**
|
|
5390
|
+
* List the org's A2P brands (broker resources). The SMS-consent editor uses
|
|
5391
|
+
* this to pick which brand's consent config to edit.
|
|
5392
|
+
*/
|
|
5393
|
+
async listA2PBrands(orgUuid) {
|
|
5394
|
+
return this.fetch(`o/${orgUuid}/a2p-brands`);
|
|
5395
|
+
}
|
|
5396
|
+
/**
|
|
5397
|
+
* Fetch a brand's resolved A2P campaign config. The response carries both the
|
|
5398
|
+
* raw `overrides` and the `resolved` payload (defaults + overrides) the editor
|
|
5399
|
+
* previews — including the canonical SMS consent text.
|
|
5400
|
+
*/
|
|
5401
|
+
async getA2PCampaignConfig(orgUuid, brandUuid) {
|
|
5402
|
+
return this.fetch(
|
|
5403
|
+
`o/${orgUuid}/a2p-brands/${brandUuid}/campaign-config`
|
|
5404
|
+
);
|
|
5405
|
+
}
|
|
5406
|
+
/**
|
|
5407
|
+
* Partial-update a brand's A2P campaign config. Returns the freshly resolved
|
|
5408
|
+
* config so the editor's live preview updates without a second round-trip.
|
|
5409
|
+
*/
|
|
5410
|
+
async updateA2PCampaignConfig(orgUuid, brandUuid, data) {
|
|
5411
|
+
return this.fetch(
|
|
5412
|
+
`o/${orgUuid}/a2p-brands/${brandUuid}/campaign-config`,
|
|
5413
|
+
{
|
|
5414
|
+
method: "PUT",
|
|
5415
|
+
body: JSON.stringify(data)
|
|
5416
|
+
}
|
|
5417
|
+
);
|
|
5418
|
+
}
|
|
5419
|
+
/**
|
|
5420
|
+
* Published Sites across the org's workspaces that can be linked as this
|
|
5421
|
+
* brand's enrollment (opt-in) surface. Org-authorized, so it works even when
|
|
5422
|
+
* the admin isn't a member of the workspace holding the Site.
|
|
5423
|
+
*/
|
|
5424
|
+
async listA2PEnrollmentSiteCandidates(orgUuid, brandUuid) {
|
|
5425
|
+
return this.fetch(
|
|
5426
|
+
`o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site/candidates`
|
|
5427
|
+
);
|
|
5428
|
+
}
|
|
5429
|
+
/**
|
|
5430
|
+
* Link the brand to a published enrollment Site (sets `site_uuid`). Returns
|
|
5431
|
+
* the refreshed campaign config so the editor's link state updates inline.
|
|
5432
|
+
*/
|
|
5433
|
+
async linkA2PEnrollmentSite(orgUuid, brandUuid, data) {
|
|
5434
|
+
return this.fetch(
|
|
5435
|
+
`o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site`,
|
|
5436
|
+
{
|
|
5437
|
+
method: "PUT",
|
|
5438
|
+
body: JSON.stringify(data)
|
|
5439
|
+
}
|
|
5440
|
+
);
|
|
5441
|
+
}
|
|
5442
|
+
/**
|
|
5443
|
+
* Provision (or reuse) a patient-enrollment Site for the brand and link it —
|
|
5444
|
+
* the one-click path behind the SMS Consent tab. `workspaceUuid` is required
|
|
5445
|
+
* only when the org has multiple workspaces. Returns the refreshed campaign
|
|
5446
|
+
* config so the editor's link state updates inline. Idempotent.
|
|
5447
|
+
*/
|
|
5448
|
+
async provisionA2PEnrollmentSite(orgUuid, brandUuid, data = {}) {
|
|
5449
|
+
return this.fetch(
|
|
5450
|
+
`o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site/provision`,
|
|
5451
|
+
{
|
|
5452
|
+
method: "POST",
|
|
5453
|
+
body: JSON.stringify(data)
|
|
5454
|
+
}
|
|
5455
|
+
);
|
|
5456
|
+
}
|
|
5457
|
+
/** Clear the brand's enrollment-site link. */
|
|
5458
|
+
async unlinkA2PEnrollmentSite(orgUuid, brandUuid) {
|
|
5459
|
+
return this.fetch(
|
|
5460
|
+
`o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site`,
|
|
5461
|
+
{ method: "DELETE" }
|
|
5462
|
+
);
|
|
5463
|
+
}
|
|
5464
|
+
/**
|
|
5465
|
+
* The brand-addressable enrollment form URL (carries `?brand=…`). Outreach
|
|
5466
|
+
* appends each patient's `external_id`. `url` is null until a Site is linked.
|
|
5467
|
+
*/
|
|
5468
|
+
async getA2PBrandEnrollmentUrl(orgUuid, brandUuid) {
|
|
5469
|
+
return this.fetch(
|
|
5470
|
+
`o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-url`
|
|
5471
|
+
);
|
|
5472
|
+
}
|
|
5177
5473
|
/**
|
|
5178
5474
|
* List available member roles for a workspace in the organization.
|
|
5179
5475
|
*/
|
|
@@ -5198,58 +5494,53 @@ var OrgApi = class extends BaseApiClient {
|
|
|
5198
5494
|
function getOAuthPath(providerSlug, action) {
|
|
5199
5495
|
if (providerSlug === "google_calendar") {
|
|
5200
5496
|
return `oauth/google/calendar/${action}`;
|
|
5201
|
-
}
|
|
5497
|
+
}
|
|
5498
|
+
if (providerSlug === "gmail") {
|
|
5202
5499
|
return `oauth/google/gmail/${action}`;
|
|
5203
|
-
} else {
|
|
5204
|
-
return `oauth/${providerSlug}/${action}`;
|
|
5205
5500
|
}
|
|
5501
|
+
if (providerSlug === "gdrive") {
|
|
5502
|
+
return `oauth/google/drive/${action}`;
|
|
5503
|
+
}
|
|
5504
|
+
return `oauth/${providerSlug}/${action}`;
|
|
5505
|
+
}
|
|
5506
|
+
function buildAuthorizeQuery(options) {
|
|
5507
|
+
if (!options) return "";
|
|
5508
|
+
const params = new URLSearchParams();
|
|
5509
|
+
if (options.credentialUuid) params.set("credentialUuid", options.credentialUuid);
|
|
5510
|
+
if (options.loginHint) params.set("loginHint", options.loginHint);
|
|
5511
|
+
if (options.redirect) params.set("redirect", options.redirect);
|
|
5512
|
+
const qs = params.toString();
|
|
5513
|
+
return qs ? `?${qs}` : "";
|
|
5206
5514
|
}
|
|
5207
5515
|
var OAuthConnectionsApi = class extends BaseApiClient {
|
|
5208
|
-
/**
|
|
5209
|
-
* Get the connection status for an OAuth provider
|
|
5210
|
-
*/
|
|
5211
5516
|
async getConnectionStatus(providerSlug) {
|
|
5212
5517
|
const path = getOAuthPath(providerSlug, "status");
|
|
5213
5518
|
return this.fetchRoot(path);
|
|
5214
5519
|
}
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
*/
|
|
5218
|
-
async getAuthorizationUrl(providerSlug) {
|
|
5219
|
-
const path = getOAuthPath(providerSlug, "authorize");
|
|
5520
|
+
async listAccounts(providerSlug) {
|
|
5521
|
+
const path = getOAuthPath(providerSlug, "accounts");
|
|
5220
5522
|
return this.fetchRoot(path);
|
|
5221
5523
|
}
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5524
|
+
async getAuthorizationUrl(providerSlug, options) {
|
|
5525
|
+
const path = getOAuthPath(providerSlug, "authorize") + buildAuthorizeQuery(options);
|
|
5526
|
+
return this.fetchRoot(path);
|
|
5527
|
+
}
|
|
5528
|
+
async disconnect(providerSlug, credentialUuid) {
|
|
5226
5529
|
const path = getOAuthPath(providerSlug, "disconnect");
|
|
5227
|
-
|
|
5530
|
+
const qs = credentialUuid ? `?credentialUuid=${encodeURIComponent(credentialUuid)}` : "";
|
|
5531
|
+
return this.fetchRoot(`${path}${qs}`, { method: "DELETE" });
|
|
5228
5532
|
}
|
|
5229
5533
|
};
|
|
5230
5534
|
var OAuthApi = class extends BaseApiClient {
|
|
5231
|
-
/**
|
|
5232
|
-
* Get all available OAuth/API key scopes with metadata.
|
|
5233
|
-
*
|
|
5234
|
-
* This returns the full scope definitions from the backend,
|
|
5235
|
-
* ensuring the UI always shows the correct scopes.
|
|
5236
|
-
*/
|
|
5237
5535
|
async getAvailableScopes() {
|
|
5238
5536
|
return this.fetch("oauth/scopes");
|
|
5239
5537
|
}
|
|
5240
|
-
/**
|
|
5241
|
-
* Create an authorization code for OAuth flow
|
|
5242
|
-
* This is called after the user approves the authorization request
|
|
5243
|
-
*/
|
|
5244
5538
|
async authorize(request) {
|
|
5245
5539
|
return this.fetch("oauth/authorize", {
|
|
5246
5540
|
method: "POST",
|
|
5247
5541
|
body: JSON.stringify(request)
|
|
5248
5542
|
});
|
|
5249
5543
|
}
|
|
5250
|
-
/**
|
|
5251
|
-
* Exchange authorization code for access token
|
|
5252
|
-
*/
|
|
5253
5544
|
async exchangeOAuthToken(request) {
|
|
5254
5545
|
const formData = new URLSearchParams();
|
|
5255
5546
|
formData.append("grant_type", request.grant_type);
|
|
@@ -5543,6 +5834,37 @@ var PersonasApi = class extends BaseApiClient {
|
|
|
5543
5834
|
}
|
|
5544
5835
|
};
|
|
5545
5836
|
|
|
5837
|
+
// src/api/queries.ts
|
|
5838
|
+
var QueriesApi = class extends BaseApiClient {
|
|
5839
|
+
/** Queryable namespace: native fields, operators per type, DataType record fields. */
|
|
5840
|
+
async getQueryFields(wid) {
|
|
5841
|
+
return this.fetch(`w/${wid}/queries/fields`, {
|
|
5842
|
+
method: "GET"
|
|
5843
|
+
});
|
|
5844
|
+
}
|
|
5845
|
+
/** Structure / field / access / cost validation without execution. */
|
|
5846
|
+
async validateQuery(wid, query) {
|
|
5847
|
+
return this.fetch(`w/${wid}/queries/validate`, {
|
|
5848
|
+
method: "POST",
|
|
5849
|
+
body: JSON.stringify({ query })
|
|
5850
|
+
});
|
|
5851
|
+
}
|
|
5852
|
+
/** Bounded sample run (limit capped server-side). */
|
|
5853
|
+
async previewQuery(wid, query, mode) {
|
|
5854
|
+
return this.fetch(`w/${wid}/queries/preview`, {
|
|
5855
|
+
method: "POST",
|
|
5856
|
+
body: JSON.stringify({ query, mode })
|
|
5857
|
+
});
|
|
5858
|
+
}
|
|
5859
|
+
/** Execute a query (rows / count / aggregate). */
|
|
5860
|
+
async runQuery(wid, query, mode) {
|
|
5861
|
+
return this.fetch(`w/${wid}/queries/run`, {
|
|
5862
|
+
method: "POST",
|
|
5863
|
+
body: JSON.stringify({ query, mode })
|
|
5864
|
+
});
|
|
5865
|
+
}
|
|
5866
|
+
};
|
|
5867
|
+
|
|
5546
5868
|
// src/api/qualifications.ts
|
|
5547
5869
|
var QualificationsApi = class extends BaseApiClient {
|
|
5548
5870
|
/** List qualifications in a workspace, paginated. */
|
|
@@ -5594,6 +5916,9 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
5594
5916
|
async listTestChatRuns(wid, workflowId, params) {
|
|
5595
5917
|
const query = new URLSearchParams();
|
|
5596
5918
|
if (params?.scenarioId !== void 0) query.set("scenarioId", String(params.scenarioId));
|
|
5919
|
+
if (params?.assistantChatModelId !== void 0) {
|
|
5920
|
+
query.set("assistantChatModelId", params.assistantChatModelId);
|
|
5921
|
+
}
|
|
5597
5922
|
if (params?.limit !== void 0) query.set("limit", String(params.limit));
|
|
5598
5923
|
const qs = query.toString() ? `?${query.toString()}` : "";
|
|
5599
5924
|
return this.fetch(
|
|
@@ -6028,6 +6353,112 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6028
6353
|
async getSite(wid, id) {
|
|
6029
6354
|
return this.fetch(`w/${wid}/sites/${id}`);
|
|
6030
6355
|
}
|
|
6356
|
+
/** Get a site's sharing settings. */
|
|
6357
|
+
async getSiteSharing(wid, siteId) {
|
|
6358
|
+
return this.fetch(`w/${wid}/sites/${siteId}/sharing`);
|
|
6359
|
+
}
|
|
6360
|
+
/** Update a site's sharing settings. */
|
|
6361
|
+
async updateSiteSharing(wid, siteId, data) {
|
|
6362
|
+
return this.fetch(`w/${wid}/sites/${siteId}/sharing`, {
|
|
6363
|
+
method: "PUT",
|
|
6364
|
+
body: JSON.stringify(data)
|
|
6365
|
+
});
|
|
6366
|
+
}
|
|
6367
|
+
/** Get a site's source tree. */
|
|
6368
|
+
async getSiteSource(wid, siteId) {
|
|
6369
|
+
return this.fetch(`w/${wid}/sites/${siteId}/source`);
|
|
6370
|
+
}
|
|
6371
|
+
/** Starter templates the caller may seed (superuser-only ones filtered server-side). */
|
|
6372
|
+
async getSiteSourceTemplates(wid, siteId) {
|
|
6373
|
+
return this.fetch(`w/${wid}/sites/${siteId}/source/templates`);
|
|
6374
|
+
}
|
|
6375
|
+
/** Create a site's source tree with starter files if it does not exist. */
|
|
6376
|
+
async createSiteSource(wid, siteId) {
|
|
6377
|
+
return this.fetch(`w/${wid}/sites/${siteId}/source`, {
|
|
6378
|
+
method: "POST"
|
|
6379
|
+
});
|
|
6380
|
+
}
|
|
6381
|
+
/** Build a site's source without publishing. */
|
|
6382
|
+
async buildSiteSource(wid, siteId) {
|
|
6383
|
+
return this.fetch(`w/${wid}/sites/${siteId}/source/build`, {
|
|
6384
|
+
method: "POST"
|
|
6385
|
+
});
|
|
6386
|
+
}
|
|
6387
|
+
/**
|
|
6388
|
+
* Build and publish a site's source. Optionally label the published version
|
|
6389
|
+
* with a `name` and `note`; both default to null (the UI then shows
|
|
6390
|
+
* "Version {version}").
|
|
6391
|
+
*/
|
|
6392
|
+
async publishSiteSource(wid, siteId, options) {
|
|
6393
|
+
return this.fetch(`w/${wid}/sites/${siteId}/source/publish`, {
|
|
6394
|
+
method: "POST",
|
|
6395
|
+
body: JSON.stringify({
|
|
6396
|
+
name: options?.name ?? null,
|
|
6397
|
+
note: options?.note ?? null
|
|
6398
|
+
})
|
|
6399
|
+
});
|
|
6400
|
+
}
|
|
6401
|
+
/**
|
|
6402
|
+
* Reset a site's source files: load a starter template and/or wipe existing
|
|
6403
|
+
* files. `template` selects which starter to seed when `loadDefaults` is set
|
|
6404
|
+
* (defaults to "hello-world"; "patient-enrollment" is the other built-in).
|
|
6405
|
+
*/
|
|
6406
|
+
async resetSiteSource(wid, siteId, options) {
|
|
6407
|
+
return this.fetch(`w/${wid}/sites/${siteId}/source/reset`, {
|
|
6408
|
+
method: "POST",
|
|
6409
|
+
body: JSON.stringify({
|
|
6410
|
+
load_defaults: options.loadDefaults,
|
|
6411
|
+
delete_existing: options.deleteExisting,
|
|
6412
|
+
...options.template ? { template: options.template } : {}
|
|
6413
|
+
})
|
|
6414
|
+
});
|
|
6415
|
+
}
|
|
6416
|
+
/**
|
|
6417
|
+
* Re-point the published release to a prior version from the history. A pure
|
|
6418
|
+
* pointer move (no rebuild); the other versions stay in the history.
|
|
6419
|
+
*/
|
|
6420
|
+
async rollbackSiteSource(wid, siteId, releaseUuid) {
|
|
6421
|
+
return this.fetch(`w/${wid}/sites/${siteId}/source/rollback`, {
|
|
6422
|
+
method: "POST",
|
|
6423
|
+
body: JSON.stringify({ release_uuid: releaseUuid })
|
|
6424
|
+
});
|
|
6425
|
+
}
|
|
6426
|
+
/**
|
|
6427
|
+
* Export the site's source tree as a ZIP archive (editor-gated server-side).
|
|
6428
|
+
* Returns the raw archive bytes for the caller to save.
|
|
6429
|
+
*/
|
|
6430
|
+
async downloadSiteSourceZip(wid, siteId) {
|
|
6431
|
+
const response = await this.fetchRaw(`w/${wid}/sites/${siteId}/source/download`);
|
|
6432
|
+
return response.blob();
|
|
6433
|
+
}
|
|
6434
|
+
/**
|
|
6435
|
+
* Replace the site's source tree with the contents of an uploaded ZIP
|
|
6436
|
+
* (clears the existing source first, like a reset that loads a template).
|
|
6437
|
+
*/
|
|
6438
|
+
async importSiteSourceZip(wid, siteId, file) {
|
|
6439
|
+
const form = new FormData();
|
|
6440
|
+
form.append("file", file, "source.zip");
|
|
6441
|
+
return this.fetch(`w/${wid}/sites/${siteId}/source/import`, {
|
|
6442
|
+
method: "POST",
|
|
6443
|
+
body: form
|
|
6444
|
+
});
|
|
6445
|
+
}
|
|
6446
|
+
/**
|
|
6447
|
+
* Get a theme's settings schema, the site's saved values, and capabilities.
|
|
6448
|
+
* Pass `theme` to resolve the schema for a theme other than the saved one
|
|
6449
|
+
* (e.g. one the builder has selected but not yet saved).
|
|
6450
|
+
*/
|
|
6451
|
+
async getThemeSettings(wid, siteId, theme) {
|
|
6452
|
+
const query = theme ? `?theme=${encodeURIComponent(theme)}` : "";
|
|
6453
|
+
return this.fetch(`w/${wid}/sites/${siteId}/theme-settings${query}`);
|
|
6454
|
+
}
|
|
6455
|
+
/** Save values for the active theme's settings (validated against the schema). */
|
|
6456
|
+
async updateThemeSettings(wid, siteId, values) {
|
|
6457
|
+
return this.fetch(`w/${wid}/sites/${siteId}/theme-settings`, {
|
|
6458
|
+
method: "PUT",
|
|
6459
|
+
body: JSON.stringify({ values })
|
|
6460
|
+
});
|
|
6461
|
+
}
|
|
6031
6462
|
/** Get a single site by UUID. */
|
|
6032
6463
|
async getSiteByUuid(wid, uuid) {
|
|
6033
6464
|
return this.fetch(`s/${wid}/${uuid}`);
|
|
@@ -6383,6 +6814,16 @@ var SupportRequestsApi = class extends BaseApiClient {
|
|
|
6383
6814
|
body: JSON.stringify(data)
|
|
6384
6815
|
});
|
|
6385
6816
|
}
|
|
6817
|
+
/**
|
|
6818
|
+
* Reopen a resolved support request (e.g. staff resolved it prematurely).
|
|
6819
|
+
* The server rejects requests that are not in the `resolved` state.
|
|
6820
|
+
*/
|
|
6821
|
+
async reopenWorkspaceSupportRequest(workspaceUuid, uuid, data = {}) {
|
|
6822
|
+
return this.fetch(`w/${workspaceUuid}/support-requests/${uuid}/reopen`, {
|
|
6823
|
+
method: "POST",
|
|
6824
|
+
body: JSON.stringify(data)
|
|
6825
|
+
});
|
|
6826
|
+
}
|
|
6386
6827
|
/**
|
|
6387
6828
|
* Record a click on a pushed resource (Proactive Support). For a
|
|
6388
6829
|
* manager_prompt, pass the Manager Chat UUID it opened so the
|
|
@@ -7317,6 +7758,20 @@ var BulkMemberResultStatus = {
|
|
|
7317
7758
|
updated: "updated",
|
|
7318
7759
|
failed: "failed"
|
|
7319
7760
|
};
|
|
7761
|
+
var MemberImportMatchInfoMatchType = {
|
|
7762
|
+
external_id: "external_id",
|
|
7763
|
+
email: "email",
|
|
7764
|
+
phone: "phone",
|
|
7765
|
+
account_email: "account_email",
|
|
7766
|
+
account_phone: "account_phone"
|
|
7767
|
+
};
|
|
7768
|
+
var MemberImportPreviewRowAction = {
|
|
7769
|
+
create: "create",
|
|
7770
|
+
update: "update",
|
|
7771
|
+
unchanged: "unchanged",
|
|
7772
|
+
conflict: "conflict",
|
|
7773
|
+
error: "error"
|
|
7774
|
+
};
|
|
7320
7775
|
|
|
7321
7776
|
// src/types/member-types.ts
|
|
7322
7777
|
var MemberType = /* @__PURE__ */ ((MemberType2) => {
|
|
@@ -7360,6 +7815,9 @@ var EventRuleObjectType = /* @__PURE__ */ ((EventRuleObjectType2) => {
|
|
|
7360
7815
|
})(EventRuleObjectType || {});
|
|
7361
7816
|
var EventRuleEventType = /* @__PURE__ */ ((EventRuleEventType2) => {
|
|
7362
7817
|
EventRuleEventType2["TASK_EXECUTE"] = "task:execute";
|
|
7818
|
+
EventRuleEventType2["TASK_ENTER"] = "task:enter";
|
|
7819
|
+
EventRuleEventType2["TASK_COMMAND"] = "task:command";
|
|
7820
|
+
EventRuleEventType2["TASK_EXIT"] = "task:exit";
|
|
7363
7821
|
EventRuleEventType2["MEMBER_JOINED"] = "workspace:member_joined";
|
|
7364
7822
|
EventRuleEventType2["MEMBER_LEFT"] = "workspace:member_left";
|
|
7365
7823
|
EventRuleEventType2["DATA_RECORD_CREATED"] = "data_record:created";
|
|
@@ -7393,6 +7851,7 @@ var EventRuleActionType = /* @__PURE__ */ ((EventRuleActionType2) => {
|
|
|
7393
7851
|
EventRuleActionType2["SWITCH_TASK_ACTION"] = "task:switch";
|
|
7394
7852
|
EventRuleActionType2["ASSISTANT_MESSAGE"] = "assistant:message";
|
|
7395
7853
|
EventRuleActionType2["FORM_FIELD_UPDATE"] = "form:update_field";
|
|
7854
|
+
EventRuleActionType2["CEL_MUTATE"] = "record:cel_mutate";
|
|
7396
7855
|
EventRuleActionType2["MESSAGE_VALIDATION"] = "message:validation";
|
|
7397
7856
|
EventRuleActionType2["CHAT_CREATE"] = "chat:create";
|
|
7398
7857
|
EventRuleActionType2["CHAT_CONTINUE"] = "chat:continue";
|
|
@@ -7525,6 +7984,12 @@ var InvitationStatus = /* @__PURE__ */ ((InvitationStatus2) => {
|
|
|
7525
7984
|
return InvitationStatus2;
|
|
7526
7985
|
})(InvitationStatus || {});
|
|
7527
7986
|
|
|
7987
|
+
// src/types/generated/data.ts
|
|
7988
|
+
var DataRecordRetirementResponseReason = {
|
|
7989
|
+
monday_item_archived: "monday_item_archived",
|
|
7990
|
+
monday_item_deleted: "monday_item_deleted"
|
|
7991
|
+
};
|
|
7992
|
+
|
|
7528
7993
|
// src/types/data-types.ts
|
|
7529
7994
|
var DataFieldType = /* @__PURE__ */ ((DataFieldType2) => {
|
|
7530
7995
|
DataFieldType2["ENUM"] = "enum";
|
|
@@ -7586,7 +8051,6 @@ var ModelProvider = {
|
|
|
7586
8051
|
aws: "aws",
|
|
7587
8052
|
elevenlabs: "elevenlabs",
|
|
7588
8053
|
deepgram: "deepgram",
|
|
7589
|
-
pocket: "pocket",
|
|
7590
8054
|
xai: "xai",
|
|
7591
8055
|
custom: "custom"
|
|
7592
8056
|
};
|
|
@@ -7616,7 +8080,10 @@ var TTS_MODEL_ELEVENLABS_MULTILINGUAL = "elevenlabs:tts:eleven_multilingual_v2";
|
|
|
7616
8080
|
var TTS_MODEL_DEEPGRAM_AURA_2 = "deepgram:tts:aura-2";
|
|
7617
8081
|
var TTS_MODEL_AWS_POLLY_GENERATIVE = "aws:tts:polly-generative";
|
|
7618
8082
|
var TTS_MODEL_AWS_POLLY_NEURAL = "aws:tts:polly-neural";
|
|
7619
|
-
|
|
8083
|
+
|
|
8084
|
+
// src/types/pids-types.ts
|
|
8085
|
+
var PIDS_DISPOSITIONS = ["true_positive", "false_positive", "needs_more_context"];
|
|
8086
|
+
var PIDS_SOURCES = ["scheduled", "backfill", "pre_llm"];
|
|
7620
8087
|
|
|
7621
8088
|
// src/types/calendar-types.ts
|
|
7622
8089
|
var CalendarPermissionType = /* @__PURE__ */ ((CalendarPermissionType2) => {
|
|
@@ -8285,6 +8752,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
|
|
|
8285
8752
|
events: new EventsApi(apiKey, baseUrl, customFetch),
|
|
8286
8753
|
experiments: new ExperimentsApi(apiKey, baseUrl, customFetch),
|
|
8287
8754
|
fhirConnections: new FhirConnectionsApi(apiKey, baseUrl, customFetch),
|
|
8755
|
+
patientSyncConnections: new PatientSyncConnectionsApi(apiKey, baseUrl, customFetch),
|
|
8288
8756
|
healthie: new HealthieApi(apiKey, baseUrl, customFetch),
|
|
8289
8757
|
hubspot: new HubspotApi(apiKey, baseUrl, customFetch),
|
|
8290
8758
|
features: new FeaturesApi(apiKey, baseUrl, customFetch),
|
|
@@ -8308,6 +8776,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
|
|
|
8308
8776
|
pronunciations: new PronunciationsApi(apiKey, baseUrl, customFetch),
|
|
8309
8777
|
qualifications: new QualificationsApi(apiKey, baseUrl, customFetch),
|
|
8310
8778
|
personas: new PersonasApi(apiKey, baseUrl, customFetch),
|
|
8779
|
+
queries: new QueriesApi(apiKey, baseUrl, customFetch),
|
|
8311
8780
|
reports: new ReportsApi(apiKey, baseUrl, customFetch),
|
|
8312
8781
|
salesforce: new SalesforceApi(apiKey, baseUrl, customFetch),
|
|
8313
8782
|
sites: new SitesApi(apiKey, baseUrl, customFetch),
|
|
@@ -8352,6 +8821,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
8352
8821
|
"cancelAgentTask",
|
|
8353
8822
|
"cancelAssignment",
|
|
8354
8823
|
"cancelCalendarEvent",
|
|
8824
|
+
"cancelChatCallback",
|
|
8355
8825
|
"cancelCredentialUpdateInvite",
|
|
8356
8826
|
"checkAvailability",
|
|
8357
8827
|
"checkSiteDomainAvailability",
|
|
@@ -8366,6 +8836,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
8366
8836
|
"commentOnWorkspaceSupportRequest",
|
|
8367
8837
|
"configureConfluence",
|
|
8368
8838
|
"configureHealthie",
|
|
8839
|
+
"configurePatientSync",
|
|
8369
8840
|
"configureHubspot",
|
|
8370
8841
|
"configureMondayConnection",
|
|
8371
8842
|
"configureSalesforce",
|
|
@@ -8396,6 +8867,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
8396
8867
|
"createExperiment",
|
|
8397
8868
|
"createExperimentAssignment",
|
|
8398
8869
|
"createExperimentGroup",
|
|
8870
|
+
"convertMemberFilterToQuery",
|
|
8399
8871
|
"createFhirConnection",
|
|
8400
8872
|
"createFile",
|
|
8401
8873
|
"createFileLabel",
|
|
@@ -8460,6 +8932,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
8460
8932
|
"deleteExperimentAssignment",
|
|
8461
8933
|
"deleteExperimentGroup",
|
|
8462
8934
|
"deleteFhirConnection",
|
|
8935
|
+
"deletePatientSyncConnection",
|
|
8463
8936
|
"deleteFile",
|
|
8464
8937
|
"deleteFileLabel",
|
|
8465
8938
|
"deleteFolder",
|
|
@@ -8595,6 +9068,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
8595
9068
|
"getCelContext",
|
|
8596
9069
|
"getChat",
|
|
8597
9070
|
"getChatAssignmentTasks",
|
|
9071
|
+
"getChatCallbacks",
|
|
8598
9072
|
"getChatEmails",
|
|
8599
9073
|
"getChatFilter",
|
|
8600
9074
|
"getChatFilterByUuid",
|
|
@@ -8661,6 +9135,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
8661
9135
|
"getHealthieAvailableSlots",
|
|
8662
9136
|
"getHealthieReconciliationMatches",
|
|
8663
9137
|
"getHealthieStatus",
|
|
9138
|
+
"getPatientSyncStatus",
|
|
8664
9139
|
"getHubspotContactProperties",
|
|
8665
9140
|
"getHubspotManagedRules",
|
|
8666
9141
|
"getHubspotReconciliationMatches",
|
|
@@ -8706,6 +9181,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
8706
9181
|
"getMemberRole",
|
|
8707
9182
|
"getMemberRoleByUuid",
|
|
8708
9183
|
"getMemberRoles",
|
|
9184
|
+
"getMemberSyncLinks",
|
|
8709
9185
|
"getMemberSyncSummary",
|
|
8710
9186
|
"getMemberUsage",
|
|
8711
9187
|
"getMembersMessageActivity",
|
|
@@ -8870,6 +9346,7 @@ var WORKSPACE_METHOD_NAMES = [
|
|
|
8870
9346
|
"markEmailAsRead",
|
|
8871
9347
|
"markEmailAsUnread",
|
|
8872
9348
|
"markNotificationAsRead",
|
|
9349
|
+
"previewImportMembers",
|
|
8873
9350
|
"previewImportWorkspace",
|
|
8874
9351
|
"previewSchedule",
|
|
8875
9352
|
"previewTTS",
|
|
@@ -9096,6 +9573,8 @@ function bindTasksMethods(target, tasks, abilities) {
|
|
|
9096
9573
|
function bindChatsMethods(target, chats) {
|
|
9097
9574
|
target.getChats = chats.getChats.bind(chats);
|
|
9098
9575
|
target.getChat = chats.getChat.bind(chats);
|
|
9576
|
+
target.getChatCallbacks = chats.getChatCallbacks.bind(chats);
|
|
9577
|
+
target.cancelChatCallback = chats.cancelChatCallback.bind(chats);
|
|
9099
9578
|
target.getChatTokenUsage = chats.getChatTokenUsage.bind(chats);
|
|
9100
9579
|
target.getChatTodos = chats.getChatTodos.bind(chats);
|
|
9101
9580
|
target.getChatSkills = chats.getChatSkills.bind(chats);
|
|
@@ -9145,6 +9624,8 @@ function bindCallsMethods(target, calls, cel) {
|
|
|
9145
9624
|
target.initiateCall = calls.initiateCall.bind(calls);
|
|
9146
9625
|
target.getVoiceToken = calls.getVoiceToken.bind(calls);
|
|
9147
9626
|
target.getMessageTiming = calls.getMessageTiming.bind(calls);
|
|
9627
|
+
target.listChatRecordings = calls.listChatRecordings.bind(calls);
|
|
9628
|
+
target.getCallRecordingDownloadUrl = calls.getCallRecordingDownloadUrl.bind(calls);
|
|
9148
9629
|
target.getCelContext = cel.getCelContext.bind(cel);
|
|
9149
9630
|
}
|
|
9150
9631
|
|
|
@@ -9187,6 +9668,9 @@ function bindMembersMethods(target, members) {
|
|
|
9187
9668
|
target.deleteMember = members.deleteMember.bind(members);
|
|
9188
9669
|
target.archiveMember = members.archiveMember.bind(members);
|
|
9189
9670
|
target.unarchiveMember = members.unarchiveMember.bind(members);
|
|
9671
|
+
target.sendMemberPhoneConfirmation = members.sendMemberPhoneConfirmation.bind(members);
|
|
9672
|
+
target.bulkCreateMembers = members.bulkCreateMembers.bind(members);
|
|
9673
|
+
target.previewImportMembers = members.previewImportMembers.bind(members);
|
|
9190
9674
|
target.importMembers = members.importMembers.bind(members);
|
|
9191
9675
|
target.exportMembers = members.exportMembers.bind(members);
|
|
9192
9676
|
target.getMembersMessageActivity = members.getMembersMessageActivity.bind(members);
|
|
@@ -9194,6 +9678,7 @@ function bindMembersMethods(target, members) {
|
|
|
9194
9678
|
target.getMemberFilter = members.getMemberFilter.bind(members);
|
|
9195
9679
|
target.createMemberFilter = members.createMemberFilter.bind(members);
|
|
9196
9680
|
target.updateMemberFilter = members.updateMemberFilter.bind(members);
|
|
9681
|
+
target.convertMemberFilterToQuery = members.convertMemberFilterToQuery.bind(members);
|
|
9197
9682
|
target.deleteMemberFilter = members.deleteMemberFilter.bind(members);
|
|
9198
9683
|
target.getMemberFilterCount = members.getMemberFilterCount.bind(members);
|
|
9199
9684
|
target.getMemberLabels = members.getMemberLabels.bind(members);
|
|
@@ -9223,6 +9708,7 @@ function bindMembersMethods(target, members) {
|
|
|
9223
9708
|
target.getMemberMemories = members.getMemberMemories.bind(members);
|
|
9224
9709
|
target.createMemberMemory = members.createMemberMemory.bind(members);
|
|
9225
9710
|
target.deleteMemberMemory = members.deleteMemberMemory.bind(members);
|
|
9711
|
+
target.getMemberSyncLinks = members.getMemberSyncLinks.bind(members);
|
|
9226
9712
|
}
|
|
9227
9713
|
|
|
9228
9714
|
// src/client/bindings/workspaces.ts
|
|
@@ -9356,6 +9842,19 @@ function bindSitesMethods(target, sites) {
|
|
|
9356
9842
|
target.checkSiteSlugAvailability = sites.checkSiteSlugAvailability.bind(sites);
|
|
9357
9843
|
target.checkSiteDomainAvailability = sites.checkSiteDomainAvailability.bind(sites);
|
|
9358
9844
|
target.getSite = sites.getSite.bind(sites);
|
|
9845
|
+
target.getSiteSharing = sites.getSiteSharing.bind(sites);
|
|
9846
|
+
target.updateSiteSharing = sites.updateSiteSharing.bind(sites);
|
|
9847
|
+
target.getSiteSource = sites.getSiteSource.bind(sites);
|
|
9848
|
+
target.getSiteSourceTemplates = sites.getSiteSourceTemplates.bind(sites);
|
|
9849
|
+
target.createSiteSource = sites.createSiteSource.bind(sites);
|
|
9850
|
+
target.buildSiteSource = sites.buildSiteSource.bind(sites);
|
|
9851
|
+
target.publishSiteSource = sites.publishSiteSource.bind(sites);
|
|
9852
|
+
target.resetSiteSource = sites.resetSiteSource.bind(sites);
|
|
9853
|
+
target.rollbackSiteSource = sites.rollbackSiteSource.bind(sites);
|
|
9854
|
+
target.downloadSiteSourceZip = sites.downloadSiteSourceZip.bind(sites);
|
|
9855
|
+
target.importSiteSourceZip = sites.importSiteSourceZip.bind(sites);
|
|
9856
|
+
target.getThemeSettings = sites.getThemeSettings.bind(sites);
|
|
9857
|
+
target.updateThemeSettings = sites.updateThemeSettings.bind(sites);
|
|
9359
9858
|
target.getSiteByUuid = sites.getSiteByUuid.bind(sites);
|
|
9360
9859
|
target.getSiteRenderedPage = sites.getSiteRenderedPage.bind(sites);
|
|
9361
9860
|
target.getSiteRenderedMenu = sites.getSiteRenderedMenu.bind(sites);
|
|
@@ -9388,6 +9887,7 @@ function bindSitesMethods(target, sites) {
|
|
|
9388
9887
|
function bindFilesMethods(target, files) {
|
|
9389
9888
|
target.getFiles = files.getFiles.bind(files);
|
|
9390
9889
|
target.getFile = files.getFile.bind(files);
|
|
9890
|
+
target.downloadFilesZip = files.downloadFilesZip.bind(files);
|
|
9391
9891
|
target.createFile = files.createFile.bind(files);
|
|
9392
9892
|
target.uploadFile = files.uploadFile.bind(files);
|
|
9393
9893
|
target.updateFile = files.updateFile.bind(files);
|
|
@@ -9429,6 +9929,7 @@ function bindEventsMethods(target, events) {
|
|
|
9429
9929
|
target.createEventRule = events.createEventRule.bind(events);
|
|
9430
9930
|
target.updateEventRule = events.updateEventRule.bind(events);
|
|
9431
9931
|
target.deleteEventRule = events.deleteEventRule.bind(events);
|
|
9932
|
+
target.testWebhook = events.testWebhook.bind(events);
|
|
9432
9933
|
target.reorderEventRules = events.reorderEventRules.bind(events);
|
|
9433
9934
|
target.getWebhookLogs = events.getWebhookLogs.bind(events);
|
|
9434
9935
|
target.getRuleExecutions = events.getRuleExecutions.bind(events);
|
|
@@ -9679,12 +10180,13 @@ function bindAppsMethods(target, apps, builders, inquiries, oauth, oauthConnecti
|
|
|
9679
10180
|
target.exchangeOAuthToken = oauth.exchangeOAuthToken.bind(oauth);
|
|
9680
10181
|
target.getAvailableScopes = oauth.getAvailableScopes.bind(oauth);
|
|
9681
10182
|
target.getOAuthConnectionStatus = oauthConnections.getConnectionStatus.bind(oauthConnections);
|
|
10183
|
+
target.listOAuthAccounts = oauthConnections.listAccounts.bind(oauthConnections);
|
|
9682
10184
|
target.getOAuthAuthorizationUrl = oauthConnections.getAuthorizationUrl.bind(oauthConnections);
|
|
9683
10185
|
target.disconnectOAuthProvider = oauthConnections.disconnect.bind(oauthConnections);
|
|
9684
10186
|
}
|
|
9685
10187
|
|
|
9686
10188
|
// src/client/bindings/integrations.ts
|
|
9687
|
-
function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, healthie, salesforce, hubspot, appConnections, connectionSync, confluence) {
|
|
10189
|
+
function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, patientSyncConnections, healthie, salesforce, hubspot, appConnections, connectionSync, confluence) {
|
|
9688
10190
|
target.getMondayBoards = mondayIntegration.getBoards.bind(mondayIntegration);
|
|
9689
10191
|
target.getMondayBoardColumns = mondayIntegration.getBoardColumns.bind(mondayIntegration);
|
|
9690
10192
|
target.getMondayBoardGroups = mondayIntegration.getBoardGroups.bind(mondayIntegration);
|
|
@@ -9769,6 +10271,9 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
|
|
|
9769
10271
|
target.fhirGetEncounterSyncRuns = fhirConnections.fhirGetEncounterSyncRuns.bind(fhirConnections);
|
|
9770
10272
|
target.fhirRefreshEncounterPatient = fhirConnections.fhirRefreshEncounterPatient.bind(fhirConnections);
|
|
9771
10273
|
target.fhirBackfillEncounterSync = fhirConnections.fhirBackfillEncounterSync.bind(fhirConnections);
|
|
10274
|
+
target.configurePatientSync = patientSyncConnections.configurePatientSync.bind(patientSyncConnections);
|
|
10275
|
+
target.getPatientSyncStatus = patientSyncConnections.getPatientSyncStatus.bind(patientSyncConnections);
|
|
10276
|
+
target.deletePatientSyncConnection = patientSyncConnections.deletePatientSyncConnection.bind(patientSyncConnections);
|
|
9772
10277
|
target.configureHealthie = healthie.configureHealthie.bind(healthie);
|
|
9773
10278
|
target.getHealthieStatus = healthie.getHealthieStatus.bind(healthie);
|
|
9774
10279
|
target.listHealthieProviders = healthie.listHealthieProviders.bind(healthie);
|
|
@@ -9962,6 +10467,14 @@ function bindPersonasMethods(target, personas) {
|
|
|
9962
10467
|
target.deletePersona = personas.deletePersona.bind(personas);
|
|
9963
10468
|
}
|
|
9964
10469
|
|
|
10470
|
+
// src/client/bindings/queries.ts
|
|
10471
|
+
function bindQueriesMethods(target, queries) {
|
|
10472
|
+
target.getQueryFields = queries.getQueryFields.bind(queries);
|
|
10473
|
+
target.validateQuery = queries.validateQuery.bind(queries);
|
|
10474
|
+
target.previewQuery = queries.previewQuery.bind(queries);
|
|
10475
|
+
target.runQuery = queries.runQuery.bind(queries);
|
|
10476
|
+
}
|
|
10477
|
+
|
|
9965
10478
|
// src/client/bindings/customers.ts
|
|
9966
10479
|
function bindCustomersMethods(target, customers) {
|
|
9967
10480
|
target.getMyCustomers = customers.getMyCustomers.bind(customers);
|
|
@@ -10008,6 +10521,7 @@ function bindSupportRequestMethods(target, supportRequests) {
|
|
|
10008
10521
|
target.createWorkspaceSupportRequest = supportRequests.createWorkspaceSupportRequest.bind(supportRequests);
|
|
10009
10522
|
target.commentOnWorkspaceSupportRequest = supportRequests.commentOnWorkspaceSupportRequest.bind(supportRequests);
|
|
10010
10523
|
target.closeWorkspaceSupportRequest = supportRequests.closeWorkspaceSupportRequest.bind(supportRequests);
|
|
10524
|
+
target.reopenWorkspaceSupportRequest = supportRequests.reopenWorkspaceSupportRequest.bind(supportRequests);
|
|
10011
10525
|
target.clickWorkspaceSupportRequestResource = supportRequests.clickWorkspaceSupportRequestResource.bind(supportRequests);
|
|
10012
10526
|
}
|
|
10013
10527
|
|
|
@@ -10035,6 +10549,8 @@ var GravityRailClient = class {
|
|
|
10035
10549
|
// Chats API
|
|
10036
10550
|
getChats;
|
|
10037
10551
|
getChat;
|
|
10552
|
+
getChatCallbacks;
|
|
10553
|
+
cancelChatCallback;
|
|
10038
10554
|
getChatTokenUsage;
|
|
10039
10555
|
getChatTodos;
|
|
10040
10556
|
getChatSkills;
|
|
@@ -10081,6 +10597,8 @@ var GravityRailClient = class {
|
|
|
10081
10597
|
initiateCall;
|
|
10082
10598
|
getVoiceToken;
|
|
10083
10599
|
getMessageTiming;
|
|
10600
|
+
listChatRecordings;
|
|
10601
|
+
getCallRecordingDownloadUrl;
|
|
10084
10602
|
getCelContext;
|
|
10085
10603
|
// Data Types API
|
|
10086
10604
|
getDataTypes;
|
|
@@ -10117,6 +10635,9 @@ var GravityRailClient = class {
|
|
|
10117
10635
|
deleteMember;
|
|
10118
10636
|
archiveMember;
|
|
10119
10637
|
unarchiveMember;
|
|
10638
|
+
sendMemberPhoneConfirmation;
|
|
10639
|
+
bulkCreateMembers;
|
|
10640
|
+
previewImportMembers;
|
|
10120
10641
|
importMembers;
|
|
10121
10642
|
exportMembers;
|
|
10122
10643
|
getMembersMessageActivity;
|
|
@@ -10124,6 +10645,7 @@ var GravityRailClient = class {
|
|
|
10124
10645
|
getMemberFilter;
|
|
10125
10646
|
createMemberFilter;
|
|
10126
10647
|
updateMemberFilter;
|
|
10648
|
+
convertMemberFilterToQuery;
|
|
10127
10649
|
deleteMemberFilter;
|
|
10128
10650
|
getMemberFilterCount;
|
|
10129
10651
|
getMemberLabels;
|
|
@@ -10157,6 +10679,8 @@ var GravityRailClient = class {
|
|
|
10157
10679
|
getMemberMemories;
|
|
10158
10680
|
createMemberMemory;
|
|
10159
10681
|
deleteMemberMemory;
|
|
10682
|
+
// Member Sync Links
|
|
10683
|
+
getMemberSyncLinks;
|
|
10160
10684
|
// Agent Tasks API (operator-facing async sub-agent inspection/cancel)
|
|
10161
10685
|
getAgentTasks;
|
|
10162
10686
|
getAgentTask;
|
|
@@ -10187,6 +10711,11 @@ var GravityRailClient = class {
|
|
|
10187
10711
|
evaluateTestChatRun;
|
|
10188
10712
|
endTestChatRun;
|
|
10189
10713
|
// Personas API (workspace-scoped test-identity templates)
|
|
10714
|
+
// Unified Query Engine
|
|
10715
|
+
getQueryFields;
|
|
10716
|
+
validateQuery;
|
|
10717
|
+
previewQuery;
|
|
10718
|
+
runQuery;
|
|
10190
10719
|
listPersonas;
|
|
10191
10720
|
getPersona;
|
|
10192
10721
|
createPersona;
|
|
@@ -10405,6 +10934,19 @@ var GravityRailClient = class {
|
|
|
10405
10934
|
checkSiteSlugAvailability;
|
|
10406
10935
|
checkSiteDomainAvailability;
|
|
10407
10936
|
getSite;
|
|
10937
|
+
getSiteSharing;
|
|
10938
|
+
updateSiteSharing;
|
|
10939
|
+
getSiteSource;
|
|
10940
|
+
getSiteSourceTemplates;
|
|
10941
|
+
createSiteSource;
|
|
10942
|
+
buildSiteSource;
|
|
10943
|
+
publishSiteSource;
|
|
10944
|
+
resetSiteSource;
|
|
10945
|
+
rollbackSiteSource;
|
|
10946
|
+
downloadSiteSourceZip;
|
|
10947
|
+
importSiteSourceZip;
|
|
10948
|
+
getThemeSettings;
|
|
10949
|
+
updateThemeSettings;
|
|
10408
10950
|
getSiteByUuid;
|
|
10409
10951
|
getSiteRenderedPage;
|
|
10410
10952
|
getSiteRenderedMenu;
|
|
@@ -10434,6 +10976,7 @@ var GravityRailClient = class {
|
|
|
10434
10976
|
// Files API
|
|
10435
10977
|
getFiles;
|
|
10436
10978
|
getFile;
|
|
10979
|
+
downloadFilesZip;
|
|
10437
10980
|
createFile;
|
|
10438
10981
|
uploadFile;
|
|
10439
10982
|
updateFile;
|
|
@@ -10473,6 +11016,7 @@ var GravityRailClient = class {
|
|
|
10473
11016
|
createEventRule;
|
|
10474
11017
|
updateEventRule;
|
|
10475
11018
|
deleteEventRule;
|
|
11019
|
+
testWebhook;
|
|
10476
11020
|
reorderEventRules;
|
|
10477
11021
|
getWebhookLogs;
|
|
10478
11022
|
getRuleExecutions;
|
|
@@ -10688,6 +11232,7 @@ var GravityRailClient = class {
|
|
|
10688
11232
|
exchangeOAuthToken;
|
|
10689
11233
|
getAvailableScopes;
|
|
10690
11234
|
getOAuthConnectionStatus;
|
|
11235
|
+
listOAuthAccounts;
|
|
10691
11236
|
getOAuthAuthorizationUrl;
|
|
10692
11237
|
disconnectOAuthProvider;
|
|
10693
11238
|
// Integrations API
|
|
@@ -10781,6 +11326,9 @@ var GravityRailClient = class {
|
|
|
10781
11326
|
fhirRefreshEncounterPatient;
|
|
10782
11327
|
fhirBackfillEncounterSync;
|
|
10783
11328
|
// Healthie API
|
|
11329
|
+
configurePatientSync;
|
|
11330
|
+
getPatientSyncStatus;
|
|
11331
|
+
deletePatientSyncConnection;
|
|
10784
11332
|
configureHealthie;
|
|
10785
11333
|
getHealthieStatus;
|
|
10786
11334
|
listHealthieProviders;
|
|
@@ -10909,6 +11457,7 @@ var GravityRailClient = class {
|
|
|
10909
11457
|
createWorkspaceSupportRequest;
|
|
10910
11458
|
commentOnWorkspaceSupportRequest;
|
|
10911
11459
|
closeWorkspaceSupportRequest;
|
|
11460
|
+
reopenWorkspaceSupportRequest;
|
|
10912
11461
|
clickWorkspaceSupportRequestResource;
|
|
10913
11462
|
constructor(apiKey, baseUrl, customFetch) {
|
|
10914
11463
|
const apis = createApiModules(apiKey, baseUrl, customFetch);
|
|
@@ -10923,6 +11472,7 @@ var GravityRailClient = class {
|
|
|
10923
11472
|
bindAgentsMethods(this, apis.agents);
|
|
10924
11473
|
bindQualificationsMethods(this, apis.qualifications);
|
|
10925
11474
|
bindPersonasMethods(this, apis.personas);
|
|
11475
|
+
bindQueriesMethods(this, apis.queries);
|
|
10926
11476
|
bindJourneysMethods(this, apis.journeys);
|
|
10927
11477
|
bindExperimentsMethods(this, apis.experiments);
|
|
10928
11478
|
bindOperatorMethods(this, apis.operatorGroups);
|
|
@@ -10962,6 +11512,7 @@ var GravityRailClient = class {
|
|
|
10962
11512
|
apis.slackApps,
|
|
10963
11513
|
apis.teamsApps,
|
|
10964
11514
|
apis.fhirConnections,
|
|
11515
|
+
apis.patientSyncConnections,
|
|
10965
11516
|
apis.healthie,
|
|
10966
11517
|
apis.salesforce,
|
|
10967
11518
|
apis.hubspot,
|
|
@@ -11015,23 +11566,30 @@ var GravityRailClient = class {
|
|
|
11015
11566
|
});
|
|
11016
11567
|
}
|
|
11017
11568
|
/**
|
|
11018
|
-
* Set the org
|
|
11019
|
-
*
|
|
11020
|
-
*
|
|
11569
|
+
* Set the org session credential for cross-domain / non-browser clients (e.g. CLI).
|
|
11570
|
+
* Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still
|
|
11571
|
+
* use X-Org-Token during the migration window.
|
|
11021
11572
|
*
|
|
11022
|
-
* `orgUuid` is the org that issued the
|
|
11023
|
-
* detect a stale
|
|
11573
|
+
* `orgUuid` is the org that issued the session. Pass it so the SDK can
|
|
11574
|
+
* detect a stale session (e.g. switching orgs mid-session) and re-fire the
|
|
11024
11575
|
* org-auth handler instead of silently 401-ing.
|
|
11025
11576
|
*
|
|
11026
11577
|
* Propagates to all API modules.
|
|
11027
11578
|
*/
|
|
11028
|
-
|
|
11579
|
+
setOrgSession(session, orgUuid) {
|
|
11029
11580
|
Object.values(this.apis).forEach((api) => {
|
|
11030
|
-
if (typeof api.
|
|
11031
|
-
api.
|
|
11581
|
+
if (typeof api.setOrgSession === "function") {
|
|
11582
|
+
api.setOrgSession(session, orgUuid);
|
|
11032
11583
|
}
|
|
11033
11584
|
});
|
|
11034
11585
|
}
|
|
11586
|
+
/**
|
|
11587
|
+
* @deprecated Legacy compatibility for stateless orgToken JWE credentials.
|
|
11588
|
+
* Prefer setOrgSession() for opaque org browser sessions.
|
|
11589
|
+
*/
|
|
11590
|
+
setOrgToken(token, orgUuid) {
|
|
11591
|
+
this.setOrgSession(token, orgUuid);
|
|
11592
|
+
}
|
|
11035
11593
|
/**
|
|
11036
11594
|
* Update the API key across all modules.
|
|
11037
11595
|
* Used after successful re-authentication.
|
|
@@ -11088,6 +11646,24 @@ var WorkspaceBuilderResource = class {
|
|
|
11088
11646
|
_uuid;
|
|
11089
11647
|
_created = false;
|
|
11090
11648
|
_existed = false;
|
|
11649
|
+
/** Server-assigned numeric id — available after apply() or adopt(). */
|
|
11650
|
+
get id() {
|
|
11651
|
+
if (this._id === void 0) {
|
|
11652
|
+
throw new Error(
|
|
11653
|
+
`${this.constructor.name} has no id yet \u2014 ids are assigned during apply(). Pass the builder object itself where a reference is needed; refs resolve at apply time.`
|
|
11654
|
+
);
|
|
11655
|
+
}
|
|
11656
|
+
return this._id;
|
|
11657
|
+
}
|
|
11658
|
+
/** Server-assigned uuid — available after apply() or adopt(). */
|
|
11659
|
+
get uuid() {
|
|
11660
|
+
if (this._uuid === void 0) {
|
|
11661
|
+
throw new Error(
|
|
11662
|
+
`${this.constructor.name} has no uuid yet \u2014 uuids are assigned during apply(). Pass the builder object itself where a reference is needed; refs resolve at apply time.`
|
|
11663
|
+
);
|
|
11664
|
+
}
|
|
11665
|
+
return this._uuid;
|
|
11666
|
+
}
|
|
11091
11667
|
matchKey() {
|
|
11092
11668
|
return void 0;
|
|
11093
11669
|
}
|
|
@@ -11118,6 +11694,7 @@ var MemberFilterBuilder = class extends WorkspaceBuilderResource {
|
|
|
11118
11694
|
this.name = name;
|
|
11119
11695
|
this.description = options.description ?? "";
|
|
11120
11696
|
}
|
|
11697
|
+
name;
|
|
11121
11698
|
description;
|
|
11122
11699
|
rules = [];
|
|
11123
11700
|
addRule(objectType, filterType, options = {}) {
|
|
@@ -11152,6 +11729,8 @@ var RoutineBuilder = class extends WorkspaceBuilderResource {
|
|
|
11152
11729
|
this.active = options.active ?? false;
|
|
11153
11730
|
this.description = options.description ?? "";
|
|
11154
11731
|
}
|
|
11732
|
+
name;
|
|
11733
|
+
cronSchedule;
|
|
11155
11734
|
active;
|
|
11156
11735
|
description;
|
|
11157
11736
|
rules = [];
|
|
@@ -11213,6 +11792,7 @@ var NotificationRuleBuilder = class extends WorkspaceBuilderResource {
|
|
|
11213
11792
|
this.notifyEmail = Boolean(options.notifyEmail ?? options.notify_email);
|
|
11214
11793
|
this.notifyVoice = Boolean(options.notifyVoice ?? options.notify_voice);
|
|
11215
11794
|
}
|
|
11795
|
+
name;
|
|
11216
11796
|
noticeType;
|
|
11217
11797
|
memberId;
|
|
11218
11798
|
workflow;
|
|
@@ -11437,6 +12017,11 @@ var JourneyStepBuilder = class extends WorkspaceBuilderResource {
|
|
|
11437
12017
|
this.workflow = workflow;
|
|
11438
12018
|
this.description = description;
|
|
11439
12019
|
}
|
|
12020
|
+
name;
|
|
12021
|
+
journey;
|
|
12022
|
+
order;
|
|
12023
|
+
workflow;
|
|
12024
|
+
description;
|
|
11440
12025
|
connections = [];
|
|
11441
12026
|
connectsTo(child, condition, required = false, timeoutSeconds) {
|
|
11442
12027
|
this.connections.push({ parent: this, child, condition, required, timeoutSeconds });
|
|
@@ -11465,6 +12050,7 @@ var JourneyBuilder = class extends WorkspaceBuilderResource {
|
|
|
11465
12050
|
this.name = name;
|
|
11466
12051
|
this.description = options.description ?? "";
|
|
11467
12052
|
}
|
|
12053
|
+
name;
|
|
11468
12054
|
description;
|
|
11469
12055
|
steps = [];
|
|
11470
12056
|
goals = [];
|
|
@@ -11535,6 +12121,9 @@ var RoleUpdate = class extends WorkspaceBuilderResource {
|
|
|
11535
12121
|
this.workflowIds = workflowIds;
|
|
11536
12122
|
this.dataTypeIds = dataTypeIds;
|
|
11537
12123
|
}
|
|
12124
|
+
roleId;
|
|
12125
|
+
workflowIds;
|
|
12126
|
+
dataTypeIds;
|
|
11538
12127
|
planLine() {
|
|
11539
12128
|
const parts = [];
|
|
11540
12129
|
if (this.workflowIds) parts.push(`workflows=${JSON.stringify(this.workflowIds)}`);
|
|
@@ -11581,6 +12170,7 @@ var AbilityDef = class {
|
|
|
11581
12170
|
if (inputKey in options) this.perms[outputKey] = options[inputKey];
|
|
11582
12171
|
}
|
|
11583
12172
|
}
|
|
12173
|
+
abilityType;
|
|
11584
12174
|
uuid = crypto.randomUUID();
|
|
11585
12175
|
config;
|
|
11586
12176
|
enabled;
|
|
@@ -11611,13 +12201,25 @@ var TaskBuilder = class extends WorkspaceBuilderResource {
|
|
|
11611
12201
|
this.start = start;
|
|
11612
12202
|
this.description = description;
|
|
11613
12203
|
}
|
|
12204
|
+
name;
|
|
12205
|
+
workflow;
|
|
12206
|
+
prompt;
|
|
12207
|
+
start;
|
|
12208
|
+
description;
|
|
11614
12209
|
transitions = [];
|
|
11615
12210
|
eventRules = [];
|
|
11616
|
-
transitionsTo(child, when, autoNext = false, required = false) {
|
|
12211
|
+
transitionsTo(child, when, autoNext = false, required = false, celCondition) {
|
|
11617
12212
|
if (child === this) {
|
|
11618
12213
|
throw new Error(`Task '${this.name}' cannot transition to itself`);
|
|
11619
12214
|
}
|
|
11620
|
-
this.transitions.push({
|
|
12215
|
+
this.transitions.push({
|
|
12216
|
+
parent: this,
|
|
12217
|
+
child,
|
|
12218
|
+
when,
|
|
12219
|
+
autoNext,
|
|
12220
|
+
required,
|
|
12221
|
+
celCondition
|
|
12222
|
+
});
|
|
11621
12223
|
return this;
|
|
11622
12224
|
}
|
|
11623
12225
|
onEnter(action, params = {}, name) {
|
|
@@ -11659,6 +12261,7 @@ var WorkflowBuilder = class extends WorkspaceBuilderResource {
|
|
|
11659
12261
|
this.prompt = options.prompt;
|
|
11660
12262
|
this.agentId = options.agentId ?? options.agent_id;
|
|
11661
12263
|
}
|
|
12264
|
+
name;
|
|
11662
12265
|
description;
|
|
11663
12266
|
prompt;
|
|
11664
12267
|
agentId;
|
|
@@ -11779,6 +12382,7 @@ var AgentBuilder = class extends WorkspaceBuilderResource {
|
|
|
11779
12382
|
this.tools = options.tools ?? [];
|
|
11780
12383
|
this.codeInterpreterEnabled = options.codeInterpreterEnabled ?? options.code_interpreter_enabled ?? false;
|
|
11781
12384
|
}
|
|
12385
|
+
name;
|
|
11782
12386
|
chatModelId;
|
|
11783
12387
|
systemPrompt;
|
|
11784
12388
|
memberRoleId;
|
|
@@ -11830,6 +12434,7 @@ var WorkspaceBuilder = class {
|
|
|
11830
12434
|
constructor(client) {
|
|
11831
12435
|
this.client = client;
|
|
11832
12436
|
}
|
|
12437
|
+
client;
|
|
11833
12438
|
resources = [];
|
|
11834
12439
|
form(name, options = {}) {
|
|
11835
12440
|
const form = new FormBuilder(name, options.slug, options);
|
|
@@ -11954,7 +12559,7 @@ ${"=".repeat(50)}`);
|
|
|
11954
12559
|
writeLine(` Skipped: ${resource.planLine()}`);
|
|
11955
12560
|
}
|
|
11956
12561
|
} catch (err) {
|
|
11957
|
-
writeLine(
|
|
12562
|
+
writeLine(formatApplyFailureLine(resource, err));
|
|
11958
12563
|
throw new ApplyError(resource, err, summary);
|
|
11959
12564
|
}
|
|
11960
12565
|
}
|
|
@@ -12105,7 +12710,7 @@ Done! Created ${count} resources.`);
|
|
|
12105
12710
|
{
|
|
12106
12711
|
taskId,
|
|
12107
12712
|
choicePrompt: transition.when,
|
|
12108
|
-
celCondition: null,
|
|
12713
|
+
celCondition: transition.celCondition ?? null,
|
|
12109
12714
|
autoNext: transition.autoNext,
|
|
12110
12715
|
required: transition.required
|
|
12111
12716
|
}
|
|
@@ -12211,16 +12816,21 @@ Done! Created ${count} resources.`);
|
|
|
12211
12816
|
}
|
|
12212
12817
|
};
|
|
12213
12818
|
var ApplyError = class extends Error {
|
|
12819
|
+
createdSoFar;
|
|
12820
|
+
#resource;
|
|
12821
|
+
#cause;
|
|
12214
12822
|
constructor(resource, cause, createdSoFar) {
|
|
12215
|
-
super(
|
|
12216
|
-
|
|
12217
|
-
Already created: ${JSON.stringify(
|
|
12218
|
-
createdSoFar
|
|
12219
|
-
)}`
|
|
12220
|
-
);
|
|
12221
|
-
this.resource = resource;
|
|
12222
|
-
this.cause = cause;
|
|
12823
|
+
super(formatApplyErrorMessage(resource, cause, createdSoFar));
|
|
12824
|
+
this.name = "ApplyError";
|
|
12223
12825
|
this.createdSoFar = createdSoFar;
|
|
12826
|
+
this.#resource = resource;
|
|
12827
|
+
this.#cause = cause;
|
|
12828
|
+
}
|
|
12829
|
+
get resource() {
|
|
12830
|
+
return this.#resource;
|
|
12831
|
+
}
|
|
12832
|
+
get cause() {
|
|
12833
|
+
return this.#cause;
|
|
12224
12834
|
}
|
|
12225
12835
|
};
|
|
12226
12836
|
function resourceKey(resource) {
|
|
@@ -12331,8 +12941,64 @@ function handleEventRuleApplyFailure(resourceName, err) {
|
|
|
12331
12941
|
writeLine(` FAILED: Event rule on '${resourceName}': ${summary}`);
|
|
12332
12942
|
throw new Error(`Failed wiring event rule on '${resourceName}': ${summary}`);
|
|
12333
12943
|
}
|
|
12944
|
+
function writeScopeForResource(resource) {
|
|
12945
|
+
if (resource instanceof FormBuilder) return "datatypes:write";
|
|
12946
|
+
if (resource instanceof WorkflowBuilder || resource instanceof TaskBuilder) {
|
|
12947
|
+
return "workflows:write";
|
|
12948
|
+
}
|
|
12949
|
+
if (resource instanceof AgentBuilder) return "agents:write";
|
|
12950
|
+
if (resource instanceof MemberLabelBuilder || resource instanceof MemberFilterBuilder) {
|
|
12951
|
+
return "members:write";
|
|
12952
|
+
}
|
|
12953
|
+
if (resource instanceof RoutineBuilder || resource instanceof NotificationRuleBuilder) {
|
|
12954
|
+
return "automations:admin";
|
|
12955
|
+
}
|
|
12956
|
+
if (resource instanceof JourneyBuilder || resource instanceof JourneyStepBuilder) {
|
|
12957
|
+
return "journeys:write";
|
|
12958
|
+
}
|
|
12959
|
+
if (resource instanceof RoleUpdate) return "member_roles:write";
|
|
12960
|
+
return null;
|
|
12961
|
+
}
|
|
12962
|
+
function scopeRetryHint(resource) {
|
|
12963
|
+
const scope = writeScopeForResource(resource);
|
|
12964
|
+
return scope ? ` (retry exec with scopes=['${scope}'])` : "";
|
|
12965
|
+
}
|
|
12966
|
+
function formatApplyFailureLine(resource, err) {
|
|
12967
|
+
const line = ` FAILED: ${resource.planLine()}: ${summarizeError(err)}`;
|
|
12968
|
+
return hasStatus(err, 403) ? `${line}${scopeRetryHint(resource)}` : line;
|
|
12969
|
+
}
|
|
12970
|
+
function formatApplyErrorMessage(resource, cause, createdSoFar) {
|
|
12971
|
+
let message = `Failed creating ${resource.planLine()}: ${summarizeError(cause)}`;
|
|
12972
|
+
if (hasStatus(cause, 403)) {
|
|
12973
|
+
const scope = writeScopeForResource(resource);
|
|
12974
|
+
if (scope) {
|
|
12975
|
+
message += `
|
|
12976
|
+
Retry exec with scopes=['${scope}']`;
|
|
12977
|
+
}
|
|
12978
|
+
}
|
|
12979
|
+
const createdKeys = Object.keys(createdSoFar);
|
|
12980
|
+
if (createdKeys.length > 0) {
|
|
12981
|
+
message += `
|
|
12982
|
+
Already created: ${JSON.stringify(createdSoFar)}`;
|
|
12983
|
+
}
|
|
12984
|
+
return message;
|
|
12985
|
+
}
|
|
12334
12986
|
function summarizeError(err) {
|
|
12335
|
-
if (err
|
|
12987
|
+
if (hasStatus(err, 403)) {
|
|
12988
|
+
return "Insufficient permissions for this operation";
|
|
12989
|
+
}
|
|
12990
|
+
if (err instanceof ApiError) {
|
|
12991
|
+
const msg = err.message.trim();
|
|
12992
|
+
const availableTypesIdx = msg.indexOf("Available types:");
|
|
12993
|
+
if (availableTypesIdx !== -1) {
|
|
12994
|
+
const head = msg.slice(0, availableTypesIdx).trim().replace(/\.$/, "");
|
|
12995
|
+
return head ? `${head}.` : "Request failed";
|
|
12996
|
+
}
|
|
12997
|
+
return msg.length > 240 ? `${msg.slice(0, 237)}...` : msg;
|
|
12998
|
+
}
|
|
12999
|
+
if (err instanceof Error) {
|
|
13000
|
+
return err.name || "Error";
|
|
13001
|
+
}
|
|
12336
13002
|
return typeof err;
|
|
12337
13003
|
}
|
|
12338
13004
|
function hasStatus(err, status) {
|
|
@@ -12358,15 +13024,20 @@ var AbilityTypeSlugs = {
|
|
|
12358
13024
|
TOOLKITS: "tools:toolkits",
|
|
12359
13025
|
WEB_SEARCH: "tools:web_search",
|
|
12360
13026
|
CONVERSATION_HISTORY: "tools:conversation_history",
|
|
13027
|
+
IMAGE_GENERATION: "tools:image_generation",
|
|
13028
|
+
CONVERSATION_CONTROL: "tools:conversation_control",
|
|
12361
13029
|
// Integration
|
|
12362
13030
|
CALENDAR_BOOKING: "integration:calendar_booking",
|
|
12363
13031
|
FILE_ACCESS: "integration:file_access",
|
|
12364
13032
|
DATA_ACCESS: "integration:data_access",
|
|
12365
13033
|
GMAIL: "integration:gmail",
|
|
13034
|
+
GOOGLE_CALENDAR: "integration:google_calendar",
|
|
13035
|
+
GOOGLE_DRIVE: "integration:google_drive",
|
|
12366
13036
|
CHARLESTON_PMD_PAGING: "integration:charleston_pmd_paging",
|
|
12367
13037
|
// Communication
|
|
12368
13038
|
PHONE_CALL_TOOLS: "communication:phone_call_tools",
|
|
12369
13039
|
SEND_SMS: "communication:send_sms",
|
|
13040
|
+
SEND_WHATSAPP: "communication:send_whatsapp",
|
|
12370
13041
|
MEMBER_ACCESS: "communication:member_access",
|
|
12371
13042
|
AUDIO_PLAYBACK: "communication:audio_playback",
|
|
12372
13043
|
// Oversight
|
|
@@ -12375,6 +13046,12 @@ var AbilityTypeSlugs = {
|
|
|
12375
13046
|
ESCALATION: "oversight:escalation",
|
|
12376
13047
|
// Identity
|
|
12377
13048
|
MEMBER_FIELD_VERIFICATION: "identity:member_field_verification",
|
|
13049
|
+
// Delegation
|
|
13050
|
+
CONTRIBUTOR: "delegation:contributor",
|
|
13051
|
+
// Workflow
|
|
13052
|
+
WORKFLOW_RUN: "workflow:run",
|
|
13053
|
+
// Commerce
|
|
13054
|
+
RESELLER: "commerce:reseller",
|
|
12378
13055
|
// System (auto-injected, hidden from users)
|
|
12379
13056
|
USER_MESSAGE_RULES: "system:user_message_rules",
|
|
12380
13057
|
ASSISTANT_MESSAGE_RULES: "chat:assistant_message_rules",
|
|
@@ -12396,7 +13073,6 @@ var TTS_PREVIEW_PROVIDERS = [
|
|
|
12396
13073
|
"elevenlabs",
|
|
12397
13074
|
"google",
|
|
12398
13075
|
"aws",
|
|
12399
|
-
"pocket",
|
|
12400
13076
|
"deepgram",
|
|
12401
13077
|
"xai"
|
|
12402
13078
|
];
|
|
@@ -12411,6 +13087,13 @@ function canPreviewVoice(entity) {
|
|
|
12411
13087
|
return TTS_PREVIEW_PROVIDERS.includes(provider);
|
|
12412
13088
|
}
|
|
12413
13089
|
|
|
13090
|
+
// src/types/query-engine-types.ts
|
|
13091
|
+
var QUERY_VALUELESS_OPS = /* @__PURE__ */ new Set([
|
|
13092
|
+
"isEmpty",
|
|
13093
|
+
"notEmpty",
|
|
13094
|
+
"exists"
|
|
13095
|
+
]);
|
|
13096
|
+
|
|
12414
13097
|
// src/types/chat-types.ts
|
|
12415
13098
|
var SMS_DELIVERY_FAILURE_STATUSES = /* @__PURE__ */ new Set([
|
|
12416
13099
|
"failed",
|
|
@@ -12636,21 +13319,16 @@ var CHAT_TYPES = {
|
|
|
12636
13319
|
ASSIGNMENT: "assignment",
|
|
12637
13320
|
MANAGER: "manager",
|
|
12638
13321
|
CONTRIBUTOR: "contributor",
|
|
12639
|
-
|
|
12640
|
-
MEMBER: "member",
|
|
12641
|
-
/** @deprecated Use MEMBER instead */
|
|
12642
|
-
AGENT: "member",
|
|
12643
|
-
/** @deprecated Use MEMBER instead */
|
|
12644
|
-
DM: "member"
|
|
13322
|
+
DM: "dm"
|
|
12645
13323
|
};
|
|
12646
13324
|
var BUILTIN_ASSISTANT_CHAT_TYPES = /* @__PURE__ */ new Set([
|
|
12647
13325
|
CHAT_TYPES.MANAGER,
|
|
12648
|
-
CHAT_TYPES.CONTRIBUTOR
|
|
12649
|
-
CHAT_TYPES.DEVELOPER
|
|
13326
|
+
CHAT_TYPES.CONTRIBUTOR
|
|
12650
13327
|
]);
|
|
13328
|
+
var MEMBER_AGENT_CHAT_TYPES = /* @__PURE__ */ new Set([CHAT_TYPES.DM]);
|
|
12651
13329
|
var NO_ASSISTANT_PARTICIPANT_CHAT_TYPES = /* @__PURE__ */ new Set([
|
|
12652
13330
|
...BUILTIN_ASSISTANT_CHAT_TYPES,
|
|
12653
|
-
|
|
13331
|
+
...MEMBER_AGENT_CHAT_TYPES
|
|
12654
13332
|
]);
|
|
12655
13333
|
function usesBuiltinAssistant(chatType) {
|
|
12656
13334
|
return BUILTIN_ASSISTANT_CHAT_TYPES.has(chatType);
|
|
@@ -13477,6 +14155,7 @@ var SCOPE_PRESETS = {
|
|
|
13477
14155
|
DEFAULT_VOICE_INFERENCE_MODEL,
|
|
13478
14156
|
DataCategory,
|
|
13479
14157
|
DataFieldType,
|
|
14158
|
+
DataRecordRetirementResponseReason,
|
|
13480
14159
|
DataSensitivity,
|
|
13481
14160
|
DataTypeRecordScope,
|
|
13482
14161
|
DriverMode,
|
|
@@ -13500,6 +14179,9 @@ var SCOPE_PRESETS = {
|
|
|
13500
14179
|
McpServerState,
|
|
13501
14180
|
MemberFeature,
|
|
13502
14181
|
MemberFilterBuilder,
|
|
14182
|
+
MemberImportMatchInfoMatchType,
|
|
14183
|
+
MemberImportPreviewRowAction,
|
|
14184
|
+
MemberImportValidationError,
|
|
13503
14185
|
MemberLabelBuilder,
|
|
13504
14186
|
MemberType,
|
|
13505
14187
|
MenuItemResponseItemType,
|
|
@@ -13522,7 +14204,11 @@ var SCOPE_PRESETS = {
|
|
|
13522
14204
|
PERMISSION_NONE,
|
|
13523
14205
|
PERMISSION_USE,
|
|
13524
14206
|
PERMISSION_VERIFY,
|
|
14207
|
+
PIDS_DISPOSITIONS,
|
|
14208
|
+
PIDS_SOURCES,
|
|
13525
14209
|
ProductType,
|
|
14210
|
+
QUERY_VALUELESS_OPS,
|
|
14211
|
+
QueriesApi,
|
|
13526
14212
|
REALTIME_MODEL_CUSTOM,
|
|
13527
14213
|
REALTIME_MODEL_GEMINI,
|
|
13528
14214
|
REALTIME_MODEL_GEMINI_VERTEX,
|
|
@@ -13552,7 +14238,6 @@ var SCOPE_PRESETS = {
|
|
|
13552
14238
|
TTS_MODEL_ELEVENLABS_FLASH,
|
|
13553
14239
|
TTS_MODEL_ELEVENLABS_MULTILINGUAL,
|
|
13554
14240
|
TTS_MODEL_ELEVENLABS_TURBO,
|
|
13555
|
-
TTS_MODEL_POCKET,
|
|
13556
14241
|
TTS_PREVIEW_PROVIDERS,
|
|
13557
14242
|
TaskBuilder,
|
|
13558
14243
|
TemplatesApi,
|