@jsb188/graphql 1.1.11 → 1.1.12

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 (165) hide show
  1. package/audience.d.ts +343 -0
  2. package/cache/config.ts +58 -24
  3. package/cache/index.chat-activity.test.ts +119 -0
  4. package/cache/index.chat.test.ts +92 -0
  5. package/cache/index.helpers.ts +96 -0
  6. package/cache/index.regression.test.ts +149 -0
  7. package/cache/index.test.ts +370 -42
  8. package/cache/index.ts +326 -799
  9. package/cache/optimistic-ui-runtime.ts +46 -0
  10. package/cache/optimistic-ui.ts +401 -0
  11. package/cache/persist.ts +98 -19
  12. package/cache/store.ts +22 -64
  13. package/cache/value.helpers.ts +17 -0
  14. package/{drafts/store.ts → client/draft-persistence-indexed-db.ts} +19 -3
  15. package/{drafts/index.ts → client/draft-persistence.ts} +5 -2
  16. package/client/index.ts +3 -2
  17. package/client/request.helpers.ts +14 -0
  18. package/client/request.ts +130 -215
  19. package/deno.lock +17 -0
  20. package/deno.test.json +2 -0
  21. package/gql/fragments/agentMemoryFragments.ts +5 -1
  22. package/gql/fragments/agentNoteFragments.ts +150 -0
  23. package/gql/fragments/aiChatFragments.ts +36 -10
  24. package/gql/fragments/audienceFragments.ts +141 -0
  25. package/gql/fragments/campaignFragments.ts +415 -126
  26. package/gql/fragments/dataTableFragments.ts +48 -80
  27. package/gql/fragments/emailFragments.ts +28 -23
  28. package/gql/fragments/fieldDocFragments.ts +222 -40
  29. package/gql/fragments/inboundContactFragments.ts +2 -0
  30. package/gql/fragments/logFragments.ts +93 -2
  31. package/gql/fragments/organizationFragments.ts +10 -0
  32. package/gql/fragments/qrCodeFragments.ts +29 -0
  33. package/gql/fragments/scheduleFragments.ts +652 -140
  34. package/gql/fragments/sheetFragments.ts +84 -373
  35. package/gql/fragments/storageFragments.ts +25 -1
  36. package/gql/fragments/workflowFragments.ts +13 -1
  37. package/gql/mutations/agentMemoryMutations.ts +32 -0
  38. package/gql/mutations/agentNoteMutations.ts +62 -0
  39. package/gql/mutations/aiChatMutations.ts +36 -4
  40. package/gql/mutations/audienceMutations.ts +71 -0
  41. package/gql/mutations/authMutations.ts +45 -1
  42. package/gql/mutations/billingMutations.ts +24 -0
  43. package/gql/mutations/campaignMutations.ts +170 -127
  44. package/gql/mutations/contactMutations.ts +23 -0
  45. package/gql/mutations/dataTableMutations.ts +18 -75
  46. package/gql/mutations/fieldDocMutations.ts +162 -13
  47. package/gql/mutations/index.ts +8 -5
  48. package/gql/mutations/organizationMutations.ts +6 -0
  49. package/gql/mutations/qrCodeMutations.ts +20 -0
  50. package/gql/mutations/scheduleMutations.ts +1052 -354
  51. package/gql/mutations/sheetMutations.ts +62 -118
  52. package/gql/mutations/storageMutations.ts +0 -1
  53. package/gql/mutations/workflowMutations.ts +18 -0
  54. package/gql/queries/agentMemoryQueries.ts +6 -0
  55. package/gql/queries/agentNoteQueries.ts +89 -0
  56. package/gql/queries/aiChatQueries.ts +56 -4
  57. package/gql/queries/audienceQueries.ts +128 -0
  58. package/gql/queries/authQueries.ts +6 -0
  59. package/gql/queries/billingQueries.ts +95 -6
  60. package/gql/queries/campaignQueries.ts +132 -23
  61. package/gql/queries/dataTableQueries.ts +24 -65
  62. package/gql/queries/emailQueries.ts +18 -61
  63. package/gql/queries/emailReplyReportQueries.ts +76 -0
  64. package/gql/queries/fieldDocQueries.ts +100 -92
  65. package/gql/queries/inboundContactQueries.ts +4 -0
  66. package/gql/queries/index.ts +3 -1
  67. package/gql/queries/logQueries.ts +62 -7
  68. package/gql/queries/organizationQueries.ts +13 -0
  69. package/gql/queries/qrCodeQueries.ts +20 -0
  70. package/gql/queries/scheduleQueries.ts +633 -257
  71. package/gql/queries/sheetQueries.ts +59 -152
  72. package/gql/queries/workflowQueries.ts +10 -4
  73. package/hooks/index.helpers.test.ts +50 -0
  74. package/hooks/index.helpers.ts +52 -0
  75. package/hooks/index.ts +863 -685
  76. package/hooks/use-agentMemory-mtn.ts +29 -31
  77. package/hooks/use-agentMemory-qry.ts +15 -3
  78. package/hooks/use-agentNote-mtn.ts +82 -0
  79. package/hooks/use-agentNote-qry.ts +190 -0
  80. package/hooks/use-agentNote-recovery.helpers.test.ts +68 -0
  81. package/hooks/use-agentNote-recovery.helpers.ts +58 -0
  82. package/hooks/use-agentNote-recovery.ts +72 -0
  83. package/hooks/use-aiChat-mtn.ts +96 -112
  84. package/hooks/use-aiChat-qry.helpers.test.ts +63 -0
  85. package/hooks/use-aiChat-qry.helpers.ts +124 -0
  86. package/hooks/use-aiChat-qry.ts +229 -383
  87. package/hooks/use-aiChat-stream-mtn.ts +14 -0
  88. package/hooks/use-audience-mtn.ts +194 -0
  89. package/hooks/use-audience-qry.helpers.test.ts +80 -0
  90. package/hooks/use-audience-qry.helpers.ts +63 -0
  91. package/hooks/use-audience-qry.ts +330 -0
  92. package/hooks/use-auth-mtn.ts +30 -1
  93. package/hooks/use-billing-mtn.ts +31 -0
  94. package/hooks/use-billing-qry.ts +76 -0
  95. package/hooks/use-campaign-generation-recovery.ts +53 -0
  96. package/hooks/use-campaign-mtn.ts +224 -165
  97. package/hooks/use-campaign-qry.helpers.ts +40 -0
  98. package/hooks/use-campaign-qry.ts +631 -54
  99. package/hooks/use-dataTable-mtn.ts +23 -115
  100. package/hooks/use-dataTable-qry.ts +66 -916
  101. package/hooks/use-email-qry.helpers.ts +37 -0
  102. package/hooks/use-email-qry.ts +33 -178
  103. package/hooks/use-emailCampaignReplyReport-qry.ts +27 -0
  104. package/hooks/use-fieldDoc-mtn.ts +244 -32
  105. package/hooks/use-fieldDoc-qry.helpers.test.ts +65 -0
  106. package/hooks/use-fieldDoc-qry.helpers.ts +49 -0
  107. package/hooks/use-fieldDoc-qry.ts +134 -102
  108. package/hooks/use-inboundContact-qry.ts +7 -9
  109. package/hooks/use-log-mtn.ts +25 -12
  110. package/hooks/use-log-qry.ts +99 -46
  111. package/hooks/use-organization-qry.ts +16 -60
  112. package/hooks/use-publicFormEmail-mtn.ts +27 -0
  113. package/hooks/use-qrCode-mtn.ts +40 -0
  114. package/hooks/use-qrCode-qry.ts +78 -0
  115. package/hooks/use-schedule-mtn.ts +506 -333
  116. package/hooks/use-schedule-qry.ts +682 -101
  117. package/hooks/use-schedule-reactive.ts +486 -0
  118. package/hooks/use-sheet-mtn.ts +91 -199
  119. package/hooks/use-sheet-qry.ts +84 -238
  120. package/hooks/use-storage-qry.ts +84 -61
  121. package/hooks/use-workflow-mtn.ts +39 -22
  122. package/hooks/use-workflow-qry.ts +40 -61
  123. package/libs/ai-chat-outgoing.helpers.ts +153 -0
  124. package/libs/ai-chat-outgoing.ts +11 -0
  125. package/libs/ai-chat-outgoing.types.ts +25 -0
  126. package/libs/ai-chat-run-realtime.ts +20 -0
  127. package/libs/ai-chat-submission-realtime.ts +150 -0
  128. package/libs/fragment-realtime-sequence.ts +55 -0
  129. package/libs/fragment-recovery.test.ts +326 -0
  130. package/libs/fragment-recovery.ts +325 -0
  131. package/libs/open-sheet.ts +138 -0
  132. package/libs/orchestrator-realtime.helpers.test.ts +229 -0
  133. package/libs/orchestrator-realtime.helpers.ts +317 -0
  134. package/libs/orchestrator-realtime.ts +433 -0
  135. package/libs/request-cache-regression.test.ts +122 -0
  136. package/{client → libs}/request-managed-session.test.ts +1 -1
  137. package/libs/request-no-store.test.ts +419 -0
  138. package/libs/sheet-command-batch.ts +44 -0
  139. package/libs/sheet-view-realtime-router.test.ts +214 -0
  140. package/libs/sheet-view-realtime-router.ts +99 -0
  141. package/loaders/campaign.test.ts +186 -0
  142. package/loaders/campaign.ts +56 -83
  143. package/loaders/emailPreference.ts +75 -0
  144. package/loaders/rest.ts +12 -0
  145. package/package.json +42 -17
  146. package/schedule.d.ts +1790 -0
  147. package/sse.helpers.ts +19 -0
  148. package/sse.ts +26 -115
  149. package/tests/agent-note-detail-cache.test.ts +120 -0
  150. package/tests/agent-note-search.test.ts +444 -0
  151. package/types.d.ts +46 -25
  152. package/client/data-table-realtime-subscriptions.test.ts +0 -740
  153. package/client/data-table-realtime-subscriptions.ts +0 -955
  154. package/client/data-table-realtime.test.ts +0 -792
  155. package/client/data-table-realtime.ts +0 -1218
  156. package/client/fragment-realtime-sequence.ts +0 -52
  157. package/client/open-sheet.ts +0 -137
  158. package/client/request-no-store.test.ts +0 -157
  159. package/gql/fragments/agentDocFragments.ts +0 -46
  160. package/gql/fragments/billingFragments.ts +0 -14
  161. package/gql/mutations/agentDocMutations.ts +0 -177
  162. package/gql/queries/agentDocQueries.ts +0 -120
  163. package/hooks/use-agentDoc-mtn.ts +0 -285
  164. package/hooks/use-agentDoc-qry.ts +0 -208
  165. /package/{client → libs}/sse-ticket.test.ts +0 -0
