qarpeo 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/dist/chunks/tools.mjs +993 -31
  2. package/dist/cli/index.mjs +1102 -31
  3. package/dist/fate/index.d.ts +9 -1
  4. package/dist/fate/index.mjs +20 -3
  5. package/dist/module.mjs +296 -753
  6. package/dist/runtime/browser.mjs +2 -2
  7. package/dist/runtime/comments-server.d.ts +3 -0
  8. package/dist/runtime/comments-server.mjs +2 -0
  9. package/dist/runtime/comments.d.ts +0 -2
  10. package/dist/runtime/comments.mjs +0 -2
  11. package/dist/runtime/db.d.ts +10 -9
  12. package/dist/runtime/db.mjs +79 -8
  13. package/dist/runtime/drizzle.mjs +21 -6
  14. package/dist/runtime/index.d.ts +4 -0
  15. package/dist/runtime/realtime-server.d.ts +4 -0
  16. package/dist/runtime/realtime-server.mjs +13 -0
  17. package/dist/runtime/realtime.d.ts +1 -4
  18. package/dist/runtime/realtime.mjs +0 -13
  19. package/dist/runtime/replica.d.ts +27 -0
  20. package/dist/runtime/replica.mjs +229 -0
  21. package/dist/runtime/server/durable-objects/agent.mjs +14 -2
  22. package/dist/runtime/server/durable-objects/room.d.ts +10 -0
  23. package/dist/runtime/server/durable-objects/room.mjs +119 -28
  24. package/dist/runtime/server/middleware/devtools.mjs +1 -1
  25. package/dist/runtime/server/middleware/tenancy.mjs +7 -4
  26. package/dist/runtime/server/plugins/store.mjs +1 -1
  27. package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.mjs +57 -17
  28. package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +19 -12
  29. package/dist/runtime/server/routes/agents/[agent]/clear.post.mjs +8 -9
  30. package/dist/runtime/server/routes/agents/[agent]/history.get.mjs +8 -9
  31. package/dist/runtime/server/routes/analytics/events.get.mjs +12 -2
  32. package/dist/runtime/server/routes/analytics/pageviews.get.mjs +10 -1
  33. package/dist/runtime/server/routes/analytics/summary.get.mjs +10 -1
  34. package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +11 -2
  35. package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +7 -0
  36. package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +11 -2
  37. package/dist/runtime/server/routes/auth/account.delete.mjs +7 -0
  38. package/dist/runtime/server/routes/auth/magic-link/verify.get.mjs +5 -3
  39. package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +10 -0
  40. package/dist/runtime/server/routes/auth/otp/verify.post.mjs +5 -3
  41. package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +18 -0
  42. package/dist/runtime/server/routes/auth/webauthn/login/options.post.d.ts +1 -1
  43. package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +11 -2
  44. package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +10 -1
  45. package/dist/runtime/server/routes/auth/webauthn/register/options.post.d.ts +1 -1
  46. package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +10 -1
  47. package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +10 -1
  48. package/dist/runtime/server/routes/browser/crawl.post.mjs +13 -0
  49. package/dist/runtime/server/routes/browser/invoice.post.mjs +15 -1
  50. package/dist/runtime/server/routes/browser/og-image.post.mjs +13 -0
  51. package/dist/runtime/server/routes/browser/pdf.post.mjs +15 -1
  52. package/dist/runtime/server/routes/browser/screenshot.post.mjs +13 -0
  53. package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +23 -8
  54. package/dist/runtime/server/routes/cms/[collection]/[id]/publish.post.mjs +2 -1
  55. package/dist/runtime/server/routes/cms/[collection]/[id]/review.post.mjs +2 -1
  56. package/dist/runtime/server/routes/cms/[collection]/[id]/revisions/[revId]/restore.post.mjs +2 -1
  57. package/dist/runtime/server/routes/cms/[collection]/[id].delete.mjs +2 -1
  58. package/dist/runtime/server/routes/cms/[collection]/[id].put.mjs +2 -1
  59. package/dist/runtime/server/routes/cms/[collection]/index.post.mjs +2 -1
  60. package/dist/runtime/server/routes/cms/categories/[id].delete.mjs +2 -1
  61. package/dist/runtime/server/routes/cms/categories/[id].put.mjs +2 -1
  62. package/dist/runtime/server/routes/cms/categories.post.mjs +2 -1
  63. package/dist/runtime/server/routes/cms/collections/[id].delete.mjs +2 -1
  64. package/dist/runtime/server/routes/cms/collections/[id].put.mjs +2 -1
  65. package/dist/runtime/server/routes/cms/collections/index.post.mjs +2 -1
  66. package/dist/runtime/server/routes/cms/export.post.mjs +1 -1
  67. package/dist/runtime/server/routes/cms/subscribers/[id].delete.mjs +2 -1
  68. package/dist/runtime/server/routes/cms/subscribers/[id].patch.mjs +2 -1
  69. package/dist/runtime/server/routes/cms/tags/[id].delete.mjs +2 -1
  70. package/dist/runtime/server/routes/cms/tags.post.mjs +2 -1
  71. package/dist/runtime/server/routes/comments/[id]/react.post.mjs +7 -3
  72. package/dist/runtime/server/routes/comments/[id]/report.post.mjs +3 -0
  73. package/dist/runtime/server/routes/comments/[id].delete.mjs +1 -1
  74. package/dist/runtime/server/routes/comments/[id].get.mjs +13 -0
  75. package/dist/runtime/server/routes/comments/[id].patch.mjs +1 -1
  76. package/dist/runtime/server/routes/fate.d.ts +6 -0
  77. package/dist/runtime/server/routes/fate.mjs +32 -3
  78. package/dist/runtime/server/routes/mail/bounce.post.mjs +14 -2
  79. package/dist/runtime/server/routes/mail/unsubscribe.mjs +2 -1
  80. package/dist/runtime/server/routes/mail/webhooks.post.mjs +18 -4
  81. package/dist/runtime/server/routes/notifications/[id].get.mjs +3 -4
  82. package/dist/runtime/server/routes/notifications/index.get.mjs +4 -2
  83. package/dist/runtime/server/routes/notifications/push/subscribe.post.mjs +3 -1
  84. package/dist/runtime/server/routes/notifications/push/unsubscribe.post.mjs +5 -3
  85. package/dist/runtime/server/routes/notifications/read-all.post.mjs +6 -2
  86. package/dist/runtime/server/routes/notifications/send.post.mjs +13 -2
  87. package/dist/runtime/server/routes/payments/cancel.post.mjs +1 -1
  88. package/dist/runtime/server/routes/payments/change-plan.post.mjs +1 -1
  89. package/dist/runtime/server/routes/payments/checkout.post.mjs +1 -1
  90. package/dist/runtime/server/routes/payments/pause.post.mjs +1 -1
  91. package/dist/runtime/server/routes/payments/portal.post.mjs +1 -1
  92. package/dist/runtime/server/routes/payments/subscription.get.mjs +1 -1
  93. package/dist/runtime/server/routes/payments/usage.get.mjs +1 -1
  94. package/dist/runtime/server/routes/payments/usage.post.mjs +1 -1
  95. package/dist/runtime/server/routes/payments/webhook.post.mjs +8 -1
  96. package/dist/runtime/server/routes/realtime/broadcast.post.mjs +3 -2
  97. package/dist/runtime/server/routes/realtime/history.delete.mjs +2 -2
  98. package/dist/runtime/server/routes/realtime/history.get.mjs +2 -2
  99. package/dist/runtime/server/routes/realtime/presence.get.mjs +3 -3
  100. package/dist/runtime/server/routes/realtime/state.get.mjs +3 -3
  101. package/dist/runtime/server/routes/realtime/state.post.mjs +13 -4
  102. package/dist/runtime/server/routes/realtime/ws.get.mjs +2 -2
  103. package/dist/runtime/server/routes/storage/file/[...key].delete.mjs +1 -1
  104. package/dist/runtime/server/routes/storage/file/[...key].get.mjs +7 -0
  105. package/dist/runtime/server/routes/storage/files.get.d.ts +1 -1
  106. package/dist/runtime/server/routes/storage/files.get.mjs +24 -4
  107. package/dist/runtime/server/routes/storage/multipart/abort.post.mjs +16 -1
  108. package/dist/runtime/server/routes/storage/multipart/complete.post.d.ts +1 -1
  109. package/dist/runtime/server/routes/storage/multipart/complete.post.mjs +15 -1
  110. package/dist/runtime/server/routes/storage/multipart/create.post.mjs +7 -0
  111. package/dist/runtime/server/routes/storage/multipart/part.put.mjs +15 -1
  112. package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +8 -1
  113. package/dist/runtime/server/routes/storage/presigned.post.d.ts +1 -1
  114. package/dist/runtime/server/routes/storage/presigned.post.mjs +8 -1
  115. package/dist/runtime/server/routes/storage/sign.post.mjs +7 -0
  116. package/dist/runtime/server/routes/storage/upload.post.d.ts +2 -2
  117. package/dist/runtime/server/routes/store/cart/index.delete.mjs +3 -4
  118. package/dist/runtime/server/routes/store/cart/index.get.mjs +3 -10
  119. package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +6 -4
  120. package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +12 -4
  121. package/dist/runtime/server/routes/store/cart/items.post.mjs +9 -10
  122. package/dist/runtime/server/routes/store/categories/index.get.mjs +4 -2
  123. package/dist/runtime/server/routes/store/checkout.post.mjs +13 -3
  124. package/dist/runtime/server/routes/store/coupons/apply.post.mjs +6 -5
  125. package/dist/runtime/server/routes/store/orders/[id].get.mjs +2 -2
  126. package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +6 -3
  127. package/dist/runtime/server/routes/store/orders/index.get.mjs +1 -1
  128. package/dist/runtime/server/routes/store/products/[slug].get.mjs +2 -2
  129. package/dist/runtime/server/routes/store/products/index.get.mjs +1 -1
  130. package/dist/runtime/server/routes/store/tax/calculate.post.mjs +10 -0
  131. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +26 -25
  132. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +26 -25
  133. package/dist/runtime/server/utils/ai.d.ts +6 -0
  134. package/dist/runtime/server/utils/ai.mjs +12 -2
  135. package/dist/runtime/server/utils/analytics-query.mjs +8 -4
  136. package/dist/runtime/server/utils/browser-utils.d.ts +9 -0
  137. package/dist/runtime/server/utils/browser-utils.mjs +135 -0
  138. package/dist/runtime/server/utils/cms/cache.d.ts +13 -0
  139. package/dist/runtime/server/utils/cms/cache.mjs +95 -0
  140. package/dist/runtime/server/utils/cms/common.mjs +1 -1
  141. package/dist/runtime/server/utils/cms/markdown.mjs +38 -8
  142. package/dist/runtime/server/utils/cms/mutations.d.ts +26 -0
  143. package/dist/runtime/server/utils/cms/mutations.mjs +569 -0
  144. package/dist/runtime/server/utils/cms/path.d.ts +8 -0
  145. package/dist/runtime/server/utils/cms/path.mjs +23 -0
  146. package/dist/runtime/server/utils/cms/queries.d.ts +27 -0
  147. package/dist/runtime/server/utils/cms/queries.mjs +366 -0
  148. package/dist/runtime/server/utils/cms/references.d.ts +48 -0
  149. package/dist/runtime/server/utils/cms/references.mjs +309 -0
  150. package/dist/runtime/server/utils/cms/revisions.d.ts +7 -0
  151. package/dist/runtime/server/utils/cms/revisions.mjs +60 -0
  152. package/dist/runtime/server/utils/cms/sync.mjs +3 -3
  153. package/dist/runtime/server/utils/cms.d.ts +5 -82
  154. package/dist/runtime/server/utils/cms.mjs +28 -1367
  155. package/dist/runtime/server/utils/comments.d.ts +11 -0
  156. package/dist/runtime/server/utils/comments.mjs +65 -17
  157. package/dist/runtime/server/utils/crypto.mjs +1 -1
  158. package/dist/runtime/server/utils/domains.mjs +9 -0
  159. package/dist/runtime/server/utils/drizzle.d.ts +26 -1
  160. package/dist/runtime/server/utils/drizzle.mjs +78 -19
  161. package/dist/runtime/server/utils/email-inbound.mjs +9 -1
  162. package/dist/runtime/server/utils/impersonation.mjs +58 -1
  163. package/dist/runtime/server/utils/lock.d.ts +11 -0
  164. package/dist/runtime/server/utils/lock.mjs +4 -0
  165. package/dist/runtime/server/utils/mail-suppression.mjs +48 -13
  166. package/dist/runtime/server/utils/mail.d.ts +2 -1
  167. package/dist/runtime/server/utils/mail.mjs +17 -11
  168. package/dist/runtime/server/utils/notifications.d.ts +13 -4
  169. package/dist/runtime/server/utils/notifications.mjs +20 -4
  170. package/dist/runtime/server/utils/organization.mjs +36 -1
  171. package/dist/runtime/server/utils/passwordless.mjs +8 -0
  172. package/dist/runtime/server/utils/payments/checkout.d.ts +34 -0
  173. package/dist/runtime/server/utils/payments/checkout.mjs +158 -0
  174. package/dist/runtime/server/utils/payments/common.d.ts +45 -0
  175. package/dist/runtime/server/utils/payments/common.mjs +234 -0
  176. package/dist/runtime/server/utils/payments/index.d.ts +9 -0
  177. package/dist/runtime/server/utils/payments/index.mjs +21 -0
  178. package/dist/runtime/server/utils/payments/lemonsqueezy.d.ts +7 -0
  179. package/dist/runtime/server/utils/payments/lemonsqueezy.mjs +55 -0
  180. package/dist/runtime/server/utils/payments/paddle.d.ts +7 -0
  181. package/dist/runtime/server/utils/payments/paddle.mjs +92 -0
  182. package/dist/runtime/server/utils/payments/polar.d.ts +11 -0
  183. package/dist/runtime/server/utils/payments/polar.mjs +66 -0
  184. package/dist/runtime/server/utils/payments/stripe.d.ts +7 -0
  185. package/dist/runtime/server/utils/payments/stripe.mjs +159 -0
  186. package/dist/runtime/server/utils/payments/subscriptions.d.ts +89 -0
  187. package/dist/runtime/server/utils/payments/subscriptions.mjs +236 -0
  188. package/dist/runtime/server/utils/payments/usage.d.ts +12 -0
  189. package/dist/runtime/server/utils/payments/usage.mjs +143 -0
  190. package/dist/runtime/server/utils/payments/webhooks.d.ts +10 -0
  191. package/dist/runtime/server/utils/payments/webhooks.mjs +200 -0
  192. package/dist/runtime/server/utils/payments.d.ts +1 -158
  193. package/dist/runtime/server/utils/payments.mjs +1 -1289
  194. package/dist/runtime/server/utils/queue.d.ts +2 -0
  195. package/dist/runtime/server/utils/queue.mjs +34 -21
  196. package/dist/runtime/server/utils/rag.mjs +30 -17
  197. package/dist/runtime/server/utils/realtime.d.ts +5 -1
  198. package/dist/runtime/server/utils/realtime.mjs +43 -7
  199. package/dist/runtime/server/utils/session.mjs +16 -3
  200. package/dist/runtime/server/utils/sso.d.ts +3 -0
  201. package/dist/runtime/server/utils/sso.mjs +43 -0
  202. package/dist/runtime/server/utils/storage.mjs +12 -1
  203. package/dist/runtime/server/utils/store/cart.d.ts +63 -0
  204. package/dist/runtime/server/utils/store/cart.mjs +542 -0
  205. package/dist/runtime/server/utils/store/checkout.d.ts +14 -0
  206. package/dist/runtime/server/utils/store/checkout.mjs +118 -0
  207. package/dist/runtime/server/utils/store/common.d.ts +29 -0
  208. package/dist/runtime/server/utils/store/common.mjs +479 -0
  209. package/dist/runtime/server/utils/store/index.d.ts +7 -0
  210. package/dist/runtime/server/utils/store/index.mjs +30 -0
  211. package/dist/runtime/server/utils/store/inventory.d.ts +25 -0
  212. package/dist/runtime/server/utils/store/inventory.mjs +190 -0
  213. package/dist/runtime/server/utils/store/orders.d.ts +60 -0
  214. package/dist/runtime/server/utils/store/orders.mjs +590 -0
  215. package/dist/runtime/server/utils/store/products.d.ts +35 -0
  216. package/dist/runtime/server/utils/store/products.mjs +461 -0
  217. package/dist/runtime/server/utils/store/vendor.d.ts +18 -0
  218. package/dist/runtime/server/utils/store/vendor.mjs +68 -0
  219. package/dist/runtime/server/utils/store.d.ts +1 -207
  220. package/dist/runtime/server/utils/store.mjs +1 -2227
  221. package/dist/runtime/server/utils/string.d.ts +1 -1
  222. package/dist/runtime/server/utils/string.mjs +12 -4
  223. package/dist/runtime/server/utils/tenant.mjs +19 -5
  224. package/dist/runtime/server/utils/tracker.mjs +2 -0
  225. package/dist/runtime/server.d.ts +3 -3
  226. package/dist/runtime/server.mjs +4 -4
  227. package/dist/runtime/storage-server.d.ts +2 -0
  228. package/dist/runtime/storage-server.mjs +1 -0
  229. package/dist/runtime/storage.d.ts +1 -1
  230. package/dist/runtime/storage.mjs +0 -1
  231. package/dist/runtime/store.d.ts +0 -1
  232. package/dist/runtime/store.mjs +0 -1
  233. package/dist/runtime/test-utils.d.ts +4 -0
  234. package/dist/runtime/test-utils.mjs +54 -0
  235. package/dist/runtime/types/d1.d.ts +43 -0
  236. package/dist/runtime/types/drizzle.d.ts +6 -0
  237. package/dist/runtime/types/store.d.ts +1 -1
  238. package/dist/types/analytics.d.ts +80 -0
  239. package/dist/types/auth.d.ts +282 -0
  240. package/dist/types/cache.d.ts +55 -0
  241. package/dist/types/comments.d.ts +130 -0
  242. package/dist/types/db.d.ts +29 -0
  243. package/dist/types/email.d.ts +182 -0
  244. package/dist/types/index.d.ts +22 -0
  245. package/dist/types/jobs.d.ts +58 -0
  246. package/dist/types/notifications.d.ts +77 -0
  247. package/dist/types/options.d.ts +363 -0
  248. package/dist/types/payments.d.ts +145 -0
  249. package/dist/types/ratelimit.d.ts +71 -0
  250. package/dist/types/realtime.d.ts +136 -0
  251. package/dist/types/site.d.ts +121 -0
  252. package/dist/types/storage.d.ts +164 -0
  253. package/dist/types/store-options.d.ts +199 -0
  254. package/dist/types/tenant.d.ts +100 -0
  255. package/dist/types.d.ts +1 -2174
  256. package/dist/utils/migration-lock.d.ts +139 -0
  257. package/dist/utils/pkg.d.ts +14 -1
  258. package/dist/utils/schema-diff.d.ts +39 -0
  259. package/package.json +55 -17
  260. package/dist/chunks/auth-schema.mjs +0 -364
