@gravity-rail/sdk 0.15.0 → 0.17.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 (42) hide show
  1. package/dist/agui.cjs +13 -1
  2. package/dist/agui.cjs.map +1 -1
  3. package/dist/agui.d.cts +5 -1
  4. package/dist/agui.d.ts +5 -1
  5. package/dist/agui.js +12 -1
  6. package/dist/agui.js.map +1 -1
  7. package/dist/{chunk-QTJQTTIR.js → chunk-CEFOCGYO.js} +521 -69
  8. package/dist/chunk-CEFOCGYO.js.map +1 -0
  9. package/dist/{chunk-GP6ICMWF.js → chunk-PJFEGUHM.js} +8 -1
  10. package/dist/chunk-PJFEGUHM.js.map +1 -0
  11. package/dist/{client-BLuz00Qr.d.cts → client-8xakCsVs.d.cts} +2245 -232
  12. package/dist/{client-CefA5Mxe.d.ts → client-ASnNEN1U.d.ts} +2245 -232
  13. package/dist/helpers.cjs +7 -0
  14. package/dist/helpers.cjs.map +1 -1
  15. package/dist/helpers.d.cts +2 -2
  16. package/dist/helpers.d.ts +2 -2
  17. package/dist/helpers.js +1 -1
  18. package/dist/index.cjs +898 -87
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +182 -9
  21. package/dist/index.d.ts +182 -9
  22. package/dist/index.js +397 -23
  23. package/dist/index.js.map +1 -1
  24. package/dist/internal.cjs +607 -68
  25. package/dist/internal.cjs.map +1 -1
  26. package/dist/internal.d.cts +328 -7
  27. package/dist/internal.d.ts +328 -7
  28. package/dist/internal.js +86 -4
  29. package/dist/internal.js.map +1 -1
  30. package/dist/{revision-state-axZ62kJk.d.cts → revision-state-BDsQo_xD.d.cts} +4 -2
  31. package/dist/{revision-state-DL1ViZ57.d.ts → revision-state-Cz3mcUHc.d.ts} +4 -2
  32. package/dist/schemas.cjs +179 -217
  33. package/dist/schemas.cjs.map +1 -1
  34. package/dist/schemas.d.cts +2 -2
  35. package/dist/schemas.d.ts +2 -2
  36. package/dist/schemas.js +179 -210
  37. package/dist/schemas.js.map +1 -1
  38. package/dist/{tasks-Boi6AxGp.d.cts → tasks-Z4GcIqgO.d.cts} +200 -81
  39. package/dist/{tasks-Boi6AxGp.d.ts → tasks-Z4GcIqgO.d.ts} +200 -81
  40. package/package.json +3 -3
  41. package/dist/chunk-GP6ICMWF.js.map +0 -1
  42. package/dist/chunk-QTJQTTIR.js.map +0 -1
@@ -196,7 +196,6 @@ type WebhookLogSortField = 'createdAt';
196
196
  type RuleExecutionSortField = 'createdAt' | 'completedAt' | 'durationMs' | 'status';
197
197
  type RoutineSortField = 'createdAt' | 'updatedAt' | 'name' | 'scheduledTime';
198
198
  type EventRunSortField = 'createdAt';
199
- type MilestoneSortField = 'name' | 'createdAt' | 'updatedAt' | 'targetDate';
200
199
  type AccountSortField = 'createdAt' | 'updatedAt' | 'name' | 'email';
201
200
  type WorkspaceSortField = 'createdAt' | 'updatedAt' | 'name';
202
201
  type AdminWorkspaceSortField = 'name' | 'slug' | 'createdAt';
@@ -264,6 +263,7 @@ interface AdminAccountOrgMembershipResponse {
264
263
  name: string | null;
265
264
  accountName: string | null;
266
265
  externalId: string | null;
266
+ hasBillingAccess?: boolean;
267
267
  createdAt: string;
268
268
  updatedAt: string;
269
269
  }
@@ -541,6 +541,44 @@ type WebAuthnRegistrationResponseCredentialCreationOptions = {
541
541
  [key: string]: unknown;
542
542
  };
543
543
 
544
+ /**
545
+ * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts
546
+ * (group map from emit_openapi.py). Do not edit manually.
547
+ * Group: config
548
+ */
549
+ /**
550
+ * OIDC config posted by an admin. Carries cleartext `clientSecret`.
551
+ *
552
+ * The route encrypts it before persistence and never stores it in
553
+ * cleartext. Re-saving config with `client_secret=None` keeps the
554
+ * previously encrypted blob intact.
555
+ */
556
+ interface OIDCAdminConfigInput$1 {
557
+ providerType?: OIDCAdminConfigInputProviderType;
558
+ issuer: string;
559
+ clientId: string;
560
+ expectedAudience?: string | null;
561
+ expectedTenantId?: string | null;
562
+ multiTenant?: boolean;
563
+ issuerIsMultiTenantTemplate?: boolean;
564
+ autoProvision?: boolean;
565
+ roleMapping?: OIDCAdminConfigInputRoleMapping;
566
+ rolesKey?: string | null;
567
+ groupsKey?: string | null;
568
+ postLogoutRedirectUris?: string[] | null;
569
+ clientSecret?: string | null;
570
+ }
571
+ type OIDCAdminConfigInputProviderType = typeof OIDCAdminConfigInputProviderType[keyof typeof OIDCAdminConfigInputProviderType];
572
+ declare const OIDCAdminConfigInputProviderType: {
573
+ readonly azure_ad: "azure_ad";
574
+ readonly okta: "okta";
575
+ readonly auth0: "auth0";
576
+ readonly generic: "generic";
577
+ };
578
+ type OIDCAdminConfigInputRoleMapping = {
579
+ [key: string]: string;
580
+ } | null;
581
+
544
582
  /**
545
583
  * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts
546
584
  * (group map from emit_openapi.py). Do not edit manually.
@@ -1029,6 +1067,38 @@ interface SSOConfigData {
1029
1067
  type SSOConfigDataRoleMapping = {
1030
1068
  [key: string]: string;
1031
1069
  } | null;
1070
+ /**
1071
+ * Request model for SSO configuration.
1072
+ */
1073
+ interface SSOConfigRequest {
1074
+ provider: SSOConfigRequestProvider;
1075
+ domain: string;
1076
+ authMode?: SSOConfigRequestAuthMode;
1077
+ config?: SSOProviderConfig | null;
1078
+ }
1079
+ type SSOConfigRequestAuthMode = typeof SSOConfigRequestAuthMode[keyof typeof SSOConfigRequestAuthMode];
1080
+ declare const SSOConfigRequestAuthMode: {
1081
+ readonly open: "open";
1082
+ readonly ssoForDomain: "ssoForDomain";
1083
+ readonly ssoOnly: "ssoOnly";
1084
+ };
1085
+ type SSOConfigRequestProvider = typeof SSOConfigRequestProvider[keyof typeof SSOConfigRequestProvider];
1086
+ declare const SSOConfigRequestProvider: {
1087
+ readonly google: "google";
1088
+ readonly saml: "saml";
1089
+ readonly oidc: "oidc";
1090
+ };
1091
+ /**
1092
+ * Configuration for SSO provider.
1093
+ */
1094
+ interface SSOProviderConfig {
1095
+ autoProvision?: boolean | null;
1096
+ roleMapping?: SSOProviderConfigRoleMapping;
1097
+ oidc?: OIDCAdminConfigInput$1 | null;
1098
+ }
1099
+ type SSOProviderConfigRoleMapping = {
1100
+ [key: string]: string;
1101
+ } | null;
1032
1102
  /**
1033
1103
  * SiteMapping rows that will be dropped on disable.
1034
1104
  */
@@ -1392,12 +1462,6 @@ interface AccountExternalIdentityResponse {
1392
1462
  externalIdHash: string;
1393
1463
  createdAt: string;
1394
1464
  }