@@ -0,0 +1,62 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { agentNoteDetailFragment } from '../fragments/agentNoteFragments.ts';
3
+
4
+ export const markAgentNoteReadMtn = gql`
5
+ mutation markAgentNoteRead (
6
+ $organizationId: GenericID!
7
+ $agentNoteId: GenericID!
8
+ ) {
9
+ markAgentNoteRead (
10
+ organizationId: $organizationId
11
+ agentNoteId: $agentNoteId
12
+ )
13
+ }
14
+ `;
15
+
16
+ export const updateAgentNoteMtn = gql`
17
+ mutation updateAgentNote (
18
+ $organizationId: GenericID!
19
+ $agentNoteId: GenericID!
20
+ $pinned: Boolean
21
+ $needsAttention: Boolean
22
+ $archived: Boolean
23
+ $disableAutoCreation: Boolean
24
+ ) {
25
+ updateAgentNote (
26
+ organizationId: $organizationId
27
+ agentNoteId: $agentNoteId
28
+ pinned: $pinned
29
+ needsAttention: $needsAttention
30
+ archived: $archived
31
+ disableAutoCreation: $disableAutoCreation
32
+ )
33
+ }
34
+ `;
35
+
36
+ export const refreshAgentNoteMtn = gql`
37
+ mutation refreshAgentNote (
38
+ $organizationId: GenericID!
39
+ $agentNoteId: GenericID!
40
+ ) {
41
+ refreshAgentNote (
42
+ organizationId: $organizationId
43
+ agentNoteId: $agentNoteId
44
+ ) {
45
+ ...agentNoteDetailFragment
46
+ }
47
+ }
48
+
49
+ ${agentNoteDetailFragment}
50
+ `;
51
+
52
+ export const deleteAgentNoteMtn = gql`
53
+ mutation deleteAgentNote (
54
+ $organizationId: GenericID!
55
+ $agentNoteId: GenericID!
56
+ ) {
57
+ deleteAgentNote (
58
+ organizationId: $organizationId
59
+ agentNoteId: $agentNoteId
60
+ )
61
+ }
62
+ `;
@@ -1,23 +1,32 @@
1
1
  import { gql } from 'graphql-tag';
