@riffdb/better-auth 0.2.0 → 0.2.1

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 (176) hide show
  1. package/DESIGN.md +90 -14
  2. package/README.md +157 -25
  3. package/dist/adapter.d.ts +7 -1
  4. package/dist/adapter.d.ts.map +1 -1
  5. package/dist/adapter.js +385 -47
  6. package/dist/adapter.js.map +1 -1
  7. package/dist/generated/client.d.ts +267 -26
  8. package/dist/generated/client.d.ts.map +1 -1
  9. package/dist/generated/client.js +479 -69
  10. package/dist/generated/client.js.map +1 -1
  11. package/dist/index.d.ts +3 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +3 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/plugin-dispatch.d.ts +37 -0
  16. package/dist/plugin-dispatch.d.ts.map +1 -0
  17. package/dist/plugin-dispatch.js +293 -0
  18. package/dist/plugin-dispatch.js.map +1 -0
  19. package/dist/profile-contract.d.ts +3 -0
  20. package/dist/profile-contract.d.ts.map +1 -1
  21. package/dist/profile-contract.js +8 -0
  22. package/dist/profile-contract.js.map +1 -1
  23. package/dist/profile-plan.js +1 -1
  24. package/dist/profile-plan.js.map +1 -1
  25. package/dist/profile.d.ts +2 -1
  26. package/dist/profile.d.ts.map +1 -1
  27. package/dist/profile.js +2 -1
  28. package/dist/profile.js.map +1 -1
  29. package/dist/profiles/custom-fields/profile.d.ts +3 -0
  30. package/dist/profiles/custom-fields/profile.d.ts.map +1 -0
  31. package/dist/profiles/custom-fields/profile.js +475 -0
  32. package/dist/profiles/custom-fields/profile.js.map +1 -0
  33. package/dist/profiles/custom-fields/src/generated/client.d.ts +2710 -0
  34. package/dist/profiles/custom-fields/src/generated/client.d.ts.map +1 -0
  35. package/dist/profiles/custom-fields/src/generated/client.js +2663 -0
  36. package/dist/profiles/custom-fields/src/generated/client.js.map +1 -0
  37. package/dist/profiles/runtime/profile.d.ts +3 -0
  38. package/dist/profiles/runtime/profile.d.ts.map +1 -0
  39. package/dist/profiles/runtime/profile.js +1065 -0
  40. package/dist/profiles/runtime/profile.js.map +1 -0
  41. package/dist/profiles/runtime/src/generated/client.d.ts +4274 -0
  42. package/dist/profiles/runtime/src/generated/client.d.ts.map +1 -0
  43. package/dist/profiles/runtime/src/generated/client.js +4607 -0
  44. package/dist/profiles/runtime/src/generated/client.js.map +1 -0
  45. package/dist/runtime-materialize.d.ts +10 -0
  46. package/dist/runtime-materialize.d.ts.map +1 -0
  47. package/dist/runtime-materialize.js +344 -0
  48. package/dist/runtime-materialize.js.map +1 -0
  49. package/dist/runtime-profile.d.ts +34 -0
  50. package/dist/runtime-profile.d.ts.map +1 -0
  51. package/dist/runtime-profile.js +203 -0
  52. package/dist/runtime-profile.js.map +1 -0
  53. package/generated/go/client.go +350 -96
  54. package/generated/mcp/tools.json +3338 -1768
  55. package/generated/python/client.py +603 -26
  56. package/generated/riffdb.application.exact.json +1 -1
  57. package/generated/riffdb.contract.bundle +0 -0
  58. package/generated/rust/client.rs +522 -26
  59. package/package.json +34 -13
  60. package/profiles/custom-fields/generated/go/client.go +2578 -0
  61. package/profiles/custom-fields/generated/mcp/tools.json +15998 -0
  62. package/profiles/custom-fields/generated/python/client.py +5141 -0
  63. package/profiles/custom-fields/generated/riffdb.application.exact.json +1 -0
  64. package/profiles/custom-fields/generated/riffdb.contract.bundle +0 -0
  65. package/profiles/custom-fields/generated/rust/client.rs +7980 -0
  66. package/profiles/custom-fields/profile.ts +474 -0
  67. package/profiles/custom-fields/riffdb/contract.riff +568 -0
  68. package/profiles/custom-fields/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
  69. package/profiles/custom-fields/riffdb/queries/admin_users_contains_asc.riffq +24 -0
  70. package/profiles/custom-fields/riffdb/queries/admin_users_contains_desc.riffq +24 -0
  71. package/profiles/custom-fields/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
  72. package/profiles/custom-fields/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
  73. package/profiles/custom-fields/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
  74. package/profiles/custom-fields/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
  75. package/profiles/custom-fields/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
  76. package/profiles/custom-fields/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
  77. package/profiles/custom-fields/riffdb/queries/find_account_by_id.riffq +24 -0
  78. package/profiles/custom-fields/riffdb/queries/find_account_by_provider.riffq +26 -0
  79. package/profiles/custom-fields/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
  80. package/profiles/custom-fields/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
  81. package/profiles/custom-fields/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
  82. package/profiles/custom-fields/riffdb/queries/find_credential_account.riffq +25 -0
  83. package/profiles/custom-fields/riffdb/queries/find_expired_verification_ids.riffq +17 -0
  84. package/profiles/custom-fields/riffdb/queries/find_latest_verification.riffq +20 -0
  85. package/profiles/custom-fields/riffdb/queries/find_session_by_id.riffq +20 -0
  86. package/profiles/custom-fields/riffdb/queries/find_session_by_token.riffq +20 -0
  87. package/profiles/custom-fields/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
  88. package/profiles/custom-fields/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
  89. package/profiles/custom-fields/riffdb/queries/find_user_by_email.riffq +16 -0
  90. package/profiles/custom-fields/riffdb/queries/find_user_by_id.riffq +15 -0
  91. package/profiles/custom-fields/riffdb/queries/find_verification_by_id.riffq +19 -0
  92. package/profiles/custom-fields/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
  93. package/profiles/custom-fields/riffdb/queries/profile_account_with_user_by_provider.riffq +31 -0
  94. package/profiles/custom-fields/riffdb/queries/profile_session_with_user_by_id.riffq +14 -0
  95. package/profiles/custom-fields/riffdb/queries/profile_session_with_user_by_token.riffq +14 -0
  96. package/profiles/custom-fields/riffdb/queries/profile_sessions_with_users_by_token_set.riffq +25 -0
  97. package/profiles/custom-fields/riffdb/queries/profile_user_with_accounts_by_email.riffq +19 -0
  98. package/profiles/custom-fields/riffdb/queries/profile_user_with_accounts_by_id.riffq +19 -0
  99. package/profiles/custom-fields/riffdb.application.json +217 -0
  100. package/profiles/custom-fields/riffdb.application.lock.json +1 -0
  101. package/profiles/custom-fields/riffdb.toml +3 -0
  102. package/profiles/custom-fields/src/generated/client.ts +3096 -0
  103. package/profiles/organization-security/materialization.json +3 -0
  104. package/profiles/organization-security/riffdb/contract.riff +12 -0
  105. package/profiles/organization-security/riffdb/queries/find_team_by_id.riffq +1 -1
  106. package/profiles/organization-security/riffdb/queries/find_team_member_by_id.riffq +1 -1
  107. package/profiles/organization-security/riffdb/queries/find_team_member_by_membership_key.riffq +16 -0
  108. package/profiles/organization-security/riffdb/queries/find_team_member_by_team_id.riffq +1 -1
  109. package/profiles/organization-security/riffdb.application.json +5 -0
  110. package/profiles/organization-security.profile.json +27 -1
  111. package/profiles/runtime/generated/go/client.go +4511 -0
  112. package/profiles/runtime/generated/mcp/tools.json +30004 -0
  113. package/profiles/runtime/generated/python/client.py +9337 -0
  114. package/profiles/runtime/generated/riffdb.application.exact.json +1 -0
  115. package/profiles/runtime/generated/riffdb.contract.bundle +0 -0
  116. package/profiles/runtime/generated/rust/client.rs +13297 -0
  117. package/profiles/runtime/profile.ts +1064 -0
  118. package/profiles/runtime/riffdb/contract.riff +1053 -0
  119. package/profiles/runtime/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
  120. package/profiles/runtime/riffdb/queries/admin_users_contains_asc.riffq +24 -0
  121. package/profiles/runtime/riffdb/queries/admin_users_contains_desc.riffq +24 -0
  122. package/profiles/runtime/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
  123. package/profiles/runtime/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
  124. package/profiles/runtime/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
  125. package/profiles/runtime/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
  126. package/profiles/runtime/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
  127. package/profiles/runtime/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
  128. package/profiles/runtime/riffdb/queries/find_account_by_id.riffq +24 -0
  129. package/profiles/runtime/riffdb/queries/find_account_by_provider.riffq +26 -0
  130. package/profiles/runtime/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
  131. package/profiles/runtime/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
  132. package/profiles/runtime/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
  133. package/profiles/runtime/riffdb/queries/find_credential_account.riffq +25 -0
  134. package/profiles/runtime/riffdb/queries/find_expired_verification_ids.riffq +17 -0
  135. package/profiles/runtime/riffdb/queries/find_latest_verification.riffq +20 -0
  136. package/profiles/runtime/riffdb/queries/find_session_by_id.riffq +20 -0
  137. package/profiles/runtime/riffdb/queries/find_session_by_token.riffq +20 -0
  138. package/profiles/runtime/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
  139. package/profiles/runtime/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
  140. package/profiles/runtime/riffdb/queries/find_user_by_email.riffq +16 -0
  141. package/profiles/runtime/riffdb/queries/find_user_by_id.riffq +15 -0
  142. package/profiles/runtime/riffdb/queries/find_verification_by_id.riffq +19 -0
  143. package/profiles/runtime/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
  144. package/profiles/runtime/riffdb/queries/profile_account_with_user_by_provider.riffq +31 -0
  145. package/profiles/runtime/riffdb/queries/profile_invitation_by_email.riffq +17 -0
  146. package/profiles/runtime/riffdb/queries/profile_invitation_by_id.riffq +17 -0
  147. package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_email_status.riffq +19 -0
  148. package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_id.riffq +17 -0
  149. package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_status.riffq +18 -0
  150. package/profiles/runtime/riffdb/queries/profile_member_by_id.riffq +27 -0
  151. package/profiles/runtime/riffdb/queries/profile_member_by_organization.riffq +20 -0
  152. package/profiles/runtime/riffdb/queries/profile_member_by_organization_created_at_asc.riffq +20 -0
  153. package/profiles/runtime/riffdb/queries/profile_member_by_organization_created_at_desc.riffq +20 -0
  154. package/profiles/runtime/riffdb/queries/profile_member_by_organization_role_asc.riffq +20 -0
  155. package/profiles/runtime/riffdb/queries/profile_member_by_organization_role_desc.riffq +20 -0
  156. package/profiles/runtime/riffdb/queries/profile_member_by_organization_user.riffq +28 -0
  157. package/profiles/runtime/riffdb/queries/profile_member_by_user.riffq +27 -0
  158. package/profiles/runtime/riffdb/queries/profile_organization_by_id.riffq +27 -0
  159. package/profiles/runtime/riffdb/queries/profile_organization_by_slug.riffq +27 -0
  160. package/profiles/runtime/riffdb/queries/profile_session_with_user_by_id.riffq +14 -0
  161. package/profiles/runtime/riffdb/queries/profile_session_with_user_by_token.riffq +14 -0
  162. package/profiles/runtime/riffdb/queries/profile_sessions_with_users_by_token_set.riffq +25 -0
  163. package/profiles/runtime/riffdb/queries/profile_two_factor_by_id.riffq +17 -0
  164. package/profiles/runtime/riffdb/queries/profile_two_factor_by_user.riffq +17 -0
  165. package/profiles/runtime/riffdb/queries/profile_user_with_accounts_by_email.riffq +19 -0
  166. package/profiles/runtime/riffdb/queries/profile_user_with_accounts_by_id.riffq +19 -0
  167. package/profiles/runtime/riffdb/queries/profile_users_by_id_set.riffq +8 -0
  168. package/profiles/runtime/riffdb.application.json +324 -0
  169. package/profiles/runtime/riffdb.application.lock.json +1 -0
  170. package/profiles/runtime/riffdb.toml +3 -0
  171. package/profiles/runtime/src/generated/client.ts +5186 -0
  172. package/riffdb/contract.riff +58 -0
  173. package/riffdb/queries/find_credential_account.riffq +25 -0
  174. package/riffdb.application.json +106 -26
  175. package/riffdb.application.lock.json +1 -1
  176. package/src/generated/client.ts +2746 -0
