@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,127 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ campaignFragment,
4
+ campaignRecipientFragment,
5
+ campaignResponseFragment,
6
+ campaignSummaryFragment,
7
+ campaignTemplateElementFragment,
8
+ campaignTemplateFragment,
9
+ campaignTemplateSummaryFragment,
10
+ } from '../fragments/campaignFragments.ts';
11
+
12
+ export const campaignTemplatesQry = gql`
13
+ query campaignTemplates (
14
+ $organizationId: GenericID!
15
+ $kind: CampaignKind
16
+ $status: CampaignTemplateStatus
17
+ $cursor: Cursor
18
+ $after: Boolean
19
+ $limit: Int
20
+ ) {
21
+ campaignTemplates (
22
+ organizationId: $organizationId
23
+ kind: $kind
24
+ status: $status
25
+ cursor: $cursor
26
+ after: $after
27
+ limit: $limit
28
+ ) {
29
+ ...campaignTemplateSummaryFragment
30
+ }
31
+ }
32
+ ${campaignTemplateSummaryFragment}
33
+ `;
34
+
35
+ export const campaignTemplateQry = gql`
36
+ query campaignTemplate (
37
+ $organizationId: GenericID!
38
+ $templateId: GenericID!
39
+ ) {
40
+ campaignTemplate (
41
+ organizationId: $organizationId
42
+ templateId: $templateId
43
+ ) {
44
+ ...campaignTemplateFragment
45
+ }
46
+ }
47
+ ${campaignTemplateElementFragment}
48
+ ${campaignTemplateFragment}
49
+ `;
50
+
51
+ export const campaignsQry = gql`
52
+ query campaigns (
53
+ $organizationId: GenericID!
54
+ $filter: CampaignsFilter!
55
+ $cursor: Cursor
56
+ $after: Boolean!
57
+ $limit: Int!
58
+ ) {
59
+ campaigns (
60
+ organizationId: $organizationId
61
+ filter: $filter
62
+ cursor: $cursor
63
+ after: $after
64
+ limit: $limit
65
+ ) {
66
+ ...campaignSummaryFragment
67
+ }
68
+ }
69
+ ${campaignSummaryFragment}
70
+ `;
71
+
72
+ export const campaignQry = gql`
73
+ query campaign (
74
+ $organizationId: GenericID!
75
+ $campaignId: GenericID!
76
+ ) {
77
+ campaign (
78
+ organizationId: $organizationId
79
+ campaignId: $campaignId
80
+ ) {
81
+ ...campaignFragment
82
+ }
83
+ }
84
+ ${campaignFragment}
85
+ `;
86
+
87
+ export const campaignResponsesQry = gql`
88
+ query campaignResponses (
89
+ $organizationId: GenericID!
90
+ $filter: CampaignResponsesFilter!
91
+ $cursor: Cursor
92
+ $after: Boolean!
93
+ $limit: Int!
94
+ ) {
95
+ campaignResponses (
96
+ organizationId: $organizationId
97
+ filter: $filter
98
+ cursor: $cursor
99
+ after: $after
100
+ limit: $limit
101
+ ) {
102
+ ...campaignResponseFragment
103
+ }
104
+ }
105
+ ${campaignResponseFragment}
106
+ `;
107
+
108
+ export const campaignRecipientsQry = gql`
109
+ query campaignRecipients (
110
+ $organizationId: GenericID!
111
+ $filter: CampaignRecipientsFilter!
112
+ $cursor: Cursor
113
+ $after: Boolean!
114
+ $limit: Int!
115
+ ) {
116
+ campaignRecipients (
117
+ organizationId: $organizationId
118
+ filter: $filter
119
+ cursor: $cursor
120
+ after: $after
121
+ limit: $limit
122
+ ) {
123
+ ...campaignRecipientFragment
124
+ }
125
+ }
126
+ ${campaignRecipientFragment}
127
+ `;
@@ -0,0 +1,134 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ dataTableCellFragment,
4
+ dataTableFragment,
5
+ dataTableMetadataFragment,
6
+ dataTableRowFragment,
7
+ } from '../fragments/dataTableFragments.ts';
8
+
9
+ export const dataTablesQry = gql`
10
+ query dataTables (
11
+ $organizationId: GenericID!
12
+ $filter: DataTablesFilter
13
+ $sort: GridItemSort
14
+ $cursor: Cursor
15
+ $after: Boolean!
16
+ $limit: Int!
17
+ ) {
18
+ dataTables (
19
+ organizationId: $organizationId
20
+ filter: $filter
21
+ sort: $sort
22
+ cursor: $cursor
23
+ after: $after
24
+ limit: $limit
25
+ ) {
26
+ ...dataTableFragment
27
+ realtimeToken
28
+ }
29
+ }
30
+
31
+ ${dataTableFragment}
32
+ `;
33
+
34
+ export const dataTableQry = gql`
35
+ query dataTable (
36
+ $organizationId: GenericID!
37
+ $dataTableId: GenericID!
38
+ ) {
39
+ dataTable (
40
+ organizationId: $organizationId
41
+ dataTableId: $dataTableId
42
+ ) {
43
+ ...dataTableFragment
44
+ realtimeToken
45
+ }
46
+ }
47
+
48
+ ${dataTableFragment}
49
+ `;
50
+
51
+ export const dataTableMetadataQry = gql`
52
+ query dataTableMetadata (
53
+ $dataTableId: GenericID!
54
+ ) {
55
+ dataTableMetadata (
56
+ dataTableId: $dataTableId
57
+ ) {
58
+ ...dataTableMetadataFragment
59
+ }
60
+ }
61
+
62
+ ${dataTableMetadataFragment}
63
+ `;
64
+
65
+ export const dataTableRowsSnapshotQry = gql`
66
+ query dataTableRowsSnapshot (
67
+ $dataTableId: GenericID!
68
+ $organizationId: GenericID!
69
+ $cursor: Cursor
70
+ $limit: Int!
71
+ ) {
72
+ dataTableRowsSnapshot (
73
+ dataTableId: $dataTableId
74
+ organizationId: $organizationId
75
+ cursor: $cursor
76
+ limit: $limit
77
+ ) {
78
+ dataTableId
79
+ currentSeq
80
+
81
+ dataTable {
82
+ ...dataTableFragment
83
+ realtimeToken
84
+ }
85
+
86
+ rows {
87
+ ...dataTableRowFragment
88
+
89
+ cells {
90
+ ...dataTableCellFragment
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ ${dataTableFragment}
97
+ ${dataTableRowFragment}
98
+ ${dataTableCellFragment}
99
+ `;
100
+
101
+ // Stage 6 bounded tail contract. Journal payloads are storage transitions, so
102
+ // a tail can identify a recovery target but only the snapshot query above may
103
+ // acknowledge the normalized client cache.
104
+ export const dataTableChangesQry = gql`
105
+ query dataTableChanges (
106
+ $dataTableId: GenericID!
107
+ $organizationId: GenericID!
108
+ $afterSeq: BigInt!
109
+ $limit: Int!
110
+ ) {
111
+ dataTableChanges (
112
+ dataTableId: $dataTableId
113
+ organizationId: $organizationId
114
+ afterSeq: $afterSeq
115
+ limit: $limit
116
+ ) {
117
+ dataTableId
118
+ currentSeq
119
+ requiresSnapshot
120
+ changes {
121
+ dataTableId
122
+ seq
123
+ kind
124
+ payload
125
+ actorAccountId
126
+ sourceSocketId
127
+ commandId
128
+ correlationId
129
+ causationId
130
+ createdAt
131
+ }
132
+ }
133
+ }
134
+ `;
@@ -0,0 +1,96 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ inboundEmailFragment,
4
+ outboundEmailFragment,
5
+ } from '../fragments/emailFragments.ts';
6
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
7
+
8
+ export const inboundEmailQry = gql`
9
+ query inboundEmail (
10
+ $organizationId: GenericID!
11
+ $inboundEmailId: GenericID!
12
+ ) {
13
+ inboundEmail (
14
+ organizationId: $organizationId
15
+ inboundEmailId: $inboundEmailId
16
+ ) {
17
+ ...inboundEmailFragment
18
+ }
19
+ }
20
+
21
+ ${inboundEmailFragment}
22
+ `;
23
+
24
+ export const outboundEmailQry = gql`
25
+ query outboundEmail (
26
+ $organizationId: GenericID!
27
+ $outboundEmailId: GenericID!
28
+ ) {
29
+ outboundEmail (
30
+ organizationId: $organizationId
31
+ outboundEmailId: $outboundEmailId
32
+ ) {
33
+ ...outboundEmailFragment
34
+
35
+ files {
36
+ ...storageFileFragment
37
+ }
38
+ }
39
+ }
40
+
41
+ ${storageFileFragment}
42
+ ${outboundEmailFragment}
43
+ `;
44
+
45
+ export const inboundEmailsQry = gql`
46
+ query inboundEmails (
47
+ $organizationId: GenericID!
48
+ $filter: InboundEmailsFilter
49
+ $sort: InboundEmailsSort
50
+ $cursor: Cursor
51
+ $after: Boolean!
52
+ $limit: Int!
53
+ ) {
54
+ inboundEmails (
55
+ organizationId: $organizationId
56
+ filter: $filter
57
+ sort: $sort
58
+ cursor: $cursor
59
+ after: $after
60
+ limit: $limit
61
+ ) {
62
+ ...inboundEmailFragment
63
+ }
64
+ }
65
+
66
+ ${inboundEmailFragment}
67
+ `;
68
+
69
+ export const outboundEmailsQry = gql`
70
+ query outboundEmails (
71
+ $organizationId: GenericID!
72
+ $filter: OutboundEmailsFilter
73
+ $sort: OutboundEmailsSort
74
+ $cursor: Cursor
75
+ $after: Boolean!
76
+ $limit: Int!
77
+ ) {
78
+ outboundEmails (
79
+ organizationId: $organizationId
80
+ filter: $filter
81
+ sort: $sort
82
+ cursor: $cursor
83
+ after: $after
84
+ limit: $limit
85
+ ) {
86
+ ...outboundEmailFragment
87
+
88
+ files {
89
+ ...storageFileFragment
90
+ }
91
+ }
92
+ }
93
+
94
+ ${storageFileFragment}
95
+ ${outboundEmailFragment}
96
+ `;
@@ -0,0 +1,158 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ fieldDocElementDataFragment,
4
+ fieldDocFragment,
5
+ fieldDocGroupFragment,
6
+ fieldDocSectionFragment,
7
+ fieldDocSubmissionFragment,
8
+ } from '../fragments/fieldDocFragments.ts';
9
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
10
+
11
+ export const fieldDocMetadataQry = gql`
12
+ query fieldDocMetadata (
13
+ $fieldDocSourceId: CursorToIDs!
14
+ ) {
15
+ fieldDocMetadata (
16
+ fieldDocSourceId: $fieldDocSourceId
17
+ ) {
18
+ id
19
+ title
20
+ description
21
+ }
22
+ }
23
+ `;
24
+
25
+ export const fieldDocGroupMetadataQry = gql`
26
+ query fieldDocGroupMetadata (
27
+ $fieldDocGroupId: GenericID!
28
+ ) {
29
+ fieldDocGroupMetadata (
30
+ fieldDocGroupId: $fieldDocGroupId
31
+ ) {
32
+ id
33
+ name
34
+ shortName
35
+ }
36
+ }
37
+ `;
38
+
39
+ export const fieldDocsQry = gql`
40
+ query fieldDocs (
41
+ $organizationId: GenericID!
42
+ $filter: FieldDocsFilter!
43
+ $sort: FieldDocsSort
44
+ ) {
45
+ fieldDocs (
46
+ organizationId: $organizationId
47
+ filter: $filter
48
+ sort: $sort
49
+ ) {
50
+ ...fieldDocFragment
51
+
52
+ submission {
53
+ ...fieldDocSubmissionFragment
54
+ }
55
+
56
+ sections {
57
+ ...fieldDocSectionFragment
58
+
59
+ elements {
60
+ ...fieldDocElementDataFragment
61
+
62
+ files {
63
+ ...storageFileFragment
64
+ }
65
+ }
66
+ }
67
+
68
+ }
69
+ }
70
+
71
+ ${fieldDocFragment}
72
+ ${fieldDocSubmissionFragment}
73
+ ${fieldDocSectionFragment}
74
+ ${storageFileFragment}
75
+ ${fieldDocElementDataFragment}
76
+ `;
77
+
78
+ export const fieldDocQry = gql`
79
+ query fieldDoc (
80
+ $organizationId: GenericID!
81
+ $fieldDocSourceId: CursorToIDs!
82
+ ) {
83
+ fieldDoc (
84
+ organizationId: $organizationId
85
+ fieldDocSourceId: $fieldDocSourceId
86
+ ) {
87
+ ...fieldDocFragment
88
+
89
+ aside {
90
+ title
91
+ nullText
92
+
93
+ items {
94
+ className
95
+ label
96
+ text
97
+ }
98
+ }
99
+
100
+ submission {
101
+ ...fieldDocSubmissionFragment
102
+ }
103
+
104
+ sections {
105
+ ...fieldDocSectionFragment
106
+
107
+ elements {
108
+ ...fieldDocElementDataFragment
109
+
110
+ files {
111
+ ...storageFileFragment
112
+ }
113
+ }
114
+ }
115
+
116
+ }
117
+ }
118
+
119
+ ${fieldDocFragment}
120
+ ${fieldDocSubmissionFragment}
121
+ ${fieldDocSectionFragment}
122
+ ${storageFileFragment}
123
+ ${fieldDocElementDataFragment}
124
+ `;
125
+
126
+ export const fieldDocGroupsQry = gql`
127
+ query fieldDocGroups (
128
+ $organizationId: GenericID!
129
+ ) {
130
+ fieldDocGroups (
131
+ organizationId: $organizationId
132
+ ) {
133
+ ...fieldDocGroupFragment
134
+ }
135
+ }
136
+
137
+ ${fieldDocGroupFragment}
138
+ `;
139
+
140
+ export const fieldDocSubmissionsQry = gql`
141
+ query fieldDocSubmissions (
142
+ $organizationId: GenericID!
143
+ $filter: FieldDocsFilter!
144
+ $sort: FieldDocsSort
145
+ $limit: Int!
146
+ ) {
147
+ fieldDocSubmissions (
148
+ organizationId: $organizationId
149
+ filter: $filter
150
+ sort: $sort
151
+ limit: $limit
152
+ ) {
153
+ ...fieldDocSubmissionFragment
154
+ }
155
+ }
156
+
157
+ ${fieldDocSubmissionFragment}
158
+ `;
@@ -0,0 +1,40 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { inboundContactFragment } from '../fragments/inboundContactFragments.ts';
3
+
4
+ export const inboundContactQry = gql`
5
+ query inboundContact (
6
+ $organizationId: GenericID!
7
+ $inboundContactId: GenericID!
8
+ ) {
9
+ inboundContact (
10
+ organizationId: $organizationId
11
+ inboundContactId: $inboundContactId
12
+ ) {
13
+ ...inboundContactFragment
14
+ }
15
+ }
16
+
17
+ ${inboundContactFragment}
18
+ `;
19
+
20
+ export const inboundContactsQry = gql`
21
+ query inboundContacts (
22
+ $organizationId: GenericID!
23
+ $sort: InboundContactsSort
24
+ $cursor: Cursor
25
+ $after: Boolean!
26
+ $limit: Int!
27
+ ) {
28
+ inboundContacts (
29
+ organizationId: $organizationId
30
+ sort: $sort
31
+ cursor: $cursor
32
+ after: $after
33
+ limit: $limit
34
+ ) {
35
+ ...inboundContactFragment
36
+ }
37
+ }
38
+
39
+ ${inboundContactFragment}
40
+ `;
@@ -1,6 +1,17 @@
1
- export * from './aiChatQueries';
2
- export * from './appQueries';
3
- export * from './billingQueries';
4
- export * from './logQueries';
5
- export * from './organizationQueries';
6
- export * from './productQueries';
1
+ export * from './campaignQueries.ts';
2
+ export * from './agentDocQueries.ts';
3
+ export * from './agentMemoryQueries.ts';
4
+ export * from './aiChatQueries.ts';
5
+ export * from './appQueries.ts';
6
+ export * from './authQueries.ts';
7
+ export * from './billingQueries.ts';
8
+ export * from './dataTableQueries.ts';
9
+ export * from './emailQueries.ts';
10
+ export * from './fieldDocQueries.ts';
11
+ export * from './inboundContactQueries.ts';
12
+ export * from './logQueries.ts';
13
+ export * from './organizationQueries.ts';
14
+ export * from './scheduleQueries.ts';
15
+ export * from './sheetQueries.ts';
16
+ export * from './storageQueries.ts';
17
+ export * from './workflowQueries.ts';
@@ -1,20 +1,15 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { accountFragment } from '../fragments/accountFragments';
3
- import { logEntryFragment, logArableFragment, logLivestockFragment, logFarmersMarketFragment } from '../fragments/logFragments';
4
- import { actionTaskFragment } from '../fragments/actionFragments';
2
+ import { accountFragment } from '../fragments/accountFragments.ts';
3
+ import {
4
+ logEntryDetailsFragment,
5
+ logEntryFragment,
6
+ } from '../fragments/logFragments.ts';
7
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
5
8
 
