@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,24 @@
|
|
|
1
|
+
query AdminUsersAllEmailAsc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$minimum_email: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& email >= $minimum_email
|
|
11
|
+
&& when $user_id { user_id == $user_id }
|
|
12
|
+
order by email asc, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query AdminUsersContainsAsc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$needle: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& when $user_id { user_id == $user_id }
|
|
11
|
+
&& email contains $needle
|
|
12
|
+
order by email asc, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query AdminUsersContainsDesc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$needle: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& when $user_id { user_id == $user_id }
|
|
11
|
+
&& email contains $needle
|
|
12
|
+
order by email desc, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query AdminUsersEmailContainsCreatedDesc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$needle: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& when $user_id { user_id == $user_id }
|
|
11
|
+
&& email contains $needle
|
|
12
|
+
order by created_at desc, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query AdminUsersEmailContainsImageAsc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$needle: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& when $user_id { user_id == $user_id }
|
|
11
|
+
&& email contains $needle
|
|
12
|
+
order by image asc nulls last, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query AdminUsersEndsWithAsc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$needle: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& when $user_id { user_id == $user_id }
|
|
11
|
+
&& email ends_with $needle
|
|
12
|
+
order by email asc, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query AdminUsersEndsWithDesc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$needle: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& when $user_id { user_id == $user_id }
|
|
11
|
+
&& email ends_with $needle
|
|
12
|
+
order by email desc, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query AdminUsersStartsWithAsc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$needle: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& when $user_id { user_id == $user_id }
|
|
11
|
+
&& email starts_with $needle
|
|
12
|
+
order by email asc, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query AdminUsersStartsWithDesc(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$needle: User.email,
|
|
4
|
+
$user_id: User.user_id?,
|
|
5
|
+
$limit: Limit<100> = 50,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many users from User
|
|
9
|
+
where organization_id == $organization_id
|
|
10
|
+
&& when $user_id { user_id == $user_id }
|
|
11
|
+
&& email starts_with $needle
|
|
12
|
+
order by email desc, user_id asc
|
|
13
|
+
take $limit offset $offset
|
|
14
|
+
|
|
15
|
+
aggregate total from users { exact_count() as value }
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users {
|
|
19
|
+
organization_id user_id name email email_verified image created_at updated_at revision
|
|
20
|
+
date_field locale two_factor_enabled }
|
|
21
|
+
total: total { value }
|
|
22
|
+
}
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
query FindAccountById(
|
|
2
|
+
$organization_id: Account.organization_id,
|
|
3
|
+
$id: Account.id,
|
|
4
|
+
) {
|
|
5
|
+
many accounts from Account
|
|
6
|
+
where organization_id == $organization_id
|
|
7
|
+
&& id == $id
|
|
8
|
+
order by user_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
accounts: accounts {
|
|
13
|
+
id user_id account_id provider_id
|
|
14
|
+
access_token reveals accounts.access_token
|
|
15
|
+
refresh_token reveals accounts.refresh_token
|
|
16
|
+
access_token_expires_at refresh_token_expires_at scope
|
|
17
|
+
id_token reveals accounts.id_token
|
|
18
|
+
password reveals accounts.password
|
|
19
|
+
created_at updated_at revision
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
outcomes Found
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
query FindAccountByProvider(
|
|
2
|
+
$organization_id: Account.organization_id,
|
|
3
|
+
$account_id: Account.account_id,
|
|
4
|
+
$provider_id: Account.provider_id,
|
|
5
|
+
) {
|
|
6
|
+
many accounts from Account
|
|
7
|
+
where organization_id == $organization_id
|
|
8
|
+
&& provider_id == $provider_id
|
|
9
|
+
&& account_id == $account_id
|
|
10
|
+
order by user_id asc, id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
accounts: accounts {
|
|
15
|
+
id user_id account_id provider_id
|
|
16
|
+
access_token reveals accounts.access_token
|
|
17
|
+
refresh_token reveals accounts.refresh_token
|
|
18
|
+
access_token_expires_at refresh_token_expires_at scope
|
|
19
|
+
id_token reveals accounts.id_token
|
|
20
|
+
password reveals accounts.password
|
|
21
|
+
created_at updated_at revision
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
outcomes Found
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
query FindAccountsByUserId(
|
|
2
|
+
$organization_id: Account.organization_id,
|
|
3
|
+
$user_id: Account.user_id,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many accounts from Account
|
|
7
|
+
where organization_id == $organization_id
|
|
8
|
+
&& user_id == $user_id
|
|
9
|
+
order by id asc
|
|
10
|
+
take 100 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
accounts: accounts {
|
|
14
|
+
id user_id account_id provider_id
|
|
15
|
+
access_token reveals accounts.access_token
|
|
16
|
+
refresh_token reveals accounts.refresh_token
|
|
17
|
+
access_token_expires_at refresh_token_expires_at scope
|
|
18
|
+
id_token reveals accounts.id_token
|
|
19
|
+
password reveals accounts.password
|
|
20
|
+
created_at updated_at revision
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
outcomes Found
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
query FindAccountsByUserProvider(
|
|
2
|
+
$organization_id: Account.organization_id,
|
|
3
|
+
$user_id: Account.user_id,
|
|
4
|
+
$provider_id: Account.provider_id,
|
|
5
|
+
$after: Cursor?,
|
|
6
|
+
) {
|
|
7
|
+
many accounts from Account
|
|
8
|
+
where organization_id == $organization_id
|
|
9
|
+
&& user_id == $user_id
|
|
10
|
+
&& provider_id == $provider_id
|
|
11
|
+
order by id asc
|
|
12
|
+
take 8 after $after
|
|
13
|
+
|
|
14
|
+
return Found {
|
|
15
|
+
accounts: accounts {
|
|
16
|
+
id user_id account_id provider_id
|
|
17
|
+
access_token reveals accounts.access_token
|
|
18
|
+
refresh_token reveals accounts.refresh_token
|
|
19
|
+
access_token_expires_at refresh_token_expires_at scope
|
|
20
|
+
id_token reveals accounts.id_token
|
|
21
|
+
password reveals accounts.password
|
|
22
|
+
created_at updated_at revision
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
outcomes Found
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
query FindActiveSessionsByUserId(
|
|
2
|
+
$organization_id: Session.organization_id,
|
|
3
|
+
$user_id: Session.user_id,
|
|
4
|
+
$expires_after: Session.expires_at,
|
|
5
|
+
$after: Cursor?,
|
|
6
|
+
) {
|
|
7
|
+
many sessions from Session
|
|
8
|
+
where organization_id == $organization_id
|
|
9
|
+
&& user_id == $user_id
|
|
10
|
+
&& expires_at > $expires_after
|
|
11
|
+
order by expires_at asc, id asc
|
|
12
|
+
take 32 after $after
|
|
13
|
+
|
|
14
|
+
return Found {
|
|
15
|
+
sessions: sessions {
|
|
16
|
+
id user_id
|
|
17
|
+
token reveals sessions.token
|
|
18
|
+
expires_at ip_address user_agent created_at updated_at revision
|
|
19
|
+
active_organization_id }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
outcomes Found
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
query FindCredentialAccount(
|
|
2
|
+
$organization_id: Account.organization_id,
|
|
3
|
+
$user_id: Account.user_id,
|
|
4
|
+
$account_id: Account.account_id,
|
|
5
|
+
$provider_id: Account.provider_id,
|
|
6
|
+
) {
|
|
7
|
+
many accounts from Account
|
|
8
|
+
where organization_id == $organization_id
|
|
9
|
+
&& provider_id == $provider_id
|
|
10
|
+
&& account_id == $account_id
|
|
11
|
+
&& user_id == $user_id
|
|
12
|
+
order by id asc
|
|
13
|
+
take 1
|
|
14
|
+
return Found {
|
|
15
|
+
accounts: accounts {
|
|
16
|
+
organization_id user_id id account_id provider_id
|
|
17
|
+
access_token reveals accounts.access_token
|
|
18
|
+
refresh_token reveals accounts.refresh_token
|
|
19
|
+
id_token reveals accounts.id_token
|
|
20
|
+
password reveals accounts.password
|
|
21
|
+
access_token_expires_at refresh_token_expires_at scope created_at updated_at revision
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
outcomes Found
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query FindExpiredVerificationIds(
|
|
2
|
+
$organization_id: Verification.organization_id,
|
|
3
|
+
$expires_before: Verification.expires_at,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many verifications from Verification
|
|
7
|
+
where organization_id == $organization_id
|
|
8
|
+
&& expires_at < $expires_before
|
|
9
|
+
order by expires_at asc, verification_id asc
|
|
10
|
+
take 32 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
verifications: verifications { verification_id }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
query FindLatestVerification(
|
|
2
|
+
$organization_id: Verification.organization_id,
|
|
3
|
+
$identifier: Verification.identifier,
|
|
4
|
+
) {
|
|
5
|
+
many verifications from Verification
|
|
6
|
+
where organization_id == $organization_id
|
|
7
|
+
&& identifier == $identifier
|
|
8
|
+
order by created_at desc, verification_id desc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
verifications: verifications {
|
|
13
|
+
verification_id identifier
|
|
14
|
+
value reveals verifications.value
|
|
15
|
+
expires_at created_at updated_at revision
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
outcomes Found
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
query FindSessionById(
|
|
2
|
+
$organization_id: Session.organization_id,
|
|
3
|
+
$id: Session.id,
|
|
4
|
+
) {
|
|
5
|
+
many sessions from Session
|
|
6
|
+
where organization_id == $organization_id
|
|
7
|
+
&& id == $id
|
|
8
|
+
order by user_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
sessions: sessions {
|
|
13
|
+
id user_id
|
|
14
|
+
token reveals sessions.token
|
|
15
|
+
expires_at ip_address user_agent created_at updated_at revision
|
|
16
|
+
active_organization_id }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
outcomes Found
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
query FindSessionByToken(
|
|
2
|
+
$organization_id: Session.organization_id,
|
|
3
|
+
$token: Session.token,
|
|
4
|
+
) {
|
|
5
|
+
many sessions from Session
|
|
6
|
+
where organization_id == $organization_id
|
|
7
|
+
&& token == $token
|
|
8
|
+
order by user_id asc, id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
sessions: sessions {
|
|
13
|
+
id user_id
|
|
14
|
+
token reveals sessions.token
|
|
15
|
+
expires_at ip_address user_agent created_at updated_at revision
|
|
16
|
+
active_organization_id }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
outcomes Found
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
query FindSessionsByTokenSet(
|
|
2
|
+
$organization_id: Session.organization_id,
|
|
3
|
+
$tokens: Set<Session.token>,
|
|
4
|
+
) {
|
|
5
|
+
many sessions from Session
|
|
6
|
+
where organization_id == $organization_id
|
|
7
|
+
&& token in $tokens
|
|
8
|
+
order by token asc, user_id asc, id asc
|
|
9
|
+
take 32
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
sessions: sessions {
|
|
13
|
+
id user_id
|
|
14
|
+
token reveals sessions.token
|
|
15
|
+
expires_at ip_address user_agent created_at updated_at revision
|
|
16
|
+
active_organization_id }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
outcomes Found
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
query FindSessionsByUserId(
|
|
2
|
+
$organization_id: Session.organization_id,
|
|
3
|
+
$user_id: Session.user_id,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many sessions from Session
|
|
7
|
+
where organization_id == $organization_id
|
|
8
|
+
&& user_id == $user_id
|
|
9
|
+
order by id asc
|
|
10
|
+
take 32 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
sessions: sessions {
|
|
14
|
+
id user_id
|
|
15
|
+
token reveals sessions.token
|
|
16
|
+
expires_at ip_address user_agent created_at updated_at revision
|
|
17
|
+
active_organization_id }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
outcomes Found
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
query FindUserByEmail(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$email: User.email,
|
|
4
|
+
) {
|
|
5
|
+
many users from User
|
|
6
|
+
where organization_id == $organization_id
|
|
7
|
+
&& email == $email
|
|
8
|
+
order by user_id asc
|
|
9
|
+
take 1
|
|
10
|
+
|
|
11
|
+
return Found {
|
|
12
|
+
users: users { user_id name email email_verified image created_at updated_at revision date_field locale two_factor_enabled }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
outcomes Found
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
query FindUserById(
|
|
2
|
+
$organization_id: User.organization_id,
|
|
3
|
+
$id: User.user_id,
|
|
4
|
+
) {
|
|
5
|
+
one user from User
|
|
6
|
+
where organization_id == $organization_id
|
|
7
|
+
&& user_id == $id
|
|
8
|
+
else Missing
|
|
9
|
+
|
|
10
|
+
return Found {
|
|
11
|
+
user: user { user_id name email email_verified image created_at updated_at revision date_field locale two_factor_enabled }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
outcomes Found | Missing
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
query FindVerificationById(
|
|
2
|
+
$organization_id: Verification.organization_id,
|
|
3
|
+
$id: Verification.verification_id,
|
|
4
|
+
) {
|
|
5
|
+
one verification from Verification
|
|
6
|
+
where organization_id == $organization_id
|
|
7
|
+
&& verification_id == $id
|
|
8
|
+
else Missing
|
|
9
|
+
|
|
10
|
+
return Found {
|
|
11
|
+
verification: verification {
|
|
12
|
+
verification_id identifier
|
|
13
|
+
value reveals verification.value
|
|
14
|
+
expires_at created_at updated_at revision
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
outcomes Found | Missing
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
query FindVerificationsByIdentifier(
|
|
2
|
+
$organization_id: Verification.organization_id,
|
|
3
|
+
$identifier: Verification.identifier,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
) {
|
|
6
|
+
many verifications from Verification
|
|
7
|
+
where organization_id == $organization_id
|
|
8
|
+
&& identifier == $identifier
|
|
9
|
+
order by created_at desc, verification_id desc
|
|
10
|
+
take 32 after $after
|
|
11
|
+
|
|
12
|
+
return Found {
|
|
13
|
+
verifications: verifications {
|
|
14
|
+
verification_id identifier
|
|
15
|
+
value reveals verifications.value
|
|
16
|
+
expires_at created_at updated_at revision
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
outcomes Found
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
query ProfileAccountWithUserByProvider(
|
|
2
|
+
$organization_id: Account.organization_id,
|
|
3
|
+
$account_id: Account.account_id,
|
|
4
|
+
$provider_id: Account.provider_id,
|
|
5
|
+
) {
|
|
6
|
+
many accounts from Account
|
|
7
|
+
where organization_id == $organization_id
|
|
8
|
+
&& provider_id == $provider_id
|
|
9
|
+
&& account_id == $account_id
|
|
10
|
+
order by user_id asc, id asc
|
|
11
|
+
take 1
|
|
12
|
+
|
|
13
|
+
many users from User
|
|
14
|
+
where organization_id == $organization_id && user_id in distinct(accounts.user_id)
|
|
15
|
+
take 1
|
|
16
|
+
|
|
17
|
+
return Found {
|
|
18
|
+
users: users { user_id name email email_verified image created_at updated_at revision date_field locale two_factor_enabled }
|
|
19
|
+
accounts: accounts {
|
|
20
|
+
id user_id account_id provider_id
|
|
21
|
+
access_token reveals accounts.access_token
|
|
22
|
+
refresh_token reveals accounts.refresh_token
|
|
23
|
+
access_token_expires_at refresh_token_expires_at scope
|
|
24
|
+
id_token reveals accounts.id_token
|
|
25
|
+
password reveals accounts.password
|
|
26
|
+
created_at updated_at revision
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
outcomes Found
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query ProfileInvitationByEmail(
|
|
2
|
+
$organization_id: Invitation.organization_id,
|
|
3
|
+
$email: Invitation.email,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
$limit: Limit<100> = 100,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many rows from Invitation
|
|
9
|
+
where organization_id == $organization_id && email == $email
|
|
10
|
+
order by invitation_id asc
|
|
11
|
+
take $limit after $after
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
rows: rows { invitation_id created_at email expires_at inviter_id org_id role status revision }
|
|
15
|
+
}
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
query ProfileInvitationById(
|
|
2
|
+
$organization_id: Invitation.organization_id,
|
|
3
|
+
$id: Invitation.invitation_id,
|
|
4
|
+
$after: Cursor?,
|
|
5
|
+
$limit: Limit<100> = 100,
|
|
6
|
+
$offset: u64 = 0
|
|
7
|
+
) {
|
|
8
|
+
many rows from Invitation
|
|
9
|
+
where organization_id == $organization_id && invitation_id == $id
|
|
10
|
+
order by invitation_id asc
|
|
11
|
+
take $limit after $after
|
|
12
|
+
|
|
13
|
+
return Found {
|
|
14
|
+
rows: rows { invitation_id created_at email expires_at inviter_id org_id role status revision }
|
|
15
|
+
}
|
|
16
|
+
outcomes Found
|
|
17
|
+
}
|