@jsb188/graphql 1.1.10 → 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 (176) hide show
  1. package/audience.d.ts +343 -0
  2. package/cache/config.ts +98 -50
  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 +1017 -127
  8. package/cache/index.ts +1256 -1269
  9. package/cache/optimistic-ui-runtime.ts +46 -0
  10. package/cache/optimistic-ui.ts +401 -0
  11. package/cache/persist.ts +800 -0
  12. package/cache/store.ts +395 -0
  13. package/cache/value.helpers.ts +17 -0
  14. package/client/draft-persistence-indexed-db.ts +413 -0
  15. package/client/draft-persistence.ts +152 -0
  16. package/client/index.ts +3 -0
  17. package/client/request.helpers.ts +14 -0
  18. package/client/request.ts +870 -164
  19. package/deno.lock +187 -0
  20. package/deno.test.json +10 -4
  21. package/gql/eagerQueryMap.ts +12 -0
  22. package/gql/fragments/accountAuthFragments.ts +5 -0
  23. package/gql/fragments/accountFragments.ts +0 -3
  24. package/gql/fragments/accountSessionFragments.ts +16 -0
  25. package/gql/fragments/agentMemoryFragments.ts +23 -0
  26. package/gql/fragments/agentNoteFragments.ts +150 -0
  27. package/gql/fragments/aiChatFragments.ts +42 -0
  28. package/gql/fragments/audienceFragments.ts +141 -0
  29. package/gql/fragments/campaignFragments.ts +566 -0
  30. package/gql/fragments/dataTableFragments.ts +50 -192
  31. package/gql/fragments/emailFragments.ts +32 -17
  32. package/gql/fragments/fieldDocFragments.ts +264 -0
  33. package/gql/fragments/inboundContactFragments.ts +2 -0
  34. package/gql/fragments/logFragments.ts +101 -69
  35. package/gql/fragments/organizationFragments.ts +53 -5
  36. package/gql/fragments/qrCodeFragments.ts +29 -0
  37. package/gql/fragments/scheduleFragments.ts +667 -0
  38. package/gql/fragments/sheetFragments.ts +304 -63
  39. package/gql/fragments/storageFragments.ts +45 -0
  40. package/gql/fragments/workflowFragments.ts +41 -5
  41. package/gql/mutations/accountMutations.ts +0 -2
  42. package/gql/mutations/agentMemoryMutations.ts +68 -0
  43. package/gql/mutations/agentNoteMutations.ts +62 -0
  44. package/gql/mutations/aiChatMutations.ts +49 -4
  45. package/gql/mutations/audienceMutations.ts +71 -0
  46. package/gql/mutations/authMutations.ts +203 -18
  47. package/gql/mutations/billingMutations.ts +17 -27
  48. package/gql/mutations/campaignMutations.ts +258 -0
  49. package/gql/mutations/contactMutations.ts +23 -0
  50. package/gql/mutations/dataTableMutations.ts +19 -54
  51. package/gql/mutations/fieldDocMutations.ts +173 -0
  52. package/gql/mutations/index.ts +10 -2
  53. package/gql/mutations/logMutations.ts +6 -29
  54. package/gql/mutations/organizationMutations.ts +19 -4
  55. package/gql/mutations/qrCodeMutations.ts +20 -0
  56. package/gql/mutations/scheduleMutations.ts +1121 -0
  57. package/gql/mutations/sheetMutations.ts +221 -60
  58. package/gql/mutations/storageMutations.ts +19 -0
  59. package/gql/mutations/workflowMutations.ts +60 -0
  60. package/gql/queries/agentMemoryQueries.ts +28 -0
  61. package/gql/queries/agentNoteQueries.ts +89 -0
  62. package/gql/queries/aiChatQueries.ts +70 -2
  63. package/gql/queries/audienceQueries.ts +128 -0
  64. package/gql/queries/authQueries.ts +47 -0
  65. package/gql/queries/billingQueries.ts +118 -6
  66. package/gql/queries/campaignQueries.ts +236 -0
  67. package/gql/queries/dataTableQueries.ts +61 -13
  68. package/gql/queries/emailQueries.ts +26 -17
  69. package/gql/queries/emailReplyReportQueries.ts +76 -0
  70. package/gql/queries/fieldDocQueries.ts +166 -0
  71. package/gql/queries/inboundContactQueries.ts +4 -0
  72. package/gql/queries/index.ts +10 -2
  73. package/gql/queries/logQueries.ts +68 -30
  74. package/gql/queries/organizationQueries.ts +65 -1
  75. package/gql/queries/qrCodeQueries.ts +20 -0
  76. package/gql/queries/scheduleQueries.ts +691 -0
  77. package/gql/queries/sheetQueries.ts +244 -26
  78. package/gql/queries/storageQueries.ts +38 -0
  79. package/gql/queries/workflowQueries.ts +77 -2
  80. package/hooks/index.helpers.test.ts +50 -0
  81. package/hooks/index.helpers.ts +52 -0
  82. package/hooks/index.ts +2254 -982
  83. package/hooks/use-account-mtn.ts +76 -81
  84. package/hooks/use-agentMemory-mtn.ts +71 -0
  85. package/hooks/use-agentMemory-qry.ts +56 -0
  86. package/hooks/use-agentNote-mtn.ts +82 -0
  87. package/hooks/use-agentNote-qry.ts +190 -0
  88. package/hooks/use-agentNote-recovery.helpers.test.ts +68 -0
  89. package/hooks/use-agentNote-recovery.helpers.ts +58 -0
  90. package/hooks/use-agentNote-recovery.ts +72 -0
  91. package/hooks/use-aiChat-mtn.ts +220 -141
  92. package/hooks/use-aiChat-qry.helpers.test.ts +63 -0
  93. package/hooks/use-aiChat-qry.helpers.ts +124 -0
  94. package/hooks/use-aiChat-qry.ts +341 -237
  95. package/hooks/use-aiChat-stream-mtn.ts +14 -0
  96. package/hooks/use-app-qry.ts +12 -9
  97. package/hooks/use-audience-mtn.ts +194 -0
  98. package/hooks/use-audience-qry.helpers.test.ts +80 -0
  99. package/hooks/use-audience-qry.helpers.ts +63 -0
  100. package/hooks/use-audience-qry.ts +330 -0
  101. package/hooks/use-auth-mtn.ts +435 -252
  102. package/hooks/use-auth-qry.ts +51 -0
  103. package/hooks/use-billing-mtn.ts +31 -0
  104. package/hooks/use-billing-qry.ts +76 -0
  105. package/hooks/use-campaign-generation-recovery.ts +53 -0
  106. package/hooks/use-campaign-mtn.ts +436 -0
  107. package/hooks/use-campaign-qry.helpers.ts +40 -0
  108. package/hooks/use-campaign-qry.ts +834 -0
  109. package/hooks/use-dataTable-mtn.ts +37 -46
  110. package/hooks/use-dataTable-qry.ts +102 -128
  111. package/hooks/use-email-qry.helpers.ts +37 -0
  112. package/hooks/use-email-qry.ts +56 -86
  113. package/hooks/use-emailCampaignReplyReport-qry.ts +27 -0
  114. package/hooks/use-fieldDoc-mtn.ts +262 -0
  115. package/hooks/use-fieldDoc-qry.helpers.test.ts +65 -0
  116. package/hooks/use-fieldDoc-qry.helpers.ts +49 -0
  117. package/hooks/use-fieldDoc-qry.ts +212 -0
  118. package/hooks/use-inboundContact-mtn.ts +19 -16
  119. package/hooks/use-inboundContact-qry.ts +62 -56
  120. package/hooks/use-integration-mtn.ts +56 -38
  121. package/hooks/use-integration-qry.ts +24 -9
  122. package/hooks/use-log-mtn.ts +88 -59
  123. package/hooks/use-log-qry.ts +150 -73
  124. package/hooks/use-organization-mtn.ts +334 -277
  125. package/hooks/use-organization-qry.ts +155 -129
  126. package/hooks/use-publicFormEmail-mtn.ts +27 -0
  127. package/hooks/use-qrCode-mtn.ts +40 -0
  128. package/hooks/use-qrCode-qry.ts +78 -0
  129. package/hooks/use-schedule-mtn.ts +589 -0
  130. package/hooks/use-schedule-qry.ts +738 -0
  131. package/hooks/use-schedule-reactive.ts +486 -0
  132. package/hooks/use-sheet-mtn.ts +157 -79
  133. package/hooks/use-sheet-qry.ts +221 -92
  134. package/hooks/use-storage-mtn.ts +81 -41
  135. package/hooks/use-storage-qry.ts +128 -14
  136. package/hooks/use-workflow-mtn.ts +72 -0
  137. package/hooks/use-workflow-qry.ts +184 -47
  138. package/libs/ai-chat-outgoing.helpers.ts +153 -0
  139. package/libs/ai-chat-outgoing.ts +11 -0
  140. package/libs/ai-chat-outgoing.types.ts +25 -0
  141. package/libs/ai-chat-run-realtime.ts +20 -0
  142. package/libs/ai-chat-submission-realtime.ts +150 -0
  143. package/libs/fragment-realtime-sequence.ts +55 -0
  144. package/libs/fragment-recovery.test.ts +326 -0
  145. package/libs/fragment-recovery.ts +325 -0
  146. package/libs/open-sheet.ts +138 -0
  147. package/libs/orchestrator-realtime.helpers.test.ts +229 -0
  148. package/libs/orchestrator-realtime.helpers.ts +317 -0
  149. package/libs/orchestrator-realtime.ts +433 -0
  150. package/libs/request-cache-regression.test.ts +122 -0
  151. package/libs/request-managed-session.test.ts +574 -0
  152. package/libs/request-no-store.test.ts +419 -0
  153. package/libs/sheet-command-batch.ts +44 -0
  154. package/libs/sheet-view-realtime-router.test.ts +214 -0
  155. package/libs/sheet-view-realtime-router.ts +99 -0
  156. package/libs/sse-ticket.test.ts +26 -0
  157. package/loaders/campaign.test.ts +186 -0
  158. package/loaders/campaign.ts +110 -0
  159. package/loaders/emailPreference.ts +75 -0
  160. package/loaders/rest.ts +12 -0
  161. package/package.json +119 -71
  162. package/schedule.d.ts +1790 -0
  163. package/sse.helpers.ts +19 -0
  164. package/sse.ts +70 -106
  165. package/tests/agent-note-detail-cache.test.ts +120 -0
  166. package/tests/agent-note-search.test.ts +444 -0
  167. package/tsconfig.json +11 -10
  168. package/types.d.ts +77 -26
  169. package/utils.ts +78 -49
  170. package/gql/fragments/billingFragments.ts +0 -25
  171. package/gql/fragments/productFragments.ts +0 -39
  172. package/gql/fragments/reportFragments.ts +0 -90
  173. package/gql/queries/productQueries.ts +0 -31
  174. package/gql/queries/reportQueries.ts +0 -134
  175. package/hooks/use-product-qry.ts +0 -67
  176. package/hooks/use-report-qry.ts +0 -153
