@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
@@ -0,0 +1,128 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ audienceEmailAddressFragment,
4
+ audienceEventFragment,
5
+ audienceListFragment,
6
+ audienceListMemberFragment,
7
+ campaignAudienceMemberFragment,
8
+ campaignAudiencePreviewFragment,
9
+ campaignAudienceSessionFragment,
10
+ } from '../fragments/audienceFragments.ts';
11
+
12
+ export const audienceListsQry = gql`
13
+ query audienceLists(
14
+ $organizationId: GenericID!
15
+ $filter: AudienceListsFilter
16
+ $sort: AudienceListsSort
17
+ $cursor: Cursor
18
+ $after: Boolean!
19
+ $limit: Int!
20
+ ) {
21
+ audienceLists(organizationId: $organizationId, filter: $filter, sort: $sort, cursor: $cursor, after: $after, limit: $limit) {
22
+ ...audienceListFragment
23
+ count
24
+ }
25
+ }
26
+ ${audienceListFragment}
27
+ `;
28
+
29
+ export const audienceListQry = gql`
30
+ query audienceList($organizationId: GenericID!, $audienceListId: GenericID!) {
31
+ audienceList(organizationId: $organizationId, audienceListId: $audienceListId) {
32
+ ...audienceListFragment
33
+ }
34
+ }
35
+ ${audienceListFragment}
36
+ `;
37
+
38
+ export const audienceListMembersQry = gql`
39
+ query audienceListMembers(
40
+ $organizationId: GenericID!
41
+ $filter: AudienceListMembersFilter!
42
+ $sort: AudienceListMembersSort
43
+ $cursor: Cursor
44
+ $after: Boolean!
45
+ $limit: Int!
46
+ ) {
47
+ audienceListMembers(organizationId: $organizationId, filter: $filter, sort: $sort, cursor: $cursor, after: $after, limit: $limit) {
48
+ ...audienceListMemberFragment
49
+ address {
50
+ ...audienceEmailAddressFragment
51
+ }
52
+ }
53
+ }
54
+ ${audienceListMemberFragment}
55
+ ${audienceEmailAddressFragment}
56
+ `;
57
+
58
+ export const audienceListOverviewQry = gql`
59
+ query audienceListOverview($organizationId: GenericID!, $audienceListId: GenericID!) {
60
+ audienceListOverview(organizationId: $organizationId, audienceListId: $audienceListId) {
61
+ total
62
+ subscribed
63
+ unsubscribed
64
+ nonSubscribed
65
+ pending
66
+ cleaned
67
+ eligible
68
+ }
69
+ }
70
+ `;
71
+
72
+ export const audienceEmailAddressQry = gql`
73
+ query audienceEmailAddress($organizationId: GenericID!, $emailAddressId: GenericID!) {
74
+ audienceEmailAddress(organizationId: $organizationId, emailAddressId: $emailAddressId) {
75
+ ...audienceEmailAddressFragment
76
+ }
77
+ }
78
+ ${audienceEmailAddressFragment}
79
+ `;
80
+
81
+ export const audienceAddressHistoryQry = gql`
82
+ query audienceAddressHistory($organizationId: GenericID!, $emailAddressId: GenericID!, $afterId: GenericID, $limit: Int) {
83
+ audienceAddressHistory(organizationId: $organizationId, emailAddressId: $emailAddressId, afterId: $afterId, limit: $limit) {
84
+ ...audienceEventFragment
85
+ }
86
+ }
87
+ ${audienceEventFragment}
88
+ `;
89
+
90
+ /*
91
+ * Cache/WS contract: one root carries the campaign-keyed session and preview fragments, written together by
92
+ * this query and by setCampaignAudience, and refreshed by one ALWAYS reset targeting { organizationId, campaignId }.
93
+ */
94
+ export const campaignAudienceQry = gql`
95
+ query campaignAudience($organizationId: GenericID!, $campaignId: GenericID!) {
96
+ campaignAudience(organizationId: $organizationId, campaignId: $campaignId) {
97
+ session { ...campaignAudienceSessionFragment }
98
+ preview { ...campaignAudiencePreviewFragment }
99
+ }
100
+ }
101
+ ${campaignAudienceSessionFragment}
102
+ ${campaignAudiencePreviewFragment}
103
+ `;
104
+
105
+ /*
106
+ * Cache/WS contract: pages of this query are dropped and refetched by RESET_ONLY resets
107
+ * targeting { organizationId, campaignId? }; rows are never patched through fragments.
108
+ */
109
+ export const campaignAudienceMembersQry = gql`
110
+ query campaignAudienceMembers(
111
+ $organizationId: GenericID!
112
+ $campaignId: GenericID!
113
+ $filter: CampaignAudienceMembersFilter
114
+ $sort: CampaignAudienceMembersSort
115
+ $cursor: Cursor
116
+ $after: Boolean!
117
+ $limit: Int!
118
+ ) {
119
+ campaignAudienceMembers(organizationId: $organizationId, campaignId: $campaignId, filter: $filter, sort: $sort, cursor: $cursor, after: $after, limit: $limit) {
120
+ ...campaignAudienceMemberFragment
121
+ address {
122
+ ...audienceEmailAddressFragment
123
+ }
124
+ }
125
+ }
126
+ ${campaignAudienceMemberFragment}
127
+ ${audienceEmailAddressFragment}
128
+ `;
@@ -0,0 +1,47 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { accountSessionFragment } from '../fragments/accountSessionFragments.ts';
3
+
4
+ const ORGANIZATION_AUTHORIZATION_FIELDS = `
5
+ organizationAuthorizations {
6
+ id
7
+ organizationId
8
+ ssoConnectionId
9
+ authorizationMethod
10
+ authorizedAt
11
+ lastActivityAt
12
+ revokedAt
13
+ revokeReason
14
+ }
15
+ `;
16
+
17
+ export const agentLoginAvailableQry = gql`
18
+ query agentLoginAvailable {
19
+ agentLoginAvailable
20
+ }
21
+ `;
22
+
23
+ export const myAccountSessionsQry = gql`
24
+ query myAccountSessions {
25
+ myAccountSessions {
26
+ ...accountSessionFragment
27
+ ${ORGANIZATION_AUTHORIZATION_FIELDS}
28
+ }
29
+ }
30
+ ${accountSessionFragment}
31
+ `;
32
+
33
+ export const organizationMemberSessionsQry = gql`
34
+ query organizationMemberSessions (
35
+ $organizationId: GenericID!
36
+ $accountId: GenericID!
37
+ ) {
38
+ organizationMemberSessions (
39
+ organizationId: $organizationId
40
+ accountId: $accountId
41
+ ) {
42
+ ...accountSessionFragment
43
+ ${ORGANIZATION_AUTHORIZATION_FIELDS}
44
+ }
45
+ }
46
+ ${accountSessionFragment}
47
+ `;
@@ -1,12 +1,124 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { platformProductFragment } from '../fragments/billingFragments.ts';
3
2
 
