@powerhousedao/reactor-api 6.0.0-dev.23 → 6.0.0-dev.230

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 (326) hide show
  1. package/README.md +6 -0
  2. package/dist/index.d.mts +3039 -0
  3. package/dist/index.d.mts.map +1 -0
  4. package/dist/index.mjs +6691 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/dist/src/packages/https-hooks.d.mts +39 -0
  7. package/dist/src/packages/https-hooks.d.mts.map +1 -0
  8. package/dist/src/packages/https-hooks.mjs +79 -0
  9. package/dist/src/packages/https-hooks.mjs.map +1 -0
  10. package/dist/src/packages/vite-loader.d.mts +29 -0
  11. package/dist/src/packages/vite-loader.d.mts.map +1 -0
  12. package/dist/src/packages/vite-loader.mjs +142 -0
  13. package/dist/src/packages/vite-loader.mjs.map +1 -0
  14. package/dist/types-Do4QTfT3.d.mts +37 -0
  15. package/dist/types-Do4QTfT3.d.mts.map +1 -0
  16. package/dist/utils-CHCRSWig.mjs +286 -0
  17. package/dist/utils-CHCRSWig.mjs.map +1 -0
  18. package/package.json +75 -64
  19. package/dist/codegen.d.ts +0 -4
  20. package/dist/codegen.d.ts.map +0 -1
  21. package/dist/codegen.js +0 -38
  22. package/dist/codegen.js.map +0 -1
  23. package/dist/index.d.ts +0 -14
  24. package/dist/index.d.ts.map +0 -1
  25. package/dist/index.js +0 -14
  26. package/dist/index.js.map +0 -1
  27. package/dist/src/config.d.ts +0 -7
  28. package/dist/src/config.d.ts.map +0 -1
  29. package/dist/src/config.js +0 -10
  30. package/dist/src/config.js.map +0 -1
  31. package/dist/src/graphql/analytics-subgraph.d.ts +0 -14
  32. package/dist/src/graphql/analytics-subgraph.d.ts.map +0 -1
  33. package/dist/src/graphql/analytics-subgraph.js +0 -26
  34. package/dist/src/graphql/analytics-subgraph.js.map +0 -1
  35. package/dist/src/graphql/auth/index.d.ts +0 -2
  36. package/dist/src/graphql/auth/index.d.ts.map +0 -1
  37. package/dist/src/graphql/auth/index.js +0 -2
  38. package/dist/src/graphql/auth/index.js.map +0 -1
  39. package/dist/src/graphql/auth/resolvers.d.ts +0 -149
  40. package/dist/src/graphql/auth/resolvers.d.ts.map +0 -1
  41. package/dist/src/graphql/auth/resolvers.js +0 -173
  42. package/dist/src/graphql/auth/resolvers.js.map +0 -1
  43. package/dist/src/graphql/auth/schema.graphql +0 -173
  44. package/dist/src/graphql/auth/subgraph.d.ts +0 -177
  45. package/dist/src/graphql/auth/subgraph.d.ts.map +0 -1
  46. package/dist/src/graphql/auth/subgraph.js +0 -340
  47. package/dist/src/graphql/auth/subgraph.js.map +0 -1
  48. package/dist/src/graphql/base-subgraph.d.ts +0 -20
  49. package/dist/src/graphql/base-subgraph.d.ts.map +0 -1
  50. package/dist/src/graphql/base-subgraph.js +0 -34
  51. package/dist/src/graphql/base-subgraph.js.map +0 -1
  52. package/dist/src/graphql/document-model-subgraph.d.ts +0 -51
  53. package/dist/src/graphql/document-model-subgraph.d.ts.map +0 -1
  54. package/dist/src/graphql/document-model-subgraph.js +0 -104
  55. package/dist/src/graphql/document-model-subgraph.js.map +0 -1
  56. package/dist/src/graphql/drive-subgraph.d.ts +0 -25
  57. package/dist/src/graphql/drive-subgraph.d.ts.map +0 -1
  58. package/dist/src/graphql/drive-subgraph.js +0 -487
  59. package/dist/src/graphql/drive-subgraph.js.map +0 -1
  60. package/dist/src/graphql/graphql-manager.d.ts +0 -47
  61. package/dist/src/graphql/graphql-manager.d.ts.map +0 -1
  62. package/dist/src/graphql/graphql-manager.js +0 -433
  63. package/dist/src/graphql/graphql-manager.js.map +0 -1
  64. package/dist/src/graphql/index.d.ts +0 -9
  65. package/dist/src/graphql/index.d.ts.map +0 -1
  66. package/dist/src/graphql/index.js +0 -9
  67. package/dist/src/graphql/index.js.map +0 -1
  68. package/dist/src/graphql/playground.d.ts +0 -2
  69. package/dist/src/graphql/playground.d.ts.map +0 -1
  70. package/dist/src/graphql/playground.js +0 -74
  71. package/dist/src/graphql/playground.js.map +0 -1
  72. package/dist/src/graphql/reactor/adapters.d.ts +0 -62
  73. package/dist/src/graphql/reactor/adapters.d.ts.map +0 -1
  74. package/dist/src/graphql/reactor/adapters.js +0 -270
  75. package/dist/src/graphql/reactor/adapters.js.map +0 -1
  76. package/dist/src/graphql/reactor/factory.d.ts +0 -84
  77. package/dist/src/graphql/reactor/factory.d.ts.map +0 -1
  78. package/dist/src/graphql/reactor/factory.js +0 -7
  79. package/dist/src/graphql/reactor/factory.js.map +0 -1
  80. package/dist/src/graphql/reactor/gen/graphql.d.ts +0 -1242
  81. package/dist/src/graphql/reactor/gen/graphql.d.ts.map +0 -1
  82. package/dist/src/graphql/reactor/gen/graphql.js +0 -496
  83. package/dist/src/graphql/reactor/gen/graphql.js.map +0 -1
  84. package/dist/src/graphql/reactor/index.d.ts +0 -4
  85. package/dist/src/graphql/reactor/index.d.ts.map +0 -1
  86. package/dist/src/graphql/reactor/index.js +0 -4
  87. package/dist/src/graphql/reactor/index.js.map +0 -1
  88. package/dist/src/graphql/reactor/operations.graphql +0 -253
  89. package/dist/src/graphql/reactor/pubsub.d.ts +0 -27
  90. package/dist/src/graphql/reactor/pubsub.d.ts.map +0 -1
  91. package/dist/src/graphql/reactor/pubsub.js +0 -93
  92. package/dist/src/graphql/reactor/pubsub.js.map +0 -1
  93. package/dist/src/graphql/reactor/requester.d.ts +0 -4
  94. package/dist/src/graphql/reactor/requester.d.ts.map +0 -1
  95. package/dist/src/graphql/reactor/requester.js +0 -22
  96. package/dist/src/graphql/reactor/requester.js.map +0 -1
  97. package/dist/src/graphql/reactor/requester.with-zod.d.ts +0 -4
  98. package/dist/src/graphql/reactor/requester.with-zod.d.ts.map +0 -1
  99. package/dist/src/graphql/reactor/requester.with-zod.js +0 -53
  100. package/dist/src/graphql/reactor/requester.with-zod.js.map +0 -1
  101. package/dist/src/graphql/reactor/resolvers.d.ts +0 -175
  102. package/dist/src/graphql/reactor/resolvers.d.ts.map +0 -1
  103. package/dist/src/graphql/reactor/resolvers.js +0 -526
  104. package/dist/src/graphql/reactor/resolvers.js.map +0 -1
  105. package/dist/src/graphql/reactor/schema.graphql +0 -432
  106. package/dist/src/graphql/reactor/subgraph.d.ts +0 -47
  107. package/dist/src/graphql/reactor/subgraph.d.ts.map +0 -1
  108. package/dist/src/graphql/reactor/subgraph.js +0 -555
  109. package/dist/src/graphql/reactor/subgraph.js.map +0 -1
  110. package/dist/src/graphql/reactor/validation.d.ts +0 -102
  111. package/dist/src/graphql/reactor/validation.d.ts.map +0 -1
  112. package/dist/src/graphql/reactor/validation.js +0 -73
  113. package/dist/src/graphql/reactor/validation.js.map +0 -1
  114. package/dist/src/graphql/system/env/getters.d.ts +0 -2
  115. package/dist/src/graphql/system/env/getters.d.ts.map +0 -1
  116. package/dist/src/graphql/system/env/getters.js +0 -4
  117. package/dist/src/graphql/system/env/getters.js.map +0 -1
  118. package/dist/src/graphql/system/env/index.d.ts +0 -2
  119. package/dist/src/graphql/system/env/index.d.ts.map +0 -1
  120. package/dist/src/graphql/system/env/index.js +0 -5
  121. package/dist/src/graphql/system/env/index.js.map +0 -1
  122. package/dist/src/graphql/system/index.d.ts +0 -3
  123. package/dist/src/graphql/system/index.d.ts.map +0 -1
  124. package/dist/src/graphql/system/index.js +0 -3
  125. package/dist/src/graphql/system/index.js.map +0 -1
  126. package/dist/src/graphql/system/system-subgraph.d.ts +0 -49
  127. package/dist/src/graphql/system/system-subgraph.d.ts.map +0 -1
  128. package/dist/src/graphql/system/system-subgraph.js +0 -130
  129. package/dist/src/graphql/system/system-subgraph.js.map +0 -1
  130. package/dist/src/graphql/system/types.d.ts +0 -2
  131. package/dist/src/graphql/system/types.d.ts.map +0 -1
  132. package/dist/src/graphql/system/types.js +0 -2
  133. package/dist/src/graphql/system/types.js.map +0 -1
  134. package/dist/src/graphql/temp-hack-rwa-type-defs.d.ts +0 -57
  135. package/dist/src/graphql/temp-hack-rwa-type-defs.d.ts.map +0 -1
  136. package/dist/src/graphql/temp-hack-rwa-type-defs.js +0 -2
  137. package/dist/src/graphql/temp-hack-rwa-type-defs.js.map +0 -1
  138. package/dist/src/graphql/types.d.ts +0 -103
  139. package/dist/src/graphql/types.d.ts.map +0 -1
  140. package/dist/src/graphql/types.js +0 -2
  141. package/dist/src/graphql/types.js.map +0 -1
  142. package/dist/src/graphql/utils.d.ts +0 -26
  143. package/dist/src/graphql/utils.d.ts.map +0 -1
  144. package/dist/src/graphql/utils.js +0 -100
  145. package/dist/src/graphql/utils.js.map +0 -1
  146. package/dist/src/graphql/websocket.d.ts +0 -3
  147. package/dist/src/graphql/websocket.d.ts.map +0 -1
  148. package/dist/src/graphql/websocket.js +0 -15
  149. package/dist/src/graphql/websocket.js.map +0 -1
  150. package/dist/src/migrations/001_create_document_permissions.d.ts +0 -4
  151. package/dist/src/migrations/001_create_document_permissions.d.ts.map +0 -1
  152. package/dist/src/migrations/001_create_document_permissions.js +0 -91
  153. package/dist/src/migrations/001_create_document_permissions.js.map +0 -1
  154. package/dist/src/migrations/index.d.ts +0 -10
  155. package/dist/src/migrations/index.d.ts.map +0 -1
  156. package/dist/src/migrations/index.js +0 -56
  157. package/dist/src/migrations/index.js.map +0 -1
  158. package/dist/src/packages/import-loader.d.ts +0 -16
  159. package/dist/src/packages/import-loader.d.ts.map +0 -1
  160. package/dist/src/packages/import-loader.js +0 -61
  161. package/dist/src/packages/import-loader.js.map +0 -1
  162. package/dist/src/packages/import-resolver.d.ts +0 -5
  163. package/dist/src/packages/import-resolver.d.ts.map +0 -1
  164. package/dist/src/packages/import-resolver.js +0 -127
  165. package/dist/src/packages/import-resolver.js.map +0 -1
  166. package/dist/src/packages/package-manager.d.ts +0 -34
  167. package/dist/src/packages/package-manager.d.ts.map +0 -1
  168. package/dist/src/packages/package-manager.js +0 -213
  169. package/dist/src/packages/package-manager.js.map +0 -1
  170. package/dist/src/packages/types.d.ts +0 -39
  171. package/dist/src/packages/types.d.ts.map +0 -1
  172. package/dist/src/packages/types.js +0 -2
  173. package/dist/src/packages/types.js.map +0 -1
  174. package/dist/src/packages/util.d.ts +0 -27
  175. package/dist/src/packages/util.d.ts.map +0 -1
  176. package/dist/src/packages/util.js +0 -97
  177. package/dist/src/packages/util.js.map +0 -1
  178. package/dist/src/packages/vite-loader.d.ts +0 -24
  179. package/dist/src/packages/vite-loader.d.ts.map +0 -1
  180. package/dist/src/packages/vite-loader.js +0 -172
  181. package/dist/src/packages/vite-loader.js.map +0 -1
  182. package/dist/src/server.d.ts +0 -73
  183. package/dist/src/server.d.ts.map +0 -1
  184. package/dist/src/server.js +0 -431
  185. package/dist/src/server.js.map +0 -1
  186. package/dist/src/services/auth.service.d.ts +0 -68
  187. package/dist/src/services/auth.service.d.ts.map +0 -1
  188. package/dist/src/services/auth.service.js +0 -199
  189. package/dist/src/services/auth.service.js.map +0 -1
  190. package/dist/src/services/document-permission.service.d.ts +0 -201
  191. package/dist/src/services/document-permission.service.d.ts.map +0 -1
  192. package/dist/src/services/document-permission.service.js +0 -636
  193. package/dist/src/services/document-permission.service.js.map +0 -1
  194. package/dist/src/sync/types.d.ts +0 -10
  195. package/dist/src/sync/types.d.ts.map +0 -1
  196. package/dist/src/sync/types.js +0 -2
  197. package/dist/src/sync/types.js.map +0 -1
  198. package/dist/src/sync/utils.d.ts +0 -7
  199. package/dist/src/sync/utils.d.ts.map +0 -1
  200. package/dist/src/sync/utils.js +0 -78
  201. package/dist/src/sync/utils.js.map +0 -1
  202. package/dist/src/tracing.d.ts +0 -4
  203. package/dist/src/tracing.d.ts.map +0 -1
  204. package/dist/src/tracing.js +0 -122
  205. package/dist/src/tracing.js.map +0 -1
  206. package/dist/src/types.d.ts +0 -18
  207. package/dist/src/types.d.ts.map +0 -1
  208. package/dist/src/types.js +0 -2
  209. package/dist/src/types.js.map +0 -1
  210. package/dist/src/utils/auth.d.ts +0 -3
  211. package/dist/src/utils/auth.d.ts.map +0 -1
  212. package/dist/src/utils/auth.js +0 -19
  213. package/dist/src/utils/auth.js.map +0 -1
  214. package/dist/src/utils/create-schema.d.ts +0 -11
  215. package/dist/src/utils/create-schema.d.ts.map +0 -1
  216. package/dist/src/utils/create-schema.js +0 -322
  217. package/dist/src/utils/create-schema.js.map +0 -1
  218. package/dist/src/utils/db.d.ts +0 -74
  219. package/dist/src/utils/db.d.ts.map +0 -1
  220. package/dist/src/utils/db.js +0 -101
  221. package/dist/src/utils/db.js.map +0 -1
  222. package/dist/src/utils/drive-url.d.ts +0 -2
  223. package/dist/src/utils/drive-url.d.ts.map +0 -1
  224. package/dist/src/utils/drive-url.js +0 -3
  225. package/dist/src/utils/drive-url.js.map +0 -1
  226. package/dist/src/utils/index.d.ts +0 -4
  227. package/dist/src/utils/index.d.ts.map +0 -1
  228. package/dist/src/utils/index.js +0 -4
  229. package/dist/src/utils/index.js.map +0 -1
  230. package/dist/test/benchmarks/load.bench.d.ts +0 -2
  231. package/dist/test/benchmarks/load.bench.d.ts.map +0 -1
  232. package/dist/test/benchmarks/load.bench.js +0 -73
  233. package/dist/test/benchmarks/load.bench.js.map +0 -1
  234. package/dist/test/benchmarks/sync.bench.d.ts +0 -2
  235. package/dist/test/benchmarks/sync.bench.d.ts.map +0 -1
  236. package/dist/test/benchmarks/sync.bench.js +0 -119
  237. package/dist/test/benchmarks/sync.bench.js.map +0 -1
  238. package/dist/test/document-permission.service.test.d.ts +0 -2
  239. package/dist/test/document-permission.service.test.d.ts.map +0 -1
  240. package/dist/test/document-permission.service.test.js +0 -480
  241. package/dist/test/document-permission.service.test.js.map +0 -1
  242. package/dist/test/drive-handlers.d.ts +0 -4
  243. package/dist/test/drive-handlers.d.ts.map +0 -1
  244. package/dist/test/drive-handlers.js +0 -39
  245. package/dist/test/drive-handlers.js.map +0 -1
  246. package/dist/test/drive-subgraph-permissions.test.d.ts +0 -2
  247. package/dist/test/drive-subgraph-permissions.test.d.ts.map +0 -1
  248. package/dist/test/drive-subgraph-permissions.test.js +0 -195
  249. package/dist/test/drive-subgraph-permissions.test.js.map +0 -1
  250. package/dist/test/drive.test.d.ts +0 -2
  251. package/dist/test/drive.test.d.ts.map +0 -1
  252. package/dist/test/drive.test.js +0 -142
  253. package/dist/test/drive.test.js.map +0 -1
  254. package/dist/test/identity-integration.test.d.ts +0 -2
  255. package/dist/test/identity-integration.test.d.ts.map +0 -1
  256. package/dist/test/identity-integration.test.js +0 -349
  257. package/dist/test/identity-integration.test.js.map +0 -1
  258. package/dist/test/index.d.ts +0 -3
  259. package/dist/test/index.d.ts.map +0 -1
  260. package/dist/test/index.js +0 -3
  261. package/dist/test/index.js.map +0 -1
  262. package/dist/test/permissions-integration.test.d.ts +0 -2
  263. package/dist/test/permissions-integration.test.d.ts.map +0 -1
  264. package/dist/test/permissions-integration.test.js +0 -421
  265. package/dist/test/permissions-integration.test.js.map +0 -1
  266. package/dist/test/pull-responder-transmitter.test.d.ts +0 -2
  267. package/dist/test/pull-responder-transmitter.test.d.ts.map +0 -1
  268. package/dist/test/pull-responder-transmitter.test.js +0 -220
  269. package/dist/test/pull-responder-transmitter.test.js.map +0 -1
  270. package/dist/test/push-transmitter.test.d.ts +0 -2
  271. package/dist/test/push-transmitter.test.d.ts.map +0 -1
  272. package/dist/test/push-transmitter.test.js +0 -179
  273. package/dist/test/push-transmitter.test.js.map +0 -1
  274. package/dist/test/reactor-adapters.test.d.ts +0 -2
  275. package/dist/test/reactor-adapters.test.d.ts.map +0 -1
  276. package/dist/test/reactor-adapters.test.js +0 -379
  277. package/dist/test/reactor-adapters.test.js.map +0 -1
  278. package/dist/test/reactor-client.test.d.ts +0 -2
  279. package/dist/test/reactor-client.test.d.ts.map +0 -1
  280. package/dist/test/reactor-client.test.js +0 -212
  281. package/dist/test/reactor-client.test.js.map +0 -1
  282. package/dist/test/reactor-resolvers.test.d.ts +0 -2
  283. package/dist/test/reactor-resolvers.test.d.ts.map +0 -1
  284. package/dist/test/reactor-resolvers.test.js +0 -261
  285. package/dist/test/reactor-resolvers.test.js.map +0 -1
  286. package/dist/test/reactor-subgraph-permissions.test.d.ts +0 -2
  287. package/dist/test/reactor-subgraph-permissions.test.d.ts.map +0 -1
  288. package/dist/test/reactor-subgraph-permissions.test.js +0 -400
  289. package/dist/test/reactor-subgraph-permissions.test.js.map +0 -1
  290. package/dist/test/router.test.d.ts +0 -2
  291. package/dist/test/router.test.d.ts.map +0 -1
  292. package/dist/test/router.test.js +0 -38
  293. package/dist/test/router.test.js.map +0 -1
  294. package/dist/test/subscriptions.test.d.ts +0 -2
  295. package/dist/test/subscriptions.test.d.ts.map +0 -1
  296. package/dist/test/subscriptions.test.js +0 -246
  297. package/dist/test/subscriptions.test.js.map +0 -1
  298. package/dist/test/system.test.d.ts +0 -2
  299. package/dist/test/system.test.d.ts.map +0 -1
  300. package/dist/test/system.test.js +0 -211
  301. package/dist/test/system.test.js.map +0 -1
  302. package/dist/test/three-reactor-gql-sync.test.d.ts +0 -2
  303. package/dist/test/three-reactor-gql-sync.test.d.ts.map +0 -1
  304. package/dist/test/three-reactor-gql-sync.test.js +0 -368
  305. package/dist/test/three-reactor-gql-sync.test.js.map +0 -1
  306. package/dist/test/two-reactor-gql-catchup-duplicate.test.d.ts +0 -2
  307. package/dist/test/two-reactor-gql-catchup-duplicate.test.d.ts.map +0 -1
  308. package/dist/test/two-reactor-gql-catchup-duplicate.test.js +0 -264
  309. package/dist/test/two-reactor-gql-catchup-duplicate.test.js.map +0 -1
  310. package/dist/test/two-reactor-gql-sync.test.d.ts +0 -2
  311. package/dist/test/two-reactor-gql-sync.test.d.ts.map +0 -1
  312. package/dist/test/two-reactor-gql-sync.test.js +0 -348
  313. package/dist/test/two-reactor-gql-sync.test.js.map +0 -1
  314. package/dist/test/utils/gql-resolver-bridge.d.ts +0 -12
  315. package/dist/test/utils/gql-resolver-bridge.d.ts.map +0 -1
  316. package/dist/test/utils/gql-resolver-bridge.js +0 -60
  317. package/dist/test/utils/gql-resolver-bridge.js.map +0 -1
  318. package/dist/test/utils.d.ts +0 -10
  319. package/dist/test/utils.d.ts.map +0 -1
  320. package/dist/test/utils.js +0 -23
  321. package/dist/test/utils.js.map +0 -1
  322. package/dist/tsconfig.tsbuildinfo +0 -1
  323. package/dist/vitest.config.d.ts +0 -3
  324. package/dist/vitest.config.d.ts.map +0 -1
  325. package/dist/vitest.config.js +0 -38
  326. package/dist/vitest.config.js.map +0 -1