@@ -1,16 +1,32 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { aiChatFragment, aiChatMessageFragment } from '../fragments/aiChatFragments.ts';
2
+ import { aiChatFragment, aiChatMessageFragment, aiChatRunFragment } from '../fragments/aiChatFragments.ts';
3
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
3
4
 
4
5
  export const startAIChatMtn = gql`
5
6
  mutation startAIChat (
6
7
  $organizationId: GenericID!
7
- $text: String!
8
+ $agentNoteId: GenericID
9
+ $type: AIChatType
10
+ $text: String
11
+ $attachments: [String!]
12
+ $qrCodeTokens: [String!]
13
+ $clientRequestId: String
14
+ $gridContext: AIChatGridContextInput
8
15
  ) {
9
16
  startAIChat (
10
17
  organizationId: $organizationId
18
+ agentNoteId: $agentNoteId
19
+ type: $type
11
20
  text: $text
21
+ attachments: $attachments
22
+ qrCodeTokens: $qrCodeTokens
23
+ clientRequestId: $clientRequestId
24
+ gridContext: $gridContext
12
25
  ) {
13
26
  sessionKey
27
+ run {
28
+ ...aiChatRunFragment
29
+ }
14
30
  node {
15
31
  cursor
16
32
  ...aiChatFragment
@@ -19,16 +35,19 @@ mutation startAIChat (
19
35
  }
20
36
 
21
37
  ${aiChatFragment}
38
+ ${aiChatRunFragment}
22
39
  `;
