qarpeo 0.1.28 → 0.1.30

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 (50) hide show
  1. package/dist/chunks/wrangler.mjs +1 -1
  2. package/dist/runtime/bindings.mjs +1 -1
  3. package/dist/runtime/server/plugins/dev-proxy.mjs +0 -1
  4. package/dist/runtime/server/plugins/env.d.ts +2 -2
  5. package/dist/runtime/server/plugins/env.mjs +1 -10
  6. package/dist/runtime/server/routes/__qarpeo/analytics/events.get.mjs +2 -2
  7. package/dist/runtime/server/routes/__qarpeo/analytics/summary.get.mjs +2 -2
  8. package/dist/runtime/server/routes/__qarpeo/blob/files.get.mjs +2 -2
  9. package/dist/runtime/server/routes/__qarpeo/overview/health.get.mjs +2 -2
  10. package/dist/runtime/server/routes/__qarpeo/overview.get.mjs +3 -8
  11. package/dist/runtime/server/routes/__qarpeo/settings.get.mjs +2 -8
  12. package/dist/runtime/server/routes/analytics/events.get.mjs +2 -2
  13. package/dist/runtime/server/routes/analytics/pageviews.get.mjs +2 -2
  14. package/dist/runtime/server/routes/analytics/summary.get.mjs +2 -2
  15. package/dist/runtime/server/routes/auth/magic-link/verify.get.mjs +13 -10
  16. package/dist/runtime/server/routes/auth/sso/login.get.mjs +2 -1
  17. package/dist/runtime/server/routes/auth/sso/oidc/callback.get.mjs +2 -1
  18. package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +18 -29
  19. package/dist/runtime/server/routes/cms/preview/disable.get.mjs +2 -1
  20. package/dist/runtime/server/routes/cms/preview/enable.get.mjs +3 -1
  21. package/dist/runtime/server/routes/cms/webhooks/[provider].post.mjs +2 -1
  22. package/dist/runtime/server/routes/notifications/push/subscribe.post.mjs +10 -5
  23. package/dist/runtime/server/routes/notifications/push/unsubscribe.post.mjs +6 -5
  24. package/dist/runtime/server/routes/payments/cancel.post.mjs +6 -5
  25. package/dist/runtime/server/routes/payments/change-plan.post.mjs +7 -8
  26. package/dist/runtime/server/routes/payments/checkout.post.mjs +13 -2
  27. package/dist/runtime/server/routes/payments/portal.post.mjs +6 -2
  28. package/dist/runtime/server/utils/analytics-query.mjs +15 -7
  29. package/dist/runtime/server/utils/auth.mjs +3 -2
  30. package/dist/runtime/server/utils/cms.mjs +3 -3
  31. package/dist/runtime/server/utils/config.d.ts +1 -1
  32. package/dist/runtime/server/utils/config.mjs +28 -2
  33. package/dist/runtime/server/utils/crypto.d.ts +7 -1
  34. package/dist/runtime/server/utils/crypto.mjs +29 -9
  35. package/dist/runtime/server/utils/domains.mjs +8 -4
  36. package/dist/runtime/server/utils/notifications.mjs +6 -4
  37. package/dist/runtime/server/utils/organization.d.ts +2 -1
  38. package/dist/runtime/server/utils/organization.mjs +18 -11
  39. package/dist/runtime/server/utils/passwordless.mjs +37 -15
  40. package/dist/runtime/server/utils/payments.mjs +7 -7
  41. package/dist/runtime/server/utils/ratelimit.mjs +34 -11
  42. package/dist/runtime/server/utils/sso.mjs +59 -7
  43. package/dist/runtime/server/utils/string.d.ts +11 -0
  44. package/dist/runtime/server/utils/string.mjs +24 -0
  45. package/dist/runtime/server/utils/tracker.d.ts +4 -4
  46. package/dist/runtime/server/utils/tracker.mjs +13 -11
  47. package/dist/runtime/server/utils/turnstile.mjs +6 -2
  48. package/dist/runtime/server.d.ts +4 -2
  49. package/dist/runtime/server.mjs +1 -0
  50. package/package.json +1 -1
@@ -13,9 +13,13 @@ export async function verifyTurnstileToken(event, token, remoteIp) {
13
13
  }
14
14
  const authConfig = getQarpeoConfig(event).auth || {};
15
15
  const turnstileConfig = typeof authConfig.turnstile === "object" ? authConfig.turnstile : {};
16
- const secretKey = globalThis.process?.env?.NUXT_TURNSTILE_SECRET_KEY || globalThis.process?.env?.TURNSTILE_SECRET_KEY || turnstileConfig.secretKey;
16
+ const cfEnv = event?.context?.cloudflare?.env;
17
+ const secretKey = cfEnv?.NUXT_TURNSTILE_SECRET_KEY || cfEnv?.TURNSTILE_SECRET_KEY || globalThis.process?.env?.NUXT_TURNSTILE_SECRET_KEY || globalThis.process?.env?.TURNSTILE_SECRET_KEY || turnstileConfig.secretKey;
17
18
  if (!secretKey) {
18
- if (globalThis.process?.env?.NODE_ENV !== "production") {
19
+ const isDev = Boolean(
20
+ import.meta.dev || globalThis.process?.env?.NODE_ENV === "development" || globalThis.process?.env?.NODE_ENV === "test" || cfEnv?.NODE_ENV === "development"
21
+ );
22
+ if (isDev) {
19
23
  console.warn(
20
24
  "[qarpeo:turnstile] NUXT_TURNSTILE_SECRET_KEY is not set. Allowing request in development mode."
21
25
  );
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * `qarpeo/server` — Standard server-side entrypoint for Qarpeo edge primitives.
3
3
  *
4
- * Provides typed Cloudflare bindings and high-level clients for Nuxt server routes,
5
- * event handlers, middleware, queues, and background tasks.
4
+ * Provides typed Cloudflare bindings and high-level clients for Nuxt server routes, event handlers,
5
+ * middleware, queues, and background tasks.
6
6
  *
7
7
  * Usage:
8
+ *
8
9
  * ```ts
9
10
  * import { defineEventHandler } from "nuxt/server"
10
11
  * import { db, kv, blob, ai } from "qarpeo/server"
@@ -38,3 +39,4 @@ export * from "./payments";
38
39
  export * from "./storage";
39
40
  export * from "./bots";
40
41
  export * from "./rag";
42
+ export * from "./server/utils/string";
@@ -21,3 +21,4 @@ export * from "./payments.mjs";
21
21
  export * from "./storage.mjs";
22
22
  export * from "./bots.mjs";
23
23
  export * from "./rag.mjs";
24
+ export * from "./server/utils/string.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qarpeo",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "Zero-config Cloudflare Edge Platform for Nuxt",
5
5
  "keywords": [
6
6
  "analytics-engine",