@jsb188/graphql 1.1.12 → 1.1.13

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 (137) hide show
  1. package/LICENSE +21 -0
  2. package/audience.d.ts +14 -152
  3. package/cache/config.ts +35 -32
  4. package/cache/index.helpers.ts +1 -1
  5. package/cache/index.ts +73 -44
  6. package/cache/mounted-queries.ts +33 -0
  7. package/cache/persist.ts +10 -4
  8. package/cache/realtime-fence.ts +47 -0
  9. package/cache/realtime-live.ts +17 -0
  10. package/client/draft-persistence.ts +10 -39
  11. package/client/index.ts +2 -1
  12. package/client/request.ts +9 -34
  13. package/client/storage-asset.ts +58 -0
  14. package/gql/fragments/accountAuthFragments.ts +0 -4
  15. package/gql/fragments/agentNoteFragments.ts +8 -2
  16. package/gql/fragments/aiChatFragments.ts +0 -2
  17. package/gql/fragments/aiChatLinkFragments.ts +8 -0
  18. package/gql/fragments/audienceFragments.ts +1 -66
  19. package/gql/fragments/emailFragments.ts +27 -4
  20. package/gql/fragments/emailOutreachFragments.ts +281 -0
  21. package/gql/fragments/inboundContactFragments.ts +1 -1
  22. package/gql/fragments/libraryFragments.ts +120 -0
  23. package/gql/fragments/organizationFragments.ts +4 -2
  24. package/gql/fragments/scheduleFragments.ts +241 -324
  25. package/gql/fragments/sheetFragments.ts +4 -53
  26. package/gql/fragments/workWaitFragments.ts +13 -0
  27. package/gql/fragments/workflowFragments.ts +20 -4
  28. package/gql/mutations/agentNoteMutations.ts +2 -0
  29. package/gql/mutations/aiChatLinkMutations.ts +13 -0
  30. package/gql/mutations/aiChatMutations.ts +4 -6
  31. package/gql/mutations/audienceMutations.ts +0 -13
  32. package/gql/mutations/authMutations.ts +12 -60
  33. package/gql/mutations/emailMutations.ts +22 -0
  34. package/gql/mutations/emailOutreachMutations.ts +139 -0
  35. package/gql/mutations/index.ts +3 -1
  36. package/gql/mutations/organizationMutations.ts +2 -2
  37. package/gql/mutations/scheduleMutations.ts +61 -787
  38. package/gql/mutations/storageMutations.ts +1 -0
  39. package/gql/mutations/workflowMutations.ts +76 -0
  40. package/gql/queries/agentMemoryQueries.ts +6 -2
  41. package/gql/queries/agentNoteQueries.ts +26 -29
  42. package/gql/queries/aiChatQueries.ts +39 -40
  43. package/gql/queries/audienceQueries.ts +31 -55
  44. package/gql/queries/authQueries.ts +16 -6
  45. package/gql/queries/billingQueries.ts +26 -10
  46. package/gql/queries/dataTableQueries.ts +24 -15
  47. package/gql/queries/emailOutreachQueries.ts +282 -0
  48. package/gql/queries/emailQueries.ts +39 -12
  49. package/gql/queries/emailReplyReportQueries.ts +60 -9
  50. package/gql/queries/fieldDocQueries.ts +36 -14
  51. package/gql/queries/inboundContactQueries.ts +11 -4
  52. package/gql/queries/index.ts +2 -2
  53. package/gql/queries/libraryQueries.ts +112 -0
  54. package/gql/queries/logQueries.ts +31 -12
  55. package/gql/queries/organizationQueries.ts +31 -12
  56. package/gql/queries/qrCodeQueries.ts +11 -4
  57. package/gql/queries/scheduleQueries.ts +252 -505
  58. package/gql/queries/sheetQueries.ts +36 -14
  59. package/gql/queries/storageQueries.ts +11 -4
  60. package/gql/queries/workflowQueries.ts +53 -10
  61. package/gql/reactivity.ts +98 -0
  62. package/gql/recordReads.ts +171 -0
  63. package/hooks/index.ts +79 -52
  64. package/hooks/use-agentNote-mtn.ts +7 -0
  65. package/hooks/use-agentNote-qry.ts +30 -58
  66. package/hooks/use-agentNote-recovery.ts +6 -21
  67. package/hooks/use-aiChat-mtn.ts +9 -4
  68. package/hooks/use-aiChat-qry.ts +28 -7
  69. package/hooks/use-audience-mtn.ts +0 -24
  70. package/hooks/use-audience-qry.helpers.ts +0 -24
  71. package/hooks/use-audience-qry.ts +1 -86
  72. package/hooks/use-dataTable-mtn.ts +3 -3
  73. package/hooks/use-dataTable-qry.ts +7 -2
  74. package/hooks/use-email-mtn.ts +26 -0
  75. package/hooks/use-email-qry.helpers.ts +1 -1
  76. package/hooks/use-email-qry.ts +18 -3
  77. package/hooks/use-emailOutreach-mtn.ts +211 -0
  78. package/hooks/use-emailOutreach-qry.helpers.ts +25 -0
  79. package/hooks/use-emailOutreach-qry.ts +367 -0
  80. package/hooks/use-emailOutreachReplyReport-qry.ts +46 -0
  81. package/hooks/use-fieldDoc-qry.ts +1 -1
  82. package/hooks/use-library-qry.ts +233 -0
  83. package/hooks/use-qrCode-qry.ts +1 -1
  84. package/hooks/use-schedule-mtn.ts +10 -300
  85. package/hooks/use-schedule-qry.ts +168 -680
  86. package/hooks/use-schedule-reactive.ts +71 -339
  87. package/hooks/use-sheet-qry.ts +6 -1
  88. package/hooks/use-workflow-mtn.ts +45 -1
  89. package/hooks/use-workflow-qry.ts +22 -2
  90. package/libs/ai-chat-link-events.ts +78 -0
  91. package/libs/data-changes.helpers.ts +161 -0
  92. package/libs/data-changes.ts +382 -0
  93. package/libs/fragment-realtime-sequence.ts +3 -3
  94. package/libs/record-read.ts +327 -0
  95. package/libs/sheet-command-batch.ts +3 -2
  96. package/libs/sheet-realtime-packet.ts +53 -0
  97. package/loaders/emailPreference.ts +18 -24
  98. package/package.json +44 -17
  99. package/schedule.d.ts +267 -874
  100. package/types.d.ts +3 -1
  101. package/cache/index.chat-activity.test.ts +0 -119
  102. package/cache/index.chat.test.ts +0 -92
  103. package/cache/index.regression.test.ts +0 -149
  104. package/cache/index.test.ts +0 -1209
  105. package/deno.lock +0 -187
  106. package/deno.test.json +0 -12
  107. package/gql/fragments/campaignFragments.ts +0 -566
  108. package/gql/mutations/campaignMutations.ts +0 -258
  109. package/gql/queries/appQueries.ts +0 -14
  110. package/gql/queries/campaignQueries.ts +0 -236
  111. package/hooks/index.helpers.test.ts +0 -50
  112. package/hooks/use-agentNote-recovery.helpers.test.ts +0 -68
  113. package/hooks/use-aiChat-qry.helpers.test.ts +0 -63
  114. package/hooks/use-app-qry.ts +0 -22
  115. package/hooks/use-audience-qry.helpers.test.ts +0 -80
  116. package/hooks/use-campaign-generation-recovery.ts +0 -53
  117. package/hooks/use-campaign-mtn.ts +0 -436
  118. package/hooks/use-campaign-qry.helpers.ts +0 -40
  119. package/hooks/use-campaign-qry.ts +0 -834
  120. package/hooks/use-emailCampaignReplyReport-qry.ts +0 -27
  121. package/hooks/use-fieldDoc-qry.helpers.test.ts +0 -65
  122. package/hooks/use-publicFormEmail-mtn.ts +0 -27
  123. package/libs/fragment-recovery.test.ts +0 -326
  124. package/libs/fragment-recovery.ts +0 -325
  125. package/libs/orchestrator-realtime.helpers.test.ts +0 -229
  126. package/libs/orchestrator-realtime.helpers.ts +0 -317
  127. package/libs/orchestrator-realtime.ts +0 -433
  128. package/libs/request-cache-regression.test.ts +0 -122
  129. package/libs/request-managed-session.test.ts +0 -574
  130. package/libs/request-no-store.test.ts +0 -419
  131. package/libs/sheet-view-realtime-router.test.ts +0 -214
  132. package/libs/sse-ticket.test.ts +0 -26
  133. package/loaders/campaign.test.ts +0 -186
  134. package/loaders/campaign.ts +0 -110
  135. package/tests/agent-note-detail-cache.test.ts +0 -120
  136. package/tests/agent-note-search.test.ts +0 -444
  137. package/tsconfig.json +0 -13