23
40
 
24
41
  export const editAIChatMtn = gql`
25
42
  mutation editAIChat (
26
43
  $aiChatId: GenericID!
27
- $archived: Boolean!
44
+ $archived: Boolean
45
+ $summary: String
28
46
  ) {
29
47
  editAIChat (
30
48
  aiChatId: $aiChatId
31
49
  archived: $archived
50
+ summary: $summary
32
51
  ) {
33
52
  cursor
34
53
  ...aiChatFragment
@@ -43,22 +62,42 @@ mutation sendAIChatMessage (
43
62
  $aiChatId: GenericID!
44
63
  $organizationId: GenericID
45
64
  $variablesKey: String
46
- $text: String!
65
+ $text: String
66
+ $attachments: [String!]
67
+ $qrCodeTokens: [String!]
68
+ $clientRequestId: String
69
+ $gridContext: AIChatGridContextInput
47
70
  ) {
48
71
  sendAIChatMessage (
49
72
  aiChatId: $aiChatId
50
73
  organizationId: $organizationId
51
74
  variablesKey: $variablesKey
52
75
  text: $text
76
+ attachments: $attachments
77
+ qrCodeTokens: $qrCodeTokens
78
+ clientRequestId: $clientRequestId
79
+ gridContext: $gridContext
53
80
  ) {
54
81
  sessionKey
82
+ run {
83
+ ...aiChatRunFragment
84
+ }
55
85
  node {
56
86
  ...aiChatMessageFragment
87
+
88
+ attachments {
89
+ ordinal
90
+ file {
91
+ ...storageFileFragment
92
+ }
93
+ }
57
94
  }
58
95
  }
59
96
  }
60
97
 
61
98
  ${aiChatMessageFragment}
99
+ ${aiChatRunFragment}
100
+ ${storageFileFragment}
62
101
  `;
