@jsb188/graphql 1.1.8 → 1.1.11

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 (122) hide show
  1. package/cache/config.ts +66 -42
  2. package/cache/index.test.ts +881 -0
  3. package/cache/index.ts +1815 -979
  4. package/cache/persist.ts +721 -0
  5. package/cache/store.ts +437 -0
  6. package/client/data-table-realtime-subscriptions.test.ts +740 -0
  7. package/client/data-table-realtime-subscriptions.ts +955 -0
  8. package/client/data-table-realtime.test.ts +792 -0
  9. package/client/data-table-realtime.ts +1218 -0
  10. package/client/fragment-realtime-sequence.ts +52 -0
  11. package/client/index.ts +4 -2
  12. package/client/open-sheet.ts +137 -0
  13. package/client/request-managed-session.test.ts +574 -0
  14. package/client/request-no-store.test.ts +157 -0
  15. package/client/request.ts +973 -143
  16. package/client/sse-ticket.test.ts +26 -0
  17. package/deno.lock +170 -0
  18. package/deno.test.json +10 -0
  19. package/drafts/index.ts +149 -0
  20. package/drafts/store.ts +397 -0
  21. package/gql/eagerQueryMap.ts +12 -0
  22. package/gql/fragments/accountAuthFragments.ts +5 -0
  23. package/gql/fragments/accountFragments.ts +1 -3
  24. package/gql/fragments/accountSessionFragments.ts +16 -0
  25. package/gql/fragments/agentDocFragments.ts +46 -0
  26. package/gql/fragments/agentMemoryFragments.ts +19 -0
  27. package/gql/fragments/aiChatFragments.ts +17 -0
  28. package/gql/fragments/billingFragments.ts +0 -11
  29. package/gql/fragments/campaignFragments.ts +277 -0
  30. package/gql/fragments/dataTableFragments.ts +102 -0
  31. package/gql/fragments/emailFragments.ts +36 -0
  32. package/gql/fragments/fieldDocFragments.ts +82 -0
  33. package/gql/fragments/inboundContactFragments.ts +15 -0
  34. package/gql/fragments/integrationFragments.ts +22 -0
  35. package/gql/fragments/logFragments.ts +33 -64
  36. package/gql/fragments/organizationFragments.ts +94 -21
  37. package/gql/fragments/scheduleFragments.ts +155 -0
  38. package/gql/fragments/sheetFragments.ts +675 -0
  39. package/gql/fragments/storageFragments.ts +21 -1
  40. package/gql/fragments/workflowFragments.ts +67 -0
  41. package/gql/mutations/accountMutations.ts +24 -4
  42. package/gql/mutations/agentDocMutations.ts +177 -0
  43. package/gql/mutations/agentMemoryMutations.ts +36 -0
  44. package/gql/mutations/aiChatMutations.ts +43 -3
  45. package/gql/mutations/authMutations.ts +160 -19
  46. package/gql/mutations/campaignMutations.ts +215 -0
  47. package/gql/mutations/dataTableMutations.ts +106 -0
  48. package/gql/mutations/fieldDocMutations.ts +24 -0
  49. package/gql/mutations/inboundContactMutations.ts +24 -0
  50. package/gql/mutations/index.ts +17 -8
  51. package/gql/mutations/integrationMutations.ts +25 -0
  52. package/gql/mutations/logMutations.ts +10 -19
  53. package/gql/mutations/organizationMutations.ts +160 -2
  54. package/gql/mutations/scheduleMutations.ts +423 -0
  55. package/gql/mutations/sheetMutations.ts +385 -0
  56. package/gql/mutations/storageMutations.ts +21 -2
  57. package/gql/mutations/workflowMutations.ts +42 -0
  58. package/gql/queries/agentDocQueries.ts +120 -0
  59. package/gql/queries/agentMemoryQueries.ts +22 -0
  60. package/gql/queries/aiChatQueries.ts +18 -2
  61. package/gql/queries/authQueries.ts +41 -0
  62. package/gql/queries/billingQueries.ts +24 -1
  63. package/gql/queries/campaignQueries.ts +127 -0
  64. package/gql/queries/dataTableQueries.ts +134 -0
  65. package/gql/queries/emailQueries.ts +96 -0
  66. package/gql/queries/fieldDocQueries.ts +158 -0
  67. package/gql/queries/inboundContactQueries.ts +40 -0
  68. package/gql/queries/index.ts +17 -6
  69. package/gql/queries/logQueries.ts +42 -32
  70. package/gql/queries/organizationQueries.ts +113 -8
  71. package/gql/queries/scheduleQueries.ts +315 -0
  72. package/gql/queries/sheetQueries.ts +383 -0
  73. package/gql/queries/storageQueries.ts +38 -0
  74. package/gql/queries/workflowQueries.ts +99 -0
  75. package/hooks/index.ts +2104 -860
  76. package/hooks/use-account-mtn.ts +91 -48
  77. package/hooks/use-agentDoc-mtn.ts +285 -0
  78. package/hooks/use-agentDoc-qry.ts +208 -0
  79. package/hooks/use-agentMemory-mtn.ts +73 -0
  80. package/hooks/use-agentMemory-qry.ts +44 -0
  81. package/hooks/use-aiChat-mtn.ts +248 -97
  82. package/hooks/use-aiChat-qry.ts +501 -191
  83. package/hooks/use-app-qry.ts +14 -11
  84. package/hooks/use-auth-mtn.ts +410 -256
  85. package/hooks/use-auth-qry.ts +51 -0
  86. package/hooks/use-campaign-mtn.ts +377 -0
  87. package/hooks/use-campaign-qry.ts +257 -0
  88. package/hooks/use-dataTable-mtn.ts +170 -0
  89. package/hooks/use-dataTable-qry.ts +996 -0
  90. package/hooks/use-email-qry.ts +227 -0
  91. package/hooks/use-fieldDoc-mtn.ts +50 -0
  92. package/hooks/use-fieldDoc-qry.ts +180 -0
  93. package/hooks/use-inboundContact-mtn.ts +34 -0
  94. package/hooks/use-inboundContact-qry.ts +96 -0
  95. package/hooks/use-integration-mtn.ts +77 -0
  96. package/hooks/use-integration-qry.ts +30 -0
  97. package/hooks/use-log-mtn.ts +77 -61
  98. package/hooks/use-log-qry.ts +99 -72
  99. package/hooks/use-organization-mtn.ts +409 -80
  100. package/hooks/use-organization-qry.ts +211 -92
  101. package/hooks/use-schedule-mtn.ts +416 -0
  102. package/hooks/use-schedule-qry.ts +157 -0
  103. package/hooks/use-sheet-mtn.ts +367 -0
  104. package/hooks/use-sheet-qry.ts +440 -0
  105. package/hooks/use-storage-mtn.ts +83 -42
  106. package/hooks/use-storage-qry.ts +104 -13
  107. package/hooks/use-workflow-mtn.ts +55 -0
  108. package/hooks/use-workflow-qry.ts +230 -0
  109. package/loaders/campaign.ts +137 -0
  110. package/package.json +94 -52
  111. package/sse.ts +158 -105
  112. package/tsconfig.json +13 -0
  113. package/types.d.ts +60 -29
  114. package/utils.ts +77 -50
  115. package/gql/fragments/actionFragments.ts +0 -16
  116. package/gql/fragments/productFragments.ts +0 -63
  117. package/gql/fragments/reportFragments.ts +0 -48
  118. package/gql/mutations/billingMutations.ts +0 -34
  119. package/gql/queries/productQueries.ts +0 -70
  120. package/gql/queries/reportQueries.ts +0 -66
  121. package/hooks/use-product-qry.ts +0 -109
  122. package/hooks/use-report-qry.ts +0 -69
