@powerhousedao/reactor-api 5.1.0-staging.0 → 5.1.0

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 (57) hide show
  1. package/dist/codegen.js +2 -2
  2. package/dist/codegen.js.map +1 -1
  3. package/dist/src/graphql/base-subgraph.d.ts +1 -2
  4. package/dist/src/graphql/base-subgraph.d.ts.map +1 -1
  5. package/dist/src/graphql/base-subgraph.js +0 -2
  6. package/dist/src/graphql/base-subgraph.js.map +1 -1
  7. package/dist/src/graphql/graphql-manager.d.ts.map +1 -1
  8. package/dist/src/graphql/graphql-manager.js +0 -1
  9. package/dist/src/graphql/graphql-manager.js.map +1 -1
  10. package/dist/src/graphql/reactor/adapters.js +1 -1
  11. package/dist/src/graphql/reactor/adapters.js.map +1 -1
  12. package/dist/src/graphql/reactor/factory.d.ts +4 -4
  13. package/dist/src/graphql/reactor/factory.d.ts.map +1 -1
  14. package/dist/src/graphql/reactor/gen/graphql.d.ts +64 -295
  15. package/dist/src/graphql/reactor/gen/graphql.d.ts.map +1 -1
  16. package/dist/src/graphql/reactor/gen/graphql.js +8 -121
  17. package/dist/src/graphql/reactor/gen/graphql.js.map +1 -1
  18. package/dist/src/graphql/reactor/pubsub.d.ts +2 -2
  19. package/dist/src/graphql/reactor/pubsub.d.ts.map +1 -1
  20. package/dist/src/graphql/reactor/pubsub.js +1 -2
  21. package/dist/src/graphql/reactor/pubsub.js.map +1 -1
  22. package/dist/src/graphql/reactor/resolvers.d.ts +17 -43
  23. package/dist/src/graphql/reactor/resolvers.d.ts.map +1 -1
  24. package/dist/src/graphql/reactor/resolvers.js +34 -98
  25. package/dist/src/graphql/reactor/resolvers.js.map +1 -1
  26. package/dist/src/graphql/reactor/subgraph.d.ts.map +1 -1
  27. package/dist/src/graphql/reactor/subgraph.js +5 -71
  28. package/dist/src/graphql/reactor/subgraph.js.map +1 -1
  29. package/dist/src/graphql/types.d.ts +1 -2
  30. package/dist/src/graphql/types.d.ts.map +1 -1
  31. package/dist/src/server.d.ts +3 -0
  32. package/dist/src/server.d.ts.map +1 -1
  33. package/dist/src/server.js +12 -5
  34. package/dist/src/server.js.map +1 -1
  35. package/dist/src/services/auth.service.d.ts.map +1 -1
  36. package/dist/src/services/auth.service.js +6 -2
  37. package/dist/src/services/auth.service.js.map +1 -1
  38. package/dist/src/utils/create-schema.d.ts +1 -1
  39. package/dist/src/utils/create-schema.d.ts.map +1 -1
  40. package/dist/src/utils/create-schema.js +1 -10
  41. package/dist/src/utils/create-schema.js.map +1 -1
  42. package/dist/test/reactor-adapters.test.js +2 -2
  43. package/dist/test/reactor-adapters.test.js.map +1 -1
  44. package/dist/test/reactor-resolvers.test.js +24 -24
  45. package/dist/test/reactor-resolvers.test.js.map +1 -1
  46. package/dist/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +9 -10
  48. package/dist/src/graphql/reactor/operations.graphql +0 -253
  49. package/dist/src/graphql/reactor/schema.graphql +0 -429
  50. package/dist/test/two-reactor-gql-sync.test.d.ts +0 -2
  51. package/dist/test/two-reactor-gql-sync.test.d.ts.map +0 -1
  52. package/dist/test/two-reactor-gql-sync.test.js +0 -296
  53. package/dist/test/two-reactor-gql-sync.test.js.map +0 -1
  54. package/dist/test/utils/gql-resolver-bridge.d.ts +0 -12
  55. package/dist/test/utils/gql-resolver-bridge.d.ts.map +0 -1
  56. package/dist/test/utils/gql-resolver-bridge.js +0 -60
  57. package/dist/test/utils/gql-resolver-bridge.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/reactor-api",