63
102
 
64
103
  export const stopAIChatMessageMtn = gql`
@@ -80,3 +119,9 @@ mutation deleteAIChat (
80
119
  )
81
120
  }
82
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
+ `;
@@ -1,10 +1,18 @@
1
1
  import { gql } from 'graphql-tag';
2
2
  import { accountAuthFragment } from '../fragments/accountAuthFragments.ts';
3
- import { emailFragment, phoneFragment } from '../fragments/otherFragments.ts';
4
3
  import { accountFragment } from '../fragments/accountFragments.ts';
4
+ import { emailFragment, phoneFragment } from '../fragments/otherFragments.ts';
5
5
 
6
6
  const authenticateResultText = `...accountAuthFragment
7
7
 
8
+ managedSessionCredential {
9
+ accessToken
10
+ accessTokenExpiresAt
11
+ refreshToken
12
+ refreshTokenExpiresAt
13
+ sessionId
14
+ }
15
+
8
16
  account {
9
17
  ...accountFragment
10
18
 
@@ -34,7 +42,6 @@ mutation confirmPassword (
34
42
  }
35
43
  `;
36
44
 
37
-
38
45
  export const authenticateWithPasswordMtn = gql`
39
46
  mutation authenticateWithPassword (
40
47
  $identifier: String!
@@ -50,6 +57,19 @@ mutation authenticateWithPassword (
50
57
  ${authenticateFragments}
51
58
  `;
52
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
+
53
73
  export const authenticateWithTokenMtn = gql`
54
74
  mutation authenticateWithToken (
55
75
  $token: Token!
@@ -63,12 +83,149 @@ mutation authenticateWithToken (
63
83
  ${authenticateFragments}
64
84
  `;
