@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/dist/generated/client.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
// @generated by riffdb-query-module; do not edit.
|
|
2
|
-
export const QUERY_MODULE_HASH = "
|
|
2
|
+
export const QUERY_MODULE_HASH = "8dff3a38f6c0a915d7653e7571a2ef5795a89b452990d705f38fe0ac93b5ad9a";
|
|
3
3
|
export const CONTRACT_LINEAGE = "RiffDBBetterAuthCore";
|
|
4
4
|
export const CONTRACT_VERSION = 1;
|
|
5
|
-
export const CONTRACT_BUNDLE_HASH = "
|
|
5
|
+
export const CONTRACT_BUNDLE_HASH = "74fd255eefcf04f0b054dbb6c4a0bed43a7312d82f7755687c9229ee3206ddfc";
|
|
6
|
+
export const CONTRACT_DRIVER_IDENTITY = {
|
|
7
|
+
contractLineage: CONTRACT_LINEAGE,
|
|
8
|
+
contractVersion: BigInt(CONTRACT_VERSION),
|
|
9
|
+
contractBundleHash: CONTRACT_BUNDLE_HASH,
|
|
10
|
+
};
|
|
11
|
+
export function driverIdentity(role, database) {
|
|
12
|
+
return database === undefined ? { ...CONTRACT_DRIVER_IDENTITY, role } : { ...CONTRACT_DRIVER_IDENTITY, role, database };
|
|
13
|
+
}
|
|
6
14
|
export const APPLICATION_ERROR_REGISTRY = {
|
|
7
15
|
"RDB-APP-0001": ["application request is structurally invalid", "input", "correct_request", ["correct_input"]],
|
|
8
16
|
"RDB-INPUT-0101": ["application input is invalid", "input", "correct_request", ["correct_input"]],
|
|
@@ -148,7 +156,7 @@ function compactTimestamp(value) {
|
|
|
148
156
|
throw new Error("invalid RiffDB compact value");
|
|
149
157
|
return { seconds, nanos: record.nanos };
|
|
150
158
|
}
|
|
151
|
-
export const ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH = "
|
|
159
|
+
export const ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH = "056edbaabe43e1dc95f1f6af9838747f54d927a90d5bc9f2be045ae266d107d3";
|
|
152
160
|
export function isAdminUsersAllEmailAscFound(value) {
|
|
153
161
|
return value.outcome === "Found";
|
|
154
162
|
}
|
|
@@ -161,9 +169,9 @@ export function unwrapAdminUsersAllEmailAscFound(value) {
|
|
|
161
169
|
export function adminUsersAllEmailAsc(parameters) {
|
|
162
170
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
163
171
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
164
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_all_email_asc", inputSchemaHash: "
|
|
172
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_all_email_asc", inputSchemaHash: "6f126f498c06a6648d15a6403e27e29890892d64f010ef3d89b3470124ebdd5f" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersAllEmailAsc", planHash: ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "minimum_email", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
165
173
|
}
|
|
166
|
-
export const ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH = "
|
|
174
|
+
export const ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH = "b64d213477dd2275d98422a6c3460b0cae932dd96255fe9d565005e8afa37fc4";
|
|
167
175
|
export function isAdminUsersContainsAscFound(value) {
|
|
168
176
|
return value.outcome === "Found";
|
|
169
177
|
}
|
|
@@ -176,9 +184,9 @@ export function unwrapAdminUsersContainsAscFound(value) {
|
|
|
176
184
|
export function adminUsersContainsAsc(parameters) {
|
|
177
185
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
178
186
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
179
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_contains_asc", inputSchemaHash: "
|
|
187
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_contains_asc", inputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersContainsAsc", planHash: ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "needle", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
180
188
|
}
|
|
181
|
-
export const ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH = "
|
|
189
|
+
export const ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH = "57aba8cf311c301e985adc324f97b4d963a38e6efa6058a82e248854d75f2f05";
|
|
182
190
|
export function isAdminUsersContainsDescFound(value) {
|
|
183
191
|
return value.outcome === "Found";
|
|
184
192
|
}
|
|
@@ -191,9 +199,9 @@ export function unwrapAdminUsersContainsDescFound(value) {
|
|
|
191
199
|
export function adminUsersContainsDesc(parameters) {
|
|
192
200
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
193
201
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
194
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_contains_desc", inputSchemaHash: "
|
|
202
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_contains_desc", inputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersContainsDesc", planHash: ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "needle", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
195
203
|
}
|
|
196
|
-
export const ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH = "
|
|
204
|
+
export const ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH = "7aede9eda624f5b4eb4280ca7b8a1421466ce30091177c9abab4f125987eb4ff";
|
|
197
205
|
export function isAdminUsersEmailContainsCreatedDescFound(value) {
|
|
198
206
|
return value.outcome === "Found";
|
|
199
207
|
}
|
|
@@ -206,9 +214,9 @@ export function unwrapAdminUsersEmailContainsCreatedDescFound(value) {
|
|
|
206
214
|
export function adminUsersEmailContainsCreatedDesc(parameters) {
|
|
207
215
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
208
216
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
209
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_email_contains_created_desc", inputSchemaHash: "
|
|
217
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_email_contains_created_desc", inputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersEmailContainsCreatedDesc", planHash: ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "needle", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
210
218
|
}
|
|
211
|
-
export const ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH = "
|
|
219
|
+
export const ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH = "453cb6c81f506a1f0ac99bed3cc85da59176d2cb83597d5812d771683a60cb4c";
|
|
212
220
|
export function isAdminUsersEmailContainsImageAscFound(value) {
|
|
213
221
|
return value.outcome === "Found";
|
|
214
222
|
}
|
|
@@ -221,9 +229,9 @@ export function unwrapAdminUsersEmailContainsImageAscFound(value) {
|
|
|
221
229
|
export function adminUsersEmailContainsImageAsc(parameters) {
|
|
222
230
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
223
231
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
224
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_email_contains_image_asc", inputSchemaHash: "
|
|
232
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_email_contains_image_asc", inputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersEmailContainsImageAsc", planHash: ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "needle", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
225
233
|
}
|
|
226
|
-
export const ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH = "
|
|
234
|
+
export const ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH = "924c7acfdcf3f7970917ac611b6eafc9175ac69f735d9e1cc01414fcc6f0e696";
|
|
227
235
|
export function isAdminUsersEndsWithAscFound(value) {
|
|
228
236
|
return value.outcome === "Found";
|
|
229
237
|
}
|
|
@@ -236,9 +244,9 @@ export function unwrapAdminUsersEndsWithAscFound(value) {
|
|
|
236
244
|
export function adminUsersEndsWithAsc(parameters) {
|
|
237
245
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
238
246
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
239
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_ends_with_asc", inputSchemaHash: "
|
|
247
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_ends_with_asc", inputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersEndsWithAsc", planHash: ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "needle", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
240
248
|
}
|
|
241
|
-
export const ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH = "
|
|
249
|
+
export const ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH = "cab8ad8456533e4ce97388948e4f703cac6f2eebb641b83a91c3b005ece7fffb";
|
|
242
250
|
export function isAdminUsersEndsWithDescFound(value) {
|
|
243
251
|
return value.outcome === "Found";
|
|
244
252
|
}
|
|
@@ -251,9 +259,9 @@ export function unwrapAdminUsersEndsWithDescFound(value) {
|
|
|
251
259
|
export function adminUsersEndsWithDesc(parameters) {
|
|
252
260
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
253
261
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
254
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_ends_with_desc", inputSchemaHash: "
|
|
262
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_ends_with_desc", inputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersEndsWithDesc", planHash: ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "needle", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
255
263
|
}
|
|
256
|
-
export const ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH = "
|
|
264
|
+
export const ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH = "add0aed3dbd0caea0de2857133a857d49eb7bfc0e031d117270cc873137da5ec";
|
|
257
265
|
export function isAdminUsersStartsWithAscFound(value) {
|
|
258
266
|
return value.outcome === "Found";
|
|
259
267
|
}
|
|
@@ -266,9 +274,9 @@ export function unwrapAdminUsersStartsWithAscFound(value) {
|
|
|
266
274
|
export function adminUsersStartsWithAsc(parameters) {
|
|
267
275
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
268
276
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
269
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_starts_with_asc", inputSchemaHash: "
|
|
277
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_starts_with_asc", inputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersStartsWithAsc", planHash: ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "needle", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
270
278
|
}
|
|
271
|
-
export const ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH = "
|
|
279
|
+
export const ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH = "23c1561fb3956217e79d1b358be468e55c4021b887e927a4fb3c0484c92be872";
|
|
272
280
|
export function isAdminUsersStartsWithDescFound(value) {
|
|
273
281
|
return value.outcome === "Found";
|
|
274
282
|
}
|
|
@@ -281,9 +289,9 @@ export function unwrapAdminUsersStartsWithDescFound(value) {
|
|
|
281
289
|
export function adminUsersStartsWithDesc(parameters) {
|
|
282
290
|
if (parameters.limit !== undefined && (!Number.isSafeInteger(parameters.limit) || parameters.limit < 1 || parameters.limit > 100))
|
|
283
291
|
throw new RangeError("limit must be an integer from 1 through 100");
|
|
284
|
-
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_starts_with_desc", inputSchemaHash: "
|
|
292
|
+
return { driverOperation: { name: "riffdb_better_auth_core_admin_users_starts_with_desc", inputSchemaHash: "9ffe6e4d932b3572aefb9d58255932828b4b85445b0312722b3c8be772bdd11b" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "AdminUsersStartsWithDesc", planHash: ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "needle", "schema": { "kind": "string" } }, { "name": "user_id", "schema": { "kind": "optional", "value": { "kind": "uuid" } } }, { "name": "limit", "schema": { "kind": "limit", "maximum": 100 } }, { "name": "offset", "schema": { "kind": "u64" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }, { "name": "total", "schema": { "fields": [{ "name": "value", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
285
293
|
}
|
|
286
|
-
export const FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH = "
|
|
294
|
+
export const FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH = "14a08df3dd8a74ea0a5622804bf0c2424086ee73eb10ce57d7df336a7d25f5ba";
|
|
287
295
|
export const FIND_ACCOUNT_BY_ID_SECRET_OUTPUTS = [
|
|
288
296
|
{ query: "FindAccountById", entity: "Account", field: "access_token" },
|
|
289
297
|
{ query: "FindAccountById", entity: "Account", field: "refresh_token" },
|
|
@@ -305,7 +313,7 @@ export function redactFindAccountByIdResult(value) {
|
|
|
305
313
|
export function findAccountById(parameters) {
|
|
306
314
|
return { driverOperation: { name: "riffdb_better_auth_core_find_account_by_id", inputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindAccountById", planHash: FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "id", "schema": { "kind": "uuid" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "accounts", "schema": { "kind": "list", "maximum": 1, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "account_id", "schema": { "kind": "string" } }, { "name": "provider_id", "schema": { "kind": "string" } }, { "name": "access_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "refresh_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "access_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "refresh_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "scope", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "id_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "password", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
307
315
|
}
|
|
308
|
-
export const FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH = "
|
|
316
|
+
export const FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH = "e6c4517a46d725780e79725ca3fdaba2208ef4b282d49f484121eee76c043831";
|
|
309
317
|
export const FIND_ACCOUNT_BY_PROVIDER_SECRET_OUTPUTS = [
|
|
310
318
|
{ query: "FindAccountByProvider", entity: "Account", field: "access_token" },
|
|
311
319
|
{ query: "FindAccountByProvider", entity: "Account", field: "refresh_token" },
|
|
@@ -327,7 +335,7 @@ export function redactFindAccountByProviderResult(value) {
|
|
|
327
335
|
export function findAccountByProvider(parameters) {
|
|
328
336
|
return { driverOperation: { name: "riffdb_better_auth_core_find_account_by_provider", inputSchemaHash: "7e48e77594d132efa4753eee93934c2ef61f6d82313edff8f7c84c7d8d4112f2" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindAccountByProvider", planHash: FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "account_id", "schema": { "kind": "string" } }, { "name": "provider_id", "schema": { "kind": "string" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "accounts", "schema": { "kind": "list", "maximum": 1, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "account_id", "schema": { "kind": "string" } }, { "name": "provider_id", "schema": { "kind": "string" } }, { "name": "access_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "refresh_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "access_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "refresh_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "scope", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "id_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "password", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
329
337
|
}
|
|
330
|
-
export const FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH = "
|
|
338
|
+
export const FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH = "ccdc524ca64ad667c209de25b4ce977f43b53ffdd8eb1b70fedf29fc99f27da6";
|
|
331
339
|
export const FIND_ACCOUNTS_BY_USER_ID_SECRET_OUTPUTS = [
|
|
332
340
|
{ query: "FindAccountsByUserId", entity: "Account", field: "access_token" },
|
|
333
341
|
{ query: "FindAccountsByUserId", entity: "Account", field: "refresh_token" },
|
|
@@ -349,7 +357,7 @@ export function redactFindAccountsByUserIdResult(value) {
|
|
|
349
357
|
export function findAccountsByUserId(parameters) {
|
|
350
358
|
return { driverOperation: { name: "riffdb_better_auth_core_find_accounts_by_user_id", inputSchemaHash: "52291caa82b70870673211137e93f3ecda460cbe7b9fc465f0b9d7f30df05798" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindAccountsByUserId", planHash: FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "after", "schema": { "kind": "optional", "value": { "kind": "cursor" } } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "accounts", "schema": { "kind": "list", "maximum": 100, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "account_id", "schema": { "kind": "string" } }, { "name": "provider_id", "schema": { "kind": "string" } }, { "name": "access_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "refresh_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "access_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "refresh_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "scope", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "id_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "password", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
351
359
|
}
|
|
352
|
-
export const FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH = "
|
|
360
|
+
export const FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH = "21d13b3c30b4a4059f3c436e290d11c20f0f1d1154e05fb48ae3dd0da882526d";
|
|
353
361
|
export const FIND_ACCOUNTS_BY_USER_PROVIDER_SECRET_OUTPUTS = [
|
|
354
362
|
{ query: "FindAccountsByUserProvider", entity: "Account", field: "access_token" },
|
|
355
363
|
{ query: "FindAccountsByUserProvider", entity: "Account", field: "refresh_token" },
|
|
@@ -371,7 +379,7 @@ export function redactFindAccountsByUserProviderResult(value) {
|
|
|
371
379
|
export function findAccountsByUserProvider(parameters) {
|
|
372
380
|
return { driverOperation: { name: "riffdb_better_auth_core_find_accounts_by_user_provider", inputSchemaHash: "f389d8fa7caa4fcb96e1004158f88ce43ae9bccac48b8bf74087eab48c022df7" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindAccountsByUserProvider", planHash: FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "provider_id", "schema": { "kind": "string" } }, { "name": "after", "schema": { "kind": "optional", "value": { "kind": "cursor" } } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "accounts", "schema": { "kind": "list", "maximum": 8, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "account_id", "schema": { "kind": "string" } }, { "name": "provider_id", "schema": { "kind": "string" } }, { "name": "access_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "refresh_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "access_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "refresh_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "scope", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "id_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "password", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
373
381
|
}
|
|
374
|
-
export const FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH = "
|
|
382
|
+
export const FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH = "de1e5232a64a32057699b5ac21f1b43e69d755a3c143595f906fe63e16147264";
|
|
375
383
|
export const FIND_ACTIVE_SESSIONS_BY_USER_ID_SECRET_OUTPUTS = [
|
|
376
384
|
{ query: "FindActiveSessionsByUserId", entity: "Session", field: "token" },
|
|
377
385
|
];
|
|
@@ -390,7 +398,29 @@ export function redactFindActiveSessionsByUserIdResult(value) {
|
|
|
390
398
|
export function findActiveSessionsByUserId(parameters) {
|
|
391
399
|
return { driverOperation: { name: "riffdb_better_auth_core_find_active_sessions_by_user_id", inputSchemaHash: "56f77f3deba14d9fd74810cf14012109ddc4ba2f58c27a400a180df31ee38feb" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindActiveSessionsByUserId", planHash: FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "expires_after", "schema": { "kind": "timestamp" } }, { "name": "after", "schema": { "kind": "optional", "value": { "kind": "cursor" } } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "sessions", "schema": { "kind": "list", "maximum": 32, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "token", "schema": { "kind": "string" } }, { "name": "expires_at", "schema": { "kind": "timestamp" } }, { "name": "ip_address", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "user_agent", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
392
400
|
}
|
|
393
|
-
export const
|
|
401
|
+
export const FIND_CREDENTIAL_ACCOUNT_QUERY_PLAN_HASH = "f968271d103a76cc6b2a5496f5cceffe4cff5aa39d2a370379b518d8e7d90771";
|
|
402
|
+
export const FIND_CREDENTIAL_ACCOUNT_SECRET_OUTPUTS = [
|
|
403
|
+
{ query: "FindCredentialAccount", entity: "Account", field: "access_token" },
|
|
404
|
+
{ query: "FindCredentialAccount", entity: "Account", field: "refresh_token" },
|
|
405
|
+
{ query: "FindCredentialAccount", entity: "Account", field: "id_token" },
|
|
406
|
+
{ query: "FindCredentialAccount", entity: "Account", field: "password" },
|
|
407
|
+
];
|
|
408
|
+
export function isFindCredentialAccountFound(value) {
|
|
409
|
+
return value.outcome === "Found";
|
|
410
|
+
}
|
|
411
|
+
export function unwrapFindCredentialAccountFound(value) {
|
|
412
|
+
const resolved = ("identity" in value && "applicationHead" in value && "value" in value ? value.value : value);
|
|
413
|
+
if (resolved.outcome !== "Found")
|
|
414
|
+
throw new Error(`expected FindCredentialAccount outcome "Found", got "${resolved.outcome}"`);
|
|
415
|
+
return resolved;
|
|
416
|
+
}
|
|
417
|
+
export function redactFindCredentialAccountResult(value) {
|
|
418
|
+
return { outcome: value.outcome, redactedSecretOutputs: FIND_CREDENTIAL_ACCOUNT_SECRET_OUTPUTS };
|
|
419
|
+
}
|
|
420
|
+
export function findCredentialAccount(parameters) {
|
|
421
|
+
return { driverOperation: { name: "riffdb_better_auth_core_find_credential_account", inputSchemaHash: "108a21aa464170aff1274c8f9af12f9c84d899483e63eb62f4fc9bed6e4fc040" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindCredentialAccount", planHash: FIND_CREDENTIAL_ACCOUNT_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "account_id", "schema": { "kind": "string" } }, { "name": "provider_id", "schema": { "kind": "string" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "accounts", "schema": { "kind": "list", "maximum": 1, "value": { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "id", "schema": { "kind": "uuid" } }, { "name": "account_id", "schema": { "kind": "string" } }, { "name": "provider_id", "schema": { "kind": "string" } }, { "name": "access_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "refresh_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "id_token", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "password", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "access_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "refresh_token_expires_at", "schema": { "kind": "optional", "value": { "kind": "timestamp" } } }, { "name": "scope", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
422
|
+
}
|
|
423
|
+
export const FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH = "6c799850ba3b2eb3222aac85a76f40492c46de76870075b029f3b4ac897ed8b9";
|
|
394
424
|
export function isFindExpiredVerificationIdsFound(value) {
|
|
395
425
|
return value.outcome === "Found";
|
|
396
426
|
}
|
|
@@ -403,7 +433,7 @@ export function unwrapFindExpiredVerificationIdsFound(value) {
|
|
|
403
433
|
export function findExpiredVerificationIds(parameters) {
|
|
404
434
|
return { driverOperation: { name: "riffdb_better_auth_core_find_expired_verification_ids", inputSchemaHash: "b2397d3409885ae750a1d8b4d53bc6905e59348dfc79f0b4d2934981ad4cb1b2" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindExpiredVerificationIds", planHash: FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "expires_before", "schema": { "kind": "timestamp" } }, { "name": "after", "schema": { "kind": "optional", "value": { "kind": "cursor" } } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "verifications", "schema": { "kind": "list", "maximum": 32, "value": { "fields": [{ "name": "verification_id", "schema": { "kind": "uuid" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
405
435
|
}
|
|
406
|
-
export const FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH = "
|
|
436
|
+
export const FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH = "b3832c0a8a316d3fcbc62b388fbe09ceb6624b55482195f7642553467cba6fcb";
|
|
407
437
|
export const FIND_LATEST_VERIFICATION_SECRET_OUTPUTS = [
|
|
408
438
|
{ query: "FindLatestVerification", entity: "Verification", field: "value" },
|
|
409
439
|
];
|
|
@@ -422,7 +452,7 @@ export function redactFindLatestVerificationResult(value) {
|
|
|
422
452
|
export function findLatestVerification(parameters) {
|
|
423
453
|
return { driverOperation: { name: "riffdb_better_auth_core_find_latest_verification", inputSchemaHash: "414c00deb31dd873e434c8006a8caa9d2b360457abe0f8269440d6c761dfdc94" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindLatestVerification", planHash: FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "identifier", "schema": { "kind": "string" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "verifications", "schema": { "kind": "list", "maximum": 1, "value": { "fields": [{ "name": "verification_id", "schema": { "kind": "uuid" } }, { "name": "identifier", "schema": { "kind": "string" } }, { "name": "value", "schema": { "kind": "string" } }, { "name": "expires_at", "schema": { "kind": "timestamp" } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
424
454
|
}
|
|
425
|
-
export const FIND_SESSION_BY_ID_QUERY_PLAN_HASH = "
|
|
455
|
+
export const FIND_SESSION_BY_ID_QUERY_PLAN_HASH = "c92eb2035c0e3ca7dedbaa42a4e2efe7bc4786a65213394da7f5d3beb579a2a1";
|
|
426
456
|
export const FIND_SESSION_BY_ID_SECRET_OUTPUTS = [
|
|
427
457
|
{ query: "FindSessionById", entity: "Session", field: "token" },
|
|
428
458
|
];
|
|
@@ -441,7 +471,7 @@ export function redactFindSessionByIdResult(value) {
|
|
|
441
471
|
export function findSessionById(parameters) {
|
|
442
472
|
return { driverOperation: { name: "riffdb_better_auth_core_find_session_by_id", inputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindSessionById", planHash: FIND_SESSION_BY_ID_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "id", "schema": { "kind": "uuid" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "sessions", "schema": { "kind": "list", "maximum": 1, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "token", "schema": { "kind": "string" } }, { "name": "expires_at", "schema": { "kind": "timestamp" } }, { "name": "ip_address", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "user_agent", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
443
473
|
}
|
|
444
|
-
export const FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH = "
|
|
474
|
+
export const FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH = "a8a12334a3d34c30d54be828bdcc9b9b77223303c3f9681e4a602c92341876ec";
|
|
445
475
|
export const FIND_SESSION_BY_TOKEN_SECRET_OUTPUTS = [
|
|
446
476
|
{ query: "FindSessionByToken", entity: "Session", field: "token" },
|
|
447
477
|
];
|
|
@@ -460,7 +490,8 @@ export function redactFindSessionByTokenResult(value) {
|
|
|
460
490
|
export function findSessionByToken(parameters) {
|
|
461
491
|
return { driverOperation: { name: "riffdb_better_auth_core_find_session_by_token", inputSchemaHash: "0ff142e840e9d2d322c37be4688526fc1348f508cc4976856bd7e4d2570859e8" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindSessionByToken", planHash: FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "token", "schema": { "kind": "string" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "sessions", "schema": { "kind": "list", "maximum": 1, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "token", "schema": { "kind": "string" } }, { "name": "expires_at", "schema": { "kind": "timestamp" } }, { "name": "ip_address", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "user_agent", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
462
492
|
}
|
|
463
|
-
export const FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH = "
|
|
493
|
+
export const FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH = "7e23187b537599c4c2361d34ea866b5b719f63feda0135587b5ec6afd5ce62f6";
|
|
494
|
+
export const FIND_SESSIONS_BY_TOKEN_SET_TOKENS_MAX_ITEMS = 32;
|
|
464
495
|
export const FIND_SESSIONS_BY_TOKEN_SET_SECRET_OUTPUTS = [
|
|
465
496
|
{ query: "FindSessionsByTokenSet", entity: "Session", field: "token" },
|
|
466
497
|
];
|
|
@@ -479,7 +510,7 @@ export function redactFindSessionsByTokenSetResult(value) {
|
|
|
479
510
|
export function findSessionsByTokenSet(parameters) {
|
|
480
511
|
return { driverOperation: { name: "riffdb_better_auth_core_find_sessions_by_token_set", inputSchemaHash: "6e07645237cd913d73a45bd7f863e3ca8d9ae09fdfecdb7494246fa80dea3899" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindSessionsByTokenSet", planHash: FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "tokens", "schema": { "kind": "list", "value": { "kind": "string" } } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "sessions", "schema": { "kind": "list", "maximum": 32, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "token", "schema": { "kind": "string" } }, { "name": "expires_at", "schema": { "kind": "timestamp" } }, { "name": "ip_address", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "user_agent", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
481
512
|
}
|
|
482
|
-
export const FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH = "
|
|
513
|
+
export const FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH = "a3277546d8b0c0059b850c368ae4925000c255e69b7ff005f4b3d2ef61b504af";
|
|
483
514
|
export const FIND_SESSIONS_BY_USER_ID_SECRET_OUTPUTS = [
|
|
484
515
|
{ query: "FindSessionsByUserId", entity: "Session", field: "token" },
|
|
485
516
|
];
|
|
@@ -498,7 +529,7 @@ export function redactFindSessionsByUserIdResult(value) {
|
|
|
498
529
|
export function findSessionsByUserId(parameters) {
|
|
499
530
|
return { driverOperation: { name: "riffdb_better_auth_core_find_sessions_by_user_id", inputSchemaHash: "52291caa82b70870673211137e93f3ecda460cbe7b9fc465f0b9d7f30df05798" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindSessionsByUserId", planHash: FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "after", "schema": { "kind": "optional", "value": { "kind": "cursor" } } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "sessions", "schema": { "kind": "list", "maximum": 32, "value": { "fields": [{ "name": "id", "schema": { "kind": "uuid" } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "token", "schema": { "kind": "string" } }, { "name": "expires_at", "schema": { "kind": "timestamp" } }, { "name": "ip_address", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "user_agent", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
500
531
|
}
|
|
501
|
-
export const FIND_USER_BY_EMAIL_QUERY_PLAN_HASH = "
|
|
532
|
+
export const FIND_USER_BY_EMAIL_QUERY_PLAN_HASH = "b167b8cb2fb5ce19685491b47da4e816665b840e0f0e463666f6302134472b9a";
|
|
502
533
|
export function isFindUserByEmailFound(value) {
|
|
503
534
|
return value.outcome === "Found";
|
|
504
535
|
}
|
|
@@ -533,7 +564,7 @@ function decodeFindUserByEmailCompact(value) {
|
|
|
533
564
|
export function findUserByEmail(parameters) {
|
|
534
565
|
return { driverOperation: { name: "riffdb_better_auth_core_find_user_by_email", inputSchemaHash: "7d3b1da87ea1ee59893e110cd8f8a5eacb522a8fde24a7e8aa9b7c13340990b9" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindUserByEmail", planHash: FIND_USER_BY_EMAIL_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "email", "schema": { "kind": "string" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "users", "schema": { "kind": "list", "maximum": 1, "value": { "fields": [{ "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } } }], "kind": "record" } }, compactDecoder: decodeFindUserByEmailCompact, decodeError: decodeApplicationError };
|
|
535
566
|
}
|
|
536
|
-
export const FIND_USER_BY_ID_QUERY_PLAN_HASH = "
|
|
567
|
+
export const FIND_USER_BY_ID_QUERY_PLAN_HASH = "25d4a0a77d5df64ab6187528f9fac6b205a03c33e01c9ea6b573e8316b78b924";
|
|
537
568
|
export function isFindUserByIdFound(value) {
|
|
538
569
|
return value.outcome === "Found";
|
|
539
570
|
}
|
|
@@ -549,7 +580,7 @@ export function unwrapFindUserByIdFound(value) {
|
|
|
549
580
|
export function findUserById(parameters) {
|
|
550
581
|
return { driverOperation: { name: "riffdb_better_auth_core_find_user_by_id", inputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindUserById", planHash: FIND_USER_BY_ID_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "id", "schema": { "kind": "uuid" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "user", "schema": { "fields": [{ "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "name", "schema": { "kind": "string" } }, { "name": "email", "schema": { "kind": "string" } }, { "name": "email_verified", "schema": { "kind": "bool" } }, { "name": "image", "schema": { "kind": "optional", "value": { "kind": "string" } } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" }, "Missing": { "fields": [], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
551
582
|
}
|
|
552
|
-
export const FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH = "
|
|
583
|
+
export const FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH = "54f07c7eba7d51857dd6473e39304dc798bf7084ca946dfa7f0203633a5133ac";
|
|
553
584
|
export const FIND_VERIFICATION_BY_ID_SECRET_OUTPUTS = [
|
|
554
585
|
{ query: "FindVerificationById", entity: "Verification", field: "value" },
|
|
555
586
|
];
|
|
@@ -571,7 +602,7 @@ export function redactFindVerificationByIdResult(value) {
|
|
|
571
602
|
export function findVerificationById(parameters) {
|
|
572
603
|
return { driverOperation: { name: "riffdb_better_auth_core_find_verification_by_id", inputSchemaHash: "a8efd0b9fe4e36f92ca57a7c5351df748b4c2adbd0e363e2a5ffb66ff4d23bdc" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, contractBundleHash: CONTRACT_BUNDLE_HASH, moduleHash: QUERY_MODULE_HASH, queryName: "FindVerificationById", planHash: FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH, parameters, parameterSchema: { "fields": [{ "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "id", "schema": { "kind": "uuid" } }], "kind": "record" }, resultSchemas: { "Found": { "fields": [{ "name": "verification", "schema": { "fields": [{ "name": "verification_id", "schema": { "kind": "uuid" } }, { "name": "identifier", "schema": { "kind": "string" } }, { "name": "value", "schema": { "kind": "string" } }, { "name": "expires_at", "schema": { "kind": "timestamp" } }, { "name": "created_at", "schema": { "kind": "timestamp" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "revision", "schema": { "kind": "u64" } }], "kind": "record" } }], "kind": "record" }, "Missing": { "fields": [], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
573
604
|
}
|
|
574
|
-
export const FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH = "
|
|
605
|
+
export const FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH = "4c768ae1d966454e9b791cd57a6311476947b5c457020943a50bc3cfee90765b";
|
|
575
606
|
export const FIND_VERIFICATIONS_BY_IDENTIFIER_SECRET_OUTPUTS = [
|
|
576
607
|
{ query: "FindVerificationsByIdentifier", entity: "Verification", field: "value" },
|
|
577
608
|
];
|
|
@@ -620,6 +651,21 @@ export function consumeVerificationSet(input) {
|
|
|
620
651
|
const resolvedInput = input.request_id === idempotencyKey ? input : { ...input, request_id: idempotencyKey };
|
|
621
652
|
return { driverOperation: { name: "riffdb_better_auth_core_consume_verification_set", inputSchemaHash: "ce88d8052f760625503f8a732f9813446ef7cc042d726ee1826c05c437c0929c" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, commandName: "ConsumeVerificationSet", planHash: CONSUME_VERIFICATION_SET_PLAN_HASH, input: resolvedInput, idempotencyKey, inputSchema: { "fields": [{ "name": "request_id", "schema": { "kind": "uuid" } }, { "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "verification_ids", "schema": { "kind": "list", "maximum": 32, "minimum": 1, "value": { "kind": "uuid" } } }], "kind": "record" }, outcomeSchemas: { "VerificationConsumeMissing": { "fields": [], "kind": "record" }, "VerificationSetConsumed": { "fields": [], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
622
653
|
}
|
|
654
|
+
export function isConsumeVerificationSnapshotVerificationConsumed(value) {
|
|
655
|
+
return value.outcome === "VerificationConsumed";
|
|
656
|
+
}
|
|
657
|
+
export function isConsumeVerificationSnapshotVerificationConsumeStale(value) {
|
|
658
|
+
return value.outcome === "VerificationConsumeStale";
|
|
659
|
+
}
|
|
660
|
+
export function isConsumeVerificationSnapshotVerificationConsumeMissing(value) {
|
|
661
|
+
return value.outcome === "VerificationConsumeMissing";
|
|
662
|
+
}
|
|
663
|
+
export const CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH = "1a80a36f34b4699c972fc1e6f48cad3f85da54e202831a6986aea084db09788b";
|
|
664
|
+
export function consumeVerificationSnapshot(input) {
|
|
665
|
+
const idempotencyKey = input.request_id && input.request_id.length > 0 ? input.request_id : globalThis.crypto.randomUUID();
|
|
666
|
+
const resolvedInput = input.request_id === idempotencyKey ? input : { ...input, request_id: idempotencyKey };
|
|
667
|
+
return { driverOperation: { name: "riffdb_better_auth_core_consume_verification_snapshot", inputSchemaHash: "d1ae264c5794d32e6619f9d52b77dd3a4cab39615dd48adb9a2a3b46ff92cd8c" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, commandName: "ConsumeVerificationSnapshot", planHash: CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH, input: resolvedInput, idempotencyKey, inputSchema: { "fields": [{ "name": "request_id", "schema": { "kind": "uuid" } }, { "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "verification_id", "schema": { "kind": "uuid" } }, { "name": "expected_revision", "schema": { "kind": "u64" } }], "kind": "record" }, outcomeSchemas: { "VerificationConsumeMissing": { "fields": [], "kind": "record" }, "VerificationConsumeStale": { "fields": [], "kind": "record" }, "VerificationConsumed": { "fields": [], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
668
|
+
}
|
|
623
669
|
export function isCreateAccountAccountCreated(value) {
|
|
624
670
|
return value.outcome === "AccountCreated";
|
|
625
671
|
}
|
|
@@ -758,6 +804,30 @@ export function deleteVerification(input) {
|
|
|
758
804
|
const resolvedInput = input.request_id === idempotencyKey ? input : { ...input, request_id: idempotencyKey };
|
|
759
805
|
return { driverOperation: { name: "riffdb_better_auth_core_delete_verification", inputSchemaHash: "ce88d8052f760625503f8a732f9813446ef7cc042d726ee1826c05c437c0929c" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, commandName: "DeleteVerification", planHash: DELETE_VERIFICATION_PLAN_HASH, input: resolvedInput, idempotencyKey, inputSchema: { "fields": [{ "name": "request_id", "schema": { "kind": "uuid" } }, { "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "verification_ids", "schema": { "kind": "list", "maximum": 32, "minimum": 1, "value": { "kind": "uuid" } } }], "kind": "record" }, outcomeSchemas: { "VerificationDeleted": { "fields": [], "kind": "record" }, "VerificationMissing": { "fields": [], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
760
806
|
}
|
|
807
|
+
export function isResetCredentialPasswordPasswordAccountStale(value) {
|
|
808
|
+
return value.outcome === "PasswordAccountStale";
|
|
809
|
+
}
|
|
810
|
+
export function isResetCredentialPasswordPasswordAccountMissing(value) {
|
|
811
|
+
return value.outcome === "PasswordAccountMissing";
|
|
812
|
+
}
|
|
813
|
+
export function isResetCredentialPasswordCredentialPasswordReset(value) {
|
|
814
|
+
return value.outcome === "CredentialPasswordReset";
|
|
815
|
+
}
|
|
816
|
+
export function isResetCredentialPasswordPasswordProviderMismatch(value) {
|
|
817
|
+
return value.outcome === "PasswordProviderMismatch";
|
|
818
|
+
}
|
|
819
|
+
export function isResetCredentialPasswordVerificationConsumeStale(value) {
|
|
820
|
+
return value.outcome === "VerificationConsumeStale";
|
|
821
|
+
}
|
|
822
|
+
export function isResetCredentialPasswordVerificationConsumeMissing(value) {
|
|
823
|
+
return value.outcome === "VerificationConsumeMissing";
|
|
824
|
+
}
|
|
825
|
+
export const RESET_CREDENTIAL_PASSWORD_PLAN_HASH = "ed87f267831fb0823b0e9bbf51d7b302a715a95c0cea69faf7922c0e4e7f375e";
|
|
826
|
+
export function resetCredentialPassword(input) {
|
|
827
|
+
const idempotencyKey = input.request_id && input.request_id.length > 0 ? input.request_id : globalThis.crypto.randomUUID();
|
|
828
|
+
const resolvedInput = input.request_id === idempotencyKey ? input : { ...input, request_id: idempotencyKey };
|
|
829
|
+
return { driverOperation: { name: "riffdb_better_auth_core_reset_credential_password", inputSchemaHash: "b9959320d1fe50eba09aa488169566453c4ed9a58c27a338455e204b7f0c708d" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, commandName: "ResetCredentialPassword", planHash: RESET_CREDENTIAL_PASSWORD_PLAN_HASH, input: resolvedInput, idempotencyKey, inputSchema: { "fields": [{ "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "password", "schema": { "kind": "string" } }, { "name": "account_id", "schema": { "kind": "uuid" } }, { "name": "request_id", "schema": { "kind": "uuid" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "account_revision", "schema": { "kind": "u64" } }, { "name": "verification_ids", "schema": { "kind": "list", "maximum": 1, "minimum": 1, "value": { "kind": "uuid" } } }, { "name": "external_account_id", "schema": { "kind": "string" } }, { "name": "verification_revision", "schema": { "kind": "u64" } }], "kind": "record" }, outcomeSchemas: { "CredentialPasswordReset": { "fields": [], "kind": "record" }, "PasswordAccountMissing": { "fields": [], "kind": "record" }, "PasswordAccountStale": { "fields": [], "kind": "record" }, "PasswordProviderMismatch": { "fields": [], "kind": "record" }, "VerificationConsumeMissing": { "fields": [], "kind": "record" }, "VerificationConsumeStale": { "fields": [], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
830
|
+
}
|
|
761
831
|
export function isUpdateAccountAccountUpdated(value) {
|
|
762
832
|
return value.outcome === "AccountUpdated";
|
|
763
833
|
}
|
|
@@ -791,6 +861,24 @@ export function updateAccountPasswords(input) {
|
|
|
791
861
|
const resolvedInput = input.request_id === idempotencyKey ? input : { ...input, request_id: idempotencyKey };
|
|
792
862
|
return { driverOperation: { name: "riffdb_better_auth_core_update_account_passwords", inputSchemaHash: "f210cf13f349297bad0bd949bdfbb796e37ea4dfa24b99d6205942afdde0883c" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, commandName: "UpdateAccountPasswords", planHash: UPDATE_ACCOUNT_PASSWORDS_PLAN_HASH, input: resolvedInput, idempotencyKey, inputSchema: { "fields": [{ "name": "updates", "schema": { "kind": "list", "maximum": 8, "minimum": 1, "value": { "fields": [{ "name": "user_id", "schema": { "kind": "uuid" }, "wireId": 1 }, { "name": "password", "schema": { "kind": "optional", "value": { "kind": "string" } }, "wireId": 2 }, { "name": "account_id", "schema": { "kind": "uuid" }, "wireId": 3 }, { "name": "updated_at", "schema": { "kind": "timestamp" }, "wireId": 4 }, { "name": "provider_id", "schema": { "kind": "string" }, "wireId": 5 }, { "name": "organization_id", "schema": { "kind": "uuid" }, "wireId": 6 }, { "name": "expected_revision", "schema": { "kind": "u64" }, "wireId": 7 }], "kind": "record" } } }, { "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "request_id", "schema": { "kind": "uuid" } }, { "name": "organization_id", "schema": { "kind": "uuid" } }], "kind": "record" }, outcomeSchemas: { "AccountPasswordsUpdated": { "fields": [], "kind": "record" }, "PasswordAccountMissing": { "fields": [], "kind": "record" }, "PasswordAccountStale": { "fields": [], "kind": "record" }, "PasswordProviderMismatch": { "fields": [], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
793
863
|
}
|
|
864
|
+
export function isUpdateCredentialPasswordPasswordAccountStale(value) {
|
|
865
|
+
return value.outcome === "PasswordAccountStale";
|
|
866
|
+
}
|
|
867
|
+
export function isUpdateCredentialPasswordPasswordAccountMissing(value) {
|
|
868
|
+
return value.outcome === "PasswordAccountMissing";
|
|
869
|
+
}
|
|
870
|
+
export function isUpdateCredentialPasswordPasswordProviderMismatch(value) {
|
|
871
|
+
return value.outcome === "PasswordProviderMismatch";
|
|
872
|
+
}
|
|
873
|
+
export function isUpdateCredentialPasswordCredentialPasswordUpdated(value) {
|
|
874
|
+
return value.outcome === "CredentialPasswordUpdated";
|
|
875
|
+
}
|
|
876
|
+
export const UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH = "08781a68739c705ab6ffe51a0de547605e1a7dd2fd2b8075445d40db923d1f15";
|
|
877
|
+
export function updateCredentialPassword(input) {
|
|
878
|
+
const idempotencyKey = input.request_id && input.request_id.length > 0 ? input.request_id : globalThis.crypto.randomUUID();
|
|
879
|
+
const resolvedInput = input.request_id === idempotencyKey ? input : { ...input, request_id: idempotencyKey };
|
|
880
|
+
return { driverOperation: { name: "riffdb_better_auth_core_update_credential_password", inputSchemaHash: "5d4589d948081b8f0d4472fa359bd34ca0c05895eac4e6a99f9015f8f45cc2e7" }, contractLineage: CONTRACT_LINEAGE, contractVersion: CONTRACT_VERSION, commandName: "UpdateCredentialPassword", planHash: UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH, input: resolvedInput, idempotencyKey, inputSchema: { "fields": [{ "name": "user_id", "schema": { "kind": "uuid" } }, { "name": "password", "schema": { "kind": "string" } }, { "name": "account_id", "schema": { "kind": "uuid" } }, { "name": "request_id", "schema": { "kind": "uuid" } }, { "name": "updated_at", "schema": { "kind": "timestamp" } }, { "name": "organization_id", "schema": { "kind": "uuid" } }, { "name": "expected_revision", "schema": { "kind": "u64" } }, { "name": "external_account_id", "schema": { "kind": "string" } }], "kind": "record" }, outcomeSchemas: { "CredentialPasswordUpdated": { "fields": [], "kind": "record" }, "PasswordAccountMissing": { "fields": [], "kind": "record" }, "PasswordAccountStale": { "fields": [], "kind": "record" }, "PasswordProviderMismatch": { "fields": [], "kind": "record" } }, decodeError: decodeApplicationError };
|
|
881
|
+
}
|
|
794
882
|
export function isUpdateSessionSessionUpdated(value) {
|
|
795
883
|
return value.outcome === "SessionUpdated";
|
|
796
884
|
}
|
|
@@ -854,6 +942,20 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
854
942
|
static fromTransport(transport, commandAttemptBudget = DEFAULT_COMMAND_ATTEMPT_BUDGET) {
|
|
855
943
|
return new RiffDBBetterAuthCoreClient(transport, commandAttemptBudget);
|
|
856
944
|
}
|
|
945
|
+
static driverIdentity(role, database) {
|
|
946
|
+
return driverIdentity(role, database);
|
|
947
|
+
}
|
|
948
|
+
static async connect(driver, options) {
|
|
949
|
+
const identity = driverIdentity(options.role, options.database);
|
|
950
|
+
const transport = typeof driver === "function" ? await driver({ socketPath: options.socketPath, identity }) : await driver.connect({ socketPath: options.socketPath, identity });
|
|
951
|
+
return new RiffDBBetterAuthCoreClient(transport, options.commandAttemptBudget ?? DEFAULT_COMMAND_ATTEMPT_BUDGET);
|
|
952
|
+
}
|
|
953
|
+
static async connectFromEnv(driver, options = {}) {
|
|
954
|
+
const { commandAttemptBudget, ...envOptions } = options;
|
|
955
|
+
const connectInput = { ...envOptions, identity: CONTRACT_DRIVER_IDENTITY };
|
|
956
|
+
const transport = typeof driver === "function" ? await driver(connectInput) : await driver.connectFromEnv(connectInput);
|
|
957
|
+
return new RiffDBBetterAuthCoreClient(transport, commandAttemptBudget ?? DEFAULT_COMMAND_ATTEMPT_BUDGET);
|
|
958
|
+
}
|
|
857
959
|
withReadAfterCommit(commitSequence) {
|
|
858
960
|
return new RiffDBBetterAuthCoreClient(this.transport, this.commandAttemptBudget, commitSequence, this.trackCausalWrites);
|
|
859
961
|
}
|
|
@@ -1074,6 +1176,17 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1074
1176
|
currentOptions = { ...currentOptions, cursor: page.nextCursor };
|
|
1075
1177
|
}
|
|
1076
1178
|
}
|
|
1179
|
+
async findCredentialAccount(parameters, options = {}) {
|
|
1180
|
+
const effectiveOptions = this.lastCommitSeq !== undefined && options.readAfterCommit === undefined ? { ...options, readAfterCommit: this.lastCommitSeq } : options;
|
|
1181
|
+
const request = findCredentialAccount(parameters);
|
|
1182
|
+
const result = await this.transport.executeNamedQuery(request, effectiveOptions);
|
|
1183
|
+
if (!acceptsIdentity(request, result.identity))
|
|
1184
|
+
throw new Error("RiffDB application identity mismatch");
|
|
1185
|
+
return result;
|
|
1186
|
+
}
|
|
1187
|
+
async findCredentialAccountAfterCommit(parameters, commitSequence, options = {}) {
|
|
1188
|
+
return this.findCredentialAccount(parameters, { ...options, readAfterCommit: commitSequence });
|
|
1189
|
+
}
|
|
1077
1190
|
async findExpiredVerificationIds(parameters, options = {}) {
|
|
1078
1191
|
const effectiveOptions = this.lastCommitSeq !== undefined && options.readAfterCommit === undefined ? { ...options, readAfterCommit: this.lastCommitSeq } : options;
|
|
1079
1192
|
const { after: generatedCursor, ...routedParameters } = parameters;
|
|
@@ -1148,6 +1261,42 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1148
1261
|
async findSessionsByTokenSetAfterCommit(parameters, commitSequence, options = {}) {
|
|
1149
1262
|
return this.findSessionsByTokenSet(parameters, { ...options, readAfterCommit: commitSequence });
|
|
1150
1263
|
}
|
|
1264
|
+
async findSessionsByTokenSetAll(parameters, maxPages = 64, options = {}) {
|
|
1265
|
+
if (!Number.isInteger(maxPages) || maxPages < 1 || maxPages > 1024)
|
|
1266
|
+
throw new RangeError("maxPages must be an integer from 1 through 1024");
|
|
1267
|
+
if (options.cursor !== undefined)
|
|
1268
|
+
throw new Error("findSessionsByTokenSetAll does not accept an initial cursor");
|
|
1269
|
+
const items = Array.from(new Set(parameters.tokens));
|
|
1270
|
+
if (items.length === 0)
|
|
1271
|
+
throw new RangeError("tokens must contain at least 1 item");
|
|
1272
|
+
const merged = [];
|
|
1273
|
+
let latestIdentity;
|
|
1274
|
+
let pinnedHead = options.readAfterCommit ?? this.lastCommitSeq;
|
|
1275
|
+
let highestHead = 0n;
|
|
1276
|
+
let pagesRemaining = maxPages;
|
|
1277
|
+
for (let offset = 0; offset < items.length; offset += FIND_SESSIONS_BY_TOKEN_SET_TOKENS_MAX_ITEMS) {
|
|
1278
|
+
const chunk = items.slice(offset, offset + FIND_SESSIONS_BY_TOKEN_SET_TOKENS_MAX_ITEMS);
|
|
1279
|
+
let chunkCursor = undefined;
|
|
1280
|
+
while (true) {
|
|
1281
|
+
if (pagesRemaining < 1)
|
|
1282
|
+
throw new RangeError("findSessionsByTokenSetAll exceeded maxPages (1..=1024)");
|
|
1283
|
+
pagesRemaining -= 1;
|
|
1284
|
+
const chunkOptions = { ...options, ...(pinnedHead === undefined ? {} : { readAfterCommit: pinnedHead }), ...(chunkCursor === undefined ? {} : { cursor: chunkCursor }) };
|
|
1285
|
+
const page = await this.findSessionsByTokenSet({ ...parameters, tokens: chunk }, chunkOptions);
|
|
1286
|
+
const found = unwrapFindSessionsByTokenSetFound(page);
|
|
1287
|
+
merged.push(...found.sessions);
|
|
1288
|
+
latestIdentity = page.identity;
|
|
1289
|
+
if (page.applicationHead > highestHead)
|
|
1290
|
+
highestHead = page.applicationHead;
|
|
1291
|
+
if (pinnedHead === undefined || page.applicationHead > pinnedHead)
|
|
1292
|
+
pinnedHead = page.applicationHead;
|
|
1293
|
+
if (page.nextCursor === undefined)
|
|
1294
|
+
break;
|
|
1295
|
+
chunkCursor = page.nextCursor;
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
return { identity: latestIdentity, value: { outcome: "Found", sessions: merged }, applicationHead: highestHead };
|
|
1299
|
+
}
|
|
1151
1300
|
async findSessionsByUserId(parameters, options = {}) {
|
|
1152
1301
|
const effectiveOptions = this.lastCommitSeq !== undefined && options.readAfterCommit === undefined ? { ...options, readAfterCommit: this.lastCommitSeq } : options;
|
|
1153
1302
|
const { after: generatedCursor, ...routedParameters } = parameters;
|
|
@@ -1259,9 +1408,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1259
1408
|
if (start === inputs.length)
|
|
1260
1409
|
return { items: [], checkpoint: start };
|
|
1261
1410
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1262
|
-
const
|
|
1411
|
+
const normalizedInputs = inputs.map((input) => consumeVerification(input).input);
|
|
1412
|
+
const result = await this.transport.executeCommandBatch(consumeVerification(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1413
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1414
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CONSUME_VERIFICATION_PLAN_HASH)
|
|
1415
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1416
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1417
|
+
} return item; });
|
|
1263
1418
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1264
|
-
return result;
|
|
1419
|
+
return { items, checkpoint: result.checkpoint };
|
|
1265
1420
|
}
|
|
1266
1421
|
const items = [];
|
|
1267
1422
|
let next = start;
|
|
@@ -1306,9 +1461,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1306
1461
|
if (start === inputs.length)
|
|
1307
1462
|
return { items: [], checkpoint: start };
|
|
1308
1463
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1309
|
-
const
|
|
1464
|
+
const normalizedInputs = inputs.map((input) => consumeVerificationSet(input).input);
|
|
1465
|
+
const result = await this.transport.executeCommandBatch(consumeVerificationSet(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1466
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1467
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CONSUME_VERIFICATION_SET_PLAN_HASH)
|
|
1468
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1469
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1470
|
+
} return item; });
|
|
1310
1471
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1311
|
-
return result;
|
|
1472
|
+
return { items, checkpoint: result.checkpoint };
|
|
1312
1473
|
}
|
|
1313
1474
|
const items = [];
|
|
1314
1475
|
let next = start;
|
|
@@ -1335,6 +1496,59 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1335
1496
|
items.sort((left, right) => left.index - right.index);
|
|
1336
1497
|
return { items, checkpoint };
|
|
1337
1498
|
}
|
|
1499
|
+
async consumeVerificationSnapshot(input) {
|
|
1500
|
+
const result = await this.transport.executeCommand(consumeVerificationSnapshot(input), this.commandAttemptBudget);
|
|
1501
|
+
if (result.contractVersion !== CONTRACT_VERSION || result.planHash !== CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH)
|
|
1502
|
+
throw new Error("RiffDB application identity mismatch");
|
|
1503
|
+
if (this.trackCausalWrites && result.commitSequence !== undefined && result.commitSequence > 0n && (this.lastCommitSeq === undefined || result.commitSequence > this.lastCommitSeq)) {
|
|
1504
|
+
this.lastCommitSeq = result.commitSequence;
|
|
1505
|
+
}
|
|
1506
|
+
return result;
|
|
1507
|
+
}
|
|
1508
|
+
async consumeVerificationSnapshotBatch(inputs, options) {
|
|
1509
|
+
if (!Number.isInteger(options.concurrency) || options.concurrency < 1 || options.concurrency > MAX_COMMAND_BATCH_CONCURRENCY || inputs.length < 1 || inputs.length > 4096)
|
|
1510
|
+
throw new Error("invalid command batch bounds");
|
|
1511
|
+
const start = options.checkpoint ?? 0;
|
|
1512
|
+
if (!Number.isInteger(start) || start < 0 || start > inputs.length)
|
|
1513
|
+
throw new Error("invalid command batch checkpoint");
|
|
1514
|
+
if (start === inputs.length)
|
|
1515
|
+
return { items: [], checkpoint: start };
|
|
1516
|
+
if (this.transport.executeCommandBatch !== undefined) {
|
|
1517
|
+
const normalizedInputs = inputs.map((input) => consumeVerificationSnapshot(input).input);
|
|
1518
|
+
const result = await this.transport.executeCommandBatch(consumeVerificationSnapshot(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1519
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1520
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH)
|
|
1521
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1522
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1523
|
+
} return item; });
|
|
1524
|
+
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1525
|
+
return { items, checkpoint: result.checkpoint };
|
|
1526
|
+
}
|
|
1527
|
+
const items = [];
|
|
1528
|
+
let next = start;
|
|
1529
|
+
let completed = start;
|
|
1530
|
+
let checkpoint = start;
|
|
1531
|
+
const completedAfterCheckpoint = new Set();
|
|
1532
|
+
const worker = async () => { while (true) {
|
|
1533
|
+
const index = next++;
|
|
1534
|
+
if (index >= inputs.length)
|
|
1535
|
+
return;
|
|
1536
|
+
try {
|
|
1537
|
+
items.push({ index, result: await this.consumeVerificationSnapshot(inputs[index]) });
|
|
1538
|
+
}
|
|
1539
|
+
catch (error) {
|
|
1540
|
+
items.push({ index, error });
|
|
1541
|
+
}
|
|
1542
|
+
completed += 1;
|
|
1543
|
+
completedAfterCheckpoint.add(index);
|
|
1544
|
+
while (completedAfterCheckpoint.delete(checkpoint))
|
|
1545
|
+
checkpoint += 1;
|
|
1546
|
+
options.onProgress?.({ completed, total: inputs.length, checkpoint });
|
|
1547
|
+
} };
|
|
1548
|
+
await Promise.all(Array.from({ length: Math.min(options.concurrency, inputs.length - start) }, worker));
|
|
1549
|
+
items.sort((left, right) => left.index - right.index);
|
|
1550
|
+
return { items, checkpoint };
|
|
1551
|
+
}
|
|
1338
1552
|
async createAccount(input) {
|
|
1339
1553
|
const result = await this.transport.executeCommand(createAccount(input), this.commandAttemptBudget);
|
|
1340
1554
|
if (result.contractVersion !== CONTRACT_VERSION || result.planHash !== CREATE_ACCOUNT_PLAN_HASH)
|
|
@@ -1353,9 +1567,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1353
1567
|
if (start === inputs.length)
|
|
1354
1568
|
return { items: [], checkpoint: start };
|
|
1355
1569
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1356
|
-
const
|
|
1570
|
+
const normalizedInputs = inputs.map((input) => createAccount(input).input);
|
|
1571
|
+
const result = await this.transport.executeCommandBatch(createAccount(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1572
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1573
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CREATE_ACCOUNT_PLAN_HASH)
|
|
1574
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1575
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1576
|
+
} return item; });
|
|
1357
1577
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1358
|
-
return result;
|
|
1578
|
+
return { items, checkpoint: result.checkpoint };
|
|
1359
1579
|
}
|
|
1360
1580
|
const items = [];
|
|
1361
1581
|
let next = start;
|
|
@@ -1400,9 +1620,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1400
1620
|
if (start === inputs.length)
|
|
1401
1621
|
return { items: [], checkpoint: start };
|
|
1402
1622
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1403
|
-
const
|
|
1623
|
+
const normalizedInputs = inputs.map((input) => createOAuthUserGraph(input).input);
|
|
1624
|
+
const result = await this.transport.executeCommandBatch(createOAuthUserGraph(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1625
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1626
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CREATE_O_AUTH_USER_GRAPH_PLAN_HASH)
|
|
1627
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1628
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1629
|
+
} return item; });
|
|
1404
1630
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1405
|
-
return result;
|
|
1631
|
+
return { items, checkpoint: result.checkpoint };
|
|
1406
1632
|
}
|
|
1407
1633
|
const items = [];
|
|
1408
1634
|
let next = start;
|
|
@@ -1447,9 +1673,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1447
1673
|
if (start === inputs.length)
|
|
1448
1674
|
return { items: [], checkpoint: start };
|
|
1449
1675
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1450
|
-
const
|
|
1676
|
+
const normalizedInputs = inputs.map((input) => createSession(input).input);
|
|
1677
|
+
const result = await this.transport.executeCommandBatch(createSession(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1678
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1679
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CREATE_SESSION_PLAN_HASH)
|
|
1680
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1681
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1682
|
+
} return item; });
|
|
1451
1683
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1452
|
-
return result;
|
|
1684
|
+
return { items, checkpoint: result.checkpoint };
|
|
1453
1685
|
}
|
|
1454
1686
|
const items = [];
|
|
1455
1687
|
let next = start;
|
|
@@ -1494,9 +1726,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1494
1726
|
if (start === inputs.length)
|
|
1495
1727
|
return { items: [], checkpoint: start };
|
|
1496
1728
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1497
|
-
const
|
|
1729
|
+
const normalizedInputs = inputs.map((input) => createSignupGraph(input).input);
|
|
1730
|
+
const result = await this.transport.executeCommandBatch(createSignupGraph(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1731
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1732
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CREATE_SIGNUP_GRAPH_PLAN_HASH)
|
|
1733
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1734
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1735
|
+
} return item; });
|
|
1498
1736
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1499
|
-
return result;
|
|
1737
|
+
return { items, checkpoint: result.checkpoint };
|
|
1500
1738
|
}
|
|
1501
1739
|
const items = [];
|
|
1502
1740
|
let next = start;
|
|
@@ -1541,9 +1779,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1541
1779
|
if (start === inputs.length)
|
|
1542
1780
|
return { items: [], checkpoint: start };
|
|
1543
1781
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1544
|
-
const
|
|
1782
|
+
const normalizedInputs = inputs.map((input) => createUser(input).input);
|
|
1783
|
+
const result = await this.transport.executeCommandBatch(createUser(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1784
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1785
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CREATE_USER_PLAN_HASH)
|
|
1786
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1787
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1788
|
+
} return item; });
|
|
1545
1789
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1546
|
-
return result;
|
|
1790
|
+
return { items, checkpoint: result.checkpoint };
|
|
1547
1791
|
}
|
|
1548
1792
|
const items = [];
|
|
1549
1793
|
let next = start;
|
|
@@ -1588,9 +1832,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1588
1832
|
if (start === inputs.length)
|
|
1589
1833
|
return { items: [], checkpoint: start };
|
|
1590
1834
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1591
|
-
const
|
|
1835
|
+
const normalizedInputs = inputs.map((input) => createVerification(input).input);
|
|
1836
|
+
const result = await this.transport.executeCommandBatch(createVerification(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1837
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1838
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== CREATE_VERIFICATION_PLAN_HASH)
|
|
1839
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1840
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1841
|
+
} return item; });
|
|
1592
1842
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1593
|
-
return result;
|
|
1843
|
+
return { items, checkpoint: result.checkpoint };
|
|
1594
1844
|
}
|
|
1595
1845
|
const items = [];
|
|
1596
1846
|
let next = start;
|
|
@@ -1635,9 +1885,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1635
1885
|
if (start === inputs.length)
|
|
1636
1886
|
return { items: [], checkpoint: start };
|
|
1637
1887
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1638
|
-
const
|
|
1888
|
+
const normalizedInputs = inputs.map((input) => deleteAccount(input).input);
|
|
1889
|
+
const result = await this.transport.executeCommandBatch(deleteAccount(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1890
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1891
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== DELETE_ACCOUNT_PLAN_HASH)
|
|
1892
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1893
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1894
|
+
} return item; });
|
|
1639
1895
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1640
|
-
return result;
|
|
1896
|
+
return { items, checkpoint: result.checkpoint };
|
|
1641
1897
|
}
|
|
1642
1898
|
const items = [];
|
|
1643
1899
|
let next = start;
|
|
@@ -1682,9 +1938,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1682
1938
|
if (start === inputs.length)
|
|
1683
1939
|
return { items: [], checkpoint: start };
|
|
1684
1940
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1685
|
-
const
|
|
1941
|
+
const normalizedInputs = inputs.map((input) => deleteSession(input).input);
|
|
1942
|
+
const result = await this.transport.executeCommandBatch(deleteSession(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1943
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1944
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== DELETE_SESSION_PLAN_HASH)
|
|
1945
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1946
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
1947
|
+
} return item; });
|
|
1686
1948
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1687
|
-
return result;
|
|
1949
|
+
return { items, checkpoint: result.checkpoint };
|
|
1688
1950
|
}
|
|
1689
1951
|
const items = [];
|
|
1690
1952
|
let next = start;
|
|
@@ -1729,9 +1991,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1729
1991
|
if (start === inputs.length)
|
|
1730
1992
|
return { items: [], checkpoint: start };
|
|
1731
1993
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1732
|
-
const
|
|
1994
|
+
const normalizedInputs = inputs.map((input) => deleteUser(input).input);
|
|
1995
|
+
const result = await this.transport.executeCommandBatch(deleteUser(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
1996
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
1997
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== DELETE_USER_PLAN_HASH)
|
|
1998
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
1999
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2000
|
+
} return item; });
|
|
1733
2001
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1734
|
-
return result;
|
|
2002
|
+
return { items, checkpoint: result.checkpoint };
|
|
1735
2003
|
}
|
|
1736
2004
|
const items = [];
|
|
1737
2005
|
let next = start;
|
|
@@ -1776,9 +2044,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1776
2044
|
if (start === inputs.length)
|
|
1777
2045
|
return { items: [], checkpoint: start };
|
|
1778
2046
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1779
|
-
const
|
|
2047
|
+
const normalizedInputs = inputs.map((input) => deleteVerification(input).input);
|
|
2048
|
+
const result = await this.transport.executeCommandBatch(deleteVerification(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
2049
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
2050
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== DELETE_VERIFICATION_PLAN_HASH)
|
|
2051
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
2052
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2053
|
+
} return item; });
|
|
1780
2054
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1781
|
-
return result;
|
|
2055
|
+
return { items, checkpoint: result.checkpoint };
|
|
1782
2056
|
}
|
|
1783
2057
|
const items = [];
|
|
1784
2058
|
let next = start;
|
|
@@ -1805,6 +2079,59 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1805
2079
|
items.sort((left, right) => left.index - right.index);
|
|
1806
2080
|
return { items, checkpoint };
|
|
1807
2081
|
}
|
|
2082
|
+
async resetCredentialPassword(input) {
|
|
2083
|
+
const result = await this.transport.executeCommand(resetCredentialPassword(input), this.commandAttemptBudget);
|
|
2084
|
+
if (result.contractVersion !== CONTRACT_VERSION || result.planHash !== RESET_CREDENTIAL_PASSWORD_PLAN_HASH)
|
|
2085
|
+
throw new Error("RiffDB application identity mismatch");
|
|
2086
|
+
if (this.trackCausalWrites && result.commitSequence !== undefined && result.commitSequence > 0n && (this.lastCommitSeq === undefined || result.commitSequence > this.lastCommitSeq)) {
|
|
2087
|
+
this.lastCommitSeq = result.commitSequence;
|
|
2088
|
+
}
|
|
2089
|
+
return result;
|
|
2090
|
+
}
|
|
2091
|
+
async resetCredentialPasswordBatch(inputs, options) {
|
|
2092
|
+
if (!Number.isInteger(options.concurrency) || options.concurrency < 1 || options.concurrency > MAX_COMMAND_BATCH_CONCURRENCY || inputs.length < 1 || inputs.length > 4096)
|
|
2093
|
+
throw new Error("invalid command batch bounds");
|
|
2094
|
+
const start = options.checkpoint ?? 0;
|
|
2095
|
+
if (!Number.isInteger(start) || start < 0 || start > inputs.length)
|
|
2096
|
+
throw new Error("invalid command batch checkpoint");
|
|
2097
|
+
if (start === inputs.length)
|
|
2098
|
+
return { items: [], checkpoint: start };
|
|
2099
|
+
if (this.transport.executeCommandBatch !== undefined) {
|
|
2100
|
+
const normalizedInputs = inputs.map((input) => resetCredentialPassword(input).input);
|
|
2101
|
+
const result = await this.transport.executeCommandBatch(resetCredentialPassword(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
2102
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
2103
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== RESET_CREDENTIAL_PASSWORD_PLAN_HASH)
|
|
2104
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
2105
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2106
|
+
} return item; });
|
|
2107
|
+
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
2108
|
+
return { items, checkpoint: result.checkpoint };
|
|
2109
|
+
}
|
|
2110
|
+
const items = [];
|
|
2111
|
+
let next = start;
|
|
2112
|
+
let completed = start;
|
|
2113
|
+
let checkpoint = start;
|
|
2114
|
+
const completedAfterCheckpoint = new Set();
|
|
2115
|
+
const worker = async () => { while (true) {
|
|
2116
|
+
const index = next++;
|
|
2117
|
+
if (index >= inputs.length)
|
|
2118
|
+
return;
|
|
2119
|
+
try {
|
|
2120
|
+
items.push({ index, result: await this.resetCredentialPassword(inputs[index]) });
|
|
2121
|
+
}
|
|
2122
|
+
catch (error) {
|
|
2123
|
+
items.push({ index, error });
|
|
2124
|
+
}
|
|
2125
|
+
completed += 1;
|
|
2126
|
+
completedAfterCheckpoint.add(index);
|
|
2127
|
+
while (completedAfterCheckpoint.delete(checkpoint))
|
|
2128
|
+
checkpoint += 1;
|
|
2129
|
+
options.onProgress?.({ completed, total: inputs.length, checkpoint });
|
|
2130
|
+
} };
|
|
2131
|
+
await Promise.all(Array.from({ length: Math.min(options.concurrency, inputs.length - start) }, worker));
|
|
2132
|
+
items.sort((left, right) => left.index - right.index);
|
|
2133
|
+
return { items, checkpoint };
|
|
2134
|
+
}
|
|
1808
2135
|
async updateAccount(input) {
|
|
1809
2136
|
const result = await this.transport.executeCommand(updateAccount(input), this.commandAttemptBudget);
|
|
1810
2137
|
if (result.contractVersion !== CONTRACT_VERSION || result.planHash !== UPDATE_ACCOUNT_PLAN_HASH)
|
|
@@ -1823,9 +2150,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1823
2150
|
if (start === inputs.length)
|
|
1824
2151
|
return { items: [], checkpoint: start };
|
|
1825
2152
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1826
|
-
const
|
|
2153
|
+
const normalizedInputs = inputs.map((input) => updateAccount(input).input);
|
|
2154
|
+
const result = await this.transport.executeCommandBatch(updateAccount(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
2155
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
2156
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== UPDATE_ACCOUNT_PLAN_HASH)
|
|
2157
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
2158
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2159
|
+
} return item; });
|
|
1827
2160
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1828
|
-
return result;
|
|
2161
|
+
return { items, checkpoint: result.checkpoint };
|
|
1829
2162
|
}
|
|
1830
2163
|
const items = [];
|
|
1831
2164
|
let next = start;
|
|
@@ -1870,9 +2203,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1870
2203
|
if (start === inputs.length)
|
|
1871
2204
|
return { items: [], checkpoint: start };
|
|
1872
2205
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1873
|
-
const
|
|
2206
|
+
const normalizedInputs = inputs.map((input) => updateAccountPasswords(input).input);
|
|
2207
|
+
const result = await this.transport.executeCommandBatch(updateAccountPasswords(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
2208
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
2209
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== UPDATE_ACCOUNT_PASSWORDS_PLAN_HASH)
|
|
2210
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
2211
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2212
|
+
} return item; });
|
|
1874
2213
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1875
|
-
return result;
|
|
2214
|
+
return { items, checkpoint: result.checkpoint };
|
|
1876
2215
|
}
|
|
1877
2216
|
const items = [];
|
|
1878
2217
|
let next = start;
|
|
@@ -1899,6 +2238,59 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1899
2238
|
items.sort((left, right) => left.index - right.index);
|
|
1900
2239
|
return { items, checkpoint };
|
|
1901
2240
|
}
|
|
2241
|
+
async updateCredentialPassword(input) {
|
|
2242
|
+
const result = await this.transport.executeCommand(updateCredentialPassword(input), this.commandAttemptBudget);
|
|
2243
|
+
if (result.contractVersion !== CONTRACT_VERSION || result.planHash !== UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH)
|
|
2244
|
+
throw new Error("RiffDB application identity mismatch");
|
|
2245
|
+
if (this.trackCausalWrites && result.commitSequence !== undefined && result.commitSequence > 0n && (this.lastCommitSeq === undefined || result.commitSequence > this.lastCommitSeq)) {
|
|
2246
|
+
this.lastCommitSeq = result.commitSequence;
|
|
2247
|
+
}
|
|
2248
|
+
return result;
|
|
2249
|
+
}
|
|
2250
|
+
async updateCredentialPasswordBatch(inputs, options) {
|
|
2251
|
+
if (!Number.isInteger(options.concurrency) || options.concurrency < 1 || options.concurrency > MAX_COMMAND_BATCH_CONCURRENCY || inputs.length < 1 || inputs.length > 4096)
|
|
2252
|
+
throw new Error("invalid command batch bounds");
|
|
2253
|
+
const start = options.checkpoint ?? 0;
|
|
2254
|
+
if (!Number.isInteger(start) || start < 0 || start > inputs.length)
|
|
2255
|
+
throw new Error("invalid command batch checkpoint");
|
|
2256
|
+
if (start === inputs.length)
|
|
2257
|
+
return { items: [], checkpoint: start };
|
|
2258
|
+
if (this.transport.executeCommandBatch !== undefined) {
|
|
2259
|
+
const normalizedInputs = inputs.map((input) => updateCredentialPassword(input).input);
|
|
2260
|
+
const result = await this.transport.executeCommandBatch(updateCredentialPassword(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
2261
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
2262
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH)
|
|
2263
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
2264
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2265
|
+
} return item; });
|
|
2266
|
+
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
2267
|
+
return { items, checkpoint: result.checkpoint };
|
|
2268
|
+
}
|
|
2269
|
+
const items = [];
|
|
2270
|
+
let next = start;
|
|
2271
|
+
let completed = start;
|
|
2272
|
+
let checkpoint = start;
|
|
2273
|
+
const completedAfterCheckpoint = new Set();
|
|
2274
|
+
const worker = async () => { while (true) {
|
|
2275
|
+
const index = next++;
|
|
2276
|
+
if (index >= inputs.length)
|
|
2277
|
+
return;
|
|
2278
|
+
try {
|
|
2279
|
+
items.push({ index, result: await this.updateCredentialPassword(inputs[index]) });
|
|
2280
|
+
}
|
|
2281
|
+
catch (error) {
|
|
2282
|
+
items.push({ index, error });
|
|
2283
|
+
}
|
|
2284
|
+
completed += 1;
|
|
2285
|
+
completedAfterCheckpoint.add(index);
|
|
2286
|
+
while (completedAfterCheckpoint.delete(checkpoint))
|
|
2287
|
+
checkpoint += 1;
|
|
2288
|
+
options.onProgress?.({ completed, total: inputs.length, checkpoint });
|
|
2289
|
+
} };
|
|
2290
|
+
await Promise.all(Array.from({ length: Math.min(options.concurrency, inputs.length - start) }, worker));
|
|
2291
|
+
items.sort((left, right) => left.index - right.index);
|
|
2292
|
+
return { items, checkpoint };
|
|
2293
|
+
}
|
|
1902
2294
|
async updateSession(input) {
|
|
1903
2295
|
const result = await this.transport.executeCommand(updateSession(input), this.commandAttemptBudget);
|
|
1904
2296
|
if (result.contractVersion !== CONTRACT_VERSION || result.planHash !== UPDATE_SESSION_PLAN_HASH)
|
|
@@ -1917,9 +2309,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1917
2309
|
if (start === inputs.length)
|
|
1918
2310
|
return { items: [], checkpoint: start };
|
|
1919
2311
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1920
|
-
const
|
|
2312
|
+
const normalizedInputs = inputs.map((input) => updateSession(input).input);
|
|
2313
|
+
const result = await this.transport.executeCommandBatch(updateSession(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
2314
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
2315
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== UPDATE_SESSION_PLAN_HASH)
|
|
2316
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
2317
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2318
|
+
} return item; });
|
|
1921
2319
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1922
|
-
return result;
|
|
2320
|
+
return { items, checkpoint: result.checkpoint };
|
|
1923
2321
|
}
|
|
1924
2322
|
const items = [];
|
|
1925
2323
|
let next = start;
|
|
@@ -1964,9 +2362,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
1964
2362
|
if (start === inputs.length)
|
|
1965
2363
|
return { items: [], checkpoint: start };
|
|
1966
2364
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
1967
|
-
const
|
|
2365
|
+
const normalizedInputs = inputs.map((input) => updateUser(input).input);
|
|
2366
|
+
const result = await this.transport.executeCommandBatch(updateUser(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
2367
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
2368
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== UPDATE_USER_PLAN_HASH)
|
|
2369
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
2370
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2371
|
+
} return item; });
|
|
1968
2372
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
1969
|
-
return result;
|
|
2373
|
+
return { items, checkpoint: result.checkpoint };
|
|
1970
2374
|
}
|
|
1971
2375
|
const items = [];
|
|
1972
2376
|
let next = start;
|
|
@@ -2011,9 +2415,15 @@ export class RiffDBBetterAuthCoreClient {
|
|
|
2011
2415
|
if (start === inputs.length)
|
|
2012
2416
|
return { items: [], checkpoint: start };
|
|
2013
2417
|
if (this.transport.executeCommandBatch !== undefined) {
|
|
2014
|
-
const
|
|
2418
|
+
const normalizedInputs = inputs.map((input) => updateVerification(input).input);
|
|
2419
|
+
const result = await this.transport.executeCommandBatch(updateVerification(normalizedInputs[start]), normalizedInputs, options.concurrency, start, this.commandAttemptBudget);
|
|
2420
|
+
const items = result.items.map((item) => { if (item.result === undefined)
|
|
2421
|
+
return item; if (item.result.contractVersion !== CONTRACT_VERSION || item.result.planHash !== UPDATE_VERIFICATION_PLAN_HASH)
|
|
2422
|
+
throw new Error("RiffDB application identity mismatch"); if (this.trackCausalWrites && item.result.commitSequence !== undefined && item.result.commitSequence > 0n && (this.lastCommitSeq === undefined || item.result.commitSequence > this.lastCommitSeq)) {
|
|
2423
|
+
this.lastCommitSeq = item.result.commitSequence;
|
|
2424
|
+
} return item; });
|
|
2015
2425
|
options.onProgress?.({ completed: result.checkpoint, total: inputs.length, checkpoint: result.checkpoint });
|
|
2016
|
-
return result;
|
|
2426
|
+
return { items, checkpoint: result.checkpoint };
|
|
2017
2427
|
}
|
|
2018
2428
|
const items = [];
|
|
2019
2429
|
let next = start;
|