@paimaexample/wallets 0.3.117
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/README.md +1 -0
- package/esm/chain-types/src/hash.d.ts +28 -0
- package/esm/chain-types/src/hash.d.ts.map +1 -0
- package/esm/chain-types/src/hash.js +29 -0
- package/esm/chain-types/src/mod.d.ts +3 -0
- package/esm/chain-types/src/mod.d.ts.map +1 -0
- package/esm/chain-types/src/mod.js +2 -0
- package/esm/chain-types/src/types.d.ts +70 -0
- package/esm/chain-types/src/types.d.ts.map +1 -0
- package/esm/chain-types/src/types.js +1 -0
- package/esm/concise/src/batcher.d.ts +40 -0
- package/esm/concise/src/batcher.d.ts.map +1 -0
- package/esm/concise/src/batcher.js +117 -0
- package/esm/concise/src/delegate.d.ts +18 -0
- package/esm/concise/src/delegate.d.ts.map +1 -0
- package/esm/concise/src/delegate.js +118 -0
- package/esm/concise/src/mod.d.ts +5 -0
- package/esm/concise/src/mod.d.ts.map +1 -0
- package/esm/concise/src/mod.js +3 -0
- package/esm/concise/src/v2/builtins/batcher.d.ts +27 -0
- package/esm/concise/src/v2/builtins/batcher.d.ts.map +1 -0
- package/esm/concise/src/v2/builtins/batcher.js +51 -0
- package/esm/concise/src/v2/builtins/grammar.d.ts +25 -0
- package/esm/concise/src/v2/builtins/grammar.d.ts.map +1 -0
- package/esm/concise/src/v2/builtins/grammar.js +40 -0
- package/esm/concise/src/v2/builtins/index.d.ts +3 -0
- package/esm/concise/src/v2/builtins/index.d.ts.map +1 -0
- package/esm/concise/src/v2/builtins/index.js +3 -0
- package/esm/concise/src/v2/grammar.d.ts +8 -0
- package/esm/concise/src/v2/grammar.d.ts.map +1 -0
- package/esm/concise/src/v2/grammar.js +19 -0
- package/esm/concise/src/v2/inputs.d.ts +7 -0
- package/esm/concise/src/v2/inputs.d.ts.map +1 -0
- package/esm/concise/src/v2/inputs.js +37 -0
- package/esm/concise/src/v2/mod.d.ts +5 -0
- package/esm/concise/src/v2/mod.d.ts.map +1 -0
- package/esm/concise/src/v2/mod.js +4 -0
- package/esm/concise/src/v2/types.d.ts +23 -0
- package/esm/concise/src/v2/types.d.ts.map +1 -0
- package/esm/concise/src/v2/types.js +1 -0
- package/esm/config/src/config/builder.d.ts +33 -0
- package/esm/config/src/config/builder.d.ts.map +1 -0
- package/esm/config/src/config/builder.js +82 -0
- package/esm/config/src/config/configCheck.d.ts +32 -0
- package/esm/config/src/config/configCheck.d.ts.map +1 -0
- package/esm/config/src/config/configCheck.js +67 -0
- package/esm/config/src/config/context.d.ts +23 -0
- package/esm/config/src/config/context.d.ts.map +1 -0
- package/esm/config/src/config/context.js +25 -0
- package/esm/config/src/config/mod.d.ts +7 -0
- package/esm/config/src/config/mod.d.ts.map +1 -0
- package/esm/config/src/config/mod.js +4 -0
- package/esm/config/src/config/parts/deployedAddresses.d.ts +17 -0
- package/esm/config/src/config/parts/deployedAddresses.d.ts.map +1 -0
- package/esm/config/src/config/parts/deployedAddresses.js +24 -0
- package/esm/config/src/config/parts/network.d.ts +19 -0
- package/esm/config/src/config/parts/network.d.ts.map +1 -0
- package/esm/config/src/config/parts/network.js +29 -0
- package/esm/config/src/config/parts/primitive.d.ts +31 -0
- package/esm/config/src/config/parts/primitive.d.ts.map +1 -0
- package/esm/config/src/config/parts/primitive.js +28 -0
- package/esm/config/src/config/parts/securityNamespace.d.ts +14 -0
- package/esm/config/src/config/parts/securityNamespace.d.ts.map +1 -0
- package/esm/config/src/config/parts/securityNamespace.js +26 -0
- package/esm/config/src/config/parts/syncProtocols.d.ts +43 -0
- package/esm/config/src/config/parts/syncProtocols.d.ts.map +1 -0
- package/esm/config/src/config/parts/syncProtocols.js +66 -0
- package/esm/config/src/config/utils.d.ts +40 -0
- package/esm/config/src/config/utils.d.ts.map +1 -0
- package/esm/config/src/config/utils.js +55 -0
- package/esm/config/src/mod.d.ts +3 -0
- package/esm/config/src/mod.d.ts.map +1 -0
- package/esm/config/src/mod.js +2 -0
- package/esm/config/src/schema/common.d.ts +26 -0
- package/esm/config/src/schema/common.d.ts.map +1 -0
- package/esm/config/src/schema/common.js +51 -0
- package/esm/config/src/schema/mod.d.ts +7 -0
- package/esm/config/src/schema/mod.d.ts.map +1 -0
- package/esm/config/src/schema/mod.js +6 -0
- package/esm/config/src/schema/namespace.d.ts +39 -0
- package/esm/config/src/schema/namespace.d.ts.map +1 -0
- package/esm/config/src/schema/namespace.js +34 -0
- package/esm/config/src/schema/network/algorand.d.ts +12 -0
- package/esm/config/src/schema/network/algorand.d.ts.map +1 -0
- package/esm/config/src/schema/network/algorand.js +23 -0
- package/esm/config/src/schema/network/all.d.ts +175 -0
- package/esm/config/src/schema/network/all.d.ts.map +1 -0
- package/esm/config/src/schema/network/all.js +24 -0
- package/esm/config/src/schema/network/bitcoin.d.ts +19 -0
- package/esm/config/src/schema/network/bitcoin.d.ts.map +1 -0
- package/esm/config/src/schema/network/bitcoin.js +21 -0
- package/esm/config/src/schema/network/cardano.d.ts +12 -0
- package/esm/config/src/schema/network/cardano.d.ts.map +1 -0
- package/esm/config/src/schema/network/cardano.js +27 -0
- package/esm/config/src/schema/network/evm.d.ts +68 -0
- package/esm/config/src/schema/network/evm.d.ts.map +1 -0
- package/esm/config/src/schema/network/evm.js +70 -0
- package/esm/config/src/schema/network/mina.d.ts +14 -0
- package/esm/config/src/schema/network/mina.d.ts.map +1 -0
- package/esm/config/src/schema/network/mina.js +25 -0
- package/esm/config/src/schema/network/mod.d.ts +9 -0
- package/esm/config/src/schema/network/mod.d.ts.map +1 -0
- package/esm/config/src/schema/network/mod.js +8 -0
- package/esm/config/src/schema/network/ntp.d.ts +32 -0
- package/esm/config/src/schema/network/ntp.d.ts.map +1 -0
- package/esm/config/src/schema/network/ntp.js +39 -0
- package/esm/config/src/schema/network/substrate/avail.d.ts +14 -0
- package/esm/config/src/schema/network/substrate/avail.d.ts.map +1 -0
- package/esm/config/src/schema/network/substrate/avail.js +26 -0
- package/esm/config/src/schema/network/substrate/common.d.ts +18 -0
- package/esm/config/src/schema/network/substrate/common.d.ts.map +1 -0
- package/esm/config/src/schema/network/substrate/common.js +32 -0
- package/esm/config/src/schema/network/substrate/midnight.d.ts +20 -0
- package/esm/config/src/schema/network/substrate/midnight.d.ts.map +1 -0
- package/esm/config/src/schema/network/substrate/midnight.js +32 -0
- package/esm/config/src/schema/network/substrate/mod.d.ts +4 -0
- package/esm/config/src/schema/network/substrate/mod.d.ts.map +1 -0
- package/esm/config/src/schema/network/substrate/mod.js +3 -0
- package/esm/config/src/schema/network/types.d.ts +13 -0
- package/esm/config/src/schema/network/types.d.ts.map +1 -0
- package/esm/config/src/schema/network/types.js +13 -0
- package/esm/config/src/schema/network/utils.d.ts +5 -0
- package/esm/config/src/schema/network/utils.d.ts.map +1 -0
- package/esm/config/src/schema/network/utils.js +73 -0
- package/esm/config/src/schema/primitive/mod.d.ts +2 -0
- package/esm/config/src/schema/primitive/mod.d.ts.map +1 -0
- package/esm/config/src/schema/primitive/mod.js +1 -0
- package/esm/config/src/schema/primitive/types.d.ts +58 -0
- package/esm/config/src/schema/primitive/types.d.ts.map +1 -0
- package/esm/config/src/schema/primitive/types.js +1 -0
- package/esm/config/src/schema/sync-protocols/all.d.ts +583 -0
- package/esm/config/src/schema/sync-protocols/all.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/all.js +55 -0
- package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts +76 -0
- package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/avail/rpc.js +56 -0
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +76 -0
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.js +47 -0
- package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts +80 -0
- package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/cardano/carp.js +62 -0
- package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts +2 -0
- package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/cardano/mod.js +1 -0
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +56 -0
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.js +56 -0
- package/esm/config/src/schema/sync-protocols/common.d.ts +60 -0
- package/esm/config/src/schema/sync-protocols/common.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/common.js +54 -0
- package/esm/config/src/schema/sync-protocols/decorators/all.d.ts +17 -0
- package/esm/config/src/schema/sync-protocols/decorators/all.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/decorators/all.js +8 -0
- package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts +8 -0
- package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/decorators/emulated.js +12 -0
- package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts +4 -0
- package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/decorators/mod.js +3 -0
- package/esm/config/src/schema/sync-protocols/decorators/types.d.ts +4 -0
- package/esm/config/src/schema/sync-protocols/decorators/types.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/decorators/types.js +4 -0
- package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts +68 -0
- package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/evm/rpc.js +44 -0
- package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts +66 -0
- package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/midnight/graphql.js +50 -0
- package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts +73 -0
- package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/mina/graphql.js +59 -0
- package/esm/config/src/schema/sync-protocols/mod.d.ts +10 -0
- package/esm/config/src/schema/sync-protocols/mod.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/mod.js +9 -0
- package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts +45 -0
- package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/ntp/rpc.js +33 -0
- package/esm/config/src/schema/sync-protocols/types.d.ts +125 -0
- package/esm/config/src/schema/sync-protocols/types.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/types.js +22 -0
- package/esm/config/src/schema/utils.d.ts +53 -0
- package/esm/config/src/schema/utils.d.ts.map +1 -0
- package/esm/config/src/schema/utils.js +58 -0
- package/esm/events/src/app-events.d.ts +65 -0
- package/esm/events/src/app-events.d.ts.map +1 -0
- package/esm/events/src/app-events.js +51 -0
- package/esm/events/src/asyncapi.d.ts +1173 -0
- package/esm/events/src/asyncapi.d.ts.map +1 -0
- package/esm/events/src/asyncapi.js +7 -0
- package/esm/events/src/builtin-event-utils.d.ts +5 -0
- package/esm/events/src/builtin-event-utils.d.ts.map +1 -0
- package/esm/events/src/builtin-event-utils.js +58 -0
- package/esm/events/src/builtin-events.d.ts +106 -0
- package/esm/events/src/builtin-events.d.ts.map +1 -0
- package/esm/events/src/builtin-events.js +198 -0
- package/esm/events/src/event-connect.d.ts +15 -0
- package/esm/events/src/event-connect.d.ts.map +1 -0
- package/esm/events/src/event-connect.js +75 -0
- package/esm/events/src/event-manager.d.ts +54 -0
- package/esm/events/src/event-manager.d.ts.map +1 -0
- package/esm/events/src/event-manager.js +129 -0
- package/esm/events/src/evm.d.ts +6 -0
- package/esm/events/src/evm.d.ts.map +1 -0
- package/esm/events/src/evm.js +55 -0
- package/esm/events/src/mod.d.ts +10 -0
- package/esm/events/src/mod.d.ts.map +1 -0
- package/esm/events/src/mod.js +9 -0
- package/esm/events/src/types.d.ts +255 -0
- package/esm/events/src/types.d.ts.map +1 -0
- package/esm/events/src/types.js +103 -0
- package/esm/events/src/utils.d.ts +16 -0
- package/esm/events/src/utils.d.ts.map +1 -0
- package/esm/events/src/utils.js +93 -0
- package/esm/package.json +3 -0
- package/esm/utils/src/binary-search.d.ts +7 -0
- package/esm/utils/src/binary-search.d.ts.map +1 -0
- package/esm/utils/src/binary-search.js +38 -0
- package/esm/utils/src/captcha.d.ts +9 -0
- package/esm/utils/src/captcha.d.ts.map +1 -0
- package/esm/utils/src/captcha.js +19 -0
- package/esm/utils/src/concurrency/condVar.d.ts +25 -0
- package/esm/utils/src/concurrency/condVar.d.ts.map +1 -0
- package/esm/utils/src/concurrency/condVar.js +39 -0
- package/esm/utils/src/concurrency/latch.d.ts +25 -0
- package/esm/utils/src/concurrency/latch.d.ts.map +1 -0
- package/esm/utils/src/concurrency/latch.js +51 -0
- package/esm/utils/src/concurrency/mod.d.ts +5 -0
- package/esm/utils/src/concurrency/mod.d.ts.map +1 -0
- package/esm/utils/src/concurrency/mod.js +4 -0
- package/esm/utils/src/concurrency/retry.d.ts +14 -0
- package/esm/utils/src/concurrency/retry.d.ts.map +1 -0
- package/esm/utils/src/concurrency/retry.js +26 -0
- package/esm/utils/src/concurrency/utils.d.ts +27 -0
- package/esm/utils/src/concurrency/utils.d.ts.map +1 -0
- package/esm/utils/src/concurrency/utils.js +27 -0
- package/esm/utils/src/constants.d.ts +4 -0
- package/esm/utils/src/constants.d.ts.map +1 -0
- package/esm/utils/src/constants.js +7 -0
- package/esm/utils/src/decorators/bound.d.ts +10 -0
- package/esm/utils/src/decorators/bound.d.ts.map +1 -0
- package/esm/utils/src/decorators/bound.js +17 -0
- package/esm/utils/src/decorators/mod.d.ts +2 -0
- package/esm/utils/src/decorators/mod.d.ts.map +1 -0
- package/esm/utils/src/decorators/mod.js +1 -0
- package/esm/utils/src/mod.d.ts +8 -0
- package/esm/utils/src/mod.d.ts.map +1 -0
- package/esm/utils/src/mod.js +7 -0
- package/esm/utils/src/types/json-query.d.ts +30 -0
- package/esm/utils/src/types/json-query.d.ts.map +1 -0
- package/esm/utils/src/types/json-query.js +1 -0
- package/esm/utils/src/types/misc.d.ts +109 -0
- package/esm/utils/src/types/misc.d.ts.map +1 -0
- package/esm/utils/src/types/misc.js +2 -0
- package/esm/utils/src/types/mod.d.ts +7 -0
- package/esm/utils/src/types/mod.d.ts.map +1 -0
- package/esm/utils/src/types/mod.js +3 -0
- package/esm/utils/src/types/nominal.d.ts +87 -0
- package/esm/utils/src/types/nominal.d.ts.map +1 -0
- package/esm/utils/src/types/nominal.js +1 -0
- package/esm/utils/src/types/typebox-helpers.d.ts +183 -0
- package/esm/utils/src/types/typebox-helpers.d.ts.map +1 -0
- package/esm/utils/src/types/typebox-helpers.js +235 -0
- package/esm/utils/src/types/utils.d.ts +37 -0
- package/esm/utils/src/types/utils.d.ts.map +1 -0
- package/esm/utils/src/types/utils.js +46 -0
- package/esm/utils/src/types/validators/algorand.d.ts +31 -0
- package/esm/utils/src/types/validators/algorand.d.ts.map +1 -0
- package/esm/utils/src/types/validators/algorand.js +90 -0
- package/esm/utils/src/types/validators/cardano.d.ts +26 -0
- package/esm/utils/src/types/validators/cardano.d.ts.map +1 -0
- package/esm/utils/src/types/validators/cardano.js +113 -0
- package/esm/utils/src/types/validators/mina.d.ts +15 -0
- package/esm/utils/src/types/validators/mina.d.ts.map +1 -0
- package/esm/utils/src/types/validators/mina.js +43 -0
- package/esm/utils/src/types/validators/minicbor.d.ts +98 -0
- package/esm/utils/src/types/validators/minicbor.d.ts.map +1 -0
- package/esm/utils/src/types/validators/minicbor.js +332 -0
- package/esm/utils/src/types/validators/mod.d.ts +3 -0
- package/esm/utils/src/types/validators/mod.d.ts.map +1 -0
- package/esm/utils/src/types/validators/mod.js +2 -0
- package/esm/utils/src/types/validators/utils.d.ts +6 -0
- package/esm/utils/src/types/validators/utils.d.ts.map +1 -0
- package/esm/utils/src/types/validators/utils.js +24 -0
- package/esm/utils/src/viem.d.ts +6 -0
- package/esm/utils/src/viem.d.ts.map +1 -0
- package/esm/utils/src/viem.js +15 -0
- package/esm/wallets/src/IProvider.d.ts +48 -0
- package/esm/wallets/src/IProvider.d.ts.map +1 -0
- package/esm/wallets/src/IProvider.js +7 -0
- package/esm/wallets/src/avail/avail.d.ts +28 -0
- package/esm/wallets/src/avail/avail.d.ts.map +1 -0
- package/esm/wallets/src/avail/avail.js +65 -0
- package/esm/wallets/src/avail/wrapper.d.ts +6 -0
- package/esm/wallets/src/avail/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/avail/wrapper.js +31 -0
- package/esm/wallets/src/cardano/cardano.d.ts +30 -0
- package/esm/wallets/src/cardano/cardano.d.ts.map +1 -0
- package/esm/wallets/src/cardano/cardano.js +158 -0
- package/esm/wallets/src/cardano/wrapper.d.ts +7 -0
- package/esm/wallets/src/cardano/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/cardano/wrapper.js +22 -0
- package/esm/wallets/src/evm/ethers.d.ts +28 -0
- package/esm/wallets/src/evm/ethers.d.ts.map +1 -0
- package/esm/wallets/src/evm/ethers.js +79 -0
- package/esm/wallets/src/evm/injected.d.ts +74 -0
- package/esm/wallets/src/evm/injected.d.ts.map +1 -0
- package/esm/wallets/src/evm/injected.js +322 -0
- package/esm/wallets/src/evm/types.d.ts +3 -0
- package/esm/wallets/src/evm/types.d.ts.map +1 -0
- package/esm/wallets/src/evm/types.js +1 -0
- package/esm/wallets/src/evm/wrapper-ethers.d.ts +6 -0
- package/esm/wallets/src/evm/wrapper-ethers.d.ts.map +1 -0
- package/esm/wallets/src/evm/wrapper-ethers.js +38 -0
- package/esm/wallets/src/evm/wrapper-injected.d.ts +7 -0
- package/esm/wallets/src/evm/wrapper-injected.d.ts.map +1 -0
- package/esm/wallets/src/evm/wrapper-injected.js +80 -0
- package/esm/wallets/src/midnight/midnight.d.ts +26 -0
- package/esm/wallets/src/midnight/midnight.d.ts.map +1 -0
- package/esm/wallets/src/midnight/midnight.js +112 -0
- package/esm/wallets/src/midnight/wrapper.d.ts +7 -0
- package/esm/wallets/src/midnight/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/midnight/wrapper.js +22 -0
- package/esm/wallets/src/mina/mina.d.ts +28 -0
- package/esm/wallets/src/mina/mina.d.ts.map +1 -0
- package/esm/wallets/src/mina/mina.js +133 -0
- package/esm/wallets/src/mina/wrapper.d.ts +6 -0
- package/esm/wallets/src/mina/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/mina/wrapper.js +12 -0
- package/esm/wallets/src/mod.d.ts +8 -0
- package/esm/wallets/src/mod.d.ts.map +1 -0
- package/esm/wallets/src/mod.js +5 -0
- package/esm/wallets/src/paima.d.ts +104 -0
- package/esm/wallets/src/paima.d.ts.map +1 -0
- package/esm/wallets/src/paima.js +244 -0
- package/esm/wallets/src/types.d.ts +49 -0
- package/esm/wallets/src/types.d.ts.map +1 -0
- package/esm/wallets/src/types.js +1 -0
- package/esm/wallets/src/utils.d.ts +41 -0
- package/esm/wallets/src/utils.d.ts.map +1 -0
- package/esm/wallets/src/utils.js +75 -0
- package/esm/wallets/src/wallet-modes.d.ts +49 -0
- package/esm/wallets/src/wallet-modes.d.ts.map +1 -0
- package/esm/wallets/src/wallet-modes.js +26 -0
- package/esm/wallets/src/wallets.d.ts +5 -0
- package/esm/wallets/src/wallets.d.ts.map +1 -0
- package/esm/wallets/src/wallets.js +55 -0
- package/esm/wallets/src/windows.d.ts +5 -0
- package/esm/wallets/src/windows.d.ts.map +1 -0
- package/esm/wallets/src/windows.js +9 -0
- package/package.json +51 -0
- package/script/chain-types/src/hash.d.ts +28 -0
- package/script/chain-types/src/hash.d.ts.map +1 -0
- package/script/chain-types/src/hash.js +36 -0
- package/script/chain-types/src/mod.d.ts +3 -0
- package/script/chain-types/src/mod.d.ts.map +1 -0
- package/script/chain-types/src/mod.js +18 -0
- package/script/chain-types/src/types.d.ts +70 -0
- package/script/chain-types/src/types.d.ts.map +1 -0
- package/script/chain-types/src/types.js +2 -0
- package/script/concise/src/batcher.d.ts +40 -0
- package/script/concise/src/batcher.d.ts.map +1 -0
- package/script/concise/src/batcher.js +122 -0
- package/script/concise/src/delegate.d.ts +18 -0
- package/script/concise/src/delegate.d.ts.map +1 -0
- package/script/concise/src/delegate.js +123 -0
- package/script/concise/src/mod.d.ts +5 -0
- package/script/concise/src/mod.d.ts.map +1 -0
- package/script/concise/src/mod.js +19 -0
- package/script/concise/src/v2/builtins/batcher.d.ts +27 -0
- package/script/concise/src/v2/builtins/batcher.d.ts.map +1 -0
- package/script/concise/src/v2/builtins/batcher.js +54 -0
- package/script/concise/src/v2/builtins/grammar.d.ts +25 -0
- package/script/concise/src/v2/builtins/grammar.d.ts.map +1 -0
- package/script/concise/src/v2/builtins/grammar.js +43 -0
- package/script/concise/src/v2/builtins/index.d.ts +3 -0
- package/script/concise/src/v2/builtins/index.d.ts.map +1 -0
- package/script/concise/src/v2/builtins/index.js +19 -0
- package/script/concise/src/v2/grammar.d.ts +8 -0
- package/script/concise/src/v2/grammar.d.ts.map +1 -0
- package/script/concise/src/v2/grammar.js +24 -0
- package/script/concise/src/v2/inputs.d.ts +7 -0
- package/script/concise/src/v2/inputs.d.ts.map +1 -0
- package/script/concise/src/v2/inputs.js +43 -0
- package/script/concise/src/v2/mod.d.ts +5 -0
- package/script/concise/src/v2/mod.d.ts.map +1 -0
- package/script/concise/src/v2/mod.js +20 -0
- package/script/concise/src/v2/types.d.ts +23 -0
- package/script/concise/src/v2/types.d.ts.map +1 -0
- package/script/concise/src/v2/types.js +2 -0
- package/script/config/src/config/builder.d.ts +33 -0
- package/script/config/src/config/builder.d.ts.map +1 -0
- package/script/config/src/config/builder.js +86 -0
- package/script/config/src/config/configCheck.d.ts +32 -0
- package/script/config/src/config/configCheck.d.ts.map +1 -0
- package/script/config/src/config/configCheck.js +70 -0
- package/script/config/src/config/context.d.ts +23 -0
- package/script/config/src/config/context.d.ts.map +1 -0
- package/script/config/src/config/context.js +31 -0
- package/script/config/src/config/mod.d.ts +7 -0
- package/script/config/src/config/mod.d.ts.map +1 -0
- package/script/config/src/config/mod.js +22 -0
- package/script/config/src/config/parts/deployedAddresses.d.ts +17 -0
- package/script/config/src/config/parts/deployedAddresses.d.ts.map +1 -0
- package/script/config/src/config/parts/deployedAddresses.js +28 -0
- package/script/config/src/config/parts/network.d.ts +19 -0
- package/script/config/src/config/parts/network.d.ts.map +1 -0
- package/script/config/src/config/parts/network.js +33 -0
- package/script/config/src/config/parts/primitive.d.ts +31 -0
- package/script/config/src/config/parts/primitive.d.ts.map +1 -0
- package/script/config/src/config/parts/primitive.js +32 -0
- package/script/config/src/config/parts/securityNamespace.d.ts +14 -0
- package/script/config/src/config/parts/securityNamespace.d.ts.map +1 -0
- package/script/config/src/config/parts/securityNamespace.js +30 -0
- package/script/config/src/config/parts/syncProtocols.d.ts +43 -0
- package/script/config/src/config/parts/syncProtocols.d.ts.map +1 -0
- package/script/config/src/config/parts/syncProtocols.js +70 -0
- package/script/config/src/config/utils.d.ts +40 -0
- package/script/config/src/config/utils.d.ts.map +1 -0
- package/script/config/src/config/utils.js +62 -0
- package/script/config/src/mod.d.ts +3 -0
- package/script/config/src/mod.d.ts.map +1 -0
- package/script/config/src/mod.js +18 -0
- package/script/config/src/schema/common.d.ts +26 -0
- package/script/config/src/schema/common.d.ts.map +1 -0
- package/script/config/src/schema/common.js +54 -0
- package/script/config/src/schema/mod.d.ts +7 -0
- package/script/config/src/schema/mod.d.ts.map +1 -0
- package/script/config/src/schema/mod.js +22 -0
- package/script/config/src/schema/namespace.d.ts +39 -0
- package/script/config/src/schema/namespace.d.ts.map +1 -0
- package/script/config/src/schema/namespace.js +38 -0
- package/script/config/src/schema/network/algorand.d.ts +12 -0
- package/script/config/src/schema/network/algorand.d.ts.map +1 -0
- package/script/config/src/schema/network/algorand.js +26 -0
- package/script/config/src/schema/network/all.d.ts +175 -0
- package/script/config/src/schema/network/all.d.ts.map +1 -0
- package/script/config/src/schema/network/all.js +28 -0
- package/script/config/src/schema/network/bitcoin.d.ts +19 -0
- package/script/config/src/schema/network/bitcoin.d.ts.map +1 -0
- package/script/config/src/schema/network/bitcoin.js +24 -0
- package/script/config/src/schema/network/cardano.d.ts +12 -0
- package/script/config/src/schema/network/cardano.d.ts.map +1 -0
- package/script/config/src/schema/network/cardano.js +30 -0
- package/script/config/src/schema/network/evm.d.ts +68 -0
- package/script/config/src/schema/network/evm.d.ts.map +1 -0
- package/script/config/src/schema/network/evm.js +75 -0
- package/script/config/src/schema/network/mina.d.ts +14 -0
- package/script/config/src/schema/network/mina.d.ts.map +1 -0
- package/script/config/src/schema/network/mina.js +28 -0
- package/script/config/src/schema/network/mod.d.ts +9 -0
- package/script/config/src/schema/network/mod.d.ts.map +1 -0
- package/script/config/src/schema/network/mod.js +24 -0
- package/script/config/src/schema/network/ntp.d.ts +32 -0
- package/script/config/src/schema/network/ntp.d.ts.map +1 -0
- package/script/config/src/schema/network/ntp.js +42 -0
- package/script/config/src/schema/network/substrate/avail.d.ts +14 -0
- package/script/config/src/schema/network/substrate/avail.d.ts.map +1 -0
- package/script/config/src/schema/network/substrate/avail.js +29 -0
- package/script/config/src/schema/network/substrate/common.d.ts +18 -0
- package/script/config/src/schema/network/substrate/common.d.ts.map +1 -0
- package/script/config/src/schema/network/substrate/common.js +35 -0
- package/script/config/src/schema/network/substrate/midnight.d.ts +20 -0
- package/script/config/src/schema/network/substrate/midnight.d.ts.map +1 -0
- package/script/config/src/schema/network/substrate/midnight.js +35 -0
- package/script/config/src/schema/network/substrate/mod.d.ts +4 -0
- package/script/config/src/schema/network/substrate/mod.d.ts.map +1 -0
- package/script/config/src/schema/network/substrate/mod.js +19 -0
- package/script/config/src/schema/network/types.d.ts +13 -0
- package/script/config/src/schema/network/types.d.ts.map +1 -0
- package/script/config/src/schema/network/types.js +16 -0
- package/script/config/src/schema/network/utils.d.ts +5 -0
- package/script/config/src/schema/network/utils.d.ts.map +1 -0
- package/script/config/src/schema/network/utils.js +76 -0
- package/script/config/src/schema/primitive/mod.d.ts +2 -0
- package/script/config/src/schema/primitive/mod.d.ts.map +1 -0
- package/script/config/src/schema/primitive/mod.js +17 -0
- package/script/config/src/schema/primitive/types.d.ts +58 -0
- package/script/config/src/schema/primitive/types.d.ts.map +1 -0
- package/script/config/src/schema/primitive/types.js +2 -0
- package/script/config/src/schema/sync-protocols/all.d.ts +583 -0
- package/script/config/src/schema/sync-protocols/all.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/all.js +62 -0
- package/script/config/src/schema/sync-protocols/avail/rpc.d.ts +76 -0
- package/script/config/src/schema/sync-protocols/avail/rpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/avail/rpc.js +59 -0
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +76 -0
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.js +50 -0
- package/script/config/src/schema/sync-protocols/cardano/carp.d.ts +80 -0
- package/script/config/src/schema/sync-protocols/cardano/carp.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/cardano/carp.js +65 -0
- package/script/config/src/schema/sync-protocols/cardano/mod.d.ts +2 -0
- package/script/config/src/schema/sync-protocols/cardano/mod.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/cardano/mod.js +17 -0
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +56 -0
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.js +59 -0
- package/script/config/src/schema/sync-protocols/common.d.ts +60 -0
- package/script/config/src/schema/sync-protocols/common.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/common.js +61 -0
- package/script/config/src/schema/sync-protocols/decorators/all.d.ts +17 -0
- package/script/config/src/schema/sync-protocols/decorators/all.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/decorators/all.js +12 -0
- package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts +8 -0
- package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/decorators/emulated.js +15 -0
- package/script/config/src/schema/sync-protocols/decorators/mod.d.ts +4 -0
- package/script/config/src/schema/sync-protocols/decorators/mod.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/decorators/mod.js +19 -0
- package/script/config/src/schema/sync-protocols/decorators/types.d.ts +4 -0
- package/script/config/src/schema/sync-protocols/decorators/types.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/decorators/types.js +7 -0
- package/script/config/src/schema/sync-protocols/evm/rpc.d.ts +68 -0
- package/script/config/src/schema/sync-protocols/evm/rpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/evm/rpc.js +47 -0
- package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts +66 -0
- package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/midnight/graphql.js +53 -0
- package/script/config/src/schema/sync-protocols/mina/graphql.d.ts +73 -0
- package/script/config/src/schema/sync-protocols/mina/graphql.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/mina/graphql.js +62 -0
- package/script/config/src/schema/sync-protocols/mod.d.ts +10 -0
- package/script/config/src/schema/sync-protocols/mod.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/mod.js +25 -0
- package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts +45 -0
- package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/ntp/rpc.js +36 -0
- package/script/config/src/schema/sync-protocols/types.d.ts +125 -0
- package/script/config/src/schema/sync-protocols/types.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/types.js +25 -0
- package/script/config/src/schema/utils.d.ts +53 -0
- package/script/config/src/schema/utils.d.ts.map +1 -0
- package/script/config/src/schema/utils.js +62 -0
- package/script/events/src/app-events.d.ts +65 -0
- package/script/events/src/app-events.d.ts.map +1 -0
- package/script/events/src/app-events.js +62 -0
- package/script/events/src/asyncapi.d.ts +1173 -0
- package/script/events/src/asyncapi.d.ts.map +1 -0
- package/script/events/src/asyncapi.js +8 -0
- package/script/events/src/builtin-event-utils.d.ts +5 -0
- package/script/events/src/builtin-event-utils.d.ts.map +1 -0
- package/script/events/src/builtin-event-utils.js +63 -0
- package/script/events/src/builtin-events.d.ts +106 -0
- package/script/events/src/builtin-events.d.ts.map +1 -0
- package/script/events/src/builtin-events.js +204 -0
- package/script/events/src/event-connect.d.ts +15 -0
- package/script/events/src/event-connect.d.ts.map +1 -0
- package/script/events/src/event-connect.js +82 -0
- package/script/events/src/event-manager.d.ts +54 -0
- package/script/events/src/event-manager.d.ts.map +1 -0
- package/script/events/src/event-manager.js +133 -0
- package/script/events/src/evm.d.ts +6 -0
- package/script/events/src/evm.d.ts.map +1 -0
- package/script/events/src/evm.js +59 -0
- package/script/events/src/mod.d.ts +10 -0
- package/script/events/src/mod.d.ts.map +1 -0
- package/script/events/src/mod.js +25 -0
- package/script/events/src/types.d.ts +255 -0
- package/script/events/src/types.d.ts.map +1 -0
- package/script/events/src/types.js +111 -0
- package/script/events/src/utils.d.ts +16 -0
- package/script/events/src/utils.d.ts.map +1 -0
- package/script/events/src/utils.js +98 -0
- package/script/package.json +3 -0
- package/script/utils/src/binary-search.d.ts +7 -0
- package/script/utils/src/binary-search.d.ts.map +1 -0
- package/script/utils/src/binary-search.js +41 -0
- package/script/utils/src/captcha.d.ts +9 -0
- package/script/utils/src/captcha.d.ts.map +1 -0
- package/script/utils/src/captcha.js +22 -0
- package/script/utils/src/concurrency/condVar.d.ts +25 -0
- package/script/utils/src/concurrency/condVar.d.ts.map +1 -0
- package/script/utils/src/concurrency/condVar.js +42 -0
- package/script/utils/src/concurrency/latch.d.ts +25 -0
- package/script/utils/src/concurrency/latch.d.ts.map +1 -0
- package/script/utils/src/concurrency/latch.js +54 -0
- package/script/utils/src/concurrency/mod.d.ts +5 -0
- package/script/utils/src/concurrency/mod.d.ts.map +1 -0
- package/script/utils/src/concurrency/mod.js +20 -0
- package/script/utils/src/concurrency/retry.d.ts +14 -0
- package/script/utils/src/concurrency/retry.d.ts.map +1 -0
- package/script/utils/src/concurrency/retry.js +30 -0
- package/script/utils/src/concurrency/utils.d.ts +27 -0
- package/script/utils/src/concurrency/utils.d.ts.map +1 -0
- package/script/utils/src/concurrency/utils.js +30 -0
- package/script/utils/src/constants.d.ts +4 -0
- package/script/utils/src/constants.d.ts.map +1 -0
- package/script/utils/src/constants.js +12 -0
- package/script/utils/src/decorators/bound.d.ts +10 -0
- package/script/utils/src/decorators/bound.d.ts.map +1 -0
- package/script/utils/src/decorators/bound.js +20 -0
- package/script/utils/src/decorators/mod.d.ts +2 -0
- package/script/utils/src/decorators/mod.d.ts.map +1 -0
- package/script/utils/src/decorators/mod.js +17 -0
- package/script/utils/src/mod.d.ts +8 -0
- package/script/utils/src/mod.d.ts.map +1 -0
- package/script/utils/src/mod.js +23 -0
- package/script/utils/src/types/json-query.d.ts +30 -0
- package/script/utils/src/types/json-query.d.ts.map +1 -0
- package/script/utils/src/types/json-query.js +2 -0
- package/script/utils/src/types/misc.d.ts +109 -0
- package/script/utils/src/types/misc.d.ts.map +1 -0
- package/script/utils/src/types/misc.js +3 -0
- package/script/utils/src/types/mod.d.ts +7 -0
- package/script/utils/src/types/mod.d.ts.map +1 -0
- package/script/utils/src/types/mod.js +19 -0
- package/script/utils/src/types/nominal.d.ts +87 -0
- package/script/utils/src/types/nominal.d.ts.map +1 -0
- package/script/utils/src/types/nominal.js +2 -0
- package/script/utils/src/types/typebox-helpers.d.ts +183 -0
- package/script/utils/src/types/typebox-helpers.d.ts.map +1 -0
- package/script/utils/src/types/typebox-helpers.js +277 -0
- package/script/utils/src/types/utils.d.ts +37 -0
- package/script/utils/src/types/utils.d.ts.map +1 -0
- package/script/utils/src/types/utils.js +52 -0
- package/script/utils/src/types/validators/algorand.d.ts +31 -0
- package/script/utils/src/types/validators/algorand.d.ts.map +1 -0
- package/script/utils/src/types/validators/algorand.js +98 -0
- package/script/utils/src/types/validators/cardano.d.ts +26 -0
- package/script/utils/src/types/validators/cardano.d.ts.map +1 -0
- package/script/utils/src/types/validators/cardano.js +121 -0
- package/script/utils/src/types/validators/mina.d.ts +15 -0
- package/script/utils/src/types/validators/mina.d.ts.map +1 -0
- package/script/utils/src/types/validators/mina.js +51 -0
- package/script/utils/src/types/validators/minicbor.d.ts +98 -0
- package/script/utils/src/types/validators/minicbor.d.ts.map +1 -0
- package/script/utils/src/types/validators/minicbor.js +337 -0
- package/script/utils/src/types/validators/mod.d.ts +3 -0
- package/script/utils/src/types/validators/mod.d.ts.map +1 -0
- package/script/utils/src/types/validators/mod.js +18 -0
- package/script/utils/src/types/validators/utils.d.ts +6 -0
- package/script/utils/src/types/validators/utils.d.ts.map +1 -0
- package/script/utils/src/types/validators/utils.js +31 -0
- package/script/utils/src/viem.d.ts +6 -0
- package/script/utils/src/viem.d.ts.map +1 -0
- package/script/utils/src/viem.js +19 -0
- package/script/wallets/src/IProvider.d.ts +48 -0
- package/script/wallets/src/IProvider.d.ts.map +1 -0
- package/script/wallets/src/IProvider.js +10 -0
- package/script/wallets/src/avail/avail.d.ts +28 -0
- package/script/wallets/src/avail/avail.d.ts.map +1 -0
- package/script/wallets/src/avail/avail.js +70 -0
- package/script/wallets/src/avail/wrapper.d.ts +6 -0
- package/script/wallets/src/avail/wrapper.d.ts.map +1 -0
- package/script/wallets/src/avail/wrapper.js +34 -0
- package/script/wallets/src/cardano/cardano.d.ts +30 -0
- package/script/wallets/src/cardano/cardano.d.ts.map +1 -0
- package/script/wallets/src/cardano/cardano.js +163 -0
- package/script/wallets/src/cardano/wrapper.d.ts +7 -0
- package/script/wallets/src/cardano/wrapper.d.ts.map +1 -0
- package/script/wallets/src/cardano/wrapper.js +26 -0
- package/script/wallets/src/evm/ethers.d.ts +28 -0
- package/script/wallets/src/evm/ethers.d.ts.map +1 -0
- package/script/wallets/src/evm/ethers.js +84 -0
- package/script/wallets/src/evm/injected.d.ts +74 -0
- package/script/wallets/src/evm/injected.d.ts.map +1 -0
- package/script/wallets/src/evm/injected.js +360 -0
- package/script/wallets/src/evm/types.d.ts +3 -0
- package/script/wallets/src/evm/types.d.ts.map +1 -0
- package/script/wallets/src/evm/types.js +4 -0
- package/script/wallets/src/evm/wrapper-ethers.d.ts +6 -0
- package/script/wallets/src/evm/wrapper-ethers.d.ts.map +1 -0
- package/script/wallets/src/evm/wrapper-ethers.js +41 -0
- package/script/wallets/src/evm/wrapper-injected.d.ts +7 -0
- package/script/wallets/src/evm/wrapper-injected.d.ts.map +1 -0
- package/script/wallets/src/evm/wrapper-injected.js +84 -0
- package/script/wallets/src/midnight/midnight.d.ts +26 -0
- package/script/wallets/src/midnight/midnight.d.ts.map +1 -0
- package/script/wallets/src/midnight/midnight.js +117 -0
- package/script/wallets/src/midnight/wrapper.d.ts +7 -0
- package/script/wallets/src/midnight/wrapper.d.ts.map +1 -0
- package/script/wallets/src/midnight/wrapper.js +26 -0
- package/script/wallets/src/mina/mina.d.ts +28 -0
- package/script/wallets/src/mina/mina.d.ts.map +1 -0
- package/script/wallets/src/mina/mina.js +138 -0
- package/script/wallets/src/mina/wrapper.d.ts +6 -0
- package/script/wallets/src/mina/wrapper.d.ts.map +1 -0
- package/script/wallets/src/mina/wrapper.js +15 -0
- package/script/wallets/src/mod.d.ts +8 -0
- package/script/wallets/src/mod.d.ts.map +1 -0
- package/script/wallets/src/mod.js +26 -0
- package/script/wallets/src/paima.d.ts +104 -0
- package/script/wallets/src/paima.d.ts.map +1 -0
- package/script/wallets/src/paima.js +253 -0
- package/script/wallets/src/types.d.ts +49 -0
- package/script/wallets/src/types.d.ts.map +1 -0
- package/script/wallets/src/types.js +2 -0
- package/script/wallets/src/utils.d.ts +41 -0
- package/script/wallets/src/utils.d.ts.map +1 -0
- package/script/wallets/src/utils.js +81 -0
- package/script/wallets/src/wallet-modes.d.ts +49 -0
- package/script/wallets/src/wallet-modes.d.ts.map +1 -0
- package/script/wallets/src/wallet-modes.js +29 -0
- package/script/wallets/src/wallets.d.ts +5 -0
- package/script/wallets/src/wallets.d.ts.map +1 -0
- package/script/wallets/src/wallets.js +58 -0
- package/script/wallets/src/windows.d.ts +5 -0
- package/script/wallets/src/windows.d.ts.map +1 -0
- package/script/wallets/src/windows.js +12 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fillPath = fillPath;
|
|
4
|
+
exports.toPattern = toPattern;
|
|
5
|
+
exports.keysForPath = keysForPath;
|
|
6
|
+
/**
|
|
7
|
+
* Creates an MQTT path filling in specified variables in the path
|
|
8
|
+
* @param path the base MQTT path to use
|
|
9
|
+
* @param args the args to fill the path.
|
|
10
|
+
* - `undefined` (explicitly or omitted) variables will be treated as `+`
|
|
11
|
+
* - if all trailing variables are `undefined`, it will be replaced by `#`
|
|
12
|
+
*/
|
|
13
|
+
function fillPath(path, args) {
|
|
14
|
+
const keys = new Set(Object.keys(args));
|
|
15
|
+
const possibleArgs = path
|
|
16
|
+
.map((p, index) => [p, index])
|
|
17
|
+
.filter(([p, _]) => typeof p === 'object')
|
|
18
|
+
.map(([_, index]) => index);
|
|
19
|
+
const filledArgsLeft = path
|
|
20
|
+
.map((p, index) => [p, index])
|
|
21
|
+
.filter(([p, _]) => typeof p === 'object' && keys.has(p.name))
|
|
22
|
+
.map(([_, index]) => index)
|
|
23
|
+
.reverse(); // reverse as pop() is more efficient than removing from the start of the array
|
|
24
|
+
let filledPath = [];
|
|
25
|
+
const addLastArg = (i) => {
|
|
26
|
+
if (i === path.length - 1) {
|
|
27
|
+
// if it's the last entry, + and # mean the same thing
|
|
28
|
+
// so we just pick +
|
|
29
|
+
filledPath.push('+');
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
filledPath.push('#');
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
for (let i = 0; i < path.length; i++) {
|
|
36
|
+
const entry = path[i];
|
|
37
|
+
// if we've exhausted all args provided by the user
|
|
38
|
+
// but there are still args we expect later in the path
|
|
39
|
+
// ex:
|
|
40
|
+
// 1: a/{foo}/b/{bar}, user provides just `foo` and we've already processed it
|
|
41
|
+
// 2: a/{foo}, user provided nothing
|
|
42
|
+
if (filledArgsLeft.length === 0 &&
|
|
43
|
+
possibleArgs.length > 0 &&
|
|
44
|
+
i < possibleArgs[possibleArgs.length - 1]) {
|
|
45
|
+
// if we've reached at least the first argument
|
|
46
|
+
// ex: a/{foo}, we should use `a/+` instead of just `#`
|
|
47
|
+
if (i >= possibleArgs[0]) {
|
|
48
|
+
addLastArg(i);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// 1) handle regular string types
|
|
53
|
+
{
|
|
54
|
+
if (typeof entry === 'string') {
|
|
55
|
+
filledPath.push(path[i]);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// 2) handle arg types
|
|
60
|
+
{
|
|
61
|
+
// handle types left undefined despite future args being specified
|
|
62
|
+
if (args[entry.name] === undefined) {
|
|
63
|
+
filledPath.push('+');
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// handle types explicitly provided
|
|
67
|
+
filledPath.push(args[entry.name]);
|
|
68
|
+
}
|
|
69
|
+
// if we've reached the next arg the user provided a filling for
|
|
70
|
+
if (filledArgsLeft.length > 0 && i === filledArgsLeft[filledArgsLeft.length - 1]) {
|
|
71
|
+
filledArgsLeft.pop();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return filledPath.join('/');
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Convert our internal definition of an event path to an mqtt-pattern compatible path
|
|
79
|
+
* This is useful to later deconstruct topics for pattern matching
|
|
80
|
+
*/
|
|
81
|
+
function toPattern(path) {
|
|
82
|
+
let result = '';
|
|
83
|
+
for (let i = 0; i < path.length; i++) {
|
|
84
|
+
const entry = path[i];
|
|
85
|
+
if (i > 0)
|
|
86
|
+
result += '/'; // fencepost problem
|
|
87
|
+
if (typeof entry === 'string') {
|
|
88
|
+
result += entry;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
result += `+${entry.name}`;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
function keysForPath(path) {
|
|
97
|
+
return path.filter(p => typeof p !== 'string').map(p => p.name);
|
|
98
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the left-most entry index in an array satisfying the condition
|
|
3
|
+
*
|
|
4
|
+
* ex: binarySearch([6,7,7,8], 7, val => val) return `1`
|
|
5
|
+
*/
|
|
6
|
+
export declare function binarySearch<T>(arr: T[], target: number, toNum: (val: T) => number): number | undefined;
|
|
7
|
+
//# sourceMappingURL=binary-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../../../src/utils/src/binary-search.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,GAAG,EAAE,CAAC,EAAE,EACR,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GACxB,MAAM,GAAG,SAAS,CAmCpB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.binarySearch = binarySearch;
|
|
4
|
+
/**
|
|
5
|
+
* Find the left-most entry index in an array satisfying the condition
|
|
6
|
+
*
|
|
7
|
+
* ex: binarySearch([6,7,7,8], 7, val => val) return `1`
|
|
8
|
+
*/
|
|
9
|
+
function binarySearch(arr, target, toNum) {
|
|
10
|
+
let low = 0;
|
|
11
|
+
let high = arr.length - 1;
|
|
12
|
+
let result = undefined; // This will hold the index of the smallest value >= target, if it exists
|
|
13
|
+
if (arr.length === 0) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
// if the target is smaller than all entries, just return right away
|
|
17
|
+
if (target - toNum(arr[0]) <= 0) {
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
// if the target is bigger than all entries, just return right away
|
|
21
|
+
if (target - toNum(arr[arr.length - 1]) > 0) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
// first: find the largest index where the value is smaller than the target
|
|
25
|
+
while (low < high) {
|
|
26
|
+
const mid = low + Math.floor((high - low) / 2);
|
|
27
|
+
const val = target - toNum(arr[mid]);
|
|
28
|
+
if (val <= 0) {
|
|
29
|
+
high = mid;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
result = mid;
|
|
33
|
+
low = mid + 1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// sanity check: should never happen
|
|
37
|
+
if (result == null) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return result + 1;
|
|
41
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This method will dynamically add:
|
|
3
|
+
* <script src="https://www.google.com/recaptcha/api.js?render=YOUR_SITE_KEY"></script>
|
|
4
|
+
*
|
|
5
|
+
* You can manually add this script to your HTML,
|
|
6
|
+
* this method is just a helper to do it programmatically.
|
|
7
|
+
*/
|
|
8
|
+
export declare function injectReCaptchaToHTML(document: any, reCAPTCHA_site_key: string): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=captcha.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captcha.d.ts","sourceRoot":"","sources":["../../../src/utils/src/captcha.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// <reference lib="dom" />
|
|
3
|
+
// error[banned-triple-slash-directives]: triple slash directives that modify globals are not allowed
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.injectReCaptchaToHTML = injectReCaptchaToHTML;
|
|
6
|
+
/**
|
|
7
|
+
* This method will dynamically add:
|
|
8
|
+
* <script src="https://www.google.com/recaptcha/api.js?render=YOUR_SITE_KEY"></script>
|
|
9
|
+
*
|
|
10
|
+
* You can manually add this script to your HTML,
|
|
11
|
+
* this method is just a helper to do it programmatically.
|
|
12
|
+
*/
|
|
13
|
+
async function injectReCaptchaToHTML(document, reCAPTCHA_site_key) {
|
|
14
|
+
const url = `https://www.google.com/recaptcha/api.js?render=${reCAPTCHA_site_key}`;
|
|
15
|
+
return await new Promise((resolve, reject) => {
|
|
16
|
+
const el = document.createElement("script");
|
|
17
|
+
el.src = url;
|
|
18
|
+
el.addEventListener("load", () => resolve());
|
|
19
|
+
el.addEventListener("error", () => reject());
|
|
20
|
+
document.body.append(el);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Operation } from "effection";
|
|
2
|
+
export type CondVar<T> = {
|
|
3
|
+
wait: () => Operation<T>;
|
|
4
|
+
wake: (val: T) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Allows blocking execution until a specific wake is called
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```javascript
|
|
11
|
+
* const { wait, wake } = conditionVariable<void>();
|
|
12
|
+
* yield* spawn(function*() {
|
|
13
|
+
* console.log('start wait');
|
|
14
|
+
* yield* wait();
|
|
15
|
+
* console.log('done wait');
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* yield* sleep(1000);
|
|
19
|
+
* wait(); // allows the spawn to continue executing
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* See [Condition variables](https://en.wikipedia.org/wiki/Monitor_%28synchronization%29#Condition_variables) for more information
|
|
23
|
+
*/
|
|
24
|
+
export declare function conditionVariable<T>(): CondVar<T>;
|
|
25
|
+
//# sourceMappingURL=condVar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condVar.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/concurrency/condVar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAwB,MAAM,WAAW,CAAC;AAGjE,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IACvB,IAAI,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC;IACzB,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAyBjD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.conditionVariable = conditionVariable;
|
|
4
|
+
const effection_1 = require("effection");
|
|
5
|
+
/**
|
|
6
|
+
* Allows blocking execution until a specific wake is called
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```javascript
|
|
10
|
+
* const { wait, wake } = conditionVariable<void>();
|
|
11
|
+
* yield* spawn(function*() {
|
|
12
|
+
* console.log('start wait');
|
|
13
|
+
* yield* wait();
|
|
14
|
+
* console.log('done wait');
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* yield* sleep(1000);
|
|
18
|
+
* wait(); // allows the spawn to continue executing
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* See [Condition variables](https://en.wikipedia.org/wiki/Monitor_%28synchronization%29#Condition_variables) for more information
|
|
22
|
+
*/
|
|
23
|
+
function conditionVariable() {
|
|
24
|
+
let continuations = [];
|
|
25
|
+
const wait = function* () {
|
|
26
|
+
const scope = yield* (0, effection_1.useScope)();
|
|
27
|
+
return yield* (0, effection_1.action)(function* (resolve, _reject) {
|
|
28
|
+
continuations.push({ resolve, scope });
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const wake = (val) => {
|
|
32
|
+
const oldVal = continuations;
|
|
33
|
+
continuations = [];
|
|
34
|
+
for (const continuation of oldVal) {
|
|
35
|
+
// note: we explicitly do not await here
|
|
36
|
+
void continuation.scope.run(function* () {
|
|
37
|
+
continuation.resolve(val);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return { wait, wake };
|
|
42
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Operation } from "effection";
|
|
2
|
+
/**
|
|
3
|
+
* Allow blocking execution until counted down N times
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```javascript
|
|
7
|
+
* const { wait, countDown } = countdownLatch(2);
|
|
8
|
+
* yield* spawn(function* () {
|
|
9
|
+
* yield* wait();
|
|
10
|
+
* console.log("done");
|
|
11
|
+
* });
|
|
12
|
+
*
|
|
13
|
+
* yield* sleep(1000);
|
|
14
|
+
* countDown();
|
|
15
|
+
* yield* sleep(1000);
|
|
16
|
+
* countDown();
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* See [Barrier](https://en.wikipedia.org/wiki/Barrier_%28computer_science%29) for more information
|
|
20
|
+
*/
|
|
21
|
+
export declare function countdownLatch<T>(count: number): {
|
|
22
|
+
wait: (timeout?: number) => Operation<void>;
|
|
23
|
+
countDown: () => void;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=latch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latch.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/concurrency/latch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,KAAK,EAAE,MAAM,GACZ;IACD,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5C,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CAgCA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.countdownLatch = countdownLatch;
|
|
4
|
+
const effection_1 = require("effection");
|
|
5
|
+
const condVar_js_1 = require("./condVar.js");
|
|
6
|
+
/**
|
|
7
|
+
* Allow blocking execution until counted down N times
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```javascript
|
|
11
|
+
* const { wait, countDown } = countdownLatch(2);
|
|
12
|
+
* yield* spawn(function* () {
|
|
13
|
+
* yield* wait();
|
|
14
|
+
* console.log("done");
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* yield* sleep(1000);
|
|
18
|
+
* countDown();
|
|
19
|
+
* yield* sleep(1000);
|
|
20
|
+
* countDown();
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* See [Barrier](https://en.wikipedia.org/wiki/Barrier_%28computer_science%29) for more information
|
|
24
|
+
*/
|
|
25
|
+
function countdownLatch(count) {
|
|
26
|
+
const vars = new Array(count).fill(null).map(() => (0, condVar_js_1.conditionVariable)());
|
|
27
|
+
let currIndex = 0;
|
|
28
|
+
const wait = (timeout) => (0, effection_1.action)(function* (resolve, reject) {
|
|
29
|
+
// note: start at `currIndex` and not 0
|
|
30
|
+
// this is to support waiting on latches that have already started
|
|
31
|
+
const waitAll = yield* (0, effection_1.spawn)(function* () {
|
|
32
|
+
for (let i = currIndex; i < count; i++) {
|
|
33
|
+
yield* vars[i].wait();
|
|
34
|
+
}
|
|
35
|
+
resolve();
|
|
36
|
+
});
|
|
37
|
+
if (timeout == null)
|
|
38
|
+
return yield* waitAll;
|
|
39
|
+
const rejectOnTimeout = yield* (0, effection_1.spawn)(function* () {
|
|
40
|
+
yield* (0, effection_1.sleep)(timeout);
|
|
41
|
+
reject(new Error("timeout"));
|
|
42
|
+
});
|
|
43
|
+
yield* (0, effection_1.race)([waitAll, rejectOnTimeout]);
|
|
44
|
+
});
|
|
45
|
+
const countDown = () => {
|
|
46
|
+
if (currIndex >= count) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const oldValue = currIndex;
|
|
50
|
+
currIndex++;
|
|
51
|
+
vars[oldValue].wake();
|
|
52
|
+
};
|
|
53
|
+
return { wait, countDown };
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/concurrency/mod.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./condVar.js"), exports);
|
|
18
|
+
__exportStar(require("./latch.js"), exports);
|
|
19
|
+
__exportStar(require("./retry.js"), exports);
|
|
20
|
+
__exportStar(require("./utils.js"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Operation } from "effection";
|
|
2
|
+
export declare function retry<Success, Failure = Success>(fn: () => Operation<Success | Failure>, isSuccess: (result: Success | Failure) => boolean, onRetry?: (failResult: Failure) => Operation<void>, maxAttempts?: number): Operation<Success>;
|
|
3
|
+
type Success<T> = {
|
|
4
|
+
data: T;
|
|
5
|
+
error: null;
|
|
6
|
+
};
|
|
7
|
+
type Failure<E> = {
|
|
8
|
+
data: null;
|
|
9
|
+
error: E;
|
|
10
|
+
};
|
|
11
|
+
type Result<T, E = Error> = Success<T> | Failure<E>;
|
|
12
|
+
export declare function tryYield<T, E = Error>(promise: Operation<T>): Operation<Result<T, E>>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/concurrency/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,wBAAiB,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAC/C,EAAE,EAAE,MAAM,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC,EACtC,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,KAAK,OAAO,EACjD,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,SAAS,CAAC,IAAI,CAAC,EAClD,WAAW,CAAC,EAAE,MAAM,GACnB,SAAS,CAAC,OAAO,CAAC,CAQpB;AA6BD,KAAK,OAAO,CAAC,CAAC,IAAI;IAChB,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,KAAK,OAAO,CAAC,CAAC,IAAI;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAGpD,wBAAiB,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,EACpC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,GACpB,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAOzB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.retry = retry;
|
|
4
|
+
exports.tryYield = tryYield;
|
|
5
|
+
function* retry(fn, isSuccess, onRetry, maxAttempts) {
|
|
6
|
+
return yield* retryInternal(fn, isSuccess, 0, onRetry, maxAttempts);
|
|
7
|
+
}
|
|
8
|
+
function* retryInternal(fn, isSuccess, currAttempt, onRetry, maxAttempts) {
|
|
9
|
+
const result = yield* fn();
|
|
10
|
+
if (isSuccess(result)) {
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
if (onRetry != null) {
|
|
14
|
+
yield* onRetry(result);
|
|
15
|
+
}
|
|
16
|
+
if (maxAttempts == null || currAttempt !== maxAttempts) {
|
|
17
|
+
return yield* retryInternal(fn, isSuccess, currAttempt + 1, onRetry, maxAttempts);
|
|
18
|
+
}
|
|
19
|
+
throw new Error("Max attempts reached");
|
|
20
|
+
}
|
|
21
|
+
// Main wrapper function
|
|
22
|
+
function* tryYield(promise) {
|
|
23
|
+
try {
|
|
24
|
+
const data = yield* promise;
|
|
25
|
+
return { data, error: null };
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
return { data: null, error: error };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Operation } from "effection";
|
|
2
|
+
/**
|
|
3
|
+
* Equivalent of Promise.then
|
|
4
|
+
*/
|
|
5
|
+
export declare function then<A, B>(operation: Operation<A>, fn: (value: A) => Operation<B>): Operation<B>;
|
|
6
|
+
/**
|
|
7
|
+
* TODO: this is a better `then` since it's much easier to chain
|
|
8
|
+
* @example
|
|
9
|
+
export function then<A, B>(
|
|
10
|
+
fn: (value: A) => Operation<B>,
|
|
11
|
+
): (operation: Operation<A>) => Operation<B> {
|
|
12
|
+
return function* (operation) {
|
|
13
|
+
return yield* fn(yield* operation);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
* but the problem is that it relies on a `pipe` function
|
|
17
|
+
* that is only available in effection v4
|
|
18
|
+
* end-goal: api looks like this
|
|
19
|
+
* @example
|
|
20
|
+
pipe(
|
|
21
|
+
operation,
|
|
22
|
+
then(lift((val) => val * 2)),
|
|
23
|
+
then(lift((val) => String(val)),
|
|
24
|
+
then(lift((val) => val.toUpperCase())),
|
|
25
|
+
)
|
|
26
|
+
*/
|
|
27
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/concurrency/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,wBAAiB,IAAI,CAAC,CAAC,EAAE,CAAC,EACxB,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,GAC7B,SAAS,CAAC,CAAC,CAAC,CAEd;AAED;;;;;;;;;;;;;;;;;;;;EAoBE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.then = then;
|
|
4
|
+
/**
|
|
5
|
+
* Equivalent of Promise.then
|
|
6
|
+
*/
|
|
7
|
+
function* then(operation, fn) {
|
|
8
|
+
return yield* fn(yield* operation);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* TODO: this is a better `then` since it's much easier to chain
|
|
12
|
+
* @example
|
|
13
|
+
export function then<A, B>(
|
|
14
|
+
fn: (value: A) => Operation<B>,
|
|
15
|
+
): (operation: Operation<A>) => Operation<B> {
|
|
16
|
+
return function* (operation) {
|
|
17
|
+
return yield* fn(yield* operation);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
* but the problem is that it relies on a `pipe` function
|
|
21
|
+
* that is only available in effection v4
|
|
22
|
+
* end-goal: api looks like this
|
|
23
|
+
* @example
|
|
24
|
+
pipe(
|
|
25
|
+
operation,
|
|
26
|
+
then(lift((val) => val * 2)),
|
|
27
|
+
then(lift((val) => String(val)),
|
|
28
|
+
then(lift((val) => val.toUpperCase())),
|
|
29
|
+
)
|
|
30
|
+
*/
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const DYNAMIC_PRIMITIVE_NAME_SEPARATOR = "##";
|
|
2
|
+
export declare function generateDynamicPrimitivePrefix(parentName: string): string;
|
|
3
|
+
export declare function generateDynamicPrimitiveName(parentName: string, id: number): string;
|
|
4
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC,OAAO,CAAC;AACrD,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzE;AACD,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,GACT,MAAM,CAER"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DYNAMIC_PRIMITIVE_NAME_SEPARATOR = void 0;
|
|
4
|
+
exports.generateDynamicPrimitivePrefix = generateDynamicPrimitivePrefix;
|
|
5
|
+
exports.generateDynamicPrimitiveName = generateDynamicPrimitiveName;
|
|
6
|
+
exports.DYNAMIC_PRIMITIVE_NAME_SEPARATOR = "##";
|
|
7
|
+
function generateDynamicPrimitivePrefix(parentName) {
|
|
8
|
+
return `${parentName}${exports.DYNAMIC_PRIMITIVE_NAME_SEPARATOR}`;
|
|
9
|
+
}
|
|
10
|
+
function generateDynamicPrimitiveName(parentName, id) {
|
|
11
|
+
return `${generateDynamicPrimitivePrefix(parentName)}${id}`;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avoids member functions having the wrong `this` value when passed as a function pointer.\
|
|
3
|
+
* AKA shortcut for `this.func.bind(this)`
|
|
4
|
+
*
|
|
5
|
+
* Taken form https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html
|
|
6
|
+
*
|
|
7
|
+
* Careful: this can cause a segmentation fault on Deno (https://github.com/denoland/deno/issues/25192)
|
|
8
|
+
*/
|
|
9
|
+
export declare function bound(_originalMethod: any, context: ClassMethodDecoratorContext<Record<string | symbol, any>>): void;
|
|
10
|
+
//# sourceMappingURL=bound.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bound.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/decorators/bound.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,KAAK,CACnB,eAAe,EAAE,GAAG,EACpB,OAAO,EAAE,2BAA2B,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,QAWnE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bound = bound;
|
|
4
|
+
/**
|
|
5
|
+
* Avoids member functions having the wrong `this` value when passed as a function pointer.\
|
|
6
|
+
* AKA shortcut for `this.func.bind(this)`
|
|
7
|
+
*
|
|
8
|
+
* Taken form https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html
|
|
9
|
+
*
|
|
10
|
+
* Careful: this can cause a segmentation fault on Deno (https://github.com/denoland/deno/issues/25192)
|
|
11
|
+
*/
|
|
12
|
+
function bound(_originalMethod, context) {
|
|
13
|
+
const methodName = context.name;
|
|
14
|
+
if (context.private) {
|
|
15
|
+
throw new Error(`'bound' cannot decorate private properties like ${methodName}.`);
|
|
16
|
+
}
|
|
17
|
+
context.addInitializer(function () {
|
|
18
|
+
this[methodName] = this[methodName].bind(this);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/decorators/mod.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./bound.js"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./types/mod.js";
|
|
2
|
+
export * from "./constants.js";
|
|
3
|
+
export * from "./viem.js";
|
|
4
|
+
export * from "./captcha.js";
|
|
5
|
+
export * from "./binary-search.js";
|
|
6
|
+
export * from "./concurrency/mod.js";
|
|
7
|
+
export * from "./decorators/mod.js";
|
|
8
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/utils/src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types/mod.js"), exports);
|
|
18
|
+
__exportStar(require("./constants.js"), exports);
|
|
19
|
+
__exportStar(require("./viem.js"), exports);
|
|
20
|
+
__exportStar(require("./captcha.js"), exports);
|
|
21
|
+
__exportStar(require("./binary-search.js"), exports);
|
|
22
|
+
__exportStar(require("./concurrency/mod.js"), exports);
|
|
23
|
+
__exportStar(require("./decorators/mod.js"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type ErrorCode = number;
|
|
2
|
+
export type ErrorMessageMapping = Record<ErrorCode, string>;
|
|
3
|
+
export type ErrorMessageFxn = (errorCode: ErrorCode) => string;
|
|
4
|
+
export interface SuccessfulResultMessage {
|
|
5
|
+
success: true;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SuccessfulResult<T> {
|
|
9
|
+
success: true;
|
|
10
|
+
result: T;
|
|
11
|
+
}
|
|
12
|
+
export interface FailedResult {
|
|
13
|
+
success: false;
|
|
14
|
+
errorMessage: string;
|
|
15
|
+
errorCode?: number;
|
|
16
|
+
}
|
|
17
|
+
export type Result<T> = SuccessfulResult<T> | FailedResult;
|
|
18
|
+
export type InternalServerErrorResult = FailedResult;
|
|
19
|
+
/** comes from the `tsoa` package, but we don't want it as a dependency just for this type */
|
|
20
|
+
export interface FieldErrors {
|
|
21
|
+
[name: string]: {
|
|
22
|
+
message: string;
|
|
23
|
+
value?: any;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface ValidateErrorResult {
|
|
27
|
+
message: "Validation Failed";
|
|
28
|
+
details?: FieldErrors;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=json-query.d.ts.map
|