package/package.json CHANGED
@@ -1,19 +1,26 @@
1
1
  {
2
2
  "name": "@riffdb/better-auth",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A compiled-profile Better Auth adapter for RiffDB",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
8
8
  "types": "./dist/index.d.ts",
9
9
  "import": "./dist/index.js"
10
+ },
11
+ "./profiles/custom-fields": {
12
+ "types": "./dist/profiles/custom-fields/profile.d.ts",
13
+ "import": "./dist/profiles/custom-fields/profile.js"
14
+ },
15
+ "./profiles/organization-security": {
16
+ "types": "./dist/profiles/runtime/profile.d.ts",
17
+ "import": "./dist/profiles/runtime/profile.js"
10
18
  }
11
19
  },
12
20
  "types": "./dist/index.d.ts",
13
21
  "files": [
14
22
  "dist",
15
23
  "generated",
16
- "profiles",
17
24
  "riffdb",
18
25
  "riffdb.application.json",
19
26
  "riffdb.application.lock.json",
@@ -21,34 +28,48 @@
21
28
  "README.md",
22
29
  "DESIGN.md",
23
30
  "LICENSE-APACHE",
24
- "LICENSE-MIT"
31
+ "LICENSE-MIT",
32
+ "profiles/*.profile.json",
33
+ "profiles/*/riffdb/**",
34
+ "profiles/*/generated/**",
35
+ "profiles/*/src/generated/**",
36
+ "profiles/*/riffdb.application.json",
37
+ "profiles/*/riffdb.application.lock.json",
38
+ "profiles/*/riffdb.toml",
39
+ "profiles/*/profile.ts",
40
+ "profiles/*/materialization.json",
41
+ "src/generated/client.ts"
25
42
  ],