3
- "version": "5.1.0-staging.0",
3
+ "version": "5.1.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "repository": {
@@ -39,6 +39,7 @@
39
39
  "@powerhousedao/analytics-engine-graphql": "^0.4.0",
40
40
  "@powerhousedao/analytics-engine-pg": "^0.6.0",
41
41
  "@powerhousedao/document-engineering": "^1.27.0",
42
+ "@types/ws": "^8.18.1",
42
43
  "body-parser": "^1.20.3",
43
44
  "change-case": "^5.4.4",
44
45
  "cors": "^2.8.5",
@@ -66,15 +67,14 @@
66
67
  "wildcard-match": "^5.1.3",
67
68
  "ws": "^8.18.3",
68
69
  "zod": "^3.24.3",
69
- "@powerhousedao/config": "5.1.0-staging.0",
70
- "@powerhousedao/reactor-mcp": "5.1.0-staging.0",
71
- "@powerhousedao/reactor": "5.1.0-staging.0",
72
- "@renown/sdk": "5.1.0-staging.0",
73
- "document-drive": "5.1.0-staging.0",
74
- "document-model": "5.1.0-staging.0"
70
+ "@powerhousedao/config": "5.1.0",
71
+ "@powerhousedao/reactor": "5.1.0",
72
+ "@renown/sdk": "5.1.0",
73
+ "@powerhousedao/reactor-mcp": "5.1.0",
74
+ "document-drive": "5.1.0",
75
+ "document-model": "5.1.0"
75
76
  },
76
77
  "devDependencies": {
77
- "copyfiles": "^2.4.1",
78
78
  "@graphql-codegen/cli": "^5.0.0",
79
79
  "@graphql-codegen/client-preset": "^4.1.0",
80
80
  "@graphql-codegen/typed-document-node": "^5.0.1",
@@ -92,7 +92,6 @@
92
92
  "@types/ms": "^0.7.34",
93
93
  "@types/node": "^24.6.1",
94
94
  "@types/pg": "^8.11.10",
95
- "@types/ws": "^8.18.1",
96
95
  "esbuild": "^0.24.0",
97
96
  "graphql-codegen-typescript-validation-schema": "^0.12.0",
98
97
  "graphql-tag": "^2.12.6",
@@ -103,7 +102,7 @@
103
102
  },
