@gravity-rail/sdk 0.18.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{chunk-PUIYXJSZ.js → chunk-24L4RD4Z.js} +479 -39
  2. package/dist/chunk-24L4RD4Z.js.map +1 -0
  3. package/dist/{chunk-2YLKG4TT.js → chunk-3HAV5XUJ.js} +1 -1
  4. package/dist/chunk-3HAV5XUJ.js.map +1 -0
  5. package/dist/{chunk-PJFEGUHM.js → chunk-7OLBLLV7.js} +6 -2
  6. package/dist/{chunk-PJFEGUHM.js.map → chunk-7OLBLLV7.js.map} +1 -1
  7. package/dist/{client-B-jmQ4UA.d.cts → client-B0eh2BEY.d.cts} +1315 -285
  8. package/dist/{client-CatNn6FD.d.ts → client-CFz-BGmY.d.ts} +1315 -285
  9. package/dist/helpers.cjs +141 -0
  10. package/dist/helpers.cjs.map +1 -1
  11. package/dist/helpers.d.cts +17 -3
  12. package/dist/helpers.d.ts +17 -3
  13. package/dist/helpers.js +127 -1
  14. package/dist/helpers.js.map +1 -1
  15. package/dist/index.cjs +578 -39
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +28 -5
  18. package/dist/index.d.ts +28 -5
  19. package/dist/index.js +123 -5
  20. package/dist/index.js.map +1 -1
  21. package/dist/internal.cjs +485 -39
  22. package/dist/internal.cjs.map +1 -1
  23. package/dist/internal.d.cts +630 -551
  24. package/dist/internal.d.ts +630 -551
  25. package/dist/internal.js +9 -5
  26. package/dist/internal.js.map +1 -1
  27. package/dist/{revision-state-Fw1jsQOa.d.ts → revision-state-KfOztBkY.d.ts} +53 -172
  28. package/dist/{revision-state-CuESPYpi.d.cts → revision-state-fJ9PM15N.d.cts} +53 -172
  29. package/dist/schemas.cjs +31 -5
  30. package/dist/schemas.cjs.map +1 -1
  31. package/dist/schemas.d.cts +37 -14
  32. package/dist/schemas.d.ts +37 -14
  33. package/dist/schemas.js +31 -6
  34. package/dist/schemas.js.map +1 -1
  35. package/dist/{tasks-GVbVa_Lj.d.cts → tasks-WH_VfzMv.d.cts} +351 -16
  36. package/dist/{tasks-GVbVa_Lj.d.ts → tasks-WH_VfzMv.d.ts} +351 -16
  37. package/package.json +6 -6
  38. package/dist/chunk-2YLKG4TT.js.map +0 -1
  39. package/dist/chunk-PUIYXJSZ.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -117,7 +117,6 @@ __export(src_exports, {
117
117
  REALTIME_MODEL_CUSTOM: () => REALTIME_MODEL_CUSTOM,
118
118
  REALTIME_MODEL_GEMINI: () => REALTIME_MODEL_GEMINI,
119
119
  REALTIME_MODEL_GEMINI_VERTEX: () => REALTIME_MODEL_GEMINI_VERTEX,
120
- REALTIME_MODEL_NOVA_SONIC: () => REALTIME_MODEL_NOVA_SONIC,
121
120
  REALTIME_MODEL_OPENAI: () => REALTIME_MODEL_OPENAI,
122
121
  REALTIME_MODEL_OPENAI_2: () => REALTIME_MODEL_OPENAI_2,
123
122
  REALTIME_MODEL_OPENAI_MINI: () => REALTIME_MODEL_OPENAI_MINI,
@@ -507,7 +506,11 @@ ${formattedErrors}`, response.status);
507
506
  throw error;
508
507
  }
509
508
  const errorMessage = typeof errorData.detail === "string" ? errorData.detail : errorData.message || response.statusText;
510
- throw new ApiError(errorMessage, response.status);
509
+ const simpleError = new ApiError(errorMessage, response.status);
510
+ if (typeof errorData.code === "string") {
511
+ simpleError.errorData = errorData;
512
+ }
513
+ throw simpleError;
511
514
  }
512
515
  if (response.status === 204) {
513
516
  return void 0;
@@ -873,6 +876,7 @@ var AgentsApi = class extends BaseApiClient {
873
876
  if (options.search) params.append("search", options.search);
874
877
  if (options.includeArchived)
875
878
  params.append("includeArchived", options.includeArchived.toString());
879
+ if (options.owner) params.append("owner", options.owner);
876
880
  return this.fetch(
877
881
  `w/${wid}/agents${params.toString() ? `?${params.toString()}` : ""}`
878
882
  );
@@ -1266,33 +1270,36 @@ var AuthApi = class extends BaseApiClient {
1266
1270
  });
1267
1271
  }
1268
1272
  /** Initiate SMS login by sending a verification code to the given phone number. */
1269
- async login(phoneNumber, wid, organizationUuid) {
1273
+ async login(phoneNumber, wid, organizationUuid, isSignUp = false) {
1270
1274
  const params = new URLSearchParams();
1271
1275
  if (wid) params.append("wid", wid);
1272
1276
  const body = { phoneNumber: sanitizePhoneForBackend(phoneNumber) };
1273
1277
  if (organizationUuid) body.organizationUuid = organizationUuid;
1278
+ if (isSignUp) body.isSignUp = true;
1274
1279
  return await this.fetch(`auth/login?${params.toString()}`, {
1275
1280
  method: "POST",
1276
1281
  body: JSON.stringify(body)
1277
1282
  });
1278
1283
  }
1279
1284
  /** Resend the SMS verification code to the given phone number. */
1280
- async resendCode(phoneNumber, organizationUuid) {
1285
+ async resendCode(phoneNumber, organizationUuid, isSignUp = false) {
1281
1286
  const body = { phoneNumber: sanitizePhoneForBackend(phoneNumber) };
1282
1287
  if (organizationUuid) body.organizationUuid = organizationUuid;
1288
+ if (isSignUp) body.isSignUp = true;
1283
1289
  return await this.fetch("auth/resend-code", {
1284
1290
  method: "POST",
1285
1291
  body: JSON.stringify(body)
1286
1292
  });
1287
1293
  }
1288
1294
  /** Verify an SMS code and complete authentication, handling 2FA if required. */
1289
- async verifyCodeWith2FA(phoneNumber, code, organizationUuid) {
1295
+ async verifyCodeWith2FA(phoneNumber, code, organizationUuid, isSignUp = false) {
1290
1296
  const verifyResponse = await this.fetch("auth/verify-with-2fa", {
1291
1297
  method: "POST",
1292
1298
  body: JSON.stringify({
1293
1299
  phoneNumber: sanitizePhoneForBackend(phoneNumber),
1294
1300
  code,
1295
- organizationUuid
1301
+ organizationUuid,
1302
+ isSignUp
1296
1303
  })
1297
1304
  });
1298
1305
  if (!verifyResponse.requiresTwoFactor && verifyResponse.token) {
@@ -1542,14 +1549,17 @@ var AuthApi = class extends BaseApiClient {
1542
1549
  // ===== CREDENTIAL CHANGE METHODS =====
1543
1550
  /**
1544
1551
  * Request to change email or phone credential.
1545
- * Sends an OTP to the NEW credential to verify ownership.
1552
+ * Sends an OTP to the NEW credential to verify ownership. For phone, the
1553
+ * code can be delivered by SMS (default) or read aloud over a voice call
1554
+ * (`deliveryMethod: 'voice'`) so landlines can be verified too.
1546
1555
  */
1547
- async requestCredentialChange(credentialType, newValue) {
1556
+ async requestCredentialChange(credentialType, newValue, deliveryMethod = "sms") {
1548
1557
  return this.fetch("account/request-credential-change", {
1549
1558
  method: "POST",
1550
1559
  body: JSON.stringify({
1551
1560
  credential_type: credentialType,
1552
- new_value: newValue
1561
+ new_value: newValue,
1562
+ delivery_method: deliveryMethod
1553
1563
  })
1554
1564
  });
1555
1565
  }
@@ -1831,10 +1841,12 @@ var CalendarsApi = class extends BaseApiClient {
1831
1841
  }
1832
1842
  /** Generate or regenerate an iCal feed token for a calendar. */
1833
1843
  async generateICalToken(wid, calendarId, regenerate = false) {
1834
- return this.fetch(`w/${wid}/calendars/${calendarId}/ical-token`, {
1835
- method: "POST",
1836
- body: JSON.stringify({ regenerate })
1837
- });
1844
+ const qs = new URLSearchParams();
1845
+ qs.set("regenerate", regenerate ? "true" : "false");
1846
+ return this.fetch(
1847
+ `w/${wid}/calendars/${calendarId}/ical-token?${qs.toString()}`,
1848
+ { method: "POST" }
1849
+ );
1838
1850
  }
1839
1851
  /** Revoke the iCal feed token for a calendar, disabling external feed access. */
1840
1852
  async revokeICalToken(wid, calendarId) {
@@ -2792,6 +2804,34 @@ var DataTypesApi = class extends BaseApiClient {
2792
2804
  async getFieldIndexStatus(wid, dataTypeId, fieldSlug) {
2793
2805
  return this.fetch(`w/${wid}/data-types/${dataTypeId}/fields/${fieldSlug}/index-status`);
2794
2806
  }
2807
+ /**
2808
+ * Preview renaming a field's slug — read-only.
2809
+ *
2810
+ * A field slug is the key its answers are stored under, so a rename moves
2811
+ * stored data. This reports whether the new slug is allowed, how many records
2812
+ * would move, and every configured place still naming the old slug (CEL,
2813
+ * templates, sync maps) which this rename does NOT rewrite.
2814
+ */
2815
+ async previewRenameFieldSlug(wid, dataTypeId, fieldSlug, newSlug) {
2816
+ return this.fetch(
2817
+ `w/${wid}/data-types/${dataTypeId}/fields/${fieldSlug}/rename-preview`,
2818
+ { method: "POST", body: JSON.stringify({ newSlug }) }
2819
+ );
2820
+ }
2821
+ /**
2822
+ * Rename a field's slug, preserving stored answers.
2823
+ *
2824
+ * The schema change commits synchronously; the answers are moved by the
2825
+ * existing cleanup workflow, so this resolves on ACCEPTANCE, not completion.
2826
+ * Call {@link previewRenameFieldSlug} first — references naming the old slug
2827
+ * are reported, never rewritten.
2828
+ */
2829
+ async renameFieldSlug(wid, dataTypeId, fieldSlug, newSlug) {
2830
+ return this.fetch(
2831
+ `w/${wid}/data-types/${dataTypeId}/fields/${fieldSlug}/rename`,
2832
+ { method: "POST", body: JSON.stringify({ newSlug }) }
2833
+ );
2834
+ }
2795
2835
  /**
2796
2836
  * Validate if a data type slug is available.
2797
2837
  * Returns availability and a suggested alternative if taken.
@@ -2814,6 +2854,44 @@ function isUuid(value) {
2814
2854
  return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
2815
2855
  }
2816
2856
 
2857
+ // src/api/devices.ts
2858
+ var DevicesApi = class extends BaseApiClient {
2859
+ /** List devices visible to the caller (own devices, or all with devices:admin). */
2860
+ async getDevices(wid, options = {}) {
2861
+ const qs = options.mine ? "?mine=true" : "";
2862
+ return this.fetch(`w/${wid}/devices${qs}`);
2863
+ }
2864
+ /** Fetch one device by UUID. Non-owners without devices:admin receive 404. */
2865
+ async getDevice(wid, deviceUuid) {
2866
+ return this.fetch(`w/${wid}/devices/${deviceUuid}`);
2867
+ }
2868
+ /** List shippable companion-device products (Lantern, later SKUs). */
2869
+ async getDeviceKinds(wid) {
2870
+ return this.fetch(`w/${wid}/devices/kinds`);
2871
+ }
2872
+ /** Claim a pairing code shown on a companion device. Requires devices:write. */
2873
+ async claimDevicePairing(wid, body) {
2874
+ return this.fetch(`w/${wid}/devices/pairing/claim`, {
2875
+ method: "POST",
2876
+ body: JSON.stringify(body)
2877
+ });
2878
+ }
2879
+ /** Update display name and/or LAN capability flags. Requires devices:write. */
2880
+ async updateDevice(wid, deviceUuid, body) {
2881
+ return this.fetch(`w/${wid}/devices/${deviceUuid}`, {
2882
+ method: "PATCH",
2883
+ body: JSON.stringify(body)
2884
+ });
2885
+ }
2886
+ /** Revoke a device credential. The device must pair again. Requires devices:write. */
2887
+ async revokeDevice(wid, deviceUuid) {
2888
+ return this.fetch(`w/${wid}/devices/${deviceUuid}/revoke`, {
2889
+ method: "POST",
2890
+ body: JSON.stringify({})
2891
+ });
2892
+ }
2893
+ };
2894
+
2817
2895
  // src/api/discord-bots.ts
2818
2896
  var DiscordBotsApi = class extends BaseApiClient {
2819
2897
  /**
@@ -3244,6 +3322,7 @@ var EventsApi = class extends BaseApiClient {
3244
3322
  if (options.sortBy) params.append("sortBy", options.sortBy);
3245
3323
  if (options.sortOrder) params.append("sortOrder", options.sortOrder);
3246
3324
  if (options.owner) params.append("owner", options.owner);
3325
+ if (options.ownerId) params.append("ownerId", options.ownerId.toString());
3247
3326
  return this.fetch(
3248
3327
  `w/${wid}/routines${params.toString() ? `?${params.toString()}` : ""}`
3249
3328
  );
@@ -4278,6 +4357,23 @@ var InboxesApi = class extends BaseApiClient {
4278
4357
  body: JSON.stringify({ content })
4279
4358
  });
4280
4359
  }
4360
+ /**
4361
+ * Make a stored email's sender a Member of this workspace.
4362
+ *
4363
+ * The explicit alternative to auto-signup for inboxes that accept
4364
+ * non-member mail. Requires `members:write` AND `inboxes:read`. Responds
4365
+ * 409 when a Member already holds the address — gate the call on
4366
+ * `Email.senderIsMember` rather than discovering it from the error.
4367
+ */
4368
+ async addEmailSenderAsMember(wid, inboxId, emailId, body) {
4369
+ return this.fetch(
4370
+ `w/${wid}/inboxes/${inboxId}/emails/${emailId}/add-sender-as-member`,
4371
+ {
4372
+ method: "POST",
4373
+ body: JSON.stringify(body)
4374
+ }
4375
+ );
4376
+ }
4281
4377
  /** Convert an email to text, markdown, or PDF format. */
4282
4378
  async convertEmail(wid, inboxId, emailId, format = "pdf") {
4283
4379
  return this.fetch(
@@ -4620,6 +4716,54 @@ var MembersApi = class extends BaseApiClient {
4620
4716
  async getCurrentMember(wid) {
4621
4717
  return this.fetch(`w/${wid}/me`);
4622
4718
  }
4719
+ /**
4720
+ * One row per workflow available to the member, with its voice state
4721
+ * (Custom Voice). Own-data-or-scope: a member reads their OWN rows with
4722
+ * no member scope; others need members:read.
4723
+ */
4724
+ async getMemberWorkflowVoices(wid, memberId) {
4725
+ return this.fetch(
4726
+ `w/${wid}/members/${memberId}/workflow-voices`
4727
+ );
4728
+ }
4729
+ /** Audition a voice the member can pick for this workflow (PCM16). */
4730
+ async previewMemberWorkflowVoice(wid, memberId, workflowId, body) {
4731
+ const response = await this.fetchRaw(
4732
+ `w/${wid}/members/${memberId}/workflow-voices/${workflowId}/preview`,
4733
+ { method: "POST", body: JSON.stringify(body) }
4734
+ );
4735
+ return response.arrayBuffer();
4736
+ }
4737
+ /** Set the member's preferred voice for one workflow (Custom Voice). */
4738
+ async setMemberWorkflowVoice(wid, memberId, workflowId, body) {
4739
+ return this.fetch(
4740
+ `w/${wid}/members/${memberId}/workflow-voices/${workflowId}`,
4741
+ { method: "PUT", body: JSON.stringify(body) }
4742
+ );
4743
+ }
4744
+ /** Clear the member's preferred voice for one workflow (Custom Voice). */
4745
+ async clearMemberWorkflowVoice(wid, memberId, workflowId) {
4746
+ return this.fetch(
4747
+ `w/${wid}/members/${memberId}/workflow-voices/${workflowId}`,
4748
+ { method: "DELETE" }
4749
+ );
4750
+ }
4751
+ /**
4752
+ * Member-scoped DataTypes the current member may use (self-access — works
4753
+ * on a Site session, which can hold no records scope by construction).
4754
+ */
4755
+ async getMyDataTypes(wid) {
4756
+ return this.fetch(`w/${wid}/me/data-types`);
4757
+ }
4758
+ /** The current member's own records for one DataType (self-access). */
4759
+ async getMyRecords(wid, dataTypeId, options) {
4760
+ const params = new URLSearchParams({ data_type_id: String(dataTypeId) });
4761
+ if (options?.page) params.set("page", String(options.page));
4762
+ if (options?.pageSize) params.set("page_size", String(options.pageSize));
4763
+ return this.fetch(
4764
+ `w/${wid}/me/records?${params.toString()}`
4765
+ );
4766
+ }
4623
4767
  /**
4624
4768
  * Get all members owned by the current member in this workspace.
4625
4769
  * Returns the authenticated member plus any members they own (via owner_id).
@@ -5530,7 +5674,11 @@ var OrgApi = class extends BaseApiClient {
5530
5674
  });
5531
5675
  }
5532
5676
  /**
5533
- * Get the billing customer UUID for an organization.
5677
+ * Get the billing customer and this organization's billable subscription.
5678
+ *
5679
+ * `subscriptionId` is the org-scoped row — never pick the customer's
5680
+ * newest subscription from the list endpoint. One customer can bill many
5681
+ * organizations.
5534
5682
  */
5535
5683
  async getOrgBillingCustomer(orgIdOrUuid) {
5536
5684
  return this.fetch(`o/${orgIdOrUuid}/billing-customer`);
@@ -5870,6 +6018,17 @@ var OrgApi = class extends BaseApiClient {
5870
6018
  async getOrgDomainSite(orgIdOrUuid, domainUuid) {
5871
6019
  return this.fetch(`o/${orgIdOrUuid}/domains/${domainUuid}/site`);
5872
6020
  }
6021
+ /**
6022
+ * Pre-enable DNS check: is the site CNAME resolving to the routing
6023
+ * endpoint yet? Pure DNS — consumes no enable budget.
6024
+ */
6025
+ async preflightOrgDomainSite(orgIdOrUuid, domainUuid) {
6026
+ return this.fetch(
6027
+ `o/${orgIdOrUuid}/domains/${domainUuid}/site/preflight`,
6028
+ // Empty JSON body: the route requires one as a CSRF barrier.
6029
+ { method: "POST", body: JSON.stringify({}) }
6030
+ );
6031
+ }
5873
6032
  /**
5874
6033
  * Verify the site CNAME points at the Gravity Rail sites domain.
5875
6034
  */
@@ -5913,10 +6072,10 @@ var OrgApi = class extends BaseApiClient {
5913
6072
  * is required — brands register per legal entity (Customer Profile);
5914
6073
  * there is no primary-entity fallback.
5915
6074
  */
5916
- async startA2PRegistration(orgUuid, legalEntityUuid, brandName, brandDescription, brandUuid = null) {
6075
+ async startA2PRegistration(orgUuid, legalEntityUuid, brandName, brandUuid = null) {
5917
6076
  return this.fetch(`o/${orgUuid}/phone-numbers/a2p/start`, {
5918
6077
  method: "POST",
5919
- body: JSON.stringify({ legalEntityUuid, brandName, brandDescription, brandUuid })
6078
+ body: JSON.stringify({ legalEntityUuid, brandName, brandUuid })
5920
6079
  });
5921
6080
  }
5922
6081
  /**
@@ -6020,7 +6179,12 @@ var OrgApi = class extends BaseApiClient {
6020
6179
  * Reconcile trust product state against Twilio (discovery + status
6021
6180
  * refresh). Returns the refreshed products plus which product keys were
6022
6181
  * newly discovered. Responds 409 when another Trust Hub operation holds
6023
- * the org lock — retry shortly rather than queueing.
6182
+ * this legal entity's lock, failing fast rather than queueing.
6183
+ *
6184
+ * No `Retry-After` is sent, deliberately (#23601): holders range from a
6185
+ * sub-second JSONB write to a multi-minute Twilio sequence, so no interval
6186
+ * would be honest. Back off on your own schedule, and re-read before
6187
+ * retrying — the operation you collided with may have committed SIDs.
6024
6188
  */
6025
6189
  async syncVoiceTrustProducts(orgUuid, legalEntityUuid) {
6026
6190
  return this.fetch(
@@ -6053,6 +6217,16 @@ var OrgApi = class extends BaseApiClient {
6053
6217
  async listA2PBrands(orgUuid) {
6054
6218
  return this.fetch(`o/${orgUuid}/a2p-brands`);
6055
6219
  }
6220
+ /**
6221
+ * Live per-brand campaign use-case eligibility. Approved brands only — a
6222
+ * brand still under TCR review comes back as a structured 412 the picker
6223
+ * renders as the supported-list fallback, not an error.
6224
+ */
6225
+ async getA2PBrandUseCases(orgUuid, brandUuid) {
6226
+ return this.fetch(
6227
+ `o/${orgUuid}/a2p-brands/${brandUuid}/use-cases`
6228
+ );
6229
+ }
6056
6230
  /**
6057
6231
  * Fetch a brand's resolved A2P campaign config. The response carries both the
6058
6232
  * raw `overrides` and the `resolved` payload (defaults + overrides) the editor
@@ -6724,6 +6898,20 @@ var ProjectsApi = class extends BaseApiClient {
6724
6898
  `w/${wid}/projects/${encodeURIComponent(slug)}/plans/${encodeURIComponent(plan)}`
6725
6899
  );
6726
6900
  }
6901
+ /** Typed update of a project README; absent fields are untouched. */
6902
+ async updateProject(wid, slug, update) {
6903
+ return this.fetch(`w/${wid}/projects/${encodeURIComponent(slug)}`, {
6904
+ method: "PATCH",
6905
+ body: JSON.stringify(update)
6906
+ });
6907
+ }
6908
+ /** Typed update of a plan README; absent fields are untouched. */
6909
+ async updatePlan(wid, slug, plan, update) {
6910
+ return this.fetch(
6911
+ `w/${wid}/projects/${encodeURIComponent(slug)}/plans/${encodeURIComponent(plan)}`,
6912
+ { method: "PATCH", body: JSON.stringify(update) }
6913
+ );
6914
+ }
6727
6915
  };
6728
6916
 
6729
6917
  // src/api/qualifications.ts
@@ -6991,6 +7179,26 @@ var SalesforceApi = class extends BaseApiClient {
6991
7179
  }
6992
7180
  );
6993
7181
  }
7182
+ /**
7183
+ * Pull linked members' Salesforce records now, ignoring the sync cursor.
7184
+ *
7185
+ * The inbound poll only ever returns records modified after the stored
7186
+ * cursor, so a member linked to a record that has not changed since is
7187
+ * unreachable by any poll and its link never receives a field — silently.
7188
+ * This fetches the records by Id and leaves the cursor untouched, so it is
7189
+ * safe to call at any time.
7190
+ *
7191
+ * Omit `memberIds` to resync every linked member (capped server-side).
7192
+ */
7193
+ async resyncSalesforceLinkedMembers(wid, data = {}) {
7194
+ return this.fetch(
7195
+ `w/${wid}/app-connections/salesforce/sync/resync-members`,
7196
+ {
7197
+ method: "POST",
7198
+ body: JSON.stringify(data)
7199
+ }
7200
+ );
7201
+ }
6994
7202
  /**
6995
7203
  * List the sObjects available in the connected org.
6996
7204
  *
@@ -7563,6 +7771,62 @@ var SubscriptionsApi = class extends BaseApiClient {
7563
7771
  headers: { "Content-Type": "application/json" }
7564
7772
  });
7565
7773
  }
7774
+ /** Purchase a role-granting membership in an existing workspace. */
7775
+ async createMemberCheckoutSession(productId, planPeriod = "month", options = {}) {
7776
+ return this.fetch(`subscriptions/member-checkout-session`, {
7777
+ method: "POST",
7778
+ credentials: "include",
7779
+ body: JSON.stringify({ productId, planPeriod, ...options }),
7780
+ headers: { "Content-Type": "application/json" }
7781
+ });
7782
+ }
7783
+ async getMemberSubscriptionStatus(siteUuidOrOptions) {
7784
+ const options = typeof siteUuidOrOptions === "string" ? { siteUuid: siteUuidOrOptions } : siteUuidOrOptions;
7785
+ const params = new URLSearchParams();
7786
+ if (options.siteUuid) params.set("siteUuid", options.siteUuid);
7787
+ if (options.workspaceUuid) params.set("workspaceUuid", options.workspaceUuid);
7788
+ return this.fetch(
7789
+ `subscriptions/member-subscription?${params.toString()}`,
7790
+ { credentials: "include" }
7791
+ );
7792
+ }
7793
+ /** Open Stripe's hosted membership-management portal. */
7794
+ async createMemberPortalSession(options) {
7795
+ return this.fetch(`subscriptions/member-portal-session`, {
7796
+ method: "POST",
7797
+ credentials: "include",
7798
+ body: JSON.stringify(options),
7799
+ headers: { "Content-Type": "application/json" }
7800
+ });
7801
+ }
7802
+ /**
7803
+ * Purchase one physical companion device (one-time payment; Stripe collects
7804
+ * the shipping address in hosted Checkout).
7805
+ */
7806
+ async createDeviceOrderCheckoutSession(productId, options = {}) {
7807
+ return this.fetch(`device-orders/checkout-session`, {
7808
+ method: "POST",
7809
+ credentials: "include",
7810
+ body: JSON.stringify({ productId, ...options }),
7811
+ headers: { "Content-Type": "application/json" }
7812
+ });
7813
+ }
7814
+ /** List the authenticated Account's own device orders in one workspace. */
7815
+ async listDeviceOrders(options) {
7816
+ const params = new URLSearchParams();
7817
+ if (options.siteUuid) params.set("siteUuid", options.siteUuid);
7818
+ if (options.workspaceUuid) params.set("workspaceUuid", options.workspaceUuid);
7819
+ return this.fetch(`device-orders?${params.toString()}`, {
7820
+ credentials: "include"
7821
+ });
7822
+ }
7823
+ /** Read one authenticated, server-owned checkout attempt. */
7824
+ async getCheckoutAttemptStatus(attemptId) {
7825
+ return this.fetch(
7826
+ `subscriptions/checkout-attempts/${encodeURIComponent(attemptId)}`,
7827
+ { credentials: "include" }
7828
+ );
7829
+ }
7566
7830
  /**
7567
7831
  * List self-service, purchasable organization plans or add-ons. Only products
7568
7832
  * with a Stripe Price are returned; zero-amount plans are allowed.
@@ -7767,6 +8031,9 @@ var CustomersApi = class extends BaseApiClient {
7767
8031
  if (opts?.status) params.set("status", opts.status);
7768
8032
  if (opts?.page !== void 0) params.set("page", String(opts.page));
7769
8033
  if (opts?.pageSize !== void 0) params.set("page_size", String(opts.pageSize));
8034
+ if (opts?.subscriptionId !== void 0) {
8035
+ params.set("subscription_id", String(opts.subscriptionId));
8036
+ }
7770
8037
  const qs = params.toString();
7771
8038
  return this.fetch(`customers/${uuid}/subscriptions${qs ? "?" + qs : ""}`);
7772
8039
  }
@@ -8770,28 +9037,36 @@ var WorkflowsApi = class extends BaseApiClient {
8770
9037
  };
8771
9038
 
8772
9039
  // src/api/workflow-notes.ts
9040
+ function notesPath(wid, workflowId, noteId, query) {
9041
+ const base = noteId == null ? `w/${wid}/workflows/${workflowId}/notes` : `w/${wid}/workflows/${workflowId}/notes/${noteId}`;
9042
+ if (query?.workflowRevisionId == null) return base;
9043
+ const params = new URLSearchParams({
9044
+ workflowRevisionId: String(query.workflowRevisionId)
9045
+ });
9046
+ return `${base}?${params.toString()}`;
9047
+ }
8773
9048
  var WorkflowNotesApi = class extends BaseApiClient {
8774
- /** List all notes for a specific workflow. */
8775
- async getWorkflowNotes(wid, workflowId) {
8776
- return this.fetch(`w/${wid}/workflows/${workflowId}/notes`);
9049
+ /** List notes for a workflow root (draft unless `workflowRevisionId` is set). */
9050
+ async getWorkflowNotes(wid, workflowId, query) {
9051
+ return this.fetch(notesPath(wid, workflowId, void 0, query));
8777
9052
  }
8778
- /** Create a new note on a workflow. */
8779
- async createWorkflowNote(wid, workflowId, data) {
8780
- return this.fetch(`w/${wid}/workflows/${workflowId}/notes`, {
9053
+ /** Create a new note on a workflow's draft (or a pinned draft revision). */
9054
+ async createWorkflowNote(wid, workflowId, data, query) {
9055
+ return this.fetch(notesPath(wid, workflowId, void 0, query), {
8781
9056
  method: "POST",
8782
9057
  body: JSON.stringify(data)
8783
9058
  });
8784
9059
  }
8785
9060
  /** Update an existing workflow note with partial data. */
8786
- async updateWorkflowNote(wid, workflowId, noteId, data) {
8787
- return this.fetch(`w/${wid}/workflows/${workflowId}/notes/${noteId}`, {
9061
+ async updateWorkflowNote(wid, workflowId, noteId, data, query) {
9062
+ return this.fetch(notesPath(wid, workflowId, noteId, query), {
8788
9063
  method: "PUT",
8789
9064
  body: JSON.stringify(data)
8790
9065
  });
8791
9066
  }
8792
9067
  /** Delete a workflow note by ID. */
8793
- async deleteWorkflowNote(wid, workflowId, noteId) {
8794
- return this.fetch(`w/${wid}/workflows/${workflowId}/notes/${noteId}`, {
9068
+ async deleteWorkflowNote(wid, workflowId, noteId, query) {
9069
+ return this.fetch(notesPath(wid, workflowId, noteId, query), {
8795
9070
  method: "DELETE"
8796
9071
  });
8797
9072
  }
@@ -8893,6 +9168,9 @@ var Scope = /* @__PURE__ */ ((Scope2) => {
8893
9168
  Scope2["FILES_READ"] = "files:read";
8894
9169
  Scope2["FILES_WRITE"] = "files:write";
8895
9170
  Scope2["FILES_ADMIN"] = "files:admin";
9171
+ Scope2["DEVICES_READ"] = "devices:read";
9172
+ Scope2["DEVICES_WRITE"] = "devices:write";
9173
+ Scope2["DEVICES_ADMIN"] = "devices:admin";
8896
9174
  Scope2["SITES_READ"] = "sites:read";
8897
9175
  Scope2["SITES_WRITE"] = "sites:write";
8898
9176
  Scope2["SITES_ADMIN"] = "sites:admin";
@@ -9055,6 +9333,7 @@ var EventRuleEventType = /* @__PURE__ */ ((EventRuleEventType2) => {
9055
9333
  EventRuleEventType2["CALENDAR_EVENT_CANCELLED"] = "calendar_event:cancelled";
9056
9334
  EventRuleEventType2["CALENDAR_EVENT_STARTING"] = "calendar_event:starting";
9057
9335
  EventRuleEventType2["CALENDAR_EVENT_ENDED"] = "calendar_event:ended";
9336
+ EventRuleEventType2["CALENDAR_EVENT_NO_SHOW"] = "calendar_event:no_show";
9058
9337
  EventRuleEventType2["CONNECTOR_EVENT"] = "connector:event";
9059
9338
  EventRuleEventType2["ASSIGNMENT_CONCLUDED"] = "assignment:concluded";
9060
9339
  EventRuleEventType2["JOURNEY_STEP_EXECUTE"] = "journey_step:execute";
@@ -9137,7 +9416,6 @@ var WorkspaceFeature = /* @__PURE__ */ ((WorkspaceFeature2) => {
9137
9416
  WorkspaceFeature2["CONFLUENCE"] = "confluence";
9138
9417
  WorkspaceFeature2["AGENT_MEMORY"] = "agent_memory";
9139
9418
  WorkspaceFeature2["IMAGE_GENERATION"] = "image_generation";
9140
- WorkspaceFeature2["STRICT_NATIVE_VOICE"] = "strict_native_voice";
9141
9419
  WorkspaceFeature2["CHARLESTON_NEPHROLOGY_PMD_PAGING"] = "charleston_nephrology_pmd_paging";
9142
9420
  WorkspaceFeature2["PATIENTSYNC_TRANSFER"] = "patientsync_transfer";
9143
9421
  return WorkspaceFeature2;
@@ -9177,6 +9455,8 @@ var Resource = /* @__PURE__ */ ((Resource2) => {
9177
9455
  var ProductType = /* @__PURE__ */ ((ProductType2) => {
9178
9456
  ProductType2["ORG"] = "org";
9179
9457
  ProductType2["ADDON"] = "addon";
9458
+ ProductType2["MEMBER"] = "member";
9459
+ ProductType2["DEVICE"] = "device";
9180
9460
  return ProductType2;
9181
9461
  })(ProductType || {});
9182
9462
  var ORG_ONLY_RESOURCES = /* @__PURE__ */ new Set([
@@ -9296,7 +9576,6 @@ var REALTIME_MODEL_OPENAI_MINI = "openai:realtime:gpt-realtime-mini";
9296
9576
  var REALTIME_MODEL_OPENAI_2 = "openai:realtime:gpt-realtime-2";
9297
9577
  var REALTIME_MODEL_GEMINI = "google:aistudio:gemini-3.1-flash-live";
9298
9578
  var REALTIME_MODEL_GEMINI_VERTEX = "google:vertex:gemini-3.1-flash-live";
9299
- var REALTIME_MODEL_NOVA_SONIC = "aws:bedrock:nova-sonic-1";
9300
9579
  var REALTIME_MODEL_CUSTOM = "custom:realtime:composable";
9301
9580
  var STT_MODEL_DEEPGRAM_FLUX = "deepgram:stt:flux-general-en";
9302
9581
  var STT_MODEL_DEEPGRAM_FLUX_SELFHOST = "deepgram:stt:flux-general-en:selfhost";
@@ -9828,6 +10107,13 @@ var WorkspacesApi = class extends BaseApiClient {
9828
10107
  signal: options?.signal
9829
10108
  });
9830
10109
  }
10110
+ /** Provision the one-month direct organization plan carried by a promo code. */
10111
+ async startPromoPlanTrial(request) {
10112
+ return this.fetch("promo-codes/plan-trial", {
10113
+ method: "POST",
10114
+ body: JSON.stringify(request)
10115
+ });
10116
+ }
9831
10117
  /** Get a publicly accessible product by ID. */
9832
10118
  async getPublicProduct(id) {
9833
10119
  return this.fetch(`products/${id}`);
@@ -9878,15 +10164,47 @@ var WorkspacesApi = class extends BaseApiClient {
9878
10164
  })
9879
10165
  });
9880
10166
  }
9881
- /** Import workspace configuration from exported data. */
9882
- async importWorkspace(wid, exportData, importMappings, createNew) {
10167
+ /** Download a workspace export ZIP (``export.json`` + file blobs). */
10168
+ async exportWorkspaceZip(wid, workflowId, scope, exclude) {
10169
+ const searchParams = new URLSearchParams();
10170
+ if (workflowId !== void 0) searchParams.set("workflow_id", String(workflowId));
10171
+ if (scope !== void 0) searchParams.set("scope", scope);
10172
+ if (exclude !== void 0) searchParams.set("exclude", exclude);
10173
+ const qs = searchParams.toString();
10174
+ const response = await this.fetchRaw(`w/${wid}/export.zip${qs ? `?${qs}` : ""}`);
10175
+ return response.arrayBuffer();
10176
+ }
10177
+ /** Import workspace configuration from exported JSON, or from a ZIP archive.
10178
+ * Pass ``archive`` (the ZIP from ``exportWorkspaceZip``) to restore file
10179
+ * contents. ``exportData`` may be omitted when the ZIP contains it.
10180
+ */
10181
+ async importWorkspace(wid, exportData, importMappings, createNew, archive) {
10182
+ const payload = {
10183
+ importMappings,
10184
+ createNew
10185
+ };
10186
+ if (exportData) {
10187
+ payload.exportData = exportData;
10188
+ }
10189
+ if (archive) {
10190
+ const form = new FormData();
10191
+ form.append(
10192
+ "request",
10193
+ new Blob([JSON.stringify(payload)], { type: "application/json" }),
10194
+ "import.json"
10195
+ );
10196
+ form.append("archive", archive, "workspace-export.zip");
10197
+ return this.fetch(`w/${wid}/import.zip`, {
10198
+ method: "POST",
10199
+ body: form
10200
+ });
10201
+ }
10202
+ if (!exportData) {
10203
+ throw new Error("exportData is required for JSON import");
10204
+ }
9883
10205
  return this.fetch(`w/${wid}/import`, {
9884
10206
  method: "POST",
9885
- body: JSON.stringify({
9886
- exportData,
9887
- importMappings,
9888
- createNew
9889
- })
10207
+ body: JSON.stringify(payload)
9890
10208
  });
9891
10209
  }
9892
10210
  /** Preview a workspace import using the legacy untyped interface. */
@@ -9928,7 +10246,6 @@ var WorkspacesApi = class extends BaseApiClient {
9928
10246
  * Get billing dashboard data for a workspace.
9929
10247
  *
9930
10248
  * This endpoint is available to organization owners (with org:info scope).
9931
- * Superusers should use the admin endpoint via getWorkspaceUsageDashboard.
9932
10249
  *
9933
10250
  * Returns comprehensive billing information including:
9934
10251
  * - Subscription status and plan details
@@ -10026,6 +10343,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
10026
10343
  customToolkits: new CustomToolkitsApi(apiKey, baseUrl, customFetch),
10027
10344
  dashboards: new DashboardsApi(apiKey, baseUrl, customFetch),
10028
10345
  dataTypes: new DataTypesApi(apiKey, baseUrl, customFetch),
10346
+ devices: new DevicesApi(apiKey, baseUrl, customFetch),
10029
10347
  discordBots: new DiscordBotsApi(apiKey, baseUrl, customFetch),
10030
10348
  slackApps: new SlackAppsApi(apiKey, baseUrl, customFetch),
10031
10349
  teamsApps: new TeamsAppsApi(apiKey, baseUrl, customFetch),
@@ -10084,6 +10402,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
10084
10402
  // src/client/workspace-client.ts
10085
10403
  var WORKSPACE_METHOD_NAMES = [
10086
10404
  "activateWorkflowRevision",
10405
+ "addEmailSenderAsMember",
10087
10406
  "addGroupMember",
10088
10407
  "advanceStep",
10089
10408
  "approveWorkspaceInvitation",
@@ -10114,6 +10433,7 @@ var WORKSPACE_METHOD_NAMES = [
10114
10433
  "checkAvailability",
10115
10434
  "checkSiteDomainAvailability",
10116
10435
  "checkSiteSlugAvailability",
10436
+ "claimDevicePairing",
10117
10437
  "clearConnectionMemberExclusion",
10118
10438
  "clearMemberSwitch",
10119
10439
  "clearTrackedLinkDestinations",
@@ -10301,6 +10621,7 @@ var WORKSPACE_METHOD_NAMES = [
10301
10621
  "exportMembers",
10302
10622
  "exportPhoneNumberOutboundAnalyticsCsv",
10303
10623
  "exportWorkspace",
10624
+ "exportWorkspaceZip",
10304
10625
  "fetchVoicemailAudio",
10305
10626
  "fhirBackfillEncounterSync",
10306
10627
  "fhirCheckPatientLinks",
@@ -10397,6 +10718,11 @@ var WORKSPACE_METHOD_NAMES = [
10397
10718
  "getConnectionSyncConfig",
10398
10719
  "getCredentialUpdateInvites",
10399
10720
  "getCurrentMember",
10721
+ "clearMemberWorkflowVoice",
10722
+ "getMemberWorkflowVoices",
10723
+ "getMyDataTypes",
10724
+ "getMyRecords",
10725
+ "setMemberWorkflowVoice",
10400
10726
  "getCurrentSmsChat",
10401
10727
  "getCustomToolkit",
10402
10728
  "getCustomToolkits",
@@ -10414,6 +10740,9 @@ var WORKSPACE_METHOD_NAMES = [
10414
10740
  "getDataTypeByUuid",
10415
10741
  "getDataTypeBySlug",
10416
10742
  "getDataTypes",
10743
+ "getDevice",
10744
+ "getDeviceKinds",
10745
+ "getDevices",
10417
10746
  "getDiscordBot",
10418
10747
  "getDiscordBotAccounts",
10419
10748
  "getDiscordBotByUuid",
@@ -10567,6 +10896,7 @@ var WORKSPACE_METHOD_NAMES = [
10567
10896
  "getPublicFolderFiles",
10568
10897
  "getPublicProducts",
10569
10898
  "previewPromoCode",
10899
+ "startPromoPlanTrial",
10570
10900
  "getQualification",
10571
10901
  "getQualifications",
10572
10902
  "getRecordingInfo",
@@ -10714,6 +11044,8 @@ var WORKSPACE_METHOD_NAMES = [
10714
11044
  "markNotificationAsRead",
10715
11045
  "mergeMemberRoles",
10716
11046
  "previewImportMembers",
11047
+ "previewMemberWorkflowVoice",
11048
+ "previewRenameFieldSlug",
10717
11049
  "previewImportWorkspace",
10718
11050
  "previewRoutineWorkflowAccess",
10719
11051
  "previewSchedule",
@@ -10726,6 +11058,7 @@ var WORKSPACE_METHOD_NAMES = [
10726
11058
  "rateMessage",
10727
11059
  "getChatFeedback",
10728
11060
  "reenrollMember",
11061
+ "renameFieldSlug",
10729
11062
  "registerLinkedRolesMetadata",
10730
11063
  "registerPushSubscription",
10731
11064
  "reindexFolder",
@@ -10745,6 +11078,7 @@ var WORKSPACE_METHOD_NAMES = [
10745
11078
  "restoreFileVersion",
10746
11079
  "revokeAccessGrant",
10747
11080
  "revokeApiKey",
11081
+ "revokeDevice",
10748
11082
  "revokeICalToken",
10749
11083
  "runRoutine",
10750
11084
  "searchEventRules",
@@ -10815,6 +11149,7 @@ var WORKSPACE_METHOD_NAMES = [
10815
11149
  "updateDataRecord",
10816
11150
  "updateDataRecordFilter",
10817
11151
  "updateDataType",
11152
+ "updateDevice",
10818
11153
  "updateDiscordBot",
10819
11154
  "updateEventAttendee",
10820
11155
  "updateEventRule",
@@ -10848,9 +11183,12 @@ var WORKSPACE_METHOD_NAMES = [
10848
11183
  "updatePersona",
10849
11184
  "updatePhoneNumber",
10850
11185
  "updatePlatformApp",
11186
+ "updatePlan",
10851
11187
  "updateProduct",
11188
+ "updateProject",
10852
11189
  "updateRoutine",
10853
11190
  "updateSalesforceSyncConfig",
11191
+ "resyncSalesforceLinkedMembers",
10854
11192
  "updateScenario",
10855
11193
  "updateSite",
10856
11194
  "updateSiteSharing",
@@ -11070,6 +11408,8 @@ function bindDataTypesMethods(target, dataTypes) {
11070
11408
  target.getDataRecordChanges = dataTypes.getDataRecordChanges.bind(dataTypes);
11071
11409
  target.upsertDataRecord = dataTypes.upsertDataRecord.bind(dataTypes);
11072
11410
  target.toggleFieldIndex = dataTypes.toggleFieldIndex.bind(dataTypes);
11411
+ target.previewRenameFieldSlug = dataTypes.previewRenameFieldSlug.bind(dataTypes);
11412
+ target.renameFieldSlug = dataTypes.renameFieldSlug.bind(dataTypes);
11073
11413
  target.getFieldIndexStatus = dataTypes.getFieldIndexStatus.bind(dataTypes);
11074
11414
  target.validateDataTypeSlug = dataTypes.validateDataTypeSlug.bind(dataTypes);
11075
11415
  target.getMemberRecordCounts = dataTypes.getMemberRecordCounts.bind(dataTypes);
@@ -11081,9 +11421,25 @@ function bindDataTypesMethods(target, dataTypes) {
11081
11421
  target.getDataRecordFilterCount = dataTypes.getDataRecordFilterCount.bind(dataTypes);
11082
11422
  }
11083
11423
 
11424
+ // src/client/bindings/devices.ts
11425
+ function bindDevicesMethods(target, devices) {
11426
+ target.getDevices = devices.getDevices.bind(devices);
11427
+ target.getDevice = devices.getDevice.bind(devices);
11428
+ target.getDeviceKinds = devices.getDeviceKinds.bind(devices);
11429
+ target.claimDevicePairing = devices.claimDevicePairing.bind(devices);
11430
+ target.updateDevice = devices.updateDevice.bind(devices);
11431
+ target.revokeDevice = devices.revokeDevice.bind(devices);
11432
+ }
11433
+
11084
11434
  // src/client/bindings/members.ts
11085
11435
  function bindMembersMethods(target, members) {
11086
11436
  target.getCurrentMember = members.getCurrentMember.bind(members);
11437
+ target.getMyDataTypes = members.getMyDataTypes.bind(members);
11438
+ target.getMyRecords = members.getMyRecords.bind(members);
11439
+ target.getMemberWorkflowVoices = members.getMemberWorkflowVoices.bind(members);
11440
+ target.previewMemberWorkflowVoice = members.previewMemberWorkflowVoice.bind(members);
11441
+ target.setMemberWorkflowVoice = members.setMemberWorkflowVoice.bind(members);
11442
+ target.clearMemberWorkflowVoice = members.clearMemberWorkflowVoice.bind(members);
11087
11443
  target.getOwnedMembers = members.getOwnedMembers.bind(members);
11088
11444
  target.switchMember = members.switchMember.bind(members);
11089
11445
  target.clearMemberSwitch = members.clearMemberSwitch.bind(members);
@@ -11176,6 +11532,7 @@ function bindWorkspacesMethods(target, workspaces, signupRequests) {
11176
11532
  target.updateProduct = workspaces.updateProduct.bind(workspaces);
11177
11533
  target.deleteProduct = workspaces.deleteProduct.bind(workspaces);
11178
11534
  target.exportWorkspace = workspaces.exportWorkspace.bind(workspaces);
11535
+ target.exportWorkspaceZip = workspaces.exportWorkspaceZip.bind(workspaces);
11179
11536
  target.previewWorkspaceImport = workspaces.previewWorkspaceImport.bind(workspaces);
11180
11537
  target.importWorkspace = workspaces.importWorkspace.bind(workspaces);
11181
11538
  target.previewImportWorkspace = workspaces.previewImportWorkspace.bind(workspaces);
@@ -11362,6 +11719,8 @@ function bindProjectsMethods(target, projects) {
11362
11719
  target.getProjects = projects.getProjects.bind(projects);
11363
11720
  target.getProject = projects.getProject.bind(projects);
11364
11721
  target.getPlan = projects.getPlan.bind(projects);
11722
+ target.updateProject = projects.updateProject.bind(projects);
11723
+ target.updatePlan = projects.updatePlan.bind(projects);
11365
11724
  }
11366
11725
 
11367
11726
  // src/client/bindings/events.ts
@@ -11522,6 +11881,7 @@ function bindCommunicationsMethods(target, phoneNumbers, inboxes, notificationRu
11522
11881
  target.getInboxEmail = inboxes.getInboxEmail.bind(inboxes);
11523
11882
  target.markEmailAsRead = inboxes.markEmailAsRead.bind(inboxes);
11524
11883
  target.markEmailAsUnread = inboxes.markEmailAsUnread.bind(inboxes);
11884
+ target.addEmailSenderAsMember = inboxes.addEmailSenderAsMember.bind(inboxes);
11525
11885
  target.convertEmail = inboxes.convertEmail.bind(inboxes);
11526
11886
  target.downloadEmailAttachment = inboxes.downloadEmailAttachment.bind(inboxes);
11527
11887
  target.getInboxThreads = inboxes.getInboxThreads.bind(inboxes);
@@ -11591,6 +11951,12 @@ function bindBillingMethods(target, apiKeys, subscriptions, reports) {
11591
11951
  target.addWorkspaceToSubscription = subscriptions.addWorkspaceToSubscription.bind(subscriptions);
11592
11952
  target.purchaseCredits = subscriptions.purchaseCredits.bind(subscriptions);
11593
11953
  target.createCheckoutSession = subscriptions.createCheckoutSession.bind(subscriptions);
11954
+ target.createMemberCheckoutSession = subscriptions.createMemberCheckoutSession.bind(subscriptions);
11955
+ target.createMemberPortalSession = subscriptions.createMemberPortalSession.bind(subscriptions);
11956
+ target.getMemberSubscriptionStatus = subscriptions.getMemberSubscriptionStatus.bind(subscriptions);
11957
+ target.createDeviceOrderCheckoutSession = subscriptions.createDeviceOrderCheckoutSession.bind(subscriptions);
11958
+ target.listDeviceOrders = subscriptions.listDeviceOrders.bind(subscriptions);
11959
+ target.getCheckoutAttemptStatus = subscriptions.getCheckoutAttemptStatus.bind(subscriptions);
11594
11960
  target.listSelfServeProducts = subscriptions.listSelfServeProducts.bind(subscriptions);
11595
11961
  target.getAIUsageReport = reports.getAIUsageReport.bind(reports);
11596
11962
  target.getSMSUsageReport = reports.getSMSUsageReport.bind(reports);
@@ -11768,6 +12134,7 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
11768
12134
  target.getLinkedSalesforceMembers = salesforce.getLinkedSalesforceMembers.bind(salesforce);
11769
12135
  target.getSalesforceSyncConfig = salesforce.getSalesforceSyncConfig.bind(salesforce);
11770
12136
  target.updateSalesforceSyncConfig = salesforce.updateSalesforceSyncConfig.bind(salesforce);
12137
+ target.resyncSalesforceLinkedMembers = salesforce.resyncSalesforceLinkedMembers.bind(salesforce);
11771
12138
  target.listSalesforceObjects = salesforce.listSalesforceObjects.bind(salesforce);
11772
12139
  target.describeSalesforceObject = salesforce.describeSalesforceObject.bind(salesforce);
11773
12140
  target.searchSalesforceRecords = salesforce.searchSalesforceRecords.bind(salesforce);
@@ -11839,6 +12206,7 @@ function bindOrgMethods(target, org) {
11839
12206
  target.disableOrgDomainEmail = org.disableOrgDomainEmail.bind(org);
11840
12207
  target.enableOrgDomainSite = org.enableOrgDomainSite.bind(org);
11841
12208
  target.getOrgDomainSite = org.getOrgDomainSite.bind(org);
12209
+ target.preflightOrgDomainSite = org.preflightOrgDomainSite.bind(org);
11842
12210
  target.verifyOrgDomainSite = org.verifyOrgDomainSite.bind(org);
11843
12211
  target.disableOrgDomainSite = org.disableOrgDomainSite.bind(org);
11844
12212
  target.getBusinessProfile = org.getBusinessProfile.bind(org);
@@ -12109,6 +12477,8 @@ var GravityRailClient = class {
12109
12477
  getDataRecordChanges;
12110
12478
  upsertDataRecord;
12111
12479
  toggleFieldIndex;
12480
+ previewRenameFieldSlug;
12481
+ renameFieldSlug;
12112
12482
  getFieldIndexStatus;
12113
12483
  validateDataTypeSlug;
12114
12484
  getMemberRecordCounts;
@@ -12120,6 +12490,12 @@ var GravityRailClient = class {
12120
12490
  getDataRecordFilterCount;
12121
12491
  // Members API
12122
12492
  getCurrentMember;
12493
+ getMyDataTypes;
12494
+ getMyRecords;
12495
+ getMemberWorkflowVoices;
12496
+ previewMemberWorkflowVoice;
12497
+ setMemberWorkflowVoice;
12498
+ clearMemberWorkflowVoice;
12123
12499
  getOwnedMembers;
12124
12500
  switchMember;
12125
12501
  clearMemberSwitch;
@@ -12354,11 +12730,13 @@ var GravityRailClient = class {
12354
12730
  getWorkspaceProduct;
12355
12731
  getPublicProducts;
12356
12732
  previewPromoCode;
12733
+ startPromoPlanTrial;
12357
12734
  getPublicProduct;
12358
12735
  createProduct;
12359
12736
  updateProduct;
12360
12737
  deleteProduct;
12361
12738
  exportWorkspace;
12739
+ exportWorkspaceZip;
12362
12740
  previewWorkspaceImport;
12363
12741
  importWorkspace;
12364
12742
  previewImportWorkspace;
@@ -12385,6 +12763,7 @@ var GravityRailClient = class {
12385
12763
  disableOrgDomainEmail;
12386
12764
  enableOrgDomainSite;
12387
12765
  getOrgDomainSite;
12766
+ preflightOrgDomainSite;
12388
12767
  verifyOrgDomainSite;
12389
12768
  disableOrgDomainSite;
12390
12769
  getBusinessProfile;
@@ -12521,6 +12900,8 @@ var GravityRailClient = class {
12521
12900
  getProjects;
12522
12901
  getProject;
12523
12902
  getPlan;
12903
+ updateProject;
12904
+ updatePlan;
12524
12905
  resolveFilePath;
12525
12906
  downloadFilesZip;
12526
12907
  createFile;
@@ -12691,6 +13072,7 @@ var GravityRailClient = class {
12691
13072
  getInboxEmail;
12692
13073
  markEmailAsRead;
12693
13074
  markEmailAsUnread;
13075
+ addEmailSenderAsMember;
12694
13076
  convertEmail;
12695
13077
  downloadEmailAttachment;
12696
13078
  getInboxThreads;
@@ -12739,6 +13121,13 @@ var GravityRailClient = class {
12739
13121
  getFeatureRegistry;
12740
13122
  getPublicFeatureRegistry;
12741
13123
  getFeatureBySlug;
13124
+ // Devices API
13125
+ getDevices;
13126
+ getDevice;
13127
+ getDeviceKinds;
13128
+ claimDevicePairing;
13129
+ updateDevice;
13130
+ revokeDevice;
12742
13131
  // Billing API
12743
13132
  getApiKeys;
12744
13133
  createApiKey;
@@ -12754,6 +13143,12 @@ var GravityRailClient = class {
12754
13143
  addWorkspaceToSubscription;
12755
13144
  purchaseCredits;
12756
13145
  createCheckoutSession;
13146
+ createMemberCheckoutSession;
13147
+ createMemberPortalSession;
13148
+ getMemberSubscriptionStatus;
13149
+ createDeviceOrderCheckoutSession;
13150
+ listDeviceOrders;
13151
+ getCheckoutAttemptStatus;
12757
13152
  listSelfServeProducts;
12758
13153
  getAIUsageReport;
12759
13154
  getSMSUsageReport;
@@ -12933,6 +13328,7 @@ var GravityRailClient = class {
12933
13328
  getLinkedSalesforceMembers;
12934
13329
  getSalesforceSyncConfig;
12935
13330
  updateSalesforceSyncConfig;
13331
+ resyncSalesforceLinkedMembers;
12936
13332
  listSalesforceObjects;
12937
13333
  describeSalesforceObject;
12938
13334
  searchSalesforceRecords;
@@ -13035,6 +13431,7 @@ var GravityRailClient = class {
13035
13431
  bindChatsMethods(this, apis.chats);
13036
13432
  bindCallsMethods(this, apis.calls, apis.cel);
13037
13433
  bindDataTypesMethods(this, apis.dataTypes);
13434
+ bindDevicesMethods(this, apis.devices);
13038
13435
  bindMembersMethods(this, apis.members);
13039
13436
  bindAgentTasksMethods(this, apis.agentTasks);
13040
13437
  bindAgentsMethods(this, apis.agents);
@@ -13353,6 +13750,7 @@ var RoutineBuilder = class extends WorkspaceBuilderResource {
13353
13750
  return `Routine: ${this.name} (${parts.join(", ")})`;
13354
13751
  }
13355
13752
  async apply(client) {
13753
+ if (this._existed) return;
13356
13754
  const eventRules = this.rules.map((rule) => {
13357
13755
  const actionParams = { ...rule.actionParams };
13358
13756
  if (rule.workflow?._id !== void 0) actionParams.workflowId = rule.workflow._id;
@@ -13408,6 +13806,7 @@ var NotificationRuleBuilder = class extends WorkspaceBuilderResource {
13408
13806
  return `NotificationRule: ${this.name}${parts.length ? ` (${parts.join(", ")})` : ""}`;
13409
13807
  }
13410
13808
  async apply(client) {
13809
+ if (this._existed) return;
13411
13810
  if (this.memberId === void 0) {
13412
13811
  throw new Error(`Notification rule '${this.name}' requires memberId`);
13413
13812
  }
@@ -13942,6 +14341,7 @@ var RoleUpdate = class extends WorkspaceBuilderResource {
13942
14341
  return `RoleUpdate: roleId=${this.roleId}${parts.length ? ` (${parts.join(", ")})` : ""}`;
13943
14342
  }
13944
14343
  async apply(client) {
14344
+ if (this._existed) return;
13945
14345
  const payload = {};
13946
14346
  if (this.workflowIds) payload.workflowIds = this.workflowIds;
13947
14347
  if (this.dataTypeIds) payload.dataTypeIds = this.dataTypeIds;
@@ -14171,6 +14571,7 @@ var AgentBuilder = class extends WorkspaceBuilderResource {
14171
14571
  return `Agent: ${this.name}${parts.length ? ` (${parts.join(", ")})` : ""}`;
14172
14572
  }
14173
14573
  async apply(client) {
14574
+ if (this._existed) return;
14174
14575
  if (this.memberRoleId === void 0) {
14175
14576
  throw new Error(`Agent '${this.name}' requires memberRoleId`);
14176
14577
  }
@@ -14206,6 +14607,25 @@ var PHASES = /* @__PURE__ */ new Map([
14206
14607
  [JourneyBuilder, 7],
14207
14608
  [JourneyStepBuilder, 8]
14208
14609
  ]);
14610
+ var LIST_PAGE_SIZE = 100;
14611
+ async function collectPages(fetchPage) {
14612
+ const first = await fetchPage(1);
14613
+ const all = [...first.items];
14614
+ const totalPages = first.totalPages ?? 1;
14615
+ for (let page = 2; page <= totalPages; page++) {
14616
+ const next = await fetchPage(page);
14617
+ if (!next.items.length) break;
14618
+ all.push(...next.items);
14619
+ }
14620
+ return all;
14621
+ }
14622
+ function sameIdSet(left, right) {
14623
+ const target = new Set(right);
14624
+ return target.size === new Set(left).size && left.every((id) => target.has(id));
14625
+ }
14626
+ function notificationRuleKey(noticeType, memberId, workflowId) {
14627
+ return JSON.stringify([noticeType, memberId, workflowId]);
14628
+ }
14209
14629
  function phaseFor(resource) {
14210
14630
  let ctor = resource.constructor;
14211
14631
  while (ctor) {
@@ -14468,6 +14888,103 @@ Done! Created ${count} resources.`);
14468
14888
  journeyNames.get(existing.name).adopt(detail);
14469
14889
  }
