From ecfa78d758a2ad1f907cf48edafcd89bc977f65d Mon Sep 17 00:00:00 2001 From: Boldizsar Mezei Date: Sun, 22 Oct 2023 10:07:19 +0200 Subject: [PATCH] Use @build5/database in functions Fixes Fixes Fixes Fixes --- .../workflows/functions_emulated-tests.yml | 39 +-- package.json | 4 +- packages/functions/package.json | 1 + packages/functions/scripts/db.upgrade.ts | 41 --- .../dbUpgrades/1.0/totalGuardiansRoll.ts | 55 ---- .../src/controls/address/address.control.ts | 2 +- .../award/award.approve.participant.ts | 2 +- .../src/controls/award/award.cancel.ts | 2 +- .../src/controls/award/award.create.ts | 2 +- .../src/controls/award/award.fund.ts | 2 +- .../src/controls/award/award.owner.ts | 2 +- .../src/controls/award/award.participate.ts | 2 +- .../src/controls/award/award.reject.ts | 2 +- .../collection/collection-mint.control.ts | 2 +- .../collection/collection.approve.control.ts | 2 +- .../collection/collection.create.control.ts | 2 +- .../collection/collection.reject.control.ts | 2 +- .../collection/collection.update.control.ts | 2 +- .../src/controls/credit/credit.controller.ts | 2 +- .../src/controls/file/file.upload.control.ts | 2 +- .../src/controls/member/member.create.ts | 2 +- .../src/controls/member/member.update.ts | 2 +- .../src/controls/nft/nft.bid.control.ts | 2 +- .../functions/src/controls/nft/nft.create.ts | 2 +- .../functions/src/controls/nft/nft.deposit.ts | 2 +- .../src/controls/nft/nft.puchase.control.ts | 2 +- .../src/controls/nft/nft.set.for.sale.ts | 2 +- .../functions/src/controls/nft/nft.stake.ts | 2 +- .../src/controls/nft/nft.update.unsold.ts | 2 +- .../src/controls/nft/nft.withdraw.ts | 2 +- .../proposal/approve.reject.proposal.ts | 2 +- .../src/controls/proposal/create.proposal.ts | 2 +- .../src/controls/proposal/vote.on.proposal.ts | 2 +- .../src/controls/rank/rank.control.ts | 2 +- .../controls/space/member.accept.control.ts | 2 +- .../controls/space/member.block.control.ts | 2 +- .../controls/space/member.decline.control.ts | 2 +- .../controls/space/member.leave.control.ts | 2 +- .../controls/space/member.unblock.control.ts | 2 +- .../src/controls/space/space.claim.control.ts | 2 +- .../controls/space/space.create.control.ts | 2 +- .../space/space.guardian.edit.control.ts | 2 +- .../src/controls/space/space.join.control.ts | 2 +- .../controls/space/space.update.control.ts | 2 +- .../src/controls/stake/stake.deposit.ts | 2 +- .../src/controls/stake/stake.reward.revoke.ts | 2 +- .../src/controls/stake/stake.reward.ts | 2 +- .../token-minting/airdrop-minted-token.ts | 2 +- .../claim-minted-token.control.ts | 2 +- .../token-minting/import-minted-token.ts | 2 +- .../token-minting/token-mint.control.ts | 2 +- .../token-trade-cancel.controller.ts | 2 +- .../token-trading/token-trade.controller.ts | 2 +- .../src/controls/token/token.airdrop.claim.ts | 2 +- .../src/controls/token/token.airdrop.ts | 2 +- .../controls/token/token.cancel.pub.sale.ts | 2 +- .../src/controls/token/token.create.ts | 2 +- .../src/controls/token/token.credit.ts | 2 +- .../controls/token/token.enable.trading.ts | 2 +- .../src/controls/token/token.order.ts | 2 +- .../src/controls/token/token.set.for.sale.ts | 2 +- .../src/controls/token/token.update.ts | 2 +- .../src/controls/vote/vote.control.ts | 2 +- packages/functions/src/cron/award.cron.ts | 2 +- packages/functions/src/cron/bitfinex.cron.ts | 2 +- .../src/cron/collection.floor.price.cron.ts | 2 +- packages/functions/src/cron/media.cron.ts | 2 +- packages/functions/src/cron/nft.cron.ts | 2 +- packages/functions/src/cron/nftStake.cron.ts | 2 +- packages/functions/src/cron/orders.cron.ts | 2 +- packages/functions/src/cron/proposal.cron.ts | 2 +- packages/functions/src/cron/stake.cron.ts | 2 +- .../functions/src/cron/stakeReward.cron.ts | 2 +- packages/functions/src/cron/token.cron.ts | 2 +- .../functions/src/cron/token.purchase.cron.ts | 2 +- packages/functions/src/cron/wallet.cron.ts | 3 +- packages/functions/src/firebase/app/app.ts | 11 - .../functions/src/firebase/app/build5App.ts | 8 - .../functions/src/firebase/app/interface.ts | 5 - .../src/firebase/firestore/build5Db.ts | 22 -- .../src/firebase/firestore/common.ts | 17 -- .../src/firebase/firestore/firestore.ts | 274 ------------------ .../src/firebase/firestore/interfaces.ts | 98 ------- .../src/firebase/storage/build5Storage.ts | 5 - .../src/firebase/storage/interfaces.ts | 13 - .../functions/src/firebase/storage/storage.ts | 41 --- .../src/services/payment/address-service.ts | 2 +- .../services/payment/award/award-service.ts | 2 +- .../src/services/payment/credit-service.ts | 2 +- .../services/payment/metadataNft-service.ts | 2 +- .../payment/nft/collection-minting-service.ts | 2 +- .../payment/nft/nft-deposit-service.ts | 4 +- .../src/services/payment/nft/nft-service.ts | 4 +- .../services/payment/nft/nft-stake-service.ts | 2 +- .../services/payment/payment-processing.ts | 3 +- .../services/payment/space/space-service.ts | 2 +- .../src/services/payment/stake-service.ts | 2 +- .../tangle-service/TangleRequestService.ts | 2 +- .../address/address-validation.service.ts | 2 +- .../award.approve.participant.service.ts | 3 +- .../award/award.create.service.ts | 3 +- .../award/award.fund.service.ts | 2 +- .../metadataNft/mint-metadata-nft.service.ts | 2 +- .../tangle-service/nft/nft-bid.service.ts | 2 +- .../tangle-service/nft/nft-deposit.service.ts | 2 +- .../nft/nft-purchase.service.ts | 2 +- .../nft/nft-set-for-sale.service.ts | 2 +- .../proposal/ProposalApporvalService.ts | 2 +- .../proposal/ProposalCreateService.ts | 2 +- .../proposal/voting/ProposalVoteService.ts | 2 +- .../proposal/voting/simple.voting.ts | 2 +- .../proposal/voting/staked.token.voting.ts | 3 +- .../space/SpaceAcceptMemberService.ts | 2 +- .../space/SpaceBlockMemberService.ts | 2 +- .../space/SpaceCreateService.ts | 3 +- .../space/SpaceDeclineMemberService.ts | 2 +- .../space/SpaceGuardianService.ts | 2 +- .../tangle-service/space/SpaceJoinService.ts | 2 +- .../tangle-service/space/SpaceLeaveService.ts | 2 +- .../tangle-service/token/stake.service.ts | 2 +- .../token/token-claim.service.ts | 2 +- .../token/token-trade.service.ts | 3 +- .../token/import-minted-token.service.ts | 3 +- .../payment/token/token-mint-service.ts | 2 +- .../services/payment/token/token-service.ts | 2 +- .../services/payment/transaction-service.ts | 3 +- .../src/services/payment/voting-service.ts | 2 +- .../functions/src/services/stake.service.ts | 3 +- .../src/services/validators/access.ts | 2 +- .../src/services/wallet/NativeTokenWallet.ts | 2 +- .../src/services/wallet/NftWallet.ts | 2 +- .../functions/src/services/wallet/mnemonic.ts | 2 +- .../src/services/wallet/wallet.service.ts | 2 +- .../functions/src/triggers/award.trigger.ts | 2 +- .../src/triggers/collection.stats.trigger.ts | 2 +- .../src/triggers/collection.trigger.ts | 2 +- .../milestone-transactions-triggers/common.ts | 2 +- .../consumed.vote.outputs.ts | 3 +- .../milestone-transaction.trigger.ts | 2 +- .../token.foundry.ts | 2 +- .../src/triggers/mnemonic.trigger.ts | 2 +- .../functions/src/triggers/nft.trigger.ts | 2 +- .../src/triggers/proposal.trigger.ts | 2 +- .../triggers/storage/resize.img.trigger.ts | 3 +- .../token-trading/match-base-token.ts | 3 +- .../token-trading/match-minted-token.ts | 3 +- .../token-trading/match-simple-token.ts | 3 +- .../src/triggers/token-trading/match-token.ts | 3 +- .../token-trading/token-purchase.trigger.ts | 2 +- .../token-trade-order.trigger.ts | 2 +- .../functions/src/triggers/token.trigger.ts | 3 +- .../transaction-trigger/airdrop.claim.ts | 3 +- .../award.transaction.update.ts | 2 +- .../transaction-trigger/collection-minting.ts | 2 +- .../transaction-trigger/matadatNft-minting.ts | 2 +- .../transaction-trigger/nft-staked.ts | 2 +- .../transaction-trigger/proposal.vote.ts | 2 +- .../triggers/transaction-trigger/staking.ts | 2 +- .../transaction-trigger/token-minting.ts | 2 +- .../transaction.trigger.ts | 3 +- .../transaction-trigger/wallet-params.ts | 2 +- .../collection-minting-utils/nft.utils.ts | 2 +- packages/functions/src/utils/media.utils.ts | 2 +- packages/functions/src/utils/royalty.utils.ts | 2 +- packages/functions/src/utils/space.utils.ts | 2 +- .../utils/token-minting-utils/member.utils.ts | 2 +- .../functions/src/utils/token-trade.utils.ts | 3 +- packages/functions/src/utils/token.utils.ts | 2 +- packages/functions/src/utils/wallet.utils.ts | 2 +- .../functions/test-tangle/address.spec.ts | 2 +- .../award-tangle/award-tangle_1.spec.ts | 2 +- .../award-tangle/award-tangle_2.spec.ts | 2 +- .../award-tangle/award-tangle_3.spec.ts | 2 +- .../award-tangle/award-tangle_4.spec.ts | 2 +- .../award-tangle/award-tangle_5.spec.ts | 2 +- .../award-tangle/award-tangle_6.spec.ts | 2 +- .../award-tangle/award-tangle_7.spec.ts | 2 +- .../test-tangle/award-tangle/common.ts | 3 +- .../test-tangle/award/award_1.spec.ts | 2 +- .../test-tangle/award/award_10.spec.ts | 2 +- .../test-tangle/award/award_2.spec.ts | 2 +- .../test-tangle/award/award_3.spec.ts | 2 +- .../test-tangle/award/award_4.spec.ts | 2 +- .../test-tangle/award/award_5.spec.ts | 2 +- .../test-tangle/award/award_6.spec.ts | 2 +- .../test-tangle/award/award_7.spec.ts | 2 +- .../test-tangle/award/award_8.spec.ts | 2 +- .../test-tangle/award/award_9.spec.ts | 2 +- .../functions/test-tangle/award/common.ts | 3 +- .../test-tangle/base-token-trading/Helper.ts | 2 +- .../base-token-trading_1.spec.ts | 2 +- .../base-token-trading_10.spec.ts | 2 +- .../base-token-trading_11_a.spec.ts | 2 +- .../base-token-trading_11_b.spec.ts | 2 +- .../base-token-trading_11_c.spec.ts | 2 +- .../base-token-trading_11_d.spec.ts | 2 +- .../base-token-trading_12.spec.ts | 2 +- .../base-token-trading_13.spec.ts | 2 +- .../base-token-trading_2.spec.ts | 2 +- .../base-token-trading_3.spec.ts | 2 +- .../base-token-trading_4.spec.ts | 2 +- .../base-token-trading_5.spec.ts | 2 +- .../base-token-trading_6.spec.ts | 2 +- .../base-token-trading_7.spec.ts | 2 +- .../base-token-trading_8.spec.ts | 2 +- .../base-token-trading_9.spec.ts | 2 +- .../test-tangle/collection-minting/Helper.ts | 2 +- .../collection-minting_1.spec.ts | 2 +- .../collection-minting_10.spec.ts | 2 +- .../collection-minting_11.spec.ts | 2 +- .../collection-minting_12.spec.ts | 2 +- .../collection-minting_2.spec.ts | 2 +- .../collection-minting_3.spec.ts | 2 +- .../collection-minting_4.spec.ts | 2 +- .../collection-minting_5.spec.ts | 2 +- .../collection-minting_6.spec.ts | 2 +- .../collection-minting_7.spec.ts | 2 +- .../collection-minting_8.spec.ts | 2 +- .../collection-minting_9.spec.ts | 2 +- packages/functions/test-tangle/common.ts | 2 +- .../test-tangle/metadata-nft/Helper.ts | 2 +- .../metadata-nft/mint-metadata-nft_1.spec.ts | 2 +- .../mint-metadata-nft_1_b.spec.ts | 2 +- .../metadata-nft/mint-metadata-nft_2.spec.ts | 2 +- .../metadata-nft/mint-metadata-nft_3.spec.ts | 2 +- .../mint-metadata-nft_3_b.spec.ts | 2 +- .../metadata-nft/mint-metadata-nft_4.spec.ts | 2 +- .../metadata-nft/mint-metadata-nft_5.spec.ts | 2 +- .../mint-metadata-nft_5_b.spec.ts | 2 +- .../metadata-nft/mint-metadata-nft_6.spec.ts | 2 +- .../metadata-nft/mint-metadata-nft_7.spec.ts | 2 +- .../test-tangle/minted-nft-trading/Helper.ts | 2 +- .../minted-nft-trading_1.spec.ts | 2 +- .../minted-nft-trading_10.spec.ts | 2 +- .../minted-nft-trading_11.only.spec.ts | 2 +- .../minted-nft-trading_1_b.spec.ts | 2 +- .../minted-nft-trading_2.spec.ts | 2 +- .../minted-nft-trading_3.spec.ts | 2 +- .../minted-nft-trading_4.spec.ts | 2 +- .../minted-nft-trading_5.spec.ts | 2 +- .../minted-nft-trading_6.spec.ts | 2 +- .../minted-nft-trading_7.spec.ts | 2 +- .../minted-nft-trading_8.spec.ts | 2 +- .../minted-token-airdrop/Helper.ts | 2 +- .../minted-token-airdrop_1_a.spec.ts | 2 +- .../minted-token-airdrop_1_b.spec.ts | 2 +- .../minted-token-airdrop_1_c.spec.ts | 2 +- .../minted-token-airdrop_2.spec.ts | 2 +- .../minted-token-airdrop_4.spec.ts | 2 +- .../minted-token-airdrop_5.spec.ts | 2 +- .../test-tangle/minted-token-claim/Helper.ts | 2 +- .../token.claim.minted_1.spec.ts | 2 +- .../token.claim.minted_2.spec.ts | 2 +- .../token.claim.minted_3.spec.ts | 2 +- .../token.claim.minted_4.spec.ts | 2 +- .../token.claim.minted_5.spec.ts | 2 +- .../token.claim.minted_6.spec.ts | 2 +- .../token.claim.minted_7.spec.ts | 2 +- .../test-tangle/minted-token-trade/Helper.ts | 2 +- .../minted-token-trade_1.spec.ts | 2 +- .../minted-token-trade_10.spec.ts | 2 +- .../minted-token-trade_11.spec.ts | 2 +- .../minted-token-trade_12.spec.ts | 2 +- .../minted-token-trade_12_b.spec.ts | 2 +- .../minted-token-trade_13.spec.ts | 2 +- .../minted-token-trade_14.spec.ts | 2 +- .../minted-token-trade_14_b.spec.ts | 2 +- .../minted-token-trade_15.only.spec.ts | 2 +- .../minted-token-trade_16.spec.ts | 2 +- .../minted-token-trade_17.spec.ts | 2 +- .../minted-token-trade_18.spec.ts | 2 +- .../minted-token-trade_19.spec.ts | 2 +- .../minted-token-trade_2.spec.ts | 2 +- .../minted-token-trade_3.spec.ts | 2 +- .../minted-token-trade_4.spec.ts | 2 +- .../minted-token-trade_5.spec.ts | 2 +- .../minted-token-trade_6.spec.ts | 2 +- .../minted-token-trade_7.spec.ts | 2 +- .../minted-token-trade_8.spec.ts | 2 +- .../minted-token-trade_9.spec.ts | 2 +- .../functions/test-tangle/nft-bid/Helper.ts | 2 +- .../test-tangle/nft-bid/nft-bid.otr_1.spec.ts | 2 +- .../test-tangle/nft-bid/nft-bid.otr_2.spec.ts | 2 +- .../test-tangle/nft-bid/nft-bid.otr_3.spec.ts | 2 +- .../test-tangle/nft-bid/nft-bid.otr_4.spec.ts | 2 +- .../test-tangle/nft-set-for-sale/Helper.ts | 2 +- .../nft-set-for-sale_1.spec.ts | 2 +- .../nft-set-for-sale_2.spec.ts | 2 +- .../nft-set-for-sale_3.spec.ts | 2 +- .../test-tangle/nft-staking/Helper.ts | 2 +- .../nft-staking/nft-staking_1.spec.ts | 2 +- .../nft-staking/nft-staking_2.spec.ts | 2 +- .../nft-staking/nft-staking_2_b.spec.ts | 2 +- .../nft-staking/nft-staking_3.spec.ts | 2 +- .../nft-staking/nft-staking_4.spec.ts | 2 +- .../nft-staking/nft-staking_5.spec.ts | 2 +- .../nft-staking/nft-staking_6.spec.ts | 2 +- .../nft-staking/nft-staking_7.spec.ts | 2 +- .../nft-staking/nft-staking_8.spec.ts | 2 +- .../test-tangle/proposal-tangle/Helper.ts | 3 +- .../proposal-tangle/proposal.approval.spec.ts | 2 +- .../proposal.simple.vote.spec.ts | 2 +- .../proposal.stake.voting.spec.ts | 2 +- .../proposal.token.voting.spec.ts | 2 +- .../test-tangle/space-tangle/Helper.ts | 3 +- .../space-tangle/space.accept.member.spec.ts | 2 +- .../space-tangle/space.block.member.spec.ts | 2 +- .../space-tangle/space.create.spec.ts | 2 +- .../space-tangle/space.decline.member.spec.ts | 2 +- .../space-tangle/space.edit.guardian.spec.ts | 2 +- .../space-tangle/space.join.spec.ts | 2 +- .../space-tangle/space.leave.spec.ts | 2 +- .../functions/test-tangle/staking/Helper.ts | 2 +- .../test-tangle/staking/staking_1.spec.ts | 2 +- .../test-tangle/staking/staking_2.spec.ts | 2 +- .../test-tangle/staking/staking_3.spec.ts | 2 +- .../test-tangle/staking/staking_4.spec.ts | 2 +- .../test-tangle/staking/staking_5.spec.ts | 2 +- .../tangleRequest/simple.token.trade.spec.ts | 2 +- .../tangleRequest/tangle-request.spec.ts | 2 +- .../test-tangle/token-import/Helper.ts | 2 +- .../token-import/token.import_1.spec.ts | 2 +- .../token-import/token.import_2.spec.ts | 2 +- .../test-tangle/token.based.voting/Helper.ts | 2 +- .../token.based.voting/stake.voting.spec.ts | 2 +- .../token.based.voting_4.spec.ts | 2 +- .../token.based.voting_5.spec.ts | 2 +- .../test-tangle/token.mint/Helper.ts | 2 +- .../token.mint/token.mint_1.spec.ts | 2 +- .../token.mint/token.mint_2.spec.ts | 2 +- .../token.mint/token.mint_3.spec.ts | 2 +- .../token.mint/token.mint_4.spec.ts | 2 +- .../trade-base-token-order.spec.ts | 2 +- .../functions/test-tangle/tran.match.spec.ts | 2 +- .../transaction-trigger_1.spec.ts | 2 +- .../transaction-trigger_10.spec.ts | 2 +- .../transaction-trigger_11.spec.ts | 2 +- .../transaction-trigger_12.spec.ts | 2 +- .../transaction-trigger_13.spec.ts | 2 +- .../transaction-trigger_2.spec.ts | 2 +- .../transaction-trigger_3.spec.ts | 2 +- .../transaction-trigger_4.spec.ts | 2 +- .../transaction-trigger_5.spec.ts | 2 +- .../transaction-trigger_6.spec.ts | 2 +- .../transaction-trigger_7.spec.ts | 2 +- .../transaction-trigger_8.spec.ts | 2 +- .../transaction-trigger_9.spec.ts | 2 +- .../functions/test-tangle/web3/web3_1.spec.ts | 2 +- .../functions/test-tangle/web3/web3_2.spec.ts | 2 +- .../functions/test-tangle/web3/web3_3.spec.ts | 2 +- .../withdraw-deposit-nft/Helper.ts | 2 +- .../deposit-withraw-nft_10_1.spec.ts | 2 +- .../deposit-withraw-nft_10_2.spec.ts | 2 +- .../deposit-withraw-nft_10_3.spec.ts | 2 +- .../deposit-withraw-nft_11.spec.ts | 2 +- .../deposit-withraw-nft_12_a.spec.ts | 2 +- .../deposit-withraw-nft_12_b.spec.ts | 2 +- .../deposit-withraw-nft_13.spec.ts | 2 +- .../deposit-withraw-nft_14.spec.ts | 2 +- .../deposit-withraw-nft_1_a.spec.ts | 2 +- .../deposit-withraw-nft_1_b.spec.ts | 2 +- .../deposit-withraw-nft_1_c.spec.ts | 2 +- .../deposit-withraw-nft_2.spec.ts | 2 +- .../deposit-withraw-nft_4.spec.ts | 2 +- .../deposit-withraw-nft_4_b.spec.ts | 2 +- .../deposit-withraw-nft_5.spec.ts | 2 +- .../deposit-withraw-nft_6.spec.ts | 2 +- .../deposit-withraw-nft_7.spec.ts | 2 +- .../deposit-withraw-nft_8.spec.ts | 2 +- .../deposit-withraw-nft_9.spec.ts | 3 +- packages/functions/test/auth.spec.ts | 2 +- .../functions/test/controls/address.spec.ts | 2 +- .../test/controls/collection.spec.ts | 2 +- packages/functions/test/controls/common.ts | 2 +- .../functions/test/controls/member.spec.ts | 2 +- .../test/controls/nft-bidding.spec.ts | 3 +- packages/functions/test/controls/nft.spec.ts | 2 +- .../functions/test/controls/order.spec.ts | 2 +- .../functions/test/controls/proposal.spec.ts | 2 +- .../functions/test/controls/space.spec.ts | 2 +- .../test/controls/stake.reward.spec.ts | 2 +- .../token-distribution-auto-trigger.spec.ts | 2 +- .../test/controls/token-distribution.spec.ts | 2 +- .../test/controls/token-trade.buy.spec.ts | 2 +- .../test/controls/token-trade.sell.spec.ts | 2 +- .../test/controls/token-trade.trigger.spec.ts | 2 +- .../controls/token.expired.sale.cron.spec.ts | 2 +- .../test/controls/token.order.spec.ts | 2 +- .../token/token.airdrop.claim.spec.ts | 2 +- .../test/controls/token/token.airdrop.spec.ts | 2 +- .../token/token.cancel.pub.sale.spec.ts | 2 +- .../test/controls/token/token.create.spec.ts | 2 +- .../token/token.order.and.claim.air.spec.ts | 2 +- .../test/controls/token/token.rank.spec.ts | 2 +- .../controls/token/token.set.to.sale.spec.ts | 2 +- .../test/controls/token/token.update.spec.ts | 2 +- .../test/controls/token/token.vote.spec.ts | 2 +- .../test/cron/floor-price.cron.only.spec.ts | 2 +- .../test/cron/nft-stake.cron.spec.ts | 2 +- .../functions/test/cron/proposal.cron.spec.ts | 2 +- .../test/dbRoll/total.guardians.roll.spec.ts | 29 -- packages/functions/test/set-up.ts | 2 +- .../test/stake/delete.stake.reward.spec.ts | 2 +- .../test/stake/stake.reward.cron.spec.ts | 2 +- .../functions/test/storage/resize.img.spec.ts | 2 +- packages/interfaces/src/config.ts | 2 +- 406 files changed, 396 insertions(+), 1077 deletions(-) delete mode 100644 packages/functions/scripts/db.upgrade.ts delete mode 100644 packages/functions/scripts/dbUpgrades/1.0/totalGuardiansRoll.ts delete mode 100644 packages/functions/src/firebase/app/app.ts delete mode 100644 packages/functions/src/firebase/app/build5App.ts delete mode 100644 packages/functions/src/firebase/app/interface.ts delete mode 100644 packages/functions/src/firebase/firestore/build5Db.ts delete mode 100644 packages/functions/src/firebase/firestore/common.ts delete mode 100644 packages/functions/src/firebase/firestore/firestore.ts delete mode 100644 packages/functions/src/firebase/firestore/interfaces.ts delete mode 100644 packages/functions/src/firebase/storage/build5Storage.ts delete mode 100644 packages/functions/src/firebase/storage/interfaces.ts delete mode 100644 packages/functions/src/firebase/storage/storage.ts delete mode 100644 packages/functions/test/dbRoll/total.guardians.roll.spec.ts diff --git a/.github/workflows/functions_emulated-tests.yml b/.github/workflows/functions_emulated-tests.yml index 07d647472e..506b818eb4 100644 --- a/.github/workflows/functions_emulated-tests.yml +++ b/.github/workflows/functions_emulated-tests.yml @@ -220,49 +220,14 @@ jobs: npm run test:ci -- --forceExit --findRelatedTests ./test/cron/nft-stake.cron.spec.ts && npm run test:ci -- --forceExit --findRelatedTests ./test/cron/proposal.cron.spec.ts && npm run test:ci -- --forceExit --findRelatedTests ./test/db.roll.spec.ts && - npm run test:ci -- --forceExit --findRelatedTests ./test/dbRoll/total.guardians.roll.spec.ts && npm run test:ci -- --forceExit --findRelatedTests ./test/stake/delete.stake.reward.spec.ts && - npm run test:ci -- --forceExit --findRelatedTests ./test/stake/stake.reward.cron.spec.ts - " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - - name: Archive firestore data - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: firestore-data-test-chunk_4 - path: ./packages/functions/firestore-data/ - retention-days: 1 - chunk_5: - needs: npm-install - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - uses: actions/cache@v3 - with: - path: | - node_modules - packages/functions/node_modules - packages/interfaces/node_modules - key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }} - - name: Init - run: | - npm run build:functions - npm install -g firebase-tools - - name: Test - working-directory: packages/functions - run: | - export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" - npm run milestone-sync & - firebase emulators:exec " + npm run test:ci -- --forceExit --findRelatedTests ./test/stake/stake.reward.cron.spec.ts && npm run test:ci -- --forceExit --findRelatedTests ./test/storage/resize.img.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 if: ${{ failure() }} with: - name: firestore-data-test-chunk_5 + name: firestore-data-test-chunk_4 path: ./packages/functions/firestore-data/ retention-days: 1 diff --git a/package.json b/package.json index 0b9100a537..0a68576767 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,12 @@ "packages/functions" ], "scripts": { - "build:functions": "npm run build:interfaces && npm i --workspace=packages/functions && npm run build --workspace=packages/functions", + "build:functions": "npm run build:database && npm i --workspace=packages/functions && npm run build --workspace=packages/functions", "build:interfaces": "npm i --workspace=packages/interfaces && npm run build --workspace=packages/interfaces", "build:lib": "npm run build:interfaces && npm i --workspace=packages/lib && npm run build --workspace=packages/lib", "build:indexes": "npm i --workspace=packages/indexes && npm run build --workspace=packages/indexes", "build:database": "npm run build:interfaces && npm i --workspace=packages/database && npm run build --workspace=packages/database", - "build:api": "npm run build:interfaces && npm run build:database && npm i --workspace=packages/api && npm run build --workspace=packages/api", + "build:api": "npm run build:database && npm i --workspace=packages/api && npm run build --workspace=packages/api", "build": "npm i --workspaces && npm run build --workspaces", "clean:api": "rm -rf packages/api/lib; rm -rf packages/api/node_modules", "clean:database": "rm -rf packages/database/lib; rm -rf packages/database/node_modules", diff --git a/packages/functions/package.json b/packages/functions/package.json index 2a609c5b9a..33f21c4a08 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -64,6 +64,7 @@ }, "dependencies": { "@build-5/interfaces": "*", + "@build-5/database": "*", "@ffmpeg-installer/ffmpeg": "1.1.0", "@ffprobe-installer/ffprobe": "2.0.0", "@iota/sdk": "1.1.1", diff --git a/packages/functions/scripts/db.upgrade.ts b/packages/functions/scripts/db.upgrade.ts deleted file mode 100644 index 061f64fb8f..0000000000 --- a/packages/functions/scripts/db.upgrade.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { COL } from '@build-5/interfaces'; -import crypto from 'crypto'; -import dotenv from 'dotenv'; -import admin from 'firebase-admin'; -import { getFirestore } from 'firebase-admin/firestore'; -import fs from 'fs'; -import glob from 'glob'; -import { FirebaseApp } from '../src/firebase/app/app'; -import serviceAccount from './serviceAccountKey.json'; - -dotenv.config({ path: '../.env' }); - -const app = admin.initializeApp({ - credential: admin.credential.cert(serviceAccount as any), -}); -process.env.FIREBASE_CONFIG = JSON.stringify({ projectId: serviceAccount.project_id }); - -const execute = async () => { - const db = getFirestore(app); - const files = glob.sync(`./dbUpgrades/**/*.ts`); - for (const file of files.sort()) { - const content = fs.readFileSync(file); - const hash = crypto.createHash('sha1').update(content).digest('hex'); - - const docRef = db.doc(`${COL.DB_ROLL_FILES}/${hash}`); - const doc = await docRef.get(); - if (doc.exists) { - console.warn(`${file} script was already ran`); - continue; - } - - console.log(`Running ${file}`); - const func = await import(pathToImportFileName(file)); - await func.roll(new FirebaseApp(app)); - await docRef.create({}); - } -}; - -const pathToImportFileName = (path: string) => './' + path.replace('.ts', ''); - -execute(); diff --git a/packages/functions/scripts/dbUpgrades/1.0/totalGuardiansRoll.ts b/packages/functions/scripts/dbUpgrades/1.0/totalGuardiansRoll.ts deleted file mode 100644 index 771717f73b..0000000000 --- a/packages/functions/scripts/dbUpgrades/1.0/totalGuardiansRoll.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ - -import { COL, PublicCollections, PublicSubCollections, SUB_COL, Space } from '@build-5/interfaces'; -import { last } from 'lodash'; -import { FirebaseApp } from '../../../src/firebase/app/app'; -import { Firestore } from '../../../src/firebase/firestore/firestore'; -import { IDocument } from '../../../src/firebase/firestore/interfaces'; - -export const totalGuardiansRoll = async (app: FirebaseApp) => { - const db = new Firestore(app); - let lastDocId = ''; - - do { - const startAfter = await getSnapshot(db, COL.SPACE, lastDocId); - const spaces = await db.collection(COL.SPACE).startAfter(startAfter).limit(500).get(); - lastDocId = last(spaces)?.uid || ''; - - const promises = spaces.map(async (space) => { - const totalGuardians = await getMemberCount(db, space.uid, SUB_COL.GUARDIANS); - const totalMembers = await getMemberCount(db, space.uid, SUB_COL.MEMBERS); - const totalPendingMembers = await getMemberCount(db, space.uid, SUB_COL.KNOCKING_MEMBERS); - return { uid: space.uid, totalGuardians, totalMembers, totalPendingMembers }; - }); - const spaceCounts = await Promise.all(promises); - - const batch = db.batch(); - spaceCounts.forEach((data) => { - const spaceDocRef = db.doc(`${COL.SPACE}/${data.uid}`); - batch.update(spaceDocRef, data); - }); - await batch.commit(); - } while (lastDocId); -}; - -export const roll = totalGuardiansRoll; - -const getMemberCount = (db: Firestore, space: string, subCol: SUB_COL) => - db.collection(COL.SPACE).doc(space).collection(subCol).count(); - -const getSnapshot = ( - db: Firestore, - col: COL | PublicCollections, - id?: string, - subCol?: SUB_COL | PublicSubCollections, - childId?: string, -) => { - if (!id) { - return; - } - let doc: IDocument = db.doc(`${col}/${id}`); - if (subCol && childId) { - doc = doc.collection(subCol).doc(childId); - } - return doc.getSnapshot(); -}; diff --git a/packages/functions/src/controls/address/address.control.ts b/packages/functions/src/controls/address/address.control.ts index d7bbc09cb1..d9b7056fe8 100644 --- a/packages/functions/src/controls/address/address.control.ts +++ b/packages/functions/src/controls/address/address.control.ts @@ -6,7 +6,7 @@ import { Network, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; +import { build5Db } from '@build-5/database'; import { createAddressValidationOrder } from '../../services/payment/tangle-service/address/address-validation.service'; import { invalidArgument } from '../../utils/error.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/award/award.approve.participant.ts b/packages/functions/src/controls/award/award.approve.participant.ts index ed99e20aba..b254090985 100644 --- a/packages/functions/src/controls/award/award.approve.participant.ts +++ b/packages/functions/src/controls/award/award.approve.participant.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { ApiError, AwardApproveParticipantRequest, @@ -5,7 +6,6 @@ import { Transaction, } from '@build-5/interfaces'; import { get } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { approveAwardParticipant } from '../../services/payment/tangle-service/award/award.approve.participant.service'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/award/award.cancel.ts b/packages/functions/src/controls/award/award.cancel.ts index bef412dcee..dd3832cdb4 100644 --- a/packages/functions/src/controls/award/award.cancel.ts +++ b/packages/functions/src/controls/award/award.cancel.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { Award, AwardCancelRequest, COL, WenError } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/award/award.create.ts b/packages/functions/src/controls/award/award.create.ts index e3348ae72d..b88d56189e 100644 --- a/packages/functions/src/controls/award/award.create.ts +++ b/packages/functions/src/controls/award/award.create.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { Award, AwardCreateRequest, COL, SUB_COL } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createAward } from '../../services/payment/tangle-service/award/award.create.service'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/award/award.fund.ts b/packages/functions/src/controls/award/award.fund.ts index 5138d4a784..f4e29774bc 100644 --- a/packages/functions/src/controls/award/award.fund.ts +++ b/packages/functions/src/controls/award/award.fund.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { AwardFundRequest, COL, Transaction } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createAwardFundOrder, getAwardForFunding, diff --git a/packages/functions/src/controls/award/award.owner.ts b/packages/functions/src/controls/award/award.owner.ts index c35ed72f43..5f0a28bc90 100644 --- a/packages/functions/src/controls/award/award.owner.ts +++ b/packages/functions/src/controls/award/award.owner.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, AwardAddOwnerRequest, @@ -7,7 +8,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/award/award.participate.ts b/packages/functions/src/controls/award/award.participate.ts index 4445f5d916..143c38db29 100644 --- a/packages/functions/src/controls/award/award.participate.ts +++ b/packages/functions/src/controls/award/award.participate.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, AwardParticipant, @@ -7,7 +8,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/award/award.reject.ts b/packages/functions/src/controls/award/award.reject.ts index c5efabf870..f7b45bc3f7 100644 --- a/packages/functions/src/controls/award/award.reject.ts +++ b/packages/functions/src/controls/award/award.reject.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { Award, AwardRejectRequest, COL, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/collection/collection-mint.control.ts b/packages/functions/src/controls/collection/collection-mint.control.ts index 789471c02f..1316efef93 100644 --- a/packages/functions/src/controls/collection/collection-mint.control.ts +++ b/packages/functions/src/controls/collection/collection-mint.control.ts @@ -1,3 +1,4 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, Collection, @@ -19,7 +20,6 @@ import { import { Ed25519Address } from '@iota/sdk'; import dayjs from 'dayjs'; import { last } from 'lodash'; -import { build5Db, getSnapshot } from '../../firebase/firestore/build5Db'; import { Wallet } from '../../services/wallet/wallet'; import { AddressDetails, WalletService } from '../../services/wallet/wallet.service'; import { assertMemberHasValidAddress, assertSpaceHasValidAddress } from '../../utils/address.utils'; diff --git a/packages/functions/src/controls/collection/collection.approve.control.ts b/packages/functions/src/controls/collection/collection.approve.control.ts index 98bc7bee91..57884cb478 100644 --- a/packages/functions/src/controls/collection/collection.approve.control.ts +++ b/packages/functions/src/controls/collection/collection.approve.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { ApproveCollectionRequest, COL, Collection, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/collection/collection.create.control.ts b/packages/functions/src/controls/collection/collection.create.control.ts index d2f6f25dd9..33e9fa6627 100644 --- a/packages/functions/src/controls/collection/collection.create.control.ts +++ b/packages/functions/src/controls/collection/collection.create.control.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -12,7 +13,6 @@ import { SUB_COL, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { hasStakedSoonTokens } from '../../services/stake.service'; import { assertSpaceHasValidAddress } from '../../utils/address.utils'; import { dateToTimestamp, serverTime } from '../../utils/dateTime.utils'; diff --git a/packages/functions/src/controls/collection/collection.reject.control.ts b/packages/functions/src/controls/collection/collection.reject.control.ts index 79f834510e..ba136d9128 100644 --- a/packages/functions/src/controls/collection/collection.reject.control.ts +++ b/packages/functions/src/controls/collection/collection.reject.control.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, RejectCollectionRequest, WenError } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/collection/collection.update.control.ts b/packages/functions/src/controls/collection/collection.update.control.ts index bcd3c95b0a..8a3dd024a2 100644 --- a/packages/functions/src/controls/collection/collection.update.control.ts +++ b/packages/functions/src/controls/collection/collection.update.control.ts @@ -1,3 +1,4 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, Collection, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty, last, set } from 'lodash'; -import { build5Db, getSnapshot } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { assertValidationAsync } from '../../utils/schema.utils'; diff --git a/packages/functions/src/controls/credit/credit.controller.ts b/packages/functions/src/controls/credit/credit.controller.ts index 8c0e4a47af..2292c99ccc 100644 --- a/packages/functions/src/controls/credit/credit.controller.ts +++ b/packages/functions/src/controls/credit/credit.controller.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, CreditUnrefundableRequest, @@ -11,7 +12,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { WalletService } from '../../services/wallet/wallet.service'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; diff --git a/packages/functions/src/controls/file/file.upload.control.ts b/packages/functions/src/controls/file/file.upload.control.ts index 09c4561b96..9f51a6f41f 100644 --- a/packages/functions/src/controls/file/file.upload.control.ts +++ b/packages/functions/src/controls/file/file.upload.control.ts @@ -5,7 +5,7 @@ import fs from 'fs'; import mime from 'mime-types'; import os from 'os'; import path from 'path'; -import { build5Storage } from '../../firebase/storage/build5Storage'; +import { build5Storage } from '@build-5/database'; import { getBucket } from '../../utils/config.utils'; import { invalidArgument } from '../../utils/error.utils'; import { assertValidationAsync } from '../../utils/schema.utils'; diff --git a/packages/functions/src/controls/member/member.create.ts b/packages/functions/src/controls/member/member.create.ts index 42b2b96b1f..1ca3bdf59b 100644 --- a/packages/functions/src/controls/member/member.create.ts +++ b/packages/functions/src/controls/member/member.create.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Member } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getRandomNonce } from '../../utils/wallet.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/member/member.update.ts b/packages/functions/src/controls/member/member.update.ts index 1ffb1566ee..27a783cc10 100644 --- a/packages/functions/src/controls/member/member.update.ts +++ b/packages/functions/src/controls/member/member.update.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -7,7 +8,6 @@ import { NftStatus, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { cleanupParams } from '../../utils/schema.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/nft/nft.bid.control.ts b/packages/functions/src/controls/nft/nft.bid.control.ts index 4c4c9226ce..e3098e48f0 100644 --- a/packages/functions/src/controls/nft/nft.bid.control.ts +++ b/packages/functions/src/controls/nft/nft.bid.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, NftBidRequest, Transaction, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createNftBidOrder } from '../../services/payment/tangle-service/nft/nft-bid.service'; import { invalidArgument } from '../../utils/error.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/nft/nft.create.ts b/packages/functions/src/controls/nft/nft.create.ts index fa3869721a..6da0c893a1 100644 --- a/packages/functions/src/controls/nft/nft.create.ts +++ b/packages/functions/src/controls/nft/nft.create.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { getRandomEthAddress } from '../../utils/wallet.utils'; diff --git a/packages/functions/src/controls/nft/nft.deposit.ts b/packages/functions/src/controls/nft/nft.deposit.ts index 96df036da0..6eb509d2f5 100644 --- a/packages/functions/src/controls/nft/nft.deposit.ts +++ b/packages/functions/src/controls/nft/nft.deposit.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Network, @@ -9,7 +10,6 @@ import { TransactionValidationType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { WalletService } from '../../services/wallet/wallet.service'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { getRandomEthAddress } from '../../utils/wallet.utils'; diff --git a/packages/functions/src/controls/nft/nft.puchase.control.ts b/packages/functions/src/controls/nft/nft.puchase.control.ts index 91d554d7e2..c79e319a2d 100644 --- a/packages/functions/src/controls/nft/nft.puchase.control.ts +++ b/packages/functions/src/controls/nft/nft.puchase.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, NftPurchaseRequest, Transaction } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createNftPuchaseOrder } from '../../services/payment/tangle-service/nft/nft-purchase.service'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/nft/nft.set.for.sale.ts b/packages/functions/src/controls/nft/nft.set.for.sale.ts index c1235b1ce4..2732bd662c 100644 --- a/packages/functions/src/controls/nft/nft.set.for.sale.ts +++ b/packages/functions/src/controls/nft/nft.set.for.sale.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, Nft, NftSetForSaleRequest, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getNftSetForSaleParams } from '../../services/payment/tangle-service/nft/nft-set-for-sale.service'; import { invalidArgument } from '../../utils/error.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/nft/nft.stake.ts b/packages/functions/src/controls/nft/nft.stake.ts index f8b504cae7..9dfe340129 100644 --- a/packages/functions/src/controls/nft/nft.stake.ts +++ b/packages/functions/src/controls/nft/nft.stake.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Network, NftStakeRequest, StakeType, Transaction } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createNftStakeOrder } from '../../services/payment/nft/nft-stake-service'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/nft/nft.update.unsold.ts b/packages/functions/src/controls/nft/nft.update.unsold.ts index 411f847c0f..c37f96e598 100644 --- a/packages/functions/src/controls/nft/nft.update.unsold.ts +++ b/packages/functions/src/controls/nft/nft.update.unsold.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Nft, NftUpdateUnsoldRequest, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/nft/nft.withdraw.ts b/packages/functions/src/controls/nft/nft.withdraw.ts index cc76c5e702..29cddb7ea4 100644 --- a/packages/functions/src/controls/nft/nft.withdraw.ts +++ b/packages/functions/src/controls/nft/nft.withdraw.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -8,7 +9,6 @@ import { NftWithdrawRequest, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createNftWithdrawOrder } from '../../services/payment/tangle-service/nft/nft-purchase.service'; import { assertMemberHasValidAddress, getAddress } from '../../utils/address.utils'; import { invalidArgument } from '../../utils/error.utils'; diff --git a/packages/functions/src/controls/proposal/approve.reject.proposal.ts b/packages/functions/src/controls/proposal/approve.reject.proposal.ts index 28d930b543..c59635901e 100644 --- a/packages/functions/src/controls/proposal/approve.reject.proposal.ts +++ b/packages/functions/src/controls/proposal/approve.reject.proposal.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { ApproveProposalRequest, COL, Proposal, RejectProposalRequest } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getProposalApprovalData } from '../../services/payment/tangle-service/proposal/ProposalApporvalService'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/proposal/create.proposal.ts b/packages/functions/src/controls/proposal/create.proposal.ts index 53a6b2f2f5..46bea80a45 100644 --- a/packages/functions/src/controls/proposal/create.proposal.ts +++ b/packages/functions/src/controls/proposal/create.proposal.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Proposal, ProposalCreateRequest, SUB_COL } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createProposal } from '../../services/payment/tangle-service/proposal/ProposalCreateService'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/proposal/vote.on.proposal.ts b/packages/functions/src/controls/proposal/vote.on.proposal.ts index 44d398cf9d..de2e89f1cf 100644 --- a/packages/functions/src/controls/proposal/vote.on.proposal.ts +++ b/packages/functions/src/controls/proposal/vote.on.proposal.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, ProposalType, @@ -7,7 +8,6 @@ import { Transaction, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getProposal, getProposalMember, diff --git a/packages/functions/src/controls/rank/rank.control.ts b/packages/functions/src/controls/rank/rank.control.ts index 198494aab7..c8051b1d84 100644 --- a/packages/functions/src/controls/rank/rank.control.ts +++ b/packages/functions/src/controls/rank/rank.control.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, Rank, RankRequest, SUB_COL, Token, WenError } from '@build-5/interfaces'; import { set } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { hasStakedSoonTokens } from '../../services/stake.service'; import { getRankingSpace } from '../../utils/config.utils'; import { invalidArgument } from '../../utils/error.utils'; diff --git a/packages/functions/src/controls/space/member.accept.control.ts b/packages/functions/src/controls/space/member.accept.control.ts index a66cd7e4af..f448b7c00f 100644 --- a/packages/functions/src/controls/space/member.accept.control.ts +++ b/packages/functions/src/controls/space/member.accept.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, SpaceMember, SpaceMemberUpsertRequest, SUB_COL } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { acceptSpaceMember } from '../../services/payment/tangle-service/space/SpaceAcceptMemberService'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/space/member.block.control.ts b/packages/functions/src/controls/space/member.block.control.ts index ccb78ae903..46415c7014 100644 --- a/packages/functions/src/controls/space/member.block.control.ts +++ b/packages/functions/src/controls/space/member.block.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, SpaceMember, SpaceMemberUpsertRequest, SUB_COL } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getBlockMemberUpdateData } from '../../services/payment/tangle-service/space/SpaceBlockMemberService'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/space/member.decline.control.ts b/packages/functions/src/controls/space/member.decline.control.ts index d07e7baad1..1399d1e26d 100644 --- a/packages/functions/src/controls/space/member.decline.control.ts +++ b/packages/functions/src/controls/space/member.decline.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, SpaceMemberUpsertRequest } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/space/member.leave.control.ts b/packages/functions/src/controls/space/member.leave.control.ts index d1e79c1fc1..0a7b52e38d 100644 --- a/packages/functions/src/controls/space/member.leave.control.ts +++ b/packages/functions/src/controls/space/member.leave.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, SpaceLeaveRequest } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getLeaveSpaceData } from '../../services/payment/tangle-service/space/SpaceLeaveService'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/space/member.unblock.control.ts b/packages/functions/src/controls/space/member.unblock.control.ts index a4db6d4be0..038a482393 100644 --- a/packages/functions/src/controls/space/member.unblock.control.ts +++ b/packages/functions/src/controls/space/member.unblock.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, SpaceMemberUpsertRequest } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/space/space.claim.control.ts b/packages/functions/src/controls/space/space.claim.control.ts index be247e75ef..d54ffe9093 100644 --- a/packages/functions/src/controls/space/space.claim.control.ts +++ b/packages/functions/src/controls/space/space.claim.control.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -11,7 +12,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { WalletService } from '../../services/wallet/wallet.service'; import { generateRandomAmount } from '../../utils/common.utils'; import { dateToTimestamp } from '../../utils/dateTime.utils'; diff --git a/packages/functions/src/controls/space/space.create.control.ts b/packages/functions/src/controls/space/space.create.control.ts index 4ef53cd866..ee4127b618 100644 --- a/packages/functions/src/controls/space/space.create.control.ts +++ b/packages/functions/src/controls/space/space.create.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, Space, SpaceCreateRequest } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getCreateSpaceData } from '../../services/payment/tangle-service/space/SpaceCreateService'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/space/space.guardian.edit.control.ts b/packages/functions/src/controls/space/space.guardian.edit.control.ts index d93e117896..2d9025ab7e 100644 --- a/packages/functions/src/controls/space/space.guardian.edit.control.ts +++ b/packages/functions/src/controls/space/space.guardian.edit.control.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Proposal, @@ -5,7 +6,6 @@ import { SUB_COL, SpaceMemberUpsertRequest, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { addRemoveGuardian } from '../../services/payment/tangle-service/space/SpaceGuardianService'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/space/space.join.control.ts b/packages/functions/src/controls/space/space.join.control.ts index bac7cda9fc..17bd2b63a4 100644 --- a/packages/functions/src/controls/space/space.join.control.ts +++ b/packages/functions/src/controls/space/space.join.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Space, SpaceJoinRequest, SUB_COL, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getJoinSpaceData } from '../../services/payment/tangle-service/space/SpaceJoinService'; import { invalidArgument } from '../../utils/error.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/space/space.update.control.ts b/packages/functions/src/controls/space/space.update.control.ts index 04b177a02a..51efec6929 100644 --- a/packages/functions/src/controls/space/space.update.control.ts +++ b/packages/functions/src/controls/space/space.update.control.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseProposalAnswerValue, COL, @@ -17,7 +18,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { get, startCase } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { cleanupParams } from '../../utils/schema.utils'; diff --git a/packages/functions/src/controls/stake/stake.deposit.ts b/packages/functions/src/controls/stake/stake.deposit.ts index 1db5584b5d..9e6f320db5 100644 --- a/packages/functions/src/controls/stake/stake.deposit.ts +++ b/packages/functions/src/controls/stake/stake.deposit.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, StakeType, TokenStakeRequest } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createStakeOrder } from '../../services/payment/tangle-service/token/stake.service'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/stake/stake.reward.revoke.ts b/packages/functions/src/controls/stake/stake.reward.revoke.ts index 4d0e5b00a7..d216e3fbb9 100644 --- a/packages/functions/src/controls/stake/stake.reward.revoke.ts +++ b/packages/functions/src/controls/stake/stake.reward.revoke.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseProposalAnswerValue, COL, @@ -18,7 +19,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { uniq } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp, serverTime } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; diff --git a/packages/functions/src/controls/stake/stake.reward.ts b/packages/functions/src/controls/stake/stake.reward.ts index a2c4bc79cf..d670c42a23 100644 --- a/packages/functions/src/controls/stake/stake.reward.ts +++ b/packages/functions/src/controls/stake/stake.reward.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, StakeReward, @@ -7,7 +8,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; diff --git a/packages/functions/src/controls/token-minting/airdrop-minted-token.ts b/packages/functions/src/controls/token-minting/airdrop-minted-token.ts index 1a28c2b525..69757f1fe5 100644 --- a/packages/functions/src/controls/token-minting/airdrop-minted-token.ts +++ b/packages/functions/src/controls/token-minting/airdrop-minted-token.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, CreateAirdropsRequest, @@ -16,7 +17,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { chunk } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { WalletService } from '../../services/wallet/wallet.service'; import { packBasicOutput } from '../../utils/basic-output.utils'; import { dateToTimestamp } from '../../utils/dateTime.utils'; diff --git a/packages/functions/src/controls/token-minting/claim-minted-token.control.ts b/packages/functions/src/controls/token-minting/claim-minted-token.control.ts index d155bbbd87..bb7de882a3 100644 --- a/packages/functions/src/controls/token-minting/claim-minted-token.control.ts +++ b/packages/functions/src/controls/token-minting/claim-minted-token.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, ClaimAirdroppedTokensRequest } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createMintedTokenAirdropCalimOrder } from '../../services/payment/tangle-service/token/token-claim.service'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/token-minting/import-minted-token.ts b/packages/functions/src/controls/token-minting/import-minted-token.ts index 0fd8d24253..1bad7e0782 100644 --- a/packages/functions/src/controls/token-minting/import-minted-token.ts +++ b/packages/functions/src/controls/token-minting/import-minted-token.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, ImportMintedTokenRequest, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { WalletService } from '../../services/wallet/wallet.service'; import { generateRandomAmount } from '../../utils/common.utils'; import { dateToTimestamp } from '../../utils/dateTime.utils'; diff --git a/packages/functions/src/controls/token-minting/token-mint.control.ts b/packages/functions/src/controls/token-minting/token-mint.control.ts index 2139b52210..27b07a405c 100644 --- a/packages/functions/src/controls/token-minting/token-mint.control.ts +++ b/packages/functions/src/controls/token-minting/token-mint.control.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -14,7 +15,6 @@ import { } from '@build-5/interfaces'; import { Utils } from '@iota/sdk'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { Wallet } from '../../services/wallet/wallet'; import { AddressDetails, WalletService } from '../../services/wallet/wallet.service'; import { assertMemberHasValidAddress } from '../../utils/address.utils'; diff --git a/packages/functions/src/controls/token-trading/token-trade-cancel.controller.ts b/packages/functions/src/controls/token-trading/token-trade-cancel.controller.ts index b836db3054..d99c7be3c2 100644 --- a/packages/functions/src/controls/token-trading/token-trade-cancel.controller.ts +++ b/packages/functions/src/controls/token-trading/token-trade-cancel.controller.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, CancelTokenTradeOrderRequest, @@ -5,7 +6,6 @@ import { TokenTradeOrderStatus, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { cancelTradeOrderUtil } from '../../utils/token-trade.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/token-trading/token-trade.controller.ts b/packages/functions/src/controls/token-trading/token-trade.controller.ts index fdb062e1cd..1f533f2ae5 100644 --- a/packages/functions/src/controls/token-trading/token-trade.controller.ts +++ b/packages/functions/src/controls/token-trading/token-trade.controller.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, @@ -6,7 +7,6 @@ import { TradeTokenRequest, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createTokenTradeOrder } from '../../services/payment/tangle-service/token/token-trade.service'; import { invalidArgument } from '../../utils/error.utils'; import { getTokenBySymbol } from '../../utils/token.utils'; diff --git a/packages/functions/src/controls/token/token.airdrop.claim.ts b/packages/functions/src/controls/token/token.airdrop.claim.ts index 2344afe542..8f346922a2 100644 --- a/packages/functions/src/controls/token/token.airdrop.claim.ts +++ b/packages/functions/src/controls/token/token.airdrop.claim.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, ClaimPreMintedAirdroppedTokensRequest, @@ -13,7 +14,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { WalletService } from '../../services/wallet/wallet.service'; import { generateRandomAmount } from '../../utils/common.utils'; import { dateToTimestamp } from '../../utils/dateTime.utils'; diff --git a/packages/functions/src/controls/token/token.airdrop.ts b/packages/functions/src/controls/token/token.airdrop.ts index 4558a3ee6d..7d01c5b2ad 100644 --- a/packages/functions/src/controls/token/token.airdrop.ts +++ b/packages/functions/src/controls/token/token.airdrop.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, CreateAirdropsRequest, @@ -10,7 +11,6 @@ import { WenError, } from '@build-5/interfaces'; import { chunk } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian, assertTokenApproved, assertTokenStatus } from '../../utils/token.utils'; diff --git a/packages/functions/src/controls/token/token.cancel.pub.sale.ts b/packages/functions/src/controls/token/token.cancel.pub.sale.ts index ea506aca5e..c5b8536317 100644 --- a/packages/functions/src/controls/token/token.cancel.pub.sale.ts +++ b/packages/functions/src/controls/token/token.cancel.pub.sale.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, CanelPublicSaleRequest, Token, TokenStatus, WenError } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/token/token.create.ts b/packages/functions/src/controls/token/token.create.ts index 1379a33119..3492b186d5 100644 --- a/packages/functions/src/controls/token/token.create.ts +++ b/packages/functions/src/controls/token/token.create.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -8,7 +9,6 @@ import { WenError, } from '@build-5/interfaces'; import { merge } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { hasStakedSoonTokens } from '../../services/stake.service'; import { assertSpaceHasValidAddress } from '../../utils/address.utils'; import { isProdEnv } from '../../utils/config.utils'; diff --git a/packages/functions/src/controls/token/token.credit.ts b/packages/functions/src/controls/token/token.credit.ts index e5822f0396..9d098fc82b 100644 --- a/packages/functions/src/controls/token/token.credit.ts +++ b/packages/functions/src/controls/token/token.credit.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, CreditTokenRequest, @@ -13,7 +14,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getAddress } from '../../utils/address.utils'; import { invalidArgument } from '../../utils/error.utils'; import { diff --git a/packages/functions/src/controls/token/token.enable.trading.ts b/packages/functions/src/controls/token/token.enable.trading.ts index 276c45f70a..d1014a56ec 100644 --- a/packages/functions/src/controls/token/token.enable.trading.ts +++ b/packages/functions/src/controls/token/token.enable.trading.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, EnableTokenTradingRequest, Token, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian } from '../../utils/token.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/controls/token/token.order.ts b/packages/functions/src/controls/token/token.order.ts index e8059f9cbf..fd050f4e3e 100644 --- a/packages/functions/src/controls/token/token.order.ts +++ b/packages/functions/src/controls/token/token.order.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -14,7 +15,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { assertHasAccess } from '../../services/validators/access'; import { WalletService } from '../../services/wallet/wallet.service'; import { assertMemberHasValidAddress, getAddress } from '../../utils/address.utils'; diff --git a/packages/functions/src/controls/token/token.set.for.sale.ts b/packages/functions/src/controls/token/token.set.for.sale.ts index 38dcd50b15..1de2153a71 100644 --- a/packages/functions/src/controls/token/token.set.for.sale.ts +++ b/packages/functions/src/controls/token/token.set.for.sale.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, SetTokenForSaleRequest, Token, TokenStatus, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { invalidArgument } from '../../utils/error.utils'; import { assertIsGuardian, assertTokenApproved, assertTokenStatus } from '../../utils/token.utils'; diff --git a/packages/functions/src/controls/token/token.update.ts b/packages/functions/src/controls/token/token.update.ts index 1dfd916698..0231334455 100644 --- a/packages/functions/src/controls/token/token.update.ts +++ b/packages/functions/src/controls/token/token.update.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Token, TokenStatus, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; import { assertValidationAsync } from '../../utils/schema.utils'; import { assertIsGuardian, assertTokenStatus } from '../../utils/token.utils'; diff --git a/packages/functions/src/controls/vote/vote.control.ts b/packages/functions/src/controls/vote/vote.control.ts index 63455c60be..306d98b830 100644 --- a/packages/functions/src/controls/vote/vote.control.ts +++ b/packages/functions/src/controls/vote/vote.control.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, SUB_COL, Token, Vote, VoteRequest, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { hasStakedSoonTokens } from '../../services/stake.service'; import { invalidArgument } from '../../utils/error.utils'; import { Context } from '../common'; diff --git a/packages/functions/src/cron/award.cron.ts b/packages/functions/src/cron/award.cron.ts index efd9ada03f..9c0646059b 100644 --- a/packages/functions/src/cron/award.cron.ts +++ b/packages/functions/src/cron/award.cron.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { Award, COL } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../firebase/firestore/build5Db'; export const processExpiredAwards = async () => { const snap = await build5Db() diff --git a/packages/functions/src/cron/bitfinex.cron.ts b/packages/functions/src/cron/bitfinex.cron.ts index 39ed4d68b7..a071adec06 100644 --- a/packages/functions/src/cron/bitfinex.cron.ts +++ b/packages/functions/src/cron/bitfinex.cron.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, TICKERS } from '@build-5/interfaces'; import axios from 'axios'; -import { build5Db } from '../firebase/firestore/build5Db'; export const getLatestBitfinexPricesCron = async () => { try { diff --git a/packages/functions/src/cron/collection.floor.price.cron.ts b/packages/functions/src/cron/collection.floor.price.cron.ts index daf113106b..caa7706642 100644 --- a/packages/functions/src/cron/collection.floor.price.cron.ts +++ b/packages/functions/src/cron/collection.floor.price.cron.ts @@ -1,6 +1,6 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, Collection, Nft, NftAccess, NftAvailable } from '@build-5/interfaces'; import { head, last } from 'lodash'; -import { build5Db, getSnapshot } from '../firebase/firestore/build5Db'; export const updateFloorPriceOnCollections = async () => { let lastUid = ''; diff --git a/packages/functions/src/cron/media.cron.ts b/packages/functions/src/cron/media.cron.ts index 6ff9b55f91..ab390c13fa 100644 --- a/packages/functions/src/cron/media.cron.ts +++ b/packages/functions/src/cron/media.cron.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -8,7 +9,6 @@ import { Space, Token, } from '@build-5/interfaces'; -import { build5Db } from '../firebase/firestore/build5Db'; import { awardToIpfsMetadata } from '../services/payment/award/award-service'; import { collectionToIpfsMetadata, diff --git a/packages/functions/src/cron/nft.cron.ts b/packages/functions/src/cron/nft.cron.ts index b8109edbfa..1daed5d0e7 100644 --- a/packages/functions/src/cron/nft.cron.ts +++ b/packages/functions/src/cron/nft.cron.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Nft } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../firebase/firestore/build5Db'; import { ProcessingService } from '../services/payment/payment-processing'; const finalizeNftAuction = (nftId: string) => diff --git a/packages/functions/src/cron/nftStake.cron.ts b/packages/functions/src/cron/nftStake.cron.ts index 8261cb614e..1ef8e04c61 100644 --- a/packages/functions/src/cron/nftStake.cron.ts +++ b/packages/functions/src/cron/nftStake.cron.ts @@ -1,7 +1,7 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, NftStake } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { last } from 'lodash'; -import { build5Db, getSnapshot } from '../firebase/firestore/build5Db'; export const processExpiredNftStakes = async () => { let lastDocId = ''; diff --git a/packages/functions/src/cron/orders.cron.ts b/packages/functions/src/cron/orders.cron.ts index 7541f1027d..6c1f6fb3dc 100644 --- a/packages/functions/src/cron/orders.cron.ts +++ b/packages/functions/src/cron/orders.cron.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Transaction, TransactionType } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../firebase/firestore/build5Db'; import { ProcessingService } from '../services/payment/payment-processing'; export const voidExpiredOrdersCron = async () => { diff --git a/packages/functions/src/cron/proposal.cron.ts b/packages/functions/src/cron/proposal.cron.ts index 0f3d44f114..ff2643772f 100644 --- a/packages/functions/src/cron/proposal.cron.ts +++ b/packages/functions/src/cron/proposal.cron.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Proposal } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../firebase/firestore/build5Db'; export const markExpiredProposalCompleted = async () => { let size = 0; diff --git a/packages/functions/src/cron/stake.cron.ts b/packages/functions/src/cron/stake.cron.ts index d9c9df9db6..5bbd682df0 100644 --- a/packages/functions/src/cron/stake.cron.ts +++ b/packages/functions/src/cron/stake.cron.ts @@ -1,7 +1,7 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, Stake, SUB_COL } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { last } from 'lodash'; -import { build5Db, getSnapshot } from '../firebase/firestore/build5Db'; import { onStakeExpired } from '../services/stake.service'; import { dateToTimestamp } from '../utils/dateTime.utils'; diff --git a/packages/functions/src/cron/stakeReward.cron.ts b/packages/functions/src/cron/stakeReward.cron.ts index eb7664a9f6..e878e5fabc 100644 --- a/packages/functions/src/cron/stakeReward.cron.ts +++ b/packages/functions/src/cron/stakeReward.cron.ts @@ -1,3 +1,4 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, Entity, @@ -17,7 +18,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty, last } from 'lodash'; -import { build5Db, getSnapshot } from '../firebase/firestore/build5Db'; import { serverTime } from '../utils/dateTime.utils'; import { getRandomEthAddress } from '../utils/wallet.utils'; export const stakeRewardCronTask = async () => { diff --git a/packages/functions/src/cron/token.cron.ts b/packages/functions/src/cron/token.cron.ts index 034abe8f1b..d39218887a 100644 --- a/packages/functions/src/cron/token.cron.ts +++ b/packages/functions/src/cron/token.cron.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Token, @@ -7,7 +8,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../firebase/firestore/build5Db'; import { guardedRerun } from '../utils/common.utils'; import { dateToTimestamp, serverTime } from '../utils/dateTime.utils'; import { cancelTradeOrderUtil } from '../utils/token-trade.utils'; diff --git a/packages/functions/src/cron/token.purchase.cron.ts b/packages/functions/src/cron/token.purchase.cron.ts index b4d59b1384..4aff160f94 100644 --- a/packages/functions/src/cron/token.purchase.cron.ts +++ b/packages/functions/src/cron/token.purchase.cron.ts @@ -1,7 +1,7 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, TokenPurchase, TokenPurchaseAge } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { chunk } from 'lodash'; -import { build5Db } from '../firebase/firestore/build5Db'; export const removePurchasesFromVolumeStats = async () => { for (const age of Object.values(TokenPurchaseAge)) { diff --git a/packages/functions/src/cron/wallet.cron.ts b/packages/functions/src/cron/wallet.cron.ts index 2f80ffac4b..1d125efc45 100644 --- a/packages/functions/src/cron/wallet.cron.ts +++ b/packages/functions/src/cron/wallet.cron.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, MAX_WALLET_RETRY, @@ -5,8 +6,6 @@ import { Transaction, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../firebase/firestore/build5Db'; -import { ITransaction } from '../firebase/firestore/interfaces'; export const retryWallet = async () => { const snap = await getFailedTransactionsSnap(); diff --git a/packages/functions/src/firebase/app/app.ts b/packages/functions/src/firebase/app/app.ts deleted file mode 100644 index 37daffe138..0000000000 --- a/packages/functions/src/firebase/app/app.ts +++ /dev/null @@ -1,11 +0,0 @@ -import admin from 'firebase-admin'; -import { IApp } from './interface'; - -export class FirebaseApp implements IApp { - constructor(private readonly app: admin.app.App) {} - - /* eslint-disable @typescript-eslint/no-explicit-any */ - public getInstance = (): any => this.app; - - public getName = () => this.app.options.projectId!; -} diff --git a/packages/functions/src/firebase/app/build5App.ts b/packages/functions/src/firebase/app/build5App.ts deleted file mode 100644 index 5ead12915a..0000000000 --- a/packages/functions/src/firebase/app/build5App.ts +++ /dev/null @@ -1,8 +0,0 @@ -import admin from 'firebase-admin'; -import { FirebaseApp } from './app'; - -admin.initializeApp(); - -export default admin; - -export const build5App = () => new FirebaseApp(admin.app()); diff --git a/packages/functions/src/firebase/app/interface.ts b/packages/functions/src/firebase/app/interface.ts deleted file mode 100644 index de8e3866b7..0000000000 --- a/packages/functions/src/firebase/app/interface.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IApp { - /* eslint-disable @typescript-eslint/no-explicit-any */ - getInstance: () => any; - getName: () => string; -} diff --git a/packages/functions/src/firebase/firestore/build5Db.ts b/packages/functions/src/firebase/firestore/build5Db.ts deleted file mode 100644 index f351bea971..0000000000 --- a/packages/functions/src/firebase/firestore/build5Db.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { COL, PublicCollections, PublicSubCollections, SUB_COL } from '@build-5/interfaces'; -import { build5App } from '../app/build5App'; -import { Firestore } from './firestore'; -import { IDatabase } from './interfaces'; - -export const build5Db = (): IDatabase => new Firestore(build5App()); - -export const getSnapshot = ( - col: COL | PublicCollections, - id?: string, - subCol?: SUB_COL | PublicSubCollections, - childId?: string, -) => { - if (!id) { - return; - } - let doc = build5Db().doc(`${col}/${id}`); - if (subCol && childId) { - doc = doc.collection(subCol).doc(childId); - } - return doc.getSnapshot(); -}; diff --git a/packages/functions/src/firebase/firestore/common.ts b/packages/functions/src/firebase/firestore/common.ts deleted file mode 100644 index 2a7e391f90..0000000000 --- a/packages/functions/src/firebase/firestore/common.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { SOON_PROD_ADDRESS, SOON_TEST_ADDRESS } from '@build-5/interfaces'; -import dayjs from 'dayjs'; -import { get } from 'lodash'; -import { isProdEnv } from '../../utils/config.utils'; -import { IDocument } from './interfaces'; - -export const cOn = (doc: IDocument, data: T) => { - const url = isProdEnv() ? SOON_PROD_ADDRESS : SOON_TEST_ADDRESS; - return { - ...data, - wenUrl: url + doc.getPath(), - createdOn: get(data, 'createdOn') || dayjs().toDate(), - updatedOn: get(data, 'updatedOn') || dayjs().toDate(), - }; -}; - -export const uOn = (data: T) => ({ ...data, updatedOn: dayjs().toDate() }); diff --git a/packages/functions/src/firebase/firestore/firestore.ts b/packages/functions/src/firebase/firestore/firestore.ts deleted file mode 100644 index 04a935c99b..0000000000 --- a/packages/functions/src/firebase/firestore/firestore.ts +++ /dev/null @@ -1,274 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { COL, PublicCollections, PublicSubCollections, SUB_COL } from '@build-5/interfaces'; -import admin from 'firebase-admin'; -import { isEmpty } from 'lodash'; -import { FirebaseApp } from '../app/app'; -import { cOn, uOn } from './common'; -import { - IBatch, - ICollection, - ICollectionGroup, - IDatabase, - IDocument, - IDocumentSnapshot, - IQuery, - ITransaction, -} from './interfaces'; - -export class Firestore implements IDatabase { - private db: admin.firestore.Firestore; - - constructor(private readonly app: FirebaseApp) { - this.db = this.app.getInstance().firestore(); - } - - public collection = (col: COL | PublicCollections) => - new FirestoreCollection(this.db, this.db.collection(col)); - - public collectionGroup = (col: SUB_COL | PublicSubCollections) => - new FirestoreCollectionGroup(this.db.collectionGroup(col)); - - public doc = (documentPath: string) => new FirestoreDocument(this.db, this.db.doc(documentPath)); - - public batch = (): IBatch => new FirestoreBatch(this.db); - - public runTransaction = ( - func: (transaction: FirestoreTransaction) => Promise, - ): Promise => - this.db.runTransaction((transaction) => func(new FirestoreTransaction(this.db, transaction))); - - public inc = (value: number) => admin.firestore.FieldValue.increment(value); - - public arrayUnion = (...value: T[]) => admin.firestore.FieldValue.arrayUnion(...value); - - public arrayRemove = (...value: T[]) => admin.firestore.FieldValue.arrayRemove(...value); - - public deleteField = () => admin.firestore.FieldValue.delete(); -} - -export class FirestoreBatch implements IBatch { - private batch: admin.firestore.WriteBatch; - - constructor(private readonly db: admin.firestore.Firestore) { - this.batch = db.batch(); - } - - public create = (docRef: IDocument, data: any) => { - const ref = this.db.doc(docRef.getPath()); - this.batch.create(ref, cOn(docRef, data)); - }; - - public update = (docRef: IDocument, data: any) => { - const ref = this.db.doc(docRef.getPath()); - this.batch.update(ref, uOn(data)); - }; - - public set = (docRef: IDocument, data: any, merge = false) => { - const ref = this.db.doc(docRef.getPath()); - this.batch.set(ref, merge ? uOn(data) : cOn(docRef, data), { merge }); - }; - - public delete = (docRef: IDocument) => { - const ref = this.db.doc(docRef.getPath()); - this.batch.delete(ref); - }; - - public commit = async () => { - await this.batch.commit(); - }; -} - -export class FirestoreTransaction implements ITransaction { - constructor( - private readonly db: admin.firestore.Firestore, - private readonly transaction: admin.firestore.Transaction, - ) {} - - public get = async (docRef: IDocument) => { - const refs = this.db.doc(docRef.getPath()); - const doc = await this.transaction.get(refs); - return doc.data(); - }; - - public getAll = async (...docRefs: IDocument[]) => { - if (isEmpty(docRefs)) { - return []; - } - const refs = docRefs.map((docRef) => this.db.doc(docRef.getPath())); - const snap = await this.transaction.getAll(...refs); - return snap.map((doc) => doc.data() as T | undefined); - }; - - public getByQuery = async (query: IQuery) => { - const snap = await this.transaction.get(query.getInstance()); - return snap.docs.map((d) => d.data() as T); - }; - - public create = (docRef: IDocument, data: any) => { - const ref = this.db.doc(docRef.getPath()); - this.transaction.create(ref, cOn(docRef, data)); - }; - - public update = (docRef: IDocument, data: any) => { - const ref = this.db.doc(docRef.getPath()); - this.transaction.update(ref, uOn(data)); - }; - - public set = (docRef: IDocument, data: any, merge = false) => { - const ref = this.db.doc(docRef.getPath()); - const uData = merge ? uOn(data) : cOn(docRef, data); - this.transaction.set(ref, uData, { merge }); - }; - - public delete = (docRef: IDocument) => { - const ref = this.db.doc(docRef.getPath()); - this.transaction.delete(ref); - }; -} - -class FirestoreCollectionGroup implements ICollectionGroup { - constructor( - protected readonly collection: - | admin.firestore.CollectionGroup - | admin.firestore.CollectionReference, - ) {} - - public get = async () => { - const snap = await this.collection.get(); - return snap.docs.map((d) => d.data() as T); - }; - - public where = (fieldPath: string, operator: admin.firestore.WhereFilterOp, value: any) => - new FirestoreQuery(this.collection.where(fieldPath, operator, value)); - - public limit = (value: number) => new FirestoreQuery(this.collection.limit(value)); - - public startAfter = (value?: IDocumentSnapshot | string | number | Date) => { - if (!value) { - return new FirestoreQuery(this.collection); - } - return new FirestoreQuery(this.collection.startAfter(value)); - }; - - public orderBy = (field: string, dir: 'asc' | 'desc' = 'asc') => - new FirestoreQuery(this.collection.orderBy(field, dir)); - - public count = async () => (await this.collection.count().get()).data().count; -} - -export class FirestoreCollection extends FirestoreCollectionGroup implements ICollection { - constructor( - private readonly db: admin.firestore.Firestore, - collection: admin.firestore.CollectionReference, - ) { - super(collection); - } - - public doc = (documentPath = '') => { - const colRef = this.collection as admin.firestore.CollectionReference; - const docRef = documentPath ? colRef.doc(documentPath) : colRef.doc(); - return new FirestoreDocument(this.db, docRef); - }; -} - -export class FirestoreDocument implements IDocument { - constructor( - private readonly db: admin.firestore.Firestore, - private readonly document: admin.firestore.DocumentReference, - ) {} - - public create = async (data: any) => { - await this.document.create(cOn(this, data)); - }; - - public update = async (data: any) => { - await this.document.update(uOn(data)); - }; - - public set = async (data: any, merge = false) => { - await this.document.set(merge ? uOn(data) : cOn(this, data), { merge }); - }; - - public delete = async () => { - await this.document.delete(); - }; - - public onSnapshot = ( - callback: (data: T | undefined) => void, - onError?: (error: Error) => void, - ) => - this.document.onSnapshot( - (snap) => { - callback(snap.exists ? ({ ...snap.data(), uid: snap.id } as T) : undefined); - }, - (error) => { - onError && onError(error); - }, - ); - - public collection = (subCol: SUB_COL | PublicSubCollections): ICollection => - new FirestoreCollection(this.db, this.document.collection(subCol)); - - public get = async (): Promise => { - const doc = await this.document.get(); - return doc.data(); - }; - - public getPath = () => this.document.path; - - public getSnapshot = () => this.document.get(); - - public getId = () => this.document.id; -} - -export class FirestoreQuery implements IQuery { - constructor(private query: admin.firestore.Query) {} - - public get = async (): Promise => { - const snap = await this.query.get(); - return snap.docs.map((d) => ({ ...d.data(), uid: d.id } as T)); - }; - - public where = ( - fieldPath: string, - operator: admin.firestore.WhereFilterOp, - value: any, - ): IQuery => { - this.query = this.query.where(fieldPath, operator, value); - return this; - }; - - public limit = (value: number) => { - this.query = this.query.limit(value); - return this; - }; - - public startAfter = (value?: IDocumentSnapshot | string | number | Date) => { - if (value) { - this.query = this.query.startAfter(value); - } - return this; - }; - - public orderBy = (field: string, dir: 'asc' | 'desc' = 'asc') => { - this.query = this.query.orderBy(field, dir); - return this; - }; - - public select = (...fields: string[]) => { - this.query = this.query.select(...fields); - return this; - }; - - public onSnapshot = (callback: (data: T[]) => void, onError?: (error: Error) => void) => - this.query.onSnapshot( - (snap) => { - callback(snap.docs.map((d) => ({ ...d.data(), uid: d.id } as T))); - }, - (error) => { - onError && onError(error); - }, - ); - - public getInstance = () => this.query; -} diff --git a/packages/functions/src/firebase/firestore/interfaces.ts b/packages/functions/src/firebase/firestore/interfaces.ts deleted file mode 100644 index 41189e1cbb..0000000000 --- a/packages/functions/src/firebase/firestore/interfaces.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { COL, PublicCollections, PublicSubCollections, SUB_COL } from '@build-5/interfaces'; - -export interface IDatabase { - collection: (col: COL | PublicCollections) => ICollection; - collectionGroup: (col: SUB_COL | PublicSubCollections) => ICollectionGroup; - doc: (documentPath: string) => IDocument; - - batch: () => IBatch; - runTransaction: (func: (transaction: ITransaction) => Promise) => Promise; - - inc: (value: number) => any; - arrayUnion: (...value: T[]) => any; - arrayRemove: (...value: T[]) => any; - deleteField: () => any; -} - -export interface ICollectionGroup { - get: () => Promise; - where: (fieldPath: string, operator: WhereFilterOp, value: any) => IQuery; - limit: (value: number) => IQuery; - startAfter: (value?: IDocumentSnapshot | string | number | Date) => IQuery; - orderBy: (field: string, dir?: 'asc' | 'desc') => IQuery; - count: () => Promise; -} - -export interface ICollection extends ICollectionGroup { - doc: (documentPath?: string) => IDocument; -} - -export interface IDocument { - create: (data: any) => Promise; - update: (data: any) => Promise; - set: (data: any, merge?: boolean) => Promise; - delete: () => Promise; - - onSnapshot: ( - callback: (data: T | undefined) => void, - error?: (error: Error) => void, - ) => () => void; - - collection: (subCol: SUB_COL | PublicSubCollections) => ICollection; - get: () => Promise; - - getPath: () => string; - getSnapshot: () => Promise; - - getId: () => string; -} - -export interface IDocumentSnapshot { - readonly id: string; -} - -export interface IQuery { - get: () => Promise; - where: (fieldPath: string, operator: WhereFilterOp, value: any) => IQuery; - - limit: (value: number) => IQuery; - startAfter: (value?: IDocumentSnapshot | string | number | Date) => IQuery; - onSnapshot: (callback: (data: T[]) => void, error?: (error: Error) => void) => () => void; - - getInstance: () => any; - - orderBy: (field: string, dir?: 'asc' | 'desc') => IQuery; - - select: (...fields: string[]) => IQuery; -} - -export interface IBatch { - create: (docRef: IDocument, data: any) => void; - update: (docRef: IDocument, data: any) => void; - set: (docRef: IDocument, data: any, merge?: boolean) => void; - delete: (docRef: IDocument) => void; - commit: () => Promise; -} - -export interface ITransaction { - get: (docRef: IDocument) => Promise; - getAll: (...docRefs: IDocument[]) => Promise<(T | undefined)[]>; - getByQuery: (query: IQuery) => Promise; - create: (docRef: IDocument, data: any) => void; - update: (docRef: IDocument, data: any) => void; - set: (docRef: IDocument, data: any, merge?: boolean) => void; - delete: (docRef: IDocument) => void; -} - -export type WhereFilterOp = - | '<' - | '<=' - | '==' - | '!=' - | '>=' - | '>' - | 'array-contains' - | 'in' - | 'not-in' - | 'array-contains-any'; diff --git a/packages/functions/src/firebase/storage/build5Storage.ts b/packages/functions/src/firebase/storage/build5Storage.ts deleted file mode 100644 index 377b50d13b..0000000000 --- a/packages/functions/src/firebase/storage/build5Storage.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { build5App } from '../app/build5App'; -import { IStorage } from './interfaces'; -import { FirebaseStorage } from './storage'; - -export const build5Storage = (): IStorage => new FirebaseStorage(build5App()); diff --git a/packages/functions/src/firebase/storage/interfaces.ts b/packages/functions/src/firebase/storage/interfaces.ts deleted file mode 100644 index 18bbee12c3..0000000000 --- a/packages/functions/src/firebase/storage/interfaces.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Bucket } from '@build-5/interfaces'; - -export interface IStorage { - bucket: (name: string) => IBucket; -} - -export interface IBucket { - getName: () => Bucket; - upload: (path: string, destination: string, metadata: Record) => Promise; - download: (fileName: string, destination: string) => Promise; - exists: (fileName: string) => Promise; - getFilesCount: (directory: string) => Promise; -} diff --git a/packages/functions/src/firebase/storage/storage.ts b/packages/functions/src/firebase/storage/storage.ts deleted file mode 100644 index 5cd010b203..0000000000 --- a/packages/functions/src/firebase/storage/storage.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Bucket } from '@build-5/interfaces'; -import { Bucket as FBucket } from '@google-cloud/storage'; -import { Storage } from 'firebase-admin/storage'; -import { FirebaseApp } from '../app/app'; -import { IBucket, IStorage } from './interfaces'; - -export class FirebaseStorage implements IStorage { - private readonly storage: Storage; - - constructor(private readonly app: FirebaseApp) { - this.storage = this.app.getInstance().storage(); - } - - public bucket = (name: string) => new FirebaseBucket(this.storage, name as Bucket); -} - -export class FirebaseBucket implements IBucket { - private readonly bucket: FBucket; - - constructor(private readonly storage: Storage, private readonly name: Bucket) { - this.bucket = this.storage.bucket(this.name); - } - - public getName = () => this.name; - - public upload = async (path: string, destination: string, metadata: Record) => { - const response = await this.bucket.upload(path, { destination, metadata }); - return response[1].mediaLink; - }; - - public download = async (fileName: string, destination: string) => { - await this.bucket.file(fileName).download({ destination }); - }; - - public exists = async (fileName: string) => (await this.bucket.file(fileName).exists())[0]; - - public getFilesCount = async (directory: string) => { - const files = await this.bucket.getFiles({ prefix: directory }); - return files[0].length; - }; -} diff --git a/packages/functions/src/services/payment/address-service.ts b/packages/functions/src/services/payment/address-service.ts index 96ed8e9dc4..e7d3531926 100644 --- a/packages/functions/src/services/payment/address-service.ts +++ b/packages/functions/src/services/payment/address-service.ts @@ -1,3 +1,4 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { BaseProposalAnswerValue, COL, @@ -17,7 +18,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { last } from 'lodash'; -import { build5Db, getSnapshot } from '../../firebase/firestore/build5Db'; import { getAddress } from '../../utils/address.utils'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { getRandomEthAddress } from '../../utils/wallet.utils'; diff --git a/packages/functions/src/services/payment/award/award-service.ts b/packages/functions/src/services/payment/award/award-service.ts index b8bc19499a..72f1534917 100644 --- a/packages/functions/src/services/payment/award/award-service.ts +++ b/packages/functions/src/services/payment/award/award-service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, AwardBadgeType, @@ -13,7 +14,6 @@ import { import { AliasAddress, Ed25519Address, NftAddress } from '@iota/sdk'; import dayjs from 'dayjs'; import { set } from 'lodash'; -import { build5Db } from '../../../firebase/firestore/build5Db'; import { packBasicOutput } from '../../../utils/basic-output.utils'; import { PLACEHOLDER_CID } from '../../../utils/car.utils'; import { createNftOutput } from '../../../utils/collection-minting-utils/nft.utils'; diff --git a/packages/functions/src/services/payment/credit-service.ts b/packages/functions/src/services/payment/credit-service.ts index e1f6745975..c95572bbbf 100644 --- a/packages/functions/src/services/payment/credit-service.ts +++ b/packages/functions/src/services/payment/credit-service.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Transaction, TransactionPayloadType, TransactionType } from '@build-5/interfaces'; import { get, isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getRandomEthAddress } from '../../utils/wallet.utils'; import { TransactionMatch, TransactionService } from './transaction-service'; diff --git a/packages/functions/src/services/payment/metadataNft-service.ts b/packages/functions/src/services/payment/metadataNft-service.ts index ece1d11349..f174f0e299 100644 --- a/packages/functions/src/services/payment/metadataNft-service.ts +++ b/packages/functions/src/services/payment/metadataNft-service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Access, COL, @@ -14,7 +15,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { get } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getCollectionByMintingId, getNftByMintingId, diff --git a/packages/functions/src/services/payment/nft/collection-minting-service.ts b/packages/functions/src/services/payment/nft/collection-minting-service.ts index 7d65b3bca9..bf507589c8 100644 --- a/packages/functions/src/services/payment/nft/collection-minting-service.ts +++ b/packages/functions/src/services/payment/nft/collection-minting-service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -7,7 +8,6 @@ import { UnsoldMintingOptions, } from '@build-5/interfaces'; import { get } from 'lodash'; -import { build5Db } from '../../../firebase/firestore/build5Db'; import { TransactionMatch, TransactionService } from '../transaction-service'; export class CollectionMintingService { diff --git a/packages/functions/src/services/payment/nft/nft-deposit-service.ts b/packages/functions/src/services/payment/nft/nft-deposit-service.ts index 16f40bf8c1..2d34b8ce6f 100644 --- a/packages/functions/src/services/payment/nft/nft-deposit-service.ts +++ b/packages/functions/src/services/payment/nft/nft-deposit-service.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db, build5Storage } from '@build-5/database'; import { Access, Award, @@ -20,9 +21,6 @@ import { } from '@build-5/interfaces'; import { NftOutput } from '@iota/sdk'; import { head, isEmpty, set } from 'lodash'; -import { build5Db } from '../../../firebase/firestore/build5Db'; -import { ITransaction } from '../../../firebase/firestore/interfaces'; -import { build5Storage } from '../../../firebase/storage/build5Storage'; import { getNftByMintingId } from '../../../utils/collection-minting-utils/nft.utils'; import { getBucket } from '../../../utils/config.utils'; import { serverTime } from '../../../utils/dateTime.utils'; diff --git a/packages/functions/src/services/payment/nft/nft-service.ts b/packages/functions/src/services/payment/nft/nft-service.ts index 6490a937ec..9eef20388e 100644 --- a/packages/functions/src/services/payment/nft/nft-service.ts +++ b/packages/functions/src/services/payment/nft/nft-service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -12,7 +13,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { last, set } from 'lodash'; -import { build5Db } from '../../../firebase/firestore/build5Db'; import { getAddress } from '../../../utils/address.utils'; import { dateToTimestamp, serverTime } from '../../../utils/dateTime.utils'; import { NotificationService } from '../../notification/notification'; @@ -208,7 +208,7 @@ export class NftService { previousHighestPay = (await this.transactionService.get(previousHighestPayRef))!; if ( - previousHighestPay.payload.amount! < paymentPayload.amount! && + previousHighestPay!.payload.amount! < paymentPayload.amount! && paymentPayload.amount! >= (nft?.auctionFloorPrice || 0) ) { newValidPayment = true; diff --git a/packages/functions/src/services/payment/nft/nft-stake-service.ts b/packages/functions/src/services/payment/nft/nft-stake-service.ts index 15c419844c..7d9ce02335 100644 --- a/packages/functions/src/services/payment/nft/nft-stake-service.ts +++ b/packages/functions/src/services/payment/nft/nft-stake-service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MilestoneTransactionEntry, @@ -20,7 +21,6 @@ import { } from '@iota/sdk'; import dayjs from 'dayjs'; import { cloneDeep, get } from 'lodash'; -import { build5Db } from '../../../firebase/firestore/build5Db'; import { intToU32 } from '../../../utils/common.utils'; import { dateToTimestamp } from '../../../utils/dateTime.utils'; import { getRandomEthAddress } from '../../../utils/wallet.utils'; diff --git a/packages/functions/src/services/payment/payment-processing.ts b/packages/functions/src/services/payment/payment-processing.ts index c597abd012..a895b41f68 100644 --- a/packages/functions/src/services/payment/payment-processing.ts +++ b/packages/functions/src/services/payment/payment-processing.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, Entity, @@ -11,8 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; -import { ITransaction } from '../../firebase/firestore/interfaces'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { AddressService } from './address-service'; import { AwardService } from './award/award-service'; diff --git a/packages/functions/src/services/payment/space/space-service.ts b/packages/functions/src/services/payment/space/space-service.ts index 2fcaee02ad..ecd8d007bb 100644 --- a/packages/functions/src/services/payment/space/space-service.ts +++ b/packages/functions/src/services/payment/space/space-service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -16,7 +17,6 @@ import { NftOutput, UnlockConditionType, } from '@iota/sdk'; -import { build5Db } from '../../../firebase/firestore/build5Db'; import { Bech32AddressHelper } from '../../../utils/bech32-address.helper'; import { serverTime } from '../../../utils/dateTime.utils'; import { WalletService } from '../../wallet/wallet.service'; diff --git a/packages/functions/src/services/payment/stake-service.ts b/packages/functions/src/services/payment/stake-service.ts index 209d5f33a4..b64ff0a5da 100644 --- a/packages/functions/src/services/payment/stake-service.ts +++ b/packages/functions/src/services/payment/stake-service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Entity, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { get } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../utils/dateTime.utils'; import { getRandomEthAddress } from '../../utils/wallet.utils'; import { TransactionMatch, TransactionService } from './transaction-service'; diff --git a/packages/functions/src/services/payment/tangle-service/TangleRequestService.ts b/packages/functions/src/services/payment/tangle-service/TangleRequestService.ts index 48c06c97d3..896015504e 100644 --- a/packages/functions/src/services/payment/tangle-service/TangleRequestService.ts +++ b/packages/functions/src/services/payment/tangle-service/TangleRequestService.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -9,7 +10,6 @@ import { WenError, } from '@build-5/interfaces'; import { get } from 'lodash'; -import { build5Db } from '../../../firebase/firestore/build5Db'; import { getOutputMetadata } from '../../../utils/basic-output.utils'; import { invalidArgument } from '../../../utils/error.utils'; import { getRandomNonce } from '../../../utils/wallet.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/address/address-validation.service.ts b/packages/functions/src/services/payment/tangle-service/address/address-validation.service.ts index bb277f6963..10b603b44e 100644 --- a/packages/functions/src/services/payment/tangle-service/address/address-validation.service.ts +++ b/packages/functions/src/services/payment/tangle-service/address/address-validation.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, @@ -14,7 +15,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { set } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { generateRandomAmount } from '../../../../utils/common.utils'; import { dateToTimestamp } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/award/award.approve.participant.service.ts b/packages/functions/src/services/payment/tangle-service/award/award.approve.participant.service.ts index db6f9cf37e..e18ef90eb0 100644 --- a/packages/functions/src/services/payment/tangle-service/award/award.approve.participant.service.ts +++ b/packages/functions/src/services/payment/tangle-service/award/award.approve.participant.service.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { ApiError, Award, @@ -18,8 +19,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { get, head, isEmpty } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; -import { ITransaction } from '../../../../firebase/firestore/interfaces'; import { getAddress } from '../../../../utils/address.utils'; import { serverTime } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/award/award.create.service.ts b/packages/functions/src/services/payment/tangle-service/award/award.create.service.ts index 163a849f78..4fd6142bce 100644 --- a/packages/functions/src/services/payment/tangle-service/award/award.create.service.ts +++ b/packages/functions/src/services/payment/tangle-service/award/award.create.service.ts @@ -1,3 +1,4 @@ +import { build5Db, build5Storage } from '@build-5/database'; import { Award, AwardBadge, @@ -13,8 +14,6 @@ import { WenError, } from '@build-5/interfaces'; import { isEmpty, set } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; -import { build5Storage } from '../../../../firebase/storage/build5Storage'; import { downloadMediaAndPackCar } from '../../../../utils/car.utils'; import { getBucket } from '../../../../utils/config.utils'; import { dateToTimestamp } from '../../../../utils/dateTime.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/award/award.fund.service.ts b/packages/functions/src/services/payment/tangle-service/award/award.fund.service.ts index 3347e6c5b6..ebde17c94c 100644 --- a/packages/functions/src/services/payment/tangle-service/award/award.fund.service.ts +++ b/packages/functions/src/services/payment/tangle-service/award/award.fund.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, AwardBadgeType, @@ -12,7 +13,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty, set } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../utils/schema.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/metadataNft/mint-metadata-nft.service.ts b/packages/functions/src/services/payment/tangle-service/metadataNft/mint-metadata-nft.service.ts index 1d9bcf0339..3698643637 100644 --- a/packages/functions/src/services/payment/tangle-service/metadataNft/mint-metadata-nft.service.ts +++ b/packages/functions/src/services/payment/tangle-service/metadataNft/mint-metadata-nft.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MilestoneTransaction, @@ -18,7 +19,6 @@ import { import { AliasAddress, Ed25519Address, NftAddress, NftOutput } from '@iota/sdk'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { packBasicOutput } from '../../../../utils/basic-output.utils'; import { EMPTY_NFT_ID, diff --git a/packages/functions/src/services/payment/tangle-service/nft/nft-bid.service.ts b/packages/functions/src/services/payment/tangle-service/nft/nft-bid.service.ts index 9ca5134cfd..e7b9a8b895 100644 --- a/packages/functions/src/services/payment/tangle-service/nft/nft-bid.service.ts +++ b/packages/functions/src/services/payment/tangle-service/nft/nft-bid.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, @@ -18,7 +19,6 @@ import { TransactionValidationType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { assertMemberHasValidAddress, getAddress } from '../../../../utils/address.utils'; import { getRestrictions } from '../../../../utils/common.utils'; import { isProdEnv } from '../../../../utils/config.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/nft/nft-deposit.service.ts b/packages/functions/src/services/payment/tangle-service/nft/nft-deposit.service.ts index b71f593e89..5602f79b6f 100644 --- a/packages/functions/src/services/payment/tangle-service/nft/nft-deposit.service.ts +++ b/packages/functions/src/services/payment/tangle-service/nft/nft-deposit.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MilestoneTransaction, @@ -10,7 +11,6 @@ import { TransactionValidationType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../../../utils/dateTime.utils'; import { getRandomEthAddress } from '../../../../utils/wallet.utils'; import { WalletService } from '../../../wallet/wallet.service'; diff --git a/packages/functions/src/services/payment/tangle-service/nft/nft-purchase.service.ts b/packages/functions/src/services/payment/tangle-service/nft/nft-purchase.service.ts index 0fcc181392..3f604a828b 100644 --- a/packages/functions/src/services/payment/tangle-service/nft/nft-purchase.service.ts +++ b/packages/functions/src/services/payment/tangle-service/nft/nft-purchase.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, @@ -25,7 +26,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { getAddress } from '../../../../utils/address.utils'; import { getNftByMintingId } from '../../../../utils/collection-minting-utils/nft.utils'; import { getRestrictions } from '../../../../utils/common.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/nft/nft-set-for-sale.service.ts b/packages/functions/src/services/payment/tangle-service/nft/nft-set-for-sale.service.ts index 52faabc92c..108a2c4629 100644 --- a/packages/functions/src/services/payment/tangle-service/nft/nft-set-for-sale.service.ts +++ b/packages/functions/src/services/payment/tangle-service/nft/nft-set-for-sale.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -11,7 +12,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { assertMemberHasValidAddress } from '../../../../utils/address.utils'; import { dateToTimestamp } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/proposal/ProposalApporvalService.ts b/packages/functions/src/services/payment/tangle-service/proposal/ProposalApporvalService.ts index d4b881c2e0..eddea634b7 100644 --- a/packages/functions/src/services/payment/tangle-service/proposal/ProposalApporvalService.ts +++ b/packages/functions/src/services/payment/tangle-service/proposal/ProposalApporvalService.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, @@ -5,7 +6,6 @@ import { TangleRequestType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { invalidArgument } from '../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../utils/schema.utils'; import { assertIsGuardian } from '../../../../utils/token.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/proposal/ProposalCreateService.ts b/packages/functions/src/services/payment/tangle-service/proposal/ProposalCreateService.ts index 020c4e4181..2dd1ef24ec 100644 --- a/packages/functions/src/services/payment/tangle-service/proposal/ProposalCreateService.ts +++ b/packages/functions/src/services/payment/tangle-service/proposal/ProposalCreateService.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Proposal, @@ -9,7 +10,6 @@ import { TokenStatus, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../utils/schema.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/proposal/voting/ProposalVoteService.ts b/packages/functions/src/services/payment/tangle-service/proposal/voting/ProposalVoteService.ts index 6f4af53123..9f3c1aa436 100644 --- a/packages/functions/src/services/payment/tangle-service/proposal/voting/ProposalVoteService.ts +++ b/packages/functions/src/services/payment/tangle-service/proposal/voting/ProposalVoteService.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -17,7 +18,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../../../firebase/firestore/build5Db'; import { invalidArgument } from '../../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../../utils/schema.utils'; import { getTokenForSpace } from '../../../../../utils/token.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/proposal/voting/simple.voting.ts b/packages/functions/src/services/payment/tangle-service/proposal/voting/simple.voting.ts index adc1e3b1d8..e093586bb2 100644 --- a/packages/functions/src/services/payment/tangle-service/proposal/voting/simple.voting.ts +++ b/packages/functions/src/services/payment/tangle-service/proposal/voting/simple.voting.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { Proposal, ProposalMember } from '@build-5/interfaces'; import { head } from 'lodash'; -import { build5Db } from '../../../../../firebase/firestore/build5Db'; import { createVoteTransaction } from './ProposalVoteService'; export const executeSimpleVoting = async ( diff --git a/packages/functions/src/services/payment/tangle-service/proposal/voting/staked.token.voting.ts b/packages/functions/src/services/payment/tangle-service/proposal/voting/staked.token.voting.ts index 26cc095ec1..fe63f0d81c 100644 --- a/packages/functions/src/services/payment/tangle-service/proposal/voting/staked.token.voting.ts +++ b/packages/functions/src/services/payment/tangle-service/proposal/voting/staked.token.voting.ts @@ -1,3 +1,4 @@ +import { build5Db, ITransaction } from '@build-5/database'; import { COL, Proposal, @@ -8,8 +9,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../../../firebase/firestore/build5Db'; -import { ITransaction } from '../../../../../firebase/firestore/interfaces'; import { invalidArgument } from '../../../../../utils/error.utils'; import { getTokenVoteMultiplier } from '../../../voting-service'; import { createVoteTransaction } from './ProposalVoteService'; diff --git a/packages/functions/src/services/payment/tangle-service/space/SpaceAcceptMemberService.ts b/packages/functions/src/services/payment/tangle-service/space/SpaceAcceptMemberService.ts index 2cf61bdac6..6df162ee52 100644 --- a/packages/functions/src/services/payment/tangle-service/space/SpaceAcceptMemberService.ts +++ b/packages/functions/src/services/payment/tangle-service/space/SpaceAcceptMemberService.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, SpaceMember, SUB_COL, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { invalidArgument } from '../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../utils/schema.utils'; import { assertIsGuardian } from '../../../../utils/token.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/space/SpaceBlockMemberService.ts b/packages/functions/src/services/payment/tangle-service/space/SpaceBlockMemberService.ts index 90622881e0..99da707980 100644 --- a/packages/functions/src/services/payment/tangle-service/space/SpaceBlockMemberService.ts +++ b/packages/functions/src/services/payment/tangle-service/space/SpaceBlockMemberService.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, Space, SUB_COL, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { invalidArgument } from '../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../utils/schema.utils'; import { assertIsGuardian } from '../../../../utils/token.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/space/SpaceCreateService.ts b/packages/functions/src/services/payment/tangle-service/space/SpaceCreateService.ts index a2c1e1eb58..74195da55a 100644 --- a/packages/functions/src/services/payment/tangle-service/space/SpaceCreateService.ts +++ b/packages/functions/src/services/payment/tangle-service/space/SpaceCreateService.ts @@ -1,7 +1,6 @@ +import { build5Db, build5Storage } from '@build-5/database'; import { COL, MediaStatus, Network, SUB_COL } from '@build-5/interfaces'; import { get, set } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; -import { build5Storage } from '../../../../firebase/storage/build5Storage'; import { downloadMediaAndPackCar } from '../../../../utils/car.utils'; import { getBucket, isProdEnv } from '../../../../utils/config.utils'; import { migrateUriToSotrage, uriToUrl } from '../../../../utils/media.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/space/SpaceDeclineMemberService.ts b/packages/functions/src/services/payment/tangle-service/space/SpaceDeclineMemberService.ts index ddf0ef09e1..34c738a7b8 100644 --- a/packages/functions/src/services/payment/tangle-service/space/SpaceDeclineMemberService.ts +++ b/packages/functions/src/services/payment/tangle-service/space/SpaceDeclineMemberService.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, SUB_COL } from '@build-5/interfaces'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { assertValidationAsync } from '../../../../utils/schema.utils'; import { assertIsGuardian } from '../../../../utils/token.utils'; import { TransactionService } from '../../transaction-service'; diff --git a/packages/functions/src/services/payment/tangle-service/space/SpaceGuardianService.ts b/packages/functions/src/services/payment/tangle-service/space/SpaceGuardianService.ts index c3929acdbd..b184f9dbb0 100644 --- a/packages/functions/src/services/payment/tangle-service/space/SpaceGuardianService.ts +++ b/packages/functions/src/services/payment/tangle-service/space/SpaceGuardianService.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { ADD_REMOVE_GUARDIAN_THRESHOLD_PERCENTAGE, BaseProposalAnswerValue, @@ -16,7 +17,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { dateToTimestamp, serverTime } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../utils/schema.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/space/SpaceJoinService.ts b/packages/functions/src/services/payment/tangle-service/space/SpaceJoinService.ts index a952f78cd5..68007d785b 100644 --- a/packages/functions/src/services/payment/tangle-service/space/SpaceJoinService.ts +++ b/packages/functions/src/services/payment/tangle-service/space/SpaceJoinService.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, @@ -8,7 +9,6 @@ import { TokenDistribution, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { serverTime } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../utils/schema.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/space/SpaceLeaveService.ts b/packages/functions/src/services/payment/tangle-service/space/SpaceLeaveService.ts index 71b69534df..7a9cb38792 100644 --- a/packages/functions/src/services/payment/tangle-service/space/SpaceLeaveService.ts +++ b/packages/functions/src/services/payment/tangle-service/space/SpaceLeaveService.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, Space, SUB_COL, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { invalidArgument } from '../../../../utils/error.utils'; import { assertValidationAsync } from '../../../../utils/schema.utils'; import { TransactionService } from '../../transaction-service'; diff --git a/packages/functions/src/services/payment/tangle-service/token/stake.service.ts b/packages/functions/src/services/payment/tangle-service/token/stake.service.ts index 3a2a1cf305..b19ce97354 100644 --- a/packages/functions/src/services/payment/tangle-service/token/stake.service.ts +++ b/packages/functions/src/services/payment/tangle-service/token/stake.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MilestoneTransaction, @@ -12,7 +13,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { set } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { packBasicOutput } from '../../../../utils/basic-output.utils'; import { dateToTimestamp, serverTime } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/token/token-claim.service.ts b/packages/functions/src/services/payment/tangle-service/token/token-claim.service.ts index 9026e94783..a7bd09b38d 100644 --- a/packages/functions/src/services/payment/tangle-service/token/token-claim.service.ts +++ b/packages/functions/src/services/payment/tangle-service/token/token-claim.service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, @@ -16,7 +17,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; import { assertMemberHasValidAddress } from '../../../../utils/address.utils'; import { dateToTimestamp, serverTime } from '../../../../utils/dateTime.utils'; import { invalidArgument } from '../../../../utils/error.utils'; diff --git a/packages/functions/src/services/payment/tangle-service/token/token-trade.service.ts b/packages/functions/src/services/payment/tangle-service/token/token-trade.service.ts index a930c06623..9af7d8c23e 100644 --- a/packages/functions/src/services/payment/tangle-service/token/token-trade.service.ts +++ b/packages/functions/src/services/payment/tangle-service/token/token-trade.service.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -23,8 +24,6 @@ import { import dayjs from 'dayjs'; import bigDecimal from 'js-big-decimal'; import { set } from 'lodash'; -import { build5Db } from '../../../../firebase/firestore/build5Db'; -import { ITransaction } from '../../../../firebase/firestore/interfaces'; import { assertMemberHasValidAddress } from '../../../../utils/address.utils'; import { packBasicOutput } from '../../../../utils/basic-output.utils'; import { isProdEnv } from '../../../../utils/config.utils'; diff --git a/packages/functions/src/services/payment/token/import-minted-token.service.ts b/packages/functions/src/services/payment/token/import-minted-token.service.ts index 2fca86b508..6e4e37c5d7 100644 --- a/packages/functions/src/services/payment/token/import-minted-token.service.ts +++ b/packages/functions/src/services/payment/token/import-minted-token.service.ts @@ -1,3 +1,4 @@ +import { build5Db, build5Storage } from '@build-5/database'; import { Access, COL, @@ -21,8 +22,6 @@ import { } from '@iota/sdk'; import Joi from 'joi'; import { get, isEmpty } from 'lodash'; -import { build5Db } from '../../../firebase/firestore/build5Db'; -import { build5Storage } from '../../../firebase/storage/build5Storage'; import { getBucket } from '../../../utils/config.utils'; import { migrateUriToSotrage, uriToUrl } from '../../../utils/media.utils'; import { isAliasGovernor } from '../../../utils/token-minting-utils/alias.utils'; diff --git a/packages/functions/src/services/payment/token/token-mint-service.ts b/packages/functions/src/services/payment/token/token-mint-service.ts index 8531c01510..619ff0cc6e 100644 --- a/packages/functions/src/services/payment/token/token-mint-service.ts +++ b/packages/functions/src/services/payment/token/token-mint-service.ts @@ -1,7 +1,7 @@ +import { build5Db } from '@build-5/database'; import { COL, Token, TokenStatus, Transaction, TransactionPayloadType } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { get } from 'lodash'; -import { build5Db } from '../../../firebase/firestore/build5Db'; import { TransactionMatch, TransactionService } from '../transaction-service'; export class TokenMintService { diff --git a/packages/functions/src/services/payment/token/token-service.ts b/packages/functions/src/services/payment/token/token-service.ts index 5b779cb7e5..995c60d996 100644 --- a/packages/functions/src/services/payment/token/token-service.ts +++ b/packages/functions/src/services/payment/token/token-service.ts @@ -1,3 +1,4 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -20,7 +21,6 @@ import { import dayjs from 'dayjs'; import bigDecimal from 'js-big-decimal'; import { get, head, last, set } from 'lodash'; -import { build5Db, getSnapshot } from '../../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../../utils/dateTime.utils'; import { getBoughtByMemberDiff, getTotalPublicSupply } from '../../../utils/token.utils'; import { getRandomEthAddress } from '../../../utils/wallet.utils'; diff --git a/packages/functions/src/services/payment/transaction-service.ts b/packages/functions/src/services/payment/transaction-service.ts index 1c92dba19c..8011e90fce 100644 --- a/packages/functions/src/services/payment/transaction-service.ts +++ b/packages/functions/src/services/payment/transaction-service.ts @@ -1,3 +1,4 @@ +import { IDocument, ITransaction, build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -19,8 +20,6 @@ import { import { ExpirationUnlockCondition, UnlockCondition, UnlockConditionType } from '@iota/sdk'; import dayjs from 'dayjs'; import { get, isEmpty, set } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; -import { IDocument, ITransaction } from '../../firebase/firestore/interfaces'; import { MilestoneTransactionAdapter } from '../../triggers/milestone-transactions-triggers/MilestoneTransactionAdapter'; import { getOutputMetadata } from '../../utils/basic-output.utils'; import { dateToTimestamp, serverTime } from '../../utils/dateTime.utils'; diff --git a/packages/functions/src/services/payment/voting-service.ts b/packages/functions/src/services/payment/voting-service.ts index 6b994891b0..2ee73a2186 100644 --- a/packages/functions/src/services/payment/voting-service.ts +++ b/packages/functions/src/services/payment/voting-service.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Proposal, @@ -8,7 +9,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { get, head } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getTokenForSpace } from '../../utils/token.utils'; import { getRandomEthAddress } from '../../utils/wallet.utils'; import { TransactionMatch, TransactionService } from './transaction-service'; diff --git a/packages/functions/src/services/stake.service.ts b/packages/functions/src/services/stake.service.ts index 42630b7617..ff2b6727c0 100644 --- a/packages/functions/src/services/stake.service.ts +++ b/packages/functions/src/services/stake.service.ts @@ -1,3 +1,4 @@ +import { build5Db, ITransaction } from '@build-5/database'; import { COL, Space, @@ -8,8 +9,6 @@ import { TokenDistribution, tokenTradingFeeDicountPercentage, } from '@build-5/interfaces'; -import { build5Db } from '../firebase/firestore/build5Db'; -import { ITransaction } from '../firebase/firestore/interfaces'; import { getTokenSaleConfig, isProdEnv } from '../utils/config.utils'; import { getSoonToken } from '../utils/token.utils'; diff --git a/packages/functions/src/services/validators/access.ts b/packages/functions/src/services/validators/access.ts index 7ae4713b8b..a310b1f533 100644 --- a/packages/functions/src/services/validators/access.ts +++ b/packages/functions/src/services/validators/access.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { Access, COL, Nft, SUB_COL, TransactionPayloadType, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { invalidArgument } from '../../utils/error.utils'; export const assertHasAccess = async ( diff --git a/packages/functions/src/services/wallet/NativeTokenWallet.ts b/packages/functions/src/services/wallet/NativeTokenWallet.ts index 7385218591..f2bafdf382 100644 --- a/packages/functions/src/services/wallet/NativeTokenWallet.ts +++ b/packages/functions/src/services/wallet/NativeTokenWallet.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, Token, Transaction } from '@build-5/interfaces'; import { AliasOutputBuilderParams, @@ -9,7 +10,6 @@ import { Utils, } from '@iota/sdk'; import { cloneDeep } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getAddress } from '../../utils/address.utils'; import { mergeOutputs } from '../../utils/basic-output.utils'; import { createUnlock, packEssence, submitBlock } from '../../utils/block.utils'; diff --git a/packages/functions/src/services/wallet/NftWallet.ts b/packages/functions/src/services/wallet/NftWallet.ts index 1f4ed817e6..7197449a57 100644 --- a/packages/functions/src/services/wallet/NftWallet.ts +++ b/packages/functions/src/services/wallet/NftWallet.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -34,7 +35,6 @@ import { } from '@iota/sdk'; import dayjs from 'dayjs'; import { cloneDeep, get, head, isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { unclockMnemonic } from '../../triggers/milestone-transactions-triggers/common'; import { getAddress } from '../../utils/address.utils'; import { mergeOutputs } from '../../utils/basic-output.utils'; diff --git a/packages/functions/src/services/wallet/mnemonic.ts b/packages/functions/src/services/wallet/mnemonic.ts index 875096a915..25c11bf047 100644 --- a/packages/functions/src/services/wallet/mnemonic.ts +++ b/packages/functions/src/services/wallet/mnemonic.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, Mnemonic } from '@build-5/interfaces'; import { AES, enc } from 'crypto-js'; -import { build5Db } from '../../firebase/firestore/build5Db'; export class MnemonicService { public static async store( address: string, diff --git a/packages/functions/src/services/wallet/wallet.service.ts b/packages/functions/src/services/wallet/wallet.service.ts index 2c483b2a4a..dae6b40471 100644 --- a/packages/functions/src/services/wallet/wallet.service.ts +++ b/packages/functions/src/services/wallet/wallet.service.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, NativeToken, Network } from '@build-5/interfaces'; import { Client } from '@iota/sdk'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getRandomElement } from '../../utils/common.utils'; import { IotaWallet } from './IotaWalletService'; import { SmrWallet } from './SmrWalletService'; diff --git a/packages/functions/src/triggers/award.trigger.ts b/packages/functions/src/triggers/award.trigger.ts index c7019eb078..d9ed106e4b 100644 --- a/packages/functions/src/triggers/award.trigger.ts +++ b/packages/functions/src/triggers/award.trigger.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, AwardBadgeType, @@ -8,7 +9,6 @@ import { TransactionPayloadType, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../firebase/firestore/build5Db'; import { getAddress } from '../utils/address.utils'; import { getRandomEthAddress } from '../utils/wallet.utils'; import { FirestoreDocEvent } from './common'; diff --git a/packages/functions/src/triggers/collection.stats.trigger.ts b/packages/functions/src/triggers/collection.stats.trigger.ts index 5ed81a3959..580d654072 100644 --- a/packages/functions/src/triggers/collection.stats.trigger.ts +++ b/packages/functions/src/triggers/collection.stats.trigger.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, CollectionStats } from '@build-5/interfaces'; -import { build5Db } from '../firebase/firestore/build5Db'; import { getRankingThreshold } from '../utils/config.utils'; import { FirestoreDocEvent } from './common'; diff --git a/packages/functions/src/triggers/collection.trigger.ts b/packages/functions/src/triggers/collection.trigger.ts index 7e540f462b..95142d9c61 100644 --- a/packages/functions/src/triggers/collection.trigger.ts +++ b/packages/functions/src/triggers/collection.trigger.ts @@ -1,3 +1,4 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, Collection, @@ -12,7 +13,6 @@ import { UnsoldMintingOptions, } from '@build-5/interfaces'; import { last } from 'lodash'; -import { build5Db, getSnapshot } from '../firebase/firestore/build5Db'; import { getAddress } from '../utils/address.utils'; import { collectionToIpfsMetadata, downloadMediaAndPackCar } from '../utils/car.utils'; import { getRandomEthAddress } from '../utils/wallet.utils'; diff --git a/packages/functions/src/triggers/milestone-transactions-triggers/common.ts b/packages/functions/src/triggers/milestone-transactions-triggers/common.ts index 9a56671b8b..c85da56174 100644 --- a/packages/functions/src/triggers/milestone-transactions-triggers/common.ts +++ b/packages/functions/src/triggers/milestone-transactions-triggers/common.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Transaction } from '@build-5/interfaces'; import { RegularTransactionEssence, @@ -7,7 +8,6 @@ import { } from '@iota/sdk'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; export const confirmTransaction = async ( milestoneTransactionPath: string, diff --git a/packages/functions/src/triggers/milestone-transactions-triggers/consumed.vote.outputs.ts b/packages/functions/src/triggers/milestone-transactions-triggers/consumed.vote.outputs.ts index 7795577e3f..594db4dcab 100644 --- a/packages/functions/src/triggers/milestone-transactions-triggers/consumed.vote.outputs.ts +++ b/packages/functions/src/triggers/milestone-transactions-triggers/consumed.vote.outputs.ts @@ -1,7 +1,6 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, Proposal, SUB_COL, Transaction, TransactionType } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; -import { ITransaction } from '../../firebase/firestore/interfaces'; import { getTokenVoteMultiplier } from '../../services/payment/voting-service'; import { serverTime } from '../../utils/dateTime.utils'; diff --git a/packages/functions/src/triggers/milestone-transactions-triggers/milestone-transaction.trigger.ts b/packages/functions/src/triggers/milestone-transactions-triggers/milestone-transaction.trigger.ts index db4eb6809c..42cb54dca6 100644 --- a/packages/functions/src/triggers/milestone-transactions-triggers/milestone-transaction.trigger.ts +++ b/packages/functions/src/triggers/milestone-transactions-triggers/milestone-transaction.trigger.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { Network } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { ProcessingService } from '../../services/payment/payment-processing'; import { FirestoreDocEvent } from '../common'; import { MilestoneTransactionAdapter } from './MilestoneTransactionAdapter'; diff --git a/packages/functions/src/triggers/milestone-transactions-triggers/token.foundry.ts b/packages/functions/src/triggers/milestone-transactions-triggers/token.foundry.ts index 8db4454e6c..a5638a4d4b 100644 --- a/packages/functions/src/triggers/milestone-transactions-triggers/token.foundry.ts +++ b/packages/functions/src/triggers/milestone-transactions-triggers/token.foundry.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL } from '@build-5/interfaces'; import { AddressUnlockCondition, @@ -10,7 +11,6 @@ import { UnlockConditionType, Utils, } from '@iota/sdk'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getTokenByMintId } from '../../utils/token.utils'; export const updateTokenSupplyData = async (data: Record) => { diff --git a/packages/functions/src/triggers/mnemonic.trigger.ts b/packages/functions/src/triggers/mnemonic.trigger.ts index 1f06cb2a3d..3ba325d797 100644 --- a/packages/functions/src/triggers/mnemonic.trigger.ts +++ b/packages/functions/src/triggers/mnemonic.trigger.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, MAX_WALLET_RETRY, Mnemonic, Transaction } from '@build-5/interfaces'; import { chunk, isEmpty } from 'lodash'; -import { build5Db } from '../firebase/firestore/build5Db'; import { FirestoreDocEvent } from './common'; import { CREDIT_EXECUTABLE_TRANSACTIONS, diff --git a/packages/functions/src/triggers/nft.trigger.ts b/packages/functions/src/triggers/nft.trigger.ts index f2c63ec65c..8b2c45b475 100644 --- a/packages/functions/src/triggers/nft.trigger.ts +++ b/packages/functions/src/triggers/nft.trigger.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, MediaStatus, Nft, NftAvailable } from '@build-5/interfaces'; -import { build5Db } from '../firebase/firestore/build5Db'; import { downloadMediaAndPackCar, nftToIpfsMetadata } from '../utils/car.utils'; import { FirestoreDocEvent } from './common'; diff --git a/packages/functions/src/triggers/proposal.trigger.ts b/packages/functions/src/triggers/proposal.trigger.ts index aeb1b38874..abd9a9e7a6 100644 --- a/packages/functions/src/triggers/proposal.trigger.ts +++ b/packages/functions/src/triggers/proposal.trigger.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { ADD_REMOVE_GUARDIAN_THRESHOLD_PERCENTAGE, BaseProposalAnswerValue, @@ -18,7 +19,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { get, set } from 'lodash'; -import { build5Db } from '../firebase/firestore/build5Db'; import { getStakeForType } from '../services/stake.service'; import { downloadMediaAndPackCar } from '../utils/car.utils'; import { dateToTimestamp } from '../utils/dateTime.utils'; diff --git a/packages/functions/src/triggers/storage/resize.img.trigger.ts b/packages/functions/src/triggers/storage/resize.img.trigger.ts index a0cda19863..c15432f506 100644 --- a/packages/functions/src/triggers/storage/resize.img.trigger.ts +++ b/packages/functions/src/triggers/storage/resize.img.trigger.ts @@ -1,3 +1,4 @@ +import { IBucket, build5Storage } from '@build-5/database'; import { IMAGE_CACHE_AGE, ImageWidth } from '@build-5/interfaces'; import { path as ffmpegPath } from '@ffmpeg-installer/ffmpeg'; import { spawn } from 'child-process-promise'; @@ -5,8 +6,6 @@ import fs from 'fs'; import os from 'os'; import path from 'path'; import sharp from 'sharp'; -import { build5Storage } from '../../firebase/storage/build5Storage'; -import { IBucket } from '../../firebase/storage/interfaces'; import { getRandomEthAddress } from '../../utils/wallet.utils'; // eslint-disable-next-line @typescript-eslint/no-var-requires diff --git a/packages/functions/src/triggers/token-trading/match-base-token.ts b/packages/functions/src/triggers/token-trading/match-base-token.ts index a4ac30cb9e..984c545fb3 100644 --- a/packages/functions/src/triggers/token-trading/match-base-token.ts +++ b/packages/functions/src/triggers/token-trading/match-base-token.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, Entity, @@ -14,8 +15,6 @@ import { } from '@build-5/interfaces'; import bigDecimal from 'js-big-decimal'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; -import { ITransaction } from '../../firebase/firestore/interfaces'; import { Wallet } from '../../services/wallet/wallet'; import { WalletService } from '../../services/wallet/wallet.service'; import { getAddress } from '../../utils/address.utils'; diff --git a/packages/functions/src/triggers/token-trading/match-minted-token.ts b/packages/functions/src/triggers/token-trading/match-minted-token.ts index 40d1339826..0a1dd41cc7 100644 --- a/packages/functions/src/triggers/token-trading/match-minted-token.ts +++ b/packages/functions/src/triggers/token-trading/match-minted-token.ts @@ -12,9 +12,8 @@ import { TransactionType, } from '@build-5/interfaces'; +import { ITransaction, build5Db } from '@build-5/database'; import bigDecimal from 'js-big-decimal'; -import { build5Db } from '../../firebase/firestore/build5Db'; -import { ITransaction } from '../../firebase/firestore/interfaces'; import { Wallet } from '../../services/wallet/wallet'; import { WalletService } from '../../services/wallet/wallet.service'; import { getAddress } from '../../utils/address.utils'; diff --git a/packages/functions/src/triggers/token-trading/match-simple-token.ts b/packages/functions/src/triggers/token-trading/match-simple-token.ts index cd30893742..e63bea1a0b 100644 --- a/packages/functions/src/triggers/token-trading/match-simple-token.ts +++ b/packages/functions/src/triggers/token-trading/match-simple-token.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -16,8 +17,6 @@ import { } from '@build-5/interfaces'; import bigDecimal from 'js-big-decimal'; import { isEmpty, tail } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; -import { ITransaction } from '../../firebase/firestore/interfaces'; import { getAddress } from '../../utils/address.utils'; import { getRoyaltyFees } from '../../utils/royalty.utils'; import { getRandomEthAddress } from '../../utils/wallet.utils'; diff --git a/packages/functions/src/triggers/token-trading/match-token.ts b/packages/functions/src/triggers/token-trading/match-token.ts index c0f9597d88..39e7b90403 100644 --- a/packages/functions/src/triggers/token-trading/match-token.ts +++ b/packages/functions/src/triggers/token-trading/match-token.ts @@ -1,3 +1,4 @@ +import { IQuery, ITransaction, build5Db, getSnapshot } from '@build-5/database'; import { COL, Token, @@ -10,8 +11,6 @@ import { import dayjs from 'dayjs'; import bigDecimal from 'js-big-decimal'; import { cloneDeep, last } from 'lodash'; -import { build5Db, getSnapshot } from '../../firebase/firestore/build5Db'; -import { IQuery, ITransaction } from '../../firebase/firestore/interfaces'; import { matchBaseToken } from './match-base-token'; import { matchMintedToken } from './match-minted-token'; import { matchSimpleToken, updateSellLockAndDistribution } from './match-simple-token'; diff --git a/packages/functions/src/triggers/token-trading/token-purchase.trigger.ts b/packages/functions/src/triggers/token-trading/token-purchase.trigger.ts index 671c66d457..c50d2f4394 100644 --- a/packages/functions/src/triggers/token-trading/token-purchase.trigger.ts +++ b/packages/functions/src/triggers/token-trading/token-purchase.trigger.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, TokenPurchase, TokenPurchaseAge } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { FirestoreDocEvent } from '../common'; export const onTokenPurchaseCreated = async (event: FirestoreDocEvent) => { diff --git a/packages/functions/src/triggers/token-trading/token-trade-order.trigger.ts b/packages/functions/src/triggers/token-trading/token-trade-order.trigger.ts index 4ee79bd33f..7c31ceb7be 100644 --- a/packages/functions/src/triggers/token-trading/token-trade-order.trigger.ts +++ b/packages/functions/src/triggers/token-trading/token-trade-order.trigger.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -9,7 +10,6 @@ import { TokenTradeOrderType, } from '@build-5/interfaces'; import bigDecimal from 'js-big-decimal'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getStakeForType, getTier } from '../../services/stake.service'; import { cancelTradeOrderUtil } from '../../utils/token-trade.utils'; import { BIG_DECIMAL_PRECISION, getSoonToken } from '../../utils/token.utils'; diff --git a/packages/functions/src/triggers/token.trigger.ts b/packages/functions/src/triggers/token.trigger.ts index fcb897348f..374b8bb36b 100644 --- a/packages/functions/src/triggers/token.trigger.ts +++ b/packages/functions/src/triggers/token.trigger.ts @@ -1,3 +1,4 @@ +import { IBatch, build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -18,8 +19,6 @@ import { } from '@build-5/interfaces'; import bigDecimal from 'js-big-decimal'; import { isEmpty } from 'lodash'; -import { build5Db } from '../firebase/firestore/build5Db'; -import { IBatch } from '../firebase/firestore/interfaces'; import { WalletService } from '../services/wallet/wallet.service'; import { getAddress } from '../utils/address.utils'; import { downloadMediaAndPackCar, tokenToIpfsMetadata } from '../utils/car.utils'; diff --git a/packages/functions/src/triggers/transaction-trigger/airdrop.claim.ts b/packages/functions/src/triggers/transaction-trigger/airdrop.claim.ts index 640c3c8f1b..eeee4f7a42 100644 --- a/packages/functions/src/triggers/transaction-trigger/airdrop.claim.ts +++ b/packages/functions/src/triggers/transaction-trigger/airdrop.claim.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, Entity, @@ -18,8 +19,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { head } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; -import { ITransaction } from '../../firebase/firestore/interfaces'; import { Wallet } from '../../services/wallet/wallet'; import { WalletService } from '../../services/wallet/wallet.service'; import { getAddress } from '../../utils/address.utils'; diff --git a/packages/functions/src/triggers/transaction-trigger/award.transaction.update.ts b/packages/functions/src/triggers/transaction-trigger/award.transaction.update.ts index 19bf843e76..7af6ed44ec 100644 --- a/packages/functions/src/triggers/transaction-trigger/award.transaction.update.ts +++ b/packages/functions/src/triggers/transaction-trigger/award.transaction.update.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Transaction, TransactionPayloadType, TransactionType } from '@build-5/interfaces'; import { TransactionPayload, Utils } from '@iota/sdk'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getRandomEthAddress } from '../../utils/wallet.utils'; export const onAwardUpdate = async (transaction: Transaction) => { diff --git a/packages/functions/src/triggers/transaction-trigger/collection-minting.ts b/packages/functions/src/triggers/transaction-trigger/collection-minting.ts index e7deca8614..c846aad2ca 100644 --- a/packages/functions/src/triggers/transaction-trigger/collection-minting.ts +++ b/packages/functions/src/triggers/transaction-trigger/collection-minting.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -11,7 +12,6 @@ import { import { TransactionPayload, Utils } from '@iota/sdk'; import dayjs from 'dayjs'; import { get } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getAddress } from '../../utils/address.utils'; import { getRandomEthAddress } from '../../utils/wallet.utils'; diff --git a/packages/functions/src/triggers/transaction-trigger/matadatNft-minting.ts b/packages/functions/src/triggers/transaction-trigger/matadatNft-minting.ts index de73765cf8..eeaade697c 100644 --- a/packages/functions/src/triggers/transaction-trigger/matadatNft-minting.ts +++ b/packages/functions/src/triggers/transaction-trigger/matadatNft-minting.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -13,7 +14,6 @@ import { import { TransactionPayload, Utils } from '@iota/sdk'; import dayjs from 'dayjs'; import { get } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { createMetadataCollection, createMetadataNft, diff --git a/packages/functions/src/triggers/transaction-trigger/nft-staked.ts b/packages/functions/src/triggers/transaction-trigger/nft-staked.ts index b2342707b0..e37b3e25d0 100644 --- a/packages/functions/src/triggers/transaction-trigger/nft-staked.ts +++ b/packages/functions/src/triggers/transaction-trigger/nft-staked.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Nft, Transaction } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getRandomEthAddress } from '../../utils/wallet.utils'; export const onNftStaked = async (transaction: Transaction) => { diff --git a/packages/functions/src/triggers/transaction-trigger/proposal.vote.ts b/packages/functions/src/triggers/transaction-trigger/proposal.vote.ts index 5971d7f39c..4b37aedd2d 100644 --- a/packages/functions/src/triggers/transaction-trigger/proposal.vote.ts +++ b/packages/functions/src/triggers/transaction-trigger/proposal.vote.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { MilestoneTransactionAdapter } from '../milestone-transactions-triggers/MilestoneTransactionAdapter'; export const onProposalVoteCreditConfirmed = async (transaction: Transaction) => { diff --git a/packages/functions/src/triggers/transaction-trigger/staking.ts b/packages/functions/src/triggers/transaction-trigger/staking.ts index af52b708fe..f5f9504fa6 100644 --- a/packages/functions/src/triggers/transaction-trigger/staking.ts +++ b/packages/functions/src/triggers/transaction-trigger/staking.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Stake, SUB_COL, Transaction } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { onStakeCreated } from '../../services/stake.service'; export const onStakingConfirmed = async (billPayment: Transaction) => { diff --git a/packages/functions/src/triggers/transaction-trigger/token-minting.ts b/packages/functions/src/triggers/transaction-trigger/token-minting.ts index 8fd7365042..4c680b2935 100644 --- a/packages/functions/src/triggers/transaction-trigger/token-minting.ts +++ b/packages/functions/src/triggers/transaction-trigger/token-minting.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -17,7 +18,6 @@ import { Utils, } from '@iota/sdk'; import dayjs from 'dayjs'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { getAddress } from '../../utils/address.utils'; import { getRandomEthAddress } from '../../utils/wallet.utils'; diff --git a/packages/functions/src/triggers/transaction-trigger/transaction.trigger.ts b/packages/functions/src/triggers/transaction-trigger/transaction.trigger.ts index 5fe119c012..fcf1c6f2a6 100644 --- a/packages/functions/src/triggers/transaction-trigger/transaction.trigger.ts +++ b/packages/functions/src/triggers/transaction-trigger/transaction.trigger.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, @@ -13,8 +14,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; -import { ITransaction } from '../../firebase/firestore/interfaces'; import { AliasWallet } from '../../services/wallet/AliasWallet'; import { NativeTokenWallet } from '../../services/wallet/NativeTokenWallet'; import { NftWallet } from '../../services/wallet/NftWallet'; diff --git a/packages/functions/src/triggers/transaction-trigger/wallet-params.ts b/packages/functions/src/triggers/transaction-trigger/wallet-params.ts index 8ce514bb0e..715fadebfd 100644 --- a/packages/functions/src/triggers/transaction-trigger/wallet-params.ts +++ b/packages/functions/src/triggers/transaction-trigger/wallet-params.ts @@ -7,7 +7,7 @@ import { TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../firebase/firestore/build5Db'; +import { build5Db } from '@build-5/database'; import { WalletParams } from '../../services/wallet/wallet'; import { isProdEnv } from '../../utils/config.utils'; diff --git a/packages/functions/src/utils/collection-minting-utils/nft.utils.ts b/packages/functions/src/utils/collection-minting-utils/nft.utils.ts index 28d20b322e..db1436bd4a 100644 --- a/packages/functions/src/utils/collection-minting-utils/nft.utils.ts +++ b/packages/functions/src/utils/collection-minting-utils/nft.utils.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, KEY_NAME_TANGLE, Nft } from '@build-5/interfaces'; import { Address, @@ -13,7 +14,6 @@ import { } from '@iota/sdk'; import dayjs from 'dayjs'; import { head } from 'lodash'; -import { build5Db } from '../../firebase/firestore/build5Db'; import { Wallet } from '../../services/wallet/wallet'; import { PLACEHOLDER_CID } from '../car.utils'; import { intToU32 } from '../common.utils'; diff --git a/packages/functions/src/utils/media.utils.ts b/packages/functions/src/utils/media.utils.ts index f942152dac..a20a514ffe 100644 --- a/packages/functions/src/utils/media.utils.ts +++ b/packages/functions/src/utils/media.utils.ts @@ -1,3 +1,4 @@ +import { IBucket } from '@build-5/database'; import { Bucket, COL, @@ -12,7 +13,6 @@ import fs from 'fs'; import mime from 'mime-types'; import os from 'os'; import path from 'path'; -import { IBucket } from '../firebase/storage/interfaces'; export const migrateUriToSotrage = async ( col: COL, diff --git a/packages/functions/src/utils/royalty.utils.ts b/packages/functions/src/utils/royalty.utils.ts index a43a664ea7..225ba496e3 100644 --- a/packages/functions/src/utils/royalty.utils.ts +++ b/packages/functions/src/utils/royalty.utils.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, SYSTEM_CONFIG_DOC_ID, SystemConfig } from '@build-5/interfaces'; import bigDecimal from 'js-big-decimal'; -import { build5Db } from '../firebase/firestore/build5Db'; import { getRoyaltyPercentage, getRoyaltySpaces, diff --git a/packages/functions/src/utils/space.utils.ts b/packages/functions/src/utils/space.utils.ts index ae6a225361..481bd723c9 100644 --- a/packages/functions/src/utils/space.utils.ts +++ b/packages/functions/src/utils/space.utils.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Space, SUB_COL, WenError } from '@build-5/interfaces'; import { head } from 'lodash'; -import { build5Db } from '../firebase/firestore/build5Db'; import { serverTime } from './dateTime.utils'; import { invalidArgument } from './error.utils'; diff --git a/packages/functions/src/utils/token-minting-utils/member.utils.ts b/packages/functions/src/utils/token-minting-utils/member.utils.ts index e84a705b6d..8d36a11877 100644 --- a/packages/functions/src/utils/token-minting-utils/member.utils.ts +++ b/packages/functions/src/utils/token-minting-utils/member.utils.ts @@ -1,7 +1,7 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, SUB_COL, Token, TokenDistribution, TokenDrop } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { last } from 'lodash'; -import { build5Db, getSnapshot } from '../../firebase/firestore/build5Db'; import { Wallet } from '../../services/wallet/wallet'; import { packBasicOutput } from '../basic-output.utils'; diff --git a/packages/functions/src/utils/token-trade.utils.ts b/packages/functions/src/utils/token-trade.utils.ts index 3d22cac736..72706b80a7 100644 --- a/packages/functions/src/utils/token-trade.utils.ts +++ b/packages/functions/src/utils/token-trade.utils.ts @@ -1,3 +1,4 @@ +import { ITransaction, build5Db } from '@build-5/database'; import { COL, CreditPaymentReason, @@ -14,8 +15,6 @@ import { TransactionType, } from '@build-5/interfaces'; import bigDecimal from 'js-big-decimal'; -import { build5Db } from '../firebase/firestore/build5Db'; -import { ITransaction } from '../firebase/firestore/interfaces'; import { getAddress } from './address.utils'; import { getRandomEthAddress } from './wallet.utils'; diff --git a/packages/functions/src/utils/token.utils.ts b/packages/functions/src/utils/token.utils.ts index 88f9dafc97..7978cf1538 100644 --- a/packages/functions/src/utils/token.utils.ts +++ b/packages/functions/src/utils/token.utils.ts @@ -1,3 +1,4 @@ +import { build5Db, getSnapshot } from '@build-5/database'; import { COL, SUB_COL, @@ -10,7 +11,6 @@ import { import dayjs from 'dayjs'; import bigDecimal from 'js-big-decimal'; import { last } from 'lodash'; -import { build5Db, getSnapshot } from '../firebase/firestore/build5Db'; import { invalidArgument } from './error.utils'; export const BIG_DECIMAL_PRECISION = 1000; diff --git a/packages/functions/src/utils/wallet.utils.ts b/packages/functions/src/utils/wallet.utils.ts index b3ff56ab45..1c1e432212 100644 --- a/packages/functions/src/utils/wallet.utils.ts +++ b/packages/functions/src/utils/wallet.utils.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, DecodedToken, Member, WEN_FUNC, WenError, WenRequest } from '@build-5/interfaces'; import { Ed25519Signature, INodeInfo, Utils } from '@iota/sdk'; import { recoverPersonalSignature } from '@metamask/eth-sig-util'; @@ -6,7 +7,6 @@ import dayjs from 'dayjs'; import { Wallet } from 'ethers'; import jwt from 'jsonwebtoken'; import { get } from 'lodash'; -import { build5Db } from '../firebase/firestore/build5Db'; import { WalletService } from '../services/wallet/wallet.service'; import { getCustomTokenLifetime, getJwtSecretKey } from './config.utils'; import { unAuthenticated } from './error.utils'; diff --git a/packages/functions/test-tangle/address.spec.ts b/packages/functions/test-tangle/address.spec.ts index 567fed3f95..39d69c5c33 100644 --- a/packages/functions/test-tangle/address.spec.ts +++ b/packages/functions/test-tangle/address.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -14,7 +15,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty, set } from 'lodash'; -import { build5Db } from '../src/firebase/firestore/build5Db'; import { getAddress } from '../src/utils/address.utils'; import { dateToTimestamp } from '../src/utils/dateTime.utils'; import * as wallet from '../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/award-tangle/award-tangle_1.spec.ts b/packages/functions/test-tangle/award-tangle/award-tangle_1.spec.ts index e1b4a346d9..2b9ba0e2ad 100644 --- a/packages/functions/test-tangle/award-tangle/award-tangle_1.spec.ts +++ b/packages/functions/test-tangle/award-tangle/award-tangle_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -11,7 +12,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/award-tangle/award-tangle_2.spec.ts b/packages/functions/test-tangle/award-tangle/award-tangle_2.spec.ts index a2a262d0b3..2a99bfb02a 100644 --- a/packages/functions/test-tangle/award-tangle/award-tangle_2.spec.ts +++ b/packages/functions/test-tangle/award-tangle/award-tangle_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -11,7 +12,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/award-tangle/award-tangle_3.spec.ts b/packages/functions/test-tangle/award-tangle/award-tangle_3.spec.ts index a8c8f6fe6a..fafb3899b9 100644 --- a/packages/functions/test-tangle/award-tangle/award-tangle_3.spec.ts +++ b/packages/functions/test-tangle/award-tangle/award-tangle_3.spec.ts @@ -13,8 +13,8 @@ import { TransactionType, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/award-tangle/award-tangle_4.spec.ts b/packages/functions/test-tangle/award-tangle/award-tangle_4.spec.ts index d3c7c3d3de..f6262cc434 100644 --- a/packages/functions/test-tangle/award-tangle/award-tangle_4.spec.ts +++ b/packages/functions/test-tangle/award-tangle/award-tangle_4.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -12,7 +13,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/award-tangle/award-tangle_5.spec.ts b/packages/functions/test-tangle/award-tangle/award-tangle_5.spec.ts index 057360f0fc..1072a6c96e 100644 --- a/packages/functions/test-tangle/award-tangle/award-tangle_5.spec.ts +++ b/packages/functions/test-tangle/award-tangle/award-tangle_5.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -12,7 +13,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/award-tangle/award-tangle_6.spec.ts b/packages/functions/test-tangle/award-tangle/award-tangle_6.spec.ts index 556f94ba21..cf1e272d11 100644 --- a/packages/functions/test-tangle/award-tangle/award-tangle_6.spec.ts +++ b/packages/functions/test-tangle/award-tangle/award-tangle_6.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -12,7 +13,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/award-tangle/award-tangle_7.spec.ts b/packages/functions/test-tangle/award-tangle/award-tangle_7.spec.ts index 9b5afa412e..fc43984c69 100644 --- a/packages/functions/test-tangle/award-tangle/award-tangle_7.spec.ts +++ b/packages/functions/test-tangle/award-tangle/award-tangle_7.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -11,7 +12,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/award-tangle/common.ts b/packages/functions/test-tangle/award-tangle/common.ts index 9f23ba2837..82530acda1 100644 --- a/packages/functions/test-tangle/award-tangle/common.ts +++ b/packages/functions/test-tangle/award-tangle/common.ts @@ -1,3 +1,4 @@ +import { IQuery, build5Db } from '@build-5/database'; import { COL, Network, @@ -6,8 +7,6 @@ import { TransactionPayloadType, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; -import { IQuery } from '../../src/firebase/firestore/interfaces'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; import { getRandomSymbol, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/award/award_1.spec.ts b/packages/functions/test-tangle/award/award_1.spec.ts index bf43cd32b5..b89e91cf1a 100644 --- a/packages/functions/test-tangle/award/award_1.spec.ts +++ b/packages/functions/test-tangle/award/award_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -14,7 +15,6 @@ import { } from '@build-5/interfaces'; import { NftOutput, TimelockUnlockCondition, UnlockConditionType } from '@iota/sdk'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, awardParticipate, diff --git a/packages/functions/test-tangle/award/award_10.spec.ts b/packages/functions/test-tangle/award/award_10.spec.ts index 3bb9350e5c..f5a18d8cff 100644 --- a/packages/functions/test-tangle/award/award_10.spec.ts +++ b/packages/functions/test-tangle/award/award_10.spec.ts @@ -1,7 +1,7 @@ import { Award, COL, Member, Network, Space, Token, TokenStatus } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, createAward, fundAward } from '../../src/runtime/firebase/award'; import { joinSpace } from '../../src/runtime/firebase/space'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; diff --git a/packages/functions/test-tangle/award/award_2.spec.ts b/packages/functions/test-tangle/award/award_2.spec.ts index cdc6480bbe..18e8fcedd1 100644 --- a/packages/functions/test-tangle/award/award_2.spec.ts +++ b/packages/functions/test-tangle/award/award_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -16,7 +17,6 @@ import { } from '@build-5/interfaces'; import { NftOutput, TimelockUnlockCondition, UnlockConditionType } from '@iota/sdk'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, awardParticipate, diff --git a/packages/functions/test-tangle/award/award_3.spec.ts b/packages/functions/test-tangle/award/award_3.spec.ts index 24434a18d8..f21fb6ea6e 100644 --- a/packages/functions/test-tangle/award/award_3.spec.ts +++ b/packages/functions/test-tangle/award/award_3.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -9,7 +10,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { uploadMediaToWeb3 } from '../../src/cron/media.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { createAward, fundAward } from '../../src/runtime/firebase/award'; import { joinSpace } from '../../src/runtime/firebase/space'; import * as wallet from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/award/award_4.spec.ts b/packages/functions/test-tangle/award/award_4.spec.ts index 546edeef20..b288ce577c 100644 --- a/packages/functions/test-tangle/award/award_4.spec.ts +++ b/packages/functions/test-tangle/award/award_4.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -12,7 +13,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { processExpiredAwards } from '../../src/cron/award.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, awardParticipate, diff --git a/packages/functions/test-tangle/award/award_5.spec.ts b/packages/functions/test-tangle/award/award_5.spec.ts index 2add1ac634..0d5fdc51ca 100644 --- a/packages/functions/test-tangle/award/award_5.spec.ts +++ b/packages/functions/test-tangle/award/award_5.spec.ts @@ -13,9 +13,9 @@ import { TransactionType, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; import { processExpiredAwards } from '../../src/cron/award.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, awardParticipate, diff --git a/packages/functions/test-tangle/award/award_6.spec.ts b/packages/functions/test-tangle/award/award_6.spec.ts index 5910ca3714..914b494a90 100644 --- a/packages/functions/test-tangle/award/award_6.spec.ts +++ b/packages/functions/test-tangle/award/award_6.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -12,7 +13,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { validateAddress } from '../../src/runtime/firebase/address'; import { approveAwardParticipant, createAward, fundAward } from '../../src/runtime/firebase/award'; import { claimMintedTokenOrder } from '../../src/runtime/firebase/token/minting'; diff --git a/packages/functions/test-tangle/award/award_7.spec.ts b/packages/functions/test-tangle/award/award_7.spec.ts index 388f8067d3..7c1eedca53 100644 --- a/packages/functions/test-tangle/award/award_7.spec.ts +++ b/packages/functions/test-tangle/award/award_7.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import { NftOutput } from '@iota/sdk'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, createAward, fundAward } from '../../src/runtime/firebase/award'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; diff --git a/packages/functions/test-tangle/award/award_8.spec.ts b/packages/functions/test-tangle/award/award_8.spec.ts index 0e34c19174..de44841ac5 100644 --- a/packages/functions/test-tangle/award/award_8.spec.ts +++ b/packages/functions/test-tangle/award/award_8.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -9,7 +10,6 @@ import { TransactionPayloadType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, createAward, fundAward } from '../../src/runtime/firebase/award'; import * as wallet from '../../src/utils/wallet.utils'; import { createMember, createSpace, mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/award/award_9.spec.ts b/packages/functions/test-tangle/award/award_9.spec.ts index c823ff0c88..dba74aabaa 100644 --- a/packages/functions/test-tangle/award/award_9.spec.ts +++ b/packages/functions/test-tangle/award/award_9.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -11,7 +12,6 @@ import { TransactionPayloadType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, createAward, fundAward } from '../../src/runtime/firebase/award'; import { joinSpace } from '../../src/runtime/firebase/space'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; diff --git a/packages/functions/test-tangle/award/common.ts b/packages/functions/test-tangle/award/common.ts index 84a01442b6..16b81689b5 100644 --- a/packages/functions/test-tangle/award/common.ts +++ b/packages/functions/test-tangle/award/common.ts @@ -1,3 +1,4 @@ +import { IQuery, build5Db } from '@build-5/database'; import { COL, Network, @@ -6,8 +7,6 @@ import { TransactionPayloadType, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; -import { IQuery } from '../../src/firebase/firestore/interfaces'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; import { getRandomSymbol, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/base-token-trading/Helper.ts b/packages/functions/test-tangle/base-token-trading/Helper.ts index 1629f09b65..e5385e2a4f 100644 --- a/packages/functions/test-tangle/base-token-trading/Helper.ts +++ b/packages/functions/test-tangle/base-token-trading/Helper.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, Network, Token, TokenStatus } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { createMember } from '../../src/runtime/firebase/member'; import { IotaWallet } from '../../src/services/wallet/IotaWalletService'; import { Wallet } from '../../src/services/wallet/wallet'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_1.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_1.spec.ts index 9b7072b47c..c95b655d13 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_1.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -12,7 +13,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_10.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_10.spec.ts index a0d6de268c..2de1c202cd 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_10.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_10.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_a.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_a.spec.ts index 4ba443aab5..faf80a3058 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_a.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_a.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_b.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_b.spec.ts index 47ae9973c7..c1eabb34f4 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_b.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_b.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_c.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_c.spec.ts index 80e499f3de..90e89bb18d 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_c.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_c.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_d.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_d.spec.ts index b838664f21..49f74db50d 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_d.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_d.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_12.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_12.spec.ts index f8d8483ad2..1c1238bef0 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_12.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_12.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { TokenTradeOrderType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { getTangleOrder } from '../common'; import { requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_13.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_13.spec.ts index 990048efe6..7934f8df5e 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_13.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_13.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { TokenTradeOrder, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { awaitTransactionConfirmationsForToken, getTangleOrder } from '../common'; import { requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_2.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_2.spec.ts index 09e07cefbd..386db4cd0f 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_2.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { getAddress } from '../../src/utils/address.utils'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_3.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_3.spec.ts index 74da2493c8..3f7d2f7ef1 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_3.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_3.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_4.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_4.spec.ts index 9150c968d3..cda71e4e7f 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_4.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_4.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_5.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_5.spec.ts index f1f4827396..9a7e87626b 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_5.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_5.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, TokenPurchase, TokenTradeOrderType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_6.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_6.spec.ts index 13797873ba..89f5d5904e 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_6.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_6.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, TokenPurchase, TokenTradeOrderType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_7.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_7.spec.ts index ac585479cd..0dc2d0c2fb 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_7.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_7.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, CreditPaymentReason, @@ -10,7 +11,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { cancelExpiredSale } from '../../src/cron/token.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_8.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_8.spec.ts index a5930a7321..143713df79 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_8.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_8.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { TokenTradeOrderType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_9.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_9.spec.ts index c10f8113b0..f7c0d9b5dd 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_9.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_9.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { TokenTradeOrderType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/collection-minting/Helper.ts b/packages/functions/test-tangle/collection-minting/Helper.ts index e6f74c224a..15e6363680 100644 --- a/packages/functions/test-tangle/collection-minting/Helper.ts +++ b/packages/functions/test-tangle/collection-minting/Helper.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { Access, COL, @@ -20,7 +21,6 @@ import { import { FeatureType, MetadataFeature, NftOutput, hexToUtf8 } from '@iota/sdk'; import dayjs from 'dayjs'; import { set } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveCollection, createCollection, diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_1.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_1.spec.ts index 1ef7234c7e..0274fc3fbb 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_1.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_1.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, UnsoldMintingOptions, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintCollection } from '../../src/runtime/firebase/collection/index'; import * as config from '../../src/utils/config.utils'; import { expectThrow, mockWalletReturnValue } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_10.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_10.spec.ts index f0de2884d1..58a3973f5e 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_10.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_10.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Nft } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { CollectionMintHelper } from './Helper'; describe('Collection minting', () => { diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_11.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_11.spec.ts index 8a481207c1..113d5fabae 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_11.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_11.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Nft, UnsoldMintingOptions } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { CollectionMintHelper } from './Helper'; describe('Collection minting', () => { diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_12.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_12.spec.ts index cf1fb302fe..7f9fc72268 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_12.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_12.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Nft } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { CollectionMintHelper } from './Helper'; describe('Collection minting', () => { diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_2.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_2.spec.ts index 233fb322cf..5be3f3dd78 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_2.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -6,7 +7,6 @@ import { Nft, UnsoldMintingOptions, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintCollection } from '../../src/runtime/firebase/collection'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { MEDIA, testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_3.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_3.spec.ts index 05fe9ec047..e539ba6c99 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_3.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_3.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Nft, @@ -7,7 +8,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { CollectionMintHelper } from './Helper'; describe('Collection minting', () => { diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_4.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_4.spec.ts index 2c4cf0f593..4bd93f1af6 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_4.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_4.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -13,7 +14,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { NftOutput } from '@iota/sdk'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { getAddress } from '../../src/utils/address.utils'; import { EMPTY_NFT_ID } from '../../src/utils/collection-minting-utils/nft.utils'; import { CollectionMintHelper, getNftMetadata } from './Helper'; diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_5.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_5.spec.ts index 9caa7fd330..b356e1dfb2 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_5.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_5.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -7,7 +8,6 @@ import { UnsoldMintingOptions, } from '@build-5/interfaces'; import { isEqual } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintCollection } from '../../src/runtime/firebase/collection/index'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_6.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_6.spec.ts index 99f3026048..84417c6ff1 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_6.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_6.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, Nft, UnsoldMintingOptions } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { CollectionMintHelper } from './Helper'; describe('Collection minting', () => { diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_7.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_7.spec.ts index a58e6ac170..c298bd3811 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_7.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_7.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -7,7 +8,6 @@ import { UnsoldMintingOptions, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintCollection } from '../../src/runtime/firebase/collection/index'; import { expectThrow, mockWalletReturnValue } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_8.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_8.spec.ts index 04d8aa1941..b24e8b422f 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_8.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_8.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -6,7 +7,6 @@ import { UnsoldMintingOptions, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintCollection } from '../../src/runtime/firebase/collection/index'; import { expectThrow, mockWalletReturnValue } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/collection-minting/collection-minting_9.spec.ts b/packages/functions/test-tangle/collection-minting/collection-minting_9.spec.ts index 2c183f0a57..3c6e8b3402 100644 --- a/packages/functions/test-tangle/collection-minting/collection-minting_9.spec.ts +++ b/packages/functions/test-tangle/collection-minting/collection-minting_9.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, UnsoldMintingOptions, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintCollection } from '../../src/runtime/firebase/collection/index'; import { expectThrow, mockWalletReturnValue } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/common.ts b/packages/functions/test-tangle/common.ts index c71a277b0f..88d1b266ad 100644 --- a/packages/functions/test-tangle/common.ts +++ b/packages/functions/test-tangle/common.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MAX_WALLET_RETRY, @@ -15,7 +16,6 @@ import { } from '@iota/sdk'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../src/firebase/firestore/build5Db'; import { Wallet } from '../src/services/wallet/wallet'; import { generateRandomAmount } from '../src/utils/common.utils'; import { dateToTimestamp, serverTime } from '../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/metadata-nft/Helper.ts b/packages/functions/test-tangle/metadata-nft/Helper.ts index 2b168ec2f1..ed29345196 100644 --- a/packages/functions/test-tangle/metadata-nft/Helper.ts +++ b/packages/functions/test-tangle/metadata-nft/Helper.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { Token, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_1.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_1.spec.ts index ba5bff0e8c..fe3db995fd 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_1.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -10,7 +11,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { BasicOutput, RegularTransactionEssence, TransactionPayload } from '@iota/sdk'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { getOutputMetadata } from '../../src/utils/basic-output.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_1_b.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_1_b.spec.ts index d46802a07b..f70a6ab353 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_1_b.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_1_b.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -10,7 +11,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { BasicOutput, RegularTransactionEssence, TransactionPayload } from '@iota/sdk'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { getOutputMetadata } from '../../src/utils/basic-output.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_2.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_2.spec.ts index 1c126cb8b5..16a538559e 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_2.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -9,7 +10,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { BasicOutput, RegularTransactionEssence, TransactionPayload } from '@iota/sdk'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { getOutputMetadata } from '../../src/utils/basic-output.utils'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts index fc5f89add3..a99119f206 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { NftOutput } from '@iota/sdk'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { getOutputMetadata } from '../../src/utils/basic-output.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts index c04c9d7fb3..8bcd35639b 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { NftOutput } from '@iota/sdk'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { getOutputMetadata } from '../../src/utils/basic-output.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_4.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_4.spec.ts index a9ee6f7d3f..a21debf61a 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_4.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_4.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -9,7 +10,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_5.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_5.spec.ts index 4b0d637790..c533d56d27 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_5.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_5.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -8,7 +9,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_5_b.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_5_b.spec.ts index c8796d306c..757b9ae910 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_5_b.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_5_b.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -8,7 +9,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_6.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_6.spec.ts index bb28209280..cd834e32bd 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_6.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_6.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_7.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_7.spec.ts index d3d7ed0f2d..6a57aa8e16 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_7.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_7.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/minted-nft-trading/Helper.ts b/packages/functions/test-tangle/minted-nft-trading/Helper.ts index d07c55d42b..0d6cdd1f85 100644 --- a/packages/functions/test-tangle/minted-nft-trading/Helper.ts +++ b/packages/functions/test-tangle/minted-nft-trading/Helper.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { Access, Categories, @@ -18,7 +19,6 @@ import { UnsoldMintingOptions, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveCollection, createCollection, diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_1.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_1.spec.ts index d0dfcbbf0e..7c07255739 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_1.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -13,7 +14,6 @@ import { NftOutput } from '@iota/sdk'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { finalizeAllNftAuctions } from '../../src/cron/nft.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { openBid } from '../../src/runtime/firebase/nft'; import { withdrawNft } from '../../src/runtime/firebase/nft/index'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_10.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_10.spec.ts index 3e618b0e0e..d46ed97972 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_10.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_10.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { NftPurchaseTangleRequest, TangleRequestType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { awaitLedgerInclusionState, requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_11.only.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_11.only.spec.ts index 4d4bee408e..0770fc11e1 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_11.only.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_11.only.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -9,7 +10,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { awaitLedgerInclusionState, requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_1_b.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_1_b.spec.ts index fdd08f58db..39640ac8dd 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_1_b.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_1_b.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -13,7 +14,6 @@ import { NftOutput } from '@iota/sdk'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { finalizeAllNftAuctions } from '../../src/cron/nft.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { openBid } from '../../src/runtime/firebase/nft'; import { withdrawNft } from '../../src/runtime/firebase/nft/index'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_2.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_2.spec.ts index 682441e801..ec6f27f362 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_2.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -10,7 +11,6 @@ import { } from '@build-5/interfaces'; import { NftOutput } from '@iota/sdk'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { orderNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { getAddress } from '../../src/utils/address.utils'; import { Bech32AddressHelper } from '../../src/utils/bech32-address.helper'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_3.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_3.spec.ts index fa1ed63a34..6950bfcc18 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_3.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_3.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -6,7 +7,6 @@ import { UnsoldMintingOptions, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintCollection } from '../../src/runtime/firebase/collection/index'; import { expectThrow, mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_4.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_4.spec.ts index a662f11cbe..a0d8180463 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_4.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_4.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -10,7 +11,6 @@ import { TransactionPayloadType, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_5.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_5.spec.ts index 6455576b5c..6ac9f123f6 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_5.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_5.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -8,7 +9,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { getWallet } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_6.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_6.spec.ts index 32a221bc1e..59d73936da 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_6.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_6.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, CollectionType, @@ -7,7 +8,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_7.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_7.spec.ts index 57999e40fb..d20b67f52c 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_7.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_7.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { BaseTangleResponse, COL, @@ -11,7 +12,6 @@ import { TransactionPayloadType, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_8.spec.ts b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_8.spec.ts index e31eb3fc17..ff3519abd0 100644 --- a/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_8.spec.ts +++ b/packages/functions/test-tangle/minted-nft-trading/minted-nft-trading_8.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { NftStatus, TangleRequestType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/minted-token-airdrop/Helper.ts b/packages/functions/test-tangle/minted-token-airdrop/Helper.ts index ca2bcbc428..4272122468 100644 --- a/packages/functions/test-tangle/minted-token-airdrop/Helper.ts +++ b/packages/functions/test-tangle/minted-token-airdrop/Helper.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Network, @@ -8,7 +9,6 @@ import { TokenDropStatus, TokenStatus, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts index cee11bf6ee..fa48f13c1c 100644 --- a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -17,7 +18,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { head } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { airdropMintedToken, claimMintedTokenOrder, diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts index 894d25a04d..e6b59c77d8 100644 --- a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -17,7 +18,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { head } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { airdropMintedToken, claimMintedTokenOrder, diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts index a8bdce7244..acd508e06e 100644 --- a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -12,7 +13,6 @@ import { Transaction, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { airdropMintedToken, claimMintedTokenOrder, diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_2.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_2.spec.ts index 9acdfc5b13..d918dd93c0 100644 --- a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_2.spec.ts +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_2.spec.ts @@ -14,8 +14,8 @@ import { TransactionType, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { airdropMintedToken, claimMintedTokenOrder, diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_4.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_4.spec.ts index e492233c13..41b524c924 100644 --- a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_4.spec.ts +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_4.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -14,7 +15,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { airdropMintedToken } from '../../src/runtime/firebase/token/minting'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_5.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_5.spec.ts index 4698f25ec3..f19541b52e 100644 --- a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_5.spec.ts +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_5.spec.ts @@ -10,8 +10,8 @@ import { WenError, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { airdropMintedToken, claimMintedTokenOrder, diff --git a/packages/functions/test-tangle/minted-token-claim/Helper.ts b/packages/functions/test-tangle/minted-token-claim/Helper.ts index 52ca68e6ed..fd246a9479 100644 --- a/packages/functions/test-tangle/minted-token-claim/Helper.ts +++ b/packages/functions/test-tangle/minted-token-claim/Helper.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, Network, Space, TokenStatus } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_1.spec.ts b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_1.spec.ts index 6d26d27b0b..5af97d7f21 100644 --- a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_1.spec.ts +++ b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_1.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, Token, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { claimMintedTokenOrder } from '../../src/runtime/firebase/token/minting'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_2.spec.ts b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_2.spec.ts index a029cf229b..a6b4787a13 100644 --- a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_2.spec.ts +++ b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_2.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { claimMintedTokenOrder } from '../../src/runtime/firebase/token/minting'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_3.spec.ts b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_3.spec.ts index 6835d176d2..7c7326ef40 100644 --- a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_3.spec.ts +++ b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_3.spec.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Token, TokenDrop, TokenDropStatus, TransactionType } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { claimMintedTokenOrder } from '../../src/runtime/firebase/token/minting'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_4.spec.ts b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_4.spec.ts index 18c704a3a6..4258ab143e 100644 --- a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_4.spec.ts +++ b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_4.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Token, @@ -11,7 +12,6 @@ import { import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { retryWallet } from '../../src/cron/wallet.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { claimMintedTokenOrder } from '../../src/runtime/firebase/token/minting'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_5.spec.ts b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_5.spec.ts index 25a8c335cc..5a99b98b8d 100644 --- a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_5.spec.ts +++ b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_5.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, Token, TokenDistribution, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { claimMintedTokenOrder } from '../../src/runtime/firebase/token/minting'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_6.spec.ts b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_6.spec.ts index 03cd2f8c2f..7fc65efded 100644 --- a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_6.spec.ts +++ b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_6.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, Token, TokenDistribution, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { claimMintedTokenOrder } from '../../src/runtime/firebase/token/minting'; import { expectThrow, mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_7.spec.ts b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_7.spec.ts index f8a71b3cb0..6cb682a671 100644 --- a/packages/functions/test-tangle/minted-token-claim/token.claim.minted_7.spec.ts +++ b/packages/functions/test-tangle/minted-token-claim/token.claim.minted_7.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, SUB_COL, Token, TokenStatus, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { claimMintedTokenOrder, mintTokenOrder } from '../../src/runtime/firebase/token/minting'; import { createMember, createSpace, mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-trade/Helper.ts b/packages/functions/test-tangle/minted-token-trade/Helper.ts index beffaa1ce5..fff974bffe 100644 --- a/packages/functions/test-tangle/minted-token-trade/Helper.ts +++ b/packages/functions/test-tangle/minted-token-trade/Helper.ts @@ -12,7 +12,7 @@ import { Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { build5Db } from '@build-5/database'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_1.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_1.spec.ts index 68b8a980af..b969fd8461 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_1.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_1.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -11,7 +12,6 @@ import { TransactionPayloadType, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { awaitTransactionConfirmationsForToken } from '../common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_10.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_10.spec.ts index 0b23b05f5f..4bf874d136 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_10.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_10.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, TokenPurchase } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { awaitTransactionConfirmationsForToken } from '../common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_11.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_11.spec.ts index e8c67ba09a..ee9a3f7a14 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_11.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_11.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, TokenPurchase } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { awaitTransactionConfirmationsForToken } from '../common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_12.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_12.spec.ts index 101a5195f8..ee31cf8b22 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_12.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_12.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { cancelExpiredSale } from '../../src/cron/token.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_12_b.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_12_b.spec.ts index c841d744ad..492407ad6a 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_12_b.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_12_b.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { cancelExpiredSale } from '../../src/cron/token.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_13.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_13.spec.ts index ea1cedc4c3..a7031c36e9 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_13.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_13.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { TokenTradeOrderStatus, TokenTradeOrderType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_14.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_14.spec.ts index 7dc0e35c7e..411ca4faa9 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_14.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_14.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { head } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { awaitTransactionConfirmationsForToken } from '../common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_14_b.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_14_b.spec.ts index d9764ffe83..aa745cda2f 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_14_b.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_14_b.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { awaitTransactionConfirmationsForToken } from '../common'; import { requestMintedTokenFromFaucet } from '../faucet'; import { Helper, VAULT_MNEMONIC } from './Helper'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_15.only.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_15.only.spec.ts index 69e30208d0..13d3c571b9 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_15.only.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_15.only.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -11,7 +12,6 @@ import { TransactionType, } from '@build-5/interfaces'; import { head } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { awaitTransactionConfirmationsForToken } from '../common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_16.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_16.spec.ts index eda1c24ea9..63ea971565 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_16.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_16.spec.ts @@ -9,7 +9,7 @@ import { TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { build5Db } from '@build-5/database'; import { cancelTradeOrder, tradeToken } from '../../src/runtime/firebase/token/trading'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_17.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_17.spec.ts index 9f2386ffc2..022f02d6c7 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_17.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_17.spec.ts @@ -9,7 +9,7 @@ import { TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { build5Db } from '@build-5/database'; import { creditUnrefundable } from '../../src/runtime/firebase/credit/index'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_18.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_18.spec.ts index a341e7c6d1..4022f15000 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_18.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_18.spec.ts @@ -9,8 +9,8 @@ import { TransactionType, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { wait } from '../../test/controls/common'; import { getTangleOrder } from '../common'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_19.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_19.spec.ts index 772dd7a180..7f46b009d2 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_19.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_19.spec.ts @@ -7,7 +7,7 @@ import { Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { build5Db } from '@build-5/database'; import { wait } from '../../test/controls/common'; import { awaitTransactionConfirmationsForToken, getTangleOrder } from '../common'; import { requestFundsFromFaucet, requestMintedTokenFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_2.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_2.spec.ts index 7228aff71a..d4321bf590 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_2.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_2.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -9,7 +10,6 @@ import { TransactionPayloadType, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { awaitTransactionConfirmationsForToken } from '../common'; import { requestMintedTokenFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_3.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_3.spec.ts index 938aa1c6bc..bd7e55ee44 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_3.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_3.spec.ts @@ -11,9 +11,9 @@ import { TransactionType, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; import { cancelExpiredSale } from '../../src/cron/token.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_4.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_4.spec.ts index bbdd9de2b2..ed1b731aaa 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_4.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_4.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, CreditPaymentReason, @@ -7,7 +8,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { cancelTradeOrder } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_5.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_5.spec.ts index b7cf1cef59..465fe5b1d8 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_5.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_5.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, CreditPaymentReason, @@ -8,7 +9,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { cancelTradeOrder } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_6.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_6.spec.ts index c8ea408842..3122747175 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_6.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_6.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, CreditPaymentReason, @@ -8,7 +9,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { cancelTradeOrder } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_7.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_7.spec.ts index 3e9131cdba..28ec8fc8e3 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_7.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_7.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, CreditPaymentReason, @@ -8,7 +9,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { cancelTradeOrder } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_8.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_8.spec.ts index 4279704eb7..2c82c047ef 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_8.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_8.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, TokenTradeOrderType, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { expectThrow, mockWalletReturnValue } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_9.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_9.spec.ts index 3c4cb8edea..963ed64006 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_9.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_9.spec.ts @@ -8,7 +8,7 @@ import { TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { build5Db } from '@build-5/database'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/nft-bid/Helper.ts b/packages/functions/test-tangle/nft-bid/Helper.ts index deeba46f3e..ca84da1980 100644 --- a/packages/functions/test-tangle/nft-bid/Helper.ts +++ b/packages/functions/test-tangle/nft-bid/Helper.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { Access, Categories, @@ -18,7 +19,6 @@ import { UnsoldMintingOptions, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveCollection, createCollection, diff --git a/packages/functions/test-tangle/nft-bid/nft-bid.otr_1.spec.ts b/packages/functions/test-tangle/nft-bid/nft-bid.otr_1.spec.ts index 09d70b159c..b38e75a74f 100644 --- a/packages/functions/test-tangle/nft-bid/nft-bid.otr_1.spec.ts +++ b/packages/functions/test-tangle/nft-bid/nft-bid.otr_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -12,7 +13,6 @@ import { NftOutput } from '@iota/sdk'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { finalizeAllNftAuctions } from '../../src/cron/nft.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { Bech32AddressHelper } from '../../src/utils/bech32-address.helper'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/nft-bid/nft-bid.otr_2.spec.ts b/packages/functions/test-tangle/nft-bid/nft-bid.otr_2.spec.ts index aa58ddc74b..8dc5d0e5ce 100644 --- a/packages/functions/test-tangle/nft-bid/nft-bid.otr_2.spec.ts +++ b/packages/functions/test-tangle/nft-bid/nft-bid.otr_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -10,7 +11,6 @@ import { import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { finalizeAllNftAuctions } from '../../src/cron/nft.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { wait } from '../../test/controls/common'; import { getTangleOrder } from '../common'; diff --git a/packages/functions/test-tangle/nft-bid/nft-bid.otr_3.spec.ts b/packages/functions/test-tangle/nft-bid/nft-bid.otr_3.spec.ts index da0dfa4302..33eeecf52d 100644 --- a/packages/functions/test-tangle/nft-bid/nft-bid.otr_3.spec.ts +++ b/packages/functions/test-tangle/nft-bid/nft-bid.otr_3.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -10,7 +11,6 @@ import { import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { finalizeAllNftAuctions } from '../../src/cron/nft.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { IotaWallet } from '../../src/services/wallet/IotaWalletService'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/nft-bid/nft-bid.otr_4.spec.ts b/packages/functions/test-tangle/nft-bid/nft-bid.otr_4.spec.ts index a3827f362a..75485ce515 100644 --- a/packages/functions/test-tangle/nft-bid/nft-bid.otr_4.spec.ts +++ b/packages/functions/test-tangle/nft-bid/nft-bid.otr_4.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -10,7 +11,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { finalizeAllNftAuctions } from '../../src/cron/nft.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { wait } from '../../test/controls/common'; import { getTangleOrder } from '../common'; diff --git a/packages/functions/test-tangle/nft-set-for-sale/Helper.ts b/packages/functions/test-tangle/nft-set-for-sale/Helper.ts index f11a4b4ce4..349eec599c 100644 --- a/packages/functions/test-tangle/nft-set-for-sale/Helper.ts +++ b/packages/functions/test-tangle/nft-set-for-sale/Helper.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { Access, Categories, @@ -13,7 +14,6 @@ import { Space, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveCollection, createCollection } from '../../src/runtime/firebase/collection/index'; import { createNft, orderNft } from '../../src/runtime/firebase/nft/index'; import { Wallet } from '../../src/services/wallet/wallet'; diff --git a/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_1.spec.ts b/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_1.spec.ts index c0d1170f40..7425d48919 100644 --- a/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_1.spec.ts +++ b/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { TangleRequestType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { getTangleOrder } from '../common'; import { requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_2.spec.ts b/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_2.spec.ts index 3ce8e8b70f..ca1ecb46cc 100644 --- a/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_2.spec.ts +++ b/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { getTangleOrder } from '../common'; import { requestFundsFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_3.spec.ts b/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_3.spec.ts index 7511615e7f..ee6c5fa6d2 100644 --- a/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_3.spec.ts +++ b/packages/functions/test-tangle/nft-set-for-sale/nft-set-for-sale_3.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -11,7 +12,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { wait } from '../../test/controls/common'; import { getTangleOrder } from '../common'; diff --git a/packages/functions/test-tangle/nft-staking/Helper.ts b/packages/functions/test-tangle/nft-staking/Helper.ts index f76cbdd39d..318cdeec31 100644 --- a/packages/functions/test-tangle/nft-staking/Helper.ts +++ b/packages/functions/test-tangle/nft-staking/Helper.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { Access, COL, @@ -31,7 +32,6 @@ import { } from '@iota/sdk'; import dayjs from 'dayjs'; import { cloneDeep } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveCollection, createCollection, diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_1.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_1.spec.ts index 9fe39a8c66..d7b01a8738 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_1.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -8,7 +9,6 @@ import { Transaction, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_2.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_2.spec.ts index 24c31c0a03..abfeb3854a 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_2.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_2.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Network, @@ -7,7 +8,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_2_b.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_2_b.spec.ts index 116f23820a..e3292c6fd8 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_2_b.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_2_b.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Network, @@ -7,7 +8,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_3.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_3.spec.ts index d4f726cb2b..a7678d167f 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_3.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_3.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -9,7 +10,6 @@ import { } from '@build-5/interfaces'; import { UnlockConditionType } from '@iota/sdk'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { NftWallet } from '../../src/services/wallet/NftWallet'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_4.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_4.spec.ts index 6b25486ec2..1a139ce495 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_4.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_4.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Network, @@ -7,7 +8,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_5.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_5.spec.ts index 0e2c12da67..ed10c8bffa 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_5.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_5.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Award, COL, @@ -9,7 +10,6 @@ import { TransactionPayloadType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveAwardParticipant, createAward, fundAward } from '../../src/runtime/firebase/award'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_6.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_6.spec.ts index 6226f53062..fa0c8e8d2a 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_6.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_6.spec.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, KEY_NAME_TANGLE, Network, Nft, StakeType } from '@build-5/interfaces'; import { NftOutput, NftOutputBuilderParams, TagFeature, Utils, utf8ToHex } from '@iota/sdk'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_7.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_7.spec.ts index 266caf5cb4..3a2ec70576 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_7.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_7.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Network, Nft, StakeType, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/nft-staking/nft-staking_8.spec.ts b/packages/functions/test-tangle/nft-staking/nft-staking_8.spec.ts index 4e08cafbcc..4004d3f35f 100644 --- a/packages/functions/test-tangle/nft-staking/nft-staking_8.spec.ts +++ b/packages/functions/test-tangle/nft-staking/nft-staking_8.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, IgnoreWalletReason, @@ -8,7 +9,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { creditUnrefundable } from '../../src/runtime/firebase/credit'; import { stakeNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/proposal-tangle/Helper.ts b/packages/functions/test-tangle/proposal-tangle/Helper.ts index 9fc91a6a90..178792f5ad 100644 --- a/packages/functions/test-tangle/proposal-tangle/Helper.ts +++ b/packages/functions/test-tangle/proposal-tangle/Helper.ts @@ -1,3 +1,4 @@ +import { build5Db, IQuery } from '@build-5/database'; import { COL, Member, @@ -14,8 +15,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; -import { IQuery } from '../../src/firebase/firestore/interfaces'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/proposal-tangle/proposal.approval.spec.ts b/packages/functions/test-tangle/proposal-tangle/proposal.approval.spec.ts index e368cd3976..3ec213b28e 100644 --- a/packages/functions/test-tangle/proposal-tangle/proposal.approval.spec.ts +++ b/packages/functions/test-tangle/proposal-tangle/proposal.approval.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Proposal, TangleRequestType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/proposal-tangle/proposal.simple.vote.spec.ts b/packages/functions/test-tangle/proposal-tangle/proposal.simple.vote.spec.ts index 5a6551ee84..04208da99c 100644 --- a/packages/functions/test-tangle/proposal-tangle/proposal.simple.vote.spec.ts +++ b/packages/functions/test-tangle/proposal-tangle/proposal.simple.vote.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -5,7 +6,6 @@ import { ProposalType, TangleRequestType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveProposal } from '../../src/runtime/firebase/proposal'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/proposal-tangle/proposal.stake.voting.spec.ts b/packages/functions/test-tangle/proposal-tangle/proposal.stake.voting.spec.ts index fe78b71303..e193fff0ea 100644 --- a/packages/functions/test-tangle/proposal-tangle/proposal.stake.voting.spec.ts +++ b/packages/functions/test-tangle/proposal-tangle/proposal.stake.voting.spec.ts @@ -1,7 +1,7 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, TangleRequestType, Transaction } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveProposal } from '../../src/runtime/firebase/proposal'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/proposal-tangle/proposal.token.voting.spec.ts b/packages/functions/test-tangle/proposal-tangle/proposal.token.voting.spec.ts index daabcb9003..67ea1458e7 100644 --- a/packages/functions/test-tangle/proposal-tangle/proposal.token.voting.spec.ts +++ b/packages/functions/test-tangle/proposal-tangle/proposal.token.voting.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveProposal } from '../../src/runtime/firebase/proposal'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/space-tangle/Helper.ts b/packages/functions/test-tangle/space-tangle/Helper.ts index cb0fb11153..4a32119719 100644 --- a/packages/functions/test-tangle/space-tangle/Helper.ts +++ b/packages/functions/test-tangle/space-tangle/Helper.ts @@ -1,6 +1,5 @@ +import { IQuery, build5Db } from '@build-5/database'; import { COL, Member, Network, Space, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; -import { IQuery } from '../../src/firebase/firestore/interfaces'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/space-tangle/space.accept.member.spec.ts b/packages/functions/test-tangle/space-tangle/space.accept.member.spec.ts index 97c8564e2c..58fcd78ddf 100644 --- a/packages/functions/test-tangle/space-tangle/space.accept.member.spec.ts +++ b/packages/functions/test-tangle/space-tangle/space.accept.member.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { TangleRequestType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { requestFundsFromFaucet } from '../faucet'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/space-tangle/space.block.member.spec.ts b/packages/functions/test-tangle/space-tangle/space.block.member.spec.ts index 99be678afc..ae421f1a90 100644 --- a/packages/functions/test-tangle/space-tangle/space.block.member.spec.ts +++ b/packages/functions/test-tangle/space-tangle/space.block.member.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { TangleRequestType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { joinSpace } from '../../src/runtime/firebase/space'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/space-tangle/space.create.spec.ts b/packages/functions/test-tangle/space-tangle/space.create.spec.ts index 0dc33a26c8..0e2193ed0c 100644 --- a/packages/functions/test-tangle/space-tangle/space.create.spec.ts +++ b/packages/functions/test-tangle/space-tangle/space.create.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { TangleRequestType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { requestFundsFromFaucet } from '../faucet'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/space-tangle/space.decline.member.spec.ts b/packages/functions/test-tangle/space-tangle/space.decline.member.spec.ts index 9a498911bd..3644240489 100644 --- a/packages/functions/test-tangle/space-tangle/space.decline.member.spec.ts +++ b/packages/functions/test-tangle/space-tangle/space.decline.member.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { TangleRequestType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { joinSpace } from '../../src/runtime/firebase/space'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/space-tangle/space.edit.guardian.spec.ts b/packages/functions/test-tangle/space-tangle/space.edit.guardian.spec.ts index f7b847e1b2..84a261d5f5 100644 --- a/packages/functions/test-tangle/space-tangle/space.edit.guardian.spec.ts +++ b/packages/functions/test-tangle/space-tangle/space.edit.guardian.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { TangleRequestType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { joinSpace } from '../../src/runtime/firebase/space'; import { addGuardianToSpace, mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/space-tangle/space.join.spec.ts b/packages/functions/test-tangle/space-tangle/space.join.spec.ts index e784a6ef4d..24c9b26070 100644 --- a/packages/functions/test-tangle/space-tangle/space.join.spec.ts +++ b/packages/functions/test-tangle/space-tangle/space.join.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -8,7 +9,6 @@ import { TangleRequestType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; import { requestFundsFromFaucet } from '../faucet'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/space-tangle/space.leave.spec.ts b/packages/functions/test-tangle/space-tangle/space.leave.spec.ts index 758a6760b9..6bfe4d0d26 100644 --- a/packages/functions/test-tangle/space-tangle/space.leave.spec.ts +++ b/packages/functions/test-tangle/space-tangle/space.leave.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -6,7 +7,6 @@ import { TangleRequestType, Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { joinSpace } from '../../src/runtime/firebase/space'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/staking/Helper.ts b/packages/functions/test-tangle/staking/Helper.ts index 919b4adc7d..e0d0fa00df 100644 --- a/packages/functions/test-tangle/staking/Helper.ts +++ b/packages/functions/test-tangle/staking/Helper.ts @@ -18,9 +18,9 @@ import { calcStakedMultiplier, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositStake } from '../../src/runtime/firebase/stake'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { Wallet } from '../../src/services/wallet/wallet'; diff --git a/packages/functions/test-tangle/staking/staking_1.spec.ts b/packages/functions/test-tangle/staking/staking_1.spec.ts index 59a587ff0b..d3807dabdc 100644 --- a/packages/functions/test-tangle/staking/staking_1.spec.ts +++ b/packages/functions/test-tangle/staking/staking_1.spec.ts @@ -10,10 +10,10 @@ import { WenError, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import { UnlockConditionType } from '@iota/sdk'; import dayjs from 'dayjs'; import { removeExpiredStakesFromSpace } from '../../src/cron/stake.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositStake } from '../../src/runtime/firebase/stake'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/staking/staking_2.spec.ts b/packages/functions/test-tangle/staking/staking_2.spec.ts index a7ca7ffc27..fea3cdfa81 100644 --- a/packages/functions/test-tangle/staking/staking_2.spec.ts +++ b/packages/functions/test-tangle/staking/staking_2.spec.ts @@ -1,8 +1,8 @@ +import { build5Db } from '@build-5/database'; import { COL, Space, StakeType } from '@build-5/interfaces'; import { FeatureType, MetadataFeature, UnlockConditionType, hexToUtf8 } from '@iota/sdk'; import dayjs from 'dayjs'; import { removeExpiredStakesFromSpace } from '../../src/cron/stake.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/staking/staking_3.spec.ts b/packages/functions/test-tangle/staking/staking_3.spec.ts index 208f987cfb..4c1dba5444 100644 --- a/packages/functions/test-tangle/staking/staking_3.spec.ts +++ b/packages/functions/test-tangle/staking/staking_3.spec.ts @@ -1,7 +1,7 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, MIN_IOTA_AMOUNT, Stake, StakeType } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { removeExpiredStakesFromSpace } from '../../src/cron/stake.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { wait } from '../../test/controls/common'; import { requestMintedTokenFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/staking/staking_4.spec.ts b/packages/functions/test-tangle/staking/staking_4.spec.ts index 9d0245720a..a80d5a2ab2 100644 --- a/packages/functions/test-tangle/staking/staking_4.spec.ts +++ b/packages/functions/test-tangle/staking/staking_4.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, IgnoreWalletReason, @@ -17,7 +18,6 @@ import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { stakeRewardCronTask } from '../../src/cron/stakeReward.cron'; import { retryWallet } from '../../src/cron/wallet.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { claimMintedTokenOrder } from '../../src/runtime/firebase/token/minting'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/staking/staking_5.spec.ts b/packages/functions/test-tangle/staking/staking_5.spec.ts index 9832cb0c20..3ddd7427e9 100644 --- a/packages/functions/test-tangle/staking/staking_5.spec.ts +++ b/packages/functions/test-tangle/staking/staking_5.spec.ts @@ -9,7 +9,7 @@ import { Transaction, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { build5Db } from '@build-5/database'; import { wait } from '../../test/controls/common'; import { getTangleOrder } from '../common'; import { requestFundsFromFaucet, requestMintedTokenFromFaucet } from '../faucet'; diff --git a/packages/functions/test-tangle/tangleRequest/simple.token.trade.spec.ts b/packages/functions/test-tangle/tangleRequest/simple.token.trade.spec.ts index a44965873a..e7a19746c6 100644 --- a/packages/functions/test-tangle/tangleRequest/simple.token.trade.spec.ts +++ b/packages/functions/test-tangle/tangleRequest/simple.token.trade.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, IgnoreWalletReason, @@ -12,7 +13,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { Wallet } from '../../src/services/wallet/wallet'; import { getAddress } from '../../src/utils/address.utils'; import * as wallet from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/tangleRequest/tangle-request.spec.ts b/packages/functions/test-tangle/tangleRequest/tangle-request.spec.ts index e4ffa302e4..0c70280310 100644 --- a/packages/functions/test-tangle/tangleRequest/tangle-request.spec.ts +++ b/packages/functions/test-tangle/tangleRequest/tangle-request.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -10,7 +11,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/token-import/Helper.ts b/packages/functions/test-tangle/token-import/Helper.ts index 410ae6f449..1aed1961d4 100644 --- a/packages/functions/test-tangle/token-import/Helper.ts +++ b/packages/functions/test-tangle/token-import/Helper.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, Network, Space, SUB_COL, Token, TokenStatus } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintTokenOrder } from '../../src/runtime/firebase/token/minting'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/token-import/token.import_1.spec.ts b/packages/functions/test-tangle/token-import/token.import_1.spec.ts index 3389d2beb3..e8c814fb63 100644 --- a/packages/functions/test-tangle/token-import/token.import_1.spec.ts +++ b/packages/functions/test-tangle/token-import/token.import_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Access, COL, @@ -9,7 +10,6 @@ import { TransactionPayloadType, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { importMintedToken } from '../../src/runtime/firebase/token/minting'; import { getAddress } from '../../src/utils/address.utils'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/token-import/token.import_2.spec.ts b/packages/functions/test-tangle/token-import/token.import_2.spec.ts index df55f768bc..86f57531f7 100644 --- a/packages/functions/test-tangle/token-import/token.import_2.spec.ts +++ b/packages/functions/test-tangle/token-import/token.import_2.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Transaction } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { importMintedToken } from '../../src/runtime/firebase/token/minting'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/token.based.voting/Helper.ts b/packages/functions/test-tangle/token.based.voting/Helper.ts index 9e6fb71e4a..f87127dfba 100644 --- a/packages/functions/test-tangle/token.based.voting/Helper.ts +++ b/packages/functions/test-tangle/token.based.voting/Helper.ts @@ -13,9 +13,9 @@ import { TransactionType, } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import dayjs from 'dayjs'; import { set } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveProposal, createProposal, diff --git a/packages/functions/test-tangle/token.based.voting/stake.voting.spec.ts b/packages/functions/test-tangle/token.based.voting/stake.voting.spec.ts index fbc63f98ff..191185a98c 100644 --- a/packages/functions/test-tangle/token.based.voting/stake.voting.spec.ts +++ b/packages/functions/test-tangle/token.based.voting/stake.voting.spec.ts @@ -1,7 +1,7 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { set } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveProposal, createProposal } from '../../src/runtime/firebase/proposal'; import { mockWalletReturnValue } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/token.based.voting/token.based.voting_4.spec.ts b/packages/functions/test-tangle/token.based.voting/token.based.voting_4.spec.ts index 2ff3a27f2d..590933542c 100644 --- a/packages/functions/test-tangle/token.based.voting/token.based.voting_4.spec.ts +++ b/packages/functions/test-tangle/token.based.voting/token.based.voting_4.spec.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, WenError } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { voteOnProposal } from '../../src/runtime/firebase/proposal'; import { getAddress } from '../../src/utils/address.utils'; import { expectThrow, mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/token.based.voting/token.based.voting_5.spec.ts b/packages/functions/test-tangle/token.based.voting/token.based.voting_5.spec.ts index 96c177675b..35c48f955b 100644 --- a/packages/functions/test-tangle/token.based.voting/token.based.voting_5.spec.ts +++ b/packages/functions/test-tangle/token.based.voting/token.based.voting_5.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, TokenStatus } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; import { Helper } from './Helper'; diff --git a/packages/functions/test-tangle/token.mint/Helper.ts b/packages/functions/test-tangle/token.mint/Helper.ts index 4a31067a29..0550a13af3 100644 --- a/packages/functions/test-tangle/token.mint/Helper.ts +++ b/packages/functions/test-tangle/token.mint/Helper.ts @@ -1,5 +1,6 @@ import { COL, Member, Network, SUB_COL, Space, Token, TokenStatus } from '@build-5/interfaces'; +import { build5Db } from '@build-5/database'; import { AliasOutput, AliasOutputBuilderParams, @@ -16,7 +17,6 @@ import { hexToUtf8, } from '@iota/sdk'; import { cloneDeep } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { Wallet } from '../../src/services/wallet/wallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/token.mint/token.mint_1.spec.ts b/packages/functions/test-tangle/token.mint/token.mint_1.spec.ts index 9c8e604c3d..214567ea98 100644 --- a/packages/functions/test-tangle/token.mint/token.mint_1.spec.ts +++ b/packages/functions/test-tangle/token.mint/token.mint_1.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, KEY_NAME_TANGLE, @@ -13,7 +14,6 @@ import { import { FoundryOutput } from '@iota/sdk'; import dayjs from 'dayjs'; import { isEqual } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintTokenOrder } from '../../src/runtime/firebase/token/minting'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/token.mint/token.mint_2.spec.ts b/packages/functions/test-tangle/token.mint/token.mint_2.spec.ts index 25a7223578..accc67abe3 100644 --- a/packages/functions/test-tangle/token.mint/token.mint_2.spec.ts +++ b/packages/functions/test-tangle/token.mint/token.mint_2.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, Token, TokenStatus, TransactionType, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintTokenOrder } from '../../src/runtime/firebase/token/minting'; import { getAddress } from '../../src/utils/address.utils'; import * as wallet from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/token.mint/token.mint_3.spec.ts b/packages/functions/test-tangle/token.mint/token.mint_3.spec.ts index 003f1037e2..acb79dec10 100644 --- a/packages/functions/test-tangle/token.mint/token.mint_3.spec.ts +++ b/packages/functions/test-tangle/token.mint/token.mint_3.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -13,7 +14,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { setTokenAvailableForSale } from '../../src/runtime/firebase/token/base'; import { mintTokenOrder } from '../../src/runtime/firebase/token/minting'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; diff --git a/packages/functions/test-tangle/token.mint/token.mint_4.spec.ts b/packages/functions/test-tangle/token.mint/token.mint_4.spec.ts index e1504204eb..27de8d92fd 100644 --- a/packages/functions/test-tangle/token.mint/token.mint_4.spec.ts +++ b/packages/functions/test-tangle/token.mint/token.mint_4.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -9,7 +10,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { cancelPublicSale, setTokenAvailableForSale } from '../../src/runtime/firebase/token/base'; import { mintTokenOrder } from '../../src/runtime/firebase/token/minting'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/trade-base-token-order.spec.ts b/packages/functions/test-tangle/trade-base-token-order.spec.ts index 67b598c2ac..469dfd9378 100644 --- a/packages/functions/test-tangle/trade-base-token-order.spec.ts +++ b/packages/functions/test-tangle/trade-base-token-order.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -13,7 +14,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../src/firebase/firestore/build5Db'; import { createMember } from '../src/runtime/firebase/member'; import { cancelTradeOrder, tradeToken } from '../src/runtime/firebase/token/trading'; import { AddressDetails } from '../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/tran.match.spec.ts b/packages/functions/test-tangle/tran.match.spec.ts index 869ffb5a6a..3f55c88135 100644 --- a/packages/functions/test-tangle/tran.match.spec.ts +++ b/packages/functions/test-tangle/tran.match.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, IgnoreWalletReason, @@ -7,7 +8,6 @@ import { TransactionType, TransactionValidationType, } from '@build-5/interfaces'; -import { build5Db } from '../src/firebase/firestore/build5Db'; import { Wallet } from '../src/services/wallet/wallet'; import { AddressDetails } from '../src/services/wallet/wallet.service'; import { generateRandomAmount } from '../src/utils/common.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_1.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_1.spec.ts index 701868cf87..a596ee1602 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_1.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_1.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_10.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_10.spec.ts index 0d7db7b86d..953e466ec4 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_10.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_10.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_11.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_11.spec.ts index 6fef5cbe06..4c2325d9f1 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_11.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_11.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; import { isEmpty, isEqual } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_12.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_12.spec.ts index adaa8a9459..14e3efefcd 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_12.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_12.spec.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; import { RegularTransactionEssence, TransactionPayload, UTXOInput, Utils } from '@iota/sdk'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { retryWallet } from '../../src/cron/wallet.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_13.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_13.spec.ts index ac7044fb85..8001038e92 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_13.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_13.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MAX_WALLET_RETRY, @@ -11,7 +12,6 @@ import { import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { retryWallet } from '../../src/cron/wallet.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_2.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_2.spec.ts index cfefbe97b8..b4ba33894c 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_2.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_2.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; import { UnlockConditionType } from '@iota/sdk'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_3.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_3.spec.ts index bcb8c4183d..a1293d641a 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_3.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_3.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { packBasicOutput } from '../../src/utils/basic-output.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_4.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_4.spec.ts index 894e82aeb0..5e70865e65 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_4.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_4.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { MnemonicService } from '../../src/services/wallet/mnemonic'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { packBasicOutput } from '../../src/utils/basic-output.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_5.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_5.spec.ts index 95650f98de..cc5089b7c0 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_5.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_5.spec.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash'; import { retryWallet } from '../../src/cron/wallet.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_6.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_6.spec.ts index 65efc6e461..0c6e40470c 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_6.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_6.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_7.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_7.spec.ts index a281dfd28f..4924cfec51 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_7.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_7.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_8.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_8.spec.ts index a5850df146..d142e56a42 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_8.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_8.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_9.spec.ts b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_9.spec.ts index f2294ba469..9927c643d5 100644 --- a/packages/functions/test-tangle/transaction-trigger/transaction-trigger_9.spec.ts +++ b/packages/functions/test-tangle/transaction-trigger/transaction-trigger_9.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Transaction, TransactionType } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; import { serverTime } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test-tangle/web3/web3_1.spec.ts b/packages/functions/test-tangle/web3/web3_1.spec.ts index 2573c390d6..723a40be3f 100644 --- a/packages/functions/test-tangle/web3/web3_1.spec.ts +++ b/packages/functions/test-tangle/web3/web3_1.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import { Web3Storage } from 'web3.storage'; import { uploadMediaToWeb3 } from '../../src/cron/media.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { mintTokenOrder } from '../../src/runtime/firebase/token/minting'; import { getWeb3Token } from '../../src/utils/config.utils'; import { serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test-tangle/web3/web3_2.spec.ts b/packages/functions/test-tangle/web3/web3_2.spec.ts index 08a3544705..2c276d91b5 100644 --- a/packages/functions/test-tangle/web3/web3_2.spec.ts +++ b/packages/functions/test-tangle/web3/web3_2.spec.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, MediaStatus, Space } from '@build-5/interfaces'; import { uploadMediaToWeb3 } from '../../src/cron/media.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { collectionToIpfsMetadata, nftToIpfsMetadata } from '../../src/utils/car.utils'; import * as wallet from '../../src/utils/wallet.utils'; import { createMember, createSpace, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/web3/web3_3.spec.ts b/packages/functions/test-tangle/web3/web3_3.spec.ts index 579050d49c..9648a2c315 100644 --- a/packages/functions/test-tangle/web3/web3_3.spec.ts +++ b/packages/functions/test-tangle/web3/web3_3.spec.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, MediaStatus, Space } from '@build-5/interfaces'; import { uploadMediaToWeb3 } from '../../src/cron/media.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { updateSpace } from '../../src/runtime/firebase/space'; import * as wallet from '../../src/utils/wallet.utils'; import { createMember, createSpace, mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/Helper.ts b/packages/functions/test-tangle/withdraw-deposit-nft/Helper.ts index 62cf116e59..1f32403055 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/Helper.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/Helper.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { Access, COL, @@ -31,7 +32,6 @@ import { } from '@iota/sdk'; import dayjs from 'dayjs'; import { cloneDeep } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { approveCollection, createCollection, diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_1.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_1.spec.ts index f44b82d5ff..bae5e75b56 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_1.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_1.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_2.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_2.spec.ts index 0003d6b00e..939cfbe25b 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_2.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_2.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_3.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_3.spec.ts index 8394b8daff..3ccbfa210a 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_3.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_3.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft } from '../../src/runtime/firebase/nft'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_11.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_11.spec.ts index 4f4061be5d..268cec4af3 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_11.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_11.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Collection, Nft, Space, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { claimSpace } from '../../src/runtime/firebase/space'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_a.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_a.spec.ts index a0707eb377..df6d756bd4 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_a.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_a.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -19,7 +20,6 @@ import { Utils, } from '@iota/sdk'; import { cloneDeep } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft } from '../../src/runtime/firebase/nft'; import { NftWallet } from '../../src/services/wallet/NftWallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_b.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_b.spec.ts index 75af028499..c2bb123b89 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_b.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_b.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network } from '@build-5/interfaces'; import { Ed25519Address, @@ -12,7 +13,6 @@ import { Utils, } from '@iota/sdk'; import { cloneDeep } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft } from '../../src/runtime/firebase/nft'; import { NftWallet } from '../../src/services/wallet/NftWallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_13.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_13.spec.ts index ddca695c0e..454033abf7 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_13.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_13.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, Network, Nft } from '@build-5/interfaces'; import { Ed25519Address, @@ -12,7 +13,6 @@ import { Utils, } from '@iota/sdk'; import { cloneDeep } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft } from '../../src/runtime/firebase/nft'; import { NftWallet } from '../../src/services/wallet/NftWallet'; import { AddressDetails } from '../../src/services/wallet/wallet.service'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_14.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_14.spec.ts index 5c05415961..1fe09fb440 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_14.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_14.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, IgnoreWalletReason, @@ -9,7 +10,6 @@ import { TransactionType, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { creditUnrefundable } from '../../src/runtime/firebase/credit/index'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { NftWallet } from '../../src/services/wallet/NftWallet'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_a.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_a.spec.ts index 0edf760c48..775216cc9b 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_a.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_a.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, Nft, NftStatus, Transaction, TransactionType } from '@build-5/interfaces'; import { isEqual } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { NftWallet } from '../../src/services/wallet/NftWallet'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_b.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_b.spec.ts index aac821841a..efa94de6dc 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_b.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_b.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -10,7 +11,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEqual } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { NftWallet } from '../../src/services/wallet/NftWallet'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_c.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_c.spec.ts index 8a11957f9f..1a21aa5272 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_c.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_c.spec.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, Nft, NftStatus, Transaction, TransactionType } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { isEqual } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { NftWallet } from '../../src/services/wallet/NftWallet'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_2.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_2.spec.ts index 2cceb0b972..48f3ec9440 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_2.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_2.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft } from '../../src/runtime/firebase/nft/index'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4.spec.ts index 16199b6ef9..046f9ae352 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { withdrawNft } from '../../src/runtime/firebase/nft/index'; import { expectThrow, mockWalletReturnValue } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4_b.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4_b.spec.ts index 482295532c..7cc185c190 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4_b.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4_b.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Nft, NftStatus, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { updateMember } from '../../src/runtime/firebase/member'; import { withdrawNft } from '../../src/runtime/firebase/nft/index'; import { expectThrow, mockWalletReturnValue } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_5.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_5.spec.ts index eb14e88da1..f19db509f7 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_5.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_5.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Member, Nft, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { getAddress } from '../../src/utils/address.utils'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_6.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_6.spec.ts index bc1c3ae61e..bfd91dc7a1 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_6.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_6.spec.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Collection, @@ -11,7 +12,6 @@ import { Transaction, TransactionType, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { getAddress } from '../../src/utils/address.utils'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_7.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_7.spec.ts index 2485c651b4..2780132e62 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_7.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_7.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Network, Nft, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_8.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_8.spec.ts index b79519d255..c1f097ba50 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_8.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_8.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db } from '@build-5/database'; import { COL, Collection, Nft, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_9.spec.ts b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_9.spec.ts index 5d9b0eb854..299416ee02 100644 --- a/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_9.spec.ts +++ b/packages/functions/test-tangle/withdraw-deposit-nft/deposit-withraw-nft_9.spec.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { build5Db, build5Storage } from '@build-5/database'; import { Bucket, COL, Collection, Nft, Transaction, TransactionType } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; -import { build5Storage } from '../../src/firebase/storage/build5Storage'; import { depositNft, withdrawNft } from '../../src/runtime/firebase/nft/index'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; diff --git a/packages/functions/test/auth.spec.ts b/packages/functions/test/auth.spec.ts index 04d76c7304..51be4ee374 100644 --- a/packages/functions/test/auth.spec.ts +++ b/packages/functions/test/auth.spec.ts @@ -1,8 +1,8 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, Network, WEN_FUNC, WenError } from '@build-5/interfaces'; import { CoinType, utf8ToHex } from '@iota/sdk'; import jwt from 'jsonwebtoken'; import { get } from 'lodash'; -import { build5Db } from '../src/firebase/firestore/build5Db'; import { generateCustomToken } from '../src/runtime/firebase/auth'; import * as config from '../src/utils/config.utils'; import { getJwtSecretKey } from '../src/utils/config.utils'; diff --git a/packages/functions/test/controls/address.spec.ts b/packages/functions/test/controls/address.spec.ts index ed6bfec314..7857623922 100644 --- a/packages/functions/test/controls/address.spec.ts +++ b/packages/functions/test/controls/address.spec.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, Network, Proposal, Space, WenError } from '@build-5/interfaces'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { validateAddress } from '../../src/runtime/firebase/address'; import { getAddress } from '../../src/utils/address.utils'; import * as wallet from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test/controls/collection.spec.ts b/packages/functions/test/controls/collection.spec.ts index 098b19b0b2..ca57188159 100644 --- a/packages/functions/test/controls/collection.spec.ts +++ b/packages/functions/test/controls/collection.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Access, Bucket, @@ -20,7 +21,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { chunk } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { createNft } from '../../src/runtime/firebase/nft'; import { rankController } from '../../src/runtime/firebase/rank'; import { voteController } from '../../src/runtime/firebase/vote'; diff --git a/packages/functions/test/controls/common.ts b/packages/functions/test/controls/common.ts index 6744237e38..d6fe1d36e9 100644 --- a/packages/functions/test/controls/common.ts +++ b/packages/functions/test/controls/common.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Network, @@ -14,7 +15,6 @@ import { } from '@build-5/interfaces'; import { TransactionPayload, UTXOInput, Utils } from '@iota/sdk'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { validateAddress } from '../../src/runtime/firebase/address'; import { createMember as createMemberFunc } from '../../src/runtime/firebase/member'; import { createSpace as createSpaceFunc } from '../../src/runtime/firebase/space/index'; diff --git a/packages/functions/test/controls/member.spec.ts b/packages/functions/test/controls/member.spec.ts index ec8cf97a3f..f09c60fe7d 100644 --- a/packages/functions/test/controls/member.spec.ts +++ b/packages/functions/test/controls/member.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Nft, NftAvailable, NftStatus, WEN_FUNC, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { createMember, updateMember } from '../../src/runtime/firebase/member'; import * as wallet from '../../src/utils/wallet.utils'; import { MEDIA, testEnv } from '../../test/set-up'; diff --git a/packages/functions/test/controls/nft-bidding.spec.ts b/packages/functions/test/controls/nft-bidding.spec.ts index fd46097b91..dd8adeec20 100644 --- a/packages/functions/test/controls/nft-bidding.spec.ts +++ b/packages/functions/test/controls/nft-bidding.spec.ts @@ -1,3 +1,4 @@ +import { build5Db, IDocument } from '@build-5/database'; import { Access, Categories, @@ -19,8 +20,6 @@ import { import dayjs from 'dayjs'; import { set } from 'lodash'; import { finalizeAllNftAuctions } from '../../src/cron/nft.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; -import { IDocument } from '../../src/firebase/firestore/interfaces'; import { approveCollection, createCollection } from '../../src/runtime/firebase/collection/index'; import { openBid } from '../../src/runtime/firebase/nft'; import { createNft, orderNft, setForSaleNft } from '../../src/runtime/firebase/nft/index'; diff --git a/packages/functions/test/controls/nft.spec.ts b/packages/functions/test/controls/nft.spec.ts index 67cefeeccd..d76d4c4651 100644 --- a/packages/functions/test/controls/nft.spec.ts +++ b/packages/functions/test/controls/nft.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Access, Bucket, @@ -14,7 +15,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { createCollection } from '../../src/runtime/firebase/collection/index'; import * as wallet from '../../src/utils/wallet.utils'; import { MEDIA, testEnv } from '../set-up'; diff --git a/packages/functions/test/controls/order.spec.ts b/packages/functions/test/controls/order.spec.ts index 82f0bad5c2..cfcb1df597 100644 --- a/packages/functions/test/controls/order.spec.ts +++ b/packages/functions/test/controls/order.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Access, COL, @@ -23,7 +24,6 @@ import { approveCollection, createCollection, } from '../../../functions/src/runtime/firebase/collection/index'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import * as wallet from '../../src/utils/wallet.utils'; import { testEnv } from '../set-up'; import { diff --git a/packages/functions/test/controls/proposal.spec.ts b/packages/functions/test/controls/proposal.spec.ts index 568ccd0f6c..35f5548479 100644 --- a/packages/functions/test/controls/proposal.spec.ts +++ b/packages/functions/test/controls/proposal.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Network, @@ -12,7 +13,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { serverTime } from '../../src/utils/dateTime.utils'; import * as wallet from '../../src/utils/wallet.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test/controls/space.spec.ts b/packages/functions/test/controls/space.spec.ts index edfcb10d9b..fe3fd686bb 100644 --- a/packages/functions/test/controls/space.spec.ts +++ b/packages/functions/test/controls/space.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { ADD_REMOVE_GUARDIAN_THRESHOLD_PERCENTAGE, COL, @@ -17,7 +18,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { tail } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { voteOnProposal } from '../../src/runtime/firebase/proposal'; import { acceptMemberSpace, diff --git a/packages/functions/test/controls/stake.reward.spec.ts b/packages/functions/test/controls/stake.reward.spec.ts index 2a3ccc455c..737a6fc2ae 100644 --- a/packages/functions/test/controls/stake.reward.spec.ts +++ b/packages/functions/test/controls/stake.reward.spec.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Space, StakeReward, WenError } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { stakeReward } from '../../src/runtime/firebase/stake'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import * as wallet from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test/controls/token-distribution-auto-trigger.spec.ts b/packages/functions/test/controls/token-distribution-auto-trigger.spec.ts index 170affe1e0..f5c3d144fb 100644 --- a/packages/functions/test/controls/token-distribution-auto-trigger.spec.ts +++ b/packages/functions/test/controls/token-distribution-auto-trigger.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Member, @@ -14,7 +15,6 @@ import { import dayjs from 'dayjs'; import bigDecimal from 'js-big-decimal'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { orderToken } from '../../src/runtime/firebase/token/base'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test/controls/token-distribution.spec.ts b/packages/functions/test/controls/token-distribution.spec.ts index f9d2adb546..10545f4a95 100644 --- a/packages/functions/test/controls/token-distribution.spec.ts +++ b/packages/functions/test/controls/token-distribution.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -16,7 +17,6 @@ import { import dayjs from 'dayjs'; import bigDecimal from 'js-big-decimal'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { orderToken } from '../../src/runtime/firebase/token/base'; import { getAddress } from '../../src/utils/address.utils'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test/controls/token-trade.buy.spec.ts b/packages/functions/test/controls/token-trade.buy.spec.ts index b52de1701c..b8a411f616 100644 --- a/packages/functions/test/controls/token-trade.buy.spec.ts +++ b/packages/functions/test/controls/token-trade.buy.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -11,7 +12,6 @@ import { TransactionType, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { cancelTradeOrder, tradeToken } from '../../src/runtime/firebase/token/trading'; import * as wallet from '../../src/utils/wallet.utils'; import { testEnv } from '../set-up'; diff --git a/packages/functions/test/controls/token-trade.sell.spec.ts b/packages/functions/test/controls/token-trade.sell.spec.ts index 54a25dd3ef..9ef3dae536 100644 --- a/packages/functions/test/controls/token-trade.sell.spec.ts +++ b/packages/functions/test/controls/token-trade.sell.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -12,7 +13,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { enableTokenTrading } from '../../src/runtime/firebase/token/base'; import { cancelTradeOrder, tradeToken } from '../../src/runtime/firebase/token/trading'; import * as wallet from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test/controls/token-trade.trigger.spec.ts b/packages/functions/test/controls/token-trade.trigger.spec.ts index 1c1c317f0b..15832db3ea 100644 --- a/packages/functions/test/controls/token-trade.trigger.spec.ts +++ b/packages/functions/test/controls/token-trade.trigger.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, CreditPaymentReason, @@ -23,7 +24,6 @@ import { } from '@build-5/interfaces'; import bigDecimal from 'js-big-decimal'; import { isEmpty } from 'lodash'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { cancelTradeOrder, tradeToken } from '../../src/runtime/firebase/token/trading'; import { TOKEN_TRADE_ORDER_FETCH_LIMIT } from '../../src/triggers/token-trading/match-token'; import { getAddress } from '../../src/utils/address.utils'; diff --git a/packages/functions/test/controls/token.expired.sale.cron.spec.ts b/packages/functions/test/controls/token.expired.sale.cron.spec.ts index 2e5dfef1b1..a1b3a64021 100644 --- a/packages/functions/test/controls/token.expired.sale.cron.spec.ts +++ b/packages/functions/test/controls/token.expired.sale.cron.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -11,7 +12,6 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { cancelExpiredSale } from '../../src/cron/token.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import * as wallet from '../../src/utils/wallet.utils'; import { createMember, getRandomSymbol, wait } from './common'; diff --git a/packages/functions/test/controls/token.order.spec.ts b/packages/functions/test/controls/token.order.spec.ts index fb5e897193..a6e374fe8c 100644 --- a/packages/functions/test/controls/token.order.spec.ts +++ b/packages/functions/test/controls/token.order.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Access, COL, @@ -11,7 +12,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { joinSpace } from '../../src/runtime/firebase/space'; import { creditToken, orderToken } from '../../src/runtime/firebase/token/base'; import { dateToTimestamp, serverTime } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test/controls/token/token.airdrop.claim.spec.ts b/packages/functions/test/controls/token/token.airdrop.claim.spec.ts index 65cd81f485..17a9c8f225 100644 --- a/packages/functions/test/controls/token/token.airdrop.claim.spec.ts +++ b/packages/functions/test/controls/token/token.airdrop.claim.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, SUB_COL, @@ -14,7 +15,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { airdropToken, claimAirdroppedToken, diff --git a/packages/functions/test/controls/token/token.airdrop.spec.ts b/packages/functions/test/controls/token/token.airdrop.spec.ts index 58d5439bed..268f0206d2 100644 --- a/packages/functions/test/controls/token/token.airdrop.spec.ts +++ b/packages/functions/test/controls/token/token.airdrop.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Space, @@ -8,7 +9,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { airdropToken, createToken } from '../../../src/runtime/firebase/token/base'; import { dateToTimestamp } from '../../../src/utils/dateTime.utils'; import * as wallet from '../../../src/utils/wallet.utils'; diff --git a/packages/functions/test/controls/token/token.cancel.pub.sale.spec.ts b/packages/functions/test/controls/token/token.cancel.pub.sale.spec.ts index e4db5eeb47..321da839a0 100644 --- a/packages/functions/test/controls/token/token.cancel.pub.sale.spec.ts +++ b/packages/functions/test/controls/token/token.cancel.pub.sale.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -12,7 +13,6 @@ import { WEN_FUNC, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { cancelPublicSale, orderToken, diff --git a/packages/functions/test/controls/token/token.create.spec.ts b/packages/functions/test/controls/token/token.create.spec.ts index a6240afb1f..3d1b109c58 100644 --- a/packages/functions/test/controls/token/token.create.spec.ts +++ b/packages/functions/test/controls/token/token.create.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { Access, Bucket, @@ -12,7 +13,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { createToken } from '../../../src/runtime/firebase/token/base'; import * as config from '../../../src/utils/config.utils'; import { dateToTimestamp } from '../../../src/utils/dateTime.utils'; diff --git a/packages/functions/test/controls/token/token.order.and.claim.air.spec.ts b/packages/functions/test/controls/token/token.order.and.claim.air.spec.ts index c9310a4f73..6fe5d22888 100644 --- a/packages/functions/test/controls/token/token.order.and.claim.air.spec.ts +++ b/packages/functions/test/controls/token/token.order.and.claim.air.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -9,7 +10,6 @@ import { TokenStatus, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { airdropToken, claimAirdroppedToken, diff --git a/packages/functions/test/controls/token/token.rank.spec.ts b/packages/functions/test/controls/token/token.rank.spec.ts index 2fc6a73289..86d78edccf 100644 --- a/packages/functions/test/controls/token/token.rank.spec.ts +++ b/packages/functions/test/controls/token/token.rank.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, RANKING_TEST, @@ -8,7 +9,6 @@ import { TokenStats, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { rankController } from '../../../src/runtime/firebase/rank'; import { createToken } from '../../../src/runtime/firebase/token/base'; import * as config from '../../../src/utils/config.utils'; diff --git a/packages/functions/test/controls/token/token.set.to.sale.spec.ts b/packages/functions/test/controls/token/token.set.to.sale.spec.ts index 7ebd5bcd9d..1625430b20 100644 --- a/packages/functions/test/controls/token/token.set.to.sale.spec.ts +++ b/packages/functions/test/controls/token/token.set.to.sale.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { createToken, setTokenAvailableForSale } from '../../../src/runtime/firebase/token/base'; import { dateToTimestamp } from '../../../src/utils/dateTime.utils'; import * as wallet from '../../../src/utils/wallet.utils'; diff --git a/packages/functions/test/controls/token/token.update.spec.ts b/packages/functions/test/controls/token/token.update.spec.ts index 369343dbbb..b4b160d2b9 100644 --- a/packages/functions/test/controls/token/token.update.spec.ts +++ b/packages/functions/test/controls/token/token.update.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, MIN_IOTA_AMOUNT, @@ -7,7 +8,6 @@ import { WEN_FUNC, WenError, } from '@build-5/interfaces'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { createToken, updateToken } from '../../../src/runtime/firebase/token/base'; import * as wallet from '../../../src/utils/wallet.utils'; import { MEDIA, testEnv } from '../../set-up'; diff --git a/packages/functions/test/controls/token/token.vote.spec.ts b/packages/functions/test/controls/token/token.vote.spec.ts index 03ffc0c19f..56a94dd946 100644 --- a/packages/functions/test/controls/token/token.vote.spec.ts +++ b/packages/functions/test/controls/token/token.vote.spec.ts @@ -1,5 +1,5 @@ +import { build5Db } from '@build-5/database'; import { COL, Space, SUB_COL, TokenAllocation, TokenStats, WenError } from '@build-5/interfaces'; -import { build5Db } from '../../../src/firebase/firestore/build5Db'; import { createToken } from '../../../src/runtime/firebase/token/base'; import { voteController } from '../../../src/runtime/firebase/vote'; import * as config from '../../../src/utils/config.utils'; diff --git a/packages/functions/test/cron/floor-price.cron.only.spec.ts b/packages/functions/test/cron/floor-price.cron.only.spec.ts index 48981f7176..e51c3a56dd 100644 --- a/packages/functions/test/cron/floor-price.cron.only.spec.ts +++ b/packages/functions/test/cron/floor-price.cron.only.spec.ts @@ -1,6 +1,6 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, MIN_IOTA_AMOUNT, NftAccess, NftAvailable } from '@build-5/interfaces'; import { updateFloorPriceOnCollections } from '../../src/cron/collection.floor.price.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; describe('Collection floor price', () => { diff --git a/packages/functions/test/cron/nft-stake.cron.spec.ts b/packages/functions/test/cron/nft-stake.cron.spec.ts index c714de36bd..26b54e5cda 100644 --- a/packages/functions/test/cron/nft-stake.cron.spec.ts +++ b/packages/functions/test/cron/nft-stake.cron.spec.ts @@ -1,7 +1,7 @@ +import { build5Db } from '@build-5/database'; import { COL, Collection, NftStake, StakeType } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { processExpiredNftStakes } from '../../src/cron/nftStake.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test/cron/proposal.cron.spec.ts b/packages/functions/test/cron/proposal.cron.spec.ts index 45b83ed183..b2a93bcd68 100644 --- a/packages/functions/test/cron/proposal.cron.spec.ts +++ b/packages/functions/test/cron/proposal.cron.spec.ts @@ -1,7 +1,7 @@ +import { build5Db } from '@build-5/database'; import { COL } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { markExpiredProposalCompleted } from '../../src/cron/proposal.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test/dbRoll/total.guardians.roll.spec.ts b/packages/functions/test/dbRoll/total.guardians.roll.spec.ts deleted file mode 100644 index 05b6c261f7..0000000000 --- a/packages/functions/test/dbRoll/total.guardians.roll.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { COL, SUB_COL, Space } from '@build-5/interfaces'; -import { totalGuardiansRoll } from '../../scripts/dbUpgrades/1.0/totalGuardiansRoll'; -import { build5App } from '../../src/firebase/app/build5App'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; -import { getRandomEthAddress } from '../../src/utils/wallet.utils'; - -describe('Total members roll', () => { - it('Should roll member count', async () => { - const space = getRandomEthAddress(); - const spaceDocRef = build5Db().doc(`${COL.SPACE}/${space}`); - await spaceDocRef.create({ name: 'space', uid: space }); - - await spaceDocRef.collection(SUB_COL.GUARDIANS).doc(getRandomEthAddress()).create({}); - await spaceDocRef.collection(SUB_COL.GUARDIANS).doc(getRandomEthAddress()).create({}); - - await spaceDocRef.collection(SUB_COL.MEMBERS).doc(getRandomEthAddress()).create({}); - await spaceDocRef.collection(SUB_COL.MEMBERS).doc(getRandomEthAddress()).create({}); - await spaceDocRef.collection(SUB_COL.MEMBERS).doc(getRandomEthAddress()).create({}); - - await spaceDocRef.collection(SUB_COL.KNOCKING_MEMBERS).doc(getRandomEthAddress()).create({}); - - await totalGuardiansRoll(build5App()); - - const spaceData = await spaceDocRef.get(); - expect(spaceData.totalGuardians).toBe(2); - expect(spaceData.totalMembers).toBe(3); - expect(spaceData.totalPendingMembers).toBe(1); - }); -}); diff --git a/packages/functions/test/set-up.ts b/packages/functions/test/set-up.ts index 07c0bd8e7d..3a3f4a86af 100644 --- a/packages/functions/test/set-up.ts +++ b/packages/functions/test/set-up.ts @@ -1,10 +1,10 @@ +import { build5Db } from '@build-5/database'; import { Network } from '@build-5/interfaces'; import dotenv from 'dotenv'; import express from 'express'; import test from 'firebase-functions-test'; import * as functions from 'firebase-functions/v2'; import { isEmpty } from 'lodash'; -import { build5Db } from '../src/firebase/firestore/build5Db'; import { Wallet, WalletParams } from '../src/services/wallet/wallet'; import { AddressDetails, diff --git a/packages/functions/test/stake/delete.stake.reward.spec.ts b/packages/functions/test/stake/delete.stake.reward.spec.ts index 0c121987b2..a9314415ef 100644 --- a/packages/functions/test/stake/delete.stake.reward.spec.ts +++ b/packages/functions/test/stake/delete.stake.reward.spec.ts @@ -1,3 +1,4 @@ +import { build5Db } from '@build-5/database'; import { COL, Proposal, @@ -8,7 +9,6 @@ import { WenError, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { voteOnProposal } from '../../src/runtime/firebase/proposal'; import { removeStakeReward } from '../../src/runtime/firebase/stake'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; diff --git a/packages/functions/test/stake/stake.reward.cron.spec.ts b/packages/functions/test/stake/stake.reward.cron.spec.ts index 9518bb8a9a..33f94c3c1b 100644 --- a/packages/functions/test/stake/stake.reward.cron.spec.ts +++ b/packages/functions/test/stake/stake.reward.cron.spec.ts @@ -1,7 +1,7 @@ +import { build5Db } from '@build-5/database'; import { COL, Stake, StakeReward, StakeRewardStatus, StakeType } from '@build-5/interfaces'; import dayjs from 'dayjs'; import { getStakedPerMember } from '../../src/cron/stakeReward.cron'; -import { build5Db } from '../../src/firebase/firestore/build5Db'; import { dateToTimestamp } from '../../src/utils/dateTime.utils'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; diff --git a/packages/functions/test/storage/resize.img.spec.ts b/packages/functions/test/storage/resize.img.spec.ts index c2fd06d590..146bfaefcc 100644 --- a/packages/functions/test/storage/resize.img.spec.ts +++ b/packages/functions/test/storage/resize.img.spec.ts @@ -1,5 +1,5 @@ import { Bucket, ImageWidth } from '@build-5/interfaces'; -import { build5Storage } from '../../src/firebase/storage/build5Storage'; +import { build5Storage } from '@build-5/database'; import { getRandomEthAddress } from '../../src/utils/wallet.utils'; import { wait } from '../controls/common'; diff --git a/packages/interfaces/src/config.ts b/packages/interfaces/src/config.ts index a35da7c231..387c567195 100644 --- a/packages/interfaces/src/config.ts +++ b/packages/interfaces/src/config.ts @@ -137,7 +137,7 @@ export const PROD_NETWORKS = [Network.IOTA, Network.SMR]; export const TEST_NETWORKS = [Network.ATOI, Network.RMS]; export const PROD_AVAILABLE_MINTABLE_NETWORKS = PROD_NETWORKS; export const TEST_AVAILABLE_MINTABLE_NETWORKS = [...PROD_NETWORKS, ...TEST_NETWORKS]; -export const MAX_FIELD_NAME_LENGTH = 30; +export const MAX_FIELD_NAME_LENGTH = 50; export const MAX_FIELD_VALUE_LENGTH = 100; export const MIN_WEEKS_TO_STAKE = 1;