@gravity-rail/sdk 0.7.4 → 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.
Files changed (43) hide show
  1. package/README.md +38 -0
  2. package/dist/{chunk-ANY7WLOD.js → chunk-2BJG4GYM.js} +778 -545
  3. package/dist/chunk-2BJG4GYM.js.map +1 -0
  4. package/dist/chunk-FSSXKQR5.js +471 -0
  5. package/dist/chunk-FSSXKQR5.js.map +1 -0
  6. package/dist/{chunk-QS6ZRQUZ.js → chunk-TJT7A4CO.js} +8 -1
  7. package/dist/{chunk-QS6ZRQUZ.js.map → chunk-TJT7A4CO.js.map} +1 -1
  8. package/dist/{client-B_cweJhP.d.cts → client-BffM3KcA.d.cts} +1367 -344
  9. package/dist/{client-C-on7whi.d.ts → client-DfjAYbt8.d.ts} +1367 -344
  10. package/dist/helpers.cjs +178 -2
  11. package/dist/helpers.cjs.map +1 -1
  12. package/dist/helpers.d.cts +82 -3
  13. package/dist/helpers.d.ts +82 -3
  14. package/dist/helpers.js +156 -1
  15. package/dist/helpers.js.map +1 -1
  16. package/dist/index.cjs +992 -174
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +14 -8
  19. package/dist/index.d.ts +14 -8
  20. package/dist/index.js +144 -20
  21. package/dist/index.js.map +1 -1
  22. package/dist/{inquiries-BX3PuU-7.d.cts → inquiries-UcWNYo-Q.d.cts} +567 -79
  23. package/dist/{inquiries-BX3PuU-7.d.ts → inquiries-UcWNYo-Q.d.ts} +567 -79
  24. package/dist/internal.cjs +925 -161
  25. package/dist/internal.cjs.map +1 -1
  26. package/dist/internal.d.cts +241 -5
  27. package/dist/internal.d.ts +241 -5
  28. package/dist/internal.js +71 -7
  29. package/dist/internal.js.map +1 -1
  30. package/dist/realtime.cjs +1 -0
  31. package/dist/realtime.cjs.map +1 -1
  32. package/dist/realtime.js +1 -0
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/schemas.cjs +40 -7
  35. package/dist/schemas.cjs.map +1 -1
  36. package/dist/schemas.d.cts +134 -51
  37. package/dist/schemas.d.ts +134 -51
  38. package/dist/schemas.js +40 -8
  39. package/dist/schemas.js.map +1 -1
  40. package/dist/{scopes-ColqadkM.d.ts → scopes-CjSvITpL.d.cts} +53 -8
  41. package/dist/{scopes-CNbQi30F.d.cts → scopes-CmNKWrzb.d.ts} +53 -8
  42. package/package.json +6 -6
  43. package/dist/chunk-ANY7WLOD.js.map +0 -1