2
- import {
3
- aiChatFragment,
4
- aiChatMessageFragment,
5
- } from '../fragments/aiChatFragments.ts';
2
+ import { aiChatFragment, aiChatMessageFragment, aiChatRunFragment } from '../fragments/aiChatFragments.ts';
3
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
6
4
 
7
5
  export const startAIChatMtn = gql`
8
6
  mutation startAIChat (
9
7
  $organizationId: GenericID!
8
+ $agentNoteId: GenericID
9
+ $type: AIChatType
10
10
  $text: String
11
11
  $attachments: [String!]
12
+ $qrCodeTokens: [String!]
12
13
  $clientRequestId: String
14
+ $gridContext: AIChatGridContextInput
13
15
  ) {
14
16
  startAIChat (
15
17
  organizationId: $organizationId
18
+ agentNoteId: $agentNoteId
19
+ type: $type
16
20
  text: $text
17
21
  attachments: $attachments
22
+ qrCodeTokens: $qrCodeTokens
18
23
  clientRequestId: $clientRequestId
24
+ gridContext: $gridContext
19
25
  ) {
20
26
  sessionKey
27
+ run {
28
+ ...aiChatRunFragment
29
+ }
21
30
  node {
22
31
  cursor
23
32
  ...aiChatFragment
@@ -26,6 +35,7 @@ mutation startAIChat (
26
35
  }
27
36
 
28
37
  ${aiChatFragment}
38
+ ${aiChatRunFragment}
29
39
  `;
