@quickback-dev/cli 0.40.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/commands/claude.d.ts.map +1 -1
  2. package/dist/commands/claude.js +8 -0
  3. package/dist/commands/claude.js.map +1 -1
  4. package/dist/commands/compile.d.ts.map +1 -1
  5. package/dist/commands/compile.js +13 -2
  6. package/dist/commands/compile.js.map +1 -1
  7. package/dist/commands/compile.test.js +26 -21
  8. package/dist/commands/compile.test.js.map +1 -1
  9. package/dist/commands/create.js +6 -9
  10. package/dist/commands/create.js.map +1 -1
  11. package/dist/commands/login.d.ts.map +1 -1
  12. package/dist/commands/login.js +0 -9
  13. package/dist/commands/login.js.map +1 -1
  14. package/dist/commands/start.d.ts.map +1 -1
  15. package/dist/commands/start.js +6 -7
  16. package/dist/commands/start.js.map +1 -1
  17. package/dist/commands/whoami.d.ts.map +1 -1
  18. package/dist/commands/whoami.js +0 -4
  19. package/dist/commands/whoami.js.map +1 -1
  20. package/dist/docs/content.d.ts.map +1 -1
  21. package/dist/docs/content.js +23 -33
  22. package/dist/docs/content.js.map +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/lib/api-client.d.ts +0 -12
  25. package/dist/lib/api-client.d.ts.map +1 -1
  26. package/dist/lib/api-client.js +0 -10
  27. package/dist/lib/api-client.js.map +1 -1
  28. package/dist/lib/api-client.test.js +13 -8
  29. package/dist/lib/api-client.test.js.map +1 -1
  30. package/dist/lib/auth.d.ts +0 -1
  31. package/dist/lib/auth.d.ts.map +1 -1
  32. package/dist/lib/auth.js.map +1 -1
  33. package/dist/lib/compiler-stubs.d.ts +12 -0
  34. package/dist/lib/compiler-stubs.d.ts.map +1 -1
  35. package/dist/lib/compiler-stubs.js +18 -0
  36. package/dist/lib/compiler-stubs.js.map +1 -1
  37. package/dist/lib/file-loader.d.ts +14 -0
  38. package/dist/lib/file-loader.d.ts.map +1 -1
  39. package/dist/lib/file-loader.js +63 -9
  40. package/dist/lib/file-loader.js.map +1 -1
  41. package/dist/skill/SKILL.md +76 -6
  42. package/dist/skill/docs/changelog.md +253 -0
  43. package/dist/skill/docs/compiler/cloud-compiler/authentication.md +1 -2
  44. package/dist/skill/docs/compiler/cloud-compiler/cli.md +7 -8
  45. package/dist/skill/docs/compiler/config/agents.md +49 -1
  46. package/dist/skill/docs/compiler/config/auth.md +20 -5
  47. package/dist/skill/docs/compiler/config/security.md +46 -0
  48. package/dist/skill/docs/compiler/definitions/access.md +1 -1
  49. package/dist/skill/docs/compiler/definitions/actions.md +46 -4
  50. package/dist/skill/docs/compiler/definitions/scopes.md +11 -3
  51. package/dist/skill/docs/compiler/getting-started/full-example.md +5 -3
  52. package/dist/skill/docs/compiler/getting-started/index.md +7 -7
  53. package/dist/skill/docs/compiler/getting-started/patterns.md +39 -5
  54. package/dist/skill/docs/compiler/getting-started/template-blog.md +65 -44
  55. package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +4 -5
  56. package/dist/skill/docs/compiler/getting-started/template-empty.md +7 -1
  57. package/dist/skill/docs/compiler/getting-started/templates.md +6 -6
  58. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +23 -0
  59. package/dist/skill/docs/stack/account-ui/features/passwordless.md +4 -10
  60. package/dist/skill/docs/stack/account-ui/hooks.md +24 -1
  61. package/dist/skill/docs/stack/auth/plugins/aws-ses.md +0 -7
  62. package/dist/skill/docs/stack/auth/plugins/index.md +71 -28
  63. package/dist/skill/docs/stack/storage/r2.md +8 -6
  64. package/dist/skill/docs/stack/storage/using-r2.md +58 -33
  65. package/dist/templates/registry.d.ts +0 -12
  66. package/dist/templates/registry.d.ts.map +1 -1
  67. package/dist/templates/registry.js +0 -42
  68. package/dist/templates/registry.js.map +1 -1
  69. package/package.json +1 -1
  70. package/src/skill/SKILL.md +76 -6
  71. package/src/skill/docs/changelog.md +253 -0
  72. package/src/skill/docs/compiler/cloud-compiler/authentication.md +1 -2
  73. package/src/skill/docs/compiler/cloud-compiler/cli.md +7 -8
  74. package/src/skill/docs/compiler/config/agents.md +49 -1
  75. package/src/skill/docs/compiler/config/auth.md +20 -5
  76. package/src/skill/docs/compiler/config/security.md +46 -0
  77. package/src/skill/docs/compiler/definitions/access.md +1 -1
  78. package/src/skill/docs/compiler/definitions/actions.md +46 -4
  79. package/src/skill/docs/compiler/definitions/scopes.md +11 -3
  80. package/src/skill/docs/compiler/getting-started/full-example.md +5 -3
  81. package/src/skill/docs/compiler/getting-started/index.md +7 -7
  82. package/src/skill/docs/compiler/getting-started/patterns.md +39 -5
  83. package/src/skill/docs/compiler/getting-started/template-blog.md +65 -44
  84. package/src/skill/docs/compiler/getting-started/template-cloudflare.md +4 -5
  85. package/src/skill/docs/compiler/getting-started/template-empty.md +7 -1
  86. package/src/skill/docs/compiler/getting-started/templates.md +6 -6
  87. package/src/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +23 -0
  88. package/src/skill/docs/stack/account-ui/features/passwordless.md +4 -10
  89. package/src/skill/docs/stack/account-ui/hooks.md +24 -1
  90. package/src/skill/docs/stack/auth/plugins/aws-ses.md +0 -7
  91. package/src/skill/docs/stack/auth/plugins/index.md +71 -28
  92. package/src/skill/docs/stack/storage/r2.md +8 -6
  93. package/src/skill/docs/stack/storage/using-r2.md +58 -33
  94. package/dist/skill/docs/stack/auth/plugins/combo-auth.md +0 -74
  95. package/dist/skill/docs/stack/auth/plugins/upgrade-anonymous.md +0 -155
  96. package/src/skill/docs/stack/auth/plugins/combo-auth.md +0 -74
  97. package/src/skill/docs/stack/auth/plugins/upgrade-anonymous.md +0 -155