@@ -0,0 +1,3039 @@
1
+ import { i as IPackageManagerOptions, n as IPackageLoaderOptions, r as IPackageManager, s as PackageManagerResult, t as IPackageLoader } from "./types-Do4QTfT3.mjs";
2
+ import { IAnalyticsStore } from "@powerhousedao/analytics-engine-core";
3
+ import { AnalyticsModel } from "@powerhousedao/analytics-engine-graphql";
4
+ import * as graphql from "graphql";
5
+ import { DocumentNode, GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig, GraphQLSchema } from "graphql";
6
+ import { ILogger } from "document-model";
7
+ import { CorsOptions } from "cors";
8
+ import http from "node:http";
9
+ import { DocumentModelGlobalState as DocumentModelGlobalState$1, DocumentModelModule, Operation, PHDocument, PHDocumentHeader } from "@powerhousedao/shared/document-model";
10
+ import { IDocumentModelLoader, IDocumentModelRegistry, IReactorClient, IRelationalDb, ISyncManager, ParsedDriveUrl, ReactorClientModule, driveIdFromUrl, parseDriveUrl } from "@powerhousedao/reactor";
11
+ import * as z$1 from "zod";
12
+ import { DocumentDriveDocument, DocumentDriveGlobalState } from "@powerhousedao/shared/document-drive";
13
+ import { AttachmentBuildResult } from "@powerhousedao/reactor-attachments";
14
+ import { WebSocketServer } from "ws";
15
+ import { IProcessorHostModule, IRelationalDb as IRelationalDb$1, ProcessorApp, ProcessorRecord } from "@powerhousedao/shared/processors";
16
+ import { Generated, Kysely } from "kysely";
17
+ import { PGlite } from "@electric-sql/pglite";
18
+ import { Knex } from "knex";
19
+ import { GraphQLResolverMap, GraphQLSchemaModule } from "@apollo/subgraph/dist/schema-helper/resolverMap.js";
20
+ import { Context as Context$1, GqlDocument as GqlDocument$1, GqlDriveDocument as GqlDriveDocument$1, GqlOperation as GqlOperation$1, GraphQLManager as GraphQLManager$1, ISubgraph as ISubgraph$1, Processor as Processor$1, SubgraphArgs as SubgraphArgs$1, SubgraphClass as SubgraphClass$1 } from "@powerhousedao/reactor-api";
21
+ import { IncomingHttpHeaders } from "http";
22
+ import { Pool } from "pg";
23
+
24
+ //#region src/utils/db.d.ts
25
+ /**
26
+ * Permission levels for documents:
27
+ * - READ: Can fetch and read the document
28
+ * - WRITE: Can push updates and modify the document
29
+ * - ADMIN: Can manage document permissions and settings
30
+ */
31
+ type DocumentPermissionLevel = "READ" | "WRITE" | "ADMIN";
32
+ /**
33
+ * Database schema for document permissions
34
+ */
35
+ interface DocumentProtectionTable {
36
+ documentId: string;
37
+ protected: boolean;
38
+ ownerAddress: string | null;
39
+ createdAt: Date;
40
+ updatedAt: Date;
41
+ }
42
+ interface DocumentPermissionDatabase {
43
+ DocumentPermission: DocumentPermissionTable;
44
+ Group: GroupTable;
45
+ UserGroup: UserGroupTable;
46
+ DocumentGroupPermission: DocumentGroupPermissionTable;
47
+ OperationUserPermission: OperationUserPermissionTable;
48
+ OperationGroupPermission: OperationGroupPermissionTable;
49
+ DocumentProtection: DocumentProtectionTable;
50
+ }
51
+ interface DocumentPermissionTable {
52
+ id: Generated<number>;
53
+ documentId: string;
54
+ userAddress: string;
55
+ permission: DocumentPermissionLevel;
56
+ grantedBy: string;
57
+ createdAt: Date;
58
+ updatedAt: Date;
59
+ }
60
+ interface GroupTable {
61
+ id: Generated<number>;
62
+ name: string;
63
+ description: string | null;
64
+ createdAt: Date;
65
+ updatedAt: Date;
66
+ }
67
+ interface UserGroupTable {
68
+ userAddress: string;
69
+ groupId: number;
70
+ createdAt: Date;
71
+ }
72
+ interface DocumentGroupPermissionTable {
73
+ id: Generated<number>;
74
+ documentId: string;
75
+ groupId: number;
76
+ permission: DocumentPermissionLevel;
77
+ grantedBy: string;
78
+ createdAt: Date;
79
+ updatedAt: Date;
80
+ }
81
+ interface OperationUserPermissionTable {
82
+ id: Generated<number>;
83
+ documentId: string;
84
+ operationType: string;
85
+ userAddress: string;
86
+ grantedBy: string;
87
+ createdAt: Date;
88
+ }
89
+ interface OperationGroupPermissionTable {
90
+ id: Generated<number>;
91
+ documentId: string;
92
+ operationType: string;
93
+ groupId: number;
94
+ grantedBy: string;
95
+ createdAt: Date;
96
+ }
97
+ type Db = Kysely<any>;
98
+ /**
99
+ * Optional factory used by callers (e.g. Switchboard) to inject a
100
+ * version-specific PGLite instance — e.g. `pglite-legacy-02` when an existing
101
+ * data dir was created with an older PG major. Wire-compatible with the
102
+ * current PGLite class for the surface knex-pglite uses.
103
+ */
104
+ type PgliteFactory = (connectionString: string | undefined) => PGlite;
105
+ declare function getDbClient(connectionString?: string | undefined, pgliteFactory?: PgliteFactory): {
106
+ db: Db;
107
+ knex: Knex;
108
+ pglite: PGlite | undefined;
109
+ };
110
+ declare const initAnalyticsStoreSql: string[];
111
+ //#endregion
112
+ //#region src/services/document-permission.service.d.ts
113
+ interface DocumentPermissionEntry {
114
+ documentId: string;
115
+ userAddress: string;
116
+ permission: DocumentPermissionLevel;
117
+ grantedBy: string;
118
+ createdAt: Date;
119
+ updatedAt: Date;
120
+ }
121
+ interface Group {
122
+ id: number;
123
+ name: string;
124
+ description: string | null;
125
+ createdAt: Date;
126
+ updatedAt: Date;
127
+ }
128
+ interface DocumentGroupPermissionEntry {
129
+ documentId: string;
130
+ groupId: number;
131
+ permission: DocumentPermissionLevel;
132
+ grantedBy: string;
133
+ createdAt: Date;
134
+ updatedAt: Date;
135
+ }
136
+ interface OperationUserPermissionEntry {
137
+ documentId: string;
138
+ operationType: string;
139
+ userAddress: string;
140
+ grantedBy: string;
141
+ createdAt: Date;
142
+ }
143
+ interface OperationGroupPermissionEntry {
144
+ documentId: string;
145
+ operationType: string;
146
+ groupId: number;
147
+ grantedBy: string;
148
+ createdAt: Date;
149
+ }
150
+ /**
151
+ * Function type for getting parent document IDs
152
+ * This is injected to avoid circular dependencies with the reactor client
153
+ */
154
+ type GetParentIdsFn = (documentId: string) => Promise<string[]>;
155
+ /**
156
+ * Configuration for the DocumentPermissionService
157
+ */
158
+ interface DocumentPermissionConfig {
159
+ defaultProtection: boolean;
160
+ }
161
+ /**
162
+ * Service for managing document-level permissions.
163
+ *
164
+ * Permission levels for documents:
165
+ * - READ: Can fetch and read the document
166
+ * - WRITE: Can push updates and modify the document
167
+ * - ADMIN: Can manage document permissions and settings
168
+ *
169
+ * Operation permissions:
170
+ * - Users and groups can be granted permission to execute specific operations
171
+ */
172
+ declare class DocumentPermissionService {
173
+ private readonly db;
174
+ readonly config: DocumentPermissionConfig;
175
+ constructor(db: Kysely<DocumentPermissionDatabase>, config?: DocumentPermissionConfig);
176
+ /**
177
+ * Get the permission level for a user on a specific document.
178
+ * Returns null if no permission is set.
179
+ */
180
+ getUserPermission(documentId: string, userAddress: string): Promise<DocumentPermissionLevel | null>;
181
+ /**
182
+ * Get all permissions for a document
183
+ */
184
+ getDocumentPermissions(documentId: string): Promise<DocumentPermissionEntry[]>;
185
+ /**
186
+ * Get all documents a user has explicit access to
187
+ */
188
+ getUserDocuments(userAddress: string): Promise<DocumentPermissionEntry[]>;
189
+ /**
190
+ * Grant or update a user's permission on a document.
191
+ */
192
+ grantPermission(documentId: string, userAddress: string, permission: DocumentPermissionLevel, grantedBy: string): Promise<DocumentPermissionEntry>;
193
+ /**
194
+ * Revoke a user's permission on a document
195
+ */
196
+ revokePermission(documentId: string, userAddress: string): Promise<void>;
197
+ /**
198
+ * Delete all permissions for a document (used when deleting a document)
199
+ */
200
+ deleteAllDocumentPermissions(documentId: string): Promise<void>;
201
+ /**
202
+ * Check if a user can read a document.
203
+ * Returns true if user has READ, WRITE, or ADMIN permission (direct or via group)
204
+ */
205
+ canReadDocument(documentId: string, userAddress: string | undefined): Promise<boolean>;
206
+ /**
207
+ * Check if a user can write to a document.
208
+ * Returns true if user has WRITE or ADMIN permission (direct or via group)
209
+ */
210
+ canWriteDocument(documentId: string, userAddress: string | undefined): Promise<boolean>;
211
+ /**
212
+ * Check if a user can manage a document (change permissions, settings).
213
+ * Returns true if user has ADMIN permission (direct or via group)
214
+ */
215
+ canManageDocument(documentId: string, userAddress: string | undefined): Promise<boolean>;
216
+ /**
217
+ * Check if a user can read a document, including parent permission inheritance.
218
+ * Returns true if user has permission on the document OR any parent in the hierarchy.
219
+ */
220
+ canRead(documentId: string, userAddress: string | undefined, getParentIds: GetParentIdsFn): Promise<boolean>;
221
+ /**
222
+ * Check if a user can write to a document, including parent permission inheritance.
223
+ * Returns true if user has write permission on the document OR any parent in the hierarchy.
224
+ */
225
+ canWrite(documentId: string, userAddress: string | undefined, getParentIds: GetParentIdsFn): Promise<boolean>;
226
+ /**
227
+ * Filter a list of document IDs to only include those the user can read.
228
+ */
229
+ filterReadableDocuments(documentIds: string[], userAddress: string | undefined, getParentIds: GetParentIdsFn): Promise<string[]>;
230
+ /**
231
+ * Create a new group
232
+ */
233
+ createGroup(name: string, description?: string): Promise<Group>;
234
+ /**
235
+ * Delete a group and all its associations
236
+ */
237
+ deleteGroup(groupId: number): Promise<void>;
238
+ /**
239
+ * Get a group by ID
240
+ */
241
+ getGroup(groupId: number): Promise<Group | null>;
242
+ /**
243
+ * List all groups
244
+ */
245
+ listGroups(): Promise<Group[]>;
246
+ /**
247
+ * Add a user to a group
248
+ */
249
+ addUserToGroup(userAddress: string, groupId: number): Promise<void>;
250
+ /**
251
+ * Remove a user from a group
252
+ */
253
+ removeUserFromGroup(userAddress: string, groupId: number): Promise<void>;
254
+ /**
255
+ * Get all groups a user belongs to
256
+ */
257
+ getUserGroups(userAddress: string): Promise<Group[]>;
258
+ /**
259
+ * Get all members of a group
260
+ */
261
+ getGroupMembers(groupId: number): Promise<string[]>;
262
+ /**
263
+ * Grant a group permission on a document
264
+ */
265
+ grantGroupPermission(documentId: string, groupId: number, permission: DocumentPermissionLevel, grantedBy: string): Promise<DocumentGroupPermissionEntry>;
266
+ /**
267
+ * Revoke a group's permission on a document
268
+ */
269
+ revokeGroupPermission(documentId: string, groupId: number): Promise<void>;
270
+ /**
271
+ * Get all group permissions for a document
272
+ */
273
+ getDocumentGroupPermissions(documentId: string): Promise<DocumentGroupPermissionEntry[]>;
274
+ /**
275
+ * Get best permission level a user has on a document via groups
276
+ */
277
+ getUserGroupPermission(documentId: string, userAddress: string): Promise<DocumentPermissionLevel | null>;
278
+ /**
279
+ * Grant a user permission to execute an operation on a document
280
+ */
281
+ grantOperationPermission(documentId: string, operationType: string, userAddress: string, grantedBy: string): Promise<OperationUserPermissionEntry>;
282
+ /**
283
+ * Revoke a user's permission to execute an operation
284
+ */
285
+ revokeOperationPermission(documentId: string, operationType: string, userAddress: string): Promise<void>;
286
+ /**
287
+ * Grant a group permission to execute an operation on a document
288
+ */
289
+ grantGroupOperationPermission(documentId: string, operationType: string, groupId: number, grantedBy: string): Promise<OperationGroupPermissionEntry>;
290
+ /**
291
+ * Revoke a group's permission to execute an operation
292
+ */
293
+ revokeGroupOperationPermission(documentId: string, operationType: string, groupId: number): Promise<void>;
294
+ /**
295
+ * Get all users with permission to execute an operation
296
+ */
297
+ getOperationUserPermissions(documentId: string, operationType: string): Promise<OperationUserPermissionEntry[]>;
298
+ /**
299
+ * Get all groups with permission to execute an operation
300
+ */
301
+ getOperationGroupPermissions(documentId: string, operationType: string): Promise<OperationGroupPermissionEntry[]>;
302
+ /**
303
+ * Check if a user can execute a specific operation on a document.
304
+ * Returns true if user has direct permission or is in a group with permission.
305
+ */
306
+ canExecuteOperation(documentId: string, operationType: string, userAddress: string | undefined): Promise<boolean>;
307
+ /**
308
+ * Check if an operation has any permissions set (is restricted)
309
+ */
310
+ isOperationRestricted(documentId: string, operationType: string): Promise<boolean>;
311
+ /**
312
+ * Check if a specific document has a protection row set to true.
313
+ * Falls back to `config.defaultProtection` if no row exists.
314
+ */
315
+ isDocumentProtected(documentId: string): Promise<boolean>;
316
+ /**
317
+ * Walk the parent chain: if the document itself or any ancestor is protected, return true.
318
+ * Collects all ancestor IDs first (with cycle detection), then batch-checks protection.
319
+ */
320
+ isProtectedWithAncestors(documentId: string, getParentIds: GetParentIdsFn): Promise<boolean>;
321
+ /**
322
+ * Collect all ancestor IDs (including the document itself) with cycle detection.
323
+ */
324
+ private collectAncestorIds;
325
+ /**
326
+ * Upsert protection status for a document.
327
+ */
328
+ setDocumentProtection(documentId: string, isProtected: boolean): Promise<void>;
329
+ /**
330
+ * Get the owner address for a document, or null if not set.
331
+ */
332
+ getDocumentOwner(documentId: string): Promise<string | null>;
333
+ /**
334
+ * Upsert owner address for a document.
335
+ */
336
+ setDocumentOwner(documentId: string, ownerAddress: string): Promise<void>;
337
+ /**
338
+ * Initialize protection for a newly created document.
339
+ * Sets protection status and grants ADMIN to the owner.
340
+ */
341
+ initializeDocumentProtection(documentId: string, ownerAddress: string, defaultProtection?: boolean): Promise<void>;
342
+ /**
343
+ * Get the full protection info for a document.
344
+ */
345
+ getDocumentProtection(documentId: string): Promise<{
346
+ documentId: string;
347
+ protected: boolean;
348
+ ownerAddress: string | null;
349
+ }>;
350
+ }
351
+ //#endregion
352
+ //#region src/services/authorization.service.d.ts
353
+ interface AuthorizationConfig {
354
+ admins: string[];
355
+ defaultProtection: boolean;
356
+ }
357
+ /**
358
+ * Central authorization service — single source of truth for all permission checks.
359
+ *
360
+ * Authorization model:
361
+ * 1. Supreme admin (ADMINS env) → ALLOW ALL
362
+ * 2. Is document protected?
363
+ * a. NOT protected:
364
+ * - READ: anyone (even anonymous) → ALLOW
365
+ * - WRITE: authenticated user → ALLOW
366
+ * b. PROTECTED:
367
+ * - READ: requires explicit READ/WRITE/ADMIN grant (direct or via group/parent)
368
+ * - WRITE: requires explicit WRITE/ADMIN grant (direct or via group/parent)
369
+ * 3. Operation restricted? → Check OperationUserPermission
370
+ * 4. Document owner = implicit ADMIN
371
+ * 5. Drive protected = all children effectively protected
372
+ */
373
+ declare class AuthorizationService {
374
+ private readonly documentPermissionService;
375
+ readonly config: AuthorizationConfig;
376
+ constructor(documentPermissionService: DocumentPermissionService, config: AuthorizationConfig);
377
+ /**
378
+ * Check if a user is a supreme admin (from ADMINS env var).
379
+ */
380
+ isSupremeAdmin(userAddress?: string): boolean;
381
+ /**
382
+ * Check if a user can read a document.
383
+ *
384
+ * - Supreme admin → yes
385
+ * - Not protected → anyone can read (even anonymous)
386
+ * - Protected → requires READ/WRITE/ADMIN grant (direct, group, or parent inheritance)
387
+ * - Owner → yes (implicit ADMIN)
388
+ */
389
+ canRead(documentId: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
390
+ /**
391
+ * Check if a user can write to a document.
392
+ *
393
+ * - Supreme admin → yes
394
+ * - Not protected → anyone can write (even anonymous)
395
+ * - Protected → requires authentication + WRITE/ADMIN grant
396
+ * - Owner → yes (implicit ADMIN)
397
+ */
398
+ canWrite(documentId: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
399
+ /**
400
+ * Check if a user can manage a document (change permissions, protection, transfer ownership).
401
+ *
402
+ * - Supreme admin → yes
403
+ * - Owner → yes
404
+ * - Has ADMIN grant → yes
405
+ */
406
+ canManage(documentId: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
407
+ /**
408
+ * Check if a user can execute a specific operation.
409
+ * If the operation is not restricted, falls through to the standard write check.
410
+ * If the operation is restricted, requires an explicit OperationUserPermission grant.
411
+ */
412
+ canExecuteOperation(documentId: string, operationType: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
413
+ /**
414
+ * Combined check for mutations: can the user write + execute the operation?
415
+ * This enables READ-only users with operation grants to execute specific operations.
416
+ * For restricted operations, only the operation grant is checked (bypasses write check),
417
+ * allowing READ-only users with an explicit operation grant to execute that operation.
418
+ */
419
+ canMutate(documentId: string, operationType: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
420
+ }
421
+ //#endregion
422
+ //#region src/graphql/types.d.ts
423
+ type SubgraphClass = typeof BaseSubgraph;
424
+ type Context = {
425
+ driveId?: string;
426
+ document?: PHDocument;
427
+ headers: IncomingHttpHeaders;
428
+ db: unknown;
429
+ isAdmin?: (address: string) => boolean;
430
+ user?: {
431
+ address: string;
432
+ chainId: number;
433
+ networkId: string;
434
+ };
435
+ documentPermissionService?: DocumentPermissionService;
436
+ authorizationService?: AuthorizationService;
437
+ };
438
+ type ISubgraph = {
439
+ name: string;
440
+ path?: string;
441
+ resolvers: Record<string, any>;
442
+ typeDefs: DocumentNode;
443
+ reactorClient: IReactorClient;
444
+ relationalDb: IRelationalDb;
445
+ hasSubscriptions?: boolean;
446
+ onSetup?: () => Promise<void>;
447
+ };
448
+ type SubgraphArgs = {
449
+ reactorClient: IReactorClient;
450
+ relationalDb: IRelationalDb;
451
+ analyticsStore: IAnalyticsStore;
452
+ graphqlManager: GraphQLManager$1;
453
+ syncManager: ISyncManager;
454
+ documentPermissionService?: DocumentPermissionService;
455
+ authorizationService?: AuthorizationService;
456
+ path?: string;
457
+ };
458
+ type GqlSigner = {
459
+ user: {
460
+ address: string;
461
+ networkId: string;
462
+ chainId: number;
463
+ };
464
+ app: {
465
+ name: string;
466
+ key: string;
467
+ };
468
+ signatures: string[];
469
+ };
470
+ type GqlOperationContext = {
471
+ signer: GqlSigner | undefined;
472
+ };
473
+ type GqlSignerUser = {
474
+ address: string;
475
+ networkId: string;
476
+ chainId: number;
477
+ };
478
+ type GqlSignerApp = {
479
+ name: string;
480
+ key: string;
481
+ };
482
+ type GqlOperation = {
483
+ id: string;
484
+ type: string;
485
+ index: number;
486
+ timestampUtcMs: string;
487
+ hash: string;
488
+ skip: number;
489
+ inputText: string;
490
+ error: string | undefined;
491
+ context: GqlOperationContext;
492
+ };
493
+ type GqlDocument = {
494
+ __typename?: string;
495
+ id: string;
496
+ name: string;
497
+ documentType: string;
498
+ revision: number;
499
+ createdAtUtcIso: string;
500
+ lastModifiedAtUtcIso: string;
501
+ operations: GqlOperation[];
502
+ stateJSON: JSON;
503
+ state: unknown;
504
+ initialState: unknown;
505
+ };
506
+ type GqlDriveDocument = GqlDocument & {
507
+ meta: {
508
+ preferredEditor?: string;
509
+ };
510
+ slug: string;
511
+ state: DocumentDriveGlobalState;
512
+ initialState: DocumentDriveGlobalState;
513
+ };
514
+ //#endregion
515
+ //#region src/graphql/base-subgraph.d.ts
516
+ declare class BaseSubgraph implements ISubgraph$1 {
517
+ name: string;
518
+ path: string;
519
+ resolvers: Record<string, any>;
520
+ typeDefs: DocumentNode;
521
+ reactorClient: IReactorClient;
522
+ graphqlManager: GraphQLManager$1;
523
+ relationalDb: IRelationalDb;
524
+ syncManager: ISyncManager;
525
+ documentPermissionService?: DocumentPermissionService;
526
+ authorizationService?: AuthorizationService;
527
+ constructor(args: SubgraphArgs$1);
528
+ onSetup(): Promise<void>;
529
+ protected getParentIdsFn(): GetParentIdsFn;
530
+ protected hasGlobalAdminAccess(ctx: Context): boolean;
531
+ protected canReadDocument(documentId: string, ctx: Context): Promise<boolean>;
532
+ protected assertCanRead(documentId: string, ctx: Context): Promise<void>;
533
+ protected assertCanWrite(documentId: string, ctx: Context): Promise<void>;
534
+ protected assertCanExecuteOperation(documentId: string, operationType: string, ctx: Context): Promise<void>;
535
+ }
536
+ //#endregion
537
+ //#region src/graphql/analytics-subgraph.d.ts
538
+ declare class AnalyticsSubgraph extends BaseSubgraph {
539
+ analyticsStore: IAnalyticsStore;
540
+ analyticsModel: AnalyticsModel;
541
+ name: string;
542
+ typeDefs: graphql.DocumentNode;
543
+ resolvers: GraphQLResolverMap<Context$1>;
544
+ constructor(args: SubgraphArgs$1);
545
+ }
546
+ //#endregion
547
+ //#region src/graphql/auth/resolvers.d.ts
548
+ type DocumentAccessInfo = {
549
+ documentId: string;
550
+ permissions: Array<{
551
+ documentId: string;
552
+ userAddress: string;
553
+ permission: DocumentPermissionLevel;
554
+ grantedBy: string;
555
+ createdAt: Date;
556
+ updatedAt: Date;
557
+ }>;
558
+ groupPermissions: Array<{
559
+ documentId: string;
560
+ groupId: number;
561
+ permission: DocumentPermissionLevel;
562
+ grantedBy: string;
563
+ createdAt: Date;
564
+ updatedAt: Date;
565
+ }>;
566
+ };
567
+ type Group$1 = {
568
+ id: number;
569
+ name: string;
570
+ description: string | null;
571
+ createdAt: Date;
572
+ updatedAt: Date;
573
+ };
574
+ type DocumentGroupPermission = {
575
+ documentId: string;
576
+ groupId: number;
577
+ permission: DocumentPermissionLevel;
578
+ grantedBy: string;
579
+ createdAt: Date;
580
+ updatedAt: Date;
581
+ };
582
+ type OperationUserPermission = {
583
+ documentId: string;
584
+ operationType: string;
585
+ userAddress: string;
586
+ grantedBy: string;
587
+ createdAt: Date;
588
+ };
589
+ type OperationGroupPermission = {
590
+ documentId: string;
591
+ operationType: string;
592
+ groupId: number;
593
+ grantedBy: string;
594
+ createdAt: Date;
595
+ };
596
+ type OperationPermissionsInfo = {
597
+ documentId: string;
598
+ operationType: string;
599
+ userPermissions: OperationUserPermission[];
600
+ groupPermissions: OperationGroupPermission[];
601
+ };
602
+ type DocumentProtectionInfo = {
603
+ documentId: string;
604
+ protected: boolean;
605
+ ownerAddress: string | null;
606
+ };
607
+ //#endregion
608
+ //#region src/graphql/auth/subgraph.d.ts
609
+ /**
610
+ * Auth Subgraph - handles all document permission and authorization operations
611
+ *
612
+ * This subgraph is conditionally registered based on the DOCUMENT_PERMISSIONS_ENABLED
613
+ * feature flag. When enabled, it provides GraphQL operations for:
614
+ * - Document permissions (grant/revoke user access)
615
+ * - Group management (create/delete groups, manage membership)
616
+ * - Group document permissions (grant/revoke group access)
617
+ * - Operation-level permissions (fine-grained operation control)
618
+ */
619
+ declare class AuthSubgraph extends BaseSubgraph {
620
+ private logger;
621
+ constructor(args: SubgraphArgs);
622
+ name: string;
623
+ hasSubscriptions: boolean;
624
+ typeDefs: graphql.DocumentNode;
625
+ resolvers: {
626
+ Query: {
627
+ documentAccess: (_parent: unknown, args: {
628
+ documentId: string;
629
+ }) => Promise<DocumentAccessInfo>;
630
+ userDocumentPermissions: (_parent: unknown, _args: unknown, ctx: {
631
+ user?: {
632
+ address: string;
633
+ };
634
+ }) => Promise<{
635
+ documentId: string;
636
+ userAddress: string;
637
+ permission: DocumentPermissionLevel;
638
+ grantedBy: string;
639
+ createdAt: Date;
640
+ updatedAt: Date;
641
+ }[]>;
642
+ groups: () => Promise<Group$1[]>;
643
+ group: (_parent: unknown, args: {
644
+ id: number;
645
+ }) => Promise<Group$1 | null>;
646
+ userGroups: (_parent: unknown, args: {
647
+ userAddress: string;
648
+ }) => Promise<Group$1[]>;
649
+ operationPermissions: (_parent: unknown, args: {
650
+ documentId: string;
651
+ operationType: string;
652
+ }) => Promise<OperationPermissionsInfo>;
653
+ canExecuteOperation: (_parent: unknown, args: {
654
+ documentId: string;
655
+ operationType: string;
656
+ }, ctx: {
657
+ user?: {
658
+ address: string;
659
+ };
660
+ }) => Promise<boolean>;
661
+ documentProtection: (_parent: unknown, args: {
662
+ documentId: string;
663
+ }, ctx: {
664
+ user?: {
665
+ address: string;
666
+ };
667
+ }) => Promise<DocumentProtectionInfo>;
668
+ };
669
+ Mutation: {
670
+ setDocumentProtection: (_parent: unknown, args: {
671
+ documentId: string;
672
+ protected: boolean;
673
+ }, ctx: {
674
+ user?: {
675
+ address: string;
676
+ };
677
+ isAdmin?: (address: string) => boolean;
678
+ }) => Promise<DocumentProtectionInfo>;
679
+ transferDocumentOwnership: (_parent: unknown, args: {
680
+ documentId: string;
681
+ newOwnerAddress: string;
682
+ }, ctx: {
683
+ user?: {
684
+ address: string;
685
+ };
686
+ isAdmin?: (address: string) => boolean;
687
+ }) => Promise<DocumentProtectionInfo>;
688
+ grantDocumentPermission: (_parent: unknown, args: {
689
+ documentId: string;
690
+ userAddress: string;
691
+ permission: string;
692
+ }, ctx: {
693
+ user?: {
694
+ address: string;
695
+ };
696
+ isAdmin?: (address: string) => boolean;
697
+ }) => Promise<{
698
+ documentId: string;
699
+ userAddress: string;
700
+ permission: DocumentPermissionLevel;
701
+ grantedBy: string;
702
+ createdAt: Date;
703
+ updatedAt: Date;
704
+ }>;
705
+ revokeDocumentPermission: (_parent: unknown, args: {
706
+ documentId: string;
707
+ userAddress: string;
708
+ }, ctx: {
709
+ user?: {
710
+ address: string;
711
+ };
712
+ isAdmin?: (address: string) => boolean;
713
+ }) => Promise<boolean>;
714
+ createGroup: (_parent: unknown, args: {
715
+ name: string;
716
+ description?: string | null;
717
+ }) => Promise<Group$1>;
718
+ deleteGroup: (_parent: unknown, args: {
719
+ id: number;
720
+ }) => Promise<boolean>;
721
+ addUserToGroup: (_parent: unknown, args: {
722
+ userAddress: string;
723
+ groupId: number;
724
+ }) => Promise<boolean>;
725
+ removeUserFromGroup: (_parent: unknown, args: {
726
+ userAddress: string;
727
+ groupId: number;
728
+ }) => Promise<boolean>;
729
+ grantGroupPermission: (_parent: unknown, args: {
730
+ documentId: string;
731
+ groupId: number;
732
+ permission: string;
733
+ }, ctx: {
734
+ user?: {
735
+ address: string;
736
+ };
737
+ isAdmin?: (address: string) => boolean;
738
+ }) => Promise<DocumentGroupPermission>;
739
+ revokeGroupPermission: (_parent: unknown, args: {
740
+ documentId: string;
741
+ groupId: number;
742
+ }, ctx: {
743
+ user?: {
744
+ address: string;
745
+ };
746
+ isAdmin?: (address: string) => boolean;
747
+ }) => Promise<boolean>;
748
+ grantOperationPermission: (_parent: unknown, args: {
749
+ documentId: string;
750
+ operationType: string;
751
+ userAddress: string;
752
+ }, ctx: {
753
+ user?: {
754
+ address: string;
755
+ };
756
+ isAdmin?: (address: string) => boolean;
757
+ }) => Promise<OperationUserPermission>;
758
+ revokeOperationPermission: (_parent: unknown, args: {
759
+ documentId: string;
760
+ operationType: string;
761
+ userAddress: string;
762
+ }, ctx: {
763
+ user?: {
764
+ address: string;
765
+ };
766
+ isAdmin?: (address: string) => boolean;
767
+ }) => Promise<boolean>;
768
+ grantGroupOperationPermission: (_parent: unknown, args: {
769
+ documentId: string;
770
+ operationType: string;
771
+ groupId: number;
772
+ }, ctx: {
773
+ user?: {
774
+ address: string;
775
+ };
776
+ isAdmin?: (address: string) => boolean;
777
+ }) => Promise<OperationGroupPermission>;
778
+ revokeGroupOperationPermission: (_parent: unknown, args: {
779
+ documentId: string;
780
+ operationType: string;
781
+ groupId: number;
782
+ }, ctx: {
783
+ user?: {
784
+ address: string;
785
+ };
786
+ isAdmin?: (address: string) => boolean;
787
+ }) => Promise<boolean>;
788
+ };
789
+ Group: {
790
+ members: (parent: {
791
+ id: number;
792
+ }) => Promise<string[]>;
793
+ };
794
+ DocumentGroupPermission: {
795
+ group: (parent: {
796
+ groupId: number;
797
+ }) => Promise<Group$1>;
798
+ };
799
+ OperationGroupPermission: {
800
+ group: (parent: {
801
+ groupId: number;
802
+ }) => Promise<Group$1>;
803
+ };
804
+ };
805
+ onSetup(): Promise<void>;
806
+ }
807
+ //#endregion
808
+ //#region src/services/auth.service.d.ts
809
+ interface AuthConfig {
810
+ enabled: boolean;
811
+ admins: string[];
812
+ cacheTtl?: number;
813
+ skipCredentialVerification?: boolean;
814
+ }
815
+ interface User {
816
+ address: string;
817
+ chainId: number;
818
+ networkId: string;
819
+ }
820
+ interface AuthContext {
821
+ user?: User;
822
+ admins: string[];
823
+ auth_enabled: boolean;
824
+ }
825
+ declare class AuthService {
826
+ private readonly config;
827
+ constructor(config: AuthConfig);
828
+ authenticateRequest(request: globalThis.Request): Promise<AuthContext | globalThis.Response>;
829
+ /**
830
+ * Verify a Bearer token regardless of HTTP method. Use this from non-GraphQL
831
+ * middleware that must enforce authentication on every request.
832
+ */
833
+ verifyBearer(authorization: string | undefined): Promise<AuthContext | globalThis.Response>;
834
+ authenticateWebSocketConnection(connectionParams: Record<string, unknown>): Promise<User | null>;
835
+ /**
836
+ * Verify the auth bearer token
837
+ */
838
+ private verifyToken;
839
+ /**
840
+ * Extract user information from verification result
841
+ */
842
+ private extractUserFromVerification;
843
+ /**
844
+ * Get additional context fields for GraphQL
845
+ */
846
+ getAdditionalContextFields(): {
847
+ isAdmin: (address: string) => boolean;
848
+ };
849
+ /**
850
+ * Get user context for GraphQL
851
+ */
852
+ getUserContext(user?: User): {
853
+ user?: undefined;
854
+ } | {
855
+ user: {
856
+ address: string;
857
+ chainId: number;
858
+ networkId: string;
859
+ };
860
+ };
861
+ /**
862
+ * Verify that the credential still exists on the Renown API
863
+ */
864
+ private verifyCredentialExists;
865
+ }
866
+ //#endregion
867
+ //#region src/graphql/gateway/types.d.ts
868
+ type TlsOptions = {
869
+ keyPath: string;
870
+ certPath: string;
871
+ } | {
872
+ cert: Buffer | string;
873
+ key: Buffer | string;
874
+ } | true;
875
+ type GatewayContextFactory<TContext = unknown> = (request: Request) => Promise<TContext>;
876
+ type WsContextFactory<TContext = unknown> = (connectionParams: Record<string, unknown>) => Promise<TContext>;
877
+ type WsDisposer = {
878
+ dispose: () => void | Promise<void>;
879
+ };
880
+ type FetchHandler = (request: Request) => Promise<Response>;
881
+ /**
882
+ * A framework-agnostic description of a federated subgraph service.
883
+ * Used by IGatewayAdapter.createSupergraphHandler() to compose the supergraph SDL.
884
+ */
885
+ type SubgraphDefinition = {
886
+ name: string;
887
+ typeDefs: DocumentNode;
888
+ url: string;
889
+ };
890
+ interface IGatewayAdapter<TContext = unknown> {
891
+ /** One-time startup. */
892
+ start(httpServer: http.Server): Promise<void>;
893
+ /**
894
+ * Returns a Fetch API handler for the given schema.
895
+ * Caller (IHttpAdapter) is responsible for mounting it at a path.
896
+ */
897
+ createHandler(schema: GraphQLSchema, contextFactory: GatewayContextFactory<TContext>): Promise<FetchHandler>;
898
+ /**
899
+ * Create a federation gateway handler that composes all subgraphs into a supergraph.
900
+ * getSubgraphs is called eagerly (during setup) and again on every updateSupergraph() call.
901
+ */
902
+ createSupergraphHandler(getSubgraphs: () => SubgraphDefinition[], httpServer: http.Server, contextFactory: GatewayContextFactory<TContext>): Promise<FetchHandler>;
903
+ /**
904
+ * Recompose the supergraph SDL from the current subgraph list and push the update
905
+ * to the running federation gateway. No-op if createSupergraphHandler() has not
906
+ * been called yet.
907
+ */
908
+ updateSupergraph(): Promise<void>;
909
+ /** Attach WebSocket subscriptions. Returns a disposer. */
910
+ attachWebSocket(wsServer: WebSocketServer, schema: GraphQLSchema, contextFactory: WsContextFactory<TContext>): WsDisposer;
911
+ stop(): Promise<void>;
912
+ }
913
+ interface IHttpAdapter {
914
+ /** Set up CORS and body-parser equivalent middleware. */
915
+ setupMiddleware(config: {
916
+ corsOptions?: CorsOptions;
917
+ bodyLimit?: string;
918
+ }): void;
919
+ /**
920
+ * Mount a Fetch API handler.
921
+ * - exact = false (default): exact path match via internal dispatch map.
922
+ * - exact = true: prefix match - handler also receives all sub-paths
923
+ * (uses framework router.use() semantics).
924
+ */
925
+ mount(path: string, handler: FetchHandler, options?: {
926
+ exact?: boolean;
927
+ }): void;
928
+ /**
929
+ * Register a GET route that returns a Fetch Response (for health, explorer, etc.).
930
+ * Registered directly on the underlying framework app, bypassing the sub-router.
931
+ */
932
+ getRoute(path: string, handler: (request: Request) => Response | Promise<Response>): void;
933
+ /**
934
+ * Start listening on the given port. Returns the underlying http.Server
935
+ * so callers can attach WebSocket servers.
936
+ */
937
+ listen(port: number, tls?: TlsOptions): Promise<http.Server>;
938
+ /**
939
+ * Mount a raw Connect/Express-compatible middleware function (e.g. Vite dev
940
+ * server middleware). The implementation is adapter-specific; for Express this
941
+ * is equivalent to `app.use(middleware)`.
942
+ */
943
+ mountRawMiddleware(middleware: unknown): void;
944
+ /**
945
+ * Register a method-specific route handler using Node.js core HTTP types.
946
+ * Use this when a Fetch API FetchHandler is not possible (e.g. streaming
947
+ * protocols that require direct access to IncomingMessage/ServerResponse).
948
+ *
949
+ * The req/res objects are `http.IncomingMessage`/`http.ServerResponse`
950
+ * (Express Request/Response are compatible subtypes).
951
+ */
952
+ mountNodeRoute(method: "DELETE" | "GET" | "HEAD" | "POST" | "PUT", path: string, handler: (req: http.IncomingMessage, res: http.ServerResponse, body?: unknown) => void): void;
953
+ /**
954
+ * Register framework-specific Sentry error-capturing middleware after all routes
955
+ * are mounted. Each adapter calls the Sentry setup function appropriate for its
956
+ * framework (e.g. setupExpressErrorHandler, setupFastifyErrorHandler).
957
+ * No-op if Sentry is not relevant for the adapter.
958
+ */
959
+ setupSentryErrorHandler(sentry: object): void;
960
+ /** The raw framework handle (e.g. Express app). Cast as needed at call sites. */
961
+ readonly handle: unknown;
962
+ }
963
+ //#endregion
964
+ //#region src/graphql/gateway/auth-middleware.d.ts
965
+ type AuthFetchMiddleware = (handler: FetchHandler) => FetchHandler;
966
+ /** Internal — only `graphql-manager.ts` should call this. */
967
+ declare function getAuthContext(request: globalThis.Request): AuthContext | undefined;
968
+ declare function createAuthFetchMiddleware(authService: AuthService): AuthFetchMiddleware;
969
+ //#endregion
970
+ //#region src/graphql/gateway/factory.d.ts
971
+ type GatewayAdapterType = "apollo" | "mercurius";
972
+ type HttpAdapterType = "express" | "fastify";
973
+ declare function createGatewayAdapter(type: GatewayAdapterType, logger: ILogger): IGatewayAdapter<Context>;
974
+ type HttpAdapterSetup = {
975
+ adapter: IHttpAdapter;
976
+ };
977
+ declare function createHttpAdapter(type: HttpAdapterType): HttpAdapterSetup;
978
+ //#endregion
979
+ //#region src/graphql/gateway/drive-ownership-cache.d.ts
980
+ /**
981
+ * In-memory record of which drives this switchboard instance owns.
982
+ *
983
+ * Populated at startup by walking the reactor for documents of type
984
+ * `powerhouse/document-drive`. Mutated explicitly by resolver hooks
985
+ * after successful drive create / delete operations. Read by the
986
+ * drive-validation fetch middleware to short-circuit wrong-shard
987
+ * requests with a structured 421 response.
988
+ */
989
+ declare class DriveOwnershipCache {
990
+ private readonly reactorClient;
991
+ private readonly drives;
992
+ constructor(reactorClient: IReactorClient);
993
+ init(): Promise<void>;
994
+ has(driveId: string): boolean;
995
+ add(driveId: string): void;
996
+ remove(driveId: string): void;
997
+ size(): number;
998
+ }
999
+ //#endregion
1000
+ //#region src/graphql/graphql-manager.d.ts
1001
+ type GraphqlManagerFeatureFlags = {
1002
+ enableDocumentModelSubgraphs?: boolean;
1003
+ };
1004
+ declare class GraphQLManager {
1005
+ #private;
1006
+ private readonly path;
1007
+ private readonly httpServer;
1008
+ private readonly wsServer;
1009
+ private readonly reactorClient;
1010
+ private readonly relationalDb;
1011
+ private readonly analyticsStore;
1012
+ private readonly syncManager;
1013
+ private readonly logger;
1014
+ private readonly httpAdapter;
1015
+ private readonly gatewayAdapter;
1016
+ private readonly authConfig?;
1017
+ private readonly documentPermissionService?;
1018
+ private readonly featureFlags;
1019
+ private readonly port;
1020
+ private readonly authorizationService?;
1021
+ private initialized;
1022
+ private coreSubgraphsMap;
1023
+ private contextFields;
1024
+ private readonly subgraphs;
1025
+ private authService;
1026
+ private readonly subgraphWsDisposers;
1027
+ readonly driveOwnershipCache: DriveOwnershipCache;
1028
+ /** Cached document models for schema generation - updated on init and regenerate */
1029
+ private cachedDocumentModels;
1030
+ private readonly subgraphHandlerCache;
1031
+ constructor(path: string, httpServer: http.Server, wsServer: WebSocketServer, reactorClient: IReactorClient, relationalDb: IRelationalDb, analyticsStore: IAnalyticsStore, syncManager: ISyncManager, logger: ILogger, httpAdapter: IHttpAdapter, gatewayAdapter: IGatewayAdapter<Context$1>, authConfig?: AuthConfig | undefined, documentPermissionService?: DocumentPermissionService | undefined, featureFlags?: GraphqlManagerFeatureFlags, port?: number, authorizationService?: AuthorizationService | undefined);
1032
+ init(coreSubgraphs: SubgraphClass$1[], authMiddleware?: AuthFetchMiddleware): Promise<void>;
1033
+ /**
1034
+ * Regenerate document model subgraphs when models are dynamically loaded.
1035
+ * Fetches current modules from reactor client (source of truth).
1036
+ */
1037
+ regenerateDocumentModelSubgraphs(): Promise<void>;
1038
+ /**
1039
+ * Register a pre-constructed subgraph instance.
1040
+ * Use this when you need to pass custom dependencies to a subgraph.
1041
+ */
1042
+ registerSubgraphInstance(subgraphInstance: ISubgraph$1, supergraph?: string, core?: boolean): Promise<ISubgraph$1>;
1043
+ /**
1044
+ * Get the base path used for subgraph registration.
1045
+ */
1046
+ getBasePath(): string;
1047
+ registerSubgraph(subgraph: SubgraphClass$1, supergraph?: string, core?: boolean): Promise<ISubgraph$1>;
1048
+ updateRouter: (immediate?: boolean) => Promise<void>;
1049
+ private _updateRouter;
1050
+ getAdditionalContextFields: () => Record<string, any>;
1051
+ setAdditionalContextFields(fields: Record<string, any>): void;
1052
+ setSupergraph(supergraph: string, subgraphs: ISubgraph$1[]): Promise<void>;
1053
+ shutdown(): Promise<void>;
1054
+ }
1055
+ //#endregion
1056
+ //#region src/services/package-storage.d.ts
1057
+ interface InstalledPackageInfo {
1058
+ name: string;
1059
+ version?: string;
1060
+ registryUrl: string;
1061
+ installedAt: Date;
1062
+ documentTypes: string[];
1063
+ }
1064
+ interface IPackageStorage {
1065
+ get(name: string): Promise<InstalledPackageInfo | undefined>;
1066
+ getAll(): Promise<InstalledPackageInfo[]>;
1067
+ set(name: string, info: InstalledPackageInfo): Promise<void>;
1068
+ delete(name: string): Promise<boolean>;
1069
+ has(name: string): Promise<boolean>;
1070
+ }
1071
+ declare class InMemoryPackageStorage implements IPackageStorage {
1072
+ private packages;
1073
+ get(name: string): Promise<InstalledPackageInfo | undefined>;
1074
+ getAll(): Promise<InstalledPackageInfo[]>;
1075
+ set(name: string, info: InstalledPackageInfo): Promise<void>;
1076
+ delete(name: string): Promise<boolean>;
1077
+ has(name: string): Promise<boolean>;
1078
+ }
1079
+ //#endregion
1080
+ //#region src/types.d.ts
1081
+ type API = {
1082
+ httpAdapter: IHttpAdapter;
1083
+ graphqlManager: GraphQLManager$1;
1084
+ packages: IPackageManager;
1085
+ attachments: AttachmentBuildResult;
1086
+ authService: AuthService | undefined;
1087
+ /**
1088
+ * Releases resources owned by the API: shuts down the GraphQL gateway,
1089
+ * closes WebSocket and HTTP servers, destroys knex pools, and closes any
1090
+ * PGlite instances created via {@link getDbClient}. Safe to call once;
1091
+ * intended to be wired into the reactor's shutdown chain via
1092
+ * `ReactorBuilder.withShutdownHook`.
1093
+ */
1094
+ dispose: () => Promise<void>;
1095
+ };
1096
+ type ReactorModule = {
1097
+ analyticsStore: IAnalyticsStore;
1098
+ relationalDb: IRelationalDb$1;
1099
+ };
1100
+ /** Per-drive factory after the host `module` has been applied once. */
1101
+ type ProcessorDriveFactory = (driveHeader: PHDocumentHeader) => ProcessorRecord[] | Promise<ProcessorRecord[]>;
1102
+ /**
1103
+ * Builds a per-drive factory from the host module (e.g. vetra `processorFactory`).
1104
+ * Shape: `(module) => (driveHeader) => ...`
1105
+ */
1106
+ type ProcessorFactoryBuilder = (module: IProcessorHostModule) => ProcessorDriveFactory | Promise<ProcessorDriveFactory>;
1107
+ /** Multiple initializers per package name (e.g. Switchboard `processors` option). */
1108
+ type Processor = ProcessorFactoryBuilder[];
1109
+ //#endregion
1110
+ //#region src/packages/http-loader.d.ts
1111
+ interface HttpPackageLoaderOptions {
1112
+ registryUrl: string;
1113
+ }
1114
+ interface HttpPackageLoaderLogger {
1115
+ info: (msg: string) => void;
1116
+ error: (msg: string, err: unknown) => void;
1117
+ }
1118
+ /**
1119
+ * Loads document models, subgraphs, and processors from an HTTP registry.
1120
+ * Uses Node.js module loader hooks to import directly from HTTP URLs.
1121
+ *
1122
+ * IMPORTANT: Requires https-hooks to be registered before use:
1123
+ * import { register } from "node:module";
1124
+ * register("@powerhousedao/reactor-api/https-hooks", import.meta.url);
1125
+ */
1126
+ declare class HttpPackageLoader implements IPackageLoader {
1127
+ private readonly registryUrl;
1128
+ private readonly logger;
1129
+ readonly name = "HttpPackageLoader";
1130
+ readonly documentModelLoader: HttpDocumentModelLoader;
1131
+ constructor(options: HttpPackageLoaderOptions);
1132
+ /**
1133
+ * Load document models from a package in the HTTP registry.
1134
+ * Imports directly from HTTP URL using Node.js loader hooks.
1135
+ */
1136
+ /**
1137
+ * Parse a package specifier like "@scope/pkg@tag" into name and optional tag.
1138
+ */
1139
+ private parsePackageSpec;
1140
+ loadDocumentModels(packageSpec: string): Promise<DocumentModelModule[]>;
1141
+ loadSubgraphs(packageSpec: string): Promise<SubgraphClass$1[]>;
1142
+ loadProcessors(packageSpec: string): Promise<ProcessorFactoryBuilder | null>;
1143
+ /**
1144
+ * Load document models from multiple packages.
1145
+ * Continues loading even if some packages fail.
1146
+ */
1147
+ loadPackages(packageNames: string[], logger?: HttpPackageLoaderLogger): Promise<DocumentModelModule[]>;
1148
+ private isValidPackageName;
1149
+ }
1150
+ declare class HttpDocumentModelLoader implements IDocumentModelLoader {
1151
+ private readonly loader;
1152
+ private readonly logger;
1153
+ private readonly documentTypeCache;
1154
+ private readonly packageModulesCache;
1155
+ private onModelLoaded?;
1156
+ constructor(loader: HttpPackageLoader);
1157
+ setOnModelLoaded(callback: (model: DocumentModelModule) => void): void;
1158
+ clearCache(): void;
1159
+ load(documentType: string): Promise<DocumentModelModule>;
1160
+ private findPackageByDocumentType;
1161
+ getLoadedPackages(): string[];
1162
+ getPackageModules(packageName: string): DocumentModelModule[] | undefined;
1163
+ removeFromCache(packageName: string): void;
1164
+ }
1165
+ //#endregion
1166
+ //#region src/services/package-management.service.d.ts
1167
+ interface InstallPackageResult {
1168
+ package: InstalledPackageInfo;
1169
+ documentModelsLoaded: number;
1170
+ }
1171
+ interface PackageManagementServiceOptions {
1172
+ storage?: IPackageStorage;
1173
+ defaultRegistryUrl?: string;
1174
+ httpLoader?: HttpPackageLoader;
1175
+ documentModelRegistry?: IDocumentModelRegistry;
1176
+ }
1177
+ declare class PackageManagementService {
1178
+ private readonly storage;
1179
+ private readonly defaultRegistryUrl?;
1180
+ private readonly httpLoader?;
1181
+ private readonly documentModelRegistry?;
1182
+ private readonly logger;
1183
+ private onModelsChanged?;
1184
+ private loadedModulesCache;
1185
+ constructor(options?: PackageManagementServiceOptions);
1186
+ setOnModelsChanged(callback: (models: DocumentModelModule[]) => void): void;
1187
+ installPackage(name: string, registryUrl?: string): Promise<InstallPackageResult>;
1188
+ uninstallPackage(name: string): Promise<boolean>;
1189
+ getInstalledPackages(): Promise<InstalledPackageInfo[]>;
1190
+ getInstalledPackage(name: string): Promise<InstalledPackageInfo | undefined>;
1191
+ getAllLoadedModules(): DocumentModelModule[];
1192
+ private triggerModelsChanged;
1193
+ }
1194
+ //#endregion
1195
+ //#region src/graphql/packages/subgraph.d.ts
1196
+ interface PackagesSubgraphArgs extends SubgraphArgs {
1197
+ packageManagementService: PackageManagementService;
1198
+ }
1199
+ declare class PackagesSubgraph extends BaseSubgraph {
1200
+ private logger;
1201
+ private packageManagementService;
1202
+ constructor(args: PackagesSubgraphArgs);
1203
+ name: string;
1204
+ hasSubscriptions: boolean;
1205
+ typeDefs: graphql.DocumentNode;
1206
+ resolvers: {
1207
+ Query: {
1208
+ Packages: () => {};
1209
+ };
1210
+ PackagesQueries: {
1211
+ installedPackages: () => Promise<{
1212
+ name: string;
1213
+ version: string | null;
1214
+ registryUrl: string;
1215
+ installedAt: string;
1216
+ documentTypes: string[];
1217
+ }[]>;
1218
+ installedPackage: (_parent: unknown, args: {
1219
+ name: string;
1220
+ }) => Promise<{
1221
+ name: string;
1222
+ version: string | null;
1223
+ registryUrl: string;
1224
+ installedAt: string;
1225
+ documentTypes: string[];
1226
+ } | null>;
1227
+ };
1228
+ Mutation: {
1229
+ Packages: () => {};
1230
+ };
1231
+ PackagesMutations: {
1232
+ installPackage: (_parent: unknown, args: {
1233
+ name: string;
1234
+ registryUrl?: string | null;
1235
+ }, ctx: Context) => Promise<{
1236
+ package: ReturnType<(info: InstalledPackageInfo) => {
1237
+ name: string;
1238
+ version: string | null;
1239
+ registryUrl: string;
1240
+ installedAt: string;
1241
+ documentTypes: string[];
1242
+ }>;
1243
+ documentModelsLoaded: number;
1244
+ }>;
1245
+ uninstallPackage: (_parent: unknown, args: {
1246
+ name: string;
1247
+ }, ctx: Context) => Promise<boolean>;
1248
+ };
1249
+ };
1250
+ onSetup(): Promise<void>;
1251
+ }
1252
+ //#endregion
1253
+ //#region src/graphql/playground.d.ts
1254
+ declare function renderGraphqlPlayground(url: string, query?: string, headers?: Record<string, string>): string;
1255
+ //#endregion
1256
+ //#region src/graphql/reactor/gen/graphql.d.ts
1257
+ type Maybe<T> = T | null | undefined;
1258
+ type InputMaybe<T> = T | null | undefined;
1259
+ type Exact<T extends {
1260
+ [key: string]: unknown;
1261
+ }> = { [K in keyof T]: T[K] };
1262
+ type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
1263
+ type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
1264
+ type MakeEmpty<T extends {
1265
+ [key: string]: unknown;
1266
+ }, K extends keyof T> = { [_ in K]?: never };
1267
+ type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
1268
+ type RequireFields<T, K extends keyof T> = Omit<T, K> & { [P in K]-?: NonNullable<T[P]> };
1269
+ /** All built-in and custom scalars, mapped to their actual values */
1270
+ type Scalars = {
1271
+ ID: {
1272
+ input: string;
1273
+ output: string;
1274
+ };
1275
+ String: {
1276
+ input: string;
1277
+ output: string;
1278
+ };
1279
+ Boolean: {
1280
+ input: boolean;
1281
+ output: boolean;
1282
+ };
1283
+ Int: {
1284
+ input: number;
1285
+ output: number;
1286
+ };
1287
+ Float: {
1288
+ input: number;
1289
+ output: number;
1290
+ };
1291
+ DateTime: {
1292
+ input: string | Date;
1293
+ output: string | Date;
1294
+ };
1295
+ JSONObject: {
1296
+ input: NonNullable<unknown>;
1297
+ output: NonNullable<unknown>;
1298
+ };
1299
+ };
1300
+ type Action = {
1301
+ readonly attachments?: Maybe<ReadonlyArray<Attachment>>;
1302
+ readonly context?: Maybe<ActionContext>;
1303
+ readonly id: Scalars["String"]["output"];
1304
+ readonly input: Scalars["JSONObject"]["output"];
1305
+ readonly scope: Scalars["String"]["output"];
1306
+ readonly timestampUtcMs: Scalars["String"]["output"];
1307
+ readonly type: Scalars["String"]["output"];
1308
+ };
1309
+ type ActionContext = {
1310
+ readonly signer?: Maybe<ReactorSigner>;
1311
+ };
1312
+ type ActionContextInput = {
1313
+ readonly signer?: InputMaybe<ReactorSignerInput>;
1314
+ };
1315
+ type ActionInput = {
1316
+ readonly attachments?: InputMaybe<ReadonlyArray<AttachmentInput>>;
1317
+ readonly context?: InputMaybe<ActionContextInput>;
1318
+ readonly id: Scalars["String"]["input"];
1319
+ readonly input: Scalars["JSONObject"]["input"];
1320
+ readonly scope: Scalars["String"]["input"];
1321
+ readonly timestampUtcMs: Scalars["String"]["input"];
1322
+ readonly type: Scalars["String"]["input"];
1323
+ };
1324
+ type Attachment = {
1325
+ readonly data: Scalars["String"]["output"];
1326
+ readonly extension?: Maybe<Scalars["String"]["output"]>;
1327
+ readonly fileName?: Maybe<Scalars["String"]["output"]>;
1328
+ readonly hash: Scalars["String"]["output"];
1329
+ readonly mimeType: Scalars["String"]["output"];
1330
+ };
1331
+ type AttachmentInput = {
1332
+ readonly data: Scalars["String"]["input"];
1333
+ readonly extension?: InputMaybe<Scalars["String"]["input"]>;
1334
+ readonly fileName?: InputMaybe<Scalars["String"]["input"]>;
1335
+ readonly hash: Scalars["String"]["input"];
1336
+ readonly mimeType: Scalars["String"]["input"];
1337
+ };
1338
+ type ChannelMeta = {
1339
+ readonly id: Scalars["String"]["output"];
1340
+ };
1341
+ type ChannelMetaInput = {
1342
+ readonly id: Scalars["String"]["input"];
1343
+ };
1344
+ type DeadLetterInfo = {
1345
+ readonly branch: Scalars["String"]["output"];
1346
+ readonly documentId: Scalars["String"]["output"];
1347
+ readonly error: Scalars["String"]["output"];
1348
+ readonly jobId: Scalars["String"]["output"];
1349
+ readonly operationCount: Scalars["Int"]["output"];
1350
+ readonly scopes: ReadonlyArray<Scalars["String"]["output"]>;
1351
+ };
1352
+ type DocumentChangeContext = {
1353
+ readonly childId?: Maybe<Scalars["String"]["output"]>;
1354
+ readonly parentId?: Maybe<Scalars["String"]["output"]>;
1355
+ };
1356
+ type DocumentChangeEvent = {
1357
+ readonly context?: Maybe<DocumentChangeContext>;
1358
+ readonly documents: ReadonlyArray<PhDocument>;
1359
+ readonly type: DocumentChangeType;
1360
+ };
1361
+ declare enum DocumentChangeType {
1362
+ ChildAdded = "CHILD_ADDED",
1363
+ ChildRemoved = "CHILD_REMOVED",
1364
+ Created = "CREATED",
1365
+ Deleted = "DELETED",
1366
+ ParentAdded = "PARENT_ADDED",
1367
+ ParentRemoved = "PARENT_REMOVED",
1368
+ Updated = "UPDATED"
1369
+ }
1370
+ type DocumentModelGlobalState = {
1371
+ readonly id: Scalars["String"]["output"];
1372
+ readonly name: Scalars["String"]["output"];
1373
+ readonly namespace?: Maybe<Scalars["String"]["output"]>;
1374
+ readonly specification: Scalars["JSONObject"]["output"];
1375
+ readonly version?: Maybe<Scalars["String"]["output"]>;
1376
+ };
1377
+ type DocumentModelResultPage = {
1378
+ readonly cursor?: Maybe<Scalars["String"]["output"]>;
1379
+ readonly hasNextPage: Scalars["Boolean"]["output"];
1380
+ readonly hasPreviousPage: Scalars["Boolean"]["output"];
1381
+ readonly items: ReadonlyArray<DocumentModelGlobalState>;
1382
+ readonly totalCount: Scalars["Int"]["output"];
1383
+ };
1384
+ type DocumentOperationsFilterInput = {
1385
+ readonly actionTypes?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
1386
+ readonly branch?: InputMaybe<Scalars["String"]["input"]>;
1387
+ readonly scopes?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
1388
+ readonly sinceRevision?: InputMaybe<Scalars["Int"]["input"]>;
1389
+ readonly timestampFrom?: InputMaybe<Scalars["String"]["input"]>;
1390
+ readonly timestampTo?: InputMaybe<Scalars["String"]["input"]>;
1391
+ };
1392
+ type DocumentWithChildren = {
1393
+ readonly childIds: ReadonlyArray<Scalars["String"]["output"]>;
1394
+ readonly document: PhDocument;
1395
+ };
1396
+ type JobChangeEvent = {
1397
+ readonly error?: Maybe<Scalars["String"]["output"]>;
1398
+ readonly jobId: Scalars["String"]["output"];
1399
+ readonly result: Scalars["JSONObject"]["output"];
1400
+ readonly status: Scalars["String"]["output"];
1401
+ };
1402
+ type JobInfo = {
1403
+ readonly completedAt?: Maybe<Scalars["DateTime"]["output"]>;
1404
+ readonly createdAt: Scalars["DateTime"]["output"];
1405
+ readonly error?: Maybe<Scalars["String"]["output"]>;
1406
+ readonly id: Scalars["String"]["output"];
1407
+ readonly result: Scalars["JSONObject"]["output"];
1408
+ readonly status: Scalars["String"]["output"];
1409
+ };
1410
+ type MoveRelationshipResult = {
1411
+ readonly source: PhDocument;
1412
+ readonly target: PhDocument;
1413
+ };
1414
+ type Mutation = {
1415
+ readonly addRelationship: PhDocument;
1416
+ readonly createDocument: PhDocument;
1417
+ readonly createEmptyDocument: PhDocument;
1418
+ readonly deleteDocument: Scalars["Boolean"]["output"];
1419
+ readonly deleteDocuments: Scalars["Boolean"]["output"];
1420
+ readonly moveRelationship: MoveRelationshipResult;
1421
+ readonly mutateDocument: PhDocument;
1422
+ readonly mutateDocumentAsync: Scalars["String"]["output"];
1423
+ readonly pushSyncEnvelopes: Scalars["Boolean"]["output"];
1424
+ readonly removeRelationship: PhDocument;
1425
+ readonly renameDocument: PhDocument;
1426
+ readonly touchChannel: TouchChannelResult;
1427
+ };
1428
+ type MutationAddRelationshipArgs = {
1429
+ branch?: InputMaybe<Scalars["String"]["input"]>;
1430
+ relationshipType: Scalars["String"]["input"];
1431
+ sourceIdentifier: Scalars["String"]["input"];
1432
+ targetIdentifier: Scalars["String"]["input"];
1433
+ };
1434
+ type MutationCreateDocumentArgs = {
1435
+ document: Scalars["JSONObject"]["input"];
1436
+ parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
1437
+ };
1438
+ type MutationCreateEmptyDocumentArgs = {
1439
+ documentType: Scalars["String"]["input"];
1440
+ parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
1441
+ };
1442
+ type MutationDeleteDocumentArgs = {
1443
+ identifier: Scalars["String"]["input"];
1444
+ propagate?: InputMaybe<PropagationMode>;
1445
+ };
1446
+ type MutationDeleteDocumentsArgs = {
1447
+ identifiers: ReadonlyArray<Scalars["String"]["input"]>;
1448
+ propagate?: InputMaybe<PropagationMode>;
1449
+ };
1450
+ type MutationMoveRelationshipArgs = {
1451
+ branch?: InputMaybe<Scalars["String"]["input"]>;
1452
+ relationshipType: Scalars["String"]["input"];
1453
+ sourceParentIdentifier: Scalars["String"]["input"];
1454
+ targetIdentifier: Scalars["String"]["input"];
1455
+ targetParentIdentifier: Scalars["String"]["input"];
1456
+ };
1457
+ type MutationMutateDocumentArgs = {
1458
+ actions: ReadonlyArray<Scalars["JSONObject"]["input"]>;
1459
+ documentIdentifier: Scalars["String"]["input"];
1460
+ view?: InputMaybe<ViewFilterInput>;
1461
+ };
1462
+ type MutationMutateDocumentAsyncArgs = {
1463
+ actions: ReadonlyArray<Scalars["JSONObject"]["input"]>;
1464
+ documentIdentifier: Scalars["String"]["input"];
1465
+ view?: InputMaybe<ViewFilterInput>;
1466
+ };
1467
+ type MutationPushSyncEnvelopesArgs = {
1468
+ envelopes: ReadonlyArray<SyncEnvelopeInput>;
1469
+ };
1470
+ type MutationRemoveRelationshipArgs = {
1471
+ branch?: InputMaybe<Scalars["String"]["input"]>;
1472
+ relationshipType: Scalars["String"]["input"];
1473
+ sourceIdentifier: Scalars["String"]["input"];
1474
+ targetIdentifier: Scalars["String"]["input"];
1475
+ };
1476
+ type MutationRenameDocumentArgs = {
1477
+ branch?: InputMaybe<Scalars["String"]["input"]>;
1478
+ documentIdentifier: Scalars["String"]["input"];
1479
+ name: Scalars["String"]["input"];
1480
+ };
1481
+ type MutationTouchChannelArgs = {
1482
+ input: TouchChannelInput;
1483
+ };
1484
+ type OperationContext = {
1485
+ readonly branch: Scalars["String"]["output"];
1486
+ readonly documentId: Scalars["String"]["output"];
1487
+ readonly documentType: Scalars["String"]["output"];
1488
+ readonly ordinal: Scalars["Int"]["output"];
1489
+ readonly scope: Scalars["String"]["output"];
1490
+ };
1491
+ type OperationContextInput = {
1492
+ readonly branch: Scalars["String"]["input"];
1493
+ readonly documentId: Scalars["String"]["input"];
1494
+ readonly documentType: Scalars["String"]["input"];
1495
+ readonly ordinal: Scalars["Int"]["input"];
1496
+ readonly scope: Scalars["String"]["input"];
1497
+ };
1498
+ type OperationInput = {
1499
+ readonly action: ActionInput;
1500
+ readonly error?: InputMaybe<Scalars["String"]["input"]>;
1501
+ readonly hash: Scalars["String"]["input"];
1502
+ readonly id?: InputMaybe<Scalars["String"]["input"]>;
1503
+ readonly index: Scalars["Int"]["input"];
1504
+ readonly skip: Scalars["Int"]["input"];
1505
+ readonly timestampUtcMs: Scalars["String"]["input"];
1506
+ };
1507
+ type OperationWithContext = {
1508
+ readonly context: OperationContext;
1509
+ readonly operation: ReactorOperation;
1510
+ };
1511
+ type OperationWithContextInput = {
1512
+ readonly context: OperationContextInput;
1513
+ readonly operation: OperationInput;
1514
+ };
1515
+ type OperationsFilterInput = {
1516
+ readonly actionTypes?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
1517
+ readonly branch?: InputMaybe<Scalars["String"]["input"]>;
1518
+ readonly documentId: Scalars["String"]["input"];
1519
+ readonly scopes?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
1520
+ readonly sinceRevision?: InputMaybe<Scalars["Int"]["input"]>;
1521
+ readonly timestampFrom?: InputMaybe<Scalars["String"]["input"]>;
1522
+ readonly timestampTo?: InputMaybe<Scalars["String"]["input"]>;
1523
+ };
1524
+ type PhDocument = {
1525
+ readonly createdAtUtcIso: Scalars["DateTime"]["output"];
1526
+ readonly documentType: Scalars["String"]["output"];
1527
+ readonly id: Scalars["String"]["output"];
1528
+ readonly lastModifiedAtUtcIso: Scalars["DateTime"]["output"];
1529
+ readonly name: Scalars["String"]["output"];
1530
+ readonly operations?: Maybe<ReactorOperationResultPage>;
1531
+ readonly preferredEditor?: Maybe<Scalars["String"]["output"]>;
1532
+ readonly revisionsList: ReadonlyArray<Revision>;
1533
+ readonly slug?: Maybe<Scalars["String"]["output"]>;
1534
+ readonly state: Scalars["JSONObject"]["output"];
1535
+ };
1536
+ type PhDocumentOperationsArgs = {
1537
+ filter?: InputMaybe<DocumentOperationsFilterInput>;
1538
+ paging?: InputMaybe<PagingInput>;
1539
+ };
1540
+ type PhDocumentResultPage = {
1541
+ readonly cursor?: Maybe<Scalars["String"]["output"]>;
1542
+ readonly hasNextPage: Scalars["Boolean"]["output"];
1543
+ readonly hasPreviousPage: Scalars["Boolean"]["output"];
1544
+ readonly items: ReadonlyArray<PhDocument>;
1545
+ readonly totalCount: Scalars["Int"]["output"];
1546
+ };
1547
+ type PagingInput = {
1548
+ readonly cursor?: InputMaybe<Scalars["String"]["input"]>;
1549
+ readonly limit?: InputMaybe<Scalars["Int"]["input"]>;
1550
+ readonly offset?: InputMaybe<Scalars["Int"]["input"]>;
1551
+ };
1552
+ type PollSyncEnvelopesResult = {
1553
+ readonly ackOrdinal: Scalars["Int"]["output"];
1554
+ readonly deadLetters: ReadonlyArray<DeadLetterInfo>;
1555
+ readonly envelopes: ReadonlyArray<SyncEnvelope>;
1556
+ readonly hasMore: Scalars["Boolean"]["output"];
1557
+ };
1558
+ declare enum PropagationMode {
1559
+ Cascade = "CASCADE",
1560
+ Orphan = "ORPHAN"
1561
+ }
1562
+ type Query = {
1563
+ readonly document?: Maybe<DocumentWithChildren>;
1564
+ readonly documentIncomingRelationships: PhDocumentResultPage;
1565
+ readonly documentModels: DocumentModelResultPage;
1566
+ readonly documentOperations: ReactorOperationResultPage;
1567
+ readonly documentOutgoingRelationships: PhDocumentResultPage;
1568
+ readonly findDocuments: PhDocumentResultPage;
1569
+ readonly jobStatus?: Maybe<JobInfo>;
1570
+ readonly pollSyncEnvelopes: PollSyncEnvelopesResult;
1571
+ };
1572
+ type QueryDocumentArgs = {
1573
+ identifier: Scalars["String"]["input"];
1574
+ view?: InputMaybe<ViewFilterInput>;
1575
+ };
1576
+ type QueryDocumentIncomingRelationshipsArgs = {
1577
+ paging?: InputMaybe<PagingInput>;
1578
+ relationshipType: Scalars["String"]["input"];
1579
+ targetIdentifier: Scalars["String"]["input"];
1580
+ view?: InputMaybe<ViewFilterInput>;
1581
+ };
1582
+ type QueryDocumentModelsArgs = {
1583
+ namespace?: InputMaybe<Scalars["String"]["input"]>;
1584
+ paging?: InputMaybe<PagingInput>;
1585
+ };
1586
+ type QueryDocumentOperationsArgs = {
1587
+ filter: OperationsFilterInput;
1588
+ paging?: InputMaybe<PagingInput>;
1589
+ };
1590
+ type QueryDocumentOutgoingRelationshipsArgs = {
1591
+ paging?: InputMaybe<PagingInput>;
1592
+ relationshipType: Scalars["String"]["input"];
1593
+ sourceIdentifier: Scalars["String"]["input"];
1594
+ view?: InputMaybe<ViewFilterInput>;
1595
+ };
1596
+ type QueryFindDocumentsArgs = {
1597
+ paging?: InputMaybe<PagingInput>;
1598
+ search?: InputMaybe<SearchFilterInput>;
1599
+ view?: InputMaybe<ViewFilterInput>;
1600
+ };
1601
+ type QueryJobStatusArgs = {
1602
+ jobId: Scalars["String"]["input"];
1603
+ };
1604
+ type QueryPollSyncEnvelopesArgs = {
1605
+ channelId: Scalars["String"]["input"];
1606
+ outboxAck: Scalars["Int"]["input"];
1607
+ outboxLatest: Scalars["Int"]["input"];
1608
+ };
1609
+ type ReactorOperation = {
1610
+ readonly action: Action;
1611
+ readonly error?: Maybe<Scalars["String"]["output"]>;
1612
+ readonly hash: Scalars["String"]["output"];
1613
+ readonly id?: Maybe<Scalars["String"]["output"]>;
1614
+ readonly index: Scalars["Int"]["output"];
1615
+ readonly skip: Scalars["Int"]["output"];
1616
+ readonly timestampUtcMs: Scalars["String"]["output"];
1617
+ };
1618
+ type ReactorOperationResultPage = {
1619
+ readonly cursor?: Maybe<Scalars["String"]["output"]>;
1620
+ readonly hasNextPage: Scalars["Boolean"]["output"];
1621
+ readonly hasPreviousPage: Scalars["Boolean"]["output"];
1622
+ readonly items: ReadonlyArray<ReactorOperation>;
1623
+ readonly totalCount: Scalars["Int"]["output"];
1624
+ };
1625
+ type ReactorSigner = {
1626
+ readonly app?: Maybe<ReactorSignerApp>;
1627
+ readonly signatures: ReadonlyArray<Scalars["String"]["output"]>;
1628
+ readonly user?: Maybe<ReactorSignerUser>;
1629
+ };
1630
+ type ReactorSignerApp = {
1631
+ readonly key: Scalars["String"]["output"];
1632
+ readonly name: Scalars["String"]["output"];
1633
+ };
1634
+ type ReactorSignerAppInput = {
1635
+ readonly key: Scalars["String"]["input"];
1636
+ readonly name: Scalars["String"]["input"];
1637
+ };
1638
+ type ReactorSignerInput = {
1639
+ readonly app?: InputMaybe<ReactorSignerAppInput>;
1640
+ readonly signatures: ReadonlyArray<Scalars["String"]["input"]>;
1641
+ readonly user?: InputMaybe<ReactorSignerUserInput>;
1642
+ };
1643
+ type ReactorSignerUser = {
1644
+ readonly address: Scalars["String"]["output"];
1645
+ readonly chainId: Scalars["Int"]["output"];
1646
+ readonly networkId: Scalars["String"]["output"];
1647
+ };
1648
+ type ReactorSignerUserInput = {
1649
+ readonly address: Scalars["String"]["input"];
1650
+ readonly chainId: Scalars["Int"]["input"];
1651
+ readonly networkId: Scalars["String"]["input"];
1652
+ };
1653
+ type RemoteCursor = {
1654
+ readonly cursorOrdinal: Scalars["Int"]["output"];
1655
+ readonly lastSyncedAtUtcMs?: Maybe<Scalars["String"]["output"]>;
1656
+ readonly remoteName: Scalars["String"]["output"];
1657
+ };
1658
+ type RemoteCursorInput = {
1659
+ readonly cursorOrdinal: Scalars["Int"]["input"];
1660
+ readonly lastSyncedAtUtcMs?: InputMaybe<Scalars["String"]["input"]>;
1661
+ readonly remoteName: Scalars["String"]["input"];
1662
+ };
1663
+ type RemoteFilterInput = {
1664
+ readonly branch: Scalars["String"]["input"];
1665
+ readonly documentId: ReadonlyArray<Scalars["String"]["input"]>;
1666
+ readonly scope: ReadonlyArray<Scalars["String"]["input"]>;
1667
+ };
1668
+ type Revision = {
1669
+ readonly revision: Scalars["Int"]["output"];
1670
+ readonly scope: Scalars["String"]["output"];
1671
+ };
1672
+ type SearchFilterInput = {
1673
+ readonly identifiers?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
1674
+ readonly parentId?: InputMaybe<Scalars["String"]["input"]>;
1675
+ readonly type?: InputMaybe<Scalars["String"]["input"]>;
1676
+ };
1677
+ type Subscription = {
1678
+ readonly documentChanges: DocumentChangeEvent;
1679
+ readonly jobChanges: JobChangeEvent;
1680
+ };
1681
+ type SubscriptionDocumentChangesArgs = {
1682
+ search?: InputMaybe<SearchFilterInput>;
1683
+ view?: InputMaybe<ViewFilterInput>;
1684
+ };
1685
+ type SubscriptionJobChangesArgs = {
1686
+ jobId: Scalars["String"]["input"];
1687
+ };
1688
+ type SyncEnvelope = {
1689
+ readonly channelMeta: ChannelMeta;
1690
+ readonly cursor?: Maybe<RemoteCursor>;
1691
+ readonly dependsOn?: Maybe<ReadonlyArray<Scalars["String"]["output"]>>;
1692
+ readonly key?: Maybe<Scalars["String"]["output"]>;
1693
+ readonly operations?: Maybe<ReadonlyArray<OperationWithContext>>;
1694
+ readonly type: SyncEnvelopeType;
1695
+ };
1696
+ type SyncEnvelopeInput = {
1697
+ readonly channelMeta: ChannelMetaInput;
1698
+ readonly cursor?: InputMaybe<RemoteCursorInput>;
1699
+ readonly dependsOn?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
1700
+ readonly key?: InputMaybe<Scalars["String"]["input"]>;
1701
+ readonly operations?: InputMaybe<ReadonlyArray<OperationWithContextInput>>;
1702
+ readonly type: SyncEnvelopeType;
1703
+ };
1704
+ declare enum SyncEnvelopeType {
1705
+ Ack = "ACK",
1706
+ Operations = "OPERATIONS"
1707
+ }
1708
+ type TouchChannelInput = {
1709
+ readonly collectionId: Scalars["String"]["input"];
1710
+ readonly filter: RemoteFilterInput;
1711
+ readonly id: Scalars["String"]["input"];
1712
+ readonly name: Scalars["String"]["input"];
1713
+ readonly sinceTimestampUtcMs: Scalars["String"]["input"];
1714
+ };
1715
+ type TouchChannelResult = {
1716
+ readonly ackOrdinal: Scalars["Int"]["output"];
1717
+ readonly success: Scalars["Boolean"]["output"];
1718
+ };
1719
+ type ViewFilterInput = {
1720
+ readonly branch?: InputMaybe<Scalars["String"]["input"]>;
1721
+ readonly scopes?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
1722
+ };
1723
+ type PhDocumentFieldsFragment = {
1724
+ readonly id: string;
1725
+ readonly slug?: string | null | undefined;
1726
+ readonly name: string;
1727
+ readonly documentType: string;
1728
+ readonly state: NonNullable<unknown>;
1729
+ readonly createdAtUtcIso: string | Date;
1730
+ readonly lastModifiedAtUtcIso: string | Date;
1731
+ readonly revisionsList: ReadonlyArray<{
1732
+ readonly scope: string;
1733
+ readonly revision: number;
1734
+ }>;
1735
+ };
1736
+ type GetDocumentModelsQueryVariables = Exact<{
1737
+ namespace?: InputMaybe<Scalars["String"]["input"]>;
1738
+ paging?: InputMaybe<PagingInput>;
1739
+ }>;
1740
+ type GetDocumentModelsQuery = {
1741
+ readonly documentModels: {
1742
+ readonly totalCount: number;
1743
+ readonly hasNextPage: boolean;
1744
+ readonly hasPreviousPage: boolean;
1745
+ readonly cursor?: string | null | undefined;
1746
+ readonly items: ReadonlyArray<{
1747
+ readonly id: string;
1748
+ readonly name: string;
1749
+ readonly namespace?: string | null | undefined;
1750
+ readonly version?: string | null | undefined;
1751
+ readonly specification: NonNullable<unknown>;
1752
+ }>;
1753
+ };
1754
+ };
1755
+ type GetDocumentQueryVariables = Exact<{
1756
+ identifier: Scalars["String"]["input"];
1757
+ view?: InputMaybe<ViewFilterInput>;
1758
+ }>;
1759
+ type GetDocumentQuery = {
1760
+ readonly document?: {
1761
+ readonly childIds: ReadonlyArray<string>;
1762
+ readonly document: {
1763
+ readonly id: string;
1764
+ readonly slug?: string | null | undefined;
1765
+ readonly name: string;
1766
+ readonly documentType: string;
1767
+ readonly state: NonNullable<unknown>;
1768
+ readonly createdAtUtcIso: string | Date;
1769
+ readonly lastModifiedAtUtcIso: string | Date;
1770
+ readonly revisionsList: ReadonlyArray<{
1771
+ readonly scope: string;
1772
+ readonly revision: number;
1773
+ }>;
1774
+ };
1775
+ } | null | undefined;
1776
+ };
1777
+ type GetDocumentWithOperationsQueryVariables = Exact<{
1778
+ identifier: Scalars["String"]["input"];
1779
+ view?: InputMaybe<ViewFilterInput>;
1780
+ operationsFilter?: InputMaybe<DocumentOperationsFilterInput>;
1781
+ operationsPaging?: InputMaybe<PagingInput>;
1782
+ }>;
1783
+ type GetDocumentWithOperationsQuery = {
1784
+ readonly document?: {
1785
+ readonly childIds: ReadonlyArray<string>;
1786
+ readonly document: {
1787
+ readonly id: string;
1788
+ readonly slug?: string | null | undefined;
1789
+ readonly name: string;
1790
+ readonly documentType: string;
1791
+ readonly state: NonNullable<unknown>;
1792
+ readonly createdAtUtcIso: string | Date;
1793
+ readonly lastModifiedAtUtcIso: string | Date;
1794
+ readonly operations?: {
1795
+ readonly totalCount: number;
1796
+ readonly hasNextPage: boolean;
1797
+ readonly hasPreviousPage: boolean;
1798
+ readonly cursor?: string | null | undefined;
1799
+ readonly items: ReadonlyArray<{
1800
+ readonly index: number;
1801
+ readonly timestampUtcMs: string;
1802
+ readonly hash: string;
1803
+ readonly skip: number;
1804
+ readonly error?: string | null | undefined;
1805
+ readonly id?: string | null | undefined;
1806
+ readonly action: {
1807
+ readonly id: string;
1808
+ readonly type: string;
1809
+ readonly timestampUtcMs: string;
1810
+ readonly input: NonNullable<unknown>;
1811
+ readonly scope: string;
1812
+ readonly attachments?: ReadonlyArray<{
1813
+ readonly data: string;
1814
+ readonly mimeType: string;
1815
+ readonly hash: string;
1816
+ readonly extension?: string | null | undefined;
1817
+ readonly fileName?: string | null | undefined;
1818
+ }> | null | undefined;
1819
+ readonly context?: {
1820
+ readonly signer?: {
1821
+ readonly signatures: ReadonlyArray<string>;
1822
+ readonly user?: {
1823
+ readonly address: string;
1824
+ readonly networkId: string;
1825
+ readonly chainId: number;
1826
+ } | null | undefined;
1827
+ readonly app?: {
1828
+ readonly name: string;
1829
+ readonly key: string;
1830
+ } | null | undefined;
1831
+ } | null | undefined;
1832
+ } | null | undefined;
1833
+ };
1834
+ }>;
1835
+ } | null | undefined;
1836
+ readonly revisionsList: ReadonlyArray<{
1837
+ readonly scope: string;
1838
+ readonly revision: number;
1839
+ }>;
1840
+ };
1841
+ } | null | undefined;
1842
+ };
1843
+ type GetDocumentOutgoingRelationshipsQueryVariables = Exact<{
1844
+ sourceIdentifier: Scalars["String"]["input"];
1845
+ relationshipType: Scalars["String"]["input"];
1846
+ view?: InputMaybe<ViewFilterInput>;
1847
+ paging?: InputMaybe<PagingInput>;
1848
+ }>;
1849
+ type GetDocumentOutgoingRelationshipsQuery = {
1850
+ readonly documentOutgoingRelationships: {
1851
+ readonly totalCount: number;
1852
+ readonly hasNextPage: boolean;
1853
+ readonly hasPreviousPage: boolean;
1854
+ readonly cursor?: string | null | undefined;
1855
+ readonly items: ReadonlyArray<{
1856
+ readonly id: string;
1857
+ readonly slug?: string | null | undefined;
1858
+ readonly name: string;
1859
+ readonly documentType: string;
1860
+ readonly state: NonNullable<unknown>;
1861
+ readonly createdAtUtcIso: string | Date;
1862
+ readonly lastModifiedAtUtcIso: string | Date;
1863
+ readonly revisionsList: ReadonlyArray<{
1864
+ readonly scope: string;
1865
+ readonly revision: number;
1866
+ }>;
1867
+ }>;
1868
+ };
1869
+ };
1870
+ type GetDocumentIncomingRelationshipsQueryVariables = Exact<{
1871
+ targetIdentifier: Scalars["String"]["input"];
1872
+ relationshipType: Scalars["String"]["input"];
1873
+ view?: InputMaybe<ViewFilterInput>;
1874
+ paging?: InputMaybe<PagingInput>;
1875
+ }>;
1876
+ type GetDocumentIncomingRelationshipsQuery = {
1877
+ readonly documentIncomingRelationships: {
1878
+ readonly totalCount: number;
1879
+ readonly hasNextPage: boolean;
1880
+ readonly hasPreviousPage: boolean;
1881
+ readonly cursor?: string | null | undefined;
1882
+ readonly items: ReadonlyArray<{
1883
+ readonly id: string;
1884
+ readonly slug?: string | null | undefined;
1885
+ readonly name: string;
1886
+ readonly documentType: string;
1887
+ readonly state: NonNullable<unknown>;
1888
+ readonly createdAtUtcIso: string | Date;
1889
+ readonly lastModifiedAtUtcIso: string | Date;
1890
+ readonly revisionsList: ReadonlyArray<{
1891
+ readonly scope: string;
1892
+ readonly revision: number;
1893
+ }>;
1894
+ }>;
1895
+ };
1896
+ };
1897
+ type FindDocumentsQueryVariables = Exact<{
1898
+ search?: InputMaybe<SearchFilterInput>;
1899
+ view?: InputMaybe<ViewFilterInput>;
1900
+ paging?: InputMaybe<PagingInput>;
1901
+ }>;
1902
+ type FindDocumentsQuery = {
1903
+ readonly findDocuments: {
1904
+ readonly totalCount: number;
1905
+ readonly hasNextPage: boolean;
1906
+ readonly hasPreviousPage: boolean;
1907
+ readonly cursor?: string | null | undefined;
1908
+ readonly items: ReadonlyArray<{
1909
+ readonly id: string;
1910
+ readonly slug?: string | null | undefined;
1911
+ readonly name: string;
1912
+ readonly documentType: string;
1913
+ readonly state: NonNullable<unknown>;
1914
+ readonly createdAtUtcIso: string | Date;
1915
+ readonly lastModifiedAtUtcIso: string | Date;
1916
+ readonly revisionsList: ReadonlyArray<{
1917
+ readonly scope: string;
1918
+ readonly revision: number;
1919
+ }>;
1920
+ }>;
1921
+ };
1922
+ };
1923
+ type GetDocumentOperationsQueryVariables = Exact<{
1924
+ filter: OperationsFilterInput;
1925
+ paging?: InputMaybe<PagingInput>;
1926
+ }>;
1927
+ type GetDocumentOperationsQuery = {
1928
+ readonly documentOperations: {
1929
+ readonly totalCount: number;
1930
+ readonly hasNextPage: boolean;
1931
+ readonly hasPreviousPage: boolean;
1932
+ readonly cursor?: string | null | undefined;
1933
+ readonly items: ReadonlyArray<{
1934
+ readonly index: number;
1935
+ readonly timestampUtcMs: string;
1936
+ readonly hash: string;
1937
+ readonly skip: number;
1938
+ readonly error?: string | null | undefined;
1939
+ readonly id?: string | null | undefined;
1940
+ readonly action: {
1941
+ readonly id: string;
1942
+ readonly type: string;
1943
+ readonly timestampUtcMs: string;
1944
+ readonly input: NonNullable<unknown>;
1945
+ readonly scope: string;
1946
+ readonly attachments?: ReadonlyArray<{
1947
+ readonly data: string;
1948
+ readonly mimeType: string;
1949
+ readonly hash: string;
1950
+ readonly extension?: string | null | undefined;
1951
+ readonly fileName?: string | null | undefined;
1952
+ }> | null | undefined;
1953
+ readonly context?: {
1954
+ readonly signer?: {
1955
+ readonly signatures: ReadonlyArray<string>;
1956
+ readonly user?: {
1957
+ readonly address: string;
1958
+ readonly networkId: string;
1959
+ readonly chainId: number;
1960
+ } | null | undefined;
1961
+ readonly app?: {
1962
+ readonly name: string;
1963
+ readonly key: string;
1964
+ } | null | undefined;
1965
+ } | null | undefined;
1966
+ } | null | undefined;
1967
+ };
1968
+ }>;
1969
+ };
1970
+ };
1971
+ type GetJobStatusQueryVariables = Exact<{
1972
+ jobId: Scalars["String"]["input"];
1973
+ }>;
1974
+ type GetJobStatusQuery = {
1975
+ readonly jobStatus?: {
1976
+ readonly id: string;
1977
+ readonly status: string;
1978
+ readonly result: NonNullable<unknown>;
1979
+ readonly error?: string | null | undefined;
1980
+ readonly createdAt: string | Date;
1981
+ readonly completedAt?: string | Date | null | undefined;
1982
+ } | null | undefined;
1983
+ };
1984
+ type CreateDocumentMutationVariables = Exact<{
1985
+ document: Scalars["JSONObject"]["input"];
1986
+ parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
1987
+ }>;
1988
+ type CreateDocumentMutation = {
1989
+ readonly createDocument: {
1990
+ readonly id: string;
1991
+ readonly slug?: string | null | undefined;
1992
+ readonly name: string;
1993
+ readonly documentType: string;
1994
+ readonly state: NonNullable<unknown>;
1995
+ readonly createdAtUtcIso: string | Date;
1996
+ readonly lastModifiedAtUtcIso: string | Date;
1997
+ readonly revisionsList: ReadonlyArray<{
1998
+ readonly scope: string;
1999
+ readonly revision: number;
2000
+ }>;
2001
+ };
2002
+ };
2003
+ type CreateEmptyDocumentMutationVariables = Exact<{
2004
+ documentType: Scalars["String"]["input"];
2005
+ parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2006
+ }>;
2007
+ type CreateEmptyDocumentMutation = {
2008
+ readonly createEmptyDocument: {
2009
+ readonly id: string;
2010
+ readonly slug?: string | null | undefined;
2011
+ readonly name: string;
2012
+ readonly documentType: string;
2013
+ readonly state: NonNullable<unknown>;
2014
+ readonly createdAtUtcIso: string | Date;
2015
+ readonly lastModifiedAtUtcIso: string | Date;
2016
+ readonly revisionsList: ReadonlyArray<{
2017
+ readonly scope: string;
2018
+ readonly revision: number;
2019
+ }>;
2020
+ };
2021
+ };
2022
+ type MutateDocumentMutationVariables = Exact<{
2023
+ documentIdentifier: Scalars["String"]["input"];
2024
+ actions: ReadonlyArray<Scalars["JSONObject"]["input"]>;
2025
+ view?: InputMaybe<ViewFilterInput>;
2026
+ }>;
2027
+ type MutateDocumentMutation = {
2028
+ readonly mutateDocument: {
2029
+ readonly id: string;
2030
+ readonly slug?: string | null | undefined;
2031
+ readonly name: string;
2032
+ readonly documentType: string;
2033
+ readonly state: NonNullable<unknown>;
2034
+ readonly createdAtUtcIso: string | Date;
2035
+ readonly lastModifiedAtUtcIso: string | Date;
2036
+ readonly revisionsList: ReadonlyArray<{
2037
+ readonly scope: string;
2038
+ readonly revision: number;
2039
+ }>;
2040
+ };
2041
+ };
2042
+ type MutateDocumentAsyncMutationVariables = Exact<{
2043
+ documentIdentifier: Scalars["String"]["input"];
2044
+ actions: ReadonlyArray<Scalars["JSONObject"]["input"]>;
2045
+ view?: InputMaybe<ViewFilterInput>;
2046
+ }>;
2047
+ type MutateDocumentAsyncMutation = {
2048
+ readonly mutateDocumentAsync: string;
2049
+ };
2050
+ type RenameDocumentMutationVariables = Exact<{
2051
+ documentIdentifier: Scalars["String"]["input"];
2052
+ name: Scalars["String"]["input"];
2053
+ branch?: InputMaybe<Scalars["String"]["input"]>;
2054
+ }>;
2055
+ type RenameDocumentMutation = {
2056
+ readonly renameDocument: {
2057
+ readonly id: string;
2058
+ readonly slug?: string | null | undefined;
2059
+ readonly name: string;
2060
+ readonly documentType: string;
2061
+ readonly state: NonNullable<unknown>;
2062
+ readonly createdAtUtcIso: string | Date;
2063
+ readonly lastModifiedAtUtcIso: string | Date;
2064
+ readonly revisionsList: ReadonlyArray<{
2065
+ readonly scope: string;
2066
+ readonly revision: number;
2067
+ }>;
2068
+ };
2069
+ };
2070
+ type AddRelationshipMutationVariables = Exact<{
2071
+ sourceIdentifier: Scalars["String"]["input"];
2072
+ targetIdentifier: Scalars["String"]["input"];
2073
+ relationshipType: Scalars["String"]["input"];
2074
+ branch?: InputMaybe<Scalars["String"]["input"]>;
2075
+ }>;
2076
+ type AddRelationshipMutation = {
2077
+ readonly addRelationship: {
2078
+ readonly id: string;
2079
+ readonly slug?: string | null | undefined;
2080
+ readonly name: string;
2081
+ readonly documentType: string;
2082
+ readonly state: NonNullable<unknown>;
2083
+ readonly createdAtUtcIso: string | Date;
2084
+ readonly lastModifiedAtUtcIso: string | Date;
2085
+ readonly revisionsList: ReadonlyArray<{
2086
+ readonly scope: string;
2087
+ readonly revision: number;
2088
+ }>;
2089
+ };
2090
+ };
2091
+ type RemoveRelationshipMutationVariables = Exact<{
2092
+ sourceIdentifier: Scalars["String"]["input"];
2093
+ targetIdentifier: Scalars["String"]["input"];
2094
+ relationshipType: Scalars["String"]["input"];
2095
+ branch?: InputMaybe<Scalars["String"]["input"]>;
2096
+ }>;
2097
+ type RemoveRelationshipMutation = {
2098
+ readonly removeRelationship: {
2099
+ readonly id: string;
2100
+ readonly slug?: string | null | undefined;
2101
+ readonly name: string;
2102
+ readonly documentType: string;
2103
+ readonly state: NonNullable<unknown>;
2104
+ readonly createdAtUtcIso: string | Date;
2105
+ readonly lastModifiedAtUtcIso: string | Date;
2106
+ readonly revisionsList: ReadonlyArray<{
2107
+ readonly scope: string;
2108
+ readonly revision: number;
2109
+ }>;
2110
+ };
2111
+ };
2112
+ type MoveRelationshipMutationVariables = Exact<{
2113
+ sourceParentIdentifier: Scalars["String"]["input"];
2114
+ targetParentIdentifier: Scalars["String"]["input"];
2115
+ targetIdentifier: Scalars["String"]["input"];
2116
+ relationshipType: Scalars["String"]["input"];
2117
+ branch?: InputMaybe<Scalars["String"]["input"]>;
2118
+ }>;
2119
+ type MoveRelationshipMutation = {
2120
+ readonly moveRelationship: {
2121
+ readonly source: {
2122
+ readonly id: string;
2123
+ readonly slug?: string | null | undefined;
2124
+ readonly name: string;
2125
+ readonly documentType: string;
2126
+ readonly state: NonNullable<unknown>;
2127
+ readonly createdAtUtcIso: string | Date;
2128
+ readonly lastModifiedAtUtcIso: string | Date;
2129
+ readonly revisionsList: ReadonlyArray<{
2130
+ readonly scope: string;
2131
+ readonly revision: number;
2132
+ }>;
2133
+ };
2134
+ readonly target: {
2135
+ readonly id: string;
2136
+ readonly slug?: string | null | undefined;
2137
+ readonly name: string;
2138
+ readonly documentType: string;
2139
+ readonly state: NonNullable<unknown>;
2140
+ readonly createdAtUtcIso: string | Date;
2141
+ readonly lastModifiedAtUtcIso: string | Date;
2142
+ readonly revisionsList: ReadonlyArray<{
2143
+ readonly scope: string;
2144
+ readonly revision: number;
2145
+ }>;
2146
+ };
2147
+ };
2148
+ };
2149
+ type DeleteDocumentMutationVariables = Exact<{
2150
+ identifier: Scalars["String"]["input"];
2151
+ propagate?: InputMaybe<PropagationMode>;
2152
+ }>;
2153
+ type DeleteDocumentMutation = {
2154
+ readonly deleteDocument: boolean;
2155
+ };
2156
+ type DeleteDocumentsMutationVariables = Exact<{
2157
+ identifiers: ReadonlyArray<Scalars["String"]["input"]>;
2158
+ propagate?: InputMaybe<PropagationMode>;
2159
+ }>;
2160
+ type DeleteDocumentsMutation = {
2161
+ readonly deleteDocuments: boolean;
2162
+ };
2163
+ type DocumentChangesSubscriptionVariables = Exact<{
2164
+ search?: InputMaybe<SearchFilterInput>;
2165
+ view?: InputMaybe<ViewFilterInput>;
2166
+ }>;
2167
+ type DocumentChangesSubscription = {
2168
+ readonly documentChanges: {
2169
+ readonly type: DocumentChangeType;
2170
+ readonly documents: ReadonlyArray<{
2171
+ readonly id: string;
2172
+ readonly slug?: string | null | undefined;
2173
+ readonly name: string;
2174
+ readonly documentType: string;
2175
+ readonly state: NonNullable<unknown>;
2176
+ readonly createdAtUtcIso: string | Date;
2177
+ readonly lastModifiedAtUtcIso: string | Date;
2178
+ readonly revisionsList: ReadonlyArray<{
2179
+ readonly scope: string;
2180
+ readonly revision: number;
2181
+ }>;
2182
+ }>;
2183
+ readonly context?: {
2184
+ readonly parentId?: string | null | undefined;
2185
+ readonly childId?: string | null | undefined;
2186
+ } | null | undefined;
2187
+ };
2188
+ };
2189
+ type JobChangesSubscriptionVariables = Exact<{
2190
+ jobId: Scalars["String"]["input"];
2191
+ }>;
2192
+ type JobChangesSubscription = {
2193
+ readonly jobChanges: {
2194
+ readonly jobId: string;
2195
+ readonly status: string;
2196
+ readonly result: NonNullable<unknown>;
2197
+ readonly error?: string | null | undefined;
2198
+ };
2199
+ };
2200
+ type PollSyncEnvelopesQueryVariables = Exact<{
2201
+ channelId: Scalars["String"]["input"];
2202
+ outboxAck: Scalars["Int"]["input"];
2203
+ outboxLatest: Scalars["Int"]["input"];
2204
+ }>;
2205
+ type PollSyncEnvelopesQuery = {
2206
+ readonly pollSyncEnvelopes: {
2207
+ readonly ackOrdinal: number;
2208
+ readonly hasMore: boolean;
2209
+ readonly envelopes: ReadonlyArray<{
2210
+ readonly type: SyncEnvelopeType;
2211
+ readonly key?: string | null | undefined;
2212
+ readonly dependsOn?: ReadonlyArray<string> | null | undefined;
2213
+ readonly channelMeta: {
2214
+ readonly id: string;
2215
+ };
2216
+ readonly operations?: ReadonlyArray<{
2217
+ readonly operation: {
2218
+ readonly index: number;
2219
+ readonly timestampUtcMs: string;
2220
+ readonly hash: string;
2221
+ readonly skip: number;
2222
+ readonly error?: string | null | undefined;
2223
+ readonly id?: string | null | undefined;
2224
+ readonly action: {
2225
+ readonly id: string;
2226
+ readonly type: string;
2227
+ readonly timestampUtcMs: string;
2228
+ readonly input: NonNullable<unknown>;
2229
+ readonly scope: string;
2230
+ readonly attachments?: ReadonlyArray<{
2231
+ readonly data: string;
2232
+ readonly mimeType: string;
2233
+ readonly hash: string;
2234
+ readonly extension?: string | null | undefined;
2235
+ readonly fileName?: string | null | undefined;
2236
+ }> | null | undefined;
2237
+ readonly context?: {
2238
+ readonly signer?: {
2239
+ readonly signatures: ReadonlyArray<string>;
2240
+ readonly user?: {
2241
+ readonly address: string;
2242
+ readonly networkId: string;
2243
+ readonly chainId: number;
2244
+ } | null | undefined;
2245
+ readonly app?: {
2246
+ readonly name: string;
2247
+ readonly key: string;
2248
+ } | null | undefined;
2249
+ } | null | undefined;
2250
+ } | null | undefined;
2251
+ };
2252
+ };
2253
+ readonly context: {
2254
+ readonly documentId: string;
2255
+ readonly documentType: string;
2256
+ readonly scope: string;
2257
+ readonly branch: string;
2258
+ };
2259
+ }> | null | undefined;
2260
+ readonly cursor?: {
2261
+ readonly remoteName: string;
2262
+ readonly cursorOrdinal: number;
2263
+ readonly lastSyncedAtUtcMs?: string | null | undefined;
2264
+ } | null | undefined;
2265
+ }>;
2266
+ readonly deadLetters: ReadonlyArray<{
2267
+ readonly documentId: string;
2268
+ readonly error: string;
2269
+ }>;
2270
+ };
2271
+ };
2272
+ type TouchChannelMutationVariables = Exact<{
2273
+ input: TouchChannelInput;
2274
+ }>;
2275
+ type TouchChannelMutation = {
2276
+ readonly touchChannel: {
2277
+ readonly success: boolean;
2278
+ readonly ackOrdinal: number;
2279
+ };
2280
+ };
2281
+ type PushSyncEnvelopesMutationVariables = Exact<{
2282
+ envelopes: ReadonlyArray<SyncEnvelopeInput>;
2283
+ }>;
2284
+ type PushSyncEnvelopesMutation = {
2285
+ readonly pushSyncEnvelopes: boolean;
2286
+ };
2287
+ type WithIndex<TObject> = TObject & Record<string, any>;
2288
+ type ResolversObject<TObject> = WithIndex<TObject>;
2289
+ type ResolverTypeWrapper<T> = Promise<T> | T;
2290
+ type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
2291
+ resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
2292
+ };
2293
+ type Resolver<TResult, TParent = Record<PropertyKey, never>, TContext = Record<PropertyKey, never>, TArgs = Record<PropertyKey, never>> = ResolverFn<TResult, TParent, TContext, TArgs> | ResolverWithResolve<TResult, TParent, TContext, TArgs>;
2294
+ type ResolverFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => Promise<TResult> | TResult;
2295
+ type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => AsyncIterable<TResult> | Promise<AsyncIterable<TResult>>;
2296
+ type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise<TResult>;
2297
+ interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> {
2298
+ subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>;
2299
+ resolve?: SubscriptionResolveFn<TResult, { [key in TKey]: TResult }, TContext, TArgs>;
2300
+ }
2301
+ interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> {
2302
+ subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>;
2303
+ resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>;
2304
+ }
2305
+ type SubscriptionObject<TResult, TKey extends string, TParent, TContext, TArgs> = SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs> | SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;
2306
+ type SubscriptionResolver<TResult, TKey extends string, TParent = Record<PropertyKey, never>, TContext = Record<PropertyKey, never>, TArgs = Record<PropertyKey, never>> = ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>) | SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>;
2307
+ type TypeResolveFn<TTypes, TParent = Record<PropertyKey, never>, TContext = Record<PropertyKey, never>> = (parent: TParent, context: TContext, info: GraphQLResolveInfo) => Maybe<TTypes> | Promise<Maybe<TTypes>>;
2308
+ type IsTypeOfResolverFn<T = Record<PropertyKey, never>, TContext = Record<PropertyKey, never>> = (obj: T, context: TContext, info: GraphQLResolveInfo) => boolean | Promise<boolean>;
2309
+ type NextResolverFn<T> = () => Promise<T>;
2310
+ type DirectiveResolverFn<TResult = Record<PropertyKey, never>, TParent = Record<PropertyKey, never>, TContext = Record<PropertyKey, never>, TArgs = Record<PropertyKey, never>> = (next: NextResolverFn<TResult>, parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise<TResult>;
2311
+ /** Mapping between all available schema types and the resolvers types */
2312
+ type ResolversTypes = ResolversObject<{
2313
+ Action: ResolverTypeWrapper<Action>;
2314
+ ActionContext: ResolverTypeWrapper<ActionContext>;
2315
+ ActionContextInput: ActionContextInput;
2316
+ ActionInput: ActionInput;
2317
+ Attachment: ResolverTypeWrapper<Attachment>;
2318
+ AttachmentInput: AttachmentInput;
2319
+ Boolean: ResolverTypeWrapper<Scalars["Boolean"]["output"]>;
2320
+ ChannelMeta: ResolverTypeWrapper<ChannelMeta>;
2321
+ ChannelMetaInput: ChannelMetaInput;
2322
+ DateTime: ResolverTypeWrapper<Scalars["DateTime"]["output"]>;
2323
+ DeadLetterInfo: ResolverTypeWrapper<DeadLetterInfo>;
2324
+ DocumentChangeContext: ResolverTypeWrapper<DocumentChangeContext>;
2325
+ DocumentChangeEvent: ResolverTypeWrapper<DocumentChangeEvent>;
2326
+ DocumentChangeType: DocumentChangeType;
2327
+ DocumentModelGlobalState: ResolverTypeWrapper<DocumentModelGlobalState>;
2328
+ DocumentModelResultPage: ResolverTypeWrapper<DocumentModelResultPage>;
2329
+ DocumentOperationsFilterInput: DocumentOperationsFilterInput;
2330
+ DocumentWithChildren: ResolverTypeWrapper<DocumentWithChildren>;
2331
+ Int: ResolverTypeWrapper<Scalars["Int"]["output"]>;
2332
+ JSONObject: ResolverTypeWrapper<Scalars["JSONObject"]["output"]>;
2333
+ JobChangeEvent: ResolverTypeWrapper<JobChangeEvent>;
2334
+ JobInfo: ResolverTypeWrapper<JobInfo>;
2335
+ MoveRelationshipResult: ResolverTypeWrapper<MoveRelationshipResult>;
2336
+ Mutation: ResolverTypeWrapper<Record<PropertyKey, never>>;
2337
+ OperationContext: ResolverTypeWrapper<OperationContext>;
2338
+ OperationContextInput: OperationContextInput;
2339
+ OperationInput: OperationInput;
2340
+ OperationWithContext: ResolverTypeWrapper<OperationWithContext>;
2341
+ OperationWithContextInput: OperationWithContextInput;
2342
+ OperationsFilterInput: OperationsFilterInput;
2343
+ PHDocument: ResolverTypeWrapper<PhDocument>;
2344
+ PHDocumentResultPage: ResolverTypeWrapper<PhDocumentResultPage>;
2345
+ PagingInput: PagingInput;
2346
+ PollSyncEnvelopesResult: ResolverTypeWrapper<PollSyncEnvelopesResult>;
2347
+ PropagationMode: PropagationMode;
2348
+ Query: ResolverTypeWrapper<Record<PropertyKey, never>>;
2349
+ ReactorOperation: ResolverTypeWrapper<ReactorOperation>;
2350
+ ReactorOperationResultPage: ResolverTypeWrapper<ReactorOperationResultPage>;
2351
+ ReactorSigner: ResolverTypeWrapper<ReactorSigner>;
2352
+ ReactorSignerApp: ResolverTypeWrapper<ReactorSignerApp>;
2353
+ ReactorSignerAppInput: ReactorSignerAppInput;
2354
+ ReactorSignerInput: ReactorSignerInput;
2355
+ ReactorSignerUser: ResolverTypeWrapper<ReactorSignerUser>;
2356
+ ReactorSignerUserInput: ReactorSignerUserInput;
2357
+ RemoteCursor: ResolverTypeWrapper<RemoteCursor>;
2358
+ RemoteCursorInput: RemoteCursorInput;
2359
+ RemoteFilterInput: RemoteFilterInput;
2360
+ Revision: ResolverTypeWrapper<Revision>;
2361
+ SearchFilterInput: SearchFilterInput;
2362
+ String: ResolverTypeWrapper<Scalars["String"]["output"]>;
2363
+ Subscription: ResolverTypeWrapper<Record<PropertyKey, never>>;
2364
+ SyncEnvelope: ResolverTypeWrapper<SyncEnvelope>;
2365
+ SyncEnvelopeInput: SyncEnvelopeInput;
2366
+ SyncEnvelopeType: SyncEnvelopeType;
2367
+ TouchChannelInput: TouchChannelInput;
2368
+ TouchChannelResult: ResolverTypeWrapper<TouchChannelResult>;
2369
+ ViewFilterInput: ViewFilterInput;
2370
+ }>;
2371
+ /** Mapping between all available schema types and the resolvers parents */
2372
+ type ResolversParentTypes = ResolversObject<{
2373
+ Action: Action;
2374
+ ActionContext: ActionContext;
2375
+ ActionContextInput: ActionContextInput;
2376
+ ActionInput: ActionInput;
2377
+ Attachment: Attachment;
2378
+ AttachmentInput: AttachmentInput;
2379
+ Boolean: Scalars["Boolean"]["output"];
2380
+ ChannelMeta: ChannelMeta;
2381
+ ChannelMetaInput: ChannelMetaInput;
2382
+ DateTime: Scalars["DateTime"]["output"];
2383
+ DeadLetterInfo: DeadLetterInfo;
2384
+ DocumentChangeContext: DocumentChangeContext;
2385
+ DocumentChangeEvent: DocumentChangeEvent;
2386
+ DocumentModelGlobalState: DocumentModelGlobalState;
2387
+ DocumentModelResultPage: DocumentModelResultPage;
2388
+ DocumentOperationsFilterInput: DocumentOperationsFilterInput;
2389
+ DocumentWithChildren: DocumentWithChildren;
2390
+ Int: Scalars["Int"]["output"];
2391
+ JSONObject: Scalars["JSONObject"]["output"];
2392
+ JobChangeEvent: JobChangeEvent;
2393
+ JobInfo: JobInfo;
2394
+ MoveRelationshipResult: MoveRelationshipResult;
2395
+ Mutation: Record<PropertyKey, never>;
2396
+ OperationContext: OperationContext;
2397
+ OperationContextInput: OperationContextInput;
2398
+ OperationInput: OperationInput;
2399
+ OperationWithContext: OperationWithContext;
2400
+ OperationWithContextInput: OperationWithContextInput;
2401
+ OperationsFilterInput: OperationsFilterInput;
2402
+ PHDocument: PhDocument;
2403
+ PHDocumentResultPage: PhDocumentResultPage;
2404
+ PagingInput: PagingInput;
2405
+ PollSyncEnvelopesResult: PollSyncEnvelopesResult;
2406
+ Query: Record<PropertyKey, never>;
2407
+ ReactorOperation: ReactorOperation;
2408
+ ReactorOperationResultPage: ReactorOperationResultPage;
2409
+ ReactorSigner: ReactorSigner;
2410
+ ReactorSignerApp: ReactorSignerApp;
2411
+ ReactorSignerAppInput: ReactorSignerAppInput;
2412
+ ReactorSignerInput: ReactorSignerInput;
2413
+ ReactorSignerUser: ReactorSignerUser;
2414
+ ReactorSignerUserInput: ReactorSignerUserInput;
2415
+ RemoteCursor: RemoteCursor;
2416
+ RemoteCursorInput: RemoteCursorInput;
2417
+ RemoteFilterInput: RemoteFilterInput;
2418
+ Revision: Revision;
2419
+ SearchFilterInput: SearchFilterInput;
2420
+ String: Scalars["String"]["output"];
2421
+ Subscription: Record<PropertyKey, never>;
2422
+ SyncEnvelope: SyncEnvelope;
2423
+ SyncEnvelopeInput: SyncEnvelopeInput;
2424
+ TouchChannelInput: TouchChannelInput;
2425
+ TouchChannelResult: TouchChannelResult;
2426
+ ViewFilterInput: ViewFilterInput;
2427
+ }>;
2428
+ type ActionResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Action"] = ResolversParentTypes["Action"]> = ResolversObject<{
2429
+ attachments?: Resolver<Maybe<ReadonlyArray<ResolversTypes["Attachment"]>>, ParentType, ContextType>;
2430
+ context?: Resolver<Maybe<ResolversTypes["ActionContext"]>, ParentType, ContextType>;
2431
+ id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2432
+ input?: Resolver<ResolversTypes["JSONObject"], ParentType, ContextType>;
2433
+ scope?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2434
+ timestampUtcMs?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2435
+ type?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2436
+ }>;
2437
+ type ActionContextResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ActionContext"] = ResolversParentTypes["ActionContext"]> = ResolversObject<{
2438
+ signer?: Resolver<Maybe<ResolversTypes["ReactorSigner"]>, ParentType, ContextType>;
2439
+ }>;
2440
+ type AttachmentResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Attachment"] = ResolversParentTypes["Attachment"]> = ResolversObject<{
2441
+ data?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2442
+ extension?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2443
+ fileName?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2444
+ hash?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2445
+ mimeType?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2446
+ }>;
2447
+ type ChannelMetaResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ChannelMeta"] = ResolversParentTypes["ChannelMeta"]> = ResolversObject<{
2448
+ id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2449
+ }>;
2450
+ interface DateTimeScalarConfig extends GraphQLScalarTypeConfig<ResolversTypes["DateTime"], any> {
2451
+ name: "DateTime";
2452
+ }
2453
+ type DeadLetterInfoResolvers<ContextType = Context, ParentType extends ResolversParentTypes["DeadLetterInfo"] = ResolversParentTypes["DeadLetterInfo"]> = ResolversObject<{
2454
+ branch?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2455
+ documentId?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2456
+ error?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2457
+ jobId?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2458
+ operationCount?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2459
+ scopes?: Resolver<ReadonlyArray<ResolversTypes["String"]>, ParentType, ContextType>;
2460
+ }>;
2461
+ type DocumentChangeContextResolvers<ContextType = Context, ParentType extends ResolversParentTypes["DocumentChangeContext"] = ResolversParentTypes["DocumentChangeContext"]> = ResolversObject<{
2462
+ childId?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2463
+ parentId?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2464
+ }>;
2465
+ type DocumentChangeEventResolvers<ContextType = Context, ParentType extends ResolversParentTypes["DocumentChangeEvent"] = ResolversParentTypes["DocumentChangeEvent"]> = ResolversObject<{
2466
+ context?: Resolver<Maybe<ResolversTypes["DocumentChangeContext"]>, ParentType, ContextType>;
2467
+ documents?: Resolver<ReadonlyArray<ResolversTypes["PHDocument"]>, ParentType, ContextType>;
2468
+ type?: Resolver<ResolversTypes["DocumentChangeType"], ParentType, ContextType>;
2469
+ }>;
2470
+ type DocumentModelGlobalStateResolvers<ContextType = Context, ParentType extends ResolversParentTypes["DocumentModelGlobalState"] = ResolversParentTypes["DocumentModelGlobalState"]> = ResolversObject<{
2471
+ id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2472
+ name?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2473
+ namespace?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2474
+ specification?: Resolver<ResolversTypes["JSONObject"], ParentType, ContextType>;
2475
+ version?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2476
+ }>;
2477
+ type DocumentModelResultPageResolvers<ContextType = Context, ParentType extends ResolversParentTypes["DocumentModelResultPage"] = ResolversParentTypes["DocumentModelResultPage"]> = ResolversObject<{
2478
+ cursor?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2479
+ hasNextPage?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
2480
+ hasPreviousPage?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
2481
+ items?: Resolver<ReadonlyArray<ResolversTypes["DocumentModelGlobalState"]>, ParentType, ContextType>;
2482
+ totalCount?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2483
+ }>;
2484
+ type DocumentWithChildrenResolvers<ContextType = Context, ParentType extends ResolversParentTypes["DocumentWithChildren"] = ResolversParentTypes["DocumentWithChildren"]> = ResolversObject<{
2485
+ childIds?: Resolver<ReadonlyArray<ResolversTypes["String"]>, ParentType, ContextType>;
2486
+ document?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType>;
2487
+ }>;
2488
+ interface JsonObjectScalarConfig extends GraphQLScalarTypeConfig<ResolversTypes["JSONObject"], any> {
2489
+ name: "JSONObject";
2490
+ }
2491
+ type JobChangeEventResolvers<ContextType = Context, ParentType extends ResolversParentTypes["JobChangeEvent"] = ResolversParentTypes["JobChangeEvent"]> = ResolversObject<{
2492
+ error?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2493
+ jobId?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2494
+ result?: Resolver<ResolversTypes["JSONObject"], ParentType, ContextType>;
2495
+ status?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2496
+ }>;
2497
+ type JobInfoResolvers<ContextType = Context, ParentType extends ResolversParentTypes["JobInfo"] = ResolversParentTypes["JobInfo"]> = ResolversObject<{
2498
+ completedAt?: Resolver<Maybe<ResolversTypes["DateTime"]>, ParentType, ContextType>;
2499
+ createdAt?: Resolver<ResolversTypes["DateTime"], ParentType, ContextType>;
2500
+ error?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2501
+ id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2502
+ result?: Resolver<ResolversTypes["JSONObject"], ParentType, ContextType>;
2503
+ status?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2504
+ }>;
2505
+ type MoveRelationshipResultResolvers<ContextType = Context, ParentType extends ResolversParentTypes["MoveRelationshipResult"] = ResolversParentTypes["MoveRelationshipResult"]> = ResolversObject<{
2506
+ source?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType>;
2507
+ target?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType>;
2508
+ }>;
2509
+ type MutationResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Mutation"] = ResolversParentTypes["Mutation"]> = ResolversObject<{
2510
+ addRelationship?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationAddRelationshipArgs, "relationshipType" | "sourceIdentifier" | "targetIdentifier">>;
2511
+ createDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationCreateDocumentArgs, "document">>;
2512
+ createEmptyDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationCreateEmptyDocumentArgs, "documentType">>;
2513
+ deleteDocument?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, RequireFields<MutationDeleteDocumentArgs, "identifier">>;
2514
+ deleteDocuments?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, RequireFields<MutationDeleteDocumentsArgs, "identifiers">>;
2515
+ moveRelationship?: Resolver<ResolversTypes["MoveRelationshipResult"], ParentType, ContextType, RequireFields<MutationMoveRelationshipArgs, "relationshipType" | "sourceParentIdentifier" | "targetIdentifier" | "targetParentIdentifier">>;
2516
+ mutateDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationMutateDocumentArgs, "actions" | "documentIdentifier">>;
2517
+ mutateDocumentAsync?: Resolver<ResolversTypes["String"], ParentType, ContextType, RequireFields<MutationMutateDocumentAsyncArgs, "actions" | "documentIdentifier">>;
2518
+ pushSyncEnvelopes?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, RequireFields<MutationPushSyncEnvelopesArgs, "envelopes">>;
2519
+ removeRelationship?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationRemoveRelationshipArgs, "relationshipType" | "sourceIdentifier" | "targetIdentifier">>;
2520
+ renameDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationRenameDocumentArgs, "documentIdentifier" | "name">>;
2521
+ touchChannel?: Resolver<ResolversTypes["TouchChannelResult"], ParentType, ContextType, RequireFields<MutationTouchChannelArgs, "input">>;
2522
+ }>;
2523
+ type OperationContextResolvers<ContextType = Context, ParentType extends ResolversParentTypes["OperationContext"] = ResolversParentTypes["OperationContext"]> = ResolversObject<{
2524
+ branch?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2525
+ documentId?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2526
+ documentType?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2527
+ ordinal?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2528
+ scope?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2529
+ }>;
2530
+ type OperationWithContextResolvers<ContextType = Context, ParentType extends ResolversParentTypes["OperationWithContext"] = ResolversParentTypes["OperationWithContext"]> = ResolversObject<{
2531
+ context?: Resolver<ResolversTypes["OperationContext"], ParentType, ContextType>;
2532
+ operation?: Resolver<ResolversTypes["ReactorOperation"], ParentType, ContextType>;
2533
+ }>;
2534
+ type PhDocumentResolvers<ContextType = Context, ParentType extends ResolversParentTypes["PHDocument"] = ResolversParentTypes["PHDocument"]> = ResolversObject<{
2535
+ createdAtUtcIso?: Resolver<ResolversTypes["DateTime"], ParentType, ContextType>;
2536
+ documentType?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2537
+ id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2538
+ lastModifiedAtUtcIso?: Resolver<ResolversTypes["DateTime"], ParentType, ContextType>;
2539
+ name?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2540
+ operations?: Resolver<Maybe<ResolversTypes["ReactorOperationResultPage"]>, ParentType, ContextType, Partial<PhDocumentOperationsArgs>>;
2541
+ preferredEditor?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2542
+ revisionsList?: Resolver<ReadonlyArray<ResolversTypes["Revision"]>, ParentType, ContextType>;
2543
+ slug?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2544
+ state?: Resolver<ResolversTypes["JSONObject"], ParentType, ContextType>;
2545
+ }>;
2546
+ type PhDocumentResultPageResolvers<ContextType = Context, ParentType extends ResolversParentTypes["PHDocumentResultPage"] = ResolversParentTypes["PHDocumentResultPage"]> = ResolversObject<{
2547
+ cursor?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2548
+ hasNextPage?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
2549
+ hasPreviousPage?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
2550
+ items?: Resolver<ReadonlyArray<ResolversTypes["PHDocument"]>, ParentType, ContextType>;
2551
+ totalCount?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2552
+ }>;
2553
+ type PollSyncEnvelopesResultResolvers<ContextType = Context, ParentType extends ResolversParentTypes["PollSyncEnvelopesResult"] = ResolversParentTypes["PollSyncEnvelopesResult"]> = ResolversObject<{
2554
+ ackOrdinal?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2555
+ deadLetters?: Resolver<ReadonlyArray<ResolversTypes["DeadLetterInfo"]>, ParentType, ContextType>;
2556
+ envelopes?: Resolver<ReadonlyArray<ResolversTypes["SyncEnvelope"]>, ParentType, ContextType>;
2557
+ hasMore?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
2558
+ }>;
2559
+ type QueryResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Query"] = ResolversParentTypes["Query"]> = ResolversObject<{
2560
+ document?: Resolver<Maybe<ResolversTypes["DocumentWithChildren"]>, ParentType, ContextType, RequireFields<QueryDocumentArgs, "identifier">>;
2561
+ documentIncomingRelationships?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, RequireFields<QueryDocumentIncomingRelationshipsArgs, "relationshipType" | "targetIdentifier">>;
2562
+ documentModels?: Resolver<ResolversTypes["DocumentModelResultPage"], ParentType, ContextType, Partial<QueryDocumentModelsArgs>>;
2563
+ documentOperations?: Resolver<ResolversTypes["ReactorOperationResultPage"], ParentType, ContextType, RequireFields<QueryDocumentOperationsArgs, "filter">>;
2564
+ documentOutgoingRelationships?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, RequireFields<QueryDocumentOutgoingRelationshipsArgs, "relationshipType" | "sourceIdentifier">>;
2565
+ findDocuments?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, Partial<QueryFindDocumentsArgs>>;
2566
+ jobStatus?: Resolver<Maybe<ResolversTypes["JobInfo"]>, ParentType, ContextType, RequireFields<QueryJobStatusArgs, "jobId">>;
2567
+ pollSyncEnvelopes?: Resolver<ResolversTypes["PollSyncEnvelopesResult"], ParentType, ContextType, RequireFields<QueryPollSyncEnvelopesArgs, "channelId" | "outboxAck" | "outboxLatest">>;
2568
+ }>;
2569
+ type ReactorOperationResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ReactorOperation"] = ResolversParentTypes["ReactorOperation"]> = ResolversObject<{
2570
+ action?: Resolver<ResolversTypes["Action"], ParentType, ContextType>;
2571
+ error?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2572
+ hash?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2573
+ id?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2574
+ index?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2575
+ skip?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2576
+ timestampUtcMs?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2577
+ }>;
2578
+ type ReactorOperationResultPageResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ReactorOperationResultPage"] = ResolversParentTypes["ReactorOperationResultPage"]> = ResolversObject<{
2579
+ cursor?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2580
+ hasNextPage?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
2581
+ hasPreviousPage?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
2582
+ items?: Resolver<ReadonlyArray<ResolversTypes["ReactorOperation"]>, ParentType, ContextType>;
2583
+ totalCount?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2584
+ }>;
2585
+ type ReactorSignerResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ReactorSigner"] = ResolversParentTypes["ReactorSigner"]> = ResolversObject<{
2586
+ app?: Resolver<Maybe<ResolversTypes["ReactorSignerApp"]>, ParentType, ContextType>;
2587
+ signatures?: Resolver<ReadonlyArray<ResolversTypes["String"]>, ParentType, ContextType>;
2588
+ user?: Resolver<Maybe<ResolversTypes["ReactorSignerUser"]>, ParentType, ContextType>;
2589
+ }>;
2590
+ type ReactorSignerAppResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ReactorSignerApp"] = ResolversParentTypes["ReactorSignerApp"]> = ResolversObject<{
2591
+ key?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2592
+ name?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2593
+ }>;
2594
+ type ReactorSignerUserResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ReactorSignerUser"] = ResolversParentTypes["ReactorSignerUser"]> = ResolversObject<{
2595
+ address?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2596
+ chainId?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2597
+ networkId?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2598
+ }>;
2599
+ type RemoteCursorResolvers<ContextType = Context, ParentType extends ResolversParentTypes["RemoteCursor"] = ResolversParentTypes["RemoteCursor"]> = ResolversObject<{
2600
+ cursorOrdinal?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2601
+ lastSyncedAtUtcMs?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2602
+ remoteName?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2603
+ }>;
2604
+ type RevisionResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Revision"] = ResolversParentTypes["Revision"]> = ResolversObject<{
2605
+ revision?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2606
+ scope?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
2607
+ }>;
2608
+ type SubscriptionResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Subscription"] = ResolversParentTypes["Subscription"]> = ResolversObject<{
2609
+ documentChanges?: SubscriptionResolver<ResolversTypes["DocumentChangeEvent"], "documentChanges", ParentType, ContextType, Partial<SubscriptionDocumentChangesArgs>>;
2610
+ jobChanges?: SubscriptionResolver<ResolversTypes["JobChangeEvent"], "jobChanges", ParentType, ContextType, RequireFields<SubscriptionJobChangesArgs, "jobId">>;
2611
+ }>;
2612
+ type SyncEnvelopeResolvers<ContextType = Context, ParentType extends ResolversParentTypes["SyncEnvelope"] = ResolversParentTypes["SyncEnvelope"]> = ResolversObject<{
2613
+ channelMeta?: Resolver<ResolversTypes["ChannelMeta"], ParentType, ContextType>;
2614
+ cursor?: Resolver<Maybe<ResolversTypes["RemoteCursor"]>, ParentType, ContextType>;
2615
+ dependsOn?: Resolver<Maybe<ReadonlyArray<ResolversTypes["String"]>>, ParentType, ContextType>;
2616
+ key?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
2617
+ operations?: Resolver<Maybe<ReadonlyArray<ResolversTypes["OperationWithContext"]>>, ParentType, ContextType>;
2618
+ type?: Resolver<ResolversTypes["SyncEnvelopeType"], ParentType, ContextType>;
2619
+ }>;
2620
+ type TouchChannelResultResolvers<ContextType = Context, ParentType extends ResolversParentTypes["TouchChannelResult"] = ResolversParentTypes["TouchChannelResult"]> = ResolversObject<{
2621
+ ackOrdinal?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
2622
+ success?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
2623
+ }>;
2624
+ type Resolvers<ContextType = Context> = ResolversObject<{
2625
+ Action?: ActionResolvers<ContextType>;
2626
+ ActionContext?: ActionContextResolvers<ContextType>;
2627
+ Attachment?: AttachmentResolvers<ContextType>;
2628
+ ChannelMeta?: ChannelMetaResolvers<ContextType>;
2629
+ DateTime?: GraphQLScalarType;
2630
+ DeadLetterInfo?: DeadLetterInfoResolvers<ContextType>;
2631
+ DocumentChangeContext?: DocumentChangeContextResolvers<ContextType>;
2632
+ DocumentChangeEvent?: DocumentChangeEventResolvers<ContextType>;
2633
+ DocumentModelGlobalState?: DocumentModelGlobalStateResolvers<ContextType>;
2634
+ DocumentModelResultPage?: DocumentModelResultPageResolvers<ContextType>;
2635
+ DocumentWithChildren?: DocumentWithChildrenResolvers<ContextType>;
2636
+ JSONObject?: GraphQLScalarType;
2637
+ JobChangeEvent?: JobChangeEventResolvers<ContextType>;
2638
+ JobInfo?: JobInfoResolvers<ContextType>;
2639
+ MoveRelationshipResult?: MoveRelationshipResultResolvers<ContextType>;
2640
+ Mutation?: MutationResolvers<ContextType>;
2641
+ OperationContext?: OperationContextResolvers<ContextType>;
2642
+ OperationWithContext?: OperationWithContextResolvers<ContextType>;
2643
+ PHDocument?: PhDocumentResolvers<ContextType>;
2644
+ PHDocumentResultPage?: PhDocumentResultPageResolvers<ContextType>;
2645
+ PollSyncEnvelopesResult?: PollSyncEnvelopesResultResolvers<ContextType>;
2646
+ Query?: QueryResolvers<ContextType>;
2647
+ ReactorOperation?: ReactorOperationResolvers<ContextType>;
2648
+ ReactorOperationResultPage?: ReactorOperationResultPageResolvers<ContextType>;
2649
+ ReactorSigner?: ReactorSignerResolvers<ContextType>;
2650
+ ReactorSignerApp?: ReactorSignerAppResolvers<ContextType>;
2651
+ ReactorSignerUser?: ReactorSignerUserResolvers<ContextType>;
2652
+ RemoteCursor?: RemoteCursorResolvers<ContextType>;
2653
+ Revision?: RevisionResolvers<ContextType>;
2654
+ Subscription?: SubscriptionResolvers<ContextType>;
2655
+ SyncEnvelope?: SyncEnvelopeResolvers<ContextType>;
2656
+ TouchChannelResult?: TouchChannelResultResolvers<ContextType>;
2657
+ }>;
2658
+ type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]> }>;
2659
+ type definedNonNullAny = {};
2660
+ declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
2661
+ declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType<definedNonNullAny, any, z$1.core.$ZodTypeInternals<definedNonNullAny, any>>;
2662
+ declare const DocumentChangeTypeSchema: z$1.ZodEnum<typeof DocumentChangeType>;
2663
+ declare const PropagationModeSchema: z$1.ZodEnum<typeof PropagationMode>;
2664
+ declare const SyncEnvelopeTypeSchema: z$1.ZodEnum<typeof SyncEnvelopeType>;
2665
+ declare function ActionContextInputSchema(): z$1.ZodObject<Properties<ActionContextInput>>;
2666
+ declare function ActionInputSchema(): z$1.ZodObject<Properties<ActionInput>>;
2667
+ declare function AttachmentInputSchema(): z$1.ZodObject<Properties<AttachmentInput>>;
2668
+ declare function ChannelMetaInputSchema(): z$1.ZodObject<Properties<ChannelMetaInput>>;
2669
+ declare function DocumentOperationsFilterInputSchema(): z$1.ZodObject<Properties<DocumentOperationsFilterInput>>;
2670
+ declare function OperationContextInputSchema(): z$1.ZodObject<Properties<OperationContextInput>>;
2671
+ declare function OperationInputSchema(): z$1.ZodObject<Properties<OperationInput>>;
2672
+ declare function OperationWithContextInputSchema(): z$1.ZodObject<Properties<OperationWithContextInput>>;
2673
+ declare function OperationsFilterInputSchema(): z$1.ZodObject<Properties<OperationsFilterInput>>;
2674
+ declare function PagingInputSchema(): z$1.ZodObject<Properties<PagingInput>>;
2675
+ declare function ReactorSignerAppInputSchema(): z$1.ZodObject<Properties<ReactorSignerAppInput>>;
2676
+ declare function ReactorSignerInputSchema(): z$1.ZodObject<Properties<ReactorSignerInput>>;
2677
+ declare function ReactorSignerUserInputSchema(): z$1.ZodObject<Properties<ReactorSignerUserInput>>;
2678
+ declare function RemoteCursorInputSchema(): z$1.ZodObject<Properties<RemoteCursorInput>>;
2679
+ declare function RemoteFilterInputSchema(): z$1.ZodObject<Properties<RemoteFilterInput>>;
2680
+ declare function SearchFilterInputSchema(): z$1.ZodObject<Properties<SearchFilterInput>>;
2681
+ declare function SyncEnvelopeInputSchema(): z$1.ZodObject<Properties<SyncEnvelopeInput>>;
2682
+ declare function TouchChannelInputSchema(): z$1.ZodObject<Properties<TouchChannelInput>>;
2683
+ declare function ViewFilterInputSchema(): z$1.ZodObject<Properties<ViewFilterInput>>;
2684
+ declare const PhDocumentFieldsFragmentDoc: DocumentNode;
2685
+ declare const GetDocumentModelsDocument: DocumentNode;
2686
+ declare const GetDocumentDocument: DocumentNode;
2687
+ declare const GetDocumentWithOperationsDocument: DocumentNode;
2688
+ declare const GetDocumentOutgoingRelationshipsDocument: DocumentNode;
2689
+ declare const GetDocumentIncomingRelationshipsDocument: DocumentNode;
2690
+ declare const FindDocumentsDocument: DocumentNode;
2691
+ declare const GetDocumentOperationsDocument: DocumentNode;
2692
+ declare const GetJobStatusDocument: DocumentNode;
2693
+ declare const CreateDocumentDocument: DocumentNode;
2694
+ declare const CreateEmptyDocumentDocument: DocumentNode;
2695
+ declare const MutateDocumentDocument: DocumentNode;
2696
+ declare const MutateDocumentAsyncDocument: DocumentNode;
2697
+ declare const RenameDocumentDocument: DocumentNode;
2698
+ declare const AddRelationshipDocument: DocumentNode;
2699
+ declare const RemoveRelationshipDocument: DocumentNode;
2700
+ declare const MoveRelationshipDocument: DocumentNode;
2701
+ declare const DeleteDocumentDocument: DocumentNode;
2702
+ declare const DeleteDocumentsDocument: DocumentNode;
2703
+ declare const DocumentChangesDocument: DocumentNode;
2704
+ declare const JobChangesDocument: DocumentNode;
2705
+ declare const PollSyncEnvelopesDocument: DocumentNode;
2706
+ declare const TouchChannelDocument: DocumentNode;
2707
+ declare const PushSyncEnvelopesDocument: DocumentNode;
2708
+ type Requester<C = {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R> | AsyncIterable<R>;
2709
+ declare function getSdk<C>(requester: Requester<C>): {
2710
+ GetDocumentModels(variables?: GetDocumentModelsQueryVariables, options?: C): Promise<GetDocumentModelsQuery>;
2711
+ GetDocument(variables: GetDocumentQueryVariables, options?: C): Promise<GetDocumentQuery>;
2712
+ GetDocumentWithOperations(variables: GetDocumentWithOperationsQueryVariables, options?: C): Promise<GetDocumentWithOperationsQuery>;
2713
+ GetDocumentOutgoingRelationships(variables: GetDocumentOutgoingRelationshipsQueryVariables, options?: C): Promise<GetDocumentOutgoingRelationshipsQuery>;
2714
+ GetDocumentIncomingRelationships(variables: GetDocumentIncomingRelationshipsQueryVariables, options?: C): Promise<GetDocumentIncomingRelationshipsQuery>;
2715
+ FindDocuments(variables?: FindDocumentsQueryVariables, options?: C): Promise<FindDocumentsQuery>;
2716
+ GetDocumentOperations(variables: GetDocumentOperationsQueryVariables, options?: C): Promise<GetDocumentOperationsQuery>;
2717
+ GetJobStatus(variables: GetJobStatusQueryVariables, options?: C): Promise<GetJobStatusQuery>;
2718
+ CreateDocument(variables: CreateDocumentMutationVariables, options?: C): Promise<CreateDocumentMutation>;
2719
+ CreateEmptyDocument(variables: CreateEmptyDocumentMutationVariables, options?: C): Promise<CreateEmptyDocumentMutation>;
2720
+ MutateDocument(variables: MutateDocumentMutationVariables, options?: C): Promise<MutateDocumentMutation>;
2721
+ MutateDocumentAsync(variables: MutateDocumentAsyncMutationVariables, options?: C): Promise<MutateDocumentAsyncMutation>;
2722
+ RenameDocument(variables: RenameDocumentMutationVariables, options?: C): Promise<RenameDocumentMutation>;
2723
+ AddRelationship(variables: AddRelationshipMutationVariables, options?: C): Promise<AddRelationshipMutation>;
2724
+ RemoveRelationship(variables: RemoveRelationshipMutationVariables, options?: C): Promise<RemoveRelationshipMutation>;
2725
+ MoveRelationship(variables: MoveRelationshipMutationVariables, options?: C): Promise<MoveRelationshipMutation>;
2726
+ DeleteDocument(variables: DeleteDocumentMutationVariables, options?: C): Promise<DeleteDocumentMutation>;
2727
+ DeleteDocuments(variables: DeleteDocumentsMutationVariables, options?: C): Promise<DeleteDocumentsMutation>;
2728
+ DocumentChanges(variables?: DocumentChangesSubscriptionVariables, options?: C): AsyncIterable<DocumentChangesSubscription>;
2729
+ JobChanges(variables: JobChangesSubscriptionVariables, options?: C): AsyncIterable<JobChangesSubscription>;
2730
+ PollSyncEnvelopes(variables: PollSyncEnvelopesQueryVariables, options?: C): Promise<PollSyncEnvelopesQuery>;
2731
+ TouchChannel(variables: TouchChannelMutationVariables, options?: C): Promise<TouchChannelMutation>;
2732
+ PushSyncEnvelopes(variables: PushSyncEnvelopesMutationVariables, options?: C): Promise<PushSyncEnvelopesMutation>;
2733
+ };
2734
+ type Sdk = ReturnType<typeof getSdk>;
2735
+ //#endregion
2736
+ //#region src/graphql/reactor/requester.d.ts
2737
+ type FetchLike = (input: URL | string, init: RequestInit) => Promise<Response>;
2738
+ //#endregion
2739
+ //#region src/graphql/reactor/factory.d.ts
2740
+ declare function createReactorGraphQLClient(url: string, fetchImpl?: FetchLike, headers?: Record<string, string>): {
2741
+ GetDocumentModels(variables?: Exact<{
2742
+ namespace?: InputMaybe<Scalars["String"]["input"]>;
2743
+ paging?: InputMaybe<PagingInput>;
2744
+ }> | undefined, options?: {} | undefined): Promise<GetDocumentModelsQuery>;
2745
+ GetDocument(variables: Exact<{
2746
+ identifier: Scalars["String"]["input"];
2747
+ view?: InputMaybe<ViewFilterInput>;
2748
+ }>, options?: {} | undefined): Promise<GetDocumentQuery>;
2749
+ GetDocumentWithOperations(variables: Exact<{
2750
+ identifier: Scalars["String"]["input"];
2751
+ view?: InputMaybe<ViewFilterInput>;
2752
+ operationsFilter?: InputMaybe<DocumentOperationsFilterInput>;
2753
+ operationsPaging?: InputMaybe<PagingInput>;
2754
+ }>, options?: {} | undefined): Promise<GetDocumentWithOperationsQuery>;
2755
+ GetDocumentOutgoingRelationships(variables: Exact<{
2756
+ sourceIdentifier: Scalars["String"]["input"];
2757
+ relationshipType: Scalars["String"]["input"];
2758
+ view?: InputMaybe<ViewFilterInput>;
2759
+ paging?: InputMaybe<PagingInput>;
2760
+ }>, options?: {} | undefined): Promise<GetDocumentOutgoingRelationshipsQuery>;
2761
+ GetDocumentIncomingRelationships(variables: Exact<{
2762
+ targetIdentifier: Scalars["String"]["input"];
2763
+ relationshipType: Scalars["String"]["input"];
2764
+ view?: InputMaybe<ViewFilterInput>;
2765
+ paging?: InputMaybe<PagingInput>;
2766
+ }>, options?: {} | undefined): Promise<GetDocumentIncomingRelationshipsQuery>;
2767
+ FindDocuments(variables?: Exact<{
2768
+ search?: InputMaybe<SearchFilterInput>;
2769
+ view?: InputMaybe<ViewFilterInput>;
2770
+ paging?: InputMaybe<PagingInput>;
2771
+ }> | undefined, options?: {} | undefined): Promise<FindDocumentsQuery>;
2772
+ GetDocumentOperations(variables: Exact<{
2773
+ filter: OperationsFilterInput;
2774
+ paging?: InputMaybe<PagingInput>;
2775
+ }>, options?: {} | undefined): Promise<GetDocumentOperationsQuery>;
2776
+ GetJobStatus(variables: Exact<{
2777
+ jobId: Scalars["String"]["input"];
2778
+ }>, options?: {} | undefined): Promise<GetJobStatusQuery>;
2779
+ CreateDocument(variables: Exact<{
2780
+ document: Scalars["JSONObject"]["input"];
2781
+ parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2782
+ }>, options?: {} | undefined): Promise<CreateDocumentMutation>;
2783
+ CreateEmptyDocument(variables: Exact<{
2784
+ documentType: Scalars["String"]["input"];
2785
+ parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2786
+ }>, options?: {} | undefined): Promise<CreateEmptyDocumentMutation>;
2787
+ MutateDocument(variables: Exact<{
2788
+ documentIdentifier: Scalars["String"]["input"];
2789
+ actions: ReadonlyArray<Scalars["JSONObject"]["input"]>;
2790
+ view?: InputMaybe<ViewFilterInput>;
2791
+ }>, options?: {} | undefined): Promise<MutateDocumentMutation>;
2792
+ MutateDocumentAsync(variables: Exact<{
2793
+ documentIdentifier: Scalars["String"]["input"];
2794
+ actions: ReadonlyArray<Scalars["JSONObject"]["input"]>;
2795
+ view?: InputMaybe<ViewFilterInput>;
2796
+ }>, options?: {} | undefined): Promise<MutateDocumentAsyncMutation>;
2797
+ RenameDocument(variables: Exact<{
2798
+ documentIdentifier: Scalars["String"]["input"];
2799
+ name: Scalars["String"]["input"];
2800
+ branch?: InputMaybe<Scalars["String"]["input"]>;
2801
+ }>, options?: {} | undefined): Promise<RenameDocumentMutation>;
2802
+ AddRelationship(variables: Exact<{
2803
+ sourceIdentifier: Scalars["String"]["input"];
2804
+ targetIdentifier: Scalars["String"]["input"];
2805
+ relationshipType: Scalars["String"]["input"];
2806
+ branch?: InputMaybe<Scalars["String"]["input"]>;
2807
+ }>, options?: {} | undefined): Promise<AddRelationshipMutation>;
2808
+ RemoveRelationship(variables: Exact<{
2809
+ sourceIdentifier: Scalars["String"]["input"];
2810
+ targetIdentifier: Scalars["String"]["input"];
2811
+ relationshipType: Scalars["String"]["input"];
2812
+ branch?: InputMaybe<Scalars["String"]["input"]>;
2813
+ }>, options?: {} | undefined): Promise<RemoveRelationshipMutation>;
2814
+ MoveRelationship(variables: Exact<{
2815
+ sourceParentIdentifier: Scalars["String"]["input"];
2816
+ targetParentIdentifier: Scalars["String"]["input"];
2817
+ targetIdentifier: Scalars["String"]["input"];
2818
+ relationshipType: Scalars["String"]["input"];
2819
+ branch?: InputMaybe<Scalars["String"]["input"]>;
2820
+ }>, options?: {} | undefined): Promise<MoveRelationshipMutation>;
2821
+ DeleteDocument(variables: Exact<{
2822
+ identifier: Scalars["String"]["input"];
2823
+ propagate?: InputMaybe<PropagationMode>;
2824
+ }>, options?: {} | undefined): Promise<DeleteDocumentMutation>;
2825
+ DeleteDocuments(variables: Exact<{
2826
+ identifiers: ReadonlyArray<Scalars["String"]["input"]>;
2827
+ propagate?: InputMaybe<PropagationMode>;
2828
+ }>, options?: {} | undefined): Promise<DeleteDocumentsMutation>;
2829
+ DocumentChanges(variables?: Exact<{
2830
+ search?: InputMaybe<SearchFilterInput>;
2831
+ view?: InputMaybe<ViewFilterInput>;
2832
+ }> | undefined, options?: {} | undefined): AsyncIterable<DocumentChangesSubscription>;
2833
+ JobChanges(variables: Exact<{
2834
+ jobId: Scalars["String"]["input"];
2835
+ }>, options?: {} | undefined): AsyncIterable<JobChangesSubscription>;
2836
+ PollSyncEnvelopes(variables: Exact<{
2837
+ channelId: Scalars["String"]["input"];
2838
+ outboxAck: Scalars["Int"]["input"];
2839
+ outboxLatest: Scalars["Int"]["input"];
2840
+ }>, options?: {} | undefined): Promise<PollSyncEnvelopesQuery>;
2841
+ TouchChannel(variables: Exact<{
2842
+ input: TouchChannelInput;
2843
+ }>, options?: {} | undefined): Promise<TouchChannelMutation>;
2844
+ PushSyncEnvelopes(variables: Exact<{
2845
+ envelopes: ReadonlyArray<SyncEnvelopeInput>;
2846
+ }>, options?: {} | undefined): Promise<PushSyncEnvelopesMutation>;
2847
+ };
2848
+ //#endregion
2849
+ //#region src/graphql/reactor/subgraph.d.ts
2850
+ declare class ReactorSubgraph extends BaseSubgraph {
2851
+ #private;
2852
+ private logger;
2853
+ constructor(args: SubgraphArgs);
2854
+ name: string;
2855
+ hasSubscriptions: boolean;
2856
+ /**
2857
+ * Check operation-level permissions for an array of actions.
2858
+ * Delegates to base assertCanExecuteOperation for each action.
2859
+ */
2860
+ private assertCanExecuteOperations;
2861
+ typeDefs: graphql.DocumentNode;
2862
+ resolvers: Resolvers;
2863
+ onSetup(): Promise<void>;
2864
+ }
2865
+ //#endregion
2866
+ //#region src/graphql/system/env/index.d.ts
2867
+ declare const ADMIN_USERS: string[];
2868
+ //#endregion
2869
+ //#region src/graphql/system/subgraph.d.ts
2870
+ declare class SystemSubgraph extends BaseSubgraph {
2871
+ name: string;
2872
+ hasSubscriptions: boolean;
2873
+ typeDefs: graphql.DocumentNode;
2874
+ resolvers: {
2875
+ Query: {
2876
+ system: () => {
2877
+ version: string;
2878
+ gitHash: string;
2879
+ gitUrl: string | null;
2880
+ };
2881
+ };
2882
+ };
2883
+ }
2884
+ //#endregion
2885
+ //#region src/graphql/system/version.d.ts
2886
+ declare function getVersion(): string;
2887
+ declare function getGitHash(): string;
2888
+ declare function getGitUrl(): string | null;
2889
+ //#endregion
2890
+ //#region src/graphql/utils.d.ts
2891
+ declare function isSubgraphClass(candidate: unknown): candidate is SubgraphClass$1;
2892
+ declare function buildGraphqlOperations(operations: Operation[], skip: number, first: number): GqlOperation$1[];
2893
+ declare function buildGraphqlOperation(operation: Operation): GqlOperation$1;
2894
+ declare function buildGraphQlDocument(doc: PHDocument): GqlDocument$1;
2895
+ declare function buildGraphQlDriveDocument(doc: DocumentDriveDocument): GqlDriveDocument$1;
2896
+ //#endregion
2897
+ //#region src/packages/import-loader.d.ts
2898
+ /**
2899
+ * This class is used to load packages using the import keyword.
2900
+ */
2901
+ declare class ImportPackageLoader implements IPackageLoader {
2902
+ private readonly logger;
2903
+ readonly name = "ImportPackageLoader";
2904
+ loadDocumentModels(identifier: string): Promise<DocumentModelModule[]>;
2905
+ loadSubgraphs(identifier: string): Promise<SubgraphClass$1[]>;
2906
+ loadProcessors(identifier: string): Promise<ProcessorFactoryBuilder | null>;
2907
+ }
2908
+ //#endregion
2909
+ //#region src/packages/package-manager.d.ts
2910
+ declare function getUniqueDocumentModels(...documentModels: DocumentModelModule<any>[][]): DocumentModelModule[];
2911
+ declare class PackageManager implements IPackageManager {
2912
+ protected options: IPackageManagerOptions;
2913
+ private readonly logger;
2914
+ private loaders;
2915
+ private docModelsMap;
2916
+ private subgraphsMap;
2917
+ private processorMap;
2918
+ private configWatcher;
2919
+ private debouncedUpdateCallbacks;
2920
+ private eventEmitter;
2921
+ constructor(loaders: IPackageLoader[], options: IPackageManagerOptions);
2922
+ init(): Promise<PackageManagerResult>;
2923
+ private loadPackages;
2924
+ private loadDocumentModels;
2925
+ private loadSubgraphs;
2926
+ private loadProcessors;
2927
+ private updateDocumentModelsForPackage;
2928
+ private subscribePackages;
2929
+ private getAllPackageNames;
2930
+ private getPackageNamesFromConfigFile;
2931
+ private initConfigFileWatcher;
2932
+ private updatePackagesMap;
2933
+ private updateSubgraphsMap;
2934
+ private updateProcessorsMap;
2935
+ onDocumentModelsChange(handler: (documentModels: Record<string, DocumentModelModule[]>) => void): void;
2936
+ onSubgraphsChange(handler: (subgraphs: Map<string, SubgraphClass$1[]>) => void): void;
2937
+ onProcessorsChange(handler: (processors: Map<string, Processor$1>) => void): void;
2938
+ }
2939
+ //#endregion
2940
+ //#region src/server.d.ts
2941
+ type Options = {
2942
+ port?: number;
2943
+ dbPath: string | undefined;
2944
+ client?: PGlite | typeof Pool | undefined;
2945
+ /**
2946
+ * Factory for the PGLite instance backing the read-model store. When set,
2947
+ * `getDbClient` uses it instead of constructing `new PGlite(dbPath)`. Used
2948
+ * by Switchboard to keep a legacy-version data dir readable while running
2949
+ * the newer Switchboard binary.
2950
+ */
2951
+ pgliteFactory?: PgliteFactory;
2952
+ configFile?: string;
2953
+ packages?: string[];
2954
+ auth?: {
2955
+ enabled: boolean;
2956
+ admins: string[];
2957
+ };
2958
+ https?: {
2959
+ keyPath: string;
2960
+ certPath: string;
2961
+ } | boolean | undefined;
2962
+ packageLoaders?: IPackageLoader[];
2963
+ processors?: Record<string, ProcessorInitializer[]>;
2964
+ mcp?: boolean;
2965
+ processorConfig?: Map<string, unknown>;
2966
+ /**
2967
+ * Document permission service instance.
2968
+ * When provided, the Auth subgraph is registered and document permission
2969
+ * checks are enforced on document operations.
2970
+ * If not provided, can be auto-created by setting DOCUMENT_PERMISSIONS_ENABLED=true
2971
+ * environment variable.
2972
+ */
2973
+ documentPermissionService?: DocumentPermissionService;
2974
+ enableDocumentModelSubgraphs?: boolean;
2975
+ logger?: ILogger;
2976
+ /**
2977
+ * Filesystem path for attachment binary storage.
2978
+ * Defaults to a sibling "attachments" directory next to dbPath,
2979
+ * or os.tmpdir() for in-memory DB deployments.
2980
+ */
2981
+ attachmentStoragePath?: string;
2982
+ };
2983
+ type ProcessorInitializer = ProcessorFactoryBuilder;
2984
+ /**
2985
+ * Initializes and starts the API server using an initializer function.
2986
+ * This function first loads packages to get document models, then calls the initializer function
2987
+ * to create the reactor client module with the appropriate dependencies.
2988
+ *
2989
+ * @param clientInitializer - Initializer function that creates the reactor client module with document models.
2990
+ * @param options - Additional options for server configuration.
2991
+ *
2992
+ * @returns The API server components along with the created client instances.
2993
+ */
2994
+ declare function initializeAndStartAPI(clientInitializer: (documentModels: DocumentModelModule[]) => Promise<ReactorClientModule>, options: Options, processorApp: ProcessorApp): Promise<API & {
2995
+ client: IReactorClient;
2996
+ syncManager: ISyncManager;
2997
+ documentModelRegistry: IDocumentModelRegistry;
2998
+ }>;
2999
+ //#endregion
3000
+ //#region src/tracing.d.ts
3001
+ declare function initTracing(): Promise<void>;
3002
+ declare function isTracingEnabled(): boolean;
3003
+ declare function trace<T>(_name: string, _options: any, fn: () => Promise<T>): Promise<T>;
3004
+ //#endregion
3005
+ //#region src/utils/create-schema.d.ts
3006
+ declare const buildSubgraphSchemaModule: (documentModels: DocumentModelModule[], resolvers: GraphQLResolverMap<Context$1>, typeDefs: DocumentNode) => GraphQLSchemaModule;
3007
+ declare const createSchema: (documentModels: DocumentModelModule[], resolvers: GraphQLResolverMap<Context$1>, typeDefs: DocumentNode) => graphql.GraphQLSchema;
3008
+ /**
3009
+ * Create a merged GraphQL schema from multiple subgraph modules.
3010
+ * Uses buildSubgraphSchema's array overload to combine type definitions
3011
+ * and resolvers from multiple subgraphs into a single executable schema.
3012
+ */
3013
+ declare const createMergedSchema: (modules: GraphQLSchemaModule[]) => graphql.GraphQLSchema;
3014
+ declare function getDocumentModelSchemaName(documentModel: DocumentModelGlobalState$1): string;
3015
+ declare const getDocumentModelTypeDefs: (documentModels: DocumentModelModule[], typeDefs: DocumentNode) => DocumentNode;
3016
+ /**
3017
+ * Options for generating document model GraphQL schemas.
3018
+ */
3019
+ interface DocumentModelSchemaOptions {
3020
+ /**
3021
+ * When true, generates new API patterns:
3022
+ * - Mutations return full document objects (MutationResult type)
3023
+ * - Adds createEmptyDocument mutation
3024
+ * - Makes docId and input parameters required
3025
+ * @default false
3026
+ */
3027
+ useNewApi?: boolean;
3028
+ }
3029
+ /**
3030
+ * Generate a GraphQL schema for a document model.
3031
+ *
3032
+ * @param documentModel - The document model global state
3033
+ * @param options - Schema generation options
3034
+ * @returns GraphQL DocumentNode
3035
+ */
3036
+ declare function generateDocumentModelSchema(documentModel: DocumentModelGlobalState$1, options?: DocumentModelSchemaOptions): DocumentNode;
3037
+ //#endregion
3038
+ export { ADMIN_USERS, API, Action, ActionContext, ActionContextInput, ActionContextInputSchema, ActionContextResolvers, ActionInput, ActionInputSchema, ActionResolvers, AddRelationshipDocument, AddRelationshipMutation, AddRelationshipMutationVariables, AnalyticsSubgraph, Attachment, AttachmentInput, AttachmentInputSchema, AttachmentResolvers, AuthConfig, AuthContext, AuthFetchMiddleware, AuthService, AuthSubgraph, BaseSubgraph, ChannelMeta, ChannelMetaInput, ChannelMetaInputSchema, ChannelMetaResolvers, Context, CreateDocumentDocument, CreateDocumentMutation, CreateDocumentMutationVariables, CreateEmptyDocumentDocument, CreateEmptyDocumentMutation, CreateEmptyDocumentMutationVariables, DateTimeScalarConfig, DeadLetterInfo, DeadLetterInfoResolvers, DeleteDocumentDocument, DeleteDocumentMutation, DeleteDocumentMutationVariables, DeleteDocumentsDocument, DeleteDocumentsMutation, DeleteDocumentsMutationVariables, DirectiveResolverFn, DocumentChangeContext, DocumentChangeContextResolvers, DocumentChangeEvent, DocumentChangeEventResolvers, DocumentChangeType, DocumentChangeTypeSchema, DocumentChangesDocument, DocumentChangesSubscription, DocumentChangesSubscriptionVariables, DocumentGroupPermissionEntry, DocumentGroupPermissionTable, DocumentModelGlobalState, DocumentModelGlobalStateResolvers, DocumentModelResultPage, DocumentModelResultPageResolvers, DocumentModelSchemaOptions, DocumentOperationsFilterInput, DocumentOperationsFilterInputSchema, DocumentPermissionConfig, DocumentPermissionDatabase, DocumentPermissionEntry, DocumentPermissionLevel, DocumentPermissionService, DocumentPermissionTable, DocumentProtectionTable, DocumentWithChildren, DocumentWithChildrenResolvers, Exact, FetchHandler, FindDocumentsDocument, FindDocumentsQuery, FindDocumentsQueryVariables, GatewayAdapterType, GatewayContextFactory, GetDocumentDocument, GetDocumentIncomingRelationshipsDocument, GetDocumentIncomingRelationshipsQuery, GetDocumentIncomingRelationshipsQueryVariables, GetDocumentModelsDocument, GetDocumentModelsQuery, GetDocumentModelsQueryVariables, GetDocumentOperationsDocument, GetDocumentOperationsQuery, GetDocumentOperationsQueryVariables, GetDocumentOutgoingRelationshipsDocument, GetDocumentOutgoingRelationshipsQuery, GetDocumentOutgoingRelationshipsQueryVariables, GetDocumentQuery, GetDocumentQueryVariables, GetDocumentWithOperationsDocument, GetDocumentWithOperationsQuery, GetDocumentWithOperationsQueryVariables, GetJobStatusDocument, GetJobStatusQuery, GetJobStatusQueryVariables, GetParentIdsFn, GqlDocument, GqlDriveDocument, GqlOperation, GqlOperationContext, GqlSigner, GqlSignerApp, GqlSignerUser, GraphQLManager, GraphqlManagerFeatureFlags, Group, GroupTable, HttpAdapterSetup, HttpAdapterType, HttpDocumentModelLoader, HttpPackageLoader, HttpPackageLoaderLogger, HttpPackageLoaderOptions, IGatewayAdapter, IHttpAdapter, type IPackageLoader, type IPackageLoaderOptions, IPackageStorage, ISubgraph, ImportPackageLoader, InMemoryPackageStorage, Incremental, InputMaybe, InstallPackageResult, InstalledPackageInfo, IsTypeOfResolverFn, JobChangeEvent, JobChangeEventResolvers, JobChangesDocument, JobChangesSubscription, JobChangesSubscriptionVariables, JobInfo, JobInfoResolvers, JsonObjectScalarConfig, MakeEmpty, MakeMaybe, MakeOptional, Maybe, MoveRelationshipDocument, MoveRelationshipMutation, MoveRelationshipMutationVariables, MoveRelationshipResult, MoveRelationshipResultResolvers, MutateDocumentAsyncDocument, MutateDocumentAsyncMutation, MutateDocumentAsyncMutationVariables, MutateDocumentDocument, MutateDocumentMutation, MutateDocumentMutationVariables, Mutation, MutationAddRelationshipArgs, MutationCreateDocumentArgs, MutationCreateEmptyDocumentArgs, MutationDeleteDocumentArgs, MutationDeleteDocumentsArgs, MutationMoveRelationshipArgs, MutationMutateDocumentArgs, MutationMutateDocumentAsyncArgs, MutationPushSyncEnvelopesArgs, MutationRemoveRelationshipArgs, MutationRenameDocumentArgs, MutationResolvers, MutationTouchChannelArgs, NextResolverFn, OperationContext, OperationContextInput, OperationContextInputSchema, OperationContextResolvers, OperationGroupPermissionEntry, OperationGroupPermissionTable, OperationInput, OperationInputSchema, OperationUserPermissionEntry, OperationUserPermissionTable, OperationWithContext, OperationWithContextInput, OperationWithContextInputSchema, OperationWithContextResolvers, OperationsFilterInput, OperationsFilterInputSchema, PackageManagementService, PackageManagementServiceOptions, PackageManager, PackagesSubgraph, type PackagesSubgraphArgs, PagingInput, PagingInputSchema, type ParsedDriveUrl, PgliteFactory, PhDocument, PhDocumentFieldsFragment, PhDocumentFieldsFragmentDoc, PhDocumentOperationsArgs, PhDocumentResolvers, PhDocumentResultPage, PhDocumentResultPageResolvers, PollSyncEnvelopesDocument, PollSyncEnvelopesQuery, PollSyncEnvelopesQueryVariables, PollSyncEnvelopesResult, PollSyncEnvelopesResultResolvers, Processor, ProcessorDriveFactory, ProcessorFactoryBuilder, PropagationMode, PropagationModeSchema, PushSyncEnvelopesDocument, PushSyncEnvelopesMutation, PushSyncEnvelopesMutationVariables, Query, QueryDocumentArgs, QueryDocumentIncomingRelationshipsArgs, QueryDocumentModelsArgs, QueryDocumentOperationsArgs, QueryDocumentOutgoingRelationshipsArgs, QueryFindDocumentsArgs, QueryJobStatusArgs, QueryPollSyncEnvelopesArgs, QueryResolvers, ReactorModule, ReactorOperation, ReactorOperationResolvers, ReactorOperationResultPage, ReactorOperationResultPageResolvers, ReactorSigner, ReactorSignerApp, ReactorSignerAppInput, ReactorSignerAppInputSchema, ReactorSignerAppResolvers, ReactorSignerInput, ReactorSignerInputSchema, ReactorSignerResolvers, ReactorSignerUser, ReactorSignerUserInput, ReactorSignerUserInputSchema, ReactorSignerUserResolvers, ReactorSubgraph, RemoteCursor, RemoteCursorInput, RemoteCursorInputSchema, RemoteCursorResolvers, RemoteFilterInput, RemoteFilterInputSchema, RemoveRelationshipDocument, RemoveRelationshipMutation, RemoveRelationshipMutationVariables, RenameDocumentDocument, RenameDocumentMutation, RenameDocumentMutationVariables, Requester, RequireFields, Resolver, ResolverFn, ResolverTypeWrapper, ResolverWithResolve, Resolvers, ResolversObject, ResolversParentTypes, ResolversTypes, Revision, RevisionResolvers, Scalars, Sdk, SearchFilterInput, SearchFilterInputSchema, SubgraphArgs, SubgraphClass, SubgraphDefinition, Subscription, SubscriptionDocumentChangesArgs, SubscriptionJobChangesArgs, SubscriptionObject, SubscriptionResolveFn, SubscriptionResolver, SubscriptionResolverObject, SubscriptionResolvers, SubscriptionSubscribeFn, SubscriptionSubscriberObject, SyncEnvelope, SyncEnvelopeInput, SyncEnvelopeInputSchema, SyncEnvelopeResolvers, SyncEnvelopeType, SyncEnvelopeTypeSchema, SystemSubgraph, TlsOptions, TouchChannelDocument, TouchChannelInput, TouchChannelInputSchema, TouchChannelMutation, TouchChannelMutationVariables, TouchChannelResult, TouchChannelResultResolvers, TypeResolveFn, User, UserGroupTable, ViewFilterInput, ViewFilterInputSchema, WithIndex, WsContextFactory, WsDisposer, buildGraphQlDocument, buildGraphQlDriveDocument, buildGraphqlOperation, buildGraphqlOperations, buildSubgraphSchemaModule, createAuthFetchMiddleware, createGatewayAdapter, createHttpAdapter, createMergedSchema, createReactorGraphQLClient, createSchema, definedNonNullAnySchema, driveIdFromUrl, generateDocumentModelSchema, getAuthContext, getDbClient, getDocumentModelSchemaName, getDocumentModelTypeDefs, getGitHash, getGitUrl, getSdk, getUniqueDocumentModels, getVersion, initAnalyticsStoreSql, initTracing, initializeAndStartAPI, isDefinedNonNullAny, isSubgraphClass, isTracingEnabled, parseDriveUrl, renderGraphqlPlayground, trace };
3039
+ //# sourceMappingURL=index.d.mts.map