@riffdb/better-auth 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DESIGN.md +90 -14
- package/README.md +157 -25
- package/dist/adapter.d.ts +7 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +385 -47
- package/dist/adapter.js.map +1 -1
- package/dist/generated/client.d.ts +267 -26
- package/dist/generated/client.d.ts.map +1 -1
- package/dist/generated/client.js +479 -69
- package/dist/generated/client.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- 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 +3 -0
- package/dist/profile-contract.d.ts.map +1 -1
- package/dist/profile-contract.js +8 -0
- package/dist/profile-contract.js.map +1 -1
- package/dist/profile-plan.js +1 -1
- package/dist/profile-plan.js.map +1 -1
- package/dist/profile.d.ts +2 -1
- package/dist/profile.d.ts.map +1 -1
- package/dist/profile.js +2 -1
- package/dist/profile.js.map +1 -1
- 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/generated/go/client.go +350 -96
- package/generated/mcp/tools.json +3338 -1768
- package/generated/python/client.py +603 -26
- package/generated/riffdb.application.exact.json +1 -1
- package/generated/riffdb.contract.bundle +0 -0
- package/generated/rust/client.rs +522 -26
- package/package.json +34 -13
- 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 +3 -0
- package/profiles/organization-security/riffdb/contract.riff +12 -0
- package/profiles/organization-security/riffdb/queries/find_team_by_id.riffq +1 -1
- package/profiles/organization-security/riffdb/queries/find_team_member_by_id.riffq +1 -1
- 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 +1 -1
- package/profiles/organization-security/riffdb.application.json +5 -0
- package/profiles/organization-security.profile.json +27 -1
- 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 +58 -0
- package/riffdb/queries/find_credential_account.riffq +25 -0
- package/riffdb.application.json +106 -26
- package/riffdb.application.lock.json +1 -1
- package/src/generated/client.ts +2746 -0
package/generated/go/client.go
CHANGED
|
@@ -4,14 +4,15 @@ package riffdb_better_auth_core
|
|
|
4
4
|
import (
|
|
5
5
|
"context"
|
|
6
6
|
"errors"
|
|
7
|
+
"sync"
|
|
7
8
|
|
|
8
9
|
riffdb "riffdb.dev/application"
|
|
9
10
|
)
|
|
10
11
|
|
|
11
|
-
const QueryModuleHash = "
|
|
12
|
+
const QueryModuleHash = "8dff3a38f6c0a915d7653e7571a2ef5795a89b452990d705f38fe0ac93b5ad9a"
|
|
12
13
|
const ContractLineage = "RiffDBBetterAuthCore"
|
|
13
14
|
const ContractVersion uint64 = 1
|
|
14
|
-
const ContractBundleHash = "
|
|
15
|
+
const ContractBundleHash = "74fd255eefcf04f0b054dbb6c4a0bed43a7312d82f7755687c9229ee3206ddfc"
|
|
15
16
|
|
|
16
17
|
type QuerySecretOutput struct { Query string; Entity string; Field string }
|
|
17
18
|
|
|
@@ -372,6 +373,32 @@ func (FindActiveSessionsByUserIdFound) String() string { return "FindActiveSessi
|
|
|
372
373
|
func (FindActiveSessionsByUserIdFound) GoString() string { return "FindActiveSessionsByUserIdFound{<secret outputs redacted>}" }
|
|
373
374
|
|
|
374
375
|
func UnwrapFindActiveSessionsByUserIdFound(value FindActiveSessionsByUserIdResult) (FindActiveSessionsByUserIdFound, error) { if branch, ok := value.(FindActiveSessionsByUserIdFound); ok { return branch, nil }; return FindActiveSessionsByUserIdFound{}, errors.New("expected FindActiveSessionsByUserId outcome found") }
|
|
376
|
+
var FindCredentialAccountSecretOutputs = []QuerySecretOutput{
|
|
377
|
+
{Query: "FindCredentialAccount", Entity: "Account", Field: "access_token"},
|
|
378
|
+
{Query: "FindCredentialAccount", Entity: "Account", Field: "refresh_token"},
|
|
379
|
+
{Query: "FindCredentialAccount", Entity: "Account", Field: "id_token"},
|
|
380
|
+
{Query: "FindCredentialAccount", Entity: "Account", Field: "password"},
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
type FindCredentialAccountParams struct {
|
|
384
|
+
OrganizationId string
|
|
385
|
+
UserId string
|
|
386
|
+
AccountId string
|
|
387
|
+
ProviderId string
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
type FindCredentialAccountResult interface { isFindCredentialAccountResult() }
|
|
391
|
+
type FindCredentialAccountFound struct {
|
|
392
|
+
Outcome string
|
|
393
|
+
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 }
|
|
394
|
+
}
|
|
395
|
+
func (FindCredentialAccountFound) isFindCredentialAccountResult() {}
|
|
396
|
+
func IsFindCredentialAccountFound(value FindCredentialAccountResult) (FindCredentialAccountFound, bool) { branch, ok := value.(FindCredentialAccountFound); return branch, ok }
|
|
397
|
+
|
|
398
|
+
func (FindCredentialAccountFound) String() string { return "FindCredentialAccountFound{<secret outputs redacted>}" }
|
|
399
|
+
func (FindCredentialAccountFound) GoString() string { return "FindCredentialAccountFound{<secret outputs redacted>}" }
|
|
400
|
+
|
|
401
|
+
func UnwrapFindCredentialAccountFound(value FindCredentialAccountResult) (FindCredentialAccountFound, error) { if branch, ok := value.(FindCredentialAccountFound); ok { return branch, nil }; return FindCredentialAccountFound{}, errors.New("expected FindCredentialAccount outcome found") }
|
|
375
402
|
type FindExpiredVerificationIdsParams struct {
|
|
376
403
|
OrganizationId string
|
|
377
404
|
ExpiresBefore riffdb.Instant
|
|
@@ -629,6 +656,31 @@ type ConsumeVerificationSetVerificationConsumeMissing struct {
|
|
|
629
656
|
func (ConsumeVerificationSetVerificationConsumeMissing) isConsumeVerificationSetOutcome() {}
|
|
630
657
|
func IsConsumeVerificationSetVerificationConsumeMissing(value ConsumeVerificationSetOutcome) (ConsumeVerificationSetVerificationConsumeMissing, bool) { branch, ok := value.(ConsumeVerificationSetVerificationConsumeMissing); return branch, ok }
|
|
631
658
|
|
|
659
|
+
type ConsumeVerificationSnapshotInput struct {
|
|
660
|
+
RequestId string
|
|
661
|
+
OrganizationId string
|
|
662
|
+
VerificationId string
|
|
663
|
+
ExpectedRevision uint64
|
|
664
|
+
}
|
|
665
|
+
type ConsumeVerificationSnapshotOutcome interface { isConsumeVerificationSnapshotOutcome() }
|
|
666
|
+
type ConsumeVerificationSnapshotVerificationConsumed struct {
|
|
667
|
+
Outcome string
|
|
668
|
+
}
|
|
669
|
+
func (ConsumeVerificationSnapshotVerificationConsumed) isConsumeVerificationSnapshotOutcome() {}
|
|
670
|
+
func IsConsumeVerificationSnapshotVerificationConsumed(value ConsumeVerificationSnapshotOutcome) (ConsumeVerificationSnapshotVerificationConsumed, bool) { branch, ok := value.(ConsumeVerificationSnapshotVerificationConsumed); return branch, ok }
|
|
671
|
+
|
|
672
|
+
type ConsumeVerificationSnapshotVerificationConsumeStale struct {
|
|
673
|
+
Outcome string
|
|
674
|
+
}
|
|
675
|
+
func (ConsumeVerificationSnapshotVerificationConsumeStale) isConsumeVerificationSnapshotOutcome() {}
|
|
676
|
+
func IsConsumeVerificationSnapshotVerificationConsumeStale(value ConsumeVerificationSnapshotOutcome) (ConsumeVerificationSnapshotVerificationConsumeStale, bool) { branch, ok := value.(ConsumeVerificationSnapshotVerificationConsumeStale); return branch, ok }
|
|
677
|
+
|
|
678
|
+
type ConsumeVerificationSnapshotVerificationConsumeMissing struct {
|
|
679
|
+
Outcome string
|
|
680
|
+
}
|
|
681
|
+
func (ConsumeVerificationSnapshotVerificationConsumeMissing) isConsumeVerificationSnapshotOutcome() {}
|
|
682
|
+
func IsConsumeVerificationSnapshotVerificationConsumeMissing(value ConsumeVerificationSnapshotOutcome) (ConsumeVerificationSnapshotVerificationConsumeMissing, bool) { branch, ok := value.(ConsumeVerificationSnapshotVerificationConsumeMissing); return branch, ok }
|
|
683
|
+
|
|
632
684
|
type CreateAccountInput struct {
|
|
633
685
|
Id string
|
|
634
686
|
Scope *string
|
|
@@ -914,6 +966,55 @@ type DeleteVerificationVerificationMissing struct {
|
|
|
914
966
|
func (DeleteVerificationVerificationMissing) isDeleteVerificationOutcome() {}
|
|
915
967
|
func IsDeleteVerificationVerificationMissing(value DeleteVerificationOutcome) (DeleteVerificationVerificationMissing, bool) { branch, ok := value.(DeleteVerificationVerificationMissing); return branch, ok }
|
|
916
968
|
|
|
969
|
+
type ResetCredentialPasswordInput struct {
|
|
970
|
+
UserId string
|
|
971
|
+
Password string
|
|
972
|
+
AccountId string
|
|
973
|
+
RequestId string
|
|
974
|
+
UpdatedAt riffdb.Instant
|
|
975
|
+
OrganizationId string
|
|
976
|
+
AccountRevision uint64
|
|
977
|
+
VerificationIds []string
|
|
978
|
+
ExternalAccountId string
|
|
979
|
+
VerificationRevision uint64
|
|
980
|
+
}
|
|
981
|
+
type ResetCredentialPasswordOutcome interface { isResetCredentialPasswordOutcome() }
|
|
982
|
+
type ResetCredentialPasswordPasswordAccountStale struct {
|
|
983
|
+
Outcome string
|
|
984
|
+
}
|
|
985
|
+
func (ResetCredentialPasswordPasswordAccountStale) isResetCredentialPasswordOutcome() {}
|
|
986
|
+
func IsResetCredentialPasswordPasswordAccountStale(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordPasswordAccountStale, bool) { branch, ok := value.(ResetCredentialPasswordPasswordAccountStale); return branch, ok }
|
|
987
|
+
|
|
988
|
+
type ResetCredentialPasswordPasswordAccountMissing struct {
|
|
989
|
+
Outcome string
|
|
990
|
+
}
|
|
991
|
+
func (ResetCredentialPasswordPasswordAccountMissing) isResetCredentialPasswordOutcome() {}
|
|
992
|
+
func IsResetCredentialPasswordPasswordAccountMissing(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordPasswordAccountMissing, bool) { branch, ok := value.(ResetCredentialPasswordPasswordAccountMissing); return branch, ok }
|
|
993
|
+
|
|
994
|
+
type ResetCredentialPasswordCredentialPasswordReset struct {
|
|
995
|
+
Outcome string
|
|
996
|
+
}
|
|
997
|
+
func (ResetCredentialPasswordCredentialPasswordReset) isResetCredentialPasswordOutcome() {}
|
|
998
|
+
func IsResetCredentialPasswordCredentialPasswordReset(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordCredentialPasswordReset, bool) { branch, ok := value.(ResetCredentialPasswordCredentialPasswordReset); return branch, ok }
|
|
999
|
+
|
|
1000
|
+
type ResetCredentialPasswordPasswordProviderMismatch struct {
|
|
1001
|
+
Outcome string
|
|
1002
|
+
}
|
|
1003
|
+
func (ResetCredentialPasswordPasswordProviderMismatch) isResetCredentialPasswordOutcome() {}
|
|
1004
|
+
func IsResetCredentialPasswordPasswordProviderMismatch(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordPasswordProviderMismatch, bool) { branch, ok := value.(ResetCredentialPasswordPasswordProviderMismatch); return branch, ok }
|
|
1005
|
+
|
|
1006
|
+
type ResetCredentialPasswordVerificationConsumeStale struct {
|
|
1007
|
+
Outcome string
|
|
1008
|
+
}
|
|
1009
|
+
func (ResetCredentialPasswordVerificationConsumeStale) isResetCredentialPasswordOutcome() {}
|
|
1010
|
+
func IsResetCredentialPasswordVerificationConsumeStale(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordVerificationConsumeStale, bool) { branch, ok := value.(ResetCredentialPasswordVerificationConsumeStale); return branch, ok }
|
|
1011
|
+
|
|
1012
|
+
type ResetCredentialPasswordVerificationConsumeMissing struct {
|
|
1013
|
+
Outcome string
|
|
1014
|
+
}
|
|
1015
|
+
func (ResetCredentialPasswordVerificationConsumeMissing) isResetCredentialPasswordOutcome() {}
|
|
1016
|
+
func IsResetCredentialPasswordVerificationConsumeMissing(value ResetCredentialPasswordOutcome) (ResetCredentialPasswordVerificationConsumeMissing, bool) { branch, ok := value.(ResetCredentialPasswordVerificationConsumeMissing); return branch, ok }
|
|
1017
|
+
|
|
917
1018
|
type UpdateAccountInput struct {
|
|
918
1019
|
Scope *string
|
|
919
1020
|
UserId string
|
|
@@ -981,6 +1082,41 @@ type UpdateAccountPasswordsPasswordProviderMismatch struct {
|
|
|
981
1082
|
func (UpdateAccountPasswordsPasswordProviderMismatch) isUpdateAccountPasswordsOutcome() {}
|
|
982
1083
|
func IsUpdateAccountPasswordsPasswordProviderMismatch(value UpdateAccountPasswordsOutcome) (UpdateAccountPasswordsPasswordProviderMismatch, bool) { branch, ok := value.(UpdateAccountPasswordsPasswordProviderMismatch); return branch, ok }
|
|
983
1084
|
|
|
1085
|
+
type UpdateCredentialPasswordInput struct {
|
|
1086
|
+
UserId string
|
|
1087
|
+
Password string
|
|
1088
|
+
AccountId string
|
|
1089
|
+
RequestId string
|
|
1090
|
+
UpdatedAt riffdb.Instant
|
|
1091
|
+
OrganizationId string
|
|
1092
|
+
ExpectedRevision uint64
|
|
1093
|
+
ExternalAccountId string
|
|
1094
|
+
}
|
|
1095
|
+
type UpdateCredentialPasswordOutcome interface { isUpdateCredentialPasswordOutcome() }
|
|
1096
|
+
type UpdateCredentialPasswordPasswordAccountStale struct {
|
|
1097
|
+
Outcome string
|
|
1098
|
+
}
|
|
1099
|
+
func (UpdateCredentialPasswordPasswordAccountStale) isUpdateCredentialPasswordOutcome() {}
|
|
1100
|
+
func IsUpdateCredentialPasswordPasswordAccountStale(value UpdateCredentialPasswordOutcome) (UpdateCredentialPasswordPasswordAccountStale, bool) { branch, ok := value.(UpdateCredentialPasswordPasswordAccountStale); return branch, ok }
|
|
1101
|
+
|
|
1102
|
+
type UpdateCredentialPasswordPasswordAccountMissing struct {
|
|
1103
|
+
Outcome string
|
|
1104
|
+
}
|
|
1105
|
+
func (UpdateCredentialPasswordPasswordAccountMissing) isUpdateCredentialPasswordOutcome() {}
|
|
1106
|
+
func IsUpdateCredentialPasswordPasswordAccountMissing(value UpdateCredentialPasswordOutcome) (UpdateCredentialPasswordPasswordAccountMissing, bool) { branch, ok := value.(UpdateCredentialPasswordPasswordAccountMissing); return branch, ok }
|
|
1107
|
+
|
|
1108
|
+
type UpdateCredentialPasswordPasswordProviderMismatch struct {
|
|
1109
|
+
Outcome string
|
|
1110
|
+
}
|
|
1111
|
+
func (UpdateCredentialPasswordPasswordProviderMismatch) isUpdateCredentialPasswordOutcome() {}
|
|
1112
|
+
func IsUpdateCredentialPasswordPasswordProviderMismatch(value UpdateCredentialPasswordOutcome) (UpdateCredentialPasswordPasswordProviderMismatch, bool) { branch, ok := value.(UpdateCredentialPasswordPasswordProviderMismatch); return branch, ok }
|
|
1113
|
+
|
|
1114
|
+
type UpdateCredentialPasswordCredentialPasswordUpdated struct {
|
|
1115
|
+
Outcome string
|
|
1116
|
+
}
|
|
1117
|
+
func (UpdateCredentialPasswordCredentialPasswordUpdated) isUpdateCredentialPasswordOutcome() {}
|
|
1118
|
+
func IsUpdateCredentialPasswordCredentialPasswordUpdated(value UpdateCredentialPasswordOutcome) (UpdateCredentialPasswordCredentialPasswordUpdated, bool) { branch, ok := value.(UpdateCredentialPasswordCredentialPasswordUpdated); return branch, ok }
|
|
1119
|
+
|
|
984
1120
|
type UpdateSessionInput struct {
|
|
985
1121
|
UserId string
|
|
986
1122
|
ExpiresAt riffdb.Instant
|
|
@@ -1070,12 +1206,17 @@ func (UpdateVerificationVerificationUpdateMissing) isUpdateVerificationOutcome()
|
|
|
1070
1206
|
func IsUpdateVerificationVerificationUpdateMissing(value UpdateVerificationOutcome) (UpdateVerificationVerificationUpdateMissing, bool) { branch, ok := value.(UpdateVerificationVerificationUpdateMissing); return branch, ok }
|
|
1071
1207
|
|
|
1072
1208
|
const DefaultCommandAttempts uint32 = 3
|
|
1073
|
-
type Client struct { session *riffdb.Session; commandAttempts uint32; readAfterCommit *uint64; trackCausalWrites bool }
|
|
1209
|
+
type Client struct { session *riffdb.Session; commandAttempts uint32; causalMu sync.Mutex; readAfterCommit *uint64; trackCausalWrites bool }
|
|
1074
1210
|
|
|
1075
1211
|
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 }
|
|
1212
|
+
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} }
|
|
1213
|
+
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) }
|
|
1214
|
+
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) }
|
|
1215
|
+
func (client *Client) Close() error { if client == nil || client.session == nil { return nil }; return client.session.Close() }
|
|
1076
1216
|
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} }
|
|
1077
|
-
func (client *Client) CausalSession(initialCommitSequence ...uint64) *Client { var copied *uint64; if len(initialCommitSequence) > 0 { value := initialCommitSequence[0]; copied = &value } else
|
|
1078
|
-
func (client *Client) LastCommitSequence() *uint64 { if client.readAfterCommit == nil { return nil }; value := *client.readAfterCommit; return &value }
|
|
1217
|
+
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} }
|
|
1218
|
+
func (client *Client) LastCommitSequence() *uint64 { client.causalMu.Lock(); defer client.causalMu.Unlock(); if client.readAfterCommit == nil { return nil }; value := *client.readAfterCommit; return &value }
|
|
1219
|
+
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() }
|
|
1079
1220
|
|
|
1080
1221
|
func encodeUser(value User) riffdb.Value { return riffdb.Record(map[string]riffdb.Value{
|
|
1081
1222
|
"name": riffdb.String(value.Name),
|
|
@@ -1200,15 +1341,15 @@ raw, err = requiredField(fields, "organization_id"); if err != nil { return resu
|
|
|
1200
1341
|
raw, err = requiredField(fields, "expected_revision"); if err != nil { return result, err }; result.ExpectedRevision, err = riffdb.U64Value(raw); if err != nil { return result, err }
|
|
1201
1342
|
return result, nil }
|
|
1202
1343
|
|
|
1203
|
-
const AdminUsersAllEmailAscQueryPlanHash = "
|
|
1204
|
-
var AdminUsersAllEmailAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_all_email_asc", InputSchemaHash: "
|
|
1344
|
+
const AdminUsersAllEmailAscQueryPlanHash = "056edbaabe43e1dc95f1f6af9838747f54d927a90d5bc9f2be045ae266d107d3"
|
|
1345
|
+
var AdminUsersAllEmailAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_all_email_asc", InputSchemaHash: "6f126f498c06a6648d15a6403e27e29890892d64f010ef3d89b3470124ebdd5f"}
|
|
1205
1346
|
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 {
|
|
1206
1347
|
case "Found": result := AdminUsersAllEmailAscFound{Outcome: outcome}
|
|
1207
1348
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1208
1349
|
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 }
|
|
1209
1350
|
return result, nil
|
|
1210
1351
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1211
|
-
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
|
|
1352
|
+
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{}
|
|
1212
1353
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersAllEmailAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1213
1354
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1214
1355
|
input["minimum_email"] = riffdb.String(parameters.MinimumEmail)
|
|
@@ -1218,15 +1359,15 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1218
1359
|
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 }
|
|
1219
1360
|
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) }
|
|
1220
1361
|
|
|
1221
|
-
const AdminUsersContainsAscQueryPlanHash = "
|
|
1222
|
-
var AdminUsersContainsAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_contains_asc", InputSchemaHash: "
|
|
1362
|
+
const AdminUsersContainsAscQueryPlanHash = "b64d213477dd2275d98422a6c3460b0cae932dd96255fe9d565005e8afa37fc4"
|
|
1363
|
+
var AdminUsersContainsAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_contains_asc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1223
1364
|
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 {
|
|
1224
1365
|
case "Found": result := AdminUsersContainsAscFound{Outcome: outcome}
|
|
1225
1366
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1226
1367
|
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 }
|
|
1227
1368
|
return result, nil
|
|
1228
1369
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1229
|
-
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
|
|
1370
|
+
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{}
|
|
1230
1371
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersContainsAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1231
1372
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1232
1373
|
input["needle"] = riffdb.String(parameters.Needle)
|
|
@@ -1236,15 +1377,15 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1236
1377
|
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 }
|
|
1237
1378
|
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) }
|
|
1238
1379
|
|
|
1239
|
-
const AdminUsersContainsDescQueryPlanHash = "
|
|
1240
|
-
var AdminUsersContainsDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_contains_desc", InputSchemaHash: "
|
|
1380
|
+
const AdminUsersContainsDescQueryPlanHash = "57aba8cf311c301e985adc324f97b4d963a38e6efa6058a82e248854d75f2f05"
|
|
1381
|
+
var AdminUsersContainsDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_contains_desc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1241
1382
|
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 {
|
|
1242
1383
|
case "Found": result := AdminUsersContainsDescFound{Outcome: outcome}
|
|
1243
1384
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1244
1385
|
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 }
|
|
1245
1386
|
return result, nil
|
|
1246
1387
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1247
|
-
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
|
|
1388
|
+
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{}
|
|
1248
1389
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersContainsDescResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1249
1390
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1250
1391
|
input["needle"] = riffdb.String(parameters.Needle)
|
|
@@ -1254,15 +1395,15 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1254
1395
|
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 }
|
|
1255
1396
|
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) }
|
|
1256
1397
|
|
|
1257
|
-
const AdminUsersEmailContainsCreatedDescQueryPlanHash = "
|
|
1258
|
-
var AdminUsersEmailContainsCreatedDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_email_contains_created_desc", InputSchemaHash: "
|
|
1398
|
+
const AdminUsersEmailContainsCreatedDescQueryPlanHash = "7aede9eda624f5b4eb4280ca7b8a1421466ce30091177c9abab4f125987eb4ff"
|
|
1399
|
+
var AdminUsersEmailContainsCreatedDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_email_contains_created_desc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1259
1400
|
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 {
|
|
1260
1401
|
case "Found": result := AdminUsersEmailContainsCreatedDescFound{Outcome: outcome}
|
|
1261
1402
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1262
1403
|
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 }
|
|
1263
1404
|
return result, nil
|
|
1264
1405
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1265
|
-
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
|
|
1406
|
+
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{}
|
|
1266
1407
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersEmailContainsCreatedDescResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1267
1408
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1268
1409
|
input["needle"] = riffdb.String(parameters.Needle)
|
|
@@ -1272,15 +1413,15 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1272
1413
|
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 }
|
|
1273
1414
|
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) }
|
|
1274
1415
|
|
|
1275
|
-
const AdminUsersEmailContainsImageAscQueryPlanHash = "
|
|
1276
|
-
var AdminUsersEmailContainsImageAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_email_contains_image_asc", InputSchemaHash: "
|
|
1416
|
+
const AdminUsersEmailContainsImageAscQueryPlanHash = "453cb6c81f506a1f0ac99bed3cc85da59176d2cb83597d5812d771683a60cb4c"
|
|
1417
|
+
var AdminUsersEmailContainsImageAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_email_contains_image_asc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1277
1418
|
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 {
|
|
1278
1419
|
case "Found": result := AdminUsersEmailContainsImageAscFound{Outcome: outcome}
|
|
1279
1420
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1280
1421
|
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 }
|
|
1281
1422
|
return result, nil
|
|
1282
1423
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1283
|
-
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
|
|
1424
|
+
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{}
|
|
1284
1425
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersEmailContainsImageAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1285
1426
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1286
1427
|
input["needle"] = riffdb.String(parameters.Needle)
|
|
@@ -1290,15 +1431,15 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1290
1431
|
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 }
|
|
1291
1432
|
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) }
|
|
1292
1433
|
|
|
1293
|
-
const AdminUsersEndsWithAscQueryPlanHash = "
|
|
1294
|
-
var AdminUsersEndsWithAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_ends_with_asc", InputSchemaHash: "
|
|
1434
|
+
const AdminUsersEndsWithAscQueryPlanHash = "924c7acfdcf3f7970917ac611b6eafc9175ac69f735d9e1cc01414fcc6f0e696"
|
|
1435
|
+
var AdminUsersEndsWithAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_ends_with_asc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1295
1436
|
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 {
|
|
1296
1437
|
case "Found": result := AdminUsersEndsWithAscFound{Outcome: outcome}
|
|
1297
1438
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1298
1439
|
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 }
|
|
1299
1440
|
return result, nil
|
|
1300
1441
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1301
|
-
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
|
|
1442
|
+
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{}
|
|
1302
1443
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersEndsWithAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1303
1444
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1304
1445
|
input["needle"] = riffdb.String(parameters.Needle)
|
|
@@ -1308,15 +1449,15 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1308
1449
|
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 }
|
|
1309
1450
|
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) }
|
|
1310
1451
|
|
|
1311
|
-
const AdminUsersEndsWithDescQueryPlanHash = "
|
|
1312
|
-
var AdminUsersEndsWithDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_ends_with_desc", InputSchemaHash: "
|
|
1452
|
+
const AdminUsersEndsWithDescQueryPlanHash = "cab8ad8456533e4ce97388948e4f703cac6f2eebb641b83a91c3b005ece7fffb"
|
|
1453
|
+
var AdminUsersEndsWithDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_ends_with_desc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1313
1454
|
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 {
|
|
1314
1455
|
case "Found": result := AdminUsersEndsWithDescFound{Outcome: outcome}
|
|
1315
1456
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1316
1457
|
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 }
|
|
1317
1458
|
return result, nil
|
|
1318
1459
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1319
|
-
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
|
|
1460
|
+
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{}
|
|
1320
1461
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersEndsWithDescResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1321
1462
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1322
1463
|
input["needle"] = riffdb.String(parameters.Needle)
|
|
@@ -1326,15 +1467,15 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1326
1467
|
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 }
|
|
1327
1468
|
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) }
|
|
1328
1469
|
|
|
1329
|
-
const AdminUsersStartsWithAscQueryPlanHash = "
|
|
1330
|
-
var AdminUsersStartsWithAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_starts_with_asc", InputSchemaHash: "
|
|
1470
|
+
const AdminUsersStartsWithAscQueryPlanHash = "add0aed3dbd0caea0de2857133a857d49eb7bfc0e031d117270cc873137da5ec"
|
|
1471
|
+
var AdminUsersStartsWithAscOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_starts_with_asc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1331
1472
|
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 {
|
|
1332
1473
|
case "Found": result := AdminUsersStartsWithAscFound{Outcome: outcome}
|
|
1333
1474
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1334
1475
|
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 }
|
|
1335
1476
|
return result, nil
|
|
1336
1477
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1337
|
-
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
|
|
1478
|
+
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{}
|
|
1338
1479
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersStartsWithAscResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1339
1480
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1340
1481
|
input["needle"] = riffdb.String(parameters.Needle)
|
|
@@ -1344,15 +1485,15 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1344
1485
|
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 }
|
|
1345
1486
|
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) }
|
|
1346
1487
|
|
|
1347
|
-
const AdminUsersStartsWithDescQueryPlanHash = "
|
|
1348
|
-
var AdminUsersStartsWithDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_starts_with_desc", InputSchemaHash: "
|
|
1488
|
+
const AdminUsersStartsWithDescQueryPlanHash = "23c1561fb3956217e79d1b358be468e55c4021b887e927a4fb3c0484c92be872"
|
|
1489
|
+
var AdminUsersStartsWithDescOperation = riffdb.Operation{Name: "riffdb_better_auth_core_admin_users_starts_with_desc", InputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b"}
|
|
1349
1490
|
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 {
|
|
1350
1491
|
case "Found": result := AdminUsersStartsWithDescFound{Outcome: outcome}
|
|
1351
1492
|
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 }, error) { return func() (struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *string; CreatedAt riffdb.Instant; UpdatedAt riffdb.Instant; Revision uint64 }, 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 }{}, err }; var result struct { OrganizationId string; UserId string; Name string; Email string; EmailVerified bool; Image *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, "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 }; return result, nil }() }); if err != nil { return nil, err }
|
|
1352
1493
|
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 }
|
|
1353
1494
|
return result, nil
|
|
1354
1495
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1355
|
-
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
|
|
1496
|
+
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{}
|
|
1356
1497
|
if parameters.Limit != nil && (*parameters.Limit == 0 || uint64(*parameters.Limit) > 100) { return QueryResult[AdminUsersStartsWithDescResult]{}, errors.New("limit must be from 1 through 100") }
|
|
1357
1498
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1358
1499
|
input["needle"] = riffdb.String(parameters.Needle)
|
|
@@ -1362,41 +1503,41 @@ if parameters.Offset != nil { input["offset"] = riffdb.U64(*parameters.Offset) }
|
|
|
1362
1503
|
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 }
|
|
1363
1504
|
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) }
|
|
1364
1505
|
|
|
1365
|
-
const FindAccountByIdQueryPlanHash = "
|
|
1506
|
+
const FindAccountByIdQueryPlanHash = "14a08df3dd8a74ea0a5622804bf0c2424086ee73eb10ce57d7df336a7d25f5ba"
|
|
1366
1507
|
var FindAccountByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_account_by_id", InputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc"}
|
|
1367
1508
|
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 {
|
|
1368
1509
|
case "Found": result := FindAccountByIdFound{Outcome: outcome}
|
|
1369
1510
|
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 }
|
|
1370
1511
|
return result, nil
|
|
1371
1512
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1372
|
-
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
|
|
1513
|
+
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{}
|
|
1373
1514
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1374
1515
|
input["id"] = riffdb.UUID(parameters.Id)
|
|
1375
1516
|
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 }
|
|
1376
1517
|
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) }
|
|
1377
1518
|
|
|
1378
|
-
const FindAccountByProviderQueryPlanHash = "
|
|
1519
|
+
const FindAccountByProviderQueryPlanHash = "e6c4517a46d725780e79725ca3fdaba2208ef4b282d49f484121eee76c043831"
|
|
1379
1520
|
var FindAccountByProviderOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_account_by_provider", InputSchemaHash: "7e48e77594d132efa4753eee93934c2ef61f6d82313edff8f7c84c7d8d4112f2"}
|
|
1380
1521
|
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 {
|
|
1381
1522
|
case "Found": result := FindAccountByProviderFound{Outcome: outcome}
|
|
1382
1523
|
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 }
|
|
1383
1524
|
return result, nil
|
|
1384
1525
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1385
|
-
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
|
|
1526
|
+
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{}
|
|
1386
1527
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1387
1528
|
input["account_id"] = riffdb.String(parameters.AccountId)
|
|
1388
1529
|
input["provider_id"] = riffdb.String(parameters.ProviderId)
|
|
1389
1530
|
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 }
|
|
1390
1531
|
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) }
|
|
1391
1532
|
|
|
1392
|
-
const FindAccountsByUserIdQueryPlanHash = "
|
|
1533
|
+
const FindAccountsByUserIdQueryPlanHash = "ccdc524ca64ad667c209de25b4ce977f43b53ffdd8eb1b70fedf29fc99f27da6"
|
|
1393
1534
|
var FindAccountsByUserIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_accounts_by_user_id", InputSchemaHash: "52291caa82b70870673211137e93f3ecda460cbe7b9fc465f0b9d7f30df05798"}
|
|
1394
1535
|
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 {
|
|
1395
1536
|
case "Found": result := FindAccountsByUserIdFound{Outcome: outcome}
|
|
1396
1537
|
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 }
|
|
1397
1538
|
return result, nil
|
|
1398
1539
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1399
|
-
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
|
|
1540
|
+
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{}
|
|
1400
1541
|
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindAccountsByUserIdResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1401
1542
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1402
1543
|
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
@@ -1404,14 +1545,14 @@ response, err := client.session.Invoke(ctx, FindAccountsByUserIdOperation, input
|
|
|
1404
1545
|
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) }
|
|
1405
1546
|
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 }
|
|
1406
1547
|
|
|
1407
|
-
const FindAccountsByUserProviderQueryPlanHash = "
|
|
1548
|
+
const FindAccountsByUserProviderQueryPlanHash = "21d13b3c30b4a4059f3c436e290d11c20f0f1d1154e05fb48ae3dd0da882526d"
|
|
1408
1549
|
var FindAccountsByUserProviderOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_accounts_by_user_provider", InputSchemaHash: "f389d8fa7caa4fcb96e1004158f88ce43ae9bccac48b8bf74087eab48c022df7"}
|
|
1409
1550
|
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 {
|
|
1410
1551
|
case "Found": result := FindAccountsByUserProviderFound{Outcome: outcome}
|
|
1411
1552
|
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 }
|
|
1412
1553
|
return result, nil
|
|
1413
1554
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1414
|
-
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
|
|
1555
|
+
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{}
|
|
1415
1556
|
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindAccountsByUserProviderResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1416
1557
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1417
1558
|
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
@@ -1420,14 +1561,14 @@ response, err := client.session.Invoke(ctx, FindAccountsByUserProviderOperation,
|
|
|
1420
1561
|
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) }
|
|
1421
1562
|
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 }
|
|
1422
1563
|
|
|
1423
|
-
const FindActiveSessionsByUserIdQueryPlanHash = "
|
|
1564
|
+
const FindActiveSessionsByUserIdQueryPlanHash = "de1e5232a64a32057699b5ac21f1b43e69d755a3c143595f906fe63e16147264"
|
|
1424
1565
|
var FindActiveSessionsByUserIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_active_sessions_by_user_id", InputSchemaHash: "56f77f3deba14d9fd74810cf14012109ddc4ba2f58c27a400a180df31ee38feb"}
|
|
1425
1566
|
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 {
|
|
1426
1567
|
case "Found": result := FindActiveSessionsByUserIdFound{Outcome: outcome}
|
|
1427
1568
|
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 }
|
|
1428
1569
|
return result, nil
|
|
1429
1570
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1430
|
-
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
|
|
1571
|
+
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{}
|
|
1431
1572
|
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindActiveSessionsByUserIdResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1432
1573
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1433
1574
|
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
@@ -1436,14 +1577,29 @@ response, err := client.session.Invoke(ctx, FindActiveSessionsByUserIdOperation,
|
|
|
1436
1577
|
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) }
|
|
1437
1578
|
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 }
|
|
1438
1579
|
|
|
1439
|
-
const
|
|
1580
|
+
const FindCredentialAccountQueryPlanHash = "f968271d103a76cc6b2a5496f5cceffe4cff5aa39d2a370379b518d8e7d90771"
|
|
1581
|
+
var FindCredentialAccountOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_credential_account", InputSchemaHash: "108a21aa464170aff1274c8f9af12f9c84d899483e63eb62f4fc9bed6e4fc040"}
|
|
1582
|
+
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 {
|
|
1583
|
+
case "Found": result := FindCredentialAccountFound{Outcome: outcome}
|
|
1584
|
+
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 }
|
|
1585
|
+
return result, nil
|
|
1586
|
+
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1587
|
+
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{}
|
|
1588
|
+
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1589
|
+
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
1590
|
+
input["account_id"] = riffdb.String(parameters.AccountId)
|
|
1591
|
+
input["provider_id"] = riffdb.String(parameters.ProviderId)
|
|
1592
|
+
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 }
|
|
1593
|
+
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) }
|
|
1594
|
+
|
|
1595
|
+
const FindExpiredVerificationIdsQueryPlanHash = "6c799850ba3b2eb3222aac85a76f40492c46de76870075b029f3b4ac897ed8b9"
|
|
1440
1596
|
var FindExpiredVerificationIdsOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_expired_verification_ids", InputSchemaHash: "b2397d3409885ae750a1d8b4d53bc6905e59348dfc79f0b4d2934981ad4cb1b2"}
|
|
1441
1597
|
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 {
|
|
1442
1598
|
case "Found": result := FindExpiredVerificationIdsFound{Outcome: outcome}
|
|
1443
1599
|
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 }
|
|
1444
1600
|
return result, nil
|
|
1445
1601
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1446
|
-
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
|
|
1602
|
+
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{}
|
|
1447
1603
|
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindExpiredVerificationIdsResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1448
1604
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1449
1605
|
input["expires_before"] = riffdb.TimestampFrom(parameters.ExpiresBefore)
|
|
@@ -1451,66 +1607,68 @@ response, err := client.session.Invoke(ctx, FindExpiredVerificationIdsOperation,
|
|
|
1451
1607
|
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) }
|
|
1452
1608
|
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 }
|
|
1453
1609
|
|
|
1454
|
-
const FindLatestVerificationQueryPlanHash = "
|
|
1610
|
+
const FindLatestVerificationQueryPlanHash = "b3832c0a8a316d3fcbc62b388fbe09ceb6624b55482195f7642553467cba6fcb"
|
|
1455
1611
|
var FindLatestVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_latest_verification", InputSchemaHash: "414c00deb31dd873e434c8006a8caa9d2b360457abe0f8269440d6c761dfdc94"}
|
|
1456
1612
|
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 {
|
|
1457
1613
|
case "Found": result := FindLatestVerificationFound{Outcome: outcome}
|
|
1458
1614
|
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 }
|
|
1459
1615
|
return result, nil
|
|
1460
1616
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1461
|
-
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
|
|
1617
|
+
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{}
|
|
1462
1618
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1463
1619
|
input["identifier"] = riffdb.String(parameters.Identifier)
|
|
1464
1620
|
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 }
|
|
1465
1621
|
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) }
|
|
1466
1622
|
|
|
1467
|
-
const FindSessionByIdQueryPlanHash = "
|
|
1623
|
+
const FindSessionByIdQueryPlanHash = "c92eb2035c0e3ca7dedbaa42a4e2efe7bc4786a65213394da7f5d3beb579a2a1"
|
|
1468
1624
|
var FindSessionByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_session_by_id", InputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc"}
|
|
1469
1625
|
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 {
|
|
1470
1626
|
case "Found": result := FindSessionByIdFound{Outcome: outcome}
|
|
1471
1627
|
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 }
|
|
1472
1628
|
return result, nil
|
|
1473
1629
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1474
|
-
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
|
|
1630
|
+
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{}
|
|
1475
1631
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1476
1632
|
input["id"] = riffdb.UUID(parameters.Id)
|
|
1477
1633
|
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 }
|
|
1478
1634
|
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) }
|
|
1479
1635
|
|
|
1480
|
-
const FindSessionByTokenQueryPlanHash = "
|
|
1636
|
+
const FindSessionByTokenQueryPlanHash = "a8a12334a3d34c30d54be828bdcc9b9b77223303c3f9681e4a602c92341876ec"
|
|
1481
1637
|
var FindSessionByTokenOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_session_by_token", InputSchemaHash: "0ff142e840e9d2d322c37be4688526fc1348f508cc4976856bd7e4d2570859e8"}
|
|
1482
1638
|
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 {
|
|
1483
1639
|
case "Found": result := FindSessionByTokenFound{Outcome: outcome}
|
|
1484
1640
|
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 }
|
|
1485
1641
|
return result, nil
|
|
1486
1642
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1487
|
-
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
|
|
1643
|
+
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{}
|
|
1488
1644
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1489
1645
|
input["token"] = riffdb.String(parameters.Token)
|
|
1490
1646
|
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 }
|
|
1491
1647
|
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) }
|
|
1492
1648
|
|
|
1493
|
-
const FindSessionsByTokenSetQueryPlanHash = "
|
|
1649
|
+
const FindSessionsByTokenSetQueryPlanHash = "7e23187b537599c4c2361d34ea866b5b719f63feda0135587b5ec6afd5ce62f6"
|
|
1650
|
+
const FindSessionsByTokenSetTokensMaxItems = 32
|
|
1494
1651
|
var FindSessionsByTokenSetOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_sessions_by_token_set", InputSchemaHash: "6e07645237cd913d73a45bd7f863e3ca8d9ae09fdfecdb7494246fa80dea3899"}
|
|
1495
1652
|
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 {
|
|
1496
1653
|
case "Found": result := FindSessionsByTokenSetFound{Outcome: outcome}
|
|
1497
1654
|
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 }
|
|
1498
1655
|
return result, nil
|
|
1499
1656
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1500
|
-
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
|
|
1657
|
+
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{}
|
|
1501
1658
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1502
1659
|
input["tokens"] = riffdb.Values(parameters.Tokens, func(item string) riffdb.Value { return riffdb.String(item) })
|
|
1503
1660
|
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 }
|
|
1504
1661
|
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) }
|
|
1662
|
+
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 }
|
|
1505
1663
|
|
|
1506
|
-
const FindSessionsByUserIdQueryPlanHash = "
|
|
1664
|
+
const FindSessionsByUserIdQueryPlanHash = "a3277546d8b0c0059b850c368ae4925000c255e69b7ff005f4b3d2ef61b504af"
|
|
1507
1665
|
var FindSessionsByUserIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_sessions_by_user_id", InputSchemaHash: "52291caa82b70870673211137e93f3ecda460cbe7b9fc465f0b9d7f30df05798"}
|
|
1508
1666
|
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 {
|
|
1509
1667
|
case "Found": result := FindSessionsByUserIdFound{Outcome: outcome}
|
|
1510
1668
|
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 }
|
|
1511
1669
|
return result, nil
|
|
1512
1670
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1513
|
-
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
|
|
1671
|
+
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{}
|
|
1514
1672
|
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindSessionsByUserIdResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1515
1673
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1516
1674
|
input["user_id"] = riffdb.UUID(parameters.UserId)
|
|
@@ -1518,7 +1676,7 @@ response, err := client.session.Invoke(ctx, FindSessionsByUserIdOperation, input
|
|
|
1518
1676
|
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) }
|
|
1519
1677
|
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 }
|
|
1520
1678
|
|
|
1521
|
-
const FindUserByEmailQueryPlanHash = "
|
|
1679
|
+
const FindUserByEmailQueryPlanHash = "b167b8cb2fb5ce19685491b47da4e816665b840e0f0e463666f6302134472b9a"
|
|
1522
1680
|
var FindUserByEmailOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_user_by_email", InputSchemaHash: "7d3b1da87ea1ee59893e110cd8f8a5eacb522a8fde24a7e8aa9b7c13340990b9"}
|
|
1523
1681
|
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 {
|
|
1524
1682
|
case "Found": result := FindUserByEmailFound{Outcome: outcome}
|
|
@@ -1535,13 +1693,13 @@ row.Revision, err = riffdb.U64Value(rawRow[5]); if err != nil { return nil, err
|
|
|
1535
1693
|
row.UpdatedAt, err = riffdb.TimestampValue(rawRow[6]); if err != nil { return nil, err }
|
|
1536
1694
|
row.UserId, err = riffdb.UUIDValue(rawRow[7]); if err != nil { return nil, err }
|
|
1537
1695
|
rows = append(rows, row) }; return FindUserByEmailFound{Outcome: "Found", Users: rows}, nil }
|
|
1538
|
-
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
|
|
1696
|
+
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{}
|
|
1539
1697
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1540
1698
|
input["email"] = riffdb.String(parameters.Email)
|
|
1541
1699
|
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 }
|
|
1542
1700
|
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) }
|
|
1543
1701
|
|
|
1544
|
-
const FindUserByIdQueryPlanHash = "
|
|
1702
|
+
const FindUserByIdQueryPlanHash = "25d4a0a77d5df64ab6187528f9fac6b205a03c33e01c9ea6b573e8316b78b924"
|
|
1545
1703
|
var FindUserByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_user_by_id", InputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc"}
|
|
1546
1704
|
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 {
|
|
1547
1705
|
case "Found": result := FindUserByIdFound{Outcome: outcome}
|
|
@@ -1550,13 +1708,13 @@ return result, nil
|
|
|
1550
1708
|
case "Missing": result := FindUserByIdMissing{Outcome: outcome}
|
|
1551
1709
|
return result, nil
|
|
1552
1710
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1553
|
-
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
|
|
1711
|
+
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{}
|
|
1554
1712
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1555
1713
|
input["id"] = riffdb.UUID(parameters.Id)
|
|
1556
1714
|
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 }
|
|
1557
1715
|
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) }
|
|
1558
1716
|
|
|
1559
|
-
const FindVerificationByIdQueryPlanHash = "
|
|
1717
|
+
const FindVerificationByIdQueryPlanHash = "54f07c7eba7d51857dd6473e39304dc798bf7084ca946dfa7f0203633a5133ac"
|
|
1560
1718
|
var FindVerificationByIdOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_verification_by_id", InputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc"}
|
|
1561
1719
|
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 {
|
|
1562
1720
|
case "Found": result := FindVerificationByIdFound{Outcome: outcome}
|
|
@@ -1565,20 +1723,20 @@ return result, nil
|
|
|
1565
1723
|
case "Missing": result := FindVerificationByIdMissing{Outcome: outcome}
|
|
1566
1724
|
return result, nil
|
|
1567
1725
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1568
|
-
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
|
|
1726
|
+
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{}
|
|
1569
1727
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1570
1728
|
input["id"] = riffdb.UUID(parameters.Id)
|
|
1571
1729
|
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 }
|
|
1572
1730
|
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) }
|
|
1573
1731
|
|
|
1574
|
-
const FindVerificationsByIdentifierQueryPlanHash = "
|
|
1732
|
+
const FindVerificationsByIdentifierQueryPlanHash = "4c768ae1d966454e9b791cd57a6311476947b5c457020943a50bc3cfee90765b"
|
|
1575
1733
|
var FindVerificationsByIdentifierOperation = riffdb.Operation{Name: "riffdb_better_auth_core_find_verifications_by_identifier", InputSchemaHash: "f61c6a3fd1f9b7496a437e77f166f72e9c36d27d832811ac96f146fa2999cc37"}
|
|
1576
1734
|
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 {
|
|
1577
1735
|
case "Found": result := FindVerificationsByIdentifierFound{Outcome: outcome}
|
|
1578
1736
|
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 }
|
|
1579
1737
|
return result, nil
|
|
1580
1738
|
default: return nil, errors.New("RiffDB driver returned unknown query outcome") } }
|
|
1581
|
-
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
|
|
1739
|
+
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{}
|
|
1582
1740
|
if parameters.After != nil { if options.Cursor != "" { return QueryResult[FindVerificationsByIdentifierResult]{}, errors.New("generated cursor conflicts with query options") }; options.Cursor = *parameters.After }
|
|
1583
1741
|
input["organization_id"] = riffdb.UUID(parameters.OrganizationId)
|
|
1584
1742
|
input["identifier"] = riffdb.String(parameters.Identifier)
|
|
@@ -1606,8 +1764,9 @@ return result, nil
|
|
|
1606
1764
|
case "VerificationConsumeMissing": result := ConsumeVerificationVerificationConsumeMissing{Outcome: outcome}
|
|
1607
1765
|
return result, nil
|
|
1608
1766
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1609
|
-
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 };
|
|
1610
|
-
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 }; 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 }
|
|
1767
|
+
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 }
|
|
1768
|
+
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 }
|
|
1769
|
+
|
|
1611
1770
|
|
|
1612
1771
|
const ConsumeVerificationSetPlanHash = "cc5e0d69851c61f11bbbca45ad00bec80b32687a94272379e133fbf854d59780"
|
|
1613
1772
|
var ConsumeVerificationSetOperation = riffdb.Operation{Name: "riffdb_better_auth_core_consume_verification_set", InputSchemaHash: "ce88d8052f760625503f8a732f9813446ef7cc042d726ee1826c05c437c0929c"}
|
|
@@ -1623,8 +1782,29 @@ return result, nil
|
|
|
1623
1782
|
case "VerificationConsumeMissing": result := ConsumeVerificationSetVerificationConsumeMissing{Outcome: outcome}
|
|
1624
1783
|
return result, nil
|
|
1625
1784
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1626
|
-
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 };
|
|
1627
|
-
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 }; 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 }
|
|
1785
|
+
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 }
|
|
1786
|
+
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 }
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
const ConsumeVerificationSnapshotPlanHash = "1a80a36f34b4699c972fc1e6f48cad3f85da54e202831a6986aea084db09788b"
|
|
1790
|
+
var ConsumeVerificationSnapshotOperation = riffdb.Operation{Name: "riffdb_better_auth_core_consume_verification_snapshot", InputSchemaHash: "d1ae264c5794d32e6619f9d52b77dd3a4cab39615dd48adb9a2a3b46ff92cd8c"}
|
|
1791
|
+
func encodeConsumeVerificationSnapshotInput(input ConsumeVerificationSnapshotInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
1792
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
1793
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
1794
|
+
"verification_id": riffdb.UUID(input.VerificationId),
|
|
1795
|
+
"expected_revision": riffdb.U64(input.ExpectedRevision),
|
|
1796
|
+
} }
|
|
1797
|
+
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 {
|
|
1798
|
+
case "VerificationConsumed": result := ConsumeVerificationSnapshotVerificationConsumed{Outcome: outcome}
|
|
1799
|
+
return result, nil
|
|
1800
|
+
case "VerificationConsumeStale": result := ConsumeVerificationSnapshotVerificationConsumeStale{Outcome: outcome}
|
|
1801
|
+
return result, nil
|
|
1802
|
+
case "VerificationConsumeMissing": result := ConsumeVerificationSnapshotVerificationConsumeMissing{Outcome: outcome}
|
|
1803
|
+
return result, nil
|
|
1804
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1805
|
+
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 }
|
|
1806
|
+
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 }
|
|
1807
|
+
|
|
1628
1808
|
|
|
1629
1809
|
const CreateAccountPlanHash = "53f2e7b330780eb514a299ceb673da4f1eeaea81beb45253267a52e41a7fd0b2"
|
|
1630
1810
|
var CreateAccountOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_account", InputSchemaHash: "9f59abcc35f23822a34f3504905acaae3df3c62c0f60e6bcb65bd8768279c4f9"}
|
|
@@ -1653,8 +1833,9 @@ return result, nil
|
|
|
1653
1833
|
case "AccountAlreadyExists": result := CreateAccountAccountAlreadyExists{Outcome: outcome}
|
|
1654
1834
|
return result, nil
|
|
1655
1835
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1656
|
-
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 };
|
|
1657
|
-
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 }; 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 }
|
|
1836
|
+
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 }
|
|
1837
|
+
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 }
|
|
1838
|
+
|
|
1658
1839
|
|
|
1659
1840
|
const CreateOAuthUserGraphPlanHash = "a30c6faca9666ff17536e1f4ec35f0306e970430a064e0d72a66adccefad7407"
|
|
1660
1841
|
var CreateOAuthUserGraphOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_o_auth_user_graph", InputSchemaHash: "e7b044ec8cfadc80fc33bc06825e721bc65d5926299b0643cf1f7e4e75cf6f33"}
|
|
@@ -1689,8 +1870,9 @@ return result, nil
|
|
|
1689
1870
|
case "OAuthUserGraphCreated": result := CreateOAuthUserGraphOAuthUserGraphCreated{Outcome: outcome}
|
|
1690
1871
|
return result, nil
|
|
1691
1872
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1692
|
-
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 };
|
|
1693
|
-
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 }; 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 }
|
|
1873
|
+
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 }
|
|
1874
|
+
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 }
|
|
1875
|
+
|
|
1694
1876
|
|
|
1695
1877
|
const CreateSessionPlanHash = "c5e41496adb0a45f87503008fa43da87c6c729674bb1f521625ff16183059050"
|
|
1696
1878
|
var CreateSessionOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_session", InputSchemaHash: "90f15b4cdb6f49df5e37b625173a07170d7975bbb4e8a8d1419071cd4f8a9312"}
|
|
@@ -1714,8 +1896,9 @@ return result, nil
|
|
|
1714
1896
|
case "SessionAlreadyExists": result := CreateSessionSessionAlreadyExists{Outcome: outcome}
|
|
1715
1897
|
return result, nil
|
|
1716
1898
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1717
|
-
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 };
|
|
1718
|
-
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 }; 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 }
|
|
1899
|
+
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 }
|
|
1900
|
+
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 }
|
|
1901
|
+
|
|
1719
1902
|
|
|
1720
1903
|
const CreateSignupGraphPlanHash = "01e4e118b1cc5c3a16c19259284cd0845e8a2e405fc02f81ab9b1fcafc79d0b8"
|
|
1721
1904
|
var CreateSignupGraphOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_signup_graph", InputSchemaHash: "49ab048473688615ee1dd52f54c399de0a8da4accab6a7e8f109b3bdd0937c31"}
|
|
@@ -1753,8 +1936,9 @@ return result, nil
|
|
|
1753
1936
|
case "SignupSessionExists": result := CreateSignupGraphSignupSessionExists{Outcome: outcome}
|
|
1754
1937
|
return result, nil
|
|
1755
1938
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1756
|
-
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 };
|
|
1757
|
-
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 }; 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 }
|
|
1939
|
+
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 }
|
|
1940
|
+
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 }
|
|
1941
|
+
|
|
1758
1942
|
|
|
1759
1943
|
const CreateUserPlanHash = "752d7d404aa418b5c1a08065ce9a8efbb28ab2b62f18969c98a13a06092fd8b3"
|
|
1760
1944
|
var CreateUserOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_user", InputSchemaHash: "797c4a05358287284cac08b3b955bda7d19f1fb1fd7d682d3daf07b12d64ea2a"}
|
|
@@ -1775,8 +1959,9 @@ return result, nil
|
|
|
1775
1959
|
case "UserAlreadyExists": result := CreateUserUserAlreadyExists{Outcome: outcome}
|
|
1776
1960
|
return result, nil
|
|
1777
1961
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1778
|
-
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 };
|
|
1779
|
-
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 }; 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 }
|
|
1962
|
+
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 }
|
|
1963
|
+
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 }
|
|
1964
|
+
|
|
1780
1965
|
|
|
1781
1966
|
const CreateVerificationPlanHash = "82bce005457b1fcf1d069a69304f7bf4e2eeb7d2718d5289dc9d25e197309e35"
|
|
1782
1967
|
var CreateVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_create_verification", InputSchemaHash: "1df4414485ef2e463cee868bb97850b7a189a8c72c6090a650a1a1e0bd96baef"}
|
|
@@ -1796,8 +1981,9 @@ return result, nil
|
|
|
1796
1981
|
case "VerificationAlreadyExists": result := CreateVerificationVerificationAlreadyExists{Outcome: outcome}
|
|
1797
1982
|
return result, nil
|
|
1798
1983
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1799
|
-
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 };
|
|
1800
|
-
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 }; 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 }
|
|
1984
|
+
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 }
|
|
1985
|
+
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 }
|
|
1986
|
+
|
|
1801
1987
|
|
|
1802
1988
|
const DeleteAccountPlanHash = "6429ebe6e70797c57c44a4738c8a511bbe5304e5bf58148dfc0c2721ffaff382"
|
|
1803
1989
|
var DeleteAccountOperation = riffdb.Operation{Name: "riffdb_better_auth_core_delete_account", InputSchemaHash: "8e512e4d77b1ced01a098641ce940e1440a4b63d4c3e2ddad9068a1faf9c2c11"}
|
|
@@ -1814,8 +2000,9 @@ return result, nil
|
|
|
1814
2000
|
case "AccountMissing": result := DeleteAccountAccountMissing{Outcome: outcome}
|
|
1815
2001
|
return result, nil
|
|
1816
2002
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1817
|
-
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 };
|
|
1818
|
-
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 }; 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 }
|
|
2003
|
+
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 }
|
|
2004
|
+
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 }
|
|
2005
|
+
|
|
1819
2006
|
|
|
1820
2007
|
const DeleteSessionPlanHash = "a3901beb6c2d2754fd3d2c64252b6f5059cd1792c0a0560741c94da4668a0524"
|
|
1821
2008
|
var DeleteSessionOperation = riffdb.Operation{Name: "riffdb_better_auth_core_delete_session", InputSchemaHash: "6eeb9f3b452bb70a9b0e955dcb9e9a0115db479f3297a5d3c8b243a6e34974f7"}
|
|
@@ -1832,8 +2019,9 @@ return result, nil
|
|
|
1832
2019
|
case "SessionMissing": result := DeleteSessionSessionMissing{Outcome: outcome}
|
|
1833
2020
|
return result, nil
|
|
1834
2021
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1835
|
-
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 };
|
|
1836
|
-
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 }; 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 }
|
|
2022
|
+
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 }
|
|
2023
|
+
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 }
|
|
2024
|
+
|
|
1837
2025
|
|
|
1838
2026
|
const DeleteUserPlanHash = "f7195857c4f50a68b37ee0f8516c27dd03b08d5cd5ba45f53d9f9345d2f90985"
|
|
1839
2027
|
var DeleteUserOperation = riffdb.Operation{Name: "riffdb_better_auth_core_delete_user", InputSchemaHash: "c128e0333c57f08e3094e68459abbac53483952520e8381c0b79db903c36146d"}
|
|
@@ -1851,8 +2039,9 @@ return result, nil
|
|
|
1851
2039
|
case "DeleteUserCascadeLimitExceeded": result := DeleteUserDeleteUserCascadeLimitExceeded{Outcome: outcome}
|
|
1852
2040
|
return result, nil
|
|
1853
2041
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1854
|
-
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 };
|
|
1855
|
-
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 }; 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 }
|
|
2042
|
+
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 }
|
|
2043
|
+
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 }
|
|
2044
|
+
|
|
1856
2045
|
|
|
1857
2046
|
const DeleteVerificationPlanHash = "bffc0c5ef5ad2b602954492d043e833785ec3f9d6f0520fbc0f933422544ae6a"
|
|
1858
2047
|
var DeleteVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_delete_verification", InputSchemaHash: "ce88d8052f760625503f8a732f9813446ef7cc042d726ee1826c05c437c0929c"}
|
|
@@ -1868,8 +2057,42 @@ return result, nil
|
|
|
1868
2057
|
case "VerificationMissing": result := DeleteVerificationVerificationMissing{Outcome: outcome}
|
|
1869
2058
|
return result, nil
|
|
1870
2059
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1871
|
-
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 };
|
|
1872
|
-
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 }; 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 }
|
|
2060
|
+
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 }
|
|
2061
|
+
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 }
|
|
2062
|
+
|
|
2063
|
+
|
|
2064
|
+
const ResetCredentialPasswordPlanHash = "ed87f267831fb0823b0e9bbf51d7b302a715a95c0cea69faf7922c0e4e7f375e"
|
|
2065
|
+
var ResetCredentialPasswordOperation = riffdb.Operation{Name: "riffdb_better_auth_core_reset_credential_password", InputSchemaHash: "b9959320d1fe50eba09aa488169566453c4ed9a58c27a338455e204b7f0c708d"}
|
|
2066
|
+
func encodeResetCredentialPasswordInput(input ResetCredentialPasswordInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2067
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2068
|
+
"password": riffdb.String(input.Password),
|
|
2069
|
+
"account_id": riffdb.UUID(input.AccountId),
|
|
2070
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2071
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2072
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2073
|
+
"account_revision": riffdb.U64(input.AccountRevision),
|
|
2074
|
+
"verification_ids": riffdb.Values(input.VerificationIds, func(item string) riffdb.Value { return riffdb.UUID(item) }),
|
|
2075
|
+
"external_account_id": riffdb.String(input.ExternalAccountId),
|
|
2076
|
+
"verification_revision": riffdb.U64(input.VerificationRevision),
|
|
2077
|
+
} }
|
|
2078
|
+
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 }
|
|
2079
|
+
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 {
|
|
2080
|
+
case "PasswordAccountStale": result := ResetCredentialPasswordPasswordAccountStale{Outcome: outcome}
|
|
2081
|
+
return result, nil
|
|
2082
|
+
case "PasswordAccountMissing": result := ResetCredentialPasswordPasswordAccountMissing{Outcome: outcome}
|
|
2083
|
+
return result, nil
|
|
2084
|
+
case "CredentialPasswordReset": result := ResetCredentialPasswordCredentialPasswordReset{Outcome: outcome}
|
|
2085
|
+
return result, nil
|
|
2086
|
+
case "PasswordProviderMismatch": result := ResetCredentialPasswordPasswordProviderMismatch{Outcome: outcome}
|
|
2087
|
+
return result, nil
|
|
2088
|
+
case "VerificationConsumeStale": result := ResetCredentialPasswordVerificationConsumeStale{Outcome: outcome}
|
|
2089
|
+
return result, nil
|
|
2090
|
+
case "VerificationConsumeMissing": result := ResetCredentialPasswordVerificationConsumeMissing{Outcome: outcome}
|
|
2091
|
+
return result, nil
|
|
2092
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2093
|
+
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 }
|
|
2094
|
+
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 }
|
|
2095
|
+
|
|
1873
2096
|
|
|
1874
2097
|
const UpdateAccountPlanHash = "1556cd92effd135225904f0313f1cdf146ebe82f72621ebeccb2686c5442b849"
|
|
1875
2098
|
var UpdateAccountOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_account", InputSchemaHash: "f623666040b60333eba3b4b46d5b1fe92158fcade5037f13b8ed0435e5c9471e"}
|
|
@@ -1898,8 +2121,9 @@ return result, nil
|
|
|
1898
2121
|
case "AccountUpdateMissing": result := UpdateAccountAccountUpdateMissing{Outcome: outcome}
|
|
1899
2122
|
return result, nil
|
|
1900
2123
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1901
|
-
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 };
|
|
1902
|
-
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 }; 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 }
|
|
2124
|
+
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 }
|
|
2125
|
+
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 }
|
|
2126
|
+
|
|
1903
2127
|
|
|
1904
2128
|
const UpdateAccountPasswordsPlanHash = "5f18c741b5e9c09203c67b5985af9d034fad670462ecdda32a0a1f031ef288f6"
|
|
1905
2129
|
var UpdateAccountPasswordsOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_account_passwords", InputSchemaHash: "f210cf13f349297bad0bd949bdfbb796e37ea4dfa24b99d6205942afdde0883c"}
|
|
@@ -1920,8 +2144,35 @@ return result, nil
|
|
|
1920
2144
|
case "PasswordProviderMismatch": result := UpdateAccountPasswordsPasswordProviderMismatch{Outcome: outcome}
|
|
1921
2145
|
return result, nil
|
|
1922
2146
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1923
|
-
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 };
|
|
1924
|
-
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 }; 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 }
|
|
2147
|
+
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 }
|
|
2148
|
+
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 }
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
const UpdateCredentialPasswordPlanHash = "08781a68739c705ab6ffe51a0de547605e1a7dd2fd2b8075445d40db923d1f15"
|
|
2152
|
+
var UpdateCredentialPasswordOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_credential_password", InputSchemaHash: "5d4589d948081b8f0d4472fa359bd34ca0c05895eac4e6a99f9015f8f45cc2e7"}
|
|
2153
|
+
func encodeUpdateCredentialPasswordInput(input UpdateCredentialPasswordInput) map[string]riffdb.Value { return map[string]riffdb.Value{
|
|
2154
|
+
"user_id": riffdb.UUID(input.UserId),
|
|
2155
|
+
"password": riffdb.String(input.Password),
|
|
2156
|
+
"account_id": riffdb.UUID(input.AccountId),
|
|
2157
|
+
"request_id": riffdb.UUID(input.RequestId),
|
|
2158
|
+
"updated_at": riffdb.TimestampFrom(input.UpdatedAt),
|
|
2159
|
+
"organization_id": riffdb.UUID(input.OrganizationId),
|
|
2160
|
+
"expected_revision": riffdb.U64(input.ExpectedRevision),
|
|
2161
|
+
"external_account_id": riffdb.String(input.ExternalAccountId),
|
|
2162
|
+
} }
|
|
2163
|
+
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 {
|
|
2164
|
+
case "PasswordAccountStale": result := UpdateCredentialPasswordPasswordAccountStale{Outcome: outcome}
|
|
2165
|
+
return result, nil
|
|
2166
|
+
case "PasswordAccountMissing": result := UpdateCredentialPasswordPasswordAccountMissing{Outcome: outcome}
|
|
2167
|
+
return result, nil
|
|
2168
|
+
case "PasswordProviderMismatch": result := UpdateCredentialPasswordPasswordProviderMismatch{Outcome: outcome}
|
|
2169
|
+
return result, nil
|
|
2170
|
+
case "CredentialPasswordUpdated": result := UpdateCredentialPasswordCredentialPasswordUpdated{Outcome: outcome}
|
|
2171
|
+
return result, nil
|
|
2172
|
+
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
2173
|
+
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 }
|
|
2174
|
+
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 }
|
|
2175
|
+
|
|
1925
2176
|
|
|
1926
2177
|
const UpdateSessionPlanHash = "4c1184c5c0a1f8b8935a8b96204ad839afe84e1752f2ba24cdf63feef4f7ce3a"
|
|
1927
2178
|
var UpdateSessionOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_session", InputSchemaHash: "4dc035dba6c54788232952ebe5eb225c8f1e8e542ea3b20ef188f85fbfb1a1a1"}
|
|
@@ -1944,8 +2195,9 @@ return result, nil
|
|
|
1944
2195
|
case "SessionUpdateMissing": result := UpdateSessionSessionUpdateMissing{Outcome: outcome}
|
|
1945
2196
|
return result, nil
|
|
1946
2197
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1947
|
-
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 };
|
|
1948
|
-
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 }; 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 }
|
|
2198
|
+
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 }
|
|
2199
|
+
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 }
|
|
2200
|
+
|
|
1949
2201
|
|
|
1950
2202
|
const UpdateUserPlanHash = "cd0d3c8108976d4b2413f41fd68791b3e9276a763787f40b82bef17219091194"
|
|
1951
2203
|
var UpdateUserOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_user", InputSchemaHash: "1c26635c0abf32530ed895a1dd615ef00b0a9c9177fafb4adedd7de97f7f5757"}
|
|
@@ -1968,8 +2220,9 @@ return result, nil
|
|
|
1968
2220
|
case "UserUpdateMissing": result := UpdateUserUserUpdateMissing{Outcome: outcome}
|
|
1969
2221
|
return result, nil
|
|
1970
2222
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1971
|
-
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 };
|
|
1972
|
-
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 }; 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 }
|
|
2223
|
+
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 }
|
|
2224
|
+
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 }
|
|
2225
|
+
|
|
1973
2226
|
|
|
1974
2227
|
const UpdateVerificationPlanHash = "b9ea963db584e7fd9dbce1069d982dc0f53ebb06b72b41b060578b284596018f"
|
|
1975
2228
|
var UpdateVerificationOperation = riffdb.Operation{Name: "riffdb_better_auth_core_update_verification", InputSchemaHash: "4377bfd8aba7795661e686fbc5903e8116b2f9eba24bce9fcdd63cd4bb53e8c5"}
|
|
@@ -1990,7 +2243,8 @@ return result, nil
|
|
|
1990
2243
|
case "VerificationUpdateMissing": result := UpdateVerificationVerificationUpdateMissing{Outcome: outcome}
|
|
1991
2244
|
return result, nil
|
|
1992
2245
|
default: return nil, errors.New("RiffDB driver returned unknown command outcome") } }
|
|
1993
|
-
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 };
|
|
1994
|
-
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 }; 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 }
|
|
2246
|
+
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 }
|
|
2247
|
+
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 }
|
|
2248
|
+
|
|
1995
2249
|
|
|
1996
2250
|
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 }
|