@@ -0,0 +1,385 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ sheetCellFragment,
4
+ sheetCommandResultFragment,
5
+ sheetFragment,
6
+ sheetRangeFragment,
7
+ sheetRegionFragment,
8
+ sheetTabFragment,
9
+ sheetViewPatchFragment,
10
+ } from '../fragments/sheetFragments.ts';
11
+
12
+ export const createSheetMtn = gql`
13
+ mutation createSheet (
14
+ $organizationId: GenericID!
15
+ $title: String!
16
+ $name: String
17
+ $description: String
18
+ $position: Float
19
+ ) {
20
+ createSheet (
21
+ organizationId: $organizationId
22
+ title: $title
23
+ name: $name
24
+ description: $description
25
+ position: $position
26
+ )
27
+ }
28
+ `;
29
+
30
+ export const updateSheetMtn = gql`
31
+ mutation updateSheet (
32
+ $organizationId: GenericID!
33
+ $sheetId: GenericID!
34
+ $title: String
35
+ $name: String
36
+ $description: String
37
+ $position: Float
38
+ ) {
39
+ updateSheet (
40
+ organizationId: $organizationId
41
+ sheetId: $sheetId
42
+ title: $title
43
+ name: $name
44
+ description: $description
45
+ position: $position
46
+ ) {
47
+ ...sheetFragment
48
+ }
49
+ }
50
+
51
+ ${sheetFragment}
52
+ `;
53
+
54
+ export const deleteSheetMtn = gql`
55
+ mutation deleteSheet (
56
+ $organizationId: GenericID!
57
+ $sheetId: GenericID!
58
+ ) {
59
+ deleteSheet (
60
+ organizationId: $organizationId
61
+ sheetId: $sheetId
62
+ )
63
+ }
64
+ `;
65
+
66
+ export const updateSheetAccessMtn = gql`
67
+ mutation updateSheetAccess (
68
+ $organizationId: GenericID!
69
+ $sheetId: GenericID!
70
+ $access: DocAccessInput!
71
+ ) {
72
+ updateSheetAccess (
73
+ organizationId: $organizationId
74
+ sheetId: $sheetId
75
+ access: $access
76
+ ) {
77
+ ...sheetFragment
78
+ }
79
+ }
80
+
81
+ ${sheetFragment}
82
+ `;
83
+
84
+ export const createSheetTabMtn = gql`
85
+ mutation createSheetTab (
86
+ $organizationId: GenericID!
87
+ $sheetId: GenericID!
88
+ ) {
89
+ createSheetTab (
90
+ organizationId: $organizationId
91
+ sheetId: $sheetId
92
+ ) {
93
+ ...sheetFragment
94
+
95
+ tabs {
96
+ ...sheetTabFragment
97
+ }
98
+ }
99
+ }
100
+
101
+ ${sheetFragment}
102
+ ${sheetTabFragment}
103
+ `;
104
+
105
+ export const importSheetFromFileMtn = gql`
106
+ mutation importSheetFromFile (
107
+ $organizationId: GenericID!
108
+ $fileUri: String!
109
+ $mode: SheetImportMode!
110
+ $sheetId: GenericID
111
+ $title: String
112
+ ) {
113
+ importSheetFromFile (
114
+ organizationId: $organizationId
115
+ fileUri: $fileUri
116
+ mode: $mode
117
+ sheetId: $sheetId
118
+ title: $title
119
+ ) {
120
+ id
121
+ status
122
+ mode
123
+ sheetId
124
+ errorCode
125
+ uncomputedFormulaCells
126
+ }
127
+ }
128
+ `;
129
+
130
+ export const exportSheetToFileMtn = gql`
131
+ mutation exportSheetToFile (
132
+ $organizationId: GenericID!
133
+ $sheetId: GenericID!
134
+ $sheetTabId: GenericID
135
+ $format: SheetExportFormat!
136
+ ) {
137
+ exportSheetToFile (
138
+ organizationId: $organizationId
139
+ sheetId: $sheetId
140
+ sheetTabId: $sheetTabId
141
+ format: $format
142
+ ) {
143
+ fileUri
144
+ name
145
+ contentType
146
+ size
147
+ }
148
+ }
149
+ `;
150
+
151
+ export const updateSheetTabMtn = gql`
152
+ mutation updateSheetTab (
153
+ $organizationId: GenericID!
154
+ $sheetId: GenericID!
155
+ $sheetTabId: GenericID!
156
+ $name: String
157
+ $commandId: String
158
+ $sessionId: String
159
+ ) {
160
+ updateSheetTab (
161
+ organizationId: $organizationId
162
+ sheetId: $sheetId
163
+ sheetTabId: $sheetTabId
164
+ name: $name
165
+ commandId: $commandId
166
+ sessionId: $sessionId
167
+ ) {
168
+ ...sheetTabFragment
169
+ }
170
+ }
171
+
172
+ ${sheetTabFragment}
173
+ `;
174
+
175
+ export const reorderSheetTabsMtn = gql`
176
+ mutation reorderSheetTabs (
177
+ $organizationId: GenericID!
178
+ $sheetId: GenericID!
179
+ $positions: [SheetTabPositionInput!]!
180
+ $commandId: String
181
+ $sessionId: String
182
+ ) {
183
+ reorderSheetTabs (
184
+ organizationId: $organizationId
185
+ sheetId: $sheetId
186
+ positions: $positions
187
+ commandId: $commandId
188
+ sessionId: $sessionId
189
+ ) {
190
+ ...sheetFragment
191
+
192
+ tabs {
193
+ ...sheetTabFragment
194
+ }
195
+ }
196
+ }
197
+
198
+ ${sheetFragment}
199
+ ${sheetTabFragment}
200
+ `;
201
+
202
+ export const deleteSheetTabMtn = gql`
203
+ mutation deleteSheetTab (
204
+ $organizationId: GenericID!
205
+ $sheetId: GenericID!
206
+ $sheetTabId: GenericID!
207
+ ) {
208
+ deleteSheetTab (
209
+ organizationId: $organizationId
210
+ sheetId: $sheetId
211
+ sheetTabId: $sheetTabId
212
+ )
213
+ }
214
+ `;
215
+
216
+ export const editSheetRegionCommandMtn = gql`
217
+ mutation editSheetRegionCommand (
218
+ $organizationId: GenericID!
219
+ $sheetId: GenericID!
220
+ $sheetTabId: GenericID!
221
+ $operation: SheetRegionCommandOperation!
222
+ $regionId: GenericID
223
+ $region: SheetRegionInput
224
+ $commandId: String!
225
+ $sessionId: String!
226
+ $sourceClientId: String
227
+ $baseRevision: BigInt!
228
+ $baseDesignRevision: BigInt!
229
+ $includeInOperationalHistory: Boolean
230
+ ) {
231
+ editSheetRegionCommand (
232
+ organizationId: $organizationId
233
+ sheetId: $sheetId
234
+ sheetTabId: $sheetTabId
235
+ operation: $operation
236
+ regionId: $regionId
237
+ region: $region
238
+ commandId: $commandId
239
+ sessionId: $sessionId
240
+ sourceClientId: $sourceClientId
241
+ baseRevision: $baseRevision
242
+ baseDesignRevision: $baseDesignRevision
243
+ includeInOperationalHistory: $includeInOperationalHistory
244
+ ) {
245
+ ...sheetCommandResultFragment
246
+
247
+ affectedTabs {
248
+ ...sheetTabFragment
249
+ }
250
+ }
251
+ }
252
+
253
+ ${sheetCommandResultFragment}
254
+ ${sheetCellFragment}
255
+ ${sheetTabFragment}
256
+ `;
257
+
258
+ export const editSheetCommandBatchMtn = gql`
259
+ mutation editSheetCommandBatch (
260
+ $organizationId: GenericID!
261
+ $sheetId: GenericID!
262
+ $envelopeId: String!
263
+ $sourceClientId: String!
264
+ $previewSeq: BigInt!
265
+ $commands: [SheetCommandBatchItemInput!]!
266
+ ) {
267
+ editSheetCommandBatch (
268
+ organizationId: $organizationId
269
+ sheetId: $sheetId
270
+ envelopeId: $envelopeId
271
+ sourceClientId: $sourceClientId
272
+ previewSeq: $previewSeq
273
+ commands: $commands
274
+ ) {
275
+ actorAccountId
276
+ envelopeId
277
+ sourceClientId
278
+ committedPreviewSeq
279
+ previewAuthorities {
280
+ clientId
281
+ envelopeId
282
+ previewSeq
283
+ serverSeq
284
+ sheetTabId
285
+ targetKeys
286
+ }
287
+
288
+ settlements {
289
+ commandId
290
+ errorCode
291
+
292
+ result {
293
+ commandId
294
+ commandStatus
295
+ replayed
296
+ requiresSnapshot
297
+ axisMoveOps {
298
+ schemaVersion
299
+ commandId
300
+ sheetTabId
301
+ axis
302
+ sourceStartIndex
303
+ sourceEndIndex
304
+ targetStartIndex
305
+ baseRevision
306
+ resultRevision
307
+ baseDesignRevision
308
+ resultDesignRevision
309
+ }
310
+
311
+ tabRevisions {
312
+ sheetTabId
313
+ baseRevision
314
+ resultRevision
315
+ baseDesignRevision
316
+ resultDesignRevision
317
+ journalFromSeq
318
+ journalToSeq
319
+ }
320
+
321
+ conflict {
322
+ code
323
+ message
324
+ historyBoundary
325
+ invalidatesTargetCommandId
326
+ targetType
327
+ targetKey
328
+ }
329
+ }
330
+ }
331
+
332
+ authoritativePatches {
333
+ ...sheetViewPatchFragment
334
+ }
335
+ }
336
+ }
337
+
338
+ ${sheetViewPatchFragment}
339
+ ${sheetCellFragment}
340
+ ${sheetRangeFragment}
341
+ ${sheetRegionFragment}
342
+ ${sheetTabFragment}
343
+ `;
344
+
345
+ export const editSheetStructureCommandMtn = gql`
346
+ mutation editSheetStructureCommand (
347
+ $organizationId: GenericID!
348
+ $sheetId: GenericID!
349
+ $sheetTabId: GenericID!
350
+ $operation: SheetStructureOperation!
351
+ $index: Int!
352
+ $confirmDestructive: Boolean!
353
+ $commandId: String!
354
+ $sessionId: String!
355
+ $sourceClientId: String
356
+ $baseRevision: BigInt!
357
+ $baseDesignRevision: BigInt!
358
+ $includeInOperationalHistory: Boolean
359
+ ) {
360
+ editSheetStructureCommand (
361
+ organizationId: $organizationId
362
+ sheetId: $sheetId
363
+ sheetTabId: $sheetTabId
364
+ operation: $operation
365
+ index: $index
366
+ confirmDestructive: $confirmDestructive
367
+ commandId: $commandId
368
+ sessionId: $sessionId
369
+ sourceClientId: $sourceClientId
370
+ baseRevision: $baseRevision
371
+ baseDesignRevision: $baseDesignRevision
372
+ includeInOperationalHistory: $includeInOperationalHistory
373
+ ) {
374
+ ...sheetCommandResultFragment
375
+
376
+ affectedTabs {
377
+ ...sheetTabFragment
378
+ }
379
+ }
380
+ }
381
+
382
+ ${sheetCommandResultFragment}
383
+ ${sheetCellFragment}
384
+ ${sheetTabFragment}
385
+ `;
@@ -2,23 +2,26 @@ import { gql } from 'graphql-tag';
2
2
 