@@ -0,0 +1,112 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ libraryFolderFragment,
4
+ libraryFileAnalysisFragment,
5
+ libraryFileCitationFragment,
6
+ libraryFileContentFragment,
7
+ libraryFileNoteFragment,
8
+ libraryFileObjectFragment,
9
+ libraryFileFragment,
10
+ } from '../fragments/libraryFragments.ts';
11
+ import { live } from '../reactivity.ts';
12
+
13
+ // The variable is named libraryFileId, the idKey of DATA_TYPES.libraryFile, so a change of this file matches it by scope.
14
+ export const libraryFileQry = live(
15
+ gql`
16
+ query libraryFile ($libraryFileId: GenericID!) {
17
+ libraryFile (id: $libraryFileId) {
18
+ ...libraryFileFragment
19
+ }
20
+ }
21
+ ${libraryFileFragment}
22
+ `,
23
+ { refresh: 'auto' },
24
+ );
25
+
26
+ // Keep the variable named libraryFileId: it is the scope key of the server's `touched` libraryFileContent change, which
27
+ // a new brief, text or note sends.
28
+ export const libraryFileContentQry = live(
29
+ gql`
30
+ query libraryFileContent ($libraryFileId: GenericID!) {
31
+ libraryFileContent (libraryFileId: $libraryFileId) {
32
+ ...libraryFileContentFragment
33
+ }
34
+ libraryFileObjects (libraryFileId: $libraryFileId) {
35
+ ...libraryFileObjectFragment
36
+ }
37
+ }
38
+ ${libraryFileContentFragment}
39
+ ${libraryFileObjectFragment}
40
+ `,
41
+ { refresh: 'auto', derived: ['libraryFileContent'] },
42
+ );
43
+
44
+ /* Analysis completion touches libraryFileContent for this file. */
45
+ export const libraryFileBriefQry = live(
46
+ gql`
47
+ query libraryFileBrief ($libraryFileId: GenericID!) {
48
+ libraryFileAnalysis (libraryFileId: $libraryFileId) {
49
+ ...libraryFileAnalysisFragment
50
+ }
51
+ libraryFileObjects (libraryFileId: $libraryFileId) {
52
+ ...libraryFileObjectFragment
53
+ }
54
+ }
55
+ ${libraryFileAnalysisFragment}
56
+ ${libraryFileObjectFragment}
57
+ `,
58
+ { refresh: 'auto', derived: ['libraryFileContent'] },
59
+ );
60
+
61
+ /*
62
+ * A new brief, text or note touches libraryFileContent for this file, so an open citation refetches; after a
63
+ * reanalysis it returns current: false.
64
+ */
65
+ export const libraryFileCitationQry = live(
66
+ gql`
67
+ query libraryFileCitation ($libraryFileId: GenericID!, $analysisId: String!, $ref: Int!, $start: Int, $end: Int) {
68
+ libraryFileCitation (libraryFileId: $libraryFileId, analysisId: $analysisId, ref: $ref, start: $start, end: $end) {
69
+ ...libraryFileCitationFragment
70
+ }
71
+ }
72
+ ${libraryFileCitationFragment}
73
+ `,
74
+ { refresh: 'auto', derived: ['libraryFileContent'] },
75
+ );
76
+
77
+ /* A note write, with the retention that prunes the oldest notes, touches libraryFileContent for this file. */
78
+ export const libraryFileNotesQry = live(
79
+ gql`
80
+ query libraryFileNotes ($libraryFileId: GenericID!) {
81
+ libraryFileNotes (libraryFileId: $libraryFileId) {
82
+ ...libraryFileNoteFragment
83
+ }
84
+ }
85
+ ${libraryFileNoteFragment}
86
+ `,
87
+ { refresh: 'auto', derived: ['libraryFileContent'] },
88
+ );
89
+
90
+ export const libraryFilesQry = live(
91
+ gql`
92
+ query libraryFiles ($organizationId: GenericID!, $filter: LibraryFilesFilter, $cursor: Cursor, $limit: Int!) {
93
+ libraryFiles (organizationId: $organizationId, filter: $filter, cursor: $cursor, limit: $limit) {
94
+ ...libraryFileFragment
95
+ }
96
+ }
97
+ ${libraryFileFragment}
98
+ `,
99
+ { refresh: 'auto', lists: ['libraryFile'] },
100
+ );
101
+
102
+ export const libraryFoldersQry = live(
103
+ gql`
104
+ query libraryFolders ($organizationId: GenericID!) {
105
+ libraryFolders (organizationId: $organizationId) {
106
+ ...libraryFolderFragment
107
+ }
108
+ }
109
+ ${libraryFolderFragment}
110
+ `,
111
+ { refresh: 'auto', derived: ['libraryFolder'] },
112
+ );
@@ -7,6 +7,7 @@ import {
7
7
  logRevisionSummaryFragment,
8
8
  } from '../fragments/logFragments.ts';
