@riffdb/better-auth 0.0.0-stage → 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.
- package/DESIGN.md +273 -0
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +27 -0
- package/README.md +323 -2
- package/dist/adapter.d.ts +34 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +1600 -0
- package/dist/adapter.js.map +1 -0
- package/dist/generated/client.d.ts +2166 -0
- package/dist/generated/client.d.ts.map +1 -0
- package/dist/generated/client.js +2454 -0
- package/dist/generated/client.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-dispatch.d.ts +37 -0
- package/dist/plugin-dispatch.d.ts.map +1 -0
- package/dist/plugin-dispatch.js +293 -0
- package/dist/plugin-dispatch.js.map +1 -0
- package/dist/profile-contract.d.ts +63 -0
- package/dist/profile-contract.d.ts.map +1 -0
- package/dist/profile-contract.js +543 -0
- package/dist/profile-contract.js.map +1 -0
- package/dist/profile-plan.d.ts +69 -0
- package/dist/profile-plan.d.ts.map +1 -0
- package/dist/profile-plan.js +180 -0
- package/dist/profile-plan.js.map +1 -0
- package/dist/profile.d.ts +48 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +132 -0
- package/dist/profile.js.map +1 -0
- package/dist/profiles/custom-fields/profile.d.ts +3 -0
- package/dist/profiles/custom-fields/profile.d.ts.map +1 -0
- package/dist/profiles/custom-fields/profile.js +475 -0
- package/dist/profiles/custom-fields/profile.js.map +1 -0
- package/dist/profiles/custom-fields/src/generated/client.d.ts +2710 -0
- package/dist/profiles/custom-fields/src/generated/client.d.ts.map +1 -0
- package/dist/profiles/custom-fields/src/generated/client.js +2663 -0
- package/dist/profiles/custom-fields/src/generated/client.js.map +1 -0
- package/dist/profiles/runtime/profile.d.ts +3 -0
- package/dist/profiles/runtime/profile.d.ts.map +1 -0
- package/dist/profiles/runtime/profile.js +1065 -0
- package/dist/profiles/runtime/profile.js.map +1 -0
- package/dist/profiles/runtime/src/generated/client.d.ts +4274 -0
- package/dist/profiles/runtime/src/generated/client.d.ts.map +1 -0
- package/dist/profiles/runtime/src/generated/client.js +4607 -0
- package/dist/profiles/runtime/src/generated/client.js.map +1 -0
- package/dist/runtime-materialize.d.ts +10 -0
- package/dist/runtime-materialize.d.ts.map +1 -0
- package/dist/runtime-materialize.js +344 -0
- package/dist/runtime-materialize.js.map +1 -0
- package/dist/runtime-profile.d.ts +34 -0
- package/dist/runtime-profile.d.ts.map +1 -0
- package/dist/runtime-profile.js +203 -0
- package/dist/runtime-profile.js.map +1 -0
- package/dist/testing.d.ts +11 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +12 -0
- package/dist/testing.js.map +1 -0
- package/generated/go/client.go +2250 -0
- package/generated/mcp/tools.json +13922 -0
- package/generated/python/client.py +4454 -0
- package/generated/riffdb.application.exact.json +1 -0
- package/generated/riffdb.contract.bundle +0 -0
- package/generated/rust/client.rs +6524 -0
- package/package.json +83 -4
- package/profiles/custom-fields/generated/go/client.go +2578 -0
- package/profiles/custom-fields/generated/mcp/tools.json +15998 -0
- package/profiles/custom-fields/generated/python/client.py +5141 -0
- package/profiles/custom-fields/generated/riffdb.application.exact.json +1 -0
- package/profiles/custom-fields/generated/riffdb.contract.bundle +0 -0
- package/profiles/custom-fields/generated/rust/client.rs +7980 -0
- package/profiles/custom-fields/profile.ts +474 -0
- package/profiles/custom-fields/riffdb/contract.riff +568 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_contains_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_contains_desc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/find_account_by_id.riffq +24 -0
- package/profiles/custom-fields/riffdb/queries/find_account_by_provider.riffq +26 -0
- package/profiles/custom-fields/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
- package/profiles/custom-fields/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
- package/profiles/custom-fields/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
- package/profiles/custom-fields/riffdb/queries/find_credential_account.riffq +25 -0
- package/profiles/custom-fields/riffdb/queries/find_expired_verification_ids.riffq +17 -0
- package/profiles/custom-fields/riffdb/queries/find_latest_verification.riffq +20 -0
- package/profiles/custom-fields/riffdb/queries/find_session_by_id.riffq +20 -0
- package/profiles/custom-fields/riffdb/queries/find_session_by_token.riffq +20 -0
- package/profiles/custom-fields/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
- package/profiles/custom-fields/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
- package/profiles/custom-fields/riffdb/queries/find_user_by_email.riffq +16 -0
- package/profiles/custom-fields/riffdb/queries/find_user_by_id.riffq +15 -0
- package/profiles/custom-fields/riffdb/queries/find_verification_by_id.riffq +19 -0
- package/profiles/custom-fields/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
- package/profiles/custom-fields/riffdb/queries/profile_account_with_user_by_provider.riffq +31 -0
- package/profiles/custom-fields/riffdb/queries/profile_session_with_user_by_id.riffq +14 -0
- package/profiles/custom-fields/riffdb/queries/profile_session_with_user_by_token.riffq +14 -0
- package/profiles/custom-fields/riffdb/queries/profile_sessions_with_users_by_token_set.riffq +25 -0
- package/profiles/custom-fields/riffdb/queries/profile_user_with_accounts_by_email.riffq +19 -0
- package/profiles/custom-fields/riffdb/queries/profile_user_with_accounts_by_id.riffq +19 -0
- package/profiles/custom-fields/riffdb.application.json +217 -0
- package/profiles/custom-fields/riffdb.application.lock.json +1 -0
- package/profiles/custom-fields/riffdb.toml +3 -0
- package/profiles/custom-fields/src/generated/client.ts +3096 -0
- package/profiles/organization-security/materialization.json +51 -0
- package/profiles/organization-security/riffdb/contract.riff +778 -0
- package/profiles/organization-security/riffdb/queries/find_account_by_id.riffq +18 -0
- package/profiles/organization-security/riffdb/queries/find_invitation_by_email.riffq +17 -0
- package/profiles/organization-security/riffdb/queries/find_invitation_by_id.riffq +18 -0
- package/profiles/organization-security/riffdb/queries/find_invitation_by_organization_id.riffq +17 -0
- package/profiles/organization-security/riffdb/queries/find_member_by_id.riffq +18 -0
- package/profiles/organization-security/riffdb/queries/find_member_by_user_id.riffq +17 -0
- package/profiles/organization-security/riffdb/queries/find_organization_by_id.riffq +16 -0
- package/profiles/organization-security/riffdb/queries/find_organization_by_slug.riffq +16 -0
- package/profiles/organization-security/riffdb/queries/find_session_by_id.riffq +18 -0
- package/profiles/organization-security/riffdb/queries/find_session_by_token.riffq +16 -0
- package/profiles/organization-security/riffdb/queries/find_team_by_id.riffq +18 -0
- package/profiles/organization-security/riffdb/queries/find_team_member_by_id.riffq +18 -0
- package/profiles/organization-security/riffdb/queries/find_team_member_by_membership_key.riffq +16 -0
- package/profiles/organization-security/riffdb/queries/find_team_member_by_team_id.riffq +17 -0
- package/profiles/organization-security/riffdb/queries/find_two_factor_by_id.riffq +18 -0
- package/profiles/organization-security/riffdb/queries/find_two_factor_by_secret.riffq +17 -0
- package/profiles/organization-security/riffdb/queries/find_user_by_email.riffq +16 -0
- package/profiles/organization-security/riffdb/queries/find_user_by_id.riffq +16 -0
- package/profiles/organization-security/riffdb/queries/find_verification_by_id.riffq +16 -0
- package/profiles/organization-security/riffdb/queries/find_verification_by_identifier.riffq +17 -0
- package/profiles/organization-security/riffdb.application.json +172 -0
- package/profiles/organization-security/riffdb.toml +7 -0
- package/profiles/organization-security.profile.json +980 -0
- package/profiles/runtime/generated/go/client.go +4511 -0
- package/profiles/runtime/generated/mcp/tools.json +30004 -0
- package/profiles/runtime/generated/python/client.py +9337 -0
- package/profiles/runtime/generated/riffdb.application.exact.json +1 -0
- package/profiles/runtime/generated/riffdb.contract.bundle +0 -0
- package/profiles/runtime/generated/rust/client.rs +13297 -0
- package/profiles/runtime/profile.ts +1064 -0
- package/profiles/runtime/riffdb/contract.riff +1053 -0
- package/profiles/runtime/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_contains_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_contains_desc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
- package/profiles/runtime/riffdb/queries/find_account_by_id.riffq +24 -0
- package/profiles/runtime/riffdb/queries/find_account_by_provider.riffq +26 -0
- package/profiles/runtime/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
- package/profiles/runtime/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
- package/profiles/runtime/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
- package/profiles/runtime/riffdb/queries/find_credential_account.riffq +25 -0
- package/profiles/runtime/riffdb/queries/find_expired_verification_ids.riffq +17 -0
- package/profiles/runtime/riffdb/queries/find_latest_verification.riffq +20 -0
- package/profiles/runtime/riffdb/queries/find_session_by_id.riffq +20 -0
- package/profiles/runtime/riffdb/queries/find_session_by_token.riffq +20 -0
- package/profiles/runtime/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
- package/profiles/runtime/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
- package/profiles/runtime/riffdb/queries/find_user_by_email.riffq +16 -0
- package/profiles/runtime/riffdb/queries/find_user_by_id.riffq +15 -0
- package/profiles/runtime/riffdb/queries/find_verification_by_id.riffq +19 -0
- package/profiles/runtime/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
- package/profiles/runtime/riffdb/queries/profile_account_with_user_by_provider.riffq +31 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_email.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_id.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_email_status.riffq +19 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_id.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_status.riffq +18 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_id.riffq +27 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_created_at_asc.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_created_at_desc.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_role_asc.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_role_desc.riffq +20 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_organization_user.riffq +28 -0
- package/profiles/runtime/riffdb/queries/profile_member_by_user.riffq +27 -0
- package/profiles/runtime/riffdb/queries/profile_organization_by_id.riffq +27 -0
- package/profiles/runtime/riffdb/queries/profile_organization_by_slug.riffq +27 -0
- package/profiles/runtime/riffdb/queries/profile_session_with_user_by_id.riffq +14 -0
- package/profiles/runtime/riffdb/queries/profile_session_with_user_by_token.riffq +14 -0
- package/profiles/runtime/riffdb/queries/profile_sessions_with_users_by_token_set.riffq +25 -0
- package/profiles/runtime/riffdb/queries/profile_two_factor_by_id.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_two_factor_by_user.riffq +17 -0
- package/profiles/runtime/riffdb/queries/profile_user_with_accounts_by_email.riffq +19 -0
- package/profiles/runtime/riffdb/queries/profile_user_with_accounts_by_id.riffq +19 -0
- package/profiles/runtime/riffdb/queries/profile_users_by_id_set.riffq +8 -0
- package/profiles/runtime/riffdb.application.json +324 -0
- package/profiles/runtime/riffdb.application.lock.json +1 -0
- package/profiles/runtime/riffdb.toml +3 -0
- package/profiles/runtime/src/generated/client.ts +5186 -0
- package/riffdb/contract.riff +547 -0
- package/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
- package/riffdb/queries/admin_users_contains_asc.riffq +24 -0
- package/riffdb/queries/admin_users_contains_desc.riffq +24 -0
- package/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
- package/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
- package/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
- package/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
- package/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
- package/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
- package/riffdb/queries/find_account_by_id.riffq +24 -0
- package/riffdb/queries/find_account_by_provider.riffq +26 -0
- package/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
- package/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
- package/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
- package/riffdb/queries/find_credential_account.riffq +25 -0
- package/riffdb/queries/find_expired_verification_ids.riffq +17 -0
- package/riffdb/queries/find_latest_verification.riffq +20 -0
- package/riffdb/queries/find_session_by_id.riffq +20 -0
- package/riffdb/queries/find_session_by_token.riffq +20 -0
- package/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
- package/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
- package/riffdb/queries/find_user_by_email.riffq +16 -0
- package/riffdb/queries/find_user_by_id.riffq +15 -0
- package/riffdb/queries/find_verification_by_id.riffq +19 -0
- package/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
- package/riffdb.application.json +187 -0
- package/riffdb.application.lock.json +1 -0
- package/scripts/real-riffdb-runner.mjs +333 -0
- package/src/generated/client.ts +2746 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
query FindAccountById(
|
|
2
|
+
$tenant_id: Account.tenant_id,
|
|
3
|
+
$user_id: Account.user_id,
|
|
4
|
+
$account_row_id: Account.account_row_id,
|
|
5
|
+
) {
|
|
6
|
+
many accounts from Account
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& user_id == $user_id
|
|
9
|
+
&& account_row_id == $account_row_id
|
|
10
|
+
order by account_row_id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
accounts: accounts { user_id account_row_id access_token reveals accounts.access_token access_token_expires_at reveals accounts.access_token_expires_at account_id created_at id_token reveals accounts.id_token password reveals accounts.password provider_id refresh_token reveals accounts.refresh_token refresh_token_expires_at reveals accounts.refresh_token_expires_at scope updated_at revision }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
outcomes Found
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query FindInvitationByEmail(
|
|
2
|
+
$tenant_id: Invitation.tenant_id,
|
|
3
|
+
$email: Invitation.email,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many invitations from Invitation
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& email == $email
|
|
9
|
+
order by user_id asc, invitation_id asc
|
|
10
|
+
take 50 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
invitations: invitations { user_id invitation_id created_at email expires_at organization_id role status team_id revision }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
query FindInvitationById(
|
|
2
|
+
$tenant_id: Invitation.tenant_id,
|
|
3
|
+
$user_id: Invitation.user_id,
|
|
4
|
+
$invitation_id: Invitation.invitation_id,
|
|
5
|
+
) {
|
|
6
|
+
many invitations from Invitation
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& user_id == $user_id
|
|
9
|
+
&& invitation_id == $invitation_id
|
|
10
|
+
order by invitation_id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
invitations: invitations { user_id invitation_id created_at email expires_at organization_id role status team_id revision }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
outcomes Found
|
|
18
|
+
}
|
package/profiles/organization-security/riffdb/queries/find_invitation_by_organization_id.riffq
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query FindInvitationByOrganizationId(
|
|
2
|
+
$tenant_id: Invitation.tenant_id,
|
|
3
|
+
$organization_id: Invitation.organization_id,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many invitations from Invitation
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& organization_id == $organization_id
|
|
9
|
+
order by user_id asc, invitation_id asc
|
|
10
|
+
take 50 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
invitations: invitations { user_id invitation_id created_at email expires_at organization_id role status team_id revision }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
query FindMemberById(
|
|
2
|
+
$tenant_id: Member.tenant_id,
|
|
3
|
+
$organization_id: Member.organization_id,
|
|
4
|
+
$member_id: Member.member_id,
|
|
5
|
+
) {
|
|
6
|
+
many members from Member
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& organization_id == $organization_id
|
|
9
|
+
&& member_id == $member_id
|
|
10
|
+
order by member_id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
members: members { organization_id member_id created_at role user_id revision }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
outcomes Found
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query FindMemberByUserId(
|
|
2
|
+
$tenant_id: Member.tenant_id,
|
|
3
|
+
$user_id: Member.user_id,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many members from Member
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& user_id == $user_id
|
|
9
|
+
order by organization_id asc, member_id asc
|
|
10
|
+
take 50 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
members: members { organization_id member_id created_at role user_id revision }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
query FindOrganizationById(
|
|
2
|
+
$tenant_id: Organization.tenant_id,
|
|
3
|
+
$organization_id: Organization.organization_id,
|
|
4
|
+
) {
|
|
5
|
+
many organizations from Organization
|
|
6
|
+
where tenant_id == $tenant_id
|
|
7
|
+
&& organization_id == $organization_id
|
|
8
|
+
order by organization_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
organizations: organizations { organization_id created_at logo metadata name slug revision }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
outcomes Found
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
query FindOrganizationBySlug(
|
|
2
|
+
$tenant_id: Organization.tenant_id,
|
|
3
|
+
$slug: Organization.slug,
|
|
4
|
+
) {
|
|
5
|
+
many organizations from Organization
|
|
6
|
+
where tenant_id == $tenant_id
|
|
7
|
+
&& slug == $slug
|
|
8
|
+
order by organization_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
organizations: organizations { organization_id created_at logo metadata name slug revision }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
outcomes Found
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
query FindSessionById(
|
|
2
|
+
$tenant_id: Session.tenant_id,
|
|
3
|
+
$user_id: Session.user_id,
|
|
4
|
+
$session_id: Session.session_id,
|
|
5
|
+
) {
|
|
6
|
+
many sessions from Session
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& user_id == $user_id
|
|
9
|
+
&& session_id == $session_id
|
|
10
|
+
order by session_id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
sessions: sessions { user_id session_id active_organization_id active_team_id created_at expires_at ip_address token reveals sessions.token updated_at user_agent revision }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
outcomes Found
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
query FindSessionByToken(
|
|
2
|
+
$tenant_id: Session.tenant_id,
|
|
3
|
+
$token: Session.token,
|
|
4
|
+
) {
|
|
5
|
+
many sessions from Session
|
|
6
|
+
where tenant_id == $tenant_id
|
|
7
|
+
&& token == $token
|
|
8
|
+
order by user_id asc, session_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
sessions: sessions { user_id session_id active_organization_id active_team_id created_at expires_at ip_address token reveals sessions.token updated_at user_agent revision }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
outcomes Found
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
query FindTeamById(
|
|
2
|
+
$tenant_id: Team.tenant_id,
|
|
3
|
+
$organization_id: Team.organization_id,
|
|
4
|
+
$team_id: Team.team_id,
|
|
5
|
+
) {
|
|
6
|
+
many teams from Team
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& organization_id == $organization_id
|
|
9
|
+
&& team_id == $team_id
|
|
10
|
+
order by team_id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
teams: teams { organization_id team_id created_at member_count reveals teams.member_count name updated_at revision }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
outcomes Found
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
query FindTeamMemberById(
|
|
2
|
+
$tenant_id: TeamMember.tenant_id,
|
|
3
|
+
$user_id: TeamMember.user_id,
|
|
4
|
+
$team_member_id: TeamMember.team_member_id,
|
|
5
|
+
) {
|
|
6
|
+
many team_members from TeamMember
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& user_id == $user_id
|
|
9
|
+
&& team_member_id == $team_member_id
|
|
10
|
+
order by team_member_id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
team_members: team_members { user_id team_member_id created_at membership_key reveals team_members.membership_key team_id revision }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
outcomes Found
|
|
18
|
+
}
|
package/profiles/organization-security/riffdb/queries/find_team_member_by_membership_key.riffq
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
query FindTeamMemberByMembershipKey(
|
|
2
|
+
$tenant_id: TeamMember.tenant_id,
|
|
3
|
+
$membership_key: TeamMember.membership_key,
|
|
4
|
+
) {
|
|
5
|
+
many team_members from TeamMember
|
|
6
|
+
where tenant_id == $tenant_id
|
|
7
|
+
&& membership_key == $membership_key
|
|
8
|
+
order by user_id asc, team_member_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
team_members: team_members { user_id team_member_id created_at membership_key reveals team_members.membership_key team_id revision }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
outcomes Found
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query FindTeamMemberByTeamId(
|
|
2
|
+
$tenant_id: TeamMember.tenant_id,
|
|
3
|
+
$team_id: TeamMember.team_id,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many team_members from TeamMember
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& team_id == $team_id
|
|
9
|
+
order by user_id asc, team_member_id asc
|
|
10
|
+
take 50 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
team_members: team_members { user_id team_member_id created_at membership_key reveals team_members.membership_key team_id revision }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
query FindTwoFactorById(
|
|
2
|
+
$tenant_id: TwoFactor.tenant_id,
|
|
3
|
+
$user_id: TwoFactor.user_id,
|
|
4
|
+
$two_factor_id: TwoFactor.two_factor_id,
|
|
5
|
+
) {
|
|
6
|
+
many two_factors from TwoFactor
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& user_id == $user_id
|
|
9
|
+
&& two_factor_id == $two_factor_id
|
|
10
|
+
order by two_factor_id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
two_factors: two_factors { user_id two_factor_id backup_codes reveals two_factors.backup_codes failed_verification_count reveals two_factors.failed_verification_count locked_until reveals two_factors.locked_until secret reveals two_factors.secret verified revision }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
outcomes Found
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query FindTwoFactorBySecret(
|
|
2
|
+
$tenant_id: TwoFactor.tenant_id,
|
|
3
|
+
$secret: TwoFactor.secret,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many two_factors from TwoFactor
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& secret == $secret
|
|
9
|
+
order by user_id asc, two_factor_id asc
|
|
10
|
+
take 50 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
two_factors: two_factors { user_id two_factor_id backup_codes reveals two_factors.backup_codes failed_verification_count reveals two_factors.failed_verification_count locked_until reveals two_factors.locked_until secret reveals two_factors.secret verified revision }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
query FindUserByEmail(
|
|
2
|
+
$tenant_id: User.tenant_id,
|
|
3
|
+
$email: User.email,
|
|
4
|
+
) {
|
|
5
|
+
many users from User
|
|
6
|
+
where tenant_id == $tenant_id
|
|
7
|
+
&& email == $email
|
|
8
|
+
order by user_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
users: users { user_id created_at email email_verified image locale name two_factor_enabled updated_at revision }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
outcomes Found
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
query FindUserById(
|
|
2
|
+
$tenant_id: User.tenant_id,
|
|
3
|
+
$user_id: User.user_id,
|
|
4
|
+
) {
|
|
5
|
+
many users from User
|
|
6
|
+
where tenant_id == $tenant_id
|
|
7
|
+
&& user_id == $user_id
|
|
8
|
+
order by user_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
users: users { user_id created_at email email_verified image locale name two_factor_enabled updated_at revision }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
outcomes Found
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
query FindVerificationById(
|
|
2
|
+
$tenant_id: Verification.tenant_id,
|
|
3
|
+
$verification_id: Verification.verification_id,
|
|
4
|
+
) {
|
|
5
|
+
many verifications from Verification
|
|
6
|
+
where tenant_id == $tenant_id
|
|
7
|
+
&& verification_id == $verification_id
|
|
8
|
+
order by verification_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
verifications: verifications { verification_id created_at expires_at identifier updated_at value reveals verifications.value revision }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
outcomes Found
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query FindVerificationByIdentifier(
|
|
2
|
+
$tenant_id: Verification.tenant_id,
|
|
3
|
+
$identifier: Verification.identifier,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many verifications from Verification
|
|
7
|
+
where tenant_id == $tenant_id
|
|
8
|
+
&& identifier == $identifier
|
|
9
|
+
order by verification_id asc
|
|
10
|
+
take 50 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
verifications: verifications { verification_id created_at expires_at identifier updated_at value reveals verifications.value revision }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "riffdb.application-source/v6",
|
|
3
|
+
"application": "better-auth-organization-security",
|
|
4
|
+
"contract": {
|
|
5
|
+
"source": "riffdb/contract.riff",
|
|
6
|
+
"lineage": "BetterAuthOrganizationSecurity",
|
|
7
|
+
"version": 1
|
|
8
|
+
},
|
|
9
|
+
"generation": {
|
|
10
|
+
"go": "generated/go/client.go",
|
|
11
|
+
"mcp": "generated/mcp/tools.json",
|
|
12
|
+
"python": "generated/python/client.py",
|
|
13
|
+
"rust": "generated/rust/client.rs",
|
|
14
|
+
"typescript": "src/generated/client.ts"
|
|
15
|
+
},
|
|
16
|
+
"migrations": [],
|
|
17
|
+
"query_modules": [
|
|
18
|
+
{
|
|
19
|
+
"name": "better_auth_organization_security",
|
|
20
|
+
"version": 1,
|
|
21
|
+
"queries": [
|
|
22
|
+
{
|
|
23
|
+
"name": "FindAccountById",
|
|
24
|
+
"source": "riffdb/queries/find_account_by_id.riffq"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "FindInvitationById",
|
|
28
|
+
"source": "riffdb/queries/find_invitation_by_id.riffq"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "FindInvitationByEmail",
|
|
32
|
+
"source": "riffdb/queries/find_invitation_by_email.riffq"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "FindInvitationByOrganizationId",
|
|
36
|
+
"source": "riffdb/queries/find_invitation_by_organization_id.riffq"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "FindMemberById",
|
|
40
|
+
"source": "riffdb/queries/find_member_by_id.riffq"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "FindMemberByUserId",
|
|
44
|
+
"source": "riffdb/queries/find_member_by_user_id.riffq"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "FindOrganizationById",
|
|
48
|
+
"source": "riffdb/queries/find_organization_by_id.riffq"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "FindOrganizationBySlug",
|
|
52
|
+
"source": "riffdb/queries/find_organization_by_slug.riffq"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "FindSessionById",
|
|
56
|
+
"source": "riffdb/queries/find_session_by_id.riffq"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "FindSessionByToken",
|
|
60
|
+
"source": "riffdb/queries/find_session_by_token.riffq"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "FindTeamById",
|
|
64
|
+
"source": "riffdb/queries/find_team_by_id.riffq"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "FindTeamMemberById",
|
|
68
|
+
"source": "riffdb/queries/find_team_member_by_id.riffq"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "FindTeamMemberByMembershipKey",
|
|
72
|
+
"source": "riffdb/queries/find_team_member_by_membership_key.riffq"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "FindTeamMemberByTeamId",
|
|
76
|
+
"source": "riffdb/queries/find_team_member_by_team_id.riffq"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "FindTwoFactorById",
|
|
80
|
+
"source": "riffdb/queries/find_two_factor_by_id.riffq"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "FindTwoFactorBySecret",
|
|
84
|
+
"source": "riffdb/queries/find_two_factor_by_secret.riffq"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "FindUserById",
|
|
88
|
+
"source": "riffdb/queries/find_user_by_id.riffq"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "FindUserByEmail",
|
|
92
|
+
"source": "riffdb/queries/find_user_by_email.riffq"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "FindVerificationById",
|
|
96
|
+
"source": "riffdb/queries/find_verification_by_id.riffq"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "FindVerificationByIdentifier",
|
|
100
|
+
"source": "riffdb/queries/find_verification_by_identifier.riffq"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"reactive_modules": [],
|
|
106
|
+
"roles": [
|
|
107
|
+
{
|
|
108
|
+
"name": "BetterAuthServer",
|
|
109
|
+
"environment": "development",
|
|
110
|
+
"tenant_scope": "global",
|
|
111
|
+
"queries": [
|
|
112
|
+
"FindAccountById",
|
|
113
|
+
"FindInvitationById",
|
|
114
|
+
"FindInvitationByEmail",
|
|
115
|
+
"FindInvitationByOrganizationId",
|
|
116
|
+
"FindMemberById",
|
|
117
|
+
"FindMemberByUserId",
|
|
118
|
+
"FindOrganizationById",
|
|
119
|
+
"FindOrganizationBySlug",
|
|
120
|
+
"FindSessionById",
|
|
121
|
+
"FindSessionByToken",
|
|
122
|
+
"FindTeamById",
|
|
123
|
+
"FindTeamMemberById",
|
|
124
|
+
"FindTeamMemberByMembershipKey",
|
|
125
|
+
"FindTeamMemberByTeamId",
|
|
126
|
+
"FindTwoFactorById",
|
|
127
|
+
"FindTwoFactorBySecret",
|
|
128
|
+
"FindUserById",
|
|
129
|
+
"FindUserByEmail",
|
|
130
|
+
"FindVerificationById",
|
|
131
|
+
"FindVerificationByIdentifier"
|
|
132
|
+
],
|
|
133
|
+
"commands": [
|
|
134
|
+
"CreateAccount",
|
|
135
|
+
"UpdateAccount",
|
|
136
|
+
"DeleteAccount",
|
|
137
|
+
"CreateInvitation",
|
|
138
|
+
"UpdateInvitation",
|
|
139
|
+
"DeleteInvitation",
|
|
140
|
+
"CreateMember",
|
|
141
|
+
"UpdateMember",
|
|
142
|
+
"DeleteMember",
|
|
143
|
+
"CreateOrganization",
|
|
144
|
+
"UpdateOrganization",
|
|
145
|
+
"DeleteOrganization",
|
|
146
|
+
"CreateSession",
|
|
147
|
+
"UpdateSession",
|
|
148
|
+
"DeleteSession",
|
|
149
|
+
"CreateTeam",
|
|
150
|
+
"UpdateTeam",
|
|
151
|
+
"DeleteTeam",
|
|
152
|
+
"CreateTeamMember",
|
|
153
|
+
"UpdateTeamMember",
|
|
154
|
+
"DeleteTeamMember",
|
|
155
|
+
"CreateTwoFactor",
|
|
156
|
+
"UpdateTwoFactor",
|
|
157
|
+
"DeleteTwoFactor",
|
|
158
|
+
"CreateUser",
|
|
159
|
+
"UpdateUser",
|
|
160
|
+
"DeleteUser",
|
|
161
|
+
"CreateVerification",
|
|
162
|
+
"UpdateVerification",
|
|
163
|
+
"DeleteVerification"
|
|
164
|
+
],
|
|
165
|
+
"event_streams": [],
|
|
166
|
+
"watch_queries": [],
|
|
167
|
+
"agent_subscriptions": [],
|
|
168
|
+
"row_policies": []
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"seed_inputs": []
|
|
172
|
+
}
|