3
3
  export const createSignedUploadUrlMtn = gql`
4
4
  mutation createSignedUploadUrl (
5
- $temporaryId: String!
6
5
  $organizationId: GenericID!
7
6
  $fileName: String!
8
7
  $contentType: String!
9
8
  $fileSize: Int!
10
9
  $uploadIntent: StorageIntentObject!
10
+ $moderationToken: String
11
11
  ) {
12
12
  createSignedUploadUrl (
13
- temporaryId: $temporaryId
14
13
  organizationId: $organizationId
15
14
  fileName: $fileName
16
15
  contentType: $contentType
17
16
  fileSize: $fileSize
18
17
  uploadIntent: $uploadIntent
18
+ moderationToken: $moderationToken
19
19
  ) {
20
+ id
20
21
  signedUrl
21
22
  fileUri
23
+ contentCrc32c
24
+ contentSha256
22
25
  }
23
26
  }
24
27
  `;
@@ -34,3 +37,19 @@ mutation deleteStorageFile (
34
37
  )
35
38
  }
36
39
  `;
40
+
41
+ export const createGeneratedFileDownloadLinkMtn = gql`
42
+ mutation createGeneratedFileDownloadLink (
43
+ $organizationId: GenericID!
44
+ $code: String!
45
+ ) {
46
+ createGeneratedFileDownloadLink (
47
+ organizationId: $organizationId
48
+ code: $code
49
+ ) {
50
+ url
51
+ expiresAt
52
+ isPublic
53
+ }
54
+ }
55
+ `;
@@ -0,0 +1,42 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { workflowFragment } from '../fragments/workflowFragments.ts';
3
+
4
+ export const cancelReminderMtn = gql`
5
+ mutation cancelReminder (
6
+ $organizationId: GenericID!
7
+ $workflowId: GenericID!
8
+ ) {
9
+ cancelReminder (
10
+ organizationId: $organizationId
11
+ workflowId: $workflowId
12
+ ) {
13
+ ...workflowFragment
14
+ }
15
+ }
16
+
17
+ ${workflowFragment}
18
+ `;
19
+
20
+ export const updateReminderMtn = gql`
21
+ mutation updateReminder (
22
+ $organizationId: GenericID!
23
+ $workflowId: GenericID!
24
+ $title: String
25
+ $schedule: String
26
+ $scheduleInterval: Int
27
+ $nextAt: DateTime
28
+ ) {
29
+ updateReminder (
30
+ organizationId: $organizationId
31
+ workflowId: $workflowId
32
+ title: $title
33
+ schedule: $schedule
34
+ scheduleInterval: $scheduleInterval
35
+ nextAt: $nextAt
36
+ ) {
37
+ ...workflowFragment
38
+ }
39
+ }
40
+
41
+ ${workflowFragment}
42
+ `;
@@ -0,0 +1,120 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { agentDocFragment } from '../fragments/agentDocFragments.ts';
3
+
4
+ export const agentDocMetadataQry = gql`
5
+ query agentDocMetadata (
6
+ $agentDocId: GenericID!
7
+ ) {
8
+ agentDoc (
9
+ agentDocId: $agentDocId
10
+ ) {
11
+ id
12
+ title
13
+ }
14
+ }
15
+ `;
16
+
17
+ // NOTE: viewerPermission and viewerCanEditAccess are per-viewer facts
18
+ // resolved by the server for the requesting account. They are selected
19
+ // outside agentDocFragment because realtime emits never carry them, and the
20
+ // fragment must stay aligned with the server's emit field list.
21
+ // The query takes no organizationId: the server resolves the owner org from
22
+ // the agent doc row (openSheet-style contract), so network-org members and
23
+ // grant holders outside the owner org can open a shared agent doc.
24
+
25
+ export const agentDocQry = gql`
26
+ query agentDoc (
27
+ $agentDocId: GenericID!
28
+ ) {
29
+ agentDoc (
30
+ agentDocId: $agentDocId
31
+ ) {
32
+ ...agentDocFragment
33
+
34
+ viewerPermission
35
+ viewerCanEditAccess
36
+ }
37
+ }
38
+
39
+ ${agentDocFragment}
40
+ `;
41
+
42
+ // NOTE: The list selection intentionally excludes content and files: the
43
+ // list screen only needs row metadata, and merging a content-free selection
44
+ // through the normalized cache must not clobber a full agentDoc fragment,
45
+ // so the heavy fields are simply never selected here.
46
+
47
+ export const agentDocsQry = gql`
48
+ query agentDocs (
49
+ $organizationId: GenericID!
50
+ $folderId: GenericID
51
+ $sort: GridItemSort
52
+ $cursor: Cursor
53
+ $after: Boolean!
54
+ $limit: Int!
55
+ ) {
56
+ agentDocs (
57
+ organizationId: $organizationId
58
+ folderId: $folderId
59
+ sort: $sort
60
+ cursor: $cursor
61
+ after: $after
62
+ limit: $limit
63
+ ) {
64
+ id
65
+ organizationId
66
+ folderId
67
+ title
68
+
69
+ settings {
70
+ aiCannotEdit
71
+ aiCannotRead
72
+ pinned
73
+ hiddenSurfaces
74
+ reviewBy
75
+ }
76
+
77
+ position
78
+ deletedAt
79
+ createdAt
80
+ updatedAt
81
+ }
82
+ }
83
+ `;
84
+
85
+ export const agentDocFoldersQry = gql`
86
+ query agentDocFolders (
87
+ $organizationId: GenericID!
88
+ ) {
89
+ agentDocFolders (
90
+ organizationId: $organizationId
91
+ ) {
92
+ id
93
+ organizationId
94
+ name
95
+ position
96
+ createdAt
97
+ updatedAt
98
+ }
99
+ }
100
+ `;
101
+
102
+ // NOTE: agentDocAccessGrants is owner-org only: the access settings screen
103
+ // loads the grants list with it, on top of the base policy carried by the
104
+ // AgentDoc fragment's "access" selection.
105
+
106
+ export const agentDocAccessGrantsQry = gql`
107
+ query agentDocAccessGrants (
108
+ $organizationId: GenericID!
109
+ $agentDocId: GenericID!
110
+ ) {
111
+ agentDocAccessGrants (
112
+ organizationId: $organizationId
113
+ agentDocId: $agentDocId
114
+ ) {
115
+ granteeType
116
+ granteeId
117
+ permission
118
+ }
119
+ }
120
+ `;
@@ -0,0 +1,22 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { agentMemoryFragment } from '../fragments/agentMemoryFragments.ts';
3
+
4
+ export const agentMemoriesQry = gql`
5
+ query agentMemories (
6
+ $organizationId: GenericID!
7
+ $scope: AgentMemoryScope
8
+ $status: AgentMemoryStatus
9
+ $limit: Int
10
+ ) {
11
+ agentMemories (
12
+ organizationId: $organizationId
13
+ scope: $scope
14
+ status: $status
15
+ limit: $limit
16
+ ) {
17
+ ...agentMemoryFragment
18
+ }
19
+ }
20
+
21
+ ${agentMemoryFragment}
22
+ `;
@@ -1,5 +1,21 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { aiChatFragment, aiChatMessageFragment } from '../fragments/aiChatFragments';
2
+ import {
3
+ aiChatFragment,
4
+ aiChatMessageFragment,
5
+ } from '../fragments/aiChatFragments.ts';
6
+
7
+ export const aiChatMetadataQry = gql`
8
+ query aiChatMetadata (
9
+ $aiChatId: GenericID!
10
+ ) {
11
+ aiChatMetadata (
12
+ aiChatId: $aiChatId
13
+ ) {
14
+ id
15
+ summary
16
+ }
17
+ }
18
+ `;
3
19
 
4
20
  export const aiChatQry = gql`
