@polyester/sdk 0.6.0 → 0.7.0
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/CHANGELOG.md +12 -0
- package/dist/gen/auth/v1/address_book_pb.d.ts +8 -0
- package/dist/gen/auth/v1/address_book_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/address_book_pb.js +1 -1
- package/dist/gen/auth/v1/address_book_pb.js.map +1 -1
- package/dist/gen/auth/v1/auth_pb.d.ts +7 -1
- package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/auth_pb.js +7 -1
- package/dist/gen/auth/v1/auth_pb.js.map +1 -1
- package/dist/services/address-book/address-book.d.ts +1 -1
- package/dist/services/address-book/address-book.js +1 -1
- package/dist/services/address-book/address-book.js.map +1 -1
- package/dist/services/address-book/address-book.schemas.d.ts +27 -4
- package/dist/services/address-book/address-book.schemas.d.ts.map +1 -1
- package/dist/services/address-book/address-book.schemas.js +11 -5
- package/dist/services/address-book/address-book.schemas.js.map +1 -1
- package/dist/services/social-verification/social-verification.schemas.d.ts +10 -2
- package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
- package/dist/services/social-verification/social-verification.schemas.js +4 -2
- package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
- package/dist/shared/connect-error-mapping.d.ts.map +1 -1
- package/dist/shared/connect-error-mapping.js +1 -0
- package/dist/shared/connect-error-mapping.js.map +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ var auth_pb_exports = /* @__PURE__ */ __exportAll({
|
|
|
19
19
|
/**
|
|
20
20
|
* Describes the file auth/v1/auth.proto.
|
|
21
21
|
*/
|
|
22
|
-
const file_auth_v1_auth = /*@__PURE__*/ fileDesc("
|
|
22
|
+
const file_auth_v1_auth = /*@__PURE__*/ fileDesc("ChJhdXRoL3YxL2F1dGgucHJvdG8SB2F1dGgudjEiMgoPR2V0Tm9uY2VSZXF1ZXN0Eh8KFXN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TF9JTlZBTElEEBwSIgoeQVVUSF9NRkFfUEFTU0tFWV9WRVJJRllfRkFJTEVEEB0SJwojQVVUSF9NRkFfRU5ST0xMTUVOVF9CSU5ESU5HX0lOVkFMSUQQHhIZChVBVVRIX1NURVBfVVBfUkVRVUlSRUQQHxIiCh5BVVRIX1NURVBfVVBfUFJPT0ZfVU5BVkFJTEFCTEUQIBIgChxBVVRIX1NURVBfVVBfQUxSRUFEWV9DTEFJTUVEECESFgoSQVVUSF9QT0xJQ1lfSU5fVVNFECISFgoSQVVUSF9QT0xJQ1lfTE9DS0VEECMSHgoaQVVUSF9QT0xJQ1lfU0NPUEVfTUlTTUFUQ0gQJBIaChZBVVRIX1JFVklTSU9OX0NPTkZMSUNUECUSHwobQVVUSF9NRkFfRUxFVkFUSU9OX1JFUVVJUkVEECYSIQodQVVUSF9NRkFfTEFTVF9GQUNUT1JfUkVRVUlSRUQQJxIXChNBVVRIX0lOVEVSTkFMX0VSUk9SECgy2QEKC0F1dGhTZXJ2aWNlEkEKCEdldE5vbmNlEhguYXV0aC52MS5HZXROb25jZVJlcXVlc3QaGS5hdXRoLnYxLkdldE5vbmNlUmVzcG9uc2UiABJWCg9Mb2dpbldpdGhXYWxsZXQSHy5hdXRoLnYxLkxvZ2luV2l0aFdhbGxldFJlcXVlc3QaIC5hdXRoLnYxLkxvZ2luV2l0aFdhbGxldFJlc3BvbnNlIgASLwoCTWUSEi5hdXRoLnYxLk1lUmVxdWVzdBoTLmF1dGgudjEuTWVSZXNwb25zZSIAQjxaOmdpdGh1Yi5jb20vRmFicmljLUxhYnMvcG9seWVzdGVyLXNkay1nby9nZW4vYXV0aC92MTthdXRodjFiBnByb3RvMw==", [file_auth_v1_mfa, file_google_protobuf_timestamp]);
|
|
23
23
|
/**
|
|
24
24
|
* Describes the message auth.v1.GetNonceRequest.
|
|
25
25
|
* Use `create(GetNonceRequestSchema)` to create a new message.
|
|
@@ -295,6 +295,12 @@ let AuthErrorCode = /* @__PURE__ */ function(AuthErrorCode) {
|
|
|
295
295
|
* @generated from enum value: AUTH_MFA_LAST_FACTOR_REQUIRED = 39;
|
|
296
296
|
*/
|
|
297
297
|
AuthErrorCode[AuthErrorCode["AUTH_MFA_LAST_FACTOR_REQUIRED"] = 39] = "AUTH_MFA_LAST_FACTOR_REQUIRED";
|
|
298
|
+
/**
|
|
299
|
+
* An unexpected internal failure prevented the auth mutation from completing.
|
|
300
|
+
*
|
|
301
|
+
* @generated from enum value: AUTH_INTERNAL_ERROR = 40;
|
|
302
|
+
*/
|
|
303
|
+
AuthErrorCode[AuthErrorCode["AUTH_INTERNAL_ERROR"] = 40] = "AUTH_INTERNAL_ERROR";
|
|
298
304
|
return AuthErrorCode;
|
|
299
305
|
}({});
|
|
300
306
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_pb.js","names":[],"sources":["../../../../src/gen/auth/v1/auth_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file auth/v1/auth.proto (package auth.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { SessionInfo } from \"./mfa_pb.js\";\nimport { file_auth_v1_mfa } from \"./mfa_pb.js\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file auth/v1/auth.proto.\n */\nexport const file_auth_v1_auth: GenFile = /*@__PURE__*/\n fileDesc(\"ChJhdXRoL3YxL2F1dGgucHJvdG8SB2F1dGgudjEiMgoPR2V0Tm9uY2VSZXF1ZXN0Eh8KFXNtYXJ0X2FjY291bnRfYWRkcmVzcxgBIAEoCUIAIlEKEEdldE5vbmNlUmVzcG9uc2US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SJwojQVVUSF9NRkFfRU5ST0xMTUVOVF9CSU5ESU5HX0lOVkFMSUQQHhIZChVBVVRIX1NURVBfVVBfUkVRVUlSRUQQHxIiCh5BVVRIX1NURVBfVVBfUFJPT0ZfVU5BVkFJTEFCTEUQIBIgChxBVVRIX1NURVBfVVBfQUxSRUFEWV9DTEFJTUVEECESFgoSQVVUSF9QT0xJQ1lfSU5fVVNFECISFgoSQVVUSF9QT0xJQ1lfTE9DS0VEECMSHgoaQVVUSF9QT0xJQ1lfU0NPUEVfTUlTTUFUQ0gQJBIaChZBVVRIX1JFVklTSU9OX0NPTkZMSUNUECUSHwobQVVUSF9NRkFfRUxFVkFUSU9OX1JFUVVJUkVEECYSIQodQVVUSF9NRkFfTEFTVF9GQUNUT1JfUkVRVUlSRUQQJzLZAQoLQXV0aFNlcnZpY2USQQoIR2V0Tm9uY2USGC5hdXRoLnYxLkdldE5vbmNlUmVxdWVzdBoZLmF1dGgudjEuR2V0Tm9uY2VSZXNwb25zZSIAElYKD0xvZ2luV2l0aFdhbGxldBIfLmF1dGgudjEuTG9naW5XaXRoV2FsbGV0UmVxdWVzdBogLmF1dGgudjEuTG9naW5XaXRoV2FsbGV0UmVzcG9uc2UiABIvCgJNZRISLmF1dGgudjEuTWVSZXF1ZXN0GhMuYXV0aC52MS5NZVJlc3BvbnNlIgBCPFo6Z2l0aHViLmNvbS9GYWJyaWMtTGFicy9wb2x5ZXN0ZXItc2RrLWdvL2dlbi9hdXRoL3YxO2F1dGh2MWIGcHJvdG8z\", [file_auth_v1_mfa, file_google_protobuf_timestamp]);\n\n/**\n * GetNonceRequest requests a short-lived login nonce for a smart-account\n * address. The wallet must sign a message containing this nonce before login.\n *\n * @generated from message auth.v1.GetNonceRequest\n */\nexport type GetNonceRequest = Message<\"auth.v1.GetNonceRequest\"> & {\n /**\n * Smart-account EVM address, formatted as 0x plus 40 hex characters.\n *\n * @generated from field: string smart_account_address = 1;\n */\n smartAccountAddress: string;\n};\n\n/**\n * Describes the message auth.v1.GetNonceRequest.\n * Use `create(GetNonceRequestSchema)` to create a new message.\n */\nexport const GetNonceRequestSchema: GenMessage<GetNonceRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 0);\n\n/**\n * GetNonceResponse contains the nonce that must be signed for wallet login.\n *\n * @generated from message auth.v1.GetNonceResponse\n */\nexport type GetNonceResponse = Message<\"auth.v1.GetNonceResponse\"> & {\n /**\n * Random login nonce. The nonce is single-purpose and is replaced by each new\n * nonce request for the same smart-account address.\n *\n * @generated from field: string nonce = 1;\n */\n nonce: string;\n\n /**\n * Time in UTC when the nonce expires. Login nonces expire after 5 minutes.\n *\n * @generated from field: google.protobuf.Timestamp expires_at = 2;\n */\n expiresAt?: Timestamp | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetNonceResponse.\n * Use `create(GetNonceResponseSchema)` to create a new message.\n */\nexport const GetNonceResponseSchema: GenMessage<GetNonceResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 1);\n\n/**\n * LoginWithWalletRequest completes smart-account wallet login using a signed\n * nonce.\n *\n * @generated from message auth.v1.LoginWithWalletRequest\n */\nexport type LoginWithWalletRequest = Message<\"auth.v1.LoginWithWalletRequest\"> & {\n /**\n * Smart-account EVM address that produced the signature, formatted as 0x plus\n * 40 hex characters.\n *\n * @generated from field: string smart_account_address = 1;\n */\n smartAccountAddress: string;\n\n /**\n * Nonce returned by GetNonce. The nonce must be unused and not expired.\n *\n * @generated from field: string nonce = 2;\n */\n nonce: string;\n\n /**\n * Signature over the canonical login message containing the nonce. Maximum\n * length is 8192 characters to support universal wallet signatures.\n *\n * @generated from field: string signature = 3;\n */\n signature: string;\n\n /**\n * Optional user-agent string for account security and audit displays. Maximum\n * length is 512 characters.\n *\n * @generated from field: string user_agent = 4;\n */\n userAgent: string;\n\n /**\n * Optional caller IP address for account security and audit displays. Maximum\n * length is 64 characters.\n *\n * @generated from field: string ip = 5;\n */\n ip: string;\n\n /**\n * Optional primary wallet address that controls this smart account, formatted\n * as 0x plus 40 hex characters. This value is metadata and is not used for\n * signature verification.\n *\n * @generated from field: string primary_wallet_address = 6;\n */\n primaryWalletAddress: string;\n\n /**\n * Optional provider hint for the primary wallet. Maximum length is 32 characters.\n *\n * @generated from field: string wallet_provider = 7;\n */\n walletProvider: string;\n};\n\n/**\n * Describes the message auth.v1.LoginWithWalletRequest.\n * Use `create(LoginWithWalletRequestSchema)` to create a new message.\n */\nexport const LoginWithWalletRequestSchema: GenMessage<LoginWithWalletRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 2);\n\n/**\n * LoginWithWalletResponse returns a session token for the authenticated root\n * account.\n *\n * @generated from message auth.v1.LoginWithWalletResponse\n */\nexport type LoginWithWalletResponse = Message<\"auth.v1.LoginWithWalletResponse\"> & {\n /**\n * Bearer access token for authenticated API calls.\n *\n * @generated from field: string access_token = 1;\n */\n accessToken: string;\n\n /**\n * Time in UTC when access_token expires.\n *\n * @generated from field: google.protobuf.Timestamp expires_at = 2;\n */\n expiresAt?: Timestamp | undefined;\n\n /**\n * Root account the token is bound to (opaque ID).\n *\n * @generated from field: fixed64 account_id = 10;\n */\n accountId: bigint;\n\n /**\n * Optional current username for the root account (empty if not set).\n *\n * @generated from field: string username = 13;\n */\n username: string;\n\n /**\n * Session assurance details for the issued access token.\n *\n * @generated from field: auth.v1.SessionInfo session = 20;\n */\n session?: SessionInfo | undefined;\n};\n\n/**\n * Describes the message auth.v1.LoginWithWalletResponse.\n * Use `create(LoginWithWalletResponseSchema)` to create a new message.\n */\nexport const LoginWithWalletResponseSchema: GenMessage<LoginWithWalletResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 3);\n\n/**\n * MeRequest introspects the authenticated caller from the presented access\n * token or API key.\n *\n * @generated from message auth.v1.MeRequest\n */\nexport type MeRequest = Message<\"auth.v1.MeRequest\"> & {\n};\n\n/**\n * Describes the message auth.v1.MeRequest.\n * Use `create(MeRequestSchema)` to create a new message.\n */\nexport const MeRequestSchema: GenMessage<MeRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 4);\n\n/**\n * MeResponse describes the authenticated caller and current session context.\n *\n * @generated from message auth.v1.MeResponse\n */\nexport type MeResponse = Message<\"auth.v1.MeResponse\"> & {\n /**\n * Root account identifier (opaque ID).\n *\n * @generated from field: fixed64 account_id = 1;\n */\n accountId: bigint;\n\n /**\n * When present, indicates the request is authenticated via an API key.\n *\n * @generated from field: optional fixed64 api_key_id = 10;\n */\n apiKeyId?: bigint | undefined;\n\n /**\n * Optional current username for the root account (empty if not set).\n *\n * @generated from field: string username = 11;\n */\n username: string;\n\n /**\n * Root smart-account EVM address, formatted as 0x plus 40 hex characters.\n * Empty if not set.\n *\n * @generated from field: string root_smart_account_address = 12;\n */\n rootSmartAccountAddress: string;\n\n /**\n * Session assurance details for the presented access token, if any.\n *\n * @generated from field: auth.v1.SessionInfo session = 20;\n */\n session?: SessionInfo | undefined;\n};\n\n/**\n * Describes the message auth.v1.MeResponse.\n * Use `create(MeResponseSchema)` to create a new message.\n */\nexport const MeResponseSchema: GenMessage<MeResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 5);\n\n/**\n * AuthErrorDetail describes an authentication or account-domain failure.\n *\n * @generated from message auth.v1.AuthErrorDetail\n */\nexport type AuthErrorDetail = Message<\"auth.v1.AuthErrorDetail\"> & {\n /**\n * Stable machine-readable auth error code.\n *\n * @generated from field: auth.v1.AuthErrorCode code = 1;\n */\n code: AuthErrorCode;\n\n /**\n * Human-readable error message.\n *\n * @generated from field: string message = 2;\n */\n message: string;\n};\n\n/**\n * Describes the message auth.v1.AuthErrorDetail.\n * Use `create(AuthErrorDetailSchema)` to create a new message.\n */\nexport const AuthErrorDetailSchema: GenMessage<AuthErrorDetail> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 6);\n\n/**\n * High-level error codes for authentication and account-domain failures.\n *\n * @generated from enum auth.v1.AuthErrorCode\n */\nexport enum AuthErrorCode {\n /**\n * No auth error code specified.\n *\n * @generated from enum value: AUTH_UNSPECIFIED = 0;\n */\n AUTH_UNSPECIFIED = 0,\n\n /**\n * Username format or characters are invalid.\n *\n * @generated from enum value: AUTH_USERNAME_INVALID = 1;\n */\n AUTH_USERNAME_INVALID = 1,\n\n /**\n * Username is already used by another account.\n *\n * @generated from enum value: AUTH_USERNAME_TAKEN = 2;\n */\n AUTH_USERNAME_TAKEN = 2,\n\n /**\n * Username was changed too recently.\n *\n * @generated from enum value: AUTH_USERNAME_COOLDOWN = 3;\n */\n AUTH_USERNAME_COOLDOWN = 3,\n\n /**\n * Account is not currently eligible to claim or change a username.\n *\n * @generated from enum value: AUTH_USERNAME_FEATURE_LOCKED = 4;\n */\n AUTH_USERNAME_FEATURE_LOCKED = 4,\n\n /**\n * Username is reserved and cannot be claimed by this account.\n *\n * @generated from enum value: AUTH_USERNAME_RESERVED = 5;\n */\n AUTH_USERNAME_RESERVED = 5,\n\n /**\n * Request is malformed or missing required input.\n *\n * @generated from enum value: AUTH_INVALID_REQUEST = 6;\n */\n AUTH_INVALID_REQUEST = 6,\n\n /**\n * Authentication is required for this operation.\n *\n * @generated from enum value: AUTH_AUTHENTICATION_REQUIRED = 7;\n */\n AUTH_AUTHENTICATION_REQUIRED = 7,\n\n /**\n * Presented session type is not allowed for this operation.\n *\n * @generated from enum value: AUTH_SESSION_KIND_NOT_ALLOWED = 8;\n */\n AUTH_SESSION_KIND_NOT_ALLOWED = 8,\n\n /**\n * Wallet login failed because the nonce or signature could not be verified.\n *\n * @generated from enum value: AUTH_WALLET_LOGIN_FAILED = 9;\n */\n AUTH_WALLET_LOGIN_FAILED = 9,\n\n /**\n * Requested resource was not found.\n *\n * @generated from enum value: AUTH_RESOURCE_NOT_FOUND = 10;\n */\n AUTH_RESOURCE_NOT_FOUND = 10,\n\n /**\n * Caller does not have access to the requested sub-account.\n *\n * @generated from enum value: AUTH_SUBACCOUNT_ACCESS_DENIED = 11;\n */\n AUTH_SUBACCOUNT_ACCESS_DENIED = 11,\n\n /**\n * Caller does not have access to the requested API key.\n *\n * @generated from enum value: AUTH_API_KEY_ACCESS_DENIED = 12;\n */\n AUTH_API_KEY_ACCESS_DENIED = 12,\n\n /**\n * Requested API key status transition is not allowed.\n *\n * @generated from enum value: AUTH_API_KEY_INVALID_STATUS_TRANSITION = 14;\n */\n AUTH_API_KEY_INVALID_STATUS_TRANSITION = 14,\n\n /**\n * Policy definition or binding is invalid.\n *\n * @generated from enum value: AUTH_POLICY_INVALID = 15;\n */\n AUTH_POLICY_INVALID = 15,\n\n /**\n * Smart-account address is already linked to another account.\n *\n * @generated from enum value: AUTH_SMART_ACCOUNT_ALREADY_LINKED = 16;\n */\n AUTH_SMART_ACCOUNT_ALREADY_LINKED = 16,\n\n /**\n * Caller does not have access to the requested invite.\n *\n * @generated from enum value: AUTH_INVITE_ACCESS_DENIED = 17;\n */\n AUTH_INVITE_ACCESS_DENIED = 17,\n\n /**\n * Invite cannot be used in its current state.\n *\n * @generated from enum value: AUTH_INVITE_INVALID_STATE = 18;\n */\n AUTH_INVITE_INVALID_STATE = 18,\n\n /**\n * MFA is not available for this account.\n *\n * @generated from enum value: AUTH_MFA_DISABLED = 19;\n */\n AUTH_MFA_DISABLED = 19,\n\n /**\n * Required MFA factor is not enrolled.\n *\n * @generated from enum value: AUTH_MFA_NOT_ENROLLED = 20;\n */\n AUTH_MFA_NOT_ENROLLED = 20,\n\n /**\n * MFA session is missing, expired, or invalid.\n *\n * @generated from enum value: AUTH_MFA_SESSION_INVALID = 21;\n */\n AUTH_MFA_SESSION_INVALID = 21,\n\n /**\n * MFA challenge was not found.\n *\n * @generated from enum value: AUTH_MFA_CHALLENGE_NOT_FOUND = 22;\n */\n AUTH_MFA_CHALLENGE_NOT_FOUND = 22,\n\n /**\n * MFA challenge payload is invalid.\n *\n * @generated from enum value: AUTH_MFA_CHALLENGE_INVALID = 23;\n */\n AUTH_MFA_CHALLENGE_INVALID = 23,\n\n /**\n * MFA challenge is locked after too many failed attempts.\n *\n * @generated from enum value: AUTH_MFA_CHALLENGE_LOCKED = 24;\n */\n AUTH_MFA_CHALLENGE_LOCKED = 24,\n\n /**\n * One-time password is invalid.\n *\n * @generated from enum value: AUTH_MFA_OTP_INVALID = 25;\n */\n AUTH_MFA_OTP_INVALID = 25,\n\n /**\n * Recovery code is invalid.\n *\n * @generated from enum value: AUTH_MFA_RECOVERY_INVALID = 26;\n */\n AUTH_MFA_RECOVERY_INVALID = 26,\n\n /**\n * Passkey verification is not available for this challenge.\n *\n * @generated from enum value: AUTH_MFA_PASSKEY_NOT_AVAILABLE = 27;\n */\n AUTH_MFA_PASSKEY_NOT_AVAILABLE = 27,\n\n /**\n * Passkey credential is invalid for this account or challenge.\n *\n * @generated from enum value: AUTH_MFA_PASSKEY_CREDENTIAL_INVALID = 28;\n */\n AUTH_MFA_PASSKEY_CREDENTIAL_INVALID = 28,\n\n /**\n * Passkey verification failed.\n *\n * @generated from enum value: AUTH_MFA_PASSKEY_VERIFY_FAILED = 29;\n */\n AUTH_MFA_PASSKEY_VERIFY_FAILED = 29,\n\n /**\n * MFA enrollment binding is invalid or expired.\n *\n * @generated from enum value: AUTH_MFA_ENROLLMENT_BINDING_INVALID = 30;\n */\n AUTH_MFA_ENROLLMENT_BINDING_INVALID = 30,\n\n /**\n * A fresh step-up proof is required for this protected operation.\n *\n * @generated from enum value: AUTH_STEP_UP_REQUIRED = 31;\n */\n AUTH_STEP_UP_REQUIRED = 31,\n\n /**\n * A requested step-up proof is unavailable.\n *\n * @generated from enum value: AUTH_STEP_UP_PROOF_UNAVAILABLE = 32;\n */\n AUTH_STEP_UP_PROOF_UNAVAILABLE = 32,\n\n /**\n * The step-up proof has already been claimed.\n *\n * @generated from enum value: AUTH_STEP_UP_ALREADY_CLAIMED = 33;\n */\n AUTH_STEP_UP_ALREADY_CLAIMED = 33,\n\n /**\n * The requested policy cannot be removed because it is still in use.\n *\n * @generated from enum value: AUTH_POLICY_IN_USE = 34;\n */\n AUTH_POLICY_IN_USE = 34,\n\n /**\n * The requested policy is locked against this mutation.\n *\n * @generated from enum value: AUTH_POLICY_LOCKED = 35;\n */\n AUTH_POLICY_LOCKED = 35,\n\n /**\n * The requested policy does not belong to the target account scope.\n *\n * @generated from enum value: AUTH_POLICY_SCOPE_MISMATCH = 36;\n */\n AUTH_POLICY_SCOPE_MISMATCH = 36,\n\n /**\n * The resource changed after the caller read it.\n *\n * @generated from enum value: AUTH_REVISION_CONFLICT = 37;\n */\n AUTH_REVISION_CONFLICT = 37,\n\n /**\n * A recently MFA-elevated interactive session is required.\n *\n * @generated from enum value: AUTH_MFA_ELEVATION_REQUIRED = 38;\n */\n AUTH_MFA_ELEVATION_REQUIRED = 38,\n\n /**\n * At least one active MFA factor must remain enrolled.\n *\n * @generated from enum value: AUTH_MFA_LAST_FACTOR_REQUIRED = 39;\n */\n AUTH_MFA_LAST_FACTOR_REQUIRED = 39,\n}\n\n/**\n * Describes the enum auth.v1.AuthErrorCode.\n */\nexport const AuthErrorCodeSchema: GenEnum<AuthErrorCode> = /*@__PURE__*/\n enumDesc(file_auth_v1_auth, 0);\n\n/**\n * AuthService manages wallet login and caller authentication context.\n *\n * @generated from service auth.v1.AuthService\n */\nexport const AuthService: GenService<{\n /**\n * Get a short-lived login nonce.\n *\n * @generated from rpc auth.v1.AuthService.GetNonce\n */\n getNonce: {\n methodKind: \"unary\";\n input: typeof GetNonceRequestSchema;\n output: typeof GetNonceResponseSchema;\n },\n /**\n * Verify a signed nonce and issue an access token.\n *\n * @generated from rpc auth.v1.AuthService.LoginWithWallet\n */\n loginWithWallet: {\n methodKind: \"unary\";\n input: typeof LoginWithWalletRequestSchema;\n output: typeof LoginWithWalletResponseSchema;\n },\n /**\n * Return the caller's current auth context.\n *\n * @generated from rpc auth.v1.AuthService.Me\n */\n me: {\n methodKind: \"unary\";\n input: typeof MeRequestSchema;\n output: typeof MeResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_auth_v1_auth, 0);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;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,cAAA,kCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,gCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,+BAAA,MAAA;;;;;;CAOA,cAAA,cAAA,0BAAA,MAAA;;;;;;CAOA,cAAA,cAAA,+BAAA,MAAA;;;;;;CAOA,cAAA,cAAA,oCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,yCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,oCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,yCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,2BAAA,MAAA;;;;;;CAOA,cAAA,cAAA,oCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,kCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,wBAAA,MAAA;;;;;;CAOA,cAAA,cAAA,wBAAA,MAAA;;;;;;CAOA,cAAA,cAAA,gCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,4BAAA,MAAA;;;;;;CAOA,cAAA,cAAA,iCAAA,MAAA;;;;;;CAOA,cAAA,cAAA,mCAAA,MAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,MAAa,sBACX,uBAAS,mBAAmB,CAAC;;;;;;AAO/B,MAAa,cAgCX,0BAAY,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"auth_pb.js","names":[],"sources":["../../../../src/gen/auth/v1/auth_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file auth/v1/auth.proto (package auth.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { SessionInfo } from \"./mfa_pb.js\";\nimport { file_auth_v1_mfa } from \"./mfa_pb.js\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file auth/v1/auth.proto.\n */\nexport const file_auth_v1_auth: GenFile = /*@__PURE__*/\n fileDesc(\"ChJhdXRoL3YxL2F1dGgucHJvdG8SB2F1dGgudjEiMgoPR2V0Tm9uY2VSZXF1ZXN0Eh8KFXNtYXJ0X2FjY291bnRfYWRkcmVzcxgBIAEoCUIAIlEKEEdldE5vbmNlUmVzcG9uc2USDQoFbm9uY2UYASABKAkSLgoKZXhwaXJlc19hdBgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiwAEKFkxvZ2luV2l0aFdhbGxldFJlcXVlc3QSHwoVc21hcnRfYWNjb3VudF9hZGRyZXNzGAEgASgJQgASDwoFbm9uY2UYAiABKAlCABITCglzaWduYXR1cmUYAyABKAlCABIUCgp1c2VyX2FnZW50GAQgASgJQgASDAoCaXAYBSABKAlCABIgChZwcmltYXJ5X3dhbGxldF9hZGRyZXNzGAYgASgJQgASGQoPd2FsbGV0X3Byb3ZpZGVyGAcgASgJQgAirAEKF0xvZ2luV2l0aFdhbGxldFJlc3BvbnNlEhQKDGFjY2Vzc190b2tlbhgBIAEoCRIuCgpleHBpcmVzX2F0GAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBISCgphY2NvdW50X2lkGAogASgGEhAKCHVzZXJuYW1lGA0gASgJEiUKB3Nlc3Npb24YFCABKAsyFC5hdXRoLnYxLlNlc3Npb25JbmZvIgsKCU1lUmVxdWVzdCKlAQoKTWVSZXNwb25zZRISCgphY2NvdW50X2lkGAEgASgGEhcKCmFwaV9rZXlfaWQYCiABKAZIAIgBARIQCgh1c2VybmFtZRgLIAEoCRIiChpyb290X3NtYXJ0X2FjY291bnRfYWRkcmVzcxgMIAEoCRIlCgdzZXNzaW9uGBQgASgLMhQuYXV0aC52MS5TZXNzaW9uSW5mb0INCgtfYXBpX2tleV9pZCJICg9BdXRoRXJyb3JEZXRhaWwSJ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RodjFiBnByb3RvMw==\", [file_auth_v1_mfa, file_google_protobuf_timestamp]);\n\n/**\n * GetNonceRequest requests a short-lived login nonce for a smart-account\n * address. The wallet must sign a message containing this nonce before login.\n *\n * @generated from message auth.v1.GetNonceRequest\n */\nexport type GetNonceRequest = Message<\"auth.v1.GetNonceRequest\"> & {\n /**\n * Smart-account EVM address, formatted as 0x plus 40 hex characters.\n *\n * @generated from field: string smart_account_address = 1;\n */\n smartAccountAddress: string;\n};\n\n/**\n * Describes the message auth.v1.GetNonceRequest.\n * Use `create(GetNonceRequestSchema)` to create a new message.\n */\nexport const GetNonceRequestSchema: GenMessage<GetNonceRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 0);\n\n/**\n * GetNonceResponse contains the nonce that must be signed for wallet login.\n *\n * @generated from message auth.v1.GetNonceResponse\n */\nexport type GetNonceResponse = Message<\"auth.v1.GetNonceResponse\"> & {\n /**\n * Random login nonce. The nonce is single-purpose and is replaced by each new\n * nonce request for the same smart-account address.\n *\n * @generated from field: string nonce = 1;\n */\n nonce: string;\n\n /**\n * Time in UTC when the nonce expires. Login nonces expire after 5 minutes.\n *\n * @generated from field: google.protobuf.Timestamp expires_at = 2;\n */\n expiresAt?: Timestamp | undefined;\n};\n\n/**\n * Describes the message auth.v1.GetNonceResponse.\n * Use `create(GetNonceResponseSchema)` to create a new message.\n */\nexport const GetNonceResponseSchema: GenMessage<GetNonceResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 1);\n\n/**\n * LoginWithWalletRequest completes smart-account wallet login using a signed\n * nonce.\n *\n * @generated from message auth.v1.LoginWithWalletRequest\n */\nexport type LoginWithWalletRequest = Message<\"auth.v1.LoginWithWalletRequest\"> & {\n /**\n * Smart-account EVM address that produced the signature, formatted as 0x plus\n * 40 hex characters.\n *\n * @generated from field: string smart_account_address = 1;\n */\n smartAccountAddress: string;\n\n /**\n * Nonce returned by GetNonce. The nonce must be unused and not expired.\n *\n * @generated from field: string nonce = 2;\n */\n nonce: string;\n\n /**\n * Signature over the canonical login message containing the nonce. Maximum\n * length is 8192 characters to support universal wallet signatures.\n *\n * @generated from field: string signature = 3;\n */\n signature: string;\n\n /**\n * Optional user-agent string for account security and audit displays. Maximum\n * length is 512 characters.\n *\n * @generated from field: string user_agent = 4;\n */\n userAgent: string;\n\n /**\n * Optional caller IP address for account security and audit displays. Maximum\n * length is 64 characters.\n *\n * @generated from field: string ip = 5;\n */\n ip: string;\n\n /**\n * Optional primary wallet address that controls this smart account, formatted\n * as 0x plus 40 hex characters. This value is metadata and is not used for\n * signature verification.\n *\n * @generated from field: string primary_wallet_address = 6;\n */\n primaryWalletAddress: string;\n\n /**\n * Optional provider hint for the primary wallet. Maximum length is 32 characters.\n *\n * @generated from field: string wallet_provider = 7;\n */\n walletProvider: string;\n};\n\n/**\n * Describes the message auth.v1.LoginWithWalletRequest.\n * Use `create(LoginWithWalletRequestSchema)` to create a new message.\n */\nexport const LoginWithWalletRequestSchema: GenMessage<LoginWithWalletRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 2);\n\n/**\n * LoginWithWalletResponse returns a session token for the authenticated root\n * account.\n *\n * @generated from message auth.v1.LoginWithWalletResponse\n */\nexport type LoginWithWalletResponse = Message<\"auth.v1.LoginWithWalletResponse\"> & {\n /**\n * Bearer access token for authenticated API calls.\n *\n * @generated from field: string access_token = 1;\n */\n accessToken: string;\n\n /**\n * Time in UTC when access_token expires.\n *\n * @generated from field: google.protobuf.Timestamp expires_at = 2;\n */\n expiresAt?: Timestamp | undefined;\n\n /**\n * Root account the token is bound to (opaque ID).\n *\n * @generated from field: fixed64 account_id = 10;\n */\n accountId: bigint;\n\n /**\n * Optional current username for the root account (empty if not set).\n *\n * @generated from field: string username = 13;\n */\n username: string;\n\n /**\n * Session assurance details for the issued access token.\n *\n * @generated from field: auth.v1.SessionInfo session = 20;\n */\n session?: SessionInfo | undefined;\n};\n\n/**\n * Describes the message auth.v1.LoginWithWalletResponse.\n * Use `create(LoginWithWalletResponseSchema)` to create a new message.\n */\nexport const LoginWithWalletResponseSchema: GenMessage<LoginWithWalletResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 3);\n\n/**\n * MeRequest introspects the authenticated caller from the presented access\n * token or API key.\n *\n * @generated from message auth.v1.MeRequest\n */\nexport type MeRequest = Message<\"auth.v1.MeRequest\"> & {\n};\n\n/**\n * Describes the message auth.v1.MeRequest.\n * Use `create(MeRequestSchema)` to create a new message.\n */\nexport const MeRequestSchema: GenMessage<MeRequest> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 4);\n\n/**\n * MeResponse describes the authenticated caller and current session context.\n *\n * @generated from message auth.v1.MeResponse\n */\nexport type MeResponse = Message<\"auth.v1.MeResponse\"> & {\n /**\n * Root account identifier (opaque ID).\n *\n * @generated from field: fixed64 account_id = 1;\n */\n accountId: bigint;\n\n /**\n * When present, indicates the request is authenticated via an API key.\n *\n * @generated from field: optional fixed64 api_key_id = 10;\n */\n apiKeyId?: bigint | undefined;\n\n /**\n * Optional current username for the root account (empty if not set).\n *\n * @generated from field: string username = 11;\n */\n username: string;\n\n /**\n * Root smart-account EVM address, formatted as 0x plus 40 hex characters.\n * Empty if not set.\n *\n * @generated from field: string root_smart_account_address = 12;\n */\n rootSmartAccountAddress: string;\n\n /**\n * Session assurance details for the presented access token, if any.\n *\n * @generated from field: auth.v1.SessionInfo session = 20;\n */\n session?: SessionInfo | undefined;\n};\n\n/**\n * Describes the message auth.v1.MeResponse.\n * Use `create(MeResponseSchema)` to create a new message.\n */\nexport const MeResponseSchema: GenMessage<MeResponse> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 5);\n\n/**\n * AuthErrorDetail describes an authentication or account-domain failure.\n *\n * @generated from message auth.v1.AuthErrorDetail\n */\nexport type AuthErrorDetail = Message<\"auth.v1.AuthErrorDetail\"> & {\n /**\n * Stable machine-readable auth error code.\n *\n * @generated from field: auth.v1.AuthErrorCode code = 1;\n */\n code: AuthErrorCode;\n\n /**\n * Human-readable error message.\n *\n * @generated from field: string message = 2;\n */\n message: string;\n};\n\n/**\n * Describes the message auth.v1.AuthErrorDetail.\n * Use `create(AuthErrorDetailSchema)` to create a new message.\n */\nexport const AuthErrorDetailSchema: GenMessage<AuthErrorDetail> = /*@__PURE__*/\n messageDesc(file_auth_v1_auth, 6);\n\n/**\n * High-level error codes for authentication and account-domain failures.\n *\n * @generated from enum auth.v1.AuthErrorCode\n */\nexport enum AuthErrorCode {\n /**\n * No auth error code specified.\n *\n * @generated from enum value: AUTH_UNSPECIFIED = 0;\n */\n AUTH_UNSPECIFIED = 0,\n\n /**\n * Username format or characters are invalid.\n *\n * @generated from enum value: AUTH_USERNAME_INVALID = 1;\n */\n AUTH_USERNAME_INVALID = 1,\n\n /**\n * Username is already used by another account.\n *\n * @generated from enum value: AUTH_USERNAME_TAKEN = 2;\n */\n AUTH_USERNAME_TAKEN = 2,\n\n /**\n * Username was changed too recently.\n *\n * @generated from enum value: AUTH_USERNAME_COOLDOWN = 3;\n */\n AUTH_USERNAME_COOLDOWN = 3,\n\n /**\n * Account is not currently eligible to claim or change a username.\n *\n * @generated from enum value: AUTH_USERNAME_FEATURE_LOCKED = 4;\n */\n AUTH_USERNAME_FEATURE_LOCKED = 4,\n\n /**\n * Username is reserved and cannot be claimed by this account.\n *\n * @generated from enum value: AUTH_USERNAME_RESERVED = 5;\n */\n AUTH_USERNAME_RESERVED = 5,\n\n /**\n * Request is malformed or missing required input.\n *\n * @generated from enum value: AUTH_INVALID_REQUEST = 6;\n */\n AUTH_INVALID_REQUEST = 6,\n\n /**\n * Authentication is required for this operation.\n *\n * @generated from enum value: AUTH_AUTHENTICATION_REQUIRED = 7;\n */\n AUTH_AUTHENTICATION_REQUIRED = 7,\n\n /**\n * Presented session type is not allowed for this operation.\n *\n * @generated from enum value: AUTH_SESSION_KIND_NOT_ALLOWED = 8;\n */\n AUTH_SESSION_KIND_NOT_ALLOWED = 8,\n\n /**\n * Wallet login failed because the nonce or signature could not be verified.\n *\n * @generated from enum value: AUTH_WALLET_LOGIN_FAILED = 9;\n */\n AUTH_WALLET_LOGIN_FAILED = 9,\n\n /**\n * Requested resource was not found.\n *\n * @generated from enum value: AUTH_RESOURCE_NOT_FOUND = 10;\n */\n AUTH_RESOURCE_NOT_FOUND = 10,\n\n /**\n * Caller does not have access to the requested sub-account.\n *\n * @generated from enum value: AUTH_SUBACCOUNT_ACCESS_DENIED = 11;\n */\n AUTH_SUBACCOUNT_ACCESS_DENIED = 11,\n\n /**\n * Caller does not have access to the requested API key.\n *\n * @generated from enum value: AUTH_API_KEY_ACCESS_DENIED = 12;\n */\n AUTH_API_KEY_ACCESS_DENIED = 12,\n\n /**\n * Requested API key status transition is not allowed.\n *\n * @generated from enum value: AUTH_API_KEY_INVALID_STATUS_TRANSITION = 14;\n */\n AUTH_API_KEY_INVALID_STATUS_TRANSITION = 14,\n\n /**\n * Policy definition or binding is invalid.\n *\n * @generated from enum value: AUTH_POLICY_INVALID = 15;\n */\n AUTH_POLICY_INVALID = 15,\n\n /**\n * Smart-account address is already linked to another account.\n *\n * @generated from enum value: AUTH_SMART_ACCOUNT_ALREADY_LINKED = 16;\n */\n AUTH_SMART_ACCOUNT_ALREADY_LINKED = 16,\n\n /**\n * Caller does not have access to the requested invite.\n *\n * @generated from enum value: AUTH_INVITE_ACCESS_DENIED = 17;\n */\n AUTH_INVITE_ACCESS_DENIED = 17,\n\n /**\n * Invite cannot be used in its current state.\n *\n * @generated from enum value: AUTH_INVITE_INVALID_STATE = 18;\n */\n AUTH_INVITE_INVALID_STATE = 18,\n\n /**\n * MFA is not available for this account.\n *\n * @generated from enum value: AUTH_MFA_DISABLED = 19;\n */\n AUTH_MFA_DISABLED = 19,\n\n /**\n * Required MFA factor is not enrolled.\n *\n * @generated from enum value: AUTH_MFA_NOT_ENROLLED = 20;\n */\n AUTH_MFA_NOT_ENROLLED = 20,\n\n /**\n * MFA session is missing, expired, or invalid.\n *\n * @generated from enum value: AUTH_MFA_SESSION_INVALID = 21;\n */\n AUTH_MFA_SESSION_INVALID = 21,\n\n /**\n * MFA challenge was not found.\n *\n * @generated from enum value: AUTH_MFA_CHALLENGE_NOT_FOUND = 22;\n */\n AUTH_MFA_CHALLENGE_NOT_FOUND = 22,\n\n /**\n * MFA challenge payload is invalid.\n *\n * @generated from enum value: AUTH_MFA_CHALLENGE_INVALID = 23;\n */\n AUTH_MFA_CHALLENGE_INVALID = 23,\n\n /**\n * MFA challenge is locked after too many failed attempts.\n *\n * @generated from enum value: AUTH_MFA_CHALLENGE_LOCKED = 24;\n */\n AUTH_MFA_CHALLENGE_LOCKED = 24,\n\n /**\n * One-time password is invalid.\n *\n * @generated from enum value: AUTH_MFA_OTP_INVALID = 25;\n */\n AUTH_MFA_OTP_INVALID = 25,\n\n /**\n * Recovery code is invalid.\n *\n * @generated from enum value: AUTH_MFA_RECOVERY_INVALID = 26;\n */\n AUTH_MFA_RECOVERY_INVALID = 26,\n\n /**\n * Passkey verification is not available for this challenge.\n *\n * @generated from enum value: AUTH_MFA_PASSKEY_NOT_AVAILABLE = 27;\n */\n AUTH_MFA_PASSKEY_NOT_AVAILABLE = 27,\n\n /**\n * Passkey credential is invalid for this account or challenge.\n *\n * @generated from enum value: AUTH_MFA_PASSKEY_CREDENTIAL_INVALID = 28;\n */\n AUTH_MFA_PASSKEY_CREDENTIAL_INVALID = 28,\n\n /**\n * Passkey verification failed.\n *\n * @generated from enum value: AUTH_MFA_PASSKEY_VERIFY_FAILED = 29;\n */\n AUTH_MFA_PASSKEY_VERIFY_FAILED = 29,\n\n /**\n * MFA enrollment binding is invalid or expired.\n *\n * @generated from enum value: AUTH_MFA_ENROLLMENT_BINDING_INVALID = 30;\n */\n AUTH_MFA_ENROLLMENT_BINDING_INVALID = 30,\n\n /**\n * A fresh step-up proof is required for this protected operation.\n *\n * @generated from enum value: AUTH_STEP_UP_REQUIRED = 31;\n */\n AUTH_STEP_UP_REQUIRED = 31,\n\n /**\n * A requested step-up proof is unavailable.\n *\n * @generated from enum value: AUTH_STEP_UP_PROOF_UNAVAILABLE = 32;\n */\n AUTH_STEP_UP_PROOF_UNAVAILABLE = 32,\n\n /**\n * The step-up proof has already been claimed.\n *\n * @generated from enum value: AUTH_STEP_UP_ALREADY_CLAIMED = 33;\n */\n AUTH_STEP_UP_ALREADY_CLAIMED = 33,\n\n /**\n * The requested policy cannot be removed because it is still in use.\n *\n * @generated from enum value: AUTH_POLICY_IN_USE = 34;\n */\n AUTH_POLICY_IN_USE = 34,\n\n /**\n * The requested policy is locked against this mutation.\n *\n * @generated from enum value: AUTH_POLICY_LOCKED = 35;\n */\n AUTH_POLICY_LOCKED = 35,\n\n /**\n * The requested policy does not belong to the target account scope.\n *\n * @generated from enum value: AUTH_POLICY_SCOPE_MISMATCH = 36;\n */\n AUTH_POLICY_SCOPE_MISMATCH = 36,\n\n /**\n * The resource changed after the caller read it.\n *\n * @generated from enum value: AUTH_REVISION_CONFLICT = 37;\n */\n AUTH_REVISION_CONFLICT = 37,\n\n /**\n * A recently MFA-elevated interactive session is required.\n *\n * @generated from enum value: AUTH_MFA_ELEVATION_REQUIRED = 38;\n */\n AUTH_MFA_ELEVATION_REQUIRED = 38,\n\n /**\n * At least one active MFA factor must remain enrolled.\n *\n * @generated from enum value: AUTH_MFA_LAST_FACTOR_REQUIRED = 39;\n */\n AUTH_MFA_LAST_FACTOR_REQUIRED = 39,\n\n /**\n * An unexpected internal failure prevented the auth mutation from completing.\n *\n * @generated from enum value: AUTH_INTERNAL_ERROR = 40;\n */\n AUTH_INTERNAL_ERROR = 40,\n}\n\n/**\n * Describes the enum auth.v1.AuthErrorCode.\n */\nexport const AuthErrorCodeSchema: GenEnum<AuthErrorCode> = /*@__PURE__*/\n enumDesc(file_auth_v1_auth, 0);\n\n/**\n * AuthService manages wallet login and caller authentication context.\n *\n * @generated from service auth.v1.AuthService\n */\nexport const AuthService: GenService<{\n /**\n * Get a short-lived login nonce.\n *\n * @generated from rpc auth.v1.AuthService.GetNonce\n */\n getNonce: {\n methodKind: \"unary\";\n input: typeof GetNonceRequestSchema;\n output: typeof GetNonceResponseSchema;\n },\n /**\n * Verify a signed nonce and issue an access token.\n *\n * @generated from rpc auth.v1.AuthService.LoginWithWallet\n */\n loginWithWallet: {\n methodKind: \"unary\";\n input: typeof LoginWithWalletRequestSchema;\n output: typeof LoginWithWalletResponseSchema;\n },\n /**\n * Return the caller's current auth context.\n *\n * @generated from rpc auth.v1.AuthService.Me\n */\n me: {\n methodKind: \"unary\";\n input: typeof MeRequestSchema;\n output: typeof MeResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_auth_v1_auth, 0);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,MAAa,oBACX,uBAAS,ojGAAojG,CAAC,kBAAkB,8BAA8B,CAAC;;;;;AAqBjnG,MAAa,wBACX,0BAAY,mBAAmB,CAAC;;;;;AA4BlC,MAAa,yBACX,0BAAY,mBAAmB,CAAC;;;;;AAqElC,MAAa,+BACX,0BAAY,mBAAmB,CAAC;;;;;AAiDlC,MAAa,gCACX,0BAAY,mBAAmB,CAAC;;;;;AAelC,MAAa,kBACX,0BAAY,mBAAmB,CAAC;;;;;AAiDlC,MAAa,mBACX,0BAAY,mBAAmB,CAAC;;;;;AA2BlC,MAAa,wBACX,0BAAY,mBAAmB,CAAC;;;;;;AAOlC,IAAY,gBAAL,yBAAA,eAAA;;;;;;CAML,cAAA,cAAA,sBAAA,KAAA;;;;;;CAOA,cAAA,cAAA,2BAAA,KAAA;;;;;;CAOA,cAAA,cAAA,yBAAA,KAAA;;;;;;CAOA,cAAA,cAAA,4BAAA,KAAA;;;;;;CAOA,cAAA,cAAA,kCAAA,KAAA;;;;;;CAOA,cAAA,cAAA,4BAAA,KAAA;;;;;;CAOA,cAAA,cAAA,0BAAA,KAAA;;;;;;CAOA,cAAA,cAAA,kCAAA,KAAA;;;;;;CAOA,cAAA,cAAA,mCAAA,KAAA;;;;;;CAOA,cAAA,cAAA,8BAAA,KAAA;;;;;;C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|
@@ -30,7 +30,7 @@ declare class AddressBookService {
|
|
|
30
30
|
*/
|
|
31
31
|
createEntry(input: CreateAddressBookEntryInput, options?: PolyesterMutationOptions): Promise<AddressBookEntry | null>;
|
|
32
32
|
/**
|
|
33
|
-
* Updates selected saved-destination metadata using optimistic concurrency.
|
|
33
|
+
* Updates selected saved-destination metadata using optimistic concurrency, optionally creating and attaching tags in the same request.
|
|
34
34
|
*/
|
|
35
35
|
updateEntry(input: UpdateAddressBookEntryInput, options?: PolyesterMutationOptions): Promise<AddressBookEntry | null>;
|
|
36
36
|
/**
|
|
@@ -44,7 +44,7 @@ var AddressBookService = class {
|
|
|
44
44
|
return response.entry ? parse(AddressBookEntrySchema, response.entry) : null;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* Updates selected saved-destination metadata using optimistic concurrency.
|
|
47
|
+
* Updates selected saved-destination metadata using optimistic concurrency, optionally creating and attaching tags in the same request.
|
|
48
48
|
*/
|
|
49
49
|
async updateEntry(input, options) {
|
|
50
50
|
const request = parse(UpdateAddressBookEntryInputSchema, input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-book.js","names":["#client","Proto.AddressBookService","#realtime","#resolver","Proto.AddressBookViewInvalidatedSchema","AddressBookViewInvalidatedSchema"],"sources":["../../../src/services/address-book/address-book.ts"],"sourcesContent":["import { createClient, type Client, type Transport } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/auth/v1/address_book_pb.js\";\nimport type { PolyesterRealtime } from \"../../realtime/types.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport type { AccountScopedInput } from \"../../shared/account-scope.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n AddressBookEntriesSchema,\n AddressBookEntrySchema,\n AddressBookSchema,\n AddressBookTagSchema,\n AddressBookViewSchema,\n AddressBookViewInvalidatedSchema,\n CopyAddressBookEntryInputSchema,\n CreateAddressBookEntryInputSchema,\n CreateAddressBookTagInputSchema,\n DeleteAddressBookEntryInputSchema,\n DeleteAddressBookTagInputSchema,\n GetAddressBookViewInputSchema,\n InternalTransferWhitelistEntriesSchema,\n ListAddressBookEntriesInputSchema,\n ListInternalTransferWhitelistEntriesInputSchema,\n ListTransferCounterpartiesInputSchema,\n ListTransferDestinationsInputSchema,\n SubaccountScopedInputSchema,\n TransferCounterpartiesSchema,\n TransferDestinationsSchema,\n UpdateAddressBookEntryInputSchema,\n UpdateAddressBookTagInputSchema,\n WithdrawWhitelistViewSchema,\n type AddressBook,\n type AddressBookEntries,\n type AddressBookEntry,\n type AddressBookTag,\n type AddressBookView,\n type AddressBookViewInvalidated,\n type CopyAddressBookEntryInput,\n type CreateAddressBookEntryInput,\n type CreateAddressBookTagInput,\n type DeleteAddressBookEntryInput,\n type DeleteAddressBookTagInput,\n type GetAddressBookViewInput,\n type InternalTransferWhitelistEntries,\n type ListAddressBookEntriesInput,\n type ListInternalTransferWhitelistEntriesInput,\n type ListTransferCounterpartiesInput,\n type ListTransferDestinationsInput,\n type SubaccountScopedInput,\n type TransferCounterparties,\n type TransferDestinations,\n type UpdateAddressBookEntryInput,\n type UpdateAddressBookTagInput,\n type WithdrawWhitelistView,\n} from \"./address-book.schemas.js\";\n\ninterface SubscribeViewInvalidationsInput extends BaseSubscribeInput<AddressBookViewInvalidated> {\n rootAccountPublicId: string;\n}\n\n/**\n * Manages saved transfer destinations, tags, whitelist views, and recent counterparties for root or subaccount-scoped address books.\n */\nexport class AddressBookService {\n #client: Client<typeof Proto.AddressBookService>;\n #realtime: PolyesterRealtime;\n #resolver?: SubaccountResolver;\n\n constructor(transport: Transport, realtime: PolyesterRealtime, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.AddressBookService, transport);\n this.#realtime = realtime;\n this.#resolver = resolver;\n }\n\n /**\n * Returns the root and subaccount address books visible to the caller, including caller role and display metadata.\n */\n async listBooks(options?: PolyesterRequestOptions): Promise<AddressBook[]> {\n const response = await this.#client.listAddressBooks({}, toConnectCallOptions(options));\n return response.books.map((book) => parse(AddressBookSchema, book));\n }\n\n /**\n * Returns saved address-book entries for the resolved subaccount scope, optionally filtered by external-chain or internal-account destination kind.\n */\n async listEntries(\n input: ListAddressBookEntriesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<{ entries: AddressBookEntries; nextPageToken: string }> {\n const request = parse(ListAddressBookEntriesInputSchema, this.resolveInput(input));\n const response = await this.#client.listAddressBookEntries(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n entries: parse(AddressBookEntriesSchema, response.entries),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /**\n * Creates a saved external withdrawal or internal transfer destination in the resolved address book, optionally attaching existing tags and creating new tags in the same request.\n */\n async createEntry(\n input: CreateAddressBookEntryInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookEntry | null> {\n const request = parse(CreateAddressBookEntryInputSchema, this.resolveInput(input));\n const response = await this.#client.createAddressBookEntry(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.entry ? parse(AddressBookEntrySchema, response.entry) : null;\n }\n\n /**\n * Updates selected saved-destination metadata using optimistic concurrency.\n */\n async updateEntry(\n input: UpdateAddressBookEntryInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookEntry | null> {\n const request = parse(UpdateAddressBookEntryInputSchema, input);\n const response = await this.#client.updateAddressBookEntry(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.entry ? parse(AddressBookEntrySchema, response.entry) : null;\n }\n\n /**\n * Deletes one saved destination from the selected address book.\n */\n async deleteEntry(\n input: DeleteAddressBookEntryInput,\n options?: PolyesterMutationOptions,\n ): Promise<void> {\n const request = parse(DeleteAddressBookEntryInputSchema, input);\n await this.#client.deleteAddressBookEntry(request, toConnectCallOptions(options));\n }\n\n /**\n * Copies a saved destination into another visible root or subaccount address book.\n */\n async copyEntry(\n input: CopyAddressBookEntryInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookEntry | null> {\n const request = parse(CopyAddressBookEntryInputSchema, input);\n const response = await this.#client.copyAddressBookEntry(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.entry ? parse(AddressBookEntrySchema, response.entry) : null;\n }\n\n /**\n * Creates a tag in the resolved address book scope for organizing saved destinations.\n */\n async createTag(\n input: CreateAddressBookTagInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookTag | null> {\n const request = parse(CreateAddressBookTagInputSchema, this.resolveInput(input));\n const response = await this.#client.createAddressBookTag(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.tag ? parse(AddressBookTagSchema, response.tag) : null;\n }\n\n /**\n * Updates a tag's name and optional color token.\n */\n async updateTag(\n input: UpdateAddressBookTagInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookTag | null> {\n const request = parse(UpdateAddressBookTagInputSchema, input);\n const response = await this.#client.updateAddressBookTag(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.tag ? parse(AddressBookTagSchema, response.tag) : null;\n }\n\n /**\n * Deletes a tag and detaches it from any address-book entries.\n */\n async deleteTag(\n input: DeleteAddressBookTagInput,\n options?: PolyesterMutationOptions,\n ): Promise<void> {\n const request = parse(DeleteAddressBookTagInputSchema, input);\n await this.#client.deleteAddressBookTag(request, toConnectCallOptions(options));\n }\n\n /**\n * Returns recent transfer counterparties, including unsaved destinations, with direction, kind, use count, and first/last seen timestamps.\n */\n async listTransferCounterparties(\n input: ListTransferCounterpartiesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<{ counterparties: TransferCounterparties; truncated: boolean }> {\n const request = parse(ListTransferCounterpartiesInputSchema, this.resolveInput(input));\n const response = await this.#client.listTransferCounterparties(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n counterparties: parse(TransferCounterpartiesSchema, response.counterparties),\n truncated: response.truncated,\n };\n }\n\n /**\n * Returns saved and whitelisted destinations available for transfer flows in the resolved address book scope.\n */\n async listTransferDestinations(\n input: ListTransferDestinationsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<{ destinations: TransferDestinations; nextPageToken: string }> {\n const request = parse(ListTransferDestinationsInputSchema, this.resolveInput(input));\n const response = await this.#client.listTransferDestinations(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n destinations: parse(TransferDestinationsSchema, response.destinations),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /**\n * Returns internal-transfer whitelist entries for the resolved scope, including target account metadata and resolution status.\n */\n async listInternalTransferWhitelistEntries(\n input: ListInternalTransferWhitelistEntriesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<{ entries: InternalTransferWhitelistEntries; nextPageToken: string }> {\n const request = parse(\n ListInternalTransferWhitelistEntriesInputSchema,\n this.resolveInput(input),\n );\n const response = await this.#client.listInternalTransferWhitelistEntries(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n entries: parse(InternalTransferWhitelistEntriesSchema, response.entries),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /**\n * Returns external and internal withdrawal whitelist requirements plus active mirrored external whitelist entries for the resolved scope.\n */\n async getWithdrawWhitelistView(\n input: SubaccountScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<WithdrawWhitelistView | null> {\n const request = parse(SubaccountScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.getWithdrawWhitelistView(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.view ? parse(WithdrawWhitelistViewSchema, response.view) : null;\n }\n\n /**\n * Fetches the combined address-book view used by dashboards: books, saved entries, recent destinations, tags, and withdrawal whitelist status.\n */\n async getView(\n input: GetAddressBookViewInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<AddressBookView> {\n const request = parse(GetAddressBookViewInputSchema, this.resolveInput(input));\n const response = await this.#client.getAddressBookView(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(AddressBookViewSchema, response);\n }\n\n /**\n * Subscribes to scoped address-book view invalidation signals for a root account.\n *\n * Use `scope` and `invalidatedAt` for diagnostics and ordering, then refetch `getView` for the canonical aggregate (entries, tags, recent destinations, whitelist). Do not patch individual rows from these events.\n */\n subscribeViewInvalidations(input: SubscribeViewInvalidationsInput): () => void {\n const channel = `private:auth:address-books:${input.rootAccountPublicId}:proto`;\n\n return this.#realtime.connectProtoChannel({\n channel,\n schema: Proto.AddressBookViewInvalidatedSchema,\n onPublication: (data) => {\n input.onEvent(parse(AddressBookViewInvalidatedSchema, data));\n },\n onConnected: () => input.onOpen?.(),\n onDisconnected: () => input.onClose?.(),\n onError: input.onError,\n });\n }\n\n private resolveInput<TInput extends AccountScopedInput>(input: TInput): TInput {\n return resolveAccountScopedInput(input, this.#resolver);\n }\n}\n"],"mappings":";;;;;;;;;;;AAqEA,IAAa,qBAAb,MAAgC;CAC5B;CACA;CACA;CAEA,YAAY,WAAsB,UAA6B,UAA+B;EAC1F,KAAKA,UAAU,aAAaC,sBAA0B,SAAS;EAC/D,KAAKC,YAAY;EACjB,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,UAAU,SAA2D;EAEvE,QAAO,MADgB,KAAKH,QAAQ,iBAAiB,CAAC,GAAG,qBAAqB,OAAO,CAAC,EAAA,CACtE,MAAM,KAAK,SAAS,MAAM,mBAAmB,IAAI,CAAC;CACtE;;;;CAKA,MAAM,YACF,QAAqC,CAAC,GACtC,SAC+D;EAC/D,MAAM,UAAU,MAAM,mCAAmC,KAAK,aAAa,KAAK,CAAC;EACjF,MAAM,WAAW,MAAM,KAAKA,QAAQ,uBAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO;GACH,SAAS,MAAM,0BAA0B,SAAS,OAAO;GACzD,eAAe,SAAS;EAC5B;CACJ;;;;CAKA,MAAM,YACF,OACA,SACgC;EAChC,MAAM,UAAU,MAA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C,SACwB;EACxB,MAAM,UAAU,MAAM,+BAA+B,KAAK,aAAa,KAAK,CAAC;EAC7E,MAAM,WAAW,MAAM,KAAKA,QAAQ,mBAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,uBAAuB,QAAQ;CAChD;;;;;;CAOA,2BAA2B,OAAoD;EAC3E,MAAM,UAAU,8BAA8B,MAAM,oBAAoB;EAExE,OAAO,KAAKE,UAAU,oBAAoB;GACtC;GACA,QAAQE;GACR,gBAAgB,SAAS;IACrB,MAAM,QAAQ,MAAMC,oCAAkC,IAAI,CAAC;GAC/D;GACA,mBAAmB,MAAM,SAAS;GAClC,sBAAsB,MAAM,UAAU;GACtC,SAAS,MAAM;EACnB,CAAC;CACL;CAEA,aAAwD,OAAuB;EAC3E,OAAO,0BAA0B,OAAO,KAAKF,SAAS;CAC1D;AACJ"}
|
|
1
|
+
{"version":3,"file":"address-book.js","names":["#client","Proto.AddressBookService","#realtime","#resolver","Proto.AddressBookViewInvalidatedSchema","AddressBookViewInvalidatedSchema"],"sources":["../../../src/services/address-book/address-book.ts"],"sourcesContent":["import { createClient, type Client, type Transport } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/auth/v1/address_book_pb.js\";\nimport type { PolyesterRealtime } from \"../../realtime/types.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport type { AccountScopedInput } from \"../../shared/account-scope.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n AddressBookEntriesSchema,\n AddressBookEntrySchema,\n AddressBookSchema,\n AddressBookTagSchema,\n AddressBookViewSchema,\n AddressBookViewInvalidatedSchema,\n CopyAddressBookEntryInputSchema,\n CreateAddressBookEntryInputSchema,\n CreateAddressBookTagInputSchema,\n DeleteAddressBookEntryInputSchema,\n DeleteAddressBookTagInputSchema,\n GetAddressBookViewInputSchema,\n InternalTransferWhitelistEntriesSchema,\n ListAddressBookEntriesInputSchema,\n ListInternalTransferWhitelistEntriesInputSchema,\n ListTransferCounterpartiesInputSchema,\n ListTransferDestinationsInputSchema,\n SubaccountScopedInputSchema,\n TransferCounterpartiesSchema,\n TransferDestinationsSchema,\n UpdateAddressBookEntryInputSchema,\n UpdateAddressBookTagInputSchema,\n WithdrawWhitelistViewSchema,\n type AddressBook,\n type AddressBookEntries,\n type AddressBookEntry,\n type AddressBookTag,\n type AddressBookView,\n type AddressBookViewInvalidated,\n type CopyAddressBookEntryInput,\n type CreateAddressBookEntryInput,\n type CreateAddressBookTagInput,\n type DeleteAddressBookEntryInput,\n type DeleteAddressBookTagInput,\n type GetAddressBookViewInput,\n type InternalTransferWhitelistEntries,\n type ListAddressBookEntriesInput,\n type ListInternalTransferWhitelistEntriesInput,\n type ListTransferCounterpartiesInput,\n type ListTransferDestinationsInput,\n type SubaccountScopedInput,\n type TransferCounterparties,\n type TransferDestinations,\n type UpdateAddressBookEntryInput,\n type UpdateAddressBookTagInput,\n type WithdrawWhitelistView,\n} from \"./address-book.schemas.js\";\n\ninterface SubscribeViewInvalidationsInput extends BaseSubscribeInput<AddressBookViewInvalidated> {\n rootAccountPublicId: string;\n}\n\n/**\n * Manages saved transfer destinations, tags, whitelist views, and recent counterparties for root or subaccount-scoped address books.\n */\nexport class AddressBookService {\n #client: Client<typeof Proto.AddressBookService>;\n #realtime: PolyesterRealtime;\n #resolver?: SubaccountResolver;\n\n constructor(transport: Transport, realtime: PolyesterRealtime, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.AddressBookService, transport);\n this.#realtime = realtime;\n this.#resolver = resolver;\n }\n\n /**\n * Returns the root and subaccount address books visible to the caller, including caller role and display metadata.\n */\n async listBooks(options?: PolyesterRequestOptions): Promise<AddressBook[]> {\n const response = await this.#client.listAddressBooks({}, toConnectCallOptions(options));\n return response.books.map((book) => parse(AddressBookSchema, book));\n }\n\n /**\n * Returns saved address-book entries for the resolved subaccount scope, optionally filtered by external-chain or internal-account destination kind.\n */\n async listEntries(\n input: ListAddressBookEntriesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<{ entries: AddressBookEntries; nextPageToken: string }> {\n const request = parse(ListAddressBookEntriesInputSchema, this.resolveInput(input));\n const response = await this.#client.listAddressBookEntries(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n entries: parse(AddressBookEntriesSchema, response.entries),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /**\n * Creates a saved external withdrawal or internal transfer destination in the resolved address book, optionally attaching existing tags and creating new tags in the same request.\n */\n async createEntry(\n input: CreateAddressBookEntryInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookEntry | null> {\n const request = parse(CreateAddressBookEntryInputSchema, this.resolveInput(input));\n const response = await this.#client.createAddressBookEntry(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.entry ? parse(AddressBookEntrySchema, response.entry) : null;\n }\n\n /**\n * Updates selected saved-destination metadata using optimistic concurrency, optionally creating and attaching tags in the same request.\n */\n async updateEntry(\n input: UpdateAddressBookEntryInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookEntry | null> {\n const request = parse(UpdateAddressBookEntryInputSchema, input);\n const response = await this.#client.updateAddressBookEntry(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.entry ? parse(AddressBookEntrySchema, response.entry) : null;\n }\n\n /**\n * Deletes one saved destination from the selected address book.\n */\n async deleteEntry(\n input: DeleteAddressBookEntryInput,\n options?: PolyesterMutationOptions,\n ): Promise<void> {\n const request = parse(DeleteAddressBookEntryInputSchema, input);\n await this.#client.deleteAddressBookEntry(request, toConnectCallOptions(options));\n }\n\n /**\n * Copies a saved destination into another visible root or subaccount address book.\n */\n async copyEntry(\n input: CopyAddressBookEntryInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookEntry | null> {\n const request = parse(CopyAddressBookEntryInputSchema, input);\n const response = await this.#client.copyAddressBookEntry(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.entry ? parse(AddressBookEntrySchema, response.entry) : null;\n }\n\n /**\n * Creates a tag in the resolved address book scope for organizing saved destinations.\n */\n async createTag(\n input: CreateAddressBookTagInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookTag | null> {\n const request = parse(CreateAddressBookTagInputSchema, this.resolveInput(input));\n const response = await this.#client.createAddressBookTag(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.tag ? parse(AddressBookTagSchema, response.tag) : null;\n }\n\n /**\n * Updates a tag's name and optional color token.\n */\n async updateTag(\n input: UpdateAddressBookTagInput,\n options?: PolyesterMutationOptions,\n ): Promise<AddressBookTag | null> {\n const request = parse(UpdateAddressBookTagInputSchema, input);\n const response = await this.#client.updateAddressBookTag(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.tag ? parse(AddressBookTagSchema, response.tag) : null;\n }\n\n /**\n * Deletes a tag and detaches it from any address-book entries.\n */\n async deleteTag(\n input: DeleteAddressBookTagInput,\n options?: PolyesterMutationOptions,\n ): Promise<void> {\n const request = parse(DeleteAddressBookTagInputSchema, input);\n await this.#client.deleteAddressBookTag(request, toConnectCallOptions(options));\n }\n\n /**\n * Returns recent transfer counterparties, including unsaved destinations, with direction, kind, use count, and first/last seen timestamps.\n */\n async listTransferCounterparties(\n input: ListTransferCounterpartiesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<{ counterparties: TransferCounterparties; truncated: boolean }> {\n const request = parse(ListTransferCounterpartiesInputSchema, this.resolveInput(input));\n const response = await this.#client.listTransferCounterparties(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n counterparties: parse(TransferCounterpartiesSchema, response.counterparties),\n truncated: response.truncated,\n };\n }\n\n /**\n * Returns saved and whitelisted destinations available for transfer flows in the resolved address book scope.\n */\n async listTransferDestinations(\n input: ListTransferDestinationsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<{ destinations: TransferDestinations; nextPageToken: string }> {\n const request = parse(ListTransferDestinationsInputSchema, this.resolveInput(input));\n const response = await this.#client.listTransferDestinations(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n destinations: parse(TransferDestinationsSchema, response.destinations),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /**\n * Returns internal-transfer whitelist entries for the resolved scope, including target account metadata and resolution status.\n */\n async listInternalTransferWhitelistEntries(\n input: ListInternalTransferWhitelistEntriesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<{ entries: InternalTransferWhitelistEntries; nextPageToken: string }> {\n const request = parse(\n ListInternalTransferWhitelistEntriesInputSchema,\n this.resolveInput(input),\n );\n const response = await this.#client.listInternalTransferWhitelistEntries(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n entries: parse(InternalTransferWhitelistEntriesSchema, response.entries),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /**\n * Returns external and internal withdrawal whitelist requirements plus active mirrored external whitelist entries for the resolved scope.\n */\n async getWithdrawWhitelistView(\n input: SubaccountScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<WithdrawWhitelistView | null> {\n const request = parse(SubaccountScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.getWithdrawWhitelistView(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.view ? parse(WithdrawWhitelistViewSchema, response.view) : null;\n }\n\n /**\n * Fetches the combined address-book view used by dashboards: books, saved entries, recent destinations, tags, and withdrawal whitelist status.\n */\n async getView(\n input: GetAddressBookViewInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<AddressBookView> {\n const request = parse(GetAddressBookViewInputSchema, this.resolveInput(input));\n const response = await this.#client.getAddressBookView(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(AddressBookViewSchema, response);\n }\n\n /**\n * Subscribes to scoped address-book view invalidation signals for a root account.\n *\n * Use `scope` and `invalidatedAt` for diagnostics and ordering, then refetch `getView` for the canonical aggregate (entries, tags, recent destinations, whitelist). Do not patch individual rows from these events.\n */\n subscribeViewInvalidations(input: SubscribeViewInvalidationsInput): () => void {\n const channel = `private:auth:address-books:${input.rootAccountPublicId}:proto`;\n\n return this.#realtime.connectProtoChannel({\n channel,\n schema: Proto.AddressBookViewInvalidatedSchema,\n onPublication: (data) => {\n input.onEvent(parse(AddressBookViewInvalidatedSchema, data));\n },\n onConnected: () => input.onOpen?.(),\n onDisconnected: () => input.onClose?.(),\n onError: input.onError,\n });\n }\n\n private resolveInput<TInput extends AccountScopedInput>(input: TInput): TInput {\n return resolveAccountScopedInput(input, this.#resolver);\n }\n}\n"],"mappings":";;;;;;;;;;;AAqEA,IAAa,qBAAb,MAAgC;CAC5B;CACA;CACA;CAEA,YAAY,WAAsB,UAA6B,UAA+B;EAC1F,KAAKA,UAAU,aAAaC,sBAA0B,SAAS;EAC/D,KAAKC,YAAY;EACjB,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,UAAU,SAA2D;EAEvE,QAAO,MADgB,KAAKH,QAAQ,iBAAiB,CAAC,GAAG,qBAAqB,OAAO,CAAC,EAAA,CACtE,MAAM,KAAK,SAAS,MAAM,mBAAmB,IAAI,CAAC;CACtE;;;;CAKA,MAAM,YACF,QAAqC,CAAC,GACtC,SAC+D;EAC/D,MAAM,UAAU,MAAM,mCAAmC,KAAK,aAAa,KAAK,CAAC;EACjF,MAAM,WAAW,MAAM,KAAKA,QAAQ,uBAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO;GACH,SAAS,MAAM,0BAA0B,SAAS,OAAO;GACzD,eAAe,SAAS;EAC5B;CACJ;;;;CAKA,MAAM,YACF,OACA,SACgC;EAChC,MAAM,UAAU,MAAM,mCAAmC,KAAK,aAAa,KAAK,CAAC;EACjF,MAAM,WAAW,MAAM,KAAKA,QAAQ,uBAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC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OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,uBAAuB,QAAQ;CAChD;;;;;;CAOA,2BAA2B,OAAoD;EAC3E,MAAM,UAAU,8BAA8B,MAAM,oBAAoB;EAExE,OAAO,KAAKE,UAAU,oBAAoB;GACtC;GACA,QAAQE;GACR,gBAAgB,SAAS;IACrB,MAAM,QAAQ,MAAMC,oCAAkC,IAAI,CAAC;GAC/D;GACA,mBAAmB,MAAM,SAAS;GAClC,sBAAsB,MAAM,UAAU;GACtC,SAAS,MAAM;EACnB,CAAC;CACL;CAEA,aAAwD,OAAuB;EAC3E,OAAO,0BAA0B,OAAO,KAAKF,SAAS;CAC1D;AACJ"}
|
|
@@ -35,10 +35,13 @@ declare const CreateAddressBookEntryInputSchema: v.SchemaWithPipe<readonly [v.St
|
|
|
35
35
|
readonly smartAccountAddress: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
36
36
|
}, undefined>], undefined>;
|
|
37
37
|
readonly tagIds: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>, undefined>, readonly []>;
|
|
38
|
-
readonly newTags: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
39
|
-
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
40
|
-
readonly color: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, "">;
|
|
41
|
-
}, undefined>, undefined>,
|
|
38
|
+
readonly newTags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
|
|
39
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 48, undefined>]>;
|
|
40
|
+
readonly color: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 32, undefined>]>, "">;
|
|
41
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
42
|
+
name: string;
|
|
43
|
+
color: string;
|
|
44
|
+
}[], 10, undefined>]>, readonly []>;
|
|
42
45
|
readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
|
|
43
46
|
readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
44
47
|
}, undefined>], undefined>, undefined>;
|
|
@@ -94,18 +97,33 @@ declare const UpdateAddressBookEntryInputSchema: v.SchemaWithPipe<readonly [v.St
|
|
|
94
97
|
readonly label: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
95
98
|
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
96
99
|
readonly tagIds: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>, undefined>, undefined>;
|
|
100
|
+
readonly newTags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
|
|
101
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 48, undefined>]>;
|
|
102
|
+
readonly color: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 32, undefined>]>, "">;
|
|
103
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
104
|
+
name: string;
|
|
105
|
+
color: string;
|
|
106
|
+
}[], 10, undefined>]>, undefined>;
|
|
97
107
|
}, undefined>, v.CheckAction<{
|
|
98
108
|
addressBookEntryId: bigint;
|
|
99
109
|
expectedRevision: bigint;
|
|
100
110
|
label?: string | undefined;
|
|
101
111
|
note?: string | undefined;
|
|
102
112
|
tagIds?: bigint[] | undefined;
|
|
113
|
+
newTags?: {
|
|
114
|
+
name: string;
|
|
115
|
+
color: string;
|
|
116
|
+
}[] | undefined;
|
|
103
117
|
}, "At least one address-book entry field must be provided">, v.TransformAction<{
|
|
104
118
|
addressBookEntryId: bigint;
|
|
105
119
|
expectedRevision: bigint;
|
|
106
120
|
label?: string | undefined;
|
|
107
121
|
note?: string | undefined;
|
|
108
122
|
tagIds?: bigint[] | undefined;
|
|
123
|
+
newTags?: {
|
|
124
|
+
name: string;
|
|
125
|
+
color: string;
|
|
126
|
+
}[] | undefined;
|
|
109
127
|
}, {
|
|
110
128
|
addressBookEntryId: bigint;
|
|
111
129
|
entry: Partial<{
|
|
@@ -114,6 +132,11 @@ declare const UpdateAddressBookEntryInputSchema: v.SchemaWithPipe<readonly [v.St
|
|
|
114
132
|
note: string;
|
|
115
133
|
} & {
|
|
116
134
|
tagIds: bigint[];
|
|
135
|
+
} & {
|
|
136
|
+
newTags: {
|
|
137
|
+
name: string;
|
|
138
|
+
color: string;
|
|
139
|
+
}[];
|
|
117
140
|
}>;
|
|
118
141
|
updateMask: {
|
|
119
142
|
paths: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-book.schemas.d.ts","names":[],"sources":["../../../src/services/address-book/address-book.schemas.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"address-book.schemas.d.ts","names":[],"sources":["../../../src/services/address-book/address-book.schemas.ts"],"mappings":";;;;cAoDa,mCAAiC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;KAelC,8BAA8B,EAAE,kBAAkB;cAEjD,mCAAiC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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D7B,yBAAyB,EAAE,mBAAmB;cAE7C,yCAAuC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+CxC,oCAAoC,EAAE,mBACvC;cAGE,uBAAqB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAStB,kBAAkB,EAAE,mBAAmB;cAEtC,kCAAgC,EAAA;;;;;;;;;;;;;;KAKjC,6BAA6B,EAAE,mBAAmB"}
|
|
@@ -17,9 +17,10 @@ const AddressBookViewLimitSchema = v.optional(v.pipe(v.number(), v.integer(), v.
|
|
|
17
17
|
const PageTokenSchema = v.optional(v.pipe(v.string(), v.trim()), "");
|
|
18
18
|
const TimestampMsSchema = OptionalTimestampMsSchema;
|
|
19
19
|
const AddressBookTagInputSchema = v.strictObject({
|
|
20
|
-
name: v.pipe(v.string(), v.trim(), v.minLength(1)),
|
|
21
|
-
color: v.optional(v.pipe(v.string(), v.trim()), "")
|
|
20
|
+
name: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(48)),
|
|
21
|
+
color: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(32)), "")
|
|
22
22
|
});
|
|
23
|
+
const AddressBookTagInputsSchema = v.pipe(v.array(AddressBookTagInputSchema), v.maxLength(10));
|
|
23
24
|
const ListAddressBookEntriesInputSchema = v.pipe(v.strictObject({
|
|
24
25
|
...AccountScopeInputEntries,
|
|
25
26
|
kind: v.optional(v.picklist(ADDRESS_BOOK_ENTRY_KIND_VALUES)),
|
|
@@ -44,7 +45,7 @@ const CreateAddressBookEntryInputSchema = v.pipe(v.strictObject({
|
|
|
44
45
|
smartAccountAddress: v.pipe(v.string(), v.trim(), v.minLength(1))
|
|
45
46
|
})]),
|
|
46
47
|
tagIds: v.optional(v.array(IdSchema("tagId")), []),
|
|
47
|
-
newTags: v.optional(
|
|
48
|
+
newTags: v.optional(AddressBookTagInputsSchema, [])
|
|
48
49
|
}), v.transform(({ account, entry, ...rest }) => ({
|
|
49
50
|
...rest,
|
|
50
51
|
subaccountId: accountScopeToSubaccountId(account),
|
|
@@ -74,6 +75,10 @@ const ADDRESS_BOOK_ENTRY_PATCH_FIELDS = defineProtoPatchFields()({
|
|
|
74
75
|
tagIds: {
|
|
75
76
|
path: "tag_ids",
|
|
76
77
|
encode: (tagIds) => ({ tagIds })
|
|
78
|
+
},
|
|
79
|
+
newTags: {
|
|
80
|
+
path: "new_tags",
|
|
81
|
+
encode: (newTags) => ({ newTags })
|
|
77
82
|
}
|
|
78
83
|
});
|
|
79
84
|
const UpdateAddressBookEntryInputSchema = v.pipe(v.strictObject({
|
|
@@ -81,8 +86,9 @@ const UpdateAddressBookEntryInputSchema = v.pipe(v.strictObject({
|
|
|
81
86
|
expectedRevision: positiveBigintStringInputSchema("expectedRevision"),
|
|
82
87
|
label: v.optional(v.pipe(v.string(), v.trim())),
|
|
83
88
|
note: v.optional(v.pipe(v.string(), v.trim())),
|
|
84
|
-
tagIds: v.optional(v.array(IdSchema("tagId")))
|
|
85
|
-
|
|
89
|
+
tagIds: v.optional(v.array(IdSchema("tagId"))),
|
|
90
|
+
newTags: v.optional(AddressBookTagInputsSchema)
|
|
91
|
+
}), v.check(({ label, note, tagIds, newTags }) => label !== void 0 || note !== void 0 || tagIds !== void 0 || newTags !== void 0, "At least one address-book entry field must be provided"), v.transform(({ addressBookEntryId, expectedRevision, ...input }) => {
|
|
86
92
|
const { patch: entry, updateMask } = buildProtoPatch(input, ADDRESS_BOOK_ENTRY_PATCH_FIELDS);
|
|
87
93
|
return {
|
|
88
94
|
addressBookEntryId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-book.schemas.js","names":["Proto.AccountScopeType","Proto.DestinationWhitelistStatus","Proto.AddressBookEntryKind","Proto.TransferCounterpartyDirection","Proto.InternalWhitelistResolutionStatus","RequiredTimestampMsSchema"],"sources":["../../../src/services/address-book/address-book.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport * as Proto from \"../../gen/auth/v1/address_book_pb.js\";\nimport { SubaccountRole } from \"../../gen/auth/v1/subaccounts_pb.js\";\nimport {\n OptionalTimestampMsSchema,\n BigIntStringSchema,\n PublicIdSchema,\n TimestampMsSchema as RequiredTimestampMsSchema,\n idInputSchema,\n optionalSubaccountIdInputSchema,\n positiveBigintStringInputSchema,\n} from \"../../shared/schemas.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport {\n ADDRESS_BOOK_ENTRY_KIND_VALUES,\n AccountScopeTypeCodec,\n AddressBookEntryKindCodec,\n DestinationWhitelistStatusCodec,\n InternalWhitelistResolutionStatusCodec,\n TRANSFER_COUNTERPARTY_DIRECTION_VALUES,\n TransferCounterpartyDirectionCodec,\n} from \"./address-book.codecs.js\";\nimport { SubaccountRoleCodec } from \"../subaccounts/subaccounts.codecs.js\";\nimport { buildProtoPatch, defineProtoPatchFields } from \"../../utils/proto-patch.js\";\n\nconst OptionalSubaccountIdSchema = optionalSubaccountIdInputSchema();\nconst IdSchema = idInputSchema;\n\nconst AddressBookLimitSchema = v.optional(\n v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(500)),\n);\nconst AddressBookCounterpartyLimitSchema = v.optional(\n v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(200)),\n);\nconst AddressBookViewLimitSchema = v.optional(\n v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(200)),\n);\nconst PageTokenSchema = v.optional(v.pipe(v.string(), v.trim()), \"\");\n\nconst TimestampMsSchema = OptionalTimestampMsSchema;\n\nconst AddressBookTagInputSchema = v.strictObject({\n name: v.pipe(v.string(), v.trim(), v.minLength(1)),\n color: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n});\n\nexport const ListAddressBookEntriesInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n kind: v.optional(v.picklist(ADDRESS_BOOK_ENTRY_KIND_VALUES)),\n limit: AddressBookLimitSchema,\n pageToken: PageTokenSchema,\n }),\n v.transform(({ account, kind, limit, pageToken }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n kind: kind ? AddressBookEntryKindCodec.inputToProto[kind] : undefined,\n limit,\n pageToken,\n })),\n);\n\nexport type ListAddressBookEntriesInput = v.InferInput<typeof ListAddressBookEntriesInputSchema>;\n\nexport const CreateAddressBookEntryInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n label: v.pipe(v.string(), v.trim(), v.minLength(1)),\n note: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n entry: v.variant(\"kind\", [\n v.strictObject({\n kind: v.literal(\"external\"),\n polychainChainId: v.pipe(v.number(), v.integer(), v.gtValue(0)),\n address: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n v.strictObject({\n kind: v.literal(\"internal\"),\n smartAccountAddress: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n ]),\n tagIds: v.optional(v.array(IdSchema(\"tagId\")), []),\n newTags: v.optional(v.array(AddressBookTagInputSchema), []),\n }),\n v.transform(({ account, entry, ...rest }) => ({\n ...rest,\n subaccountId: accountScopeToSubaccountId(account),\n entry:\n entry.kind === \"external\"\n ? {\n case: \"external\" as const,\n value: {\n polychainChainId: entry.polychainChainId,\n address: entry.address,\n },\n }\n : {\n case: \"internal\" as const,\n value: {\n smartAccountAddress: entry.smartAccountAddress,\n },\n },\n })),\n);\n\nexport type CreateAddressBookEntryInput = v.InferInput<typeof CreateAddressBookEntryInputSchema>;\n\nexport function validateCreateAddressBookEntryInput(input: CreateAddressBookEntryInput): void {\n parse(CreateAddressBookEntryInputSchema, input);\n}\n\ntype AddressBookEntryPatch = {\n label?: string;\n note?: string;\n tagIds?: bigint[];\n};\n\nconst ADDRESS_BOOK_ENTRY_PATCH_FIELDS = defineProtoPatchFields<AddressBookEntryPatch>()({\n label: { path: \"label\", encode: (label) => ({ label }) },\n note: { path: \"note\", encode: (note) => ({ note }) },\n tagIds: { path: \"tag_ids\", encode: (tagIds) => ({ tagIds }) },\n});\n\nexport const UpdateAddressBookEntryInputSchema = v.pipe(\n v.strictObject({\n addressBookEntryId: IdSchema(\"addressBookEntryId\"),\n expectedRevision: positiveBigintStringInputSchema(\"expectedRevision\"),\n label: v.optional(v.pipe(v.string(), v.trim())),\n note: v.optional(v.pipe(v.string(), v.trim())),\n tagIds: v.optional(v.array(IdSchema(\"tagId\"))),\n }),\n v.check(\n ({ label, note, tagIds }) =>\n label !== undefined || note !== undefined || tagIds !== undefined,\n \"At least one address-book entry field must be provided\",\n ),\n v.transform(({ addressBookEntryId, expectedRevision, ...input }) => {\n const { patch: entry, updateMask } = buildProtoPatch(\n input,\n ADDRESS_BOOK_ENTRY_PATCH_FIELDS,\n );\n return { addressBookEntryId, entry, updateMask, expectedRevision };\n }),\n);\n\nexport type UpdateAddressBookEntryInput = v.InferInput<typeof UpdateAddressBookEntryInputSchema>;\n\nexport const DeleteAddressBookEntryInputSchema = v.strictObject({\n addressBookEntryId: IdSchema(\"addressBookEntryId\"),\n});\n\nexport type DeleteAddressBookEntryInput = v.InferInput<typeof DeleteAddressBookEntryInputSchema>;\n\nexport const CopyAddressBookEntryInputSchema = v.strictObject({\n addressBookEntryId: IdSchema(\"addressBookEntryId\"),\n targetSubaccountId: OptionalSubaccountIdSchema,\n});\n\nexport type CopyAddressBookEntryInput = v.InferInput<typeof CopyAddressBookEntryInputSchema>;\n\nexport const CreateAddressBookTagInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n name: v.pipe(v.string(), v.trim(), v.minLength(1)),\n color: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type CreateAddressBookTagInput = v.InferInput<typeof CreateAddressBookTagInputSchema>;\n\nexport const UpdateAddressBookTagInputSchema = v.pipe(\n v.strictObject({\n tagId: IdSchema(\"tagId\"),\n name: v.optional(v.pipe(v.string(), v.trim(), v.minLength(1))),\n color: v.optional(v.pipe(v.string(), v.trim())),\n }),\n v.check(\n ({ name, color }) => name !== undefined || color !== undefined,\n \"At least one address-book tag field must be provided\",\n ),\n);\n\nexport type UpdateAddressBookTagInput = v.InferInput<typeof UpdateAddressBookTagInputSchema>;\n\nexport const DeleteAddressBookTagInputSchema = v.strictObject({\n tagId: IdSchema(\"tagId\"),\n});\n\nexport type DeleteAddressBookTagInput = v.InferInput<typeof DeleteAddressBookTagInputSchema>;\n\nexport const ListTransferCounterpartiesInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n direction: v.optional(v.picklist(TRANSFER_COUNTERPARTY_DIRECTION_VALUES)),\n kind: v.optional(v.picklist(ADDRESS_BOOK_ENTRY_KIND_VALUES)),\n limit: AddressBookCounterpartyLimitSchema,\n }),\n v.transform(({ account, direction, kind, limit }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n direction: direction\n ? TransferCounterpartyDirectionCodec.inputToProto[direction]\n : undefined,\n kind: kind ? AddressBookEntryKindCodec.inputToProto[kind] : undefined,\n limit,\n })),\n);\n\nexport type ListTransferCounterpartiesInput = v.InferInput<\n typeof ListTransferCounterpartiesInputSchema\n>;\n\nexport const ListTransferDestinationsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n kind: v.optional(v.picklist(ADDRESS_BOOK_ENTRY_KIND_VALUES)),\n limit: AddressBookLimitSchema,\n pageToken: PageTokenSchema,\n }),\n v.transform(({ account, kind, limit, pageToken }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n kind: kind ? AddressBookEntryKindCodec.inputToProto[kind] : undefined,\n limit,\n pageToken,\n })),\n);\n\nexport type ListTransferDestinationsInput = v.InferInput<\n typeof ListTransferDestinationsInputSchema\n>;\n\nexport const SubaccountScopedInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n }),\n v.transform(({ account }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type SubaccountScopedInput = v.InferInput<typeof SubaccountScopedInputSchema>;\n\nexport const ListInternalTransferWhitelistEntriesInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n limit: AddressBookLimitSchema,\n pageToken: PageTokenSchema,\n }),\n v.transform(({ account, limit, pageToken }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n limit,\n pageToken,\n })),\n);\n\nexport type ListInternalTransferWhitelistEntriesInput = v.InferInput<\n typeof ListInternalTransferWhitelistEntriesInputSchema\n>;\n\nexport const GetAddressBookViewInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n limit: AddressBookViewLimitSchema,\n }),\n v.transform(({ account, limit }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n limit,\n })),\n);\n\nexport type GetAddressBookViewInput = v.InferInput<typeof GetAddressBookViewInputSchema>;\n\nconst CountSchema = v.pipe(\n v.bigint(),\n v.transform((value) => Number(value)),\n);\n\nconst AccountScopeSchema = v.object({\n scopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.AccountScopeSchema\",\n \"scope type\",\n ),\n ),\n ),\n rootAccountId: PublicIdSchema,\n subaccountId: PublicIdSchema,\n});\n\nconst ExternalWithdrawAddressSchema = v.object({\n polychainChainId: v.pipe(v.number(), v.integer()),\n address: v.string(),\n});\n\nconst InternalTransferAccountSchema = v.object({\n rootAccountId: PublicIdSchema,\n targetAccountId: PublicIdSchema,\n targetScopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.InternalTransferAccountSchema\",\n \"target scope type\",\n ),\n ),\n ),\n smartAccountAddress: v.string(),\n rootUsername: v.string(),\n subaccountLabel: v.string(),\n});\n\nconst AddressBookEntryValueSchema = v.variant(\"case\", [\n v.object({ case: v.literal(\"external\"), value: ExternalWithdrawAddressSchema }),\n v.object({ case: v.literal(\"internal\"), value: InternalTransferAccountSchema }),\n v.object({ case: v.undefined(), value: v.optional(v.undefined()) }),\n]);\n\nconst DestinationWhitelistStatusSchema = v.pipe(\n v.enum(Proto.DestinationWhitelistStatus),\n v.transform((value) =>\n requiredEnumLabel(\n DestinationWhitelistStatusCodec.protoToOutput,\n value,\n \"PolyesterClient.DestinationWhitelistStatusSchema\",\n \"whitelist status\",\n ),\n ),\n);\n\nconst AddressBookEntryKindSchema = v.pipe(\n v.enum(Proto.AddressBookEntryKind),\n v.transform((value) =>\n requiredEnumLabel(\n AddressBookEntryKindCodec.protoToOutput,\n value,\n \"PolyesterClient.AddressBookEntryKindSchema\",\n \"entry kind\",\n ),\n ),\n);\n\nconst TransferCounterpartyDirectionSchema = v.pipe(\n v.enum(Proto.TransferCounterpartyDirection),\n v.transform((value) =>\n requiredEnumLabel(\n TransferCounterpartyDirectionCodec.protoToOutput,\n value,\n \"PolyesterClient.TransferCounterpartyDirectionSchema\",\n \"direction\",\n ),\n ),\n);\n\nexport const AddressBookSchema = v.object({\n scope: v.optional(AccountScopeSchema),\n callerRole: v.pipe(\n v.enum(SubaccountRole),\n v.transform((role) =>\n requiredEnumLabel(\n SubaccountRoleCodec.protoToOutput,\n role,\n \"AddressBookEntrySchema\",\n \"caller role\",\n ),\n ),\n ),\n label: v.string(),\n ownerUsername: v.string(),\n smartAccountAddress: v.string(),\n});\n\nexport type AddressBook = v.InferOutput<typeof AddressBookSchema>;\n\nexport const AddressBookTagSummarySchema = v.object({\n tagId: PublicIdSchema,\n name: v.string(),\n color: v.string(),\n});\n\nexport type AddressBookTagSummary = v.InferOutput<typeof AddressBookTagSummarySchema>;\n\nexport const AddressBookTagSchema = v.object({\n tagId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n name: v.string(),\n color: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n});\n\nexport type AddressBookTag = v.InferOutput<typeof AddressBookTagSchema>;\n\nexport const AddressBookEntrySchema = v.object({\n addressBookEntryId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n kind: AddressBookEntryKindSchema,\n label: v.string(),\n note: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n entry: AddressBookEntryValueSchema,\n tags: v.array(AddressBookTagSchema),\n revision: BigIntStringSchema,\n});\n\nexport type AddressBookEntry = v.InferOutput<typeof AddressBookEntrySchema>;\n\nexport const AddressBookEntriesSchema = v.array(AddressBookEntrySchema);\nexport type AddressBookEntries = v.InferOutput<typeof AddressBookEntriesSchema>;\n\nexport const TransferCounterpartySchema = v.object({\n counterpartyId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n direction: TransferCounterpartyDirectionSchema,\n kind: AddressBookEntryKindSchema,\n saved: v.boolean(),\n addressBookEntryId: PublicIdSchema,\n useCount: CountSchema,\n firstSeenAt: TimestampMsSchema,\n lastSeenAt: TimestampMsSchema,\n counterparty: AddressBookEntryValueSchema,\n});\n\nexport type TransferCounterparty = v.InferOutput<typeof TransferCounterpartySchema>;\n\nexport const TransferCounterpartiesSchema = v.array(TransferCounterpartySchema);\nexport type TransferCounterparties = v.InferOutput<typeof TransferCounterpartiesSchema>;\n\nexport const TransferDestinationSchema = v.object({\n scope: v.optional(AccountScopeSchema),\n kind: AddressBookEntryKindSchema,\n saved: v.boolean(),\n whitelisted: v.boolean(),\n whitelistStatus: DestinationWhitelistStatusSchema,\n addressBookEntry: v.optional(AddressBookEntrySchema),\n destination: AddressBookEntryValueSchema,\n whitelistEffectiveAt: TimestampMsSchema,\n whitelistUpdatedAt: TimestampMsSchema,\n});\n\nexport type TransferDestination = v.InferOutput<typeof TransferDestinationSchema>;\n\nexport const TransferDestinationsSchema = v.array(TransferDestinationSchema);\nexport type TransferDestinations = v.InferOutput<typeof TransferDestinationsSchema>;\n\nexport const InternalTransferWhitelistEntrySchema = v.object({\n entryId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n rootAccountId: PublicIdSchema,\n targetAccountId: PublicIdSchema,\n targetScopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.InternalTransferWhitelistEntrySchema\",\n \"target scope type\",\n ),\n ),\n ),\n smartAccountAddress: v.string(),\n rootUsername: v.string(),\n subaccountLabel: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n resolutionStatus: v.pipe(\n v.enum(Proto.InternalWhitelistResolutionStatus),\n v.transform((value) =>\n requiredEnumLabel(\n InternalWhitelistResolutionStatusCodec.protoToOutput,\n value,\n \"PolyesterClient.InternalTransferWhitelistEntrySchema\",\n \"resolution status\",\n ),\n ),\n ),\n});\n\nexport type InternalTransferWhitelistEntry = v.InferOutput<\n typeof InternalTransferWhitelistEntrySchema\n>;\n\nexport const InternalTransferWhitelistEntriesSchema = v.array(InternalTransferWhitelistEntrySchema);\n\nexport type InternalTransferWhitelistEntries = v.InferOutput<\n typeof InternalTransferWhitelistEntriesSchema\n>;\n\nexport const MirroredWithdrawWhitelistEntrySchema = v.object({\n canonicalAddress: v.string(),\n rawAddressHex: v.string(),\n updatedAt: TimestampMsSchema,\n polychainChainId: v.pipe(v.number(), v.integer()),\n});\n\nexport type MirroredWithdrawWhitelistEntry = v.InferOutput<\n typeof MirroredWithdrawWhitelistEntrySchema\n>;\n\nexport const WithdrawWhitelistViewSchema = v.object({\n scope: v.optional(AccountScopeSchema),\n externalWhitelistRequired: v.boolean(),\n internalWhitelistRequired: v.boolean(),\n activeEntries: v.optional(v.array(MirroredWithdrawWhitelistEntrySchema), []),\n});\n\nexport type WithdrawWhitelistView = v.InferOutput<typeof WithdrawWhitelistViewSchema>;\n\nexport const AddressBookEntriesViewSchema = v.object({\n external: v.optional(\n v.array(\n v.object({\n addressBookEntryId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n label: v.string(),\n note: v.string(),\n tagIds: v.optional(v.array(PublicIdSchema), []),\n whitelistStatus: DestinationWhitelistStatusSchema,\n polychainChainId: v.pipe(v.number(), v.integer()),\n address: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n revision: BigIntStringSchema,\n }),\n ),\n [],\n ),\n internal: v.optional(\n v.array(\n v.object({\n addressBookEntryId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n label: v.string(),\n note: v.string(),\n tagIds: v.optional(v.array(PublicIdSchema), []),\n whitelistStatus: DestinationWhitelistStatusSchema,\n rootAccountId: PublicIdSchema,\n targetAccountId: PublicIdSchema,\n targetScopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.AddressBookEntriesViewSchema\",\n \"target scope type\",\n ),\n ),\n ),\n smartAccountAddress: v.string(),\n rootUsername: v.string(),\n subaccountLabel: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n revision: BigIntStringSchema,\n }),\n ),\n [],\n ),\n});\n\nexport type AddressBookEntriesView = v.InferOutput<typeof AddressBookEntriesViewSchema>;\n\nexport const AddressBookRecentDestinationsViewSchema = v.object({\n external: v.optional(\n v.array(\n v.object({\n scope: v.optional(AccountScopeSchema),\n lastDirection: TransferCounterpartyDirectionSchema,\n saved: v.boolean(),\n addressBookEntryId: PublicIdSchema,\n useCount: CountSchema,\n lastSeenAt: TimestampMsSchema,\n polychainChainId: v.pipe(v.number(), v.integer()),\n address: v.string(),\n }),\n ),\n [],\n ),\n internal: v.optional(\n v.array(\n v.object({\n scope: v.optional(AccountScopeSchema),\n lastDirection: TransferCounterpartyDirectionSchema,\n saved: v.boolean(),\n addressBookEntryId: PublicIdSchema,\n useCount: CountSchema,\n lastSeenAt: TimestampMsSchema,\n rootAccountId: PublicIdSchema,\n targetAccountId: PublicIdSchema,\n targetScopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.AddressBookRecentDestinationsViewSchema\",\n \"target scope type\",\n ),\n ),\n ),\n smartAccountAddress: v.string(),\n rootUsername: v.string(),\n subaccountLabel: v.string(),\n }),\n ),\n [],\n ),\n});\n\nexport type AddressBookRecentDestinationsView = v.InferOutput<\n typeof AddressBookRecentDestinationsViewSchema\n>;\n\nexport const AddressBookViewSchema = v.object({\n books: v.optional(v.array(AddressBookSchema), []),\n entries: v.optional(AddressBookEntriesViewSchema),\n recentDestinations: v.optional(AddressBookRecentDestinationsViewSchema),\n tags: v.optional(v.array(AddressBookTagSummarySchema), []),\n withdrawWhitelist: v.optional(WithdrawWhitelistViewSchema),\n recentDestinationsTruncated: v.optional(v.boolean(), false),\n});\n\nexport type AddressBookView = v.InferOutput<typeof AddressBookViewSchema>;\n\nexport const AddressBookViewInvalidatedSchema = v.object({\n scope: v.optional(AccountScopeSchema),\n invalidatedAt: RequiredTimestampMsSchema,\n});\n\nexport type AddressBookViewInvalidated = v.InferOutput<typeof AddressBookViewInvalidatedSchema>;\n"],"mappings":";;;;;;;;;;;AA8BA,MAAM,6BAA6B,gCAAgC;AACnE,MAAM,WAAW;AAEjB,MAAM,yBAAyB,EAAE,SAC7B,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CACjE;AACA,MAAM,qCAAqC,EAAE,SACzC,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CACjE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ACvB,iBAAiB,EAAE,OAAO;CAC9B,CAAC,CACL,GACA,CAAC,CACL;AACJ,CAAC;AAMD,MAAa,wBAAwB,EAAE,OAAO;CAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,GAAG,CAAC,CAAC;CAChD,SAAS,EAAE,SAAS,4BAA4B;CAChD,oBAAoB,EAAE,SAAS,uCAAuC;CACtE,MAAM,EAAE,SAAS,EAAE,MAAM,2BAA2B,GAAG,CAAC,CAAC;CACzD,mBAAmB,EAAE,SAAS,2BAA2B;CACzD,6BAA6B,EAAE,SAAS,EAAE,QAAQ,GAAG,KAAK;AAC9D,CAAC;AAID,MAAa,mCAAmC,EAAE,OAAO;CACrD,OAAO,EAAE,SAAS,kBAAkB;CACpC,eAAeK;AACnB,CAAC"}
|
|
1
|
+
{"version":3,"file":"address-book.schemas.js","names":["Proto.AccountScopeType","Proto.DestinationWhitelistStatus","Proto.AddressBookEntryKind","Proto.TransferCounterpartyDirection","Proto.InternalWhitelistResolutionStatus","RequiredTimestampMsSchema"],"sources":["../../../src/services/address-book/address-book.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport * as Proto from \"../../gen/auth/v1/address_book_pb.js\";\nimport { SubaccountRole } from \"../../gen/auth/v1/subaccounts_pb.js\";\nimport {\n OptionalTimestampMsSchema,\n BigIntStringSchema,\n PublicIdSchema,\n TimestampMsSchema as RequiredTimestampMsSchema,\n idInputSchema,\n optionalSubaccountIdInputSchema,\n positiveBigintStringInputSchema,\n} from \"../../shared/schemas.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport {\n ADDRESS_BOOK_ENTRY_KIND_VALUES,\n AccountScopeTypeCodec,\n AddressBookEntryKindCodec,\n DestinationWhitelistStatusCodec,\n InternalWhitelistResolutionStatusCodec,\n TRANSFER_COUNTERPARTY_DIRECTION_VALUES,\n TransferCounterpartyDirectionCodec,\n} from \"./address-book.codecs.js\";\nimport { SubaccountRoleCodec } from \"../subaccounts/subaccounts.codecs.js\";\nimport { buildProtoPatch, defineProtoPatchFields } from \"../../utils/proto-patch.js\";\n\nconst OptionalSubaccountIdSchema = optionalSubaccountIdInputSchema();\nconst IdSchema = idInputSchema;\n\nconst AddressBookLimitSchema = v.optional(\n v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(500)),\n);\nconst AddressBookCounterpartyLimitSchema = v.optional(\n v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(200)),\n);\nconst AddressBookViewLimitSchema = v.optional(\n v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(200)),\n);\nconst PageTokenSchema = v.optional(v.pipe(v.string(), v.trim()), \"\");\n\nconst TimestampMsSchema = OptionalTimestampMsSchema;\n\nconst AddressBookTagInputSchema = v.strictObject({\n name: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(48)),\n color: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(32)), \"\"),\n});\nconst AddressBookTagInputsSchema = v.pipe(v.array(AddressBookTagInputSchema), v.maxLength(10));\n\nexport const ListAddressBookEntriesInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n kind: v.optional(v.picklist(ADDRESS_BOOK_ENTRY_KIND_VALUES)),\n limit: AddressBookLimitSchema,\n pageToken: PageTokenSchema,\n }),\n v.transform(({ account, kind, limit, pageToken }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n kind: kind ? AddressBookEntryKindCodec.inputToProto[kind] : undefined,\n limit,\n pageToken,\n })),\n);\n\nexport type ListAddressBookEntriesInput = v.InferInput<typeof ListAddressBookEntriesInputSchema>;\n\nexport const CreateAddressBookEntryInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n label: v.pipe(v.string(), v.trim(), v.minLength(1)),\n note: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n entry: v.variant(\"kind\", [\n v.strictObject({\n kind: v.literal(\"external\"),\n polychainChainId: v.pipe(v.number(), v.integer(), v.gtValue(0)),\n address: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n v.strictObject({\n kind: v.literal(\"internal\"),\n smartAccountAddress: v.pipe(v.string(), v.trim(), v.minLength(1)),\n }),\n ]),\n tagIds: v.optional(v.array(IdSchema(\"tagId\")), []),\n newTags: v.optional(AddressBookTagInputsSchema, []),\n }),\n v.transform(({ account, entry, ...rest }) => ({\n ...rest,\n subaccountId: accountScopeToSubaccountId(account),\n entry:\n entry.kind === \"external\"\n ? {\n case: \"external\" as const,\n value: {\n polychainChainId: entry.polychainChainId,\n address: entry.address,\n },\n }\n : {\n case: \"internal\" as const,\n value: {\n smartAccountAddress: entry.smartAccountAddress,\n },\n },\n })),\n);\n\nexport type CreateAddressBookEntryInput = v.InferInput<typeof CreateAddressBookEntryInputSchema>;\n\nexport function validateCreateAddressBookEntryInput(input: CreateAddressBookEntryInput): void {\n parse(CreateAddressBookEntryInputSchema, input);\n}\n\ntype AddressBookEntryPatch = {\n label?: string;\n note?: string;\n tagIds?: bigint[];\n newTags?: v.InferOutput<typeof AddressBookTagInputSchema>[];\n};\n\nconst ADDRESS_BOOK_ENTRY_PATCH_FIELDS = defineProtoPatchFields<AddressBookEntryPatch>()({\n label: { path: \"label\", encode: (label) => ({ label }) },\n note: { path: \"note\", encode: (note) => ({ note }) },\n tagIds: { path: \"tag_ids\", encode: (tagIds) => ({ tagIds }) },\n newTags: { path: \"new_tags\", encode: (newTags) => ({ newTags }) },\n});\n\nexport const UpdateAddressBookEntryInputSchema = v.pipe(\n v.strictObject({\n addressBookEntryId: IdSchema(\"addressBookEntryId\"),\n expectedRevision: positiveBigintStringInputSchema(\"expectedRevision\"),\n label: v.optional(v.pipe(v.string(), v.trim())),\n note: v.optional(v.pipe(v.string(), v.trim())),\n tagIds: v.optional(v.array(IdSchema(\"tagId\"))),\n newTags: v.optional(AddressBookTagInputsSchema),\n }),\n v.check(\n ({ label, note, tagIds, newTags }) =>\n label !== undefined ||\n note !== undefined ||\n tagIds !== undefined ||\n newTags !== undefined,\n \"At least one address-book entry field must be provided\",\n ),\n v.transform(({ addressBookEntryId, expectedRevision, ...input }) => {\n const { patch: entry, updateMask } = buildProtoPatch(\n input,\n ADDRESS_BOOK_ENTRY_PATCH_FIELDS,\n );\n return { addressBookEntryId, entry, updateMask, expectedRevision };\n }),\n);\n\nexport type UpdateAddressBookEntryInput = v.InferInput<typeof UpdateAddressBookEntryInputSchema>;\n\nexport const DeleteAddressBookEntryInputSchema = v.strictObject({\n addressBookEntryId: IdSchema(\"addressBookEntryId\"),\n});\n\nexport type DeleteAddressBookEntryInput = v.InferInput<typeof DeleteAddressBookEntryInputSchema>;\n\nexport const CopyAddressBookEntryInputSchema = v.strictObject({\n addressBookEntryId: IdSchema(\"addressBookEntryId\"),\n targetSubaccountId: OptionalSubaccountIdSchema,\n});\n\nexport type CopyAddressBookEntryInput = v.InferInput<typeof CopyAddressBookEntryInputSchema>;\n\nexport const CreateAddressBookTagInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n name: v.pipe(v.string(), v.trim(), v.minLength(1)),\n color: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type CreateAddressBookTagInput = v.InferInput<typeof CreateAddressBookTagInputSchema>;\n\nexport const UpdateAddressBookTagInputSchema = v.pipe(\n v.strictObject({\n tagId: IdSchema(\"tagId\"),\n name: v.optional(v.pipe(v.string(), v.trim(), v.minLength(1))),\n color: v.optional(v.pipe(v.string(), v.trim())),\n }),\n v.check(\n ({ name, color }) => name !== undefined || color !== undefined,\n \"At least one address-book tag field must be provided\",\n ),\n);\n\nexport type UpdateAddressBookTagInput = v.InferInput<typeof UpdateAddressBookTagInputSchema>;\n\nexport const DeleteAddressBookTagInputSchema = v.strictObject({\n tagId: IdSchema(\"tagId\"),\n});\n\nexport type DeleteAddressBookTagInput = v.InferInput<typeof DeleteAddressBookTagInputSchema>;\n\nexport const ListTransferCounterpartiesInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n direction: v.optional(v.picklist(TRANSFER_COUNTERPARTY_DIRECTION_VALUES)),\n kind: v.optional(v.picklist(ADDRESS_BOOK_ENTRY_KIND_VALUES)),\n limit: AddressBookCounterpartyLimitSchema,\n }),\n v.transform(({ account, direction, kind, limit }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n direction: direction\n ? TransferCounterpartyDirectionCodec.inputToProto[direction]\n : undefined,\n kind: kind ? AddressBookEntryKindCodec.inputToProto[kind] : undefined,\n limit,\n })),\n);\n\nexport type ListTransferCounterpartiesInput = v.InferInput<\n typeof ListTransferCounterpartiesInputSchema\n>;\n\nexport const ListTransferDestinationsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n kind: v.optional(v.picklist(ADDRESS_BOOK_ENTRY_KIND_VALUES)),\n limit: AddressBookLimitSchema,\n pageToken: PageTokenSchema,\n }),\n v.transform(({ account, kind, limit, pageToken }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n kind: kind ? AddressBookEntryKindCodec.inputToProto[kind] : undefined,\n limit,\n pageToken,\n })),\n);\n\nexport type ListTransferDestinationsInput = v.InferInput<\n typeof ListTransferDestinationsInputSchema\n>;\n\nexport const SubaccountScopedInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n }),\n v.transform(({ account }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type SubaccountScopedInput = v.InferInput<typeof SubaccountScopedInputSchema>;\n\nexport const ListInternalTransferWhitelistEntriesInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n limit: AddressBookLimitSchema,\n pageToken: PageTokenSchema,\n }),\n v.transform(({ account, limit, pageToken }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n limit,\n pageToken,\n })),\n);\n\nexport type ListInternalTransferWhitelistEntriesInput = v.InferInput<\n typeof ListInternalTransferWhitelistEntriesInputSchema\n>;\n\nexport const GetAddressBookViewInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n limit: AddressBookViewLimitSchema,\n }),\n v.transform(({ account, limit }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n limit,\n })),\n);\n\nexport type GetAddressBookViewInput = v.InferInput<typeof GetAddressBookViewInputSchema>;\n\nconst CountSchema = v.pipe(\n v.bigint(),\n v.transform((value) => Number(value)),\n);\n\nconst AccountScopeSchema = v.object({\n scopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.AccountScopeSchema\",\n \"scope type\",\n ),\n ),\n ),\n rootAccountId: PublicIdSchema,\n subaccountId: PublicIdSchema,\n});\n\nconst ExternalWithdrawAddressSchema = v.object({\n polychainChainId: v.pipe(v.number(), v.integer()),\n address: v.string(),\n});\n\nconst InternalTransferAccountSchema = v.object({\n rootAccountId: PublicIdSchema,\n targetAccountId: PublicIdSchema,\n targetScopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.InternalTransferAccountSchema\",\n \"target scope type\",\n ),\n ),\n ),\n smartAccountAddress: v.string(),\n rootUsername: v.string(),\n subaccountLabel: v.string(),\n});\n\nconst AddressBookEntryValueSchema = v.variant(\"case\", [\n v.object({ case: v.literal(\"external\"), value: ExternalWithdrawAddressSchema }),\n v.object({ case: v.literal(\"internal\"), value: InternalTransferAccountSchema }),\n v.object({ case: v.undefined(), value: v.optional(v.undefined()) }),\n]);\n\nconst DestinationWhitelistStatusSchema = v.pipe(\n v.enum(Proto.DestinationWhitelistStatus),\n v.transform((value) =>\n requiredEnumLabel(\n DestinationWhitelistStatusCodec.protoToOutput,\n value,\n \"PolyesterClient.DestinationWhitelistStatusSchema\",\n \"whitelist status\",\n ),\n ),\n);\n\nconst AddressBookEntryKindSchema = v.pipe(\n v.enum(Proto.AddressBookEntryKind),\n v.transform((value) =>\n requiredEnumLabel(\n AddressBookEntryKindCodec.protoToOutput,\n value,\n \"PolyesterClient.AddressBookEntryKindSchema\",\n \"entry kind\",\n ),\n ),\n);\n\nconst TransferCounterpartyDirectionSchema = v.pipe(\n v.enum(Proto.TransferCounterpartyDirection),\n v.transform((value) =>\n requiredEnumLabel(\n TransferCounterpartyDirectionCodec.protoToOutput,\n value,\n \"PolyesterClient.TransferCounterpartyDirectionSchema\",\n \"direction\",\n ),\n ),\n);\n\nexport const AddressBookSchema = v.object({\n scope: v.optional(AccountScopeSchema),\n callerRole: v.pipe(\n v.enum(SubaccountRole),\n v.transform((role) =>\n requiredEnumLabel(\n SubaccountRoleCodec.protoToOutput,\n role,\n \"AddressBookEntrySchema\",\n \"caller role\",\n ),\n ),\n ),\n label: v.string(),\n ownerUsername: v.string(),\n smartAccountAddress: v.string(),\n});\n\nexport type AddressBook = v.InferOutput<typeof AddressBookSchema>;\n\nexport const AddressBookTagSummarySchema = v.object({\n tagId: PublicIdSchema,\n name: v.string(),\n color: v.string(),\n});\n\nexport type AddressBookTagSummary = v.InferOutput<typeof AddressBookTagSummarySchema>;\n\nexport const AddressBookTagSchema = v.object({\n tagId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n name: v.string(),\n color: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n});\n\nexport type AddressBookTag = v.InferOutput<typeof AddressBookTagSchema>;\n\nexport const AddressBookEntrySchema = v.object({\n addressBookEntryId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n kind: AddressBookEntryKindSchema,\n label: v.string(),\n note: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n entry: AddressBookEntryValueSchema,\n tags: v.array(AddressBookTagSchema),\n revision: BigIntStringSchema,\n});\n\nexport type AddressBookEntry = v.InferOutput<typeof AddressBookEntrySchema>;\n\nexport const AddressBookEntriesSchema = v.array(AddressBookEntrySchema);\nexport type AddressBookEntries = v.InferOutput<typeof AddressBookEntriesSchema>;\n\nexport const TransferCounterpartySchema = v.object({\n counterpartyId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n direction: TransferCounterpartyDirectionSchema,\n kind: AddressBookEntryKindSchema,\n saved: v.boolean(),\n addressBookEntryId: PublicIdSchema,\n useCount: CountSchema,\n firstSeenAt: TimestampMsSchema,\n lastSeenAt: TimestampMsSchema,\n counterparty: AddressBookEntryValueSchema,\n});\n\nexport type TransferCounterparty = v.InferOutput<typeof TransferCounterpartySchema>;\n\nexport const TransferCounterpartiesSchema = v.array(TransferCounterpartySchema);\nexport type TransferCounterparties = v.InferOutput<typeof TransferCounterpartiesSchema>;\n\nexport const TransferDestinationSchema = v.object({\n scope: v.optional(AccountScopeSchema),\n kind: AddressBookEntryKindSchema,\n saved: v.boolean(),\n whitelisted: v.boolean(),\n whitelistStatus: DestinationWhitelistStatusSchema,\n addressBookEntry: v.optional(AddressBookEntrySchema),\n destination: AddressBookEntryValueSchema,\n whitelistEffectiveAt: TimestampMsSchema,\n whitelistUpdatedAt: TimestampMsSchema,\n});\n\nexport type TransferDestination = v.InferOutput<typeof TransferDestinationSchema>;\n\nexport const TransferDestinationsSchema = v.array(TransferDestinationSchema);\nexport type TransferDestinations = v.InferOutput<typeof TransferDestinationsSchema>;\n\nexport const InternalTransferWhitelistEntrySchema = v.object({\n entryId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n rootAccountId: PublicIdSchema,\n targetAccountId: PublicIdSchema,\n targetScopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.InternalTransferWhitelistEntrySchema\",\n \"target scope type\",\n ),\n ),\n ),\n smartAccountAddress: v.string(),\n rootUsername: v.string(),\n subaccountLabel: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n resolutionStatus: v.pipe(\n v.enum(Proto.InternalWhitelistResolutionStatus),\n v.transform((value) =>\n requiredEnumLabel(\n InternalWhitelistResolutionStatusCodec.protoToOutput,\n value,\n \"PolyesterClient.InternalTransferWhitelistEntrySchema\",\n \"resolution status\",\n ),\n ),\n ),\n});\n\nexport type InternalTransferWhitelistEntry = v.InferOutput<\n typeof InternalTransferWhitelistEntrySchema\n>;\n\nexport const InternalTransferWhitelistEntriesSchema = v.array(InternalTransferWhitelistEntrySchema);\n\nexport type InternalTransferWhitelistEntries = v.InferOutput<\n typeof InternalTransferWhitelistEntriesSchema\n>;\n\nexport const MirroredWithdrawWhitelistEntrySchema = v.object({\n canonicalAddress: v.string(),\n rawAddressHex: v.string(),\n updatedAt: TimestampMsSchema,\n polychainChainId: v.pipe(v.number(), v.integer()),\n});\n\nexport type MirroredWithdrawWhitelistEntry = v.InferOutput<\n typeof MirroredWithdrawWhitelistEntrySchema\n>;\n\nexport const WithdrawWhitelistViewSchema = v.object({\n scope: v.optional(AccountScopeSchema),\n externalWhitelistRequired: v.boolean(),\n internalWhitelistRequired: v.boolean(),\n activeEntries: v.optional(v.array(MirroredWithdrawWhitelistEntrySchema), []),\n});\n\nexport type WithdrawWhitelistView = v.InferOutput<typeof WithdrawWhitelistViewSchema>;\n\nexport const AddressBookEntriesViewSchema = v.object({\n external: v.optional(\n v.array(\n v.object({\n addressBookEntryId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n label: v.string(),\n note: v.string(),\n tagIds: v.optional(v.array(PublicIdSchema), []),\n whitelistStatus: DestinationWhitelistStatusSchema,\n polychainChainId: v.pipe(v.number(), v.integer()),\n address: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n revision: BigIntStringSchema,\n }),\n ),\n [],\n ),\n internal: v.optional(\n v.array(\n v.object({\n addressBookEntryId: PublicIdSchema,\n scope: v.optional(AccountScopeSchema),\n label: v.string(),\n note: v.string(),\n tagIds: v.optional(v.array(PublicIdSchema), []),\n whitelistStatus: DestinationWhitelistStatusSchema,\n rootAccountId: PublicIdSchema,\n targetAccountId: PublicIdSchema,\n targetScopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.AddressBookEntriesViewSchema\",\n \"target scope type\",\n ),\n ),\n ),\n smartAccountAddress: v.string(),\n rootUsername: v.string(),\n subaccountLabel: v.string(),\n createdAt: TimestampMsSchema,\n updatedAt: TimestampMsSchema,\n revision: BigIntStringSchema,\n }),\n ),\n [],\n ),\n});\n\nexport type AddressBookEntriesView = v.InferOutput<typeof AddressBookEntriesViewSchema>;\n\nexport const AddressBookRecentDestinationsViewSchema = v.object({\n external: v.optional(\n v.array(\n v.object({\n scope: v.optional(AccountScopeSchema),\n lastDirection: TransferCounterpartyDirectionSchema,\n saved: v.boolean(),\n addressBookEntryId: PublicIdSchema,\n useCount: CountSchema,\n lastSeenAt: TimestampMsSchema,\n polychainChainId: v.pipe(v.number(), v.integer()),\n address: v.string(),\n }),\n ),\n [],\n ),\n internal: v.optional(\n v.array(\n v.object({\n scope: v.optional(AccountScopeSchema),\n lastDirection: TransferCounterpartyDirectionSchema,\n saved: v.boolean(),\n addressBookEntryId: PublicIdSchema,\n useCount: CountSchema,\n lastSeenAt: TimestampMsSchema,\n rootAccountId: PublicIdSchema,\n targetAccountId: PublicIdSchema,\n targetScopeType: v.pipe(\n v.enum(Proto.AccountScopeType),\n v.transform((value) =>\n requiredEnumLabel(\n AccountScopeTypeCodec.protoToOutput,\n value,\n \"PolyesterClient.AddressBookRecentDestinationsViewSchema\",\n \"target scope type\",\n ),\n ),\n ),\n smartAccountAddress: v.string(),\n rootUsername: v.string(),\n subaccountLabel: v.string(),\n }),\n ),\n [],\n ),\n});\n\nexport type AddressBookRecentDestinationsView = v.InferOutput<\n typeof AddressBookRecentDestinationsViewSchema\n>;\n\nexport const AddressBookViewSchema = v.object({\n books: v.optional(v.array(AddressBookSchema), []),\n entries: v.optional(AddressBookEntriesViewSchema),\n recentDestinations: v.optional(AddressBookRecentDestinationsViewSchema),\n tags: v.optional(v.array(AddressBookTagSummarySchema), []),\n withdrawWhitelist: v.optional(WithdrawWhitelistViewSchema),\n recentDestinationsTruncated: v.optional(v.boolean(), false),\n});\n\nexport type AddressBookView = v.InferOutput<typeof AddressBookViewSchema>;\n\nexport const AddressBookViewInvalidatedSchema = v.object({\n scope: v.optional(AccountScopeSchema),\n invalidatedAt: RequiredTimestampMsSchema,\n});\n\nexport type AddressBookViewInvalidated = v.InferOutput<typeof AddressBookViewInvalidatedSchema>;\n"],"mappings":";;;;;;;;;;;AA8BA,MAAM,6BAA6B,gCAAgC;AACnE,MAAM,WAAW;AAEjB,MAAM,yBAAyB,EAAE,SAC7B,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CACjE;AACA,MAAM,qCAAqC,EAAE,SACzC,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CACjE;AACA,MAAM,6BAA6B,EAAE,SACjC,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CACjE;AACA,MAAM,kBAAkB,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;AAEnE,MAAM,oBAAoB;AAE1B,MAAM,4BAA4B,EAAE,aAAa;CAC7C,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC;CAClE,OAAO,EAAE,SAAS,EAAE,KAAK,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AChD,oBAAoB,EAAE,SAAS,uCAAuC;CACtE,MAAM,EAAE,SAAS,EAAE,MAAM,2BAA2B,GAAG,CAAC,CAAC;CACzD,mBAAmB,EAAE,SAAS,2BAA2B;CACzD,6BAA6B,EAAE,SAAS,EAAE,QAAQ,GAAG,KAAK;AAC9D,CAAC;AAID,MAAa,mCAAmC,EAAE,OAAO;CACrD,OAAO,EAAE,SAAS,kBAAkB;CACpC,eAAeK;AACnB,CAAC"}
|
|
@@ -42,11 +42,19 @@ type SocialVerification = Omit<SocialVerificationBase, "provider" | "method" | "
|
|
|
42
42
|
method: DecodedEnum<SocialVerificationMethod>;
|
|
43
43
|
status: DecodedEnum<SocialVerificationStatus>;
|
|
44
44
|
};
|
|
45
|
-
declare const StartVerificationInputSchema: v.StrictObjectSchema<{
|
|
45
|
+
declare const StartVerificationInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
46
46
|
readonly provider: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["twitter", "discord"], undefined>, v.TransformAction<"twitter" | "discord", SocialProvider$1.TWITTER | SocialProvider$1.DISCORD>]>;
|
|
47
47
|
readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
|
|
48
48
|
readonly method: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["profile", "channel", "dm"], undefined>, "profile">, v.TransformAction<"profile" | "channel" | "dm", SocialVerificationMethod$1.METHOD_PROFILE | SocialVerificationMethod$1.METHOD_CHANNEL | SocialVerificationMethod$1.METHOD_DM>]>;
|
|
49
|
-
}, undefined
|
|
49
|
+
}, undefined>, v.CheckAction<{
|
|
50
|
+
provider: SocialProvider$1.TWITTER | SocialProvider$1.DISCORD;
|
|
51
|
+
handle: string;
|
|
52
|
+
method: SocialVerificationMethod$1.METHOD_PROFILE | SocialVerificationMethod$1.METHOD_CHANNEL | SocialVerificationMethod$1.METHOD_DM;
|
|
53
|
+
}, "Handle must not contain '<' or '>'">, v.CheckAction<{
|
|
54
|
+
provider: SocialProvider$1.TWITTER | SocialProvider$1.DISCORD;
|
|
55
|
+
handle: string;
|
|
56
|
+
method: SocialVerificationMethod$1.METHOD_PROFILE | SocialVerificationMethod$1.METHOD_CHANNEL | SocialVerificationMethod$1.METHOD_DM;
|
|
57
|
+
}, "Twitter handle must be 1-15 letters, digits, or underscores">]>;
|
|
50
58
|
type StartVerificationInput = v.InferInput<typeof StartVerificationInputSchema>;
|
|
51
59
|
declare const SocialProviderInputSchema: v.StrictObjectSchema<{
|
|
52
60
|
readonly provider: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["twitter", "discord"], undefined>, v.TransformAction<"twitter" | "discord", SocialProvider$1.TWITTER | SocialProvider$1.DISCORD>]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-verification.schemas.d.ts","names":[],"sources":["../../../src/services/social-verification/social-verification.schemas.ts"],"mappings":";;;;;cAoBa,sBAAoB,EAAA;KACrB,iBAAiB,EAAE,kBAAkB;cAEpC,gCAA8B,EAAA;KAC/B,2BAA2B,EAAE,kBAAkB;cAE9C,gCAA8B,EAAA;KAC/B,2BAA2B,EAAE,mBAAmB;
|
|
1
|
+
{"version":3,"file":"social-verification.schemas.d.ts","names":[],"sources":["../../../src/services/social-verification/social-verification.schemas.ts"],"mappings":";;;;;cAoBa,sBAAoB,EAAA;KACrB,iBAAiB,EAAE,kBAAkB;cAEpC,gCAA8B,EAAA;KAC/B,2BAA2B,EAAE,kBAAkB;cAE9C,gCAA8B,EAAA;KAC/B,2BAA2B,EAAE,mBAAmB;cA+C/C,0BAAwB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgBhC,yBAAyB,EAAE,mBAAmB;KACvC,qBAAqB,KAAK;EAClC,UAAU,YAAY;EACtB,QAAQ,YAAY;EACpB,QAAQ,YAAY;;cAGX,8BAA4B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;KAoB7B,yBAAyB,EAAE,kBAAkB;cAO5C,2BAAyB,EAAA;;;KAI1B,sBAAsB,EAAE,kBAAkB;cAEzC,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;KAahC,4BAA4B,EAAE,mBAAmB;cAEhD,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;KAShC,4BAA4B,EAAE,mBAAmB;cAEhD,+BAA6B,EAAA,yBAAA,EAAA;;;;;;;KAS9B,0BAA0B,EAAE,mBAAmB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { requiredEnumLabel } from "../../shared/proto-enum-codec.js";
|
|
2
2
|
import { TimestampSchema } from "../../shared/schemas.js";
|
|
3
|
+
import "../../gen/auth/v1/social_verification_pb.js";
|
|
3
4
|
import { SOCIAL_PROVIDER_VALUES, SOCIAL_VERIFICATION_METHOD_VALUES, SOCIAL_VERIFICATION_STATUS_VALUES, SocialProviderCodec, SocialVerificationMethodCodec, SocialVerificationStatusCodec } from "./social-verification.codecs.js";
|
|
4
5
|
import * as v from "valibot";
|
|
5
6
|
//#region src/services/social-verification/social-verification.schemas.ts
|
|
@@ -9,6 +10,7 @@ const SocialVerificationStatusSchema = v.picklist(SOCIAL_VERIFICATION_STATUS_VAL
|
|
|
9
10
|
function normalizeHandle(input) {
|
|
10
11
|
return (input ?? "").trim().replace(/^@+/, "");
|
|
11
12
|
}
|
|
13
|
+
const TWITTER_HANDLE_PATTERN = /^[A-Za-z0-9_]{1,15}$/;
|
|
12
14
|
/**
|
|
13
15
|
* Normalizes a social verification response into the SDK verification shape.
|
|
14
16
|
*/
|
|
@@ -45,11 +47,11 @@ v.object({
|
|
|
45
47
|
lastError: v.string(),
|
|
46
48
|
updatedAt: v.optional(TimestampSchema)
|
|
47
49
|
});
|
|
48
|
-
const StartVerificationInputSchema = v.strictObject({
|
|
50
|
+
const StartVerificationInputSchema = v.pipe(v.strictObject({
|
|
49
51
|
provider: v.pipe(SocialProviderSchema, v.transform((v) => SocialProviderCodec.inputToProto[v])),
|
|
50
52
|
handle: v.pipe(v.string(), v.transform(normalizeHandle), v.minLength(1), v.maxLength(64)),
|
|
51
53
|
method: v.pipe(v.optional(SocialVerificationMethodSchema, "profile"), v.transform((v) => SocialVerificationMethodCodec.inputToProto[v ?? "profile"]))
|
|
52
|
-
});
|
|
54
|
+
}), v.check(({ handle }) => !/[<>]/.test(handle), "Handle must not contain '<' or '>'"), v.check(({ provider, handle }) => provider !== 1 || TWITTER_HANDLE_PATTERN.test(handle), "Twitter handle must be 1-15 letters, digits, or underscores"));
|
|
53
55
|
const ProviderInputSchema = v.pipe(SocialProviderSchema, v.transform((v) => SocialProviderCodec.inputToProto[v]));
|
|
54
56
|
const SocialProviderInputSchema = v.strictObject({ provider: ProviderInputSchema });
|
|
55
57
|
const StartVerificationResponseSchema = v.pipe(v.object({
|