30
40
 
31
41
  export const editAIChatMtn = gql`
@@ -54,7 +64,9 @@ mutation sendAIChatMessage (
54
64
  $variablesKey: String
55
65
  $text: String
56
66
  $attachments: [String!]
67
+ $qrCodeTokens: [String!]
57
68
  $clientRequestId: String
69
+ $gridContext: AIChatGridContextInput
58
70
  ) {
59
71
  sendAIChatMessage (
60
72
  aiChatId: $aiChatId
@@ -62,16 +74,30 @@ mutation sendAIChatMessage (
62
74
  variablesKey: $variablesKey
63
75
  text: $text
64
76
  attachments: $attachments
77
+ qrCodeTokens: $qrCodeTokens
65
78
  clientRequestId: $clientRequestId
79
+ gridContext: $gridContext
66
80
  ) {
67
81
  sessionKey
82
+ run {
83
+ ...aiChatRunFragment
84
+ }
68
85
  node {
69
86
  ...aiChatMessageFragment
87
+
88
+ attachments {
89
+ ordinal
90
+ file {
91
+ ...storageFileFragment
92
+ }
93
+ }
70
94
  }
71
95
  }
72
96
  }
73
97
 
74
98
  ${aiChatMessageFragment}
99
+ ${aiChatRunFragment}
100
+ ${storageFileFragment}
75
101
  `;
76
102
 
77
103
  export const stopAIChatMessageMtn = gql`
@@ -93,3 +119,9 @@ mutation deleteAIChat (
93
119
  )
94
120
  }
95
121
  `;