5
21
  query aiChat (
@@ -47,7 +63,7 @@ ${aiChatMessageFragment}
47
63
 
48
64
  export const aiChatsQry = gql`
49
65
  query aiChats (
50
- $organizationId: GenericID!
66
+ $organizationId: GenericID
51
67
  $filter: AIChatsFilter
52
68
  $cursor: Cursor
53
69
  $after: Boolean!
@@ -0,0 +1,41 @@
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 myAccountSessionsQry = gql`
18
+ query myAccountSessions {
19
+ myAccountSessions {
20
+ ...accountSessionFragment
21
+ ${ORGANIZATION_AUTHORIZATION_FIELDS}
22
+ }
23
+ }
24
+ ${accountSessionFragment}
25
+ `;
26
+
27
+ export const organizationMemberSessionsQry = gql`
28
+ query organizationMemberSessions (
29
+ $organizationId: GenericID!
30
+ $accountId: GenericID!
31
+ ) {
32
+ organizationMemberSessions (
33
+ organizationId: $organizationId
34
+ accountId: $accountId
35
+ ) {
36
+ ...accountSessionFragment
37
+ ${ORGANIZATION_AUTHORIZATION_FIELDS}
38
+ }
39
+ }
40
+ ${accountSessionFragment}
41
+ `;
@@ -1,5 +1,28 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { platformProductFragment } from '../fragments/billingFragments';
2
+ import { platformProductFragment } from '../fragments/billingFragments.ts';
3
+
4
+ export const organizationUsageQry = gql`
5
+ query organizationUsage(
6
+ $organizationId: GenericID!
7
+ $occurredAtFrom: DateTime!
8
+ $occurredAtTo: DateTime!
9
+ $meters: [UsageMeter!]
10
+ $origins: [UsageOrigin!]
11
+ ) {
12
+ organizationUsage(
13
+ organizationId: $organizationId
14
+ occurredAtFrom: $occurredAtFrom
15
+ occurredAtTo: $occurredAtTo
16
+ meters: $meters
17
+ origins: $origins
18
+ ) {
19
+ meter
20
+ origin
21
+ quantity
22
+ eventCount
23
+ }
24
+ }
25
+ `;
3
26
 
4
27
  export const platformProductsQry = gql`
5
28
  query platformProducts {