@powerhousedao/reactor-api 6.0.0-dev.21 → 6.0.0-dev.211

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