qarpeo 0.1.30 → 0.1.32

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 (182) hide show
  1. package/README.md +9 -0
  2. package/dist/chunks/auth-schema.mjs +28 -16
  3. package/dist/chunks/wrangler.mjs +1 -1
  4. package/dist/module.d.ts +1 -1
  5. package/dist/module.mjs +405 -20
  6. package/dist/runtime/app/components/AuthRegister.vue +306 -0
  7. package/dist/runtime/app/components/AuthSessionsList.vue +137 -0
  8. package/dist/runtime/app/components/AuthSignIn.vue +298 -0
  9. package/dist/runtime/app/components/AuthState.vue +10 -0
  10. package/dist/runtime/app/components/CMSBookmarkButton.vue +59 -0
  11. package/dist/runtime/app/components/CMSComments.vue +202 -0
  12. package/dist/runtime/app/components/CMSNewsletter.vue +81 -0
  13. package/dist/runtime/app/components/CMSTableOfContents.vue +84 -0
  14. package/dist/runtime/app/components/NotificationBell.vue +263 -0
  15. package/dist/runtime/app/components/NotificationList.vue +205 -0
  16. package/dist/runtime/app/components/NotificationPrompt.vue +133 -0
  17. package/dist/runtime/app/components/PricingGated.vue +81 -0
  18. package/dist/runtime/app/components/PricingTable.vue +274 -0
  19. package/dist/runtime/app/components/RealtimeChat.vue +164 -0
  20. package/dist/runtime/app/components/RealtimeCursors.vue +139 -0
  21. package/dist/runtime/app/components/RealtimePresence.vue +129 -0
  22. package/dist/runtime/app/components/RealtimeStatus.vue +79 -0
  23. package/dist/runtime/app/components/SubscriptionCard.vue +207 -0
  24. package/dist/runtime/app/components/UserProfile.vue +558 -0
  25. package/dist/runtime/app/composables/cms-preview.mjs +14 -2
  26. package/dist/runtime/app/composables/cms.d.ts +107 -14
  27. package/dist/runtime/app/composables/cms.mjs +308 -11
  28. package/dist/runtime/app/composables/payments.d.ts +2 -0
  29. package/dist/runtime/app/composables/payments.mjs +22 -0
  30. package/dist/runtime/app/composables/realtime.d.ts +2 -0
  31. package/dist/runtime/app/composables/realtime.mjs +11 -0
  32. package/dist/runtime/app/composables/site.mjs +1 -1
  33. package/dist/runtime/app/pages/devtools/notifications.vue +355 -0
  34. package/dist/runtime/blob.mjs +22 -6
  35. package/dist/runtime/email.mjs +4 -4
  36. package/dist/runtime/kv.mjs +38 -0
  37. package/dist/runtime/server/db/cms-schema.d.ts +820 -1
  38. package/dist/runtime/server/db/cms-schema.mjs +109 -3
  39. package/dist/runtime/server/durable-objects/agent.mjs +4 -4
  40. package/dist/runtime/server/middleware/auth.mjs +9 -2
  41. package/dist/runtime/server/middleware/devtools.mjs +14 -1
  42. package/dist/runtime/server/middleware/ratelimit.mjs +9 -2
  43. package/dist/runtime/server/middleware/tracker.mjs +3 -1
  44. package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +3 -5
  45. package/dist/runtime/server/routes/analytics/events.get.mjs +10 -1
  46. package/dist/runtime/server/routes/analytics/pageviews.get.mjs +10 -1
  47. package/dist/runtime/server/routes/analytics/summary.get.mjs +10 -1
  48. package/dist/runtime/server/routes/auth/audit-logs.get.d.ts +5 -0
  49. package/dist/runtime/server/routes/auth/audit-logs.get.mjs +19 -0
  50. package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +1 -1
  51. package/dist/runtime/server/routes/cms/[collection]/[id]/publish.post.mjs +1 -1
  52. package/dist/runtime/server/routes/cms/[collection]/[id]/review.post.mjs +1 -1
  53. package/dist/runtime/server/routes/cms/[collection]/[id]/revisions/[revId]/restore.post.d.ts +4 -0
  54. package/dist/runtime/server/routes/cms/[collection]/[id]/revisions/[revId]/restore.post.mjs +21 -0
  55. package/dist/runtime/server/routes/cms/[collection]/[id]/revisions/index.get.d.ts +4 -0
  56. package/dist/runtime/server/routes/cms/[collection]/[id]/revisions/index.get.mjs +13 -0
  57. package/dist/runtime/server/routes/cms/[collection]/[id]/view.post.d.ts +12 -0
  58. package/dist/runtime/server/routes/cms/[collection]/[id]/view.post.mjs +20 -0
  59. package/dist/runtime/server/routes/cms/[collection]/[id].delete.mjs +1 -1
  60. package/dist/runtime/server/routes/cms/[collection]/[id].put.mjs +1 -1
  61. package/dist/runtime/server/routes/cms/[collection]/[slug].get.mjs +3 -1
  62. package/dist/runtime/server/routes/cms/[collection]/by-path.get.mjs +2 -2
  63. package/dist/runtime/server/routes/cms/[collection]/index.get.mjs +32 -4
  64. package/dist/runtime/server/routes/cms/[collection]/index.post.mjs +1 -1
  65. package/dist/runtime/server/routes/cms/[collection]/references.get.mjs +1 -1
  66. package/dist/runtime/server/routes/cms/bookmarks/[id].delete.d.ts +5 -0
  67. package/dist/runtime/server/routes/cms/bookmarks/[id].delete.mjs +23 -0
  68. package/dist/runtime/server/routes/cms/bookmarks/check.post.d.ts +4 -0
  69. package/dist/runtime/server/routes/cms/bookmarks/check.post.mjs +20 -0
  70. package/dist/runtime/server/routes/cms/bookmarks/index.get.d.ts +4 -0
  71. package/dist/runtime/server/routes/cms/bookmarks/index.get.mjs +16 -0
  72. package/dist/runtime/server/routes/cms/bookmarks/index.post.d.ts +5 -0
  73. package/dist/runtime/server/routes/cms/bookmarks/index.post.mjs +20 -0
  74. package/dist/runtime/server/routes/cms/categories/[id].delete.d.ts +5 -0
  75. package/dist/runtime/server/routes/cms/categories/[id].delete.mjs +13 -0
  76. package/dist/runtime/server/routes/cms/categories/[id].put.d.ts +5 -0
  77. package/dist/runtime/server/routes/cms/categories/[id].put.mjs +14 -0
  78. package/dist/runtime/server/routes/cms/categories.get.d.ts +5 -0
  79. package/dist/runtime/server/routes/cms/categories.get.mjs +6 -0
  80. package/dist/runtime/server/routes/cms/categories.post.d.ts +15 -0
  81. package/dist/runtime/server/routes/cms/categories.post.mjs +20 -0
  82. package/dist/runtime/server/routes/cms/collections/[id].delete.mjs +1 -1
  83. package/dist/runtime/server/routes/cms/collections/[id].put.mjs +1 -1
  84. package/dist/runtime/server/routes/cms/collections/index.get.mjs +4 -1
  85. package/dist/runtime/server/routes/cms/collections/index.post.mjs +1 -1
  86. package/dist/runtime/server/routes/cms/comments/[id].delete.d.ts +5 -0
  87. package/dist/runtime/server/routes/cms/comments/[id].delete.mjs +12 -0
  88. package/dist/runtime/server/routes/cms/comments/[id].get.d.ts +4 -0
  89. package/dist/runtime/server/routes/cms/comments/[id].get.mjs +13 -0
  90. package/dist/runtime/server/routes/cms/comments/[id].patch.d.ts +6 -0
  91. package/dist/runtime/server/routes/cms/comments/[id].patch.mjs +17 -0
  92. package/dist/runtime/server/routes/cms/comments.get.d.ts +5 -0
  93. package/dist/runtime/server/routes/cms/comments.get.mjs +43 -0
  94. package/dist/runtime/server/routes/cms/comments.post.d.ts +17 -0
  95. package/dist/runtime/server/routes/cms/comments.post.mjs +46 -0
  96. package/dist/runtime/server/routes/cms/components/index.get.mjs +2 -0
  97. package/dist/runtime/server/routes/cms/export.post.mjs +13 -5
  98. package/dist/runtime/server/routes/cms/newsletter.post.d.ts +12 -0
  99. package/dist/runtime/server/routes/cms/newsletter.post.mjs +31 -0
  100. package/dist/runtime/server/routes/cms/preview/disable.get.mjs +3 -0
  101. package/dist/runtime/server/routes/cms/preview/enable.get.mjs +8 -1
  102. package/dist/runtime/server/routes/cms/search.get.mjs +10 -4
  103. package/dist/runtime/server/routes/cms/subscribers/[id].delete.d.ts +5 -0
  104. package/dist/runtime/server/routes/cms/subscribers/[id].delete.mjs +12 -0
  105. package/dist/runtime/server/routes/cms/subscribers/[id].patch.d.ts +6 -0
  106. package/dist/runtime/server/routes/cms/subscribers/[id].patch.mjs +15 -0
  107. package/dist/runtime/server/routes/cms/subscribers.get.d.ts +5 -0
  108. package/dist/runtime/server/routes/cms/subscribers.get.mjs +11 -0
  109. package/dist/runtime/server/routes/cms/sync.post.mjs +1 -1
  110. package/dist/runtime/server/routes/cms/tags/[id].delete.d.ts +5 -0
  111. package/dist/runtime/server/routes/cms/tags/[id].delete.mjs +13 -0
  112. package/dist/runtime/server/routes/cms/tags.get.d.ts +4 -0
  113. package/dist/runtime/server/routes/cms/tags.get.mjs +6 -0
  114. package/dist/runtime/server/routes/cms/tags.post.d.ts +9 -0
  115. package/dist/runtime/server/routes/cms/tags.post.mjs +17 -0
  116. package/dist/runtime/server/routes/mail/bounce.post.mjs +10 -1
  117. package/dist/runtime/server/routes/mail/inbox/[id].get.mjs +3 -0
  118. package/dist/runtime/server/routes/mail/inbox.get.mjs +4 -1
  119. package/dist/runtime/server/routes/mail/suppressions/[email].delete.d.ts +1 -1
  120. package/dist/runtime/server/routes/mail/suppressions/[email].delete.mjs +17 -0
  121. package/dist/runtime/server/routes/mail/suppressions/index.get.d.ts +2 -1
  122. package/dist/runtime/server/routes/mail/suppressions/index.get.mjs +18 -1
  123. package/dist/runtime/server/routes/mail/suppressions/index.post.d.ts +2 -1
  124. package/dist/runtime/server/routes/mail/suppressions/index.post.mjs +17 -0
  125. package/dist/runtime/server/routes/mail/webhooks.post.mjs +10 -1
  126. package/dist/runtime/server/routes/notifications/send.post.d.ts +4 -0
  127. package/dist/runtime/server/routes/notifications/send.post.mjs +45 -0
  128. package/dist/runtime/server/routes/payments/checkout.post.mjs +2 -2
  129. package/dist/runtime/server/routes/payments/pause.post.mjs +6 -5
  130. package/dist/runtime/server/routes/payments/portal.post.mjs +1 -1
  131. package/dist/runtime/server/routes/payments/usage.post.mjs +16 -11
  132. package/dist/runtime/server/routes/payments/webhook.post.d.ts +1 -0
  133. package/dist/runtime/server/routes/realtime/broadcast.post.mjs +8 -0
  134. package/dist/runtime/server/routes/realtime/history.delete.mjs +8 -0
  135. package/dist/runtime/server/routes/realtime/ws.get.mjs +3 -0
  136. package/dist/runtime/server/routes/storage/file/[...key].delete.mjs +30 -1
  137. package/dist/runtime/server/routes/storage/files.get.mjs +12 -2
  138. package/dist/runtime/server/routes/storage/multipart/part.put.mjs +2 -2
  139. package/dist/runtime/server/tasks/cms/publish.d.ts +1 -3
  140. package/dist/runtime/server/tasks/cms/publish.mjs +0 -1
  141. package/dist/runtime/server/utils/audit.d.ts +32 -0
  142. package/dist/runtime/server/utils/audit.mjs +197 -0
  143. package/dist/runtime/server/utils/auth.d.ts +4 -4
  144. package/dist/runtime/server/utils/auth.mjs +53 -7
  145. package/dist/runtime/server/utils/bots.mjs +1 -0
  146. package/dist/runtime/server/utils/cache.mjs +5 -1
  147. package/dist/runtime/server/utils/cms/common.d.ts +6 -3
  148. package/dist/runtime/server/utils/cms/common.mjs +3 -5
  149. package/dist/runtime/server/utils/cms/git.mjs +6 -2
  150. package/dist/runtime/server/utils/cms/markdown.d.ts +5 -0
  151. package/dist/runtime/server/utils/cms/markdown.mjs +18 -3
  152. package/dist/runtime/server/utils/cms-events.mjs +8 -2
  153. package/dist/runtime/server/utils/cms.d.ts +151 -0
  154. package/dist/runtime/server/utils/cms.mjs +818 -104
  155. package/dist/runtime/server/utils/crypto.d.ts +2 -0
  156. package/dist/runtime/server/utils/crypto.mjs +10 -0
  157. package/dist/runtime/server/utils/domains.mjs +2 -1
  158. package/dist/runtime/server/utils/impersonation.mjs +4 -5
  159. package/dist/runtime/server/utils/mail-suppression.mjs +10 -2
  160. package/dist/runtime/server/utils/mail.mjs +4 -2
  161. package/dist/runtime/server/utils/notifications.mjs +1 -3
  162. package/dist/runtime/server/utils/oauth.d.ts +31 -0
  163. package/dist/runtime/server/utils/oauth.mjs +82 -0
  164. package/dist/runtime/server/utils/organization.mjs +4 -5
  165. package/dist/runtime/server/utils/passwordless.mjs +4 -5
  166. package/dist/runtime/server/utils/payments.d.ts +1 -0
  167. package/dist/runtime/server/utils/payments.mjs +42 -16
  168. package/dist/runtime/server/utils/schema-fallback.d.ts +5 -0
  169. package/dist/runtime/server/utils/schema-fallback.mjs +3 -0
  170. package/dist/runtime/server/utils/session.d.ts +4 -4
  171. package/dist/runtime/server/utils/sso.mjs +4 -2
  172. package/dist/runtime/server/utils/storage.mjs +1 -1
  173. package/dist/runtime/server/utils/tenant.mjs +11 -9
  174. package/dist/runtime/server/utils/turnstile.mjs +2 -1
  175. package/dist/runtime/server.d.ts +1 -0
  176. package/dist/runtime/server.mjs +1 -0
  177. package/dist/runtime/types/imports.d.ts +5 -0
  178. package/dist/runtime/types/index.d.ts +10 -0
  179. package/dist/runtime/types/r2.d.ts +22 -4
  180. package/dist/types.d.ts +104 -1
  181. package/dist/utils/auth-schema.d.ts +1 -1
  182. package/package.json +7 -7
