@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/rust/client.rs
CHANGED
|
@@ -6,11 +6,11 @@ pub use riffdb_client_rust::QueryOptions;
|
|
|
6
6
|
use riffdb_client_rust::v1::value::Kind as WireKind;
|
|
7
7
|
|
|
8
8
|
use riffdb_client_rust::app_v1;
|
|
9
|
-
pub const QUERY_MODULE_HASH: [u8; 32] = [
|
|
9
|
+
pub const QUERY_MODULE_HASH: [u8; 32] = [0x8d, 0xff, 0x3a, 0x38, 0xf6, 0xc0, 0xa9, 0x15, 0xd7, 0x65, 0x3e, 0x75, 0x71, 0xa2, 0xef, 0x57, 0x95, 0xa8, 0x9b, 0x45, 0x29, 0x90, 0xd7, 0x05, 0xf3, 0x8f, 0xe0, 0xac, 0x93, 0xb5, 0xad, 0x9a];
|
|
10
10
|
pub const CONTRACT_LINEAGE: &str = "RiffDBBetterAuthCore";
|
|
11
11
|
pub const CONTRACT_VERSION: u64 = 1;
|
|
12
12
|
|
|
13
|
-
pub const CONTRACT_BUNDLE_HASH: [u8; 32] = [
|
|
13
|
+
pub const CONTRACT_BUNDLE_HASH: [u8; 32] = [0x74, 0xfd, 0x25, 0x5e, 0xef, 0xcf, 0x04, 0xf0, 0xb0, 0x54, 0xdb, 0xb6, 0xc4, 0xa0, 0xbe, 0xd4, 0x3a, 0x73, 0x12, 0xd8, 0x2f, 0x77, 0x55, 0x68, 0x7c, 0x92, 0x29, 0xee, 0x32, 0x06, 0xdd, 0xfc];
|
|
14
14
|
|
|
15
15
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
16
16
|
pub struct DecimalValue {
|
|
@@ -93,7 +93,7 @@ impl AdminUsersAllEmailAscResult {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
pub const ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
96
|
+
pub const ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH: [u8; 32] = [0x05, 0x6e, 0xdb, 0xaa, 0xbe, 0x43, 0xe1, 0xdc, 0x95, 0xf1, 0xf6, 0xaf, 0x98, 0x38, 0x74, 0x7f, 0x54, 0xd9, 0x27, 0xa9, 0x0d, 0x5b, 0xc9, 0xf2, 0xbe, 0x04, 0x5a, 0xe2, 0x66, 0xd1, 0x07, 0xd3];
|
|
97
97
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
98
98
|
pub struct AdminUsersAllEmailAscQuery(pub AdminUsersAllEmailAscParams);
|
|
99
99
|
impl GeneratedQuery for AdminUsersAllEmailAscQuery {
|
|
@@ -224,7 +224,7 @@ impl AdminUsersContainsAscResult {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
pub const ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
227
|
+
pub const ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH: [u8; 32] = [0xb6, 0x4d, 0x21, 0x34, 0x77, 0xdd, 0x22, 0x75, 0xd9, 0x84, 0x22, 0xa6, 0xc3, 0x46, 0x0b, 0x0c, 0xae, 0x93, 0x2d, 0xd9, 0x62, 0x55, 0xfe, 0x9d, 0x56, 0x50, 0x05, 0xe8, 0xaf, 0xa3, 0x7f, 0xc4];
|
|
228
228
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
229
229
|
pub struct AdminUsersContainsAscQuery(pub AdminUsersContainsAscParams);
|
|
230
230
|
impl GeneratedQuery for AdminUsersContainsAscQuery {
|
|
@@ -355,7 +355,7 @@ impl AdminUsersContainsDescResult {
|
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
pub const ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
358
|
+
pub const ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH: [u8; 32] = [0x57, 0xab, 0xa8, 0xcf, 0x31, 0x1c, 0x30, 0x1e, 0x98, 0x5a, 0xdc, 0x32, 0x4f, 0x97, 0xb4, 0xd9, 0x63, 0xa3, 0x8e, 0x6e, 0xfa, 0x60, 0x58, 0xa8, 0x2e, 0x24, 0x88, 0x54, 0xd7, 0x5f, 0x2f, 0x05];
|
|
359
359
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
360
360
|
pub struct AdminUsersContainsDescQuery(pub AdminUsersContainsDescParams);
|
|
361
361
|
impl GeneratedQuery for AdminUsersContainsDescQuery {
|
|
@@ -486,7 +486,7 @@ impl AdminUsersEmailContainsCreatedDescResult {
|
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
pub const ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
489
|
+
pub const ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH: [u8; 32] = [0x7a, 0xed, 0xe9, 0xed, 0xa6, 0x24, 0xf5, 0xb4, 0xeb, 0x42, 0x80, 0xca, 0x7b, 0x8a, 0x14, 0x21, 0x46, 0x6c, 0xe3, 0x00, 0x91, 0x17, 0x7c, 0x9a, 0xba, 0xb4, 0xf1, 0x25, 0x98, 0x7e, 0xb4, 0xff];
|
|
490
490
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
491
491
|
pub struct AdminUsersEmailContainsCreatedDescQuery(pub AdminUsersEmailContainsCreatedDescParams);
|
|
492
492
|
impl GeneratedQuery for AdminUsersEmailContainsCreatedDescQuery {
|
|
@@ -617,7 +617,7 @@ impl AdminUsersEmailContainsImageAscResult {
|
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
-
pub const ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
620
|
+
pub const ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH: [u8; 32] = [0x45, 0x3c, 0xb6, 0xc8, 0x1f, 0x50, 0x6a, 0x1f, 0x0a, 0xc9, 0x9b, 0xed, 0x3c, 0xc8, 0x5d, 0xa5, 0x91, 0x76, 0xd2, 0xcb, 0x83, 0x59, 0x7d, 0x58, 0x12, 0xd7, 0x71, 0x68, 0x3a, 0x60, 0xcb, 0x4c];
|
|
621
621
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
622
622
|
pub struct AdminUsersEmailContainsImageAscQuery(pub AdminUsersEmailContainsImageAscParams);
|
|
623
623
|
impl GeneratedQuery for AdminUsersEmailContainsImageAscQuery {
|
|
@@ -748,7 +748,7 @@ impl AdminUsersEndsWithAscResult {
|
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
pub const ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
751
|
+
pub const ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH: [u8; 32] = [0x92, 0x4c, 0x7a, 0xcf, 0xdc, 0xf3, 0xf7, 0x97, 0x09, 0x17, 0xac, 0x61, 0x1b, 0x6e, 0xaf, 0xc9, 0x17, 0x5a, 0xc6, 0x9f, 0x73, 0x5d, 0x9e, 0x1c, 0xc0, 0x14, 0x14, 0xfc, 0xc6, 0xf0, 0xe6, 0x96];
|
|
752
752
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
753
753
|
pub struct AdminUsersEndsWithAscQuery(pub AdminUsersEndsWithAscParams);
|
|
754
754
|
impl GeneratedQuery for AdminUsersEndsWithAscQuery {
|
|
@@ -879,7 +879,7 @@ impl AdminUsersEndsWithDescResult {
|
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
881
|
|
|
882
|
-
pub const ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
882
|
+
pub const ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH: [u8; 32] = [0xca, 0xb8, 0xad, 0x84, 0x56, 0x53, 0x3e, 0x4c, 0xe9, 0x73, 0x88, 0x94, 0x8e, 0x4f, 0x70, 0x3c, 0xac, 0x6f, 0x2e, 0xeb, 0xb6, 0x41, 0xb8, 0x3a, 0x91, 0xc3, 0xb0, 0x05, 0xec, 0xe7, 0xff, 0xfb];
|
|
883
883
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
884
884
|
pub struct AdminUsersEndsWithDescQuery(pub AdminUsersEndsWithDescParams);
|
|
885
885
|
impl GeneratedQuery for AdminUsersEndsWithDescQuery {
|
|
@@ -1010,7 +1010,7 @@ impl AdminUsersStartsWithAscResult {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
-
pub const ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
1013
|
+
pub const ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH: [u8; 32] = [0xad, 0xd0, 0xae, 0xd3, 0xdb, 0xd0, 0xca, 0xea, 0x0d, 0xe2, 0x85, 0x71, 0x33, 0xa8, 0x57, 0xd4, 0x9e, 0xb7, 0xbf, 0xc0, 0xe0, 0x31, 0xd1, 0x17, 0x27, 0x0c, 0xc8, 0x73, 0x13, 0x7d, 0xa5, 0xec];
|
|
1014
1014
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1015
1015
|
pub struct AdminUsersStartsWithAscQuery(pub AdminUsersStartsWithAscParams);
|
|
1016
1016
|
impl GeneratedQuery for AdminUsersStartsWithAscQuery {
|
|
@@ -1141,7 +1141,7 @@ impl AdminUsersStartsWithDescResult {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
1143
|
|
|
1144
|
-
pub const ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH: [u8; 32] = [
|
|
1144
|
+
pub const ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH: [u8; 32] = [0x23, 0xc1, 0x56, 0x1f, 0xb3, 0x95, 0x62, 0x17, 0xe7, 0x9d, 0x1b, 0x35, 0x8b, 0xe4, 0x68, 0xe5, 0x5c, 0x40, 0x21, 0xb8, 0x87, 0xe9, 0x27, 0xa4, 0xfb, 0x3c, 0x04, 0x84, 0xc9, 0x2b, 0xe8, 0x72];
|
|
1145
1145
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1146
1146
|
pub struct AdminUsersStartsWithDescQuery(pub AdminUsersStartsWithDescParams);
|
|
1147
1147
|
impl GeneratedQuery for AdminUsersStartsWithDescQuery {
|
|
@@ -1290,7 +1290,7 @@ impl FindAccountByIdResult {
|
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
|
-
pub const FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH: [u8; 32] = [
|
|
1293
|
+
pub const FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH: [u8; 32] = [0x14, 0xa0, 0x8d, 0xf3, 0xdd, 0x8a, 0x74, 0xea, 0x0a, 0x56, 0x22, 0x80, 0x4b, 0xf0, 0xc2, 0x42, 0x40, 0x86, 0xee, 0x73, 0xeb, 0x10, 0xce, 0x57, 0xd7, 0xdf, 0x33, 0x6a, 0x7d, 0x25, 0xf5, 0xba];
|
|
1294
1294
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1295
1295
|
pub struct FindAccountByIdQuery(pub FindAccountByIdParams);
|
|
1296
1296
|
impl GeneratedQuery for FindAccountByIdQuery {
|
|
@@ -1432,7 +1432,7 @@ impl FindAccountByProviderResult {
|
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
1434
1434
|
|
|
1435
|
-
pub const FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH: [u8; 32] = [
|
|
1435
|
+
pub const FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH: [u8; 32] = [0xe6, 0xc4, 0x51, 0x7a, 0x46, 0xd7, 0x25, 0x78, 0x0e, 0x79, 0x72, 0x5c, 0xa3, 0xfd, 0xab, 0xa2, 0x20, 0x8e, 0xf4, 0xb2, 0x82, 0xd4, 0x9f, 0x48, 0x41, 0x21, 0xee, 0xe7, 0x6c, 0x04, 0x38, 0x31];
|
|
1436
1436
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1437
1437
|
pub struct FindAccountByProviderQuery(pub FindAccountByProviderParams);
|
|
1438
1438
|
impl GeneratedQuery for FindAccountByProviderQuery {
|
|
@@ -1575,7 +1575,7 @@ impl FindAccountsByUserIdResult {
|
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
1577
|
|
|
1578
|
-
pub const FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH: [u8; 32] = [
|
|
1578
|
+
pub const FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH: [u8; 32] = [0xcc, 0xdc, 0x52, 0x4c, 0xa6, 0x4a, 0xd6, 0x67, 0xc2, 0x09, 0xde, 0x25, 0xb4, 0xce, 0x97, 0x7f, 0x43, 0xb5, 0x3f, 0xfd, 0xd8, 0xeb, 0x1b, 0x70, 0xfe, 0xdf, 0x29, 0xfc, 0x99, 0xf2, 0x7d, 0xa6];
|
|
1579
1579
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1580
1580
|
pub struct FindAccountsByUserIdQuery(pub FindAccountsByUserIdParams);
|
|
1581
1581
|
impl GeneratedQuery for FindAccountsByUserIdQuery {
|
|
@@ -1720,7 +1720,7 @@ impl FindAccountsByUserProviderResult {
|
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
|
|
1723
|
-
pub const FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH: [u8; 32] = [
|
|
1723
|
+
pub const FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH: [u8; 32] = [0x21, 0xd1, 0x3b, 0x3c, 0x30, 0xb4, 0xa4, 0x05, 0x9f, 0x3c, 0x43, 0x6e, 0x29, 0x0d, 0x11, 0xc2, 0x0f, 0x0f, 0x1d, 0x11, 0x54, 0xe0, 0x5f, 0xb4, 0x8a, 0xe3, 0xdd, 0x0d, 0xa8, 0x82, 0x52, 0x6d];
|
|
1724
1724
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1725
1725
|
pub struct FindAccountsByUserProviderQuery(pub FindAccountsByUserProviderParams);
|
|
1726
1726
|
impl GeneratedQuery for FindAccountsByUserProviderQuery {
|
|
@@ -1858,7 +1858,7 @@ impl FindActiveSessionsByUserIdResult {
|
|
|
1858
1858
|
}
|
|
1859
1859
|
}
|
|
1860
1860
|
|
|
1861
|
-
pub const FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH: [u8; 32] = [
|
|
1861
|
+
pub const FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH: [u8; 32] = [0xde, 0x1e, 0x52, 0x32, 0xa6, 0x4a, 0x32, 0x05, 0x76, 0x99, 0xb5, 0xac, 0x21, 0xf1, 0xb4, 0x3e, 0x69, 0xd7, 0x55, 0xa3, 0xc1, 0x43, 0x59, 0x5f, 0x90, 0x6f, 0xe6, 0x3e, 0x16, 0x14, 0x72, 0x64];
|
|
1862
1862
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1863
1863
|
pub struct FindActiveSessionsByUserIdQuery(pub FindActiveSessionsByUserIdParams);
|
|
1864
1864
|
impl GeneratedQuery for FindActiveSessionsByUserIdQuery {
|
|
@@ -1915,6 +1915,153 @@ fn decode_find_active_sessions_by_user_id_found_sessions_record(mut record: Appl
|
|
|
1915
1915
|
Ok(value)
|
|
1916
1916
|
}
|
|
1917
1917
|
|
|
1918
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1919
|
+
pub struct FindCredentialAccountParams {
|
|
1920
|
+
pub organization_id: String,
|
|
1921
|
+
pub user_id: String,
|
|
1922
|
+
pub account_id: String,
|
|
1923
|
+
pub provider_id: String,
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
pub const FIND_CREDENTIAL_ACCOUNT_SECRET_OUTPUTS: &[(&str, &str, &str)] = &[
|
|
1927
|
+
("FindCredentialAccount", "Account", "access_token"),
|
|
1928
|
+
("FindCredentialAccount", "Account", "refresh_token"),
|
|
1929
|
+
("FindCredentialAccount", "Account", "id_token"),
|
|
1930
|
+
("FindCredentialAccount", "Account", "password"),
|
|
1931
|
+
];
|
|
1932
|
+
|
|
1933
|
+
#[derive(Clone, Eq, PartialEq)]
|
|
1934
|
+
pub struct FindCredentialAccountFoundAccounts {
|
|
1935
|
+
pub organization_id: String,
|
|
1936
|
+
pub user_id: String,
|
|
1937
|
+
pub id: String,
|
|
1938
|
+
pub account_id: String,
|
|
1939
|
+
pub provider_id: String,
|
|
1940
|
+
pub access_token: Option<String>,
|
|
1941
|
+
pub refresh_token: Option<String>,
|
|
1942
|
+
pub id_token: Option<String>,
|
|
1943
|
+
pub password: Option<String>,
|
|
1944
|
+
pub access_token_expires_at: Option<TimestampValue>,
|
|
1945
|
+
pub refresh_token_expires_at: Option<TimestampValue>,
|
|
1946
|
+
pub scope: Option<String>,
|
|
1947
|
+
pub created_at: TimestampValue,
|
|
1948
|
+
pub updated_at: TimestampValue,
|
|
1949
|
+
pub revision: u64,
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
impl std::fmt::Debug for FindCredentialAccountFoundAccounts {
|
|
1953
|
+
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
1954
|
+
formatter.write_str("FindCredentialAccountFoundAccounts { <secret outputs redacted> }")
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
#[derive(Clone, Eq, PartialEq)]
|
|
1959
|
+
pub struct FindCredentialAccountFound {
|
|
1960
|
+
pub accounts: Vec<FindCredentialAccountFoundAccounts>,
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
impl std::fmt::Debug for FindCredentialAccountFound {
|
|
1964
|
+
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
1965
|
+
formatter.write_str("FindCredentialAccountFound { <secret outputs redacted> }")
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1970
|
+
pub enum FindCredentialAccountResult {
|
|
1971
|
+
Found(Box<FindCredentialAccountFound>),
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
#[allow(dead_code)]
|
|
1975
|
+
impl FindCredentialAccountResult {
|
|
1976
|
+
#[must_use]
|
|
1977
|
+
pub const fn is_found(&self) -> bool {
|
|
1978
|
+
matches!(self, Self::Found(_))
|
|
1979
|
+
}
|
|
1980
|
+
#[must_use]
|
|
1981
|
+
pub fn as_found(&self) -> Option<&FindCredentialAccountFound> {
|
|
1982
|
+
match self {
|
|
1983
|
+
Self::Found(value) => Some(value.as_ref()),
|
|
1984
|
+
#[allow(unreachable_patterns)]
|
|
1985
|
+
_ => None,
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
pub fn into_found(self) -> Result<FindCredentialAccountFound, Self> {
|
|
1989
|
+
match self {
|
|
1990
|
+
Self::Found(value) => Ok(*value),
|
|
1991
|
+
#[allow(unreachable_patterns)]
|
|
1992
|
+
other => Err(other),
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
pub fn unwrap_found(&self) -> Result<&FindCredentialAccountFound, ApplicationClientError> {
|
|
1996
|
+
self.as_found().ok_or(ApplicationClientError::InvalidResponse)
|
|
1997
|
+
}
|
|
1998
|
+
pub fn unwrap_found_value(&self) -> Result<&Vec<FindCredentialAccountFoundAccounts>, ApplicationClientError> {
|
|
1999
|
+
Ok(&self.unwrap_found()?.accounts)
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
pub const FIND_CREDENTIAL_ACCOUNT_QUERY_PLAN_HASH: [u8; 32] = [0xf9, 0x68, 0x27, 0x1d, 0x10, 0x3a, 0x76, 0xcc, 0x6b, 0x2a, 0x54, 0x96, 0xf5, 0xcc, 0xef, 0xfe, 0x4c, 0xff, 0x5a, 0xa3, 0x9d, 0x2a, 0x37, 0x03, 0x79, 0xb5, 0x18, 0xd8, 0xe7, 0xd9, 0x07, 0x71];
|
|
2004
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
2005
|
+
pub struct FindCredentialAccountQuery(pub FindCredentialAccountParams);
|
|
2006
|
+
impl GeneratedQuery for FindCredentialAccountQuery {
|
|
2007
|
+
type Output = FindCredentialAccountResult;
|
|
2008
|
+
|
|
2009
|
+
fn named_query(self, options: QueryOptions) -> Result<NamedQuery, ApplicationClientError> {
|
|
2010
|
+
let mut parameters = BTreeMap::new();
|
|
2011
|
+
parameters.insert("organization_id".to_owned(), ApplicationValue::Uuid(ApplicationUuid::from_text(self.0.organization_id)?));
|
|
2012
|
+
parameters.insert("user_id".to_owned(), ApplicationValue::Uuid(ApplicationUuid::from_text(self.0.user_id)?));
|
|
2013
|
+
parameters.insert("account_id".to_owned(), ApplicationValue::String(self.0.account_id));
|
|
2014
|
+
parameters.insert("provider_id".to_owned(), ApplicationValue::String(self.0.provider_id));
|
|
2015
|
+
NamedQuery::new(
|
|
2016
|
+
ApplicationContract::Exact {
|
|
2017
|
+
lineage: CONTRACT_LINEAGE.to_owned(),
|
|
2018
|
+
version: CONTRACT_VERSION,
|
|
2019
|
+
bundle_hash: Some(CONTRACT_BUNDLE_HASH),
|
|
2020
|
+
},
|
|
2021
|
+
"FindCredentialAccount",
|
|
2022
|
+
Some(QUERY_MODULE_HASH),
|
|
2023
|
+
parameters,
|
|
2024
|
+
None,
|
|
2025
|
+
)?.expect_plan_hash(FIND_CREDENTIAL_ACCOUNT_QUERY_PLAN_HASH).with_options(options)
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
fn decode_result(mut response: NamedQueryResult) -> Result<Self::Output, ApplicationClientError> {
|
|
2029
|
+
let outcome = response.outcome.clone();
|
|
2030
|
+
match outcome.as_str() {
|
|
2031
|
+
"Found" => {
|
|
2032
|
+
let decoded = FindCredentialAccountFound {
|
|
2033
|
+
accounts: many_result_records(take_result_field(&mut response.fields, "accounts")?)?.into_iter().map(decode_find_credential_account_found_accounts_record).collect::<Result<Vec<_>, _>>()?,
|
|
2034
|
+
};
|
|
2035
|
+
if !response.fields.is_empty() { return Err(ApplicationClientError::InvalidResponse); }
|
|
2036
|
+
Ok(FindCredentialAccountResult::Found(Box::new(decoded)))
|
|
2037
|
+
},
|
|
2038
|
+
_ => Err(ApplicationClientError::InvalidResponse),
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
fn decode_find_credential_account_found_accounts_record(mut record: ApplicationRecord) -> Result<FindCredentialAccountFoundAccounts, ApplicationClientError> {
|
|
2044
|
+
let value = FindCredentialAccountFoundAccounts {
|
|
2045
|
+
organization_id: application_uuid(take_application_value(&mut record.fields, "organization_id")?)?,
|
|
2046
|
+
user_id: application_uuid(take_application_value(&mut record.fields, "user_id")?)?,
|
|
2047
|
+
id: application_uuid(take_application_value(&mut record.fields, "id")?)?,
|
|
2048
|
+
account_id: application_string(take_application_value(&mut record.fields, "account_id")?)?,
|
|
2049
|
+
provider_id: application_string(take_application_value(&mut record.fields, "provider_id")?)?,
|
|
2050
|
+
access_token: match take_application_value(&mut record.fields, "access_token")? { ApplicationValue::Null => None, value => Some(application_string(value)?) },
|
|
2051
|
+
refresh_token: match take_application_value(&mut record.fields, "refresh_token")? { ApplicationValue::Null => None, value => Some(application_string(value)?) },
|
|
2052
|
+
id_token: match take_application_value(&mut record.fields, "id_token")? { ApplicationValue::Null => None, value => Some(application_string(value)?) },
|
|
2053
|
+
password: match take_application_value(&mut record.fields, "password")? { ApplicationValue::Null => None, value => Some(application_string(value)?) },
|
|
2054
|
+
access_token_expires_at: match take_application_value(&mut record.fields, "access_token_expires_at")? { ApplicationValue::Null => None, value => Some(application_timestamp(value)?) },
|
|
2055
|
+
refresh_token_expires_at: match take_application_value(&mut record.fields, "refresh_token_expires_at")? { ApplicationValue::Null => None, value => Some(application_timestamp(value)?) },
|
|
2056
|
+
scope: match take_application_value(&mut record.fields, "scope")? { ApplicationValue::Null => None, value => Some(application_string(value)?) },
|
|
2057
|
+
created_at: application_timestamp(take_application_value(&mut record.fields, "created_at")?)?,
|
|
2058
|
+
updated_at: application_timestamp(take_application_value(&mut record.fields, "updated_at")?)?,
|
|
2059
|
+
revision: application_u64(take_application_value(&mut record.fields, "revision")?)?,
|
|
2060
|
+
};
|
|
2061
|
+
if !record.fields.is_empty() { return Err(ApplicationClientError::InvalidResponse); }
|
|
2062
|
+
Ok(value)
|
|
2063
|
+
}
|
|
2064
|
+
|
|
1918
2065
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1919
2066
|
pub struct FindExpiredVerificationIdsParams {
|
|
1920
2067
|
pub organization_id: String,
|
|
@@ -1966,7 +2113,7 @@ impl FindExpiredVerificationIdsResult {
|
|
|
1966
2113
|
}
|
|
1967
2114
|
}
|
|
1968
2115
|
|
|
1969
|
-
pub const FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH: [u8; 32] = [
|
|
2116
|
+
pub const FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH: [u8; 32] = [0x6c, 0x79, 0x98, 0x50, 0xba, 0x3b, 0x2e, 0xb3, 0x22, 0x2a, 0xac, 0x85, 0xa7, 0x6f, 0x40, 0x49, 0x2c, 0x46, 0xde, 0x76, 0x87, 0x00, 0x75, 0xb0, 0x29, 0xf3, 0xb4, 0xac, 0x89, 0x7e, 0xd8, 0xb9];
|
|
1970
2117
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
1971
2118
|
pub struct FindExpiredVerificationIdsQuery(pub FindExpiredVerificationIdsParams);
|
|
1972
2119
|
impl GeneratedQuery for FindExpiredVerificationIdsQuery {
|
|
@@ -2086,7 +2233,7 @@ impl FindLatestVerificationResult {
|
|
|
2086
2233
|
}
|
|
2087
2234
|
}
|
|
2088
2235
|
|
|
2089
|
-
pub const FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH: [u8; 32] = [
|
|
2236
|
+
pub const FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH: [u8; 32] = [0xb3, 0x83, 0x2c, 0x0a, 0x8a, 0x31, 0x6d, 0x3f, 0xcb, 0xc6, 0x2b, 0x38, 0x8f, 0xbe, 0x09, 0xce, 0xb6, 0x62, 0x4b, 0x55, 0x48, 0x21, 0x95, 0xf7, 0x64, 0x25, 0x53, 0x46, 0x7c, 0xba, 0x6f, 0xcb];
|
|
2090
2237
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
2091
2238
|
pub struct FindLatestVerificationQuery(pub FindLatestVerificationParams);
|
|
2092
2239
|
impl GeneratedQuery for FindLatestVerificationQuery {
|
|
@@ -2212,7 +2359,7 @@ impl FindSessionByIdResult {
|
|
|
2212
2359
|
}
|
|
2213
2360
|
}
|
|
2214
2361
|
|
|
2215
|
-
pub const FIND_SESSION_BY_ID_QUERY_PLAN_HASH: [u8; 32] = [
|
|
2362
|
+
pub const FIND_SESSION_BY_ID_QUERY_PLAN_HASH: [u8; 32] = [0xc9, 0x2e, 0xb2, 0x03, 0x5c, 0x0e, 0x3c, 0xa7, 0xde, 0xdb, 0xaa, 0x42, 0xa4, 0xe2, 0xef, 0xe7, 0xbc, 0x47, 0x86, 0xa6, 0x52, 0x13, 0x39, 0x4d, 0xa7, 0xf5, 0xd3, 0xbe, 0xb5, 0x79, 0xa2, 0xa1];
|
|
2216
2363
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
2217
2364
|
pub struct FindSessionByIdQuery(pub FindSessionByIdParams);
|
|
2218
2365
|
impl GeneratedQuery for FindSessionByIdQuery {
|
|
@@ -2340,7 +2487,7 @@ impl FindSessionByTokenResult {
|
|
|
2340
2487
|
}
|
|
2341
2488
|
}
|
|
2342
2489
|
|
|
2343
|
-
pub const FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH: [u8; 32] = [
|
|
2490
|
+
pub const FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH: [u8; 32] = [0xa8, 0xa1, 0x23, 0x34, 0xa3, 0xd3, 0x4c, 0x30, 0xd5, 0x4b, 0xe8, 0x28, 0xbd, 0xcc, 0x9b, 0x9b, 0x77, 0x22, 0x33, 0x03, 0xc3, 0xf9, 0x68, 0x1e, 0x4a, 0x60, 0x2c, 0x92, 0x34, 0x18, 0x76, 0xec];
|
|
2344
2491
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
2345
2492
|
pub struct FindSessionByTokenQuery(pub FindSessionByTokenParams);
|
|
2346
2493
|
impl GeneratedQuery for FindSessionByTokenQuery {
|
|
@@ -2468,7 +2615,7 @@ impl FindSessionsByTokenSetResult {
|
|
|
2468
2615
|
}
|
|
2469
2616
|
}
|
|
2470
2617
|
|
|
2471
|
-
pub const FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH: [u8; 32] = [
|
|
2618
|
+
pub const FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH: [u8; 32] = [0x7e, 0x23, 0x18, 0x7b, 0x53, 0x75, 0x99, 0xc4, 0xc2, 0x36, 0x1d, 0x34, 0xea, 0x86, 0x6b, 0x5b, 0x71, 0x9f, 0x63, 0xfe, 0xda, 0x01, 0x35, 0x58, 0x7b, 0x5e, 0xc6, 0xaf, 0xd5, 0xce, 0x62, 0xf6];
|
|
2472
2619
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
2473
2620
|
pub struct FindSessionsByTokenSetQuery(pub FindSessionsByTokenSetParams);
|
|
2474
2621
|
impl GeneratedQuery for FindSessionsByTokenSetQuery {
|
|
@@ -2597,7 +2744,7 @@ impl FindSessionsByUserIdResult {
|
|
|
2597
2744
|
}
|
|
2598
2745
|
}
|
|
2599
2746
|
|
|
2600
|
-
pub const FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH: [u8; 32] = [
|
|
2747
|
+
pub const FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH: [u8; 32] = [0xa3, 0x27, 0x75, 0x46, 0xd8, 0xb0, 0xc0, 0x05, 0x9b, 0x85, 0x0c, 0x36, 0x8a, 0xe4, 0x92, 0x50, 0x00, 0xc2, 0x55, 0xe6, 0x9b, 0x7f, 0xf0, 0x05, 0xf4, 0xb3, 0xd2, 0xef, 0x61, 0xb5, 0x04, 0xaf];
|
|
2601
2748
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
2602
2749
|
pub struct FindSessionsByUserIdQuery(pub FindSessionsByUserIdParams);
|
|
2603
2750
|
impl GeneratedQuery for FindSessionsByUserIdQuery {
|
|
@@ -2710,7 +2857,7 @@ impl FindUserByEmailResult {
|
|
|
2710
2857
|
}
|
|
2711
2858
|
}
|
|
2712
2859
|
|
|
2713
|
-
pub const FIND_USER_BY_EMAIL_QUERY_PLAN_HASH: [u8; 32] = [
|
|
2860
|
+
pub const FIND_USER_BY_EMAIL_QUERY_PLAN_HASH: [u8; 32] = [0xb1, 0x67, 0xb8, 0xcb, 0x2f, 0xb5, 0xce, 0x19, 0x68, 0x54, 0x91, 0xb4, 0x7d, 0xa4, 0xe8, 0x16, 0x66, 0x5b, 0x84, 0x0e, 0x0f, 0x0e, 0x46, 0x36, 0x66, 0xf6, 0x30, 0x21, 0x34, 0x47, 0x2b, 0x9a];
|
|
2714
2861
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
2715
2862
|
pub struct FindUserByEmailQuery(pub FindUserByEmailParams);
|
|
2716
2863
|
impl GeneratedQuery for FindUserByEmailQuery {
|
|
@@ -2869,7 +3016,7 @@ impl FindUserByIdResult {
|
|
|
2869
3016
|
}
|
|
2870
3017
|
}
|
|
2871
3018
|
|
|
2872
|
-
pub const FIND_USER_BY_ID_QUERY_PLAN_HASH: [u8; 32] = [
|
|
3019
|
+
pub const FIND_USER_BY_ID_QUERY_PLAN_HASH: [u8; 32] = [0x25, 0xd4, 0xa0, 0xa7, 0x7d, 0x5d, 0xf6, 0x4a, 0xb6, 0x18, 0x75, 0x28, 0xf9, 0xfa, 0xc6, 0xb2, 0x05, 0xa0, 0x3c, 0x33, 0xe0, 0x1c, 0x9e, 0xa6, 0xb5, 0x73, 0xe8, 0x31, 0x6b, 0x78, 0xb9, 0x24];
|
|
2873
3020
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
2874
3021
|
pub struct FindUserByIdQuery(pub FindUserByIdParams);
|
|
2875
3022
|
impl GeneratedQuery for FindUserByIdQuery {
|
|
@@ -3030,7 +3177,7 @@ impl FindVerificationByIdResult {
|
|
|
3030
3177
|
}
|
|
3031
3178
|
}
|
|
3032
3179
|
|
|
3033
|
-
pub const FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH: [u8; 32] = [
|
|
3180
|
+
pub const FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH: [u8; 32] = [0x54, 0xf0, 0x7c, 0x7e, 0xba, 0x7d, 0x51, 0x85, 0x7d, 0xd6, 0x47, 0x3e, 0x39, 0x30, 0x4d, 0xc7, 0x98, 0xbf, 0x70, 0x84, 0xca, 0x94, 0x6d, 0xfa, 0x7f, 0x02, 0x03, 0x63, 0x3a, 0x51, 0x33, 0xac];
|
|
3034
3181
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
3035
3182
|
pub struct FindVerificationByIdQuery(pub FindVerificationByIdParams);
|
|
3036
3183
|
impl GeneratedQuery for FindVerificationByIdQuery {
|
|
@@ -3161,7 +3308,7 @@ impl FindVerificationsByIdentifierResult {
|
|
|
3161
3308
|
}
|
|
3162
3309
|
}
|
|
3163
3310
|
|
|
3164
|
-
pub const FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH: [u8; 32] = [
|
|
3311
|
+
pub const FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH: [u8; 32] = [0x4c, 0x76, 0x8a, 0xe1, 0xd9, 0x66, 0x45, 0x4e, 0x9b, 0x79, 0x1c, 0xd5, 0x7a, 0x63, 0x11, 0x47, 0x69, 0x47, 0xb5, 0xc4, 0x57, 0x02, 0x09, 0x43, 0xa5, 0x0b, 0xc3, 0xcf, 0xee, 0x90, 0x76, 0x5b];
|
|
3165
3312
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
3166
3313
|
pub struct FindVerificationsByIdentifierQuery(pub FindVerificationsByIdentifierParams);
|
|
3167
3314
|
impl GeneratedQuery for FindVerificationsByIdentifierQuery {
|
|
@@ -3603,6 +3750,76 @@ impl GeneratedCommand for ConsumeVerificationSetInput {
|
|
|
3603
3750
|
}
|
|
3604
3751
|
}
|
|
3605
3752
|
|
|
3753
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
3754
|
+
pub struct ConsumeVerificationSnapshotInput {
|
|
3755
|
+
pub request_id: String,
|
|
3756
|
+
pub organization_id: String,
|
|
3757
|
+
pub verification_id: String,
|
|
3758
|
+
pub expected_revision: u64,
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
#[allow(clippy::enum_variant_names, clippy::large_enum_variant)]
|
|
3762
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
3763
|
+
pub enum ConsumeVerificationSnapshotOutcome {
|
|
3764
|
+
VerificationConsumed,
|
|
3765
|
+
|
|
3766
|
+
VerificationConsumeStale,
|
|
3767
|
+
|
|
3768
|
+
VerificationConsumeMissing,
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3771
|
+
#[allow(dead_code)]
|
|
3772
|
+
impl ConsumeVerificationSnapshotOutcome {
|
|
3773
|
+
#[must_use]
|
|
3774
|
+
pub const fn is_verification_consumed(&self) -> bool {
|
|
3775
|
+
matches!(self, Self::VerificationConsumed)
|
|
3776
|
+
}
|
|
3777
|
+
#[must_use]
|
|
3778
|
+
pub const fn is_verification_consume_stale(&self) -> bool {
|
|
3779
|
+
matches!(self, Self::VerificationConsumeStale)
|
|
3780
|
+
}
|
|
3781
|
+
#[must_use]
|
|
3782
|
+
pub const fn is_verification_consume_missing(&self) -> bool {
|
|
3783
|
+
matches!(self, Self::VerificationConsumeMissing)
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
const CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH: [u8; 32] = [0x1a, 0x80, 0xa3, 0x6f, 0x34, 0xb4, 0x69, 0x9c, 0x97, 0x2f, 0xc1, 0xe6, 0xf4, 0x8c, 0xad, 0x3f, 0x85, 0xda, 0x54, 0xe2, 0x02, 0x83, 0x1a, 0x69, 0x86, 0xae, 0xa0, 0x84, 0xdb, 0x09, 0x78, 0x8b];
|
|
3788
|
+
impl GeneratedCommand for ConsumeVerificationSnapshotInput {
|
|
3789
|
+
type Outcome = ConsumeVerificationSnapshotOutcome;
|
|
3790
|
+
|
|
3791
|
+
fn idempotent_command(&self) -> Result<IdempotentCommand, GeneratedCommandError> {
|
|
3792
|
+
|
|
3793
|
+
let fields = vec![
|
|
3794
|
+
wire_named_field("request_id", wire_uuid(&self.request_id)?),
|
|
3795
|
+
wire_named_field("organization_id", wire_uuid(&self.organization_id)?),
|
|
3796
|
+
wire_named_field("verification_id", wire_uuid(&self.verification_id)?),
|
|
3797
|
+
wire_named_field("expected_revision", wire_u64(self.expected_revision)),
|
|
3798
|
+
];
|
|
3799
|
+
IdempotentCommand::new("ConsumeVerificationSnapshot", Some(CONTRACT_VERSION), wire_record(fields)).map_err(Into::into)
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
fn outcome_request(&self, request_id: riffdb_client_rust::RequestId) -> Result<v1::GetOutcomeRequest, GeneratedCommandError> {
|
|
3803
|
+
Ok(v1::GetOutcomeRequest {
|
|
3804
|
+
request_id: request_id.into_bytes().to_vec(),
|
|
3805
|
+
contract_lineage: CONTRACT_LINEAGE.to_owned(),
|
|
3806
|
+
command_name: "ConsumeVerificationSnapshot".to_owned(),
|
|
3807
|
+
idempotency_key: self.request_id.clone(),
|
|
3808
|
+
outcome_uri: None,
|
|
3809
|
+
})
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
fn decode_outcome(&self, response: &v1::ExecuteCommandResponse) -> Result<Self::Outcome, GeneratedCommandError> {
|
|
3813
|
+
let fields = wire_outcome_fields(response, &CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH)?;
|
|
3814
|
+
match response.outcome_type.as_str() {
|
|
3815
|
+
"VerificationConsumed" => if fields.is_empty() { Ok(Self::Outcome::VerificationConsumed) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
3816
|
+
"VerificationConsumeStale" => if fields.is_empty() { Ok(Self::Outcome::VerificationConsumeStale) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
3817
|
+
"VerificationConsumeMissing" => if fields.is_empty() { Ok(Self::Outcome::VerificationConsumeMissing) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
3818
|
+
_ => Err(GeneratedCommandError::InvalidOutcomeShape),
|
|
3819
|
+
}
|
|
3820
|
+
}
|
|
3821
|
+
}
|
|
3822
|
+
|
|
3606
3823
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
3607
3824
|
pub struct CreateAccountInput {
|
|
3608
3825
|
pub id: String,
|
|
@@ -4397,6 +4614,110 @@ impl GeneratedCommand for DeleteVerificationInput {
|
|
|
4397
4614
|
}
|
|
4398
4615
|
}
|
|
4399
4616
|
|
|
4617
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
4618
|
+
pub struct ResetCredentialPasswordInput {
|
|
4619
|
+
pub user_id: String,
|
|
4620
|
+
pub password: String,
|
|
4621
|
+
pub account_id: String,
|
|
4622
|
+
pub request_id: String,
|
|
4623
|
+
pub updated_at: TimestampValue,
|
|
4624
|
+
pub organization_id: String,
|
|
4625
|
+
pub account_revision: u64,
|
|
4626
|
+
pub verification_ids: Vec<String>,
|
|
4627
|
+
pub external_account_id: String,
|
|
4628
|
+
pub verification_revision: u64,
|
|
4629
|
+
}
|
|
4630
|
+
|
|
4631
|
+
#[allow(clippy::enum_variant_names, clippy::large_enum_variant)]
|
|
4632
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
4633
|
+
pub enum ResetCredentialPasswordOutcome {
|
|
4634
|
+
PasswordAccountStale,
|
|
4635
|
+
|
|
4636
|
+
PasswordAccountMissing,
|
|
4637
|
+
|
|
4638
|
+
CredentialPasswordReset,
|
|
4639
|
+
|
|
4640
|
+
PasswordProviderMismatch,
|
|
4641
|
+
|
|
4642
|
+
VerificationConsumeStale,
|
|
4643
|
+
|
|
4644
|
+
VerificationConsumeMissing,
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4647
|
+
#[allow(dead_code)]
|
|
4648
|
+
impl ResetCredentialPasswordOutcome {
|
|
4649
|
+
#[must_use]
|
|
4650
|
+
pub const fn is_password_account_stale(&self) -> bool {
|
|
4651
|
+
matches!(self, Self::PasswordAccountStale)
|
|
4652
|
+
}
|
|
4653
|
+
#[must_use]
|
|
4654
|
+
pub const fn is_password_account_missing(&self) -> bool {
|
|
4655
|
+
matches!(self, Self::PasswordAccountMissing)
|
|
4656
|
+
}
|
|
4657
|
+
#[must_use]
|
|
4658
|
+
pub const fn is_credential_password_reset(&self) -> bool {
|
|
4659
|
+
matches!(self, Self::CredentialPasswordReset)
|
|
4660
|
+
}
|
|
4661
|
+
#[must_use]
|
|
4662
|
+
pub const fn is_password_provider_mismatch(&self) -> bool {
|
|
4663
|
+
matches!(self, Self::PasswordProviderMismatch)
|
|
4664
|
+
}
|
|
4665
|
+
#[must_use]
|
|
4666
|
+
pub const fn is_verification_consume_stale(&self) -> bool {
|
|
4667
|
+
matches!(self, Self::VerificationConsumeStale)
|
|
4668
|
+
}
|
|
4669
|
+
#[must_use]
|
|
4670
|
+
pub const fn is_verification_consume_missing(&self) -> bool {
|
|
4671
|
+
matches!(self, Self::VerificationConsumeMissing)
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
|
|
4675
|
+
const RESET_CREDENTIAL_PASSWORD_PLAN_HASH: [u8; 32] = [0xed, 0x87, 0xf2, 0x67, 0x83, 0x1f, 0xb0, 0x82, 0x3b, 0x0e, 0x9b, 0xbf, 0x51, 0xd7, 0xb3, 0x02, 0xa7, 0x15, 0xa9, 0x5c, 0x0c, 0xea, 0x69, 0xfa, 0xf7, 0x92, 0x2c, 0x0e, 0x4e, 0x7f, 0x37, 0x5e];
|
|
4676
|
+
impl GeneratedCommand for ResetCredentialPasswordInput {
|
|
4677
|
+
type Outcome = ResetCredentialPasswordOutcome;
|
|
4678
|
+
|
|
4679
|
+
fn idempotent_command(&self) -> Result<IdempotentCommand, GeneratedCommandError> {
|
|
4680
|
+
|
|
4681
|
+
if self.verification_ids.is_empty() || self.verification_ids.len() > 1 { return Err(GeneratedCommandError::InvalidInputShape); }
|
|
4682
|
+
let fields = vec![
|
|
4683
|
+
wire_named_field("user_id", wire_uuid(&self.user_id)?),
|
|
4684
|
+
wire_named_field("password", wire_string(Clone::clone(&self.password))),
|
|
4685
|
+
wire_named_field("account_id", wire_uuid(&self.account_id)?),
|
|
4686
|
+
wire_named_field("request_id", wire_uuid(&self.request_id)?),
|
|
4687
|
+
wire_named_field("updated_at", wire_timestamp(&self.updated_at)?),
|
|
4688
|
+
wire_named_field("organization_id", wire_uuid(&self.organization_id)?),
|
|
4689
|
+
wire_named_field("account_revision", wire_u64(self.account_revision)),
|
|
4690
|
+
wire_named_field("verification_ids", v1::Value { kind: Some(WireKind::ListValue(v1::ValueList { values: (self.verification_ids).iter().map(|value| wire_uuid(value)).collect::<Result<Vec<_>, GeneratedCommandError>>()? })) }),
|
|
4691
|
+
wire_named_field("external_account_id", wire_string(Clone::clone(&self.external_account_id))),
|
|
4692
|
+
wire_named_field("verification_revision", wire_u64(self.verification_revision)),
|
|
4693
|
+
];
|
|
4694
|
+
IdempotentCommand::new("ResetCredentialPassword", Some(CONTRACT_VERSION), wire_record(fields)).map_err(Into::into)
|
|
4695
|
+
}
|
|
4696
|
+
|
|
4697
|
+
fn outcome_request(&self, request_id: riffdb_client_rust::RequestId) -> Result<v1::GetOutcomeRequest, GeneratedCommandError> {
|
|
4698
|
+
Ok(v1::GetOutcomeRequest {
|
|
4699
|
+
request_id: request_id.into_bytes().to_vec(),
|
|
4700
|
+
contract_lineage: CONTRACT_LINEAGE.to_owned(),
|
|
4701
|
+
command_name: "ResetCredentialPassword".to_owned(),
|
|
4702
|
+
idempotency_key: self.request_id.clone(),
|
|
4703
|
+
outcome_uri: None,
|
|
4704
|
+
})
|
|
4705
|
+
}
|
|
4706
|
+
|
|
4707
|
+
fn decode_outcome(&self, response: &v1::ExecuteCommandResponse) -> Result<Self::Outcome, GeneratedCommandError> {
|
|
4708
|
+
let fields = wire_outcome_fields(response, &RESET_CREDENTIAL_PASSWORD_PLAN_HASH)?;
|
|
4709
|
+
match response.outcome_type.as_str() {
|
|
4710
|
+
"PasswordAccountStale" => if fields.is_empty() { Ok(Self::Outcome::PasswordAccountStale) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4711
|
+
"PasswordAccountMissing" => if fields.is_empty() { Ok(Self::Outcome::PasswordAccountMissing) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4712
|
+
"CredentialPasswordReset" => if fields.is_empty() { Ok(Self::Outcome::CredentialPasswordReset) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4713
|
+
"PasswordProviderMismatch" => if fields.is_empty() { Ok(Self::Outcome::PasswordProviderMismatch) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4714
|
+
"VerificationConsumeStale" => if fields.is_empty() { Ok(Self::Outcome::VerificationConsumeStale) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4715
|
+
"VerificationConsumeMissing" => if fields.is_empty() { Ok(Self::Outcome::VerificationConsumeMissing) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4716
|
+
_ => Err(GeneratedCommandError::InvalidOutcomeShape),
|
|
4717
|
+
}
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
|
|
4400
4721
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
4401
4722
|
pub struct UpdateAccountInput {
|
|
4402
4723
|
pub scope: Option<String>,
|
|
@@ -4567,6 +4888,91 @@ impl GeneratedCommand for UpdateAccountPasswordsInput {
|
|
|
4567
4888
|
}
|
|
4568
4889
|
}
|
|
4569
4890
|
|
|
4891
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
4892
|
+
pub struct UpdateCredentialPasswordInput {
|
|
4893
|
+
pub user_id: String,
|
|
4894
|
+
pub password: String,
|
|
4895
|
+
pub account_id: String,
|
|
4896
|
+
pub request_id: String,
|
|
4897
|
+
pub updated_at: TimestampValue,
|
|
4898
|
+
pub organization_id: String,
|
|
4899
|
+
pub expected_revision: u64,
|
|
4900
|
+
pub external_account_id: String,
|
|
4901
|
+
}
|
|
4902
|
+
|
|
4903
|
+
#[allow(clippy::enum_variant_names, clippy::large_enum_variant)]
|
|
4904
|
+
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
4905
|
+
pub enum UpdateCredentialPasswordOutcome {
|
|
4906
|
+
PasswordAccountStale,
|
|
4907
|
+
|
|
4908
|
+
PasswordAccountMissing,
|
|
4909
|
+
|
|
4910
|
+
PasswordProviderMismatch,
|
|
4911
|
+
|
|
4912
|
+
CredentialPasswordUpdated,
|
|
4913
|
+
}
|
|
4914
|
+
|
|
4915
|
+
#[allow(dead_code)]
|
|
4916
|
+
impl UpdateCredentialPasswordOutcome {
|
|
4917
|
+
#[must_use]
|
|
4918
|
+
pub const fn is_password_account_stale(&self) -> bool {
|
|
4919
|
+
matches!(self, Self::PasswordAccountStale)
|
|
4920
|
+
}
|
|
4921
|
+
#[must_use]
|
|
4922
|
+
pub const fn is_password_account_missing(&self) -> bool {
|
|
4923
|
+
matches!(self, Self::PasswordAccountMissing)
|
|
4924
|
+
}
|
|
4925
|
+
#[must_use]
|
|
4926
|
+
pub const fn is_password_provider_mismatch(&self) -> bool {
|
|
4927
|
+
matches!(self, Self::PasswordProviderMismatch)
|
|
4928
|
+
}
|
|
4929
|
+
#[must_use]
|
|
4930
|
+
pub const fn is_credential_password_updated(&self) -> bool {
|
|
4931
|
+
matches!(self, Self::CredentialPasswordUpdated)
|
|
4932
|
+
}
|
|
4933
|
+
}
|
|
4934
|
+
|
|
4935
|
+
const UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH: [u8; 32] = [0x08, 0x78, 0x1a, 0x68, 0x73, 0x9c, 0x70, 0x5a, 0xb6, 0xff, 0xe5, 0x1a, 0x0d, 0xe5, 0x47, 0x60, 0x5e, 0x1a, 0x7d, 0xd2, 0xfd, 0x2b, 0x80, 0x75, 0x44, 0x5d, 0x40, 0xdb, 0x92, 0x3d, 0x1f, 0x15];
|
|
4936
|
+
impl GeneratedCommand for UpdateCredentialPasswordInput {
|
|
4937
|
+
type Outcome = UpdateCredentialPasswordOutcome;
|
|
4938
|
+
|
|
4939
|
+
fn idempotent_command(&self) -> Result<IdempotentCommand, GeneratedCommandError> {
|
|
4940
|
+
|
|
4941
|
+
let fields = vec![
|
|
4942
|
+
wire_named_field("user_id", wire_uuid(&self.user_id)?),
|
|
4943
|
+
wire_named_field("password", wire_string(Clone::clone(&self.password))),
|
|
4944
|
+
wire_named_field("account_id", wire_uuid(&self.account_id)?),
|
|
4945
|
+
wire_named_field("request_id", wire_uuid(&self.request_id)?),
|
|
4946
|
+
wire_named_field("updated_at", wire_timestamp(&self.updated_at)?),
|
|
4947
|
+
wire_named_field("organization_id", wire_uuid(&self.organization_id)?),
|
|
4948
|
+
wire_named_field("expected_revision", wire_u64(self.expected_revision)),
|
|
4949
|
+
wire_named_field("external_account_id", wire_string(Clone::clone(&self.external_account_id))),
|
|
4950
|
+
];
|
|
4951
|
+
IdempotentCommand::new("UpdateCredentialPassword", Some(CONTRACT_VERSION), wire_record(fields)).map_err(Into::into)
|
|
4952
|
+
}
|
|
4953
|
+
|
|
4954
|
+
fn outcome_request(&self, request_id: riffdb_client_rust::RequestId) -> Result<v1::GetOutcomeRequest, GeneratedCommandError> {
|
|
4955
|
+
Ok(v1::GetOutcomeRequest {
|
|
4956
|
+
request_id: request_id.into_bytes().to_vec(),
|
|
4957
|
+
contract_lineage: CONTRACT_LINEAGE.to_owned(),
|
|
4958
|
+
command_name: "UpdateCredentialPassword".to_owned(),
|
|
4959
|
+
idempotency_key: self.request_id.clone(),
|
|
4960
|
+
outcome_uri: None,
|
|
4961
|
+
})
|
|
4962
|
+
}
|
|
4963
|
+
|
|
4964
|
+
fn decode_outcome(&self, response: &v1::ExecuteCommandResponse) -> Result<Self::Outcome, GeneratedCommandError> {
|
|
4965
|
+
let fields = wire_outcome_fields(response, &UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH)?;
|
|
4966
|
+
match response.outcome_type.as_str() {
|
|
4967
|
+
"PasswordAccountStale" => if fields.is_empty() { Ok(Self::Outcome::PasswordAccountStale) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4968
|
+
"PasswordAccountMissing" => if fields.is_empty() { Ok(Self::Outcome::PasswordAccountMissing) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4969
|
+
"PasswordProviderMismatch" => if fields.is_empty() { Ok(Self::Outcome::PasswordProviderMismatch) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4970
|
+
"CredentialPasswordUpdated" => if fields.is_empty() { Ok(Self::Outcome::CredentialPasswordUpdated) } else { Err(GeneratedCommandError::InvalidOutcomeShape) },
|
|
4971
|
+
_ => Err(GeneratedCommandError::InvalidOutcomeShape),
|
|
4972
|
+
}
|
|
4973
|
+
}
|
|
4974
|
+
}
|
|
4975
|
+
|
|
4570
4976
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
4571
4977
|
pub struct UpdateSessionInput {
|
|
4572
4978
|
pub user_id: String,
|
|
@@ -5249,6 +5655,27 @@ impl RiffDBBetterAuthCoreClient {
|
|
|
5249
5655
|
Ok(pages)
|
|
5250
5656
|
}
|
|
5251
5657
|
|
|
5658
|
+
/// Executes the generated `FindCredentialAccount` named query.
|
|
5659
|
+
pub async fn find_credential_account(&mut self, parameters: FindCredentialAccountParams) -> Result<FindCredentialAccountResult, ApplicationClientError> {
|
|
5660
|
+
let options = match self.read_after_commit {
|
|
5661
|
+
Some(commit_sequence) => QueryOptions::new().read_after_commit(commit_sequence),
|
|
5662
|
+
None => QueryOptions::new(),
|
|
5663
|
+
};
|
|
5664
|
+
Ok(self.find_credential_account_with_options(parameters, options).await?.value)
|
|
5665
|
+
}
|
|
5666
|
+
/// Executes `FindCredentialAccount` against a snapshot at or after the supplied command commit.
|
|
5667
|
+
pub async fn find_credential_account_after_commit(&mut self, parameters: FindCredentialAccountParams, commit_sequence: u64) -> Result<TypedQueryResult<FindCredentialAccountResult>, ApplicationClientError> {
|
|
5668
|
+
self.find_credential_account_with_options(parameters, QueryOptions::new().read_after_commit(commit_sequence)).await
|
|
5669
|
+
}
|
|
5670
|
+
/// Executes `FindCredentialAccount` with generated pagination or read-fence options.
|
|
5671
|
+
pub async fn find_credential_account_with_options(&mut self, parameters: FindCredentialAccountParams, options: QueryOptions) -> Result<TypedQueryResult<FindCredentialAccountResult>, ApplicationClientError> {
|
|
5672
|
+
let options = match self.read_after_commit {
|
|
5673
|
+
Some(commit_sequence) if options == QueryOptions::new() => options.read_after_commit(commit_sequence),
|
|
5674
|
+
_ => options,
|
|
5675
|
+
};
|
|
5676
|
+
self.client.execute_generated_query(FindCredentialAccountQuery(parameters), options, &self.metadata).await
|
|
5677
|
+
}
|
|
5678
|
+
|
|
5252
5679
|
/// Executes the generated `FindExpiredVerificationIds` named query.
|
|
5253
5680
|
pub async fn find_expired_verification_ids(&mut self, parameters: FindExpiredVerificationIdsParams) -> Result<FindExpiredVerificationIdsResult, ApplicationClientError> {
|
|
5254
5681
|
let options = match self.read_after_commit {
|
|
@@ -5574,6 +6001,29 @@ impl RiffDBBetterAuthCoreClient {
|
|
|
5574
6001
|
self.client.execute_generated_command_batch_with_progress(inputs, options, self.command_attempts, &self.metadata, progress).await
|
|
5575
6002
|
}
|
|
5576
6003
|
|
|
6004
|
+
pub async fn consume_verification_snapshot(&mut self, input: ConsumeVerificationSnapshotInput) -> Result<TypedCommandResult<ConsumeVerificationSnapshotOutcome>, ApplicationClientError> {
|
|
6005
|
+
let result: TypedCommandResult<ConsumeVerificationSnapshotOutcome> = self.client.execute_generated_command(&input, self.command_attempts, &self.metadata).await?;
|
|
6006
|
+
if self.track_causal_writes
|
|
6007
|
+
&& let Some(commit_sequence) = result.commit_sequence
|
|
6008
|
+
&& commit_sequence > 0
|
|
6009
|
+
&& self.read_after_commit.is_none_or(|current| commit_sequence > current)
|
|
6010
|
+
{
|
|
6011
|
+
self.read_after_commit = Some(commit_sequence);
|
|
6012
|
+
}
|
|
6013
|
+
Ok(result)
|
|
6014
|
+
}
|
|
6015
|
+
|
|
6016
|
+
pub async fn consume_verification_snapshot_batch(&self, inputs: Vec<ConsumeVerificationSnapshotInput>, options: GeneratedBatchOptions) -> Result<GeneratedBatchResult<ConsumeVerificationSnapshotOutcome>, GeneratedBatchError> {
|
|
6017
|
+
self.client.execute_generated_command_batch(inputs, options, self.command_attempts, &self.metadata).await
|
|
6018
|
+
}
|
|
6019
|
+
|
|
6020
|
+
pub async fn consume_verification_snapshot_batch_with_progress<F>(&self, inputs: Vec<ConsumeVerificationSnapshotInput>, options: GeneratedBatchOptions, progress: F) -> Result<GeneratedBatchResult<ConsumeVerificationSnapshotOutcome>, GeneratedBatchError>
|
|
6021
|
+
where
|
|
6022
|
+
F: FnMut(GeneratedBatchProgress),
|
|
6023
|
+
{
|
|
6024
|
+
self.client.execute_generated_command_batch_with_progress(inputs, options, self.command_attempts, &self.metadata, progress).await
|
|
6025
|
+
}
|
|
6026
|
+
|
|
5577
6027
|
pub async fn create_account(&mut self, input: CreateAccountInput) -> Result<TypedCommandResult<CreateAccountOutcome>, ApplicationClientError> {
|
|
5578
6028
|
let result: TypedCommandResult<CreateAccountOutcome> = self.client.execute_generated_command(&input, self.command_attempts, &self.metadata).await?;
|
|
5579
6029
|
if self.track_causal_writes
|
|
@@ -5804,6 +6254,29 @@ impl RiffDBBetterAuthCoreClient {
|
|
|
5804
6254
|
self.client.execute_generated_command_batch_with_progress(inputs, options, self.command_attempts, &self.metadata, progress).await
|
|
5805
6255
|
}
|
|
5806
6256
|
|
|
6257
|
+
pub async fn reset_credential_password(&mut self, input: ResetCredentialPasswordInput) -> Result<TypedCommandResult<ResetCredentialPasswordOutcome>, ApplicationClientError> {
|
|
6258
|
+
let result: TypedCommandResult<ResetCredentialPasswordOutcome> = self.client.execute_generated_command(&input, self.command_attempts, &self.metadata).await?;
|
|
6259
|
+
if self.track_causal_writes
|
|
6260
|
+
&& let Some(commit_sequence) = result.commit_sequence
|
|
6261
|
+
&& commit_sequence > 0
|
|
6262
|
+
&& self.read_after_commit.is_none_or(|current| commit_sequence > current)
|
|
6263
|
+
{
|
|
6264
|
+
self.read_after_commit = Some(commit_sequence);
|
|
6265
|
+
}
|
|
6266
|
+
Ok(result)
|
|
6267
|
+
}
|
|
6268
|
+
|
|
6269
|
+
pub async fn reset_credential_password_batch(&self, inputs: Vec<ResetCredentialPasswordInput>, options: GeneratedBatchOptions) -> Result<GeneratedBatchResult<ResetCredentialPasswordOutcome>, GeneratedBatchError> {
|
|
6270
|
+
self.client.execute_generated_command_batch(inputs, options, self.command_attempts, &self.metadata).await
|
|
6271
|
+
}
|
|
6272
|
+
|
|
6273
|
+
pub async fn reset_credential_password_batch_with_progress<F>(&self, inputs: Vec<ResetCredentialPasswordInput>, options: GeneratedBatchOptions, progress: F) -> Result<GeneratedBatchResult<ResetCredentialPasswordOutcome>, GeneratedBatchError>
|
|
6274
|
+
where
|
|
6275
|
+
F: FnMut(GeneratedBatchProgress),
|
|
6276
|
+
{
|
|
6277
|
+
self.client.execute_generated_command_batch_with_progress(inputs, options, self.command_attempts, &self.metadata, progress).await
|
|
6278
|
+
}
|
|
6279
|
+
|
|
5807
6280
|
pub async fn update_account(&mut self, input: UpdateAccountInput) -> Result<TypedCommandResult<UpdateAccountOutcome>, ApplicationClientError> {
|
|
5808
6281
|
let result: TypedCommandResult<UpdateAccountOutcome> = self.client.execute_generated_command(&input, self.command_attempts, &self.metadata).await?;
|
|
5809
6282
|
if self.track_causal_writes
|
|
@@ -5850,6 +6323,29 @@ impl RiffDBBetterAuthCoreClient {
|
|
|
5850
6323
|
self.client.execute_generated_command_batch_with_progress(inputs, options, self.command_attempts, &self.metadata, progress).await
|
|
5851
6324
|
}
|
|
5852
6325
|
|
|
6326
|
+
pub async fn update_credential_password(&mut self, input: UpdateCredentialPasswordInput) -> Result<TypedCommandResult<UpdateCredentialPasswordOutcome>, ApplicationClientError> {
|
|
6327
|
+
let result: TypedCommandResult<UpdateCredentialPasswordOutcome> = self.client.execute_generated_command(&input, self.command_attempts, &self.metadata).await?;
|
|
6328
|
+
if self.track_causal_writes
|
|
6329
|
+
&& let Some(commit_sequence) = result.commit_sequence
|
|
6330
|
+
&& commit_sequence > 0
|
|
6331
|
+
&& self.read_after_commit.is_none_or(|current| commit_sequence > current)
|
|
6332
|
+
{
|
|
6333
|
+
self.read_after_commit = Some(commit_sequence);
|
|
6334
|
+
}
|
|
6335
|
+
Ok(result)
|
|
6336
|
+
}
|
|
6337
|
+
|
|
6338
|
+
pub async fn update_credential_password_batch(&self, inputs: Vec<UpdateCredentialPasswordInput>, options: GeneratedBatchOptions) -> Result<GeneratedBatchResult<UpdateCredentialPasswordOutcome>, GeneratedBatchError> {
|
|
6339
|
+
self.client.execute_generated_command_batch(inputs, options, self.command_attempts, &self.metadata).await
|
|
6340
|
+
}
|
|
6341
|
+
|
|
6342
|
+
pub async fn update_credential_password_batch_with_progress<F>(&self, inputs: Vec<UpdateCredentialPasswordInput>, options: GeneratedBatchOptions, progress: F) -> Result<GeneratedBatchResult<UpdateCredentialPasswordOutcome>, GeneratedBatchError>
|
|
6343
|
+
where
|
|
6344
|
+
F: FnMut(GeneratedBatchProgress),
|
|
6345
|
+
{
|
|
6346
|
+
self.client.execute_generated_command_batch_with_progress(inputs, options, self.command_attempts, &self.metadata, progress).await
|
|
6347
|
+
}
|
|
6348
|
+
|
|
5853
6349
|
pub async fn update_session(&mut self, input: UpdateSessionInput) -> Result<TypedCommandResult<UpdateSessionOutcome>, ApplicationClientError> {
|
|
5854
6350
|
let result: TypedCommandResult<UpdateSessionOutcome> = self.client.execute_generated_command(&input, self.command_attempts, &self.metadata).await?;
|
|
5855
6351
|
if self.track_causal_writes
|