@@ -1,74 +0,0 @@
1
- # Combo Auth Plugin
2
-
3
- `@quickback-dev/better-auth-combo-auth` provides a combined authentication flow that sends both a magic link and an OTP code in a single email. Users can click the link (one-click) or enter the 6-digit OTP code — whichever is more convenient.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @quickback-dev/better-auth-combo-auth
9
- ```
10
-
11
- ## Server Setup
12
-
13
- Add the plugin to your Better Auth configuration:
14
-
15
- ```typescript
16
- import { betterAuth } from "better-auth";
17
- import { comboAuth } from "@quickback-dev/better-auth-combo-auth";
18
-
19
- export const auth = betterAuth({
20
- plugins: [
21
- comboAuth({
22
- sendComboAuth: async ({ email, otp, url }) => {
23
- // Send email with both the magic link (url) and OTP code (otp)
24
- await sendEmail({
25
- to: email,
26
- subject: "Sign in to My App",
27
- html: `
28
- <p>Click the link below to sign in:</p>
29
- <a href="${url}">Sign in to My App</a>
30
- <p>Or enter this code: <strong>${otp}</strong></p>
31
- `,
32
- });
33
- },
34
- }),
35
- ],
36
- });
37
- ```
38
-
39
- ## Client Usage
40
-
41
- ```typescript
42
- import { createAuthClient } from "better-auth/client";
43
- import { comboAuthClient } from "@quickback-dev/better-auth-combo-auth/client";
44
-
45
- const authClient = createAuthClient({
46
- plugins: [comboAuthClient()],
47
- });
48
-
49
- // Request authentication — sends email with link + OTP
50
- await authClient.signIn.comboAuth({
51
- email: "user@example.com",
52
- });
53
-
54
- // Verify with OTP code (if user enters it manually)
55
- await authClient.signIn.comboAuth({
56
- email: "user@example.com",
57
- otp: "123456",
58
- });
59
- ```
60
-
61
- ## How It Works
62
-
63
- 1. User enters their email and requests sign-in
64
- 2. A single email is sent containing both a magic link and a 6-digit OTP
65
- 3. **Option A:** User clicks the magic link — authenticated immediately
66
- 4. **Option B:** User enters the OTP code — authenticated after verification
67
-
68
- This provides the best of both worlds: convenience of magic links with the reliability of OTP codes (useful when magic links don't work well, e.g., opening email on a different device).
69
-
70
- ## See Also
71
-
72
- - [Auth Plugins](/stack/auth/plugins) — All authentication plugin options
73
- - [Upgrade Anonymous](/stack/auth/plugins/upgrade-anonymous) — Convert anonymous sessions to full accounts
74
- - [AWS SES](/stack/auth/plugins/aws-ses) — Email delivery for auth flows
@@ -1,155 +0,0 @@
1
- # Upgrade Anonymous Plugin
2
-
3
- `@quickback-dev/better-auth-upgrade-anonymous` provides a single endpoint to convert anonymous users into full authenticated users. It flips the `isAnonymous` flag, optionally updates email and name, and refreshes the session — no re-authentication required.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @quickback-dev/better-auth-upgrade-anonymous
9
- ```
10
-
11
- ## Configuration
12
-
13
- Enable both the `anonymous` and `upgradeAnonymous` plugins:
14
-
15
- ```typescript
16
- auth: defineAuth("better-auth", {
17
- plugins: ["anonymous", "upgradeAnonymous"],
18
- })
19
- ```
20
-
21
- The plugin accepts optional configuration:
22
-
23
- ```typescript
24
- import { upgradeAnonymous } from "@quickback-dev/better-auth-upgrade-anonymous";
25
-
26
- upgradeAnonymous({
27
- emailConfigured: true, // Whether email delivery is available
28
- requireEmailVerification: true, // Whether to require email verification
29
- })
30
- ```
31
-
32
- | Option | Default | Description |
33
- |--------|---------|-------------|
34
- | `emailConfigured` | `false` | When `true` and an email is provided, `emailVerified` is set based on `requireEmailVerification` |
35
- | `requireEmailVerification` | `true` | When `true`, provided emails are marked unverified (requiring OTP). When `false`, emails are marked verified immediately |
36
-
37
- > **Quickback Compiler**
38
- >
39
- > When using the Quickback compiler, these options are set automatically based on your SES environment variables. You don't need to configure them manually.
40
-
41
-
42
- ## Endpoint
43
-
44
- ```
45
- POST /auth/v1/upgrade-anonymous
46
- ```
47
-
48
- ### Flow
49
-
50
- 1. Validates the user's session (returns `401` if not authenticated)
51
- 2. Checks if the user is already upgraded (returns success immediately if so)
52
- 3. If an email is provided, checks for duplicates (returns `400` if email is taken)
53
- 4. Updates `isAnonymous` to `false`, plus optional `email`, `name`, and `emailVerified` fields
54
- 5. Refreshes the session cookie with the updated user object
55
- 6. Returns the updated user, session, and `verificationRequired` flag
56
-
57
- ### Request
58
-
59
- The body is optional. When provided, it accepts:
60
-
61
- | Field | Type | Description |
62
- |-------|------|-------------|
63
- | `email` | `string` (email) | Optional. Real email to replace the anonymous placeholder |
64
- | `name` | `string` | Optional. User's display name |
65
-
66
- ```bash
67
- # Minimal — just upgrade, no email/name
68
- curl -X POST https://api.example.com/auth/v1/upgrade-anonymous \
69
- -H "Cookie: better-auth.session_token=..."
70
-
71
- # With email and name
72
- curl -X POST https://api.example.com/auth/v1/upgrade-anonymous \
73
- -H "Cookie: better-auth.session_token=..." \
74
- -H "Content-Type: application/json" \
75
- -d '{"email": "jane@example.com", "name": "Jane"}'
76
- ```
77
-
78
- ### Response
79
-
80
- ```json
81
- {
82
- "success": true,
83
- "verificationRequired": true,
84
- "user": {
85
- "id": "usr_abc123",
86
- "email": "jane@example.com",
87
- "isAnonymous": false
88
- },
89
- "session": {
90
- "id": "sess_xyz",
91
- "userId": "usr_abc123"
92
- }
93
- }
94
- ```
95
-
96
- The `verificationRequired` field is `true` when all three conditions are met:
97
- - An email was provided in the request body
98
- - `emailConfigured` is `true` in plugin config
99
- - `requireEmailVerification` is `true` in plugin config
100
-
101
- When `verificationRequired` is `true`, the frontend should send a verification OTP and redirect the user to verify their email.
102
-
103
- ## How It Works
104
-
105
- The plugin is designed to be flexible:
106
-
107
- - **Minimal by default** — With no body, only changes `isAnonymous` from `true` to `false`
108
- - **Optional email/name** — Can update email and name in the same request
109
- - **Duplicate protection** — Rejects emails already associated with another account
110
- - **Verification-aware** — Returns `verificationRequired` so the frontend knows whether to trigger OTP
111
- - **Session preserved** — Same session ID, no re-authentication needed
112
- - **Idempotent** — Calling on an already-upgraded user returns success immediately
113
-
114
- ## Typical Flows
115
-
116
- ### Passkey Signup (no email)
117
-
118
- 1. User creates anonymous session
119
- 2. User registers a passkey
120
- 3. App calls `POST /auth/v1/upgrade-anonymous` with no body
121
- 4. User is now a full user with passkey auth — no email on file
122
-
123
- ### Passkey Signup (with email)
124
-
125
- 1. User creates anonymous session
126
- 2. User registers a passkey
127
- 3. User optionally enters email/name on the email collection step
128
- 4. App calls `POST /auth/v1/upgrade-anonymous` with `{ email, name }`
129
- 5. If `verificationRequired`: app sends OTP, user verifies, then redirects to dashboard
130
- 6. Otherwise: user goes straight to dashboard
131
-
132
- ### Email Signup
133
-
134
- 1. User starts as anonymous (created via Better Auth's `anonymous` plugin)
135
- 2. User provides email/password through your UI (via combo auth or signup)
136
- 3. Your app calls `POST /auth/v1/upgrade-anonymous`
137
- 4. User is now a full user with the same ID and all their data intact
138
-
139
- ### Client Plugin
140
-
141
- ```typescript
142
- import { upgradeAnonymousClient } from "@quickback-dev/better-auth-upgrade-anonymous/client";
143
-
144
- const authClient = createAuthClient({
145
- plugins: [upgradeAnonymousClient()],
146
- });
147
-
148
- // Upgrade the current anonymous user
149
- await authClient.upgradeAnonymous();
150
- ```
151
-
152
- ## See Also
153
-
154
- - [Combo Auth Plugin](/stack/auth/plugins/combo-auth) — Combined magic link + OTP for collecting credentials
155
- - [Auth Configuration](/compiler/config/providers) — Configuring auth plugins