9
9
  import { storageFileFragment } from '../fragments/storageFragments.ts';
10
+ import { live } from '../reactivity.ts';
10
11
 
11
12
  export const logEntryFragmentStatement = `...logEntryFragment
12
13
 
@@ -24,7 +25,8 @@ ${logEntryFragment}
24
25
  ${logEntryDetailsFragment}
25
26
  `;
26
27
 
27
- export const logEntryQry = gql`
28
+ export const logEntryQry = live(
29
+ gql`
28
30
  query logEntry (
29
31
  $organizationId: GenericID!
30
32
  $logEntryId: GenericID!
@@ -43,9 +45,12 @@ query logEntry (
43
45
 
44
46
  ${storageFileFragment}
45
47
  ${logEntryFragmentImports}
46
- `;
48
+ `,
49
+ { refresh: 'auto' },
50
+ );
47
51
 
48
- export const logEntriesQry = gql`
52
+ export const logEntriesQry = live(
53
+ gql`
49
54
  query logEntries (
50
55
  $organizationId: GenericID!
51
56
  $filter: LogEntriesFilter!
@@ -72,10 +77,13 @@ query logEntries (
72
77
 
73
78
  ${storageFileFragment}
74
79
  ${logEntryFragmentImports}
75
- `;
80
+ `,
81
+ { refresh: 'notice', lists: ['logEntry'] },
82
+ );
76
83
 
77
84
  // Lives beside logEntryFragmentStatement so the document page's logs share the log list's shape
78
- export const fieldDocSubmissionLogsQry = gql`
85
+ export const fieldDocSubmissionLogsQry = live(
86
+ gql`
79
87
  query fieldDocSubmissionLogs (
80
88
  $fieldDocSubmissionId: GenericID!
81
89
  ) {
@@ -92,9 +100,12 @@ query fieldDocSubmissionLogs (
92
100
 
93
101
  ${storageFileFragment}
94
102
  ${logEntryFragmentImports}
95
- `;
103
+ `,
104
+ { refresh: 'auto', derived: ['fieldDocSubmissionLog'] },
105
+ );
96
106
 
97
- export const logRevisionsQry = gql`
107
+ export const logRevisionsQry = live(
108
+ gql`
98
109
  query logRevisions (
99
110
  $organizationId: GenericID!
100
111
  $logEntryId: GenericID!
@@ -114,9 +125,12 @@ query logRevisions (
114
125
  }
115
126
 
116
127
  ${logRevisionSummaryFragment}
117
- `;
128
+ `,
129
+ { refresh: 'auto' },
130
+ );
118
131
 
119
- export const logRevisionQry = gql`
132
+ export const logRevisionQry = live(
133
+ gql`
120
134
  query logRevision (
121
135
  $organizationId: GenericID!
122
136
  $revisionId: GenericID!
@@ -130,9 +144,12 @@ query logRevision (
130
144
  }
131
145
 
132
146
  ${logRevisionFragment}
133
- `;
147
+ `,
148
+ { refresh: 'auto' },
149
+ );
134
150
 
135
- export const logRevisionProofDownloadUrlQry = gql`
151
+ export const logRevisionProofDownloadUrlQry = live(
152
+ gql`
136
153
  query logRevisionProofDownloadUrl (
137
154
  $organizationId: GenericID!
138
155
  $revisionId: GenericID!
@@ -148,4 +165,6 @@ query logRevisionProofDownloadUrl (
148
165
  hash
149
166
  }
150
167
  }
151
- `;
168
+ `,
169
+ { refresh: 'auto' },
170
+ );
@@ -11,6 +11,7 @@ import {
11
11
  } from '../fragments/organizationFragments.ts';
12
12
  import { emailFragment, phoneFragment } from '../fragments/otherFragments.ts';
13
13
  import { storageFileFragment } from '../fragments/storageFragments.ts';
14
+ import { live } from '../reactivity.ts';
14
15
 
15
16
  // Always use organizationRelationship() instead
16
17
 
@@ -28,7 +29,8 @@ import { storageFileFragment } from '../fragments/storageFragments.ts';
28
29
  // ${organizationFragment}
29
30
  // `;
30
31
 
31
- export const organizationRelationshipQry = gql`
32
+ export const organizationRelationshipQry = live(
33
+ gql`
32
34
  query organizationRelationship (
33
35
  $organizationId: GenericID!
34
36
  ) {
@@ -56,9 +58,12 @@ ${organizationFragment}
56
58
  ${organizationComplianceFragment}
57
59
  ${organizationRelationshipFragment}
58
60
  ${storageFileFragment}
59
- `;
61
+ `,
62
+ { refresh: 'auto' },
63
+ );
60
64
 
61
- export const myOrganizationsQry = gql`
65
+ export const myOrganizationsQry = live(
66
+ gql`
62
67
  query myOrganizations {
63
68
  myOrganizations {
64
69
  ...organizationRelationshipFragment
@@ -129,9 +134,12 @@ ${organizationComplianceFragment}
129
134
  ${organizationRelationshipFragment}
130
135
  ${integrationConnectionFragment}
131
136
  ${storageFileFragment}
132
- `;
137
+ `,
138
+ { refresh: 'auto', lists: ['integrationConnection'], derived: ['accountOrganizations'] },
139
+ );
133
140
 
134
- export const childOrganizationsQry = gql`
141
+ export const childOrganizationsQry = live(
142
+ gql`
135
143
  query childOrganizations (
136
144
  $organizationId: GenericID!
137
145
  $filter: ChildOrgsFilter
@@ -167,9 +175,12 @@ ${organizationChildFragment}
167
175
  ${organizationFragment}
168
176
  ${organizationComplianceFragment}
169
177
  ${storageFileFragment}
170
- `;
178
+ `,
179
+ { refresh: 'auto', lists: ['organizationChild'] },
180
+ );
171
181
 
172
- export const organizationMembersQry = gql`
182
+ export const organizationMembersQry = live(
183
+ gql`
173
184
  query organizationMembers (
174
185
  $organizationId: GenericID!
175
186
  $showGuests: Boolean
@@ -198,9 +209,12 @@ ${organizationRelationshipFragment}
198
209
  ${accountFragment}
199
210
  ${emailFragment}
200
211
  ${phoneFragment}
201
- `;
212
+ `,
213
+ { refresh: 'auto', lists: ['organizationRelationship'] },
214
+ );
202
215
 
203
- export const organizationSitesQry = gql`
216
+ export const organizationSitesQry = live(
217
+ gql`
204
218
  query organizationSites (
205
219
  $organizationId: GenericID!
206
220
  $parentId: GenericID!
@@ -214,9 +228,12 @@ query organizationSites (
214
228
  }
215
229
 
216
230
  ${organizationSiteFragment}
217
- `;
231
+ `,
232
+ { refresh: 'auto', lists: ['organizationSite'] },
233
+ );
218
234
 
219
- export const pageRoutesQry = gql`
235
+ export const pageRoutesQry = live(
236
+ gql`
220
237
  query pageRoutes (
221
238
  $organizationId: GenericID!
222
239
  ) {
@@ -228,4 +245,6 @@ query pageRoutes (
228
245
  }
229
246
 
230
247
  ${orgPageRouteFragment}
231
- `;
248
+ `,
249
+ { refresh: 'auto', derived: ['pageRoute'] },
250
+ );
@@ -1,20 +1,27 @@
1
1
  import { gql } from 'graphql-tag';
2
2
  import { qrCodeFragment } from '../fragments/qrCodeFragments.ts';
3
+ import { live } from '../reactivity.ts';
3
4
 
4
- export const qrCodeQry = gql`
5
+ export const qrCodeQry = live(
6
+ gql`
5
7
  query qrCode($organizationId: GenericID!, $qrCodeId: GenericID, $publicId: String) {
6
8
  qrCode(organizationId: $organizationId, qrCodeId: $qrCodeId, publicId: $publicId) {
7
9
  ...qrCodeFragment
8
10
  }
9
11
  }
10
12
  ${qrCodeFragment}
11
- `;
13
+ `,
14
+ { refresh: 'auto' },
15
+ );
12
16
 
13
- export const qrCodesQry = gql`
17
+ export const qrCodesQry = live(
18
+ gql`
14
19
  query qrCodes($organizationId: GenericID!, $filter: QrCodesFilter, $cursor: Cursor, $limit: Int = 50) {
15
20
  qrCodes(organizationId: $organizationId, filter: $filter, cursor: $cursor, limit: $limit) {
16
21
  ...qrCodeFragment
17
22
  }
18
23
  }
19
24
  ${qrCodeFragment}
20
- `;
25
+ `,
26
+ { refresh: 'auto', lists: ['qrCode'] },
27
+ );