14470
14890
  }
14891
+ const agentNames = new Map(
14892
+ resources.filter((resource) => resource instanceof AgentBuilder).map((resource) => [resource.name, resource])
14893
+ );
14894
+ if (agentNames.size) {
14895
+ for (const existing of await collectPages(
14896
+ (page) => this.client.getAgents({ page, pageSize: LIST_PAGE_SIZE })
14897
+ )) {
14898
+ if (existing.name && agentNames.has(existing.name)) {
14899
+ agentNames.get(existing.name).adopt(existing);
14900
+ }
14901
+ }
14902
+ }
14903
+ const routineNames = new Map(
14904
+ resources.filter((resource) => resource instanceof RoutineBuilder).map((resource) => [resource.name, resource])
14905
+ );
14906
+ if (routineNames.size) {
14907
+ for (const existing of await collectPages(
14908
+ (page) => this.client.getRoutines({ page, pageSize: LIST_PAGE_SIZE })
14909
+ )) {
14910
+ if (existing.name && routineNames.has(existing.name)) {
14911
+ routineNames.get(existing.name).adopt(existing);
14912
+ }
14913
+ }
14914
+ }
14915
+ await this.resolveExistingRoleUpdates(resources);
14916
+ await this.resolveExistingWorkflows(resources, workflowNames);
14917
+ await this.resolveExistingNotificationRules(resources);
14918
+ }
14919
+ /**
14920
+ * Adopt a role update whose grants the server already has.
14921
+ *
14922
+ * A role update is a replace-semantics PUT, not a create, so its identity is
14923
+ * the role id and "already applied" means the id sets match exactly. Subset
14924
+ * would be wrong: `roleUpdate(7, [])` asks to *clear* the role's workflow
14925
+ * access, and treating that as satisfied by a role that still has grants
14926
+ * would silently skip a real change.
14927
+ *
14928
+ * Only the fields this update declares are compared — an update that passes
14929
+ * `workflowIds` and omits `dataTypeIds` never touches data-type access, so
14930
+ * that access cannot make it stale.
14931
+ */
14932
+ async resolveExistingRoleUpdates(resources) {
14933
+ const updates = resources.filter(
14934
+ (resource) => resource instanceof RoleUpdate
14935
+ );
14936
+ if (!updates.length) return;
14937
+ const rolesById = new Map(
14938
+ (await this.client.getMemberRoles()).map((role) => [role.id, role])
14939
+ );
14940
+ for (const update of updates) {
14941
+ const role = rolesById.get(update.roleId);
14942
+ if (!role) continue;
14943
+ const workflowsSettled = update.workflowIds === void 0 || sameIdSet(
14944
+ update.workflowIds,
14945
+ (role.workflowAccess ?? []).map((access) => access.workflowId)
14946
+ );
14947
+ const dataTypesSettled = update.dataTypeIds === void 0 || sameIdSet(
14948
+ update.dataTypeIds,
14949
+ (role.dataTypeAccess ?? []).map((access) => access.dataTypeId)
14950
+ );
14951
+ if (workflowsSettled && dataTypesSettled) update.adopt(role);
14952
+ }
14953
+ }
14954
+ /**
14955
+ * Adopt notification rules the server already has.
14956
+ *
14957
+ * There is no name on the server row — `NotificationRule` is keyed by what
14958
+ * it does — so identity is the composite the API enforces uniqueness on in
14959
+ * practice: notice type, recipient, and subject workflow.
14960
+ */
14961
+ async resolveExistingNotificationRules(resources) {
14962
+ const rules = resources.filter(
14963
+ (resource) => resource instanceof NotificationRuleBuilder
14964
+ );
14965
+ if (!rules.length) return;
14966
+ const identified = rules.flatMap((rule) => {
14967
+ if (rule.memberId === void 0) return [];
14968
+ if (rule.workflow && rule.workflow._id === void 0) return [];
14969
+ return [
14970
+ [
14971
+ notificationRuleKey(rule.noticeType, rule.memberId, rule.workflow?._id ?? null),
14972
+ rule
14973
+ ]
14974
+ ];
14975
+ });
14976
+ if (!identified.length) return;
14977
+ const byKey = new Map(identified);
14978
+ for (const existing of await this.client.getNotificationRules()) {
14979
+ const key = notificationRuleKey(
14980
+ existing.noticeType,
14981
+ existing.memberId,
14982
+ existing.workflowId ?? null
14983
+ );
14984
+ byKey.get(key)?.adopt(existing);
14985
+ }
14986
+ }
14987
+ async resolveExistingWorkflows(resources, workflowNames) {
14471
14988
  if (!workflowNames.size) return;
14472
14989
  const existingWorkflows = await this.client.getWorkflows();
14473
14990
  for (const { workflow: existing } of existingWorkflows.items) {
@@ -14913,6 +15430,7 @@ var AbilityTypeSlugs = {
14913
15430
  SEND_WHATSAPP: "communication:send_whatsapp",
14914
15431
  MEMBER_ACCESS: "communication:member_access",
14915
15432
  AUDIO_PLAYBACK: "communication:audio_playback",
15433
+ IMAGE_DISPLAY: "communication:image_display",
14916
15434
  // Oversight
14917
15435
  SUPERVISOR: "oversight:supervisor",
14918
15436
  SUPERVISOR_ACTIONS: "oversight:supervisor_actions",
@@ -14921,6 +15439,7 @@ var AbilityTypeSlugs = {
14921
15439
  MEMBER_FIELD_VERIFICATION: "identity:member_field_verification",
14922
15440
  // Delegation
14923
15441
  CONTRIBUTOR: "delegation:contributor",
15442
+ MANAGE_WORKSPACE: "delegation:manage_workspace",
14924
15443
  // Workflow
14925
15444
  WORKFLOW_RUN: "workflow:run",
14926
15445
  // Commerce
@@ -15248,7 +15767,7 @@ function isChatType(value) {
15248
15767
 
15249
15768
  // src/constants/models.ts
15250
15769
  var DEFAULT_CHAT_MODEL = "aws:bedrock:claude-4-5-haiku";
15251
- var DEFAULT_VOICE_INFERENCE_MODEL = "google:vertex:gemini-3-flash";
15770
+ var DEFAULT_VOICE_INFERENCE_MODEL = "openai:chat:gpt-5.6-luna";
15252
15771
  var DEFAULT_CUSTOM_VOICE_MODEL = "elevenlabs:voice:river";
15253
15772
 
15254
15773
  // src/types/resource-metadata.ts
@@ -15352,6 +15871,7 @@ var ScopeCategory = /* @__PURE__ */ ((ScopeCategory2) => {
15352
15871
  ScopeCategory2["DATATYPES"] = "datatypes";
15353
15872
  ScopeCategory2["RECORDS"] = "records";
15354
15873
  ScopeCategory2["FILES"] = "files";
15874
+ ScopeCategory2["DEVICES"] = "devices";
15355
15875
  ScopeCategory2["JOURNEYS"] = "journeys";
15356
15876
  ScopeCategory2["EXPERIMENTS"] = "experiments";
15357
15877
  ScopeCategory2["SITES"] = "sites";
@@ -15596,6 +16116,26 @@ var SCOPES = {
15596
16116
  implies: ["files:write"]
15597
16117
  },
15598
16118
  // =========================================================================
16119
+ // DEVICES
16120
+ // =========================================================================
16121
+ "devices:read": {
16122
+ name: "devices:read",
16123
+ category: "devices" /* DEVICES */,
16124
+ description: "View companion devices"
16125
+ },
16126
+ "devices:write": {
16127
+ name: "devices:write",
16128
+ category: "devices" /* DEVICES */,
16129
+ description: "Enrol and manage own companion devices",
16130
+ implies: ["devices:read"]
16131
+ },
16132
+ "devices:admin": {
16133
+ name: "devices:admin",
16134
+ category: "devices" /* DEVICES */,
16135
+ description: "List and revoke any companion device",
16136
+ implies: ["devices:write"]
16137
+ },
16138
+ // =========================================================================
15599
16139
  // JOURNEYS
15600
16140
  // =========================================================================
15601
16141
  "journeys:read": {
@@ -16090,7 +16630,6 @@ function getRevisionState(workflow, revision) {
16090
16630
  REALTIME_MODEL_CUSTOM,
16091
16631
  REALTIME_MODEL_GEMINI,
16092
16632
  REALTIME_MODEL_GEMINI_VERTEX,
16093
- REALTIME_MODEL_NOVA_SONIC,
16094
16633
  REALTIME_MODEL_OPENAI,
16095
16634
  REALTIME_MODEL_OPENAI_2,
16096
16635
  REALTIME_MODEL_OPENAI_MINI,