122
+
123
+ export const resumeAIChatStreamMtn = gql`
124
+ mutation resumeAIChatStream($aiChatId: GenericID!) {
125
+ resumeAIChatStream(aiChatId: $aiChatId)
126
+ }
127
+ `;
@@ -0,0 +1,71 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ audienceEmailAddressFragment,
4
+ audienceListFragment,
5
+ audienceListMemberFragment,
6
+ campaignAudiencePreviewFragment,
7
+ campaignAudienceSessionFragment,
8
+ } from '../fragments/audienceFragments.ts';
9
+
10
+ export const createAudienceListMtn = gql`
11
+ mutation createAudienceList($input: CreateAudienceListInput!) {
12
+ createAudienceList(input: $input) { ...audienceListFragment }
13
+ }
14
+ ${audienceListFragment}
15
+ `;
16
+
17
+ export const editAudienceListMtn = gql`
18
+ mutation editAudienceList($input: EditAudienceListInput!) {
19
+ editAudienceList(input: $input) { ...audienceListFragment }
20
+ }
21
+ ${audienceListFragment}
22
+ `;
23
+
24
+ export const editAudienceListMemberMtn = gql`
25
+ mutation editAudienceListMember($input: EditAudienceListMemberInput!) {
26
+ editAudienceListMember(input: $input) { ...audienceListMemberFragment }
27
+ }
28
+ ${audienceListMemberFragment}
29
+ `;
30
+
31
+ export const addAudienceListMembersMtn = gql`
32
+ mutation addAudienceListMembers($input: AddAudienceListMembersInput!) {
33
+ addAudienceListMembers(input: $input) {
34
+ index
35
+ emailAddress
36
+ outcome
37
+ memberId
38
+ }
39
+ }
40
+ `;
41
+
42
+ export const changeAudienceListSubscriptionMtn = gql`
43
+ mutation changeAudienceListSubscription($input: ChangeAudienceListSubscriptionInput!) {
44
+ changeAudienceListSubscription(input: $input) { ...audienceListMemberFragment }
45
+ }
46
+ ${audienceListMemberFragment}
47
+ `;
48
+
49
+ export const removeAudienceListMembersMtn = gql`
50
+ mutation removeAudienceListMembers($input: RemoveAudienceListMembersInput!) {
51
+ removeAudienceListMembers(input: $input)
52
+ }
53
+ `;
54
+
55
+ export const setAudienceAddressSuppressionMtn = gql`
56
+ mutation setAudienceAddressSuppression($input: SetAudienceAddressSuppressionInput!) {
57
+ setAudienceAddressSuppression(input: $input) { ...audienceEmailAddressFragment }
58
+ }
59
+ ${audienceEmailAddressFragment}
60
+ `;
61
+
62
+ export const setCampaignAudienceMtn = gql`
63
+ mutation setCampaignAudience($input: SetCampaignAudienceInput!) {
64
+ setCampaignAudience(input: $input) {
65
+ session { ...campaignAudienceSessionFragment }
66
+ preview { ...campaignAudiencePreviewFragment }
67
+ }
68
+ }
69
+ ${campaignAudienceSessionFragment}
70
+ ${campaignAudiencePreviewFragment}
71
+ `;
@@ -57,6 +57,19 @@ mutation authenticateWithPassword (
57
57
  ${authenticateFragments}
58
58
  `;
59
59
 
60
+ export const authenticateAsAgentMtn = gql`
61
+ mutation authenticateAsAgent (
62
+ $identifier: String!
63
+ ) {
64
+ authenticateAsAgent (
65
+ identifier: $identifier
66
+ ) {
67
+ ${authenticateResultText}
68
+ }
69
+ }
70
+ ${authenticateFragments}
71
+ `;
72
+
60
73
  export const authenticateWithTokenMtn = gql`
61
74
  mutation authenticateWithToken (
62
75
  $token: Token!
@@ -180,13 +193,17 @@ mutation revokeOrganizationMemberSessions (
180
193
 
181
194
  export const continueWithGoogleMtn = gql`
182
195
  mutation continueWithGoogle (
183
- $oauthToken: String!
196
+ $oauthToken: String
197
+ $idToken: String
198
+ $nonce: String
184
199
  $ssoConnectionId: GenericID
185
200
  $formPublicId: String
186
201
  $authenticateOnly: Boolean
187
202
  ) {
188
203
  continueWithGoogle (
189
204
  oauthToken: $oauthToken
205
+ idToken: $idToken
206
+ nonce: $nonce
190
207
  ssoConnectionId: $ssoConnectionId
191
208
  formPublicId: $formPublicId
192
209
  authenticateOnly: $authenticateOnly
@@ -281,6 +298,33 @@ mutation sendPhoneVerificationCode (
281
298
  )
282
299
  }`;
283
300
 
301
+ export const sendPublicFormEmailCodeMtn = gql`
302
+ mutation sendPublicFormEmailCode (
303
+ $formPublicId: String!
304
+ $email: String!
305
+ ) {
306
+ sendPublicFormEmailCode (
307
+ formPublicId: $formPublicId
308
+ email: $email
309
+ )
310
+ }`;
311
+
312
+ export const confirmPublicFormEmailCodeMtn = gql`
313
+ mutation confirmPublicFormEmailCode (
314
+ $formPublicId: String!
315
+ $email: String!
316
+ $code: String!
317
+ ) {
318
+ confirmPublicFormEmailCode (
319
+ formPublicId: $formPublicId
320
+ email: $email
321
+ code: $code
322
+ ) {
323
+ respondentToken
324
+ respondentEmail
325
+ }
326
+ }`;
327
+
284
328
  export const confirmPhoneVerificationCodeMtn = gql`
285
329
  mutation confirmPhoneVerificationCode (
286
330
  $phone: String!
@@ -0,0 +1,24 @@
1
+ import { gql } from 'graphql-tag';
2
+
3
+ // The response carries a Stripe client secret; the hook sends it with the
4
+ // no-store cache policy so it never reaches the normalized or persisted cache.
5
+ export const startBillingSubscriptionMtn = gql`
6
+ mutation startBillingSubscription (
7
+ $organizationId: GenericID!
8
+ $priceId: String!
9
+ $billingDetails: BillingDetailsInput!
10
+ ) {
11
+ startBillingSubscription (
12
+ organizationId: $organizationId
13
+ priceId: $priceId
14
+ billingDetails: $billingDetails
15
+ ) {
16
+ purchaseAttemptId
17
+ subscriptionId
18
+ intentType
19
+ clientSecret
20
+ amountDue
21
+ currency
22
+ }
23
+ }
24
+ `;