104
103
  "scripts": {
105
104
  "tsc": "tsc",
106
- "build": "pnpm tsc --build && copyfiles -u 0 \"src/**/*.graphql\" dist/",
105
+ "build": "pnpm tsc --build",
107
106
  "lint": "eslint",
108
107
  "test": "vitest run",
109
108
  "bench": "vitest bench",
@@ -1,253 +0,0 @@
1
- # Fragment for common PHDocument fields
2
- fragment PHDocumentFields on PHDocument {
3
- id
4
- slug
5
- name
6
- documentType
7
- state
8
- revisionsList {
9
- scope
10
- revision
11
- }
12
- createdAtUtcIso
13
- lastModifiedAtUtcIso
14
- parentId
15
- }
16
-
17
- # Query operations
18
- query GetDocumentModels($namespace: String, $paging: PagingInput) {
19
- documentModels(namespace: $namespace, paging: $paging) {
20
- items {
21
- id
22
- name
23
- namespace
24
- version
25
- specification
26
- }
27
- totalCount
28
- hasNextPage
29
- hasPreviousPage
30
- cursor
31
- }
32
- }
33
-
34
- query GetDocument($identifier: String!, $view: ViewFilterInput) {
35
- document(identifier: $identifier, view: $view) {
36
- document {
37
- ...PHDocumentFields
38
- }
39
- childIds
40
- }
41
- }
42
-
43
- query GetDocumentChildren(
44
- $parentIdentifier: String!
45
- $view: ViewFilterInput
46
- $paging: PagingInput
47
- ) {
48
- documentChildren(
49
- parentIdentifier: $parentIdentifier
50
- view: $view
51
- paging: $paging
52
- ) {
53
- items {
54
- ...PHDocumentFields
55
- }
56
- totalCount
57
- hasNextPage
58
- hasPreviousPage
59
- cursor
60
- }
61
- }
62
-
63
- query GetDocumentParents(
64
- $childIdentifier: String!
65
- $view: ViewFilterInput
66
- $paging: PagingInput
67
- ) {
68
- documentParents(
69
- childIdentifier: $childIdentifier
70
- view: $view
71
- paging: $paging
72
- ) {
73
- items {
74
- ...PHDocumentFields
75
- }
76
- totalCount
77
- hasNextPage
78
- hasPreviousPage
79
- cursor
80
- }
81
- }
82
-
83
- query FindDocuments(
84
- $search: SearchFilterInput!
85
- $view: ViewFilterInput
86
- $paging: PagingInput
87
- ) {
88
- findDocuments(search: $search, view: $view, paging: $paging) {
89
- items {
90
- ...PHDocumentFields
91
- }
92
- totalCount
93
- hasNextPage
94
- hasPreviousPage
95
- cursor
96
- }
97
- }
98
-
99
- query GetJobStatus($jobId: String!) {
100
- jobStatus(jobId: $jobId) {
101
- id
102
- status
103
- result
104
- error
105
- createdAt
106
- completedAt
107
- }
108
- }
109
-
110
- # Mutation operations
111
- mutation CreateDocument($document: JSONObject!, $parentIdentifier: String) {
112
- createDocument(document: $document, parentIdentifier: $parentIdentifier) {
113
- ...PHDocumentFields
114
- }
115
- }
116
-
117
- mutation CreateEmptyDocument(
118
- $documentType: String!
119
- $parentIdentifier: String
120
- ) {
121
- createEmptyDocument(
122
- documentType: $documentType
123
- parentIdentifier: $parentIdentifier
124
- ) {
125
- ...PHDocumentFields
126
- }
127
- }
128
-
129
- mutation MutateDocument(
130
- $documentIdentifier: String!
131
- $actions: [JSONObject!]!
132
- $view: ViewFilterInput
133
- ) {
134
- mutateDocument(
135
- documentIdentifier: $documentIdentifier
136
- actions: $actions
137
- view: $view
138
- ) {
139
- ...PHDocumentFields
140
- }
141
- }
142
-
143
- mutation MutateDocumentAsync(
144
- $documentIdentifier: String!
145
- $actions: [JSONObject!]!
146
- $view: ViewFilterInput
147
- ) {
148
- mutateDocumentAsync(
149
- documentIdentifier: $documentIdentifier
150
- actions: $actions
151
- view: $view
152
- )
153
- }
154
-
155
- mutation RenameDocument(
156
- $documentIdentifier: String!
157
- $name: String!
158
- $branch: String
159
- ) {
160
- renameDocument(
161
- documentIdentifier: $documentIdentifier
162
- name: $name
163
- branch: $branch
164
- ) {
165
- ...PHDocumentFields
166
- }
167
- }
168
-
169
- mutation AddChildren(
170
- $parentIdentifier: String!
171
- $documentIdentifiers: [String!]!
172
- $branch: String
173
- ) {
174
- addChildren(
175
- parentIdentifier: $parentIdentifier
176
- documentIdentifiers: $documentIdentifiers
177
- branch: $branch
178
- ) {
179
- ...PHDocumentFields
180
- }
181
- }
182
-
183
- mutation RemoveChildren(
184
- $parentIdentifier: String!
185
- $documentIdentifiers: [String!]!
186
- $branch: String
187
- ) {
188
- removeChildren(
189
- parentIdentifier: $parentIdentifier
190
- documentIdentifiers: $documentIdentifiers
191
- branch: $branch
192
- ) {
193
- ...PHDocumentFields
194
- }
195
- }
196
-
197
- mutation MoveChildren(
198
- $sourceParentIdentifier: String!
199
- $targetParentIdentifier: String!
200
- $documentIdentifiers: [String!]!
201
- $branch: String
202
- ) {
203
- moveChildren(
204
- sourceParentIdentifier: $sourceParentIdentifier
205
- targetParentIdentifier: $targetParentIdentifier
206
- documentIdentifiers: $documentIdentifiers
207
- branch: $branch
208
- ) {
209
- source {
210
- ...PHDocumentFields
211
- }
212
- target {
213
- ...PHDocumentFields
214
- }
215
- }
216
- }
217
-
218
- mutation DeleteDocument($identifier: String!, $propagate: PropagationMode) {
219
- deleteDocument(identifier: $identifier, propagate: $propagate)
220
- }
221
-
222
- mutation DeleteDocuments(
223
- $identifiers: [String!]!
224
- $propagate: PropagationMode
225
- ) {
226
- deleteDocuments(identifiers: $identifiers, propagate: $propagate)
227
- }
228
-
229
- # Subscription operations
230
- subscription DocumentChanges(
231
- $search: SearchFilterInput!
232
- $view: ViewFilterInput
233
- ) {
234
- documentChanges(search: $search, view: $view) {
235
- type
236
- documents {
237
- ...PHDocumentFields
238
- }
239
- context {
240
- parentId
241
- childId
242
- }
243
- }
244
- }
245
-
246
- subscription JobChanges($jobId: String!) {
247
- jobChanges(jobId: $jobId) {
248
- jobId
249
- status
250
- result
251
- error
252
- }
253
- }
@@ -1,429 +0,0 @@
1
- # Scalar types (for codegen - also defined in create-schema.ts)
2
- scalar JSONObject
3
- scalar DateTime
4
-
5
- # Input types
6
- input PagingInput {
7
- limit: Int
8
- offset: Int
9
- cursor: String
10
- }
11
-
12
- input ViewFilterInput {
13
- branch: String
14
- scopes: [String!]
15
- }
16
-
17
- input SearchFilterInput {
18
- type: String
19
- parentId: String
20
- identifiers: [String!]
21
- }
22
-
23
- # Enums
24
- enum PropagationMode {
25
- CASCADE
26
- ORPHAN
27
- }
28
-
29
- enum DocumentChangeType {
30
- CREATED
31
- DELETED
32
- UPDATED
33
- PARENT_ADDED
34
- PARENT_REMOVED
35
- CHILD_ADDED
36
- CHILD_REMOVED
37
- }
38
-
39
- # Object types
40
- type DocumentModelGlobalState {
41
- id: String!
42
- name: String!
43
- namespace: String
44
- version: String
45
- specification: JSONObject!
46
- }
47
-
48
- type DocumentModelResultPage {
49
- items: [DocumentModelGlobalState!]!
50
- totalCount: Int!
51
- hasNextPage: Boolean!
52
- hasPreviousPage: Boolean!
53
- cursor: String
54
- }
55
-
56
- type Revision {
57
- scope: String!
58
- revision: Int!
59
- }
60
-
61
- type PHDocument {
62
- id: String!
63
- slug: String
64
- name: String!
65
- documentType: String!
66
- state: JSONObject!
67
- revisionsList: [Revision!]!
68
- createdAtUtcIso: DateTime!
69
- lastModifiedAtUtcIso: DateTime!
70
- parentId: String
71
- }
72
-
73
- type PHDocumentResultPage {
74
- items: [PHDocument!]!
75
- totalCount: Int!
76
- hasNextPage: Boolean!
77
- hasPreviousPage: Boolean!
78
- cursor: String
79
- }
80
-
81
- type DocumentWithChildren {
82
- document: PHDocument!
83
- childIds: [String!]!
84
- }
85
-
86
- type MoveChildrenResult {
87
- source: PHDocument!
88
- target: PHDocument!
89
- }
90
-
91
- type JobInfo {
92
- id: String!
93
- status: String!
94
- result: JSONObject!
95
- error: String
96
- createdAt: DateTime!
97
- completedAt: DateTime
98
- }
99
-
100
- type DocumentChangeEvent {
101
- type: DocumentChangeType!
102
- documents: [PHDocument!]!
103
- context: DocumentChangeContext
104
- }
105
-
106
- type DocumentChangeContext {
107
- parentId: String
108
- childId: String
109
- }
110
-
111
- type JobChangeEvent {
112
- jobId: String!
113
- status: String!
114
- result: JSONObject!
115
- error: String
116
- }
117
-
118
- type ReactorSignerUser {
119
- address: String!
120
- networkId: String!
121
- chainId: Int!
122
- }
123
-
124
- type ReactorSignerApp {
125
- name: String!
126
- key: String!
127
- }
128
-
129
- type ReactorSigner {
130
- user: ReactorSignerUser
131
- app: ReactorSignerApp
132
- signatures: [String!]!
133
- }
134
-
135
- type ActionContext {
136
- signer: ReactorSigner
137
- }
138
-
139
- type Action {
140
- id: String!
141
- type: String!
142
- timestampUtcMs: String!
143
- input: JSONObject!
144
- scope: String!
145
- attachments: [Attachment!]
146
- context: ActionContext
147
- }
148
-
149
- type Attachment {
150
- data: String!
151
- mimeType: String!
152
- hash: String!
153
- extension: String
154
- fileName: String
155
- }
156
-
157
- # Input types for sync operations
158
- input ActionContextInput {
159
- signer: ReactorSignerInput
160
- }
161
-
162
- input ReactorSignerInput {
163
- user: ReactorSignerUserInput
164
- app: ReactorSignerAppInput
165
- signatures: [String!]!
166
- }
167
-
168
- input ReactorSignerUserInput {
169
- address: String!
170
- networkId: String!
171
- chainId: Int!
172
- }
173
-
174
- input ReactorSignerAppInput {
175
- name: String!
176
- key: String!
177
- }
178
-
179
- input ActionInput {
180
- id: String!
181
- type: String!
182
- timestampUtcMs: String!
183
- input: JSONObject!
184
- scope: String!
185
- attachments: [AttachmentInput!]
186
- context: ActionContextInput
187
- }
188
-
189
- input AttachmentInput {
190
- data: String!
191
- mimeType: String!
192
- hash: String!
193
- extension: String
194
- fileName: String
195
- }
196
-
197
- # Synchronization types
198
- type ReactorOperation {
199
- index: Int!
200
- timestampUtcMs: String!
201
- hash: String!
202
- skip: Int!
203
- error: String
204
- id: String
205
- action: Action!
206
- }
207
-
208
- input OperationInput {
209
- index: Int!
210
- timestampUtcMs: String!
211
- hash: String!
212
- skip: Int!
213
- error: String
214
- id: String
215
- action: ActionInput!
216
- }
217
-
218
- type OperationContext {
219
- documentId: String!
220
- documentType: String!
221
- scope: String!
222
- branch: String!
223
- }
224
-
225
- input OperationContextInput {
226
- documentId: String!
227
- documentType: String!
228
- scope: String!
229
- branch: String!
230
- }
231
-
232
- type OperationWithContext {
233
- operation: ReactorOperation!
234
- context: OperationContext!
235
- }
236
-
237
- input OperationWithContextInput {
238
- operation: OperationInput!
239
- context: OperationContextInput!
240
- }
241
-
242
- type ChannelMeta {
243
- id: String!
244
- }
245
-
246
- input ChannelMetaInput {
247
- id: String!
248
- }
249
-
250
- type RemoteCursor {
251
- remoteName: String!
252
- cursorOrdinal: Int!
253
- lastSyncedAtUtcMs: String
254
- }
255
-
256
- input RemoteCursorInput {
257
- remoteName: String!
258
- cursorOrdinal: Int!
259
- lastSyncedAtUtcMs: String
260
- }
261
-
262
- enum SyncEnvelopeType {
263
- OPERATIONS
264
- ACK
265
- }
266
-
267
- type SyncEnvelope {
268
- type: SyncEnvelopeType!
269
- channelMeta: ChannelMeta!
270
- operations: [OperationWithContext!]
271
- cursor: RemoteCursor
272
- }
273
-
274
- input SyncEnvelopeInput {
275
- type: SyncEnvelopeType!
276
- channelMeta: ChannelMetaInput!
277
- operations: [OperationWithContextInput!]
278
- cursor: RemoteCursorInput
279
- }
280
-
281
- input RemoteFilterInput {
282
- documentId: [String!]!
283
- scope: [String!]!
284
- branch: String!
285
- }
286
-
287
- input CreateChannelInput {
288
- id: String!
289
- name: String!
290
- collectionId: String!
291
- filter: RemoteFilterInput!
292
- }
293
-
294
- type Query {
295
- # Get document models for a namespace
296
- documentModels(
297
- namespace: String
298
- paging: PagingInput
299
- ): DocumentModelResultPage!
300
-
301
- # Get a specific document by ID or slug
302
- document(
303
- identifier: String!
304
- view: ViewFilterInput
305
- ): DocumentWithChildren
306
-
307
- # Get children of a document
308
- documentChildren(
309
- parentIdentifier: String!
310
- view: ViewFilterInput
311
- paging: PagingInput
312
- ): PHDocumentResultPage!
313
-
314
- # Get parents of a document
315
- documentParents(
316
- childIdentifier: String!
317
- view: ViewFilterInput
318
- paging: PagingInput
319
- ): PHDocumentResultPage!
320
-
321
- # Find documents by search criteria
322
- findDocuments(
323
- search: SearchFilterInput!
324
- view: ViewFilterInput
325
- paging: PagingInput
326
- ): PHDocumentResultPage!
327
-
328
- # Get job status
329
- jobStatus(jobId: String!): JobInfo
330
-
331
- # Poll for sync envelopes from a channel
332
- pollSyncEnvelopes(
333
- channelId: String!
334
- cursorOrdinal: Int!
335
- ): [SyncEnvelope!]!
336
- }
337
-
338
- type Mutation {
339
- # Create a new document
340
- createDocument(
341
- document: JSONObject!
342
- parentIdentifier: String
343
- ): PHDocument!
344
-
345
- # Create an empty document of specified type
346
- createEmptyDocument(
347
- documentType: String!
348
- parentIdentifier: String
349
- ): PHDocument!
350
-
351
- # Apply actions to a document (synchronous)
352
- mutateDocument(
353
- documentIdentifier: String!
354
- actions: [JSONObject!]!
355
- view: ViewFilterInput
356
- ): PHDocument!
357
-
358
- # Submit actions to a document (asynchronous)
359
- mutateDocumentAsync(
360
- documentIdentifier: String!
361
- actions: [JSONObject!]!
362
- view: ViewFilterInput
363
- ): String!
364
-
365
- # Rename a document
366
- renameDocument(
367
- documentIdentifier: String!
368
- name: String!
369
- branch: String
370
- ): PHDocument!
371
-
372
- # Add children to a document
373
- addChildren(
374
- parentIdentifier: String!
375
- documentIdentifiers: [String!]!
376
- branch: String
377
- ): PHDocument!
378
-
379
- # Remove children from a document
380
- removeChildren(
381
- parentIdentifier: String!
382
- documentIdentifiers: [String!]!
383
- branch: String
384
- ): PHDocument!
385
-
386
- # Move children between documents
387
- moveChildren(
388
- sourceParentIdentifier: String!
389
- targetParentIdentifier: String!
390
- documentIdentifiers: [String!]!
391
- branch: String
392
- ): MoveChildrenResult!
393
-
394
- # Delete a single document
395
- deleteDocument(
396
- identifier: String!
397
- propagate: PropagationMode
398
- ): Boolean!
399
-
400
- # Delete multiple documents
401
- deleteDocuments(
402
- identifiers: [String!]!
403
- propagate: PropagationMode
404
- ): Boolean!
405
-
406
- # Create or update a channel for sync
407
- createChannel(
408
- input: CreateChannelInput!
409
- ): Boolean!
410
-
411
- # Push sync envelope to a channel
412
- pushSyncEnvelope(
413
- envelope: SyncEnvelopeInput!
414
- ): Boolean!
415
- }
416
-
417
- type Subscription {
418
- # Subscribe to document changes
419
- documentChanges(
420
- search: SearchFilterInput!
421
- view: ViewFilterInput
422
- ): DocumentChangeEvent!
423
-
424
- # Subscribe to job changes
425
- jobChanges(
426
- jobId: String!
427
- ): JobChangeEvent!
428
- }
429
-
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=two-reactor-gql-sync.test.d.ts.map