6
9
  export const logEntryFragmentStatement = `...logEntryFragment
7
10
 
8
11
  details {
9
- ...on LogArable {
10
- ...logArableFragment
11
- }
12
- ...on LogFarmersMarket {
13
- ...logFarmersMarketFragment
14
- }
15
- ...on LogLivestock {
16
- ...logLivestockFragment
17
- }
12
+ ...logEntryDetailsFragment
18
13
  }
19
14
 
20
15
  account {
@@ -24,9 +19,28 @@ export const logEntryFragmentStatement = `...logEntryFragment
24
19
  export const logEntryFragmentImports = `
25
20
  ${accountFragment}
26
21
  ${logEntryFragment}
27
- ${logArableFragment}
28
- ${logFarmersMarketFragment}
29
- ${logLivestockFragment}
22
+ ${logEntryDetailsFragment}
23
+ `;
24
+
25
+ export const logEntryQry = gql`
26
+ query logEntry (
27
+ $organizationId: GenericID!
28
+ $logEntryId: GenericID!
29
+ ) {
30
+ logEntry (
31
+ organizationId: $organizationId
32
+ logEntryId: $logEntryId
33
+ ) {
34
+ ${logEntryFragmentStatement}
35
+
36
+ files {
37
+ ...storageFileFragment
38
+ }
39
+ }
40
+ }
41
+
42
+ ${storageFileFragment}
43
+ ${logEntryFragmentImports}
30
44
  `;