1395
- interface UnlinkExternalIdentityResponse {
1396
- id: number;
1397
- accountId: number;
1398
- providerType: string;
1399
- status: string;
1400
- }
1401
1465
  interface OrgScopedIdentityResponse {
1402
1466
  orgExternalIdentityId: number;
1403
1467
  organizationId: number;
@@ -1674,6 +1738,7 @@ interface CurrentMemberResponse {
1674
1738
  locale: string | null;
1675
1739
  memberRoleId: number;
1676
1740
  memberRoleName: string;
1741
+ memberRoleSystemKey?: string | null;
1677
1742
  homeFolderId?: number | null;
1678
1743
  labels?: MemberLabelResponse[];
1679
1744
  accountEnabled?: boolean | null;
@@ -1924,6 +1989,7 @@ interface MemberRoleResponse {
1924
1989
  id: number;
1925
1990
  uuid: string;
1926
1991
  name: string;
1992
+ systemKey?: string | null;
1927
1993
  grantedScopes?: string[];
1928
1994
  siteAccess?: MemberRoleSiteAccessResponse[];
1929
1995
  dataTypeAccess?: MemberRoleDataTypeAccessResponse[];
@@ -2060,6 +2126,7 @@ interface WorkspaceMemberResponse {
2060
2126
  locale: string | null;
2061
2127
  memberRoleId: number;
2062
2128
  memberRoleName: string;
2129
+ memberRoleSystemKey?: string | null;
2063
2130
  homeFolderId?: number | null;
2064
2131
  labels?: MemberLabelResponse[];
2065
2132
  accountEnabled?: boolean | null;
@@ -2332,77 +2399,6 @@ interface QueryFieldsResponse {
2332
2399
  aggregateSourceCategories?: Record<string, Record<string, string>>;
2333
2400
  }
2334
2401
 
2335
- declare const MilestoneGoalFormDataSchema: z.ZodObject<{
2336
- id: z.ZodOptional<z.ZodNumber>;
2337
- name: z.ZodString;
2338
- description: z.ZodOptional<z.ZodString>;
2339
- memberFilterId: z.ZodNumber;
2340
- value: z.ZodOptional<z.ZodNumber>;
2341
- }, z.core.$strip>;
2342
- declare const MilestoneFormDataSchema: z.ZodObject<{
2343
- name: z.ZodString;
2344
- description: z.ZodOptional<z.ZodString>;
2345
- targetDate: z.ZodString;
2346
- goals: z.ZodArray<z.ZodObject<{
2347
- id: z.ZodOptional<z.ZodNumber>;
2348
- name: z.ZodString;
2349
- description: z.ZodOptional<z.ZodString>;
2350
- memberFilterId: z.ZodNumber;
2351
- value: z.ZodOptional<z.ZodNumber>;
2352
- }, z.core.$strip>>;
2353
- }, z.core.$strip>;
2354
- declare const ListMilestonesSchema: z.ZodObject<{
2355
- wid: z.ZodString;
2356
- page: z.ZodOptional<z.ZodNumber>;
2357
- pageSize: z.ZodOptional<z.ZodNumber>;
2358
- sortBy: z.ZodOptional<z.ZodString>;
2359
- sortOrder: z.ZodOptional<z.ZodEnum<{
2360
- asc: "asc";
2361
- desc: "desc";
2362
- }>>;
2363
- }, z.core.$strip>;
2364
- declare const GetMilestoneSchema: z.ZodObject<{
2365
- wid: z.ZodString;
2366
- milestoneId: z.ZodNumber;
2367
- }, z.core.$strip>;
2368
- declare const CreateMilestoneSchema: z.ZodObject<{
2369
- wid: z.ZodString;
2370
- name: z.ZodString;
2371
- description: z.ZodOptional<z.ZodString>;
2372
- targetDate: z.ZodString;
2373
- goals: z.ZodArray<z.ZodObject<{
2374
- id: z.ZodOptional<z.ZodNumber>;
2375
- name: z.ZodString;
2376
- description: z.ZodOptional<z.ZodString>;
2377
- memberFilterId: z.ZodNumber;
2378
- value: z.ZodOptional<z.ZodNumber>;
2379
- }, z.core.$strip>>;
2380
- }, z.core.$strip>;
2381
- declare const UpdateMilestoneSchema: z.ZodObject<{
2382
- wid: z.ZodString;
2383
- milestoneId: z.ZodNumber;
2384
- name: z.ZodOptional<z.ZodString>;
2385
- description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2386
- targetDate: z.ZodOptional<z.ZodString>;
2387
- goals: z.ZodOptional<z.ZodArray<z.ZodObject<{
2388
- id: z.ZodOptional<z.ZodNumber>;
2389
- name: z.ZodString;
2390
- description: z.ZodOptional<z.ZodString>;
2391
- memberFilterId: z.ZodNumber;
2392
- value: z.ZodOptional<z.ZodNumber>;
2393
- }, z.core.$strip>>>;
2394
- }, z.core.$strip>;
2395
- declare const DeleteMilestoneSchema: z.ZodObject<{
2396
- wid: z.ZodString;
2397
- milestoneId: z.ZodNumber;
2398
- }, z.core.$strip>;
2399
- type MilestoneFormData = z.infer<typeof MilestoneFormDataSchema>;
2400
- type ListMilestonesInput = z.infer<typeof ListMilestonesSchema>;
2401
- type GetMilestoneInput = z.infer<typeof GetMilestoneSchema>;
2402
- type CreateMilestoneInput = z.infer<typeof CreateMilestoneSchema>;
2403
- type UpdateMilestoneInput = z.infer<typeof UpdateMilestoneSchema>;
2404
- type DeleteMilestoneInput = z.infer<typeof DeleteMilestoneSchema>;
2405
-
2406
2402
  type MemoryItem = MemoryResponse$1;
2407
2403
  type MemoryResponse = MemoryItem;
2408
2404
  type MemberMemoriesResponse = Omit<MemoryListResponse, 'items'> & {
@@ -2560,7 +2556,99 @@ interface MemberFormData {
2560
2556
  email?: string;
2561
2557
  externalId?: string;
2562
2558
  dateOfBirth?: string | null;
2559
+ /**
2560
+ * Resolve a contact-uniqueness collision by clearing the colliding value off
2561
+ * the member that currently holds it, in the same transaction that claims
2562
+ * it. Requires `members:admin`. Only the fields this request is claiming,
2563
+ * and only where that member's current value *is* the claimed one, are
2564
+ * cleared. See `MemberContactConflict`.
2565
+ */
2566
+ releaseContactFromMemberId?: number;
2563
2567
  }
2568
+ type MemberContactField = 'phone' | 'email' | 'externalId';
2569
+ /**
2570
+ * Structured 409 body returned when a member's phone / email / external ID is
2571
+ * already held by another member in the workspace. Returned by `POST /members`,
2572
+ * `PUT /members/{id}` and `PUT /me` alike.
2573
+ *
2574
+ * Carries the blocking member's **id** only — never their name or contact
2575
+ * value. Fetch the record through the normal member endpoints to display it.
2576
+ */
2577
+ interface MemberContactConflict {
2578
+ error: true;
2579
+ code: 'MEMBER_CONTACT_CONFLICT';
2580
+ message: string;
2581
+ conflictField: MemberContactField;
2582
+ /**
2583
+ * `null` on the server's race backstop, which learns that a uniqueness
2584
+ * constraint fired but not who holds the value. `canRelease` is always
2585
+ * `false` in that case — there is nothing to release *from*.
2586
+ */
2587
+ conflictingMemberId: number | null;
2588
+ conflictingMemberArchived: boolean;
2589
+ /** Whether the caller holds `members:admin` and may release the value. */
2590
+ canRelease: boolean;
2591
+ }
2592
+ /**
2593
+ * Structured 409 body returned when the contact value belongs to another global
2594
+ * **Account** in the organization rather than to a member of this workspace.
2595
+ *
2596
+ * Deliberately carries no member id and no `canRelease`: there is no local
2597
+ * record to show, and the remedy is a verified / holder-consented identity
2598
+ * flow, not something the caller can resolve in this request.
2599
+ */
2600
+ interface AccountContactConflict {
2601
+ error: true;
2602
+ code: 'ACCOUNT_CONTACT_CONFLICT';
2603
+ message: string;
2604
+ conflictField: MemberContactField;
2605
+ }
2606
+ /**
2607
+ * Narrow an unknown thrown value to a member contact conflict.
2608
+ *
2609
+ * Deliberately structural rather than an `instanceof ApiError` check, so the
2610
+ * guard works on errors that crossed a React Query boundary or were re-wrapped.
2611
+ *
2612
+ * A conflict with a null `conflictingMemberId` still matches — it is a real
2613
+ * conflict and its message is the right thing to show. Callers that want to
2614
+ * render the resolution UI should branch on `canRelease`, which is the field
2615
+ * that actually answers "is there something to do about this".
2616
+ *
2617
+ * Only `code` and the id's shape are validated, deliberately. `conflictField`,
2618
+ * `canRelease` and `conflictingMemberArchived` come from the same server
2619
+ * response as `code`; re-validating them would turn a server that added a new
2620
+ * `conflictField` value into a silent "not a conflict at all", which is a worse
2621
+ * failure than rendering an unfamiliar noun. The id is checked because callers
2622
+ * pass it back as a member id.
2623
+ */
2624
+ declare function isMemberContactConflict(error: unknown): MemberContactConflict | null;
2625
+ /** Narrow an unknown thrown value to an account-level contact conflict. */
2626
+ declare function isAccountContactConflict(error: unknown): AccountContactConflict | null;
2627
+ /**
2628
+ * The archived member's id when `POST /members` collided with an archived
2629
+ * record, or `null`. Unlike a contact conflict, the remedy here is to unarchive
2630
+ * that member rather than take a value from them.
2631
+ */
2632
+ declare function archivedMemberConflictId(error: unknown): number | null;
2633
+ /**
2634
+ * A conflict that names the member holding the value.
2635
+ *
2636
+ * This is what the resolution UI needs: something to show the user. Whether
2637
+ * they may also *act* on it is a separate question answered by `canRelease` —
2638
+ * a non-admin still benefits from being told who holds the value and to ask an
2639
+ * admin. The only conflict excluded here is the server's race backstop, which
2640
+ * has no id and so has nothing to display beyond its message.
2641
+ */
2642
+ interface IdentifiedMemberContactConflict extends MemberContactConflict {
2643
+ conflictingMemberId: number;
2644
+ }
2645
+ declare function isIdentifiedMemberContactConflict(conflict: MemberContactConflict | null): conflict is IdentifiedMemberContactConflict;
2646
+ /**
2647
+ * Narrow a thrown value straight to a displayable member conflict — the common
2648
+ * call-site need, since a conflict with no id has no resolution UI and belongs
2649
+ * in the ordinary error toast.
2650
+ */
2651
+ declare function asIdentifiedMemberContactConflict(error: unknown): IdentifiedMemberContactConflict | null;
2564
2652
  interface CreateWorkspaceMemberRequest {
2565
2653
  email?: string;
2566
2654
  phone?: string;
@@ -2571,6 +2659,12 @@ interface CreateWorkspaceMemberRequest {
2571
2659
  dateOfBirth?: string;
2572
2660
  emailTrusted?: boolean;
2573
2661
  phoneTrusted?: boolean;
2662
+ /**
2663
+ * Resolve a contact-uniqueness collision by clearing the colliding value off
2664
+ * the member currently holding it, in the same transaction that creates this
2665
+ * one. Requires `members:admin`. See `MemberContactConflict`.
2666
+ */
2667
+ releaseContactFromMemberId?: number;
2574
2668
  memberRoleId: number;
2575
2669
  notifySms?: boolean;
2576
2670
  notifyEmail?: boolean;
@@ -2609,6 +2703,12 @@ interface UpdateWorkspaceMemberRequest {
2609
2703
  isSuperuser?: boolean;
2610
2704
  accountTosAccepted?: boolean;
2611
2705
  memberType?: MemberType;
2706
+ /**
2707
+ * Resolve a contact-uniqueness collision by clearing the colliding value off
2708
+ * the member currently holding it, in the same transaction that claims it
2709
+ * here. Requires `members:admin`. See `MemberContactConflict`.
2710
+ */
2711
+ releaseContactFromMemberId?: number;
2612
2712
  }
2613
2713
  interface MergeMembersRequest {
2614
2714
  targetMemberId: number;
@@ -2777,6 +2877,7 @@ declare const EventRuleEventType$1: {
2777
2877
  readonly 'data_record:updated': "data_record:updated";
2778
2878
  readonly 'data_record:changed': "data_record:changed";
2779
2879
  readonly 'chat:created': "chat:created";
2880
+ readonly 'chat:summary': "chat:summary";
2780
2881
  readonly 'routine:triggered': "routine:triggered";
2781
2882
  readonly 'workflow:assistant_message': "workflow:assistant_message";
2782
2883
  readonly 'workflow:user_message': "workflow:user_message";
@@ -3115,6 +3216,9 @@ interface RoutineResponse$1 {
3115
3216
  memberFilterName?: string | null;
3116
3217
  targetMemberId?: number | null;
3117
3218
  workflowId?: number | null;
3219
+ managerPrompt?: string | null;
3220
+ managerSkills?: string[] | null;
3221
+ managerModel?: string | null;
3118
3222
  limit: number;
3119
3223
  visibility: string;
3120
3224
  ownerId: number | null;
@@ -3227,6 +3331,8 @@ declare enum EventRuleEventType {
3227
3331
  DATA_RECORD_UPDATED = "data_record:updated",
3228
3332
  DATA_RECORD_CHANGED = "data_record:changed",
3229
3333
  CHAT_CREATED = "chat:created",
3334
+ /** Fires after a chat summary is generated on any channel. */
3335
+ CHAT_SUMMARY = "chat:summary",
3230
3336
  CHAT_CALLBACK = "chat:callback",
3231
3337
  MEMBER_UPDATED = "member:updated",
3232
3338
  ROUTINE_TRIGGERED = "routine:triggered",
@@ -3628,6 +3734,12 @@ interface CreateRoutineRequest {
3628
3734
  memberFilterId?: number | null;
3629
3735
  targetMemberId?: number | null;
3630
3736
  workflowId?: number | null;
3737
+ /** Manager-task purpose: prompt the Workspace Manager should run. */
3738
+ managerPrompt?: string | null;
3739
+ /** Optional starting Manager skills for the task. */
3740
+ managerSkills?: string[] | null;
3741
+ /** Optional model override for the Manager task. */
3742
+ managerModel?: string | null;
3631
3743
  limit?: number;
3632
3744
  visibility?: 'private' | 'workspace';
3633
3745
  /** When true, the server generates a webhook secret and returns its
@@ -3654,6 +3766,9 @@ interface UpdateRoutineRequest {
3654
3766
  memberFilterId?: number | null;
3655
3767
  targetMemberId?: number | null;
3656
3768
  workflowId?: number | null;
3769
+ managerPrompt?: string | null;
3770
+ managerSkills?: string[] | null;
3771
+ managerModel?: string | null;
3657
3772
  limit?: number;
3658
3773
  visibility?: 'private' | 'workspace';
3659
3774
  /** Ordered event rules to attach. Server syncs by UUID: same-UUID rows
@@ -4297,16 +4412,18 @@ declare const CreateInquirySchema: z.ZodObject<{
4297
4412
  state: z.ZodOptional<z.ZodString>;
4298
4413
  message: z.ZodOptional<z.ZodString>;
4299
4414
  productId: z.ZodOptional<z.ZodNumber>;
4415
+ requiresBaa: z.ZodOptional<z.ZodBoolean>;
4300
4416
  documentId: z.ZodOptional<z.ZodString>;
4301
4417
  source: z.ZodOptional<z.ZodEnum<{
4302
4418
  contact: "contact";
4303
- whitepaper: "whitepaper";
4304
4419
  demo: "demo";
4420
+ whitepaper: "whitepaper";
4305
4421
  gap_zero: "gap_zero";
4306
4422
  waitlist_updates: "waitlist_updates";
4307
4423
  about_contact: "about_contact";
4308
4424
  concierge_error: "concierge_error";
4309
4425
  concierge_anonymous: "concierge_anonymous";
4426
+ get_started: "get_started";
4310
4427
  }>>;
4311
4428
  recaptchaToken: z.ZodOptional<z.ZodString>;
4312
4429
  }, z.core.$strip>;
@@ -4330,16 +4447,18 @@ declare const AnonymousInquiryFormSchema: z.ZodObject<{
4330
4447
  state: z.ZodOptional<z.ZodString>;
4331
4448
  message: z.ZodOptional<z.ZodString>;
4332
4449
  productId: z.ZodOptional<z.ZodNumber>;
4450
+ requiresBaa: z.ZodOptional<z.ZodBoolean>;
4333
4451
  documentId: z.ZodOptional<z.ZodString>;
4334
4452
  source: z.ZodOptional<z.ZodEnum<{
4335
4453
  contact: "contact";
4336
- whitepaper: "whitepaper";
4337
4454
  demo: "demo";
4455
+ whitepaper: "whitepaper";
4338
4456
  gap_zero: "gap_zero";
4339
4457
  waitlist_updates: "waitlist_updates";
4340
4458
  about_contact: "about_contact";
4341
4459
  concierge_error: "concierge_error";
4342
4460
  concierge_anonymous: "concierge_anonymous";
4461
+ get_started: "get_started";
4343
4462
  }>>;
4344
4463
  recaptchaToken: z.ZodOptional<z.ZodString>;
4345
4464
  }, z.core.$strip>;
@@ -4504,4 +4623,4 @@ type DeleteTaskInput = z.infer<typeof DeleteTaskSchema>;
4504
4623
  type ArchiveTaskInput = z.infer<typeof ArchiveTaskSchema>;
4505
4624
  type UnarchiveTaskInput = z.infer<typeof UnarchiveTaskSchema>;
4506
4625
 
4507
- export { type CalendarEventFormData as $, AccessLevel as A, AttendeeStatus as B, type AuthorizedRep as C, DataFieldType as D, EventRuleEventType as E, type AvailabilityCheck as F, type AvailabilityResponse as G, type AvailableSlotsRequest as H, type AvailableSlotsResponse as I, type BotSortField as J, type BulkCreateDataRecordRequest as K, type BulkCreateDataRecordResponse as L, type BulkCreateMembersRequest as M, type BulkCreateMembersResponse as N, type BulkMemberItem as O, type BulkMemberResult as P, type QueryPredicate as Q, BulkMemberResultStatus as R, type SchemaField as S, type BulkRecordResult as T, BusinessIndustry as U, type BusinessInfo as V, type BusinessProfileCancelResponse as W, type BusinessProfileSubmitResponse as X, BusinessType as Y, type Calendar as Z, type EventResponse as _, EventRuleActionType as a, type DataTypeMemberRoleAccessInput as a$, type CalendarEventSortField as a0, CalendarEventStatus as a1, type EventTypeResponse as a2, type CalendarEventTypeFormData as a3, type CalendarEventsQueryParams as a4, type CalendarFormData as a5, CalendarPermissionType as a6, type CalendarResponse as a7, type CalendarSchedule as a8, CalendarScheduleAvailabilityType as a9, type CredentialChangeInviteResponse as aA, type CredentialChangeRequestResponse as aB, type CredentialChangeVerifyResponse as aC, type CredentialType as aD, type CurrentMemberResponse as aE, type CurrentOrgMember as aF, type CursorPaginatedResponse as aG, DataCategory as aH, type DataField as aI, type DataIntegrityReportItem as aJ, type DataRecordResponse as aK, type DataRecordAssociationFormData as aL, type DataRecordFieldWarning as aM, type DataRecordFilterResponse as aN, type DataRecordFilterFormData as aO, type DataRecordFilterWithQuery as aP, type DataRecordFormData as aQ, type DataRecordReportItem as aR, type DataRecordRetirementResponse as aS, DataRecordRetirementResponseReason as aT, type DataRecordUpdateResponse as aU, type DataRecordWithAccessMode as aV, type DataRecordsPaginatedResponse as aW, DataSensitivity as aX, type DataTypeResponse as aY, type DataTypeExportItem as aZ, type DataTypeFormData as a_, type CalendarScheduleFormData as aa, CalendarScheduleRecurrence as ab, type CalendarScheduleResponse as ac, CalendarSource as ad, type CancelCredentialChangeInviteResponse as ae, type CancelCredentialChangeResponse as af, type CapabilityRequirementFinding as ag, type CapabilityStatus as ah, type ChatContinueActionParams as ai, type ChatCreateActionParams as aj, type ChatPauseActionParams as ak, type ChatSortField as al, type ChatSummarizeActionParams as am, type ConcludeAssignmentActionParams as an, type CreateAccountOrgMembershipRequest as ao, type CreateAccountOrgMembershipResponse as ap, type CreateAgentRequest as aq, type CreateAnonymousMemberRequest as ar, type CreateCredentialChangeInviteRequest as as, type CreateDataRecordFilterRequest as at, type CreateOrganizationRequest as au, type CreateRoutineRequest as av, type CreateSignupResponse as aw, type CreateWorkspaceMemberRequest as ax, type CredentialChangeInviteConfirmResponse as ay, type CredentialChangeInviteDetailsResponse as az, type AccountResponse as b, type MemberFilterFormData as b$, type DataTypeMemberRoleAccessResponse as b0, DataTypeRecordScope as b1, type DataTypeSortField as b2, type DeleteAccountOrgMembershipResponse as b3, type DetailedAccount as b4, type DuplicateAccountInfo as b5, type EcwRefreshMemberEncountersActionParams as b6, type EmailDisableImpactResponse as b7, EmailDnsRecordType as b8, type EmailDomainConfigResponse as b9, type GoogleCalendarInsufficientScopesResponse as bA, type GoogleCalendarStatusResponse as bB, type ICalFeedTokenResponse as bC, type ICalFeedUrlResponse as bD, type IdentityConflictPolicy as bE, IndexStatus as bF, type IndexStatusResponse as bG, type InvokeCustomToolActionParams as bH, JobPosition as bI, type JourneyEnrollActionParams as bJ, type JourneySortField as bK, type LibModelsGlbResponsesOrganizationResponsesSSOConfigResponse as bL, type LinkCalendarRequest as bM, type LinkCalendarResponse as bN, type LoginRequest as bO, type LoginResponse as bP, type LogoUploadRequest as bQ, type LogoUploadResponse as bR, MASKED_SECRET_SENTINEL as bS, type McpServerSortField as bT, type WorkspaceMemberResponse as bU, type MemberCredentialResponse as bV, type MemberFieldResponse as bW, type MemberFieldDefinitionResponse as bX, type MemberFieldDefinitionListResponse as bY, type MemberFieldListResponse as bZ, type MemberFilterResponse as b_, type EmailSendActionParams as ba, type EmailVerificationResponse as bb, type EnumOption as bc, type ErrorResponse as bd, type EventActionMapping as be, type EventActionMappingsResponse as bf, type EventRule as bg, type EventRuleExportItem as bh, type EventRuleFormData as bi, type EventRuleInput as bj, EventRuleObjectType as bk, type EventRuleResponse as bl, type EventRunSortField as bm, type ExpireAnonymousMemberRequest as bn, type ExternalAttendeeData as bo, type FileSortField as bp, type FormFieldUpdateActionParams as bq, type GenerateRecoveryCodesRequest as br, type BusinessProfileResponse as bs, type CalendarResponse$1 as bt, type CalendarScheduleResponse$1 as bu, type MemoryListResponse as bv, type MemoryResponse$1 as bw, type OrgDomainResponse as bx, type OwnershipDnsRecord as by, type GoogleCalendarInfo as bz, type AccountFormData as c, PERMISSION_ADMIN as c$, type MemberFilterWithQuery as c0, type MemberFormData as c1, type MemberImportConflictInfo as c2, type MemberImportIdentitySnapshot as c3, type MemberImportMatchInfo as c4, MemberImportMatchInfoMatchType as c5, type MemberImportPreviewResponse as c6, type MemberImportPreviewRow as c7, MemberImportPreviewRowAction as c8, type MemberImportPreviewSummary as c9, type MembersQueryParams as cA, type MemoryItem as cB, type MemoryResponse as cC, type MemoryType as cD, type MergeMembersRequest as cE, type MergeMembersResponse as cF, type MessageValidationActionParams as cG, type MilestoneSortField as cH, type MissingMembershipItem as cI, type MondayColumnMapping as cJ, type MondayLookupType as cK, type MondayRefreshActionParams as cL, type MondayRefreshColumnMapping as cM, type MondayUpsertItemActionParams as cN, type MondayUpsertMode as cO, type MultiMatchBehavior as cP, type NormalizeMemberRequest as cQ, type NormalizeMemberResponse as cR, type OIDCAdminConfigView as cS, OIDCAdminConfigViewProviderType as cT, type ObjectPermission as cU, type ObjectPermissionFlags as cV, type OrgMember as cW, type OrgMemberListResponse as cX, type OrgMemberRole as cY, type OrganizationResponse as cZ, type OwnershipVerificationResponse as c_, type MemberImportStreamConflict as ca, type MemberImportStreamEvent as cb, type MemberLabelResponse as cc, type MemberLabelActionParams as cd, type MemberLabelFormData as ce, type MemberMemoriesResponse as cf, type MemberMessageActivity as cg, type MemberOrgView as ch, type MemberReportItem as ci, type MemberRoleResponse as cj, type MemberRoleCalendarAccessResponse as ck, type MemberRoleDataTypeAccessResponse as cl, type MemberRoleFileAccessResponse as cm, type MemberRoleFolderAccessResponse as cn, type MemberRoleFormData as co, type MemberRoleInboxAccessResponse as cp, type MemberRoleSiteAccessResponse as cq, type MemberRoleTaskAccess as cr, type MemberRoleWorkflowAccessResponse as cs, type MemberSortField as ct, type MemberSummary as cu, type MemberSyncLink as cv, MemberType as cw, type MemberUpsertActionParams as cx, type MemberUpsertBehavior as cy, type MemberWorkspaceInfo as cz, type AccountLookupResponse as d, type RoutineRunResponse as d$, PERMISSION_CREATE as d0, PERMISSION_DELETE as d1, PERMISSION_EDIT as d2, PERMISSION_GEOLOCATE as d3, PERMISSION_LIST as d4, PERMISSION_LIST_ALL as d5, PERMISSION_NONE as d6, PERMISSION_USE as d7, PERMISSION_VERIFY as d8, type PageSortField as d9, type QueryMatchAll as dA, type QueryMetric as dB, type QueryNot as dC, type QueryNowValue as dD, type QueryOr as dE, type QueryRangeBound as dF, type QueryRangeValue as dG, type QueryRecordFieldInfo as dH, type QueryRecordMatch as dI, type QueryRecordSelection as dJ, type QueryRelationMatch as dK, type QueryRunMode as dL, type QuerySavedFilterRef as dM, type QueryScalar as dN, type QuerySortKey as dO, type QuerySubQueryRef as dP, type QueryTemporalValue as dQ, type QueryValue as dR, type RecoveryCodeResponse as dS, Region as dT, RegistrationIdentifier as dU, type RequestCredentialChangeRequest as dV, type RequestMagicLinkRequest as dW, type RequestMagicLinkResponse as dX, type ResolveAnonymousMemberRequest as dY, type Routine as dZ, type RoutineResponse as d_, type PaginatedResponse as da, type PendingAnonymousMembersResponse as db, type PendingCredentialChangeResponse as dc, type PendingCredentialChangeInviteResponse as dd, type PhoneCallActionParams as de, type PlayAudioActionParams as df, QUERY_VALUELESS_OPS as dg, type QualificationSortField as dh, type QueryAggregateOp as di, type QueryAggregatePredicate as dj, type QueryAggregateSpec as dk, type QueryAnd as dl, type QueryCompare as dm, type QueryComparisonOp as dn, type QueryCostInfo as dp, type QueryDataTypeInfo as dq, type QueryDayBoundaryValue as dr, type QueryDaysAgoValue as ds, type QueryDaysFromNowValue as dt, type QueryEntityType as du, type QueryEnumOption as dv, type QueryFieldInfo as dw, type QueryFieldsResponse as dx, type QueryGroupBy as dy, type QueryIR as dz, type AccountReportItem as e, type VerifyWebAuthnSetupRequest as e$, type RoutineRunStatus as e0, type RoutineRunsQueryParams as e1, type RoutineScheduleMode as e2, type RoutineSortField as e3, type RoutineVisibility as e4, type RoutineWorkflowAccessMissingRoleResponse as e5, type RoutineWorkflowAccessPreviewRequest as e6, type RoutineWorkflowAccessPreviewResponse as e7, type RoutineWorkflowAccessWarningResponse as e8, type RoutinesQueryParams as e9, type TaskExportDataTypeRelation as eA, type TaskExportEventRuleRelation as eB, type TaskSortField as eC, type TestWebhookRequest as eD, type TestWebhookResponse as eE, type TimeSlot as eF, type TwoFactorMethod as eG, type TwoFactorOperationResponse as eH, type TwoFactorStatus as eI, type UnlinkCalendarResponse as eJ, type UpdateAgentRequest as eK, type UpdateAttendeeRequest as eL, type UpdateDataRecordFilterRequest as eM, type UpdateEventRuleFormData as eN, type UpdateOrgMemberRequest as eO, type UpdateOrganizationRequest as eP, type UpdateRoutineRequest as eQ, type UpdateTwoFactorMethodRequest as eR, type UpdateWorkspaceMemberRequest as eS, type ValidateMagicLinkRequest as eT, type ValidateMagicLinkResponse as eU, type ValidateQueryResponse as eV, type VerifyCodeRequest as eW, type VerifyCodeResponse as eX, type VerifyCredentialChangeRequest as eY, type VerifyEmailRequest as eZ, type VerifyTOTPSetupRequest as e_, type RuleExecutionSortField as ea, type RuleExecutionsQueryParams as eb, type RunQueryRequest as ec, type RunQueryResponse as ed, type SendLoginCodeResponse as ee, type SSOConfigData as ef, type SchedulePreviewRequest as eg, type SchedulePreviewResponse as eh, Scope as ei, type SendEmailVerificationRequest as ej, type SessionExchangeRequest as ek, type SessionExchangeResponse as el, type SetupTOTPRequest as em, type SetupWebAuthnRequest as en, type SignupAccountResponse as eo, type SignupMemberResponse as ep, type SiteDisableImpactResponse as eq, SiteDnsRecordType as er, type SiteDomainConfigResponse as es, type SiteSortField as et, type SiteVerificationResponse as eu, type SmsSendActionParams as ev, type SortOrder as ew, type SwitchTaskActionParams as ex, type SyncCalendarResponse as ey, type TOTPSetupResponse as ez, type AccountSortField as f, DeclaredDataUse as f$, WORKFLOW_IMPLICIT_USE_SCOPE as f0, type WebhookActionParams as f1, type WebhookLogSortField as f2, type WebhookLogsQueryParams as f3, type WorkflowAccessRole as f4, type WorkflowRoleAccess as f5, type WorkflowSortField as f6, type WorkspaceMemberCountResponse as f7, type WorkspaceMemberCountResponseActiveByType as f8, type WorkspaceSortField as f9, EnrichInquirySchema as fA, type GetInquiryInput as fB, GetInquirySchema as fC, type GetMilestoneInput as fD, GetMilestoneSchema as fE, type GetTaskInput as fF, GetTaskSchema as fG, type ListInquiriesInput as fH, ListInquiriesSchema as fI, type ListMilestonesInput as fJ, ListMilestonesSchema as fK, type ListTasksInput as fL, ListTasksSchema as fM, type MilestoneFormData as fN, MilestoneFormDataSchema as fO, MilestoneGoalFormDataSchema as fP, type TaskFormData as fQ, TaskFormDataSchema as fR, type UnarchiveTaskInput as fS, UnarchiveTaskSchema as fT, type UpdateInquiryInput as fU, UpdateInquiryRequestSchema as fV, UpdateInquirySchema as fW, type UpdateMilestoneInput as fX, UpdateMilestoneSchema as fY, type UpdateTaskInput as fZ, UpdateTaskSchema as f_, decodePermissions as fa, encodePermissions as fb, eventRuleActionParams as fc, roleCanUseWorkflow as fd, roleImplicitWorkflowUseScope as fe, roleWorkflowAccess as ff, type AbilityData as fg, AbilityDataSchema as fh, AnonymousInquiryFormSchema as fi, type ArchiveTaskInput as fj, ArchiveTaskSchema as fk, type ChildTaskFormData as fl, ChildTaskFormDataSchema as fm, type CreateInquiryInput as fn, CreateInquirySchema as fo, type CreateMilestoneInput as fp, CreateMilestoneSchema as fq, type CreateTaskInput as fr, CreateTaskSchema as fs, type DeleteInquiryInput as ft, DeleteInquirySchema as fu, type DeleteMilestoneInput as fv, DeleteMilestoneSchema as fw, type DeleteTaskInput as fx, DeleteTaskSchema as fy, type EnrichInquiryInput as fz, type AccountState as g, type AccountDataExport as g0, type AccountExternalIdentityResponse as g1, type AccountIdentityResolutionResponse as g2, type AdminAccountResponse as g3, type AdminAccountFormData as g4, type AdminAccountMembership as g5, type AdminAccountMembershipResponse as g6, type AdminAccountOrgMembershipResponse as g7, type AdminOrganization as g8, type AdminOrganizationResponse as g9, type AdminWorkspaceMemberFormData as ga, type ConsentRecordExport as gb, type DataExportResponse as gc, type DeletionCancelResponse as gd, type DeletionRequestResponse as ge, type TwoFactorMethodResponse$1 as gf, type TwoFactorStatusResponse$1 as gg, type OIDCAdminConfigInput as gh, type OrgMembershipExport as gi, type OrgScopedIdentityResponse as gj, type TwoFactorMethodResponse as gk, type TwoFactorMethodType as gl, type TwoFactorStatusResponse as gm, type UnlinkExternalIdentityResponse as gn, type WebAuthnRegistrationResponse as go, type WorkspaceMembershipExport as gp, type EnumOption$1 as gq, type EventRuleResponse$1 as gr, type OrgDomainListResponse as gs, type EmailDnsRecord as gt, type EmailDomainConfigGetResponse as gu, type SiteDnsRecord as gv, type SiteDomainConfigGetResponse as gw, type Address as h, type AdminWorkspaceSortField as i, type AgentResponse as j, type AgentConfigResponse as k, type AgentConfigFormData as l, type AgentMemoryConfig as m, type AgentSortField as n, type AnonymousInteractionResponse as o, type AnonymousMemberResolutionResponse as p, type AnonymousMemberResolutionStatus as q, type ApiKeyResponse as r, type ApiKeyCreatedResponse as s, type ApiKeyFormData as t, type ApiKeyScope as u, type ApiKeyScopesResponse as v, type AssignmentSortField as w, type AssistantMessageActionParams as x, type AttendeeResponse as y, AttendeeResponseStatus as z };
4626
+ export { type Calendar as $, AccessLevel as A, type AttendeeResponse as B, AttendeeResponseStatus as C, DataFieldType as D, EventRuleEventType as E, AttendeeStatus as F, type AuthorizedRep as G, type AvailabilityCheck as H, type AvailabilityResponse as I, type AvailableSlotsRequest as J, type AvailableSlotsResponse as K, type BotSortField as L, type BulkCreateDataRecordRequest as M, type BulkCreateDataRecordResponse as N, type BulkCreateMembersRequest as O, type BulkCreateMembersResponse as P, type QueryPredicate as Q, type BulkMemberItem as R, type SchemaField as S, type BulkMemberResult as T, BulkMemberResultStatus as U, type BulkRecordResult as V, BusinessIndustry as W, type BusinessInfo as X, type BusinessProfileCancelResponse as Y, type BusinessProfileSubmitResponse as Z, BusinessType as _, EventRuleActionType as a, type DataTypeExportItem as a$, type EventResponse as a0, type CalendarEventFormData as a1, type CalendarEventSortField as a2, CalendarEventStatus as a3, type EventTypeResponse as a4, type CalendarEventTypeFormData as a5, type CalendarEventsQueryParams as a6, type CalendarFormData as a7, CalendarPermissionType as a8, type CalendarResponse as a9, type CredentialChangeInviteConfirmResponse as aA, type CredentialChangeInviteDetailsResponse as aB, type CredentialChangeInviteResponse as aC, type CredentialChangeRequestResponse as aD, type CredentialChangeVerifyResponse as aE, type CredentialType as aF, type CurrentMemberResponse as aG, type CurrentOrgMember as aH, type CursorPaginatedResponse as aI, DataCategory as aJ, type DataField as aK, type DataIntegrityReportItem as aL, type DataRecordResponse as aM, type DataRecordAssociationFormData as aN, type DataRecordFieldWarning as aO, type DataRecordFilterResponse as aP, type DataRecordFilterFormData as aQ, type DataRecordFilterWithQuery as aR, type DataRecordFormData as aS, type DataRecordReportItem as aT, type DataRecordRetirementResponse as aU, DataRecordRetirementResponseReason as aV, type DataRecordUpdateResponse as aW, type DataRecordWithAccessMode as aX, type DataRecordsPaginatedResponse as aY, DataSensitivity as aZ, type DataTypeResponse as a_, type CalendarSchedule as aa, CalendarScheduleAvailabilityType as ab, type CalendarScheduleFormData as ac, CalendarScheduleRecurrence as ad, type CalendarScheduleResponse as ae, CalendarSource as af, type CancelCredentialChangeInviteResponse as ag, type CancelCredentialChangeResponse as ah, type CapabilityRequirementFinding as ai, type CapabilityStatus as aj, type ChatContinueActionParams as ak, type ChatCreateActionParams as al, type ChatPauseActionParams as am, type ChatSortField as an, type ChatSummarizeActionParams as ao, type ConcludeAssignmentActionParams as ap, type CreateAccountOrgMembershipRequest as aq, type CreateAccountOrgMembershipResponse as ar, type CreateAgentRequest as as, type CreateAnonymousMemberRequest as at, type CreateCredentialChangeInviteRequest as au, type CreateDataRecordFilterRequest as av, type CreateOrganizationRequest as aw, type CreateRoutineRequest as ax, type CreateSignupResponse as ay, type CreateWorkspaceMemberRequest as az, type EventRuleInput as b, type MemberFieldDefinitionResponse as b$, type DataTypeFormData as b0, type DataTypeMemberRoleAccessInput as b1, type DataTypeMemberRoleAccessResponse as b2, DataTypeRecordScope as b3, type DataTypeSortField as b4, type DeleteAccountOrgMembershipResponse as b5, type DetailedAccount as b6, type DuplicateAccountInfo as b7, type EcwRefreshMemberEncountersActionParams as b8, type EmailDisableImpactResponse as b9, type GoogleCalendarInfo as bA, type GoogleCalendarInsufficientScopesResponse as bB, type GoogleCalendarStatusResponse as bC, type ICalFeedTokenResponse as bD, type ICalFeedUrlResponse as bE, type IdentifiedMemberContactConflict as bF, type IdentityConflictPolicy as bG, IndexStatus as bH, type IndexStatusResponse as bI, type InvokeCustomToolActionParams as bJ, JobPosition as bK, type JourneyEnrollActionParams as bL, type JourneySortField as bM, type LibModelsGlbResponsesOrganizationResponsesSSOConfigResponse as bN, type LinkCalendarRequest as bO, type LinkCalendarResponse as bP, type LoginRequest as bQ, type LoginResponse as bR, type LogoUploadRequest as bS, type LogoUploadResponse as bT, MASKED_SECRET_SENTINEL as bU, type McpServerSortField as bV, type WorkspaceMemberResponse as bW, type MemberContactConflict as bX, type MemberContactField as bY, type MemberCredentialResponse as bZ, type MemberFieldResponse as b_, EmailDnsRecordType as ba, type EmailDomainConfigResponse as bb, type EmailSendActionParams as bc, type EmailVerificationResponse as bd, type EnumOption as be, type ErrorResponse as bf, type EventActionMapping as bg, type EventActionMappingsResponse as bh, type EventRule as bi, type EventRuleExportItem as bj, type EventRuleFormData as bk, EventRuleObjectType as bl, type EventRuleResponse as bm, type EventRunSortField as bn, type ExpireAnonymousMemberRequest as bo, type ExternalAttendeeData as bp, type FileSortField as bq, type FormFieldUpdateActionParams as br, type GenerateRecoveryCodesRequest as bs, type BusinessProfileResponse as bt, type CalendarResponse$1 as bu, type CalendarScheduleResponse$1 as bv, type MemoryListResponse as bw, type MemoryResponse$1 as bx, type OrgDomainResponse as by, type OwnershipDnsRecord as bz, type AccountResponse as c, type OrgMemberRole as c$, type MemberFieldDefinitionListResponse as c0, type MemberFieldListResponse as c1, type MemberFilterResponse as c2, type MemberFilterFormData as c3, type MemberFilterWithQuery as c4, type MemberFormData as c5, type MemberImportConflictInfo as c6, type MemberImportIdentitySnapshot as c7, type MemberImportMatchInfo as c8, MemberImportMatchInfoMatchType as c9, MemberType as cA, type MemberUpsertActionParams as cB, type MemberUpsertBehavior as cC, type MemberWorkspaceInfo as cD, type MembersQueryParams as cE, type MemoryItem as cF, type MemoryResponse as cG, type MemoryType as cH, type MergeMembersRequest as cI, type MergeMembersResponse as cJ, type MessageValidationActionParams as cK, type MissingMembershipItem as cL, type MondayColumnMapping as cM, type MondayLookupType as cN, type MondayRefreshActionParams as cO, type MondayRefreshColumnMapping as cP, type MondayUpsertItemActionParams as cQ, type MondayUpsertMode as cR, type MultiMatchBehavior as cS, type NormalizeMemberRequest as cT, type NormalizeMemberResponse as cU, type OIDCAdminConfigView as cV, OIDCAdminConfigViewProviderType as cW, type ObjectPermission as cX, type ObjectPermissionFlags as cY, type OrgMember as cZ, type OrgMemberListResponse as c_, type MemberImportPreviewResponse as ca, type MemberImportPreviewRow as cb, MemberImportPreviewRowAction as cc, type MemberImportPreviewSummary as cd, type MemberImportStreamConflict as ce, type MemberImportStreamEvent as cf, type MemberLabelResponse as cg, type MemberLabelActionParams as ch, type MemberLabelFormData as ci, type MemberMemoriesResponse as cj, type MemberMessageActivity as ck, type MemberOrgView as cl, type MemberReportItem as cm, type MemberRoleResponse as cn, type MemberRoleCalendarAccessResponse as co, type MemberRoleDataTypeAccessResponse as cp, type MemberRoleFileAccessResponse as cq, type MemberRoleFolderAccessResponse as cr, type MemberRoleFormData as cs, type MemberRoleInboxAccessResponse as ct, type MemberRoleSiteAccessResponse as cu, type MemberRoleTaskAccess as cv, type MemberRoleWorkflowAccessResponse as cw, type MemberSortField as cx, type MemberSummary as cy, type MemberSyncLink as cz, type AccountContactConflict as d, type ResolveAnonymousMemberRequest as d$, type OrganizationResponse as d0, type OwnershipVerificationResponse as d1, PERMISSION_ADMIN as d2, PERMISSION_CREATE as d3, PERMISSION_DELETE as d4, PERMISSION_EDIT as d5, PERMISSION_GEOLOCATE as d6, PERMISSION_LIST as d7, PERMISSION_LIST_ALL as d8, PERMISSION_NONE as d9, type QueryFieldsResponse as dA, type QueryGroupBy as dB, type QueryIR as dC, type QueryMatchAll as dD, type QueryMetric as dE, type QueryNot as dF, type QueryNowValue as dG, type QueryOr as dH, type QueryRangeBound as dI, type QueryRangeValue as dJ, type QueryRecordFieldInfo as dK, type QueryRecordMatch as dL, type QueryRecordSelection as dM, type QueryRelationMatch as dN, type QueryRunMode as dO, type QuerySavedFilterRef as dP, type QueryScalar as dQ, type QuerySortKey as dR, type QuerySubQueryRef as dS, type QueryTemporalValue as dT, type QueryValue as dU, type RecoveryCodeResponse as dV, Region as dW, RegistrationIdentifier as dX, type RequestCredentialChangeRequest as dY, type RequestMagicLinkRequest as dZ, type RequestMagicLinkResponse as d_, PERMISSION_USE as da, PERMISSION_VERIFY as db, type PageSortField as dc, type PaginatedResponse as dd, type PendingAnonymousMembersResponse as de, type PendingCredentialChangeResponse as df, type PendingCredentialChangeInviteResponse as dg, type PhoneCallActionParams as dh, type PlayAudioActionParams as di, QUERY_VALUELESS_OPS as dj, type QualificationSortField as dk, type QueryAggregateOp as dl, type QueryAggregatePredicate as dm, type QueryAggregateSpec as dn, type QueryAnd as dp, type QueryCompare as dq, type QueryComparisonOp as dr, type QueryCostInfo as ds, type QueryDataTypeInfo as dt, type QueryDayBoundaryValue as du, type QueryDaysAgoValue as dv, type QueryDaysFromNowValue as dw, type QueryEntityType as dx, type QueryEnumOption as dy, type QueryFieldInfo as dz, type AccountFormData as e, type VerifyCodeRequest as e$, type Routine as e0, type RoutineResponse as e1, type RoutineRunResponse as e2, type RoutineRunStatus as e3, type RoutineRunsQueryParams as e4, type RoutineScheduleMode as e5, type RoutineSortField as e6, type RoutineVisibility as e7, type RoutineWorkflowAccessMissingRoleResponse as e8, type RoutineWorkflowAccessPreviewRequest as e9, type SmsSendActionParams as eA, type SortOrder as eB, type SwitchTaskActionParams as eC, type SyncCalendarResponse as eD, type TOTPSetupResponse as eE, type TaskExportDataTypeRelation as eF, type TaskExportEventRuleRelation as eG, type TaskSortField as eH, type TestWebhookRequest as eI, type TestWebhookResponse as eJ, type TimeSlot as eK, type TwoFactorMethod as eL, type TwoFactorOperationResponse as eM, type TwoFactorStatus as eN, type UnlinkCalendarResponse as eO, type UpdateAgentRequest as eP, type UpdateAttendeeRequest as eQ, type UpdateDataRecordFilterRequest as eR, type UpdateEventRuleFormData as eS, type UpdateOrgMemberRequest as eT, type UpdateOrganizationRequest as eU, type UpdateRoutineRequest as eV, type UpdateTwoFactorMethodRequest as eW, type UpdateWorkspaceMemberRequest as eX, type ValidateMagicLinkRequest as eY, type ValidateMagicLinkResponse as eZ, type ValidateQueryResponse as e_, type RoutineWorkflowAccessPreviewResponse as ea, type RoutineWorkflowAccessWarningResponse as eb, type RoutinesQueryParams as ec, type RuleExecutionSortField as ed, type RuleExecutionsQueryParams as ee, type RunQueryRequest as ef, type RunQueryResponse as eg, type SendLoginCodeResponse as eh, type SSOConfigData as ei, type SSOConfigRequest as ej, type SSOProviderConfig as ek, type SchedulePreviewRequest as el, type SchedulePreviewResponse as em, Scope as en, type SendEmailVerificationRequest as eo, type SessionExchangeRequest as ep, type SessionExchangeResponse as eq, type SetupTOTPRequest as er, type SetupWebAuthnRequest as es, type SignupAccountResponse as et, type SignupMemberResponse as eu, type SiteDisableImpactResponse as ev, SiteDnsRecordType as ew, type SiteDomainConfigResponse as ex, type SiteSortField as ey, type SiteVerificationResponse as ez, type AccountLookupResponse as f, type AccountIdentityResolutionResponse as f$, type VerifyCodeResponse as f0, type VerifyCredentialChangeRequest as f1, type VerifyEmailRequest as f2, type VerifyTOTPSetupRequest as f3, type VerifyWebAuthnSetupRequest as f4, WORKFLOW_IMPLICIT_USE_SCOPE as f5, type WebhookActionParams as f6, type WebhookLogSortField as f7, type WebhookLogsQueryParams as f8, type WorkflowAccessRole as f9, CreateTaskSchema as fA, type DeleteInquiryInput as fB, DeleteInquirySchema as fC, type DeleteTaskInput as fD, DeleteTaskSchema as fE, type EnrichInquiryInput as fF, EnrichInquirySchema as fG, type GetInquiryInput as fH, GetInquirySchema as fI, type GetTaskInput as fJ, GetTaskSchema as fK, type ListInquiriesInput as fL, ListInquiriesSchema as fM, type ListTasksInput as fN, ListTasksSchema as fO, type TaskFormData as fP, TaskFormDataSchema as fQ, type UnarchiveTaskInput as fR, UnarchiveTaskSchema as fS, type UpdateInquiryInput as fT, UpdateInquiryRequestSchema as fU, UpdateInquirySchema as fV, type UpdateTaskInput as fW, UpdateTaskSchema as fX, DeclaredDataUse as fY, type AccountDataExport as fZ, type AccountExternalIdentityResponse as f_, type WorkflowRoleAccess as fa, type WorkflowSortField as fb, type WorkspaceMemberCountResponse as fc, type WorkspaceMemberCountResponseActiveByType as fd, type WorkspaceSortField as fe, archivedMemberConflictId as ff, asIdentifiedMemberContactConflict as fg, decodePermissions as fh, encodePermissions as fi, eventRuleActionParams as fj, isAccountContactConflict as fk, isIdentifiedMemberContactConflict as fl, isMemberContactConflict as fm, roleCanUseWorkflow as fn, roleImplicitWorkflowUseScope as fo, roleWorkflowAccess as fp, type AbilityData as fq, AbilityDataSchema as fr, AnonymousInquiryFormSchema as fs, type ArchiveTaskInput as ft, ArchiveTaskSchema as fu, type ChildTaskFormData as fv, ChildTaskFormDataSchema as fw, type CreateInquiryInput as fx, CreateInquirySchema as fy, type CreateTaskInput as fz, type AccountReportItem as g, type AdminAccountResponse as g0, type AdminAccountFormData as g1, type AdminAccountMembership as g2, type AdminAccountMembershipResponse as g3, type AdminAccountOrgMembershipResponse as g4, type AdminOrganization as g5, type AdminOrganizationResponse as g6, type AdminWorkspaceMemberFormData as g7, type ConsentRecordExport as g8, type DataExportResponse as g9, type DeletionCancelResponse as ga, type DeletionRequestResponse as gb, type TwoFactorMethodResponse$1 as gc, type TwoFactorStatusResponse$1 as gd, type OIDCAdminConfigInput as ge, type OrgMembershipExport as gf, type OrgScopedIdentityResponse as gg, type TwoFactorMethodResponse as gh, type TwoFactorMethodType as gi, type TwoFactorStatusResponse as gj, type WebAuthnRegistrationResponse as gk, type WorkspaceMembershipExport as gl, type EnumOption$1 as gm, type EventRuleResponse$1 as gn, type OrgDomainListResponse as go, type EmailDnsRecord as gp, type EmailDomainConfigGetResponse as gq, type SiteDnsRecord as gr, type SiteDomainConfigGetResponse as gs, type AccountSortField as h, type AccountState as i, type Address as j, type AdminWorkspaceSortField as k, type AgentResponse as l, type AgentConfigResponse as m, type AgentConfigFormData as n, type AgentMemoryConfig as o, type AgentSortField as p, type AnonymousInteractionResponse as q, type AnonymousMemberResolutionResponse as r, type AnonymousMemberResolutionStatus as s, type ApiKeyResponse as t, type ApiKeyCreatedResponse as u, type ApiKeyFormData as v, type ApiKeyScope as w, type ApiKeyScopesResponse as x, type AssignmentSortField as y, type AssistantMessageActionParams as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-rail/sdk",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "Gravity Rail TypeScript SDK — API client for workspace management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -95,10 +95,10 @@
95
95
  "devDependencies": {
96
96
  "@modelcontextprotocol/sdk": "^1.26.0",
97
97
  "@types/jest": "^30.0.0",
98
- "@types/node": "^24.13.3",
98
+ "@types/node": "^26.1.2",
99
99
  "@types/react": "^19.2.17",
100
100
  "jest": "^30.4.2",
101
- "react": "^19.2.7",
101
+ "react": "^19.2.8",
102
102
  "ts-jest": "^29.4.6",
103
103
  "tsup": "^8.3.5",
104
104
  "typedoc": "^0.28.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/api/base.ts"],"sourcesContent":["// Utility function to read a specific cookie value\nexport function getCookieValue(name: string): string | undefined {\n if (typeof document === 'undefined') return undefined;\n\n const cookies = document.cookie.split(';');\n for (const cookie of cookies) {\n const trimmedCookie = cookie.trim();\n const eqIndex = trimmedCookie.indexOf('=');\n if (eqIndex === -1) continue;\n\n const cookieName = trimmedCookie.substring(0, eqIndex);\n const cookieValue = trimmedCookie.substring(eqIndex + 1);\n\n if (cookieName === name) {\n return cookieValue;\n }\n }\n\n return undefined;\n}\n\n/**\n * Structured validation error returned by the backend's workflow-expression\n * validator (CEL / Jinja schema checks). See WorkflowValidationErrorResponse\n * in workflowValidationTypes.ts for the public-facing shape.\n */\nexport interface ApiValidationError {\n field: string;\n kind: 'cel_syntax' | 'cel_schema' | 'jinja_syntax' | 'jinja_schema';\n message: string;\n offendingPath: string | null;\n location: {\n start: number;\n end: number;\n line: number;\n column: number;\n length: number;\n } | null;\n suggestion: string | null;\n}\n\nfunction isApiValidationError(value: unknown): value is ApiValidationError {\n if (!value || typeof value !== 'object') return false;\n const v = value as Record<string, unknown>;\n return (\n typeof v.field === 'string' && typeof v.kind === 'string' && typeof v.message === 'string'\n );\n}\n\nexport class ApiError extends Error {\n statusCode: number;\n /** Legacy string-array errors — kept for non-validation callers. */\n errors?: string[];\n /**\n * Structured workflow-expression validation errors (CEL/Jinja).\n * Populated when the backend returns a WorkflowValidationErrorResponse.\n */\n validationErrors?: ApiValidationError[];\n\n constructor(\n message: string,\n statusCode: number,\n errors?: string[],\n validationErrors?: ApiValidationError[]\n ) {\n super(message);\n this.statusCode = statusCode;\n this.errors = errors;\n this.validationErrors = validationErrors;\n }\n}\n\n/**\n * Handler for enhanced authentication requirement (RFC 9470 Step-Up Authentication).\n * Called when a 401 response includes WWW-Authenticate header with\n * error=\"insufficient_user_authentication\".\n * Should return a promise that resolves with the new auth token after re-auth.\n */\nexport type EnhancedAuthHandler = () => Promise<string>;\n\n/**\n * Info parsed from WWW-Authenticate header for org auth requirement.\n */\nexport interface OrgAuthInfo {\n orgUuid: string;\n cookieName: string;\n authUrl: string;\n}\n\n/**\n * Handler for organization authentication requirement.\n * Called when a 401 response includes WWW-Authenticate header with realm=\"org\".\n * The handler should redirect the user to the auth URL for consent/SSO.\n * Returns a promise that resolves when the user should retry (after page reload with cookie).\n */\nexport type OrgAuthHandler = (info: OrgAuthInfo) => Promise<void>;\n\n/**\n * Check if a WWW-Authenticate header indicates step-up authentication is required.\n * Per RFC 9470, this is indicated by error=\"insufficient_user_authentication\".\n */\nfunction requiresStepUpAuth(wwwAuthenticate: string | null): boolean {\n if (!wwwAuthenticate) return false;\n return wwwAuthenticate.includes('error=\"insufficient_user_authentication\"');\n}\n\n/**\n * Parse org auth info from WWW-Authenticate header.\n * Returns null if this is not an org auth challenge.\n * Expected format: Bearer realm=\"org\", org_uuid=\"...\", cookie_name=\"...\", auth_url=\"...\"\n *\n * Exported so non-SDK fetch paths (e.g. the app's same-origin file-content\n * proxy fetches) can detect the same challenge and trigger the shared org\n * step-up flow.\n */\nexport function parseOrgAuthChallenge(wwwAuthenticate: string | null): OrgAuthInfo | null {\n if (!wwwAuthenticate) return null;\n if (!wwwAuthenticate.includes('realm=\"org\"')) return null;\n\n // Parse the key-value pairs from the header\n const orgUuidMatch = wwwAuthenticate.match(/org_uuid=\"([^\"]+)\"/);\n const cookieNameMatch = wwwAuthenticate.match(/cookie_name=\"([^\"]+)\"/);\n const authUrlMatch = wwwAuthenticate.match(/auth_url=\"([^\"]+)\"/);\n\n if (!orgUuidMatch?.[1] || !cookieNameMatch?.[1] || !authUrlMatch?.[1]) {\n // Don't log the raw header value — it embeds org_uuid + auth_url.\n console.warn('Invalid org auth challenge header: missing required fields');\n return null;\n }\n\n return {\n orgUuid: orgUuidMatch[1],\n cookieName: cookieNameMatch[1],\n authUrl: authUrlMatch[1],\n };\n}\n\nfunction getRequestOrgCookieName(cookieName: string): string | null {\n if (cookieName.startsWith('orgToken')) {\n return cookieName.replace(/^orgToken/, 'requestOrgToken');\n }\n if (cookieName.startsWith('orgSession')) {\n return cookieName.replace(/^orgSession/, 'requestOrgSession');\n }\n return null;\n}\n\nfunction orgAuthHeaderName(token: string): 'X-Org-Token' | 'X-Org-Session' {\n return token.startsWith('gr_sess_') ? 'X-Org-Session' : 'X-Org-Token';\n}\n\nfunction setOrgAuthHeader(headers: Headers, token: string | undefined): void {\n if (!token) return;\n headers.set(orgAuthHeaderName(token), token);\n}\n\nexport class BaseApiClient {\n protected baseUrl: string;\n protected apiKey: string | undefined;\n protected isCrossDomain: boolean;\n protected fetchFunction: typeof fetch;\n private enhancedAuthHandler?: EnhancedAuthHandler;\n private enhancedAuthInProgress: Promise<string> | null = null;\n private orgAuthHandler?: OrgAuthHandler;\n private orgAuthInProgress: Promise<void> | null = null;\n private actingMemberUuid?: string;\n private orgSession?: string;\n /**\n * The org_uuid that issued the current org auth credential. Tracked so we can detect\n * a 401 challenge from a *different* org and re-fire the handler — the\n * credential is opaque to the client, so without this the original guard\n * `!this.orgSession` would prevent re-auth across orgs and surface as a silent\n * 401 in multi-org CLI workflows.\n */\n private orgSessionOrgUuid?: string;\n\n constructor(apiKey: string | undefined, baseUrl: string, customFetch?: typeof fetch) {\n this.baseUrl = baseUrl;\n this.apiKey = apiKey;\n // console.log('[BaseApiClient] constructor - baseUrl:', baseUrl);\n // Bind fetch to its proper context (window in browser, global in Node)\n this.fetchFunction =\n customFetch || (typeof window !== 'undefined' ? fetch.bind(window) : fetch);\n\n // Determine if we're making cross-domain requests by comparing current origin to API origin\n const apiUrlParsed = new URL(baseUrl);\n const currentOrigin = typeof window !== 'undefined' ? window.location.origin : '';\n this.isCrossDomain = currentOrigin !== '' && currentOrigin !== apiUrlParsed.origin;\n // console.log('[BaseApiClient] isCrossDomain:', this.isCrossDomain, 'currentOrigin:', currentOrigin, 'apiOrigin:', apiUrlParsed.origin);\n }\n\n /**\n * Set the handler for enhanced authentication requirements (RFC 9470 Step-Up Auth).\n * This handler is called when a 401 response includes WWW-Authenticate header\n * with error=\"insufficient_user_authentication\".\n */\n setEnhancedAuthHandler(handler: EnhancedAuthHandler | undefined) {\n this.enhancedAuthHandler = handler;\n }\n\n /**\n * Set the handler for organization authentication requirements.\n * This handler is called when a 401 response includes WWW-Authenticate header\n * with realm=\"org\". The handler should redirect the user to complete org auth.\n */\n setOrgAuthHandler(handler: OrgAuthHandler | undefined) {\n this.orgAuthHandler = handler;\n }\n\n /**\n * Update the API key (used after successful re-authentication).\n */\n updateApiKey(newApiKey: string) {\n this.apiKey = newApiKey;\n }\n\n /**\n * Set the acting member UUID for member identity switching.\n * When set, all API requests will include the X-Acting-Member header.\n * The backend will validate that the authenticated account owns this member\n * and use it as the effective identity for the request.\n */\n setActingMember(memberUuid: string | undefined) {\n this.actingMemberUuid = memberUuid;\n }\n\n /**\n * Get the current acting member UUID.\n */\n getActingMember(): string | undefined {\n return this.actingMemberUuid;\n }\n\n /**\n * Set the opaque org session credential for cross-domain requests.\n * Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still\n * use X-Org-Token through setOrgToken() during the migration window.\n *\n * `orgUuid` is the org that issued the credential; passing it lets the 401\n * handler detect a stale session when a subsequent request targets a\n * different org and re-fire the org-auth handler instead of silently\n * 401-ing. Callers without that context (legacy / unknown) may omit it.\n */\n setOrgSession(session: string | undefined, orgUuid?: string) {\n this.orgSession = session;\n this.orgSessionOrgUuid = session ? orgUuid : undefined;\n }\n\n /**\n * @deprecated Legacy compatibility for stateless orgToken JWE credentials.\n * Prefer setOrgSession() for opaque org browser sessions.\n */\n setOrgToken(token: string | undefined, orgUuid?: string) {\n this.setOrgSession(token, orgUuid);\n }\n\n protected async fetch<T>(endpoint: string, options?: RequestInit): Promise<T> {\n try {\n const headers = new Headers({\n // Don't set Content-Type for FormData — the browser must set it\n // with the multipart boundary automatically.\n ...(options?.body instanceof FormData ? {} : { 'Content-Type': 'application/json' }),\n ...((options?.headers as Record<string, string>) || {}),\n });\n\n if (this.apiKey) {\n headers.set('Authorization', `Bearer ${this.apiKey}`);\n } else if (this.isCrossDomain) {\n // For cross-domain requests, try to use the requestToken cookie\n const requestToken = getCookieValue('requestToken');\n if (requestToken) {\n headers.set('Authorization', `Bearer ${requestToken}`);\n }\n }\n\n // Include X-Acting-Member header for member identity switching\n if (this.actingMemberUuid) {\n headers.set('X-Acting-Member', this.actingMemberUuid);\n }\n\n setOrgAuthHeader(headers, this.orgSession);\n\n // console.warn(\"Calling with apiKey:\", this.apiKey)\n const fullUrl = `${this.baseUrl}/api/v2/${endpoint}`;\n // console.log('[BaseApiClient] fetch - URL:', fullUrl, 'baseUrl:', this.baseUrl, 'endpoint:', endpoint);\n\n const response = await this.fetchFunction(fullUrl, {\n ...options,\n ...(this.apiKey ? {} : { credentials: 'include' }),\n ...(this.isCrossDomain ? { mode: 'cors' } : {}),\n headers,\n });\n\n if (!response.ok) {\n // Check for step-up auth requirement per RFC 9470 (superuser 2FA re-auth needed)\n if (\n response.status === 401 &&\n requiresStepUpAuth(response.headers.get('WWW-Authenticate')) &&\n this.enhancedAuthHandler\n ) {\n // If re-auth is already in progress, wait for it\n if (this.enhancedAuthInProgress) {\n await this.enhancedAuthInProgress;\n } else {\n // Trigger re-auth and wait for completion\n this.enhancedAuthInProgress = this.enhancedAuthHandler();\n try {\n const newToken = await this.enhancedAuthInProgress;\n this.apiKey = newToken;\n } finally {\n this.enhancedAuthInProgress = null;\n }\n }\n // Retry the request with the new token\n try {\n return await this.fetch<T>(endpoint, options);\n } catch (retryError) {\n this.orgSession = undefined;\n this.orgSessionOrgUuid = undefined;\n throw retryError;\n }\n }\n\n if (response.status === 401) {\n const orgAuthInfo = parseOrgAuthChallenge(response.headers.get('WWW-Authenticate'));\n // If the challenge targets a different org than our current\n // token, the token is stale (e.g. switching from Org A to Org\n // B mid-session). Clear it so the handler re-fires below.\n if (\n orgAuthInfo &&\n this.orgSession &&\n this.orgSessionOrgUuid &&\n this.orgSessionOrgUuid !== orgAuthInfo.orgUuid\n ) {\n this.orgSession = undefined;\n this.orgSessionOrgUuid = undefined;\n }\n if (orgAuthInfo && !this.orgSession) {\n const requestCookieName = getRequestOrgCookieName(orgAuthInfo.cookieName);\n const cachedOrgSession = requestCookieName\n ? getCookieValue(requestCookieName)\n : undefined;\n if (cachedOrgSession) {\n this.orgSession = cachedOrgSession;\n this.orgSessionOrgUuid = orgAuthInfo.orgUuid;\n try {\n return await this.fetch<T>(endpoint, options);\n } catch (retryError) {\n this.orgSession = undefined;\n this.orgSessionOrgUuid = undefined;\n throw retryError;\n }\n }\n\n if (this.orgAuthHandler) {\n if (!this.orgAuthInProgress) {\n const handler = this.orgAuthHandler;\n this.orgAuthInProgress = (async () => {\n try {\n await handler(orgAuthInfo);\n } finally {\n this.orgAuthInProgress = null;\n }\n })();\n }\n await this.orgAuthInProgress;\n // Prefer cookie (browser). Fall back to this.orgSession which\n // non-browser handlers (e.g. CLI) set directly via setOrgSession().\n const postHandlerSession =\n (requestCookieName ? getCookieValue(requestCookieName) : undefined) ??\n this.orgSession;\n if (!postHandlerSession) {\n throw new ApiError(\n 'Organization authentication did not issue a session',\n 401\n );\n }\n this.orgSession = postHandlerSession;\n this.orgSessionOrgUuid = orgAuthInfo.orgUuid;\n try {\n return await this.fetch<T>(endpoint, options);\n } catch (retryError) {\n this.orgSession = undefined;\n this.orgSessionOrgUuid = undefined;\n throw retryError;\n }\n }\n }\n }\n\n const errorData = await response.json().catch(() => ({}));\n\n // Handle unauthorized errors for account endpoint\n if (response.status === 401 && endpoint === 'account') {\n throw new Error('unauthorized');\n }\n\n // Handle structured validation errors (Pydantic array format)\n if (Array.isArray(errorData.detail)) {\n const formattedErrors = errorData.detail\n .map((error: any) => {\n const location = error.loc.join(' > ');\n return `${location}: ${error.msg}`;\n })\n .join('\\n');\n throw new ApiError(`Validation Error:\\n${formattedErrors}`, response.status);\n }\n\n // Handle validation errors with errors array (new format)\n if (errorData.errors && Array.isArray(errorData.errors)) {\n // Structured workflow-expression validation errors — objects with\n // { field, kind, message, offendingPath, location }. Build a\n // readable message and preserve the structured payload.\n if (errorData.errors.length > 0 && isApiValidationError(errorData.errors[0])) {\n const validationErrors: ApiValidationError[] =\n errorData.errors.filter(isApiValidationError);\n const [first] = validationErrors;\n if (first) {\n const extra =\n validationErrors.length > 1\n ? ` (+${validationErrors.length - 1} more)`\n : '';\n const readable = `${first.field}: ${first.message}${extra}`;\n throw new ApiError(\n readable,\n response.status,\n validationErrors.map((e) => `${e.field}: ${e.message}`),\n validationErrors\n );\n }\n }\n\n // Legacy string-array errors.\n const stringErrors: string[] = errorData.errors.filter(\n (e: unknown): e is string => typeof e === 'string'\n );\n const details = stringErrors.join('; ');\n const message = errorData.detail\n ? `${errorData.detail}: ${details}`\n : `Validation failed: ${details}`;\n throw new ApiError(message, response.status, stringErrors);\n }\n\n // Handle structured errors (with error: true or with code property)\n const structuredError = errorData.detail || errorData;\n if (\n structuredError &&\n typeof structuredError === 'object' &&\n (structuredError.error === true || structuredError.code)\n ) {\n const message = structuredError.message || structuredError.code || 'Unknown error';\n const error = new ApiError(message, response.status);\n // Attach the full error data for frontend handling\n (error as any).errorData = structuredError;\n throw error;\n }\n\n // Handle simple error messages\n const errorMessage =\n typeof errorData.detail === 'string'\n ? errorData.detail\n : errorData.message || response.statusText;\n throw new ApiError(errorMessage, response.status);\n }\n\n // Handle 204 No Content - no JSON body to parse\n if (response.status === 204) {\n return undefined as any;\n }\n\n return response.json();\n } catch (error) {\n console.warn(error);\n throw error;\n }\n }\n\n protected async fetchRaw(\n endpoint: string,\n options?: RequestInit,\n allowedErrorStatuses: number[] = []\n ): Promise<Response> {\n try {\n const headers = new Headers({\n ...((options?.headers as Record<string, string>) || {}),\n });\n\n if (this.apiKey) {\n headers.set('Authorization', `Bearer ${this.apiKey}`);\n } else if (this.isCrossDomain) {\n // For cross-domain requests, try to use the requestToken cookie\n const requestToken = getCookieValue('requestToken');\n if (requestToken) {\n headers.set('Authorization', `Bearer ${requestToken}`);\n }\n }\n\n // Include X-Acting-Member header for member identity switching\n if (this.actingMemberUuid) {\n headers.set('X-Acting-Member', this.actingMemberUuid);\n }\n\n setOrgAuthHeader(headers, this.orgSession);\n\n const response = await this.fetchFunction(`${this.baseUrl}/api/v2/${endpoint}`, {\n ...options,\n ...(this.apiKey ? {} : { credentials: 'include' }),\n ...(this.isCrossDomain ? { mode: 'cors' } : {}),\n headers,\n });\n\n if (!response.ok) {\n // Check for step-up auth requirement per RFC 9470 (superuser 2FA re-auth needed)\n if (\n response.status === 401 &&\n requiresStepUpAuth(response.headers.get('WWW-Authenticate')) &&\n this.enhancedAuthHandler\n ) {\n // If re-auth is already in progress, wait for it\n if (this.enhancedAuthInProgress) {\n await this.enhancedAuthInProgress;\n } else {\n // Trigger re-auth and wait for completion\n this.enhancedAuthInProgress = this.enhancedAuthHandler();\n try {\n const newToken = await this.enhancedAuthInProgress;\n this.apiKey = newToken;\n } finally {\n this.enhancedAuthInProgress = null;\n }\n }\n // Retry the request with the new token\n try {\n return await this.fetchRaw(endpoint, options, allowedErrorStatuses);\n } catch (retryError) {\n this.orgSession = undefined;\n this.orgSessionOrgUuid = undefined;\n throw retryError;\n }\n }\n\n // Mirror of the org-auth branch in fetch() above; see comments there.\n if (response.status === 401) {\n const orgAuthInfo = parseOrgAuthChallenge(response.headers.get('WWW-Authenticate'));\n if (\n orgAuthInfo &&\n this.orgSession &&\n this.orgSessionOrgUuid &&\n this.orgSessionOrgUuid !== orgAuthInfo.orgUuid\n ) {\n this.orgSession = undefined;\n this.orgSessionOrgUuid = undefined;\n }\n if (orgAuthInfo && !this.orgSession) {\n const requestCookieName = getRequestOrgCookieName(orgAuthInfo.cookieName);\n const cachedOrgSession = requestCookieName\n ? getCookieValue(requestCookieName)\n : undefined;\n if (cachedOrgSession) {\n this.orgSession = cachedOrgSession;\n this.orgSessionOrgUuid = orgAuthInfo.orgUuid;\n try {\n return await this.fetchRaw(endpoint, options, allowedErrorStatuses);\n } catch (retryError) {\n this.orgSession = undefined;\n this.orgSessionOrgUuid = undefined;\n throw retryError;\n }\n }\n\n if (this.orgAuthHandler) {\n if (!this.orgAuthInProgress) {\n const handler = this.orgAuthHandler;\n this.orgAuthInProgress = (async () => {\n try {\n await handler(orgAuthInfo);\n } finally {\n this.orgAuthInProgress = null;\n }\n })();\n }\n await this.orgAuthInProgress;\n // Prefer cookie (browser). Fall back to this.orgSession which\n // non-browser handlers (e.g. CLI) set directly via setOrgSession().\n const postHandlerSession =\n (requestCookieName ? getCookieValue(requestCookieName) : undefined) ??\n this.orgSession;\n if (!postHandlerSession) {\n throw new ApiError(\n 'Organization authentication did not issue a session',\n 401\n );\n }\n this.orgSession = postHandlerSession;\n this.orgSessionOrgUuid = orgAuthInfo.orgUuid;\n try {\n return await this.fetchRaw(endpoint, options, allowedErrorStatuses);\n } catch (retryError) {\n this.orgSession = undefined;\n this.orgSessionOrgUuid = undefined;\n throw retryError;\n }\n }\n }\n }\n\n if (allowedErrorStatuses.includes(response.status)) {\n return response;\n }\n\n const errorText = await response.text().catch(() => '');\n throw new ApiError(errorText || response.statusText, response.status);\n }\n\n return response;\n } catch (error) {\n console.warn(error);\n throw error;\n }\n }\n\n /**\n * Fetch from root path (not prefixed with /api/v2/)\n * Used for OAuth and other non-API endpoints\n */\n protected async fetchRoot<T>(path: string, options?: RequestInit): Promise<T> {\n try {\n const headers = new Headers({\n ...(options?.body instanceof FormData ? {} : { 'Content-Type': 'application/json' }),\n ...((options?.headers as Record<string, string>) || {}),\n });\n\n if (this.apiKey) {\n headers.set('Authorization', `Bearer ${this.apiKey}`);\n } else if (this.isCrossDomain) {\n const requestToken = getCookieValue('requestToken');\n if (requestToken) {\n headers.set('Authorization', `Bearer ${requestToken}`);\n }\n }\n\n // Include X-Acting-Member header for member identity switching\n if (this.actingMemberUuid) {\n headers.set('X-Acting-Member', this.actingMemberUuid);\n }\n\n setOrgAuthHeader(headers, this.orgSession);\n\n const fullUrl = `${this.baseUrl}/${path}`;\n\n const response = await this.fetchFunction(fullUrl, {\n ...options,\n ...(this.apiKey ? {} : { credentials: 'include' }),\n ...(this.isCrossDomain ? { mode: 'cors' } : {}),\n headers,\n });\n\n if (!response.ok) {\n if (response.status === 404) {\n return null as T;\n }\n const errorData = await response.json().catch(() => ({}));\n const errorMessage = errorData.detail || errorData.message || response.statusText;\n throw new ApiError(errorMessage, response.status);\n }\n\n if (response.status === 204) {\n return undefined as T;\n }\n\n return response.json();\n } catch (error) {\n console.warn(error);\n throw error;\n }\n }\n}\n"],"mappings":";AACO,SAAS,eAAe,MAAkC;AAC9D,MAAI,OAAO,aAAa,YAAa,QAAO;AAE5C,QAAM,UAAU,SAAS,OAAO,MAAM,GAAG;AACzC,aAAW,UAAU,SAAS;AAC3B,UAAM,gBAAgB,OAAO,KAAK;AAClC,UAAM,UAAU,cAAc,QAAQ,GAAG;AACzC,QAAI,YAAY,GAAI;AAEpB,UAAM,aAAa,cAAc,UAAU,GAAG,OAAO;AACrD,UA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