@gravity-rail/sdk 0.8.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +45 -8
  2. package/dist/chunk-FSSXKQR5.js +471 -0
  3. package/dist/chunk-FSSXKQR5.js.map +1 -0
  4. package/dist/{chunk-QS6ZRQUZ.js → chunk-V7ZKEH4V.js} +8 -1
  5. package/dist/chunk-V7ZKEH4V.js.map +1 -0
  6. package/dist/{chunk-ML55PVP7.js → chunk-YESHLUL7.js} +1435 -703
  7. package/dist/chunk-YESHLUL7.js.map +1 -0
  8. package/dist/{client-C2aWAalu.d.cts → client-BCgXtr8p.d.cts} +3684 -1291
  9. package/dist/{client-CLGovEox.d.ts → client-Dh1l20Ue.d.ts} +3684 -1291
  10. package/dist/helpers.cjs +177 -13
  11. package/dist/helpers.cjs.map +1 -1
  12. package/dist/helpers.d.cts +82 -3
  13. package/dist/helpers.d.ts +82 -3
  14. package/dist/helpers.js +155 -12
  15. package/dist/helpers.js.map +1 -1
  16. package/dist/index.cjs +1679 -420
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +32 -24
  19. package/dist/index.d.ts +32 -24
  20. package/dist/index.js +193 -113
  21. package/dist/index.js.map +1 -1
  22. package/dist/internal.cjs +1742 -413
  23. package/dist/internal.cjs.map +1 -1
  24. package/dist/internal.d.cts +634 -29
  25. package/dist/internal.d.ts +634 -29
  26. package/dist/internal.js +140 -7
  27. package/dist/internal.js.map +1 -1
  28. package/dist/realtime.cjs +43 -0
  29. package/dist/realtime.cjs.map +1 -1
  30. package/dist/realtime.d.cts +26 -0
  31. package/dist/realtime.d.ts +26 -0
  32. package/dist/realtime.js +43 -0
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/{scopes-D6a_Mvqr.d.ts → revision-state-BTF-MnbW.d.cts} +270 -23
  35. package/dist/{scopes-CDaJBQVT.d.cts → revision-state-DOH1NMGb.d.ts} +270 -23
  36. package/dist/schemas.cjs +56 -117
  37. package/dist/schemas.cjs.map +1 -1
  38. package/dist/schemas.d.cts +121 -484
  39. package/dist/schemas.d.ts +121 -484
  40. package/dist/schemas.js +55 -114
  41. package/dist/schemas.js.map +1 -1
  42. package/dist/{inquiries-CmECZnkl.d.cts → tasks-C4aYbWVv.d.cts} +944 -148
  43. package/dist/{inquiries-CmECZnkl.d.ts → tasks-C4aYbWVv.d.ts} +944 -148
  44. package/package.json +5 -5
  45. package/dist/chunk-ML55PVP7.js.map +0 -1
  46. package/dist/chunk-QS6ZRQUZ.js.map +0 -1
package/dist/schemas.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  DataSensitivity,
9
9
  DataTypeRecordScope,
10
10
  IndexStatus
11
- } from "./chunk-QS6ZRQUZ.js";
11
+ } from "./chunk-V7ZKEH4V.js";
12
12
 
13
13
  // src/schemas/accounts.ts
14
14
  import { z } from "zod";