31
45
 
32
46
  export const logEntriesQry = gql`
@@ -48,39 +62,35 @@ query logEntries (
48
62
  ) {
49
63
  ${logEntryFragmentStatement}
50
64
 
51
- actions {
52
- ...actionTaskFragment
65
+ files {
66
+ ...storageFileFragment
53
67
  }
54
68
  }
55
69
  }
56
70
 
57
- ${actionTaskFragment}
71
+ ${storageFileFragment}
58
72
  ${logEntryFragmentImports}
59
73
  `;
60
74
 
61
- export const logEvidencesQry = gql`
62
- query logEvidences (
75
+ export const logEntriesForFieldDocQry = gql`
76
+ query logEntriesForFieldDoc (
63
77
  $organizationId: GenericID!
64
- $reportId: CursorToID!
65
- $cursor: Cursor
66
- $after: Boolean!
67
- $limit: Int!
78
+ $fieldDocSourceId: CursorToIDs!
79
+ $fieldDocSubmissionId: GenericID!
68
80
  ) {
69
- logEvidences (
81
+ logEntriesForFieldDoc (
70
82
  organizationId: $organizationId
71
- reportId: $reportId
72
- cursor: $cursor
73
- after: $after
74
- limit: $limit
83
+ fieldDocSourceId: $fieldDocSourceId
84
+ fieldDocSubmissionId: $fieldDocSubmissionId
75
85
  ) {
76
86
  ${logEntryFragmentStatement}
77
87
 
78
- actions {
79
- ...actionTaskFragment
88
+ files {
89
+ ...storageFileFragment
80
90
  }
81
91
  }
82
92
  }
83
93
 
84
- ${actionTaskFragment}
94
+ ${storageFileFragment}
85
95
  ${logEntryFragmentImports}
86
96
  `;