4
- export const platformProductsQry = gql`
5
- query platformProducts {
6
- platformProducts {
7
- ...platformProductFragment
3
+ export const organizationUsageQry = gql`
4
+ query organizationUsage(
5
+ $organizationId: GenericID!
6
+ $occurredAtFrom: DateTime!
7
+ $occurredAtTo: DateTime!
8
+ $meters: [UsageMeter!]
9
+ $origins: [UsageOrigin!]
10
+ ) {
11
+ organizationUsage(
12
+ organizationId: $organizationId
13
+ occurredAtFrom: $occurredAtFrom
14
+ occurredAtTo: $occurredAtTo
15
+ meters: $meters
16
+ origins: $origins
17
+ ) {
18
+ meter
19
+ origin
20
+ quantity
21
+ eventCount
8
22
  }
9
23
  }
24
+ `;
25
+
26
+ export const billingPlansQry = gql`
27
+ query billingPlans {
28
+ billingPlans {
29
+ planKey
30
+ name
31
+ contactSales
32
+
33
+ prices {
34
+ priceId
35
+ lookupKey
36
+ planKey
37
+ interval
38
+ unitAmount
39
+ currency
40
+ }
41
+ }
42
+ }
43
+ `;
44
+
45
+ export const billingClientConfigQry = gql`
46
+ query billingClientConfig {
47
+ billingClientConfig {
48
+ publishableKey
49
+ livemode
50
+ paymentMethodTypes
51
+ }
52
+ }
53
+ `;
10
54
 
11
- ${platformProductFragment}
55
+ export const organizationBillingQry = gql`
56
+ query organizationBilling (
57
+ $organizationId: GenericID!
58
+ ) {
59
+ organizationBilling (
60
+ organizationId: $organizationId
61
+ ) {
62
+ organizationId
63
+
64
+ access {
65
+ enforcement
66
+ planKey
67
+ subscriptionStatus
68
+ paidThroughAt
69
+ accessEndsAt
70
+ accessLockedAt
71
+ graceDays
72
+ }
73
+
74
+ subscription {
75
+ id
76
+ status
77
+ planKey
78
+ interval
79
+ currentPeriodEnd
80
+ cancelAtPeriodEnd
81
+ collectionMethod
82
+ unitAmount
83
+ currency
84
+ }
85
+
86
+ invoices {
87
+ id
88
+ number
89
+ status
90
+ total
91
+ amountDue
92
+ amountPaid
93
+ currency
94
+ hostedInvoiceUrl
95
+ invoicePdf
96
+ periodStart
97
+ periodEnd
98
+ paidAt
99
+ dueDate
100
+ createdAt
101
+ }
102
+ }
103
+ }
104
+ `;
105
+
106
+ export const billingPurchasePreviewQry = gql`
107
+ query billingPurchasePreview (
108
+ $organizationId: GenericID!
109
+ $priceId: String!
110
+ $address: BillingAddressInput!
111
+ ) {
112
+ billingPurchasePreview (
113
+ organizationId: $organizationId
114
+ priceId: $priceId
115
+ address: $address
116
+ ) {
117
+ subtotal
118
+ tax
119
+ total
120
+ currency
121
+ taxStatus
122
+ }
123
+ }
12
124
  `;
@@ -0,0 +1,236 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ campaignEditorFieldsSelection,
4
+ campaignFieldsSelection,
5
+ campaignRecipientFragment,
6
+ campaignRecipientOverviewFragment,
7
+ campaignResponseFragment,
8
+ campaignResponseOverviewFragment,
9
+ campaignResponseSummaryFragment,
10
+ campaignSummaryFragment,
11
+ campaignTemplateFieldsSelection,
12
+ campaignTemplateSummaryFragment,
13
+ } from '../fragments/campaignFragments.ts';
14
+
15
+ export const campaignTemplatesQry = gql`
16
+ query campaignTemplates (
17
+ $organizationId: GenericID!
18
+ $filter: CampaignTemplatesFilter!
19
+ $cursor: Cursor
20
+ $after: Boolean!
21
+ $limit: Int!
22
+ ) {
23
+ campaignTemplates (
24
+ organizationId: $organizationId
25
+ filter: $filter
26
+ cursor: $cursor
27
+ after: $after
28
+ limit: $limit
29
+ ) {
30
+ ...campaignTemplateSummaryFragment
31
+ }
32
+ }
33
+ ${campaignTemplateSummaryFragment}
34
+ `;
35
+
36
+ /**
37
+ * Every current system template (no owning organization). Not paginated.
38
+ */
39
+ export const systemCampaignTemplatesQry = gql`
40
+ query systemCampaignTemplates (
41
+ $filter: SystemCampaignTemplatesFilter!
42
+ ) {
43
+ systemCampaignTemplates (filter: $filter) {
44
+ ...campaignTemplateSummaryFragment
45
+ }
46
+ }
47
+ ${campaignTemplateSummaryFragment}
48
+ `;
49
+
50
+ export const campaignTemplateEditSessionQry = gql`
51
+ query campaignTemplateEditSession (
52
+ $templateId: GenericID!
53
+ ) {
54
+ campaignTemplateEditSession (
55
+ templateId: $templateId
56
+ ) {
57
+ organizationId
58
+ status
59
+ template {
60
+ ${campaignTemplateFieldsSelection}
61
+ }
62
+ editor {
63
+ ${campaignEditorFieldsSelection}
64
+ }
65
+ editable
66
+ }
67
+ }
68
+ `;
69
+
70
+ export const campaignsQry = gql`
71
+ query campaigns (
72
+ $organizationId: GenericID
73
+ $filter: CampaignsFilter!
74
+ $sort: CampaignsSort
75
+ $cursor: Cursor
76
+ $after: Boolean!
77
+ $limit: Int!
78
+ ) {
79
+ campaigns (
80
+ organizationId: $organizationId
81
+ filter: $filter
82
+ sort: $sort
83
+ cursor: $cursor
84
+ after: $after
85
+ limit: $limit
86
+ ) {
87
+ ...campaignSummaryFragment
88
+ }
89
+ }
90
+ ${campaignSummaryFragment}
91
+ `;
92
+
93
+ export const campaignEditSessionQry = gql`
94
+ query campaignEditSession (
95
+ $campaignId: GenericID!
96
+ ) {
97
+ campaignEditSession (
98
+ campaignId: $campaignId
99
+ ) {
100
+ organizationId
101
+ status
102
+ campaign {
103
+ ${campaignFieldsSelection}
104
+ }
105
+ editor {
106
+ ${campaignEditorFieldsSelection}
107
+ }
108
+ editable
109
+ manageable
110
+ }
111
+ }
112
+ `;
113
+
114
+ /**
115
+ * Fetch the latest organization overrides and picker targets for one form.
116
+ */
117
+ export const campaignFormAccessSessionQry = gql`
118
+ query campaignFormAccessSession (
119
+ $organizationId: GenericID!
120
+ $campaignId: GenericID!
121
+ ) {
122
+ campaignFormAccessSession (
123
+ organizationId: $organizationId
124
+ campaignId: $campaignId
125
+ ) {
126
+ campaignId
127
+ organizationId
128
+ editVersion
129
+ audience
130
+ editable
131
+ publicId
132
+ grants {
133
+ granteeType
134
+ granteeId
135
+ permission
136
+ }
137
+ organizations {
138
+ id
139
+ name
140
+ operation
141
+ inNetwork
142
+ available
143
+ }
144
+ }
145
+ }
146
+ `;
147
+
148
+ export const campaignResponsesQry = gql`
149
+ query campaignResponses (
150
+ $organizationId: GenericID!
151
+ $filter: CampaignResponsesFilter!
152
+ $cursor: Cursor
153
+ $after: Boolean!
154
+ $limit: Int!
155
+ ) {
156
+ campaignResponses (
157
+ organizationId: $organizationId
158
+ filter: $filter
159
+ cursor: $cursor
160
+ after: $after
161
+ limit: $limit
162
+ ) {
163
+ ...campaignResponseSummaryFragment
164
+ }
165
+ }
166
+ ${campaignResponseSummaryFragment}
167
+ `;
168
+
169
+ export const campaignResponseQry = gql`
170
+ query campaignResponse (
171
+ $organizationId: GenericID!
172
+ $responseId: GenericID!
173
+ ) {
174
+ campaignResponse (
175
+ organizationId: $organizationId
176
+ responseId: $responseId
177
+ ) {
178
+ ...campaignResponseFragment
179
+ }
180
+ }
181
+ ${campaignResponseFragment}
182
+ `;
183
+
184
+ export const campaignResponseOverviewQry = gql`
185
+ query campaignResponseOverview (
186
+ $organizationId: GenericID!
187
+ $campaignId: GenericID!
188
+ ) {
189
+ campaignResponseOverview (
190
+ organizationId: $organizationId
191
+ campaignId: $campaignId
192
+ ) {
193
+ ...campaignResponseOverviewFragment
194
+ }
195
+ }
196
+ ${campaignResponseOverviewFragment}
197
+ `;
198
+
199
+ export const campaignRecipientsQry = gql`
200
+ query campaignRecipients (
201
+ $organizationId: GenericID!
202
+ $filter: CampaignRecipientsFilter!
203
+ $cursor: Cursor
204
+ $after: Boolean!
205
+ $limit: Int!
206
+ ) {
207
+ campaignRecipients (
208
+ organizationId: $organizationId
209
+ filter: $filter
210
+ cursor: $cursor
211
+ after: $after
212
+ limit: $limit
213
+ ) {
214
+ ...campaignRecipientFragment
215
+ }
216
+ }
217
+ ${campaignRecipientFragment}
218
+ `;
219
+
220
+ /**
221
+ * Fetch aggregate delivery and engagement metrics for one email campaign.
222
+ */
223
+ export const campaignRecipientOverviewQry = gql`
224
+ query campaignRecipientOverview (
225
+ $organizationId: GenericID!
226
+ $campaignId: GenericID!
227
+ ) {
228
+ campaignRecipientOverview (
229
+ organizationId: $organizationId
230
+ campaignId: $campaignId
231
+ ) {
232
+ ...campaignRecipientOverviewFragment
233
+ }
234
+ }
235
+ ${campaignRecipientOverviewFragment}
236
+ `;
@@ -1,14 +1,26 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { dataTableCellFragment, dataTableFragment, dataTableRowFragment } from '../fragments/dataTableFragments.ts';
2
+ import {
3
+ dataTableFragment,
4
+ dataTableRowFragment,
5
+ dataTableRunFragment,
6
+ } from '../fragments/dataTableFragments.ts';
3
7
 
4
8
  export const dataTablesQry = gql`