package/README.md CHANGED
@@ -43,11 +43,20 @@ export default defineNuxtConfig({
43
43
  modules: ["qarpeo"],
44
44
 
45
45
  qarpeo: {
46
+ // Edge Primitives
46
47
  db: true,
47
48
  blob: true,
48
49
  kv: true,
49
50
  ai: true,
50
51
  browser: true,
52
+
53
+ // Domain Kits
54
+ kits: {
55
+ auth: true,
56
+ cms: true,
57
+ payments: true,
58
+ notifications: true,
59
+ },
51
60
  },
52
61
  })
53
62
  ```
@@ -7,12 +7,13 @@ const ALL_AUTH_TABLE_NAMES = [
7
7
  "passkey",
8
8
  "organization",
9
9
  "member",
10
- "invitation"
10
+ "invitation",
11
+ "auditLogs"
11
12
  ];
12
13
  function getActiveAuthTableNames(auth) {
13
14
  if (!auth) return [];
14
15
  const opts = typeof auth === "object" ? auth : {};
15
- const tables = ["user", "account", "session", "verification"];
16
+ const tables = ["user", "account", "session", "verification", "auditLogs"];
16
17
  if (opts.twoFactor) tables.push("twoFactor");
17
18
  if (opts.webauthn || opts.webAuthn) tables.push("passkey");
18
19
  if (opts.organizations) tables.push("organization", "member", "invitation");
@@ -112,7 +113,30 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
112
113
  ` expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),`,
113
114
  ` createdAt: integer("created_at", { mode: "timestamp_ms" }),`,
114
115
  ` updatedAt: integer("updated_at", { mode: "timestamp_ms" }),`,
115
- `});`
116
+ `});`,
117
+ ``,
118
+ `// \u2500\u2500\u2500 5. Audit Logs Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
119
+ `export const auditLogs = sqliteTable("audit_logs", {`,
120
+ ` id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()),`,
121
+ ` userId: text("user_id").references(() => user.id, { onDelete: "set null" }),`,
122
+ ` action: text("action").notNull(),`,
123
+ ` targetType: text("target_type"),`,
124
+ ` targetId: text("target_id"),`,
125
+ ` details: text("details", { mode: "json" }),`,
126
+ ` ipAddress: text("ip_address"),`,
127
+ ` userAgent: text("user_agent"),`,
128
+ ` createdAt: text("created_at").default(sql\`(STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))\`),`,
129
+ ` updatedAt: text("updated_at")`,
130
+ ` .default(sql\`(STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))\`)`,
131
+ ` .$onUpdate(() => sql\`(STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))\`),`,
132
+ `}, (table) => [`,
133
+ ` index("audit_logs_user_id_idx").on(table.userId),`,
134
+ ` index("audit_logs_action_idx").on(table.action),`,
135
+ ` index("audit_logs_target_idx").on(table.targetType, table.targetId),`,
136
+ ` index("audit_logs_created_at_idx").on(table.createdAt),`,
137
+ `]);`,
138
+ `export const _qarpeo_audit_logs = auditLogs;`,
139
+ `export { auditLogs as audit_logs };`
116
140
  );