@@ -331,7 +331,7 @@ var CreateCalendarEventSchema = z2.object({
331
331
  title: z2.string().describe("Event title"),
332
332
  startTime: z2.string().describe("ISO 8601 datetime string"),
333
333
  attendeeIds: z2.array(z2.number()).optional().describe("Member IDs of attendees"),
334
- workflowId: z2.number().optional().describe("Associated workflow ID"),
334
+ workflowRevisionId: z2.number().optional().describe("Associated workflow revision ID"),
335
335
  taskId: z2.number().optional().describe("Associated task ID"),
336
336
  description: z2.string().optional().describe("Event description"),
337
337
  location: z2.string().optional().describe("Event location (physical or virtual)")
@@ -495,14 +495,21 @@ function createTool(name, description, schema) {
495
495
 
496
496
  // src/schemas/chats.ts
497
497
  var ChannelEnum = z4.enum([
498
- "phone-call",
498
+ "cli",
499
+ "frame",
499
500
  "phone-sms",
500
- "realtime",
501
- "chat",
501
+ "phone-voice",
502
+ "phone-whatsapp",
502
503
  "email",
503
504
  "background",
504
- "site-chat",
505
- "direct-message"
505
+ "web-chat",
506
+ "web-voice",
507
+ "discord",
508
+ "slack",
509
+ "teams",
510
+ "direct-message",
511
+ "a2a",
512
+ "routine"
506
513
  ]);
507
514
  var MessageRoleEnum = z4.enum([
508
515
  "user",
@@ -564,11 +571,17 @@ var ChatFormDataSchema = z4.object({
564
571
  title: z4.string().optional(),
565
572
  channel: z4.string(),
566
573
  workflowId: z4.number().nullable(),
574
+ workflowUuid: z4.string().nullable().optional(),
575
+ workflowRevisionId: z4.number().nullable().optional(),
576
+ workflowRevisionUuid: z4.string().nullable().optional(),
567
577
  phoneNumberId: z4.number().nullable().optional(),
568
578
  siteId: z4.number().nullable().optional(),
569
579
  memberId: z4.number().nullable().optional(),
570
580
  participants: z4.array(ChatParticipantFormDataSchema),
571
581
  agentEnabled: z4.boolean().optional(),
582
+ assistantMemberId: z4.number().nullable().optional(),
583
+ assistantName: z4.string().nullable().optional(),
584
+ // Legacy client-side alias. ChatsApi serializes it as assistantMemberId.
572
585
  agentMemberId: z4.number().nullable().optional(),
573
586
  // Per-chat assistant model override (snapshotted onto the assistant
574
587
  // participant). Set from the Create-Chat assistant-override dialog.
@@ -579,7 +592,6 @@ var ChatFormDataSchema = z4.object({
579
592
  paused: z4.boolean().optional(),
580
593
  muted: z4.boolean().optional(),
581
594
  needsResponse: z4.boolean().optional(),
582
- workflowVersionNumber: z4.number().nullable().optional(),
583
595
  // Human-typed initial SMS/email body. Optional, request-body only.
584
596
  // Backend dispatches via the existing initial-message path when the
585
597
  // Agent is disabled. Treat as PHI client-side.
@@ -594,7 +606,8 @@ var ChatFiltersSchema = z4.object({
594
606
  needsResponse: z4.boolean().optional(),
595
607
  paused: z4.boolean().optional(),
596
608
  archived: z4.boolean().optional(),
597
- channel: z4.string().optional()
609
+ channel: z4.string().optional(),
610
+ chatType: z4.enum(["assignment", "manager", "dm", "contributor"]).optional().describe("Filter by chat type. Omitted = all types.")
598
611
  });
599
612
  var ListChatsSchema = WorkspaceIdSchema.merge(ChatFiltersSchema);
600
613
  var GetChatSchema = WorkspaceIdSchema.extend({
@@ -682,9 +695,14 @@ var ChatSchema = z4.object({
682
695
  muted: z4.boolean(),
683
696
  needsResponse: z4.boolean(),
684
697
  channel: ChannelEnum,
698
+ chatType: z4.string(),
685
699
  paused: z4.boolean(),
686
- assignmentId: z4.number(),
700
+ assignmentId: z4.number().nullable(),
701
+ workflowId: z4.number().nullable(),
687
702
  phoneNumberId: z4.number().nullable(),
703
+ inboxId: z4.number().nullable().optional(),
704
+ siteId: z4.number().nullable().optional(),
705
+ folderId: z4.number().nullable().optional(),
688
706
  fromMessageId: z4.number().nullable(),
689
707
  createdAt: z4.string(),
690
708
  updatedAt: z4.string(),
@@ -863,13 +881,6 @@ function validateDataTypePolicy(data, ctx) {
863
881
  const hasHighRiskCategory = fields.some(
864
882
  (field) => (field.categories ?? []).some((category) => HIGH_RISK_CATEGORIES.has(category))
865
883
  );
866
- if (recordScope === "workspace" /* WORKSPACE */ && data.isCollection === false) {
867
- ctx.addIssue({
868
- code: z5.ZodIssueCode.custom,
869
- path: ["isCollection"],
870
- message: "Workspace-scoped data types must be collections"
871
- });
872
- }
873
884
  if (recordScope === "workspace" /* WORKSPACE */ && hasHighRiskCategory) {
874
885
  ctx.addIssue({
875
886
  code: z5.ZodIssueCode.custom,
@@ -891,13 +902,6 @@ function validateDataTypeUpdatePolicy(data, ctx) {
891
902
  const hasHighRiskCategory = fields.some(
892
903
  (field) => (field.categories ?? []).some((category) => HIGH_RISK_CATEGORIES.has(category))
893
904
  );
894
- if (data.recordScope === "workspace" /* WORKSPACE */ && data.isCollection === false) {
895
- ctx.addIssue({
896
- code: z5.ZodIssueCode.custom,
897
- path: ["isCollection"],
898
- message: "Workspace-scoped data types must be collections"
899
- });
900
- }
901
905
  if (data.recordScope === "workspace" /* WORKSPACE */ && hasFields && hasHighRiskCategory) {
902
906
  ctx.addIssue({
903
907
  code: z5.ZodIssueCode.custom,
@@ -1129,6 +1133,11 @@ var UpdateDataFieldSchema = WorkspaceIdSchema.extend({
1129
1133
  shouldIndex: z5.boolean().optional().describe("Whether to create a search index for this field"),
1130
1134
  adminOnly: z5.boolean().optional().describe("Whether only admins can edit this field")
1131
1135
  });
1136
+ var DataRecordRetirementSchema = z5.object({
1137
+ status: z5.literal("retired"),
1138
+ reason: z5.enum(["monday_item_archived", "monday_item_deleted"]),
1139
+ source: z5.literal("monday")
1140
+ });
1132
1141
  var DataRecordSchema = z5.object({
1133
1142
  id: z5.number(),
1134
1143
  dataTypeId: z5.number(),
@@ -1137,7 +1146,8 @@ var DataRecordSchema = z5.object({
1137
1146
  externalId: z5.string().optional(),
1138
1147
  assignmentTaskId: z5.number().optional(),
1139
1148
  createdAt: z5.string(),
1140
- updatedAt: z5.string()
1149
+ updatedAt: z5.string(),
1150
+ retirement: DataRecordRetirementSchema.nullable().optional()
1141
1151
  });
1142
1152
  var DataRecordFormDataSchema = z5.object({
1143
1153
  memberId: z5.number().nullable().optional(),
@@ -1284,6 +1294,13 @@ var CreateInquirySchema = z7.object({
1284
1294
  productId: z7.number().optional(),
1285
1295
  recaptchaToken: z7.string().optional()
1286
1296
  });
1297
+ var AnonymousInquiryFormSchema = CreateInquirySchema.refine(
1298
+ (data) => Boolean(data.email?.trim()) || Boolean(data.cellNumber?.trim()),
1299
+ {
1300
+ message: "At least one of email or cellNumber is required",
1301
+ path: ["email"]
1302
+ }
1303
+ );
1287
1304
  var ListInquiriesSchema = z7.object({
1288
1305
  page: z7.number().optional().describe("Page number"),
1289
1306
  pageSize: z7.number().optional().describe("Items per page"),
@@ -1463,82 +1480,6 @@ var MemberLabelFormDataSchema = z8.object({
1463
1480
  description: z8.string().optional(),
1464
1481
  color: z8.string()
1465
1482
  });
1466
- var MemberFilterObjectTypeEnum = z8.enum([
1467
- "label",
1468
- "dataType",
1469
- "member",
1470
- "memberRole",
1471
- "name",
1472
- "email",
1473
- "phone",
1474
- "phoneType",
1475
- "age",
1476
- "dateOfBirth",
1477
- "workflow",
1478
- "tosAccepted",
1479
- "notifySms",
1480
- "notifyEmail",
1481
- "notifyVoice",
1482
- "smsDeliveryStatus",
1483
- "callForwarded",
1484
- "calendarEvent",
1485
- "chatEngagement",
1486
- "lastMessageActivity",
1487
- "memberCreated",
1488
- "isDefault",
1489
- "memberType",
1490
- "memberField",
1491
- "journey"
1492
- ]);
1493
- var MemberFilterFilterTypeEnum = z8.enum([
1494
- "any",
1495
- "all",
1496
- "none",
1497
- "partial",
1498
- "notPartial",
1499
- "exact",
1500
- "equals",
1501
- "notEquals",
1502
- "notContains",
1503
- "atLeast",
1504
- "atMost",
1505
- "field",
1506
- "dateFilter",
1507
- "greaterThan",
1508
- "greaterThanOrEqual",
1509
- "lessThan",
1510
- "lessThanOrEqual",
1511
- "within",
1512
- "olderThan",
1513
- "never",
1514
- "isEmpty",
1515
- "notEmpty",
1516
- "before",
1517
- "after",
1518
- "between",
1519
- "notBetween",
1520
- "daysAgo",
1521
- "lessThanDaysAgo",
1522
- "daysUntil",
1523
- "hasKey",
1524
- "hasKeyValue",
1525
- "smsDeliveryStatusNeedsAttention",
1526
- "callForwardedAny"
1527
- ]);
1528
- var MemberFilterRuleSchema = z8.object({
1529
- id: z8.number(),
1530
- uuid: z8.string(),
1531
- objectType: MemberFilterObjectTypeEnum,
1532
- filterType: MemberFilterFilterTypeEnum,
1533
- objectIds: z8.array(z8.number()).optional(),
1534
- query: z8.string().optional()
1535
- });
1536
- var MemberFilterRuleFormDataSchema = z8.object({
1537
- objectType: MemberFilterObjectTypeEnum,
1538
- filterType: MemberFilterFilterTypeEnum,
1539
- objectIds: z8.array(z8.number()).optional(),
1540
- query: z8.string().optional()
1541
- });
1542
1483
  var MemberFilterSchema = z8.object({
1543
1484
  id: z8.number(),
1544
1485
  name: z8.string(),
@@ -1546,14 +1487,12 @@ var MemberFilterSchema = z8.object({
1546
1487
  description: z8.string().optional(),
1547
1488
  pinned: z8.boolean().optional(),
1548
1489
  createdAt: z8.string(),
1549
- updatedAt: z8.string(),
1550
- rules: z8.array(MemberFilterRuleSchema)
1490
+ updatedAt: z8.string()
1551
1491
  });
1552
1492
  var MemberFilterFormDataSchema = z8.object({
1553
1493
  name: z8.string(),
1554
1494
  description: z8.string().optional(),
1555
- pinned: z8.boolean().optional(),
1556
- rules: z8.array(MemberFilterRuleFormDataSchema)
1495
+ pinned: z8.boolean().optional()
1557
1496
  });
1558
1497
  var MemberRoleSchema = z8.object({
1559
1498
  id: z8.number(),
@@ -1792,12 +1731,11 @@ var ChildTaskFormDataSchema = z12.object({
1792
1731
  celCondition: z12.string().optional()
1793
1732
  });
1794
1733
  var AbilityDataSchema = z12.object({
1795
- id: z12.number().optional(),
1796
- // Existing ability ID (omit for new)
1734
+ uuid: z12.string(),
1735
+ // UUID for matching/creating abilities
1797
1736
  abilityType: z12.string(),
1798
1737
  config: z12.record(z12.string(), z12.any()).optional(),
1799
1738
  enabled: z12.boolean().optional(),
1800
- order: z12.number().optional(),
1801
1739
  celCondition: z12.string().optional()
1802
1740
  });
1803
1741
  var TaskFormDataSchema = z12.object({
@@ -1843,8 +1781,13 @@ var WorkflowCreateFormDataSchema = z13.object({
1843
1781
  description: z13.string().optional(),
1844
1782
  prompt: z13.string().optional(),
1845
1783
  ownerId: z13.number().optional(),
1846
- agentId: z13.number().nullable().optional(),
1847
- // Optional workflow-level model overrides (inherit when null/omitted).
1784
+ copyFromAgentId: z13.number().optional(),
1785
+ copyFromWorkflowRevisionId: z13.number().optional(),
1786
+ copySourceDigest: z13.string().optional(),
1787
+ assistantName: z13.string().nullable().optional(),
1788
+ assistantIdentity: z13.string().nullable().optional(),
1789
+ // Concrete revision models; selecting an Agent copies its preset here.
1790
+ // Explicit null resets to the concrete Haiku fallback and clears config.
1848
1791
  chatModelId: z13.string().nullable().optional(),
1849
1792
  chatModelConfig: z13.record(z13.string(), z13.unknown()).nullable().optional(),
1850
1793
  realtimeModelId: z13.string().nullable().optional(),
@@ -1907,6 +1850,7 @@ export {
1907
1850
  AdminAccountMembershipSchema,
1908
1851
  AdminOrganizationSchema,
1909
1852
  AdminWorkspaceMemberFormDataSchema,
1853
+ AnonymousInquiryFormSchema,
1910
1854
  ApiKeyCreatedSchema,
1911
1855
  ApiKeyFormDataSchema,
1912
1856
  ApiKeySchema,
@@ -1966,6 +1910,7 @@ export {
1966
1910
  DataRecordFiltersSchema,
1967
1911
  DataRecordFormDataSchema,
1968
1912
  DataRecordReportItemSchema,
1913
+ DataRecordRetirementSchema,
1969
1914
  DataRecordSchema,
1970
1915
  DataRecordWithAccessModeSchema,
1971
1916
  DataRecordsPaginatedResponseSchema,
@@ -2067,11 +2012,7 @@ export {
2067
2012
  LoginResponseSchema,
2068
2013
  MarkEmailReadSchema,
2069
2014
  MarkEmailUnreadSchema,
2070
- MemberFilterFilterTypeEnum,
2071
2015
  MemberFilterFormDataSchema,
2072
- MemberFilterObjectTypeEnum,
2073
- MemberFilterRuleFormDataSchema,
2074
- MemberFilterRuleSchema,
2075
2016
  MemberFilterSchema,
2076
2017
  MemberFormDataSchema,
2077
2018
  MemberLabelFormDataSchema,