@powerhousedao/reactor-browser 6.0.0-dev.194 → 6.0.0-dev.196
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.
- package/dist/client-DMdsUVJw.js +852 -0
- package/dist/client-DMdsUVJw.js.map +1 -0
- package/dist/client-DS0--utd.d.ts +777 -0
- package/dist/client-DS0--utd.d.ts.map +1 -0
- package/dist/document-by-id-CDLUqru5.js +441 -0
- package/dist/document-by-id-CDLUqru5.js.map +1 -0
- package/dist/index-Ce4S7Kk1.d.ts +726 -0
- package/dist/index-Ce4S7Kk1.d.ts.map +1 -0
- package/dist/index-DgwLcoI3.d.ts +343 -0
- package/dist/index-DgwLcoI3.d.ts.map +1 -0
- package/dist/index.d.ts +8 -1278
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -2800
- package/dist/index.js.map +1 -1
- package/dist/make-ph-event-functions-Cr4GqOTT.js +57 -0
- package/dist/make-ph-event-functions-Cr4GqOTT.js.map +1 -0
- package/dist/relational-jwreqDwz.js +123 -0
- package/dist/relational-jwreqDwz.js.map +1 -0
- package/dist/renown-CV_45Xc1.js +1014 -0
- package/dist/renown-CV_45Xc1.js.map +1 -0
- package/dist/src/analytics/index.d.ts +113 -0
- package/dist/src/analytics/index.d.ts.map +1 -0
- package/dist/src/analytics/index.js +343 -0
- package/dist/src/analytics/index.js.map +1 -0
- package/dist/src/graphql/client.d.ts +2 -0
- package/dist/src/graphql/client.js +2 -0
- package/dist/src/relational/index.d.ts +2 -0
- package/dist/src/relational/index.js +2 -0
- package/dist/src/renown/index.d.ts +2 -0
- package/dist/src/renown/index.js +2 -0
- package/dist/types-BmR60pPN.d.ts +22 -0
- package/dist/types-BmR60pPN.d.ts.map +1 -0
- package/package.json +24 -8
|
@@ -0,0 +1,852 @@
|
|
|
1
|
+
import { GraphQLClient } from "graphql-request";
|
|
2
|
+
import { gql } from "graphql-tag";
|
|
3
|
+
//#region src/graphql/gen/schema.ts
|
|
4
|
+
let PropagationMode = /* @__PURE__ */ function(PropagationMode) {
|
|
5
|
+
PropagationMode["Cascade"] = "CASCADE";
|
|
6
|
+
PropagationMode["Orphan"] = "ORPHAN";
|
|
7
|
+
return PropagationMode;
|
|
8
|
+
}({});
|
|
9
|
+
const PhDocumentFieldsFragmentDoc = gql`
|
|
10
|
+
fragment PHDocumentFields on PHDocument {
|
|
11
|
+
id
|
|
12
|
+
slug
|
|
13
|
+
name
|
|
14
|
+
documentType
|
|
15
|
+
state
|
|
16
|
+
revisionsList {
|
|
17
|
+
scope
|
|
18
|
+
revision
|
|
19
|
+
}
|
|
20
|
+
createdAtUtcIso
|
|
21
|
+
lastModifiedAtUtcIso
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const GetDocumentModelsDocument = gql`
|
|
25
|
+
query GetDocumentModels($namespace: String, $paging: PagingInput) {
|
|
26
|
+
documentModels(namespace: $namespace, paging: $paging) {
|
|
27
|
+
items {
|
|
28
|
+
id
|
|
29
|
+
name
|
|
30
|
+
namespace
|
|
31
|
+
version
|
|
32
|
+
specification
|
|
33
|
+
}
|
|
34
|
+
totalCount
|
|
35
|
+
hasNextPage
|
|
36
|
+
hasPreviousPage
|
|
37
|
+
cursor
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
const GetDocumentDocument = gql`
|
|
42
|
+
query GetDocument($identifier: String!, $view: ViewFilterInput) {
|
|
43
|
+
document(identifier: $identifier, view: $view) {
|
|
44
|
+
document {
|
|
45
|
+
...PHDocumentFields
|
|
46
|
+
}
|
|
47
|
+
childIds
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
${PhDocumentFieldsFragmentDoc}
|
|
51
|
+
`;
|
|
52
|
+
const GetDocumentWithOperationsDocument = gql`
|
|
53
|
+
query GetDocumentWithOperations(
|
|
54
|
+
$identifier: String!
|
|
55
|
+
$view: ViewFilterInput
|
|
56
|
+
$operationsFilter: DocumentOperationsFilterInput
|
|
57
|
+
$operationsPaging: PagingInput
|
|
58
|
+
) {
|
|
59
|
+
document(identifier: $identifier, view: $view) {
|
|
60
|
+
document {
|
|
61
|
+
...PHDocumentFields
|
|
62
|
+
operations(filter: $operationsFilter, paging: $operationsPaging) {
|
|
63
|
+
items {
|
|
64
|
+
index
|
|
65
|
+
timestampUtcMs
|
|
66
|
+
hash
|
|
67
|
+
skip
|
|
68
|
+
error
|
|
69
|
+
id
|
|
70
|
+
action {
|
|
71
|
+
id
|
|
72
|
+
type
|
|
73
|
+
timestampUtcMs
|
|
74
|
+
input
|
|
75
|
+
scope
|
|
76
|
+
attachments {
|
|
77
|
+
data
|
|
78
|
+
mimeType
|
|
79
|
+
hash
|
|
80
|
+
extension
|
|
81
|
+
fileName
|
|
82
|
+
}
|
|
83
|
+
context {
|
|
84
|
+
signer {
|
|
85
|
+
user {
|
|
86
|
+
address
|
|
87
|
+
networkId
|
|
88
|
+
chainId
|
|
89
|
+
}
|
|
90
|
+
app {
|
|
91
|
+
name
|
|
92
|
+
key
|
|
93
|
+
}
|
|
94
|
+
signatures
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
totalCount
|
|
100
|
+
hasNextPage
|
|
101
|
+
hasPreviousPage
|
|
102
|
+
cursor
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
childIds
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
${PhDocumentFieldsFragmentDoc}
|
|
109
|
+
`;
|
|
110
|
+
const GetDocumentChildrenDocument = gql`
|
|
111
|
+
query GetDocumentChildren(
|
|
112
|
+
$parentIdentifier: String!
|
|
113
|
+
$view: ViewFilterInput
|
|
114
|
+
$paging: PagingInput
|
|
115
|
+
) {
|
|
116
|
+
documentChildren(
|
|
117
|
+
parentIdentifier: $parentIdentifier
|
|
118
|
+
view: $view
|
|
119
|
+
paging: $paging
|
|
120
|
+
) {
|
|
121
|
+
items {
|
|
122
|
+
...PHDocumentFields
|
|
123
|
+
}
|
|
124
|
+
totalCount
|
|
125
|
+
hasNextPage
|
|
126
|
+
hasPreviousPage
|
|
127
|
+
cursor
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
${PhDocumentFieldsFragmentDoc}
|
|
131
|
+
`;
|
|
132
|
+
const GetDocumentParentsDocument = gql`
|
|
133
|
+
query GetDocumentParents(
|
|
134
|
+
$childIdentifier: String!
|
|
135
|
+
$view: ViewFilterInput
|
|
136
|
+
$paging: PagingInput
|
|
137
|
+
) {
|
|
138
|
+
documentParents(
|
|
139
|
+
childIdentifier: $childIdentifier
|
|
140
|
+
view: $view
|
|
141
|
+
paging: $paging
|
|
142
|
+
) {
|
|
143
|
+
items {
|
|
144
|
+
...PHDocumentFields
|
|
145
|
+
}
|
|
146
|
+
totalCount
|
|
147
|
+
hasNextPage
|
|
148
|
+
hasPreviousPage
|
|
149
|
+
cursor
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
${PhDocumentFieldsFragmentDoc}
|
|
153
|
+
`;
|
|
154
|
+
const FindDocumentsDocument = gql`
|
|
155
|
+
query FindDocuments(
|
|
156
|
+
$search: SearchFilterInput
|
|
157
|
+
$view: ViewFilterInput
|
|
158
|
+
$paging: PagingInput
|
|
159
|
+
) {
|
|
160
|
+
findDocuments(search: $search, view: $view, paging: $paging) {
|
|
161
|
+
items {
|
|
162
|
+
...PHDocumentFields
|
|
163
|
+
}
|
|
164
|
+
totalCount
|
|
165
|
+
hasNextPage
|
|
166
|
+
hasPreviousPage
|
|
167
|
+
cursor
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
${PhDocumentFieldsFragmentDoc}
|
|
171
|
+
`;
|
|
172
|
+
const GetDocumentOperationsDocument = gql`
|
|
173
|
+
query GetDocumentOperations(
|
|
174
|
+
$filter: OperationsFilterInput!
|
|
175
|
+
$paging: PagingInput
|
|
176
|
+
) {
|
|
177
|
+
documentOperations(filter: $filter, paging: $paging) {
|
|
178
|
+
items {
|
|
179
|
+
index
|
|
180
|
+
timestampUtcMs
|
|
181
|
+
hash
|
|
182
|
+
skip
|
|
183
|
+
error
|
|
184
|
+
id
|
|
185
|
+
action {
|
|
186
|
+
id
|
|
187
|
+
type
|
|
188
|
+
timestampUtcMs
|
|
189
|
+
input
|
|
190
|
+
scope
|
|
191
|
+
attachments {
|
|
192
|
+
data
|
|
193
|
+
mimeType
|
|
194
|
+
hash
|
|
195
|
+
extension
|
|
196
|
+
fileName
|
|
197
|
+
}
|
|
198
|
+
context {
|
|
199
|
+
signer {
|
|
200
|
+
user {
|
|
201
|
+
address
|
|
202
|
+
networkId
|
|
203
|
+
chainId
|
|
204
|
+
}
|
|
205
|
+
app {
|
|
206
|
+
name
|
|
207
|
+
key
|
|
208
|
+
}
|
|
209
|
+
signatures
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
totalCount
|
|
215
|
+
hasNextPage
|
|
216
|
+
hasPreviousPage
|
|
217
|
+
cursor
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
`;
|
|
221
|
+
const GetJobStatusDocument = gql`
|
|
222
|
+
query GetJobStatus($jobId: String!) {
|
|
223
|
+
jobStatus(jobId: $jobId) {
|
|
224
|
+
id
|
|
225
|
+
status
|
|
226
|
+
result
|
|
227
|
+
error
|
|
228
|
+
createdAt
|
|
229
|
+
completedAt
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
`;
|
|
233
|
+
const CreateDocumentDocument = gql`
|
|
234
|
+
mutation CreateDocument($document: JSONObject!, $parentIdentifier: String) {
|
|
235
|
+
createDocument(document: $document, parentIdentifier: $parentIdentifier) {
|
|
236
|
+
...PHDocumentFields
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
${PhDocumentFieldsFragmentDoc}
|
|
240
|
+
`;
|
|
241
|
+
const CreateEmptyDocumentDocument = gql`
|
|
242
|
+
mutation CreateEmptyDocument(
|
|
243
|
+
$documentType: String!
|
|
244
|
+
$parentIdentifier: String
|
|
245
|
+
) {
|
|
246
|
+
createEmptyDocument(
|
|
247
|
+
documentType: $documentType
|
|
248
|
+
parentIdentifier: $parentIdentifier
|
|
249
|
+
) {
|
|
250
|
+
...PHDocumentFields
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
${PhDocumentFieldsFragmentDoc}
|
|
254
|
+
`;
|
|
255
|
+
const MutateDocumentDocument = gql`
|
|
256
|
+
mutation MutateDocument(
|
|
257
|
+
$documentIdentifier: String!
|
|
258
|
+
$actions: [JSONObject!]!
|
|
259
|
+
$view: ViewFilterInput
|
|
260
|
+
) {
|
|
261
|
+
mutateDocument(
|
|
262
|
+
documentIdentifier: $documentIdentifier
|
|
263
|
+
actions: $actions
|
|
264
|
+
view: $view
|
|
265
|
+
) {
|
|
266
|
+
...PHDocumentFields
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
${PhDocumentFieldsFragmentDoc}
|
|
270
|
+
`;
|
|
271
|
+
const MutateDocumentAsyncDocument = gql`
|
|
272
|
+
mutation MutateDocumentAsync(
|
|
273
|
+
$documentIdentifier: String!
|
|
274
|
+
$actions: [JSONObject!]!
|
|
275
|
+
$view: ViewFilterInput
|
|
276
|
+
) {
|
|
277
|
+
mutateDocumentAsync(
|
|
278
|
+
documentIdentifier: $documentIdentifier
|
|
279
|
+
actions: $actions
|
|
280
|
+
view: $view
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
`;
|
|
284
|
+
const RenameDocumentDocument = gql`
|
|
285
|
+
mutation RenameDocument(
|
|
286
|
+
$documentIdentifier: String!
|
|
287
|
+
$name: String!
|
|
288
|
+
$branch: String
|
|
289
|
+
) {
|
|
290
|
+
renameDocument(
|
|
291
|
+
documentIdentifier: $documentIdentifier
|
|
292
|
+
name: $name
|
|
293
|
+
branch: $branch
|
|
294
|
+
) {
|
|
295
|
+
...PHDocumentFields
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
${PhDocumentFieldsFragmentDoc}
|
|
299
|
+
`;
|
|
300
|
+
const AddChildrenDocument = gql`
|
|
301
|
+
mutation AddChildren(
|
|
302
|
+
$parentIdentifier: String!
|
|
303
|
+
$documentIdentifiers: [String!]!
|
|
304
|
+
$branch: String
|
|
305
|
+
) {
|
|
306
|
+
addChildren(
|
|
307
|
+
parentIdentifier: $parentIdentifier
|
|
308
|
+
documentIdentifiers: $documentIdentifiers
|
|
309
|
+
branch: $branch
|
|
310
|
+
) {
|
|
311
|
+
...PHDocumentFields
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
${PhDocumentFieldsFragmentDoc}
|
|
315
|
+
`;
|
|
316
|
+
const RemoveChildrenDocument = gql`
|
|
317
|
+
mutation RemoveChildren(
|
|
318
|
+
$parentIdentifier: String!
|
|
319
|
+
$documentIdentifiers: [String!]!
|
|
320
|
+
$branch: String
|
|
321
|
+
) {
|
|
322
|
+
removeChildren(
|
|
323
|
+
parentIdentifier: $parentIdentifier
|
|
324
|
+
documentIdentifiers: $documentIdentifiers
|
|
325
|
+
branch: $branch
|
|
326
|
+
) {
|
|
327
|
+
...PHDocumentFields
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
${PhDocumentFieldsFragmentDoc}
|
|
331
|
+
`;
|
|
332
|
+
const MoveChildrenDocument = gql`
|
|
333
|
+
mutation MoveChildren(
|
|
334
|
+
$sourceParentIdentifier: String!
|
|
335
|
+
$targetParentIdentifier: String!
|
|
336
|
+
$documentIdentifiers: [String!]!
|
|
337
|
+
$branch: String
|
|
338
|
+
) {
|
|
339
|
+
moveChildren(
|
|
340
|
+
sourceParentIdentifier: $sourceParentIdentifier
|
|
341
|
+
targetParentIdentifier: $targetParentIdentifier
|
|
342
|
+
documentIdentifiers: $documentIdentifiers
|
|
343
|
+
branch: $branch
|
|
344
|
+
) {
|
|
345
|
+
source {
|
|
346
|
+
...PHDocumentFields
|
|
347
|
+
}
|
|
348
|
+
target {
|
|
349
|
+
...PHDocumentFields
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
${PhDocumentFieldsFragmentDoc}
|
|
354
|
+
`;
|
|
355
|
+
const DeleteDocumentDocument = gql`
|
|
356
|
+
mutation DeleteDocument($identifier: String!, $propagate: PropagationMode) {
|
|
357
|
+
deleteDocument(identifier: $identifier, propagate: $propagate)
|
|
358
|
+
}
|
|
359
|
+
`;
|
|
360
|
+
const DeleteDocumentsDocument = gql`
|
|
361
|
+
mutation DeleteDocuments(
|
|
362
|
+
$identifiers: [String!]!
|
|
363
|
+
$propagate: PropagationMode
|
|
364
|
+
) {
|
|
365
|
+
deleteDocuments(identifiers: $identifiers, propagate: $propagate)
|
|
366
|
+
}
|
|
367
|
+
`;
|
|
368
|
+
const DocumentChangesDocument = gql`
|
|
369
|
+
subscription DocumentChanges(
|
|
370
|
+
$search: SearchFilterInput
|
|
371
|
+
$view: ViewFilterInput
|
|
372
|
+
) {
|
|
373
|
+
documentChanges(search: $search, view: $view) {
|
|
374
|
+
type
|
|
375
|
+
documents {
|
|
376
|
+
...PHDocumentFields
|
|
377
|
+
}
|
|
378
|
+
context {
|
|
379
|
+
parentId
|
|
380
|
+
childId
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
${PhDocumentFieldsFragmentDoc}
|
|
385
|
+
`;
|
|
386
|
+
const JobChangesDocument = gql`
|
|
387
|
+
subscription JobChanges($jobId: String!) {
|
|
388
|
+
jobChanges(jobId: $jobId) {
|
|
389
|
+
jobId
|
|
390
|
+
status
|
|
391
|
+
result
|
|
392
|
+
error
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
`;
|
|
396
|
+
const PollSyncEnvelopesDocument = gql`
|
|
397
|
+
query PollSyncEnvelopes(
|
|
398
|
+
$channelId: String!
|
|
399
|
+
$outboxAck: Int!
|
|
400
|
+
$outboxLatest: Int!
|
|
401
|
+
) {
|
|
402
|
+
pollSyncEnvelopes(
|
|
403
|
+
channelId: $channelId
|
|
404
|
+
outboxAck: $outboxAck
|
|
405
|
+
outboxLatest: $outboxLatest
|
|
406
|
+
) {
|
|
407
|
+
envelopes {
|
|
408
|
+
type
|
|
409
|
+
channelMeta {
|
|
410
|
+
id
|
|
411
|
+
}
|
|
412
|
+
operations {
|
|
413
|
+
operation {
|
|
414
|
+
index
|
|
415
|
+
timestampUtcMs
|
|
416
|
+
hash
|
|
417
|
+
skip
|
|
418
|
+
error
|
|
419
|
+
id
|
|
420
|
+
action {
|
|
421
|
+
id
|
|
422
|
+
type
|
|
423
|
+
timestampUtcMs
|
|
424
|
+
input
|
|
425
|
+
scope
|
|
426
|
+
attachments {
|
|
427
|
+
data
|
|
428
|
+
mimeType
|
|
429
|
+
hash
|
|
430
|
+
extension
|
|
431
|
+
fileName
|
|
432
|
+
}
|
|
433
|
+
context {
|
|
434
|
+
signer {
|
|
435
|
+
user {
|
|
436
|
+
address
|
|
437
|
+
networkId
|
|
438
|
+
chainId
|
|
439
|
+
}
|
|
440
|
+
app {
|
|
441
|
+
name
|
|
442
|
+
key
|
|
443
|
+
}
|
|
444
|
+
signatures
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
context {
|
|
450
|
+
documentId
|
|
451
|
+
documentType
|
|
452
|
+
scope
|
|
453
|
+
branch
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
cursor {
|
|
457
|
+
remoteName
|
|
458
|
+
cursorOrdinal
|
|
459
|
+
lastSyncedAtUtcMs
|
|
460
|
+
}
|
|
461
|
+
key
|
|
462
|
+
dependsOn
|
|
463
|
+
}
|
|
464
|
+
ackOrdinal
|
|
465
|
+
deadLetters {
|
|
466
|
+
documentId
|
|
467
|
+
error
|
|
468
|
+
}
|
|
469
|
+
hasMore
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
`;
|
|
473
|
+
const TouchChannelDocument = gql`
|
|
474
|
+
mutation TouchChannel($input: TouchChannelInput!) {
|
|
475
|
+
touchChannel(input: $input) {
|
|
476
|
+
success
|
|
477
|
+
ackOrdinal
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
`;
|
|
481
|
+
const PushSyncEnvelopesDocument = gql`
|
|
482
|
+
mutation PushSyncEnvelopes($envelopes: [SyncEnvelopeInput!]!) {
|
|
483
|
+
pushSyncEnvelopes(envelopes: $envelopes)
|
|
484
|
+
}
|
|
485
|
+
`;
|
|
486
|
+
const defaultWrapper = (action, _operationName, _operationType, _variables) => action();
|
|
487
|
+
function getSdk(client, withWrapper = defaultWrapper) {
|
|
488
|
+
return {
|
|
489
|
+
GetDocumentModels(variables, requestHeaders, signal) {
|
|
490
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
491
|
+
document: GetDocumentModelsDocument,
|
|
492
|
+
variables,
|
|
493
|
+
requestHeaders: {
|
|
494
|
+
...requestHeaders,
|
|
495
|
+
...wrappedRequestHeaders
|
|
496
|
+
},
|
|
497
|
+
signal
|
|
498
|
+
}), "GetDocumentModels", "query", variables);
|
|
499
|
+
},
|
|
500
|
+
GetDocument(variables, requestHeaders, signal) {
|
|
501
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
502
|
+
document: GetDocumentDocument,
|
|
503
|
+
variables,
|
|
504
|
+
requestHeaders: {
|
|
505
|
+
...requestHeaders,
|
|
506
|
+
...wrappedRequestHeaders
|
|
507
|
+
},
|
|
508
|
+
signal
|
|
509
|
+
}), "GetDocument", "query", variables);
|
|
510
|
+
},
|
|
511
|
+
GetDocumentWithOperations(variables, requestHeaders, signal) {
|
|
512
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
513
|
+
document: GetDocumentWithOperationsDocument,
|
|
514
|
+
variables,
|
|
515
|
+
requestHeaders: {
|
|
516
|
+
...requestHeaders,
|
|
517
|
+
...wrappedRequestHeaders
|
|
518
|
+
},
|
|
519
|
+
signal
|
|
520
|
+
}), "GetDocumentWithOperations", "query", variables);
|
|
521
|
+
},
|
|
522
|
+
GetDocumentChildren(variables, requestHeaders, signal) {
|
|
523
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
524
|
+
document: GetDocumentChildrenDocument,
|
|
525
|
+
variables,
|
|
526
|
+
requestHeaders: {
|
|
527
|
+
...requestHeaders,
|
|
528
|
+
...wrappedRequestHeaders
|
|
529
|
+
},
|
|
530
|
+
signal
|
|
531
|
+
}), "GetDocumentChildren", "query", variables);
|
|
532
|
+
},
|
|
533
|
+
GetDocumentParents(variables, requestHeaders, signal) {
|
|
534
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
535
|
+
document: GetDocumentParentsDocument,
|
|
536
|
+
variables,
|
|
537
|
+
requestHeaders: {
|
|
538
|
+
...requestHeaders,
|
|
539
|
+
...wrappedRequestHeaders
|
|
540
|
+
},
|
|
541
|
+
signal
|
|
542
|
+
}), "GetDocumentParents", "query", variables);
|
|
543
|
+
},
|
|
544
|
+
FindDocuments(variables, requestHeaders, signal) {
|
|
545
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
546
|
+
document: FindDocumentsDocument,
|
|
547
|
+
variables,
|
|
548
|
+
requestHeaders: {
|
|
549
|
+
...requestHeaders,
|
|
550
|
+
...wrappedRequestHeaders
|
|
551
|
+
},
|
|
552
|
+
signal
|
|
553
|
+
}), "FindDocuments", "query", variables);
|
|
554
|
+
},
|
|
555
|
+
GetDocumentOperations(variables, requestHeaders, signal) {
|
|
556
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
557
|
+
document: GetDocumentOperationsDocument,
|
|
558
|
+
variables,
|
|
559
|
+
requestHeaders: {
|
|
560
|
+
...requestHeaders,
|
|
561
|
+
...wrappedRequestHeaders
|
|
562
|
+
},
|
|
563
|
+
signal
|
|
564
|
+
}), "GetDocumentOperations", "query", variables);
|
|
565
|
+
},
|
|
566
|
+
GetJobStatus(variables, requestHeaders, signal) {
|
|
567
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
568
|
+
document: GetJobStatusDocument,
|
|
569
|
+
variables,
|
|
570
|
+
requestHeaders: {
|
|
571
|
+
...requestHeaders,
|
|
572
|
+
...wrappedRequestHeaders
|
|
573
|
+
},
|
|
574
|
+
signal
|
|
575
|
+
}), "GetJobStatus", "query", variables);
|
|
576
|
+
},
|
|
577
|
+
CreateDocument(variables, requestHeaders, signal) {
|
|
578
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
579
|
+
document: CreateDocumentDocument,
|
|
580
|
+
variables,
|
|
581
|
+
requestHeaders: {
|
|
582
|
+
...requestHeaders,
|
|
583
|
+
...wrappedRequestHeaders
|
|
584
|
+
},
|
|
585
|
+
signal
|
|
586
|
+
}), "CreateDocument", "mutation", variables);
|
|
587
|
+
},
|
|
588
|
+
CreateEmptyDocument(variables, requestHeaders, signal) {
|
|
589
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
590
|
+
document: CreateEmptyDocumentDocument,
|
|
591
|
+
variables,
|
|
592
|
+
requestHeaders: {
|
|
593
|
+
...requestHeaders,
|
|
594
|
+
...wrappedRequestHeaders
|
|
595
|
+
},
|
|
596
|
+
signal
|
|
597
|
+
}), "CreateEmptyDocument", "mutation", variables);
|
|
598
|
+
},
|
|
599
|
+
MutateDocument(variables, requestHeaders, signal) {
|
|
600
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
601
|
+
document: MutateDocumentDocument,
|
|
602
|
+
variables,
|
|
603
|
+
requestHeaders: {
|
|
604
|
+
...requestHeaders,
|
|
605
|
+
...wrappedRequestHeaders
|
|
606
|
+
},
|
|
607
|
+
signal
|
|
608
|
+
}), "MutateDocument", "mutation", variables);
|
|
609
|
+
},
|
|
610
|
+
MutateDocumentAsync(variables, requestHeaders, signal) {
|
|
611
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
612
|
+
document: MutateDocumentAsyncDocument,
|
|
613
|
+
variables,
|
|
614
|
+
requestHeaders: {
|
|
615
|
+
...requestHeaders,
|
|
616
|
+
...wrappedRequestHeaders
|
|
617
|
+
},
|
|
618
|
+
signal
|
|
619
|
+
}), "MutateDocumentAsync", "mutation", variables);
|
|
620
|
+
},
|
|
621
|
+
RenameDocument(variables, requestHeaders, signal) {
|
|
622
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
623
|
+
document: RenameDocumentDocument,
|
|
624
|
+
variables,
|
|
625
|
+
requestHeaders: {
|
|
626
|
+
...requestHeaders,
|
|
627
|
+
...wrappedRequestHeaders
|
|
628
|
+
},
|
|
629
|
+
signal
|
|
630
|
+
}), "RenameDocument", "mutation", variables);
|
|
631
|
+
},
|
|
632
|
+
AddChildren(variables, requestHeaders, signal) {
|
|
633
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
634
|
+
document: AddChildrenDocument,
|
|
635
|
+
variables,
|
|
636
|
+
requestHeaders: {
|
|
637
|
+
...requestHeaders,
|
|
638
|
+
...wrappedRequestHeaders
|
|
639
|
+
},
|
|
640
|
+
signal
|
|
641
|
+
}), "AddChildren", "mutation", variables);
|
|
642
|
+
},
|
|
643
|
+
RemoveChildren(variables, requestHeaders, signal) {
|
|
644
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
645
|
+
document: RemoveChildrenDocument,
|
|
646
|
+
variables,
|
|
647
|
+
requestHeaders: {
|
|
648
|
+
...requestHeaders,
|
|
649
|
+
...wrappedRequestHeaders
|
|
650
|
+
},
|
|
651
|
+
signal
|
|
652
|
+
}), "RemoveChildren", "mutation", variables);
|
|
653
|
+
},
|
|
654
|
+
MoveChildren(variables, requestHeaders, signal) {
|
|
655
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
656
|
+
document: MoveChildrenDocument,
|
|
657
|
+
variables,
|
|
658
|
+
requestHeaders: {
|
|
659
|
+
...requestHeaders,
|
|
660
|
+
...wrappedRequestHeaders
|
|
661
|
+
},
|
|
662
|
+
signal
|
|
663
|
+
}), "MoveChildren", "mutation", variables);
|
|
664
|
+
},
|
|
665
|
+
DeleteDocument(variables, requestHeaders, signal) {
|
|
666
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
667
|
+
document: DeleteDocumentDocument,
|
|
668
|
+
variables,
|
|
669
|
+
requestHeaders: {
|
|
670
|
+
...requestHeaders,
|
|
671
|
+
...wrappedRequestHeaders
|
|
672
|
+
},
|
|
673
|
+
signal
|
|
674
|
+
}), "DeleteDocument", "mutation", variables);
|
|
675
|
+
},
|
|
676
|
+
DeleteDocuments(variables, requestHeaders, signal) {
|
|
677
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
678
|
+
document: DeleteDocumentsDocument,
|
|
679
|
+
variables,
|
|
680
|
+
requestHeaders: {
|
|
681
|
+
...requestHeaders,
|
|
682
|
+
...wrappedRequestHeaders
|
|
683
|
+
},
|
|
684
|
+
signal
|
|
685
|
+
}), "DeleteDocuments", "mutation", variables);
|
|
686
|
+
},
|
|
687
|
+
DocumentChanges(variables, requestHeaders, signal) {
|
|
688
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
689
|
+
document: DocumentChangesDocument,
|
|
690
|
+
variables,
|
|
691
|
+
requestHeaders: {
|
|
692
|
+
...requestHeaders,
|
|
693
|
+
...wrappedRequestHeaders
|
|
694
|
+
},
|
|
695
|
+
signal
|
|
696
|
+
}), "DocumentChanges", "subscription", variables);
|
|
697
|
+
},
|
|
698
|
+
JobChanges(variables, requestHeaders, signal) {
|
|
699
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
700
|
+
document: JobChangesDocument,
|
|
701
|
+
variables,
|
|
702
|
+
requestHeaders: {
|
|
703
|
+
...requestHeaders,
|
|
704
|
+
...wrappedRequestHeaders
|
|
705
|
+
},
|
|
706
|
+
signal
|
|
707
|
+
}), "JobChanges", "subscription", variables);
|
|
708
|
+
},
|
|
709
|
+
PollSyncEnvelopes(variables, requestHeaders, signal) {
|
|
710
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
711
|
+
document: PollSyncEnvelopesDocument,
|
|
712
|
+
variables,
|
|
713
|
+
requestHeaders: {
|
|
714
|
+
...requestHeaders,
|
|
715
|
+
...wrappedRequestHeaders
|
|
716
|
+
},
|
|
717
|
+
signal
|
|
718
|
+
}), "PollSyncEnvelopes", "query", variables);
|
|
719
|
+
},
|
|
720
|
+
TouchChannel(variables, requestHeaders, signal) {
|
|
721
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
722
|
+
document: TouchChannelDocument,
|
|
723
|
+
variables,
|
|
724
|
+
requestHeaders: {
|
|
725
|
+
...requestHeaders,
|
|
726
|
+
...wrappedRequestHeaders
|
|
727
|
+
},
|
|
728
|
+
signal
|
|
729
|
+
}), "TouchChannel", "mutation", variables);
|
|
730
|
+
},
|
|
731
|
+
PushSyncEnvelopes(variables, requestHeaders, signal) {
|
|
732
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
733
|
+
document: PushSyncEnvelopesDocument,
|
|
734
|
+
variables,
|
|
735
|
+
requestHeaders: {
|
|
736
|
+
...requestHeaders,
|
|
737
|
+
...wrappedRequestHeaders
|
|
738
|
+
},
|
|
739
|
+
signal
|
|
740
|
+
}), "PushSyncEnvelopes", "mutation", variables);
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/graphql/batch-queries.ts
|
|
746
|
+
/** Get the source string from a GraphQL document (string or DocumentNode). */
|
|
747
|
+
function getDocumentSource(doc) {
|
|
748
|
+
return typeof doc === "string" ? doc : doc.loc?.source.body ?? "";
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Extract the inner selection set of a named field from a GraphQL document source.
|
|
752
|
+
* Returns the `{ ... }` block including braces.
|
|
753
|
+
*/
|
|
754
|
+
function extractSelectionSet(doc, fieldName, fallback) {
|
|
755
|
+
const source = getDocumentSource(doc);
|
|
756
|
+
return new RegExp(`${fieldName}\\([^)]*\\)\\s*(\\{[\\s\\S]*\\})\\s*\\}`).exec(source)?.[1] ?? fallback;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Extract the query body and any fragment definitions from a GraphQL document.
|
|
760
|
+
* Returns { body, fragments } where body is the content inside the query `{ ... }`
|
|
761
|
+
* and fragments are any trailing fragment definitions.
|
|
762
|
+
*/
|
|
763
|
+
function extractQueryParts(doc, fallbackBody) {
|
|
764
|
+
const source = getDocumentSource(doc);
|
|
765
|
+
const queryMatch = /^[^{]*\{([\s\S]*?)\}\s*(fragment[\s\S]*)?$/.exec(source);
|
|
766
|
+
return {
|
|
767
|
+
body: queryMatch?.[1]?.trim() ?? fallbackBody,
|
|
768
|
+
fragments: queryMatch?.[2]?.trim() ?? ""
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
const operationsSelectionSet = extractSelectionSet(GetDocumentOperationsDocument, "documentOperations", "{ items { index } }");
|
|
772
|
+
const documentParts = extractQueryParts(GetDocumentDocument, "document(identifier: $identifier) { document { id name documentType state revisionsList { scope revision } createdAtUtcIso lastModifiedAtUtcIso } childIds }");
|
|
773
|
+
/**
|
|
774
|
+
* Build a single GraphQL query that fetches documentOperations for
|
|
775
|
+
* multiple filters using aliases. Each filter gets its own alias
|
|
776
|
+
* (`scope_0`, `scope_1`, …) so all scopes are fetched in one HTTP request.
|
|
777
|
+
*/
|
|
778
|
+
function buildBatchOperationsQuery(filters, pagings) {
|
|
779
|
+
const query = `query BatchGetDocumentOperations(${filters.flatMap((_, i) => [`$filter_${i}: OperationsFilterInput!`, `$paging_${i}: PagingInput`]).join(", ")}) {
|
|
780
|
+
${filters.map((_, i) => `scope_${i}: documentOperations(filter: $filter_${i}, paging: $paging_${i}) ${operationsSelectionSet}`).join("\n ")}
|
|
781
|
+
}`;
|
|
782
|
+
const variables = {};
|
|
783
|
+
for (let i = 0; i < filters.length; i++) {
|
|
784
|
+
variables[`filter_${i}`] = filters[i];
|
|
785
|
+
variables[`paging_${i}`] = pagings[i] ?? null;
|
|
786
|
+
}
|
|
787
|
+
return {
|
|
788
|
+
query,
|
|
789
|
+
variables
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Build a single GraphQL query that fetches a document AND
|
|
794
|
+
* documentOperations for multiple filters, all in one HTTP request.
|
|
795
|
+
*/
|
|
796
|
+
function buildBatchDocumentWithOperationsQuery(identifier, view, filters, pagings) {
|
|
797
|
+
const docVarDefs = "$identifier: String!, $view: ViewFilterInput";
|
|
798
|
+
const opsVarDefs = filters.flatMap((_, i) => [`$filter_${i}: OperationsFilterInput!`, `$paging_${i}: PagingInput`]).join(", ");
|
|
799
|
+
const opsFields = filters.map((_, i) => `scope_${i}: documentOperations(filter: $filter_${i}, paging: $paging_${i}) ${operationsSelectionSet}`).join("\n ");
|
|
800
|
+
const query = `query BatchGetDocumentWithOperations(${docVarDefs}, ${opsVarDefs}) {
|
|
801
|
+
${documentParts.body}
|
|
802
|
+
${opsFields}
|
|
803
|
+
}
|
|
804
|
+
${documentParts.fragments}`;
|
|
805
|
+
const variables = {
|
|
806
|
+
identifier,
|
|
807
|
+
view: view ?? null
|
|
808
|
+
};
|
|
809
|
+
for (let i = 0; i < filters.length; i++) {
|
|
810
|
+
variables[`filter_${i}`] = filters[i];
|
|
811
|
+
variables[`paging_${i}`] = pagings[i] ?? null;
|
|
812
|
+
}
|
|
813
|
+
return {
|
|
814
|
+
query,
|
|
815
|
+
variables
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region src/graphql/client.ts
|
|
820
|
+
/**
|
|
821
|
+
* Creates a GraphQL client for the Reactor Subgraph API.
|
|
822
|
+
* @param urlOrGQLClient The URL of the GraphQL API or a GraphQL client instance.
|
|
823
|
+
* @param middleware An optional middleware function to wrap the GraphQL client calls.
|
|
824
|
+
* @returns A GraphQL client for the Reactor Subgraph API.
|
|
825
|
+
*/
|
|
826
|
+
function createClient(urlOrGQLClient, middleware) {
|
|
827
|
+
const client = typeof urlOrGQLClient === "string" ? new GraphQLClient(urlOrGQLClient) : urlOrGQLClient;
|
|
828
|
+
const runWithMiddleware = async (operationName, run) => {
|
|
829
|
+
if (!middleware) return run();
|
|
830
|
+
return middleware(run, operationName, "query");
|
|
831
|
+
};
|
|
832
|
+
return {
|
|
833
|
+
...getSdk(client, middleware),
|
|
834
|
+
async BatchGetDocumentOperations(filters, pagings) {
|
|
835
|
+
const { query, variables } = buildBatchOperationsQuery(filters, pagings);
|
|
836
|
+
const data = await runWithMiddleware("BatchGetDocumentOperations", (requestHeaders) => client.request(query, variables, requestHeaders));
|
|
837
|
+
return filters.map((_, i) => data[`scope_${i}`]);
|
|
838
|
+
},
|
|
839
|
+
async BatchGetDocumentWithOperations(identifier, view, filters, pagings) {
|
|
840
|
+
const { query, variables } = buildBatchDocumentWithOperationsQuery(identifier, view, filters, pagings);
|
|
841
|
+
const data = await runWithMiddleware("BatchGetDocumentWithOperations", (requestHeaders) => client.request(query, variables, requestHeaders));
|
|
842
|
+
return {
|
|
843
|
+
document: data.document ?? null,
|
|
844
|
+
operations: filters.map((_, i) => data[`scope_${i}`])
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
//#endregion
|
|
850
|
+
export { PropagationMode as n, createClient as t };
|
|
851
|
+
|
|
852
|
+
//# sourceMappingURL=client-DMdsUVJw.js.map
|