@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,2578 @@
|
|
|
1
|
+
// Code generated by riffdb-query-module. DO NOT EDIT.
|
|
2
|
+
package riffdb_better_auth_core
|
|
3
|
+
|
|
4
|
+
import (
|
|
5
|
+
"context"
|
|
6
|
+
"errors"
|
|
7
|
+
"sync"
|
|
8
|
+
|
|
9
|
+
riffdb "riffdb.dev/application"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
const QueryModuleHash = "eec91a84b8d7f5372ce91cbc9bbead58a6a49f16f0acd5f8ef813a47070d0a21"
|
|
13
|
+
const ContractLineage = "BetterAuthCustomFields"
|
|
14
|
+
const ContractVersion uint64 = 1
|
|
15
|
+
const ContractBundleHash = "78db5a4be0e3f6edb09d1e743703e53171b7cacea589a9fac33d2e1fea33c374"
|
|
16
|
+
|
|
17
|
+
type QuerySecretOutput struct { Query string; Entity string; Field string }
|
|
18
|
+
|
|
19
|
+
type QueryOptions = riffdb.Options
|
|
20
|
+
type QueryIdentity struct { ContractLineage string; ContractVersion uint64; ContractBundleHash string; ModuleHash string; QueryName string; PlanHash string }
|
|
21
|
+
type QueryResult[T any] struct { Value T; Identity QueryIdentity; ApplicationHead uint64; NextCursor string }
|
|
22
|
+
type WorkflowSuccessorRevision struct { Binding string; Revision uint64 }
|
|
23
|
+
type CommandResult[T any] struct { Outcome T; CommitSequence *uint64; ContractVersion uint64; PlanHash string; Replayed bool; OutcomeURI string; WorkflowRevisions []WorkflowSuccessorRevision }
|
|
24
|
+
type BatchItem[T any] struct { Index uint32; Result *CommandResult[T]; Error error }
|
|
25
|
+
type BatchResult[T any] struct { Items []BatchItem[T]; Checkpoint uint32; Total uint32 }
|
|
26
|
+
|
|
27
|
+
type User struct {
|
|
28
|
+
Name string
|
|
29
|
+
Email string
|
|
30
|
+
Image *string
|
|
31
|
+
Locale *string
|
|
32
|
+
UserId string
|
|
33
|
+
Revision uint64
|
|
34
|
+
CreatedAt riffdb.Instant
|
|
35
|
+
DateField *riffdb.Instant
|
|
36
|
+
UpdatedAt riffdb.Instant
|
|
37
|
+
EmailVerified bool
|
|
38
|
+
OrganizationId string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type Tenant struct {
|
|
42
|
+
OrganizationId string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type Account struct {
|
|
46
|
+
Id string
|
|
47
|
+
Scope *string
|
|
48
|
+
UserId string
|
|
49
|
+
IdToken *string
|
|
50
|
+
Password *string
|
|
51
|
+
Revision uint64
|
|
52
|
+
AccountId string
|
|
53
|
+
CreatedAt riffdb.Instant
|
|
54
|
+
UpdatedAt riffdb.Instant
|
|
55
|
+
ProviderId string
|
|
56
|
+
AccessToken *string
|
|
57
|
+
RefreshToken *string
|
|
58
|
+
OrganizationId string
|
|
59
|
+
AccessTokenExpiresAt *riffdb.Instant
|
|
60
|
+
RefreshTokenExpiresAt *riffdb.Instant
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type Session struct {
|
|
64
|
+
Id string
|
|
65
|
+
Token string
|
|
66
|
+
UserId string
|
|
67
|
+
Revision uint64
|
|
68
|
+
CreatedAt riffdb.Instant
|
|
69
|
+
ExpiresAt riffdb.Instant
|
|
70
|
+
IpAddress *string
|
|
71
|
+
UpdatedAt riffdb.Instant
|
|
72
|
+
UserAgent *string
|
|
73
|
+
OrganizationId string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
type Verification struct {
|
|
77
|
+
Value string
|
|
78
|
+
Revision uint64
|
|
79
|
+
CreatedAt riffdb.Instant
|
|
80
|
+
ExpiresAt riffdb.Instant
|
|
81
|
+
Identifier string
|
|
82
|
+
UpdatedAt riffdb.Instant
|
|
83
|
+
OrganizationId string
|
|
84
|
+
VerificationId string
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
type AccountPasswordUpdate struct {
|
|
88
|
+
UserId string
|
|
89
|
+
Password *string
|
|
90
|
+
AccountId string
|
|
91
|
+
UpdatedAt riffdb.Instant
|
|
92
|
+
ProviderId string
|
|
93
|
+
OrganizationId string
|
|
94
|
+
ExpectedRevision uint64
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
type AdminUsersAllEmailAscParams struct {
|
|
98
|
+
OrganizationId string
|
|
99
|
+
MinimumEmail string
|
|
100
|
+
UserId *string
|
|
101
|
+
Limit *uint32
|
|
102
|
+
Offset *uint64
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
type AdminUsersAllEmailAscResult interface { isAdminUsersAllEmailAscResult() }
|
|
106
|
+
type AdminUsersAllEmailAscFound struct {
|
|
107
|
+
Outcome string
|
|
108
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
109
|
+
Total struct { Value uint64 }
|
|
110
|
+
}
|
|
111
|
+
func (AdminUsersAllEmailAscFound) isAdminUsersAllEmailAscResult() {}
|
|
112
|
+
func IsAdminUsersAllEmailAscFound(value AdminUsersAllEmailAscResult) (AdminUsersAllEmailAscFound, bool) { branch, ok := value.(AdminUsersAllEmailAscFound); return branch, ok }
|
|
113
|
+
|
|
114
|
+
func UnwrapAdminUsersAllEmailAscFound(value AdminUsersAllEmailAscResult) (AdminUsersAllEmailAscFound, error) { if branch, ok := value.(AdminUsersAllEmailAscFound); ok { return branch, nil }; return AdminUsersAllEmailAscFound{}, errors.New("expected AdminUsersAllEmailAsc outcome found") }
|
|
115
|
+
type AdminUsersContainsAscParams struct {
|
|
116
|
+
OrganizationId string
|
|
117
|
+
Needle string
|
|
118
|
+
UserId *string
|
|
119
|
+
Limit *uint32
|
|
120
|
+
Offset *uint64
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
type AdminUsersContainsAscResult interface { isAdminUsersContainsAscResult() }
|
|
124
|
+
type AdminUsersContainsAscFound struct {
|
|
125
|
+
Outcome string
|
|
126
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
127
|
+
Total struct { Value uint64 }
|
|
128
|
+
}
|
|
129
|
+
func (AdminUsersContainsAscFound) isAdminUsersContainsAscResult() {}
|
|
130
|
+
func IsAdminUsersContainsAscFound(value AdminUsersContainsAscResult) (AdminUsersContainsAscFound, bool) { branch, ok := value.(AdminUsersContainsAscFound); return branch, ok }
|
|
131
|
+
|
|
132
|
+
func UnwrapAdminUsersContainsAscFound(value AdminUsersContainsAscResult) (AdminUsersContainsAscFound, error) { if branch, ok := value.(AdminUsersContainsAscFound); ok { return branch, nil }; return AdminUsersContainsAscFound{}, errors.New("expected AdminUsersContainsAsc outcome found") }
|
|
133
|
+
type AdminUsersContainsDescParams struct {
|
|
134
|
+
OrganizationId string
|
|
135
|
+
Needle string
|
|
136
|
+
UserId *string
|
|
137
|
+
Limit *uint32
|
|
138
|
+
Offset *uint64
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
type AdminUsersContainsDescResult interface { isAdminUsersContainsDescResult() }
|
|
142
|
+
type AdminUsersContainsDescFound struct {
|
|
143
|
+
Outcome string
|
|
144
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
145
|
+
Total struct { Value uint64 }
|
|
146
|
+
}
|
|
147
|
+
func (AdminUsersContainsDescFound) isAdminUsersContainsDescResult() {}
|
|
148
|
+
func IsAdminUsersContainsDescFound(value AdminUsersContainsDescResult) (AdminUsersContainsDescFound, bool) { branch, ok := value.(AdminUsersContainsDescFound); return branch, ok }
|
|
149
|
+
|
|
150
|
+
func UnwrapAdminUsersContainsDescFound(value AdminUsersContainsDescResult) (AdminUsersContainsDescFound, error) { if branch, ok := value.(AdminUsersContainsDescFound); ok { return branch, nil }; return AdminUsersContainsDescFound{}, errors.New("expected AdminUsersContainsDesc outcome found") }
|
|
151
|
+
type AdminUsersEmailContainsCreatedDescParams struct {
|
|
152
|
+
OrganizationId string
|
|
153
|
+
Needle string
|
|
154
|
+
UserId *string
|
|
155
|
+
Limit *uint32
|
|
156
|
+
Offset *uint64
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
type AdminUsersEmailContainsCreatedDescResult interface { isAdminUsersEmailContainsCreatedDescResult() }
|
|
160
|
+
type AdminUsersEmailContainsCreatedDescFound struct {
|
|
161
|
+
Outcome string
|
|
162
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
163
|
+
Total struct { Value uint64 }
|
|
164
|
+
}
|
|
165
|
+
func (AdminUsersEmailContainsCreatedDescFound) isAdminUsersEmailContainsCreatedDescResult() {}
|
|
166
|
+
func IsAdminUsersEmailContainsCreatedDescFound(value AdminUsersEmailContainsCreatedDescResult) (AdminUsersEmailContainsCreatedDescFound, bool) { branch, ok := value.(AdminUsersEmailContainsCreatedDescFound); return branch, ok }
|
|
167
|
+
|
|
168
|
+
func UnwrapAdminUsersEmailContainsCreatedDescFound(value AdminUsersEmailContainsCreatedDescResult) (AdminUsersEmailContainsCreatedDescFound, error) { if branch, ok := value.(AdminUsersEmailContainsCreatedDescFound); ok { return branch, nil }; return AdminUsersEmailContainsCreatedDescFound{}, errors.New("expected AdminUsersEmailContainsCreatedDesc outcome found") }
|
|
169
|
+
type AdminUsersEmailContainsImageAscParams struct {
|
|
170
|
+
OrganizationId string
|
|
171
|
+
Needle string
|
|
172
|
+
UserId *string
|
|
173
|
+
Limit *uint32
|
|
174
|
+
Offset *uint64
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
type AdminUsersEmailContainsImageAscResult interface { isAdminUsersEmailContainsImageAscResult() }
|
|
178
|
+
type AdminUsersEmailContainsImageAscFound struct {
|
|
179
|
+
Outcome string
|
|
180
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
181
|
+
Total struct { Value uint64 }
|
|
182
|
+
}
|
|
183
|
+
func (AdminUsersEmailContainsImageAscFound) isAdminUsersEmailContainsImageAscResult() {}
|
|
184
|
+
func IsAdminUsersEmailContainsImageAscFound(value AdminUsersEmailContainsImageAscResult) (AdminUsersEmailContainsImageAscFound, bool) { branch, ok := value.(AdminUsersEmailContainsImageAscFound); return branch, ok }
|
|
185
|
+
|
|
186
|
+
func UnwrapAdminUsersEmailContainsImageAscFound(value AdminUsersEmailContainsImageAscResult) (AdminUsersEmailContainsImageAscFound, error) { if branch, ok := value.(AdminUsersEmailContainsImageAscFound); ok { return branch, nil }; return AdminUsersEmailContainsImageAscFound{}, errors.New("expected AdminUsersEmailContainsImageAsc outcome found") }
|
|
187
|
+
type AdminUsersEndsWithAscParams struct {
|
|
188
|
+
OrganizationId string
|
|
189
|
+
Needle string
|
|
190
|
+
UserId *string
|
|
191
|
+
Limit *uint32
|
|
192
|
+
Offset *uint64
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
type AdminUsersEndsWithAscResult interface { isAdminUsersEndsWithAscResult() }
|
|
196
|
+
type AdminUsersEndsWithAscFound struct {
|
|
197
|
+
Outcome string
|
|
198
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
199
|
+
Total struct { Value uint64 }
|
|
200
|
+
}
|
|
201
|
+
func (AdminUsersEndsWithAscFound) isAdminUsersEndsWithAscResult() {}
|
|
202
|
+
func IsAdminUsersEndsWithAscFound(value AdminUsersEndsWithAscResult) (AdminUsersEndsWithAscFound, bool) { branch, ok := value.(AdminUsersEndsWithAscFound); return branch, ok }
|
|
203
|
+
|
|
204
|
+
func UnwrapAdminUsersEndsWithAscFound(value AdminUsersEndsWithAscResult) (AdminUsersEndsWithAscFound, error) { if branch, ok := value.(AdminUsersEndsWithAscFound); ok { return branch, nil }; return AdminUsersEndsWithAscFound{}, errors.New("expected AdminUsersEndsWithAsc outcome found") }
|
|
205
|
+
type AdminUsersEndsWithDescParams struct {
|
|
206
|
+
OrganizationId string
|
|
207
|
+
Needle string
|
|
208
|
+
UserId *string
|
|
209
|
+
Limit *uint32
|
|
210
|
+
Offset *uint64
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
type AdminUsersEndsWithDescResult interface { isAdminUsersEndsWithDescResult() }
|
|
214
|
+
type AdminUsersEndsWithDescFound struct {
|
|
215
|
+
Outcome string
|
|
216
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
217
|
+
Total struct { Value uint64 }
|
|
218
|
+
}
|
|
219
|
+
func (AdminUsersEndsWithDescFound) isAdminUsersEndsWithDescResult() {}
|
|
220
|
+
func IsAdminUsersEndsWithDescFound(value AdminUsersEndsWithDescResult) (AdminUsersEndsWithDescFound, bool) { branch, ok := value.(AdminUsersEndsWithDescFound); return branch, ok }
|
|
221
|
+
|
|
222
|
+
func UnwrapAdminUsersEndsWithDescFound(value AdminUsersEndsWithDescResult) (AdminUsersEndsWithDescFound, error) { if branch, ok := value.(AdminUsersEndsWithDescFound); ok { return branch, nil }; return AdminUsersEndsWithDescFound{}, errors.New("expected AdminUsersEndsWithDesc outcome found") }
|
|
223
|
+
type AdminUsersStartsWithAscParams struct {
|
|
224
|
+
OrganizationId string
|
|
225
|
+
Needle string
|
|
226
|
+
UserId *string
|
|
227
|
+
Limit *uint32
|
|
228
|
+
Offset *uint64
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
type AdminUsersStartsWithAscResult interface { isAdminUsersStartsWithAscResult() }
|
|
232
|
+
type AdminUsersStartsWithAscFound struct {
|
|
233
|
+
Outcome string
|
|
234
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
235
|
+
Total struct { Value uint64 }
|
|
236
|
+
}
|
|
237
|
+
func (AdminUsersStartsWithAscFound) isAdminUsersStartsWithAscResult() {}
|
|
238
|
+
func IsAdminUsersStartsWithAscFound(value AdminUsersStartsWithAscResult) (AdminUsersStartsWithAscFound, bool) { branch, ok := value.(AdminUsersStartsWithAscFound); return branch, ok }
|
|
239
|
+
|
|
240
|
+
func UnwrapAdminUsersStartsWithAscFound(value AdminUsersStartsWithAscResult) (AdminUsersStartsWithAscFound, error) { if branch, ok := value.(AdminUsersStartsWithAscFound); ok { return branch, nil }; return AdminUsersStartsWithAscFound{}, errors.New("expected AdminUsersStartsWithAsc outcome found") }
|
|
241
|
+
type AdminUsersStartsWithDescParams struct {
|
|
242
|
+
OrganizationId string
|
|
243
|
+
Needle string
|
|
244
|
+
UserId *string
|
|
245
|
+
Limit *uint32
|
|
246
|
+
Offset *uint64
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
type AdminUsersStartsWithDescResult interface { isAdminUsersStartsWithDescResult() }
|
|
250
|
+
type AdminUsersStartsWithDescFound struct {
|
|
251
|
+
Outcome string
|
|
252
|
+
Users []struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
253
|
+
Total struct { Value uint64 }
|
|
254
|
+
}
|
|
255
|
+
func (AdminUsersStartsWithDescFound) isAdminUsersStartsWithDescResult() {}
|
|
256
|
+
func IsAdminUsersStartsWithDescFound(value AdminUsersStartsWithDescResult) (AdminUsersStartsWithDescFound, bool) { branch, ok := value.(AdminUsersStartsWithDescFound); return branch, ok }
|
|
257
|
+
|
|
258
|
+
func UnwrapAdminUsersStartsWithDescFound(value AdminUsersStartsWithDescResult) (AdminUsersStartsWithDescFound, error) { if branch, ok := value.(AdminUsersStartsWithDescFound); ok { return branch, nil }; return AdminUsersStartsWithDescFound{}, errors.New("expected AdminUsersStartsWithDesc outcome found") }
|
|
259
|
+
var FindAccountByIdSecretOutputs = []QuerySecretOutput{
|
|
260
|
+
{Query: "FindAccountById", Entity: "Account", Field: "access_token"},
|
|
261
|
+
{Query: "FindAccountById", Entity: "Account", Field: "refresh_token"},
|
|
262
|
+
{Query: "FindAccountById", Entity: "Account", Field: "id_token"},
|
|
263
|
+
{Query: "FindAccountById", Entity: "Account", Field: "password"},
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
type FindAccountByIdParams struct {
|
|
267
|
+
OrganizationId string
|
|
268
|
+
Id string
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
type FindAccountByIdResult interface { isFindAccountByIdResult() }
|
|
272
|
+
type FindAccountByIdFound struct {
|
|
273
|
+
Outcome string
|
|
274
|
+
Accounts []struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
275
|
+
}
|
|
276
|
+
func (FindAccountByIdFound) isFindAccountByIdResult() {}
|
|
277
|
+
func IsFindAccountByIdFound(value FindAccountByIdResult) (FindAccountByIdFound, bool) { branch, ok := value.(FindAccountByIdFound); return branch, ok }
|
|
278
|
+
|
|
279
|
+
func (FindAccountByIdFound) String() string { return "FindAccountByIdFound{<secret outputs redacted>}" }
|
|
280
|
+
func (FindAccountByIdFound) GoString() string { return "FindAccountByIdFound{<secret outputs redacted>}" }
|
|
281
|
+
|
|
282
|
+
func UnwrapFindAccountByIdFound(value FindAccountByIdResult) (FindAccountByIdFound, error) { if branch, ok := value.(FindAccountByIdFound); ok { return branch, nil }; return FindAccountByIdFound{}, errors.New("expected FindAccountById outcome found") }
|
|
283
|
+
var FindAccountByProviderSecretOutputs = []QuerySecretOutput{
|
|
284
|
+
{Query: "FindAccountByProvider", Entity: "Account", Field: "access_token"},
|
|
285
|
+
{Query: "FindAccountByProvider", Entity: "Account", Field: "refresh_token"},
|
|
286
|
+
{Query: "FindAccountByProvider", Entity: "Account", Field: "id_token"},
|
|
287
|
+
{Query: "FindAccountByProvider", Entity: "Account", Field: "password"},
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
type FindAccountByProviderParams struct {
|
|
291
|
+
OrganizationId string
|
|
292
|
+
AccountId string
|
|
293
|
+
ProviderId string
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
type FindAccountByProviderResult interface { isFindAccountByProviderResult() }
|
|
297
|
+
type FindAccountByProviderFound struct {
|
|
298
|
+
Outcome string
|
|
299
|
+
Accounts []struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
300
|
+
}
|
|
301
|
+
func (FindAccountByProviderFound) isFindAccountByProviderResult() {}
|
|
302
|
+
func IsFindAccountByProviderFound(value FindAccountByProviderResult) (FindAccountByProviderFound, bool) { branch, ok := value.(FindAccountByProviderFound); return branch, ok }
|
|
303
|
+
|
|
304
|
+
func (FindAccountByProviderFound) String() string { return "FindAccountByProviderFound{<secret outputs redacted>}" }
|
|
305
|
+
func (FindAccountByProviderFound) GoString() string { return "FindAccountByProviderFound{<secret outputs redacted>}" }
|
|
306
|
+
|
|
307
|
+
func UnwrapFindAccountByProviderFound(value FindAccountByProviderResult) (FindAccountByProviderFound, error) { if branch, ok := value.(FindAccountByProviderFound); ok { return branch, nil }; return FindAccountByProviderFound{}, errors.New("expected FindAccountByProvider outcome found") }
|
|
308
|
+
var FindAccountsByUserIdSecretOutputs = []QuerySecretOutput{
|
|
309
|
+
{Query: "FindAccountsByUserId", Entity: "Account", Field: "access_token"},
|
|
310
|
+
{Query: "FindAccountsByUserId", Entity: "Account", Field: "refresh_token"},
|
|
311
|
+
{Query: "FindAccountsByUserId", Entity: "Account", Field: "id_token"},
|
|
312
|
+
{Query: "FindAccountsByUserId", Entity: "Account", Field: "password"},
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
type FindAccountsByUserIdParams struct {
|
|
316
|
+
OrganizationId string
|
|
317
|
+
UserId string
|
|
318
|
+
After *string
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
type FindAccountsByUserIdResult interface { isFindAccountsByUserIdResult() }
|
|
322
|
+
type FindAccountsByUserIdFound struct {
|
|
323
|
+
Outcome string
|
|
324
|
+
Accounts []struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
325
|
+
}
|
|
326
|
+
func (FindAccountsByUserIdFound) isFindAccountsByUserIdResult() {}
|
|
327
|
+
func IsFindAccountsByUserIdFound(value FindAccountsByUserIdResult) (FindAccountsByUserIdFound, bool) { branch, ok := value.(FindAccountsByUserIdFound); return branch, ok }
|
|
328
|
+
|
|
329
|
+
func (FindAccountsByUserIdFound) String() string { return "FindAccountsByUserIdFound{<secret outputs redacted>}" }
|
|
330
|
+
func (FindAccountsByUserIdFound) GoString() string { return "FindAccountsByUserIdFound{<secret outputs redacted>}" }
|
|
331
|
+
|
|
332
|
+
func UnwrapFindAccountsByUserIdFound(value FindAccountsByUserIdResult) (FindAccountsByUserIdFound, error) { if branch, ok := value.(FindAccountsByUserIdFound); ok { return branch, nil }; return FindAccountsByUserIdFound{}, errors.New("expected FindAccountsByUserId outcome found") }
|
|
333
|
+
var FindAccountsByUserProviderSecretOutputs = []QuerySecretOutput{
|
|
334
|
+
{Query: "FindAccountsByUserProvider", Entity: "Account", Field: "access_token"},
|
|
335
|
+
{Query: "FindAccountsByUserProvider", Entity: "Account", Field: "refresh_token"},
|
|
336
|
+
{Query: "FindAccountsByUserProvider", Entity: "Account", Field: "id_token"},
|
|
337
|
+
{Query: "FindAccountsByUserProvider", Entity: "Account", Field: "password"},
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
type FindAccountsByUserProviderParams struct {
|
|
341
|
+
OrganizationId string
|
|
342
|
+
UserId string
|
|
343
|
+
ProviderId string
|
|
344
|
+
After *string
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
type FindAccountsByUserProviderResult interface { isFindAccountsByUserProviderResult() }
|
|
348
|
+
type FindAccountsByUserProviderFound struct {
|
|
349
|
+
Outcome string
|
|
350
|
+
Accounts []struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
351
|
+
}
|
|
352
|
+
func (FindAccountsByUserProviderFound) isFindAccountsByUserProviderResult() {}
|
|
353
|
+
func IsFindAccountsByUserProviderFound(value FindAccountsByUserProviderResult) (FindAccountsByUserProviderFound, bool) { branch, ok := value.(FindAccountsByUserProviderFound); return branch, ok }
|
|
354
|
+
|
|
355
|
+
func (FindAccountsByUserProviderFound) String() string { return "FindAccountsByUserProviderFound{<secret outputs redacted>}" }
|
|
356
|
+
func (FindAccountsByUserProviderFound) GoString() string { return "FindAccountsByUserProviderFound{<secret outputs redacted>}" }
|
|
357
|
+
|
|
358
|
+
func UnwrapFindAccountsByUserProviderFound(value FindAccountsByUserProviderResult) (FindAccountsByUserProviderFound, error) { if branch, ok := value.(FindAccountsByUserProviderFound); ok { return branch, nil }; return FindAccountsByUserProviderFound{}, errors.New("expected FindAccountsByUserProvider outcome found") }
|
|
359
|
+
var FindActiveSessionsByUserIdSecretOutputs = []QuerySecretOutput{
|
|
360
|
+
{Query: "FindActiveSessionsByUserId", Entity: "Session", Field: "token"},
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
type FindActiveSessionsByUserIdParams struct {
|
|
364
|
+
OrganizationId string
|
|
365
|
+
UserId string
|
|
366
|
+
ExpiresAfter riffdb.Instant
|
|
367
|
+
After *string
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
type FindActiveSessionsByUserIdResult interface { isFindActiveSessionsByUserIdResult() }
|
|
371
|
+
type FindActiveSessionsByUserIdFound struct {
|
|
372
|
+
Outcome string
|
|
373
|
+
Sessions []struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
374
|
+
}
|
|
375
|
+
func (FindActiveSessionsByUserIdFound) isFindActiveSessionsByUserIdResult() {}
|
|
376
|
+
func IsFindActiveSessionsByUserIdFound(value FindActiveSessionsByUserIdResult) (FindActiveSessionsByUserIdFound, bool) { branch, ok := value.(FindActiveSessionsByUserIdFound); return branch, ok }
|
|
377
|
+
|
|
378
|
+
func (FindActiveSessionsByUserIdFound) String() string { return "FindActiveSessionsByUserIdFound{<secret outputs redacted>}" }
|
|
379
|
+
func (FindActiveSessionsByUserIdFound) GoString() string { return "FindActiveSessionsByUserIdFound{<secret outputs redacted>}" }
|
|
380
|
+
|
|
381
|
+
func UnwrapFindActiveSessionsByUserIdFound(value FindActiveSessionsByUserIdResult) (FindActiveSessionsByUserIdFound, error) { if branch, ok := value.(FindActiveSessionsByUserIdFound); ok { return branch, nil }; return FindActiveSessionsByUserIdFound{}, errors.New("expected FindActiveSessionsByUserId outcome found") }
|
|
382
|
+
var FindCredentialAccountSecretOutputs = []QuerySecretOutput{
|
|
383
|
+
{Query: "FindCredentialAccount", Entity: "Account", Field: "access_token"},
|
|
384
|
+
{Query: "FindCredentialAccount", Entity: "Account", Field: "refresh_token"},
|
|
385
|
+
{Query: "FindCredentialAccount", Entity: "Account", Field: "id_token"},
|
|
386
|
+
{Query: "FindCredentialAccount", Entity: "Account", Field: "password"},
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
type FindCredentialAccountParams struct {
|
|
390
|
+
OrganizationId string
|
|
391
|
+
UserId string
|
|
392
|
+
AccountId string
|
|
393
|
+
ProviderId string
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
type FindCredentialAccountResult interface { isFindCredentialAccountResult() }
|
|
397
|
+
type FindCredentialAccountFound struct {
|
|
398
|
+
Outcome string
|
|
399
|
+
Accounts []struct { OrganizationId string; UserId string; Id string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; IdToken *string; Password *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
400
|
+
}
|
|
401
|
+
func (FindCredentialAccountFound) isFindCredentialAccountResult() {}
|
|
402
|
+
func IsFindCredentialAccountFound(value FindCredentialAccountResult) (FindCredentialAccountFound, bool) { branch, ok := value.(FindCredentialAccountFound); return branch, ok }
|
|
403
|
+
|
|
404
|
+
func (FindCredentialAccountFound) String() string { return "FindCredentialAccountFound{<secret outputs redacted>}" }
|
|
405
|
+
func (FindCredentialAccountFound) GoString() string { return "FindCredentialAccountFound{<secret outputs redacted>}" }
|
|
406
|
+
|
|
407
|
+
func UnwrapFindCredentialAccountFound(value FindCredentialAccountResult) (FindCredentialAccountFound, error) { if branch, ok := value.(FindCredentialAccountFound); ok { return branch, nil }; return FindCredentialAccountFound{}, errors.New("expected FindCredentialAccount outcome found") }
|
|
408
|
+
type FindExpiredVerificationIdsParams struct {
|
|
409
|
+
OrganizationId string
|
|
410
|
+
ExpiresBefore riffdb.Instant
|
|
411
|
+
After *string
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
type FindExpiredVerificationIdsResult interface { isFindExpiredVerificationIdsResult() }
|
|
415
|
+
type FindExpiredVerificationIdsFound struct {
|
|
416
|
+
Outcome string
|
|
417
|
+
Verifications []struct { VerificationId string }
|
|
418
|
+
}
|
|
419
|
+
func (FindExpiredVerificationIdsFound) isFindExpiredVerificationIdsResult() {}
|
|
420
|
+
func IsFindExpiredVerificationIdsFound(value FindExpiredVerificationIdsResult) (FindExpiredVerificationIdsFound, bool) { branch, ok := value.(FindExpiredVerificationIdsFound); return branch, ok }
|
|
421
|
+
|
|
422
|
+
func UnwrapFindExpiredVerificationIdsFound(value FindExpiredVerificationIdsResult) (FindExpiredVerificationIdsFound, error) { if branch, ok := value.(FindExpiredVerificationIdsFound); ok { return branch, nil }; return FindExpiredVerificationIdsFound{}, errors.New("expected FindExpiredVerificationIds outcome found") }
|
|
423
|
+
var FindLatestVerificationSecretOutputs = []QuerySecretOutput{
|
|
424
|
+
{Query: "FindLatestVerification", Entity: "Verification", Field: "value"},
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
type FindLatestVerificationParams struct {
|
|
428
|
+
OrganizationId string
|
|
429
|
+
Identifier string
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
type FindLatestVerificationResult interface { isFindLatestVerificationResult() }
|
|
433
|
+
type FindLatestVerificationFound struct {
|
|
434
|
+
Outcome string
|
|
435
|
+
Verifications []struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
436
|
+
}
|
|
437
|
+
func (FindLatestVerificationFound) isFindLatestVerificationResult() {}
|
|
438
|
+
func IsFindLatestVerificationFound(value FindLatestVerificationResult) (FindLatestVerificationFound, bool) { branch, ok := value.(FindLatestVerificationFound); return branch, ok }
|
|
439
|
+
|
|
440
|
+
func (FindLatestVerificationFound) String() string { return "FindLatestVerificationFound{<secret outputs redacted>}" }
|
|
441
|
+
func (FindLatestVerificationFound) GoString() string { return "FindLatestVerificationFound{<secret outputs redacted>}" }
|
|
442
|
+
|
|
443
|
+
func UnwrapFindLatestVerificationFound(value FindLatestVerificationResult) (FindLatestVerificationFound, error) { if branch, ok := value.(FindLatestVerificationFound); ok { return branch, nil }; return FindLatestVerificationFound{}, errors.New("expected FindLatestVerification outcome found") }
|
|
444
|
+
var FindSessionByIdSecretOutputs = []QuerySecretOutput{
|
|
445
|
+
{Query: "FindSessionById", Entity: "Session", Field: "token"},
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
type FindSessionByIdParams struct {
|
|
449
|
+
OrganizationId string
|
|
450
|
+
Id string
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
type FindSessionByIdResult interface { isFindSessionByIdResult() }
|
|
454
|
+
type FindSessionByIdFound struct {
|
|
455
|
+
Outcome string
|
|
456
|
+
Sessions []struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
457
|
+
}
|
|
458
|
+
func (FindSessionByIdFound) isFindSessionByIdResult() {}
|
|
459
|
+
func IsFindSessionByIdFound(value FindSessionByIdResult) (FindSessionByIdFound, bool) { branch, ok := value.(FindSessionByIdFound); return branch, ok }
|
|
460
|
+
|
|
461
|
+
func (FindSessionByIdFound) String() string { return "FindSessionByIdFound{<secret outputs redacted>}" }
|
|
462
|
+
func (FindSessionByIdFound) GoString() string { return "FindSessionByIdFound{<secret outputs redacted>}" }
|
|
463
|
+
|
|
464
|
+
func UnwrapFindSessionByIdFound(value FindSessionByIdResult) (FindSessionByIdFound, error) { if branch, ok := value.(FindSessionByIdFound); ok { return branch, nil }; return FindSessionByIdFound{}, errors.New("expected FindSessionById outcome found") }
|
|
465
|
+
var FindSessionByTokenSecretOutputs = []QuerySecretOutput{
|
|
466
|
+
{Query: "FindSessionByToken", Entity: "Session", Field: "token"},
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
type FindSessionByTokenParams struct {
|
|
470
|
+
OrganizationId string
|
|
471
|
+
Token string
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
type FindSessionByTokenResult interface { isFindSessionByTokenResult() }
|
|
475
|
+
type FindSessionByTokenFound struct {
|
|
476
|
+
Outcome string
|
|
477
|
+
Sessions []struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
478
|
+
}
|
|
479
|
+
func (FindSessionByTokenFound) isFindSessionByTokenResult() {}
|
|
480
|
+
func IsFindSessionByTokenFound(value FindSessionByTokenResult) (FindSessionByTokenFound, bool) { branch, ok := value.(FindSessionByTokenFound); return branch, ok }
|
|
481
|
+
|
|
482
|
+
func (FindSessionByTokenFound) String() string { return "FindSessionByTokenFound{<secret outputs redacted>}" }
|
|
483
|
+
func (FindSessionByTokenFound) GoString() string { return "FindSessionByTokenFound{<secret outputs redacted>}" }
|
|
484
|
+
|
|
485
|
+
func UnwrapFindSessionByTokenFound(value FindSessionByTokenResult) (FindSessionByTokenFound, error) { if branch, ok := value.(FindSessionByTokenFound); ok { return branch, nil }; return FindSessionByTokenFound{}, errors.New("expected FindSessionByToken outcome found") }
|
|
486
|
+
var FindSessionsByTokenSetSecretOutputs = []QuerySecretOutput{
|
|
487
|
+
{Query: "FindSessionsByTokenSet", Entity: "Session", Field: "token"},
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
type FindSessionsByTokenSetParams struct {
|
|
491
|
+
OrganizationId string
|
|
492
|
+
Tokens []string
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
type FindSessionsByTokenSetResult interface { isFindSessionsByTokenSetResult() }
|
|
496
|
+
type FindSessionsByTokenSetFound struct {
|
|
497
|
+
Outcome string
|
|
498
|
+
Sessions []struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
499
|
+
}
|
|
500
|
+
func (FindSessionsByTokenSetFound) isFindSessionsByTokenSetResult() {}
|
|
501
|
+
func IsFindSessionsByTokenSetFound(value FindSessionsByTokenSetResult) (FindSessionsByTokenSetFound, bool) { branch, ok := value.(FindSessionsByTokenSetFound); return branch, ok }
|
|
502
|
+
|
|
503
|
+
func (FindSessionsByTokenSetFound) String() string { return "FindSessionsByTokenSetFound{<secret outputs redacted>}" }
|
|
504
|
+
func (FindSessionsByTokenSetFound) GoString() string { return "FindSessionsByTokenSetFound{<secret outputs redacted>}" }
|
|
505
|
+
|
|
506
|
+
func UnwrapFindSessionsByTokenSetFound(value FindSessionsByTokenSetResult) (FindSessionsByTokenSetFound, error) { if branch, ok := value.(FindSessionsByTokenSetFound); ok { return branch, nil }; return FindSessionsByTokenSetFound{}, errors.New("expected FindSessionsByTokenSet outcome found") }
|
|
507
|
+
var FindSessionsByUserIdSecretOutputs = []QuerySecretOutput{
|
|
508
|
+
{Query: "FindSessionsByUserId", Entity: "Session", Field: "token"},
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
type FindSessionsByUserIdParams struct {
|
|
512
|
+
OrganizationId string
|
|
513
|
+
UserId string
|
|
514
|
+
After *string
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
type FindSessionsByUserIdResult interface { isFindSessionsByUserIdResult() }
|
|
518
|
+
type FindSessionsByUserIdFound struct {
|
|
519
|
+
Outcome string
|
|
520
|
+
Sessions []struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
521
|
+
}
|
|
522
|
+
func (FindSessionsByUserIdFound) isFindSessionsByUserIdResult() {}
|
|
523
|
+
func IsFindSessionsByUserIdFound(value FindSessionsByUserIdResult) (FindSessionsByUserIdFound, bool) { branch, ok := value.(FindSessionsByUserIdFound); return branch, ok }
|
|
524
|
+
|
|
525
|
+
func (FindSessionsByUserIdFound) String() string { return "FindSessionsByUserIdFound{<secret outputs redacted>}" }
|
|
526
|
+
func (FindSessionsByUserIdFound) GoString() string { return "FindSessionsByUserIdFound{<secret outputs redacted>}" }
|
|
527
|
+
|
|
528
|
+
func UnwrapFindSessionsByUserIdFound(value FindSessionsByUserIdResult) (FindSessionsByUserIdFound, error) { if branch, ok := value.(FindSessionsByUserIdFound); ok { return branch, nil }; return FindSessionsByUserIdFound{}, errors.New("expected FindSessionsByUserId outcome found") }
|
|
529
|
+
type FindUserByEmailParams struct {
|
|
530
|
+
OrganizationId string
|
|
531
|
+
Email string
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
type FindUserByEmailResult interface { isFindUserByEmailResult() }
|
|
535
|
+
type FindUserByEmailFound struct {
|
|
536
|
+
Outcome string
|
|
537
|
+
Users []struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
538
|
+
}
|
|
539
|
+
func (FindUserByEmailFound) isFindUserByEmailResult() {}
|
|
540
|
+
func IsFindUserByEmailFound(value FindUserByEmailResult) (FindUserByEmailFound, bool) { branch, ok := value.(FindUserByEmailFound); return branch, ok }
|
|
541
|
+
|
|
542
|
+
func UnwrapFindUserByEmailFound(value FindUserByEmailResult) (FindUserByEmailFound, error) { if branch, ok := value.(FindUserByEmailFound); ok { return branch, nil }; return FindUserByEmailFound{}, errors.New("expected FindUserByEmail outcome found") }
|
|
543
|
+
type FindUserByIdParams struct {
|
|
544
|
+
OrganizationId string
|
|
545
|
+
Id string
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
type FindUserByIdResult interface { isFindUserByIdResult() }
|
|
549
|
+
type FindUserByIdFound struct {
|
|
550
|
+
Outcome string
|
|
551
|
+
User struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
552
|
+
}
|
|
553
|
+
func (FindUserByIdFound) isFindUserByIdResult() {}
|
|
554
|
+
func IsFindUserByIdFound(value FindUserByIdResult) (FindUserByIdFound, bool) { branch, ok := value.(FindUserByIdFound); return branch, ok }
|
|
555
|
+
|
|
556
|
+
type FindUserByIdMissing struct {
|
|
557
|
+
Outcome string
|
|
558
|
+
}
|
|
559
|
+
func (FindUserByIdMissing) isFindUserByIdResult() {}
|
|
560
|
+
func IsFindUserByIdMissing(value FindUserByIdResult) (FindUserByIdMissing, bool) { branch, ok := value.(FindUserByIdMissing); return branch, ok }
|
|
561
|
+
|
|
562
|
+
func UnwrapFindUserByIdFound(value FindUserByIdResult) (FindUserByIdFound, error) { if branch, ok := value.(FindUserByIdFound); ok { return branch, nil }; return FindUserByIdFound{}, errors.New("expected FindUserById outcome found") }
|
|
563
|
+
var FindVerificationByIdSecretOutputs = []QuerySecretOutput{
|
|
564
|
+
{Query: "FindVerificationById", Entity: "Verification", Field: "value"},
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
type FindVerificationByIdParams struct {
|
|
568
|
+
OrganizationId string
|
|
569
|
+
Id string
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
type FindVerificationByIdResult interface { isFindVerificationByIdResult() }
|
|
573
|
+
type FindVerificationByIdFound struct {
|
|
574
|
+
Outcome string
|
|
575
|
+
Verification struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
576
|
+
}
|
|
577
|
+
func (FindVerificationByIdFound) isFindVerificationByIdResult() {}
|
|
578
|
+
func IsFindVerificationByIdFound(value FindVerificationByIdResult) (FindVerificationByIdFound, bool) { branch, ok := value.(FindVerificationByIdFound); return branch, ok }
|
|
579
|
+
|
|
580
|
+
func (FindVerificationByIdFound) String() string { return "FindVerificationByIdFound{<secret outputs redacted>}" }
|
|
581
|
+
func (FindVerificationByIdFound) GoString() string { return "FindVerificationByIdFound{<secret outputs redacted>}" }
|
|
582
|
+
|
|
583
|
+
type FindVerificationByIdMissing struct {
|
|
584
|
+
Outcome string
|
|
585
|
+
}
|
|
586
|
+
func (FindVerificationByIdMissing) isFindVerificationByIdResult() {}
|
|
587
|
+
func IsFindVerificationByIdMissing(value FindVerificationByIdResult) (FindVerificationByIdMissing, bool) { branch, ok := value.(FindVerificationByIdMissing); return branch, ok }
|
|
588
|
+
|
|
589
|
+
func (FindVerificationByIdMissing) String() string { return "FindVerificationByIdMissing{<secret outputs redacted>}" }
|
|
590
|
+
func (FindVerificationByIdMissing) GoString() string { return "FindVerificationByIdMissing{<secret outputs redacted>}" }
|
|
591
|
+
|
|
592
|
+
func UnwrapFindVerificationByIdFound(value FindVerificationByIdResult) (FindVerificationByIdFound, error) { if branch, ok := value.(FindVerificationByIdFound); ok { return branch, nil }; return FindVerificationByIdFound{}, errors.New("expected FindVerificationById outcome found") }
|
|
593
|
+
var FindVerificationsByIdentifierSecretOutputs = []QuerySecretOutput{
|
|
594
|
+
{Query: "FindVerificationsByIdentifier", Entity: "Verification", Field: "value"},
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
type FindVerificationsByIdentifierParams struct {
|
|
598
|
+
OrganizationId string
|
|
599
|
+
Identifier string
|
|
600
|
+
After *string
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
type FindVerificationsByIdentifierResult interface { isFindVerificationsByIdentifierResult() }
|
|
604
|
+
type FindVerificationsByIdentifierFound struct {
|
|
605
|
+
Outcome string
|
|
606
|
+
Verifications []struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
607
|
+
}
|
|
608
|
+
func (FindVerificationsByIdentifierFound) isFindVerificationsByIdentifierResult() {}
|
|
609
|
+
func IsFindVerificationsByIdentifierFound(value FindVerificationsByIdentifierResult) (FindVerificationsByIdentifierFound, bool) { branch, ok := value.(FindVerificationsByIdentifierFound); return branch, ok }
|
|
610
|
+
|
|
611
|
+
func (FindVerificationsByIdentifierFound) String() string { return "FindVerificationsByIdentifierFound{<secret outputs redacted>}" }
|
|
612
|
+
func (FindVerificationsByIdentifierFound) GoString() string { return "FindVerificationsByIdentifierFound{<secret outputs redacted>}" }
|
|
613
|
+
|
|
614
|
+
func UnwrapFindVerificationsByIdentifierFound(value FindVerificationsByIdentifierResult) (FindVerificationsByIdentifierFound, error) { if branch, ok := value.(FindVerificationsByIdentifierFound); ok { return branch, nil }; return FindVerificationsByIdentifierFound{}, errors.New("expected FindVerificationsByIdentifier outcome found") }
|
|
615
|
+
var ProfileAccountWithUserByProviderSecretOutputs = []QuerySecretOutput{
|
|
616
|
+
{Query: "ProfileAccountWithUserByProvider", Entity: "Account", Field: "access_token"},
|
|
617
|
+
{Query: "ProfileAccountWithUserByProvider", Entity: "Account", Field: "refresh_token"},
|
|
618
|
+
{Query: "ProfileAccountWithUserByProvider", Entity: "Account", Field: "id_token"},
|
|
619
|
+
{Query: "ProfileAccountWithUserByProvider", Entity: "Account", Field: "password"},
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
type ProfileAccountWithUserByProviderParams struct {
|
|
623
|
+
OrganizationId string
|
|
624
|
+
AccountId string
|
|
625
|
+
ProviderId string
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
type ProfileAccountWithUserByProviderResult interface { isProfileAccountWithUserByProviderResult() }
|
|
629
|
+
type ProfileAccountWithUserByProviderFound struct {
|
|
630
|
+
Outcome string
|
|
631
|
+
Users []struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
632
|
+
Accounts []struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
633
|
+
}
|
|
634
|
+
func (ProfileAccountWithUserByProviderFound) isProfileAccountWithUserByProviderResult() {}
|
|
635
|
+
func IsProfileAccountWithUserByProviderFound(value ProfileAccountWithUserByProviderResult) (ProfileAccountWithUserByProviderFound, bool) { branch, ok := value.(ProfileAccountWithUserByProviderFound); return branch, ok }
|
|
636
|
+
|
|
637
|
+
func (ProfileAccountWithUserByProviderFound) String() string { return "ProfileAccountWithUserByProviderFound{<secret outputs redacted>}" }
|
|
638
|
+
func (ProfileAccountWithUserByProviderFound) GoString() string { return "ProfileAccountWithUserByProviderFound{<secret outputs redacted>}" }
|
|
639
|
+
|
|
640
|
+
func UnwrapProfileAccountWithUserByProviderFound(value ProfileAccountWithUserByProviderResult) (ProfileAccountWithUserByProviderFound, error) { if branch, ok := value.(ProfileAccountWithUserByProviderFound); ok { return branch, nil }; return ProfileAccountWithUserByProviderFound{}, errors.New("expected ProfileAccountWithUserByProvider outcome found") }
|
|
641
|
+
var ProfileSessionWithUserByIdSecretOutputs = []QuerySecretOutput{
|
|
642
|
+
{Query: "ProfileSessionWithUserById", Entity: "Session", Field: "token"},
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
type ProfileSessionWithUserByIdParams struct {
|
|
646
|
+
OrganizationId string
|
|
647
|
+
Value string
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
type ProfileSessionWithUserByIdResult interface { isProfileSessionWithUserByIdResult() }
|
|
651
|
+
type ProfileSessionWithUserByIdFound struct {
|
|
652
|
+
Outcome string
|
|
653
|
+
Session struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
654
|
+
User struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
655
|
+
}
|
|
656
|
+
func (ProfileSessionWithUserByIdFound) isProfileSessionWithUserByIdResult() {}
|
|
657
|
+
func IsProfileSessionWithUserByIdFound(value ProfileSessionWithUserByIdResult) (ProfileSessionWithUserByIdFound, bool) { branch, ok := value.(ProfileSessionWithUserByIdFound); return branch, ok }
|
|
658
|
+
|
|
659
|
+
func (ProfileSessionWithUserByIdFound) String() string { return "ProfileSessionWithUserByIdFound{<secret outputs redacted>}" }
|
|
660
|
+
func (ProfileSessionWithUserByIdFound) GoString() string { return "ProfileSessionWithUserByIdFound{<secret outputs redacted>}" }
|
|
661
|
+
|
|
662
|
+
type ProfileSessionWithUserByIdMissing struct {
|
|
663
|
+
Outcome string
|
|
664
|
+
}
|
|
665
|
+
func (ProfileSessionWithUserByIdMissing) isProfileSessionWithUserByIdResult() {}
|
|
666
|
+
func IsProfileSessionWithUserByIdMissing(value ProfileSessionWithUserByIdResult) (ProfileSessionWithUserByIdMissing, bool) { branch, ok := value.(ProfileSessionWithUserByIdMissing); return branch, ok }
|
|
667
|
+
|
|
668
|
+
func (ProfileSessionWithUserByIdMissing) String() string { return "ProfileSessionWithUserByIdMissing{<secret outputs redacted>}" }
|
|
669
|
+
func (ProfileSessionWithUserByIdMissing) GoString() string { return "ProfileSessionWithUserByIdMissing{<secret outputs redacted>}" }
|
|
670
|
+
|
|
671
|
+
type ProfileSessionWithUserByIdIntegrityFailure struct {
|
|
672
|
+
Outcome string
|
|
673
|
+
}
|
|
674
|
+
func (ProfileSessionWithUserByIdIntegrityFailure) isProfileSessionWithUserByIdResult() {}
|
|
675
|
+
func IsProfileSessionWithUserByIdIntegrityFailure(value ProfileSessionWithUserByIdResult) (ProfileSessionWithUserByIdIntegrityFailure, bool) { branch, ok := value.(ProfileSessionWithUserByIdIntegrityFailure); return branch, ok }
|
|
676
|
+
|
|
677
|
+
func (ProfileSessionWithUserByIdIntegrityFailure) String() string { return "ProfileSessionWithUserByIdIntegrityFailure{<secret outputs redacted>}" }
|
|
678
|
+
func (ProfileSessionWithUserByIdIntegrityFailure) GoString() string { return "ProfileSessionWithUserByIdIntegrityFailure{<secret outputs redacted>}" }
|
|
679
|
+
|
|
680
|
+
func UnwrapProfileSessionWithUserByIdFound(value ProfileSessionWithUserByIdResult) (ProfileSessionWithUserByIdFound, error) { if branch, ok := value.(ProfileSessionWithUserByIdFound); ok { return branch, nil }; return ProfileSessionWithUserByIdFound{}, errors.New("expected ProfileSessionWithUserById outcome found") }
|
|
681
|
+
var ProfileSessionWithUserByTokenSecretOutputs = []QuerySecretOutput{
|
|
682
|
+
{Query: "ProfileSessionWithUserByToken", Entity: "Session", Field: "token"},
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
type ProfileSessionWithUserByTokenParams struct {
|
|
686
|
+
OrganizationId string
|
|
687
|
+
Value string
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
type ProfileSessionWithUserByTokenResult interface { isProfileSessionWithUserByTokenResult() }
|
|
691
|
+
type ProfileSessionWithUserByTokenFound struct {
|
|
692
|
+
Outcome string
|
|
693
|
+
Session struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
694
|
+
User struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
695
|
+
}
|
|
696
|
+
func (ProfileSessionWithUserByTokenFound) isProfileSessionWithUserByTokenResult() {}
|
|
697
|
+
func IsProfileSessionWithUserByTokenFound(value ProfileSessionWithUserByTokenResult) (ProfileSessionWithUserByTokenFound, bool) { branch, ok := value.(ProfileSessionWithUserByTokenFound); return branch, ok }
|
|
698
|
+
|
|
699
|
+
func (ProfileSessionWithUserByTokenFound) String() string { return "ProfileSessionWithUserByTokenFound{<secret outputs redacted>}" }
|
|
700
|
+
func (ProfileSessionWithUserByTokenFound) GoString() string { return "ProfileSessionWithUserByTokenFound{<secret outputs redacted>}" }
|
|
701
|
+
|
|
702
|
+
type ProfileSessionWithUserByTokenMissing struct {
|
|
703
|
+
Outcome string
|
|
704
|
+
}
|
|
705
|
+
func (ProfileSessionWithUserByTokenMissing) isProfileSessionWithUserByTokenResult() {}
|
|
706
|
+
func IsProfileSessionWithUserByTokenMissing(value ProfileSessionWithUserByTokenResult) (ProfileSessionWithUserByTokenMissing, bool) { branch, ok := value.(ProfileSessionWithUserByTokenMissing); return branch, ok }
|
|
707
|
+
|
|
708
|
+
func (ProfileSessionWithUserByTokenMissing) String() string { return "ProfileSessionWithUserByTokenMissing{<secret outputs redacted>}" }
|
|
709
|
+
func (ProfileSessionWithUserByTokenMissing) GoString() string { return "ProfileSessionWithUserByTokenMissing{<secret outputs redacted>}" }
|
|
710
|
+
|
|
711
|
+
type ProfileSessionWithUserByTokenIntegrityFailure struct {
|
|
712
|
+
Outcome string
|
|
713
|
+
}
|
|
714
|
+
func (ProfileSessionWithUserByTokenIntegrityFailure) isProfileSessionWithUserByTokenResult() {}
|
|
715
|
+
func IsProfileSessionWithUserByTokenIntegrityFailure(value ProfileSessionWithUserByTokenResult) (ProfileSessionWithUserByTokenIntegrityFailure, bool) { branch, ok := value.(ProfileSessionWithUserByTokenIntegrityFailure); return branch, ok }
|
|
716
|
+
|
|
717
|
+
func (ProfileSessionWithUserByTokenIntegrityFailure) String() string { return "ProfileSessionWithUserByTokenIntegrityFailure{<secret outputs redacted>}" }
|
|
718
|
+
func (ProfileSessionWithUserByTokenIntegrityFailure) GoString() string { return "ProfileSessionWithUserByTokenIntegrityFailure{<secret outputs redacted>}" }
|
|
719
|
+
|
|
720
|
+
func UnwrapProfileSessionWithUserByTokenFound(value ProfileSessionWithUserByTokenResult) (ProfileSessionWithUserByTokenFound, error) { if branch, ok := value.(ProfileSessionWithUserByTokenFound); ok { return branch, nil }; return ProfileSessionWithUserByTokenFound{}, errors.New("expected ProfileSessionWithUserByToken outcome found") }
|
|
721
|
+
var ProfileSessionsWithUsersByTokenSetSecretOutputs = []QuerySecretOutput{
|
|
722
|
+
{Query: "ProfileSessionsWithUsersByTokenSet", Entity: "Session", Field: "token"},
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
type ProfileSessionsWithUsersByTokenSetParams struct {
|
|
726
|
+
OrganizationId string
|
|
727
|
+
Tokens []string
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
type ProfileSessionsWithUsersByTokenSetResult interface { isProfileSessionsWithUsersByTokenSetResult() }
|
|
731
|
+
type ProfileSessionsWithUsersByTokenSetFound struct {
|
|
732
|
+
Outcome string
|
|
733
|
+
Users []struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
734
|
+
Sessions []struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
735
|
+
}
|
|
736
|
+
func (ProfileSessionsWithUsersByTokenSetFound) isProfileSessionsWithUsersByTokenSetResult() {}
|
|
737
|
+
func IsProfileSessionsWithUsersByTokenSetFound(value ProfileSessionsWithUsersByTokenSetResult) (ProfileSessionsWithUsersByTokenSetFound, bool) { branch, ok := value.(ProfileSessionsWithUsersByTokenSetFound); return branch, ok }
|
|
738
|
+
|
|
739
|
+
func (ProfileSessionsWithUsersByTokenSetFound) String() string { return "ProfileSessionsWithUsersByTokenSetFound{<secret outputs redacted>}" }
|
|
740
|
+
func (ProfileSessionsWithUsersByTokenSetFound) GoString() string { return "ProfileSessionsWithUsersByTokenSetFound{<secret outputs redacted>}" }
|
|
741
|
+
|
|
742
|
+
func UnwrapProfileSessionsWithUsersByTokenSetFound(value ProfileSessionsWithUsersByTokenSetResult) (ProfileSessionsWithUsersByTokenSetFound, error) { if branch, ok := value.(ProfileSessionsWithUsersByTokenSetFound); ok { return branch, nil }; return ProfileSessionsWithUsersByTokenSetFound{}, errors.New("expected ProfileSessionsWithUsersByTokenSet outcome found") }
|
|
743
|
+
var ProfileUserWithAccountsByEmailSecretOutputs = []QuerySecretOutput{
|
|
744
|
+
{Query: "ProfileUserWithAccountsByEmail", Entity: "Account", Field: "access_token"},
|
|
745
|
+
{Query: "ProfileUserWithAccountsByEmail", Entity: "Account", Field: "refresh_token"},
|
|
746
|
+
{Query: "ProfileUserWithAccountsByEmail", Entity: "Account", Field: "id_token"},
|
|
747
|
+
{Query: "ProfileUserWithAccountsByEmail", Entity: "Account", Field: "password"},
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
type ProfileUserWithAccountsByEmailParams struct {
|
|
751
|
+
OrganizationId string
|
|
752
|
+
Value string
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
type ProfileUserWithAccountsByEmailResult interface { isProfileUserWithAccountsByEmailResult() }
|
|
756
|
+
type ProfileUserWithAccountsByEmailFound struct {
|
|
757
|
+
Outcome string
|
|
758
|
+
User struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
759
|
+
Accounts []struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
760
|
+
}
|
|
761
|
+
func (ProfileUserWithAccountsByEmailFound) isProfileUserWithAccountsByEmailResult() {}
|
|
762
|
+
func IsProfileUserWithAccountsByEmailFound(value ProfileUserWithAccountsByEmailResult) (ProfileUserWithAccountsByEmailFound, bool) { branch, ok := value.(ProfileUserWithAccountsByEmailFound); return branch, ok }
|
|
763
|
+
|
|
764
|
+
func (ProfileUserWithAccountsByEmailFound) String() string { return "ProfileUserWithAccountsByEmailFound{<secret outputs redacted>}" }
|
|
765
|
+
func (ProfileUserWithAccountsByEmailFound) GoString() string { return "ProfileUserWithAccountsByEmailFound{<secret outputs redacted>}" }
|
|
766
|
+
|
|
767
|
+
type ProfileUserWithAccountsByEmailMissing struct {
|
|
768
|
+
Outcome string
|
|
769
|
+
}
|
|
770
|
+
func (ProfileUserWithAccountsByEmailMissing) isProfileUserWithAccountsByEmailResult() {}
|
|
771
|
+
func IsProfileUserWithAccountsByEmailMissing(value ProfileUserWithAccountsByEmailResult) (ProfileUserWithAccountsByEmailMissing, bool) { branch, ok := value.(ProfileUserWithAccountsByEmailMissing); return branch, ok }
|
|
772
|
+
|
|
773
|
+
func (ProfileUserWithAccountsByEmailMissing) String() string { return "ProfileUserWithAccountsByEmailMissing{<secret outputs redacted>}" }
|
|
774
|
+
func (ProfileUserWithAccountsByEmailMissing) GoString() string { return "ProfileUserWithAccountsByEmailMissing{<secret outputs redacted>}" }
|
|
775
|
+
|
|
776
|
+
func UnwrapProfileUserWithAccountsByEmailFound(value ProfileUserWithAccountsByEmailResult) (ProfileUserWithAccountsByEmailFound, error) { if branch, ok := value.(ProfileUserWithAccountsByEmailFound); ok { return branch, nil }; return ProfileUserWithAccountsByEmailFound{}, errors.New("expected ProfileUserWithAccountsByEmail outcome found") }
|
|
777
|
+
var ProfileUserWithAccountsByIdSecretOutputs = []QuerySecretOutput{
|
|
778
|
+
{Query: "ProfileUserWithAccountsById", Entity: "Account", Field: "access_token"},
|
|
779
|
+
{Query: "ProfileUserWithAccountsById", Entity: "Account", Field: "refresh_token"},
|
|
780
|
+
{Query: "ProfileUserWithAccountsById", Entity: "Account", Field: "id_token"},
|
|
781
|
+
{Query: "ProfileUserWithAccountsById", Entity: "Account", Field: "password"},
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
type ProfileUserWithAccountsByIdParams struct {
|
|
785
|
+
OrganizationId string
|
|
786
|
+
Value string
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
type ProfileUserWithAccountsByIdResult interface { isProfileUserWithAccountsByIdResult() }
|
|
790
|
+
type ProfileUserWithAccountsByIdFound struct {
|
|
791
|
+
Outcome string
|
|
792
|
+
User struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }
|
|
793
|
+
Accounts []struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }
|
|
794
|
+
}
|
|
795
|
+
func (ProfileUserWithAccountsByIdFound) isProfileUserWithAccountsByIdResult() {}
|
|
796
|
+
func IsProfileUserWithAccountsByIdFound(value ProfileUserWithAccountsByIdResult) (ProfileUserWithAccountsByIdFound, bool) { branch, ok := value.(ProfileUserWithAccountsByIdFound); return branch, ok }
|
|
797
|
+
|
|
798
|
+
func (ProfileUserWithAccountsByIdFound) String() string { return "ProfileUserWithAccountsByIdFound{<secret outputs redacted>}" }
|
|
799
|
+
func (ProfileUserWithAccountsByIdFound) GoString() string { return "ProfileUserWithAccountsByIdFound{<secret outputs redacted>}" }
|
|
800
|
+
|
|
801
|
+
type ProfileUserWithAccountsByIdMissing struct {
|
|
802
|
+
Outcome string
|
|
803
|
+
}
|
|
804
|
+
func (ProfileUserWithAccountsByIdMissing) isProfileUserWithAccountsByIdResult() {}
|
|
805
|
+
func IsProfileUserWithAccountsByIdMissing(value ProfileUserWithAccountsByIdResult) (ProfileUserWithAccountsByIdMissing, bool) { branch, ok := value.(ProfileUserWithAccountsByIdMissing); return branch, ok }
|
|
806
|
+
|
|
807
|
+
func (ProfileUserWithAccountsByIdMissing) String() string { return "ProfileUserWithAccountsByIdMissing{<secret outputs redacted>}" }
|
|
808
|
+
func (ProfileUserWithAccountsByIdMissing) GoString() string { return "ProfileUserWithAccountsByIdMissing{<secret outputs redacted>}" }
|
|
809
|
+
|
|
810
|
+
func UnwrapProfileUserWithAccountsByIdFound(value ProfileUserWithAccountsByIdResult) (ProfileUserWithAccountsByIdFound, error) { if branch, ok := value.(ProfileUserWithAccountsByIdFound); ok { return branch, nil }; return ProfileUserWithAccountsByIdFound{}, errors.New("expected ProfileUserWithAccountsById outcome found") }
|
|
811
|
+
var ConsumeVerificationSecretOutputs = []struct { Outcome, Field, Entity, SourceField string }{
|
|
812
|
+
{Outcome: "VerificationConsumed", Field: "value", Entity: "Verification", SourceField: "value"},
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
type ConsumeVerificationInput struct {
|
|
816
|
+
RequestId string
|
|
817
|
+
OrganizationId string
|
|
818
|
+
VerificationId string
|
|
819
|
+
}
|
|
820
|
+
type ConsumeVerificationOutcome interface { isConsumeVerificationOutcome() }
|
|
821
|
+
type ConsumeVerificationVerificationConsumed struct {
|
|
822
|
+
Outcome string
|
|
823
|
+
Value string
|
|
824
|
+
Revision uint64
|
|
825
|
+
CreatedAt riffdb.Instant
|
|
826
|
+
ExpiresAt riffdb.Instant
|
|
827
|
+
Identifier string
|
|
828
|
+
UpdatedAt riffdb.Instant
|
|
829
|
+
VerificationId string
|
|
830
|
+
}
|
|
831
|
+
func (ConsumeVerificationVerificationConsumed) isConsumeVerificationOutcome() {}
|
|
832
|
+
func IsConsumeVerificationVerificationConsumed(value ConsumeVerificationOutcome) (ConsumeVerificationVerificationConsumed, bool) { branch, ok := value.(ConsumeVerificationVerificationConsumed); return branch, ok }
|
|
833
|
+
|
|
834
|
+
func (ConsumeVerificationVerificationConsumed) String() string { return "ConsumeVerificationVerificationConsumed{<secret outputs redacted>}" }
|
|
835
|
+
func (ConsumeVerificationVerificationConsumed) GoString() string { return "ConsumeVerificationVerificationConsumed{<secret outputs redacted>}" }
|
|
836
|
+
|
|
837
|
+
type ConsumeVerificationVerificationConsumeMissing struct {
|
|
838
|
+
Outcome string
|
|
839
|
+
}
|
|
840
|
+
func (ConsumeVerificationVerificationConsumeMissing) isConsumeVerificationOutcome() {}
|
|
841
|
+
func IsConsumeVerificationVerificationConsumeMissing(value ConsumeVerificationOutcome) (ConsumeVerificationVerificationConsumeMissing, bool) { branch, ok := value.(ConsumeVerificationVerificationConsumeMissing); return branch, ok }
|
|
842
|
+
|
|
843
|
+
type ConsumeVerificationSetInput struct {
|
|
844
|
+
RequestId string
|
|
845
|
+
OrganizationId string
|
|
846
|
+
VerificationIds []string
|
|
847
|
+
}
|
|
848
|
+
type ConsumeVerificationSetOutcome interface { isConsumeVerificationSetOutcome() }
|
|
849
|
+
type ConsumeVerificationSetVerificationSetConsumed struct {
|
|
850
|
+
Outcome string
|
|
851
|
+
}
|
|
852
|
+
func (ConsumeVerificationSetVerificationSetConsumed) isConsumeVerificationSetOutcome() {}
|
|
853
|
+
func IsConsumeVerificationSetVerificationSetConsumed(value ConsumeVerificationSetOutcome) (ConsumeVerificationSetVerificationSetConsumed, bool) { branch, ok := value.(ConsumeVerificationSetVerificationSetConsumed); return branch, ok }
|
|
854
|
+
|
|
855
|
+
type ConsumeVerificationSetVerificationConsumeMissing struct {
|
|
856
|
+
Outcome string
|
|
857
|
+
}
|
|
858
|
+
func (ConsumeVerificationSetVerificationConsumeMissing) isConsumeVerificationSetOutcome() {}
|
|
859
|
+
func IsConsumeVerificationSetVerificationConsumeMissing(value ConsumeVerificationSetOutcome) (ConsumeVerificationSetVerificationConsumeMissing, bool) { branch, ok := value.(ConsumeVerificationSetVerificationConsumeMissing); return branch, ok }
|
|
860
|
+
|
|
861
|
+
type ConsumeVerificationSnapshotInput struct {
|
|
862
|
+
RequestId string
|
|
863
|
+
OrganizationId string
|
|
864
|
+
VerificationId string
|
|
865
|
+
ExpectedRevision uint64
|
|
866
|
+
}
|
|
867
|
+
type ConsumeVerificationSnapshotOutcome interface { isConsumeVerificationSnapshotOutcome() }
|
|
868
|
+
type ConsumeVerificationSnapshotVerificationConsumed struct {
|
|
869
|
+
Outcome string
|
|
870
|
+
}
|
|
871
|
+
func (ConsumeVerificationSnapshotVerificationConsumed) isConsumeVerificationSnapshotOutcome() {}
|
|
872
|
+
func IsConsumeVerificationSnapshotVerificationConsumed(value ConsumeVerificationSnapshotOutcome) (ConsumeVerificationSnapshotVerificationConsumed, bool) { branch, ok := value.(ConsumeVerificationSnapshotVerificationConsumed); return branch, ok }
|
|
873
|
+
|
|
874
|
+
type ConsumeVerificationSnapshotVerificationConsumeStale struct {
|
|
875
|
+
Outcome string
|
|
876
|
+
}
|
|
877
|
+
func (ConsumeVerificationSnapshotVerificationConsumeStale) isConsumeVerificationSnapshotOutcome() {}
|
|
878
|
+
func IsConsumeVerificationSnapshotVerificationConsumeStale(value ConsumeVerificationSnapshotOutcome) (ConsumeVerificationSnapshotVerificationConsumeStale, bool) { branch, ok := value.(ConsumeVerificationSnapshotVerificationConsumeStale); return branch, ok }
|
|
879
|
+
|
|
880
|
+
type ConsumeVerificationSnapshotVerificationConsumeMissing struct {
|
|
881
|
+
Outcome string
|
|
882
|
+
}
|
|
883
|
+
func (ConsumeVerificationSnapshotVerificationConsumeMissing) isConsumeVerificationSnapshotOutcome() {}
|
|
884
|
+
func IsConsumeVerificationSnapshotVerificationConsumeMissing(value ConsumeVerificationSnapshotOutcome) (ConsumeVerificationSnapshotVerificationConsumeMissing, bool) { branch, ok := value.(ConsumeVerificationSnapshotVerificationConsumeMissing); return branch, ok }
|
|
885
|
+
|
|
886
|
+
type CreateAccountInput struct {
|
|
887
|
+
Id string
|
|
888
|
+
Scope *string
|
|
889
|
+
UserId string
|
|
890
|
+
IdToken *string
|
|
891
|
+
Password *string
|
|
892
|
+
AccountId string
|
|
893
|
+
CreatedAt riffdb.Instant
|
|
894
|
+
RequestId string
|
|
895
|
+
UpdatedAt riffdb.Instant
|
|
896
|
+
ProviderId string
|
|
897
|
+
AccessToken *string
|
|
898
|
+
RefreshToken *string
|
|
899
|
+
OrganizationId string
|
|
900
|
+
AccessTokenExpiresAt *riffdb.Instant
|
|
901
|
+
RefreshTokenExpiresAt *riffdb.Instant
|
|
902
|
+
}
|
|
903
|
+
type CreateAccountOutcome interface { isCreateAccountOutcome() }
|
|
904
|
+
type CreateAccountAccountCreated struct {
|
|
905
|
+
Outcome string
|
|
906
|
+
}
|
|
907
|
+
func (CreateAccountAccountCreated) isCreateAccountOutcome() {}
|
|
908
|
+
func IsCreateAccountAccountCreated(value CreateAccountOutcome) (CreateAccountAccountCreated, bool) { branch, ok := value.(CreateAccountAccountCreated); return branch, ok }
|
|
909
|
+
|
|
910
|
+
type CreateAccountAccountUserMissing struct {
|
|
911
|
+
Outcome string
|
|
912
|
+
}
|
|
913
|
+
func (CreateAccountAccountUserMissing) isCreateAccountOutcome() {}
|
|
914
|
+
func IsCreateAccountAccountUserMissing(value CreateAccountOutcome) (CreateAccountAccountUserMissing, bool) { branch, ok := value.(CreateAccountAccountUserMissing); return branch, ok }
|
|
915
|
+
|
|
916
|
+
type CreateAccountAccountAlreadyExists struct {
|
|
917
|
+
Outcome string
|
|
918
|
+
}
|
|
919
|
+
func (CreateAccountAccountAlreadyExists) isCreateAccountOutcome() {}
|
|
920
|
+
func IsCreateAccountAccountAlreadyExists(value CreateAccountOutcome) (CreateAccountAccountAlreadyExists, bool) { branch, ok := value.(CreateAccountAccountAlreadyExists); return branch, ok }
|
|
921
|
+
|
|
922
|
+
type CreateOAuthUserGraphInput struct {
|
|
923
|
+
Scope *string
|
|
924
|
+
UserId string
|
|
925
|
+
IdToken *string
|
|
926
|
+
Password *string
|
|
927
|
+
UserName string
|
|
928
|
+
AccountId string
|
|
929
|
+
RequestId string
|
|
930
|
+
UserEmail string
|
|
931
|
+
UserImage *string
|
|
932
|
+
ProviderId string
|
|
933
|
+
UserLocale *string
|
|
934
|
+
AccessToken *string
|
|
935
|
+
RefreshToken *string
|
|
936
|
+
OrganizationId string
|
|
937
|
+
UserCreatedAt riffdb.Instant
|
|
938
|
+
UserDateField *riffdb.Instant
|
|
939
|
+
UserUpdatedAt riffdb.Instant
|
|
940
|
+
AccountCreatedAt riffdb.Instant
|
|
941
|
+
AccountUpdatedAt riffdb.Instant
|
|
942
|
+
ExternalAccountId string
|
|
943
|
+
UserEmailVerified bool
|
|
944
|
+
AccessTokenExpiresAt *riffdb.Instant
|
|
945
|
+
RefreshTokenExpiresAt *riffdb.Instant
|
|
946
|
+
}
|
|
947
|
+
type CreateOAuthUserGraphOutcome interface { isCreateOAuthUserGraphOutcome() }
|
|
948
|
+
type CreateOAuthUserGraphOAuthUserExists struct {
|
|
949
|
+
Outcome string
|
|
950
|
+
}
|
|
951
|
+
func (CreateOAuthUserGraphOAuthUserExists) isCreateOAuthUserGraphOutcome() {}
|
|
952
|
+
func IsCreateOAuthUserGraphOAuthUserExists(value CreateOAuthUserGraphOutcome) (CreateOAuthUserGraphOAuthUserExists, bool) { branch, ok := value.(CreateOAuthUserGraphOAuthUserExists); return branch, ok }
|
|
953
|
+
|
|
954
|
+
type CreateOAuthUserGraphOAuthAccountExists struct {
|
|
955
|
+
Outcome string
|
|
956
|
+
}
|
|
957
|
+
func (CreateOAuthUserGraphOAuthAccountExists) isCreateOAuthUserGraphOutcome() {}
|
|
958
|
+
func IsCreateOAuthUserGraphOAuthAccountExists(value CreateOAuthUserGraphOutcome) (CreateOAuthUserGraphOAuthAccountExists, bool) { branch, ok := value.(CreateOAuthUserGraphOAuthAccountExists); return branch, ok }
|
|
959
|
+
|
|
960
|
+
type CreateOAuthUserGraphOAuthUserGraphCreated struct {
|
|
961
|
+
Outcome string
|
|
962
|
+
}
|
|
963
|
+
func (CreateOAuthUserGraphOAuthUserGraphCreated) isCreateOAuthUserGraphOutcome() {}
|
|
964
|
+
func IsCreateOAuthUserGraphOAuthUserGraphCreated(value CreateOAuthUserGraphOutcome) (CreateOAuthUserGraphOAuthUserGraphCreated, bool) { branch, ok := value.(CreateOAuthUserGraphOAuthUserGraphCreated); return branch, ok }
|
|
965
|
+
|
|
966
|
+
type CreateSessionInput struct {
|
|
967
|
+
Id string
|
|
968
|
+
Token string
|
|
969
|
+
UserId string
|
|
970
|
+
CreatedAt riffdb.Instant
|
|
971
|
+
ExpiresAt riffdb.Instant
|
|
972
|
+
IpAddress *string
|
|
973
|
+
RequestId string
|
|
974
|
+
UpdatedAt riffdb.Instant
|
|
975
|
+
UserAgent *string
|
|
976
|
+
OrganizationId string
|
|
977
|
+
}
|
|
978
|
+
type CreateSessionOutcome interface { isCreateSessionOutcome() }
|
|
979
|
+
type CreateSessionSessionCreated struct {
|
|
980
|
+
Outcome string
|
|
981
|
+
}
|
|
982
|
+
func (CreateSessionSessionCreated) isCreateSessionOutcome() {}
|
|
983
|
+
func IsCreateSessionSessionCreated(value CreateSessionOutcome) (CreateSessionSessionCreated, bool) { branch, ok := value.(CreateSessionSessionCreated); return branch, ok }
|
|
984
|
+
|
|
985
|
+
type CreateSessionSessionUserMissing struct {
|
|
986
|
+
Outcome string
|
|
987
|
+
}
|
|
988
|
+
func (CreateSessionSessionUserMissing) isCreateSessionOutcome() {}
|
|
989
|
+
func IsCreateSessionSessionUserMissing(value CreateSessionOutcome) (CreateSessionSessionUserMissing, bool) { branch, ok := value.(CreateSessionSessionUserMissing); return branch, ok }
|
|
990
|
+
|
|
991
|
+
type CreateSessionSessionAlreadyExists struct {
|
|
992
|
+
Outcome string
|
|
993
|
+
}
|
|
994
|
+
func (CreateSessionSessionAlreadyExists) isCreateSessionOutcome() {}
|
|
995
|
+
func IsCreateSessionSessionAlreadyExists(value CreateSessionOutcome) (CreateSessionSessionAlreadyExists, bool) { branch, ok := value.(CreateSessionSessionAlreadyExists); return branch, ok }
|
|
996
|
+
|
|
997
|
+
type CreateSignupGraphInput struct {
|
|
998
|
+
UserId string
|
|
999
|
+
UserName string
|
|
1000
|
+
AccountId string
|
|
1001
|
+
RequestId string
|
|
1002
|
+
SessionId string
|
|
1003
|
+
UserEmail string
|
|
1004
|
+
UserImage *string
|
|
1005
|
+
ProviderId string
|
|
1006
|
+
UserLocale *string
|
|
1007
|
+
SessionToken string
|
|
1008
|
+
OrganizationId string
|
|
1009
|
+
UserCreatedAt riffdb.Instant
|
|
1010
|
+
UserDateField *riffdb.Instant
|
|
1011
|
+
UserUpdatedAt riffdb.Instant
|
|
1012
|
+
AccountPassword *string
|
|
1013
|
+
AccountCreatedAt riffdb.Instant
|
|
1014
|
+
AccountUpdatedAt riffdb.Instant
|
|
1015
|
+
SessionCreatedAt riffdb.Instant
|
|
1016
|
+
SessionExpiresAt riffdb.Instant
|
|
1017
|
+
SessionIpAddress *string
|
|
1018
|
+
SessionUpdatedAt riffdb.Instant
|
|
1019
|
+
SessionUserAgent *string
|
|
1020
|
+
ExternalAccountId string
|
|
1021
|
+
UserEmailVerified bool
|
|
1022
|
+
}
|
|
1023
|
+
type CreateSignupGraphOutcome interface { isCreateSignupGraphOutcome() }
|
|
1024
|
+
type CreateSignupGraphSignupUserExists struct {
|
|
1025
|
+
Outcome string
|
|
1026
|
+
}
|
|
1027
|
+
func (CreateSignupGraphSignupUserExists) isCreateSignupGraphOutcome() {}
|
|
1028
|
+
func IsCreateSignupGraphSignupUserExists(value CreateSignupGraphOutcome) (CreateSignupGraphSignupUserExists, bool) { branch, ok := value.(CreateSignupGraphSignupUserExists); return branch, ok }
|
|
1029
|
+
|
|
1030
|
+
type CreateSignupGraphSignupGraphCreated struct {
|
|
1031
|
+
Outcome string
|
|
1032
|
+
}
|
|
1033
|
+
func (CreateSignupGraphSignupGraphCreated) isCreateSignupGraphOutcome() {}
|
|
1034
|
+
func IsCreateSignupGraphSignupGraphCreated(value CreateSignupGraphOutcome) (CreateSignupGraphSignupGraphCreated, bool) { branch, ok := value.(CreateSignupGraphSignupGraphCreated); return branch, ok }
|
|
1035
|
+
|
|
1036
|
+
type CreateSignupGraphSignupAccountExists struct {
|
|
1037
|
+
Outcome string
|
|
1038
|
+
}
|
|
1039
|
+
func (CreateSignupGraphSignupAccountExists) isCreateSignupGraphOutcome() {}
|
|
1040
|
+
func IsCreateSignupGraphSignupAccountExists(value CreateSignupGraphOutcome) (CreateSignupGraphSignupAccountExists, bool) { branch, ok := value.(CreateSignupGraphSignupAccountExists); return branch, ok }
|
|
1041
|
+
|
|
1042
|
+
type CreateSignupGraphSignupSessionExists struct {
|
|
1043
|
+
Outcome string
|
|
1044
|
+
}
|
|
1045
|
+
func (CreateSignupGraphSignupSessionExists) isCreateSignupGraphOutcome() {}
|
|
1046
|
+
func IsCreateSignupGraphSignupSessionExists(value CreateSignupGraphOutcome) (CreateSignupGraphSignupSessionExists, bool) { branch, ok := value.(CreateSignupGraphSignupSessionExists); return branch, ok }
|
|
1047
|
+
|
|
1048
|
+
type CreateUserInput struct {
|
|
1049
|
+
Id string
|
|
1050
|
+
Name string
|
|
1051
|
+
Email string
|
|
1052
|
+
Image *string
|
|
1053
|
+
Locale *string
|
|
1054
|
+
CreatedAt riffdb.Instant
|
|
1055
|
+
DateField *riffdb.Instant
|
|
1056
|
+
RequestId string
|
|
1057
|
+
UpdatedAt riffdb.Instant
|
|
1058
|
+
EmailVerified bool
|
|
1059
|
+
OrganizationId string
|
|
1060
|
+
}
|
|
1061
|
+
type CreateUserOutcome interface { isCreateUserOutcome() }
|
|
1062
|
+
type CreateUserUserCreated struct {
|
|
1063
|
+
Outcome string
|
|
1064
|
+
}
|
|
1065
|
+
func (CreateUserUserCreated) isCreateUserOutcome() {}
|
|
1066
|
+
func IsCreateUserUserCreated(value CreateUserOutcome) (CreateUserUserCreated, bool) { branch, ok := value.(CreateUserUserCreated); return branch, ok }
|
|
1067
|
+
|
|
1068
|
+
type CreateUserUserAlreadyExists struct {
|
|
1069
|
+
Outcome string
|
|
1070
|
+
}
|
|
1071
|
+
func (CreateUserUserAlreadyExists) isCreateUserOutcome() {}
|
|
1072
|
+
func IsCreateUserUserAlreadyExists(value CreateUserOutcome) (CreateUserUserAlreadyExists, bool) { branch, ok := value.(CreateUserUserAlreadyExists); return branch, ok }
|
|
1073
|
+
|
|
1074
|
+
type CreateVerificationInput struct {
|
|
1075
|
+
Id string
|
|
1076
|
+
Value string
|
|
1077
|
+
CreatedAt riffdb.Instant
|
|
1078
|
+
ExpiresAt riffdb.Instant
|
|
1079
|
+
Identifier string
|
|
1080
|
+
RequestId string
|
|
1081
|
+
UpdatedAt riffdb.Instant
|
|
1082
|
+
OrganizationId string
|
|
1083
|
+
}
|
|
1084
|
+
type CreateVerificationOutcome interface { isCreateVerificationOutcome() }
|
|
1085
|
+
type CreateVerificationVerificationCreated struct {
|
|
1086
|
+
Outcome string
|
|
1087
|
+
}
|
|
1088
|
+
func (CreateVerificationVerificationCreated) isCreateVerificationOutcome() {}
|
|
1089
|
+
func IsCreateVerificationVerificationCreated(value CreateVerificationOutcome) (CreateVerificationVerificationCreated, bool) { branch, ok := value.(CreateVerificationVerificationCreated); return branch, ok }
|
|
1090
|
+
|
|
1091
|
+
type CreateVerificationVerificationAlreadyExists struct {
|
|
1092
|
+
Outcome string
|
|
1093
|
+
}
|
|
1094
|
+
func (CreateVerificationVerificationAlreadyExists) isCreateVerificationOutcome() {}
|
|
1095
|
+
func IsCreateVerificationVerificationAlreadyExists(value CreateVerificationOutcome) (CreateVerificationVerificationAlreadyExists, bool) { branch, ok := value.(CreateVerificationVerificationAlreadyExists); return branch, ok }
|
|
1096
|
+
|
|
1097
|
+
type DeleteAccountInput struct {
|
|
1098
|
+
UserId string
|
|
1099
|
+
RequestId string
|
|
1100
|
+
AccountIds []string
|
|
1101
|
+
OrganizationId string
|
|
1102
|
+
}
|
|
1103
|
+
type DeleteAccountOutcome interface { isDeleteAccountOutcome() }
|
|
1104
|
+
type DeleteAccountAccountDeleted struct {
|
|
1105
|
+
Outcome string
|
|
1106
|
+
}
|
|
1107
|
+
func (DeleteAccountAccountDeleted) isDeleteAccountOutcome() {}
|
|
1108
|
+
func IsDeleteAccountAccountDeleted(value DeleteAccountOutcome) (DeleteAccountAccountDeleted, bool) { branch, ok := value.(DeleteAccountAccountDeleted); return branch, ok }
|
|
1109
|
+
|
|
1110
|
+
type DeleteAccountAccountMissing struct {
|
|
1111
|
+
Outcome string
|
|
1112
|
+
}
|
|
1113
|
+
func (DeleteAccountAccountMissing) isDeleteAccountOutcome() {}
|
|
1114
|
+
func IsDeleteAccountAccountMissing(value DeleteAccountOutcome) (DeleteAccountAccountMissing, bool) { branch, ok := value.(DeleteAccountAccountMissing); return branch, ok }
|
|
1115
|
+
|
|
1116
|
+
type DeleteSessionInput struct {
|
|
1117
|
+
UserId string
|
|
1118
|
+
RequestId string
|
|
1119
|
+
SessionIds []string
|
|
1120
|
+
OrganizationId string
|
|
1121
|
+
}
|
|
1122
|
+
type DeleteSessionOutcome interface { isDeleteSessionOutcome() }
|
|
1123
|
+
type DeleteSessionSessionDeleted struct {
|
|
1124
|
+
Outcome string
|
|
1125
|
+
}
|
|
1126
|
+
func (DeleteSessionSessionDeleted) isDeleteSessionOutcome() {}
|
|
1127
|
+
func IsDeleteSessionSessionDeleted(value DeleteSessionOutcome) (DeleteSessionSessionDeleted, bool) { branch, ok := value.(DeleteSessionSessionDeleted); return branch, ok }
|
|
1128
|
+
|
|
1129
|
+
type DeleteSessionSessionMissing struct {
|
|
1130
|
+
Outcome string
|
|
1131
|
+
}
|
|
1132
|
+
func (DeleteSessionSessionMissing) isDeleteSessionOutcome() {}
|
|
1133
|
+
func IsDeleteSessionSessionMissing(value DeleteSessionOutcome) (DeleteSessionSessionMissing, bool) { branch, ok := value.(DeleteSessionSessionMissing); return branch, ok }
|
|
1134
|
+
|
|
1135
|
+
type DeleteUserInput struct {
|
|
1136
|
+
UserIds []string
|
|
1137
|
+
RequestId string
|
|
1138
|
+
OrganizationId string
|
|
1139
|
+
}
|
|
1140
|
+
type DeleteUserOutcome interface { isDeleteUserOutcome() }
|
|
1141
|
+
type DeleteUserUserDeleted struct {
|
|
1142
|
+
Outcome string
|
|
1143
|
+
}
|
|
1144
|
+
func (DeleteUserUserDeleted) isDeleteUserOutcome() {}
|
|
1145
|
+
func IsDeleteUserUserDeleted(value DeleteUserOutcome) (DeleteUserUserDeleted, bool) { branch, ok := value.(DeleteUserUserDeleted); return branch, ok }
|
|
1146
|
+
|
|
1147
|
+
type DeleteUserDeleteUserMissing struct {
|
|
1148
|
+
Outcome string
|
|
1149
|
+
}
|
|
1150
|
+
func (DeleteUserDeleteUserMissing) isDeleteUserOutcome() {}
|
|
1151
|
+
func IsDeleteUserDeleteUserMissing(value DeleteUserOutcome) (DeleteUserDeleteUserMissing, bool) { branch, ok := value.(DeleteUserDeleteUserMissing); return branch, ok }
|
|
1152
|
+
|
|
1153
|
+
type DeleteUserDeleteUserCascadeLimitExceeded struct {
|
|
1154
|
+
Outcome string
|
|
1155
|
+
}
|
|
1156
|
+
func (DeleteUserDeleteUserCascadeLimitExceeded) isDeleteUserOutcome() {}
|
|
1157
|
+
func IsDeleteUserDeleteUserCascadeLimitExceeded(value DeleteUserOutcome) (DeleteUserDeleteUserCascadeLimitExceeded, bool) { branch, ok := value.(DeleteUserDeleteUserCascadeLimitExceeded); return branch, ok }
|
|
1158
|
+
|
|
1159
|
+
type DeleteVerificationInput struct {
|
|
1160
|
+
RequestId string
|
|
1161
|
+
OrganizationId string
|
|
1162
|
+
VerificationIds []string
|
|
1163
|
+
}
|
|
1164
|
+
type DeleteVerificationOutcome interface { isDeleteVerificationOutcome() }
|
|
1165
|
+
type DeleteVerificationVerificationDeleted struct {
|
|
1166
|
+
Outcome string
|
|
1167
|
+
}
|
|
1168
|
+
func (DeleteVerificationVerificationDeleted) isDeleteVerificationOutcome() {}
|
|
1169
|
+
func IsDeleteVerificationVerificationDeleted(value DeleteVerificationOutcome) (DeleteVerificationVerificationDeleted, bool) { branch, ok := value.(DeleteVerificationVerificationDeleted); return branch, ok }
|
|
1170
|
+
|
|
1171
|
+
type DeleteVerificationVerificationMissing struct {
|
|
1172
|
+
Outcome string
|
|
1173
|
+
}
|
|
1174
|
+
func (DeleteVerificationVerificationMissing) isDeleteVerificationOutcome() {}
|
|
1175
|
+
func IsDeleteVerificationVerificationMissing(value DeleteVerificationOutcome) (DeleteVerificationVerificationMissing, bool) { branch, ok := value.(DeleteVerificationVerificationMissing); return branch, ok }
|
|
1176
|
+
|
|
1177
|
+
type ResetCredentialPasswordInput struct {
|
|
1178
|
+
UserId string
|
|
1179
|
+
Password string
|
|
1180
|
+
AccountId string
|
|
1181
|
+
RequestId string
|
|
1182
|
+
UpdatedAt riffdb.Instant
|
|
1183
|
+
OrganizationId string
|
|
1184
|
+
AccountRevision uint64
|
|
1185
|
+
VerificationIds []string
|
|
1186
|
+
ExternalAccountId string
|
|
1187
|
+
VerificationRevision uint64
|
|
1188
|
+
}
|
|
1189
|
+
type ResetCredentialPasswordOutcome interface { isResetCredentialPasswordOutcome() }
|
|
1190
|
+
type ResetCredentialPasswordPasswordAccountStale struct {
|
|
1191
|
+
Outcome string
|
|
1192
|
+
}
|
|
1193
|
+
func (ResetCredentialPasswordPasswordAccountStale) isResetCredentialPasswordOutcome() {}
|
|
1194
|
+
func IsResetCredentialPasswordPasswordAccountStale(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordPasswordAccountStale, bool) { branch, ok := value.(ResetCredentialPasswordPasswordAccountStale); return branch, ok }
|
|
1195
|
+
|
|
1196
|
+
type ResetCredentialPasswordPasswordAccountMissing struct {
|
|
1197
|
+
Outcome string
|
|
1198
|
+
}
|
|
1199
|
+
func (ResetCredentialPasswordPasswordAccountMissing) isResetCredentialPasswordOutcome() {}
|
|
1200
|
+
func IsResetCredentialPasswordPasswordAccountMissing(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordPasswordAccountMissing, bool) { branch, ok := value.(ResetCredentialPasswordPasswordAccountMissing); return branch, ok }
|
|
1201
|
+
|
|
1202
|
+
type ResetCredentialPasswordCredentialPasswordReset struct {
|
|
1203
|
+
Outcome string
|
|
1204
|
+
}
|
|
1205
|
+
func (ResetCredentialPasswordCredentialPasswordReset) isResetCredentialPasswordOutcome() {}
|
|
1206
|
+
func IsResetCredentialPasswordCredentialPasswordReset(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordCredentialPasswordReset, bool) { branch, ok := value.(ResetCredentialPasswordCredentialPasswordReset); return branch, ok }
|
|
1207
|
+
|
|
1208
|
+
type ResetCredentialPasswordPasswordProviderMismatch struct {
|
|
1209
|
+
Outcome string
|
|
1210
|
+
}
|
|
1211
|
+
func (ResetCredentialPasswordPasswordProviderMismatch) isResetCredentialPasswordOutcome() {}
|
|
1212
|
+
func IsResetCredentialPasswordPasswordProviderMismatch(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordPasswordProviderMismatch, bool) { branch, ok := value.(ResetCredentialPasswordPasswordProviderMismatch); return branch, ok }
|
|
1213
|
+
|
|
1214
|
+
type ResetCredentialPasswordVerificationConsumeStale struct {
|
|
1215
|
+
Outcome string
|
|
1216
|
+
}
|
|
1217
|
+
func (ResetCredentialPasswordVerificationConsumeStale) isResetCredentialPasswordOutcome() {}
|
|
1218
|
+
func IsResetCredentialPasswordVerificationConsumeStale(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordVerificationConsumeStale, bool) { branch, ok := value.(ResetCredentialPasswordVerificationConsumeStale); return branch, ok }
|
|
1219
|
+
|
|
1220
|
+
type ResetCredentialPasswordVerificationConsumeMissing struct {
|
|
1221
|
+
Outcome string
|
|
1222
|
+
}
|
|
1223
|
+
func (ResetCredentialPasswordVerificationConsumeMissing) isResetCredentialPasswordOutcome() {}
|
|
1224
|
+
func IsResetCredentialPasswordVerificationConsumeMissing(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordVerificationConsumeMissing, bool) { branch, ok := value.(ResetCredentialPasswordVerificationConsumeMissing); return branch, ok }
|
|
1225
|
+
|
|
1226
|
+
type UpdateAccountInput struct {
|
|
1227
|
+
Scope *string
|
|
1228
|
+
UserId string
|
|
1229
|
+
IdToken *string
|
|
1230
|
+
Password *string
|
|
1231
|
+
AccountId string
|
|
1232
|
+
RequestId string
|
|
1233
|
+
UpdatedAt riffdb.Instant
|
|
1234
|
+
ProviderId string
|
|
1235
|
+
AccessToken *string
|
|
1236
|
+
RefreshToken *string
|
|
1237
|
+
OrganizationId string
|
|
1238
|
+
ExpectedRevision uint64
|
|
1239
|
+
ExternalAccountId string
|
|
1240
|
+
AccessTokenExpiresAt *riffdb.Instant
|
|
1241
|
+
RefreshTokenExpiresAt *riffdb.Instant
|
|
1242
|
+
}
|
|
1243
|
+
type UpdateAccountOutcome interface { isUpdateAccountOutcome() }
|
|
1244
|
+
type UpdateAccountAccountUpdated struct {
|
|
1245
|
+
Outcome string
|
|
1246
|
+
}
|
|
1247
|
+
func (UpdateAccountAccountUpdated) isUpdateAccountOutcome() {}
|
|
1248
|
+
func IsUpdateAccountAccountUpdated(value UpdateAccountOutcome) (UpdateAccountAccountUpdated, bool) { branch, ok := value.(UpdateAccountAccountUpdated); return branch, ok }
|
|
1249
|
+
|
|
1250
|
+
type UpdateAccountAccountUpdateStale struct {
|
|
1251
|
+
Outcome string
|
|
1252
|
+
}
|
|
1253
|
+
func (UpdateAccountAccountUpdateStale) isUpdateAccountOutcome() {}
|
|
1254
|
+
func IsUpdateAccountAccountUpdateStale(value UpdateAccountOutcome) (UpdateAccountAccountUpdateStale, bool) { branch, ok := value.(UpdateAccountAccountUpdateStale); return branch, ok }
|
|
1255
|
+
|
|
1256
|
+
type UpdateAccountAccountUpdateMissing struct {
|
|
1257
|
+
Outcome string
|
|
1258
|
+
}
|
|
1259
|
+
func (UpdateAccountAccountUpdateMissing) isUpdateAccountOutcome() {}
|
|
1260
|
+
func IsUpdateAccountAccountUpdateMissing(value UpdateAccountOutcome) (UpdateAccountAccountUpdateMissing, bool) { branch, ok := value.(UpdateAccountAccountUpdateMissing); return branch, ok }
|
|
1261
|
+
|
|
1262
|
+
type UpdateAccountPasswordsInput struct {
|
|
1263
|
+
Updates []AccountPasswordUpdate
|
|
1264
|
+
UserId string
|
|
1265
|
+
RequestId string
|
|
1266
|
+
OrganizationId string
|
|
1267
|
+
}
|
|
1268
|
+
type UpdateAccountPasswordsOutcome interface { isUpdateAccountPasswordsOutcome() }
|
|
1269
|
+
type UpdateAccountPasswordsPasswordAccountStale struct {
|
|
1270
|
+
Outcome string
|
|
1271
|
+
}
|
|
1272
|
+
func (UpdateAccountPasswordsPasswordAccountStale) isUpdateAccountPasswordsOutcome() {}
|
|
1273
|
+
func IsUpdateAccountPasswordsPasswordAccountStale(value UpdateAccountPasswordsOutcome) (UpdateAccountPasswordsPasswordAccountStale, bool) { branch, ok := value.(UpdateAccountPasswordsPasswordAccountStale); return branch, ok }
|
|
1274
|
+
|
|
1275
|
+
type UpdateAccountPasswordsPasswordAccountMissing struct {
|
|
1276
|
+
Outcome string
|
|
1277
|
+
}
|
|
1278
|
+
func (UpdateAccountPasswordsPasswordAccountMissing) isUpdateAccountPasswordsOutcome() {}
|
|
1279
|
+
func IsUpdateAccountPasswordsPasswordAccountMissing(value UpdateAccountPasswordsOutcome) (UpdateAccountPasswordsPasswordAccountMissing, bool) { branch, ok := value.(UpdateAccountPasswordsPasswordAccountMissing); return branch, ok }
|
|
1280
|
+
|
|
1281
|
+
type UpdateAccountPasswordsAccountPasswordsUpdated struct {
|
|
1282
|
+
Outcome string
|
|
1283
|
+
}
|
|
1284
|
+
func (UpdateAccountPasswordsAccountPasswordsUpdated) isUpdateAccountPasswordsOutcome() {}
|
|
1285
|
+
func IsUpdateAccountPasswordsAccountPasswordsUpdated(value UpdateAccountPasswordsOutcome) (UpdateAccountPasswordsAccountPasswordsUpdated, bool) { branch, ok := value.(UpdateAccountPasswordsAccountPasswordsUpdated); return branch, ok }
|
|
1286
|
+
|
|
1287
|
+
type UpdateAccountPasswordsPasswordProviderMismatch struct {
|
|
1288
|
+
Outcome string
|
|
1289
|
+
}
|
|
1290
|
+
func (UpdateAccountPasswordsPasswordProviderMismatch) isUpdateAccountPasswordsOutcome() {}
|
|
1291
|
+
func IsUpdateAccountPasswordsPasswordProviderMismatch(value UpdateAccountPasswordsOutcome) (UpdateAccountPasswordsPasswordProviderMismatch, bool) { branch, ok := value.(UpdateAccountPasswordsPasswordProviderMismatch); return branch, ok }
|
|
1292
|
+
|
|
1293
|
+
type UpdateCredentialPasswordInput struct {
|
|
1294
|
+
UserId string
|
|
1295
|
+
Password string
|
|
1296
|
+
AccountId string
|
|
1297
|
+
RequestId string
|
|
1298
|
+
UpdatedAt riffdb.Instant
|
|
1299
|
+
OrganizationId string
|
|
1300
|
+
ExpectedRevision uint64
|
|
1301
|
+
ExternalAccountId string
|
|
1302
|
+
}
|
|
1303
|
+
type UpdateCredentialPasswordOutcome interface { isUpdateCredentialPasswordOutcome() }
|
|
1304
|
+
type UpdateCredentialPasswordPasswordAccountStale struct {
|
|
1305
|
+
Outcome string
|
|
1306
|
+
}
|
|
1307
|
+
func (UpdateCredentialPasswordPasswordAccountStale) isUpdateCredentialPasswordOutcome() {}
|
|
1308
|
+
func IsUpdateCredentialPasswordPasswordAccountStale(value UpdateCredentialPasswordOutcome) (UpdateCredentialPasswordPasswordAccountStale, bool) { branch, ok := value.(UpdateCredentialPasswordPasswordAccountStale); return branch, ok }
|
|
1309
|
+
|
|
1310
|
+
type UpdateCredentialPasswordPasswordAccountMissing struct {
|
|
1311
|
+
Outcome string
|
|
1312
|
+
}
|
|
1313
|
+
func (UpdateCredentialPasswordPasswordAccountMissing) isUpdateCredentialPasswordOutcome() {}
|
|
1314
|
+
func IsUpdateCredentialPasswordPasswordAccountMissing(value UpdateCredentialPasswordOutcome) (UpdateCredentialPasswordPasswordAccountMissing, bool) { branch, ok := value.(UpdateCredentialPasswordPasswordAccountMissing); return branch, ok }
|
|
1315
|
+
|
|
1316
|
+
type UpdateCredentialPasswordPasswordProviderMismatch struct {
|
|
1317
|
+
Outcome string
|
|
1318
|
+
}
|
|
1319
|
+
func (UpdateCredentialPasswordPasswordProviderMismatch) isUpdateCredentialPasswordOutcome() {}
|
|
1320
|
+
func IsUpdateCredentialPasswordPasswordProviderMismatch(value UpdateCredentialPasswordOutcome) (UpdateCredentialPasswordPasswordProviderMismatch, bool) { branch, ok := value.(UpdateCredentialPasswordPasswordProviderMismatch); return branch, ok }
|
|
1321
|
+
|
|
1322
|
+
type UpdateCredentialPasswordCredentialPasswordUpdated struct {
|
|
1323
|
+
Outcome string
|
|
1324
|
+
}
|
|
1325
|
+
func (UpdateCredentialPasswordCredentialPasswordUpdated) isUpdateCredentialPasswordOutcome() {}
|
|
1326
|
+
func IsUpdateCredentialPasswordCredentialPasswordUpdated(value UpdateCredentialPasswordOutcome) (UpdateCredentialPasswordCredentialPasswordUpdated, bool) { branch, ok := value.(UpdateCredentialPasswordCredentialPasswordUpdated); return branch, ok }
|
|
1327
|
+
|
|
1328
|
+
type UpdateSessionInput struct {
|
|
1329
|
+
UserId string
|
|
1330
|
+
ExpiresAt riffdb.Instant
|
|
1331
|
+
IpAddress *string
|
|
1332
|
+
RequestId string
|
|
1333
|
+
SessionId string
|
|
1334
|
+
UpdatedAt riffdb.Instant
|
|
1335
|
+
UserAgent *string
|
|
1336
|
+
OrganizationId string
|
|
1337
|
+
ExpectedRevision uint64
|
|
1338
|
+
}
|
|
1339
|
+
type UpdateSessionOutcome interface { isUpdateSessionOutcome() }
|
|
1340
|
+
type UpdateSessionSessionUpdated struct {
|
|
1341
|
+
Outcome string
|
|
1342
|
+
}
|
|
1343
|
+
func (UpdateSessionSessionUpdated) isUpdateSessionOutcome() {}
|
|
1344
|
+
func IsUpdateSessionSessionUpdated(value UpdateSessionOutcome) (UpdateSessionSessionUpdated, bool) { branch, ok := value.(UpdateSessionSessionUpdated); return branch, ok }
|
|
1345
|
+
|
|
1346
|
+
type UpdateSessionSessionUpdateStale struct {
|
|
1347
|
+
Outcome string
|
|
1348
|
+
}
|
|
1349
|
+
func (UpdateSessionSessionUpdateStale) isUpdateSessionOutcome() {}
|
|
1350
|
+
func IsUpdateSessionSessionUpdateStale(value UpdateSessionOutcome) (UpdateSessionSessionUpdateStale, bool) { branch, ok := value.(UpdateSessionSessionUpdateStale); return branch, ok }
|
|
1351
|
+
|
|
1352
|
+
type UpdateSessionSessionUpdateMissing struct {
|
|
1353
|
+
Outcome string
|
|
1354
|
+
}
|
|
1355
|
+
func (UpdateSessionSessionUpdateMissing) isUpdateSessionOutcome() {}
|
|
1356
|
+
func IsUpdateSessionSessionUpdateMissing(value UpdateSessionOutcome) (UpdateSessionSessionUpdateMissing, bool) { branch, ok := value.(UpdateSessionSessionUpdateMissing); return branch, ok }
|
|
1357
|
+
|
|
1358
|
+
type UpdateUserInput struct {
|
|
1359
|
+
Name string
|
|
1360
|
+
Email string
|
|
1361
|
+
Image *string
|
|
1362
|
+
Locale *string
|
|
1363
|
+
UserId string
|
|
1364
|
+
DateField *riffdb.Instant
|
|
1365
|
+
RequestId string
|
|
1366
|
+
UpdatedAt riffdb.Instant
|
|
1367
|
+
EmailVerified bool
|
|
1368
|
+
OrganizationId string
|
|
1369
|
+
ExpectedRevision uint64
|
|
1370
|
+
}
|
|
1371
|
+
type UpdateUserOutcome interface { isUpdateUserOutcome() }
|
|
1372
|
+
type UpdateUserUserUpdated struct {
|
|
1373
|
+
Outcome string
|
|
1374
|
+
}
|
|
1375
|
+
func (UpdateUserUserUpdated) isUpdateUserOutcome() {}
|
|
1376
|
+
func IsUpdateUserUserUpdated(value UpdateUserOutcome) (UpdateUserUserUpdated, bool) { branch, ok := value.(UpdateUserUserUpdated); return branch, ok }
|
|
1377
|
+
|
|
1378
|
+
type UpdateUserUserUpdateStale struct {
|
|
1379
|
+
Outcome string
|
|
1380
|
+
}
|
|
1381
|
+
func (UpdateUserUserUpdateStale) isUpdateUserOutcome() {}
|
|
1382
|
+
func IsUpdateUserUserUpdateStale(value UpdateUserOutcome) (UpdateUserUserUpdateStale, bool) { branch, ok := value.(UpdateUserUserUpdateStale); return branch, ok }
|
|
1383
|
+
|
|
1384
|
+
type UpdateUserUserUpdateMissing struct {
|
|
1385
|
+
Outcome string
|
|
1386
|
+
}
|
|
1387
|
+
func (UpdateUserUserUpdateMissing) isUpdateUserOutcome() {}
|
|
1388
|
+
func IsUpdateUserUserUpdateMissing(value UpdateUserOutcome) (UpdateUserUserUpdateMissing, bool) { branch, ok := value.(UpdateUserUserUpdateMissing); return branch, ok }
|
|
1389
|
+
|
|
1390
|
+
type UpdateVerificationInput struct {
|
|
1391
|
+
Value string
|
|
1392
|
+
ExpiresAt riffdb.Instant
|
|
1393
|
+
RequestId string
|
|
1394
|
+
UpdatedAt riffdb.Instant
|
|
1395
|
+
OrganizationId string
|
|
1396
|
+
VerificationId string
|
|
1397
|
+
ExpectedRevision uint64
|
|
1398
|
+
}
|
|
1399
|
+
type UpdateVerificationOutcome interface { isUpdateVerificationOutcome() }
|
|
1400
|
+
type UpdateVerificationVerificationUpdated struct {
|
|
1401
|
+
Outcome string
|
|
1402
|
+
}
|
|
1403
|
+
func (UpdateVerificationVerificationUpdated) isUpdateVerificationOutcome() {}
|
|
1404
|
+
func IsUpdateVerificationVerificationUpdated(value UpdateVerificationOutcome) (UpdateVerificationVerificationUpdated, bool) { branch, ok := value.(UpdateVerificationVerificationUpdated); return branch, ok }
|
|
1405
|
+
|
|
1406
|
+
type UpdateVerificationVerificationUpdateStale struct {
|
|
1407
|
+
Outcome string
|
|
1408
|
+
}
|
|
1409
|
+
func (UpdateVerificationVerificationUpdateStale) isUpdateVerificationOutcome() {}
|
|
1410
|
+
func IsUpdateVerificationVerificationUpdateStale(value UpdateVerificationOutcome) (UpdateVerificationVerificationUpdateStale, bool) { branch, ok := value.(UpdateVerificationVerificationUpdateStale); return branch, ok }
|
|
1411
|
+
|
|
1412
|
+
type UpdateVerificationVerificationUpdateMissing struct {
|
|
1413
|
+
Outcome string
|
|
1414
|
+
}
|
|
1415
|
+
func (UpdateVerificationVerificationUpdateMissing) isUpdateVerificationOutcome() {}
|
|
1416
|
+
func IsUpdateVerificationVerificationUpdateMissing(value UpdateVerificationOutcome) (UpdateVerificationVerificationUpdateMissing, bool) { branch, ok := value.(UpdateVerificationVerificationUpdateMissing); return branch, ok }
|
|
1417
|
+
|
|
1418
|
+
const DefaultCommandAttempts uint32 = 3
|
|
1419
|
+
type Client struct { session *riffdb.Session; commandAttempts uint32; causalMu sync.Mutex; readAfterCommit *uint64; trackCausalWrites bool }
|
|
1420
|
+
|
|
1421
|
+
func NewClient(session *riffdb.Session, commandAttempts ...uint32) (*Client, error) { attempts := DefaultCommandAttempts; if len(commandAttempts) > 1 { return nil, errors.New("invalid generated RiffDB client configuration") } else if len(commandAttempts) == 1 { attempts = commandAttempts[0] }; if session == nil || attempts < 1 || attempts > 10 { return nil, errors.New("invalid generated RiffDB client configuration") }; return &Client{session: session, commandAttempts: attempts, trackCausalWrites: true}, nil }
|
|
1422
|
+
func DriverIdentity(role string, database ...string) riffdb.Identity { var db string; if len(database) > 0 { db = database[0] }; return riffdb.Identity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, Role: role, Database: db} }
|
|
1423
|
+
func Connect(ctx context.Context, socketPath string, role string, database ...string) (*Client, error) { if len(database) > 1 { return nil, errors.New("invalid generated RiffDB client configuration") }; session, err := riffdb.Connect(ctx, socketPath, DriverIdentity(role, database...)); if err != nil { return nil, err }; return NewClient(session) }
|
|
1424
|
+
func ConnectFromEnv(ctx context.Context, prefix ...string) (*Client, error) { if len(prefix) > 1 { return nil, errors.New("invalid generated RiffDB client configuration") }; var envPrefix string; if len(prefix) == 1 { envPrefix = prefix[0] }; session, err := riffdb.ConnectFromEnv(ctx, riffdb.Identity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash}, envPrefix); if err != nil { return nil, err }; return NewClient(session) }
|
|
1425
|
+
func (client *Client) Close() error { if client == nil || client.session == nil { return nil }; return client.session.Close() }
|
|
1426
|
+
func (client *Client) WithReadAfterCommit(commitSequence *uint64) *Client { var copied *uint64; if commitSequence != nil { value := *commitSequence; copied = &value }; return &Client{session: client.session, commandAttempts: client.commandAttempts, readAfterCommit: copied, trackCausalWrites: client.trackCausalWrites} }
|
|
1427
|
+
func (client *Client) CausalSession(initialCommitSequence ...uint64) *Client { var copied *uint64; if len(initialCommitSequence) > 0 { value := initialCommitSequence[0]; copied = &value } else { copied = client.LastCommitSequence() }; return &Client{session: client.session, commandAttempts: client.commandAttempts, readAfterCommit: copied, trackCausalWrites: true} }
|
|
1428
|
+
func (client *Client) LastCommitSequence() *uint64 { client.causalMu.Lock(); defer client.causalMu.Unlock(); if client.readAfterCommit == nil { return nil }; value := *client.readAfterCommit; return &value }
|
|
1429
|
+
func (client *Client) observeCommit(commitSequence *uint64) { if !client.trackCausalWrites || commitSequence == nil || *commitSequence == 0 { return }; client.causalMu.Lock(); if client.readAfterCommit == nil || *commitSequence > *client.readAfterCommit { value := *commitSequence; client.readAfterCommit = &value }; client.causalMu.Unlock() }
|
|
1430
|
+
|
|
1431
|
+
func encodeUser(value User) riffdb.Value { return riffdb.Record(map[string]riffdb.Value{
|
|
1432
|
+
"name": riffdb.String(value.Name),
|
|
1433
|
+
"email": riffdb.String(value.Email),
|
|
1434
|
+
"image": riffdb.Optional(value.Image, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1435
|
+
"locale": riffdb.Optional(value.Locale, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1436
|
+
"user_id": riffdb.UUID(value.UserId),
|
|
1437
|
+
"revision": riffdb.U64(value.Revision),
|
|
1438
|
+
"created_at": riffdb.TimestampFrom(value.CreatedAt),
|
|
1439
|
+
"date_field": riffdb.Optional(value.DateField, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
1440
|
+
"updated_at": riffdb.TimestampFrom(value.UpdatedAt),
|
|
1441
|
+
"email_verified": riffdb.Bool(value.EmailVerified),
|
|
1442
|
+
"organization_id": riffdb.UUID(value.OrganizationId),
|
|
1443
|
+
}) }
|
|
1444
|
+
func decodeUser(value riffdb.Value) (User, error) { fields, err := riffdb.RecordFields(value); if err != nil { return User{}, err }; var result User; var raw riffdb.Value
|
|
1445
|
+
raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }
|
|
1446
|
+
raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }
|
|
1447
|
+
raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1448
|
+
raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1449
|
+
raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1450
|
+
raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }
|
|
1451
|
+
raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1452
|
+
raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }
|
|
1453
|
+
raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1454
|
+
raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }
|
|
1455
|
+
raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1456
|
+
return result, nil }
|
|
1457
|
+
|
|
1458
|
+
func encodeTenant(value Tenant) riffdb.Value { return riffdb.Record(map[string]riffdb.Value{
|
|
1459
|
+
"organization_id": riffdb.UUID(value.OrganizationId),
|
|
1460
|
+
}) }
|
|
1461
|
+
func decodeTenant(value riffdb.Value) (Tenant, error) { fields, err := riffdb.RecordFields(value); if err != nil { return Tenant{}, err }; var result Tenant; var raw riffdb.Value
|
|
1462
|
+
raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1463
|
+
return result, nil }
|
|
1464
|
+
|
|
1465
|
+
func encodeAccount(value Account) riffdb.Value { return riffdb.Record(map[string]riffdb.Value{
|
|
1466
|
+
"id": riffdb.UUID(value.Id),
|
|
1467
|
+
"scope": riffdb.Optional(value.Scope, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1468
|
+
"user_id": riffdb.UUID(value.UserId),
|
|
1469
|
+
"id_token": riffdb.Optional(value.IdToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1470
|
+
"password": riffdb.Optional(value.Password, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1471
|
+
"revision": riffdb.U64(value.Revision),
|
|
1472
|
+
"account_id": riffdb.String(value.AccountId),
|
|
1473
|
+
"created_at": riffdb.TimestampFrom(value.CreatedAt),
|
|
1474
|
+
"updated_at": riffdb.TimestampFrom(value.UpdatedAt),
|
|
1475
|
+
"provider_id": riffdb.String(value.ProviderId),
|
|
1476
|
+
"access_token": riffdb.Optional(value.AccessToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1477
|
+
"refresh_token": riffdb.Optional(value.RefreshToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1478
|
+
"organization_id": riffdb.UUID(value.OrganizationId),
|
|
1479
|
+
"access_token_expires_at": riffdb.Optional(value.AccessTokenExpiresAt, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
1480
|
+
"refresh_token_expires_at": riffdb.Optional(value.RefreshTokenExpiresAt, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
1481
|
+
}) }
|
|
1482
|
+
func decodeAccount(value riffdb.Value) (Account, error) { fields, err := riffdb.RecordFields(value); if err != nil { return Account{}, err }; var result Account; var raw riffdb.Value
|
|
1483
|
+
raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1484
|
+
raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1485
|
+
raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1486
|
+
raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1487
|
+
raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1488
|
+
raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }
|
|
1489
|
+
raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }
|
|
1490
|
+
raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1491
|
+
raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1492
|
+
raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }
|
|
1493
|
+
raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1494
|
+
raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1495
|
+
raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1496
|
+
raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }
|
|
1497
|
+
raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }
|
|
1498
|
+
return result, nil }
|
|
1499
|
+
|
|
1500
|
+
func encodeSession(value Session) riffdb.Value { return riffdb.Record(map[string]riffdb.Value{
|
|
1501
|
+
"id": riffdb.UUID(value.Id),
|
|
1502
|
+
"token": riffdb.String(value.Token),
|
|
1503
|
+
"user_id": riffdb.UUID(value.UserId),
|
|
1504
|
+
"revision": riffdb.U64(value.Revision),
|
|
1505
|
+
"created_at": riffdb.TimestampFrom(value.CreatedAt),
|
|
1506
|
+
"expires_at": riffdb.TimestampFrom(value.ExpiresAt),
|
|
1507
|
+
"ip_address": riffdb.Optional(value.IpAddress, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1508
|
+
"updated_at": riffdb.TimestampFrom(value.UpdatedAt),
|
|
1509
|
+
"user_agent": riffdb.Optional(value.UserAgent, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1510
|
+
"organization_id": riffdb.UUID(value.OrganizationId),
|
|
1511
|
+
}) }
|
|
1512
|
+
func decodeSession(value riffdb.Value) (Session, error) { fields, err := riffdb.RecordFields(value); if err != nil { return Session{}, err }; var result Session; var raw riffdb.Value
|
|
1513
|
+
raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1514
|
+
raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }
|
|
1515
|
+
raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1516
|
+
raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }
|
|
1517
|
+
raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1518
|
+
raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1519
|
+
raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1520
|
+
raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1521
|
+
raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1522
|
+
raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1523
|
+
return result, nil }
|
|
1524
|
+
|
|
1525
|
+
func encodeVerification(value Verification) riffdb.Value { return riffdb.Record(map[string]riffdb.Value{
|
|
1526
|
+
"value": riffdb.String(value.Value),
|
|
1527
|
+
"revision": riffdb.U64(value.Revision),
|
|
1528
|
+
"created_at": riffdb.TimestampFrom(value.CreatedAt),
|
|
1529
|
+
"expires_at": riffdb.TimestampFrom(value.ExpiresAt),
|
|
1530
|
+
"identifier": riffdb.String(value.Identifier),
|
|
1531
|
+
"updated_at": riffdb.TimestampFrom(value.UpdatedAt),
|
|
1532
|
+
"organization_id": riffdb.UUID(value.OrganizationId),
|
|
1533
|
+
"verification_id": riffdb.UUID(value.VerificationId),
|
|
1534
|
+
}) }
|
|
1535
|
+
func decodeVerification(value riffdb.Value) (Verification, error) { fields, err := riffdb.RecordFields(value); if err != nil { return Verification{}, err }; var result Verification; var raw riffdb.Value
|
|
1536
|
+
raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.StringValue(raw); if err != nil { return result, err }
|
|
1537
|
+
raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }
|
|
1538
|
+
raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1539
|
+
raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1540
|
+
raw, err = requiredField(fields, "identifier"); if err != nil { return result, err }; result.Identifier, err = riffdb.StringValue(raw); if err != nil { return result, err }
|
|
1541
|
+
raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1542
|
+
raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1543
|
+
raw, err = requiredField(fields, "verification_id"); if err != nil { return result, err }; result.VerificationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1544
|
+
return result, nil }
|
|
1545
|
+
|
|
1546
|
+
func encodeAccountPasswordUpdate(value AccountPasswordUpdate) riffdb.Value { return riffdb.Record(map[string]riffdb.Value{
|
|
1547
|
+
"user_id": riffdb.UUID(value.UserId),
|
|
1548
|
+
"password": riffdb.Optional(value.Password, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
1549
|
+
"account_id": riffdb.UUID(value.AccountId),
|
|
1550
|
+
"updated_at": riffdb.TimestampFrom(value.UpdatedAt),
|
|
1551
|
+
"provider_id": riffdb.String(value.ProviderId),
|
|
1552
|
+
"organization_id": riffdb.UUID(value.OrganizationId),
|
|
1553
|
+
"expected_revision": riffdb.U64(value.ExpectedRevision),
|
|
1554
|
+
}) }
|
|
1555
|
+
func decodeAccountPasswordUpdate(value riffdb.Value) (AccountPasswordUpdate, error) { fields, err := riffdb.RecordFields(value); if err != nil { return AccountPasswordUpdate{}, err }; var result AccountPasswordUpdate; var raw riffdb.Value
|
|
1556
|
+
raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1557
|
+
raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }
|
|
1558
|
+
raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1559
|
+
raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }
|
|
1560
|
+
raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }
|
|
1561
|
+
raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }
|
|
1562
|
+
raw, err = requiredField(fields, "expected_revision"); if err != nil { return result, err }; result.ExpectedRevision, err = riffdb.U64Value(raw); if err != nil { return result, err }
|
|
1563
|
+
return result, nil }
|
|
1564
|
+
|
|
1565
|
+
const AdminUsersAllEmailAscQueryPlanHash = "0d5b12685395e42e8de3b58bb525dbe2f9157267cd3254a93852dd75fef9b2ba"
|
|
1566
|
+
var AdminUsersAllEmailAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_all_email_asc", InputSchemaHash: "6f126f498c06a6648d15a6403e27e29890892d64f010ef3d89b3470124ebdd5f"}
|
|
1567
|
+
func decodeAdminUsersAllEmailAscResult(value riffdb.Value) (AdminUsersAllEmailAscResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1568
|
+
case "Found": result := AdminUsersAllEmailAscFound{Outcome: outcome}
|
|
1569
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1570
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1571
|
+
return result, nil
|
|
1572
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1573
|
+
func (client *Client) AdminUsersAllEmailAsc(ctx context.Context, parameters AdminUsersAllEmailAscParams, optionsList ...QueryOptions) (QueryResult[AdminUsersAllEmailAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersAllEmailAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1574
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersAllEmailAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1575
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1576
|
+
input["minimum_email"] = riffdb.String(parameters.MinimumEmail)
|
|
1577
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1578
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1579
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1580
|
+
response, err := client.session.Invoke(ctx, AdminUsersAllEmailAscOperation, input, options); if err != nil { return QueryResult[AdminUsersAllEmailAscResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersAllEmailAscResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersAllEmailAscResult(response.Value); if err != nil { return QueryResult[AdminUsersAllEmailAscResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersAllEmailAsc", PlanHash: AdminUsersAllEmailAscQueryPlanHash}; return QueryResult[AdminUsersAllEmailAscResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1581
|
+
func (client *Client) AdminUsersAllEmailAscAfterCommit(ctx context.Context, parameters AdminUsersAllEmailAscParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersAllEmailAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersAllEmailAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersAllEmailAsc(ctx, parameters, options) }
|
|
1582
|
+
|
|
1583
|
+
const AdminUsersContainsAscQueryPlanHash = "150dff76943515597746d05865d4605467289e475d376afd7fcb6a32a34b45b7"
|
|
1584
|
+
var AdminUsersContainsAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_contains_asc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1585
|
+
func decodeAdminUsersContainsAscResult(value riffdb.Value) (AdminUsersContainsAscResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1586
|
+
case "Found": result := AdminUsersContainsAscFound{Outcome: outcome}
|
|
1587
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1588
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1589
|
+
return result, nil
|
|
1590
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1591
|
+
func (client *Client) AdminUsersContainsAsc(ctx context.Context, parameters AdminUsersContainsAscParams, optionsList ...QueryOptions) (QueryResult[AdminUsersContainsAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersContainsAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1592
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersContainsAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1593
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1594
|
+
input["needle"] = riffdb.String(parameters.Needle)
|
|
1595
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1596
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1597
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1598
|
+
response, err := client.session.Invoke(ctx, AdminUsersContainsAscOperation, input, options); if err != nil { return QueryResult[AdminUsersContainsAscResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersContainsAscResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersContainsAscResult(response.Value); if err != nil { return QueryResult[AdminUsersContainsAscResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersContainsAsc", PlanHash: AdminUsersContainsAscQueryPlanHash}; return QueryResult[AdminUsersContainsAscResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1599
|
+
func (client *Client) AdminUsersContainsAscAfterCommit(ctx context.Context, parameters AdminUsersContainsAscParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersContainsAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersContainsAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersContainsAsc(ctx, parameters, options) }
|
|
1600
|
+
|
|
1601
|
+
const AdminUsersContainsDescQueryPlanHash = "d6a8b309f821e178f50e3ce1fdac11c6167187badbe65f3d110ce2fbb2730a6a"
|
|
1602
|
+
var AdminUsersContainsDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_contains_desc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1603
|
+
func decodeAdminUsersContainsDescResult(value riffdb.Value) (AdminUsersContainsDescResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1604
|
+
case "Found": result := AdminUsersContainsDescFound{Outcome: outcome}
|
|
1605
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1606
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1607
|
+
return result, nil
|
|
1608
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1609
|
+
func (client *Client) AdminUsersContainsDesc(ctx context.Context, parameters AdminUsersContainsDescParams, optionsList ...QueryOptions) (QueryResult[AdminUsersContainsDescResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersContainsDescResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1610
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersContainsDescResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1611
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1612
|
+
input["needle"] = riffdb.String(parameters.Needle)
|
|
1613
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1614
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1615
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1616
|
+
response, err := client.session.Invoke(ctx, AdminUsersContainsDescOperation, input, options); if err != nil { return QueryResult[AdminUsersContainsDescResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersContainsDescResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersContainsDescResult(response.Value); if err != nil { return QueryResult[AdminUsersContainsDescResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersContainsDesc", PlanHash: AdminUsersContainsDescQueryPlanHash}; return QueryResult[AdminUsersContainsDescResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1617
|
+
func (client *Client) AdminUsersContainsDescAfterCommit(ctx context.Context, parameters AdminUsersContainsDescParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersContainsDescResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersContainsDescResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersContainsDesc(ctx, parameters, options) }
|
|
1618
|
+
|
|
1619
|
+
const AdminUsersEmailContainsCreatedDescQueryPlanHash = "56699d8bbc9991cf37ef1ea450e33fc4c73c2c4ed1c4d4d403b8ca07a1f891d0"
|
|
1620
|
+
var AdminUsersEmailContainsCreatedDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_email_contains_created_desc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1621
|
+
func decodeAdminUsersEmailContainsCreatedDescResult(value riffdb.Value) (AdminUsersEmailContainsCreatedDescResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1622
|
+
case "Found": result := AdminUsersEmailContainsCreatedDescFound{Outcome: outcome}
|
|
1623
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1624
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1625
|
+
return result, nil
|
|
1626
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1627
|
+
func (client *Client) AdminUsersEmailContainsCreatedDesc(ctx context.Context, parameters AdminUsersEmailContainsCreatedDescParams, optionsList ...QueryOptions) (QueryResult[AdminUsersEmailContainsCreatedDescResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersEmailContainsCreatedDescResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1628
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersEmailContainsCreatedDescResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1629
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1630
|
+
input["needle"] = riffdb.String(parameters.Needle)
|
|
1631
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1632
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1633
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1634
|
+
response, err := client.session.Invoke(ctx, AdminUsersEmailContainsCreatedDescOperation, input, options); if err != nil { return QueryResult[AdminUsersEmailContainsCreatedDescResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersEmailContainsCreatedDescResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersEmailContainsCreatedDescResult(response.Value); if err != nil { return QueryResult[AdminUsersEmailContainsCreatedDescResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersEmailContainsCreatedDesc", PlanHash: AdminUsersEmailContainsCreatedDescQueryPlanHash}; return QueryResult[AdminUsersEmailContainsCreatedDescResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1635
|
+
func (client *Client) AdminUsersEmailContainsCreatedDescAfterCommit(ctx context.Context, parameters AdminUsersEmailContainsCreatedDescParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersEmailContainsCreatedDescResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersEmailContainsCreatedDescResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersEmailContainsCreatedDesc(ctx, parameters, options) }
|
|
1636
|
+
|
|
1637
|
+
const AdminUsersEmailContainsImageAscQueryPlanHash = "54f861d04e1ca2b3cfde740a098c7577588223a2552c733fb6c9c27e570d32c8"
|
|
1638
|
+
var AdminUsersEmailContainsImageAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_email_contains_image_asc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1639
|
+
func decodeAdminUsersEmailContainsImageAscResult(value riffdb.Value) (AdminUsersEmailContainsImageAscResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1640
|
+
case "Found": result := AdminUsersEmailContainsImageAscFound{Outcome: outcome}
|
|
1641
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1642
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1643
|
+
return result, nil
|
|
1644
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1645
|
+
func (client *Client) AdminUsersEmailContainsImageAsc(ctx context.Context, parameters AdminUsersEmailContainsImageAscParams, optionsList ...QueryOptions) (QueryResult[AdminUsersEmailContainsImageAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersEmailContainsImageAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1646
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersEmailContainsImageAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1647
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1648
|
+
input["needle"] = riffdb.String(parameters.Needle)
|
|
1649
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1650
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1651
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1652
|
+
response, err := client.session.Invoke(ctx, AdminUsersEmailContainsImageAscOperation, input, options); if err != nil { return QueryResult[AdminUsersEmailContainsImageAscResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersEmailContainsImageAscResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersEmailContainsImageAscResult(response.Value); if err != nil { return QueryResult[AdminUsersEmailContainsImageAscResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersEmailContainsImageAsc", PlanHash: AdminUsersEmailContainsImageAscQueryPlanHash}; return QueryResult[AdminUsersEmailContainsImageAscResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1653
|
+
func (client *Client) AdminUsersEmailContainsImageAscAfterCommit(ctx context.Context, parameters AdminUsersEmailContainsImageAscParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersEmailContainsImageAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersEmailContainsImageAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersEmailContainsImageAsc(ctx, parameters, options) }
|
|
1654
|
+
|
|
1655
|
+
const AdminUsersEndsWithAscQueryPlanHash = "a0261b356443918721db89ae6f6533b8a2046fbc8c7ad7273fcceffd18a20b82"
|
|
1656
|
+
var AdminUsersEndsWithAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_ends_with_asc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1657
|
+
func decodeAdminUsersEndsWithAscResult(value riffdb.Value) (AdminUsersEndsWithAscResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1658
|
+
case "Found": result := AdminUsersEndsWithAscFound{Outcome: outcome}
|
|
1659
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1660
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1661
|
+
return result, nil
|
|
1662
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1663
|
+
func (client *Client) AdminUsersEndsWithAsc(ctx context.Context, parameters AdminUsersEndsWithAscParams, optionsList ...QueryOptions) (QueryResult[AdminUsersEndsWithAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersEndsWithAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1664
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersEndsWithAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1665
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1666
|
+
input["needle"] = riffdb.String(parameters.Needle)
|
|
1667
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1668
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1669
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1670
|
+
response, err := client.session.Invoke(ctx, AdminUsersEndsWithAscOperation, input, options); if err != nil { return QueryResult[AdminUsersEndsWithAscResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersEndsWithAscResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersEndsWithAscResult(response.Value); if err != nil { return QueryResult[AdminUsersEndsWithAscResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersEndsWithAsc", PlanHash: AdminUsersEndsWithAscQueryPlanHash}; return QueryResult[AdminUsersEndsWithAscResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1671
|
+
func (client *Client) AdminUsersEndsWithAscAfterCommit(ctx context.Context, parameters AdminUsersEndsWithAscParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersEndsWithAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersEndsWithAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersEndsWithAsc(ctx, parameters, options) }
|
|
1672
|
+
|
|
1673
|
+
const AdminUsersEndsWithDescQueryPlanHash = "df4ffbf8934efe3a10cc98afb8cda7da0fb828b0a9e6981181340184b9be30d9"
|
|
1674
|
+
var AdminUsersEndsWithDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_ends_with_desc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1675
|
+
func decodeAdminUsersEndsWithDescResult(value riffdb.Value) (AdminUsersEndsWithDescResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1676
|
+
case "Found": result := AdminUsersEndsWithDescFound{Outcome: outcome}
|
|
1677
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1678
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1679
|
+
return result, nil
|
|
1680
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1681
|
+
func (client *Client) AdminUsersEndsWithDesc(ctx context.Context, parameters AdminUsersEndsWithDescParams, optionsList ...QueryOptions) (QueryResult[AdminUsersEndsWithDescResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersEndsWithDescResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1682
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersEndsWithDescResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1683
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1684
|
+
input["needle"] = riffdb.String(parameters.Needle)
|
|
1685
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1686
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1687
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1688
|
+
response, err := client.session.Invoke(ctx, AdminUsersEndsWithDescOperation, input, options); if err != nil { return QueryResult[AdminUsersEndsWithDescResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersEndsWithDescResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersEndsWithDescResult(response.Value); if err != nil { return QueryResult[AdminUsersEndsWithDescResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersEndsWithDesc", PlanHash: AdminUsersEndsWithDescQueryPlanHash}; return QueryResult[AdminUsersEndsWithDescResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1689
|
+
func (client *Client) AdminUsersEndsWithDescAfterCommit(ctx context.Context, parameters AdminUsersEndsWithDescParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersEndsWithDescResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersEndsWithDescResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersEndsWithDesc(ctx, parameters, options) }
|
|
1690
|
+
|
|
1691
|
+
const AdminUsersStartsWithAscQueryPlanHash = "dfaf7f619cde891bfc2254a1ad8523732904fc99cda955d76e1b3192d721c96e"
|
|
1692
|
+
var AdminUsersStartsWithAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_starts_with_asc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1693
|
+
func decodeAdminUsersStartsWithAscResult(value riffdb.Value) (AdminUsersStartsWithAscResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1694
|
+
case "Found": result := AdminUsersStartsWithAscFound{Outcome: outcome}
|
|
1695
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1696
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1697
|
+
return result, nil
|
|
1698
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1699
|
+
func (client *Client) AdminUsersStartsWithAsc(ctx context.Context, parameters AdminUsersStartsWithAscParams, optionsList ...QueryOptions) (QueryResult[AdminUsersStartsWithAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersStartsWithAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1700
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersStartsWithAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1701
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1702
|
+
input["needle"] = riffdb.String(parameters.Needle)
|
|
1703
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1704
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1705
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1706
|
+
response, err := client.session.Invoke(ctx, AdminUsersStartsWithAscOperation, input, options); if err != nil { return QueryResult[AdminUsersStartsWithAscResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersStartsWithAscResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersStartsWithAscResult(response.Value); if err != nil { return QueryResult[AdminUsersStartsWithAscResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersStartsWithAsc", PlanHash: AdminUsersStartsWithAscQueryPlanHash}; return QueryResult[AdminUsersStartsWithAscResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1707
|
+
func (client *Client) AdminUsersStartsWithAscAfterCommit(ctx context.Context, parameters AdminUsersStartsWithAscParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersStartsWithAscResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersStartsWithAscResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersStartsWithAsc(ctx, parameters, options) }
|
|
1708
|
+
|
|
1709
|
+
const AdminUsersStartsWithDescQueryPlanHash = "263f8501ee5dc05a60506cbd91e7ddeebc665caaef4fcad8b3d4538f9745d29f"
|
|
1710
|
+
var AdminUsersStartsWithDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_starts_with_desc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1711
|
+
func decodeAdminUsersStartsWithDescResult(value riffdb.Value) (AdminUsersStartsWithDescResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1712
|
+
case "Found": result := AdminUsersStartsWithDescFound{Outcome: outcome}
|
|
1713
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1714
|
+
raw, err = requiredField(fields, "total"); if err != nil { return nil, err }; result.Total, err = func() (struct { Value uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Value uint64 }{}, err }; var result struct { Value uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1715
|
+
return result, nil
|
|
1716
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1717
|
+
func (client *Client) AdminUsersStartsWithDesc(ctx context.Context, parameters AdminUsersStartsWithDescParams, optionsList ...QueryOptions) (QueryResult[AdminUsersStartsWithDescResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersStartsWithDescResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1718
|
+
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersStartsWithDescResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1719
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1720
|
+
input["needle"] = riffdb.String(parameters.Needle)
|
|
1721
|
+
if parameters.UserId != nil { input["user_id"] = riffdb.Optional(parameters.UserId, func(item string) riffdb.Value { return riffdb.UUID(item) }) }
|
|
1722
|
+
if parameters.Limit != nil { input["limit"] = riffdb.U64(uint64(*parameters.Limit)) }
|
|
1723
|
+
if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
1724
|
+
response, err := client.session.Invoke(ctx, AdminUsersStartsWithDescOperation, input, options); if err != nil { return QueryResult[AdminUsersStartsWithDescResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[AdminUsersStartsWithDescResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeAdminUsersStartsWithDescResult(response.Value); if err != nil { return QueryResult[AdminUsersStartsWithDescResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "AdminUsersStartsWithDesc", PlanHash: AdminUsersStartsWithDescQueryPlanHash}; return QueryResult[AdminUsersStartsWithDescResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1725
|
+
func (client *Client) AdminUsersStartsWithDescAfterCommit(ctx context.Context, parameters AdminUsersStartsWithDescParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[AdminUsersStartsWithDescResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[AdminUsersStartsWithDescResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.AdminUsersStartsWithDesc(ctx, parameters, options) }
|
|
1726
|
+
|
|
1727
|
+
const FindAccountByIdQueryPlanHash = "5f4c19b342e9e5fb133ba311dcf43e5a45aab2a92ad4c0237df58788f8163fa1"
|
|
1728
|
+
var FindAccountByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_account_by_id", InputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc"}
|
|
1729
|
+
func decodeFindAccountByIdResult(value riffdb.Value) (FindAccountByIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1730
|
+
case "Found": result := FindAccountByIdFound{Outcome: outcome}
|
|
1731
|
+
raw, err = requiredField(fields, "accounts"); if err != nil { return nil, err }; result.Accounts, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1732
|
+
return result, nil
|
|
1733
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1734
|
+
func (client *Client) FindAccountById(ctx context.Context, parameters FindAccountByIdParams, optionsList ...QueryOptions) (QueryResult[FindAccountByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindAccountByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1735
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1736
|
+
input["id"] = riffdb.UUID(parameters.Id)
|
|
1737
|
+
response, err := client.session.Invoke(ctx, FindAccountByIdOperation, input, options); if err != nil { return QueryResult[FindAccountByIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindAccountByIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindAccountByIdResult(response.Value); if err != nil { return QueryResult[FindAccountByIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindAccountById", PlanHash: FindAccountByIdQueryPlanHash}; return QueryResult[FindAccountByIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1738
|
+
func (client *Client) FindAccountByIdAfterCommit(ctx context.Context, parameters FindAccountByIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindAccountByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindAccountByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindAccountById(ctx, parameters, options) }
|
|
1739
|
+
|
|
1740
|
+
const FindAccountByProviderQueryPlanHash = "4e2ff9c33d5520ebe850da58f3271e47beaaab4c9a092c325dc9a02b058421ab"
|
|
1741
|
+
var FindAccountByProviderOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_account_by_provider", InputSchemaHash: "7e48e77594d132efa4753eee93934c2ef61f6d82313edff8f7c84c7d8d4112f2"}
|
|
1742
|
+
func decodeFindAccountByProviderResult(value riffdb.Value) (FindAccountByProviderResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1743
|
+
case "Found": result := FindAccountByProviderFound{Outcome: outcome}
|
|
1744
|
+
raw, err = requiredField(fields, "accounts"); if err != nil { return nil, err }; result.Accounts, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1745
|
+
return result, nil
|
|
1746
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1747
|
+
func (client *Client) FindAccountByProvider(ctx context.Context, parameters FindAccountByProviderParams, optionsList ...QueryOptions) (QueryResult[FindAccountByProviderResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindAccountByProviderResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1748
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1749
|
+
input["account_id"] = riffdb.String(parameters.AccountId)
|
|
1750
|
+
input["provider_id"] = riffdb.String(parameters.ProviderId)
|
|
1751
|
+
response, err := client.session.Invoke(ctx, FindAccountByProviderOperation, input, options); if err != nil { return QueryResult[FindAccountByProviderResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindAccountByProviderResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindAccountByProviderResult(response.Value); if err != nil { return QueryResult[FindAccountByProviderResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindAccountByProvider", PlanHash: FindAccountByProviderQueryPlanHash}; return QueryResult[FindAccountByProviderResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1752
|
+
func (client *Client) FindAccountByProviderAfterCommit(ctx context.Context, parameters FindAccountByProviderParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindAccountByProviderResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindAccountByProviderResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindAccountByProvider(ctx, parameters, options) }
|
|
1753
|
+
|
|
1754
|
+
const FindAccountsByUserIdQueryPlanHash = "08aa6eeb45b87599fb8d223eff9f0cde744f16c1b2bcea0aa5fb230b9a7fd11a"
|
|
1755
|
+
var FindAccountsByUserIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_accounts_by_user_id", InputSchemaHash: "52291caa82b70870673211137e93f3ecda460cbe7b9fc465f0b9d7f30df05798"}
|
|
1756
|
+
func decodeFindAccountsByUserIdResult(value riffdb.Value) (FindAccountsByUserIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1757
|
+
case "Found": result := FindAccountsByUserIdFound{Outcome: outcome}
|
|
1758
|
+
raw, err = requiredField(fields, "accounts"); if err != nil { return nil, err }; result.Accounts, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1759
|
+
return result, nil
|
|
1760
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1761
|
+
func (client *Client) FindAccountsByUserId(ctx context.Context, parameters FindAccountsByUserIdParams, optionsList ...QueryOptions) (QueryResult[FindAccountsByUserIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindAccountsByUserIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1762
|
+
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindAccountsByUserIdResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1763
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1764
|
+
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
1765
|
+
response, err := client.session.Invoke(ctx, FindAccountsByUserIdOperation, input, options); if err != nil { return QueryResult[FindAccountsByUserIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindAccountsByUserIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindAccountsByUserIdResult(response.Value); if err != nil { return QueryResult[FindAccountsByUserIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindAccountsByUserId", PlanHash: FindAccountsByUserIdQueryPlanHash}; return QueryResult[FindAccountsByUserIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1766
|
+
func (client *Client) FindAccountsByUserIdAfterCommit(ctx context.Context, parameters FindAccountsByUserIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindAccountsByUserIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindAccountsByUserIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindAccountsByUserId(ctx, parameters, options) }
|
|
1767
|
+
func (client *Client) FindAccountsByUserIdPages(ctx context.Context, parameters FindAccountsByUserIdParams, maxPages uint32, optionsList ...QueryOptions) ([]QueryResult[FindAccountsByUserIdResult], error) { if maxPages == 0 { maxPages = 64 }; if maxPages > 1024 { return nil, errors.New("maxPages must be from 1 through 1024") }; var options QueryOptions; if len(optionsList) > 1 { return nil, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if parameters.After != nil { if options.Cursor != "" { return nil, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After; parameters.After = nil }; pages := make([]QueryResult[FindAccountsByUserIdResult], 0, maxPages); for pageIndex := uint32(0); pageIndex < maxPages; pageIndex++ { page, err := client.FindAccountsByUserId(ctx, parameters, options); if err != nil { return nil, err }; pages = append(pages, page); if page.NextCursor == "" { break }; options.Cursor = page.NextCursor }; return pages, nil }
|
|
1768
|
+
|
|
1769
|
+
const FindAccountsByUserProviderQueryPlanHash = "c2347f53814225ee99b6372ac2aac1477789eeedad57c22bbac03d429d1ded7e"
|
|
1770
|
+
var FindAccountsByUserProviderOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_accounts_by_user_provider", InputSchemaHash: "f389d8fa7caa4fcb96e1004158f88ce43ae9bccac48b8bf74087eab48c022df7"}
|
|
1771
|
+
func decodeFindAccountsByUserProviderResult(value riffdb.Value) (FindAccountsByUserProviderResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1772
|
+
case "Found": result := FindAccountsByUserProviderFound{Outcome: outcome}
|
|
1773
|
+
raw, err = requiredField(fields, "accounts"); if err != nil { return nil, err }; result.Accounts, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1774
|
+
return result, nil
|
|
1775
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1776
|
+
func (client *Client) FindAccountsByUserProvider(ctx context.Context, parameters FindAccountsByUserProviderParams, optionsList ...QueryOptions) (QueryResult[FindAccountsByUserProviderResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindAccountsByUserProviderResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1777
|
+
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindAccountsByUserProviderResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1778
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1779
|
+
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
1780
|
+
input["provider_id"] = riffdb.String(parameters.ProviderId)
|
|
1781
|
+
response, err := client.session.Invoke(ctx, FindAccountsByUserProviderOperation, input, options); if err != nil { return QueryResult[FindAccountsByUserProviderResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindAccountsByUserProviderResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindAccountsByUserProviderResult(response.Value); if err != nil { return QueryResult[FindAccountsByUserProviderResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindAccountsByUserProvider", PlanHash: FindAccountsByUserProviderQueryPlanHash}; return QueryResult[FindAccountsByUserProviderResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1782
|
+
func (client *Client) FindAccountsByUserProviderAfterCommit(ctx context.Context, parameters FindAccountsByUserProviderParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindAccountsByUserProviderResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindAccountsByUserProviderResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindAccountsByUserProvider(ctx, parameters, options) }
|
|
1783
|
+
func (client *Client) FindAccountsByUserProviderPages(ctx context.Context, parameters FindAccountsByUserProviderParams, maxPages uint32, optionsList ...QueryOptions) ([]QueryResult[FindAccountsByUserProviderResult], error) { if maxPages == 0 { maxPages = 64 }; if maxPages > 1024 { return nil, errors.New("maxPages must be from 1 through 1024") }; var options QueryOptions; if len(optionsList) > 1 { return nil, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if parameters.After != nil { if options.Cursor != "" { return nil, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After; parameters.After = nil }; pages := make([]QueryResult[FindAccountsByUserProviderResult], 0, maxPages); for pageIndex := uint32(0); pageIndex < maxPages; pageIndex++ { page, err := client.FindAccountsByUserProvider(ctx, parameters, options); if err != nil { return nil, err }; pages = append(pages, page); if page.NextCursor == "" { break }; options.Cursor = page.NextCursor }; return pages, nil }
|
|
1784
|
+
|
|
1785
|
+
const FindActiveSessionsByUserIdQueryPlanHash = "aa2b20ce2a15fda750edf852e82f3a1f656290b76e30db733330592eba706566"
|
|
1786
|
+
var FindActiveSessionsByUserIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_active_sessions_by_user_id", InputSchemaHash: "56f77f3deba14d9fd74810cf14012109ddc4ba2f58c27a400a180df31ee38feb"}
|
|
1787
|
+
func decodeFindActiveSessionsByUserIdResult(value riffdb.Value) (FindActiveSessionsByUserIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1788
|
+
case "Found": result := FindActiveSessionsByUserIdFound{Outcome: outcome}
|
|
1789
|
+
raw, err = requiredField(fields, "sessions"); if err != nil { return nil, err }; result.Sessions, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1790
|
+
return result, nil
|
|
1791
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1792
|
+
func (client *Client) FindActiveSessionsByUserId(ctx context.Context, parameters FindActiveSessionsByUserIdParams, optionsList ...QueryOptions) (QueryResult[FindActiveSessionsByUserIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindActiveSessionsByUserIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1793
|
+
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindActiveSessionsByUserIdResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1794
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1795
|
+
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
1796
|
+
input["expires_after"] = riffdb.TimestampFrom(parameters.ExpiresAfter)
|
|
1797
|
+
response, err := client.session.Invoke(ctx, FindActiveSessionsByUserIdOperation, input, options); if err != nil { return QueryResult[FindActiveSessionsByUserIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindActiveSessionsByUserIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindActiveSessionsByUserIdResult(response.Value); if err != nil { return QueryResult[FindActiveSessionsByUserIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindActiveSessionsByUserId", PlanHash: FindActiveSessionsByUserIdQueryPlanHash}; return QueryResult[FindActiveSessionsByUserIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1798
|
+
func (client *Client) FindActiveSessionsByUserIdAfterCommit(ctx context.Context, parameters FindActiveSessionsByUserIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindActiveSessionsByUserIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindActiveSessionsByUserIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindActiveSessionsByUserId(ctx, parameters, options) }
|
|
1799
|
+
func (client *Client) FindActiveSessionsByUserIdPages(ctx context.Context, parameters FindActiveSessionsByUserIdParams, maxPages uint32, optionsList ...QueryOptions) ([]QueryResult[FindActiveSessionsByUserIdResult], error) { if maxPages == 0 { maxPages = 64 }; if maxPages > 1024 { return nil, errors.New("maxPages must be from 1 through 1024") }; var options QueryOptions; if len(optionsList) > 1 { return nil, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if parameters.After != nil { if options.Cursor != "" { return nil, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After; parameters.After = nil }; pages := make([]QueryResult[FindActiveSessionsByUserIdResult], 0, maxPages); for pageIndex := uint32(0); pageIndex < maxPages; pageIndex++ { page, err := client.FindActiveSessionsByUserId(ctx, parameters, options); if err != nil { return nil, err }; pages = append(pages, page); if page.NextCursor == "" { break }; options.Cursor = page.NextCursor }; return pages, nil }
|
|
1800
|
+
|
|
1801
|
+
const FindCredentialAccountQueryPlanHash = "f526e9bd2e7b8e054da0039fc5f2b3dce0c042fc362e19ce4003832644136a00"
|
|
1802
|
+
var FindCredentialAccountOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_credential_account", InputSchemaHash: "108a21aa464170aff1274c8f9af12f9c84d899483e63eb62f4fc9bed6e4fc040"}
|
|
1803
|
+
func decodeFindCredentialAccountResult(value riffdb.Value) (FindCredentialAccountResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1804
|
+
case "Found": result := FindCredentialAccountFound{Outcome: outcome}
|
|
1805
|
+
raw, err = requiredField(fields, "accounts"); if err != nil { return nil, err }; result.Accounts, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { OrganizationId string; UserId string; Id string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; IdToken *string; Password *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { OrganizationId string; UserId string; Id string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; IdToken *string; Password *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { OrganizationId string; UserId string; Id string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; IdToken *string; Password *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { OrganizationId string; UserId string; Id string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; IdToken *string; Password *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "organization_id"); if err != nil { return result, err }; result.OrganizationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1806
|
+
return result, nil
|
|
1807
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1808
|
+
func (client *Client) FindCredentialAccount(ctx context.Context, parameters FindCredentialAccountParams, optionsList ...QueryOptions) (QueryResult[FindCredentialAccountResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindCredentialAccountResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1809
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1810
|
+
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
1811
|
+
input["account_id"] = riffdb.String(parameters.AccountId)
|
|
1812
|
+
input["provider_id"] = riffdb.String(parameters.ProviderId)
|
|
1813
|
+
response, err := client.session.Invoke(ctx, FindCredentialAccountOperation, input, options); if err != nil { return QueryResult[FindCredentialAccountResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindCredentialAccountResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindCredentialAccountResult(response.Value); if err != nil { return QueryResult[FindCredentialAccountResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindCredentialAccount", PlanHash: FindCredentialAccountQueryPlanHash}; return QueryResult[FindCredentialAccountResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1814
|
+
func (client *Client) FindCredentialAccountAfterCommit(ctx context.Context, parameters FindCredentialAccountParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindCredentialAccountResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindCredentialAccountResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindCredentialAccount(ctx, parameters, options) }
|
|
1815
|
+
|
|
1816
|
+
const FindExpiredVerificationIdsQueryPlanHash = "03bc46fc682fec7be4fabdbf1f152a4546e6613df45df02f2dbaf6b08de56f01"
|
|
1817
|
+
var FindExpiredVerificationIdsOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_expired_verification_ids", InputSchemaHash: "b2397d3409885ae750a1d8b4d53bc6905e59348dfc79f0b4d2934981ad4cb1b2"}
|
|
1818
|
+
func decodeFindExpiredVerificationIdsResult(value riffdb.Value) (FindExpiredVerificationIdsResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1819
|
+
case "Found": result := FindExpiredVerificationIdsFound{Outcome: outcome}
|
|
1820
|
+
raw, err = requiredField(fields, "verifications"); if err != nil { return nil, err }; result.Verifications, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { VerificationId string }, error) { return func() (struct { VerificationId string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { VerificationId string }{}, err }; var result struct { VerificationId string }; var raw riffdb.Value; raw, err = requiredField(fields, "verification_id"); if err != nil { return result, err }; result.VerificationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1821
|
+
return result, nil
|
|
1822
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1823
|
+
func (client *Client) FindExpiredVerificationIds(ctx context.Context, parameters FindExpiredVerificationIdsParams, optionsList ...QueryOptions) (QueryResult[FindExpiredVerificationIdsResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindExpiredVerificationIdsResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1824
|
+
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindExpiredVerificationIdsResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1825
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1826
|
+
input["expires_before"] = riffdb.TimestampFrom(parameters.ExpiresBefore)
|
|
1827
|
+
response, err := client.session.Invoke(ctx, FindExpiredVerificationIdsOperation, input, options); if err != nil { return QueryResult[FindExpiredVerificationIdsResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindExpiredVerificationIdsResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindExpiredVerificationIdsResult(response.Value); if err != nil { return QueryResult[FindExpiredVerificationIdsResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindExpiredVerificationIds", PlanHash: FindExpiredVerificationIdsQueryPlanHash}; return QueryResult[FindExpiredVerificationIdsResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1828
|
+
func (client *Client) FindExpiredVerificationIdsAfterCommit(ctx context.Context, parameters FindExpiredVerificationIdsParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindExpiredVerificationIdsResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindExpiredVerificationIdsResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindExpiredVerificationIds(ctx, parameters, options) }
|
|
1829
|
+
func (client *Client) FindExpiredVerificationIdsPages(ctx context.Context, parameters FindExpiredVerificationIdsParams, maxPages uint32, optionsList ...QueryOptions) ([]QueryResult[FindExpiredVerificationIdsResult], error) { if maxPages == 0 { maxPages = 64 }; if maxPages > 1024 { return nil, errors.New("maxPages must be from 1 through 1024") }; var options QueryOptions; if len(optionsList) > 1 { return nil, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if parameters.After != nil { if options.Cursor != "" { return nil, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After; parameters.After = nil }; pages := make([]QueryResult[FindExpiredVerificationIdsResult], 0, maxPages); for pageIndex := uint32(0); pageIndex < maxPages; pageIndex++ { page, err := client.FindExpiredVerificationIds(ctx, parameters, options); if err != nil { return nil, err }; pages = append(pages, page); if page.NextCursor == "" { break }; options.Cursor = page.NextCursor }; return pages, nil }
|
|
1830
|
+
|
|
1831
|
+
const FindLatestVerificationQueryPlanHash = "9b30d93634e08ee6d56af39d05755f51d87ab3ffd3e0b76cc06c82d63a75ee6b"
|
|
1832
|
+
var FindLatestVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_latest_verification", InputSchemaHash: "414c00deb31dd873e434c8006a8caa9d2b360457abe0f8269440d6c761dfdc94"}
|
|
1833
|
+
func decodeFindLatestVerificationResult(value riffdb.Value) (FindLatestVerificationResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1834
|
+
case "Found": result := FindLatestVerificationFound{Outcome: outcome}
|
|
1835
|
+
raw, err = requiredField(fields, "verifications"); if err != nil { return nil, err }; result.Verifications, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "verification_id"); if err != nil { return result, err }; result.VerificationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "identifier"); if err != nil { return result, err }; result.Identifier, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1836
|
+
return result, nil
|
|
1837
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1838
|
+
func (client *Client) FindLatestVerification(ctx context.Context, parameters FindLatestVerificationParams, optionsList ...QueryOptions) (QueryResult[FindLatestVerificationResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindLatestVerificationResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1839
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1840
|
+
input["identifier"] = riffdb.String(parameters.Identifier)
|
|
1841
|
+
response, err := client.session.Invoke(ctx, FindLatestVerificationOperation, input, options); if err != nil { return QueryResult[FindLatestVerificationResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindLatestVerificationResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindLatestVerificationResult(response.Value); if err != nil { return QueryResult[FindLatestVerificationResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindLatestVerification", PlanHash: FindLatestVerificationQueryPlanHash}; return QueryResult[FindLatestVerificationResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1842
|
+
func (client *Client) FindLatestVerificationAfterCommit(ctx context.Context, parameters FindLatestVerificationParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindLatestVerificationResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindLatestVerificationResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindLatestVerification(ctx, parameters, options) }
|
|
1843
|
+
|
|
1844
|
+
const FindSessionByIdQueryPlanHash = "ba28c8fbaff96325f8e0f7eb2764cf56189f1ea3c4463dcf75eec5d7780c74a3"
|
|
1845
|
+
var FindSessionByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_session_by_id", InputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc"}
|
|
1846
|
+
func decodeFindSessionByIdResult(value riffdb.Value) (FindSessionByIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1847
|
+
case "Found": result := FindSessionByIdFound{Outcome: outcome}
|
|
1848
|
+
raw, err = requiredField(fields, "sessions"); if err != nil { return nil, err }; result.Sessions, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1849
|
+
return result, nil
|
|
1850
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1851
|
+
func (client *Client) FindSessionById(ctx context.Context, parameters FindSessionByIdParams, optionsList ...QueryOptions) (QueryResult[FindSessionByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1852
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1853
|
+
input["id"] = riffdb.UUID(parameters.Id)
|
|
1854
|
+
response, err := client.session.Invoke(ctx, FindSessionByIdOperation, input, options); if err != nil { return QueryResult[FindSessionByIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindSessionByIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindSessionByIdResult(response.Value); if err != nil { return QueryResult[FindSessionByIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindSessionById", PlanHash: FindSessionByIdQueryPlanHash}; return QueryResult[FindSessionByIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1855
|
+
func (client *Client) FindSessionByIdAfterCommit(ctx context.Context, parameters FindSessionByIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindSessionByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindSessionById(ctx, parameters, options) }
|
|
1856
|
+
|
|
1857
|
+
const FindSessionByTokenQueryPlanHash = "1ff3d0007220b55cc6acf4e1c6b83071159c96679600fe80f9829185ec7e4fe7"
|
|
1858
|
+
var FindSessionByTokenOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_session_by_token", InputSchemaHash: "0ff142e840e9d2d322c37be4688526fc1348f508cc4976856bd7e4d2570859e8"}
|
|
1859
|
+
func decodeFindSessionByTokenResult(value riffdb.Value) (FindSessionByTokenResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1860
|
+
case "Found": result := FindSessionByTokenFound{Outcome: outcome}
|
|
1861
|
+
raw, err = requiredField(fields, "sessions"); if err != nil { return nil, err }; result.Sessions, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1862
|
+
return result, nil
|
|
1863
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1864
|
+
func (client *Client) FindSessionByToken(ctx context.Context, parameters FindSessionByTokenParams, optionsList ...QueryOptions) (QueryResult[FindSessionByTokenResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionByTokenResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1865
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1866
|
+
input["token"] = riffdb.String(parameters.Token)
|
|
1867
|
+
response, err := client.session.Invoke(ctx, FindSessionByTokenOperation, input, options); if err != nil { return QueryResult[FindSessionByTokenResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindSessionByTokenResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindSessionByTokenResult(response.Value); if err != nil { return QueryResult[FindSessionByTokenResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindSessionByToken", PlanHash: FindSessionByTokenQueryPlanHash}; return QueryResult[FindSessionByTokenResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1868
|
+
func (client *Client) FindSessionByTokenAfterCommit(ctx context.Context, parameters FindSessionByTokenParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindSessionByTokenResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionByTokenResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindSessionByToken(ctx, parameters, options) }
|
|
1869
|
+
|
|
1870
|
+
const FindSessionsByTokenSetQueryPlanHash = "6558126e5e64f676c7add951e272a94e2b93c3763de2eb4be0fd23d7e0ba8e0d"
|
|
1871
|
+
const FindSessionsByTokenSetTokensMaxItems = 32
|
|
1872
|
+
var FindSessionsByTokenSetOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_sessions_by_token_set", InputSchemaHash: "6e07645237cd913d73a45bd7f863e3ca8d9ae09fdfecdb7494246fa80dea3899"}
|
|
1873
|
+
func decodeFindSessionsByTokenSetResult(value riffdb.Value) (FindSessionsByTokenSetResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1874
|
+
case "Found": result := FindSessionsByTokenSetFound{Outcome: outcome}
|
|
1875
|
+
raw, err = requiredField(fields, "sessions"); if err != nil { return nil, err }; result.Sessions, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1876
|
+
return result, nil
|
|
1877
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1878
|
+
func (client *Client) FindSessionsByTokenSet(ctx context.Context, parameters FindSessionsByTokenSetParams, optionsList ...QueryOptions) (QueryResult[FindSessionsByTokenSetResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionsByTokenSetResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1879
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1880
|
+
input["tokens"] = riffdb.Values(parameters.Tokens, func(item string) riffdb.Value { return riffdb.String(item) })
|
|
1881
|
+
response, err := client.session.Invoke(ctx, FindSessionsByTokenSetOperation, input, options); if err != nil { return QueryResult[FindSessionsByTokenSetResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindSessionsByTokenSetResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindSessionsByTokenSetResult(response.Value); if err != nil { return QueryResult[FindSessionsByTokenSetResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindSessionsByTokenSet", PlanHash: FindSessionsByTokenSetQueryPlanHash}; return QueryResult[FindSessionsByTokenSetResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1882
|
+
func (client *Client) FindSessionsByTokenSetAfterCommit(ctx context.Context, parameters FindSessionsByTokenSetParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindSessionsByTokenSetResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionsByTokenSetResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindSessionsByTokenSet(ctx, parameters, options) }
|
|
1883
|
+
func (client *Client) FindSessionsByTokenSetAll(ctx context.Context, parameters FindSessionsByTokenSetParams, maxPages uint32, optionsList ...QueryOptions) (QueryResult[FindSessionsByTokenSetFound], error) { if maxPages == 0 { maxPages = 64 }; if maxPages > 1024 { return QueryResult[FindSessionsByTokenSetFound]{}, errors.New("maxPages must be from 1 through 1024") }; var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionsByTokenSetFound]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.Cursor != "" { return QueryResult[FindSessionsByTokenSetFound]{}, errors.New("FindSessionsByTokenSetAll does not accept an initial cursor") }; rawItems := parameters.Tokens; if len(rawItems) == 0 { return QueryResult[FindSessionsByTokenSetFound]{}, errors.New("tokens must contain at least 1 item") }; seen := make(map[string]struct{}, len(rawItems)); items := make([]string, 0, len(rawItems)); for _, item := range rawItems { if _, ok := seen[item]; !ok { seen[item] = struct{}{}; items = append(items, item) } }; var pinnedHead *uint64; if options.ReadAfterCommit != nil { commitSeq := *options.ReadAfterCommit; pinnedHead = &commitSeq } else { pinnedHead = client.LastCommitSequence() }; var highestHead uint64; var latestIdentity QueryIdentity; merged := FindSessionsByTokenSetFound{Outcome: "Found"}; pagesRemaining := maxPages; for offset := 0; offset < len(items); offset += FindSessionsByTokenSetTokensMaxItems { end := offset + FindSessionsByTokenSetTokensMaxItems; if end > len(items) { end = len(items) }; chunkParams := parameters; chunkParams.Tokens = items[offset:end]; chunkOptions := options; chunkOptions.Cursor = ""; for { if pagesRemaining == 0 { return QueryResult[FindSessionsByTokenSetFound]{}, errors.New("FindSessionsByTokenSetAll exceeded maxPages (1..=1024)") }; pagesRemaining--; chunkOptions.ReadAfterCommit = pinnedHead; page, err := client.FindSessionsByTokenSet(ctx, chunkParams, chunkOptions); if err != nil { return QueryResult[FindSessionsByTokenSetFound]{}, err }; found, err := UnwrapFindSessionsByTokenSetFound(page.Value); if err != nil { return QueryResult[FindSessionsByTokenSetFound]{}, err }; if merged.Sessions == nil { merged.Sessions = append(found.Sessions[:0:0], found.Sessions...) } else { merged.Sessions = append(merged.Sessions, found.Sessions...) }; latestIdentity = page.Identity; if page.ApplicationHead > highestHead { highestHead = page.ApplicationHead }; if pinnedHead == nil || page.ApplicationHead > *pinnedHead { headCopy := page.ApplicationHead; pinnedHead = &headCopy }; if page.NextCursor == "" { break }; chunkOptions.Cursor = page.NextCursor } }; return QueryResult[FindSessionsByTokenSetFound]{Value: merged, Identity: latestIdentity, ApplicationHead: highestHead}, nil }
|
|
1884
|
+
|
|
1885
|
+
const FindSessionsByUserIdQueryPlanHash = "83a23f70bb1ec3f3cab97553aba531eb3d7a9011db5854bc6b6db78dbff0bae2"
|
|
1886
|
+
var FindSessionsByUserIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_sessions_by_user_id", InputSchemaHash: "52291caa82b70870673211137e93f3ecda460cbe7b9fc465f0b9d7f30df05798"}
|
|
1887
|
+
func decodeFindSessionsByUserIdResult(value riffdb.Value) (FindSessionsByUserIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1888
|
+
case "Found": result := FindSessionsByUserIdFound{Outcome: outcome}
|
|
1889
|
+
raw, err = requiredField(fields, "sessions"); if err != nil { return nil, err }; result.Sessions, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1890
|
+
return result, nil
|
|
1891
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1892
|
+
func (client *Client) FindSessionsByUserId(ctx context.Context, parameters FindSessionsByUserIdParams, optionsList ...QueryOptions) (QueryResult[FindSessionsByUserIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionsByUserIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1893
|
+
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindSessionsByUserIdResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1894
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1895
|
+
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
1896
|
+
response, err := client.session.Invoke(ctx, FindSessionsByUserIdOperation, input, options); if err != nil { return QueryResult[FindSessionsByUserIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindSessionsByUserIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindSessionsByUserIdResult(response.Value); if err != nil { return QueryResult[FindSessionsByUserIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindSessionsByUserId", PlanHash: FindSessionsByUserIdQueryPlanHash}; return QueryResult[FindSessionsByUserIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1897
|
+
func (client *Client) FindSessionsByUserIdAfterCommit(ctx context.Context, parameters FindSessionsByUserIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindSessionsByUserIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindSessionsByUserIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindSessionsByUserId(ctx, parameters, options) }
|
|
1898
|
+
func (client *Client) FindSessionsByUserIdPages(ctx context.Context, parameters FindSessionsByUserIdParams, maxPages uint32, optionsList ...QueryOptions) ([]QueryResult[FindSessionsByUserIdResult], error) { if maxPages == 0 { maxPages = 64 }; if maxPages > 1024 { return nil, errors.New("maxPages must be from 1 through 1024") }; var options QueryOptions; if len(optionsList) > 1 { return nil, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if parameters.After != nil { if options.Cursor != "" { return nil, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After; parameters.After = nil }; pages := make([]QueryResult[FindSessionsByUserIdResult], 0, maxPages); for pageIndex := uint32(0); pageIndex < maxPages; pageIndex++ { page, err := client.FindSessionsByUserId(ctx, parameters, options); if err != nil { return nil, err }; pages = append(pages, page); if page.NextCursor == "" { break }; options.Cursor = page.NextCursor }; return pages, nil }
|
|
1899
|
+
|
|
1900
|
+
const FindUserByEmailQueryPlanHash = "24762c2b0ffffcebb8a9d610401f5596d2a64d46cf5fb362971414b2377d894f"
|
|
1901
|
+
var FindUserByEmailOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_user_by_email", InputSchemaHash: "7d3b1da87ea1ee59893e110cd8f8a5eacb522a8fde24a7e8aa9b7c13340990b9"}
|
|
1902
|
+
func decodeFindUserByEmailResult(value riffdb.Value) (FindUserByEmailResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1903
|
+
case "Found": result := FindUserByEmailFound{Outcome: outcome}
|
|
1904
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1905
|
+
return result, nil
|
|
1906
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1907
|
+
func decodeFindUserByEmailCompact(value *riffdb.CompactQueryResult) (FindUserByEmailResult, error) { if value == nil || value.Outcome != "Found" || value.ResultName != "users" || value.Entity != "User" || len(value.Fields) != 10 || len(value.Rows) > 1 { return nil, errors.New("RiffDB driver returned invalid compact result") }; expected := []string{"created_at", "date_field", "email", "email_verified", "image", "locale", "name", "revision", "updated_at", "user_id"}; for index := range expected { if value.Fields[index] != expected[index] { return nil, errors.New("RiffDB driver returned invalid compact result") } }; rows := make([]struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, 0, len(value.Rows)); for _, rawRow := range value.Rows { if len(rawRow) != len(expected) { return nil, errors.New("RiffDB driver returned invalid compact result") }; var row struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var err error
|
|
1908
|
+
row.CreatedAt, err = riffdb.TimestampValue(rawRow[0]); if err != nil { return nil, err }
|
|
1909
|
+
row.DateField, err = riffdb.DecodeOptional(rawRow[1], func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return nil, err }
|
|
1910
|
+
row.Email, err = func() (string, error) { result, err := riffdb.StringValue(rawRow[2]); if err != nil || len(result) > 320 { return "", errors.New("invalid RiffDB compact value") }; return result, nil }(); if err != nil { return nil, err }
|
|
1911
|
+
row.EmailVerified, err = riffdb.BoolValue(rawRow[3]); if err != nil { return nil, err }
|
|
1912
|
+
row.Image, err = riffdb.DecodeOptional(rawRow[4], func(item riffdb.Value) (string, error) { return func() (string, error) { result, err := riffdb.StringValue(item); if err != nil || len(result) > 2048 { return "", errors.New("invalid RiffDB compact value") }; return result, nil }() }); if err != nil { return nil, err }
|
|
1913
|
+
row.Locale, err = riffdb.DecodeOptional(rawRow[5], func(item riffdb.Value) (string, error) { return func() (string, error) { result, err := riffdb.StringValue(item); if err != nil || len(result) > 2048 { return "", errors.New("invalid RiffDB compact value") }; return result, nil }() }); if err != nil { return nil, err }
|
|
1914
|
+
row.Name, err = func() (string, error) { result, err := riffdb.StringValue(rawRow[6]); if err != nil || len(result) > 256 { return "", errors.New("invalid RiffDB compact value") }; return result, nil }(); if err != nil { return nil, err }
|
|
1915
|
+
row.Revision, err = riffdb.U64Value(rawRow[7]); if err != nil { return nil, err }
|
|
1916
|
+
row.UpdatedAt, err = riffdb.TimestampValue(rawRow[8]); if err != nil { return nil, err }
|
|
1917
|
+
row.UserId, err = riffdb.UUIDValue(rawRow[9]); if err != nil { return nil, err }
|
|
1918
|
+
rows = append(rows, row) }; return FindUserByEmailFound{Outcome: "Found", Users: rows}, nil }
|
|
1919
|
+
func (client *Client) FindUserByEmail(ctx context.Context, parameters FindUserByEmailParams, optionsList ...QueryOptions) (QueryResult[FindUserByEmailResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindUserByEmailResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1920
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1921
|
+
input["email"] = riffdb.String(parameters.Email)
|
|
1922
|
+
options.AcceptCompactResult = true; response, err := client.session.Invoke(ctx, FindUserByEmailOperation, input, options); if err != nil { return QueryResult[FindUserByEmailResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindUserByEmailResult]{}, errors.New("RiffDB driver omitted query frontier") }; var value FindUserByEmailResult; if response.Compact != nil { value, err = decodeFindUserByEmailCompact(response.Compact) } else { value, err = decodeFindUserByEmailResult(response.Value) }; if err != nil { return QueryResult[FindUserByEmailResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindUserByEmail", PlanHash: FindUserByEmailQueryPlanHash}; return QueryResult[FindUserByEmailResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1923
|
+
func (client *Client) FindUserByEmailAfterCommit(ctx context.Context, parameters FindUserByEmailParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindUserByEmailResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindUserByEmailResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindUserByEmail(ctx, parameters, options) }
|
|
1924
|
+
|
|
1925
|
+
const FindUserByIdQueryPlanHash = "4cf6ed386cc8486083a127c74d554670d1358187d2ef4e83d68fca40adfe77ae"
|
|
1926
|
+
var FindUserByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_user_by_id", InputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc"}
|
|
1927
|
+
func decodeFindUserByIdResult(value riffdb.Value) (FindUserByIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1928
|
+
case "Found": result := FindUserByIdFound{Outcome: outcome}
|
|
1929
|
+
raw, err = requiredField(fields, "user"); if err != nil { return nil, err }; result.User, err = func() (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1930
|
+
return result, nil
|
|
1931
|
+
case "Missing": result := FindUserByIdMissing{Outcome: outcome}
|
|
1932
|
+
return result, nil
|
|
1933
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1934
|
+
func (client *Client) FindUserById(ctx context.Context, parameters FindUserByIdParams, optionsList ...QueryOptions) (QueryResult[FindUserByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindUserByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1935
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1936
|
+
input["id"] = riffdb.UUID(parameters.Id)
|
|
1937
|
+
response, err := client.session.Invoke(ctx, FindUserByIdOperation, input, options); if err != nil { return QueryResult[FindUserByIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindUserByIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindUserByIdResult(response.Value); if err != nil { return QueryResult[FindUserByIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindUserById", PlanHash: FindUserByIdQueryPlanHash}; return QueryResult[FindUserByIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1938
|
+
func (client *Client) FindUserByIdAfterCommit(ctx context.Context, parameters FindUserByIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindUserByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindUserByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindUserById(ctx, parameters, options) }
|
|
1939
|
+
|
|
1940
|
+
const FindVerificationByIdQueryPlanHash = "061068a3b56749be5ff6153ccca99f82689bfaf825a09621b611270d17c7c0dc"
|
|
1941
|
+
var FindVerificationByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_verification_by_id", InputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc"}
|
|
1942
|
+
func decodeFindVerificationByIdResult(value riffdb.Value) (FindVerificationByIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1943
|
+
case "Found": result := FindVerificationByIdFound{Outcome: outcome}
|
|
1944
|
+
raw, err = requiredField(fields, "verification"); if err != nil { return nil, err }; result.Verification, err = func() (struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "verification_id"); if err != nil { return result, err }; result.VerificationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "identifier"); if err != nil { return result, err }; result.Identifier, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1945
|
+
return result, nil
|
|
1946
|
+
case "Missing": result := FindVerificationByIdMissing{Outcome: outcome}
|
|
1947
|
+
return result, nil
|
|
1948
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1949
|
+
func (client *Client) FindVerificationById(ctx context.Context, parameters FindVerificationByIdParams, optionsList ...QueryOptions) (QueryResult[FindVerificationByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindVerificationByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1950
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1951
|
+
input["id"] = riffdb.UUID(parameters.Id)
|
|
1952
|
+
response, err := client.session.Invoke(ctx, FindVerificationByIdOperation, input, options); if err != nil { return QueryResult[FindVerificationByIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindVerificationByIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindVerificationByIdResult(response.Value); if err != nil { return QueryResult[FindVerificationByIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindVerificationById", PlanHash: FindVerificationByIdQueryPlanHash}; return QueryResult[FindVerificationByIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1953
|
+
func (client *Client) FindVerificationByIdAfterCommit(ctx context.Context, parameters FindVerificationByIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindVerificationByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindVerificationByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindVerificationById(ctx, parameters, options) }
|
|
1954
|
+
|
|
1955
|
+
const FindVerificationsByIdentifierQueryPlanHash = "ee1531d8c350b6b110af9f113d8abc9aaba558e0f705b5154a74d1fca8086445"
|
|
1956
|
+
var FindVerificationsByIdentifierOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_verifications_by_identifier", InputSchemaHash: "f61c6a3fd1f9b7496a437e77f166f72e9c36d27d832811ac96f146fa2999cc37"}
|
|
1957
|
+
func decodeFindVerificationsByIdentifierResult(value riffdb.Value) (FindVerificationsByIdentifierResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1958
|
+
case "Found": result := FindVerificationsByIdentifierFound{Outcome: outcome}
|
|
1959
|
+
raw, err = requiredField(fields, "verifications"); if err != nil { return nil, err }; result.Verifications, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { VerificationId string; Identifier string; Value string; ExpiresAt riffdb.Instant; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "verification_id"); if err != nil { return result, err }; result.VerificationId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "identifier"); if err != nil { return result, err }; result.Identifier, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "value"); if err != nil { return result, err }; result.Value, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1960
|
+
return result, nil
|
|
1961
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1962
|
+
func (client *Client) FindVerificationsByIdentifier(ctx context.Context, parameters FindVerificationsByIdentifierParams, optionsList ...QueryOptions) (QueryResult[FindVerificationsByIdentifierResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindVerificationsByIdentifierResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1963
|
+
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindVerificationsByIdentifierResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1964
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1965
|
+
input["identifier"] = riffdb.String(parameters.Identifier)
|
|
1966
|
+
response, err := client.session.Invoke(ctx, FindVerificationsByIdentifierOperation, input, options); if err != nil { return QueryResult[FindVerificationsByIdentifierResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[FindVerificationsByIdentifierResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeFindVerificationsByIdentifierResult(response.Value); if err != nil { return QueryResult[FindVerificationsByIdentifierResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "FindVerificationsByIdentifier", PlanHash: FindVerificationsByIdentifierQueryPlanHash}; return QueryResult[FindVerificationsByIdentifierResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1967
|
+
func (client *Client) FindVerificationsByIdentifierAfterCommit(ctx context.Context, parameters FindVerificationsByIdentifierParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[FindVerificationsByIdentifierResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[FindVerificationsByIdentifierResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.FindVerificationsByIdentifier(ctx, parameters, options) }
|
|
1968
|
+
func (client *Client) FindVerificationsByIdentifierPages(ctx context.Context, parameters FindVerificationsByIdentifierParams, maxPages uint32, optionsList ...QueryOptions) ([]QueryResult[FindVerificationsByIdentifierResult], error) { if maxPages == 0 { maxPages = 64 }; if maxPages > 1024 { return nil, errors.New("maxPages must be from 1 through 1024") }; var options QueryOptions; if len(optionsList) > 1 { return nil, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if parameters.After != nil { if options.Cursor != "" { return nil, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After; parameters.After = nil }; pages := make([]QueryResult[FindVerificationsByIdentifierResult], 0, maxPages); for pageIndex := uint32(0); pageIndex < maxPages; pageIndex++ { page, err := client.FindVerificationsByIdentifier(ctx, parameters, options); if err != nil { return nil, err }; pages = append(pages, page); if page.NextCursor == "" { break }; options.Cursor = page.NextCursor }; return pages, nil }
|
|
1969
|
+
|
|
1970
|
+
const ProfileAccountWithUserByProviderQueryPlanHash = "1aaa15d82bedbb0beb9084e2009715fcb167872fbc23d5429819746188fa7fd4"
|
|
1971
|
+
var ProfileAccountWithUserByProviderOperation = riffdb.Operation{Name: "riffdb_better_auth_core_profile_account_with_user_by_provider", InputSchemaHash: "7e48e77594d132efa4753eee93934c2ef61f6d82313edff8f7c84c7d8d4112f2"}
|
|
1972
|
+
func decodeProfileAccountWithUserByProviderResult(value riffdb.Value) (ProfileAccountWithUserByProviderResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1973
|
+
case "Found": result := ProfileAccountWithUserByProviderFound{Outcome: outcome}
|
|
1974
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1975
|
+
raw, err = requiredField(fields, "accounts"); if err != nil { return nil, err }; result.Accounts, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
1976
|
+
return result, nil
|
|
1977
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1978
|
+
func (client *Client) ProfileAccountWithUserByProvider(ctx context.Context, parameters ProfileAccountWithUserByProviderParams, optionsList ...QueryOptions) (QueryResult[ProfileAccountWithUserByProviderResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileAccountWithUserByProviderResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1979
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1980
|
+
input["account_id"] = riffdb.String(parameters.AccountId)
|
|
1981
|
+
input["provider_id"] = riffdb.String(parameters.ProviderId)
|
|
1982
|
+
response, err := client.session.Invoke(ctx, ProfileAccountWithUserByProviderOperation, input, options); if err != nil { return QueryResult[ProfileAccountWithUserByProviderResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[ProfileAccountWithUserByProviderResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeProfileAccountWithUserByProviderResult(response.Value); if err != nil { return QueryResult[ProfileAccountWithUserByProviderResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "ProfileAccountWithUserByProvider", PlanHash: ProfileAccountWithUserByProviderQueryPlanHash}; return QueryResult[ProfileAccountWithUserByProviderResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
1983
|
+
func (client *Client) ProfileAccountWithUserByProviderAfterCommit(ctx context.Context, parameters ProfileAccountWithUserByProviderParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[ProfileAccountWithUserByProviderResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileAccountWithUserByProviderResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.ProfileAccountWithUserByProvider(ctx, parameters, options) }
|
|
1984
|
+
|
|
1985
|
+
const ProfileSessionWithUserByIdQueryPlanHash = "75b27ee6cdd604c50ae9c8f2a7353cb746908c06f98eb2cda4e51c22d3927173"
|
|
1986
|
+
var ProfileSessionWithUserByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_profile_session_with_user_by_id", InputSchemaHash: "b36ab8632996b6bf3630a697bca331638b949de2e3f46abc2d612c0cb3d6afc9"}
|
|
1987
|
+
func decodeProfileSessionWithUserByIdResult(value riffdb.Value) (ProfileSessionWithUserByIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
1988
|
+
case "Found": result := ProfileSessionWithUserByIdFound{Outcome: outcome}
|
|
1989
|
+
raw, err = requiredField(fields, "session"); if err != nil { return nil, err }; result.Session, err = func() (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1990
|
+
raw, err = requiredField(fields, "user"); if err != nil { return nil, err }; result.User, err = func() (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
1991
|
+
return result, nil
|
|
1992
|
+
case "Missing": result := ProfileSessionWithUserByIdMissing{Outcome: outcome}
|
|
1993
|
+
return result, nil
|
|
1994
|
+
case "IntegrityFailure": result := ProfileSessionWithUserByIdIntegrityFailure{Outcome: outcome}
|
|
1995
|
+
return result, nil
|
|
1996
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1997
|
+
func (client *Client) ProfileSessionWithUserById(ctx context.Context, parameters ProfileSessionWithUserByIdParams, optionsList ...QueryOptions) (QueryResult[ProfileSessionWithUserByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileSessionWithUserByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
1998
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1999
|
+
input["value"] = riffdb.UUID(parameters.Value)
|
|
2000
|
+
response, err := client.session.Invoke(ctx, ProfileSessionWithUserByIdOperation, input, options); if err != nil { return QueryResult[ProfileSessionWithUserByIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[ProfileSessionWithUserByIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeProfileSessionWithUserByIdResult(response.Value); if err != nil { return QueryResult[ProfileSessionWithUserByIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "ProfileSessionWithUserById", PlanHash: ProfileSessionWithUserByIdQueryPlanHash}; return QueryResult[ProfileSessionWithUserByIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
2001
|
+
func (client *Client) ProfileSessionWithUserByIdAfterCommit(ctx context.Context, parameters ProfileSessionWithUserByIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[ProfileSessionWithUserByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileSessionWithUserByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.ProfileSessionWithUserById(ctx, parameters, options) }
|
|
2002
|
+
|
|
2003
|
+
const ProfileSessionWithUserByTokenQueryPlanHash = "8613d0bbe90e6671f419604026f5ba58d4f0c688d322d7f223e511f7f8eddefc"
|
|
2004
|
+
var ProfileSessionWithUserByTokenOperation = riffdb.Operation{Name: "riffdb_better_auth_core_profile_session_with_user_by_token", InputSchemaHash: "b36ab8632996b6bf3630a697bca331638b949de2e3f46abc2d612c0cb3d6afc9"}
|
|
2005
|
+
func decodeProfileSessionWithUserByTokenResult(value riffdb.Value) (ProfileSessionWithUserByTokenResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
2006
|
+
case "Found": result := ProfileSessionWithUserByTokenFound{Outcome: outcome}
|
|
2007
|
+
raw, err = requiredField(fields, "session"); if err != nil { return nil, err }; result.Session, err = func() (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
2008
|
+
raw, err = requiredField(fields, "user"); if err != nil { return nil, err }; result.User, err = func() (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
2009
|
+
return result, nil
|
|
2010
|
+
case "Missing": result := ProfileSessionWithUserByTokenMissing{Outcome: outcome}
|
|
2011
|
+
return result, nil
|
|
2012
|
+
case "IntegrityFailure": result := ProfileSessionWithUserByTokenIntegrityFailure{Outcome: outcome}
|
|
2013
|
+
return result, nil
|
|
2014
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
2015
|
+
func (client *Client) ProfileSessionWithUserByToken(ctx context.Context, parameters ProfileSessionWithUserByTokenParams, optionsList ...QueryOptions) (QueryResult[ProfileSessionWithUserByTokenResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileSessionWithUserByTokenResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
2016
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
2017
|
+
input["value"] = riffdb.String(parameters.Value)
|
|
2018
|
+
response, err := client.session.Invoke(ctx, ProfileSessionWithUserByTokenOperation, input, options); if err != nil { return QueryResult[ProfileSessionWithUserByTokenResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[ProfileSessionWithUserByTokenResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeProfileSessionWithUserByTokenResult(response.Value); if err != nil { return QueryResult[ProfileSessionWithUserByTokenResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "ProfileSessionWithUserByToken", PlanHash: ProfileSessionWithUserByTokenQueryPlanHash}; return QueryResult[ProfileSessionWithUserByTokenResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
2019
|
+
func (client *Client) ProfileSessionWithUserByTokenAfterCommit(ctx context.Context, parameters ProfileSessionWithUserByTokenParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[ProfileSessionWithUserByTokenResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileSessionWithUserByTokenResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.ProfileSessionWithUserByToken(ctx, parameters, options) }
|
|
2020
|
+
|
|
2021
|
+
const ProfileSessionsWithUsersByTokenSetQueryPlanHash = "8be2d5032391444cc188e0475b21178508458289f7778eee98db480449e7b9a0"
|
|
2022
|
+
var ProfileSessionsWithUsersByTokenSetOperation = riffdb.Operation{Name: "riffdb_better_auth_core_profile_sessions_with_users_by_token_set", InputSchemaHash: "6e07645237cd913d73a45bd7f863e3ca8d9ae09fdfecdb7494246fa80dea3899"}
|
|
2023
|
+
func decodeProfileSessionsWithUsersByTokenSetResult(value riffdb.Value) (ProfileSessionsWithUsersByTokenSetResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
2024
|
+
case "Found": result := ProfileSessionsWithUsersByTokenSetFound{Outcome: outcome}
|
|
2025
|
+
raw, err = requiredField(fields, "users"); if err != nil { return nil, err }; result.Users, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { return func() (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
2026
|
+
raw, err = requiredField(fields, "sessions"); if err != nil { return nil, err }; result.Sessions, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; Token string; ExpiresAt riffdb.Instant; IpAddress *string; UserAgent *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "token"); if err != nil { return result, err }; result.Token, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "expires_at"); if err != nil { return result, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "ip_address"); if err != nil { return result, err }; result.IpAddress, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "user_agent"); if err != nil { return result, err }; result.UserAgent, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
2027
|
+
return result, nil
|
|
2028
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
2029
|
+
func (client *Client) ProfileSessionsWithUsersByTokenSet(ctx context.Context, parameters ProfileSessionsWithUsersByTokenSetParams, optionsList ...QueryOptions) (QueryResult[ProfileSessionsWithUsersByTokenSetResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileSessionsWithUsersByTokenSetResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
2030
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
2031
|
+
input["tokens"] = riffdb.Values(parameters.Tokens, func(item string) riffdb.Value { return riffdb.String(item) })
|
|
2032
|
+
response, err := client.session.Invoke(ctx, ProfileSessionsWithUsersByTokenSetOperation, input, options); if err != nil { return QueryResult[ProfileSessionsWithUsersByTokenSetResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[ProfileSessionsWithUsersByTokenSetResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeProfileSessionsWithUsersByTokenSetResult(response.Value); if err != nil { return QueryResult[ProfileSessionsWithUsersByTokenSetResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "ProfileSessionsWithUsersByTokenSet", PlanHash: ProfileSessionsWithUsersByTokenSetQueryPlanHash}; return QueryResult[ProfileSessionsWithUsersByTokenSetResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
2033
|
+
func (client *Client) ProfileSessionsWithUsersByTokenSetAfterCommit(ctx context.Context, parameters ProfileSessionsWithUsersByTokenSetParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[ProfileSessionsWithUsersByTokenSetResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileSessionsWithUsersByTokenSetResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.ProfileSessionsWithUsersByTokenSet(ctx, parameters, options) }
|
|
2034
|
+
|
|
2035
|
+
const ProfileUserWithAccountsByEmailQueryPlanHash = "3cad29f13a66ea5688a7f403d330e090af32e118cb4c70683175987f1b7fea9f"
|
|
2036
|
+
var ProfileUserWithAccountsByEmailOperation = riffdb.Operation{Name: "riffdb_better_auth_core_profile_user_with_accounts_by_email", InputSchemaHash: "b36ab8632996b6bf3630a697bca331638b949de2e3f46abc2d612c0cb3d6afc9"}
|
|
2037
|
+
func decodeProfileUserWithAccountsByEmailResult(value riffdb.Value) (ProfileUserWithAccountsByEmailResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
2038
|
+
case "Found": result := ProfileUserWithAccountsByEmailFound{Outcome: outcome}
|
|
2039
|
+
raw, err = requiredField(fields, "user"); if err != nil { return nil, err }; result.User, err = func() (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
2040
|
+
raw, err = requiredField(fields, "accounts"); if err != nil { return nil, err }; result.Accounts, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
2041
|
+
return result, nil
|
|
2042
|
+
case "Missing": result := ProfileUserWithAccountsByEmailMissing{Outcome: outcome}
|
|
2043
|
+
return result, nil
|
|
2044
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
2045
|
+
func (client *Client) ProfileUserWithAccountsByEmail(ctx context.Context, parameters ProfileUserWithAccountsByEmailParams, optionsList ...QueryOptions) (QueryResult[ProfileUserWithAccountsByEmailResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileUserWithAccountsByEmailResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
2046
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
2047
|
+
input["value"] = riffdb.String(parameters.Value)
|
|
2048
|
+
response, err := client.session.Invoke(ctx, ProfileUserWithAccountsByEmailOperation, input, options); if err != nil { return QueryResult[ProfileUserWithAccountsByEmailResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[ProfileUserWithAccountsByEmailResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeProfileUserWithAccountsByEmailResult(response.Value); if err != nil { return QueryResult[ProfileUserWithAccountsByEmailResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "ProfileUserWithAccountsByEmail", PlanHash: ProfileUserWithAccountsByEmailQueryPlanHash}; return QueryResult[ProfileUserWithAccountsByEmailResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
2049
|
+
func (client *Client) ProfileUserWithAccountsByEmailAfterCommit(ctx context.Context, parameters ProfileUserWithAccountsByEmailParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[ProfileUserWithAccountsByEmailResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileUserWithAccountsByEmailResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.ProfileUserWithAccountsByEmail(ctx, parameters, options) }
|
|
2050
|
+
|
|
2051
|
+
const ProfileUserWithAccountsByIdQueryPlanHash = "3f956d2afae78effa75ba00d6ca557c8b1ebd98d971bf80daacefdfb4aa638d1"
|
|
2052
|
+
var ProfileUserWithAccountsByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_profile_user_with_accounts_by_id", InputSchemaHash: "b36ab8632996b6bf3630a697bca331638b949de2e3f46abc2d612c0cb3d6afc9"}
|
|
2053
|
+
func decodeProfileUserWithAccountsByIdResult(value riffdb.Value) (ProfileUserWithAccountsByIdResult, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
2054
|
+
case "Found": result := ProfileUserWithAccountsByIdFound{Outcome: outcome}
|
|
2055
|
+
raw, err = requiredField(fields, "user"); if err != nil { return nil, err }; result.User, err = func() (struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }, error) { fields, err := riffdb.RecordFields(raw); if err != nil { return struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }{}, err }; var result struct { UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64; DateField *riffdb.Instant; Locale *string }; var raw riffdb.Value; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "name"); if err != nil { return result, err }; result.Name, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email"); if err != nil { return result, err }; result.Email, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "email_verified"); if err != nil { return result, err }; result.EmailVerified, err = riffdb.BoolValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "image"); if err != nil { return result, err }; result.Image, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "date_field"); if err != nil { return result, err }; result.DateField, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "locale"); if err != nil { return result, err }; result.Locale, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; return result, nil }(); if err != nil { return nil, err }
|
|
2056
|
+
raw, err = requiredField(fields, "accounts"); if err != nil { return nil, err }; result.Accounts, err = riffdb.DecodeValues(raw, func(item riffdb.Value) (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { return func() (struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, error) { fields, err := riffdb.RecordFields(item); if err != nil { return struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }{}, err }; var result struct { Id string; UserId string; AccountId string; ProviderId string; AccessToken *string; RefreshToken *string; AccessTokenExpiresAt *riffdb.Instant; RefreshTokenExpiresAt *riffdb.Instant; Scope *string; IdToken *string; Password *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }; var raw riffdb.Value; raw, err = requiredField(fields, "id"); if err != nil { return result, err }; result.Id, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "user_id"); if err != nil { return result, err }; result.UserId, err = riffdb.UUIDValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "account_id"); if err != nil { return result, err }; result.AccountId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "provider_id"); if err != nil { return result, err }; result.ProviderId, err = riffdb.StringValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token"); if err != nil { return result, err }; result.AccessToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token"); if err != nil { return result, err }; result.RefreshToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "access_token_expires_at"); if err != nil { return result, err }; result.AccessTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "refresh_token_expires_at"); if err != nil { return result, err }; result.RefreshTokenExpiresAt, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (riffdb.Instant, error) { return riffdb.TimestampValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "scope"); if err != nil { return result, err }; result.Scope, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "id_token"); if err != nil { return result, err }; result.IdToken, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "password"); if err != nil { return result, err }; result.Password, err = riffdb.DecodeOptional(raw, func(item riffdb.Value) (string, error) { return riffdb.StringValue(item) }); if err != nil { return result, err }; raw, err = requiredField(fields, "created_at"); if err != nil { return result, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "updated_at"); if err != nil { return result, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return result, err }; raw, err = requiredField(fields, "revision"); if err != nil { return result, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return result, err }; return result, nil }() }); if err != nil { return nil, err }
|
|
2057
|
+
return result, nil
|
|
2058
|
+
case "Missing": result := ProfileUserWithAccountsByIdMissing{Outcome: outcome}
|
|
2059
|
+
return result, nil
|
|
2060
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
2061
|
+
func (client *Client) ProfileUserWithAccountsById(ctx context.Context, parameters ProfileUserWithAccountsByIdParams, optionsList ...QueryOptions) (QueryResult[ProfileUserWithAccountsByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileUserWithAccountsByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; if options.ReadAfterCommit == nil { options.ReadAfterCommit = client.LastCommitSequence() }; input := map[string]riffdb.Value{}
|
|
2062
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
2063
|
+
input["value"] = riffdb.UUID(parameters.Value)
|
|
2064
|
+
response, err := client.session.Invoke(ctx, ProfileUserWithAccountsByIdOperation, input, options); if err != nil { return QueryResult[ProfileUserWithAccountsByIdResult]{}, err }; if response.ApplicationHead == nil { return QueryResult[ProfileUserWithAccountsByIdResult]{}, errors.New("RiffDB driver omitted query frontier") }; value, err := decodeProfileUserWithAccountsByIdResult(response.Value); if err != nil { return QueryResult[ProfileUserWithAccountsByIdResult]{}, err }; identity := QueryIdentity{ContractLineage: ContractLineage, ContractVersion: ContractVersion, ContractBundleHash: ContractBundleHash, ModuleHash: QueryModuleHash, QueryName: "ProfileUserWithAccountsById", PlanHash: ProfileUserWithAccountsByIdQueryPlanHash}; return QueryResult[ProfileUserWithAccountsByIdResult]{Value: value, Identity: identity, ApplicationHead: *response.ApplicationHead, NextCursor: response.Cursor}, nil }
|
|
2065
|
+
func (client *Client) ProfileUserWithAccountsByIdAfterCommit(ctx context.Context, parameters ProfileUserWithAccountsByIdParams, commitSequence uint64, optionsList ...QueryOptions) (QueryResult[ProfileUserWithAccountsByIdResult], error) { var options QueryOptions; if len(optionsList) > 1 { return QueryResult[ProfileUserWithAccountsByIdResult]{}, errors.New("invalid generated RiffDB query options") } else if len(optionsList) == 1 { options = optionsList[0] }; options.ReadAfterCommit = &commitSequence; return client.ProfileUserWithAccountsById(ctx, parameters, options) }
|
|
2066
|
+
|
|
2067
|
+
const ConsumeVerificationPlanHash = "19fa6c84843516bc8bf61b12b77c3a2a11ef187e35ee3e41b2beac55757e20eb"
|
|
2068
|
+
var ConsumeVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_consume_verification", InputSchemaHash: "4e28ec5a411c2397de0d11fd9358879744a2b3f75c5855002b3cba62fb1d26c3"}
|
|
2069
|
+
func encodeConsumeVerificationInput(input ConsumeVerificationInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2070
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2071
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2072
|
+
"verification_id": riffdb.UUID(input.VerificationId),
|
|
2073
|
+
} }
|
|
2074
|
+
func decodeConsumeVerificationOutcome(value riffdb.Value) (ConsumeVerificationOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; var raw riffdb.Value; switch outcome {
|
|
2075
|
+
case "VerificationConsumed": result := ConsumeVerificationVerificationConsumed{Outcome: outcome}
|
|
2076
|
+
raw, err = requiredField(fields, "value"); if err != nil { return nil, err }; result.Value, err = riffdb.StringValue(raw); if err != nil { return nil, err }
|
|
2077
|
+
raw, err = requiredField(fields, "revision"); if err != nil { return nil, err }; result.Revision, err = riffdb.U64Value(raw); if err != nil { return nil, err }
|
|
2078
|
+
raw, err = requiredField(fields, "created_at"); if err != nil { return nil, err }; result.CreatedAt, err = riffdb.TimestampValue(raw); if err != nil { return nil, err }
|
|
2079
|
+
raw, err = requiredField(fields, "expires_at"); if err != nil { return nil, err }; result.ExpiresAt, err = riffdb.TimestampValue(raw); if err != nil { return nil, err }
|
|
2080
|
+
raw, err = requiredField(fields, "identifier"); if err != nil { return nil, err }; result.Identifier, err = riffdb.StringValue(raw); if err != nil { return nil, err }
|
|
2081
|
+
raw, err = requiredField(fields, "updated_at"); if err != nil { return nil, err }; result.UpdatedAt, err = riffdb.TimestampValue(raw); if err != nil { return nil, err }
|
|
2082
|
+
raw, err = requiredField(fields, "verification_id"); if err != nil { return nil, err }; result.VerificationId, err = riffdb.UUIDValue(raw); if err != nil { return nil, err }
|
|
2083
|
+
return result, nil
|
|
2084
|
+
case "VerificationConsumeMissing": result := ConsumeVerificationVerificationConsumeMissing{Outcome: outcome}
|
|
2085
|
+
return result, nil
|
|
2086
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2087
|
+
func (client *Client) ConsumeVerification(ctx context.Context, input ConsumeVerificationInput) (CommandResult[ConsumeVerificationOutcome], error) { response, err := client.session.Invoke(ctx, ConsumeVerificationOperation, encodeConsumeVerificationInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[ConsumeVerificationOutcome]{}, err }; outcome, err := decodeConsumeVerificationOutcome(response.Value); if err != nil { return CommandResult[ConsumeVerificationOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[ConsumeVerificationOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: ConsumeVerificationPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2088
|
+
func (client *Client) ConsumeVerificationBatch(ctx context.Context, inputs []ConsumeVerificationInput, concurrency, checkpoint uint32) (BatchResult[ConsumeVerificationOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeConsumeVerificationInput(input) }; response, err := client.session.Batch(ctx, ConsumeVerificationOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[ConsumeVerificationOutcome]{}, err }; result := BatchResult[ConsumeVerificationOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[ConsumeVerificationOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[ConsumeVerificationOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeConsumeVerificationOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[ConsumeVerificationOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[ConsumeVerificationOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: ConsumeVerificationPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2089
|
+
|
|
2090
|
+
|
|
2091
|
+
const ConsumeVerificationSetPlanHash = "1545427bfaa7b1581797b5e83df8bae717e9f57ff91b8bec3749aeab3b2d2f75"
|
|
2092
|
+
var ConsumeVerificationSetOperation = riffdb.Operation{Name: "riffdb_better_auth_core_consume_verification_set", InputSchemaHash: "ce88d8052f760625503f8a732f9813446ef7cc042d726ee1826c05c437c0929c"}
|
|
2093
|
+
func encodeConsumeVerificationSetInput(input ConsumeVerificationSetInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2094
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2095
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2096
|
+
"verification_ids": riffdb.Values(input.VerificationIds, func(item string) riffdb.Value { return riffdb.UUID(item) }),
|
|
2097
|
+
} }
|
|
2098
|
+
func validateConsumeVerificationSetInput(input ConsumeVerificationSetInput) error { if len(input.VerificationIds) < 1 || len(input.VerificationIds) > 32 { return errors.New("invalid bounded collection length for ConsumeVerificationSet.verification_ids") }; return nil }
|
|
2099
|
+
func decodeConsumeVerificationSetOutcome(value riffdb.Value) (ConsumeVerificationSetOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2100
|
+
case "VerificationSetConsumed": result := ConsumeVerificationSetVerificationSetConsumed{Outcome: outcome}
|
|
2101
|
+
return result, nil
|
|
2102
|
+
case "VerificationConsumeMissing": result := ConsumeVerificationSetVerificationConsumeMissing{Outcome: outcome}
|
|
2103
|
+
return result, nil
|
|
2104
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2105
|
+
func (client *Client) ConsumeVerificationSet(ctx context.Context, input ConsumeVerificationSetInput) (CommandResult[ConsumeVerificationSetOutcome], error) { if err := validateConsumeVerificationSetInput(input); err != nil { return CommandResult[ConsumeVerificationSetOutcome]{}, err }; response, err := client.session.Invoke(ctx, ConsumeVerificationSetOperation, encodeConsumeVerificationSetInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[ConsumeVerificationSetOutcome]{}, err }; outcome, err := decodeConsumeVerificationSetOutcome(response.Value); if err != nil { return CommandResult[ConsumeVerificationSetOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[ConsumeVerificationSetOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: ConsumeVerificationSetPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2106
|
+
func (client *Client) ConsumeVerificationSetBatch(ctx context.Context, inputs []ConsumeVerificationSetInput, concurrency, checkpoint uint32) (BatchResult[ConsumeVerificationSetOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { if err := validateConsumeVerificationSetInput(input); err != nil { return BatchResult[ConsumeVerificationSetOutcome]{}, err }; encoded[index] = encodeConsumeVerificationSetInput(input) }; response, err := client.session.Batch(ctx, ConsumeVerificationSetOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[ConsumeVerificationSetOutcome]{}, err }; result := BatchResult[ConsumeVerificationSetOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[ConsumeVerificationSetOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[ConsumeVerificationSetOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeConsumeVerificationSetOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[ConsumeVerificationSetOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[ConsumeVerificationSetOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: ConsumeVerificationSetPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2107
|
+
|
|
2108
|
+
|
|
2109
|
+
const ConsumeVerificationSnapshotPlanHash = "4b5df61ae9e1dd93c8ca26035e178389ad241d166891d4eb29a9f89ac3829352"
|
|
2110
|
+
var ConsumeVerificationSnapshotOperation = riffdb.Operation{Name: "riffdb_better_auth_core_consume_verification_snapshot", InputSchemaHash: "d1ae264c5794d32e6619f9d52b77dd3a4cab39615dd48adb9a2a3b46ff92cd8c"}
|
|
2111
|
+
func encodeConsumeVerificationSnapshotInput(input ConsumeVerificationSnapshotInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2112
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2113
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2114
|
+
"verification_id": riffdb.UUID(input.VerificationId),
|
|
2115
|
+
"expected_revision": riffdb.U64(input.ExpectedRevision),
|
|
2116
|
+
} }
|
|
2117
|
+
func decodeConsumeVerificationSnapshotOutcome(value riffdb.Value) (ConsumeVerificationSnapshotOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2118
|
+
case "VerificationConsumed": result := ConsumeVerificationSnapshotVerificationConsumed{Outcome: outcome}
|
|
2119
|
+
return result, nil
|
|
2120
|
+
case "VerificationConsumeStale": result := ConsumeVerificationSnapshotVerificationConsumeStale{Outcome: outcome}
|
|
2121
|
+
return result, nil
|
|
2122
|
+
case "VerificationConsumeMissing": result := ConsumeVerificationSnapshotVerificationConsumeMissing{Outcome: outcome}
|
|
2123
|
+
return result, nil
|
|
2124
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2125
|
+
func (client *Client) ConsumeVerificationSnapshot(ctx context.Context, input ConsumeVerificationSnapshotInput) (CommandResult[ConsumeVerificationSnapshotOutcome], error) { response, err := client.session.Invoke(ctx, ConsumeVerificationSnapshotOperation, encodeConsumeVerificationSnapshotInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[ConsumeVerificationSnapshotOutcome]{}, err }; outcome, err := decodeConsumeVerificationSnapshotOutcome(response.Value); if err != nil { return CommandResult[ConsumeVerificationSnapshotOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[ConsumeVerificationSnapshotOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: ConsumeVerificationSnapshotPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2126
|
+
func (client *Client) ConsumeVerificationSnapshotBatch(ctx context.Context, inputs []ConsumeVerificationSnapshotInput, concurrency, checkpoint uint32) (BatchResult[ConsumeVerificationSnapshotOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeConsumeVerificationSnapshotInput(input) }; response, err := client.session.Batch(ctx, ConsumeVerificationSnapshotOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[ConsumeVerificationSnapshotOutcome]{}, err }; result := BatchResult[ConsumeVerificationSnapshotOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[ConsumeVerificationSnapshotOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[ConsumeVerificationSnapshotOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeConsumeVerificationSnapshotOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[ConsumeVerificationSnapshotOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[ConsumeVerificationSnapshotOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: ConsumeVerificationSnapshotPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2127
|
+
|
|
2128
|
+
|
|
2129
|
+
const CreateAccountPlanHash = "7f36d8eda7a7e2d62c847ac079ced1329986dab9873d3e0a74711ce08ce55514"
|
|
2130
|
+
var CreateAccountOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_account", InputSchemaHash: "9f59abcc35f23822a34f3504905acaae3df3c62c0f60e6bcb65bd8768279c4f9"}
|
|
2131
|
+
func encodeCreateAccountInput(input CreateAccountInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2132
|
+
"id": riffdb.UUID(input.Id),
|
|
2133
|
+
"scope": riffdb.Optional(input.Scope, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2134
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2135
|
+
"id_token": riffdb.Optional(input.IdToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2136
|
+
"password": riffdb.Optional(input.Password, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2137
|
+
"account_id": riffdb.String(input.AccountId),
|
|
2138
|
+
"created_at": riffdb.TimestampFrom(input.CreatedAt),
|
|
2139
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2140
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2141
|
+
"provider_id": riffdb.String(input.ProviderId),
|
|
2142
|
+
"access_token": riffdb.Optional(input.AccessToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2143
|
+
"refresh_token": riffdb.Optional(input.RefreshToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2144
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2145
|
+
"access_token_expires_at": riffdb.Optional(input.AccessTokenExpiresAt, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2146
|
+
"refresh_token_expires_at": riffdb.Optional(input.RefreshTokenExpiresAt, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2147
|
+
} }
|
|
2148
|
+
func decodeCreateAccountOutcome(value riffdb.Value) (CreateAccountOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2149
|
+
case "AccountCreated": result := CreateAccountAccountCreated{Outcome: outcome}
|
|
2150
|
+
return result, nil
|
|
2151
|
+
case "AccountUserMissing": result := CreateAccountAccountUserMissing{Outcome: outcome}
|
|
2152
|
+
return result, nil
|
|
2153
|
+
case "AccountAlreadyExists": result := CreateAccountAccountAlreadyExists{Outcome: outcome}
|
|
2154
|
+
return result, nil
|
|
2155
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2156
|
+
func (client *Client) CreateAccount(ctx context.Context, input CreateAccountInput) (CommandResult[CreateAccountOutcome], error) { response, err := client.session.Invoke(ctx, CreateAccountOperation, encodeCreateAccountInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[CreateAccountOutcome]{}, err }; outcome, err := decodeCreateAccountOutcome(response.Value); if err != nil { return CommandResult[CreateAccountOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[CreateAccountOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: CreateAccountPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2157
|
+
func (client *Client) CreateAccountBatch(ctx context.Context, inputs []CreateAccountInput, concurrency, checkpoint uint32) (BatchResult[CreateAccountOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeCreateAccountInput(input) }; response, err := client.session.Batch(ctx, CreateAccountOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[CreateAccountOutcome]{}, err }; result := BatchResult[CreateAccountOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[CreateAccountOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[CreateAccountOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeCreateAccountOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[CreateAccountOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[CreateAccountOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: CreateAccountPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2158
|
+
|
|
2159
|
+
|
|
2160
|
+
const CreateOAuthUserGraphPlanHash = "b38cef15a18f63d11e491b17d3941048b8771e2fdca825c21821a187603077a4"
|
|
2161
|
+
var CreateOAuthUserGraphOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_o_auth_user_graph", InputSchemaHash: "1c3f9fac47e356c42ecf43565ab385d264c645e3b52e2ac68a9bc8ec8655cab7"}
|
|
2162
|
+
func encodeCreateOAuthUserGraphInput(input CreateOAuthUserGraphInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2163
|
+
"scope": riffdb.Optional(input.Scope, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2164
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2165
|
+
"id_token": riffdb.Optional(input.IdToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2166
|
+
"password": riffdb.Optional(input.Password, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2167
|
+
"user_name": riffdb.String(input.UserName),
|
|
2168
|
+
"account_id": riffdb.UUID(input.AccountId),
|
|
2169
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2170
|
+
"user_email": riffdb.String(input.UserEmail),
|
|
2171
|
+
"user_image": riffdb.Optional(input.UserImage, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2172
|
+
"provider_id": riffdb.String(input.ProviderId),
|
|
2173
|
+
"user_locale": riffdb.Optional(input.UserLocale, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2174
|
+
"access_token": riffdb.Optional(input.AccessToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2175
|
+
"refresh_token": riffdb.Optional(input.RefreshToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2176
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2177
|
+
"user_created_at": riffdb.TimestampFrom(input.UserCreatedAt),
|
|
2178
|
+
"user_date_field": riffdb.Optional(input.UserDateField, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2179
|
+
"user_updated_at": riffdb.TimestampFrom(input.UserUpdatedAt),
|
|
2180
|
+
"account_created_at": riffdb.TimestampFrom(input.AccountCreatedAt),
|
|
2181
|
+
"account_updated_at": riffdb.TimestampFrom(input.AccountUpdatedAt),
|
|
2182
|
+
"external_account_id": riffdb.String(input.ExternalAccountId),
|
|
2183
|
+
"user_email_verified": riffdb.Bool(input.UserEmailVerified),
|
|
2184
|
+
"access_token_expires_at": riffdb.Optional(input.AccessTokenExpiresAt, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2185
|
+
"refresh_token_expires_at": riffdb.Optional(input.RefreshTokenExpiresAt, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2186
|
+
} }
|
|
2187
|
+
func decodeCreateOAuthUserGraphOutcome(value riffdb.Value) (CreateOAuthUserGraphOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2188
|
+
case "OAuthUserExists": result := CreateOAuthUserGraphOAuthUserExists{Outcome: outcome}
|
|
2189
|
+
return result, nil
|
|
2190
|
+
case "OAuthAccountExists": result := CreateOAuthUserGraphOAuthAccountExists{Outcome: outcome}
|
|
2191
|
+
return result, nil
|
|
2192
|
+
case "OAuthUserGraphCreated": result := CreateOAuthUserGraphOAuthUserGraphCreated{Outcome: outcome}
|
|
2193
|
+
return result, nil
|
|
2194
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2195
|
+
func (client *Client) CreateOAuthUserGraph(ctx context.Context, input CreateOAuthUserGraphInput) (CommandResult[CreateOAuthUserGraphOutcome], error) { response, err := client.session.Invoke(ctx, CreateOAuthUserGraphOperation, encodeCreateOAuthUserGraphInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[CreateOAuthUserGraphOutcome]{}, err }; outcome, err := decodeCreateOAuthUserGraphOutcome(response.Value); if err != nil { return CommandResult[CreateOAuthUserGraphOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[CreateOAuthUserGraphOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: CreateOAuthUserGraphPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2196
|
+
func (client *Client) CreateOAuthUserGraphBatch(ctx context.Context, inputs []CreateOAuthUserGraphInput, concurrency, checkpoint uint32) (BatchResult[CreateOAuthUserGraphOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeCreateOAuthUserGraphInput(input) }; response, err := client.session.Batch(ctx, CreateOAuthUserGraphOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[CreateOAuthUserGraphOutcome]{}, err }; result := BatchResult[CreateOAuthUserGraphOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[CreateOAuthUserGraphOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[CreateOAuthUserGraphOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeCreateOAuthUserGraphOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[CreateOAuthUserGraphOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[CreateOAuthUserGraphOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: CreateOAuthUserGraphPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2197
|
+
|
|
2198
|
+
|
|
2199
|
+
const CreateSessionPlanHash = "6b1781167ff976b69b11ae5ccae5b1ad1233eda1679e5e42907f0dee0922c08a"
|
|
2200
|
+
var CreateSessionOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_session", InputSchemaHash: "90f15b4cdb6f49df5e37b625173a07170d7975bbb4e8a8d1419071cd4f8a9312"}
|
|
2201
|
+
func encodeCreateSessionInput(input CreateSessionInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2202
|
+
"id": riffdb.UUID(input.Id),
|
|
2203
|
+
"token": riffdb.String(input.Token),
|
|
2204
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2205
|
+
"created_at": riffdb.TimestampFrom(input.CreatedAt),
|
|
2206
|
+
"expires_at": riffdb.TimestampFrom(input.ExpiresAt),
|
|
2207
|
+
"ip_address": riffdb.Optional(input.IpAddress, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2208
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2209
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2210
|
+
"user_agent": riffdb.Optional(input.UserAgent, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2211
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2212
|
+
} }
|
|
2213
|
+
func decodeCreateSessionOutcome(value riffdb.Value) (CreateSessionOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2214
|
+
case "SessionCreated": result := CreateSessionSessionCreated{Outcome: outcome}
|
|
2215
|
+
return result, nil
|
|
2216
|
+
case "SessionUserMissing": result := CreateSessionSessionUserMissing{Outcome: outcome}
|
|
2217
|
+
return result, nil
|
|
2218
|
+
case "SessionAlreadyExists": result := CreateSessionSessionAlreadyExists{Outcome: outcome}
|
|
2219
|
+
return result, nil
|
|
2220
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2221
|
+
func (client *Client) CreateSession(ctx context.Context, input CreateSessionInput) (CommandResult[CreateSessionOutcome], error) { response, err := client.session.Invoke(ctx, CreateSessionOperation, encodeCreateSessionInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[CreateSessionOutcome]{}, err }; outcome, err := decodeCreateSessionOutcome(response.Value); if err != nil { return CommandResult[CreateSessionOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[CreateSessionOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: CreateSessionPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2222
|
+
func (client *Client) CreateSessionBatch(ctx context.Context, inputs []CreateSessionInput, concurrency, checkpoint uint32) (BatchResult[CreateSessionOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeCreateSessionInput(input) }; response, err := client.session.Batch(ctx, CreateSessionOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[CreateSessionOutcome]{}, err }; result := BatchResult[CreateSessionOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[CreateSessionOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[CreateSessionOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeCreateSessionOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[CreateSessionOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[CreateSessionOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: CreateSessionPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2223
|
+
|
|
2224
|
+
|
|
2225
|
+
const CreateSignupGraphPlanHash = "f3f2e0ffcc6f05e50f3caafc21b124cd08b79bbe6ce4498f3d8b3a8ba2aa7d67"
|
|
2226
|
+
var CreateSignupGraphOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_signup_graph", InputSchemaHash: "58a728840521574ea1ef22b5fa681b6578af003a7473a2bbeb53bc467eac61e0"}
|
|
2227
|
+
func encodeCreateSignupGraphInput(input CreateSignupGraphInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2228
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2229
|
+
"user_name": riffdb.String(input.UserName),
|
|
2230
|
+
"account_id": riffdb.UUID(input.AccountId),
|
|
2231
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2232
|
+
"session_id": riffdb.UUID(input.SessionId),
|
|
2233
|
+
"user_email": riffdb.String(input.UserEmail),
|
|
2234
|
+
"user_image": riffdb.Optional(input.UserImage, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2235
|
+
"provider_id": riffdb.String(input.ProviderId),
|
|
2236
|
+
"user_locale": riffdb.Optional(input.UserLocale, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2237
|
+
"session_token": riffdb.String(input.SessionToken),
|
|
2238
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2239
|
+
"user_created_at": riffdb.TimestampFrom(input.UserCreatedAt),
|
|
2240
|
+
"user_date_field": riffdb.Optional(input.UserDateField, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2241
|
+
"user_updated_at": riffdb.TimestampFrom(input.UserUpdatedAt),
|
|
2242
|
+
"account_password": riffdb.Optional(input.AccountPassword, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2243
|
+
"account_created_at": riffdb.TimestampFrom(input.AccountCreatedAt),
|
|
2244
|
+
"account_updated_at": riffdb.TimestampFrom(input.AccountUpdatedAt),
|
|
2245
|
+
"session_created_at": riffdb.TimestampFrom(input.SessionCreatedAt),
|
|
2246
|
+
"session_expires_at": riffdb.TimestampFrom(input.SessionExpiresAt),
|
|
2247
|
+
"session_ip_address": riffdb.Optional(input.SessionIpAddress, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2248
|
+
"session_updated_at": riffdb.TimestampFrom(input.SessionUpdatedAt),
|
|
2249
|
+
"session_user_agent": riffdb.Optional(input.SessionUserAgent, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2250
|
+
"external_account_id": riffdb.String(input.ExternalAccountId),
|
|
2251
|
+
"user_email_verified": riffdb.Bool(input.UserEmailVerified),
|
|
2252
|
+
} }
|
|
2253
|
+
func decodeCreateSignupGraphOutcome(value riffdb.Value) (CreateSignupGraphOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2254
|
+
case "SignupUserExists": result := CreateSignupGraphSignupUserExists{Outcome: outcome}
|
|
2255
|
+
return result, nil
|
|
2256
|
+
case "SignupGraphCreated": result := CreateSignupGraphSignupGraphCreated{Outcome: outcome}
|
|
2257
|
+
return result, nil
|
|
2258
|
+
case "SignupAccountExists": result := CreateSignupGraphSignupAccountExists{Outcome: outcome}
|
|
2259
|
+
return result, nil
|
|
2260
|
+
case "SignupSessionExists": result := CreateSignupGraphSignupSessionExists{Outcome: outcome}
|
|
2261
|
+
return result, nil
|
|
2262
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2263
|
+
func (client *Client) CreateSignupGraph(ctx context.Context, input CreateSignupGraphInput) (CommandResult[CreateSignupGraphOutcome], error) { response, err := client.session.Invoke(ctx, CreateSignupGraphOperation, encodeCreateSignupGraphInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[CreateSignupGraphOutcome]{}, err }; outcome, err := decodeCreateSignupGraphOutcome(response.Value); if err != nil { return CommandResult[CreateSignupGraphOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[CreateSignupGraphOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: CreateSignupGraphPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2264
|
+
func (client *Client) CreateSignupGraphBatch(ctx context.Context, inputs []CreateSignupGraphInput, concurrency, checkpoint uint32) (BatchResult[CreateSignupGraphOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeCreateSignupGraphInput(input) }; response, err := client.session.Batch(ctx, CreateSignupGraphOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[CreateSignupGraphOutcome]{}, err }; result := BatchResult[CreateSignupGraphOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[CreateSignupGraphOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[CreateSignupGraphOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeCreateSignupGraphOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[CreateSignupGraphOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[CreateSignupGraphOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: CreateSignupGraphPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2265
|
+
|
|
2266
|
+
|
|
2267
|
+
const CreateUserPlanHash = "a03a8751aa63f4338978c1446bdf1cd9f9ebeb07d80858b2e01286a1d09503b5"
|
|
2268
|
+
var CreateUserOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_user", InputSchemaHash: "5eef6139856ea46c239c3e66aa346ee9c8547b07c24f7bd0c1710f88c5cbb0e4"}
|
|
2269
|
+
func encodeCreateUserInput(input CreateUserInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2270
|
+
"id": riffdb.UUID(input.Id),
|
|
2271
|
+
"name": riffdb.String(input.Name),
|
|
2272
|
+
"email": riffdb.String(input.Email),
|
|
2273
|
+
"image": riffdb.Optional(input.Image, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2274
|
+
"locale": riffdb.Optional(input.Locale, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2275
|
+
"created_at": riffdb.TimestampFrom(input.CreatedAt),
|
|
2276
|
+
"date_field": riffdb.Optional(input.DateField, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2277
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2278
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2279
|
+
"email_verified": riffdb.Bool(input.EmailVerified),
|
|
2280
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2281
|
+
} }
|
|
2282
|
+
func decodeCreateUserOutcome(value riffdb.Value) (CreateUserOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2283
|
+
case "UserCreated": result := CreateUserUserCreated{Outcome: outcome}
|
|
2284
|
+
return result, nil
|
|
2285
|
+
case "UserAlreadyExists": result := CreateUserUserAlreadyExists{Outcome: outcome}
|
|
2286
|
+
return result, nil
|
|
2287
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2288
|
+
func (client *Client) CreateUser(ctx context.Context, input CreateUserInput) (CommandResult[CreateUserOutcome], error) { response, err := client.session.Invoke(ctx, CreateUserOperation, encodeCreateUserInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[CreateUserOutcome]{}, err }; outcome, err := decodeCreateUserOutcome(response.Value); if err != nil { return CommandResult[CreateUserOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[CreateUserOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: CreateUserPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2289
|
+
func (client *Client) CreateUserBatch(ctx context.Context, inputs []CreateUserInput, concurrency, checkpoint uint32) (BatchResult[CreateUserOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeCreateUserInput(input) }; response, err := client.session.Batch(ctx, CreateUserOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[CreateUserOutcome]{}, err }; result := BatchResult[CreateUserOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[CreateUserOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[CreateUserOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeCreateUserOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[CreateUserOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[CreateUserOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: CreateUserPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2290
|
+
|
|
2291
|
+
|
|
2292
|
+
const CreateVerificationPlanHash = "fb8bc9c8dbacfb0319bb4e822b9cc3e0f0c83beb61d2840c7529b9362bac2ed3"
|
|
2293
|
+
var CreateVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_verification", InputSchemaHash: "1df4414485ef2e463cee868bb97850b7a189a8c72c6090a650a1a1e0bd96baef"}
|
|
2294
|
+
func encodeCreateVerificationInput(input CreateVerificationInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2295
|
+
"id": riffdb.UUID(input.Id),
|
|
2296
|
+
"value": riffdb.String(input.Value),
|
|
2297
|
+
"created_at": riffdb.TimestampFrom(input.CreatedAt),
|
|
2298
|
+
"expires_at": riffdb.TimestampFrom(input.ExpiresAt),
|
|
2299
|
+
"identifier": riffdb.String(input.Identifier),
|
|
2300
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2301
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2302
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2303
|
+
} }
|
|
2304
|
+
func decodeCreateVerificationOutcome(value riffdb.Value) (CreateVerificationOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2305
|
+
case "VerificationCreated": result := CreateVerificationVerificationCreated{Outcome: outcome}
|
|
2306
|
+
return result, nil
|
|
2307
|
+
case "VerificationAlreadyExists": result := CreateVerificationVerificationAlreadyExists{Outcome: outcome}
|
|
2308
|
+
return result, nil
|
|
2309
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2310
|
+
func (client *Client) CreateVerification(ctx context.Context, input CreateVerificationInput) (CommandResult[CreateVerificationOutcome], error) { response, err := client.session.Invoke(ctx, CreateVerificationOperation, encodeCreateVerificationInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[CreateVerificationOutcome]{}, err }; outcome, err := decodeCreateVerificationOutcome(response.Value); if err != nil { return CommandResult[CreateVerificationOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[CreateVerificationOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: CreateVerificationPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2311
|
+
func (client *Client) CreateVerificationBatch(ctx context.Context, inputs []CreateVerificationInput, concurrency, checkpoint uint32) (BatchResult[CreateVerificationOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeCreateVerificationInput(input) }; response, err := client.session.Batch(ctx, CreateVerificationOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[CreateVerificationOutcome]{}, err }; result := BatchResult[CreateVerificationOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[CreateVerificationOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[CreateVerificationOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeCreateVerificationOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[CreateVerificationOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[CreateVerificationOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: CreateVerificationPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2312
|
+
|
|
2313
|
+
|
|
2314
|
+
const DeleteAccountPlanHash = "1cb75e3e7a09d68b1fb2b9299fd6cb87703c9da1e0955756aef682d933b275d0"
|
|
2315
|
+
var DeleteAccountOperation = riffdb.Operation{Name: "riffdb_better_auth_core_delete_account", InputSchemaHash: "8e512e4d77b1ced01a098641ce940e1440a4b63d4c3e2ddad9068a1faf9c2c11"}
|
|
2316
|
+
func encodeDeleteAccountInput(input DeleteAccountInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2317
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2318
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2319
|
+
"account_ids": riffdb.Values(input.AccountIds, func(item string) riffdb.Value { return riffdb.UUID(item) }),
|
|
2320
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2321
|
+
} }
|
|
2322
|
+
func validateDeleteAccountInput(input DeleteAccountInput) error { if len(input.AccountIds) < 1 || len(input.AccountIds) > 32 { return errors.New("invalid bounded collection length for DeleteAccount.account_ids") }; return nil }
|
|
2323
|
+
func decodeDeleteAccountOutcome(value riffdb.Value) (DeleteAccountOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2324
|
+
case "AccountDeleted": result := DeleteAccountAccountDeleted{Outcome: outcome}
|
|
2325
|
+
return result, nil
|
|
2326
|
+
case "AccountMissing": result := DeleteAccountAccountMissing{Outcome: outcome}
|
|
2327
|
+
return result, nil
|
|
2328
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2329
|
+
func (client *Client) DeleteAccount(ctx context.Context, input DeleteAccountInput) (CommandResult[DeleteAccountOutcome], error) { if err := validateDeleteAccountInput(input); err != nil { return CommandResult[DeleteAccountOutcome]{}, err }; response, err := client.session.Invoke(ctx, DeleteAccountOperation, encodeDeleteAccountInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[DeleteAccountOutcome]{}, err }; outcome, err := decodeDeleteAccountOutcome(response.Value); if err != nil { return CommandResult[DeleteAccountOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[DeleteAccountOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: DeleteAccountPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2330
|
+
func (client *Client) DeleteAccountBatch(ctx context.Context, inputs []DeleteAccountInput, concurrency, checkpoint uint32) (BatchResult[DeleteAccountOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { if err := validateDeleteAccountInput(input); err != nil { return BatchResult[DeleteAccountOutcome]{}, err }; encoded[index] = encodeDeleteAccountInput(input) }; response, err := client.session.Batch(ctx, DeleteAccountOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[DeleteAccountOutcome]{}, err }; result := BatchResult[DeleteAccountOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[DeleteAccountOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[DeleteAccountOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeDeleteAccountOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[DeleteAccountOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[DeleteAccountOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: DeleteAccountPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2331
|
+
|
|
2332
|
+
|
|
2333
|
+
const DeleteSessionPlanHash = "e666aab82c5bfd211b9f134b37693cb976f8610f27db4949eded2820a6484612"
|
|
2334
|
+
var DeleteSessionOperation = riffdb.Operation{Name: "riffdb_better_auth_core_delete_session", InputSchemaHash: "6eeb9f3b452bb70a9b0e955dcb9e9a0115db479f3297a5d3c8b243a6e34974f7"}
|
|
2335
|
+
func encodeDeleteSessionInput(input DeleteSessionInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2336
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2337
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2338
|
+
"session_ids": riffdb.Values(input.SessionIds, func(item string) riffdb.Value { return riffdb.UUID(item) }),
|
|
2339
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2340
|
+
} }
|
|
2341
|
+
func validateDeleteSessionInput(input DeleteSessionInput) error { if len(input.SessionIds) < 1 || len(input.SessionIds) > 32 { return errors.New("invalid bounded collection length for DeleteSession.session_ids") }; return nil }
|
|
2342
|
+
func decodeDeleteSessionOutcome(value riffdb.Value) (DeleteSessionOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2343
|
+
case "SessionDeleted": result := DeleteSessionSessionDeleted{Outcome: outcome}
|
|
2344
|
+
return result, nil
|
|
2345
|
+
case "SessionMissing": result := DeleteSessionSessionMissing{Outcome: outcome}
|
|
2346
|
+
return result, nil
|
|
2347
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2348
|
+
func (client *Client) DeleteSession(ctx context.Context, input DeleteSessionInput) (CommandResult[DeleteSessionOutcome], error) { if err := validateDeleteSessionInput(input); err != nil { return CommandResult[DeleteSessionOutcome]{}, err }; response, err := client.session.Invoke(ctx, DeleteSessionOperation, encodeDeleteSessionInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[DeleteSessionOutcome]{}, err }; outcome, err := decodeDeleteSessionOutcome(response.Value); if err != nil { return CommandResult[DeleteSessionOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[DeleteSessionOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: DeleteSessionPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2349
|
+
func (client *Client) DeleteSessionBatch(ctx context.Context, inputs []DeleteSessionInput, concurrency, checkpoint uint32) (BatchResult[DeleteSessionOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { if err := validateDeleteSessionInput(input); err != nil { return BatchResult[DeleteSessionOutcome]{}, err }; encoded[index] = encodeDeleteSessionInput(input) }; response, err := client.session.Batch(ctx, DeleteSessionOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[DeleteSessionOutcome]{}, err }; result := BatchResult[DeleteSessionOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[DeleteSessionOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[DeleteSessionOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeDeleteSessionOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[DeleteSessionOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[DeleteSessionOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: DeleteSessionPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2350
|
+
|
|
2351
|
+
|
|
2352
|
+
const DeleteUserPlanHash = "dd329f56ff3441a53c8e58080cee67813beeb5ca001fe1432e3e013eb9b8c3d1"
|
|
2353
|
+
var DeleteUserOperation = riffdb.Operation{Name: "riffdb_better_auth_core_delete_user", InputSchemaHash: "c128e0333c57f08e3094e68459abbac53483952520e8381c0b79db903c36146d"}
|
|
2354
|
+
func encodeDeleteUserInput(input DeleteUserInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2355
|
+
"user_ids": riffdb.Values(input.UserIds, func(item string) riffdb.Value { return riffdb.UUID(item) }),
|
|
2356
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2357
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2358
|
+
} }
|
|
2359
|
+
func validateDeleteUserInput(input DeleteUserInput) error { if len(input.UserIds) < 1 || len(input.UserIds) > 1 { return errors.New("invalid bounded collection length for DeleteUser.user_ids") }; return nil }
|
|
2360
|
+
func decodeDeleteUserOutcome(value riffdb.Value) (DeleteUserOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2361
|
+
case "UserDeleted": result := DeleteUserUserDeleted{Outcome: outcome}
|
|
2362
|
+
return result, nil
|
|
2363
|
+
case "DeleteUserMissing": result := DeleteUserDeleteUserMissing{Outcome: outcome}
|
|
2364
|
+
return result, nil
|
|
2365
|
+
case "DeleteUserCascadeLimitExceeded": result := DeleteUserDeleteUserCascadeLimitExceeded{Outcome: outcome}
|
|
2366
|
+
return result, nil
|
|
2367
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2368
|
+
func (client *Client) DeleteUser(ctx context.Context, input DeleteUserInput) (CommandResult[DeleteUserOutcome], error) { if err := validateDeleteUserInput(input); err != nil { return CommandResult[DeleteUserOutcome]{}, err }; response, err := client.session.Invoke(ctx, DeleteUserOperation, encodeDeleteUserInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[DeleteUserOutcome]{}, err }; outcome, err := decodeDeleteUserOutcome(response.Value); if err != nil { return CommandResult[DeleteUserOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[DeleteUserOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: DeleteUserPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2369
|
+
func (client *Client) DeleteUserBatch(ctx context.Context, inputs []DeleteUserInput, concurrency, checkpoint uint32) (BatchResult[DeleteUserOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { if err := validateDeleteUserInput(input); err != nil { return BatchResult[DeleteUserOutcome]{}, err }; encoded[index] = encodeDeleteUserInput(input) }; response, err := client.session.Batch(ctx, DeleteUserOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[DeleteUserOutcome]{}, err }; result := BatchResult[DeleteUserOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[DeleteUserOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[DeleteUserOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeDeleteUserOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[DeleteUserOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[DeleteUserOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: DeleteUserPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2370
|
+
|
|
2371
|
+
|
|
2372
|
+
const DeleteVerificationPlanHash = "10bbbfa72a6bbc023398edf8853d868e8a04a0b1646b39d6faabda3735178808"
|
|
2373
|
+
var DeleteVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_delete_verification", InputSchemaHash: "ce88d8052f760625503f8a732f9813446ef7cc042d726ee1826c05c437c0929c"}
|
|
2374
|
+
func encodeDeleteVerificationInput(input DeleteVerificationInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2375
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2376
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2377
|
+
"verification_ids": riffdb.Values(input.VerificationIds, func(item string) riffdb.Value { return riffdb.UUID(item) }),
|
|
2378
|
+
} }
|
|
2379
|
+
func validateDeleteVerificationInput(input DeleteVerificationInput) error { if len(input.VerificationIds) < 1 || len(input.VerificationIds) > 32 { return errors.New("invalid bounded collection length for DeleteVerification.verification_ids") }; return nil }
|
|
2380
|
+
func decodeDeleteVerificationOutcome(value riffdb.Value) (DeleteVerificationOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2381
|
+
case "VerificationDeleted": result := DeleteVerificationVerificationDeleted{Outcome: outcome}
|
|
2382
|
+
return result, nil
|
|
2383
|
+
case "VerificationMissing": result := DeleteVerificationVerificationMissing{Outcome: outcome}
|
|
2384
|
+
return result, nil
|
|
2385
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2386
|
+
func (client *Client) DeleteVerification(ctx context.Context, input DeleteVerificationInput) (CommandResult[DeleteVerificationOutcome], error) { if err := validateDeleteVerificationInput(input); err != nil { return CommandResult[DeleteVerificationOutcome]{}, err }; response, err := client.session.Invoke(ctx, DeleteVerificationOperation, encodeDeleteVerificationInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[DeleteVerificationOutcome]{}, err }; outcome, err := decodeDeleteVerificationOutcome(response.Value); if err != nil { return CommandResult[DeleteVerificationOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[DeleteVerificationOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: DeleteVerificationPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2387
|
+
func (client *Client) DeleteVerificationBatch(ctx context.Context, inputs []DeleteVerificationInput, concurrency, checkpoint uint32) (BatchResult[DeleteVerificationOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { if err := validateDeleteVerificationInput(input); err != nil { return BatchResult[DeleteVerificationOutcome]{}, err }; encoded[index] = encodeDeleteVerificationInput(input) }; response, err := client.session.Batch(ctx, DeleteVerificationOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[DeleteVerificationOutcome]{}, err }; result := BatchResult[DeleteVerificationOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[DeleteVerificationOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[DeleteVerificationOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeDeleteVerificationOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[DeleteVerificationOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[DeleteVerificationOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: DeleteVerificationPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2388
|
+
|
|
2389
|
+
|
|
2390
|
+
const ResetCredentialPasswordPlanHash = "5e4d36f733ba1e44dcb94e4e0a4ea4e9870b58391ef0d82c29c21cd6b8ebbd3c"
|
|
2391
|
+
var ResetCredentialPasswordOperation = riffdb.Operation{Name: "riffdb_better_auth_core_reset_credential_password", InputSchemaHash: "b9959320d1fe50eba09aa488169566453c4ed9a58c27a338455e204b7f0c708d"}
|
|
2392
|
+
func encodeResetCredentialPasswordInput(input ResetCredentialPasswordInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2393
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2394
|
+
"password": riffdb.String(input.Password),
|
|
2395
|
+
"account_id": riffdb.UUID(input.AccountId),
|
|
2396
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2397
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2398
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2399
|
+
"account_revision": riffdb.U64(input.AccountRevision),
|
|
2400
|
+
"verification_ids": riffdb.Values(input.VerificationIds, func(item string) riffdb.Value { return riffdb.UUID(item) }),
|
|
2401
|
+
"external_account_id": riffdb.String(input.ExternalAccountId),
|
|
2402
|
+
"verification_revision": riffdb.U64(input.VerificationRevision),
|
|
2403
|
+
} }
|
|
2404
|
+
func validateResetCredentialPasswordInput(input ResetCredentialPasswordInput) error { if len(input.VerificationIds) < 1 || len(input.VerificationIds) > 1 { return errors.New("invalid bounded collection length for ResetCredentialPassword.verification_ids") }; return nil }
|
|
2405
|
+
func decodeResetCredentialPasswordOutcome(value riffdb.Value) (ResetCredentialPasswordOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2406
|
+
case "PasswordAccountStale": result := ResetCredentialPasswordPasswordAccountStale{Outcome: outcome}
|
|
2407
|
+
return result, nil
|
|
2408
|
+
case "PasswordAccountMissing": result := ResetCredentialPasswordPasswordAccountMissing{Outcome: outcome}
|
|
2409
|
+
return result, nil
|
|
2410
|
+
case "CredentialPasswordReset": result := ResetCredentialPasswordCredentialPasswordReset{Outcome: outcome}
|
|
2411
|
+
return result, nil
|
|
2412
|
+
case "PasswordProviderMismatch": result := ResetCredentialPasswordPasswordProviderMismatch{Outcome: outcome}
|
|
2413
|
+
return result, nil
|
|
2414
|
+
case "VerificationConsumeStale": result := ResetCredentialPasswordVerificationConsumeStale{Outcome: outcome}
|
|
2415
|
+
return result, nil
|
|
2416
|
+
case "VerificationConsumeMissing": result := ResetCredentialPasswordVerificationConsumeMissing{Outcome: outcome}
|
|
2417
|
+
return result, nil
|
|
2418
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2419
|
+
func (client *Client) ResetCredentialPassword(ctx context.Context, input ResetCredentialPasswordInput) (CommandResult[ResetCredentialPasswordOutcome], error) { if err := validateResetCredentialPasswordInput(input); err != nil { return CommandResult[ResetCredentialPasswordOutcome]{}, err }; response, err := client.session.Invoke(ctx, ResetCredentialPasswordOperation, encodeResetCredentialPasswordInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[ResetCredentialPasswordOutcome]{}, err }; outcome, err := decodeResetCredentialPasswordOutcome(response.Value); if err != nil { return CommandResult[ResetCredentialPasswordOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[ResetCredentialPasswordOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: ResetCredentialPasswordPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2420
|
+
func (client *Client) ResetCredentialPasswordBatch(ctx context.Context, inputs []ResetCredentialPasswordInput, concurrency, checkpoint uint32) (BatchResult[ResetCredentialPasswordOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { if err := validateResetCredentialPasswordInput(input); err != nil { return BatchResult[ResetCredentialPasswordOutcome]{}, err }; encoded[index] = encodeResetCredentialPasswordInput(input) }; response, err := client.session.Batch(ctx, ResetCredentialPasswordOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[ResetCredentialPasswordOutcome]{}, err }; result := BatchResult[ResetCredentialPasswordOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[ResetCredentialPasswordOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[ResetCredentialPasswordOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeResetCredentialPasswordOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[ResetCredentialPasswordOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[ResetCredentialPasswordOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: ResetCredentialPasswordPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2421
|
+
|
|
2422
|
+
|
|
2423
|
+
const UpdateAccountPlanHash = "ab4c60ce1e1a05bb4c9bdb0d9aa72e39ba1553cc121f09cb6215e8ff1cac0c8b"
|
|
2424
|
+
var UpdateAccountOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_account", InputSchemaHash: "f623666040b60333eba3b4b46d5b1fe92158fcade5037f13b8ed0435e5c9471e"}
|
|
2425
|
+
func encodeUpdateAccountInput(input UpdateAccountInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2426
|
+
"scope": riffdb.Optional(input.Scope, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2427
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2428
|
+
"id_token": riffdb.Optional(input.IdToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2429
|
+
"password": riffdb.Optional(input.Password, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2430
|
+
"account_id": riffdb.UUID(input.AccountId),
|
|
2431
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2432
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2433
|
+
"provider_id": riffdb.String(input.ProviderId),
|
|
2434
|
+
"access_token": riffdb.Optional(input.AccessToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2435
|
+
"refresh_token": riffdb.Optional(input.RefreshToken, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2436
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2437
|
+
"expected_revision": riffdb.U64(input.ExpectedRevision),
|
|
2438
|
+
"external_account_id": riffdb.String(input.ExternalAccountId),
|
|
2439
|
+
"access_token_expires_at": riffdb.Optional(input.AccessTokenExpiresAt, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2440
|
+
"refresh_token_expires_at": riffdb.Optional(input.RefreshTokenExpiresAt, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2441
|
+
} }
|
|
2442
|
+
func decodeUpdateAccountOutcome(value riffdb.Value) (UpdateAccountOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2443
|
+
case "AccountUpdated": result := UpdateAccountAccountUpdated{Outcome: outcome}
|
|
2444
|
+
return result, nil
|
|
2445
|
+
case "AccountUpdateStale": result := UpdateAccountAccountUpdateStale{Outcome: outcome}
|
|
2446
|
+
return result, nil
|
|
2447
|
+
case "AccountUpdateMissing": result := UpdateAccountAccountUpdateMissing{Outcome: outcome}
|
|
2448
|
+
return result, nil
|
|
2449
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2450
|
+
func (client *Client) UpdateAccount(ctx context.Context, input UpdateAccountInput) (CommandResult[UpdateAccountOutcome], error) { response, err := client.session.Invoke(ctx, UpdateAccountOperation, encodeUpdateAccountInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[UpdateAccountOutcome]{}, err }; outcome, err := decodeUpdateAccountOutcome(response.Value); if err != nil { return CommandResult[UpdateAccountOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[UpdateAccountOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: UpdateAccountPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2451
|
+
func (client *Client) UpdateAccountBatch(ctx context.Context, inputs []UpdateAccountInput, concurrency, checkpoint uint32) (BatchResult[UpdateAccountOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeUpdateAccountInput(input) }; response, err := client.session.Batch(ctx, UpdateAccountOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[UpdateAccountOutcome]{}, err }; result := BatchResult[UpdateAccountOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[UpdateAccountOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[UpdateAccountOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeUpdateAccountOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[UpdateAccountOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[UpdateAccountOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: UpdateAccountPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2452
|
+
|
|
2453
|
+
|
|
2454
|
+
const UpdateAccountPasswordsPlanHash = "16a4d018afc3eff4bcf7d3e2f7549a13c08cf70e22b1399f0e9773fab373ddf3"
|
|
2455
|
+
var UpdateAccountPasswordsOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_account_passwords", InputSchemaHash: "f210cf13f349297bad0bd949bdfbb796e37ea4dfa24b99d6205942afdde0883c"}
|
|
2456
|
+
func encodeUpdateAccountPasswordsInput(input UpdateAccountPasswordsInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2457
|
+
"updates": riffdb.Values(input.Updates, func(item AccountPasswordUpdate) riffdb.Value { return encodeAccountPasswordUpdate(item) }),
|
|
2458
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2459
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2460
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2461
|
+
} }
|
|
2462
|
+
func validateUpdateAccountPasswordsInput(input UpdateAccountPasswordsInput) error { if len(input.Updates) < 1 || len(input.Updates) > 8 { return errors.New("invalid bounded collection length for UpdateAccountPasswords.updates") }; return nil }
|
|
2463
|
+
func decodeUpdateAccountPasswordsOutcome(value riffdb.Value) (UpdateAccountPasswordsOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2464
|
+
case "PasswordAccountStale": result := UpdateAccountPasswordsPasswordAccountStale{Outcome: outcome}
|
|
2465
|
+
return result, nil
|
|
2466
|
+
case "PasswordAccountMissing": result := UpdateAccountPasswordsPasswordAccountMissing{Outcome: outcome}
|
|
2467
|
+
return result, nil
|
|
2468
|
+
case "AccountPasswordsUpdated": result := UpdateAccountPasswordsAccountPasswordsUpdated{Outcome: outcome}
|
|
2469
|
+
return result, nil
|
|
2470
|
+
case "PasswordProviderMismatch": result := UpdateAccountPasswordsPasswordProviderMismatch{Outcome: outcome}
|
|
2471
|
+
return result, nil
|
|
2472
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2473
|
+
func (client *Client) UpdateAccountPasswords(ctx context.Context, input UpdateAccountPasswordsInput) (CommandResult[UpdateAccountPasswordsOutcome], error) { if err := validateUpdateAccountPasswordsInput(input); err != nil { return CommandResult[UpdateAccountPasswordsOutcome]{}, err }; response, err := client.session.Invoke(ctx, UpdateAccountPasswordsOperation, encodeUpdateAccountPasswordsInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[UpdateAccountPasswordsOutcome]{}, err }; outcome, err := decodeUpdateAccountPasswordsOutcome(response.Value); if err != nil { return CommandResult[UpdateAccountPasswordsOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[UpdateAccountPasswordsOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: UpdateAccountPasswordsPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2474
|
+
func (client *Client) UpdateAccountPasswordsBatch(ctx context.Context, inputs []UpdateAccountPasswordsInput, concurrency, checkpoint uint32) (BatchResult[UpdateAccountPasswordsOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { if err := validateUpdateAccountPasswordsInput(input); err != nil { return BatchResult[UpdateAccountPasswordsOutcome]{}, err }; encoded[index] = encodeUpdateAccountPasswordsInput(input) }; response, err := client.session.Batch(ctx, UpdateAccountPasswordsOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[UpdateAccountPasswordsOutcome]{}, err }; result := BatchResult[UpdateAccountPasswordsOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[UpdateAccountPasswordsOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[UpdateAccountPasswordsOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeUpdateAccountPasswordsOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[UpdateAccountPasswordsOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[UpdateAccountPasswordsOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: UpdateAccountPasswordsPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2475
|
+
|
|
2476
|
+
|
|
2477
|
+
const UpdateCredentialPasswordPlanHash = "7784b4f6a0765b2de2486791a3b13253371c00ef809b498c37f0ec693c3ddefa"
|
|
2478
|
+
var UpdateCredentialPasswordOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_credential_password", InputSchemaHash: "5d4589d948081b8f0d4472fa359bd34ca0c05895eac4e6a99f9015f8f45cc2e7"}
|
|
2479
|
+
func encodeUpdateCredentialPasswordInput(input UpdateCredentialPasswordInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2480
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2481
|
+
"password": riffdb.String(input.Password),
|
|
2482
|
+
"account_id": riffdb.UUID(input.AccountId),
|
|
2483
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2484
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2485
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2486
|
+
"expected_revision": riffdb.U64(input.ExpectedRevision),
|
|
2487
|
+
"external_account_id": riffdb.String(input.ExternalAccountId),
|
|
2488
|
+
} }
|
|
2489
|
+
func decodeUpdateCredentialPasswordOutcome(value riffdb.Value) (UpdateCredentialPasswordOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2490
|
+
case "PasswordAccountStale": result := UpdateCredentialPasswordPasswordAccountStale{Outcome: outcome}
|
|
2491
|
+
return result, nil
|
|
2492
|
+
case "PasswordAccountMissing": result := UpdateCredentialPasswordPasswordAccountMissing{Outcome: outcome}
|
|
2493
|
+
return result, nil
|
|
2494
|
+
case "PasswordProviderMismatch": result := UpdateCredentialPasswordPasswordProviderMismatch{Outcome: outcome}
|
|
2495
|
+
return result, nil
|
|
2496
|
+
case "CredentialPasswordUpdated": result := UpdateCredentialPasswordCredentialPasswordUpdated{Outcome: outcome}
|
|
2497
|
+
return result, nil
|
|
2498
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2499
|
+
func (client *Client) UpdateCredentialPassword(ctx context.Context, input UpdateCredentialPasswordInput) (CommandResult[UpdateCredentialPasswordOutcome], error) { response, err := client.session.Invoke(ctx, UpdateCredentialPasswordOperation, encodeUpdateCredentialPasswordInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[UpdateCredentialPasswordOutcome]{}, err }; outcome, err := decodeUpdateCredentialPasswordOutcome(response.Value); if err != nil { return CommandResult[UpdateCredentialPasswordOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[UpdateCredentialPasswordOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: UpdateCredentialPasswordPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2500
|
+
func (client *Client) UpdateCredentialPasswordBatch(ctx context.Context, inputs []UpdateCredentialPasswordInput, concurrency, checkpoint uint32) (BatchResult[UpdateCredentialPasswordOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeUpdateCredentialPasswordInput(input) }; response, err := client.session.Batch(ctx, UpdateCredentialPasswordOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[UpdateCredentialPasswordOutcome]{}, err }; result := BatchResult[UpdateCredentialPasswordOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[UpdateCredentialPasswordOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[UpdateCredentialPasswordOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeUpdateCredentialPasswordOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[UpdateCredentialPasswordOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[UpdateCredentialPasswordOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: UpdateCredentialPasswordPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2501
|
+
|
|
2502
|
+
|
|
2503
|
+
const UpdateSessionPlanHash = "5647523809f40e2b96dfc5ec23243d4e93f918d2a618da9fd61ec2be7f69cc47"
|
|
2504
|
+
var UpdateSessionOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_session", InputSchemaHash: "4dc035dba6c54788232952ebe5eb225c8f1e8e542ea3b20ef188f85fbfb1a1a1"}
|
|
2505
|
+
func encodeUpdateSessionInput(input UpdateSessionInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2506
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2507
|
+
"expires_at": riffdb.TimestampFrom(input.ExpiresAt),
|
|
2508
|
+
"ip_address": riffdb.Optional(input.IpAddress, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2509
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2510
|
+
"session_id": riffdb.UUID(input.SessionId),
|
|
2511
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2512
|
+
"user_agent": riffdb.Optional(input.UserAgent, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2513
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2514
|
+
"expected_revision": riffdb.U64(input.ExpectedRevision),
|
|
2515
|
+
} }
|
|
2516
|
+
func decodeUpdateSessionOutcome(value riffdb.Value) (UpdateSessionOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2517
|
+
case "SessionUpdated": result := UpdateSessionSessionUpdated{Outcome: outcome}
|
|
2518
|
+
return result, nil
|
|
2519
|
+
case "SessionUpdateStale": result := UpdateSessionSessionUpdateStale{Outcome: outcome}
|
|
2520
|
+
return result, nil
|
|
2521
|
+
case "SessionUpdateMissing": result := UpdateSessionSessionUpdateMissing{Outcome: outcome}
|
|
2522
|
+
return result, nil
|
|
2523
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2524
|
+
func (client *Client) UpdateSession(ctx context.Context, input UpdateSessionInput) (CommandResult[UpdateSessionOutcome], error) { response, err := client.session.Invoke(ctx, UpdateSessionOperation, encodeUpdateSessionInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[UpdateSessionOutcome]{}, err }; outcome, err := decodeUpdateSessionOutcome(response.Value); if err != nil { return CommandResult[UpdateSessionOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[UpdateSessionOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: UpdateSessionPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2525
|
+
func (client *Client) UpdateSessionBatch(ctx context.Context, inputs []UpdateSessionInput, concurrency, checkpoint uint32) (BatchResult[UpdateSessionOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeUpdateSessionInput(input) }; response, err := client.session.Batch(ctx, UpdateSessionOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[UpdateSessionOutcome]{}, err }; result := BatchResult[UpdateSessionOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[UpdateSessionOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[UpdateSessionOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeUpdateSessionOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[UpdateSessionOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[UpdateSessionOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: UpdateSessionPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2526
|
+
|
|
2527
|
+
|
|
2528
|
+
const UpdateUserPlanHash = "23fe689d0383112a3db43b7cca6e852608babd6042ea953db0f33fbcc7d4739b"
|
|
2529
|
+
var UpdateUserOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_user", InputSchemaHash: "2c760aa9861afd77f4abceee83a3a12425e38d964bbfd919f67a631a813cd82a"}
|
|
2530
|
+
func encodeUpdateUserInput(input UpdateUserInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2531
|
+
"name": riffdb.String(input.Name),
|
|
2532
|
+
"email": riffdb.String(input.Email),
|
|
2533
|
+
"image": riffdb.Optional(input.Image, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2534
|
+
"locale": riffdb.Optional(input.Locale, func(item string) riffdb.Value { return riffdb.String(item) }),
|
|
2535
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2536
|
+
"date_field": riffdb.Optional(input.DateField, func(item riffdb.Instant) riffdb.Value { return riffdb.TimestampFrom(item) }),
|
|
2537
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2538
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2539
|
+
"email_verified": riffdb.Bool(input.EmailVerified),
|
|
2540
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2541
|
+
"expected_revision": riffdb.U64(input.ExpectedRevision),
|
|
2542
|
+
} }
|
|
2543
|
+
func decodeUpdateUserOutcome(value riffdb.Value) (UpdateUserOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2544
|
+
case "UserUpdated": result := UpdateUserUserUpdated{Outcome: outcome}
|
|
2545
|
+
return result, nil
|
|
2546
|
+
case "UserUpdateStale": result := UpdateUserUserUpdateStale{Outcome: outcome}
|
|
2547
|
+
return result, nil
|
|
2548
|
+
case "UserUpdateMissing": result := UpdateUserUserUpdateMissing{Outcome: outcome}
|
|
2549
|
+
return result, nil
|
|
2550
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2551
|
+
func (client *Client) UpdateUser(ctx context.Context, input UpdateUserInput) (CommandResult[UpdateUserOutcome], error) { response, err := client.session.Invoke(ctx, UpdateUserOperation, encodeUpdateUserInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[UpdateUserOutcome]{}, err }; outcome, err := decodeUpdateUserOutcome(response.Value); if err != nil { return CommandResult[UpdateUserOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[UpdateUserOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: UpdateUserPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2552
|
+
func (client *Client) UpdateUserBatch(ctx context.Context, inputs []UpdateUserInput, concurrency, checkpoint uint32) (BatchResult[UpdateUserOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeUpdateUserInput(input) }; response, err := client.session.Batch(ctx, UpdateUserOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[UpdateUserOutcome]{}, err }; result := BatchResult[UpdateUserOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[UpdateUserOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[UpdateUserOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeUpdateUserOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[UpdateUserOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[UpdateUserOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: UpdateUserPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2553
|
+
|
|
2554
|
+
|
|
2555
|
+
const UpdateVerificationPlanHash = "96bcf79ae9819e3e1535a033c197b722e1b416a286c60395f11faf7f5f87a25b"
|
|
2556
|
+
var UpdateVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_verification", InputSchemaHash: "4377bfd8aba7795661e686fbc5903e8116b2f9eba24bce9fcdd63cd4bb53e8c5"}
|
|
2557
|
+
func encodeUpdateVerificationInput(input UpdateVerificationInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2558
|
+
"value": riffdb.String(input.Value),
|
|
2559
|
+
"expires_at": riffdb.TimestampFrom(input.ExpiresAt),
|
|
2560
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2561
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2562
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2563
|
+
"verification_id": riffdb.UUID(input.VerificationId),
|
|
2564
|
+
"expected_revision": riffdb.U64(input.ExpectedRevision),
|
|
2565
|
+
} }
|
|
2566
|
+
func decodeUpdateVerificationOutcome(value riffdb.Value) (UpdateVerificationOutcome, error) { fields, err := riffdb.RecordFields(value); if err != nil { return nil, err }; outcomeValue, err := requiredField(fields, "outcome"); if err != nil { return nil, err }; outcome, err := riffdb.EnumValue(outcomeValue); if err != nil { return nil, err }; switch outcome {
|
|
2567
|
+
case "VerificationUpdated": result := UpdateVerificationVerificationUpdated{Outcome: outcome}
|
|
2568
|
+
return result, nil
|
|
2569
|
+
case "VerificationUpdateStale": result := UpdateVerificationVerificationUpdateStale{Outcome: outcome}
|
|
2570
|
+
return result, nil
|
|
2571
|
+
case "VerificationUpdateMissing": result := UpdateVerificationVerificationUpdateMissing{Outcome: outcome}
|
|
2572
|
+
return result, nil
|
|
2573
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2574
|
+
func (client *Client) UpdateVerification(ctx context.Context, input UpdateVerificationInput) (CommandResult[UpdateVerificationOutcome], error) { response, err := client.session.Invoke(ctx, UpdateVerificationOperation, encodeUpdateVerificationInput(input), riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return CommandResult[UpdateVerificationOutcome]{}, err }; outcome, err := decodeUpdateVerificationOutcome(response.Value); if err != nil { return CommandResult[UpdateVerificationOutcome]{}, err }; client.observeCommit(response.ApplicationHead); return CommandResult[UpdateVerificationOutcome]{Outcome: outcome, CommitSequence: response.ApplicationHead, ContractVersion: ContractVersion, PlanHash: UpdateVerificationPlanHash, Replayed: response.Replayed, OutcomeURI: response.Cursor}, nil }
|
|
2575
|
+
func (client *Client) UpdateVerificationBatch(ctx context.Context, inputs []UpdateVerificationInput, concurrency, checkpoint uint32) (BatchResult[UpdateVerificationOutcome], error) { encoded := make([]map[string]riffdb.Value, len(inputs)); for index, input := range inputs { encoded[index] = encodeUpdateVerificationInput(input) }; response, err := client.session.Batch(ctx, UpdateVerificationOperation, encoded, concurrency, checkpoint, riffdb.Options{MaximumAttempts: client.commandAttempts}); if err != nil { return BatchResult[UpdateVerificationOutcome]{}, err }; result := BatchResult[UpdateVerificationOutcome]{Checkpoint: response.Checkpoint, Total: response.Total, Items: make([]BatchItem[UpdateVerificationOutcome], 0, len(response.Items))}; for _, item := range response.Items { converted := BatchItem[UpdateVerificationOutcome]{Index: item.Index}; if item.Error != nil { converted.Error = item.Error } else if item.Result != nil { outcome, decodeErr := decodeUpdateVerificationOutcome(item.Result.Value); if decodeErr != nil { return BatchResult[UpdateVerificationOutcome]{}, decodeErr }; client.observeCommit(item.Result.CommitSequence); converted.Result = &CommandResult[UpdateVerificationOutcome]{Outcome: outcome, CommitSequence: item.Result.CommitSequence, ContractVersion: ContractVersion, PlanHash: UpdateVerificationPlanHash, Replayed: item.Result.Replayed, OutcomeURI: item.Result.OutcomeURI} }; result.Items = append(result.Items, converted) }; return result, nil }
|
|
2576
|
+
|
|
2577
|
+
|
|
2578
|
+
func requiredField(fields map[string]riffdb.Value, name string) (riffdb.Value, error) { value, ok := fields[name]; if !ok { return riffdb.Value{}, errors.New("RiffDB driver result is missing a generated field") }; return value, nil }
|