@@ -33,7 +33,7 @@ export function createBrowser(bindingName, event) {
33
33
  const client = await loadPuppeteer();
34
34
  if (!client) {
35
35
  throw new Error(
36
- `[qarpeo] '@cloudflare/puppeteer' is required to launch browser sessions. Please install it with 'vp add -D @cloudflare/puppeteer'.`
36
+ `[qarpeo] '@cloudflare/puppeteer' is required to launch browser sessions. Please install it with your package manager (e.g. 'pnpm add -D @cloudflare/puppeteer').`
37
37
  );
38
38
  }
39
39
  return client.launch(getB(), options);
@@ -42,7 +42,7 @@ export function createBrowser(bindingName, event) {
42
42
  const client = await loadPuppeteer();
43
43
  if (!client) {
44
44
  throw new Error(
45
- `[qarpeo] '@cloudflare/puppeteer' is required to connect to browser sessions. Please install it with 'vp add -D @cloudflare/puppeteer'.`
45
+ `[qarpeo] '@cloudflare/puppeteer' is required to connect to browser sessions. Please install it with your package manager (e.g. 'pnpm add -D @cloudflare/puppeteer').`
46
46
  );
47
47
  }
48
48
  return client.connect(getB(), sessionId);
@@ -0,0 +1,3 @@
1
+ export * from "./server/utils/comments";
2
+ export * from "./server/utils/comments-filter";
3
+ export type { CommentsOptions, CommentsModerationConfig } from "../types";
@@ -0,0 +1,2 @@
1
+ export * from "./server/utils/comments.mjs";
2
+ export * from "./server/utils/comments-filter.mjs";
@@ -1,4 +1,2 @@
1
- export * from "./server/utils/comments";
2
- export * from "./server/utils/comments-filter";
3
1
  export type * from "./app/composables/comments";
4
2
  export type { CommentsOptions, CommentsModerationConfig } from "../types";
@@ -1,2 +0,0 @@
1
- export * from "./server/utils/comments.mjs";
2
- export * from "./server/utils/comments-filter.mjs";
@@ -1,18 +1,19 @@
1
- import type { QarpeoDB, D1Database, DatabaseDialect, DatabaseInfo } from "./types/d1";
1
+ import type { QarpeoDB, D1Database, DatabaseDialect, DatabaseInfo, D1DatabaseOptions } from "./types/d1";
2
2
  import type { CFEvent } from "./types/index";
3
- export type { DatabaseDialect, DatabaseInfo } from "./types/d1";
3
+ export type { DatabaseDialect, DatabaseInfo, D1ReplicaOptions, D1DatabaseOptions } from "./types/d1";
4
+ export { createReplicaRoutedD1, isWriteQuery, resolveD1ReplicaBinding } from "./replica";
4
5
  /** Returns the raw Cloudflare D1Database binding from the active environment. */
5
6
  export declare function getD1Binding(bindingName?: string, event?: CFEvent): D1Database;
6
- /** Creates a typed D1 database interface for a specific binding and optional event. */
7
- export declare function createDB(bindingName?: string, event?: CFEvent): QarpeoDB;
7
+ /** Creates a typed D1 database interface with optional read replica routing and event context. */
8
+ export declare function createDB(bindingNameOrOptions?: string | D1DatabaseOptions, eventOrOptions?: CFEvent | D1DatabaseOptions): QarpeoDB;
8
9
  /**
9
- * Access a typed Cloudflare D1 instance.
10
+ * Access a typed Cloudflare D1 instance with optional read replica routing.
10
11
  *
11
- * @param bindingName Optional Cloudflare D1 binding name (defaults to configured binding or 'DB')
12
- * @param event Optional event context
12
+ * @param bindingName Optional Cloudflare D1 binding name or replica options
13
+ * @param event Optional event context or options
13
14
  */
14
- export declare const useDB: (bindingName?: string, event?: CFEvent) => QarpeoDB;
15
- export declare const useD1: (bindingName?: string, event?: CFEvent) => QarpeoDB;
15
+ export declare const useDB: (bindingNameOrOptions?: string | D1DatabaseOptions, eventOrOptions?: CFEvent | D1DatabaseOptions) => QarpeoDB;
16
+ export declare const useD1: (bindingNameOrOptions?: string | D1DatabaseOptions, eventOrOptions?: CFEvent | D1DatabaseOptions) => QarpeoDB;
16
17
  /** Auto-imported `db` instance for direct Cloudflare D1 operations. */
17
18
  export declare const db: QarpeoDB;
18
19
  /**
@@ -1,8 +1,16 @@
1
1
  import { getCloudflareEnv, resolveRuntimeBinding } from "./bindings.mjs";
2
+ import { createReplicaRoutedD1 } from "./replica.mjs";
3
+ export { createReplicaRoutedD1, isWriteQuery, resolveD1ReplicaBinding } from "./replica.mjs";
2
4
  export function getD1Binding(bindingName, event) {
3
5
  const resolvedBinding = resolveRuntimeBinding("db", bindingName, "DB");
4
6
  const env = getCloudflareEnv(event);
5
- const binding = env[resolvedBinding] || env["DB"] || env["DATABASE"];
7
+ let binding = env[resolvedBinding];
8
+ if (!binding && bindingName) {
9
+ const raw = bindingName.replace(/^(d1-)/i, "");
10
+ const upper = raw.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
11
+ binding = env[`${upper}_DB`] || env[`D1_${upper}`] || env[upper];
12
+ }
13
+ binding = binding || env["DB"] || env["DATABASE"];
6
14
  if (!binding) {
7
15
  throw new Error(
8
16
  `[qarpeo] Cloudflare D1 binding "${resolvedBinding}" was not found. Check your wrangler.json or QARPEO_DB_BINDING environment variable.`
@@ -10,23 +18,78 @@ export function getD1Binding(bindingName, event) {
10
18
  }
11
19
  return binding;
12
20
  }
13
- export function createDB(bindingName, event) {
14
- const getD1 = () => getD1Binding(bindingName, event);
21
+ export function createDB(bindingNameOrOptions, eventOrOptions) {
22
+ let bindingName;
23
+ let event;
24
+ let replicaOpts;
25
+ if (typeof bindingNameOrOptions === "string") {
26
+ bindingName = bindingNameOrOptions;
27
+ } else if (bindingNameOrOptions && typeof bindingNameOrOptions === "object") {
28
+ if ("node" in bindingNameOrOptions || "context" in bindingNameOrOptions || "req" in bindingNameOrOptions) {
29
+ event = bindingNameOrOptions;
30
+ } else {
31
+ replicaOpts = bindingNameOrOptions;
32
+ if (replicaOpts.event) event = replicaOpts.event;
33
+ }
34
+ }
35
+ if (eventOrOptions) {
36
+ if ("node" in eventOrOptions || "context" in eventOrOptions || "req" in eventOrOptions) {
37
+ event = eventOrOptions;
38
+ } else if (typeof eventOrOptions === "object") {
39
+ replicaOpts = eventOrOptions;
40
+ if (replicaOpts.event) event = replicaOpts.event;
41
+ }
42
+ }
43
+ let cachedPrimaryD1 = null;
44
+ let cachedRoutedTarget = null;
45
+ const getTarget = () => {
46
+ const primaryD1 = getD1Binding(bindingName, event);
47
+ if (replicaOpts?.replica) {
48
+ const evtContext = event?.context;
49
+ const sessionKey = `_qarpeo_replica_db_${bindingName || "DB"}_${String(replicaOpts.replica)}_${replicaOpts.bookmark || ""}`;
50
+ if (evtContext && evtContext[sessionKey]) {
51
+ return evtContext[sessionKey];
52
+ }
53
+ if (cachedPrimaryD1 === primaryD1 && cachedRoutedTarget) {
54
+ return cachedRoutedTarget;
55
+ }
56
+ const routed = createReplicaRoutedD1(primaryD1, { ...replicaOpts, event }, bindingName);
57
+ cachedPrimaryD1 = primaryD1;
58
+ cachedRoutedTarget = routed;
59
+ if (evtContext) {
60
+ evtContext[sessionKey] = routed;
61
+ }
62
+ return routed;
63
+ }
64
+ return primaryD1;
65
+ };
15
66
  return {
16
67
  prepare: (query) => {
17
- return getD1().prepare(query);
68
+ return getTarget().prepare(query);
18
69
  },
19
70
  batch: (statements) => {
20
- return getD1().batch(statements);
71
+ return getTarget().batch(statements);
21
72
  },
22
73
  exec: (query) => {
23
- return getD1().exec(query);
74
+ return getTarget().exec(query);
24
75
  },
25
76
  dump: () => {
26
- return getD1().dump();
77
+ return getTarget().dump();
27
78
  },
28
79
  raw: (bName) => {
29
80
  return getD1Binding(bName || bindingName, event);
81
+ },
82
+ primary: () => {
83
+ const target = getTarget();
84
+ return target.primary ? target.primary() : target;
85
+ },
86
+ replica: () => {
87
+ const target = getTarget();
88
+ return target.replica ? target.replica() : target;
89
+ },
90
+ getBookmark: () => {
91
+ const target = getTarget();
92
+ return target.getBookmark ? target.getBookmark() : null;
30
93
  }
31
94
  };
32
95
  }
@@ -68,7 +131,15 @@ export function getDatabaseInfo(bindingOrEvent, maybeEvent) {
68
131
  hd = env[bindingName];
69
132
  url = hd.connectionString;
70
133
  } else {
71
- url = env[`${bindingName}_URL`] || globalThis.process?.env?.[`${bindingName}_URL`] || env[`${bindingName}_DATABASE_URL`] || globalThis.process?.env?.[`${bindingName}_DATABASE_URL`];
134
+ const raw = bindingName.replace(/^(pg-|postgres-|ms-|mysql-)/i, "");
135
+ const upper = raw.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
136
+ const candidateHd = env[`${upper}_HD`] || env[`HYPERDRIVE_${upper}`] || env[`MYSQL_${upper}`] || env[upper];
137
+ if (candidateHd?.connectionString) {
138
+ hd = candidateHd;
139
+ url = hd.connectionString;
140
+ } else {
141
+ url = env[`${bindingName}_URL`] || env[`${upper}_URL`] || env[`${upper}_DATABASE_URL`] || globalThis.process?.env?.[`${bindingName}_URL`] || globalThis.process?.env?.[`${upper}_URL`] || env[`${bindingName}_DATABASE_URL`] || globalThis.process?.env?.[`${bindingName}_DATABASE_URL`] || globalThis.process?.env?.[`${upper}_DATABASE_URL`];
142
+ }
72
143
  }
73
144
  }
74
145
  if (!url) {
@@ -1,17 +1,31 @@
1
1
  import { defineRelations } from "drizzle-orm";
2
2
  import { drizzle as drizzleD1 } from "drizzle-orm/d1";
3
3
  import { drizzle as drizzlePostgres } from "drizzle-orm/postgres-js";
4
- import postgres from "postgres";
5
4
  import { getD1Binding, getDatabaseInfo } from "./db.mjs";
6
5
  const drizzleCache = /* @__PURE__ */ new WeakMap();
7
6
  const pgDrizzleCache = /* @__PURE__ */ new Map();
8
7
  export function createDrizzle(schema, bindingName, event) {
9
8
  const dbInfo = getDatabaseInfo(bindingName, event);
10
9
  if (dbInfo.isPostgres && dbInfo.url) {
10
+ let postgresLib;
11
+ try {
12
+ const req = globalThis.require || (typeof globalThis.process !== "undefined" && typeof require !== "undefined" ? require : void 0);
13
+ if (req) {
14
+ const pgMod = req("postgres");
15
+ postgresLib = pgMod?.default || pgMod;
16
+ }
17
+ } catch {
18
+ }
19
+ if (!postgresLib) {
20
+ throw new Error(
21
+ `[qarpeo] PostgreSQL runtime client requires the \`postgres\` package.
22
+ Install it with: pnpm add postgres`
23
+ );
24
+ }
11
25
  const cacheKey = dbInfo.url;
12
26
  let pgInstance = pgDrizzleCache.get(cacheKey);
13
27
  if (!pgInstance) {
14
- const client = postgres(dbInfo.url, {
28
+ const client = postgresLib(dbInfo.url, {
15
29
  prepare: false,
16
30
  // Cloudflare Hyperdrive and transaction poolers recommend disabling prepared statements
17
31
  max: 1
@@ -56,12 +70,13 @@ Install it with: pnpm add mysql2`
56
70
  const cacheKey = `mysql:${dbInfo.url}`;
57
71
  let mysqlInstance = pgDrizzleCache.get(cacheKey);
58
72
  if (!mysqlInstance) {
59
- const pool = mysqlLib.createPool(dbInfo.url);
73
+ const mysqlCreatePool = mysqlLib.default?.createPool ?? mysqlLib.createPool;
74
+ const pool = mysqlCreatePool(dbInfo.url);
60
75
  const relations = defineRelations(schema);
61
- const rawDrizzle = drizzleMysql(pool, {
76
+ const rawDrizzle = drizzleMysql({
77
+ client: pool,
62
78
  relations,
63
- schema,
64
- mode: "default"
79
+ schema
65
80
  });
66
81
  mysqlInstance = Object.assign(rawDrizzle, {
67
82
  raw: () => pool
@@ -1 +1,5 @@
1
+ /**
2
+ * @deprecated Import from `"qarpeo/server"` instead.
3
+ * Kept as a compatibility alias for existing server consumers.
4
+ */
1
5
  export * from "./server";
@@ -0,0 +1,4 @@
1
+ export { QarpeoRoomDO } from "./server/durable-objects/room";
2
+ export { broadcastToRoom, getRoomPresence, getRoomHistory, getRoomState, setRoomState, patchRoomState, disconnectRoomUser, getRoomDurableObject, defineRealtimeHandler, defineRoomState, } from "./server/utils/realtime";
3
+ export type { RealtimeOptions, RealtimeUser, RealtimeMessage, RealtimePeer, RealtimeHandlerOptions, RealtimeHandlerRegistration, RoomStateSchema, } from "../types";
4
+ export type { DurableObjectId, DurableObjectStub, DurableObjectNamespace, DurableObjectState, DurableObjectStorage, } from "./types";
@@ -0,0 +1,13 @@
1
+ export { QarpeoRoomDO } from "./server/durable-objects/room.mjs";
2
+ export {
3
+ broadcastToRoom,
4
+ getRoomPresence,
5
+ getRoomHistory,
6
+ getRoomState,
7
+ setRoomState,
8
+ patchRoomState,
9
+ disconnectRoomUser,
10
+ getRoomDurableObject,
11
+ defineRealtimeHandler,
12
+ defineRoomState
13
+ } from "./server/utils/realtime.mjs";
@@ -1,6 +1,3 @@
1
- export { QarpeoRoomDO } from "./server/durable-objects/room";
2
1
  export { useRealtime, usePresence, useRoomState } from "./app/composables/realtime";
3
- export { broadcastToRoom, getRoomPresence, getRoomHistory, getRoomState, setRoomState, patchRoomState, disconnectRoomUser, getRoomDurableObject, defineRealtimeHandler, defineRoomState, } from "./server/utils/realtime";
4
- export type { RealtimeOptions, RealtimeUser, RealtimeMessage, RealtimePeer, RealtimeHandlerOptions, RealtimeHandlerRegistration, RoomStateSchema, UsePresenceOptions, UsePresenceReturn, UseRoomStateReturn, } from "../types";
5
- export type { DurableObjectId, DurableObjectStub, DurableObjectNamespace, DurableObjectState, DurableObjectStorage, } from "./types";
6
2
  export type { UseRealtimeOptions, UseRealtimeReturn } from "./app/composables/realtime";
3
+ export type { RealtimeOptions, RealtimeUser, RealtimeMessage, RealtimePeer, RealtimeHandlerOptions, RealtimeHandlerRegistration, RoomStateSchema, UsePresenceOptions, UsePresenceReturn, UseRoomStateReturn, } from "../types";
@@ -1,14 +1 @@
1
- export { QarpeoRoomDO } from "./server/durable-objects/room.mjs";
2
1
  export { useRealtime, usePresence, useRoomState } from "./app/composables/realtime.mjs";
3
- export {
4
- broadcastToRoom,
5
- getRoomPresence,
6
- getRoomHistory,
7
- getRoomState,
8
- setRoomState,
9
- patchRoomState,
10
- disconnectRoomUser,
11
- getRoomDurableObject,
12
- defineRealtimeHandler,
13
- defineRoomState
14
- } from "./server/utils/realtime.mjs";
@@ -0,0 +1,27 @@
1
+ import type { D1Database, QarpeoDB, D1ReplicaOptions } from "./types/d1";
2
+ export type { D1ReplicaOptions } from "./types/d1";
3
+ /**
4
+ * Detects whether a SQL query modifies database state.
5
+ *
6
+ * Supports SQLite statements, Common Table Expressions (WITH), comments,
7
+ * and PRAGMA directives.
8
+ */
9
+ export declare function isWriteQuery(sql: string): boolean;
10
+ /**
11
+ * Resolves the read replica binding or creates a D1 replication session.
12
+ */
13
+ export declare function resolveD1ReplicaBinding(primaryD1: D1Database, bindingName?: string, options?: D1ReplicaOptions): {
14
+ replicaD1: D1Database;
15
+ session?: any;
16
+ };
17
+ /**
18
+ * Creates a replica-routed `QarpeoDB` instance.
19
+ *
20
+ * Directs read queries (e.g. SELECT) to the nearest Cloudflare D1 read replica,
21
+ * while transparently executing write queries (INSERT, UPDATE, DELETE, CREATE, etc.)
22
+ * on the primary D1 database.
23
+ *
24
+ * If a read query on the replica encounters a failure, it automatically falls back
25
+ * to the primary database to ensure high availability.
26
+ */
27
+ export declare function createReplicaRoutedD1(primaryD1: D1Database, options?: D1ReplicaOptions, bindingName?: string): QarpeoDB;
@@ -0,0 +1,229 @@
1
+ import { getCloudflareEnv, resolveRuntimeBinding } from "./bindings.mjs";
2
+ export function isWriteQuery(sql) {
3
+ if (!sql || typeof sql !== "string") return false;
4
+ let clean = sql.replace(/\/\*[\s\S]*?\*\//g, "").replace(/--.*$/gm, "").trim();
5
+ if (!clean) return false;
6
+ if (/^WITH\b/i.test(clean)) {
7
+ let depth = 0;
8
+ let hasOpenedParen = false;
9
+ let inQuotes = null;
10
+ let i = 4;
11
+ while (i < clean.length) {
12
+ const char = clean[i];
13
+ if (inQuotes) {
14
+ if (char === inQuotes) inQuotes = null;
15
+ } else if (char === "'" || char === '"' || char === "`") {
16
+ inQuotes = char;
17
+ } else if (char === "(") {
18
+ depth++;
19
+ hasOpenedParen = true;
20
+ } else if (char === ")") {
21
+ depth--;
22
+ if (depth === 0 && hasOpenedParen) {
23
+ const nextPart = clean.slice(i + 1).trimStart();
24
+ if (nextPart.startsWith(",")) {
25
+ hasOpenedParen = false;
26
+ i = clean.indexOf(",", i);
27
+ } else if (nextPart.length > 0) {
28
+ clean = nextPart;
29
+ break;
30
+ }
31
+ }
32
+ }
33
+ i++;
34
+ }
35
+ }
36
+ const firstWord = clean.match(/^\w+/)?.[0]?.toUpperCase() || "";
37
+ const writeCommands = /* @__PURE__ */ new Set([
38
+ "INSERT",
39
+ "UPDATE",
40
+ "DELETE",
41
+ "REPLACE",
42
+ "CREATE",
43
+ "DROP",
44
+ "ALTER",
45
+ "TRUNCATE",
46
+ "ATTACH",
47
+ "DETACH",
48
+ "REINDEX",
49
+ "VACUUM",
50
+ "BEGIN",
51
+ "COMMIT",
52
+ "ROLLBACK",
53
+ "SAVEPOINT",
54
+ "RELEASE"
55
+ ]);
56
+ if (writeCommands.has(firstWord)) {
57
+ return true;
58
+ }
59
+ if (firstWord === "PRAGMA") {
60
+ return clean.includes("=");
61
+ }
62
+ return false;
63
+ }
64
+ export function resolveD1ReplicaBinding(primaryD1, bindingName, options) {
65
+ const resolvedBinding = resolveRuntimeBinding("db", bindingName, "DB");
66
+ let env = {};
67
+ try {
68
+ env = getCloudflareEnv(options?.event);
69
+ } catch {
70
+ }
71
+ const replicaBinding = env[`${resolvedBinding}_REPLICA`] || env[`${resolvedBinding}_READ_REPLICA`] || (resolvedBinding === "DB" ? env["DB_REPLICA"] || env["DB_READ_REPLICA"] : void 0);
72
+ if (replicaBinding && typeof replicaBinding.prepare === "function") {
73
+ return { replicaD1: replicaBinding };
74
+ }
75
+ if (typeof primaryD1.withSession === "function") {
76
+ const sessionToken = options?.bookmark || (typeof options?.replica === "string" ? options.replica : "first-unconstrained");
77
+ try {
78
+ const session = primaryD1.withSession(sessionToken);
79
+ if (session && typeof session.prepare === "function") {
80
+ return { replicaD1: session, session };
81
+ }
82
+ } catch {
83
+ }
84
+ }
85
+ return { replicaD1: primaryD1 };
86
+ }
87
+ export function createReplicaRoutedD1(primaryD1, options, bindingName) {
88
+ const { replicaD1, session } = resolveD1ReplicaBinding(primaryD1, bindingName, options);
89
+ const fallback = options?.fallbackToPrimary !== false;
90
+ let latestBookmark = options?.bookmark || (typeof options?.replica === "string" && !["first-unconstrained", "first-primary"].includes(options.replica) ? options.replica : null);
91
+ let hasWrittenWithoutSession = false;
92
+ const writeTarget = session ?? primaryD1;
93
+ const getReadTarget = () => hasWrittenWithoutSession && !session ? primaryD1 : replicaD1;
94
+ function updateBookmark(target, result) {
95
+ if (target && typeof target.getBookmark === "function") {
96
+ try {
97
+ const bm = target.getBookmark();
98
+ if (bm) latestBookmark = bm;
99
+ } catch {
100
+ }
101
+ }
102
+ const metaBookmark = result?.meta?.bookmark;
103
+ if (typeof metaBookmark === "string" && metaBookmark.length > 0) {
104
+ latestBookmark = metaBookmark;
105
+ }
106
+ }
107
+ function createStatementWrapper(query, boundValues = []) {
108
+ const isWrite = isWriteQuery(query);
109
+ async function executeQuery(execOnStmt) {
110
+ if (isWrite) {
111
+ const stmt = writeTarget.prepare(query).bind(...boundValues);
112
+ const result = await execOnStmt(stmt);
113
+ if (!session) hasWrittenWithoutSession = true;
114
+ updateBookmark(writeTarget, result);
115
+ return result;
116
+ }
117
+ const target = getReadTarget();
118
+ try {
119
+ const stmt = target.prepare(query).bind(...boundValues);
120
+ const result = await execOnStmt(stmt);
121
+ updateBookmark(target, result);
122
+ return result;
123
+ } catch (err) {
124
+ if (fallback && target !== primaryD1) {
125
+ const stmt = primaryD1.prepare(query).bind(...boundValues);
126
+ const result = await execOnStmt(stmt);
127
+ updateBookmark(primaryD1, result);
128
+ return result;
129
+ }
130
+ throw err;
131
+ }
132
+ }
133
+ return {
134
+ _isWrite: isWrite,
135
+ _query: query,
136
+ _boundValues: boundValues,
137
+ bind(...values) {
138
+ return createStatementWrapper(query, values);
139
+ },
140
+ first(colName) {
141
+ return executeQuery((stmt) => colName ? stmt.first(colName) : stmt.first());
142
+ },
143
+ all() {
144
+ return executeQuery((stmt) => stmt.all());
145
+ },
146
+ run() {
147
+ return executeQuery((stmt) => stmt.run());
148
+ },
149
+ raw() {
150
+ return executeQuery((stmt) => stmt.raw());
151
+ }
152
+ };
153
+ }
154
+ function unwrapStatements(target, statements) {
155
+ return statements.map((s) => {
156
+ const anyS = s;
157
+ return anyS._query ? target.prepare(anyS._query).bind(...anyS._boundValues || []) : s;
158
+ });
159
+ }
160
+ return {
161
+ prepare(query) {
162
+ return createStatementWrapper(query);
163
+ },
164
+ async batch(statements) {
165
+ const hasWrite = statements.some((s) => {
166
+ const anyS = s;
167
+ return anyS._isWrite || anyS._query && isWriteQuery(anyS._query);
168
+ });
169
+ if (hasWrite) {
170
+ const res = await writeTarget.batch(unwrapStatements(writeTarget, statements));
171
+ if (!session) hasWrittenWithoutSession = true;
172
+ updateBookmark(writeTarget, res?.[res.length - 1]);
173
+ return res;
174
+ }
175
+ const target = getReadTarget();
176
+ try {
177
+ const res = await target.batch(unwrapStatements(target, statements));
178
+ updateBookmark(target, res?.[res.length - 1]);
179
+ return res;
180
+ } catch (err) {
181
+ if (fallback && target !== primaryD1) {
182
+ const res = await primaryD1.batch(unwrapStatements(primaryD1, statements));
183
+ updateBookmark(primaryD1, res?.[res.length - 1]);
184
+ return res;
185
+ }
186
+ throw err;
187
+ }
188
+ },
189
+ async exec(query) {
190
+ if (isWriteQuery(query)) {
191
+ const res = await writeTarget.exec(query);
192
+ if (!session) hasWrittenWithoutSession = true;
193
+ updateBookmark(writeTarget, res);
194
+ return res;
195
+ }
196
+ const target = getReadTarget();
197
+ try {
198
+ const res = await target.exec(query);
199
+ updateBookmark(target, res);
200
+ return res;
201
+ } catch (err) {
202
+ if (fallback && target !== primaryD1) {
203
+ const res = await primaryD1.exec(query);
204
+ updateBookmark(primaryD1, res);
205
+ return res;
206
+ }
207
+ throw err;
208
+ }
209
+ },
210
+ dump() {
211
+ return primaryD1.dump();
212
+ },
213
+ raw(bName) {
214
+ return bName ? primaryD1 : replicaD1;
215
+ },
216
+ getBookmark() {
217
+ updateBookmark(session);
218
+ updateBookmark(replicaD1);
219
+ updateBookmark(primaryD1);
220
+ return latestBookmark;
221
+ },
222
+ primary() {
223
+ return primaryD1;
224
+ },
225
+ replica() {
226
+ return replicaD1;
227
+ }
228
+ };
229
+ }
@@ -216,8 +216,11 @@ export class QarpeoAgentDO {
216
216
  const stream = body.stream !== false;
217
217
  const systemPrompt = body.system || this.agentDefinition?.system || "You are a helpful assistant.";
218
218
  const model = body.model || this.agentDefinition?.model || "@cf/meta/llama-3.3-70b-instruct";
219
- const maxSteps = Math.max(1, body.maxSteps ?? this.agentDefinition?.maxSteps ?? 5);
220
- const maxContextMessages = body.maxContextMessages ?? this.agentDefinition?.maxContextMessages ?? 30;
219
+ const maxSteps = Math.min(Math.max(1, body.maxSteps ?? this.agentDefinition?.maxSteps ?? 5), 20);
220
+ const maxContextMessages = Math.min(
221
+ Math.max(1, body.maxContextMessages ?? this.agentDefinition?.maxContextMessages ?? 30),
222
+ 100
223
+ );
221
224
  const gateway = body.gateway || this.agentDefinition?.gateway;
222
225
  const toolMap = /* @__PURE__ */ new Map();
223
226
  const defTools = normalizeTools(this.agentDefinition?.tools);
@@ -267,6 +270,15 @@ When using a tool, you can call it natively or output: <tool_call>{"name": "tool
267
270
  if (!tool || typeof tool.execute !== "function") {
268
271
  return { error: `Tool "${name}" is not implemented or missing execute function.` };
269
272
  }
273
+ if (tool.parameters && typeof tool.parameters.safeParse === "function") {
274
+ const validation = tool.parameters.safeParse(args);
275
+ if (!validation.success) {
276
+ return {
277
+ error: `Invalid arguments for tool "${name}": ${validation.error.message}`
278
+ };
279
+ }
280
+ args = validation.data;
281
+ }
270
282
  const currentState = await this.ctx.storage.get("state") || {};
271
283
  const toolContext = {
272
284
  env: this.env,
@@ -33,4 +33,14 @@ export declare class QarpeoRoomDO {
33
33
  private broadcast;
34
34
  /** Returns current active users list in the room. */
35
35
  private getPresenceList;
36
+ /**
37
+ * Validates internal server control requests against REALTIME_ROOM_SECRET (if configured).
38
+ */
39
+ private isAuthorizedServerRequest;
40
+ /**
41
+ * Authorizes client state mutation (state:patch / state:set).
42
+ * Restricts anonymous users by default unless REALTIME_ALLOW_ANONYMOUS_STATE_WRITE is enabled,
43
+ * or matches against configured REALTIME_STATE_WRITE_ROLES.
44
+ */
45
+ private isStateWriteAuthorized;
36
46
  }