117
141
  if (opts.twoFactor) {
118
142
  lines.push(
@@ -190,21 +214,9 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
190
214
  lines.push(
191
215
  `export const organization = undefined;`,
192
216
  `export const member = undefined;`,
193
- `export const invitation = undefined;`,
194
- `export const organizations = undefined;`,
195
- `export const members = undefined;`,
196
- `export const invitations = undefined;`
197
- );
198
- } else {
199
- lines.push(
200
- `export { organization as organizations, member as members, invitation as invitations };`
217
+ `export const invitation = undefined;`
201
218
  );
202
219
  }
203
- lines.push(
204
- ``,
205
- `// Backwards compatibility aliases`,
206
- `export { user as users, session as sessions, account as accounts, verification as verifications };`
207
- );
208
220
  return lines.join("\n") + "\n";
209
221
  }
210
222
 
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url';
9
9
  import { mkdir, writeFile, readFile } from 'node:fs/promises';
10
10
  import { defu } from 'defu';
11
11
 
12
- const version = "0.1.30";
12
+ const version = "0.1.32";
13
13
 
14
14
  function scanSchemaExports(schemaFiles) {
15
15
  const types = [];
package/dist/module.d.ts CHANGED
@@ -7,7 +7,7 @@ export { findQueueFiles } from "./utils/queue";
7
7
  export { findJobFiles } from "./utils/jobs";
8
8
  export { findAgentFiles } from "./utils/agents";
9
9
  export { generateAuthSchema, getActiveAuthTableNames } from "./utils/auth-schema";
10
- export { cmsCollections, cmsEntries, cmsRevisions, ALL_CMS_TABLE_NAMES, getActiveCmsTableNames, } from "./utils/cms-schema";
10
+ export { cmsCollections, cmsEntries, cmsRevisions, cmsCategories, cmsTags, cmsComments, cmsBookmarks, cmsSubscribers, ALL_CMS_TABLE_NAMES, getActiveCmsTableNames, } from "./utils/cms-schema";
11
11
  export { generatePaymentsSchema, getActivePaymentsTableNames } from "./utils/payments-schema";
12
12
  export { generateNotificationsSchema, getActiveNotificationsTableNames, } from "./utils/notifications-schema";
13
13
  export { scanContentEntries } from "./utils/cms-scan";