5
9
  query dataTables (
6
10
  $organizationId: GenericID!
7
- $active: Boolean
11
+ $filter: DataTablesFilter
12
+ $sort: GridItemSort
13
+ $cursor: Cursor
14
+ $after: Boolean!
15
+ $limit: Int!
8
16
  ) {
9
17
  dataTables (
10
18
  organizationId: $organizationId
11
- active: $active
19
+ filter: $filter
20
+ sort: $sort
21
+ cursor: $cursor
22
+ after: $after
23
+ limit: $limit
12
24
  ) {
13
25
  ...dataTableFragment
14
26
  }
@@ -17,29 +29,65 @@ query dataTables (
17
29
  ${dataTableFragment}
18
30
  `;
19
31
 
32
+ export const dataTableQry = gql`
33
+ query dataTable (
34
+ $organizationId: GenericID!
35
+ $dataTableId: GenericID!
36
+ ) {
37
+ dataTable (
38
+ organizationId: $organizationId
39
+ dataTableId: $dataTableId
40
+ ) {
41
+ ...dataTableFragment
42
+ }
43
+ }
44
+
45
+ ${dataTableFragment}
46
+ `;
47
+
48
+ // One keyset page of a table's live rows. The server resets this query
49
+ // (RESET_ONLY) when the table's rows change.
20
50
  export const dataTableRowsQry = gql`
21
51
  query dataTableRows (
22
- $dataTableId: GenericID!
23
52
  $organizationId: GenericID!
24
- $cursor: Cursor
25
- $limit: Int!
26
- $filter: DataTableRowsFilterInput
53
+ $dataTableId: GenericID!
54
+ $sort: DataTableRowSortInput
55
+ $cursor: String
56
+ $limit: Int
27
57
  ) {
28
58
  dataTableRows (
29
- dataTableId: $dataTableId
30
59
  organizationId: $organizationId
60
+ dataTableId: $dataTableId
61
+ sort: $sort
31
62
  cursor: $cursor
32
63
  limit: $limit
33
- filter: $filter
34
64
  ) {
35
- ...dataTableRowFragment
65
+ nextCursor
66
+ revision
36
67
 
37
- cells {
38
- ...dataTableCellFragment
68
+ items {
69
+ ...dataTableRowFragment
39
70
  }
40
71
  }
41
72
  }
42
73
 
43
74
  ${dataTableRowFragment}
44
- ${dataTableCellFragment}
75
+ `;
76
+
77
+ export const dataTableRunsQry = gql`
78
+ query dataTableRuns (
79
+ $organizationId: GenericID!
80
+ $dataTableId: GenericID!
81
+ $limit: Int
82
+ ) {
83
+ dataTableRuns (
84
+ organizationId: $organizationId
85
+ dataTableId: $dataTableId
86
+ limit: $limit
87
+ ) {
88
+ ...dataTableRunFragment
89
+ }
90
+ }
91
+
92
+ ${dataTableRunFragment}
45
93
  `;
@@ -1,33 +1,43 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { inboundEmailAttachmentFragment, inboundEmailFragment } from '../fragments/emailFragments.ts';
2
+ import {
3
+ emailMessageDetailsFragment,
4
+ emailMessageFragment,
5
+ } from '../fragments/emailFragments.ts';
6
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
3
7
 
4
- export const inboundEmailQry = gql`
5
- query inboundEmail (
8
+ export const emailMessageQry = gql`
9
+ query emailMessage (
6
10
  $organizationId: GenericID!
7
- $inboundEmailId: GenericID!
11
+ $emailMessageId: ID!
8
12
  ) {
9
- inboundEmail (
13
+ emailMessage (
10
14
  organizationId: $organizationId
11
- inboundEmailId: $inboundEmailId
15
+ emailMessageId: $emailMessageId
12
16
  ) {
13
- ...inboundEmailFragment
17
+ ...emailMessageFragment
18
+ ...emailMessageDetailsFragment
19
+
20
+ files {
21
+ ...storageFileFragment
22
+ }
14
23
  }
15
24
  }
16
25
 
17
- ${inboundEmailAttachmentFragment}
18
- ${inboundEmailFragment}
26
+ ${storageFileFragment}
27
+ ${emailMessageFragment}
28
+ ${emailMessageDetailsFragment}
19
29
  `;
20
30
 
21
- export const inboundEmailsQry = gql`
22
- query inboundEmails (
31
+ export const emailMessagesQry = gql`
32
+ query emailMessages (
23
33
  $organizationId: GenericID!
24
- $filter: InboundEmailsFilter
25
- $sort: InboundEmailsSort
34
+ $filter: EmailMessagesFilter
35
+ $sort: EmailMessagesSort
26
36
  $cursor: Cursor
27
37
  $after: Boolean!
28
38
  $limit: Int!
29
39
  ) {
30
- inboundEmails (
40
+ emailMessages (
31
41
  organizationId: $organizationId
32
42
  filter: $filter
33
43
  sort: $sort
@@ -35,10 +45,9 @@ query inboundEmails (
35
45
  after: $after
36
46
  limit: $limit
37
47
  ) {
38
- ...inboundEmailFragment
48
+ ...emailMessageFragment
39
49
  }
40
50
  }
41
51
 
42
- ${inboundEmailAttachmentFragment}
43
- ${inboundEmailFragment}
52
+ ${emailMessageFragment}
44
53
  `;