65
85
 
86
+ export const authenticateManagedSessionMtn = gql`
87
+ mutation authenticateManagedSession (
88
+ $accessToken: Token!
89
+ $refreshToken: String!
90
+ $refreshAttemptId: String!
91
+ ) {
92
+ authenticateManagedSession (
93
+ accessToken: $accessToken
94
+ refreshToken: $refreshToken
95
+ refreshAttemptId: $refreshAttemptId
96
+ ) {
97
+ auth {
98
+ ${authenticateResultText}
99
+ }
100
+
101
+ credential {
102
+ accessToken
103
+ accessTokenExpiresAt
104
+ refreshToken
105
+ refreshTokenExpiresAt
106
+ sessionId
107
+ }
108
+ }
109
+ }
110
+ ${authenticateFragments}
111
+ `;
112
+
113
+ export const exchangeSessionBootstrapMtn = gql`
114
+ mutation exchangeSessionBootstrap (
115
+ $bootstrapToken: String!
116
+ ) {
117
+ exchangeSessionBootstrap (
118
+ bootstrapToken: $bootstrapToken
119
+ ) {
120
+ accessToken
121
+ accessTokenExpiresAt
122
+ refreshToken
123
+ refreshTokenExpiresAt
124
+ sessionId
125
+ }
126
+ }`;
127
+
128
+ export const refreshManagedSessionMtn = gql`
129
+ mutation refreshManagedSession (
130
+ $refreshToken: String!
131
+ $refreshAttemptId: String
132
+ ) {
133
+ refreshManagedSession (
134
+ refreshToken: $refreshToken
135
+ refreshAttemptId: $refreshAttemptId
136
+ ) {
137
+ accessToken
138
+ accessTokenExpiresAt
139
+ refreshToken
140
+ refreshTokenExpiresAt
141
+ sessionId
142
+ }
143
+ }`;
144
+
145
+ export const revokeManagedSessionMtn = gql`
146
+ mutation revokeManagedSession (
147
+ $refreshToken: String!
148
+ $accessToken: Token
149
+ ) {
150
+ revokeManagedSession (
151
+ refreshToken: $refreshToken
152
+ accessToken: $accessToken
153
+ )
154
+ }`;
155
+
156
+ export const revokeMyAccountSessionMtn = gql`
157
+ mutation revokeMyAccountSession (
158
+ $sessionId: GenericID!
159
+ ) {
160
+ revokeMyAccountSession (
161
+ sessionId: $sessionId
162
+ )
163
+ }`;
164
+
165
+ export const revokeMyOtherAccountSessionsMtn = gql`
166
+ mutation revokeMyOtherAccountSessions {
167
+ revokeMyOtherAccountSessions
168
+ }`;
169
+
170
+ export const revokeOrganizationMemberSessionMtn = gql`
171
+ mutation revokeOrganizationMemberSession (
172
+ $organizationId: GenericID!
173
+ $accountId: GenericID!
174
+ $sessionId: GenericID!
175
+ ) {
176
+ revokeOrganizationMemberSession (
177
+ organizationId: $organizationId
178
+ accountId: $accountId
179
+ sessionId: $sessionId
180
+ )
181
+ }`;
182
+
183
+ export const revokeOrganizationMemberSessionsMtn = gql`
184
+ mutation revokeOrganizationMemberSessions (
185
+ $organizationId: GenericID!
186
+ $accountId: GenericID!
187
+ ) {
188
+ revokeOrganizationMemberSessions (
189
+ organizationId: $organizationId
190
+ accountId: $accountId
191
+ )
192
+ }`;
193
+
66
194
  export const continueWithGoogleMtn = gql`
67
195
  mutation continueWithGoogle (
68
- $oauthToken: String!
196
+ $oauthToken: String
197
+ $idToken: String
198
+ $nonce: String
199
+ $ssoConnectionId: GenericID
200
+ $formPublicId: String
201
+ $authenticateOnly: Boolean
69
202
  ) {
70
203
  continueWithGoogle (
71
204
  oauthToken: $oauthToken
205
+ idToken: $idToken
206
+ nonce: $nonce
207
+ ssoConnectionId: $ssoConnectionId
208
+ formPublicId: $formPublicId
209
+ authenticateOnly: $authenticateOnly
210
+ ) {
211
+ ${authenticateResultText}
212
+ }
213
+ }
214
+ ${authenticateFragments}
215
+ `;
216
+
217
+ export const continueWithMicrosoftMtn = gql`
218
+ mutation continueWithMicrosoft (
219
+ $idToken: String!
220
+ $ssoConnectionId: GenericID
221
+ $formPublicId: String
222
+ $authenticateOnly: Boolean
223
+ ) {
224
+ continueWithMicrosoft (
225
+ idToken: $idToken
226
+ ssoConnectionId: $ssoConnectionId
227
+ formPublicId: $formPublicId
228
+ authenticateOnly: $authenticateOnly
72
229
  ) {
73
230
  ${authenticateResultText}
74
231
  }
@@ -76,6 +233,22 @@ mutation continueWithGoogle (
76
233
  ${authenticateFragments}
77
234
  `;