26
43
  "scripts": {
27
- "build": "tsc -p tsconfig.build.json",
28
- "check": "npm run typecheck && npm test && npm run profiles:check && npm pack --dry-run --cache ./node_modules/.cache/npm",
44
+ "build": "tsc -p tsconfig.build.json && tsc -p tsconfig.profiles.json",
45
+ "check": "npm run build && npm run typecheck && npm test && npm run profiles:check && node scripts/check-package.mjs",
29
46
  "prepack": "npm run build",
30
47
  "start": "node scripts/real-riffdb-runner.mjs",
31
- "profiles:check": "npm run build && node scripts/profile-example.mjs --check && node scripts/materialize-profile.mjs --check",
48
+ "profiles:check": "npm run build && node scripts/profile-example.mjs --check && node scripts/materialize-profile.mjs --check && node scripts/runtime-profiles.mjs --check && riffdb application check && riffdb application check profiles/custom-fields/riffdb.application.json && riffdb application check profiles/runtime/riffdb.application.json && riffdb application check profiles/organization-security/riffdb.application.json",
32
49
  "profiles:write": "npm run build && node scripts/profile-example.mjs --write",
33
50
  "test": "vitest run",
34
51
  "typecheck": "tsc -p tsconfig.json --noEmit",
35
- "profiles:materialize": "npm run build && node scripts/materialize-profile.mjs --write"
52
+ "profiles:materialize": "npm run build && node scripts/materialize-profile.mjs --write",
53
+ "test:loopback": "npm run build && node scripts/loopback.mjs && node scripts/loopback.mjs profiles/custom-fields && node scripts/loopback.mjs profiles/runtime plugins",
54
+ "profiles:runtime": "npm run build && node scripts/runtime-profiles.mjs --write"
36
55
  },
37
56
  "engines": {
38
57
  "node": ">=22"
39
58
  },
40
59
  "peerDependencies": {
41
- "@riffdb/client": "0.2.0",
42
- "better-auth": "1.6.29"
60
+ "@riffdb/client": "0.2.1",
61
+ "better-auth": "1.7.18"
43
62
  },
44
63
  "dependencies": {
45
- "@riffdb/client": "0.2.0"
64
+ "@riffdb/client": "0.2.1"
46
65
  },
47
66
  "devDependencies": {
48
- "@better-auth/test-utils": "1.6.29",
49
- "@riffdb/cli": "0.2.0",
67
+ "@better-auth/test-utils": "1.7.18",
68
+ "@better-auth/utils": "0.5.1",
69
+ "@riffdb/cli": "0.2.1",
50
70
  "@types/node": "26.2.0",
51
- "better-auth": "1.6.29",
71
+ "better-auth": "1.7.18",
72
+ "next": "16.4.5",
52
73
  "typescript": "7.0.2",
53
74
  "vitest": "4.1.10"
54
75
  },