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
|
@@ -4,9 +4,9 @@ export { timingSafeEqualString };
|
|
|
4
4
|
* Generates a random Base32 secret for TOTP registration.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const secret = generateBase32Secret() // e.g. "JBSWY3DPEHPK3PXP"
|
|
9
|
+
* ```
|
|
10
10
|
*/
|
|
11
11
|
export declare function generateBase32Secret(length?: number): string;
|
|
12
12
|
export declare function base32ToBytes(base32: string): Uint8Array;
|
|
@@ -14,18 +14,18 @@ export declare function base32ToBytes(base32: string): Uint8Array;
|
|
|
14
14
|
* Generates the current 6-digit TOTP code for a secret.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* const code = await generateTOTPCode(secret) // "123456"
|
|
19
|
+
* ```
|
|
20
20
|
*/
|
|
21
21
|
export declare function generateTOTPCode(secret: string, timeStep?: number): Promise<string>;
|
|
22
22
|
/**
|
|
23
23
|
* Validates a 6-digit TOTP code with +/- 1 step drift tolerance (90-second validity).
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* const isValid = await verifyTOTPCode(secret, "123456")
|
|
28
|
+
* ```
|
|
29
29
|
*/
|
|
30
30
|
export declare function verifyTOTPCode(secret: string, userCode: string, timeStep?: number): Promise<boolean>;
|
|
31
31
|
export declare function hashBackupCode(code: string): Promise<string>;
|
|
@@ -33,9 +33,9 @@ export declare function hashBackupCode(code: string): Promise<string>;
|
|
|
33
33
|
* Generates cleartext and hashed backup codes for account recovery.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* const { rawCodes, hashedCodes } = await generateBackupCodes(8)
|
|
38
|
+
* ```
|
|
39
39
|
*/
|
|
40
40
|
export declare function generateBackupCodes(count?: number): Promise<{
|
|
41
41
|
rawCodes: string[];
|
|
@@ -45,9 +45,9 @@ export declare function generateBackupCodes(count?: number): Promise<{
|
|
|
45
45
|
* Verifies a cleartext backup code against a list of SHA-256 hashed codes in constant time.
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* const { valid, matchingHash } = await verifyBackupCode("ABCD1234", storedHashes)
|
|
50
|
+
* ```
|
|
51
51
|
*/
|
|
52
52
|
export declare function verifyBackupCode(rawCode: string, hashedCodes: string[]): Promise<{
|
|
53
53
|
valid: boolean;
|
|
@@ -65,9 +65,9 @@ export declare function buildOTPAuthURL(options: {
|
|
|
65
65
|
* rather than an SVG so authenticator apps always receive a clean, scannable code.
|
|
66
66
|
*
|
|
67
67
|
* @example
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
68
|
+
* ```ts
|
|
69
|
+
* const url = generateTOTPUrl({ issuer: "My App", accountName: "user@example.com", secret })
|
|
70
|
+
* ```
|
|
71
71
|
*/
|
|
72
72
|
export declare function generateTOTPUrl(options: {
|
|
73
73
|
issuer: string;
|
|
@@ -62,10 +62,10 @@ export interface UseTrackerReturn {
|
|
|
62
62
|
* `trackPageview` / `trackEvent` multiple times without passing the event every time.
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* const tracker = useTracker(event)
|
|
67
|
+
* tracker.trackPageview()
|
|
68
|
+
* tracker.trackEvent("signup", { meta: { plan: "pro" } })
|
|
69
|
+
* ```
|
|
70
70
|
*/
|
|
71
71
|
export declare function useTracker(event: RequestEvent): UseTrackerReturn;
|
|
@@ -12,20 +12,20 @@ export interface TurnstileVerificationResult {
|
|
|
12
12
|
* NUXT_TURNSTILE_SECRET_KEY, TURNSTILE_SECRET_KEY, or qarpeo.auth.turnstile.secretKey.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const result = await verifyTurnstileToken(event, token)
|
|
17
|
+
* if (!result.success) {
|
|
18
|
+
* // verification failed
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare function verifyTurnstileToken(event: RequestEvent, token?: string, remoteIp?: string): Promise<TurnstileVerificationResult>;
|
|
23
23
|
/**
|
|
24
24
|
* Enforces Cloudflare Turnstile verification. Throws 403 Forbidden if invalid.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* await requireTurnstile(event)
|
|
29
|
+
* ```
|
|
30
30
|
*/
|
|
31
31
|
export declare function requireTurnstile(event: RequestEvent, token?: string): Promise<void>;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns true if the given string is a valid, safe targetUrn.
|
|
3
|
-
*
|
|
2
|
+
* Returns true if the given string is a valid, safe targetUrn. Does NOT throw — callers decide how
|
|
3
|
+
* to surface the error.
|
|
4
4
|
*/
|
|
5
5
|
export declare function isValidTargetUrn(urn: string): boolean;
|
|
6
6
|
/**
|
|
7
|
-
* Validates that a targetUrn is a safe, structured identifier.
|
|
8
|
-
*
|
|
7
|
+
* Validates that a targetUrn is a safe, structured identifier. Throws an HTTP 400 createError if
|
|
8
|
+
* invalid.
|
|
9
9
|
*/
|
|
10
10
|
export declare function validateTargetUrn(urn: string): void;
|
|
11
|
-
/**
|
|
12
|
-
* Throws a plain Error if the targetUrn is invalid.
|
|
13
|
-
* Convenient in test or non-HTTP contexts.
|
|
14
|
-
*/
|
|
11
|
+
/** Throws a plain Error if the targetUrn is invalid. Convenient in test or non-HTTP contexts. */
|
|
15
12
|
export declare function assertValidTargetUrn(urn: string): void;
|
|
@@ -20,6 +20,7 @@ export declare function setWorkflowFastForward(enabled: boolean): void;
|
|
|
20
20
|
* Parses human-readable duration strings into milliseconds.
|
|
21
21
|
*
|
|
22
22
|
* Supported formats:
|
|
23
|
+
*
|
|
23
24
|
* - `"500ms"`
|
|
24
25
|
* - `"5s"`, `"5 sec"`, `"5 seconds"`
|
|
25
26
|
* - `"2m"`, `"2 min"`, `"2 minutes"`
|
|
@@ -33,32 +34,32 @@ export interface StepEngineOptions {
|
|
|
33
34
|
fastForward?: boolean;
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
|
-
* Creates a durable `WorkflowStep` execution engine.
|
|
37
|
-
*
|
|
37
|
+
* Creates a durable `WorkflowStep` execution engine. Records step executions and caches values to
|
|
38
|
+
* support replay semantics.
|
|
38
39
|
*/
|
|
39
40
|
export declare function createStepEngine(options: StepEngineOptions): WorkflowStep;
|
|
40
41
|
/**
|
|
41
42
|
* Defines a durable Cloudflare Workflow with step replay, sleep, and automatic retries.
|
|
42
43
|
*
|
|
43
44
|
* @example
|
|
44
|
-
*
|
|
45
|
-
*
|
|
45
|
+
* ```ts [server/workflows/onboarding.ts]
|
|
46
|
+
* export default defineWorkflow({
|
|
46
47
|
* name: "onboarding",
|
|
47
48
|
* async run(event, step) {
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* const user = await step.do("create-user", async () => {
|
|
50
|
+
* return await createUser(event.payload.email)
|
|
51
|
+
* })
|
|
51
52
|
*
|
|
52
|
-
*
|
|
53
|
+
* await step.sleep("wait-for-email", "1 day")
|
|
53
54
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
55
|
+
* await step.do("send-survey", {
|
|
56
|
+
* retries: { limit: 3, delay: "5 seconds", backoff: "exponential" }
|
|
57
|
+
* }, async () => {
|
|
58
|
+
* await sendSurveyEmail(user.id)
|
|
59
|
+
* })
|
|
59
60
|
* }
|
|
60
|
-
*
|
|
61
|
-
*
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
62
63
|
*/
|
|
63
64
|
export declare function defineWorkflow<TParams = any, TOutput = any>(defOrRun: WorkflowDefinition<TParams, TOutput> | ((event: WorkflowEvent<TParams>, step: WorkflowStep) => Promise<TOutput> | TOutput)): WorkflowDefinition<TParams, TOutput>;
|
|
64
65
|
/** Returns the raw Cloudflare Workflow binding from the active environment. */
|
|
@@ -66,27 +67,25 @@ export declare function getWorkflowBinding(bindingName: string, event?: CFEvent)
|
|
|
66
67
|
/**
|
|
67
68
|
* Resolves a typed `WorkflowClient` to trigger, query, pause, resume, or restart a workflow.
|
|
68
69
|
*
|
|
69
|
-
* @param name Workflow name or Cloudflare binding name
|
|
70
|
-
* @param event Optional CFEvent context
|
|
71
|
-
*
|
|
72
70
|
* @example
|
|
73
|
-
*
|
|
74
|
-
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* const onboarding = useWorkflow("onboarding")
|
|
73
|
+
*
|
|
74
|
+
* // Trigger an instance
|
|
75
|
+
* const instance = await onboarding.create({
|
|
76
|
+
* id: "user-123-welcome",
|
|
77
|
+
* params: { email: "user@example.com" },
|
|
78
|
+
* })
|
|
75
79
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* params: { email: "user@example.com" }
|
|
80
|
-
* })
|
|
80
|
+
* // Check status
|
|
81
|
+
* const status = await onboarding.status(instance.id)
|
|
82
|
+
* ```
|
|
81
83
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* ```
|
|
84
|
+
* @param name Workflow name or Cloudflare binding name
|
|
85
|
+
* @param event Optional CFEvent context
|
|
85
86
|
*/
|
|
86
87
|
export declare function useWorkflow<TParams = any, TOutput = any>(name: string, event?: CFEvent): WorkflowClient<TParams, TOutput>;
|
|
87
|
-
/**
|
|
88
|
-
* Creates a `WorkflowClient` for a workflow name or binding.
|
|
89
|
-
*/
|
|
88
|
+
/** Creates a `WorkflowClient` for a workflow name or binding. */
|
|
90
89
|
export declare function createWorkflowClient<TParams = any, TOutput = any>(name: string, event?: CFEvent): WorkflowClient<TParams, TOutput>;
|
|
91
90
|
/** Clear all stored workflow instances and registry definitions (for test teardown). */
|
|
92
91
|
export declare function clearWorkflowRegistry(): void;
|
|
@@ -83,9 +83,7 @@ export function createStepEngine(options) {
|
|
|
83
83
|
new Promise(
|
|
84
84
|
(_, reject) => setTimeout(
|
|
85
85
|
() => reject(
|
|
86
|
-
new Error(
|
|
87
|
-
`[qarpeo:workflows] Step "${name}" timed out after ${timeoutMs}ms`
|
|
88
|
-
)
|
|
86
|
+
new Error(`[qarpeo:workflows] Step "${name}" timed out after ${timeoutMs}ms`)
|
|
89
87
|
),
|
|
90
88
|
timeoutMs
|
|
91
89
|
)
|
|
@@ -105,7 +103,7 @@ export function createStepEngine(options) {
|
|
|
105
103
|
if (backoff === "linear") {
|
|
106
104
|
delayMs = initialDelay * attempt;
|
|
107
105
|
} else if (backoff === "exponential") {
|
|
108
|
-
delayMs = initialDelay *
|
|
106
|
+
delayMs = initialDelay * 2 ** (attempt - 1);
|
|
109
107
|
}
|
|
110
108
|
if (!isFastForward && delayMs > 0) {
|
|
111
109
|
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
package/dist/runtime/server.d.ts
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
* })
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
19
|
-
* NOTE: test-utils are intentionally NOT exported here to keep production bundles lean.
|
|
20
|
-
*
|
|
19
|
+
* NOTE: test-utils are intentionally NOT exported here to keep production bundles lean. Import from
|
|
20
|
+
* "qarpeo/test-utils" explicitly in test files only.
|
|
21
21
|
*/
|
|
22
22
|
export * from "./types/index";
|
|
23
23
|
export * from "./bindings";
|
|
@@ -13,19 +13,19 @@ export declare function getServiceBinding(serviceName: string, event?: CFEvent):
|
|
|
13
13
|
* HTTP-style fetch/JSON requests and Cloudflare Workers RPC direct method calls.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* interface AuthService {
|
|
18
|
+
* verifyToken(token: string): Promise<{ userId: string }>
|
|
19
|
+
* }
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* const auth = useServiceBinding<AuthService>("AUTH_SERVICE")
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* // RPC style (zero HTTP serialization overhead)
|
|
24
|
+
* const user = await auth.rpc.verifyToken("jwt-xyz")
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* // HTTP style
|
|
27
|
+
* const profile = await auth.get("/api/profile", { userId: user.userId })
|
|
28
|
+
* ```
|
|
29
29
|
*/
|
|
30
30
|
export declare function createServiceClient<TRpc = Record<string, any>>(serviceName: string, event?: CFEvent): QarpeoServiceClient<TRpc>;
|
|
31
31
|
/**
|
|
@@ -168,18 +168,18 @@ export declare function createMockQueue<T = any>(queueName?: string): MockQueue<
|
|
|
168
168
|
* mock bindings onto `getCloudflareEnv()`.
|
|
169
169
|
*
|
|
170
170
|
* @example
|
|
171
|
-
*
|
|
172
|
-
*
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { createEdgeTestContext } from "qarpeo/test-utils"
|
|
173
173
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
174
|
+
* describe("My Edge Route", () => {
|
|
175
|
+
* const edge = createEdgeTestContext()
|
|
176
|
+
* afterEach(() => edge.cleanup())
|
|
177
177
|
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
178
|
+
* it("interacts with D1 and KV", async () => {
|
|
179
|
+
* await edge.kv.put("user:1", { name: "Alice" })
|
|
180
|
+
* expect(await edge.kv.get("user:1", "json")).toEqual({ name: "Alice" })
|
|
181
|
+
* })
|
|
181
182
|
* })
|
|
182
|
-
*
|
|
183
|
-
* ```
|
|
183
|
+
* ```
|
|
184
184
|
*/
|
|
185
185
|
export declare function createEdgeTestContext(options?: EdgeTestContextOptions): EdgeTestContext;
|
|
@@ -127,7 +127,11 @@ export function createMockD1Database() {
|
|
|
127
127
|
async all() {
|
|
128
128
|
sessionQueries.push(query);
|
|
129
129
|
queries.push(query);
|
|
130
|
-
return {
|
|
130
|
+
return {
|
|
131
|
+
results: [],
|
|
132
|
+
success: true,
|
|
133
|
+
meta: { duration: 1, served_by: "d1-replica-session-mock" }
|
|
134
|
+
};
|
|
131
135
|
},
|
|
132
136
|
async run() {
|
|
133
137
|
sessionQueries.push(query);
|
|
@@ -238,7 +242,10 @@ export function createMockR2Bucket() {
|
|
|
238
242
|
customMetadata: item.customMetadata || {},
|
|
239
243
|
uploaded: item.uploaded || /* @__PURE__ */ new Date(),
|
|
240
244
|
async arrayBuffer() {
|
|
241
|
-
return item.data?.buffer ? item.data.buffer.slice(
|
|
245
|
+
return item.data?.buffer ? item.data.buffer.slice(
|
|
246
|
+
item.data.byteOffset,
|
|
247
|
+
item.data.byteOffset + item.data.byteLength
|
|
248
|
+
) : new ArrayBuffer(0);
|
|
242
249
|
},
|
|
243
250
|
async text() {
|
|
244
251
|
return new TextDecoder().decode(item.data || new Uint8Array(0));
|
|
@@ -59,22 +59,22 @@ export interface QarpeoAI {
|
|
|
59
59
|
/** Generate complete text from a prompt or chat messages. */
|
|
60
60
|
generateText(options: StreamTextOptions): Promise<string>;
|
|
61
61
|
/**
|
|
62
|
-
* Generate a structured object from a prompt using Cloudflare Workers AI
|
|
63
|
-
*
|
|
62
|
+
* Generate a structured object from a prompt using Cloudflare Workers AI constrained JSON schema
|
|
63
|
+
* decoding and validation.
|
|
64
64
|
*
|
|
65
65
|
* @example
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
66
|
+
* ```ts
|
|
67
|
+
* import { z } from "zod"
|
|
68
|
+
* const user = await ai.generateObject({
|
|
69
|
+
* prompt: "Extract: Jane Doe, 32, likes reading and tennis",
|
|
70
|
+
* schema: z.object({
|
|
71
|
+
* name: z.string(),
|
|
72
|
+
* age: z.number(),
|
|
73
|
+
* hobbies: z.array(z.string()),
|
|
74
|
+
* }),
|
|
75
|
+
* })
|
|
76
|
+
* console.log(user.object.name) // "Jane Doe"
|
|
77
|
+
* ```
|
|
78
78
|
*/
|
|
79
79
|
generateObject<T = any>(options: GenerateObjectOptions<T>): Promise<GenerateObjectResult<T>>;
|
|
80
80
|
/** Stream text generation as a Server-Sent Events response. */
|
|
@@ -45,7 +45,8 @@ export interface D1Database {
|
|
|
45
45
|
/**
|
|
46
46
|
* Creates a session for read replication consistency and routing.
|
|
47
47
|
*
|
|
48
|
-
* @param bookmark Optional bookmark token or routing constraint ("first-unconstrained" |
|
|
48
|
+
* @param bookmark Optional bookmark token or routing constraint ("first-unconstrained" |
|
|
49
|
+
* "first-primary")
|
|
49
50
|
*/
|
|
50
51
|
withSession?(bookmark?: string): D1DatabaseSession;
|
|
51
52
|
}
|
|
@@ -63,24 +64,18 @@ export interface QarpeoDB extends D1Database {
|
|
|
63
64
|
export interface D1ReplicaOptions {
|
|
64
65
|
/**
|
|
65
66
|
* Route reads to Cloudflare D1 Read Replicas:
|
|
67
|
+
*
|
|
66
68
|
* - `true`: routes to nearest replica using "first-unconstrained" session
|
|
67
69
|
* - `"first-unconstrained"`: reads from nearest replica immediately
|
|
68
70
|
* - `"first-primary"`: first query routed to primary, subsequent reads routed to replica
|
|
69
71
|
* - `string`: bookmark token string to guarantee sequential consistency
|
|
70
72
|
*/
|
|
71
73
|
replica?: boolean | "first-unconstrained" | "first-primary" | string;
|
|
72
|
-
/**
|
|
73
|
-
* Cloudflare D1 session bookmark token.
|
|
74
|
-
*/
|
|
74
|
+
/** Cloudflare D1 session bookmark token. */
|
|
75
75
|
bookmark?: string;
|
|
76
|
-
/**
|
|
77
|
-
* Automatically fallback to primary database if replica read fails.
|
|
78
|
-
* Default: `true`.
|
|
79
|
-
*/
|
|
76
|
+
/** Automatically fallback to primary database if replica read fails. Default: `true`. */
|
|
80
77
|
fallbackToPrimary?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Optional Cloudflare event context.
|
|
83
|
-
*/
|
|
78
|
+
/** Optional Cloudflare event context. */
|
|
84
79
|
event?: CFEvent;
|
|
85
80
|
}
|
|
86
81
|
export interface D1DatabaseOptions extends D1ReplicaOptions {
|
|
@@ -43,9 +43,7 @@ export interface SqlStorage {
|
|
|
43
43
|
readonly databaseSize: number;
|
|
44
44
|
}
|
|
45
45
|
export interface DurableObjectStorage {
|
|
46
|
-
/**
|
|
47
|
-
* Zero-latency embedded SQLite database interface directly inside this Durable Object isolate.
|
|
48
|
-
*/
|
|
46
|
+
/** Zero-latency embedded SQLite database interface directly inside this Durable Object isolate. */
|
|
49
47
|
readonly sql: SqlStorage;
|
|
50
48
|
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
51
49
|
get<T = unknown>(keys: string[]): Promise<Map<string, T>>;
|
|
@@ -78,9 +76,7 @@ export interface DurableObjectState {
|
|
|
78
76
|
getWebSocketAutoResponse?(): unknown;
|
|
79
77
|
getWebSocketAutoResponseTimestamp?(ws: WebSocket): Date | null;
|
|
80
78
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Execution context provided to object-literal Durable Object methods via `this`.
|
|
83
|
-
*/
|
|
79
|
+
/** Execution context provided to object-literal Durable Object methods via `this`. */
|
|
84
80
|
export interface DurableObjectContext {
|
|
85
81
|
readonly state: DurableObjectState;
|
|
86
82
|
readonly storage: DurableObjectStorage;
|
|
@@ -92,8 +88,8 @@ export interface DurableObjectContext {
|
|
|
92
88
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
93
89
|
}
|
|
94
90
|
/**
|
|
95
|
-
* Modern typed RPC Stub for a Durable Object.
|
|
96
|
-
*
|
|
91
|
+
* Modern typed RPC Stub for a Durable Object. Any method defined on the Durable Object can be
|
|
92
|
+
* directly called as an asynchronous RPC call.
|
|
97
93
|
*/
|
|
98
94
|
export type DurableObjectRPCStub<T = any> = DurableObjectStub & {
|
|
99
95
|
[K in keyof T]: T[K] extends (...args: infer P) => infer R ? (...args: P) => Promise<Awaited<R>> : T[K];
|
|
@@ -64,9 +64,7 @@ export interface QarpeoEmail {
|
|
|
64
64
|
/** Access the raw underlying Cloudflare `send_email` binding. */
|
|
65
65
|
raw(bindingName?: string): SendEmailBinding;
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Inbound email message received by Cloudflare Email Workers.
|
|
69
|
-
*/
|
|
67
|
+
/** Inbound email message received by Cloudflare Email Workers. */
|
|
70
68
|
export interface InboundEmailMessage {
|
|
71
69
|
/** The envelope sender address. */
|
|
72
70
|
from: string;
|
|
@@ -89,9 +87,7 @@ export interface InboundEmailMessage {
|
|
|
89
87
|
/** Helper to parse a JSON body if the incoming email contains structured JSON. */
|
|
90
88
|
json<T = any>(): Promise<T>;
|
|
91
89
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Context object passed to defineEmailHandler.
|
|
94
|
-
*/
|
|
90
|
+
/** Context object passed to defineEmailHandler. */
|
|
95
91
|
export interface InboundEmailContext {
|
|
96
92
|
/** The inbound email message. */
|
|
97
93
|
message: InboundEmailMessage;
|
|
@@ -106,7 +102,5 @@ export interface InboundEmailContext {
|
|
|
106
102
|
/** Cloudflare worker execution context (e.g. waitUntil). */
|
|
107
103
|
context?: any;
|
|
108
104
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Handler function for incoming Cloudflare emails.
|
|
111
|
-
*/
|
|
105
|
+
/** Handler function for incoming Cloudflare emails. */
|
|
112
106
|
export type InboundEmailHandler = (event: InboundEmailContext) => Promise<void> | void;
|
|
@@ -147,16 +147,16 @@ export interface QarpeoKV {
|
|
|
147
147
|
*/
|
|
148
148
|
clear(prefix?: string): Promise<void>;
|
|
149
149
|
/**
|
|
150
|
-
* Create a scoped, typed KV map for managing collections sharing a common prefix (Void `kv.map`
|
|
151
|
-
* Automatically prefixes keys on write/read and strips prefixes on listing.
|
|
150
|
+
* Create a scoped, typed KV map for managing collections sharing a common prefix (Void `kv.map`
|
|
151
|
+
* compatibility). Automatically prefixes keys on write/read and strips prefixes on listing.
|
|
152
152
|
*
|
|
153
153
|
* @example
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
154
|
+
* ```ts
|
|
155
|
+
* const sessions = kv.map<Session>("sessions")
|
|
156
|
+
* await sessions.put("abc", { userId: 1 }, { ttl: 3600 })
|
|
157
|
+
* const session = await sessions.get("abc")
|
|
158
|
+
* await sessions.delete("abc")
|
|
159
|
+
* ```
|
|
160
160
|
*/
|
|
161
161
|
map<T = unknown>(prefix: string): QarpeoKVMap<T>;
|
|
162
162
|
/** Alias for get (Unstorage / NuxtHub compatibility) */
|
|
@@ -184,8 +184,8 @@ export interface QarpeoKV {
|
|
|
184
184
|
raw(bindingName?: string): KVNamespace;
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
|
-
* Scoped, typed KV map for managing prefixed collections (Void `kv.map` compatibility).
|
|
188
|
-
*
|
|
187
|
+
* Scoped, typed KV map for managing prefixed collections (Void `kv.map` compatibility). Keys are
|
|
188
|
+
* automatically prefixed upon write/read and stripped upon listing.
|
|
189
189
|
*/
|
|
190
190
|
export interface QarpeoKVMap<T = unknown> {
|
|
191
191
|
/** The normalized namespace prefix for this map */
|
|
@@ -203,21 +203,15 @@ export interface QarpeoKVMap<T = unknown> {
|
|
|
203
203
|
/** Alias for `delete` */
|
|
204
204
|
del(key: string): Promise<boolean>;
|
|
205
205
|
/**
|
|
206
|
-
* List all keys within this map. Prefix is automatically stripped from returned keys.
|
|
207
|
-
*
|
|
206
|
+
* List all keys within this map. Prefix is automatically stripped from returned keys. Pass
|
|
207
|
+
* `subPrefix` to filter further within this namespace.
|
|
208
208
|
*/
|
|
209
209
|
keys(subPrefix?: string): Promise<string[]>;
|
|
210
|
-
/**
|
|
211
|
-
* Paginated list within this map. Returned key names have the map prefix stripped.
|
|
212
|
-
*/
|
|
210
|
+
/** Paginated list within this map. Returned key names have the map prefix stripped. */
|
|
213
211
|
list(options?: KVListOptions): Promise<KVNamespaceListResult<unknown>>;
|
|
214
|
-
/**
|
|
215
|
-
* Clear all keys in this map namespace (or all keys matching an optional subPrefix).
|
|
216
|
-
*/
|
|
212
|
+
/** Clear all keys in this map namespace (or all keys matching an optional subPrefix). */
|
|
217
213
|
clear(subPrefix?: string): Promise<void>;
|
|
218
|
-
/**
|
|
219
|
-
* Get a value together with its metadata in a single round-trip.
|
|
220
|
-
*/
|
|
214
|
+
/** Get a value together with its metadata in a single round-trip. */
|
|
221
215
|
getWithMetadata<M = unknown>(key: string, options?: KVGetOptions): Promise<{
|
|
222
216
|
value: T | null;
|
|
223
217
|
metadata: M | null;
|
|
@@ -123,8 +123,8 @@ export interface QarpeoBlob {
|
|
|
123
123
|
delete(pathname: string | string[]): Promise<void>;
|
|
124
124
|
list(options?: R2ListOptions): Promise<BlobListResult>;
|
|
125
125
|
/**
|
|
126
|
-
* Duplicates an object in R2 without downloading and re-uploading through the client.
|
|
127
|
-
*
|
|
126
|
+
* Duplicates an object in R2 without downloading and re-uploading through the client. Preserves
|
|
127
|
+
* existing metadata unless overridden.
|
|
128
128
|
*/
|
|
129
129
|
copy(sourceKey: string, destinationKey: string, options?: BlobCopyOptions): Promise<R2Object & {
|
|
130
130
|
pathname: string;
|
|
@@ -145,9 +145,9 @@ export interface QarpeoBlob {
|
|
|
145
145
|
createMultipartUpload(pathname: string, options?: R2PutOptions): Promise<R2MultipartUpload>;
|
|
146
146
|
resumeMultipartUpload(pathname: string, uploadId: string): R2MultipartUpload;
|
|
147
147
|
/**
|
|
148
|
-
* Generates a true R2 presigned URL for direct client-to-R2 uploads.
|
|
149
|
-
*
|
|
150
|
-
*
|
|
148
|
+
* Generates a true R2 presigned URL for direct client-to-R2 uploads. The client PUTs directly to
|
|
149
|
+
* R2's CDN endpoint — no data passes through the Worker. Supports files up to 5 TB (vs the Worker
|
|
150
|
+
* 100 MB proxy limit).
|
|
151
151
|
*
|
|
152
152
|
* @param pathname Object key / path in R2
|
|
153
153
|
* @param options.expiresIn Duration string ("15 minutes", "1h") or seconds (default: 900)
|
|
@@ -209,6 +209,13 @@ export interface StoreVendorMetrics {
|
|
|
209
209
|
itemsSoldCount: number;
|
|
210
210
|
totalProducts: number;
|
|
211
211
|
}
|
|
212
|
+
export interface StoreVendorSummary {
|
|
213
|
+
id: string;
|
|
214
|
+
name: string;
|
|
215
|
+
productCount: number;
|
|
216
|
+
logoUrl?: string | null;
|
|
217
|
+
description?: string | null;
|
|
218
|
+
}
|
|
212
219
|
export interface StoreQueryDiscountsOptions {
|
|
213
220
|
tenantId?: string;
|
|
214
221
|
isActive?: boolean;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript types for Cloudflare Workflows in Qarpeo.
|
|
3
|
-
*/
|
|
1
|
+
/** TypeScript types for Cloudflare Workflows in Qarpeo. */
|
|
4
2
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
5
3
|
export interface WorkflowStepRetryConfig {
|
|
6
4
|
/** Maximum number of retry attempts (default: 3). */
|
|
@@ -18,8 +16,8 @@ export interface WorkflowStepConfig {
|
|
|
18
16
|
}
|
|
19
17
|
export interface WorkflowStep {
|
|
20
18
|
/**
|
|
21
|
-
* Execute a durable step. The step's return value is saved to durable storage.
|
|
22
|
-
*
|
|
19
|
+
* Execute a durable step. The step's return value is saved to durable storage. If the workflow
|
|
20
|
+
* restarts or replays, the cached result is returned without re-running the callback.
|
|
23
21
|
*/
|
|
24
22
|
do<T>(name: string, callback: () => Promise<T> | T): Promise<T>;
|
|
25
23
|
do<T>(name: string, config: WorkflowStepConfig, callback: () => Promise<T> | T): Promise<T>;
|
|
@@ -27,7 +25,8 @@ export interface WorkflowStep {
|
|
|
27
25
|
* Puts the workflow to sleep for a specified duration without consuming CPU.
|
|
28
26
|
*
|
|
29
27
|
* @param name Name of the sleep step for observability and replay
|
|
30
|
-
* @param duration Duration string ("5 seconds", "10 minutes", "2 hours", "3 days") or
|
|
28
|
+
* @param duration Duration string ("5 seconds", "10 minutes", "2 hours", "3 days") or
|
|
29
|
+
* milliseconds
|
|
31
30
|
*/
|
|
32
31
|
sleep(name: string, duration: string | number): Promise<void>;
|
|
33
32
|
/**
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `qarpeo/workflows` — Re-exports of Cloudflare Workflows definitions and Step Engine.
|
|
3
|
-
*/
|
|
1
|
+
/** `qarpeo/workflows` — Re-exports of Cloudflare Workflows definitions and Step Engine. */
|
|
4
2
|
export * from "./types/workflows";
|
|
5
3
|
export * from "./server/utils/workflows";
|