78
235
 
236
+ export const getSsoLoginOptionsMtn = gql`
237
+ mutation getSsoLoginOptions (
238
+ $email: String!
239
+ ) {
240
+ getSsoLoginOptions (
241
+ email: $email
242
+ ) {
243
+ id
244
+ provider
245
+ organizationId
246
+ organizationName
247
+ microsoftTenantId
248
+ googleHostedDomain
249
+ }
250
+ }`;
251
+
79
252
  export const checkUsernameOrEmailMtn = gql`
80
253
  mutation checkUsernameOrEmail (
81
254
  $usernameOrEmail: String!
@@ -125,6 +298,33 @@ mutation sendPhoneVerificationCode (
125
298
  )
126
299
  }`;
127
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
+
128
328
  export const confirmPhoneVerificationCodeMtn = gql`
129
329
  mutation confirmPhoneVerificationCode (
130
330
  $phone: String!
@@ -149,18 +349,3 @@ mutation signUpWithEmail (
149
349
  password: $password
150
350
  )
151
351
  }`;
152
-
153
- export const signInWithAppleMtn = gql`
154
- mutation signInWithApple (
155
- $code: String!
156
- $idToken: String!
157
- ) {
158
- signInWithApple (
159
- code: $code
160
- idToken: $idToken
161
- ) {
162
- ${authenticateResultText}
163
- }
164
- }
165
- ${authenticateFragments}
166
- `;
@@ -1,34 +1,24 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { platformProductPurchaseResultFragment } from '../fragments/billingFragments.ts';
3
2
 
4
- export const purchasePlatformProductMtn = gql`
5
- mutation purchasePlatformProduct (
6
- $paymentId: String!
7
- $paymentMethodId: String!
8
- $productGroup: PlatformProductGroup!
9
- $email: String!
10
- $name: String
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!
11
10
  ) {
12
- purchasePlatformProduct (
13
- paymentId: $paymentId
14
- paymentMethodId: $paymentMethodId
15
- productGroup: $productGroup
16
- email: $email
17
- name: $name
11
+ startBillingSubscription (
12
+ organizationId: $organizationId
13
+ priceId: $priceId
14
+ billingDetails: $billingDetails
18
15
  ) {
19
- ...platformProductPurchaseResultFragment
16
+ purchaseAttemptId
17
+ subscriptionId
18
+ intentType
19
+ clientSecret
20
+ amountDue
21
+ currency
20
22
  }
21
23
  }
22
-
23
- ${platformProductPurchaseResultFragment}
24
- `;
25
-
26
- export const cancelPlatformSubscriptionMtn = gql`
27
- mutation cancelPlatformSubscription {
28
- cancelPlatformSubscription {
29
- ...platformProductPurchaseResultFragment
30
- }
31
- }
32
-
33
- ${platformProductPurchaseResultFragment}
34
24
  `;