@keetanetwork/keetanet-client 0.14.13 → 0.16.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/client/builder.d.ts +29 -3
- package/client/index-browser.d.ts +24 -6
- package/client/index-browser.js +3426 -2704
- package/client/index.d.ts +24 -6
- package/client/index.js +1107 -501
- package/config/index.d.ts +3 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/KeetaNetSDK.Client.html +6 -5
- package/docs/classes/KeetaNetSDK.Referenced.Account.html +13 -13
- package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BaseVoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Block.html +33 -30
- package/docs/classes/KeetaNetSDK.Referenced.BlockBuilder.html +2 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockHash.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMANAGE_CERTIFICATE.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.Certificate.html +11 -5
- package/docs/classes/KeetaNetSDK.Referenced.CertificateBundle.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.CertificateHash.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.ECDSAKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PrivateKey.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PublicKey.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1Signature.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PrivateKey.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PublicKey.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1Signature.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ED25519KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PrivateKey.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PublicKey.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ED25519Signature.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.ExternalKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ExternalSet.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.IdempotentKey.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKey.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetError.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetErrorBase.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerIdempotentKeyError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerVoteError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeyInterface.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeyStorage.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.Log.html +15 -3
- package/docs/classes/KeetaNetSDK.Referenced.LogTargetConsole.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.Node.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.P2PSwitch.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.PendingAccount.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyUnsignedBlock.html +38 -0
- package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.Stats.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.StatsPending.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.UnsignedBlock.html +42 -0
- package/docs/classes/KeetaNetSDK.Referenced.UserClientBuilder.html +13 -1
- package/docs/classes/KeetaNetSDK.Referenced.Vote.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockBundle.html +11 -9
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHash.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteLikeBase.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteQuote.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteQuoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteStaple.html +10 -8
- package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateBuilder.html +4 -2
- package/docs/classes/KeetaNetSDK.UserClient.html +19 -11
- package/docs/documents/GETTING-STARTED.html +2 -2
- package/docs/enums/KeetaNetSDK.Referenced.AdjustMethod.html +4 -4
- package/docs/enums/KeetaNetSDK.Referenced.OperationType.html +10 -10
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.DecodeBase32.html +2 -2
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.DecodeBase64URL.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.EncodeBase64URL.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.toJSONSerializable.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLUpdate.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ExplicitContextTag.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ImplicitContextTag.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1Object.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseExternalKeyPairFunctions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseIdentifierCreateArguments.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperation.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationCREATE_IDENTIFIER.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATE.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMODIFY_PERMISSIONS.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationRECEIVE.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSEND.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_INFO.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_REP.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_MODIFY_BALANCE.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_SUPPLY.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockOperationValidateContext.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV1Canonical.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV2Canonical.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.DisposableTimingHandle.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsNoEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsSupportsEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.IdentifierCreateRequest.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.InitialConfigSupply.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.InstanceSet.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.KVGenericOptionsType.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.KVSetOptionsType.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.LogTarget.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.MultiSigIdentifierCreateArguments.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.MultisigConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.NodeConfig.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.NumericValueEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerBase.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerListener.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerRepBase.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperations.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperationsJSON.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.PublishOptions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.RequestTokenReceiveEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.TokenNumericEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientOptions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteBundleConstructor.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteStapleJSON.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.WithIsInstance.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_config.ValidationConfig.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1BitString.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Date.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1OID.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Set.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1String.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Struct.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_buffer.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_certificate.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.BlockJSONOptionalSigned.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockV1JSONOptionalSigned.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockV2JSONOptionalSigned.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateUpdate.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.IsTuple.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.JSONDepthLimit.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.KeyUsage.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.KeyUsageBits.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.LogTargetConsoleConfig.html +3 -2
- package/docs/types/KeetaNetSDK.Referenced.MultisigSignerFieldJSON.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.VoteOptions.html +7 -3
- package/docs/types/KeetaNetSDK.Referenced.VoteStapleInputs.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.VoteStapleOptions.html +9 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.NetworkConfig.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateBundleJSONOutput.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateJSONOutput.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializable.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.BlockOperationASN1Schema.html +2 -2
- package/docs/variables/KeetaNetSDK.Referenced.allFullErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.keyUsageBits.html +1 -0
- package/lib/block/index.d.ts +341 -46
- package/lib/block/operations.d.ts +14 -21
- package/lib/error/block.d.ts +2 -2
- package/lib/error/index.d.ts +1 -1
- package/lib/ledger/common.d.ts +3 -0
- package/lib/ledger/db_spanner_helper.d.ts +1 -1
- package/lib/log/common.d.ts +3 -0
- package/lib/log/index.d.ts +20 -0
- package/lib/log/internal.d.ts +22 -0
- package/lib/log/target_console.d.ts +6 -0
- package/lib/log/target_gcp.d.ts +6 -0
- package/lib/log/target_gcp.js +259 -77
- package/lib/log/target_https.d.ts +28 -0
- package/lib/log/target_https.js +6055 -0
- package/lib/p2p.d.ts +6 -2
- package/lib/utils/buffer.d.ts +8 -2
- package/lib/utils/certificate.d.ts +41 -25
- package/lib/utils/conversion.d.ts +8 -4
- package/lib/utils/external-keys/passkey-prf.d.ts +156 -0
- package/lib/utils/external-keys/passkey-prf.js +391 -0
- package/lib/vote.d.ts +230 -35
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/version.d.ts +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATESerializable.html +0 -5
- package/docs/types/KeetaNetSDK.Referenced.ExportedJSONOperation.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.MultisigSignerField.html +0 -1
package/lib/error/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeetaNetErrorBase } from './base';
|
|
2
2
|
import { KeetaNetLedgerError, KeetaNetLedgerVoteError, KeetaNetLedgerIdempotentKeyError } from './ledger';
|
|
3
|
-
declare const allFullErrorCodes: readonly ("PERMISSIONS_CANNOT_MIX_FLAGS_AND_TYPES" | "PERMISSIONS_EXTERNAL_OFFSET_TOO_LARGE" | "PERMISSIONS_INVALID_EXTERNAL_FLAG" | "PERMISSIONS_INVALID_FLAG" | "PERMISSIONS_INVALID_FLAG_ASSERTION" | "BLOCK_AMOUNT_BELOW_ZERO" | "BLOCK_CANNOT_FORWARD_TO_SELF" | "BLOCK_CANNOT_SEND_NON_TOKEN" | "BLOCK_CERTIFICATE_SUBJECT_MISMATCH" | "BLOCK_EXACT_TRUE_WHEN_FORWARDING" | "BLOCK_EXTERNAL_INVALID" | "BLOCK_EXTERNAL_MISSING" | "BLOCK_EXTERNAL_TOO_LONG" | "BLOCK_GENERAL_FIELD_INVALID" | "BLOCK_IDENTIFIER_INVALID" | "BLOCK_IDENTIFIER_NEED_DEFAULT_PERMISSIONS" | "BLOCK_INTERMEDIATE_CERTIFICATES_ONLY_ADD" | "BLOCK_INVALID_ACCOUNT_TYPE" | "BLOCK_INVALID_CERTIFICATE_VALUE" | "BLOCK_INVALID_CREATE_IDENTIFIER_ARGS" | "BLOCK_INVALID_IDEMPOTENT_FORMAT" | "BLOCK_INVALID_IDEMPOTENT_LENGTH" | "BLOCK_INVALID_MULTISIG_QUORUM" | "BLOCK_INVALID_MULTISIG_SIGNER_COUNT" | "BLOCK_INVALID_MULTISIG_SIGNER_DEPTH" | "BLOCK_INVALID_MULTISIG_SIGNER_DUPLICATE" | "BLOCK_INVALID_PURPOSE_VALIDATION" | "BLOCK_INVALID_SIGNATURE" | "BLOCK_INVALID_SIGNER" | "BLOCK_INVALID_TYPE" | "BLOCK_INVALID_VERSION" | "BLOCK_NO_ADMIN_ON_TARGET" | "BLOCK_NO_DELEGATE_ADMIN" | "BLOCK_NO_DUPLICATE_CERTIFICATE_OPERATION" | "BLOCK_NO_IDENTIFIER_OP" | "BLOCK_NO_MODIFY_PERMISSION_DUPE" | "BLOCK_NO_MULTIPLE_SET_REP" | "BLOCK_NO_MULTISIG_OP" | "BLOCK_NO_TOKEN_OP" | "BLOCK_ONLY_IDENTIFIER_OP" | "BLOCK_ONLY_TOKEN_OP" | "BLOCK_PERMISSIONS_INVALID_DEFAULT" | "BLOCK_PERMISSIONS_INVALID_ENTITY" | "BLOCK_PERMISSIONS_INVALID_PRINCIPAL" | "BLOCK_PERMISSIONS_INVALID_TARGET" | "BLOCK_PREVIOUS_SELF" | "BLOCK_SUPPLY_INVALID" | "BLOCK_TOKEN_RECEIVE_DIFFERS" | "CERTIFICATE_INVALID_VERSION" | "CERTIFICATE_DUPLICATE_INCLUDED" | "CERTIFICATE_ORPHAN_FOUND" | "CERTIFICATE_CYCLE_FOUND" | "CERTIFICATE_SECONDARY_GRAPH" | "CERTIFICATE_MISSING_FIELD" | "CERTIFICATE_SIGNATURE_ALGORITHM_MISMATCH" | "CERTIFICATE_SELF_SIGNED_VALIDATION_FAILED" | "CERTIFICATE_CHAIN_VERIFICATION_FAILED" | "CERTIFICATE_DUPLICATE_EXTENSION" | "CERTIFICATE_EXTENSION_NOT_PROCESSED" | "CERTIFICATE_INVALID_SIGNATURE_ALGORITHM" | "CERTIFICATE_INVALID_GRAPH_COUNT" | "CERTIFICATE_MOMENT_INVALID" | "VOTE_INVALID_VERSION" | "VOTE_SERIAL_MISMATCH" | "VOTE_INVALID_CONSTRUCTION" | "VOTE_INVALID_CONSTRUCTION_JSON" | "VOTE_SIGNATURE_INVALID" | "VOTE_EXPIRED" | "VOTE_INVALID_VALIDITY" | "VOTE_MOMENT_BEFORE_VALIDITY_FROM" | "VOTE_STAPLE_INVALID_CONSTRUCTION" | "VOTE_STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_COUNT" | "VOTE_STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_MISSING" | "VOTE_STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_ORDER" | "VOTE_STAPLE_DUPLICATE_VOTE_ISSUER" | "VOTE_STAPLE_PERMANENCE_MISMATCH" | "VOTE_BUILDER_INVALID_CONSTRUCTION" | "VOTE_BUILDER_INVALID_BLOCK_TYPE" | "VOTE_BUILDER_INVALID_SERIAL" | "VOTE_BUILDER_INVALID_VALID_TO_FROM" | "VOTE_MALFORMED_WRAPPER" | "VOTE_MALFORMED_VOTE_WRAPPER" | "VOTE_MALFORMED_VOTE_CONTENT" | "VOTE_MALFORMED_VOTE_CONTENT_EXTRA_DATA" | "VOTE_MALFORMED_VOTE_VERSION" | "VOTE_MALFORMED_VOTE_SERIAL" | "VOTE_MALFORMED_VOTE_SIGNATURE_INFORMATION" | "VOTE_MALFORMED_VOTE_ISSUER_INFORMATION" | "VOTE_MALFORMED_VOTE_SUBJECT_INFORMATION" | "VOTE_MALFORMED_VOTE_VALIDITY_INFORMATION" | "VOTE_MALFORMED_VOTE_EXTENSIONS" | "VOTE_MALFORMED_VOTE_EXTENSIONS_DATA" | "VOTE_MALFORMED_VOTE_EXTENSIONS_VALUE" | "VOTE_MALFORMED_VOTE_EXTENSIONS_VALUE_OID" | "VOTE_MALFORMED_VOTE_EXTENSIONS_VALUE_CRITICAL" | "VOTE_MALFORMED_VOTE_EXTENSIONS_VALUE_CRITICAL_TYPE" | "VOTE_MALFORMED_VOTE_SIGNATURE_SCHEME_DOES_NOT_MATCH_ISSUER" | "VOTE_MALFORMED_VOTE_SIGNATURE_SCHEME_DOES_NOT_MATCH_WRAPPER" | "VOTE_MALFORMED_VOTE_SIGNATURE_SCHEME_ECDSA_INVALID_CURVE" | "VOTE_MALFORMED_VOTE_SIGNATURE_UNSUPPORTED_SCHEME" | "VOTE_MALFORMED_VOTE_SUBJECT_PUBLIC_KEY_INFORMATION" | "VOTE_MALFORMED_VOTE_SIGNATURE_VALUE" | "VOTE_MALFORMED_VOTE_NO_BLOCKS_FOUND" | "VOTE_MALFORMED_STAPLE" | "VOTE_MALFORMED_STAPLE_BLOCKS" | "VOTE_MALFORMED_STAPLE_BLOCKS_AT_LEAST_ONE" | "VOTE_MALFORMED_STAPLE_VOTES" | "VOTE_MALFORMED_STAPLE_VOTES_AT_LEAST_ONE" | "VOTE_MALFORMED_FIND_RDN_INVALID_TYPE" | "VOTE_MALFORMED_FIND_RDN_MUST_HAVE_ONE" | "VOTE_MALFORMED_FIND_RDN_PART_WELL_FORMED" | "VOTE_MALFORMED_FIND_RDN_MUST_BE_SET" | "VOTE_MALFORMED_FIND_RDN_TYPE_MUST_BE_OID" | "VOTE_MALFORMED_HASHES_FROM_VOTE_INVALID_INPUT" | "VOTE_MALFORMED_HASHES_FROM_VOTE_INVALID_TYPE" | "VOTE_MALFORMED_HASHES_FROM_VOTE_INVALID_CONTEXT_SPECIFIC" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_NEEDS_OID" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_HASH_DATA_MUST_BE_SEQUENCE" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_NOT_TWO_ITEMS" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_UNSUPPORTED_HASH_FUNC" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_UNSUPPORTED_HASH_TYPE" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_SECOND_MUST_BE_SEQUENCE" | "VOTE_MALFORMED_FEES_AMOUNT" | "VOTE_MALFORMED_FEES_FROM_VOTE_INVALID_INPUT" | "VOTE_MALFORMED_FEES_IN_PERMANENT_VOTE" | "VOTE_MALFORMED_FEES_PAY_TO_INVALID" | "VOTE_MALFORMED_FEES_TOKEN_NOT_TOKEN" | "VOTE_FEE_IS_QUOTE" | "VOTE_FEE_QUOTE_MISSING_FEES" | "VOTE_FEE_NOT_QUOTE" | "VOTE_MALFORMED_FEES_KIND_MISSING" | "VOTE_MALFORMED_FEES_QUOTE_INVALID" | "LEDGER_BLOCK_ALREADY_EXISTS" | "LEDGER_BLOCK_EXPIRED" | "LEDGER_TRANSACTION_ABORTED" | "LEDGER_INVALID_CHAIN" | "LEDGER_INVALID_NETWORK" | "LEDGER_INVALID_SUBNET" | "LEDGER_INVALID_PERMISSIONS" | "LEDGER_INVALID_OWNER_COUNT" | "LEDGER_INVALID_BALANCE" | "LEDGER_INVALID_SET_REP" | "LEDGER_OPERATION_NOT_SUPPORTED" | "LEDGER_NOT_EMPTY" | "LEDGER_PREVIOUS_ALREADY_USED" | "LEDGER_PREVIOUS_NOT_SEEN" | "LEDGER_SUCCESSOR_VOTE_EXISTS" | "LEDGER_INSUFFICIENT_VOTING_WEIGHT" | "LEDGER_INVALID_ACCOUNT_INFO_KEY" | "LEDGER_RECEIVE_NOT_MET" | "LEDGER_DUPLICATE_VOTE_FOUND" | "LEDGER_CANNOT_EXCHANGE_PERM_VOTE" | "LEDGER_TEMP_VOTE_INCLUDES_SELF" | "LEDGER_BLOCKS_DIFFER_FROM_VOTED_ON" | "LEDGER_NO_PERM_WITHOUT_SELF_TEMP" | "LEDGER_DUPLICATE_VOTE_ISSUER_FOUND" | "LEDGER_OTHER" | "LEDGER_MISSING_BLOCKS" | "LEDGER_FEE_AMOUNT_MISMATCH" | "LEDGER_FEE_TOKEN_MISMATCH" | "LEDGER_FEE_MISSING" | "LEDGER_MISSING_REQUIRED_FEE_BLOCK" | "LEDGER_MULTIPLE_FEE_BLOCK" | "LEDGER_VOTE_WITH_QUOTE" | "LEDGER_QUOTE_MISMATCH" | "LEDGER_REQUIRED_FEE_MISMATCH" | "LEDGER_NOT_SUCCESSOR" | "LEDGER_NOT_OPENING" | "LEDGER_IDEMPOTENT_KEY_EXISTS" | "ACCOUNT_INVALID_CONSTRUCTION" | "ACCOUNT_INVALID_PREFIX" | "ACCOUNT_INVALID_KEYTYPE" | "ACCOUNT_INVALID_KEYTYPE_EXTERNAL" | "ACCOUNT_PASSPHRASE_WEAK" | "ACCOUNT_NO_IDENTIFIER_SIGN" | "ACCOUNT_NO_IDENTIFIER_VERIFY" | "ACCOUNT_INVALID_IDENTIFIER_CONSTRUCTION" | "ACCOUNT_SEED_INDEX_UNDEFINED" | "ACCOUNT_SEED_INDEX_NEGATIVE" | "ACCOUNT_SEED_INDEX_NOT_INT" | "ACCOUNT_SEED_INDEX_TOO_LARGE" | "ACCOUNT_ENCRYPTION_NOT_SUPPORTED" | "API_INVALID_LIMIT" | "API_INVALID_SIDE" | "API_INVALID_START" | "API_LIMIT_NOT_NUMBER" | "API_LIMIT_NOT_GREATER_THAN_ZERO" | "API_REP_MISSING" | "API_START_MISSING" | "CLIENT_BUILDER_AMOUNT_IS_ZERO" | "CLIENT_BUILDER_CANNOT_READ_BEFORE_RENDER" | "CLIENT_BUILDER_REQUIRES_PRIVATE_KEY" | "CLIENT_BUILDER_USER_CLIENT_REQUIRED" | "CLIENT_PUBLISH_AID_NOT_AVAILABLE" | "CLIENT_SIGNER_REQUIRES_PRIVATE_KEY" | "CLIENT_SYNC_PUBLISH_FAILED" | "CLIENT_SWAP_INVALID_ACCOUNT_OPTION" | "CLIENT_SWAP_OPTIONS_INVALID" | "CLIENT_SWAP_MISSING_SEND" | "CLIENT_SWAP_MISSING_RECEIVE" | "CLIENT_SWAP_SEND_RECEIVE_ACCOUNT_MISMATCH" | "CLIENT_SWAP_SEND_ACCOUNT_MISMATCH" | "CLIENT_SWAP_SEND_TOKEN_MISMATCH" | "CLIENT_SWAP_SEND_AMOUNT_TOO_LOW" | "CLIENT_SWAP_SEND_AMOUNT_RECEIVE_EXACT_MISMATCH" | "CLIENT_SWAP_REQUEST_TOKEN_MISMATCH" | "CLIENT_SWAP_REQUEST_AMOUNT_MISMATCH" | "KV_TTL_NOT_SUPPORTED" | "KV_KEY_ALREADY_EXISTS")[];
|
|
3
|
+
declare const allFullErrorCodes: readonly ("PERMISSIONS_CANNOT_MIX_FLAGS_AND_TYPES" | "PERMISSIONS_EXTERNAL_OFFSET_TOO_LARGE" | "PERMISSIONS_INVALID_EXTERNAL_FLAG" | "PERMISSIONS_INVALID_FLAG" | "PERMISSIONS_INVALID_FLAG_ASSERTION" | "BLOCK_AMOUNT_BELOW_ZERO" | "BLOCK_CANNOT_FORWARD_TO_SELF" | "BLOCK_CANNOT_SEND_NON_TOKEN" | "BLOCK_CERTIFICATE_SUBJECT_MISMATCH" | "BLOCK_EXACT_TRUE_WHEN_FORWARDING" | "BLOCK_EXTERNAL_INVALID" | "BLOCK_EXTERNAL_MISSING" | "BLOCK_EXTERNAL_TOO_LONG" | "BLOCK_GENERAL_FIELD_INVALID" | "BLOCK_IDENTIFIER_INVALID" | "BLOCK_IDENTIFIER_NEED_DEFAULT_PERMISSIONS" | "BLOCK_INTERMEDIATE_CERTIFICATES_ONLY_ADD" | "BLOCK_INVALID_ACCOUNT_TYPE" | "BLOCK_INVALID_CERTIFICATE_VALUE" | "BLOCK_INVALID_CREATE_IDENTIFIER_ARGS" | "BLOCK_INVALID_IDEMPOTENT_FORMAT" | "BLOCK_INVALID_IDEMPOTENT_LENGTH" | "BLOCK_INVALID_MULTISIG_QUORUM" | "BLOCK_INVALID_MULTISIG_SIGNER_COUNT" | "BLOCK_INVALID_MULTISIG_SIGNER_DEPTH" | "BLOCK_INVALID_MULTISIG_SIGNER_DUPLICATE" | "BLOCK_INVALID_PURPOSE_VALIDATION" | "BLOCK_INVALID_SIGNATURE" | "BLOCK_INVALID_SIGNER" | "BLOCK_INVALID_TYPE" | "BLOCK_INVALID_VERSION" | "BLOCK_NO_ADMIN_ON_TARGET" | "BLOCK_NO_DELEGATE_ADMIN" | "BLOCK_NO_DUPLICATE_CERTIFICATE_OPERATION" | "BLOCK_NO_IDENTIFIER_OP" | "BLOCK_NO_MODIFY_PERMISSION_DUPE" | "BLOCK_NO_MULTIPLE_SET_REP" | "BLOCK_NO_MULTISIG_OP" | "BLOCK_NO_TOKEN_OP" | "BLOCK_ONLY_IDENTIFIER_OP" | "BLOCK_ONLY_TOKEN_OP" | "BLOCK_PERMISSIONS_INVALID_DEFAULT" | "BLOCK_PERMISSIONS_INVALID_ENTITY" | "BLOCK_PERMISSIONS_INVALID_PRINCIPAL" | "BLOCK_PERMISSIONS_INVALID_TARGET" | "BLOCK_PREVIOUS_SELF" | "BLOCK_SUPPLY_INVALID" | "BLOCK_TOKEN_RECEIVE_DIFFERS" | "BLOCK_SIGNATURE_REQUIRED" | "BLOCK_SIGNATURE_PARAMETER_DIFFERS" | "CERTIFICATE_INVALID_VERSION" | "CERTIFICATE_DUPLICATE_INCLUDED" | "CERTIFICATE_ORPHAN_FOUND" | "CERTIFICATE_CYCLE_FOUND" | "CERTIFICATE_SECONDARY_GRAPH" | "CERTIFICATE_MISSING_FIELD" | "CERTIFICATE_SIGNATURE_ALGORITHM_MISMATCH" | "CERTIFICATE_SELF_SIGNED_VALIDATION_FAILED" | "CERTIFICATE_CHAIN_VERIFICATION_FAILED" | "CERTIFICATE_DUPLICATE_EXTENSION" | "CERTIFICATE_EXTENSION_NOT_PROCESSED" | "CERTIFICATE_INVALID_SIGNATURE_ALGORITHM" | "CERTIFICATE_INVALID_GRAPH_COUNT" | "CERTIFICATE_MOMENT_INVALID" | "VOTE_INVALID_VERSION" | "VOTE_SERIAL_MISMATCH" | "VOTE_INVALID_CONSTRUCTION" | "VOTE_INVALID_CONSTRUCTION_JSON" | "VOTE_SIGNATURE_INVALID" | "VOTE_EXPIRED" | "VOTE_INVALID_VALIDITY" | "VOTE_MOMENT_BEFORE_VALIDITY_FROM" | "VOTE_STAPLE_INVALID_CONSTRUCTION" | "VOTE_STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_COUNT" | "VOTE_STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_MISSING" | "VOTE_STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_ORDER" | "VOTE_STAPLE_DUPLICATE_VOTE_ISSUER" | "VOTE_STAPLE_PERMANENCE_MISMATCH" | "VOTE_BUILDER_INVALID_CONSTRUCTION" | "VOTE_BUILDER_INVALID_BLOCK_TYPE" | "VOTE_BUILDER_INVALID_SERIAL" | "VOTE_BUILDER_INVALID_VALID_TO_FROM" | "VOTE_MALFORMED_WRAPPER" | "VOTE_MALFORMED_VOTE_WRAPPER" | "VOTE_MALFORMED_VOTE_CONTENT" | "VOTE_MALFORMED_VOTE_CONTENT_EXTRA_DATA" | "VOTE_MALFORMED_VOTE_VERSION" | "VOTE_MALFORMED_VOTE_SERIAL" | "VOTE_MALFORMED_VOTE_SIGNATURE_INFORMATION" | "VOTE_MALFORMED_VOTE_ISSUER_INFORMATION" | "VOTE_MALFORMED_VOTE_SUBJECT_INFORMATION" | "VOTE_MALFORMED_VOTE_VALIDITY_INFORMATION" | "VOTE_MALFORMED_VOTE_EXTENSIONS" | "VOTE_MALFORMED_VOTE_EXTENSIONS_DATA" | "VOTE_MALFORMED_VOTE_EXTENSIONS_VALUE" | "VOTE_MALFORMED_VOTE_EXTENSIONS_VALUE_OID" | "VOTE_MALFORMED_VOTE_EXTENSIONS_VALUE_CRITICAL" | "VOTE_MALFORMED_VOTE_EXTENSIONS_VALUE_CRITICAL_TYPE" | "VOTE_MALFORMED_VOTE_SIGNATURE_SCHEME_DOES_NOT_MATCH_ISSUER" | "VOTE_MALFORMED_VOTE_SIGNATURE_SCHEME_DOES_NOT_MATCH_WRAPPER" | "VOTE_MALFORMED_VOTE_SIGNATURE_SCHEME_ECDSA_INVALID_CURVE" | "VOTE_MALFORMED_VOTE_SIGNATURE_UNSUPPORTED_SCHEME" | "VOTE_MALFORMED_VOTE_SUBJECT_PUBLIC_KEY_INFORMATION" | "VOTE_MALFORMED_VOTE_SIGNATURE_VALUE" | "VOTE_MALFORMED_VOTE_NO_BLOCKS_FOUND" | "VOTE_MALFORMED_STAPLE" | "VOTE_MALFORMED_STAPLE_BLOCKS" | "VOTE_MALFORMED_STAPLE_BLOCKS_AT_LEAST_ONE" | "VOTE_MALFORMED_STAPLE_VOTES" | "VOTE_MALFORMED_STAPLE_VOTES_AT_LEAST_ONE" | "VOTE_MALFORMED_FIND_RDN_INVALID_TYPE" | "VOTE_MALFORMED_FIND_RDN_MUST_HAVE_ONE" | "VOTE_MALFORMED_FIND_RDN_PART_WELL_FORMED" | "VOTE_MALFORMED_FIND_RDN_MUST_BE_SET" | "VOTE_MALFORMED_FIND_RDN_TYPE_MUST_BE_OID" | "VOTE_MALFORMED_HASHES_FROM_VOTE_INVALID_INPUT" | "VOTE_MALFORMED_HASHES_FROM_VOTE_INVALID_TYPE" | "VOTE_MALFORMED_HASHES_FROM_VOTE_INVALID_CONTEXT_SPECIFIC" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_NEEDS_OID" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_HASH_DATA_MUST_BE_SEQUENCE" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_NOT_TWO_ITEMS" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_UNSUPPORTED_HASH_FUNC" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_UNSUPPORTED_HASH_TYPE" | "VOTE_MALFORMED_HASHES_FROM_VOTE_DATA_SECOND_MUST_BE_SEQUENCE" | "VOTE_MALFORMED_FEES_AMOUNT" | "VOTE_MALFORMED_FEES_FROM_VOTE_INVALID_INPUT" | "VOTE_MALFORMED_FEES_IN_PERMANENT_VOTE" | "VOTE_MALFORMED_FEES_PAY_TO_INVALID" | "VOTE_MALFORMED_FEES_TOKEN_NOT_TOKEN" | "VOTE_FEE_IS_QUOTE" | "VOTE_FEE_QUOTE_MISSING_FEES" | "VOTE_FEE_NOT_QUOTE" | "VOTE_MALFORMED_FEES_KIND_MISSING" | "VOTE_MALFORMED_FEES_QUOTE_INVALID" | "LEDGER_BLOCK_ALREADY_EXISTS" | "LEDGER_BLOCK_EXPIRED" | "LEDGER_TRANSACTION_ABORTED" | "LEDGER_INVALID_CHAIN" | "LEDGER_INVALID_NETWORK" | "LEDGER_INVALID_SUBNET" | "LEDGER_INVALID_PERMISSIONS" | "LEDGER_INVALID_OWNER_COUNT" | "LEDGER_INVALID_BALANCE" | "LEDGER_INVALID_SET_REP" | "LEDGER_OPERATION_NOT_SUPPORTED" | "LEDGER_NOT_EMPTY" | "LEDGER_PREVIOUS_ALREADY_USED" | "LEDGER_PREVIOUS_NOT_SEEN" | "LEDGER_SUCCESSOR_VOTE_EXISTS" | "LEDGER_INSUFFICIENT_VOTING_WEIGHT" | "LEDGER_INVALID_ACCOUNT_INFO_KEY" | "LEDGER_RECEIVE_NOT_MET" | "LEDGER_DUPLICATE_VOTE_FOUND" | "LEDGER_CANNOT_EXCHANGE_PERM_VOTE" | "LEDGER_TEMP_VOTE_INCLUDES_SELF" | "LEDGER_BLOCKS_DIFFER_FROM_VOTED_ON" | "LEDGER_NO_PERM_WITHOUT_SELF_TEMP" | "LEDGER_DUPLICATE_VOTE_ISSUER_FOUND" | "LEDGER_OTHER" | "LEDGER_MISSING_BLOCKS" | "LEDGER_FEE_AMOUNT_MISMATCH" | "LEDGER_FEE_TOKEN_MISMATCH" | "LEDGER_FEE_MISSING" | "LEDGER_MISSING_REQUIRED_FEE_BLOCK" | "LEDGER_MULTIPLE_FEE_BLOCK" | "LEDGER_VOTE_WITH_QUOTE" | "LEDGER_QUOTE_MISMATCH" | "LEDGER_REQUIRED_FEE_MISMATCH" | "LEDGER_NOT_SUCCESSOR" | "LEDGER_NOT_OPENING" | "LEDGER_IDEMPOTENT_KEY_EXISTS" | "ACCOUNT_INVALID_CONSTRUCTION" | "ACCOUNT_INVALID_PREFIX" | "ACCOUNT_INVALID_KEYTYPE" | "ACCOUNT_INVALID_KEYTYPE_EXTERNAL" | "ACCOUNT_PASSPHRASE_WEAK" | "ACCOUNT_NO_IDENTIFIER_SIGN" | "ACCOUNT_NO_IDENTIFIER_VERIFY" | "ACCOUNT_INVALID_IDENTIFIER_CONSTRUCTION" | "ACCOUNT_SEED_INDEX_UNDEFINED" | "ACCOUNT_SEED_INDEX_NEGATIVE" | "ACCOUNT_SEED_INDEX_NOT_INT" | "ACCOUNT_SEED_INDEX_TOO_LARGE" | "ACCOUNT_ENCRYPTION_NOT_SUPPORTED" | "API_INVALID_LIMIT" | "API_INVALID_SIDE" | "API_INVALID_START" | "API_LIMIT_NOT_NUMBER" | "API_LIMIT_NOT_GREATER_THAN_ZERO" | "API_REP_MISSING" | "API_START_MISSING" | "CLIENT_BUILDER_AMOUNT_IS_ZERO" | "CLIENT_BUILDER_CANNOT_READ_BEFORE_RENDER" | "CLIENT_BUILDER_REQUIRES_PRIVATE_KEY" | "CLIENT_BUILDER_USER_CLIENT_REQUIRED" | "CLIENT_PUBLISH_AID_NOT_AVAILABLE" | "CLIENT_SIGNER_REQUIRES_PRIVATE_KEY" | "CLIENT_SYNC_PUBLISH_FAILED" | "CLIENT_SWAP_INVALID_ACCOUNT_OPTION" | "CLIENT_SWAP_OPTIONS_INVALID" | "CLIENT_SWAP_MISSING_SEND" | "CLIENT_SWAP_MISSING_RECEIVE" | "CLIENT_SWAP_SEND_RECEIVE_ACCOUNT_MISMATCH" | "CLIENT_SWAP_SEND_ACCOUNT_MISMATCH" | "CLIENT_SWAP_SEND_TOKEN_MISMATCH" | "CLIENT_SWAP_SEND_AMOUNT_TOO_LOW" | "CLIENT_SWAP_SEND_AMOUNT_RECEIVE_EXACT_MISMATCH" | "CLIENT_SWAP_REQUEST_TOKEN_MISMATCH" | "CLIENT_SWAP_REQUEST_AMOUNT_MISMATCH" | "KV_TTL_NOT_SUPPORTED" | "KV_KEY_ALREADY_EXISTS")[];
|
|
4
4
|
export type ErrorCode = typeof allFullErrorCodes[number];
|
|
5
5
|
export declare function ExpectErrorCode(code: ErrorCode, test: () => any): Promise<void>;
|
|
6
6
|
export declare class KeetaNetError extends KeetaNetErrorBase<ErrorCode> {
|
package/lib/ledger/common.d.ts
CHANGED
|
@@ -57,6 +57,9 @@ interface ComputeLedgerEffectOptions<T extends boolean, P extends boolean, W ext
|
|
|
57
57
|
baseToken: TokenAddress;
|
|
58
58
|
}
|
|
59
59
|
export declare function validateSupply(amount: bigint, network: bigint): void;
|
|
60
|
+
export declare function validateNumericValue(value: bigint, block: Pick<Block, 'network' | 'date'>, fieldName?: string, context?: {
|
|
61
|
+
block: Block;
|
|
62
|
+
}): void;
|
|
60
63
|
export declare function validateBlockSignerCount(amount: bigint, network: bigint): void;
|
|
61
64
|
export declare function validateBlockSignerDepth(depth: bigint, network: bigint): void;
|
|
62
65
|
/**
|
|
@@ -483,7 +483,7 @@ export declare class Helper {
|
|
|
483
483
|
static getPrimaryKeyNames<X extends TableIndexName>(table: X): string[];
|
|
484
484
|
static getNameFromType(filterType: 'INDEX'): IndexName[];
|
|
485
485
|
static getNameFromType(filterType: 'TABLE'): TableName[];
|
|
486
|
-
static getAllTables(): ("
|
|
486
|
+
static getAllTables(): ("permissions" | "blocks" | "votes" | "ledger" | "chain" | "history" | "weight" | "accountInfo" | "accountCertificates" | "heapBlocks" | "heapStorage" | "delegation" | "idempotentKeys" | "voteBlocks")[];
|
|
487
487
|
static IsTable(name: TableIndexName): name is TableName;
|
|
488
488
|
static IsIndex(name: TableIndexName): name is IndexName;
|
|
489
489
|
static getIndexParent(index: IndexName): TableName;
|
package/lib/log/common.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ export type LogEntryFilled = Omit<LogEntry, 'options'> & {
|
|
|
19
19
|
export interface LogTarget {
|
|
20
20
|
readonly logLevel: LogTargetLevel;
|
|
21
21
|
readonly filter: RegExp | null;
|
|
22
|
+
readonly context?: {
|
|
23
|
+
[key: string]: string;
|
|
24
|
+
};
|
|
22
25
|
emitLogs(logs: LogEntry[]): Promise<void>;
|
|
23
26
|
}
|
|
24
27
|
export interface Logger {
|
package/lib/log/index.d.ts
CHANGED
|
@@ -74,6 +74,26 @@ declare class Log implements Logger {
|
|
|
74
74
|
* Unregister a logging target (sink) to stop sending logs to
|
|
75
75
|
*/
|
|
76
76
|
unregisterTarget(id: LogTargetID): void;
|
|
77
|
+
/**
|
|
78
|
+
* Get the currently registered log targets.
|
|
79
|
+
*
|
|
80
|
+
* If this is a child logger, this will return the parent's targets
|
|
81
|
+
* because child loggers share the same targets as their parent.
|
|
82
|
+
*/
|
|
83
|
+
protected get targets(): LogTarget[];
|
|
84
|
+
/**
|
|
85
|
+
* Parent logger, if any -- used for creating hierarchical loggers
|
|
86
|
+
*/
|
|
87
|
+
protected parent: Log | null;
|
|
88
|
+
/**
|
|
89
|
+
* Create a child logger instance that shares the same targets as this instance
|
|
90
|
+
* but has its own log queue, this is useful for creating hierarchical loggers
|
|
91
|
+
* which can call sync independently.
|
|
92
|
+
*
|
|
93
|
+
* Since the child shares the same targets, registering or unregistering targets
|
|
94
|
+
* from either the parent or child will affect both.
|
|
95
|
+
*/
|
|
96
|
+
createChild(): Log;
|
|
77
97
|
/**
|
|
78
98
|
* Emit a set of logs to all registered targets
|
|
79
99
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JSONSerializable } from '../utils/conversion';
|
|
2
|
+
/**
|
|
3
|
+
* Convert an array of arbitrary values to a string suitable for logging
|
|
4
|
+
*
|
|
5
|
+
* Truncates the resulting string to 300 characters.
|
|
6
|
+
*
|
|
7
|
+
* Limits the depth of object traversal to 10 levels to avoid
|
|
8
|
+
* overly deep recursion.
|
|
9
|
+
*/
|
|
10
|
+
export declare function convertToLogString(value: unknown[], options?: {
|
|
11
|
+
maxDepth: number;
|
|
12
|
+
maxLength: number;
|
|
13
|
+
}): string;
|
|
14
|
+
/**
|
|
15
|
+
* Convert a value to a JSON-serializable representation
|
|
16
|
+
*
|
|
17
|
+
* Uses toJSONSerializable for most conversions, with special handling for:
|
|
18
|
+
* - Error objects (extract message and stack)
|
|
19
|
+
* - Functions and symbols (use util.inspect)
|
|
20
|
+
* - Depth limiting to avoid infinite recursion
|
|
21
|
+
*/
|
|
22
|
+
export declare function convertToJSONSerializable(value: unknown, depthLimit: number): JSONSerializable;
|
|
@@ -3,11 +3,17 @@ type LogTargetConsoleConfig = {
|
|
|
3
3
|
logLevel?: LogTargetLevel;
|
|
4
4
|
filter?: RegExp;
|
|
5
5
|
console?: Pick<typeof console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
6
|
+
context?: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
6
9
|
};
|
|
7
10
|
declare class LogTargetConsole implements LogTarget {
|
|
8
11
|
#private;
|
|
9
12
|
readonly logLevel: LogTargetLevel;
|
|
10
13
|
readonly filter: RegExp | null;
|
|
14
|
+
readonly context?: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
11
17
|
constructor(config?: LogTargetConsoleConfig);
|
|
12
18
|
emitLogs(logs: LogEntry[]): Promise<void>;
|
|
13
19
|
}
|
package/lib/log/target_gcp.d.ts
CHANGED
|
@@ -9,11 +9,17 @@ type LogTargetGCPConfig = {
|
|
|
9
9
|
environment: string;
|
|
10
10
|
product: string;
|
|
11
11
|
vendor: string;
|
|
12
|
+
context?: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
12
15
|
};
|
|
13
16
|
declare class LogTargetGCP implements LogTarget {
|
|
14
17
|
#private;
|
|
15
18
|
readonly logLevel: LogTargetLevel;
|
|
16
19
|
readonly filter: RegExp | null;
|
|
20
|
+
readonly context?: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
17
23
|
constructor(config: LogTargetGCPConfig);
|
|
18
24
|
/**
|
|
19
25
|
* This function tries to log a test message to GCP Logging, and if it fails,
|
package/lib/log/target_gcp.js
CHANGED
|
@@ -49,6 +49,146 @@ function filterLog(target, message) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
|
|
52
|
+
/***/ }),
|
|
53
|
+
|
|
54
|
+
/***/ 996:
|
|
55
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
59
|
+
if (k2 === undefined) k2 = k;
|
|
60
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
61
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
62
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
63
|
+
}
|
|
64
|
+
Object.defineProperty(o, k2, desc);
|
|
65
|
+
}) : (function(o, m, k, k2) {
|
|
66
|
+
if (k2 === undefined) k2 = k;
|
|
67
|
+
o[k2] = m[k];
|
|
68
|
+
}));
|
|
69
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
70
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
71
|
+
}) : function(o, v) {
|
|
72
|
+
o["default"] = v;
|
|
73
|
+
});
|
|
74
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
75
|
+
if (mod && mod.__esModule) return mod;
|
|
76
|
+
var result = {};
|
|
77
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
78
|
+
__setModuleDefault(result, mod);
|
|
79
|
+
return result;
|
|
80
|
+
};
|
|
81
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
82
|
+
exports.convertToLogString = convertToLogString;
|
|
83
|
+
exports.convertToJSONSerializable = convertToJSONSerializable;
|
|
84
|
+
const util = __importStar(__webpack_require__(23));
|
|
85
|
+
const conversion_1 = __webpack_require__(360);
|
|
86
|
+
/**
|
|
87
|
+
* Convert an array of arbitrary values to a string suitable for logging
|
|
88
|
+
*
|
|
89
|
+
* Truncates the resulting string to 300 characters.
|
|
90
|
+
*
|
|
91
|
+
* Limits the depth of object traversal to 10 levels to avoid
|
|
92
|
+
* overly deep recursion.
|
|
93
|
+
*/
|
|
94
|
+
function convertToLogString(value, options) {
|
|
95
|
+
options = {
|
|
96
|
+
maxDepth: 10,
|
|
97
|
+
maxLength: 300,
|
|
98
|
+
...options
|
|
99
|
+
};
|
|
100
|
+
const output = value.map(function (item) {
|
|
101
|
+
if (typeof item === 'string') {
|
|
102
|
+
return (item);
|
|
103
|
+
}
|
|
104
|
+
if (typeof item === 'object' && item !== null) {
|
|
105
|
+
if ('toJSON' in item && typeof item.toJSON === 'function') {
|
|
106
|
+
try {
|
|
107
|
+
const jsonValue = item.toJSON();
|
|
108
|
+
return (util.inspect(jsonValue, { depth: options.maxDepth - 2, maxArrayLength: 20, breakLength: Infinity, compact: true, maxStringLength: 300 }));
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// Fall through to normal handling
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return (util.inspect(item, { depth: options.maxDepth - 2, maxArrayLength: 20, breakLength: Infinity, compact: true, maxStringLength: 300 }));
|
|
116
|
+
}).join(' ');
|
|
117
|
+
if (output.length > options.maxLength) {
|
|
118
|
+
return (output.slice(0, options.maxLength - 3) + '...');
|
|
119
|
+
}
|
|
120
|
+
return (output);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Convert a value to a JSON-serializable representation
|
|
124
|
+
*
|
|
125
|
+
* Uses toJSONSerializable for most conversions, with special handling for:
|
|
126
|
+
* - Error objects (extract message and stack)
|
|
127
|
+
* - Functions and symbols (use util.inspect)
|
|
128
|
+
* - Depth limiting to avoid infinite recursion
|
|
129
|
+
*/
|
|
130
|
+
function convertToJSONSerializable(value, depthLimit) {
|
|
131
|
+
if (depthLimit <= 0) {
|
|
132
|
+
return ('[depth limit reached]');
|
|
133
|
+
}
|
|
134
|
+
// Handle undefined explicitly (toJSONSerializable removes it)
|
|
135
|
+
if (value === undefined) {
|
|
136
|
+
return ('undefined');
|
|
137
|
+
}
|
|
138
|
+
// Handle bigint before toJSONSerializable (which also handles it but differently)
|
|
139
|
+
if (typeof value === 'bigint') {
|
|
140
|
+
return ('0x' + value.toString(16).toUpperCase());
|
|
141
|
+
}
|
|
142
|
+
// Handle Error objects by extracting properties
|
|
143
|
+
if (value instanceof Error) {
|
|
144
|
+
const errorObj = { message: value.message };
|
|
145
|
+
if (value.stack) {
|
|
146
|
+
errorObj.stack = value.stack;
|
|
147
|
+
}
|
|
148
|
+
return (errorObj);
|
|
149
|
+
}
|
|
150
|
+
// Handle functions and symbols with util.inspect
|
|
151
|
+
if (typeof value === 'function' || typeof value === 'symbol') {
|
|
152
|
+
return (util.inspect(value, { depth: 0 }));
|
|
153
|
+
}
|
|
154
|
+
// Handle arrays recursively
|
|
155
|
+
if (Array.isArray(value)) {
|
|
156
|
+
return (value.map(function (item) {
|
|
157
|
+
return (convertToJSONSerializable(item, depthLimit - 1));
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
// For all other types, try toJSONSerializable first
|
|
161
|
+
if (typeof value === 'object' && value !== null) {
|
|
162
|
+
try {
|
|
163
|
+
const converted = (0, conversion_1.toJSONSerializable)(value, { debugUnsafe: false });
|
|
164
|
+
// Apply depth limiting by recursively processing nested structures
|
|
165
|
+
if (typeof converted === 'object' && converted !== null) {
|
|
166
|
+
if (Array.isArray(converted)) {
|
|
167
|
+
return (converted.map(function (item) {
|
|
168
|
+
return (convertToJSONSerializable(item, depthLimit - 1));
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
// For plain objects, process entries
|
|
172
|
+
return (Object.fromEntries(Object.entries(converted).map(function ([key, val]) {
|
|
173
|
+
return ([key, convertToJSONSerializable(val, depthLimit - 1)]);
|
|
174
|
+
})));
|
|
175
|
+
}
|
|
176
|
+
return (converted);
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
// Fallback to util.inspect for unconvertible objects
|
|
180
|
+
return (util.inspect(value, {
|
|
181
|
+
depth: depthLimit,
|
|
182
|
+
maxArrayLength: 100,
|
|
183
|
+
breakLength: Infinity,
|
|
184
|
+
compact: true
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return ((0, conversion_1.toJSONSerializable)(value, { debugUnsafe: false }));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
52
192
|
/***/ }),
|
|
53
193
|
|
|
54
194
|
/***/ 22:
|
|
@@ -76,6 +216,7 @@ class LogTargetConsole {
|
|
|
76
216
|
this.logLevel = config?.logLevel ?? 'ALL';
|
|
77
217
|
__classPrivateFieldSet(this, _LogTargetConsole_console, config?.console ?? console, "f");
|
|
78
218
|
this.filter = config?.filter ?? null;
|
|
219
|
+
this.context = config?.context;
|
|
79
220
|
}
|
|
80
221
|
async emitLogs(logs) {
|
|
81
222
|
for (const rawLog of logs) {
|
|
@@ -101,9 +242,10 @@ class LogTargetConsole {
|
|
|
101
242
|
(0, never_1.assertNever)(log.level);
|
|
102
243
|
}
|
|
103
244
|
const requestID = log.options.currentRequestInfo.id;
|
|
104
|
-
|
|
245
|
+
const contextPrefix = this.context ? Object.entries(this.context).map(([k, v]) => `${k}=${v}`).join(' ') + ' ' : '';
|
|
246
|
+
__classPrivateFieldGet(this, _LogTargetConsole_console, "f")[method](`[${requestID}] ${contextPrefix}${log.level} ${log.from}:`, ...log.args);
|
|
105
247
|
if (log.trace !== undefined) {
|
|
106
|
-
__classPrivateFieldGet(this, _LogTargetConsole_console, "f")[method](`[${requestID}] ${log.level} ${log.from} TRACE:`, log.trace);
|
|
248
|
+
__classPrivateFieldGet(this, _LogTargetConsole_console, "f")[method](`[${requestID}] ${contextPrefix}${log.level} ${log.from} TRACE:`, log.trace);
|
|
107
249
|
}
|
|
108
250
|
}
|
|
109
251
|
}
|
|
@@ -118,29 +260,6 @@ exports["default"] = LogTargetConsole;
|
|
|
118
260
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
119
261
|
|
|
120
262
|
|
|
121
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
122
|
-
if (k2 === undefined) k2 = k;
|
|
123
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
124
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
125
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
126
|
-
}
|
|
127
|
-
Object.defineProperty(o, k2, desc);
|
|
128
|
-
}) : (function(o, m, k, k2) {
|
|
129
|
-
if (k2 === undefined) k2 = k;
|
|
130
|
-
o[k2] = m[k];
|
|
131
|
-
}));
|
|
132
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
133
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
134
|
-
}) : function(o, v) {
|
|
135
|
-
o["default"] = v;
|
|
136
|
-
});
|
|
137
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
138
|
-
if (mod && mod.__esModule) return mod;
|
|
139
|
-
var result = {};
|
|
140
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
141
|
-
__setModuleDefault(result, mod);
|
|
142
|
-
return result;
|
|
143
|
-
};
|
|
144
263
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
145
264
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
146
265
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -161,11 +280,11 @@ exports.Testing = void 0;
|
|
|
161
280
|
const common_1 = __webpack_require__(364);
|
|
162
281
|
const logging_1 = __webpack_require__(377);
|
|
163
282
|
const target_console_1 = __importDefault(__webpack_require__(22));
|
|
164
|
-
const
|
|
283
|
+
const internal_1 = __webpack_require__(996);
|
|
165
284
|
/**
|
|
166
285
|
* Convert a JSONSerializable value to a Google Cloud Platform Logging value
|
|
167
286
|
*/
|
|
168
|
-
function
|
|
287
|
+
function convertJSONSerializableToGCPLoggingValue(value, depthLimit) {
|
|
169
288
|
/**
|
|
170
289
|
* Ensure we do not recurse too deeply
|
|
171
290
|
*/
|
|
@@ -180,10 +299,6 @@ function convertJSONToGCPLoggingValue(value, depthLimit) {
|
|
|
180
299
|
return ({
|
|
181
300
|
stringValue: String(value)
|
|
182
301
|
});
|
|
183
|
-
case 'bigint':
|
|
184
|
-
return ({
|
|
185
|
-
stringValue: '0x' + value.toString(16).toUpperCase()
|
|
186
|
-
});
|
|
187
302
|
case 'string':
|
|
188
303
|
return ({
|
|
189
304
|
stringValue: value
|
|
@@ -206,30 +321,21 @@ function convertJSONToGCPLoggingValue(value, depthLimit) {
|
|
|
206
321
|
return ({
|
|
207
322
|
listValue: {
|
|
208
323
|
values: value.map(function (itemValue) {
|
|
209
|
-
return (
|
|
324
|
+
return (convertJSONSerializableToGCPLoggingValue(itemValue, depthLimit));
|
|
210
325
|
})
|
|
211
326
|
}
|
|
212
327
|
});
|
|
213
328
|
}
|
|
214
|
-
|
|
329
|
+
const properties = Object.keys(value);
|
|
215
330
|
if (properties.length === 0) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
* function handle it.
|
|
222
|
-
*/
|
|
223
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
224
|
-
const jsonValue = value.toJSON();
|
|
225
|
-
return (convertJSONToGCPLoggingValue(jsonValue, depthLimit));
|
|
331
|
+
try {
|
|
332
|
+
const maybeStringValue = String(value);
|
|
333
|
+
if (maybeStringValue !== '[object Object]') {
|
|
334
|
+
return ({ stringValue: String(value) });
|
|
335
|
+
}
|
|
226
336
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
if (properties.length === 0) {
|
|
230
|
-
const maybeStringValue = String(value);
|
|
231
|
-
if (maybeStringValue !== '[object Object]') {
|
|
232
|
-
return ({ stringValue: String(value) });
|
|
337
|
+
catch {
|
|
338
|
+
return ({ structValue: { fields: {} } });
|
|
233
339
|
}
|
|
234
340
|
}
|
|
235
341
|
return ({
|
|
@@ -245,7 +351,7 @@ function convertJSONToGCPLoggingValue(value, depthLimit) {
|
|
|
245
351
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
246
352
|
itemValue = value[itemKey];
|
|
247
353
|
}
|
|
248
|
-
return ([itemKey,
|
|
354
|
+
return ([itemKey, convertJSONSerializableToGCPLoggingValue(itemValue, depthLimit)]);
|
|
249
355
|
}))
|
|
250
356
|
}
|
|
251
357
|
});
|
|
@@ -258,30 +364,10 @@ function convertJSONToGCPLoggingValue(value, depthLimit) {
|
|
|
258
364
|
* Convert an arbitrary value to a Google Cloud Platform Logging value
|
|
259
365
|
*/
|
|
260
366
|
function convertToGCPLoggingValue(value) {
|
|
261
|
-
const
|
|
367
|
+
const convertedValue = (0, internal_1.convertToJSONSerializable)(value, 10);
|
|
368
|
+
const retval = convertJSONSerializableToGCPLoggingValue(convertedValue, 10);
|
|
262
369
|
return (retval);
|
|
263
370
|
}
|
|
264
|
-
/**
|
|
265
|
-
* Convert an array of arbitrary values to a string suitable for Google Cloud
|
|
266
|
-
* Platform Logging textPayload
|
|
267
|
-
*
|
|
268
|
-
* Truncates the resulting string to 300 characters.
|
|
269
|
-
*
|
|
270
|
-
* Limits the depth of object traversal to 10 levels to avoid
|
|
271
|
-
* overly deep recursion.
|
|
272
|
-
*/
|
|
273
|
-
function convertToGCPLoggingString(value) {
|
|
274
|
-
const output = value.map(function (item) {
|
|
275
|
-
if (typeof item === 'string') {
|
|
276
|
-
return (item);
|
|
277
|
-
}
|
|
278
|
-
return (util.inspect(item, { depth: 10, maxArrayLength: 20, breakLength: 120, compact: true, maxStringLength: 300 }));
|
|
279
|
-
}).join(' ');
|
|
280
|
-
if (output.length > 300) {
|
|
281
|
-
return (output.slice(0, 297) + '...');
|
|
282
|
-
}
|
|
283
|
-
return (output);
|
|
284
|
-
}
|
|
285
371
|
class LogTargetGCP {
|
|
286
372
|
constructor(config) {
|
|
287
373
|
_LogTargetGCP_instances.add(this);
|
|
@@ -300,10 +386,12 @@ class LogTargetGCP {
|
|
|
300
386
|
_LogTargetGCP_console.set(this, void 0);
|
|
301
387
|
this.logLevel = config.logLevel ?? 'DEBUG';
|
|
302
388
|
this.filter = config.filter ?? null;
|
|
389
|
+
this.context = config.context;
|
|
303
390
|
__classPrivateFieldSet(this, _LogTargetGCP_console, config.console ?? console, "f");
|
|
304
391
|
__classPrivateFieldSet(this, _LogTargetGCP_consoleLoggingTarget, new target_console_1.default({
|
|
305
392
|
logLevel: config.logLevel,
|
|
306
|
-
console: config.console
|
|
393
|
+
console: config.console,
|
|
394
|
+
context: config.context
|
|
307
395
|
}), "f");
|
|
308
396
|
__classPrivateFieldSet(this, _LogTargetGCP_googleCloudLoggingOptions, {
|
|
309
397
|
environment: config.environment,
|
|
@@ -364,7 +452,7 @@ class LogTargetGCP {
|
|
|
364
452
|
}
|
|
365
453
|
const [vendor, product] = __classPrivateFieldGet(this, _LogTargetGCP_instances, "a", _LogTargetGCP_gcpLoggingTarget_get).split('/');
|
|
366
454
|
const environment = __classPrivateFieldGet(this, _LogTargetGCP_googleCloudLoggingOptions, "f").environment;
|
|
367
|
-
const logEntries = logs.map(
|
|
455
|
+
const logEntries = logs.map((log) => {
|
|
368
456
|
const addLogFields = {};
|
|
369
457
|
if (log.trace !== undefined) {
|
|
370
458
|
addLogFields.trace = {
|
|
@@ -375,7 +463,7 @@ class LogTargetGCP {
|
|
|
375
463
|
jsonPayload: {
|
|
376
464
|
fields: {
|
|
377
465
|
message: {
|
|
378
|
-
stringValue:
|
|
466
|
+
stringValue: (0, internal_1.convertToLogString)([`[${log.from}]`, ...log.args])
|
|
379
467
|
},
|
|
380
468
|
currentRequest: convertToGCPLoggingValue(log.options.currentRequestInfo.id),
|
|
381
469
|
userVisible: {
|
|
@@ -394,7 +482,8 @@ class LogTargetGCP {
|
|
|
394
482
|
labels: {
|
|
395
483
|
vendor: vendor,
|
|
396
484
|
product: product,
|
|
397
|
-
environment: environment
|
|
485
|
+
environment: environment,
|
|
486
|
+
...(this.context ?? {})
|
|
398
487
|
},
|
|
399
488
|
severity: log.level
|
|
400
489
|
}));
|
|
@@ -414,11 +503,104 @@ _LogTargetGCP_googleCloudLoggingOptions = new WeakMap(), _LogTargetGCP_googleClo
|
|
|
414
503
|
/** @internal */
|
|
415
504
|
exports.Testing = {
|
|
416
505
|
convertToGCPLoggingValue,
|
|
417
|
-
|
|
506
|
+
convertToLogString: internal_1.convertToLogString
|
|
418
507
|
};
|
|
419
508
|
exports["default"] = LogTargetGCP;
|
|
420
509
|
|
|
421
510
|
|
|
511
|
+
/***/ }),
|
|
512
|
+
|
|
513
|
+
/***/ 360:
|
|
514
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
518
|
+
exports.toJSONSerializable = toJSONSerializable;
|
|
519
|
+
exports.objectToBuffer = objectToBuffer;
|
|
520
|
+
exports.parseHexBigIntString = parseHexBigIntString;
|
|
521
|
+
const util_1 = __webpack_require__(23);
|
|
522
|
+
;
|
|
523
|
+
function convertSingleValue(value, opts = {}) {
|
|
524
|
+
const checkPrefix = function (out, prefix, parseOpts) {
|
|
525
|
+
if (parseOpts.debugUnsafe && prefix) {
|
|
526
|
+
out = `[${prefix} ${out}]`;
|
|
527
|
+
}
|
|
528
|
+
return (out);
|
|
529
|
+
};
|
|
530
|
+
let out = value;
|
|
531
|
+
let prefix;
|
|
532
|
+
if (typeof value === 'bigint') {
|
|
533
|
+
if (opts.debugUnsafe) {
|
|
534
|
+
out = String(value);
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
let positiveValue = value;
|
|
538
|
+
let sign = '';
|
|
539
|
+
if (value < 0n) {
|
|
540
|
+
positiveValue = value * -1n;
|
|
541
|
+
sign = '-';
|
|
542
|
+
}
|
|
543
|
+
const numberAsString = positiveValue.toString(16).toUpperCase();
|
|
544
|
+
out = `${sign}0x${numberAsString}`;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
else if (util_1.types.isDate(value)) {
|
|
548
|
+
prefix = 'DATE';
|
|
549
|
+
out = value.toISOString();
|
|
550
|
+
}
|
|
551
|
+
else if (util_1.types.isArrayBuffer(value)) {
|
|
552
|
+
out = Buffer.from(value).toString('hex').toUpperCase();
|
|
553
|
+
}
|
|
554
|
+
else if (value instanceof Buffer) {
|
|
555
|
+
out = value.toString('hex').toUpperCase();
|
|
556
|
+
}
|
|
557
|
+
else if (Array.isArray(value)) {
|
|
558
|
+
out = value.map(val => convertSingleValue(val, opts));
|
|
559
|
+
}
|
|
560
|
+
else if (value instanceof Object) {
|
|
561
|
+
let hasValue = false;
|
|
562
|
+
if (value.toJSON !== undefined && typeof value.toJSON === 'function') {
|
|
563
|
+
hasValue = true;
|
|
564
|
+
out = convertSingleValue(value.toJSON(opts), opts);
|
|
565
|
+
}
|
|
566
|
+
else if (opts.debugUnsafe && value.toString !== undefined && typeof value.toString === 'function') {
|
|
567
|
+
const toStringResult = value.toString();
|
|
568
|
+
if (toStringResult !== '[object Object]') {
|
|
569
|
+
out = convertSingleValue(value.toJSON(), opts);
|
|
570
|
+
prefix = 'OBJECT';
|
|
571
|
+
if (typeof value.constructor && value.constructor.name) {
|
|
572
|
+
prefix = value.constructor.name;
|
|
573
|
+
}
|
|
574
|
+
hasValue = true;
|
|
575
|
+
out = value.toString();
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (hasValue === false) {
|
|
579
|
+
const retval = { ...value };
|
|
580
|
+
for (const key in retval) {
|
|
581
|
+
retval[key] = convertSingleValue(retval[key], opts);
|
|
582
|
+
}
|
|
583
|
+
out = retval;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
return (checkPrefix(out, prefix, opts));
|
|
587
|
+
}
|
|
588
|
+
function toJSONSerializable(data, opts) {
|
|
589
|
+
return (JSON.parse(JSON.stringify(convertSingleValue(data, opts))));
|
|
590
|
+
}
|
|
591
|
+
function objectToBuffer(data, opts = {}) {
|
|
592
|
+
return (Buffer.from(JSON.stringify(convertSingleValue(data, opts))));
|
|
593
|
+
}
|
|
594
|
+
function parseHexBigIntString(input) {
|
|
595
|
+
if (input.startsWith('-')) {
|
|
596
|
+
return (BigInt(input.substring(1)) * -1n);
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
return (BigInt(input));
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
|
|
422
604
|
/***/ }),
|
|
423
605
|
|
|
424
606
|
/***/ 692:
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { LogTarget, LogTargetLevel, LogEntry } from './common';
|
|
2
|
+
import type { NonIdentifierAccount } from '../account';
|
|
3
|
+
import LogTargetConsole from './target_console';
|
|
4
|
+
type LogTargetHTTPSConfig = {
|
|
5
|
+
account: NonIdentifierAccount;
|
|
6
|
+
url: string;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
logLevel?: LogTargetLevel;
|
|
9
|
+
filter?: RegExp;
|
|
10
|
+
console?: NonNullable<ConstructorParameters<typeof LogTargetConsole>[0]>['console'];
|
|
11
|
+
environment: string;
|
|
12
|
+
product: string;
|
|
13
|
+
vendor: string;
|
|
14
|
+
context?: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
declare class LogTargetHTTPS implements LogTarget {
|
|
19
|
+
#private;
|
|
20
|
+
readonly logLevel: LogTargetLevel;
|
|
21
|
+
readonly filter: RegExp | null;
|
|
22
|
+
readonly context?: {
|
|
23
|
+
[key: string]: string;
|
|
24
|
+
};
|
|
25
|
+
constructor(config: LogTargetHTTPSConfig);
|
|
26
|
+
emitLogs(input: LogEntry[]): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export default LogTargetHTTPS;
|