package/dist/internal.cjs CHANGED
@@ -61,6 +61,12 @@ __export(internal_exports, {
61
61
  ConsentMethod: () => ConsentMethod,
62
62
  CriterionType: () => CriterionType,
63
63
  CustomToolkitsApi: () => CustomToolkitsApi,
64
+ CustomerActivityClassifierDetectorName: () => CustomerActivityClassifierDetectorName,
65
+ CustomerActivityClassifierLabel: () => CustomerActivityClassifierLabel,
66
+ CustomerActivityEventSource: () => CustomerActivityEventSource,
67
+ CustomerActivityEventStatus: () => CustomerActivityEventStatus,
68
+ CustomerActivityReviewOutcome: () => CustomerActivityReviewOutcome,
69
+ CustomerActivitySeverity: () => CustomerActivitySeverity,
64
70
  CustomersApi: () => CustomersApi,
65
71
  DEFAULT_CHAT_MODEL: () => DEFAULT_CHAT_MODEL,
66
72
  DEFAULT_CUSTOM_VOICE_MODEL: () => DEFAULT_CUSTOM_VOICE_MODEL,
@@ -68,6 +74,7 @@ __export(internal_exports, {
68
74
  DEFAULT_VOICE_INFERENCE_MODEL: () => DEFAULT_VOICE_INFERENCE_MODEL,
69
75
  DataCategory: () => DataCategory,
70
76
  DataFieldType: () => DataFieldType,
77
+ DataRecordRetirementResponseReason: () => DataRecordRetirementResponseReason,
71
78
  DataSensitivity: () => DataSensitivity,
72
79
  DataTypeRecordScope: () => DataTypeRecordScope,
73
80
  DataTypesApi: () => DataTypesApi,
@@ -100,6 +107,8 @@ __export(internal_exports, {
100
107
  McpServerState: () => McpServerState,
101
108
  McpServersApi: () => McpServersApi,
102
109
  MemberFeature: () => MemberFeature,
110
+ MemberImportMatchInfoMatchType: () => MemberImportMatchInfoMatchType,
111
+ MemberImportPreviewRowAction: () => MemberImportPreviewRowAction,
103
112
  MemberType: () => MemberType,
104
113
  MembersApi: () => MembersApi,
105
114
  MenuItemResponseItemType: () => MenuItemResponseItemType,
@@ -127,11 +136,14 @@ __export(internal_exports, {
127
136
  PERMISSION_NONE: () => PERMISSION_NONE,
128
137
  PERMISSION_USE: () => PERMISSION_USE,
129
138
  PERMISSION_VERIFY: () => PERMISSION_VERIFY,
139
+ PIDS_DISPOSITIONS: () => PIDS_DISPOSITIONS,
140
+ PIDS_SOURCES: () => PIDS_SOURCES,
130
141
  PersonasApi: () => PersonasApi,
131
142
  PhoneNumbersApi: () => PhoneNumbersApi,
132
143
  ProductType: () => ProductType,
133
144
  PromptsApi: () => PromptsApi,
134
145
  PronunciationsApi: () => PronunciationsApi,
146
+ QUERY_VALUELESS_OPS: () => QUERY_VALUELESS_OPS,
135
147
  QualificationsApi: () => QualificationsApi,
136
148
  REALTIME_MODEL_CUSTOM: () => REALTIME_MODEL_CUSTOM,
137
149
  REALTIME_MODEL_GEMINI: () => REALTIME_MODEL_GEMINI,
@@ -169,7 +181,6 @@ __export(internal_exports, {
169
181
  TTS_MODEL_ELEVENLABS_FLASH: () => TTS_MODEL_ELEVENLABS_FLASH,
170
182
  TTS_MODEL_ELEVENLABS_MULTILINGUAL: () => TTS_MODEL_ELEVENLABS_MULTILINGUAL,
171
183
  TTS_MODEL_ELEVENLABS_TURBO: () => TTS_MODEL_ELEVENLABS_TURBO,
172
- TTS_MODEL_POCKET: () => TTS_MODEL_POCKET,
173
184
  TTS_PREVIEW_PROVIDERS: () => TTS_PREVIEW_PROVIDERS,
174
185
  TasksApi: () => TasksApi,
175
186
  TemplatesApi: () => TemplatesApi,
@@ -209,6 +220,7 @@ __export(internal_exports, {
209
220
  bindPromptsMethods: () => bindPromptsMethods,
210
221
  bindPronunciationsMethods: () => bindPronunciationsMethods,
211
222
  bindQualificationsMethods: () => bindQualificationsMethods,
223
+ bindQueriesMethods: () => bindQueriesMethods,
212
224
  bindResellersMethods: () => bindResellersMethods,
213
225
  bindSitesMethods: () => bindSitesMethods,
214
226
  bindSupportRequestMethods: () => bindSupportRequestMethods,
@@ -373,6 +385,20 @@ var BulkMemberResultStatus = {
373
385
  updated: "updated",
374
386
  failed: "failed"
375
387
  };
388
+ var MemberImportMatchInfoMatchType = {
389
+ external_id: "external_id",
390
+ email: "email",
391
+ phone: "phone",
392
+ account_email: "account_email",
393
+ account_phone: "account_phone"
394
+ };
395
+ var MemberImportPreviewRowAction = {
396
+ create: "create",
397
+ update: "update",
398
+ unchanged: "unchanged",
399
+ conflict: "conflict",
400
+ error: "error"
401
+ };
376
402
 
377
403
  // src/types/member-types.ts
378
404
  var MemberType = /* @__PURE__ */ ((MemberType2) => {
@@ -416,6 +442,9 @@ var EventRuleObjectType = /* @__PURE__ */ ((EventRuleObjectType2) => {
416
442
  })(EventRuleObjectType || {});
417
443
  var EventRuleEventType = /* @__PURE__ */ ((EventRuleEventType2) => {
418
444
  EventRuleEventType2["TASK_EXECUTE"] = "task:execute";
445
+ EventRuleEventType2["TASK_ENTER"] = "task:enter";
446
+ EventRuleEventType2["TASK_COMMAND"] = "task:command";
447
+ EventRuleEventType2["TASK_EXIT"] = "task:exit";
419
448
  EventRuleEventType2["MEMBER_JOINED"] = "workspace:member_joined";
420
449
  EventRuleEventType2["MEMBER_LEFT"] = "workspace:member_left";
421
450
  EventRuleEventType2["DATA_RECORD_CREATED"] = "data_record:created";
@@ -449,6 +478,7 @@ var EventRuleActionType = /* @__PURE__ */ ((EventRuleActionType2) => {
449
478
  EventRuleActionType2["SWITCH_TASK_ACTION"] = "task:switch";
450
479
  EventRuleActionType2["ASSISTANT_MESSAGE"] = "assistant:message";
451
480
  EventRuleActionType2["FORM_FIELD_UPDATE"] = "form:update_field";
481
+ EventRuleActionType2["CEL_MUTATE"] = "record:cel_mutate";
452
482
  EventRuleActionType2["MESSAGE_VALIDATION"] = "message:validation";
453
483
  EventRuleActionType2["CHAT_CREATE"] = "chat:create";
454
484
  EventRuleActionType2["CHAT_CONTINUE"] = "chat:continue";
@@ -590,6 +620,12 @@ var InvitationStatus = /* @__PURE__ */ ((InvitationStatus2) => {
590
620
  return InvitationStatus2;
591
621
  })(InvitationStatus || {});
592
622
 
623
+ // src/types/generated/data.ts
624
+ var DataRecordRetirementResponseReason = {
625
+ monday_item_archived: "monday_item_archived",
626
+ monday_item_deleted: "monday_item_deleted"
627
+ };
628
+
593
629
  // src/types/data-types.ts
594
630
  var DataFieldType = /* @__PURE__ */ ((DataFieldType2) => {
595
631
  DataFieldType2["ENUM"] = "enum";
@@ -651,7 +687,6 @@ var ModelProvider = {
651
687
  aws: "aws",
652
688
  elevenlabs: "elevenlabs",
653
689
  deepgram: "deepgram",
654
- pocket: "pocket",
655
690
  xai: "xai",
656
691
  custom: "custom"
657
692
  };
@@ -681,7 +716,10 @@ var TTS_MODEL_ELEVENLABS_MULTILINGUAL = "elevenlabs:tts:eleven_multilingual_v2";
681
716
  var TTS_MODEL_DEEPGRAM_AURA_2 = "deepgram:tts:aura-2";
682
717
  var TTS_MODEL_AWS_POLLY_GENERATIVE = "aws:tts:polly-generative";
683
718
  var TTS_MODEL_AWS_POLLY_NEURAL = "aws:tts:polly-neural";
684
- var TTS_MODEL_POCKET = "pocket:tts:default";
719
+
720
+ // src/types/pids-types.ts
721
+ var PIDS_DISPOSITIONS = ["true_positive", "false_positive", "needs_more_context"];
722
+ var PIDS_SOURCES = ["scheduled", "backfill", "pre_llm"];
685
723
 
686
724
  // src/types/calendar-types.ts
687
725
  var CalendarPermissionType = /* @__PURE__ */ ((CalendarPermissionType2) => {
@@ -821,15 +859,20 @@ var AbilityTypeSlugs = {
821
859
  TOOLKITS: "tools:toolkits",
822
860
  WEB_SEARCH: "tools:web_search",
823
861
  CONVERSATION_HISTORY: "tools:conversation_history",
862
+ IMAGE_GENERATION: "tools:image_generation",
863
+ CONVERSATION_CONTROL: "tools:conversation_control",
824
864
  // Integration
825
865
  CALENDAR_BOOKING: "integration:calendar_booking",
826
866
  FILE_ACCESS: "integration:file_access",
827
867
  DATA_ACCESS: "integration:data_access",
828
868
  GMAIL: "integration:gmail",
869
+ GOOGLE_CALENDAR: "integration:google_calendar",
870
+ GOOGLE_DRIVE: "integration:google_drive",
829
871
  CHARLESTON_PMD_PAGING: "integration:charleston_pmd_paging",
830
872
  // Communication
831
873
  PHONE_CALL_TOOLS: "communication:phone_call_tools",
832
874
  SEND_SMS: "communication:send_sms",
875
+ SEND_WHATSAPP: "communication:send_whatsapp",
833
876
  MEMBER_ACCESS: "communication:member_access",
834
877
  AUDIO_PLAYBACK: "communication:audio_playback",
835
878
  // Oversight
@@ -838,12 +881,69 @@ var AbilityTypeSlugs = {
838
881
  ESCALATION: "oversight:escalation",
839
882
  // Identity
840
883
  MEMBER_FIELD_VERIFICATION: "identity:member_field_verification",
884
+ // Delegation
885
+ CONTRIBUTOR: "delegation:contributor",
886
+ // Workflow
887
+ WORKFLOW_RUN: "workflow:run",
888
+ // Commerce
889
+ RESELLER: "commerce:reseller",
841
890
  // System (auto-injected, hidden from users)
842
891
  USER_MESSAGE_RULES: "system:user_message_rules",
843
892
  ASSISTANT_MESSAGE_RULES: "chat:assistant_message_rules",
844
893
  CEL_ROUTING: "system:cel_routing"
845
894
  };
846
895
 
896
+ // src/types/query-engine-types.ts
897
+ var QUERY_VALUELESS_OPS = /* @__PURE__ */ new Set([
898
+ "isEmpty",
899
+ "notEmpty",
900
+ "exists"
901
+ ]);
902
+
903
+ // src/types/generated/customer_activity.ts
904
+ var CustomerActivityClassifierDetectorName = {
905
+ assignment_chat_classifier: "assignment_chat_classifier",
906
+ manager_chat_classifier: "manager_chat_classifier",
907
+ concierge_chat_classifier: "concierge_chat_classifier",
908
+ chat_review: "chat_review"
909
+ };
910
+ var CustomerActivityClassifierLabel = {
911
+ user_distress: "user_distress",
912
+ user_confusion: "user_confusion",
913
+ health_topic_mentioned: "health_topic_mentioned",
914
+ health_advice_given: "health_advice_given",
915
+ escalation_failure: "escalation_failure",
916
+ repeated_tool_failure: "repeated_tool_failure",
917
+ transcription_quality: "transcription_quality",
918
+ repetitive_loop: "repetitive_loop"
919
+ };
920
+ var CustomerActivityEventSource = {
921
+ system: "system",
922
+ customer: "customer",
923
+ classifier: "classifier",
924
+ operator: "operator"
925
+ };
926
+ var CustomerActivityEventStatus = {
927
+ new: "new",
928
+ reviewed: "reviewed"
929
+ };
930
+ var CustomerActivityReviewOutcome = {
931
+ no_action_needed: "no_action_needed",
932
+ support_request_created: "support_request_created",
933
+ bug_filed: "bug_filed",
934
+ linked_existing_work: "linked_existing_work",
935
+ classifier_feedback: "classifier_feedback",
936
+ test_activity: "test_activity"
937
+ };
938
+ var CustomerActivitySeverity = {
939
+ none: "none",
940
+ minimal: "minimal",
941
+ low: "low",
942
+ medium: "medium",
943
+ high: "high",
944
+ critical: "critical"
945
+ };
946
+
847
947
  // src/types/model-config-types.ts
848
948
  var DEFAULT_THINKING_SPEECH_PHRASES = [
849
949
  "One moment please",
@@ -859,7 +959,6 @@ var TTS_PREVIEW_PROVIDERS = [
859
959
  "elevenlabs",
860
960
  "google",
861
961
  "aws",
862
- "pocket",
863
962
  "deepgram",
864
963
  "xai"
865
964
  ];
@@ -1305,21 +1404,16 @@ var CHAT_TYPES = {
1305
1404
  ASSIGNMENT: "assignment",
1306
1405
  MANAGER: "manager",
1307
1406
  CONTRIBUTOR: "contributor",
1308
- DEVELOPER: "developer",
1309
- MEMBER: "member",
1310
- /** @deprecated Use MEMBER instead */
1311
- AGENT: "member",
1312
- /** @deprecated Use MEMBER instead */
1313
- DM: "member"
1407
+ DM: "dm"
1314
1408
  };
1315
1409
  var BUILTIN_ASSISTANT_CHAT_TYPES = /* @__PURE__ */ new Set([
1316
1410
  CHAT_TYPES.MANAGER,
1317
- CHAT_TYPES.CONTRIBUTOR,
1318
- CHAT_TYPES.DEVELOPER
1411
+ CHAT_TYPES.CONTRIBUTOR
1319
1412
  ]);
1413
+ var MEMBER_AGENT_CHAT_TYPES = /* @__PURE__ */ new Set([CHAT_TYPES.DM]);
1320
1414
  var NO_ASSISTANT_PARTICIPANT_CHAT_TYPES = /* @__PURE__ */ new Set([
1321
1415
  ...BUILTIN_ASSISTANT_CHAT_TYPES,
1322
- CHAT_TYPES.MEMBER
1416
+ ...MEMBER_AGENT_CHAT_TYPES
1323
1417
  ]);
1324
1418
  function usesBuiltinAssistant(chatType) {
1325
1419
  return BUILTIN_ASSISTANT_CHAT_TYPES.has(chatType);
@@ -2030,6 +2124,22 @@ function parseOrgAuthChallenge(wwwAuthenticate) {
2030
2124
  authUrl: authUrlMatch[1]
2031
2125
  };
2032
2126
  }
2127
+ function getRequestOrgCookieName(cookieName) {
2128
+ if (cookieName.startsWith("orgToken")) {
2129
+ return cookieName.replace(/^orgToken/, "requestOrgToken");
2130
+ }
2131
+ if (cookieName.startsWith("orgSession")) {
2132
+ return cookieName.replace(/^orgSession/, "requestOrgSession");
2133
+ }
2134
+ return null;
2135
+ }
2136
+ function orgAuthHeaderName(token) {
2137
+ return token.startsWith("gr_sess_") ? "X-Org-Session" : "X-Org-Token";
2138
+ }
2139
+ function setOrgAuthHeader(headers, token) {
2140
+ if (!token) return;
2141
+ headers.set(orgAuthHeaderName(token), token);
2142
+ }
2033
2143
  var BaseApiClient = class {
2034
2144
  baseUrl;
2035
2145
  apiKey;
@@ -2040,15 +2150,15 @@ var BaseApiClient = class {
2040
2150
  orgAuthHandler;
2041
2151
  orgAuthInProgress = null;
2042
2152
  actingMemberUuid;
2043
- orgToken;
2153
+ orgSession;
2044
2154
  /**
2045
- * The org_uuid that issued the current orgToken. Tracked so we can detect
2155
+ * The org_uuid that issued the current org auth credential. Tracked so we can detect
2046
2156
  * a 401 challenge from a *different* org and re-fire the handler — the
2047
- * orgToken is an opaque JWE we cannot decrypt client-side, so without this
2048
- * the original guard `!this.orgToken` would prevent re-auth across orgs and
2049
- * surface as a silent 401 in multi-org CLI workflows.
2157
+ * credential is opaque to the client, so without this the original guard
2158
+ * `!this.orgSession` would prevent re-auth across orgs and surface as a silent
2159
+ * 401 in multi-org CLI workflows.
2050
2160
  */
2051
- orgTokenOrgUuid;
2161
+ orgSessionOrgUuid;
2052
2162
  constructor(apiKey, baseUrl, customFetch) {
2053
2163
  this.baseUrl = baseUrl;
2054
2164
  this.apiKey = apiKey;
@@ -2095,18 +2205,25 @@ var BaseApiClient = class {
2095
2205
  return this.actingMemberUuid;
2096
2206
  }
2097
2207
  /**
2098
- * Set the org token for cross-domain requests.
2099
- * When set, all API requests will include the X-Org-Token header,
2100
- * allowing org-level SSO verification without cookies.
2208
+ * Set the opaque org session credential for cross-domain requests.
2209
+ * Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still
2210
+ * use X-Org-Token through setOrgToken() during the migration window.
2101
2211
  *
2102
- * `orgUuid` is the org that issued the token; passing it lets the 401
2103
- * handler detect a stale token when a subsequent request targets a
2212
+ * `orgUuid` is the org that issued the credential; passing it lets the 401
2213
+ * handler detect a stale session when a subsequent request targets a
2104
2214
  * different org and re-fire the org-auth handler instead of silently
2105
2215
  * 401-ing. Callers without that context (legacy / unknown) may omit it.
2106
2216
  */
2217
+ setOrgSession(session, orgUuid) {
2218
+ this.orgSession = session;
2219
+ this.orgSessionOrgUuid = session ? orgUuid : void 0;
2220
+ }
2221
+ /**
2222
+ * @deprecated Legacy compatibility for stateless orgToken JWE credentials.
2223
+ * Prefer setOrgSession() for opaque org browser sessions.
2224
+ */
2107
2225
  setOrgToken(token, orgUuid) {
2108
- this.orgToken = token;
2109
- this.orgTokenOrgUuid = token ? orgUuid : void 0;
2226
+ this.setOrgSession(token, orgUuid);
2110
2227
  }
2111
2228
  async fetch(endpoint, options) {
2112
2229
  try {
@@ -2127,9 +2244,7 @@ var BaseApiClient = class {
2127
2244
  if (this.actingMemberUuid) {
2128
2245
  headers.set("X-Acting-Member", this.actingMemberUuid);
2129
2246
  }
2130
- if (this.orgToken) {
2131
- headers.set("X-Org-Token", this.orgToken);
2132
- }
2247
+ setOrgAuthHeader(headers, this.orgSession);
2133
2248
  const fullUrl = `${this.baseUrl}/api/v2/${endpoint}`;
2134
2249
  const response = await this.fetchFunction(fullUrl, {
2135
2250
  ...options,
@@ -2153,31 +2268,28 @@ var BaseApiClient = class {
2153
2268
  try {
2154
2269
  return await this.fetch(endpoint, options);
2155
2270
  } catch (retryError) {
2156
- this.orgToken = void 0;
2157
- this.orgTokenOrgUuid = void 0;
2271
+ this.orgSession = void 0;
2272
+ this.orgSessionOrgUuid = void 0;
2158
2273
  throw retryError;
2159
2274
  }
2160
2275
  }
2161
2276
  if (response.status === 401) {
2162
2277
  const orgAuthInfo = parseOrgAuthChallenge(response.headers.get("WWW-Authenticate"));
2163
- if (orgAuthInfo && this.orgToken && this.orgTokenOrgUuid && this.orgTokenOrgUuid !== orgAuthInfo.orgUuid) {
2164
- this.orgToken = void 0;
2165
- this.orgTokenOrgUuid = void 0;
2278
+ if (orgAuthInfo && this.orgSession && this.orgSessionOrgUuid && this.orgSessionOrgUuid !== orgAuthInfo.orgUuid) {
2279
+ this.orgSession = void 0;
2280
+ this.orgSessionOrgUuid = void 0;
2166
2281
  }
2167
- if (orgAuthInfo && !this.orgToken) {
2168
- const requestCookieName = orgAuthInfo.cookieName.replace(
2169
- /^orgToken/,
2170
- "requestOrgToken"
2171
- );
2172
- const cachedOrgToken = getCookieValue(requestCookieName);
2173
- if (cachedOrgToken) {
2174
- this.orgToken = cachedOrgToken;
2175
- this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
2282
+ if (orgAuthInfo && !this.orgSession) {
2283
+ const requestCookieName = getRequestOrgCookieName(orgAuthInfo.cookieName);
2284
+ const cachedOrgSession = requestCookieName ? getCookieValue(requestCookieName) : void 0;
2285
+ if (cachedOrgSession) {
2286
+ this.orgSession = cachedOrgSession;
2287
+ this.orgSessionOrgUuid = orgAuthInfo.orgUuid;
2176
2288
  try {
2177
2289
  return await this.fetch(endpoint, options);
2178
2290
  } catch (retryError) {
2179
- this.orgToken = void 0;
2180
- this.orgTokenOrgUuid = void 0;
2291
+ this.orgSession = void 0;
2292
+ this.orgSessionOrgUuid = void 0;
2181
2293
  throw retryError;
2182
2294
  }
2183
2295
  }
@@ -2193,20 +2305,20 @@ var BaseApiClient = class {
2193
2305
  })();
2194
2306
  }
2195
2307
  await this.orgAuthInProgress;
2196
- const postHandlerToken = getCookieValue(requestCookieName) ?? this.orgToken;
2197
- if (!postHandlerToken) {
2308
+ const postHandlerSession = (requestCookieName ? getCookieValue(requestCookieName) : void 0) ?? this.orgSession;
2309
+ if (!postHandlerSession) {
2198
2310
  throw new ApiError(
2199
- "Organization authentication did not issue a token",
2311
+ "Organization authentication did not issue a session",
2200
2312
  401
2201
2313
  );
2202
2314
  }
2203
- this.orgToken = postHandlerToken;
2204
- this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
2315
+ this.orgSession = postHandlerSession;
2316
+ this.orgSessionOrgUuid = orgAuthInfo.orgUuid;
2205
2317
  try {
2206
2318
  return await this.fetch(endpoint, options);
2207
2319
  } catch (retryError) {
2208
- this.orgToken = void 0;
2209
- this.orgTokenOrgUuid = void 0;
2320
+ this.orgSession = void 0;
2321
+ this.orgSessionOrgUuid = void 0;
2210
2322
  throw retryError;
2211
2323
  }
2212
2324
  }
@@ -2281,9 +2393,7 @@ ${formattedErrors}`, response.status);
2281
2393
  if (this.actingMemberUuid) {
2282
2394
  headers.set("X-Acting-Member", this.actingMemberUuid);
2283
2395
  }
2284
- if (this.orgToken) {
2285
- headers.set("X-Org-Token", this.orgToken);
2286
- }
2396
+ setOrgAuthHeader(headers, this.orgSession);
2287
2397
  const response = await this.fetchFunction(`${this.baseUrl}/api/v2/${endpoint}`, {
2288
2398
  ...options,
2289
2399
  ...this.apiKey ? {} : { credentials: "include" },
@@ -2306,31 +2416,28 @@ ${formattedErrors}`, response.status);
2306
2416
  try {
2307
2417
  return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
2308
2418
  } catch (retryError) {
2309
- this.orgToken = void 0;
2310
- this.orgTokenOrgUuid = void 0;
2419
+ this.orgSession = void 0;
2420
+ this.orgSessionOrgUuid = void 0;
2311
2421
  throw retryError;
2312
2422
  }
2313
2423
  }
2314
2424
  if (response.status === 401) {
2315
2425
  const orgAuthInfo = parseOrgAuthChallenge(response.headers.get("WWW-Authenticate"));
2316
- if (orgAuthInfo && this.orgToken && this.orgTokenOrgUuid && this.orgTokenOrgUuid !== orgAuthInfo.orgUuid) {
2317
- this.orgToken = void 0;
2318
- this.orgTokenOrgUuid = void 0;
2426
+ if (orgAuthInfo && this.orgSession && this.orgSessionOrgUuid && this.orgSessionOrgUuid !== orgAuthInfo.orgUuid) {
2427
+ this.orgSession = void 0;
2428
+ this.orgSessionOrgUuid = void 0;
2319
2429
  }
2320
- if (orgAuthInfo && !this.orgToken) {
2321
- const requestCookieName = orgAuthInfo.cookieName.replace(
2322
- /^orgToken/,
2323
- "requestOrgToken"
2324
- );
2325
- const cachedOrgToken = getCookieValue(requestCookieName);
2326
- if (cachedOrgToken) {
2327
- this.orgToken = cachedOrgToken;
2328
- this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
2430
+ if (orgAuthInfo && !this.orgSession) {
2431
+ const requestCookieName = getRequestOrgCookieName(orgAuthInfo.cookieName);
2432
+ const cachedOrgSession = requestCookieName ? getCookieValue(requestCookieName) : void 0;
2433
+ if (cachedOrgSession) {
2434
+ this.orgSession = cachedOrgSession;
2435
+ this.orgSessionOrgUuid = orgAuthInfo.orgUuid;
2329
2436
  try {
2330
2437
  return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
2331
2438
  } catch (retryError) {
2332
- this.orgToken = void 0;
2333
- this.orgTokenOrgUuid = void 0;
2439
+ this.orgSession = void 0;
2440
+ this.orgSessionOrgUuid = void 0;
2334
2441
  throw retryError;
2335
2442
  }
2336
2443
  }
@@ -2346,20 +2453,20 @@ ${formattedErrors}`, response.status);
2346
2453
  })();
2347
2454
  }
2348
2455
  await this.orgAuthInProgress;
2349
- const postHandlerToken = getCookieValue(requestCookieName) ?? this.orgToken;
2350
- if (!postHandlerToken) {
2456
+ const postHandlerSession = (requestCookieName ? getCookieValue(requestCookieName) : void 0) ?? this.orgSession;
2457
+ if (!postHandlerSession) {
2351
2458
  throw new ApiError(
2352
- "Organization authentication did not issue a token",
2459
+ "Organization authentication did not issue a session",
2353
2460
  401
2354
2461
  );
2355
2462
  }
2356
- this.orgToken = postHandlerToken;
2357
- this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
2463
+ this.orgSession = postHandlerSession;
2464
+ this.orgSessionOrgUuid = orgAuthInfo.orgUuid;
2358
2465
  try {
2359
2466
  return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
2360
2467
  } catch (retryError) {
2361
- this.orgToken = void 0;
2362
- this.orgTokenOrgUuid = void 0;
2468
+ this.orgSession = void 0;
2469
+ this.orgSessionOrgUuid = void 0;
2363
2470
  throw retryError;
2364
2471
  }
2365
2472
  }
@@ -2398,9 +2505,7 @@ ${formattedErrors}`, response.status);
2398
2505
  if (this.actingMemberUuid) {
2399
2506
  headers.set("X-Acting-Member", this.actingMemberUuid);
2400
2507
  }
2401
- if (this.orgToken) {
2402
- headers.set("X-Org-Token", this.orgToken);
2403
- }
2508
+ setOrgAuthHeader(headers, this.orgSession);
2404
2509
  const fullUrl = `${this.baseUrl}/${path}`;
2405
2510
  const response = await this.fetchFunction(fullUrl, {
2406
2511
  ...options,
@@ -2430,10 +2535,52 @@ ${formattedErrors}`, response.status);
2430
2535
  // src/api/abilities.ts
2431
2536
  var AbilitiesApi = class extends BaseApiClient {
2432
2537
  /**
2433
- * List all available ability types from the registry.
2538
+ * List available ability types from the registry.
2539
+ * Pass includeSystem to also return auto-injected system abilities.
2540
+ */
2541
+ async getAbilityTypes(wid, options = {}) {
2542
+ const params = new URLSearchParams();
2543
+ if (options.includeSystem) params.append("includeSystem", "true");
2544
+ const qs = params.toString() ? `?${params.toString()}` : "";
2545
+ return this.fetch(`w/${wid}/abilities/types${qs}`);
2546
+ }
2547
+ /** Get the full spec for a single ability type by slug. */
2548
+ async getAbilityType(wid, slug) {
2549
+ return this.fetch(
2550
+ `w/${wid}/abilities/types/${encodeURIComponent(slug)}`
2551
+ );
2552
+ }
2553
+ /**
2554
+ * List configured ability instances for a workflow or task scope.
2555
+ * Exactly one of workflowId / taskId must be provided.
2434
2556
  */
2435
- async getAbilityTypes(wid) {
2436
- return this.fetch(`w/${wid}/abilities/types`);
2557
+ async listAbilities(wid, options) {
2558
+ const params = new URLSearchParams();
2559
+ if (options.workflowId !== void 0)
2560
+ params.append("workflowId", options.workflowId.toString());
2561
+ if (options.taskId !== void 0)
2562
+ params.append("taskId", options.taskId.toString());
2563
+ return this.fetch(`w/${wid}/abilities?${params}`);
2564
+ }
2565
+ /** Create (enable) a configured ability on a workflow or task scope. */
2566
+ async createAbility(wid, body) {
2567
+ return this.fetch(`w/${wid}/abilities`, {
2568
+ method: "POST",
2569
+ body: JSON.stringify(body)
2570
+ });
2571
+ }
2572
+ /** Update a configured ability (configure / enable / disable) by UUID. */
2573
+ async updateAbility(wid, abilityUuid, body) {
2574
+ return this.fetch(`w/${wid}/abilities/${abilityUuid}`, {
2575
+ method: "PATCH",
2576
+ body: JSON.stringify(body)
2577
+ });
2578
+ }
2579
+ /** Delete a configured ability instance by UUID. */
2580
+ async deleteAbility(wid, abilityUuid) {
2581
+ return this.fetch(`w/${wid}/abilities/${abilityUuid}`, {
2582
+ method: "DELETE"
2583
+ });
2437
2584
  }
2438
2585
  };
2439
2586
 
@@ -2596,9 +2743,21 @@ var AgentsApi = class extends BaseApiClient {
2596
2743
  async resolveAgentTools(wid, id, options) {
2597
2744
  const params = new URLSearchParams();
2598
2745
  params.append("channel", options.channel);
2599
- params.append("taskId", options.taskId.toString());
2746
+ if (options.taskId !== void 0) params.append("taskId", options.taskId.toString());
2747
+ if (options.taskUuid !== void 0) params.append("taskUuid", options.taskUuid);
2600
2748
  return this.fetch(`w/${wid}/agents/${id}/resolve-tools?${params}`);
2601
2749
  }
2750
+ /**
2751
+ * List the configured abilities effective for an agent via a task's workflow.
2752
+ * Requires taskId because abilities are scoped to workflows/tasks, not agents.
2753
+ */
2754
+ async listAgentAbilities(wid, id, options) {
2755
+ const params = new URLSearchParams();
2756
+ params.append("taskId", options.taskId.toString());
2757
+ return this.fetch(
2758
+ `w/${wid}/agents/${id}/abilities?${params}`
2759
+ );
2760
+ }
2602
2761
  };
2603
2762
 
2604
2763
  // src/api/ai-models.ts
@@ -2656,7 +2815,11 @@ var AIModelsApi = class extends BaseApiClient {
2656
2815
  return this.fetch(url);
2657
2816
  }
2658
2817
  /**
2659
- * Get available speech-to-text models
2818
+ * Get available speech-to-text models.
2819
+ *
2820
+ * Returns the per-shape `STTModelsResponse` so callers see `languages` and
2821
+ * `capabilities` on each model (the chat-shape `AIModelsResponse` it used
2822
+ * to return doesn't include either).
2660
2823
  */
2661
2824
  async getSTTModels(provider) {
2662
2825
  const searchParams = new URLSearchParams();
@@ -3051,15 +3214,11 @@ var AuthApi = class extends BaseApiClient {
3051
3214
  body: JSON.stringify({ email, organizationUuid, redirectUrl })
3052
3215
  });
3053
3216
  }
3054
- /** Validate a magic link token and optional OTP to complete authentication. */
3055
- async validateMagicLink(token, otp) {
3056
- const body = { token };
3057
- if (otp) {
3058
- body.otp = otp;
3059
- }
3217
+ /** Validate a magic link token to complete authentication. */
3218
+ async validateMagicLink(token) {
3060
3219
  return await this.fetch(`auth/validate-magic-link`, {
3061
3220
  method: "POST",
3062
- body: JSON.stringify(body)
3221
+ body: JSON.stringify({ token })
3063
3222
  });
3064
3223
  }
3065
3224
  // ===== EMAIL VERIFICATION METHODS =====
@@ -3565,6 +3724,26 @@ var CallsApi = class extends BaseApiClient {
3565
3724
  async getMessageTiming(wid, chatId) {
3566
3725
  return this.fetch(`w/${wid}/recordings/chat/${chatId}/message-timing`);
3567
3726
  }
3727
+ /** List the recorded audio chunks for a chat (metadata only). */
3728
+ async listChatRecordings(wid, chatId, options = {}) {
3729
+ const params = new URLSearchParams();
3730
+ if (options.role) params.set("role", options.role);
3731
+ return this.fetch(
3732
+ `w/${wid}/recordings/chat/${chatId}${params.toString() ? `?${params.toString()}` : ""}`
3733
+ );
3734
+ }
3735
+ /**
3736
+ * Get a single short-lived presigned URL to download the complete call
3737
+ * recording as one WAV file. The first request assembles + caches the
3738
+ * full-call WAV; later requests reuse it.
3739
+ */
3740
+ async getCallRecordingDownloadUrl(wid, chatId, options = {}) {
3741
+ const params = new URLSearchParams();
3742
+ if (options.expiresIn !== void 0) params.set("expires_in", String(options.expiresIn));
3743
+ return this.fetch(
3744
+ `w/${wid}/recordings/chat/${chatId}/download-url${params.toString() ? `?${params.toString()}` : ""}`
3745
+ );
3746
+ }
3568
3747
  };
3569
3748
 
3570
3749
  // src/api/cel.ts
@@ -3649,6 +3828,17 @@ var ChatsApi = class extends BaseApiClient {
3649
3828
  async getChatTokenUsage(wid, chatId) {
3650
3829
  return this.fetch(`w/${wid}/chats/${chatId}/token-usage`);
3651
3830
  }
3831
+ /** List scheduled callbacks for a chat (newest first). */
3832
+ async getChatCallbacks(wid, chatId) {
3833
+ return this.fetch(`w/${wid}/chats/${chatId}/callbacks`);
3834
+ }
3835
+ /** Cancel a pending scheduled callback on a chat. */
3836
+ async cancelChatCallback(wid, chatId, callbackId) {
3837
+ return this.fetch(
3838
+ `w/${wid}/chats/${chatId}/callbacks/${callbackId}/cancel`,
3839
+ { method: "POST" }
3840
+ );
3841
+ }
3652
3842
  /** Get todo items extracted from a chat. */
3653
3843
  async getChatTodos(wid, chatId) {
3654
3844
  return this.fetch(`w/${wid}/chats/${chatId}/todos`);
@@ -3687,9 +3877,11 @@ var ChatsApi = class extends BaseApiClient {
3687
3877
  }
3688
3878
  /** Create a new chat. */
3689
3879
  async createChat(wid, chat) {
3880
+ const { agentMemberId, ...rest } = chat;
3881
+ const payload = agentMemberId !== void 0 && rest.assistantMemberId === void 0 ? { ...rest, assistantMemberId: agentMemberId } : rest;
3690
3882
  return this.fetch(`w/${wid}/chats`, {
3691
3883
  method: "POST",
3692
- body: JSON.stringify(chat)
3884
+ body: JSON.stringify(payload)
3693
3885
  });
3694
3886
  }
3695
3887
  /**
@@ -3752,7 +3944,8 @@ var ChatsApi = class extends BaseApiClient {
3752
3944
  }
3753
3945
  );
3754
3946
  }
3755
- /** List messages in a chat with optional pagination. */
3947
+ /** List messages in a chat with optional pagination.
3948
+ * ``id`` is the numeric chat id (documented) or the chat uuid (accepted). */
3756
3949
  async getChatMessages(wid, id, limit, offset) {
3757
3950
  const params = new URLSearchParams();
3758
3951
  if (limit) params.append("limit", limit.toString());
@@ -4132,6 +4325,7 @@ var DataTypesApi = class extends BaseApiClient {
4132
4325
  async getDataRecords(wid, dataTypeId, options) {
4133
4326
  const params = new URLSearchParams();
4134
4327
  if (options?.memberId !== void 0) params.append("member_id", options.memberId.toString());
4328
+ if (options?.memberIds?.length) params.append("member_ids", options.memberIds.join(","));
4135
4329
  if (options?.search) params.append("search", options.search);
4136
4330
  if (options?.searchField) params.append("search_field", options.searchField);
4137
4331
  if (options?.page) params.append("page", options.page.toString());
@@ -4536,6 +4730,13 @@ var EventsApi = class extends BaseApiClient {
4536
4730
  method: "DELETE"
4537
4731
  });
4538
4732
  }
4733
+ /** Send a one-off test webhook for an existing webhook event rule. */
4734
+ async testWebhook(wid, id, request) {
4735
+ return this.fetch(`w/${wid}/event-rules/${id}/test-webhook`, {
4736
+ method: "POST",
4737
+ body: JSON.stringify(request)
4738
+ });
4739
+ }
4539
4740
  /** Reorder event rules by specifying the desired rule ID sequence. */
4540
4741
  async reorderEventRules(wid, ruleIds) {
4541
4742
  return this.fetch(`w/${wid}/event-rules/reorder`, {
@@ -5013,6 +5214,25 @@ var FhirConnectionsApi = class extends BaseApiClient {
5013
5214
  }
5014
5215
  };
5015
5216
 
5217
+ // src/api/patientsync-connections.ts
5218
+ var PatientSyncConnectionsApi = class extends BaseApiClient {
5219
+ /** Create or update the workspace's PatientSync connection (singleton). */
5220
+ async configurePatientSync(wid, data) {
5221
+ return this.fetch(
5222
+ `w/${wid}/app-connections/patientsync/configure`,
5223
+ { method: "POST", body: JSON.stringify(data) }
5224
+ );
5225
+ }
5226
+ /** Read the PatientSync connection status (never returns the API key). */
5227
+ async getPatientSyncStatus(wid) {
5228
+ return this.fetch(`w/${wid}/app-connections/patientsync/status`);
5229
+ }
5230
+ /** Delete the workspace's PatientSync connection. */
5231
+ async deletePatientSyncConnection(wid) {
5232
+ return this.fetch(`w/${wid}/app-connections/patientsync/`, { method: "DELETE" });
5233
+ }
5234
+ };
5235
+
5016
5236
  // src/api/healthie.ts
5017
5237
  var HealthieApi = class extends BaseApiClient {
5018
5238
  async configureHealthie(wid, data) {
@@ -5133,6 +5353,18 @@ var FilesApi = class extends BaseApiClient {
5133
5353
  async getFile(wid, id) {
5134
5354
  return this.fetch(`w/${wid}/files/${id}`);
5135
5355
  }
5356
+ /**
5357
+ * Download the given files + folders (folders recursively) as a single ZIP.
5358
+ * Returns the raw archive bytes for the caller to save.
5359
+ */
5360
+ async downloadFilesZip(wid, fileIds, folderIds) {
5361
+ const response = await this.fetchRaw(`w/${wid}/files/download/zip`, {
5362
+ method: "POST",
5363
+ headers: { "Content-Type": "application/json" },
5364
+ body: JSON.stringify({ file_ids: fileIds, folder_ids: folderIds })
5365
+ });
5366
+ return response.blob();
5367
+ }
5136
5368
  /** Create a new file record in the workspace. */
5137
5369
  async createFile(wid, file) {
5138
5370
  return this.fetch(`w/${wid}/files`, {
@@ -5623,6 +5855,12 @@ var AppConnectionsApi = class extends BaseApiClient {
5623
5855
  * values are intentionally never exposed. Operators can also add a
5624
5856
  * new key via the UI's "Add custom field key" free-text action.
5625
5857
  */
5858
+ async setDefaultGooglePlatformAccount(wid, connectionUuid, credentialUuid) {
5859
+ return this.fetch(
5860
+ `w/${wid}/app-connections/google/platform-apps/${connectionUuid}/accounts/${credentialUuid}/default`,
5861
+ { method: "POST" }
5862
+ );
5863
+ }
5626
5864
  async listConnectionMemberFieldKeys(wid, connectionId) {
5627
5865
  return this.fetch(
5628
5866
  `w/${wid}/app-connections/${connectionId}/member-field-keys`
@@ -5743,6 +5981,31 @@ var McpServersApi = class extends BaseApiClient {
5743
5981
  };
5744
5982
 
5745
5983
  // src/api/members.ts
5984
+ var MemberImportValidationError = class extends Error {
5985
+ validationErrors;
5986
+ constructor(message, validationErrors) {
5987
+ super(message);
5988
+ this.name = "MemberImportValidationError";
5989
+ this.validationErrors = validationErrors;
5990
+ }
5991
+ };
5992
+ function throwMemberImportError(errorBody, fallback) {
5993
+ let detail = errorBody?.detail;
5994
+ if (typeof detail === "string") {
5995
+ try {
5996
+ const parsed = JSON.parse(detail);
5997
+ if (parsed && typeof parsed === "object") detail = parsed;
5998
+ } catch {
5999
+ }
6000
+ }
6001
+ if (detail && typeof detail === "object") {
6002
+ const { message, errors } = detail;
6003
+ if (Array.isArray(errors)) {
6004
+ throw new MemberImportValidationError(message || fallback, errors);
6005
+ }
6006
+ }
6007
+ throw new Error(typeof detail === "string" ? detail : fallback);
6008
+ }
5746
6009
  var MembersApi = class extends BaseApiClient {
5747
6010
  /** Get the currently authenticated member for a workspace. */
5748
6011
  async getCurrentMember(wid) {
@@ -5783,8 +6046,10 @@ var MembersApi = class extends BaseApiClient {
5783
6046
  });
5784
6047
  }
5785
6048
  /** List workspace members with pagination, filtering, and sorting. */
5786
- async getWorkspaceMembers(wid, page = 1, pageSize = 10, filters, search, role, sortBy, sortOrder, memberType, isArchived = false, isManager, memberTypes, hasAccount, excludeIds) {
6049
+ async getWorkspaceMembers(wid, page = 1, pageSize = 10, filters, search, role, sortBy, sortOrder, memberType, isArchived = false, isManager, memberTypes, hasAccount, excludeIds, memberFilterId, query) {
5787
6050
  const params = new URLSearchParams();
6051
+ if (memberFilterId != null) params.append("memberFilterId", memberFilterId.toString());
6052
+ if (query != null) params.append("query", JSON.stringify(query));
5788
6053
  if (page) params.append("page", page.toString());
5789
6054
  if (pageSize) params.append("pageSize", pageSize.toString());
5790
6055
  if (sortBy) params.append("sortBy", sortBy);
@@ -5857,6 +6122,17 @@ var MembersApi = class extends BaseApiClient {
5857
6122
  method: "POST"
5858
6123
  });
5859
6124
  }
6125
+ /**
6126
+ * Send the member an SMS asking them to confirm their phone number. When they
6127
+ * reply, a trusted phone auth binding is created so they can use SMS as
6128
+ * themselves without an account (member-attested alternative to the
6129
+ * members:admin "Trusted" override).
6130
+ */
6131
+ async sendMemberPhoneConfirmation(wid, memberId) {
6132
+ return this.fetch(`w/${wid}/members/${memberId}/phone-confirmation`, {
6133
+ method: "POST"
6134
+ });
6135
+ }
5860
6136
  // Member Filter APIs
5861
6137
  /** List all saved member filters for a workspace. */
5862
6138
  async getMemberFilters(wid) {
@@ -5880,6 +6156,22 @@ var MembersApi = class extends BaseApiClient {
5880
6156
  body: JSON.stringify(data)
5881
6157
  });
5882
6158
  }
6159
+ /**
6160
+ * Convert a legacy rules filter to a query-engine predicate. One-way and
6161
+ * transactional: on success the filter's legacy rules are gone and
6162
+ * `query` holds the equivalent IR predicate. 409 if already query-format;
6163
+ * 422 when rules have no engine equivalent.
6164
+ *
6165
+ * With `dryRun: true` the same validation runs but nothing persists: the
6166
+ * response previews the normalized predicate in `query` while `rules`
6167
+ * stay intact on the filter.
6168
+ */
6169
+ async convertMemberFilterToQuery(wid, filterId, opts) {
6170
+ const suffix = opts?.dryRun ? "?dryRun=true" : "";
6171
+ return this.fetch(`w/${wid}/member-filters/${filterId}/convert${suffix}`, {
6172
+ method: "PUT"
6173
+ });
6174
+ }
5883
6175
  /** Delete a saved member filter. */
5884
6176
  async deleteMemberFilter(wid, filterId) {
5885
6177
  return this.fetch(`w/${wid}/member-filters/${filterId}`, {
@@ -5957,48 +6249,98 @@ var MembersApi = class extends BaseApiClient {
5957
6249
  });
5958
6250
  }
5959
6251
  // Import/Export Members API
5960
- /** Import members from a CSV file, streaming progress updates via callback. */
5961
- async importMembers(wid, file, newMemberRoleId, onProgress) {
6252
+ /**
6253
+ * Read-only preview classifying each CSV row before any write (GRA-5545).
6254
+ *
6255
+ * Returns create/update/unchanged/conflict/error counts. For phone-only
6256
+ * identity conflicts it also returns existing vs incoming identity so the
6257
+ * operator can decide whether to skip or explicitly overwrite before
6258
+ * committing. Requires MEMBERS_ADMIN and is bulk-PHI audited server-side.
6259
+ */
6260
+ async previewImportMembers(wid, file, newMemberRoleId, options) {
5962
6261
  const formData = new FormData();
5963
6262
  formData.append("file", file);
5964
6263
  const params = new URLSearchParams();
5965
6264
  params.append("new_member_role_id", newMemberRoleId.toString());
5966
- const response = await fetch(
5967
- `${this.baseUrl}/api/v2/w/${wid}/members/import?${params.toString()}`,
6265
+ if (options?.trustEmailAddresses) {
6266
+ params.append("trust_email_addresses", "true");
6267
+ }
6268
+ if (options?.trustPhoneNumbers) {
6269
+ params.append("trust_phone_numbers", "true");
6270
+ }
6271
+ const response = await this.fetchRaw(
6272
+ `w/${wid}/members/import/preview?${params.toString()}`,
5968
6273
  {
5969
6274
  method: "POST",
5970
- body: formData,
5971
- credentials: "include"
5972
- }
6275
+ body: formData
6276
+ },
6277
+ [400, 413]
5973
6278
  );
5974
6279
  if (!response.ok) {
5975
- const error = await response.json();
5976
- if (error.detail && typeof error.detail === "object") {
5977
- const { message, errors } = error.detail;
5978
- if (errors && Array.isArray(errors)) {
5979
- const importError = new Error(message || "Import validation failed");
5980
- importError.validationErrors = errors;
5981
- throw importError;
5982
- }
5983
- }
5984
- throw new Error(error.detail || "Import failed");
6280
+ const error = await response.json().catch(() => ({}));
6281
+ throwMemberImportError(error, "Import preview failed");
6282
+ }
6283
+ return response.json();
6284
+ }
6285
+ /**
6286
+ * Import members from a CSV file, streaming progress updates via callback.
6287
+ *
6288
+ * ``identityConflictPolicy`` (default 'skip') controls how a row matching an
6289
+ * existing member ONLY by phone with different identity fields is handled.
6290
+ * Send 'overwrite_identity_fields' only after the operator confirms a preview.
6291
+ */
6292
+ async importMembers(wid, file, newMemberRoleId, onProgress, options) {
6293
+ const formData = new FormData();
6294
+ formData.append("file", file);
6295
+ const params = new URLSearchParams();
6296
+ params.append("new_member_role_id", newMemberRoleId.toString());
6297
+ if (options?.trustEmailAddresses) {
6298
+ params.append("trust_email_addresses", "true");
6299
+ }
6300
+ if (options?.trustPhoneNumbers) {
6301
+ params.append("trust_phone_numbers", "true");
6302
+ }
6303
+ if (options?.identityConflictPolicy) {
6304
+ params.append("identity_conflict_policy", options.identityConflictPolicy);
6305
+ }
6306
+ const response = await this.fetchRaw(
6307
+ `w/${wid}/members/import?${params.toString()}`,
6308
+ {
6309
+ method: "POST",
6310
+ body: formData
6311
+ },
6312
+ [400, 413]
6313
+ );
6314
+ if (!response.ok) {
6315
+ const error = await response.json().catch(() => ({}));
6316
+ throwMemberImportError(error, "Import failed");
5985
6317
  }
5986
6318
  if (onProgress && response.body) {
5987
6319
  const reader = response.body.getReader();
5988
6320
  const decoder = new TextDecoder();
6321
+ let buffer = "";
5989
6322
  while (true) {
5990
6323
  const { done, value } = await reader.read();
5991
6324
  if (done) break;
5992
- const chunk = decoder.decode(value);
5993
- const lines = chunk.split("\n").filter((line) => line.trim());
6325
+ buffer += decoder.decode(value, { stream: true });
6326
+ const lines = buffer.split("\n");
6327
+ buffer = lines.pop() ?? "";
5994
6328
  for (const line of lines) {
6329
+ const trimmed = line.trim();
6330
+ if (!trimmed) continue;
5995
6331
  try {
5996
- const progress = JSON.parse(line);
5997
- onProgress(progress);
6332
+ onProgress(JSON.parse(trimmed));
5998
6333
  } catch {
5999
6334
  }
6000
6335
  }
6001
6336
  }
6337
+ const tail = buffer.trim();
6338
+ if (tail) {
6339
+ try {
6340
+ onProgress(JSON.parse(tail));
6341
+ } catch {
6342
+ }
6343
+ }
6002
6344
  }
6003
6345
  return { success: true };
6004
6346
  }
@@ -6190,6 +6532,17 @@ var MembersApi = class extends BaseApiClient {
6190
6532
  { method: "DELETE" }
6191
6533
  );
6192
6534
  }
6535
+ /** Bulk-create members in a workspace. */
6536
+ async bulkCreateMembers(wid, request) {
6537
+ return this.fetch(`w/${wid}/members/bulk`, {
6538
+ method: "POST",
6539
+ body: JSON.stringify(request)
6540
+ });
6541
+ }
6542
+ /** Get all sync links for a member across app connections. */
6543
+ async getMemberSyncLinks(wid, memberId) {
6544
+ return this.fetch(`w/${wid}/members/${memberId}/sync-links`);
6545
+ }
6193
6546
  };
6194
6547
 
6195
6548
  // src/api/milestones.ts
@@ -6686,6 +7039,7 @@ var OrgApi = class extends BaseApiClient {
6686
7039
  */
6687
7040
  async searchPhoneNumbers(orgUuid, params) {
6688
7041
  const query = new URLSearchParams();
7042
+ if (params?.country) query.set("country", params.country);
6689
7043
  if (params?.numberType) query.set("number_type", params.numberType);
6690
7044
  if (params?.areaCode) query.set("area_code", params.areaCode);
6691
7045
  if (params?.contains) query.set("contains", params.contains);
@@ -6697,11 +7051,20 @@ var OrgApi = class extends BaseApiClient {
6697
7051
  }
6698
7052
  /**
6699
7053
  * Purchase a phone number from Twilio for this org inventory (org admin only).
7054
+ *
7055
+ * Numbers in regulated countries (e.g. Australia) require a Twilio regulatory
7056
+ * bundle and an address — pass `bundleSid` and `addressSid` for those.
6700
7057
  */
6701
- async purchasePhoneNumber(orgUuid, phoneNumber, numberType) {
7058
+ async purchasePhoneNumber(orgUuid, phoneNumber, numberType, opts) {
6702
7059
  return this.fetch(`o/${orgUuid}/phone-numbers/purchase`, {
6703
7060
  method: "POST",
6704
- body: JSON.stringify({ phoneNumber, numberType })
7061
+ body: JSON.stringify({
7062
+ phoneNumber,
7063
+ numberType,
7064
+ country: opts?.country,
7065
+ bundleSid: opts?.bundleSid,
7066
+ addressSid: opts?.addressSid
7067
+ })
6705
7068
  });
6706
7069
  }
6707
7070
  /**
@@ -6909,6 +7272,90 @@ var OrgApi = class extends BaseApiClient {
6909
7272
  method: "POST"
6910
7273
  });
6911
7274
  }
7275
+ /**
7276
+ * List the org's A2P brands (broker resources). The SMS-consent editor uses
7277
+ * this to pick which brand's consent config to edit.
7278
+ */
7279
+ async listA2PBrands(orgUuid) {
7280
+ return this.fetch(`o/${orgUuid}/a2p-brands`);
7281
+ }
7282
+ /**
7283
+ * Fetch a brand's resolved A2P campaign config. The response carries both the
7284
+ * raw `overrides` and the `resolved` payload (defaults + overrides) the editor
7285
+ * previews — including the canonical SMS consent text.
7286
+ */
7287
+ async getA2PCampaignConfig(orgUuid, brandUuid) {
7288
+ return this.fetch(
7289
+ `o/${orgUuid}/a2p-brands/${brandUuid}/campaign-config`
7290
+ );
7291
+ }
7292
+ /**
7293
+ * Partial-update a brand's A2P campaign config. Returns the freshly resolved
7294
+ * config so the editor's live preview updates without a second round-trip.
7295
+ */
7296
+ async updateA2PCampaignConfig(orgUuid, brandUuid, data) {
7297
+ return this.fetch(
7298
+ `o/${orgUuid}/a2p-brands/${brandUuid}/campaign-config`,
7299
+ {
7300
+ method: "PUT",
7301
+ body: JSON.stringify(data)
7302
+ }
7303
+ );
7304
+ }
7305
+ /**
7306
+ * Published Sites across the org's workspaces that can be linked as this
7307
+ * brand's enrollment (opt-in) surface. Org-authorized, so it works even when
7308
+ * the admin isn't a member of the workspace holding the Site.
7309
+ */
7310
+ async listA2PEnrollmentSiteCandidates(orgUuid, brandUuid) {
7311
+ return this.fetch(
7312
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site/candidates`
7313
+ );
7314
+ }
7315
+ /**
7316
+ * Link the brand to a published enrollment Site (sets `site_uuid`). Returns
7317
+ * the refreshed campaign config so the editor's link state updates inline.
7318
+ */
7319
+ async linkA2PEnrollmentSite(orgUuid, brandUuid, data) {
7320
+ return this.fetch(
7321
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site`,
7322
+ {
7323
+ method: "PUT",
7324
+ body: JSON.stringify(data)
7325
+ }
7326
+ );
7327
+ }
7328
+ /**
7329
+ * Provision (or reuse) a patient-enrollment Site for the brand and link it —
7330
+ * the one-click path behind the SMS Consent tab. `workspaceUuid` is required
7331
+ * only when the org has multiple workspaces. Returns the refreshed campaign
7332
+ * config so the editor's link state updates inline. Idempotent.
7333
+ */
7334
+ async provisionA2PEnrollmentSite(orgUuid, brandUuid, data = {}) {
7335
+ return this.fetch(
7336
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site/provision`,
7337
+ {
7338
+ method: "POST",
7339
+ body: JSON.stringify(data)
7340
+ }
7341
+ );
7342
+ }
7343
+ /** Clear the brand's enrollment-site link. */
7344
+ async unlinkA2PEnrollmentSite(orgUuid, brandUuid) {
7345
+ return this.fetch(
7346
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site`,
7347
+ { method: "DELETE" }
7348
+ );
7349
+ }
7350
+ /**
7351
+ * The brand-addressable enrollment form URL (carries `?brand=…`). Outreach
7352
+ * appends each patient's `external_id`. `url` is null until a Site is linked.
7353
+ */
7354
+ async getA2PBrandEnrollmentUrl(orgUuid, brandUuid) {
7355
+ return this.fetch(
7356
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-url`
7357
+ );
7358
+ }
6912
7359
  /**
6913
7360
  * List available member roles for a workspace in the organization.
6914
7361
  */
@@ -6933,58 +7380,53 @@ var OrgApi = class extends BaseApiClient {
6933
7380
  function getOAuthPath(providerSlug, action) {
6934
7381
  if (providerSlug === "google_calendar") {
6935
7382
  return `oauth/google/calendar/${action}`;
6936
- } else if (providerSlug === "gmail") {
7383
+ }
7384
+ if (providerSlug === "gmail") {
6937
7385
  return `oauth/google/gmail/${action}`;
6938
- } else {
6939
- return `oauth/${providerSlug}/${action}`;
6940
7386
  }
7387
+ if (providerSlug === "gdrive") {
7388
+ return `oauth/google/drive/${action}`;
7389
+ }
7390
+ return `oauth/${providerSlug}/${action}`;
7391
+ }
7392
+ function buildAuthorizeQuery(options) {
7393
+ if (!options) return "";
7394
+ const params = new URLSearchParams();
7395
+ if (options.credentialUuid) params.set("credentialUuid", options.credentialUuid);
7396
+ if (options.loginHint) params.set("loginHint", options.loginHint);
7397
+ if (options.redirect) params.set("redirect", options.redirect);
7398
+ const qs = params.toString();
7399
+ return qs ? `?${qs}` : "";
6941
7400
  }
6942
7401
  var OAuthConnectionsApi = class extends BaseApiClient {
6943
- /**
6944
- * Get the connection status for an OAuth provider
6945
- */
6946
7402
  async getConnectionStatus(providerSlug) {
6947
7403
  const path = getOAuthPath(providerSlug, "status");
6948
7404
  return this.fetchRoot(path);
6949
7405
  }
6950
- /**
6951
- * Get the authorization URL to start OAuth flow
6952
- */
6953
- async getAuthorizationUrl(providerSlug) {
6954
- const path = getOAuthPath(providerSlug, "authorize");
7406
+ async listAccounts(providerSlug) {
7407
+ const path = getOAuthPath(providerSlug, "accounts");
6955
7408
  return this.fetchRoot(path);
6956
7409
  }
6957
- /**
6958
- * Disconnect an OAuth provider
6959
- */
6960
- async disconnect(providerSlug) {
7410
+ async getAuthorizationUrl(providerSlug, options) {
7411
+ const path = getOAuthPath(providerSlug, "authorize") + buildAuthorizeQuery(options);
7412
+ return this.fetchRoot(path);
7413
+ }
7414
+ async disconnect(providerSlug, credentialUuid) {
6961
7415
  const path = getOAuthPath(providerSlug, "disconnect");
6962
- return this.fetchRoot(path, { method: "DELETE" });
7416
+ const qs = credentialUuid ? `?credentialUuid=${encodeURIComponent(credentialUuid)}` : "";
7417
+ return this.fetchRoot(`${path}${qs}`, { method: "DELETE" });
6963
7418
  }
6964
7419
  };
6965
7420
  var OAuthApi = class extends BaseApiClient {
6966
- /**
6967
- * Get all available OAuth/API key scopes with metadata.
6968
- *
6969
- * This returns the full scope definitions from the backend,
6970
- * ensuring the UI always shows the correct scopes.
6971
- */
6972
7421
  async getAvailableScopes() {
6973
7422
  return this.fetch("oauth/scopes");
6974
7423
  }
6975
- /**
6976
- * Create an authorization code for OAuth flow
6977
- * This is called after the user approves the authorization request
6978
- */
6979
7424
  async authorize(request) {
6980
7425
  return this.fetch("oauth/authorize", {
6981
7426
  method: "POST",
6982
7427
  body: JSON.stringify(request)
6983
7428
  });
6984
7429
  }
6985
- /**
6986
- * Exchange authorization code for access token
6987
- */
6988
7430
  async exchangeOAuthToken(request) {
6989
7431
  const formData = new URLSearchParams();
6990
7432
  formData.append("grant_type", request.grant_type);
@@ -7278,6 +7720,37 @@ var PersonasApi = class extends BaseApiClient {
7278
7720
  }
7279
7721
  };
7280
7722
 
7723
+ // src/api/queries.ts
7724
+ var QueriesApi = class extends BaseApiClient {
7725
+ /** Queryable namespace: native fields, operators per type, DataType record fields. */
7726
+ async getQueryFields(wid) {
7727
+ return this.fetch(`w/${wid}/queries/fields`, {
7728
+ method: "GET"
7729
+ });
7730
+ }
7731
+ /** Structure / field / access / cost validation without execution. */
7732
+ async validateQuery(wid, query) {
7733
+ return this.fetch(`w/${wid}/queries/validate`, {
7734
+ method: "POST",
7735
+ body: JSON.stringify({ query })
7736
+ });
7737
+ }
7738
+ /** Bounded sample run (limit capped server-side). */
7739
+ async previewQuery(wid, query, mode) {
7740
+ return this.fetch(`w/${wid}/queries/preview`, {
7741
+ method: "POST",
7742
+ body: JSON.stringify({ query, mode })
7743
+ });
7744
+ }
7745
+ /** Execute a query (rows / count / aggregate). */
7746
+ async runQuery(wid, query, mode) {
7747
+ return this.fetch(`w/${wid}/queries/run`, {
7748
+ method: "POST",
7749
+ body: JSON.stringify({ query, mode })
7750
+ });
7751
+ }
7752
+ };
7753
+
7281
7754
  // src/api/qualifications.ts
7282
7755
  var QualificationsApi = class extends BaseApiClient {
7283
7756
  /** List qualifications in a workspace, paginated. */
@@ -7329,6 +7802,9 @@ var QualificationsApi = class extends BaseApiClient {
7329
7802
  async listTestChatRuns(wid, workflowId, params) {
7330
7803
  const query = new URLSearchParams();
7331
7804
  if (params?.scenarioId !== void 0) query.set("scenarioId", String(params.scenarioId));
7805
+ if (params?.assistantChatModelId !== void 0) {
7806
+ query.set("assistantChatModelId", params.assistantChatModelId);
7807
+ }
7332
7808
  if (params?.limit !== void 0) query.set("limit", String(params.limit));
7333
7809
  const qs = query.toString() ? `?${query.toString()}` : "";
7334
7810
  return this.fetch(
@@ -7763,6 +8239,112 @@ var SitesApi = class extends BaseApiClient {
7763
8239
  async getSite(wid, id) {
7764
8240
  return this.fetch(`w/${wid}/sites/${id}`);
7765
8241
  }
8242
+ /** Get a site's sharing settings. */
8243
+ async getSiteSharing(wid, siteId) {
8244
+ return this.fetch(`w/${wid}/sites/${siteId}/sharing`);
8245
+ }
8246
+ /** Update a site's sharing settings. */
8247
+ async updateSiteSharing(wid, siteId, data) {
8248
+ return this.fetch(`w/${wid}/sites/${siteId}/sharing`, {
8249
+ method: "PUT",
8250
+ body: JSON.stringify(data)
8251
+ });
8252
+ }
8253
+ /** Get a site's source tree. */
8254
+ async getSiteSource(wid, siteId) {
8255
+ return this.fetch(`w/${wid}/sites/${siteId}/source`);
8256
+ }
8257
+ /** Starter templates the caller may seed (superuser-only ones filtered server-side). */
8258
+ async getSiteSourceTemplates(wid, siteId) {
8259
+ return this.fetch(`w/${wid}/sites/${siteId}/source/templates`);
8260
+ }
8261
+ /** Create a site's source tree with starter files if it does not exist. */
8262
+ async createSiteSource(wid, siteId) {
8263
+ return this.fetch(`w/${wid}/sites/${siteId}/source`, {
8264
+ method: "POST"
8265
+ });
8266
+ }
8267
+ /** Build a site's source without publishing. */
8268
+ async buildSiteSource(wid, siteId) {
8269
+ return this.fetch(`w/${wid}/sites/${siteId}/source/build`, {
8270
+ method: "POST"
8271
+ });
8272
+ }
8273
+ /**
8274
+ * Build and publish a site's source. Optionally label the published version
8275
+ * with a `name` and `note`; both default to null (the UI then shows
8276
+ * "Version {version}").
8277
+ */
8278
+ async publishSiteSource(wid, siteId, options) {
8279
+ return this.fetch(`w/${wid}/sites/${siteId}/source/publish`, {
8280
+ method: "POST",
8281
+ body: JSON.stringify({
8282
+ name: options?.name ?? null,
8283
+ note: options?.note ?? null
8284
+ })
8285
+ });
8286
+ }
8287
+ /**
8288
+ * Reset a site's source files: load a starter template and/or wipe existing
8289
+ * files. `template` selects which starter to seed when `loadDefaults` is set
8290
+ * (defaults to "hello-world"; "patient-enrollment" is the other built-in).
8291
+ */
8292
+ async resetSiteSource(wid, siteId, options) {
8293
+ return this.fetch(`w/${wid}/sites/${siteId}/source/reset`, {
8294
+ method: "POST",
8295
+ body: JSON.stringify({
8296
+ load_defaults: options.loadDefaults,
8297
+ delete_existing: options.deleteExisting,
8298
+ ...options.template ? { template: options.template } : {}
8299
+ })
8300
+ });
8301
+ }
8302
+ /**
8303
+ * Re-point the published release to a prior version from the history. A pure
8304
+ * pointer move (no rebuild); the other versions stay in the history.
8305
+ */
8306
+ async rollbackSiteSource(wid, siteId, releaseUuid) {
8307
+ return this.fetch(`w/${wid}/sites/${siteId}/source/rollback`, {
8308
+ method: "POST",
8309
+ body: JSON.stringify({ release_uuid: releaseUuid })
8310
+ });
8311
+ }
8312
+ /**
8313
+ * Export the site's source tree as a ZIP archive (editor-gated server-side).
8314
+ * Returns the raw archive bytes for the caller to save.
8315
+ */
8316
+ async downloadSiteSourceZip(wid, siteId) {
8317
+ const response = await this.fetchRaw(`w/${wid}/sites/${siteId}/source/download`);
8318
+ return response.blob();
8319
+ }
8320
+ /**
8321
+ * Replace the site's source tree with the contents of an uploaded ZIP
8322
+ * (clears the existing source first, like a reset that loads a template).
8323
+ */
8324
+ async importSiteSourceZip(wid, siteId, file) {
8325
+ const form = new FormData();
8326
+ form.append("file", file, "source.zip");
8327
+ return this.fetch(`w/${wid}/sites/${siteId}/source/import`, {
8328
+ method: "POST",
8329
+ body: form
8330
+ });
8331
+ }
8332
+ /**
8333
+ * Get a theme's settings schema, the site's saved values, and capabilities.
8334
+ * Pass `theme` to resolve the schema for a theme other than the saved one
8335
+ * (e.g. one the builder has selected but not yet saved).
8336
+ */
8337
+ async getThemeSettings(wid, siteId, theme) {
8338
+ const query = theme ? `?theme=${encodeURIComponent(theme)}` : "";
8339
+ return this.fetch(`w/${wid}/sites/${siteId}/theme-settings${query}`);
8340
+ }
8341
+ /** Save values for the active theme's settings (validated against the schema). */
8342
+ async updateThemeSettings(wid, siteId, values) {
8343
+ return this.fetch(`w/${wid}/sites/${siteId}/theme-settings`, {
8344
+ method: "PUT",
8345
+ body: JSON.stringify({ values })
8346
+ });
8347
+ }
7766
8348
  /** Get a single site by UUID. */
7767
8349
  async getSiteByUuid(wid, uuid) {
7768
8350
  return this.fetch(`s/${wid}/${uuid}`);
@@ -7978,6 +8560,28 @@ var SubscriptionsApi = class extends BaseApiClient {
7978
8560
  async getSubscriptions() {
7979
8561
  return this.fetch("subscriptions");
7980
8562
  }
8563
+ /**
8564
+ * Create a Stripe Checkout session to purchase an organization plan.
8565
+ * Returns the checkout URL to open in a browser. The organization, billing
8566
+ * customer, and subscription are created on payment by the checkout
8567
+ * completion handler.
8568
+ */
8569
+ async createCheckoutSession(productId, planPeriod = "month") {
8570
+ return this.fetch(`subscriptions/checkout-session`, {
8571
+ method: "POST",
8572
+ credentials: "include",
8573
+ body: JSON.stringify({ productId, planPeriod }),
8574
+ headers: { "Content-Type": "application/json" }
8575
+ });
8576
+ }
8577
+ /**
8578
+ * List self-service, purchasable plans (org or workspace). Only plans with a
8579
+ * paid Stripe price are returned. No auth required.
8580
+ */
8581
+ async listSelfServeProducts(productType) {
8582
+ const qs = productType ? `?product_type=${productType}` : "";
8583
+ return this.fetch(`products/self-service${qs}`);
8584
+ }
7981
8585
  /** List all subscriptions associated with a workspace. */
7982
8586
  async getWorkspaceSubscriptions(wid) {
7983
8587
  return this.fetch(`w/${wid}/subscriptions`);
@@ -8018,6 +8622,10 @@ var SubscriptionsApi = class extends BaseApiClient {
8018
8622
  }
8019
8623
  });
8020
8624
  }
8625
+ /** List line items for a subscription. */
8626
+ async getSubscriptionItems(subscriptionId) {
8627
+ return this.fetch(`subscriptions/${subscriptionId}/items`);
8628
+ }
8021
8629
  /** Purchase extra credits on a subscription (org-level). */
8022
8630
  async purchaseCredits(subscriptionId, amountCents) {
8023
8631
  return this.fetch(`subscriptions/${subscriptionId}/purchase-credits`, {
@@ -8119,6 +8727,16 @@ var SupportRequestsApi = class extends BaseApiClient {
8119
8727
  body: JSON.stringify(data)
8120
8728
  });
8121
8729
  }
8730
+ /**
8731
+ * Reopen a resolved support request (e.g. staff resolved it prematurely).
8732
+ * The server rejects requests that are not in the `resolved` state.
8733
+ */
8734
+ async reopenWorkspaceSupportRequest(workspaceUuid, uuid, data = {}) {
8735
+ return this.fetch(`w/${workspaceUuid}/support-requests/${uuid}/reopen`, {
8736
+ method: "POST",
8737
+ body: JSON.stringify(data)
8738
+ });
8739
+ }
8122
8740
  /**
8123
8741
  * Record a click on a pushed resource (Proactive Support). For a
8124
8742
  * manager_prompt, pass the Manager Chat UUID it opened so the
@@ -8273,6 +8891,12 @@ var TasksApi = class extends BaseApiClient {
8273
8891
  if (options.workflowId) {
8274
8892
  params.append("workflow_id", options.workflowId.toString());
8275
8893
  }
8894
+ if (options.sortBy) {
8895
+ params.append("sortBy", options.sortBy);
8896
+ }
8897
+ if (options.sortOrder) {
8898
+ params.append("sortOrder", options.sortOrder);
8899
+ }
8276
8900
  return this.fetch(
8277
8901
  `w/${wid}/tasks${params.toString() ? `?${params.toString()}` : ""}`
8278
8902
  );
@@ -8643,9 +9267,17 @@ var WorkflowsApi = class extends BaseApiClient {
8643
9267
  `w/${wid}/workflows/activity/batch?${params.toString()}`
8644
9268
  );
8645
9269
  }
8646
- /** Get the Mermaid diagram representation of a workflow. */
8647
- async getWorkflowDiagram(wid, id) {
8648
- return this.fetch(`w/${wid}/workflows/${id}/diagram`);
9270
+ /**
9271
+ * Get the Mermaid diagram representation of a workflow.
9272
+ *
9273
+ * By default only active tasks are rendered. Pass `includeArchived: true`
9274
+ * to also render archived tasks (distinctly styled). `taskCount` is always
9275
+ * the total (active + archived); `archivedTaskCount` breaks out the archived
9276
+ * portion so the active count can be derived.
9277
+ */
9278
+ async getWorkflowDiagram(wid, id, options = {}) {
9279
+ const query = options.includeArchived ? "?include_archived=true" : "";
9280
+ return this.fetch(`w/${wid}/workflows/${id}/diagram${query}`);
8649
9281
  }
8650
9282
  /**
8651
9283
  * Get workflow thumbnail URL.
@@ -9401,6 +10033,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
9401
10033
  events: new EventsApi(apiKey, baseUrl, customFetch),
9402
10034
  experiments: new ExperimentsApi(apiKey, baseUrl, customFetch),
9403
10035
  fhirConnections: new FhirConnectionsApi(apiKey, baseUrl, customFetch),
10036
+ patientSyncConnections: new PatientSyncConnectionsApi(apiKey, baseUrl, customFetch),
9404
10037
  healthie: new HealthieApi(apiKey, baseUrl, customFetch),
9405
10038
  hubspot: new HubspotApi(apiKey, baseUrl, customFetch),
9406
10039
  features: new FeaturesApi(apiKey, baseUrl, customFetch),
@@ -9424,6 +10057,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
9424
10057
  pronunciations: new PronunciationsApi(apiKey, baseUrl, customFetch),
9425
10058
  qualifications: new QualificationsApi(apiKey, baseUrl, customFetch),
9426
10059
  personas: new PersonasApi(apiKey, baseUrl, customFetch),
10060
+ queries: new QueriesApi(apiKey, baseUrl, customFetch),
9427
10061
  reports: new ReportsApi(apiKey, baseUrl, customFetch),
9428
10062
  salesforce: new SalesforceApi(apiKey, baseUrl, customFetch),
9429
10063
  sites: new SitesApi(apiKey, baseUrl, customFetch),
@@ -9468,6 +10102,7 @@ var WORKSPACE_METHOD_NAMES = [
9468
10102
  "cancelAgentTask",
9469
10103
  "cancelAssignment",
9470
10104
  "cancelCalendarEvent",
10105
+ "cancelChatCallback",
9471
10106
  "cancelCredentialUpdateInvite",
9472
10107
  "checkAvailability",
9473
10108
  "checkSiteDomainAvailability",
@@ -9482,12 +10117,14 @@ var WORKSPACE_METHOD_NAMES = [
9482
10117
  "commentOnWorkspaceSupportRequest",
9483
10118
  "configureConfluence",
9484
10119
  "configureHealthie",
10120
+ "configurePatientSync",
9485
10121
  "configureHubspot",
9486
10122
  "configureMondayConnection",
9487
10123
  "configureSalesforce",
9488
10124
  "convertEmail",
9489
10125
  "convertFile",
9490
10126
  "crawlSite",
10127
+ "createAbility",
9491
10128
  "createAccessGrant",
9492
10129
  "createAgent",
9493
10130
  "createApiKey",
@@ -9511,6 +10148,7 @@ var WORKSPACE_METHOD_NAMES = [
9511
10148
  "createExperiment",
9512
10149
  "createExperimentAssignment",
9513
10150
  "createExperimentGroup",
10151
+ "convertMemberFilterToQuery",
9514
10152
  "createFhirConnection",
9515
10153
  "createFile",
9516
10154
  "createFileLabel",
@@ -9551,6 +10189,7 @@ var WORKSPACE_METHOD_NAMES = [
9551
10189
  "createWorkspaceMember",
9552
10190
  "createWorkspaceSupportRequest",
9553
10191
  "deactivateWorkflowVersion",
10192
+ "deleteAbility",
9554
10193
  "deleteAgent",
9555
10194
  "deleteAssignment",
9556
10195
  "deleteCalendar",
@@ -9574,6 +10213,7 @@ var WORKSPACE_METHOD_NAMES = [
9574
10213
  "deleteExperimentAssignment",
9575
10214
  "deleteExperimentGroup",
9576
10215
  "deleteFhirConnection",
10216
+ "deletePatientSyncConnection",
9577
10217
  "deleteFile",
9578
10218
  "deleteFileLabel",
9579
10219
  "deleteFolder",
@@ -9674,6 +10314,7 @@ var WORKSPACE_METHOD_NAMES = [
9674
10314
  "generateICalToken",
9675
10315
  "generateSiteMediaUploadUrl",
9676
10316
  "getAIUsageReport",
10317
+ "getAbilityType",
9677
10318
  "getAbilityTypes",
9678
10319
  "getAccessGrant",
9679
10320
  "getAccessGrants",
@@ -9708,6 +10349,7 @@ var WORKSPACE_METHOD_NAMES = [
9708
10349
  "getCelContext",
9709
10350
  "getChat",
9710
10351
  "getChatAssignmentTasks",
10352
+ "getChatCallbacks",
9711
10353
  "getChatEmails",
9712
10354
  "getChatFilter",
9713
10355
  "getChatFilterByUuid",
@@ -9774,6 +10416,7 @@ var WORKSPACE_METHOD_NAMES = [
9774
10416
  "getHealthieAvailableSlots",
9775
10417
  "getHealthieReconciliationMatches",
9776
10418
  "getHealthieStatus",
10419
+ "getPatientSyncStatus",
9777
10420
  "getHubspotContactProperties",
9778
10421
  "getHubspotManagedRules",
9779
10422
  "getHubspotReconciliationMatches",
@@ -9819,6 +10462,7 @@ var WORKSPACE_METHOD_NAMES = [
9819
10462
  "getMemberRole",
9820
10463
  "getMemberRoleByUuid",
9821
10464
  "getMemberRoles",
10465
+ "getMemberSyncLinks",
9822
10466
  "getMemberSyncSummary",
9823
10467
  "getMemberUsage",
9824
10468
  "getMembersMessageActivity",
@@ -9961,11 +10605,14 @@ var WORKSPACE_METHOD_NAMES = [
9961
10605
  "linkMemberToMonday",
9962
10606
  "linkMemberToSalesforce",
9963
10607
  "linkPhoneNumber",
10608
+ "listAbilities",
10609
+ "listAgentAbilities",
9964
10610
  "listAppConnections",
9965
10611
  "listAvailableAppConnections",
9966
10612
  "listConfluencePages",
9967
10613
  "listConfluenceSpaces",
9968
10614
  "listConnectionMemberFieldKeys",
10615
+ "setDefaultGooglePlatformAccount",
9969
10616
  "listGoogleCalendars",
9970
10617
  "listHealthieAppointmentTypes",
9971
10618
  "listHealthiePatients",
@@ -9980,6 +10627,7 @@ var WORKSPACE_METHOD_NAMES = [
9980
10627
  "markEmailAsRead",
9981
10628
  "markEmailAsUnread",
9982
10629
  "markNotificationAsRead",
10630
+ "previewImportMembers",
9983
10631
  "previewImportWorkspace",
9984
10632
  "previewSchedule",
9985
10633
  "previewTTS",
@@ -10054,6 +10702,7 @@ var WORKSPACE_METHOD_NAMES = [
10054
10702
  "unlinkMemberFromMonday",
10055
10703
  "unlinkMemberFromSalesforce",
10056
10704
  "unregisterPushSubscription",
10705
+ "updateAbility",
10057
10706
  "updateAgent",
10058
10707
  "updateAssignment",
10059
10708
  "updateCalendar",
@@ -10180,6 +10829,7 @@ function bindAgentsMethods(target, agents) {
10180
10829
  target.archiveAgent = agents.archiveAgent.bind(agents);
10181
10830
  target.unarchiveAgent = agents.unarchiveAgent.bind(agents);
10182
10831
  target.resolveAgentTools = agents.resolveAgentTools.bind(agents);
10832
+ target.listAgentAbilities = agents.listAgentAbilities.bind(agents);
10183
10833
  }
10184
10834
 
10185
10835
  // src/client/bindings/tasks.ts
@@ -10193,12 +10843,19 @@ function bindTasksMethods(target, tasks, abilities) {
10193
10843
  target.unarchiveTask = tasks.unarchiveTask.bind(tasks);
10194
10844
  target.cloneTask = tasks.cloneTask.bind(tasks);
10195
10845
  target.getAbilityTypes = abilities.getAbilityTypes.bind(abilities);
10846
+ target.getAbilityType = abilities.getAbilityType.bind(abilities);
10847
+ target.listAbilities = abilities.listAbilities.bind(abilities);
10848
+ target.createAbility = abilities.createAbility.bind(abilities);
10849
+ target.updateAbility = abilities.updateAbility.bind(abilities);
10850
+ target.deleteAbility = abilities.deleteAbility.bind(abilities);
10196
10851
  }
10197
10852
 
10198
10853
  // src/client/bindings/chats.ts
10199
10854
  function bindChatsMethods(target, chats) {
10200
10855
  target.getChats = chats.getChats.bind(chats);
10201
10856
  target.getChat = chats.getChat.bind(chats);
10857
+ target.getChatCallbacks = chats.getChatCallbacks.bind(chats);
10858
+ target.cancelChatCallback = chats.cancelChatCallback.bind(chats);
10202
10859
  target.getChatTokenUsage = chats.getChatTokenUsage.bind(chats);
10203
10860
  target.getChatTodos = chats.getChatTodos.bind(chats);
10204
10861
  target.getChatSkills = chats.getChatSkills.bind(chats);
@@ -10248,6 +10905,8 @@ function bindCallsMethods(target, calls, cel) {
10248
10905
  target.initiateCall = calls.initiateCall.bind(calls);
10249
10906
  target.getVoiceToken = calls.getVoiceToken.bind(calls);
10250
10907
  target.getMessageTiming = calls.getMessageTiming.bind(calls);
10908
+ target.listChatRecordings = calls.listChatRecordings.bind(calls);
10909
+ target.getCallRecordingDownloadUrl = calls.getCallRecordingDownloadUrl.bind(calls);
10251
10910
  target.getCelContext = cel.getCelContext.bind(cel);
10252
10911
  }
10253
10912
 
@@ -10290,6 +10949,9 @@ function bindMembersMethods(target, members) {
10290
10949
  target.deleteMember = members.deleteMember.bind(members);
10291
10950
  target.archiveMember = members.archiveMember.bind(members);
10292
10951
  target.unarchiveMember = members.unarchiveMember.bind(members);
10952
+ target.sendMemberPhoneConfirmation = members.sendMemberPhoneConfirmation.bind(members);
10953
+ target.bulkCreateMembers = members.bulkCreateMembers.bind(members);
10954
+ target.previewImportMembers = members.previewImportMembers.bind(members);
10293
10955
  target.importMembers = members.importMembers.bind(members);
10294
10956
  target.exportMembers = members.exportMembers.bind(members);
10295
10957
  target.getMembersMessageActivity = members.getMembersMessageActivity.bind(members);
@@ -10297,6 +10959,7 @@ function bindMembersMethods(target, members) {
10297
10959
  target.getMemberFilter = members.getMemberFilter.bind(members);
10298
10960
  target.createMemberFilter = members.createMemberFilter.bind(members);
10299
10961
  target.updateMemberFilter = members.updateMemberFilter.bind(members);
10962
+ target.convertMemberFilterToQuery = members.convertMemberFilterToQuery.bind(members);
10300
10963
  target.deleteMemberFilter = members.deleteMemberFilter.bind(members);
10301
10964
  target.getMemberFilterCount = members.getMemberFilterCount.bind(members);
10302
10965
  target.getMemberLabels = members.getMemberLabels.bind(members);
@@ -10326,6 +10989,7 @@ function bindMembersMethods(target, members) {
10326
10989
  target.getMemberMemories = members.getMemberMemories.bind(members);
10327
10990
  target.createMemberMemory = members.createMemberMemory.bind(members);
10328
10991
  target.deleteMemberMemory = members.deleteMemberMemory.bind(members);
10992
+ target.getMemberSyncLinks = members.getMemberSyncLinks.bind(members);
10329
10993
  }
10330
10994
 
10331
10995
  // src/client/bindings/workspaces.ts
@@ -10459,6 +11123,19 @@ function bindSitesMethods(target, sites) {
10459
11123
  target.checkSiteSlugAvailability = sites.checkSiteSlugAvailability.bind(sites);
10460
11124
  target.checkSiteDomainAvailability = sites.checkSiteDomainAvailability.bind(sites);
10461
11125
  target.getSite = sites.getSite.bind(sites);
11126
+ target.getSiteSharing = sites.getSiteSharing.bind(sites);
11127
+ target.updateSiteSharing = sites.updateSiteSharing.bind(sites);
11128
+ target.getSiteSource = sites.getSiteSource.bind(sites);
11129
+ target.getSiteSourceTemplates = sites.getSiteSourceTemplates.bind(sites);
11130
+ target.createSiteSource = sites.createSiteSource.bind(sites);
11131
+ target.buildSiteSource = sites.buildSiteSource.bind(sites);
11132
+ target.publishSiteSource = sites.publishSiteSource.bind(sites);
11133
+ target.resetSiteSource = sites.resetSiteSource.bind(sites);
11134
+ target.rollbackSiteSource = sites.rollbackSiteSource.bind(sites);
11135
+ target.downloadSiteSourceZip = sites.downloadSiteSourceZip.bind(sites);
11136
+ target.importSiteSourceZip = sites.importSiteSourceZip.bind(sites);
11137
+ target.getThemeSettings = sites.getThemeSettings.bind(sites);
11138
+ target.updateThemeSettings = sites.updateThemeSettings.bind(sites);
10462
11139
  target.getSiteByUuid = sites.getSiteByUuid.bind(sites);
10463
11140
  target.getSiteRenderedPage = sites.getSiteRenderedPage.bind(sites);
10464
11141
  target.getSiteRenderedMenu = sites.getSiteRenderedMenu.bind(sites);
@@ -10491,6 +11168,7 @@ function bindSitesMethods(target, sites) {
10491
11168
  function bindFilesMethods(target, files) {
10492
11169
  target.getFiles = files.getFiles.bind(files);
10493
11170
  target.getFile = files.getFile.bind(files);
11171
+ target.downloadFilesZip = files.downloadFilesZip.bind(files);
10494
11172
  target.createFile = files.createFile.bind(files);
10495
11173
  target.uploadFile = files.uploadFile.bind(files);
10496
11174
  target.updateFile = files.updateFile.bind(files);
@@ -10532,6 +11210,7 @@ function bindEventsMethods(target, events) {
10532
11210
  target.createEventRule = events.createEventRule.bind(events);
10533
11211
  target.updateEventRule = events.updateEventRule.bind(events);
10534
11212
  target.deleteEventRule = events.deleteEventRule.bind(events);
11213
+ target.testWebhook = events.testWebhook.bind(events);
10535
11214
  target.reorderEventRules = events.reorderEventRules.bind(events);
10536
11215
  target.getWebhookLogs = events.getWebhookLogs.bind(events);
10537
11216
  target.getRuleExecutions = events.getRuleExecutions.bind(events);
@@ -10747,6 +11426,8 @@ function bindBillingMethods(target, apiKeys, subscriptions, reports) {
10747
11426
  target.updateSubscription = subscriptions.updateSubscription.bind(subscriptions);
10748
11427
  target.addWorkspaceToSubscription = subscriptions.addWorkspaceToSubscription.bind(subscriptions);
10749
11428
  target.purchaseCredits = subscriptions.purchaseCredits.bind(subscriptions);
11429
+ target.createCheckoutSession = subscriptions.createCheckoutSession.bind(subscriptions);
11430
+ target.listSelfServeProducts = subscriptions.listSelfServeProducts.bind(subscriptions);
10750
11431
  target.getAIUsageReport = reports.getAIUsageReport.bind(reports);
10751
11432
  target.getSMSUsageReport = reports.getSMSUsageReport.bind(reports);
10752
11433
  target.getPhoneUsageReport = reports.getPhoneUsageReport.bind(reports);
@@ -10780,12 +11461,13 @@ function bindAppsMethods(target, apps, builders, inquiries, oauth, oauthConnecti
10780
11461
  target.exchangeOAuthToken = oauth.exchangeOAuthToken.bind(oauth);
10781
11462
  target.getAvailableScopes = oauth.getAvailableScopes.bind(oauth);
10782
11463
  target.getOAuthConnectionStatus = oauthConnections.getConnectionStatus.bind(oauthConnections);
11464
+ target.listOAuthAccounts = oauthConnections.listAccounts.bind(oauthConnections);
10783
11465
  target.getOAuthAuthorizationUrl = oauthConnections.getAuthorizationUrl.bind(oauthConnections);
10784
11466
  target.disconnectOAuthProvider = oauthConnections.disconnect.bind(oauthConnections);
10785
11467
  }
10786
11468
 
10787
11469
  // src/client/bindings/integrations.ts
10788
- function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, healthie, salesforce, hubspot, appConnections, connectionSync, confluence) {
11470
+ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, patientSyncConnections, healthie, salesforce, hubspot, appConnections, connectionSync, confluence) {
10789
11471
  target.getMondayBoards = mondayIntegration.getBoards.bind(mondayIntegration);
10790
11472
  target.getMondayBoardColumns = mondayIntegration.getBoardColumns.bind(mondayIntegration);
10791
11473
  target.getMondayBoardGroups = mondayIntegration.getBoardGroups.bind(mondayIntegration);
@@ -10870,6 +11552,9 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
10870
11552
  target.fhirGetEncounterSyncRuns = fhirConnections.fhirGetEncounterSyncRuns.bind(fhirConnections);
10871
11553
  target.fhirRefreshEncounterPatient = fhirConnections.fhirRefreshEncounterPatient.bind(fhirConnections);
10872
11554
  target.fhirBackfillEncounterSync = fhirConnections.fhirBackfillEncounterSync.bind(fhirConnections);
11555
+ target.configurePatientSync = patientSyncConnections.configurePatientSync.bind(patientSyncConnections);
11556
+ target.getPatientSyncStatus = patientSyncConnections.getPatientSyncStatus.bind(patientSyncConnections);
11557
+ target.deletePatientSyncConnection = patientSyncConnections.deletePatientSyncConnection.bind(patientSyncConnections);
10873
11558
  target.configureHealthie = healthie.configureHealthie.bind(healthie);
10874
11559
  target.getHealthieStatus = healthie.getHealthieStatus.bind(healthie);
10875
11560
  target.listHealthieProviders = healthie.listHealthieProviders.bind(healthie);
@@ -10944,6 +11629,7 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
10944
11629
  target.updatePlatformApp = appConnections.updatePlatformApp.bind(appConnections);
10945
11630
  target.deletePlatformApp = appConnections.deletePlatformApp.bind(appConnections);
10946
11631
  target.listConnectionMemberFieldKeys = appConnections.listConnectionMemberFieldKeys.bind(appConnections);
11632
+ target.setDefaultGooglePlatformAccount = appConnections.setDefaultGooglePlatformAccount.bind(appConnections);
10947
11633
  }
10948
11634
 
10949
11635
  // src/client/bindings/operator-groups.ts
@@ -10981,6 +11667,8 @@ function bindOrgMethods(target, org) {
10981
11667
  target.updateBusinessProfile = org.updateBusinessProfile.bind(org);
10982
11668
  target.submitBusinessProfile = org.submitBusinessProfile.bind(org);
10983
11669
  target.cancelBusinessProfile = org.cancelBusinessProfile.bind(org);
11670
+ target.createOrganizationWorkspace = org.createOrganizationWorkspace.bind(org);
11671
+ target.getOrgBillingCustomer = org.getOrgBillingCustomer.bind(org);
10984
11672
  }
10985
11673
 
10986
11674
  // src/client/bindings/pronunciations.ts
@@ -11060,6 +11748,14 @@ function bindPersonasMethods(target, personas) {
11060
11748
  target.deletePersona = personas.deletePersona.bind(personas);
11061
11749
  }
11062
11750
 
11751
+ // src/client/bindings/queries.ts
11752
+ function bindQueriesMethods(target, queries) {
11753
+ target.getQueryFields = queries.getQueryFields.bind(queries);
11754
+ target.validateQuery = queries.validateQuery.bind(queries);
11755
+ target.previewQuery = queries.previewQuery.bind(queries);
11756
+ target.runQuery = queries.runQuery.bind(queries);
11757
+ }
11758
+
11063
11759
  // src/client/bindings/customers.ts
11064
11760
  function bindCustomersMethods(target, customers) {
11065
11761
  target.getMyCustomers = customers.getMyCustomers.bind(customers);
@@ -11106,6 +11802,7 @@ function bindSupportRequestMethods(target, supportRequests) {
11106
11802
  target.createWorkspaceSupportRequest = supportRequests.createWorkspaceSupportRequest.bind(supportRequests);
11107
11803
  target.commentOnWorkspaceSupportRequest = supportRequests.commentOnWorkspaceSupportRequest.bind(supportRequests);
11108
11804
  target.closeWorkspaceSupportRequest = supportRequests.closeWorkspaceSupportRequest.bind(supportRequests);
11805
+ target.reopenWorkspaceSupportRequest = supportRequests.reopenWorkspaceSupportRequest.bind(supportRequests);
11109
11806
  target.clickWorkspaceSupportRequestResource = supportRequests.clickWorkspaceSupportRequestResource.bind(supportRequests);
11110
11807
  }
11111
11808
 
@@ -11125,9 +11822,16 @@ var GravityRailClient = class {
11125
11822
  unarchiveTask;
11126
11823
  cloneTask;
11127
11824
  getAbilityTypes;
11825
+ getAbilityType;
11826
+ listAbilities;
11827
+ createAbility;
11828
+ updateAbility;
11829
+ deleteAbility;
11128
11830
  // Chats API
11129
11831
  getChats;
11130
11832
  getChat;
11833
+ getChatCallbacks;
11834
+ cancelChatCallback;
11131
11835
  getChatTokenUsage;
11132
11836
  getChatTodos;
11133
11837
  getChatSkills;
@@ -11174,6 +11878,8 @@ var GravityRailClient = class {
11174
11878
  initiateCall;
11175
11879
  getVoiceToken;
11176
11880
  getMessageTiming;
11881
+ listChatRecordings;
11882
+ getCallRecordingDownloadUrl;
11177
11883
  getCelContext;
11178
11884
  // Data Types API
11179
11885
  getDataTypes;
@@ -11210,6 +11916,9 @@ var GravityRailClient = class {
11210
11916
  deleteMember;
11211
11917
  archiveMember;
11212
11918
  unarchiveMember;
11919
+ sendMemberPhoneConfirmation;
11920
+ bulkCreateMembers;
11921
+ previewImportMembers;
11213
11922
  importMembers;
11214
11923
  exportMembers;
11215
11924
  getMembersMessageActivity;
@@ -11217,6 +11926,7 @@ var GravityRailClient = class {
11217
11926
  getMemberFilter;
11218
11927
  createMemberFilter;
11219
11928
  updateMemberFilter;
11929
+ convertMemberFilterToQuery;
11220
11930
  deleteMemberFilter;
11221
11931
  getMemberFilterCount;
11222
11932
  getMemberLabels;
@@ -11250,6 +11960,8 @@ var GravityRailClient = class {
11250
11960
  getMemberMemories;
11251
11961
  createMemberMemory;
11252
11962
  deleteMemberMemory;
11963
+ // Member Sync Links
11964
+ getMemberSyncLinks;
11253
11965
  // Agent Tasks API (operator-facing async sub-agent inspection/cancel)
11254
11966
  getAgentTasks;
11255
11967
  getAgentTask;
@@ -11264,6 +11976,7 @@ var GravityRailClient = class {
11264
11976
  archiveAgent;
11265
11977
  unarchiveAgent;
11266
11978
  resolveAgentTools;
11979
+ listAgentAbilities;
11267
11980
  // Qualifications API
11268
11981
  getQualifications;
11269
11982
  getQualification;
@@ -11279,6 +11992,11 @@ var GravityRailClient = class {
11279
11992
  evaluateTestChatRun;
11280
11993
  endTestChatRun;
11281
11994
  // Personas API (workspace-scoped test-identity templates)
11995
+ // Unified Query Engine
11996
+ getQueryFields;
11997
+ validateQuery;
11998
+ previewQuery;
11999
+ runQuery;
11282
12000
  listPersonas;
11283
12001
  getPersona;
11284
12002
  createPersona;
@@ -11418,6 +12136,8 @@ var GravityRailClient = class {
11418
12136
  updateBusinessProfile;
11419
12137
  submitBusinessProfile;
11420
12138
  cancelBusinessProfile;
12139
+ createOrganizationWorkspace;
12140
+ getOrgBillingCustomer;
11421
12141
  getVapidPublicKey;
11422
12142
  registerPushSubscription;
11423
12143
  unregisterPushSubscription;
@@ -11495,6 +12215,19 @@ var GravityRailClient = class {
11495
12215
  checkSiteSlugAvailability;
11496
12216
  checkSiteDomainAvailability;
11497
12217
  getSite;
12218
+ getSiteSharing;
12219
+ updateSiteSharing;
12220
+ getSiteSource;
12221
+ getSiteSourceTemplates;
12222
+ createSiteSource;
12223
+ buildSiteSource;
12224
+ publishSiteSource;
12225
+ resetSiteSource;
12226
+ rollbackSiteSource;
12227
+ downloadSiteSourceZip;
12228
+ importSiteSourceZip;
12229
+ getThemeSettings;
12230
+ updateThemeSettings;
11498
12231
  getSiteByUuid;
11499
12232
  getSiteRenderedPage;
11500
12233
  getSiteRenderedMenu;
@@ -11524,6 +12257,7 @@ var GravityRailClient = class {
11524
12257
  // Files API
11525
12258
  getFiles;
11526
12259
  getFile;
12260
+ downloadFilesZip;
11527
12261
  createFile;
11528
12262
  uploadFile;
11529
12263
  updateFile;
@@ -11563,6 +12297,7 @@ var GravityRailClient = class {
11563
12297
  createEventRule;
11564
12298
  updateEventRule;
11565
12299
  deleteEventRule;
12300
+ testWebhook;
11566
12301
  reorderEventRules;
11567
12302
  getWebhookLogs;
11568
12303
  getRuleExecutions;
@@ -11746,6 +12481,8 @@ var GravityRailClient = class {
11746
12481
  updateSubscription;
11747
12482
  addWorkspaceToSubscription;
11748
12483
  purchaseCredits;
12484
+ createCheckoutSession;
12485
+ listSelfServeProducts;
11749
12486
  getAIUsageReport;
11750
12487
  getSMSUsageReport;
11751
12488
  getPhoneUsageReport;
@@ -11776,6 +12513,7 @@ var GravityRailClient = class {
11776
12513
  exchangeOAuthToken;
11777
12514
  getAvailableScopes;
11778
12515
  getOAuthConnectionStatus;
12516
+ listOAuthAccounts;
11779
12517
  getOAuthAuthorizationUrl;
11780
12518
  disconnectOAuthProvider;
11781
12519
  // Integrations API
@@ -11869,6 +12607,9 @@ var GravityRailClient = class {
11869
12607
  fhirRefreshEncounterPatient;
11870
12608
  fhirBackfillEncounterSync;
11871
12609
  // Healthie API
12610
+ configurePatientSync;
12611
+ getPatientSyncStatus;
12612
+ deletePatientSyncConnection;
11872
12613
  configureHealthie;
11873
12614
  getHealthieStatus;
11874
12615
  listHealthieProviders;
@@ -11948,6 +12689,7 @@ var GravityRailClient = class {
11948
12689
  updatePlatformApp;
11949
12690
  deletePlatformApp;
11950
12691
  listConnectionMemberFieldKeys;
12692
+ setDefaultGooglePlatformAccount;
11951
12693
  // Pronunciations API
11952
12694
  getPronunciationEntries;
11953
12695
  createPronunciationEntry;
@@ -11996,6 +12738,7 @@ var GravityRailClient = class {
11996
12738
  createWorkspaceSupportRequest;
11997
12739
  commentOnWorkspaceSupportRequest;
11998
12740
  closeWorkspaceSupportRequest;
12741
+ reopenWorkspaceSupportRequest;
11999
12742
  clickWorkspaceSupportRequestResource;
12000
12743
  constructor(apiKey, baseUrl, customFetch) {
12001
12744
  const apis = createApiModules(apiKey, baseUrl, customFetch);
@@ -12010,6 +12753,7 @@ var GravityRailClient = class {
12010
12753
  bindAgentsMethods(this, apis.agents);
12011
12754
  bindQualificationsMethods(this, apis.qualifications);
12012
12755
  bindPersonasMethods(this, apis.personas);
12756
+ bindQueriesMethods(this, apis.queries);
12013
12757
  bindJourneysMethods(this, apis.journeys);
12014
12758
  bindExperimentsMethods(this, apis.experiments);
12015
12759
  bindOperatorMethods(this, apis.operatorGroups);
@@ -12049,6 +12793,7 @@ var GravityRailClient = class {
12049
12793
  apis.slackApps,
12050
12794
  apis.teamsApps,
12051
12795
  apis.fhirConnections,
12796
+ apis.patientSyncConnections,
12052
12797
  apis.healthie,
12053
12798
  apis.salesforce,
12054
12799
  apis.hubspot,
@@ -12102,23 +12847,30 @@ var GravityRailClient = class {
12102
12847
  });
12103
12848
  }
12104
12849
  /**
12105
- * Set the org token for cross-domain / non-browser clients (e.g. CLI).
12106
- * When set, all API requests include the X-Org-Token header so the backend
12107
- * accepts the request without requiring a browser cookie.
12850
+ * Set the org session credential for cross-domain / non-browser clients (e.g. CLI).
12851
+ * Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still
12852
+ * use X-Org-Token during the migration window.
12108
12853
  *
12109
- * `orgUuid` is the org that issued the token. Pass it so the SDK can
12110
- * detect a stale token (e.g. switching orgs mid-session) and re-fire the
12854
+ * `orgUuid` is the org that issued the session. Pass it so the SDK can
12855
+ * detect a stale session (e.g. switching orgs mid-session) and re-fire the
12111
12856
  * org-auth handler instead of silently 401-ing.
12112
12857
  *
12113
12858
  * Propagates to all API modules.
12114
12859
  */
12115
- setOrgToken(token, orgUuid) {
12860
+ setOrgSession(session, orgUuid) {
12116
12861
  Object.values(this.apis).forEach((api) => {
12117
- if (typeof api.setOrgToken === "function") {
12118
- api.setOrgToken(token, orgUuid);
12862
+ if (typeof api.setOrgSession === "function") {
12863
+ api.setOrgSession(session, orgUuid);
12119
12864
  }
12120
12865
  });
12121
12866
  }
12867
+ /**
12868
+ * @deprecated Legacy compatibility for stateless orgToken JWE credentials.
12869
+ * Prefer setOrgSession() for opaque org browser sessions.
12870
+ */
12871
+ setOrgToken(token, orgUuid) {
12872
+ this.setOrgSession(token, orgUuid);
12873
+ }
12122
12874
  /**
12123
12875
  * Update the API key across all modules.
12124
12876
  * Used after successful re-authentication.
@@ -12200,6 +12952,12 @@ var GravityRailClient = class {
12200
12952
  ConsentMethod,
12201
12953
  CriterionType,
12202
12954
  CustomToolkitsApi,
12955
+ CustomerActivityClassifierDetectorName,
12956
+ CustomerActivityClassifierLabel,
12957
+ CustomerActivityEventSource,
12958
+ CustomerActivityEventStatus,
12959
+ CustomerActivityReviewOutcome,
12960
+ CustomerActivitySeverity,
12203
12961
  CustomersApi,
12204
12962
  DEFAULT_CHAT_MODEL,
12205
12963
  DEFAULT_CUSTOM_VOICE_MODEL,
@@ -12207,6 +12965,7 @@ var GravityRailClient = class {
12207
12965
  DEFAULT_VOICE_INFERENCE_MODEL,
12208
12966
  DataCategory,
12209
12967
  DataFieldType,
12968
+ DataRecordRetirementResponseReason,
12210
12969
  DataSensitivity,
12211
12970
  DataTypeRecordScope,
12212
12971
  DataTypesApi,
@@ -12239,6 +12998,8 @@ var GravityRailClient = class {
12239
12998
  McpServerState,
12240
12999
  McpServersApi,
12241
13000
  MemberFeature,
13001
+ MemberImportMatchInfoMatchType,
13002
+ MemberImportPreviewRowAction,
12242
13003
  MemberType,
12243
13004
  MembersApi,
12244
13005
  MenuItemResponseItemType,
@@ -12266,11 +13027,14 @@ var GravityRailClient = class {
12266
13027
  PERMISSION_NONE,
12267
13028
  PERMISSION_USE,
12268
13029
  PERMISSION_VERIFY,
13030
+ PIDS_DISPOSITIONS,
13031
+ PIDS_SOURCES,
12269
13032
  PersonasApi,
12270
13033
  PhoneNumbersApi,
12271
13034
  ProductType,
12272
13035
  PromptsApi,
12273
13036
  PronunciationsApi,
13037
+ QUERY_VALUELESS_OPS,
12274
13038
  QualificationsApi,
12275
13039
  REALTIME_MODEL_CUSTOM,
12276
13040
  REALTIME_MODEL_GEMINI,
@@ -12308,7 +13072,6 @@ var GravityRailClient = class {
12308
13072
  TTS_MODEL_ELEVENLABS_FLASH,
12309
13073
  TTS_MODEL_ELEVENLABS_MULTILINGUAL,
12310
13074
  TTS_MODEL_ELEVENLABS_TURBO,
12311
- TTS_MODEL_POCKET,
12312
13075
  TTS_PREVIEW_PROVIDERS,
12313
13076
  TasksApi,
12314
13077
  TemplatesApi,
@@ -12348,6 +13111,7 @@ var GravityRailClient = class {
12348
13111
  bindPromptsMethods,
12349
13112
  bindPronunciationsMethods,
12350
13113
  bindQualificationsMethods,
13114
+ bindQueriesMethods,
12351
13115
  bindResellersMethods,
12352
13116
  bindSitesMethods,
12353
13117
  bindSupportRequestMethods,