qarpeo 0.4.13 → 0.4.15
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.
- package/README.md +197 -191
- package/dist/apps/cms.d.ts +1 -1
- package/dist/apps/comments.d.ts +1 -1
- package/dist/apps/payments.d.ts +1 -1
- package/dist/apps/store.d.ts +1 -1
- package/dist/chunks/{manifest.get.mjs → tools.mjs} +445 -430
- package/dist/cli/index.mjs +756 -746
- package/dist/core/aliases.d.ts +1 -1
- package/dist/core/context.d.ts +1 -1
- package/dist/core/d1-migrate.d.ts +1 -1
- package/dist/core/devtools.d.ts +1 -1
- package/dist/core/nitro.d.ts +1 -1
- package/dist/core/schema.d.ts +1 -1
- package/dist/core/server-utils.d.ts +1 -1
- package/dist/core/wrangler.d.ts +1 -1
- package/dist/fate/index.d.ts +8 -8
- package/dist/fate/index.mjs +3 -1
- package/dist/features/agents.d.ts +1 -1
- package/dist/features/auth.d.ts +1 -1
- package/dist/features/bots.d.ts +1 -1
- package/dist/features/console.d.ts +1 -1
- package/dist/features/fate.d.ts +1 -1
- package/dist/features/mail.d.ts +1 -1
- package/dist/features/mcp.d.ts +1 -1
- package/dist/features/multitenant.d.ts +1 -1
- package/dist/features/notifications.d.ts +1 -1
- package/dist/features/realtime.d.ts +1 -1
- package/dist/features/studio.d.ts +4 -0
- package/dist/module.d.ts +1 -1
- package/dist/module.mjs +5451 -5249
- package/dist/primitives/ai.d.ts +1 -1
- package/dist/primitives/analytics.d.ts +1 -1
- package/dist/primitives/blob.d.ts +1 -1
- package/dist/primitives/browser.d.ts +1 -1
- package/dist/primitives/cache.d.ts +1 -1
- package/dist/primitives/d1.d.ts +1 -1
- package/dist/primitives/do.d.ts +1 -1
- package/dist/primitives/email.d.ts +1 -1
- package/dist/primitives/hyperdrive.d.ts +1 -1
- package/dist/primitives/kv.d.ts +1 -1
- package/dist/primitives/queue.d.ts +1 -1
- package/dist/primitives/ratelimit.d.ts +1 -1
- package/dist/primitives/vectorize.d.ts +1 -1
- package/dist/primitives/workflows.d.ts +1 -1
- package/dist/runtime/ai.mjs +4 -1
- package/dist/runtime/app/components/CMSEditor.vue +439 -0
- package/dist/runtime/app/components/CMSEditorImageNode.vue +90 -0
- package/dist/runtime/app/components/CMSEditorLinkPopover.vue +120 -0
- package/dist/runtime/app/components/QDropZone.vue +327 -0
- package/dist/runtime/app/components/QImageCropper.vue +658 -0
- package/dist/runtime/app/components/QImageStudio.vue +300 -0
- package/dist/runtime/app/components/QImg.vue +7 -4
- package/dist/runtime/app/composables/analytics.d.ts +8 -8
- package/dist/runtime/app/composables/api-tokens.d.ts +5 -5
- package/dist/runtime/app/composables/auth.d.ts +23 -19
- package/dist/runtime/app/composables/chat.d.ts +7 -6
- package/dist/runtime/app/composables/cms-preview.d.ts +7 -8
- package/dist/runtime/app/composables/cms.d.ts +6 -6
- package/dist/runtime/app/composables/comments.d.ts +5 -5
- package/dist/runtime/app/composables/comments.mjs +7 -4
- package/dist/runtime/app/composables/console.d.ts +6 -14
- package/dist/runtime/app/composables/docs-version.d.ts +8 -8
- package/dist/runtime/app/composables/impersonation.d.ts +5 -5
- package/dist/runtime/app/composables/organization.d.ts +5 -5
- package/dist/runtime/app/composables/passkey.d.ts +5 -5
- package/dist/runtime/app/composables/passwordless.d.ts +5 -5
- package/dist/runtime/app/composables/payments.d.ts +5 -5
- package/dist/runtime/app/composables/rbac.d.ts +5 -5
- package/dist/runtime/app/composables/site.d.ts +2 -2
- package/dist/runtime/app/composables/sse.d.ts +20 -33
- package/dist/runtime/app/composables/sse.mjs +6 -3
- package/dist/runtime/app/composables/storage.d.ts +6 -8
- package/dist/runtime/app/composables/store.d.ts +52 -36
- package/dist/runtime/app/composables/store.mjs +70 -11
- package/dist/runtime/app/composables/studio.d.ts +59 -0
- package/dist/runtime/app/composables/studio.mjs +129 -0
- package/dist/runtime/app/composables/tenant.d.ts +7 -7
- package/dist/runtime/app/composables/turnstile.d.ts +5 -5
- package/dist/runtime/app/composables/two-factor.d.ts +5 -5
- package/dist/runtime/app/pages/devtools/notifications.vue +1 -6
- package/dist/runtime/app/plugins/pwa.mjs +1 -3
- package/dist/runtime/app/utils/cms-editor.d.ts +25 -0
- package/dist/runtime/app/utils/cms-editor.mjs +43 -0
- package/dist/runtime/auth.d.ts +9 -9
- package/dist/runtime/blob.d.ts +1 -3
- package/dist/runtime/blob.mjs +3 -1
- package/dist/runtime/cache.d.ts +8 -6
- package/dist/runtime/cache.mjs +8 -11
- package/dist/runtime/db.d.ts +4 -3
- package/dist/runtime/drizzle.d.ts +2 -1
- package/dist/runtime/drizzle.mjs +2 -2
- package/dist/runtime/queue.d.ts +1 -0
- package/dist/runtime/replica.d.ts +6 -10
- package/dist/runtime/replica.mjs +3 -1
- package/dist/runtime/schema-mysql.d.ts +16 -32
- package/dist/runtime/schema-pg.d.ts +15 -31
- package/dist/runtime/schema-shared.d.ts +20 -17
- package/dist/runtime/schema.d.ts +21 -33
- package/dist/runtime/server/durable-objects/agent.mjs +4 -1
- package/dist/runtime/server/durable-objects/room.d.ts +4 -6
- package/dist/runtime/server/durable-objects/room.mjs +18 -8
- package/dist/runtime/server/plugins/comments.d.ts +2 -3
- package/dist/runtime/server/plugins/email-inbound.d.ts +1 -3
- package/dist/runtime/server/plugins/store.d.ts +2 -3
- package/dist/runtime/server/routes/__qarpeo/cloud/agents/run.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.get.mjs +10 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.post.mjs +10 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/cms.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/cms.get.mjs +7 -1
- package/dist/runtime/server/routes/__qarpeo/cloud/comments/moderate.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/comments/moderate.post.mjs +5 -1
- package/dist/runtime/server/routes/__qarpeo/cloud/comments.get.d.ts +1 -3
- package/dist/runtime/server/routes/__qarpeo/cloud/extras.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/extras.get.mjs +15 -4
- package/dist/runtime/server/routes/__qarpeo/cloud/mail/unsuppress.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/migrate/cms.post.mjs +13 -4
- package/dist/runtime/server/routes/__qarpeo/cloud/migrate/products.post.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/cloud/migrate.post.d.ts +3 -3
- package/dist/runtime/server/routes/__qarpeo/cloud/migrate.post.mjs +22 -6
- package/dist/runtime/server/routes/__qarpeo/cloud/notifications/test.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/operations.get.d.ts +6 -5
- package/dist/runtime/server/routes/__qarpeo/cloud/store/order-status.post.d.ts +1 -3
- package/dist/runtime/server/routes/__qarpeo/cloud/store/order-status.post.mjs +14 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/store/orders.get.d.ts +1 -3
- package/dist/runtime/server/routes/__qarpeo/cloud/store/orders.get.mjs +7 -1
- package/dist/runtime/server/routes/__qarpeo/cloud/store/products.get.d.ts +1 -3
- package/dist/runtime/server/routes/__qarpeo/cloud/tasks/run.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/users/action.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/cloud/users/action.post.mjs +5 -1
- package/dist/runtime/server/routes/__qarpeo/cloud/users.get.d.ts +6 -5
- package/dist/runtime/server/routes/__qarpeo/cloud/users.get.mjs +1 -3
- package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.mjs +2 -2
- package/dist/runtime/server/routes/__qarpeo/manifest.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/og.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/rbac/me.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/rbac/roles.delete.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/rbac/roles.delete.mjs +5 -1
- package/dist/runtime/server/routes/__qarpeo/rbac/roles.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/rbac/roles.get.mjs +1 -5
- package/dist/runtime/server/routes/__qarpeo/rbac/roles.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/rbac/roles.post.mjs +5 -1
- package/dist/runtime/server/routes/__qarpeo/rbac/users.post.d.ts +2 -2
- package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +1 -6
- package/dist/runtime/server/routes/agents/[agent]/clear.post.mjs +1 -6
- package/dist/runtime/server/routes/agents/[agent]/history.get.mjs +1 -6
- package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +5 -1
- package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +7 -1
- package/dist/runtime/server/routes/auth/magic-link/send.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/otp/send.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/search.get.mjs +2 -6
- package/dist/runtime/server/routes/comments/[id]/report.post.mjs +1 -4
- package/dist/runtime/server/routes/comments/[id].patch.mjs +1 -4
- package/dist/runtime/server/routes/comments/batch.post.mjs +1 -3
- package/dist/runtime/server/routes/comments/index.post.mjs +1 -5
- package/dist/runtime/server/routes/fate.mjs +1 -1
- package/dist/runtime/server/routes/mail/webhooks.post.mjs +1 -1
- package/dist/runtime/server/routes/sitemap.xml.get.mjs +2 -1
- package/dist/runtime/server/routes/storage/presigned-r2.post.d.ts +5 -6
- package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +1 -1
- package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +1 -1
- package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +1 -1
- package/dist/runtime/server/routes/store/currencies.get.mjs +1 -4
- package/dist/runtime/server/routes/store/orders/[id].get.mjs +1 -1
- package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +13 -4
- package/dist/runtime/server/routes/store/orders/index.get.mjs +1 -1
- package/dist/runtime/server/routes/store/products/index.get.mjs +2 -0
- package/dist/runtime/server/routes/store/tax/calculate.post.d.ts +2 -1
- package/dist/runtime/server/routes/store/tax/calculate.post.mjs +12 -3
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +4 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +4 -1
- package/dist/runtime/server/utils/ai.d.ts +38 -35
- package/dist/runtime/server/utils/ai.mjs +7 -11
- package/dist/runtime/server/utils/analytics-query.d.ts +4 -4
- package/dist/runtime/server/utils/auth.d.ts +25 -25
- package/dist/runtime/server/utils/auth.mjs +22 -8
- package/dist/runtime/server/utils/bots.d.ts +7 -7
- package/dist/runtime/server/utils/browser-utils.d.ts +26 -27
- package/dist/runtime/server/utils/cache.d.ts +20 -20
- package/dist/runtime/server/utils/cms/collections.mjs +1 -6
- package/dist/runtime/server/utils/cms/common.mjs +1 -0
- package/dist/runtime/server/utils/cms/markdown.d.ts +2 -2
- package/dist/runtime/server/utils/cms/markdown.mjs +5 -5
- package/dist/runtime/server/utils/cms/mutations.mjs +8 -23
- package/dist/runtime/server/utils/cms/navigation.mjs +4 -4
- package/dist/runtime/server/utils/cms/path.d.ts +1 -0
- package/dist/runtime/server/utils/cms/path.mjs +8 -2
- package/dist/runtime/server/utils/cms/references.mjs +1 -7
- package/dist/runtime/server/utils/cms/search.d.ts +2 -2
- package/dist/runtime/server/utils/cms/sync.mjs +4 -2
- package/dist/runtime/server/utils/cms/taxonomy.d.ts +2 -2
- package/dist/runtime/server/utils/cms.d.ts +1 -1
- package/dist/runtime/server/utils/cms.mjs +1 -5
- package/dist/runtime/server/utils/comments-filter.d.ts +9 -7
- package/dist/runtime/server/utils/comments.d.ts +68 -55
- package/dist/runtime/server/utils/comments.mjs +21 -9
- package/dist/runtime/server/utils/config.d.ts +2 -2
- package/dist/runtime/server/utils/console.d.ts +3 -5
- package/dist/runtime/server/utils/context.d.ts +10 -10
- package/dist/runtime/server/utils/crypto.d.ts +20 -20
- package/dist/runtime/server/utils/domains.mjs +3 -1
- package/dist/runtime/server/utils/drizzle.d.ts +24 -25
- package/dist/runtime/server/utils/drizzle.mjs +17 -17
- package/dist/runtime/server/utils/durable-object.d.ts +27 -25
- package/dist/runtime/server/utils/durable-object.mjs +3 -10
- package/dist/runtime/server/utils/email-inbound.d.ts +10 -10
- package/dist/runtime/server/utils/impersonation.d.ts +18 -18
- package/dist/runtime/server/utils/legacy-hash.d.ts +23 -27
- package/dist/runtime/server/utils/lock.d.ts +20 -23
- package/dist/runtime/server/utils/mail.d.ts +19 -19
- package/dist/runtime/server/utils/mail.mjs +4 -2
- package/dist/runtime/server/utils/mcp.d.ts +20 -20
- package/dist/runtime/server/utils/mcp.mjs +22 -38
- package/dist/runtime/server/utils/notifications.d.ts +49 -38
- package/dist/runtime/server/utils/oauth.d.ts +3 -9
- package/dist/runtime/server/utils/organization.d.ts +28 -28
- package/dist/runtime/server/utils/organization.mjs +15 -5
- package/dist/runtime/server/utils/passwordless.d.ts +24 -24
- package/dist/runtime/server/utils/payments/checkout.d.ts +12 -12
- package/dist/runtime/server/utils/payments/checkout.mjs +1 -3
- package/dist/runtime/server/utils/payments/common.d.ts +3 -3
- package/dist/runtime/server/utils/payments/paddle.d.ts +4 -1
- package/dist/runtime/server/utils/payments/polar.d.ts +4 -1
- package/dist/runtime/server/utils/payments/stripe.mjs +5 -7
- package/dist/runtime/server/utils/payments/subscriptions.d.ts +14 -14
- package/dist/runtime/server/utils/payments/subscriptions.mjs +2 -6
- package/dist/runtime/server/utils/payments/usage.mjs +1 -3
- package/dist/runtime/server/utils/payments/webhooks.mjs +2 -2
- package/dist/runtime/server/utils/queue.d.ts +54 -58
- package/dist/runtime/server/utils/queue.mjs +2 -6
- package/dist/runtime/server/utils/rag.d.ts +23 -23
- package/dist/runtime/server/utils/rag.mjs +10 -5
- package/dist/runtime/server/utils/ratelimit.d.ts +21 -18
- package/dist/runtime/server/utils/rbac.d.ts +13 -15
- package/dist/runtime/server/utils/rbac.mjs +44 -10
- package/dist/runtime/server/utils/realtime.d.ts +53 -52
- package/dist/runtime/server/utils/role-env.d.ts +5 -4
- package/dist/runtime/server/utils/scheduled-task.d.ts +14 -15
- package/dist/runtime/server/utils/session.d.ts +40 -40
- package/dist/runtime/server/utils/sse.d.ts +23 -33
- package/dist/runtime/server/utils/sse.mjs +5 -14
- package/dist/runtime/server/utils/sso.mjs +3 -1
- package/dist/runtime/server/utils/storage.d.ts +20 -22
- package/dist/runtime/server/utils/storage.mjs +2 -2
- package/dist/runtime/server/utils/store/cart.d.ts +5 -3
- package/dist/runtime/server/utils/store/cart.mjs +14 -10
- package/dist/runtime/server/utils/store/checkout.mjs +4 -1
- package/dist/runtime/server/utils/store/common.d.ts +1 -1
- package/dist/runtime/server/utils/store/common.mjs +36 -12
- package/dist/runtime/server/utils/store/inventory.mjs +3 -1
- package/dist/runtime/server/utils/store/orders.mjs +32 -24
- package/dist/runtime/server/utils/store/vendor.d.ts +11 -1
- package/dist/runtime/server/utils/store/vendor.mjs +47 -0
- package/dist/runtime/server/utils/store-localization.d.ts +9 -27
- package/dist/runtime/server/utils/store-localization.mjs +3 -3
- package/dist/runtime/server/utils/table-names.d.ts +15 -15
- package/dist/runtime/server/utils/table-names.mjs +1 -1
- package/dist/runtime/server/utils/tenant.d.ts +12 -12
- package/dist/runtime/server/utils/tenant.mjs +7 -4
- package/dist/runtime/server/utils/totp.d.ts +18 -18
- package/dist/runtime/server/utils/tracker.d.ts +5 -5
- package/dist/runtime/server/utils/turnstile.d.ts +9 -9
- package/dist/runtime/server/utils/urn.d.ts +5 -8
- package/dist/runtime/server/utils/workflows.d.ts +30 -31
- package/dist/runtime/server/utils/workflows.mjs +2 -4
- package/dist/runtime/server.d.ts +2 -2
- package/dist/runtime/service.d.ts +10 -10
- package/dist/runtime/test-utils.d.ts +10 -10
- package/dist/runtime/test-utils.mjs +9 -2
- package/dist/runtime/types/ai.d.ts +14 -14
- package/dist/runtime/types/d1.d.ts +6 -11
- package/dist/runtime/types/durable-object.d.ts +4 -8
- package/dist/runtime/types/email.d.ts +3 -9
- package/dist/runtime/types/index.d.ts +15 -21
- package/dist/runtime/types/r2.d.ts +5 -5
- package/dist/runtime/types/store.d.ts +7 -0
- package/dist/runtime/types/workflows.d.ts +5 -6
- package/dist/runtime/workflows.d.ts +1 -3
- package/dist/types/ai.d.ts +10 -17
- package/dist/types/auth.d.ts +5 -3
- package/dist/types/cache.d.ts +7 -7
- package/dist/types/cms.d.ts +30 -5
- package/dist/types/comments.d.ts +23 -21
- package/dist/types/console.d.ts +1 -3
- package/dist/types/db.d.ts +7 -7
- package/dist/types/index.d.ts +1 -0
- package/dist/types/options.d.ts +36 -24
- package/dist/types/site.d.ts +8 -2
- package/dist/types/storage.d.ts +2 -1
- package/dist/types/store-options.d.ts +31 -26
- package/dist/types/studio.d.ts +79 -0
- package/dist/utils/bots.d.ts +7 -3
- package/dist/utils/cms-table-names.d.ts +1 -1
- package/dist/utils/drizzle.d.ts +13 -14
- package/dist/utils/email-inbound.d.ts +4 -4
- package/dist/utils/features.d.ts +19 -5
- package/dist/utils/mcp.d.ts +1 -0
- package/dist/utils/migration-lock.d.ts +15 -29
- package/dist/utils/overridable-routes.d.ts +12 -0
- package/dist/utils/pkg.d.ts +6 -7
- package/dist/utils/schema-diff.d.ts +7 -11
- package/dist/utils/store-schema.d.ts +4 -6
- package/dist/utils/tools.d.ts +3 -3
- package/package.json +55 -5
|
@@ -104,12 +104,7 @@ function formatDate(ts?: number) {
|
|
|
104
104
|
size="xs"
|
|
105
105
|
@click="reloadNotifications"
|
|
106
106
|
/>
|
|
107
|
-
<UButton
|
|
108
|
-
label="+ Send Test"
|
|
109
|
-
color="primary"
|
|
110
|
-
size="xs"
|
|
111
|
-
@click="showSendDialog = true"
|
|
112
|
-
/>
|
|
107
|
+
<UButton label="+ Send Test" color="primary" size="xs" @click="showSendDialog = true" />
|
|
113
108
|
</div>
|
|
114
109
|
</div>
|
|
115
110
|
|
|
@@ -5,9 +5,7 @@ export default defineNuxtPlugin(() => {
|
|
|
5
5
|
const pwa = qarpeo.pwa || {};
|
|
6
6
|
const site = qarpeo.site || {};
|
|
7
7
|
if (pwa.enabled === false) return;
|
|
8
|
-
const links = [
|
|
9
|
-
{ rel: "manifest", href: "/manifest.webmanifest" }
|
|
10
|
-
];
|
|
8
|
+
const links = [{ rel: "manifest", href: "/manifest.webmanifest" }];
|
|
11
9
|
const appleTouchIcon = pwa.appleTouchIcon || pwa.icons?.find((i) => i.sizes.includes("180") || i.sizes.includes("192"))?.src || pwa.icons?.[0]?.src;
|
|
12
10
|
if (appleTouchIcon) {
|
|
13
11
|
links.push({ rel: "apple-touch-icon", href: appleTouchIcon });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
import type { Editor } from "@tiptap/vue-3";
|
|
3
|
+
import type { Component } from "vue";
|
|
4
|
+
declare module "@tiptap/core" {
|
|
5
|
+
interface Commands<ReturnType> {
|
|
6
|
+
imageUpload: {
|
|
7
|
+
insertImageUpload: () => ReturnType;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare function createCMSImageUploadExtension(nodeComponent: Component): Node<any, any>;
|
|
12
|
+
export declare const cmsEditorHandlers: {
|
|
13
|
+
imageUpload: {
|
|
14
|
+
canExecute: (editor: Editor) => boolean;
|
|
15
|
+
execute: (editor: Editor) => import("@tiptap/core").ChainedCommands;
|
|
16
|
+
isActive: (editor: Editor) => boolean;
|
|
17
|
+
isDisabled: undefined;
|
|
18
|
+
};
|
|
19
|
+
table: {
|
|
20
|
+
canExecute: (editor: Editor) => any;
|
|
21
|
+
execute: (editor: Editor) => any;
|
|
22
|
+
isActive: (editor: Editor) => boolean;
|
|
23
|
+
isDisabled: undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
2
|
+
import { VueNodeViewRenderer } from "@tiptap/vue-3";
|
|
3
|
+
export function createCMSImageUploadExtension(nodeComponent) {
|
|
4
|
+
return Node.create({
|
|
5
|
+
name: "imageUpload",
|
|
6
|
+
group: "block",
|
|
7
|
+
atom: true,
|
|
8
|
+
draggable: true,
|
|
9
|
+
addAttributes() {
|
|
10
|
+
return {};
|
|
11
|
+
},
|
|
12
|
+
parseHTML() {
|
|
13
|
+
return [{ tag: 'div[data-type="image-upload"]' }];
|
|
14
|
+
},
|
|
15
|
+
renderHTML({ HTMLAttributes }) {
|
|
16
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "image-upload" })];
|
|
17
|
+
},
|
|
18
|
+
addNodeView() {
|
|
19
|
+
return VueNodeViewRenderer(nodeComponent);
|
|
20
|
+
},
|
|
21
|
+
addCommands() {
|
|
22
|
+
return {
|
|
23
|
+
insertImageUpload: () => ({ commands }) => {
|
|
24
|
+
return commands.insertContent({ type: this.name });
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export const cmsEditorHandlers = {
|
|
31
|
+
imageUpload: {
|
|
32
|
+
canExecute: (editor) => editor.can().insertContent({ type: "imageUpload" }),
|
|
33
|
+
execute: (editor) => editor.chain().focus().insertContent({ type: "imageUpload" }),
|
|
34
|
+
isActive: (editor) => editor.isActive("imageUpload"),
|
|
35
|
+
isDisabled: void 0
|
|
36
|
+
},
|
|
37
|
+
table: {
|
|
38
|
+
canExecute: (editor) => editor.can().insertTable({ rows: 3, cols: 3, withHeaderRow: true }),
|
|
39
|
+
execute: (editor) => editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }),
|
|
40
|
+
isActive: (editor) => editor.isActive("table"),
|
|
41
|
+
isDisabled: void 0
|
|
42
|
+
}
|
|
43
|
+
};
|
package/dist/runtime/auth.d.ts
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Standard auth user columns mixin for Tier 3 custom schema declarations.
|
|
3
3
|
*
|
|
4
4
|
* @example
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { snakeCase, text } from "drizzle-orm/sqlite-core"
|
|
7
|
+
* import { authUserFields } from "qarpeo/auth"
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* export const users = snakeCase.table("users", {
|
|
10
|
+
* ...authUserFields,
|
|
11
|
+
* bio: text(),
|
|
12
|
+
* customField: text(),
|
|
13
|
+
* })
|
|
14
|
+
* ```
|
|
15
15
|
*/
|
|
16
16
|
export declare const authUserFields: {
|
|
17
17
|
id: import("drizzle-orm").IsPrimaryKey<import("drizzle-orm/sqlite-core").SQLiteTextBuilder<[string, ...string[]]>>;
|
package/dist/runtime/blob.d.ts
CHANGED
|
@@ -24,9 +24,7 @@ export declare function createBlob(bindingName?: string, event?: CFEvent): Qarpe
|
|
|
24
24
|
export declare const handleBlob: (bindingName?: string, event?: CFEvent) => QarpeoBlob;
|
|
25
25
|
/** Auto-imported `blob` instance for direct Cloudflare R2 Blob operations. */
|
|
26
26
|
export declare const blob: QarpeoBlob;
|
|
27
|
-
/**
|
|
28
|
-
* Auto-imported `storage` instance — alias for `blob` providing Void Cloud (`void/storage`) parity.
|
|
29
|
-
*/
|
|
27
|
+
/** Auto-imported `storage` instance — alias for `blob` providing Void Cloud (`void/storage`) parity. */
|
|
30
28
|
export declare const storage: QarpeoBlob;
|
|
31
29
|
/** Alias for createBlob */
|
|
32
30
|
export declare const createStorage: typeof createBlob;
|
package/dist/runtime/blob.mjs
CHANGED
|
@@ -37,7 +37,9 @@ function assertValidPathname(pathname) {
|
|
|
37
37
|
}
|
|
38
38
|
function parseDurationToSeconds(input) {
|
|
39
39
|
const s = input.trim().toLowerCase();
|
|
40
|
-
const match = s.match(
|
|
40
|
+
const match = s.match(
|
|
41
|
+
/^(\d+(?:\.\d+)?)\s*(s|sec|second|seconds|m|min|minute|minutes|h|hr|hour|hours|d|day|days|w|week|weeks)?$/
|
|
42
|
+
);
|
|
41
43
|
if (!match) return parseInt(s, 10) || 900;
|
|
42
44
|
const n = parseFloat(match[1]);
|
|
43
45
|
const unit = match[2] || "s";
|
package/dist/runtime/cache.d.ts
CHANGED
|
@@ -23,7 +23,8 @@ export declare function useEdgeCache(): EdgeCacheInterface | undefined;
|
|
|
23
23
|
*
|
|
24
24
|
* Purges cached responses from Cloudflare's Edge Cache (`caches.default`) for the given path(s).
|
|
25
25
|
*
|
|
26
|
-
* @param pathOrUrl Single path/URL or array of paths to revalidate (e.g. `/api/posts`,
|
|
26
|
+
* @param pathOrUrl Single path/URL or array of paths to revalidate (e.g. `/api/posts`,
|
|
27
|
+
* `https://example.com/blog`)
|
|
27
28
|
* @param event Optional event context for resolving host origin
|
|
28
29
|
*/
|
|
29
30
|
export declare function revalidate(pathOrUrl: string | string[], event?: any): Promise<{
|
|
@@ -33,10 +34,11 @@ export declare function revalidate(pathOrUrl: string | string[], event?: any): P
|
|
|
33
34
|
/** Alias for revalidate matching Next.js / Void Cloud semantics. */
|
|
34
35
|
export declare const revalidatePath: typeof revalidate;
|
|
35
36
|
/**
|
|
36
|
-
* Sets one or more semantic cache tags on an outgoing response.
|
|
37
|
-
*
|
|
37
|
+
* Sets one or more semantic cache tags on an outgoing response. Cloudflare Edge Cache / CDN reads
|
|
38
|
+
* the `Cache-Tag` header for tag-based cache purging.
|
|
38
39
|
*
|
|
39
|
-
* @param eventOrResponse Nuxt/Nitro RequestEvent, standard Response object, or response headers
|
|
40
|
+
* @param eventOrResponse Nuxt/Nitro RequestEvent, standard Response object, or response headers
|
|
41
|
+
* container
|
|
40
42
|
* @param tags Single tag or array of tags (e.g. "products", ["blog", "post:123"])
|
|
41
43
|
*/
|
|
42
44
|
export declare function setCacheTags(eventOrResponse: any, tags: string | string[]): void;
|
|
@@ -59,8 +61,8 @@ export interface RevalidateTagResult {
|
|
|
59
61
|
/**
|
|
60
62
|
* On-demand edge cache tag purging (Void Cloud & Next.js parity).
|
|
61
63
|
*
|
|
62
|
-
* Purges cached entries associated with the specified tag(s) across Cloudflare's Edge CDN
|
|
63
|
-
*
|
|
64
|
+
* Purges cached entries associated with the specified tag(s) across Cloudflare's Edge CDN and
|
|
65
|
+
* internal edge storage.
|
|
64
66
|
*
|
|
65
67
|
* @param tagOrTags Single tag or array of tags to purge
|
|
66
68
|
* @param options Optional credentials and configuration overrides
|
package/dist/runtime/cache.mjs
CHANGED
|
@@ -74,17 +74,14 @@ export async function revalidateTag(tagOrTags, options) {
|
|
|
74
74
|
const apiToken = options?.apiToken || process.env.CLOUDFLARE_API_TOKEN || process.env.CF_API_TOKEN || process.env.CLOUDFLARE_TOKEN;
|
|
75
75
|
if (zoneId && apiToken) {
|
|
76
76
|
try {
|
|
77
|
-
const res = await fetch(
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
body: JSON.stringify({ tags })
|
|
86
|
-
}
|
|
87
|
-
);
|
|
77
|
+
const res = await fetch(`https://api.cloudflare.com/client/v4/zones/${zoneId}/purge_cache`, {
|
|
78
|
+
method: "POST",
|
|
79
|
+
headers: {
|
|
80
|
+
Authorization: `Bearer ${apiToken}`,
|
|
81
|
+
"Content-Type": "application/json"
|
|
82
|
+
},
|
|
83
|
+
body: JSON.stringify({ tags })
|
|
84
|
+
});
|
|
88
85
|
const data = await res.json();
|
|
89
86
|
if (data?.success) {
|
|
90
87
|
return { success: true, tags, purged: true };
|
package/dist/runtime/db.d.ts
CHANGED
|
@@ -25,14 +25,15 @@ export declare const d1: QarpeoDB;
|
|
|
25
25
|
* Automatically infers the database dialect from a connection URL string.
|
|
26
26
|
*
|
|
27
27
|
* Rules:
|
|
28
|
+
*
|
|
28
29
|
* - `postgres://` or `postgresql://` -> `"postgres"`
|
|
29
30
|
* - `mysql://` or `mysql2://` -> `"mysql"`
|
|
30
|
-
* -
|
|
31
|
+
* - Otherwise (empty, sqlite://, file:) -> `"d1"` (Cloudflare D1 / SQLite default)
|
|
31
32
|
*/
|
|
32
33
|
export declare function detectDatabaseDialect(url?: string): DatabaseDialect;
|
|
33
34
|
/**
|
|
34
|
-
* Returns active database connection info and inferred dialect based on DATABASE_URL,
|
|
35
|
-
*
|
|
35
|
+
* Returns active database connection info and inferred dialect based on DATABASE_URL, named
|
|
36
|
+
* Hyperdrive binding, or Cloudflare environment variables.
|
|
36
37
|
*
|
|
37
38
|
* @param bindingOrEvent Optional binding name / URL string, or CFEvent context
|
|
38
39
|
* @param maybeEvent Optional event context when first parameter is a binding name
|
|
@@ -7,7 +7,8 @@ export type { QarpeoDrizzleDB, InferDrizzleRelations } from "./types/drizzle";
|
|
|
7
7
|
* Automatically detects whether to use D1 or PostgreSQL based on DATABASE_URL or Hyperdrive.
|
|
8
8
|
*
|
|
9
9
|
* @param schema The database schema containing tables
|
|
10
|
-
* @param bindingName Optional Cloudflare D1 / Hyperdrive binding name (defaults to 'DB' or
|
|
10
|
+
* @param bindingName Optional Cloudflare D1 / Hyperdrive binding name (defaults to 'DB' or
|
|
11
|
+
* 'HYPERDRIVE')
|
|
11
12
|
* @param event Optional event context
|
|
12
13
|
*/
|
|
13
14
|
export declare function createDrizzle<TSchema extends Record<string, unknown>>(schema: TSchema, bindingName?: string, event?: CFEvent): QarpeoDrizzleDB<InferDrizzleRelations<TSchema>>;
|
package/dist/runtime/drizzle.mjs
CHANGED
|
@@ -9,7 +9,7 @@ export function createDrizzle(schema, bindingName, event) {
|
|
|
9
9
|
let postgresLib;
|
|
10
10
|
let drizzlePostgres;
|
|
11
11
|
try {
|
|
12
|
-
const req = globalThis.require || (
|
|
12
|
+
const req = globalThis.require || (globalThis.process !== void 0 && typeof require !== "undefined" ? require : void 0);
|
|
13
13
|
if (req) {
|
|
14
14
|
const pgMod = req("postgres");
|
|
15
15
|
postgresLib = pgMod?.default || pgMod;
|
|
@@ -56,7 +56,7 @@ Ensure your Hyperdrive binding exposes a connectionString (or set DATABASE_URL).
|
|
|
56
56
|
let mysqlLib;
|
|
57
57
|
let drizzleMysql;
|
|
58
58
|
try {
|
|
59
|
-
const req = globalThis.require || (
|
|
59
|
+
const req = globalThis.require || (globalThis.process !== void 0 && typeof require !== "undefined" ? require : void 0);
|
|
60
60
|
if (req) {
|
|
61
61
|
mysqlLib = req("mysql2/promise");
|
|
62
62
|
drizzleMysql = req("drizzle-orm/mysql2").drizzle;
|
package/dist/runtime/queue.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare const queue: QarpeoQueue<any>;
|
|
|
23
23
|
* Dynamic proxy for accessing any named Cloudflare Queue (Void Cloud `void/queues` parity).
|
|
24
24
|
*
|
|
25
25
|
* Usage:
|
|
26
|
+
*
|
|
26
27
|
* ```ts
|
|
27
28
|
* await queues.emails.send({ to: "user@example.com", subject: "Welcome" })
|
|
28
29
|
* await queues["order-notifications"].sendBatch([ ... ])
|
|
@@ -3,13 +3,10 @@ export type { D1ReplicaOptions } from "./types/d1";
|
|
|
3
3
|
/**
|
|
4
4
|
* Detects whether a SQL query modifies database state.
|
|
5
5
|
*
|
|
6
|
-
* Supports SQLite statements, Common Table Expressions (WITH), comments,
|
|
7
|
-
* and PRAGMA directives.
|
|
6
|
+
* Supports SQLite statements, Common Table Expressions (WITH), comments, and PRAGMA directives.
|
|
8
7
|
*/
|
|
9
8
|
export declare function isWriteQuery(sql: string): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Resolves the read replica binding or creates a D1 replication session.
|
|
12
|
-
*/
|
|
9
|
+
/** Resolves the read replica binding or creates a D1 replication session. */
|
|
13
10
|
export declare function resolveD1ReplicaBinding(primaryD1: D1Database, bindingName?: string, options?: D1ReplicaOptions): {
|
|
14
11
|
replicaD1: D1Database;
|
|
15
12
|
session?: any;
|
|
@@ -17,11 +14,10 @@ export declare function resolveD1ReplicaBinding(primaryD1: D1Database, bindingNa
|
|
|
17
14
|
/**
|
|
18
15
|
* Creates a replica-routed `QarpeoDB` instance.
|
|
19
16
|
*
|
|
20
|
-
* Directs read queries (e.g. SELECT) to the nearest Cloudflare D1 read replica,
|
|
21
|
-
*
|
|
22
|
-
* on the primary D1 database.
|
|
17
|
+
* Directs read queries (e.g. SELECT) to the nearest Cloudflare D1 read replica, while transparently
|
|
18
|
+
* executing write queries (INSERT, UPDATE, DELETE, CREATE, etc.) on the primary D1 database.
|
|
23
19
|
*
|
|
24
|
-
* If a read query on the replica encounters a failure, it automatically falls back
|
|
25
|
-
*
|
|
20
|
+
* If a read query on the replica encounters a failure, it automatically falls back to the primary
|
|
21
|
+
* database to ensure high availability.
|
|
26
22
|
*/
|
|
27
23
|
export declare function createReplicaRoutedD1(primaryD1: D1Database, options?: D1ReplicaOptions, bindingName?: string): QarpeoDB;
|
package/dist/runtime/replica.mjs
CHANGED
|
@@ -138,7 +138,9 @@ export function createReplicaRoutedD1(primaryD1, options, bindingName) {
|
|
|
138
138
|
return createStatementWrapper(query, values);
|
|
139
139
|
},
|
|
140
140
|
first(colName) {
|
|
141
|
-
return executeQuery(
|
|
141
|
+
return executeQuery(
|
|
142
|
+
(stmt) => colName ? stmt.first(colName) : stmt.first()
|
|
143
|
+
);
|
|
142
144
|
},
|
|
143
145
|
all() {
|
|
144
146
|
return executeQuery((stmt) => stmt.all());
|
|
@@ -2,75 +2,59 @@
|
|
|
2
2
|
* `qarpeo/schema/mysql` — MySQL Drizzle ORM helpers, column spreads, and ID generators.
|
|
3
3
|
*
|
|
4
4
|
* Re-exports everything from `"drizzle-orm/mysql-core"` and `"drizzle-orm"`, plus Qarpeo's
|
|
5
|
-
* `msTable` alias (`mysqlTable`), primary key strategies (`msid`, `msuuid`, `msint`),
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* `msTable` alias (`mysqlTable`), primary key strategies (`msid`, `msuuid`, `msint`), timestamps
|
|
6
|
+
* (`mstimestamps`, `msCreatedAt`, `msUpdatedAt`), soft delete (`mssoftdelete`), multi-tenancy
|
|
7
|
+
* (`mstenantid`), and type helpers (`SelectFrom`, `InsertInto`).
|
|
8
8
|
*
|
|
9
9
|
* The `ms` prefix stands for **MySQL** throughout this module.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* ```ts [db/ms-logs/schema/logs.ts]
|
|
13
|
+
* import { msTable, msid, mstimestamps, varchar, text } from "qarpeo/schema/mysql"
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* export const logs = msTable("logs", {
|
|
16
16
|
* ...msid,
|
|
17
17
|
* level: varchar({ length: 32 }).notNull(),
|
|
18
18
|
* message: text().notNull(),
|
|
19
19
|
* ...mstimestamps,
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
22
|
*/
|
|
23
23
|
export * from "drizzle-orm/mysql-core";
|
|
24
24
|
export * from "drizzle-orm";
|
|
25
25
|
export type { SelectedFields, SelectedFieldsFlat, SelectedFieldsOrdered, TableConfig, } from "drizzle-orm/mysql-core";
|
|
26
26
|
export * from "./schema-shared";
|
|
27
27
|
export { mysqlTable as msTable } from "drizzle-orm/mysql-core";
|
|
28
|
-
/**
|
|
29
|
-
* **Recommended MySQL primary key** — VARCHAR(36) UUID v7, auto-generated at insert.
|
|
30
|
-
*/
|
|
28
|
+
/** **Recommended MySQL primary key** — VARCHAR(36) UUID v7, auto-generated at insert. */
|
|
31
29
|
export declare const msid: {
|
|
32
30
|
readonly id: import("drizzle-orm").HasRuntimeDefault<import("drizzle-orm").HasDefault<import("drizzle-orm").IsPrimaryKey<import("drizzle-orm/mysql-core").MySqlVarCharBuilder<[string, ...string[]]>>>>;
|
|
33
31
|
};
|
|
34
|
-
/**
|
|
35
|
-
* MySQL UUID v4 primary key — VARCHAR(36), `crypto.randomUUID()`.
|
|
36
|
-
*/
|
|
32
|
+
/** MySQL UUID v4 primary key — VARCHAR(36), `crypto.randomUUID()`. */
|
|
37
33
|
export declare const msuuid: {
|
|
38
34
|
readonly id: import("drizzle-orm").HasRuntimeDefault<import("drizzle-orm").HasDefault<import("drizzle-orm").IsPrimaryKey<import("drizzle-orm/mysql-core").MySqlVarCharBuilder<[string, ...string[]]>>>>;
|
|
39
35
|
};
|
|
40
|
-
/**
|
|
41
|
-
* MySQL auto-increment primary key (SERIAL / BIGINT UNSIGNED AUTO_INCREMENT).
|
|
42
|
-
*/
|
|
36
|
+
/** MySQL auto-increment primary key (SERIAL / BIGINT UNSIGNED AUTO_INCREMENT). */
|
|
43
37
|
export declare const msint: {
|
|
44
38
|
readonly id: import("drizzle-orm").IsPrimaryKey<import("drizzle-orm/mysql-core").MySqlSerialBuilder>;
|
|
45
39
|
};
|
|
46
|
-
/**
|
|
47
|
-
* MySQL `createdAt` + `updatedAt` TIMESTAMP columns with automatic defaults.
|
|
48
|
-
*/
|
|
40
|
+
/** MySQL `createdAt` + `updatedAt` TIMESTAMP columns with automatic defaults. */
|
|
49
41
|
export declare const mstimestamps: {
|
|
50
42
|
readonly createdAt: import("drizzle-orm").HasRuntimeDefault<import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/mysql-core").MySqlTimestampBuilder>>>;
|
|
51
43
|
readonly updatedAt: import("drizzle-orm").HasDefault<import("drizzle-orm").HasRuntimeDefault<import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/mysql-core").MySqlTimestampBuilder>>>>;
|
|
52
44
|
};
|
|
53
|
-
/**
|
|
54
|
-
* Just `createdAt` for MySQL — set once at insert, never updated.
|
|
55
|
-
*/
|
|
45
|
+
/** Just `createdAt` for MySQL — set once at insert, never updated. */
|
|
56
46
|
export declare const msCreatedAt: {
|
|
57
47
|
readonly createdAt: import("drizzle-orm").HasRuntimeDefault<import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/mysql-core").MySqlTimestampBuilder>>>;
|
|
58
48
|
};
|
|
59
|
-
/**
|
|
60
|
-
* Just `updatedAt` for MySQL — set at insert and refreshed on every update.
|
|
61
|
-
*/
|
|
49
|
+
/** Just `updatedAt` for MySQL — set at insert and refreshed on every update. */
|
|
62
50
|
export declare const msUpdatedAt: {
|
|
63
51
|
readonly updatedAt: import("drizzle-orm").HasDefault<import("drizzle-orm").HasRuntimeDefault<import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/mysql-core").MySqlTimestampBuilder>>>>;
|
|
64
52
|
};
|
|
65
|
-
/**
|
|
66
|
-
* MySQL soft-delete column — `deletedAt` nullable TIMESTAMP.
|
|
67
|
-
*/
|
|
53
|
+
/** MySQL soft-delete column — `deletedAt` nullable TIMESTAMP. */
|
|
68
54
|
export declare const mssoftdelete: {
|
|
69
55
|
readonly deletedAt: import("drizzle-orm/mysql-core").MySqlTimestampBuilder;
|
|
70
56
|
};
|
|
71
|
-
/**
|
|
72
|
-
* MySQL multi-tenant isolation column — `tenantId` nullable VARCHAR(36).
|
|
73
|
-
*/
|
|
57
|
+
/** MySQL multi-tenant isolation column — `tenantId` nullable VARCHAR(36). */
|
|
74
58
|
export declare const mstenantid: {
|
|
75
59
|
readonly tenantId: import("drizzle-orm/mysql-core").MySqlVarCharBuilder<[string, ...string[]]>;
|
|
76
60
|
};
|
|
@@ -1,73 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `qarpeo/schema/pg` — PostgreSQL Drizzle ORM helpers, column spreads, and ID generators.
|
|
3
3
|
*
|
|
4
|
-
* Re-exports everything from `"drizzle-orm/pg-core"` and `"drizzle-orm"`, plus Qarpeo's
|
|
5
|
-
*
|
|
4
|
+
* Re-exports everything from `"drizzle-orm/pg-core"` and `"drizzle-orm"`, plus Qarpeo's primary key
|
|
5
|
+
* strategies (`pgid`, `pguuid`, `pgint`), timestamps (`pgtimestamps`, `pgCreatedAt`,
|
|
6
6
|
* `pgUpdatedAt`), soft delete (`pgsoftdelete`), multi-tenancy (`pgtenantid`), and type helpers
|
|
7
7
|
* (`SelectFrom`, `InsertInto`).
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* ```ts [db/pg-orders/schema/orders.ts]
|
|
11
|
+
* import { pgTable, pgid, pgtimestamps, varchar, integer } from "qarpeo/schema/pg"
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* export const orders = pgTable("orders", {
|
|
14
14
|
* ...pgid,
|
|
15
15
|
* status: varchar({ length: 32 }).notNull().default("pending"),
|
|
16
16
|
* amount: integer().notNull(),
|
|
17
17
|
* ...pgtimestamps,
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
20
|
*/
|
|
21
21
|
export * from "drizzle-orm/pg-core";
|
|
22
22
|
export * from "drizzle-orm";
|
|
23
23
|
export type { SelectedFields, SelectedFieldsFlat, SelectedFieldsOrdered, TableConfig, } from "drizzle-orm/pg-core";
|
|
24
24
|
export * from "./schema-shared";
|
|
25
|
-
/**
|
|
26
|
-
* PostgreSQL UUID v7 primary key — text column, auto-generated at insert.
|
|
27
|
-
*/
|
|
25
|
+
/** PostgreSQL UUID v7 primary key — text column, auto-generated at insert. */
|
|
28
26
|
export declare const pgid: {
|
|
29
27
|
readonly id: import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>>;
|
|
30
28
|
};
|
|
31
|
-
/**
|
|
32
|
-
* PostgreSQL native UUID v4 primary key — uses `uuid` column type with `defaultRandom()`.
|
|
33
|
-
*/
|
|
29
|
+
/** PostgreSQL native UUID v4 primary key — uses `uuid` column type with `defaultRandom()`. */
|
|
34
30
|
export declare const pguuid: {
|
|
35
31
|
readonly id: import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgUUIDBuilder>>;
|
|
36
32
|
};
|
|
37
|
-
/**
|
|
38
|
-
* PostgreSQL serial (auto-increment) primary key.
|
|
39
|
-
*/
|
|
33
|
+
/** PostgreSQL serial (auto-increment) primary key. */
|
|
40
34
|
export declare const pgint: {
|
|
41
35
|
readonly id: import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgSerialBuilder>;
|
|
42
36
|
};
|
|
43
|
-
/**
|
|
44
|
-
* PostgreSQL `createdAt` + `updatedAt` timestamp columns with timezone (`TIMESTAMPTZ`).
|
|
45
|
-
*/
|
|
37
|
+
/** PostgreSQL `createdAt` + `updatedAt` timestamp columns with timezone (`TIMESTAMPTZ`). */
|
|
46
38
|
export declare const pgtimestamps: {
|
|
47
39
|
readonly createdAt: import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>;
|
|
48
40
|
readonly updatedAt: import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>>;
|
|
49
41
|
};
|
|
50
|
-
/**
|
|
51
|
-
* Just `createdAt` for PostgreSQL — set once at insert, never updated.
|
|
52
|
-
*/
|
|
42
|
+
/** Just `createdAt` for PostgreSQL — set once at insert, never updated. */
|
|
53
43
|
export declare const pgCreatedAt: {
|
|
54
44
|
readonly createdAt: import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>;
|
|
55
45
|
};
|
|
56
|
-
/**
|
|
57
|
-
* Just `updatedAt` for PostgreSQL — set at insert and refreshed on every update.
|
|
58
|
-
*/
|
|
46
|
+
/** Just `updatedAt` for PostgreSQL — set at insert and refreshed on every update. */
|
|
59
47
|
export declare const pgUpdatedAt: {
|
|
60
48
|
readonly updatedAt: import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>>;
|
|
61
49
|
};
|
|
62
|
-
/**
|
|
63
|
-
* PostgreSQL soft-delete column — `deletedAt` nullable timestamptz.
|
|
64
|
-
*/
|
|
50
|
+
/** PostgreSQL soft-delete column — `deletedAt` nullable timestamptz. */
|
|
65
51
|
export declare const pgsoftdelete: {
|
|
66
52
|
readonly deletedAt: import("drizzle-orm/pg-core").PgTimestampBuilder;
|
|
67
53
|
};
|
|
68
|
-
/**
|
|
69
|
-
* PostgreSQL multi-tenant isolation column — `tenantId` nullable text.
|
|
70
|
-
*/
|
|
54
|
+
/** PostgreSQL multi-tenant isolation column — `tenantId` nullable text. */
|
|
71
55
|
export declare const pgtenantid: {
|
|
72
56
|
readonly tenantId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
|
|
73
57
|
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import type { InferInsertModel, InferSelectModel, Table } from "drizzle-orm";
|
|
2
2
|
/**
|
|
3
|
-
* Generates a **UUID v4** using the Web Crypto API (`crypto.randomUUID()`).
|
|
4
|
-
*
|
|
3
|
+
* Generates a **UUID v4** using the Web Crypto API (`crypto.randomUUID()`). Fully random 128-bit
|
|
4
|
+
* identifier. Available natively in Cloudflare Workers, Node 19+, Deno, browsers.
|
|
5
5
|
*
|
|
6
|
-
* @example
|
|
6
|
+
* @example
|
|
7
|
+
* ;`"550e8400-e29b-41d4-a716-446655440000"`
|
|
7
8
|
*/
|
|
8
9
|
export declare function generateUUID(): string;
|
|
9
10
|
/**
|
|
10
11
|
* Generates a **UUID v7** (RFC 9562) — a time-ordered, lexicographically sortable UUID.
|
|
11
12
|
*
|
|
12
13
|
* The first 48 bits encode the current Unix timestamp in milliseconds so records sort
|
|
13
|
-
* chronologically by ID alone. Sub-millisecond generation uses a monotonic counter
|
|
14
|
-
*
|
|
14
|
+
* chronologically by ID alone. Sub-millisecond generation uses a monotonic counter per RFC 9562
|
|
15
|
+
* §6.2 Method 1 to avoid same-millisecond collisions.
|
|
15
16
|
*
|
|
16
17
|
* **Why prefer UUID v7 over v4 for database primary keys:**
|
|
18
|
+
*
|
|
17
19
|
* - New rows are always appended to the end of the B-tree index → no page splits → faster inserts
|
|
18
20
|
* - `ORDER BY id` naturally returns records in insertion order → no extra `ORDER BY created_at`
|
|
19
21
|
* - Works in distributed edge Workers without a central counter
|
|
@@ -25,12 +27,13 @@ export declare function generateUUID(): string;
|
|
|
25
27
|
*
|
|
26
28
|
* Zero external dependencies — uses only `Date.now()` and `crypto.getRandomValues()`.
|
|
27
29
|
*
|
|
28
|
-
* @example
|
|
30
|
+
* @example
|
|
31
|
+
* ;`"01936c0a-5e0c-7b3a-8f9d-2e1c4a6b8d0f"`
|
|
29
32
|
*/
|
|
30
33
|
export declare function generateUUIDv7(): string;
|
|
31
34
|
/**
|
|
32
|
-
* Default ID generator — produces a **UUID v7** (time-ordered).
|
|
33
|
-
*
|
|
35
|
+
* Default ID generator — produces a **UUID v7** (time-ordered). Recommended for all new Qarpeo
|
|
36
|
+
* tables.
|
|
34
37
|
*
|
|
35
38
|
* Override with `generateUUID()` for UUID v4 or use `sqlint`/`pgint`/`msint` for auto-increment.
|
|
36
39
|
*/
|
|
@@ -39,19 +42,19 @@ export declare const generateId: typeof generateUUIDv7;
|
|
|
39
42
|
* Infer the TypeScript type of a full row returned from a SELECT query.
|
|
40
43
|
*
|
|
41
44
|
* @example
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { posts } from "./schema"
|
|
47
|
+
* type Post = SelectFrom<typeof posts>
|
|
48
|
+
* ```
|
|
46
49
|
*/
|
|
47
50
|
export type SelectFrom<T extends Table> = InferSelectModel<T>;
|
|
48
51
|
/**
|
|
49
|
-
* Infer the TypeScript type of the data shape required for an INSERT.
|
|
50
|
-
*
|
|
52
|
+
* Infer the TypeScript type of the data shape required for an INSERT. Optional fields (those with
|
|
53
|
+
* `$defaultFn`) become optional in the type.
|
|
51
54
|
*
|
|
52
55
|
* @example
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
+
* ```ts
|
|
57
|
+
* type NewPost = InsertInto<typeof posts>
|
|
58
|
+
* ```
|
|
56
59
|
*/
|
|
57
60
|
export type InsertInto<T extends Table> = InferInsertModel<T>;
|