repoName
stringlengths
7
77
tree
stringlengths
0
2.85M
readme
stringlengths
0
4.9M
Peersyst_wax-woocommerce-gateway
.vscode launch.json assets css wax-checkout.css img pay_with_wax.svg js jquery.initialize.min.js nanobar.min.js qrcode.min.js wax-checkout.min.js waxjs.min.js docker-compose.yml gulpfile.js includes class-wc-gateway-wax.php class-wc-wax-ajax.php class-wc-wax-api.php class-wc-wax-currency.php wc-gateway-wax-settings.php package-lock.json package.json readme.txt woocommerce-gateway-wax.php
KimeraMoses_Grandpa-s-Faucet
.env .github workflows firebase-hosting-merge.yml firebase-hosting-pull-request.yml README.md config.json firebase.json package.json public index.html manifest.json robots.txt src App.js components Button Button.css Button.js Confirmation Confirmation.css Confirmation.js Dropdown Dropdown.js Dropdown.module.css FAQs Faq.css Faq.js FaqCard.css FaqCard.js Home Home.css Home.js Login.js MainTemplate MainTemplate.js MetaMask MetaMask.js OTP Otp.js SignIn SignIn.css SignIn.js SignUp SignUp.css SignUp.js TransactionStatus TransactionStatus.css TransactionStatus.js Transactions Transaction Transaction.css Transaction.js TransactionList TransactionList.css TransactionList.js Transactions.css Transactions.js WhiteBoard WhiteBoard.js index.js store Actions AuthActions.js TransactionsActions.js Slices authSlice.js transactionSlice.js transactionsSlice.js index.js
# Grandpa's Faucet UI/UX ## _The fully functional web application of grandpa's faucet_ # Project Details Grandpa's Faucet is project that was assigned to me by [Isaac Mubiru](https://github.com/zac-09), my role was to implement the UI from the Xd mockup. The application is built in Reactjs,Redux, React Router v6 and material icons ## Client's Requirements The tasks are as follows: 1. Responsive and cross-browser page background and footer 2. Login by Button to connect to Metamask Wallet via Polygon(matic.js) library 3. OTP form and verification if member 4. Redirection link to https://whiteboardcrypto.com/ after login if not a member 5. FAQs accordion 6. Localization (English only) 7. Form - Amount Input field + Captcha - "Select with dummy data (will be loaded from DB) Options: MATIC, FTM, ETH, AVAX, ONE, ETH, NEAR, CELO, BNB, FTM" - Request button disabled till wallet address/IP is AJAX-verified from backend as not blacklisted with valid amount 8. Transaction Status / Blacklisted user components 9. Display last 5 successful transactions below input section just before FAQ accordion(updated every second). 10. Connect frontend to backend 10. Testing and Debugging 11. Documentation (Readme) After the first design, other requirements recieved were Also please rename the routes: - otp-confirm to confirm-otp - whiteboard to sign-up - meta-mask to connect-metamask Also remove the Captcha from the confirm page as it is only accessible to logged in users so they must have verified the OTP. Lastly, please redirect all unknown pages to the sign-in page. Remember to create a base module for API connections to the backend that will get credentials from a .env file. It could be of the form apiRequest(method, url, payload) { try { // adios, request, fetch or anything you use here. } catch(error){ // format general errors from API here for localization } } # Features > Mobie Responsiveness: We had a task of making sure that the web pages are made responsive on different device widths > Semantic tags: Use of the know semantic tags was also a checkpoint during the project, making sure that we used only tags that were neccessary. > Beautiful UI and UX ✨: Bringing out the webpages as they appear in the mockup was the major goal of this task. > Adding Logic and Making API Calls: After the UI implementation, i had to add logic to the UIs making different calls and storing data in redux and passing it on to the different components where it had to be displayed. It was such an awesome experience getting to learn how to connect to metamask extension and capturing the account address to use it when making calls for different transactions. ##### DEMO: ![](src/assets/UI/Web1920–2.png?raw=true "Sign In") ![](src/assets/UI/Web1920–3.png?raw=true "Confirm Otp") ![](src/assets/UI/Web1920–4.png?raw=true "Connect to WhiteBoard Crypto") ![](src/assets/UI/Web1920–5.png?raw=true "Connect to MetaMask") ![](src/assets/UI/Web1920–6.png?raw=true "Transactions") ![](src/assets/UI/Web1920–7.png?raw=true "Transaction Success") ![](src/assets/UI/Web1920–8.png?raw=true "Transaction Failed") ![](src/assets/UI/Web1920–9.png?raw=true "Transaction Black List")
GigaHierz_sha-donnas-list
.github workflows deploy-to-skynet.yml README.md client README.md deploy-to-skynet.yml package.json public index.html manifest.json robots.txt src App.css Data NFTs Companies.json NFT_1.json NFT_2.json Ratings.json contracts Membership.sol Membership.dbg.json Membership.json index.css logo.svg react-app-env.d.ts reportWebVitals.ts setupTests.ts styles landingpage.css navigation.css profilepage.css reviewcard.css tsconfig.json hardhat.config.js package-lock.json package.json scripts script.js test sample-test.js
# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. ### `npm test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `npm run build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ### `npm run eject` **Note: this is a one-way operation. Once you `eject`, you can’t go back!** If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/). # ShaDonnas List - Rate the Block TechStack The whole technical Vision for the Project When a web3company/DAO signs with us they will get a membership NFT, which will store the info but will also be linked to the rating they get. When signing up they can choose a certain amount of NFTs they are planning to distribute to their community. These NFTs will serve as a Proof of Relationship. As this is a web3 application and privacy is our highest priority especially as our product will be directed at marginalised communities, we will use ZK Proof to offer anonymity. So we want the rating that should be of course immutable not be related to the user-address For this ZK Proof of Relationships we will use a copy of tornadocash, to proof that the user holds an NFT related to the companies/DAOs membership NFT. We'll build the app using Polygon because we'll need a low-cost blockchain to deploy a large number of NFTs. To deploy the contract to the blockchain we will use DataHub by Figment. However, because this is just one use-case, it might serve as a prototype for a generic rating platform. in a more advanced application,we would not issue the proof of relation as it would be tied to the product, such as receipts for shopping, restaurants, business contracts, and employment. For this we need a multi-chain approach, so we would also build on NEAR and Solana as well. We could utilize [https://neon-labs.org/](https://neon-labs.org/) so we wouldn’t have to rewrite tornadocash for Solana. Because total decentralisation is important to us: As we care about complete decentralization : - We will deploy our frontend on Skylabs - Membership NFTs, as well as the related ratings, will be stored on StorJ Our product will also be able to serve the web3companies in the sense that they will receive feedback data that our company harvest based on the ratings. It would be an interesting use-case to use Lukka for the data analysation and improve DAOs and web3 companies through that. [https://lukka.tech/enterprise-data](https://lukka.tech/enterprise-data) The PROJECT 1. ShaDonna’s list is the number one Web3 rating and surveying resource that provides proof of relationship with zero knowledge verification for users. This enables the web3 community to share business and service experiences in a decentralized way. This rating system keeps a transparent and honest Web3 community through our membership NFT gated 3rd party rating system. 2. This project leverages technology well, utilizing multiple sponsor’s Web3 resources into one original application, including Storj, Figment, Coinbase Wallet, Polygon, Starknet, The Graph and NEAR. 3. Although this initial project is targeted for the Web3 community, the technology utilized is scalable and can be used to enhance the broader rating and survey industry for all service and product industry verticals, thus providing usefulness in the real world. 4. Our team started with 3 women on Friday who ideated this concept. It then evolved to 5 on Saturday putting forth a tremendous effort in which the tech stack and pitch was developed for Sunday’s presentation. 5. We solve the problem of survey anonymity. Postings and ratings in Web2 can be submitted by unvaried customers to allow for anonymity, but sacrificing integrity of verification of connection to the actual company being rated. 6. We disrupt the traditional centralized user rating systems. Currently, there exists no user rating system that is decentralized. 7. We uniquely provide a trusted 3rd Party Equality rating. Web3 industry’s egalitarian panacea reputation is tarnished by lack of equity and companies' clear solution path to resolve it falling short on its promise of forging a democratizing force. 8. Provide Web3 companies feedback from data harvested from ratings. 9. A Web3 application with privacy is its highest priority directed at marginalized communities, utilizing ZK Proof to offer anonymity. 10. NFTs providing Proof of Relationship. 11. Storage of NFTs on a decentralized cloud enables NFTs that are more secure, automatically globally redundant and immutable with a Story-hosted IPFS-dedicated node.
near-examples_indexer-tx-watcher-example
Cargo.toml README.md src configs.rs main.rs
Indexer that catches txs for specific contract(s) ================================================= **This project is a copy of https://github.com/near-examples/indexer-tx-watcher-example but is migrated to [NEAR Lake Framework](https://github.com/near/near-lake-framework). We keep them both separately as they show different approaches to the same use case** The most common use case for indexers is to react on a transaction sent to a specific contract or a list of contracts. This project is trying to provide an example of the indexer described about. It's simple yet doing the necessary stuff. In this example we don't use any external storage (like database or files) to keep track for the transactions to keep the example as simple as possible. We've tried to put the explanatory comments in the code to help developers to extend this example according to their needs. > Please refer to [NEAR Indexer for Explorer](https://github.com/near/near-indexer-for-explorer) to find an inspiration for extending the indexer. ## How it works Assuming we want to watch for transactions where a receiver account id is one of the provided in a list. We pass the list of account ids (or contracts it is the same) via argument `--accounts`. We want to catch all *successfull* transactions sent to one of the accounts from the list. In the demo we'll just look for them and log them but it might and probably should be extended based on your needs. --- ## How to use Before you proceed, make sure you have the following software installed: * [rustup](https://rustup.rs/) or Rust version that is mentioned in `rust-toolchain` file in the root of [nearcore](https://github.com/nearprotocol/nearcore) project. Clone this repository and open the project folder ```bash $ git clone git@github.com:khorolets/indexer-tx-watcher-example.git $ cd indexer-tx-watcher-example ``` ### Run ```bash $ cargo build --release $ ./target/release/indexer-tx-watcher-example --accounts mycoolcontract.near,myanothercoolcontract.near --block-height 88088521 testnet ``` Provide your contracts list after `--accounts` key separated with comma (`,`) **avoid spaces**, pick a fresher block height on https://explorer.testnet.near.org/ --- Find more docs about indexers on https://near-indexers.io Indexer that catches txs for specific contract(s) ================================================= The most common use case for indexers is to react on a transaction sent to a specific contract or a list of contracts. This project is trying to provide an example of the indexer described about. It's simple yet doing the necessary stuff. In this example we don't use any external storage (like database or files) to keep track for the transactions to keep the example as simple as possible. We've tried to put the explanatory comments in the code to help developers to extend this example according to their needs. > Please refer to [NEAR Indexer for Explorer](https://github.com/near/near-indexer-for-explorer) to find an inspiration for extending the indexer. ## How it works Assuming we want to watch for transactions where a receiver account id is one of the provided in a list. We pass the list of account ids (or contracts it is the same) via argument `--accounts`. We want to catch all *successfull* transactions sent to one of the accounts from the list. In the demo we'll just look for them and log them but it might and probably should be extended based on your needs. --- ## How to use Before you proceed, make sure you have the following software installed: * [rustup](https://rustup.rs/) or Rust version that is mentioned in `rust-toolchain` file in the root of [nearcore](https://github.com/nearprotocol/nearcore) project. Clone this repository and open the project folder ```bash $ git clone git@github.com:khorolets/indexer-tx-watcher-example.git $ cd indexer-tx-watcher-example ``` ### Init To connect NEAR Indexer for Explorer to the specific chain you need to have necessary configs, you can generate it as follows: * `localnet` (recommended to start with) ```bash $ cargo build --release $ ./target/release/indexer-tx-watcher-example --home-dir ~/.near/localnet init --chain-id localnet ``` * `testnet` (once you've adjusted and extended the example for your needs) ```bash $ cargo build --release $ ./target/release/indexer-tx-watcher-example --home-dir ~/.near/testnet init --chain-id testnet --download-config --download-genesis ``` The above code will download the official genesis config and generate necessary configs. **NB!** According to changes in `nearcore` config generation we don't fill all the necessary fields in the config file. While this issue is open https://github.com/nearprotocol/nearcore/issues/3156 you need to download config you want and replace the generated one manually. - [testnet config.json](https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/testnet/config.json) - [betanet config.json](https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/betanet/config.json) - [mainnet config.json](https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/mainnet/config.json) Configs for the specified network are in the `--home-dir` provided folder. We need to ensure that NEAR Indexer for Explorer follows all the necessary shards, so `"tracked_shards"` parameters in `~/.near/localnet/config.json` needs to be configured properly. For example, with a single shared network, you just add the shards numbers you need to the list: ``` ... "tracked_shards": [0], ... ``` ### Run ```bash $ ./target/release/indexer-tx-watcher-example --home-dir ~/.near/localnet run --accounts mycoolcontract.near,myanothercoolcontract.near ``` Provide your contracts list after `--accounts` key separated with comma (`,`) **avoid spaces** --- ## Syncing Whenever you run the indexer for any network except `localnet` you'll need to sync with the network. This is required because it's a natural behavior of `nearcore` node and the indexer is a wrapper for the regular `nearcore` node. In order to work and index the data your node must be synced with the network. This process can take a while, so we suggest to download a fresh backup of the `data` folder and put it in you `--home-dir` of your choice (by default it is `~/.near`) Running your indexer node on top of a backup data will reduce the time of syncing process because your node will download only missing data and it will take reasonable time. All the backups can be downloaded from the public S3 bucket which contains latest daily snapshots: * [Recent 5-epoch Mainnet data folder](https://near-protocol-public.s3.ca-central-1.amazonaws.com/backups/mainnet/rpc/data.tar) * [Recent 5-epoch Testnet data folder](https://near-protocol-public.s3.ca-central-1.amazonaws.com/backups/testnet/rpc/data.tar) ## Archival node It's not necessary but in order to index everything in the network it is better to do it from the genesis. `nearcore` node is running in non-archival mode by default. That means that the node keeps data only for [5 last epochs](https://docs.near.org/concepts/basics/epoch). In order to index data from the genesis we need to turn the node in archival mode. To do it we need to update `config.json` located in `--home-dir` or your choice (by default it is `~/.near`). Find next keys in the config and update them as following: ```json { ... "archive": true, "tracked_shards": [0], ... } ``` The syncing process in archival mode can take a lot of time, so it's better to download a backup provided by NEAR and put it in your `data` folder. After that your node will need to sync only missing data and it should take reasonable time. All the backups can be downloaded from the public S3 bucket which contains latest daily snapshots: * [Archival Mainnet data folder](https://near-protocol-public.s3.ca-central-1.amazonaws.com/backups/mainnet/archive/data.tar) * [Archival Testnet data folder](https://near-protocol-public.s3.ca-central-1.amazonaws.com/backups/testnet/archive/data.tar) See [this article](https://docs.near.org/integrator/exchange-integration#running-an-archival-node) for reference
NEAR-Balkans_pool-together
README.md build_all.sh common Cargo.toml src lib.rs types.rs defi-borrow Cargo.toml build.sh src events.rs lib.rs draw Cargo.toml build.sh src interfaces mod.rs lib.rs test_utils.rs pool Cargo.toml build.sh neardev dev-account.env src burrow.rs external.rs ft_token.rs interfaces mod.rs lib.rs picks.rs prize.rs test_utils.rs twab.rs utils.rs tests basic.rs utils.rs sim-tests Cargo.toml src lib.rs setup.rs utils.rs
# pool-together
manolaz_technous-medical-logistic-smart-contract
README.md medi-log .gitpod.yml README.md babel.config.js contract Cargo.toml README.md compile.js src lib.rs package.json src App.js __mocks__ fileMock.js assets logo-black.svg logo-white.svg config.js global.css index.html index.js jest.init.js main.test.js utils.js wallet login index.html staticweb index.html
medi-log Smart Contract ================== A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard Rust tests using [cargo] with a `--nocapture` flag so that you can see any debug info you print to the console. [smart contract]: https://docs.near.org/docs/roles/developer/contracts/intro [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://github.com/near/near-sdk-rs#pre-requisites [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html medi-log ================== This [React] app was initialized with [create-near-app] Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install dependencies: `yarn install` 3. Run the local development server: `yarn dev` (see `package.json` for a full list of `scripts` you can run with `yarn`) Now you'll have a local development environment backed by the NEAR TestNet! Go ahead and play with the app and the code. As you make code changes, the app will automatically reload. Exploring The Code ================== 1. The "backend" code lives in the `/contract` folder. See the README there for more info. 2. The frontend code lives in the `/src` folder. `/src/index.html` is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and the smart contract. See `contract/README` for info about how it's tested. The frontend code gets tested with [jest]. You can run both of these at once with `yarn run test`. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally: yarn install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `medi-log.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `medi-log.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account medi-log.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'medi-log.YOUR-NAME.testnet' Step 3: deploy! --------------- One command: yarn deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contract to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [React]: https://reactjs.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages # technous-medical-logistic-smart-contract Smart contract for Open Med Logistic
htamlive_Near-App
.gitpod.yml README.md contract Cargo.toml README.md neardev dev-account.env src lib.rs target .rustc_info.json debug .fingerprint Inflector-5962d0ee2f0ab2a7 lib-inflector.json Inflector-ba423869db093087 lib-inflector.json ahash-187a50e0f8890e4c run-build-script-build-script-build.json ahash-208056d29386357e lib-ahash.json ahash-423605d20674662e build-script-build-script-build.json ahash-7eaf706119029f41 lib-ahash.json ahash-8e8a17a301d84bff build-script-build-script-build.json ahash-b564970e0363ee1f run-build-script-build-script-build.json arrayref-89f8cd5d707a7d9e lib-arrayref.json arrayref-93fc2c7bd2277b5c lib-arrayref.json arrayvec-476cc882b0abcc2e lib-arrayvec.json arrayvec-6c4594168e2258cc lib-arrayvec.json arrayvec-846805dcd6747252 lib-arrayvec.json arrayvec-eaa9c5cefa2e820f lib-arrayvec.json autocfg-6bf9dfeeb2cf1023 lib-autocfg.json autocfg-8196867e0b9e6ea0 lib-autocfg.json base64-1e0a110bb2a1f5c7 lib-base64.json base64-424c6dad82414ed5 lib-base64.json base64-520c077775c4288d lib-base64.json base64-67f16044398e34e1 lib-base64.json bitvec-917f24fd0b6bf19e lib-bitvec.json bitvec-d68454d427319c4e lib-bitvec.json blake2-7119b352d466be94 lib-blake2.json blake2-e8f6da000b153522 lib-blake2.json block-buffer-09e931c9d34390ca lib-block-buffer.json block-buffer-29d5f1fd0713c90b lib-block-buffer.json block-buffer-c74a746a8f225240 lib-block-buffer.json block-buffer-cd6b2bc30290c2fc lib-block-buffer.json borsh-3957de8f41a62bbf lib-borsh.json borsh-6a286c5416cf722f lib-borsh.json borsh-derive-2f57ff15d5b2bffb lib-borsh-derive.json borsh-derive-4e42e761c8fdd648 lib-borsh-derive.json borsh-derive-internal-b6e618bd5524b5b7 lib-borsh-derive-internal.json borsh-derive-internal-cdc4475de0529a6d lib-borsh-derive-internal.json borsh-schema-derive-internal-6bd03234a312f376 lib-borsh-schema-derive-internal.json borsh-schema-derive-internal-84f80f4c9a64ab97 lib-borsh-schema-derive-internal.json bs58-947edcedcfda2396 lib-bs58.json bs58-e62fd96934b0bec7 lib-bs58.json byte-slice-cast-1a43485ada229a25 lib-byte-slice-cast.json byte-slice-cast-de1e8a3e99298c14 lib-byte-slice-cast.json byteorder-a7a3670b9a2f6cfe lib-byteorder.json byteorder-d73e84f9bda66feb lib-byteorder.json bytesize-07a5ffabcc5052dd lib-bytesize.json bytesize-32f5533ce8c3380b lib-bytesize.json c2-chacha-0c76c96dd45621f9 lib-c2-chacha.json c2-chacha-b81dc3255249a97b lib-c2-chacha.json cc-670041c26ce3b88f lib-cc.json cc-e11d38eaaa29708b lib-cc.json cfg-if-54b9c4b6dd239d91 lib-cfg-if.json cfg-if-64f39b0abd2c6529 lib-cfg-if.json cfg-if-8aebaf67cb64a367 lib-cfg-if.json cfg-if-a78dbf0dcab27289 lib-cfg-if.json cfg-if-f8ad2a765ea7f234 lib-cfg-if.json chrono-aa8a41b05f0c4dcf lib-chrono.json chrono-b41d6c14b538d05d lib-chrono.json cipher-059e5aac8838c6fc lib-cipher.json cipher-cbd43691c8014fee lib-cipher.json convert_case-ac4da1b9680c7551 lib-convert_case.json convert_case-bc7e4fed4cf1e764 lib-convert_case.json cpufeatures-03fc5c273288cf08 lib-cpufeatures.json cpufeatures-cf2b3f235460950e lib-cpufeatures.json crunchy-25299a78a96ef834 lib-crunchy.json crunchy-8552afcc3e1d72ac build-script-build-script-build.json crunchy-8a7fa857dbcc43bc build-script-build-script-build.json crunchy-96af34784b652c21 run-build-script-build-script-build.json crunchy-9c1cb0b4c883b07c lib-crunchy.json crunchy-b1bffbbdac285499 run-build-script-build-script-build.json crypto-common-30175d6e0417b0f9 lib-crypto-common.json crypto-common-be03dc691ced9067 lib-crypto-common.json crypto-mac-6576be562aecffb9 lib-crypto-mac.json crypto-mac-f23cfa8a459468f6 lib-crypto-mac.json curve25519-dalek-2fd1d846fe43365a lib-curve25519-dalek.json curve25519-dalek-f79f43e5bda0d1d8 lib-curve25519-dalek.json derive_more-e1c1e2a3c35eade8 lib-derive_more.json derive_more-f8840607b5e94283 lib-derive_more.json digest-2e90a24e8cd1cbcd lib-digest.json digest-67bb28ec1a9213c0 lib-digest.json digest-f3de8ece62aa0981 lib-digest.json digest-f8e41b26ef355acf lib-digest.json easy-ext-62537f1fba29c6e9 lib-easy-ext.json easy-ext-a1ad2f2ae06c5559 lib-easy-ext.json ed25519-d64ad6ff06b566ea lib-ed25519.json ed25519-dalek-d74bb35387fd9816 lib-ed25519-dalek.json ed25519-dalek-e62c4beb1b84ef0d lib-ed25519-dalek.json ed25519-e26d104e1e8dbd0c lib-ed25519.json fixed-hash-8a7a86e58d1388df lib-fixed-hash.json fixed-hash-be5cb5e2f5435306 lib-fixed-hash.json funty-423c278525275655 lib-funty.json funty-e0cc36b9f7bf4b37 lib-funty.json generic-array-35d343a5fef92d39 run-build-script-build-script-build.json generic-array-3f96a44fc184f739 run-build-script-build-script-build.json generic-array-48652491a2dfd986 lib-generic_array.json generic-array-b81659f44158c1aa build-script-build-script-build.json generic-array-ce577f258add2b66 lib-generic_array.json generic-array-d485288ae663f8cc build-script-build-script-build.json getrandom-118a236c59eeae85 run-build-script-build-script-build.json getrandom-29e45fb9b8a1ec3f lib-getrandom.json getrandom-32aa2f28fa4d33ab lib-getrandom.json getrandom-4be1ce77e6cf582b build-script-build-script-build.json getrandom-780c8e132c34b4b3 lib-getrandom.json getrandom-8fd7d86e6e059675 lib-getrandom.json getrandom-9f0f3be3f64bfc9c build-script-build-script-build.json getrandom-b16fede5e08f0135 run-build-script-build-script-build.json hashbrown-73848b61a52cbab5 lib-hashbrown.json hashbrown-d9cc52fa998d04f5 lib-hashbrown.json heck-08fa7e5f846be969 lib-heck.json heck-09fa200789122cf4 lib-heck.json hello_near-00ca379cccdf6430 lib-hello_near.json hello_near-203ae482fc574f48 test-lib-hello_near.json hello_near-4d057c3c114d10c8 test-lib-hello_near.json hello_near-e29a23b77a2eb220 lib-hello_near.json hex-2f376e536acb2029 lib-hex.json hex-be64ae2ca0e4a11d lib-hex.json iana-time-zone-8520316279f14aa9 lib-iana-time-zone.json iana-time-zone-d61f26605ad52558 lib-iana-time-zone.json impl-codec-1a39e09947d35c9c lib-impl-codec.json impl-codec-1f43c092195bf504 lib-impl-codec.json impl-trait-for-tuples-420dbb82a3bf0a22 lib-impl-trait-for-tuples.json impl-trait-for-tuples-8182ac0dfd474b91 lib-impl-trait-for-tuples.json itoa-17e019cd974ce0e3 lib-itoa.json itoa-9a5b46b5f0814a20 lib-itoa.json keccak-8c31034f184b2ace lib-keccak.json keccak-cd906a41110b9e6c lib-keccak.json libc-1e10a1c6f2476a7f build-script-build-script-build.json libc-3c50104ed0cc4176 lib-libc.json libc-5cb644435fe1cd1f run-build-script-build-script-build.json libc-cd28d6d1fb9c7fab run-build-script-build-script-build.json libc-cdb28208a7c7888f build-script-build-script-build.json libc-e85ebdbdf683c64c lib-libc.json memory_units-06af935a86ed2368 lib-memory_units.json memory_units-1041b786cb189d0a lib-memory_units.json near-account-id-401aad0b74223dcb lib-near-account-id.json near-account-id-f5e790ebe85f1f72 lib-near-account-id.json near-crypto-25fa1d575c63dc8e lib-near-crypto.json near-crypto-510d3f2a187bfa3a lib-near-crypto.json near-primitives-48343d327a8f5438 lib-near-primitives.json near-primitives-7319cf26093a1c50 lib-near-primitives.json near-primitives-core-9136eeedfc5c870d lib-near-primitives-core.json near-primitives-core-a0432bfc53d60082 lib-near-primitives-core.json near-rpc-error-core-74e9b700e42ccfe3 lib-near-rpc-error-core.json near-rpc-error-core-d238ffcb1bc595c0 lib-near-rpc-error-core.json near-rpc-error-macro-595c623481b7a9d5 lib-near-rpc-error-macro.json near-rpc-error-macro-8ec8cc1271c85127 lib-near-rpc-error-macro.json near-sdk-76e3327d2e32eeec lib-near-sdk.json near-sdk-ec6573d40c885636 lib-near-sdk.json near-sdk-macros-5c318060cee0a27e lib-near-sdk-macros.json near-sdk-macros-d8d53adca967c532 lib-near-sdk-macros.json near-sys-88b3cccfc9312c80 lib-near-sys.json near-sys-cefd0ac53cf8d4c2 lib-near-sys.json near-vm-errors-964272dfad87a766 lib-near-vm-errors.json near-vm-errors-da5454a90c08b000 lib-near-vm-errors.json near-vm-logic-29c626dd162fe2ab lib-near-vm-logic.json near-vm-logic-3b8ffb16cd4ff0e6 lib-near-vm-logic.json num-bigint-05694e8a934b3726 lib-num-bigint.json num-bigint-0a3956771b73db1b lib-num-bigint.json num-bigint-59a010d5b0ff2468 build-script-build-script-build.json num-bigint-5c38fcbfd078c15e run-build-script-build-script-build.json num-bigint-84d86702bf1a95c5 build-script-build-script-build.json num-bigint-8c623f5658d530e5 run-build-script-build-script-build.json num-integer-0a432e04a3434172 lib-num-integer.json num-integer-3880e0566d8a5ab3 build-script-build-script-build.json num-integer-66ec47d414f4d9d4 build-script-build-script-build.json num-integer-71ef58c8376a659b run-build-script-build-script-build.json num-integer-941a247e86c72a49 lib-num-integer.json num-integer-c5a9c68f351f6366 run-build-script-build-script-build.json num-rational-0aee3b51d7d20054 lib-num-rational.json num-rational-7b0e1dd9ebee7fd3 run-build-script-build-script-build.json num-rational-7f7578a66b5fe579 build-script-build-script-build.json num-rational-833cf0106d4aa4c1 lib-num-rational.json num-rational-8bc950785f8ef735 build-script-build-script-build.json num-rational-c24d469f6289991a run-build-script-build-script-build.json num-traits-0058ddc532491d37 run-build-script-build-script-build.json num-traits-4438c83c24c87aed build-script-build-script-build.json num-traits-92c43a54ffc825c6 build-script-build-script-build.json num-traits-aef9014c86bcaba1 lib-num-traits.json num-traits-b367d24b3475117c run-build-script-build-script-build.json num-traits-cc175ed6295f1b79 lib-num-traits.json once_cell-d4f2c8af6a52edfa lib-once_cell.json once_cell-dbde35a33e338b01 lib-once_cell.json once_cell-ea617f36b85600c1 lib-once_cell.json opaque-debug-08fe8b6aacfd06c5 lib-opaque-debug.json opaque-debug-23dd0dc2303d48ec lib-opaque-debug.json parity-scale-codec-6203cc9233dfdc82 lib-parity-scale-codec.json parity-scale-codec-derive-b260b779b84b1c26 lib-parity-scale-codec-derive.json parity-scale-codec-derive-b9aafd3154f02ec5 lib-parity-scale-codec-derive.json parity-scale-codec-e97cb248eb3f3da8 lib-parity-scale-codec.json parity-secp256k1-1cd6790a696e85d7 run-build-script-build-script-build.json parity-secp256k1-1eff3643970b17ac build-script-build-script-build.json parity-secp256k1-66e819bf8f240c69 run-build-script-build-script-build.json parity-secp256k1-845b918d87012fca lib-secp256k1.json parity-secp256k1-acf04e9b7c11e54d lib-secp256k1.json parity-secp256k1-e1cd722b418ca841 build-script-build-script-build.json ppv-lite86-2d065cebe2837269 lib-ppv-lite86.json ppv-lite86-85a9fafec72cf774 lib-ppv-lite86.json primitive-types-2d6530d469cd3ee7 lib-primitive-types.json primitive-types-8e4233ae3bddfc91 lib-primitive-types.json proc-macro-crate-2e6ee527b7182d6b lib-proc-macro-crate.json proc-macro-crate-73f496cd129a1d92 lib-proc-macro-crate.json proc-macro-crate-7cc87844200e34f2 lib-proc-macro-crate.json proc-macro-crate-cebf36378934f904 lib-proc-macro-crate.json proc-macro2-35ebc83702ce1249 lib-proc-macro2.json proc-macro2-52cb53e8d9fab673 run-build-script-build-script-build.json proc-macro2-578468c34a9cf32e build-script-build-script-build.json proc-macro2-ac77fa5cad7c1f8c build-script-build-script-build.json proc-macro2-e2810d457df05c6f run-build-script-build-script-build.json proc-macro2-ef0d54fa9efa0da5 lib-proc-macro2.json quote-43180963301747cc lib-quote.json quote-44611f63c1c69ac0 lib-quote.json quote-c61099e647f3d29c run-build-script-build-script-build.json quote-cb105e187d706036 build-script-build-script-build.json quote-cfc15fc1f8d7e602 run-build-script-build-script-build.json quote-e03d72a831cf6b24 build-script-build-script-build.json radium-2aadca54cbc21cee run-build-script-build-script-build.json radium-5c5caa257171be32 lib-radium.json radium-7ac73d22f62aa1b5 run-build-script-build-script-build.json radium-b320b3d6c87fae86 lib-radium.json radium-fa25404fef0c2e36 build-script-build-script-build.json radium-fac3e44617f4ab21 build-script-build-script-build.json rand-4fccbb15cf16de39 lib-rand.json rand-95cafb5a6149a200 lib-rand.json rand-b756a249a0790e7f lib-rand.json rand-f3e1c29fb8f628f4 lib-rand.json rand_chacha-0cebc69bc0841641 lib-rand_chacha.json rand_chacha-1334b6f4bbd0dfa2 lib-rand_chacha.json rand_chacha-a13f6b71d26139a6 lib-rand_chacha.json rand_chacha-ca3a50e7c0f7d583 lib-rand_chacha.json rand_core-88c502d92873b0b8 lib-rand_core.json rand_core-b05f846284fdf1fc lib-rand_core.json rand_core-d7f90d2f222f4959 lib-rand_core.json rand_core-ed623dddeb7492ec lib-rand_core.json reed-solomon-erasure-3e0952b8eaba8c5b run-build-script-build-script-build.json reed-solomon-erasure-3faa8dbe8bdf017b lib-reed-solomon-erasure.json reed-solomon-erasure-46a9c56d4ccffc9d lib-reed-solomon-erasure.json reed-solomon-erasure-48e3b0904914a11a build-script-build-script-build.json reed-solomon-erasure-94ea8d0843e076fc build-script-build-script-build.json reed-solomon-erasure-d32bc4c59d592853 run-build-script-build-script-build.json ripemd-a8b67fb51899c161 lib-ripemd.json ripemd-bca32ed2418c2f74 lib-ripemd.json rustc-hex-2a72f97fbb549485 lib-rustc-hex.json rustc-hex-4197daa76a873a17 lib-rustc-hex.json rustversion-1bf04f8b0de96743 lib-rustversion.json rustversion-4ac551d38641b18d run-build-script-build-script-build.json rustversion-6c39b446ea92268b run-build-script-build-script-build.json rustversion-9f120bd797633710 build-script-build-script-build.json rustversion-da0aad92b2df0e94 build-script-build-script-build.json rustversion-e1f4b30b0524868e lib-rustversion.json ryu-787b246cd1580eaf lib-ryu.json ryu-ed2e54b2ed510c67 lib-ryu.json serde-0470448cad629c78 lib-serde.json serde-2b136e249d3ec8bf build-script-build-script-build.json serde-2e1d6f96495cd50b run-build-script-build-script-build.json serde-425e4b91e58dac1b build-script-build-script-build.json serde-521502af26ab8ec1 run-build-script-build-script-build.json serde-94e34a562c35a5ed build-script-build-script-build.json serde-aafe782ad0113dbd run-build-script-build-script-build.json serde-b601b3cc7b275188 lib-serde.json serde-b6196f20be80bb6c run-build-script-build-script-build.json serde-cceeff5a3b7df861 build-script-build-script-build.json serde-d34a42cb0a240749 lib-serde.json serde-de90abb32959b927 lib-serde.json serde_derive-33a5c83adb65a3f2 lib-serde_derive.json serde_derive-4255ba949823dcb1 lib-serde_derive.json serde_derive-44f6d9a17ed41b16 build-script-build-script-build.json serde_derive-9b999e5474ce177c run-build-script-build-script-build.json serde_derive-f050a64f384e8b1a run-build-script-build-script-build.json serde_derive-f36eaecb6dbe6314 build-script-build-script-build.json serde_json-1012aa632f33ac98 run-build-script-build-script-build.json serde_json-2a75fe2929a0e0e4 lib-serde_json.json serde_json-780062c42d760234 run-build-script-build-script-build.json serde_json-9d04b8e3c58f52b9 build-script-build-script-build.json serde_json-c9ec8b550bd77ee1 lib-serde_json.json serde_json-f15a54c6c1b74193 build-script-build-script-build.json sha2-02913fb317d6f6e0 lib-sha2.json sha2-4d3f1d868345f262 lib-sha2.json sha2-74e19aac4fe963ad lib-sha2.json sha2-81abdf295a0fdb5e lib-sha2.json sha3-d9cc41664c3918e1 lib-sha3.json sha3-faa2ff3f00896683 lib-sha3.json signature-895396839a772db6 lib-signature.json signature-c79bf655b8288ae5 lib-signature.json smallvec-1213ea5d548c828b lib-smallvec.json smallvec-eda9c36ecfc95728 lib-smallvec.json smart-default-25e49db7451e7aef lib-smart-default.json smart-default-a7e8bad4a1d798b5 lib-smart-default.json static_assertions-4e640dd0a3d1e6bd lib-static_assertions.json static_assertions-8936f35f17f18216 lib-static_assertions.json strum-ce19fb9092b58054 lib-strum.json strum-e9dac50dd2ad41be lib-strum.json strum_macros-3d19c6e450068ceb lib-strum_macros.json strum_macros-caf8e9b3ac9454a6 lib-strum_macros.json subtle-57ef08d7facba13c lib-subtle.json subtle-9e2a930de84bf4bc lib-subtle.json syn-8fe727c5e51f53a3 lib-syn.json syn-b2c5d6c8340d2e32 build-script-build-script-build.json syn-d8978a8bb08a292b lib-syn.json syn-dc8b11db70ea2e22 run-build-script-build-script-build.json syn-f207b8aa4a90ad6c build-script-build-script-build.json syn-f451bf98df381eb6 run-build-script-build-script-build.json synstructure-62f9c661d30fe367 lib-synstructure.json synstructure-633be0c18fdcf3f0 lib-synstructure.json tap-86d71e3685aab230 lib-tap.json tap-ad644cfb2a7152ea lib-tap.json thiserror-3e9ad55e768059a3 lib-thiserror.json thiserror-5cfebb5f183fd4db lib-thiserror.json thiserror-d5732a827652bba7 lib-thiserror.json thiserror-impl-94c4a47729701ae7 lib-thiserror-impl.json thiserror-impl-ff66101b07dd6794 lib-thiserror-impl.json time-2a80e43e6e136577 lib-time.json time-e75988d4b92ba8a0 lib-time.json toml-12f45c6e5b8ef878 lib-toml.json toml-7319044c7dacb9d1 lib-toml.json typenum-1a04422e7d3871a6 build-script-build-script-main.json typenum-6582314566cbfebf build-script-build-script-main.json typenum-75b658a6e3feb321 run-build-script-build-script-main.json typenum-a638d148d84494a5 lib-typenum.json typenum-e85d902fc94ce6c9 run-build-script-build-script-main.json typenum-f18b7974e20ae109 lib-typenum.json uint-6ba264a84a9effa6 lib-uint.json uint-b8f062eaa3aaacd3 lib-uint.json unicode-ident-786d91c019a1f227 lib-unicode-ident.json unicode-ident-a2404d4dc6c184f5 lib-unicode-ident.json unicode-xid-462fc610b9fff532 lib-unicode-xid.json unicode-xid-b30ac17ce2d08c5f lib-unicode-xid.json version_check-039849167687a3a8 lib-version_check.json version_check-80de5d381feeba97 lib-version_check.json wee_alloc-22a767e65a4dce67 lib-wee_alloc.json wee_alloc-68001fea00d8ab15 run-build-script-build-script-build.json wee_alloc-aedb42d1822effbf build-script-build-script-build.json wee_alloc-d11e3498696ba6da build-script-build-script-build.json wee_alloc-dd1ecbf771fb49bb run-build-script-build-script-build.json wee_alloc-e08cddfa1498efad lib-wee_alloc.json winapi-1d46736d9760cd12 build-script-build-script-build.json winapi-38dec1d45a0d3871 run-build-script-build-script-build.json winapi-aad58df2f1ab31cb lib-winapi.json wyz-48185abb01a783df lib-wyz.json wyz-8927dee85994246c lib-wyz.json zeroize-3fd1187657cebe1b lib-zeroize.json zeroize-48b54e905e1d8fe0 lib-zeroize.json zeroize_derive-68708c982c416e6e lib-zeroize_derive.json zeroize_derive-739914b53764e3b3 lib-zeroize_derive.json build crunchy-96af34784b652c21 out lib.rs crunchy-b1bffbbdac285499 out lib.rs num-bigint-5c38fcbfd078c15e out radix_bases.rs num-bigint-8c623f5658d530e5 out radix_bases.rs parity-secp256k1-1cd6790a696e85d7 out flag_check.c parity-secp256k1-66e819bf8f240c69 out flag_check.c reed-solomon-erasure-3e0952b8eaba8c5b out table.rs reed-solomon-erasure-d32bc4c59d592853 out table.rs typenum-75b658a6e3feb321 out consts.rs op.rs tests.rs typenum-e85d902fc94ce6c9 out consts.rs op.rs tests.rs wee_alloc-68001fea00d8ab15 out wee_alloc_static_array_backend_size_bytes.txt wee_alloc-dd1ecbf771fb49bb out wee_alloc_static_array_backend_size_bytes.txt release .fingerprint Inflector-34b3ed2ea6d72e66 lib-inflector.json ahash-c6faee060863811c build-script-build-script-build.json borsh-derive-d8c855ffd7f93343 lib-borsh-derive.json borsh-derive-internal-49d1eff69d2e3272 lib-borsh-derive-internal.json borsh-schema-derive-internal-44d6bb28b8a41dd7 lib-borsh-schema-derive-internal.json crunchy-65d3b1c0a0e86220 build-script-build-script-build.json near-sdk-macros-152b5091fa8a968e lib-near-sdk-macros.json proc-macro-crate-20d1b892ce56e1ff lib-proc-macro-crate.json proc-macro2-4efd15ea6f194149 build-script-build-script-build.json proc-macro2-7c45c5f273f79f73 lib-proc-macro2.json proc-macro2-82c06534cac70032 run-build-script-build-script-build.json quote-b4f3a83d583cfcbf lib-quote.json quote-d84025bcaea3aac1 run-build-script-build-script-build.json quote-e1ffceccfc17b52a build-script-build-script-build.json serde-0a65bc5dd186ef9c build-script-build-script-build.json serde-4a56a6e108aaafef lib-serde.json serde-676d6cce90a81f9e build-script-build-script-build.json serde-a035cff5e6832800 run-build-script-build-script-build.json serde_derive-2b2e3cf4deed344b build-script-build-script-build.json serde_derive-c17ef56d118aa091 run-build-script-build-script-build.json serde_derive-eda52f6d61f6f6c1 lib-serde_derive.json serde_json-bde9ae0a4b07a63c build-script-build-script-build.json syn-07196c0d57be7d7e build-script-build-script-build.json syn-0f66d4066780122c lib-syn.json syn-6ddee39b83cb17b3 run-build-script-build-script-build.json toml-d5d57096483c3118 lib-toml.json unicode-ident-bf1a645bac15dc35 lib-unicode-ident.json version_check-af49dc8d387d5ba8 lib-version_check.json wee_alloc-38f0ffe950509f8f build-script-build-script-build.json wasm32-unknown-unknown release .fingerprint ahash-92604981850cf802 run-build-script-build-script-build.json ahash-c93ed3cc59949b25 lib-ahash.json base64-2602488d6de3eacf lib-base64.json borsh-a1c3528e94e97ea7 lib-borsh.json bs58-2b855d1adba00fd2 lib-bs58.json byteorder-c3dfc6c7eea94d0f lib-byteorder.json cfg-if-660d9e104deb4443 lib-cfg-if.json crunchy-13ae59a1d174703c lib-crunchy.json crunchy-4787d78e6c3aada5 run-build-script-build-script-build.json hashbrown-d73f284706233ed6 lib-hashbrown.json hello_near-00ca379cccdf6430 lib-hello_near.json hex-f0709e5d4ee69ad7 lib-hex.json itoa-0568bfa47efd16f2 lib-itoa.json memory_units-376ed0a383ba5c97 lib-memory_units.json near-sdk-36d85ab3e34332f3 lib-near-sdk.json near-sys-f42a345412602ae4 lib-near-sys.json once_cell-f9dfe8588decd5aa lib-once_cell.json ryu-eb6ead6bb2c420fc lib-ryu.json serde-e8d1600e59df04e1 lib-serde.json serde-fb30c304d97991c3 run-build-script-build-script-build.json serde_json-292e9b0645b4fa0d lib-serde_json.json serde_json-6d2cc67ce2831e60 run-build-script-build-script-build.json static_assertions-0952d6fc09f9abd8 lib-static_assertions.json uint-42fa0b589bb8343f lib-uint.json wee_alloc-9da2a0138dc0dd17 lib-wee_alloc.json wee_alloc-a1be3ffafd2ab100 run-build-script-build-script-build.json build crunchy-4787d78e6c3aada5 out lib.rs wee_alloc-a1be3ffafd2ab100 out wee_alloc_static_array_backend_size_bytes.txt frontend App.js assets global.css logo-black.svg logo-white.svg dist index.bc0daea6.css index.html logo-black.4514ed42.svg logo-white.a7716062.svg index.html index.js near-api.js near-config.js package-lock.json package.json ui-components.js integration-tests package-lock.json package.json src main.ava.ts package-lock.json package.json
Hello NEAR! ================================= A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. 2. There are two functions to the smart contract: `get_greeting` and `set_greeting`. 3. Tests: You can run smart contract tests with the `cargo test`. [smart contract]: https://docs.near.org/develop/welcome [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://docs.near.org/develop/prerequisites#rust-and-wasm [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html near-blank-project ================== This app was initialized with [create-near-app] Quick Start =========== If you haven't installed dependencies during setup: npm run deps-install Build and deploy your contract to TestNet with a temporary dev account: npm run deploy Test your contract: npm test If you have a frontend, run `npm start`. This will run a dev server. Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages
Learn-NEAR_NCD--near-shipment
README.md check scripts in `. scripts` as-pect.config.js asconfig.json package-lock.json package.json scripts 1.dev-deploy.sh 2.use-contract.sh 3.cleanup.sh README.md src as_types.d.ts asconfig.json assembly __tests__ index.unit.spec.ts index.ts model.ts tsconfig.json utils.ts
## Setting up your terminal The scripts in this folder are designed to help you demonstrate the behavior of the contract(s) in this project. It uses the following setup: ```sh # set your terminal up to have 2 windows, A and B like this: ┌─────────────────────────────────┬─────────────────────────────────┐ │ │ │ │ │ │ │ A │ B │ │ │ │ │ │ │ └─────────────────────────────────┴─────────────────────────────────┘ ``` ### Terminal **A** *This window is used to compile, deploy and control the contract* - Environment ```sh export CONTRACT= # depends on deployment export OWNER= # any account you control # for example # export CONTRACT=dev-1615190770786-2702449 # export OWNER=sherif.testnet ``` - Commands _helper scripts_ ```sh 1.dev-deploy.sh # helper: build and deploy contracts 2.use-contract.sh # helper: call methods on ContractPromise 3.cleanup.sh # helper: delete build and deploy artifacts ``` ### Terminal **B** *This window is used to render the contract account storage* - Environment ```sh export CONTRACT= # depends on deployment # for example # export CONTRACT=dev-1615190770786-2702449 ``` - Commands ```sh # monitor contract storage using near-account-utils # https://github.com/near-examples/near-account-utils watch -d -n 1 yarn storage $CONTRACT ``` --- ## OS Support ### Linux - The `watch` command is supported natively on Linux - To learn more about any of these shell commands take a look at [explainshell.com](https://explainshell.com) ### MacOS - Consider `brew info visionmedia-watch` (or `brew install watch`) ### Windows - Consider this article: [What is the Windows analog of the Linux watch command?](https://superuser.com/questions/191063/what-is-the-windows-analog-of-the-linuo-watch-command#191068) # Near shipment 1. Clone repo with `git clone` 2. Install dependencies `yarn` 3. install `near-cli` globably ```bash npm install -g near-cli ``` --- check scripts in `./scripts` --- ## How it works - This smart contract can be used by a delivery company to track deliveries from the warehouse to the item's destination - at every point the item moves, the delivery agent will need to update the current location, basically by creating a shipment with the same information and only changing the `status` and `currentLoction` - in the end the status will be changed to delivered and the current location will be set to the destination.
MjolNear_marketplace-contracts
Cargo.toml README.md build.sh src lib.rs
# Marketplace Contract This mono repo contains the source code for the smart contracts of our Open NFT Marketplace on [NEAR](https://near.org). ## Development 1. Install `rustup` via https://rustup.rs/ 2. Run the following: ``` rustup default stable rustup target add wasm32-unknown-unknown ``` ### Testing Contracts have unit tests and also integration tests using NEAR Simulation framework. All together can be run: ``` cargo test --all ``` ### Compiling You can build release version by running script: ``` ./build.sh ``` ### Deploying to Testnet To deploy to Testnet, you can use next command: ``` near dev-deploy ``` This will output on the contract ID it deployed. ### Deploying to Mainnet To deploy to Mainnet, you can use next command: ``` export NEAR_ENV=mainnet near deploy market.mjol.near --accountId market.mjol.near ``` ### Migrate ``` near call market.mjol.near migrate '{}' --accountId market.mjol.near ```
myklemykle_stateless-web
.gitpod.yml old distrodemo.html distrodemo.js package.json readme.md src assets 1x_active.svg 1x_idle.svg 4x_active.svg 4x_idle.svg call_new_selection.svg help.svg wallet_connected.svg wallet_not_connected.svg components GridOfNFTs.js HeaderFooter.js NFTInGrid.js NFTSingle.js Nav.js PageHeadings.js fetch.js index.html index.js routes ArtistG.js ArtistS.js G.js Id.js OwnerG.js OwnerS.js S.js styles.css util.js
MiguelAngel115_MigsNearStarter2
README.md as-pect.config.js asconfig.json neardev dev-account.env node_modules @as-pect assembly README.md assembly index.ts internal Actual.ts Expectation.ts Expected.ts Reflect.ts ReflectedValueType.ts Test.ts assert.ts call.ts comparison toIncludeComparison.ts toIncludeEqualComparison.ts log.ts noOp.ts package.json types as-pect.d.ts as-pect.portable.d.ts env.d.ts cli README.md init as-pect.config.js env.d.ts example.spec.ts init-types.d.ts portable-types.d.ts lib as-pect.cli.amd.d.ts as-pect.cli.amd.js help.d.ts help.js index.d.ts index.js init.d.ts init.js portable.d.ts portable.js run.d.ts run.js test.d.ts test.js types.d.ts types.js util CommandLineArg.d.ts CommandLineArg.js IConfiguration.d.ts IConfiguration.js asciiArt.d.ts asciiArt.js collectReporter.d.ts collectReporter.js getTestEntryFiles.d.ts getTestEntryFiles.js removeFile.d.ts removeFile.js strings.d.ts strings.js writeFile.d.ts writeFile.js worklets ICommand.d.ts ICommand.js compiler.d.ts compiler.js package.json core README.md lib as-pect.core.amd.d.ts as-pect.core.amd.js index.d.ts index.js reporter CombinationReporter.d.ts CombinationReporter.js EmptyReporter.d.ts EmptyReporter.js IReporter.d.ts IReporter.js SummaryReporter.d.ts SummaryReporter.js VerboseReporter.d.ts VerboseReporter.js test IWarning.d.ts IWarning.js TestContext.d.ts TestContext.js TestNode.d.ts TestNode.js transform assemblyscript.d.ts assemblyscript.js createAddReflectedValueKeyValuePairsMember.d.ts createAddReflectedValueKeyValuePairsMember.js createGenericTypeParameter.d.ts createGenericTypeParameter.js createStrictEqualsMember.d.ts createStrictEqualsMember.js emptyTransformer.d.ts emptyTransformer.js hash.d.ts hash.js index.d.ts index.js util IAspectExports.d.ts IAspectExports.js IWriteable.d.ts IWriteable.js ReflectedValue.d.ts ReflectedValue.js TestNodeType.d.ts TestNodeType.js rTrace.d.ts rTrace.js stringifyReflectedValue.d.ts stringifyReflectedValue.js timeDifference.d.ts timeDifference.js wasmTools.d.ts wasmTools.js package.json csv-reporter index.ts lib as-pect.csv-reporter.amd.d.ts as-pect.csv-reporter.amd.js index.d.ts index.js package.json readme.md tsconfig.json json-reporter index.ts lib as-pect.json-reporter.amd.d.ts as-pect.json-reporter.amd.js index.d.ts index.js package.json readme.md tsconfig.json snapshots __tests__ snapshot.spec.ts jest.config.js lib Snapshot.d.ts Snapshot.js SnapshotDiff.d.ts SnapshotDiff.js SnapshotDiffResult.d.ts SnapshotDiffResult.js as-pect.core.amd.d.ts as-pect.core.amd.js index.d.ts index.js parser grammar.d.ts grammar.js package.json src Snapshot.ts SnapshotDiff.ts SnapshotDiffResult.ts index.ts parser grammar.ts tsconfig.json @assemblyscript loader README.md index.d.ts index.js package.json umd index.d.ts index.js package.json ansi-regex index.d.ts index.js package.json readme.md ansi-styles index.d.ts index.js package.json readme.md as-bignum .travis.yml README.md as-pect.config.js assembly __tests__ as-pect.d.ts safe_u128.spec.as.ts u128.spec.as.ts u256.spec.as.ts utils.ts fixed fp128.ts fp256.ts index.ts safe fp128.ts fp256.ts types.ts globals.ts index.ts integer i128.ts i256.ts index.ts safe i128.ts i256.ts i64.ts index.ts u128.ts u256.ts u64.ts u128.ts u256.ts tsconfig.json utils.ts index.js package.json tsconfig.json asbuild README.md dist cli.d.ts cli.js index.d.ts index.js main.d.ts main.js index.js node_modules cliui CHANGELOG.md LICENSE.txt README.md index.js package.json wrap-ansi index.js package.json readme.md y18n CHANGELOG.md README.md index.js package.json yargs-parser CHANGELOG.md LICENSE.txt README.md index.js lib tokenize-arg-string.js package.json yargs CHANGELOG.md README.md build lib apply-extends.d.ts apply-extends.js argsert.d.ts argsert.js command.d.ts command.js common-types.d.ts common-types.js completion-templates.d.ts completion-templates.js completion.d.ts completion.js is-promise.d.ts is-promise.js levenshtein.d.ts levenshtein.js middleware.d.ts middleware.js obj-filter.d.ts obj-filter.js parse-command.d.ts parse-command.js process-argv.d.ts process-argv.js usage.d.ts usage.js validation.d.ts validation.js yargs.d.ts yargs.js yerror.d.ts yerror.js index.js locales be.json de.json en.json es.json fi.json fr.json hi.json hu.json id.json it.json ja.json ko.json nb.json nl.json nn.json pirate.json pl.json pt.json pt_BR.json ru.json th.json tr.json zh_CN.json zh_TW.json package.json yargs.js package.json assemblyscript-json .eslintrc.js .travis.yml README.md as-pect.config.js assembly JSON.ts __tests__ as-pect.d.ts json-parse.spec.ts roundtrip.spec.ts to-string.spec.ts usage.spec.ts decoder.ts encoder.ts index.ts tsconfig.json util index.ts docs README.md classes decoderstate.md json.arr.md json.bool.md json.float.md json.integer.md json.null.md json.num.md json.obj.md json.str.md json.value.md jsondecoder.md jsonencoder.md jsonhandler.md throwingjsonhandler.md modules json.md index.js package.json assemblyscript README.md cli README.md asc.d.ts asc.js asc.json shim README.md fs.js path.js process.js transform.d.ts transform.js util colors.d.ts colors.js find.d.ts find.js mkdirp.d.ts mkdirp.js options.d.ts options.js utf8.d.ts utf8.js dist asc.js assemblyscript.d.ts assemblyscript.js sdk.js index.d.ts index.js lib loader README.md index.d.ts index.js package.json umd index.d.ts index.js package.json rtrace README.md bin rtplot.js index.d.ts index.js package.json umd index.d.ts index.js package.json package-lock.json package.json std README.md assembly.json assembly array.ts arraybuffer.ts atomics.ts bindings Date.ts Math.ts Reflect.ts asyncify.ts console.ts wasi.ts wasi_snapshot_preview1.ts wasi_unstable.ts builtins.ts compat.ts console.ts crypto.ts dataview.ts date.ts diagnostics.ts error.ts function.ts index.d.ts iterator.ts map.ts math.ts memory.ts number.ts object.ts polyfills.ts process.ts reference.ts regexp.ts rt.ts rt README.md common.ts index-incremental.ts index-minimal.ts index-stub.ts index.d.ts itcms.ts rtrace.ts stub.ts tcms.ts tlsf.ts set.ts shared feature.ts target.ts tsconfig.json typeinfo.ts staticarray.ts string.ts symbol.ts table.ts tsconfig.json typedarray.ts util casemap.ts error.ts hash.ts math.ts memory.ts number.ts sort.ts string.ts vector.ts wasi index.ts portable.json portable index.d.ts index.js types assembly index.d.ts package.json portable index.d.ts package.json tsconfig-base.json axios CHANGELOG.md README.md UPGRADE_GUIDE.md dist axios.js axios.min.js index.d.ts index.js lib adapters README.md http.js xhr.js axios.js cancel Cancel.js CancelToken.js isCancel.js core Axios.js InterceptorManager.js README.md buildFullPath.js createError.js dispatchRequest.js enhanceError.js mergeConfig.js settle.js transformData.js defaults.js helpers README.md bind.js buildURL.js combineURLs.js cookies.js deprecatedMethod.js isAbsoluteURL.js isURLSameOrigin.js normalizeHeaderName.js parseHeaders.js spread.js utils.js package.json balanced-match LICENSE.md README.md index.js package.json base-x LICENSE.md README.md package.json src index.d.ts index.js binary-install README.md example binary.js package.json run.js index.js package.json src binary.js binaryen README.md index.d.ts package-lock.json package.json wasm.d.ts bn.js CHANGELOG.md README.md lib bn.js package.json brace-expansion README.md index.js package.json bs58 CHANGELOG.md README.md index.js package.json camelcase index.d.ts index.js package.json readme.md chalk index.d.ts package.json readme.md source index.js templates.js util.js chownr README.md chownr.js package.json cliui CHANGELOG.md LICENSE.txt README.md build lib index.js string-utils.js package.json color-convert CHANGELOG.md README.md conversions.js index.js package.json route.js color-name README.md index.js package.json commander CHANGELOG.md Readme.md index.js package.json typings index.d.ts concat-map .travis.yml example map.js index.js package.json test map.js debug .coveralls.yml .travis.yml CHANGELOG.md README.md karma.conf.js node.js package.json src browser.js debug.js index.js node.js decamelize index.js package.json readme.md diff CONTRIBUTING.md README.md dist diff.js lib convert dmp.js xml.js diff array.js base.js character.js css.js json.js line.js sentence.js word.js index.es6.js index.js patch apply.js create.js merge.js parse.js util array.js distance-iterator.js params.js package.json release-notes.md runtime.js discontinuous-range .travis.yml README.md index.js package.json test main-test.js emoji-regex LICENSE-MIT.txt README.md es2015 index.js text.js index.d.ts index.js package.json text.js env-paths index.d.ts index.js package.json readme.md escalade dist index.js index.d.ts package.json readme.md sync index.d.ts index.js find-up index.d.ts index.js package.json readme.md follow-redirects README.md http.js https.js index.js package.json fs-minipass README.md index.js package.json fs.realpath README.md index.js old.js package.json get-caller-file LICENSE.md README.md index.d.ts index.js package.json glob README.md changelog.md common.js glob.js package.json sync.js has-flag index.d.ts index.js package.json readme.md hasurl README.md index.js package.json inflight README.md inflight.js package.json inherits README.md inherits.js inherits_browser.js package.json is-fullwidth-code-point index.d.ts index.js package.json readme.md js-base64 LICENSE.md README.md base64.d.ts base64.js package.json locate-path index.d.ts index.js package.json readme.md lodash.clonedeep README.md index.js package.json lodash.sortby README.md index.js package.json long README.md dist long.js index.js package.json src long.js minimatch README.md minimatch.js package.json minimist .travis.yml example parse.js index.js package.json test all_bool.js bool.js dash.js default_bool.js dotted.js kv_short.js long.js num.js parse.js parse_modified.js proto.js short.js stop_early.js unknown.js whitespace.js minipass README.md index.js package.json minizlib README.md constants.js index.js package.json mkdirp bin cmd.js usage.txt index.js package.json moo README.md moo.js package.json ms index.js license.md package.json readme.md near-mock-vm assembly __tests__ main.ts context.ts index.ts outcome.ts vm.ts bin bin.js package.json pkg near_mock_vm.d.ts near_mock_vm.js package.json vm dist cli.d.ts cli.js context.d.ts context.js index.d.ts index.js memory.d.ts memory.js runner.d.ts runner.js utils.d.ts utils.js index.js near-sdk-as as-pect.config.js as_types.d.ts asconfig.json asp.asconfig.json assembly __tests__ as-pect.d.ts assert.spec.ts avl-tree.spec.ts bignum.spec.ts contract.spec.ts contract.ts data.txt empty.ts generic.ts includeBytes.spec.ts main.ts max-heap.spec.ts model.ts near.spec.ts persistent-set.spec.ts promise.spec.ts rollback.spec.ts roundtrip.spec.ts runtime.spec.ts unordered-map.spec.ts util.ts utils.spec.ts as_types.d.ts bindgen.ts index.ts json.lib.ts tsconfig.json vm __tests__ vm.include.ts index.ts compiler.js imports.js package.json near-sdk-bindgen README.md assembly index.ts compiler.js dist JSONBuilder.d.ts JSONBuilder.js classExporter.d.ts classExporter.js index.d.ts index.js transformer.d.ts transformer.js typeChecker.d.ts typeChecker.js utils.d.ts utils.js index.js package.json near-sdk-core README.md asconfig.json assembly as_types.d.ts base58.ts base64.ts bignum.ts collections avlTree.ts index.ts maxHeap.ts persistentDeque.ts persistentMap.ts persistentSet.ts persistentUnorderedMap.ts persistentVector.ts util.ts contract.ts env env.ts index.ts runtime_api.ts index.ts logging.ts math.ts promise.ts storage.ts tsconfig.json util.ts docs assets css main.css js main.js search.json classes _sdk_core_assembly_collections_avltree_.avltree.html _sdk_core_assembly_collections_avltree_.avltreenode.html _sdk_core_assembly_collections_avltree_.childparentpair.html _sdk_core_assembly_collections_avltree_.nullable.html _sdk_core_assembly_collections_persistentdeque_.persistentdeque.html _sdk_core_assembly_collections_persistentmap_.persistentmap.html _sdk_core_assembly_collections_persistentset_.persistentset.html _sdk_core_assembly_collections_persistentunorderedmap_.persistentunorderedmap.html _sdk_core_assembly_collections_persistentvector_.persistentvector.html _sdk_core_assembly_contract_.context-1.html _sdk_core_assembly_contract_.contractpromise.html _sdk_core_assembly_contract_.contractpromiseresult.html _sdk_core_assembly_math_.rng.html _sdk_core_assembly_promise_.contractpromisebatch.html _sdk_core_assembly_storage_.storage-1.html globals.html index.html modules _sdk_core_assembly_base58_.base58.html _sdk_core_assembly_base58_.html _sdk_core_assembly_base64_.base64.html _sdk_core_assembly_base64_.html _sdk_core_assembly_collections_avltree_.html _sdk_core_assembly_collections_index_.collections.html _sdk_core_assembly_collections_index_.html _sdk_core_assembly_collections_persistentdeque_.html _sdk_core_assembly_collections_persistentmap_.html _sdk_core_assembly_collections_persistentset_.html _sdk_core_assembly_collections_persistentunorderedmap_.html _sdk_core_assembly_collections_persistentvector_.html _sdk_core_assembly_collections_util_.html _sdk_core_assembly_contract_.html _sdk_core_assembly_env_env_.env.html _sdk_core_assembly_env_env_.html _sdk_core_assembly_env_index_.html _sdk_core_assembly_env_runtime_api_.html _sdk_core_assembly_index_.html _sdk_core_assembly_logging_.html _sdk_core_assembly_logging_.logging.html _sdk_core_assembly_math_.html _sdk_core_assembly_math_.math.html _sdk_core_assembly_promise_.html _sdk_core_assembly_storage_.html _sdk_core_assembly_util_.html _sdk_core_assembly_util_.util.html package.json near-sdk-simulator __tests__ avl-tree-contract.spec.ts cross.spec.ts empty.spec.ts exportAs.spec.ts singleton-no-constructor.spec.ts singleton.spec.ts asconfig.js asconfig.json assembly __tests__ avlTreeContract.ts empty.ts exportAs.ts model.ts sentences.ts singleton-fail.ts singleton-no-constructor.ts singleton.ts words.ts as_types.d.ts tsconfig.json dist bin.d.ts bin.js context.d.ts context.js index.d.ts index.js runtime.d.ts runtime.js types.d.ts types.js utils.d.ts utils.js jest.config.js out assembly __tests__ exportAs.ts model.ts sentences.ts singleton-no-constructor.ts singleton.ts package.json src context.ts index.ts runtime.ts types.ts utils.ts tsconfig.json near-vm getBinary.js install.js package.json run.js uninstall.js nearley LICENSE.txt README.md bin nearley-railroad.js nearley-test.js nearley-unparse.js nearleyc.js lib compile.js generate.js lint.js nearley-language-bootstrapped.js nearley.js stream.js unparse.js package.json once README.md once.js package.json p-limit index.d.ts index.js package.json readme.md p-locate index.d.ts index.js package.json readme.md p-try index.d.ts index.js package.json readme.md path-exists index.d.ts index.js package.json readme.md path-is-absolute index.js package.json readme.md punycode LICENSE-MIT.txt README.md package.json punycode.es6.js punycode.js railroad-diagrams README.md example.html generator.html package.json railroad-diagrams.css railroad-diagrams.js railroad_diagrams.py randexp README.md lib randexp.js package.json require-directory .travis.yml index.js package.json require-main-filename CHANGELOG.md LICENSE.txt README.md index.js package.json ret README.md lib index.js positions.js sets.js types.js util.js package.json rimraf CHANGELOG.md README.md bin.js package.json rimraf.js safe-buffer README.md index.d.ts index.js package.json set-blocking CHANGELOG.md LICENSE.txt README.md index.js package.json string-width index.d.ts index.js package.json readme.md strip-ansi index.d.ts index.js package.json readme.md supports-color browser.js index.js package.json readme.md tar README.md index.js lib create.js extract.js get-write-flag.js header.js high-level-opt.js large-numbers.js list.js mkdir.js mode-fix.js pack.js parse.js path-reservations.js pax.js read-entry.js replace.js types.js unpack.js update.js warn-mixin.js winchars.js write-entry.js package.json tr46 LICENSE.md README.md index.js lib mappingTable.json regexes.js package.json ts-mixer CHANGELOG.md README.md dist decorator.d.ts decorator.js index.d.ts index.js mixin-tracking.d.ts mixin-tracking.js mixins.d.ts mixins.js proxy.d.ts proxy.js settings.d.ts settings.js types.d.ts types.js util.d.ts util.js package.json universal-url README.md browser.js index.js package.json visitor-as .github workflows test.yml README.md as index.d.ts index.js asconfig.json dist astBuilder.d.ts astBuilder.js base.d.ts base.js baseTransform.d.ts baseTransform.js decorator.d.ts decorator.js examples capitalize.d.ts capitalize.js exportAs.d.ts exportAs.js functionCallTransform.d.ts functionCallTransform.js includeBytesTransform.d.ts includeBytesTransform.js list.d.ts list.js index.d.ts index.js path.d.ts path.js simpleParser.d.ts simpleParser.js transformer.d.ts transformer.js utils.d.ts utils.js visitor.d.ts visitor.js package.json tsconfig.json webidl-conversions LICENSE.md README.md lib index.js package.json whatwg-url LICENSE.txt README.md lib URL-impl.js URL.js URLSearchParams-impl.js URLSearchParams.js infra.js public-api.js url-state-machine.js urlencoded.js utils.js package.json which-module CHANGELOG.md README.md index.js package.json wrap-ansi index.js package.json readme.md wrappy README.md package.json wrappy.js y18n CHANGELOG.md README.md build lib cjs.js index.js platform-shims node.js package.json yallist README.md iterator.js package.json yallist.js yargs-parser CHANGELOG.md LICENSE.txt README.md browser.js build lib index.js string-utils.js tokenize-arg-string.js yargs-parser-types.js yargs-parser.js package.json yargs CHANGELOG.md README.md build lib argsert.js command.js completion-templates.js completion.js middleware.js parse-command.js typings common-types.js yargs-parser-types.js usage.js utils apply-extends.js is-promise.js levenshtein.js obj-filter.js process-argv.js set-blocking.js which-module.js validation.js yargs-factory.js yerror.js helpers index.js package.json locales be.json de.json en.json es.json fi.json fr.json hi.json hu.json id.json it.json ja.json ko.json nb.json nl.json nn.json pirate.json pl.json pt.json pt_BR.json ru.json th.json tr.json zh_CN.json zh_TW.json package.json | package.json scripts 1.dev-deploy.sh 2.use-contract.sh 3.cleanup.sh README.md src as_types.d.ts simple __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts singleton __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts tsconfig.json utils.ts
# lodash.clonedeep v4.5.0 The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.clonedeep ``` In Node.js: ```js var cloneDeep = require('lodash.clonedeep'); ``` See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details. # ts-mixer [version-badge]: https://badgen.net/npm/v/ts-mixer [version-link]: https://npmjs.com/package/ts-mixer [build-badge]: https://img.shields.io/github/workflow/status/tannerntannern/ts-mixer/ts-mixer%20CI [build-link]: https://github.com/tannerntannern/ts-mixer/actions [ts-versions]: https://badgen.net/badge/icon/3.8,3.9,4.0?icon=typescript&label&list=| [node-versions]: https://badgen.net/badge/node/10%2C12%2C14/blue/?list=| [![npm version][version-badge]][version-link] [![github actions][build-badge]][build-link] [![TS Versions][ts-versions]][build-link] [![Node.js Versions][node-versions]][build-link] [![Minified Size](https://badgen.net/bundlephobia/min/ts-mixer)](https://bundlephobia.com/result?p=ts-mixer) [![Conventional Commits](https://badgen.net/badge/conventional%20commits/1.0.0/yellow)](https://conventionalcommits.org) ## Overview `ts-mixer` brings mixins to TypeScript. "Mixins" to `ts-mixer` are just classes, so you already know how to write them, and you can probably mix classes from your favorite library without trouble. The mixin problem is more nuanced than it appears. I've seen countless code snippets that work for certain situations, but fail in others. `ts-mixer` tries to take the best from all these solutions while accounting for the situations you might not have considered. [Quick start guide](#quick-start) ### Features * mixes plain classes * mixes classes that extend other classes * mixes classes that were mixed with `ts-mixer` * supports static properties * supports protected/private properties (the popular function-that-returns-a-class solution does not) * mixes abstract classes (with caveats [[1](#caveats)]) * mixes generic classes (with caveats [[2](#caveats)]) * supports class, method, and property decorators (with caveats [[3, 6](#caveats)]) * mostly supports the complexity presented by constructor functions (with caveats [[4](#caveats)]) * comes with an `instanceof`-like replacement (with caveats [[5, 6](#caveats)]) * [multiple mixing strategies](#settings) (ES6 proxies vs hard copy) ### Caveats 1. Mixing abstract classes requires a bit of a hack that may break in future versions of TypeScript. See [mixing abstract classes](#mixing-abstract-classes) below. 2. Mixing generic classes requires a more cumbersome notation, but it's still possible. See [mixing generic classes](#mixing-generic-classes) below. 3. Using decorators in mixed classes also requires a more cumbersome notation. See [mixing with decorators](#mixing-with-decorators) below. 4. ES6 made it impossible to use `.apply(...)` on class constructors (or any means of calling them without `new`), which makes it impossible for `ts-mixer` to pass the proper `this` to your constructors. This may or may not be an issue for your code, but there are options to work around it. See [dealing with constructors](#dealing-with-constructors) below. 5. `ts-mixer` does not support `instanceof` for mixins, but it does offer a replacement. See the [hasMixin function](#hasmixin) for more details. 6. Certain features (specifically, `@decorator` and `hasMixin`) make use of ES6 `Map`s, which means you must either use ES6+ or polyfill `Map` to use them. If you don't need these features, you should be fine without. ## Quick Start ### Installation ``` $ npm install ts-mixer ``` or if you prefer [Yarn](https://yarnpkg.com): ``` $ yarn add ts-mixer ``` ### Basic Example ```typescript import { Mixin } from 'ts-mixer'; class Foo { protected makeFoo() { return 'foo'; } } class Bar { protected makeBar() { return 'bar'; } } class FooBar extends Mixin(Foo, Bar) { public makeFooBar() { return this.makeFoo() + this.makeBar(); } } const fooBar = new FooBar(); console.log(fooBar.makeFooBar()); // "foobar" ``` ## Special Cases ### Mixing Abstract Classes Abstract classes, by definition, cannot be constructed, which means they cannot take on the type, `new(...args) => any`, and by extension, are incompatible with `ts-mixer`. BUT, you can "trick" TypeScript into giving you all the benefits of an abstract class without making it technically abstract. The trick is just some strategic `// @ts-ignore`'s: ```typescript import { Mixin } from 'ts-mixer'; // note that Foo is not marked as an abstract class class Foo { // @ts-ignore: "Abstract methods can only appear within an abstract class" public abstract makeFoo(): string; } class Bar { public makeBar() { return 'bar'; } } class FooBar extends Mixin(Foo, Bar) { // we still get all the benefits of abstract classes here, because TypeScript // will still complain if this method isn't implemented public makeFoo() { return 'foo'; } } ``` Do note that while this does work quite well, it is a bit of a hack and I can't promise that it will continue to work in future TypeScript versions. ### Mixing Generic Classes Frustratingly, it is _impossible_ for generic parameters to be referenced in base class expressions. No matter what, you will eventually run into `Base class expressions cannot reference class type parameters.` The way to get around this is to leverage [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html), and a slightly different mixing function from ts-mixer: `mix`. It works exactly like `Mixin`, except it's a decorator, which means it doesn't affect the type information of the class being decorated. See it in action below: ```typescript import { mix } from 'ts-mixer'; class Foo<T> { public fooMethod(input: T): T { return input; } } class Bar<T> { public barMethod(input: T): T { return input; } } interface FooBar<T1, T2> extends Foo<T1>, Bar<T2> { } @mix(Foo, Bar) class FooBar<T1, T2> { public fooBarMethod(input1: T1, input2: T2) { return [this.fooMethod(input1), this.barMethod(input2)]; } } ``` Key takeaways from this example: * `interface FooBar<T1, T2> extends Foo<T1>, Bar<T2> { }` makes sure `FooBar` has the typing we want, thanks to declaration merging * `@mix(Foo, Bar)` wires things up "on the JavaScript side", since the interface declaration has nothing to do with runtime behavior. * The reason we have to use the `mix` decorator is that the typing produced by `Mixin(Foo, Bar)` would conflict with the typing of the interface. `mix` has no effect "on the TypeScript side," thus avoiding type conflicts. ### Mixing with Decorators Popular libraries such as [class-validator](https://github.com/typestack/class-validator) and [TypeORM](https://github.com/typeorm/typeorm) use decorators to add functionality. Unfortunately, `ts-mixer` has no way of knowing what these libraries do with the decorators behind the scenes. So if you want these decorators to be "inherited" with classes you plan to mix, you first have to wrap them with a special `decorate` function exported by `ts-mixer`. Here's an example using `class-validator`: ```typescript import { IsBoolean, IsIn, validate } from 'class-validator'; import { Mixin, decorate } from 'ts-mixer'; class Disposable { @decorate(IsBoolean()) // instead of @IsBoolean() isDisposed: boolean = false; } class Statusable { @decorate(IsIn(['red', 'green'])) // instead of @IsIn(['red', 'green']) status: string = 'green'; } class ExtendedObject extends Mixin(Disposable, Statusable) {} const extendedObject = new ExtendedObject(); extendedObject.status = 'blue'; validate(extendedObject).then(errors => { console.log(errors); }); ``` ### Dealing with Constructors As mentioned in the [caveats section](#caveats), ES6 disallowed calling constructor functions without `new`. This means that the only way for `ts-mixer` to mix instance properties is to instantiate each base class separately, then copy the instance properties into a common object. The consequence of this is that constructors mixed by `ts-mixer` will _not_ receive the proper `this`. **This very well may not be an issue for you!** It only means that your constructors need to be "mostly pure" in terms of how they handle `this`. Specifically, your constructors cannot produce [side effects](https://en.wikipedia.org/wiki/Side_effect_%28computer_science%29) involving `this`, _other than adding properties to `this`_ (the most common side effect in JavaScript constructors). If you simply cannot eliminate `this` side effects from your constructor, there is a workaround available: `ts-mixer` will automatically forward constructor parameters to a predesignated init function (`settings.initFunction`) if it's present on the class. Unlike constructors, functions can be called with an arbitrary `this`, so this predesignated init function _will_ have the proper `this`. Here's a basic example: ```typescript import { Mixin, settings } from 'ts-mixer'; settings.initFunction = 'init'; class Person { public static allPeople: Set<Person> = new Set(); protected init() { Person.allPeople.add(this); } } type PartyAffiliation = 'democrat' | 'republican'; class PoliticalParticipant { public static democrats: Set<PoliticalParticipant> = new Set(); public static republicans: Set<PoliticalParticipant> = new Set(); public party: PartyAffiliation; // note that these same args will also be passed to init function public constructor(party: PartyAffiliation) { this.party = party; } protected init(party: PartyAffiliation) { if (party === 'democrat') PoliticalParticipant.democrats.add(this); else PoliticalParticipant.republicans.add(this); } } class Voter extends Mixin(Person, PoliticalParticipant) {} const v1 = new Voter('democrat'); const v2 = new Voter('democrat'); const v3 = new Voter('republican'); const v4 = new Voter('republican'); ``` Note the above `.add(this)` statements. These would not work as expected if they were placed in the constructor instead, since `this` is not the same between the constructor and `init`, as explained above. ## Other Features ### hasMixin As mentioned above, `ts-mixer` does not support `instanceof` for mixins. While it is possible to implement [custom `instanceof` behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance), this library does not do so because it would require modifying the source classes, which is deliberately avoided. You can fill this missing functionality with `hasMixin(instance, mixinClass)` instead. See the below example: ```typescript import { Mixin, hasMixin } from 'ts-mixer'; class Foo {} class Bar {} class FooBar extends Mixin(Foo, Bar) {} const instance = new FooBar(); // doesn't work with instanceof... console.log(instance instanceof FooBar) // true console.log(instance instanceof Foo) // false console.log(instance instanceof Bar) // false // but everything works nicely with hasMixin! console.log(hasMixin(instance, FooBar)) // true console.log(hasMixin(instance, Foo)) // true console.log(hasMixin(instance, Bar)) // true ``` `hasMixin(instance, mixinClass)` will work anywhere that `instance instanceof mixinClass` works. Additionally, like `instanceof`, you get the same [type narrowing benefits](https://www.typescriptlang.org/docs/handbook/advanced-types.html#instanceof-type-guards): ```typescript if (hasMixin(instance, Foo)) { // inferred type of instance is "Foo" } if (hasMixin(instance, Bar)) { // inferred type of instance of "Bar" } ``` ## Settings ts-mixer has multiple strategies for mixing classes which can be configured by modifying `settings` from ts-mixer. For example: ```typescript import { settings, Mixin } from 'ts-mixer'; settings.prototypeStrategy = 'proxy'; // then use `Mixin` as normal... ``` ### `settings.prototypeStrategy` * Determines how ts-mixer will mix class prototypes together * Possible values: - `'copy'` (default) - Copies all methods from the classes being mixed into a new prototype object. (This will include all methods up the prototype chains as well.) This is the default for ES5 compatibility, but it has the downside of stale references. For example, if you mix `Foo` and `Bar` to make `FooBar`, then redefine a method on `Foo`, `FooBar` will not have the latest methods from `Foo`. If this is not a concern for you, `'copy'` is the best value for this setting. - `'proxy'` - Uses an ES6 Proxy to "soft mix" prototypes. Unlike `'copy'`, updates to the base classes _will_ be reflected in the mixed class, which may be desirable. The downside is that method access is not as performant, nor is it ES5 compatible. ### `settings.staticsStrategy` * Determines how static properties are inherited * Possible values: - `'copy'` (default) - Simply copies all properties (minus `prototype`) from the base classes/constructor functions onto the mixed class. Like `settings.prototypeStrategy = 'copy'`, this strategy also suffers from stale references, but shouldn't be a concern if you don't redefine static methods after mixing. - `'proxy'` - Similar to `settings.prototypeStrategy`, proxy's static method access to base classes. Has the same benefits/downsides. ### `settings.initFunction` * If set, `ts-mixer` will automatically call the function with this name upon construction * Possible values: - `null` (default) - disables the behavior - a string - function name to call upon construction * Read more about why you would want this in [dealing with constructors](#dealing-with-constructors) ### `settings.decoratorInheritance` * Determines how decorators are inherited from classes passed to `Mixin(...)` * Possible values: - `'deep'` (default) - Deeply inherits decorators from all given classes and their ancestors - `'direct'` - Only inherits decorators defined directly on the given classes - `'none'` - Skips decorator inheritance # Author Tanner Nielsen <tannerntannern@gmail.com> * Website - [tannernielsen.com](http://tannernielsen.com) * Github - [tannerntannern](https://github.com/tannerntannern) # Regular Expression Tokenizer Tokenizes strings that represent a regular expressions. [![Build Status](https://secure.travis-ci.org/fent/ret.js.svg)](http://travis-ci.org/fent/ret.js) [![Dependency Status](https://david-dm.org/fent/ret.js.svg)](https://david-dm.org/fent/ret.js) [![codecov](https://codecov.io/gh/fent/ret.js/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/ret.js) # Usage ```js var ret = require('ret'); var tokens = ret(/foo|bar/.source); ``` `tokens` will contain the following object ```js { "type": ret.types.ROOT "options": [ [ { "type": ret.types.CHAR, "value", 102 }, { "type": ret.types.CHAR, "value", 111 }, { "type": ret.types.CHAR, "value", 111 } ], [ { "type": ret.types.CHAR, "value", 98 }, { "type": ret.types.CHAR, "value", 97 }, { "type": ret.types.CHAR, "value", 114 } ] ] } ``` # Token Types `ret.types` is a collection of the various token types exported by ret. ### ROOT Only used in the root of the regexp. This is needed due to the posibility of the root containing a pipe `|` character. In that case, the token will have an `options` key that will be an array of arrays of tokens. If not, it will contain a `stack` key that is an array of tokens. ```js { "type": ret.types.ROOT, "stack": [token1, token2...], } ``` ```js { "type": ret.types.ROOT, "options" [ [token1, token2...], [othertoken1, othertoken2...] ... ], } ``` ### GROUP Groups contain tokens that are inside of a parenthesis. If the group begins with `?` followed by another character, it's a special type of group. A ':' tells the group not to be remembered when `exec` is used. '=' means the previous token matches only if followed by this group, and '!' means the previous token matches only if NOT followed. Like root, it can contain an `options` key instead of `stack` if there is a pipe. ```js { "type": ret.types.GROUP, "remember" true, "followedBy": false, "notFollowedBy": false, "stack": [token1, token2...], } ``` ```js { "type": ret.types.GROUP, "remember" true, "followedBy": false, "notFollowedBy": false, "options" [ [token1, token2...], [othertoken1, othertoken2...] ... ], } ``` ### POSITION `\b`, `\B`, `^`, and `$` specify positions in the regexp. ```js { "type": ret.types.POSITION, "value": "^", } ``` ### SET Contains a key `set` specifying what tokens are allowed and a key `not` specifying if the set should be negated. A set can contain other sets, ranges, and characters. ```js { "type": ret.types.SET, "set": [token1, token2...], "not": false, } ``` ### RANGE Used in set tokens to specify a character range. `from` and `to` are character codes. ```js { "type": ret.types.RANGE, "from": 97, "to": 122, } ``` ### REPETITION ```js { "type": ret.types.REPETITION, "min": 0, "max": Infinity, "value": token, } ``` ### REFERENCE References a group token. `value` is 1-9. ```js { "type": ret.types.REFERENCE, "value": 1, } ``` ### CHAR Represents a single character token. `value` is the character code. This might seem a bit cluttering instead of concatenating characters together. But since repetition tokens only repeat the last token and not the last clause like the pipe, it's simpler to do it this way. ```js { "type": ret.types.CHAR, "value": 123, } ``` ## Errors ret.js will throw errors if given a string with an invalid regular expression. All possible errors are * Invalid group. When a group with an immediate `?` character is followed by an invalid character. It can only be followed by `!`, `=`, or `:`. Example: `/(?_abc)/` * Nothing to repeat. Thrown when a repetitional token is used as the first token in the current clause, as in right in the beginning of the regexp or group, or right after a pipe. Example: `/foo|?bar/`, `/{1,3}foo|bar/`, `/foo(+bar)/` * Unmatched ). A group was not opened, but was closed. Example: `/hello)2u/` * Unterminated group. A group was not closed. Example: `/(1(23)4/` * Unterminated character class. A custom character set was not closed. Example: `/[abc/` # Install npm install ret # Tests Tests are written with [vows](http://vowsjs.org/) ```bash npm test ``` # License MIT # axios // helpers The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: - Browser polyfills - Managing cookies - Parsing HTTP headers # [nearley](http://nearley.js.org) ↗️ [![JS.ORG](https://img.shields.io/badge/js.org-nearley-ffb400.svg?style=flat-square)](http://js.org) [![npm version](https://badge.fury.io/js/nearley.svg)](https://badge.fury.io/js/nearley) nearley is a simple, fast and powerful parsing toolkit. It consists of: 1. [A powerful, modular DSL for describing languages](https://nearley.js.org/docs/grammar) 2. [An efficient, lightweight Earley parser](https://nearley.js.org/docs/parser) 3. [Loads of tools, editor plug-ins, and other goodies!](https://nearley.js.org/docs/tooling) nearley is a **streaming** parser with support for catching **errors** gracefully and providing _all_ parsings for **ambiguous** grammars. It is compatible with a variety of **lexers** (we recommend [moo](http://github.com/tjvr/moo)). It comes with tools for creating **tests**, **railroad diagrams** and **fuzzers** from your grammars, and has support for a variety of editors and platforms. It works in both node and the browser. Unlike most other parser generators, nearley can handle *any* grammar you can define in BNF (and more!). In particular, while most existing JS parsers such as PEGjs and Jison choke on certain grammars (e.g. [left recursive ones](http://en.wikipedia.org/wiki/Left_recursion)), nearley handles them easily and efficiently by using the [Earley parsing algorithm](https://en.wikipedia.org/wiki/Earley_parser). nearley is used by a wide variety of projects: - [artificial intelligence](https://github.com/ChalmersGU-AI-course/shrdlite-course-project) and - [computational linguistics](https://wiki.eecs.yorku.ca/course_archive/2014-15/W/6339/useful_handouts) classes at universities; - [file format parsers](https://github.com/raymond-h/node-dmi); - [data-driven markup languages](https://github.com/idyll-lang/idyll-compiler); - [compilers for real-world programming languages](https://github.com/sizigi/lp5562); - and nearley itself! The nearley compiler is bootstrapped. nearley is an npm [staff pick](https://www.npmjs.com/package/npm-collection-staff-picks). ## Documentation Please visit our website https://nearley.js.org to get started! You will find a tutorial, detailed reference documents, and links to several real-world examples to get inspired. ## Contributing Please read [this document](.github/CONTRIBUTING.md) *before* working on nearley. If you are interested in contributing but unsure where to start, take a look at the issues labeled "up for grabs" on the issue tracker, or message a maintainer (@kach or @tjvr on Github). nearley is MIT licensed. A big thanks to Nathan Dinsmore for teaching me how to Earley, Aria Stewart for helping structure nearley into a mature module, and Robin Windels for bootstrapping the grammar. Additionally, Jacob Edelman wrote an experimental JavaScript parser with nearley and contributed ideas for EBNF support. Joshua T. Corbin refactored the compiler to be much, much prettier. Bojidar Marinov implemented postprocessors-in-other-languages. Shachar Itzhaky fixed a subtle bug with nullables. ## Citing nearley If you are citing nearley in academic work, please use the following BibTeX entry. ```bibtex @misc{nearley, author = "Kartik Chandra and Tim Radvan", title = "{nearley}: a parsing toolkit for {JavaScript}", year = {2014}, doi = {10.5281/zenodo.3897993}, url = {https://github.com/kach/nearley} } ``` # require-main-filename [![Build Status](https://travis-ci.org/yargs/require-main-filename.png)](https://travis-ci.org/yargs/require-main-filename) [![Coverage Status](https://coveralls.io/repos/yargs/require-main-filename/badge.svg?branch=master)](https://coveralls.io/r/yargs/require-main-filename?branch=master) [![NPM version](https://img.shields.io/npm/v/require-main-filename.svg)](https://www.npmjs.com/package/require-main-filename) `require.main.filename` is great for figuring out the entry point for the current application. This can be combined with a module like [pkg-conf](https://www.npmjs.com/package/pkg-conf) to, _as if by magic_, load top-level configuration. Unfortunately, `require.main.filename` sometimes fails when an application is executed with an alternative process manager, e.g., [iisnode](https://github.com/tjanczuk/iisnode). `require-main-filename` is a shim that addresses this problem. ## Usage ```js var main = require('require-main-filename')() // use main as an alternative to require.main.filename. ``` ## License ISC Railroad-diagram Generator ========================== This is a small js library for generating railroad diagrams (like what [JSON.org](http://json.org) uses) using SVG. Railroad diagrams are a way of visually representing a grammar in a form that is more readable than using regular expressions or BNF. I think (though I haven't given it a lot of thought yet) that if it's easy to write a context-free grammar for the language, the corresponding railroad diagram will be easy as well. There are several railroad-diagram generators out there, but none of them had the visual appeal I wanted. [Here's an example of how they look!](http://www.xanthir.com/etc/railroad-diagrams/example.html) And [here's an online generator for you to play with and get SVG code from!](http://www.xanthir.com/etc/railroad-diagrams/generator.html) The library now exists in a Python port as well! See the information further down. Details ------- To use the library, just include the js and css files, and then call the Diagram() function. Its arguments are the components of the diagram (Diagram is a special form of Sequence). An alternative to Diagram() is ComplexDiagram() which is used to describe a complex type diagram. Components are either leaves or containers. The leaves: * Terminal(text) or a bare string - represents literal text * NonTerminal(text) - represents an instruction or another production * Comment(text) - a comment * Skip() - an empty line The containers: * Sequence(children) - like simple concatenation in a regex * Choice(index, children) - like | in a regex. The index argument specifies which child is the "normal" choice and should go in the middle * Optional(child, skip) - like ? in a regex. A shorthand for `Choice(1, [Skip(), child])`. If the optional `skip` parameter has the value `"skip"`, it instead puts the Skip() in the straight-line path, for when the "normal" behavior is to omit the item. * OneOrMore(child, repeat) - like + in a regex. The 'repeat' argument is optional, and specifies something that must go between the repetitions. * ZeroOrMore(child, repeat, skip) - like * in a regex. A shorthand for `Optional(OneOrMore(child, repeat))`. The optional `skip` parameter is identical to Optional(). For convenience, each component can be called with or without `new`. If called without `new`, the container components become n-ary; that is, you can say either `new Sequence([A, B])` or just `Sequence(A,B)`. After constructing a Diagram, call `.format(...padding)` on it, specifying 0-4 padding values (just like CSS) for some additional "breathing space" around the diagram (the paddings default to 20px). The result can either be `.toString()`'d for the markup, or `.toSVG()`'d for an `<svg>` element, which can then be immediately inserted to the document. As a convenience, Diagram also has an `.addTo(element)` method, which immediately converts it to SVG and appends it to the referenced element with default paddings. `element` defaults to `document.body`. Options ------- There are a few options you can tweak, at the bottom of the file. Just tweak either until the diagram looks like what you want. You can also change the CSS file - feel free to tweak to your heart's content. Note, though, that if you change the text sizes in the CSS, you'll have to go adjust the metrics for the leaf nodes as well. * VERTICAL_SEPARATION - sets the minimum amount of vertical separation between two items. Note that the stroke width isn't counted when computing the separation; this shouldn't be relevant unless you have a very small separation or very large stroke width. * ARC_RADIUS - the radius of the arcs used in the branching containers like Choice. This has a relatively large effect on the size of non-trivial diagrams. Both tight and loose values look good, depending on what you're going for. * DIAGRAM_CLASS - the class set on the root `<svg>` element of each diagram, for use in the CSS stylesheet. * STROKE_ODD_PIXEL_LENGTH - the default stylesheet uses odd pixel lengths for 'stroke'. Due to rasterization artifacts, they look best when the item has been translated half a pixel in both directions. If you change the styling to use a stroke with even pixel lengths, you'll want to set this variable to `false`. * INTERNAL_ALIGNMENT - when some branches of a container are narrower than others, this determines how they're aligned in the extra space. Defaults to "center", but can be set to "left" or "right". Caveats ------- At this early stage, the generator is feature-complete and works as intended, but still has several TODOs: * The font-sizes are hard-coded right now, and the font handling in general is very dumb - I'm just guessing at some metrics that are probably "good enough" rather than measuring things properly. Python Port ----------- In addition to the canonical JS version, the library now exists as a Python library as well. Using it is basically identical. The config variables are globals in the file, and so may be adjusted either manually or via tweaking from inside your program. The main difference from the JS port is how you extract the string from the Diagram. You'll find a `writeSvg(writerFunc)` method on `Diagram`, which takes a callback of one argument and passes it the string form of the diagram. For example, it can be used like `Diagram(...).writeSvg(sys.stdout.write)` to write to stdout. **Note**: the callback will be called multiple times as it builds up the string, not just once with the whole thing. If you need it all at once, consider something like a `StringIO` as an easy way to collect it into a single string. License ------- This document and all associated files in the github project are licensed under [CC0](http://creativecommons.org/publicdomain/zero/1.0/) ![](http://i.creativecommons.org/p/zero/1.0/80x15.png). This means you can reuse, remix, or otherwise appropriate this project for your own use **without restriction**. (The actual legal meaning can be found at the above link.) Don't ask me for permission to use any part of this project, **just use it**. I would appreciate attribution, but that is not required by the license. bs58 ==== [![build status](https://travis-ci.org/cryptocoinjs/bs58.svg)](https://travis-ci.org/cryptocoinjs/bs58) JavaScript component to compute base 58 encoding. This encoding is typically used for crypto currencies such as Bitcoin. **Note:** If you're looking for **base 58 check** encoding, see: [https://github.com/bitcoinjs/bs58check](https://github.com/bitcoinjs/bs58check), which depends upon this library. Install ------- npm i --save bs58 API --- ### encode(input) `input` must be a [Buffer](https://nodejs.org/api/buffer.html) or an `Array`. It returns a `string`. **example**: ```js const bs58 = require('bs58') const bytes = Buffer.from('003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187', 'hex') const address = bs58.encode(bytes) console.log(address) // => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS ``` ### decode(input) `input` must be a base 58 encoded string. Returns a [Buffer](https://nodejs.org/api/buffer.html). **example**: ```js const bs58 = require('bs58') const address = '16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS' const bytes = bs58.decode(address) console.log(out.toString('hex')) // => 003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187 ``` Hack / Test ----------- Uses JavaScript standard style. Read more: [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) Credits ------- - [Mike Hearn](https://github.com/mikehearn) for original Java implementation - [Stefan Thomas](https://github.com/justmoon) for porting to JavaScript - [Stephan Pair](https://github.com/gasteve) for buffer improvements - [Daniel Cousens](https://github.com/dcousens) for cleanup and merging improvements from bitcoinjs-lib - [Jared Deckard](https://github.com/deckar01) for killing `bigi` as a dependency License ------- MIT # universal-url [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url] > WHATWG [`URL`](https://developer.mozilla.org/en/docs/Web/API/URL) for Node & Browser. * For Node.js versions `>= 8`, the native implementation will be used. * For Node.js versions `< 8`, a [shim](https://npmjs.com/whatwg-url) will be used. * For web browsers without a native implementation, the same shim will be used. ## Installation [Node.js](http://nodejs.org/) `>= 6` is required. To install, type this at the command line: ```shell npm install universal-url ``` ## Usage ```js const {URL, URLSearchParams} = require('universal-url'); const url = new URL('http://domain/'); const params = new URLSearchParams('?param=value'); ``` Global shim: ```js require('universal-url').shim(); const url = new URL('http://domain/'); const params = new URLSearchParams('?param=value'); ``` ## Browserify/etc The bundled file size of this library can be large for a web browser. If this is a problem, try using [universal-url-lite](https://npmjs.com/universal-url-lite) in your build as an alias for this module. [npm-image]: https://img.shields.io/npm/v/universal-url.svg [npm-url]: https://npmjs.org/package/universal-url [travis-image]: https://img.shields.io/travis/stevenvachon/universal-url.svg [travis-url]: https://travis-ci.org/stevenvachon/universal-url [greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/universal-url.svg [greenkeeper-url]: https://greenkeeper.io/ # set-blocking [![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking) [![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking) [![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) set blocking `stdio` and `stderr` ensuring that terminal output does not truncate. ```js const setBlocking = require('set-blocking') setBlocking(true) console.log(someLargeStringToOutput) ``` ## Historical Context/Word of Warning This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on newer versions of Node.js (`0.12+`), truncating terminal output. You should be mindful of the side-effects caused by using `set-blocking`: * if your module sets blocking to `true`, it will effect other modules consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call `setBlocking(true)` once we already know we are about to call `process.exit(code)`. * this patch will not apply to subprocesses spawned with `isTTY = true`, this is the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). ## License ISC # hasurl [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] > Determine whether Node.js' native [WHATWG `URL`](https://nodejs.org/api/url.html#url_the_whatwg_url_api) implementation is available. ## Installation [Node.js](http://nodejs.org/) `>= 4` is required. To install, type this at the command line: ```shell npm install hasurl ``` ## Usage ```js const hasURL = require('hasurl'); if (hasURL()) { // supported } else { // fallback } ``` [npm-image]: https://img.shields.io/npm/v/hasurl.svg [npm-url]: https://npmjs.org/package/hasurl [travis-image]: https://img.shields.io/travis/stevenvachon/hasurl.svg [travis-url]: https://travis-ci.org/stevenvachon/hasurl <p align="center"> <img width="250" src="https://raw.githubusercontent.com/yargs/yargs/master/yargs-logo.png"> </p> <h1 align="center"> Yargs </h1> <p align="center"> <b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b> </p> <br> ![ci](https://github.com/yargs/yargs/workflows/ci/badge.svg) [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] [![Coverage][coverage-image]][coverage-url] [![Conventional Commits][conventional-commits-image]][conventional-commits-url] [![Slack][slack-image]][slack-url] ## Description Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It gives you: * commands and (grouped) options (`my-program.js serve --port=5000`). * a dynamically generated help menu based on your arguments: ``` mocha [spec..] Run tests with Mocha Commands mocha inspect [spec..] Run tests with Mocha [default] mocha init <path> create a client-side Mocha setup at <path> Rules & Behavior --allow-uncaught Allow uncaught errors to propagate [boolean] --async-only, -A Require all tests to use a callback (async) or return a Promise [boolean] ``` * bash-completion shortcuts for commands and options. * and [tons more](/docs/api.md). ## Installation Stable version: ```bash npm i yargs ``` Bleeding edge version with the most recent features: ```bash npm i yargs@next ``` ## Usage ### Simple Example ```javascript #!/usr/bin/env node const yargs = require('yargs/yargs') const { hideBin } = require('yargs/helpers') const argv = yargs(hideBin(process.argv)).argv if (argv.ships > 3 && argv.distance < 53.5) { console.log('Plunder more riffiwobbles!') } else { console.log('Retreat from the xupptumblers!') } ``` ```bash $ ./plunder.js --ships=4 --distance=22 Plunder more riffiwobbles! $ ./plunder.js --ships 12 --distance 98.7 Retreat from the xupptumblers! ``` ### Complex Example ```javascript #!/usr/bin/env node const yargs = require('yargs/yargs') const { hideBin } = require('yargs/helpers') yargs(hideBin(process.argv)) .command('serve [port]', 'start the server', (yargs) => { yargs .positional('port', { describe: 'port to bind on', default: 5000 }) }, (argv) => { if (argv.verbose) console.info(`start server on :${argv.port}`) serve(argv.port) }) .option('verbose', { alias: 'v', type: 'boolean', description: 'Run with verbose logging' }) .argv ``` Run the example above with `--help` to see the help for the application. ## Supported Platforms ### TypeScript yargs has type definitions at [@types/yargs][type-definitions]. ``` npm i @types/yargs --save-dev ``` See usage examples in [docs](/docs/typescript.md). ### Deno As of `v16`, `yargs` supports [Deno](https://github.com/denoland/deno): ```typescript import yargs from 'https://deno.land/x/yargs/deno.ts' import { Arguments } from 'https://deno.land/x/yargs/deno-types.ts' yargs(Deno.args) .command('download <files...>', 'download a list of files', (yargs: any) => { return yargs.positional('files', { describe: 'a list of files to do something with' }) }, (argv: Arguments) => { console.info(argv) }) .strictCommands() .demandCommand(1) .argv ``` ### ESM As of `v16`,`yargs` supports ESM imports: ```js import yargs from 'yargs' import { hideBin } from 'yargs/helpers' yargs(hideBin(process.argv)) .command('curl <url>', 'fetch the contents of the URL', () => {}, (argv) => { console.info(argv) }) .demandCommand(1) .argv ``` ### Usage in Browser See examples of using yargs in the browser in [docs](/docs/browser.md). ## Community Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). ## Documentation ### Table of Contents * [Yargs' API](/docs/api.md) * [Examples](/docs/examples.md) * [Parsing Tricks](/docs/tricks.md) * [Stop the Parser](/docs/tricks.md#stop) * [Negating Boolean Arguments](/docs/tricks.md#negate) * [Numbers](/docs/tricks.md#numbers) * [Arrays](/docs/tricks.md#arrays) * [Objects](/docs/tricks.md#objects) * [Quotes](/docs/tricks.md#quotes) * [Advanced Topics](/docs/advanced.md) * [Composing Your App Using Commands](/docs/advanced.md#commands) * [Building Configurable CLI Apps](/docs/advanced.md#configuration) * [Customizing Yargs' Parser](/docs/advanced.md#customizing) * [Bundling yargs](/docs/bundling.md) * [Contributing](/contributing.md) ## Supported Node.js Versions Libraries in this ecosystem make a best effort to track [Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). [npm-url]: https://www.npmjs.com/package/yargs [npm-image]: https://img.shields.io/npm/v/yargs.svg [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: http://standardjs.com/ [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg [conventional-commits-url]: https://conventionalcommits.org/ [slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg [slack-url]: http://devtoolscommunity.herokuapp.com [type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs [coverage-image]: https://img.shields.io/nycrc/yargs/yargs [coverage-url]: https://github.com/yargs/yargs/blob/master/.nycrc # yargs-parser [![Build Status](https://travis-ci.org/yargs/yargs-parser.svg)](https://travis-ci.org/yargs/yargs-parser) [![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) The mighty option parser used by [yargs](https://github.com/yargs/yargs). visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. <img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/master/yargs-logo.png"> ## Example ```sh npm i yargs-parser --save ``` ```js var argv = require('yargs-parser')(process.argv.slice(2)) console.log(argv) ``` ```sh node example.js --foo=33 --bar hello { _: [], foo: 33, bar: 'hello' } ``` _or parse a string!_ ```js var argv = require('yargs-parser')('--foo=99 --bar=33') console.log(argv) ``` ```sh { _: [], foo: 99, bar: 33 } ``` Convert an array of mixed types before passing to `yargs-parser`: ```js var parse = require('yargs-parser') parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings ``` ## API ### require('yargs-parser')(args, opts={}) Parses command line arguments returning a simple mapping of keys and values. **expects:** * `args`: a string or array of strings representing the options to parse. * `opts`: provide a set of hints indicating how `args` should be parsed: * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.<br> Indicate that keys should be parsed as an array and coerced to booleans / numbers:<br> `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided (or throws an error). For arrays the function is called only once for the entire array:<br> `{coerce: {foo: function (arg) {return modifiedArg}}}`. * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:<br> `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. * `opts.normalize`: `path.normalize()` will be applied to values set to this key. * `opts.number`: keys should be treated as numbers. * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). **returns:** * `obj`: an object representing the parsed value of `args` * `key/value`: key value pairs for each argument and their aliases. * `_`: an array representing the positional arguments. * [optional] `--`: an array with arguments after the end-of-options flag `--`. ### require('yargs-parser').detailed(args, opts={}) Parses a command line string, returning detailed information required by the yargs engine. **expects:** * `args`: a string or array of strings representing options to parse. * `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. **returns:** * `argv`: an object representing the parsed value of `args` * `key/value`: key value pairs for each argument and their aliases. * `_`: an array representing the positional arguments. * [optional] `--`: an array with arguments after the end-of-options flag `--`. * `error`: populated with an error object if an exception occurred during parsing. * `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. * `newAliases`: any new aliases added via camel-case expansion: * `boolean`: `{ fooBar: true }` * `defaulted`: any new argument created by `opts.default`, no aliases included. * `boolean`: `{ foo: true }` * `configuration`: given by default settings and `opts.configuration`. <a name="configuration"></a> ### Configuration The yargs-parser applies several automated transformations on the keys provided in `args`. These features can be turned on and off using the `configuration` field of `opts`. ```js var parsed = parser(['--no-dice'], { configuration: { 'boolean-negation': false } }) ``` ### short option groups * default: `true`. * key: `short-option-groups`. Should a group of short-options be treated as boolean flags? ```sh node example.js -abc { _: [], a: true, b: true, c: true } ``` _if disabled:_ ```sh node example.js -abc { _: [], abc: true } ``` ### camel-case expansion * default: `true`. * key: `camel-case-expansion`. Should hyphenated arguments be expanded into camel-case aliases? ```sh node example.js --foo-bar { _: [], 'foo-bar': true, fooBar: true } ``` _if disabled:_ ```sh node example.js --foo-bar { _: [], 'foo-bar': true } ``` ### dot-notation * default: `true` * key: `dot-notation` Should keys that contain `.` be treated as objects? ```sh node example.js --foo.bar { _: [], foo: { bar: true } } ``` _if disabled:_ ```sh node example.js --foo.bar { _: [], "foo.bar": true } ``` ### parse numbers * default: `true` * key: `parse-numbers` Should keys that look like numbers be treated as such? ```sh node example.js --foo=99.3 { _: [], foo: 99.3 } ``` _if disabled:_ ```sh node example.js --foo=99.3 { _: [], foo: "99.3" } ``` ### boolean negation * default: `true` * key: `boolean-negation` Should variables prefixed with `--no` be treated as negations? ```sh node example.js --no-foo { _: [], foo: false } ``` _if disabled:_ ```sh node example.js --no-foo { _: [], "no-foo": true } ``` ### combine arrays * default: `false` * key: `combine-arrays` Should arrays be combined when provided by both command line arguments and a configuration file. ### duplicate arguments array * default: `true` * key: `duplicate-arguments-array` Should arguments be coerced into an array when duplicated: ```sh node example.js -x 1 -x 2 { _: [], x: [1, 2] } ``` _if disabled:_ ```sh node example.js -x 1 -x 2 { _: [], x: 2 } ``` ### flatten duplicate arrays * default: `true` * key: `flatten-duplicate-arrays` Should array arguments be coerced into a single array when duplicated: ```sh node example.js -x 1 2 -x 3 4 { _: [], x: [1, 2, 3, 4] } ``` _if disabled:_ ```sh node example.js -x 1 2 -x 3 4 { _: [], x: [[1, 2], [3, 4]] } ``` ### greedy arrays * default: `true` * key: `greedy-arrays` Should arrays consume more than one positional argument following their flag. ```sh node example --arr 1 2 { _[], arr: [1, 2] } ``` _if disabled:_ ```sh node example --arr 1 2 { _[2], arr: [1] } ``` **Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** ### nargs eats options * default: `false` * key: `nargs-eats-options` Should nargs consume dash options as well as positional arguments. ### negation prefix * default: `no-` * key: `negation-prefix` The prefix to use for negated boolean variables. ```sh node example.js --no-foo { _: [], foo: false } ``` _if set to `quux`:_ ```sh node example.js --quuxfoo { _: [], foo: false } ``` ### populate -- * default: `false`. * key: `populate--` Should unparsed flags be stored in `--` or `_`. _If disabled:_ ```sh node example.js a -b -- x y { _: [ 'a', 'x', 'y' ], b: true } ``` _If enabled:_ ```sh node example.js a -b -- x y { _: [ 'a' ], '--': [ 'x', 'y' ], b: true } ``` ### set placeholder key * default: `false`. * key: `set-placeholder-key`. Should a placeholder be added for keys not set via the corresponding CLI argument? _If disabled:_ ```sh node example.js -a 1 -c 2 { _: [], a: 1, c: 2 } ``` _If enabled:_ ```sh node example.js -a 1 -c 2 { _: [], a: 1, b: undefined, c: 2 } ``` ### halt at non-option * default: `false`. * key: `halt-at-non-option`. Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. _If disabled:_ ```sh node example.js -a run b -x y { _: [ 'b' ], a: 'run', x: 'y' } ``` _If enabled:_ ```sh node example.js -a run b -x y { _: [ 'b', '-x', 'y' ], a: 'run' } ``` ### strip aliased * default: `false` * key: `strip-aliased` Should aliases be removed before returning results? _If disabled:_ ```sh node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } ``` _If enabled:_ ```sh node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1 } ``` ### strip dashed * default: `false` * key: `strip-dashed` Should dashed keys be removed before returning results? This option has no effect if `camel-case-expansion` is disabled. _If disabled:_ ```sh node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1 } ``` _If enabled:_ ```sh node example.js --test-field 1 { _: [], testField: 1 } ``` ### unknown options as args * default: `false` * key: `unknown-options-as-args` Should unknown options be treated like regular arguments? An unknown option is one that is not configured in `opts`. _If disabled_ ```sh node example.js --unknown-option --known-option 2 --string-option --unknown-option2 { _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } ``` _If enabled_ ```sh node example.js --unknown-option --known-option 2 --string-option --unknown-option2 { _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } ``` ## Special Thanks The yargs project evolves from optimist and minimist. It owes its existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ ## License ISC Shims used when bundling asc for browser usage. Standard library ================ Standard library components for use with `tsc` (portable) and `asc` (assembly). Base configurations (.json) and definition files (.d.ts) are relevant to `tsc` only and not used by `asc`. # color-convert [![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) Color-convert is a color conversion library for JavaScript and node. It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): ```js var convert = require('color-convert'); convert.rgb.hsl(140, 200, 100); // [96, 48, 59] convert.keyword.rgb('blue'); // [0, 0, 255] var rgbChannels = convert.rgb.channels; // 3 var cmykChannels = convert.cmyk.channels; // 4 var ansiChannels = convert.ansi16.channels; // 1 ``` # Install ```console $ npm install color-convert ``` # API Simply get the property of the _from_ and _to_ conversion that you're looking for. All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). ```js var convert = require('color-convert'); // Hex to LAB convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] // RGB to CMYK convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] ``` ### Arrays All functions that accept multiple arguments also support passing an array. Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) ```js var convert = require('color-convert'); convert.rgb.hex(123, 45, 67); // '7B2D43' convert.rgb.hex([123, 45, 67]); // '7B2D43' ``` ## Routing Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). # Contribute If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. # License Copyright &copy; 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). # inflight Add callbacks to requests in flight to avoid async duplication ## USAGE ```javascript var inflight = require('inflight') // some request that does some stuff function req(key, callback) { // key is any random string. like a url or filename or whatever. // // will return either a falsey value, indicating that the // request for this key is already in flight, or a new callback // which when called will call all callbacks passed to inflightk // with the same key callback = inflight(key, callback) // If we got a falsey value back, then there's already a req going if (!callback) return // this is where you'd fetch the url or whatever // callback is also once()-ified, so it can safely be assigned // to multiple events etc. First call wins. setTimeout(function() { callback(null, key) }, 100) } // only assigns a single setTimeout // when it dings, all cbs get called req('foo', cb1) req('foo', cb2) req('foo', cb3) req('foo', cb4) ``` # balanced-match Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well! [![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) [![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) [![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) ## Example Get the first matching pair of braces: ```js var balanced = require('balanced-match'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); ``` The matches are: ```bash $ node example.js { start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } { start: 3, end: 9, pre: 'pre', body: 'first', post: 'between{second}post' } { start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } ``` ## API ### var m = balanced(a, b, str) For the first non-nested matching pair of `a` and `b` in `str`, return an object with those keys: * **start** the index of the first match of `a` * **end** the index of the matching `b` * **pre** the preamble, `a` and `b` not included * **body** the match, `a` and `b` not included * **post** the postscript, `a` and `b` not included If there's no match, `undefined` will be returned. If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) For the first non-nested matching pair of `a` and `b` in `str`, return an array with indexes: `[ <a index>, <b index> ]`. If there's no match, `undefined` will be returned. If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation With [npm](https://npmjs.org) do: ```bash npm install balanced-match ``` ## License (MIT) Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/codecov/c/github/bestiejs/punycode.js.svg)](https://codecov.io/gh/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: * [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) * [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) * [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) * [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) * [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). The current version supports recent versions of Node.js only. It provides a CommonJS module and an ES6 module. For the old version that offers the same functionality with broader support, including Rhino, Ringo, Narwhal, and web browsers, see [v1.4.1](https://github.com/bestiejs/punycode.js/releases/tag/v1.4.1). ## Installation Via [npm](https://www.npmjs.com/): ```bash npm install punycode --save ``` In [Node.js](https://nodejs.org/): ```js const punycode = require('punycode'); ``` ## API ### `punycode.decode(string)` Converts a Punycode string of ASCII symbols to a string of Unicode symbols. ```js // decode domain name parts punycode.decode('maana-pta'); // 'mañana' punycode.decode('--dqo34k'); // '☃-⌘' ``` ### `punycode.encode(string)` Converts a string of Unicode symbols to a Punycode string of ASCII symbols. ```js // encode domain name parts punycode.encode('mañana'); // 'maana-pta' punycode.encode('☃-⌘'); // '--dqo34k' ``` ### `punycode.toUnicode(input)` Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. ```js // decode domain names punycode.toUnicode('xn--maana-pta.com'); // → 'mañana.com' punycode.toUnicode('xn----dqo34k.com'); // → '☃-⌘.com' // decode email addresses punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); // → 'джумла@джpумлатест.bрфa' ``` ### `punycode.toASCII(input)` Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. ```js // encode domain names punycode.toASCII('mañana.com'); // → 'xn--maana-pta.com' punycode.toASCII('☃-⌘.com'); // → 'xn----dqo34k.com' // encode email addresses punycode.toASCII('джумла@джpумлатест.bрфa'); // → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' ``` ### `punycode.ucs2` #### `punycode.ucs2.decode(string)` Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. ```js punycode.ucs2.decode('abc'); // → [0x61, 0x62, 0x63] // surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: punycode.ucs2.decode('\uD834\uDF06'); // → [0x1D306] ``` #### `punycode.ucs2.encode(codePoints)` Creates a string based on an array of numeric code point values. ```js punycode.ucs2.encode([0x61, 0x62, 0x63]); // → 'abc' punycode.ucs2.encode([0x1D306]); // → '\uD834\uDF06' ``` ### `punycode.version` A string representing the current Punycode.js version number. ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License Punycode.js is available under the [MIT](https://mths.be/mit) license. # yallist Yet Another Linked List There are many doubly-linked list implementations like it, but this one is mine. For when an array would be too big, and a Map can't be iterated in reverse order. [![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) ## basic usage ```javascript var yallist = require('yallist') var myList = yallist.create([1, 2, 3]) myList.push('foo') myList.unshift('bar') // of course pop() and shift() are there, too console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] myList.forEach(function (k) { // walk the list head to tail }) myList.forEachReverse(function (k, index, list) { // walk the list tail to head }) var myDoubledList = myList.map(function (k) { return k + k }) // now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] // mapReverse is also a thing var myDoubledListReverse = myList.mapReverse(function (k) { return k + k }) // ['foofoo', 6, 4, 2, 'barbar'] var reduced = myList.reduce(function (set, entry) { set += entry return set }, 'start') console.log(reduced) // 'startfoo123bar' ``` ## api The whole API is considered "public". Functions with the same name as an Array method work more or less the same way. There's reverse versions of most things because that's the point. ### Yallist Default export, the class that holds and manages a list. Call it with either a forEach-able (like an array) or a set of arguments, to initialize the list. The Array-ish methods all act like you'd expect. No magic length, though, so if you change that it won't automatically prune or add empty spots. ### Yallist.create(..) Alias for Yallist function. Some people like factories. #### yallist.head The first node in the list #### yallist.tail The last node in the list #### yallist.length The number of nodes in the list. (Change this at your peril. It is not magic like Array length.) #### yallist.toArray() Convert the list to an array. #### yallist.forEach(fn, [thisp]) Call a function on each item in the list. #### yallist.forEachReverse(fn, [thisp]) Call a function on each item in the list, in reverse order. #### yallist.get(n) Get the data at position `n` in the list. If you use this a lot, probably better off just using an Array. #### yallist.getReverse(n) Get the data at position `n`, counting from the tail. #### yallist.map(fn, thisp) Create a new Yallist with the result of calling the function on each item. #### yallist.mapReverse(fn, thisp) Same as `map`, but in reverse. #### yallist.pop() Get the data from the list tail, and remove the tail from the list. #### yallist.push(item, ...) Insert one or more items to the tail of the list. #### yallist.reduce(fn, initialValue) Like Array.reduce. #### yallist.reduceReverse Like Array.reduce, but in reverse. #### yallist.reverse Reverse the list in place. #### yallist.shift() Get the data from the list head, and remove the head from the list. #### yallist.slice([from], [to]) Just like Array.slice, but returns a new Yallist. #### yallist.sliceReverse([from], [to]) Just like yallist.slice, but the result is returned in reverse. #### yallist.toArray() Create an array representation of the list. #### yallist.toArrayReverse() Create a reversed array representation of the list. #### yallist.unshift(item, ...) Insert one or more items to the head of the list. #### yallist.unshiftNode(node) Move a Node object to the front of the list. (That is, pull it out of wherever it lives, and make it the new head.) If the node belongs to a different list, then that list will remove it first. #### yallist.pushNode(node) Move a Node object to the end of the list. (That is, pull it out of wherever it lives, and make it the new tail.) If the node belongs to a list already, then that list will remove it first. #### yallist.removeNode(node) Remove a node from the list, preserving referential integrity of head and tail and other nodes. Will throw an error if you try to have a list remove a node that doesn't belong to it. ### Yallist.Node The class that holds the data and is actually the list. Call with `var n = new Node(value, previousNode, nextNode)` Note that if you do direct operations on Nodes themselves, it's very easy to get into weird states where the list is broken. Be careful :) #### node.next The next node in the list. #### node.prev The previous node in the list. #### node.value The data the node contains. #### node.list The list to which this node belongs. (Null if it does not belong to any list.) # get-caller-file [![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master) This is a utility, which allows a function to figure out from which file it was invoked. It does so by inspecting v8's stack trace at the time it is invoked. Inspired by http://stackoverflow.com/questions/13227489 *note: this relies on Node/V8 specific APIs, as such other runtimes may not work* ## Installation ```bash yarn add get-caller-file ``` ## Usage Given: ```js // ./foo.js const getCallerFile = require('get-caller-file'); module.exports = function() { return getCallerFile(); // figures out who called it }; ``` ```js // index.js const foo = require('./foo'); foo() // => /full/path/to/this/file/index.js ``` ## Options: * `getCallerFile(position = 2)`: where position is stack frame whos fileName we want. # axios [![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) [![build status](https://img.shields.io/travis/axios/axios/master.svg?style=flat-square)](https://travis-ci.org/axios/axios) [![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) [![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) [![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) [![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) [![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) Promise based HTTP client for the browser and node.js ## Features - Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser - Make [http](http://nodejs.org/api/http.html) requests from node.js - Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API - Intercept request and response - Transform request and response data - Cancel requests - Automatic transforms for JSON data - Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) ## Browser Support ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | --- | --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | [![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) ## Installing Using npm: ```bash $ npm install axios ``` Using bower: ```bash $ bower install axios ``` Using yarn: ```bash $ yarn add axios ``` Using cdn: ```html <script src="https://unpkg.com/axios/dist/axios.min.js"></script> ``` ## Example ### note: CommonJS usage In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: ```js const axios = require('axios').default; // axios.<method> will now provide autocomplete and parameter typings ``` Performing a `GET` request ```js const axios = require('axios'); // Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { // handle success console.log(response); }) .catch(function (error) { // handle error console.log(error); }) .finally(function () { // always executed }); // Optionally the request above could also be done as axios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }) .finally(function () { // always executed }); // Want to use async/await? Add the `async` keyword to your outer function/method. async function getUser() { try { const response = await axios.get('/user?ID=12345'); console.log(response); } catch (error) { console.error(error); } } ``` > **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet > Explorer and older browsers, so use with caution. Performing a `POST` request ```js axios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); ``` Performing multiple concurrent requests ```js function getUserAccount() { return axios.get('/user/12345'); } function getUserPermissions() { return axios.get('/user/12345/permissions'); } axios.all([getUserAccount(), getUserPermissions()]) .then(axios.spread(function (acct, perms) { // Both requests are now complete })); ``` ## axios API Requests can be made by passing the relevant config to `axios`. ##### axios(config) ```js // Send a POST request axios({ method: 'post', url: '/user/12345', data: { firstName: 'Fred', lastName: 'Flintstone' } }); ``` ```js // GET request for remote image axios({ method: 'get', url: 'http://bit.ly/2mTM3nY', responseType: 'stream' }) .then(function (response) { response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) }); ``` ##### axios(url[, config]) ```js // Send a GET request (default method) axios('/user/12345'); ``` ### Request method aliases For convenience aliases have been provided for all supported request methods. ##### axios.request(config) ##### axios.get(url[, config]) ##### axios.delete(url[, config]) ##### axios.head(url[, config]) ##### axios.options(url[, config]) ##### axios.post(url[, data[, config]]) ##### axios.put(url[, data[, config]]) ##### axios.patch(url[, data[, config]]) ###### NOTE When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. ### Concurrency Helper functions for dealing with concurrent requests. ##### axios.all(iterable) ##### axios.spread(callback) ### Creating an instance You can create a new instance of axios with a custom config. ##### axios.create([config]) ```js const instance = axios.create({ baseURL: 'https://some-domain.com/api/', timeout: 1000, headers: {'X-Custom-Header': 'foobar'} }); ``` ### Instance methods The available instance methods are listed below. The specified config will be merged with the instance config. ##### axios#request(config) ##### axios#get(url[, config]) ##### axios#delete(url[, config]) ##### axios#head(url[, config]) ##### axios#options(url[, config]) ##### axios#post(url[, data[, config]]) ##### axios#put(url[, data[, config]]) ##### axios#patch(url[, data[, config]]) ##### axios#getUri([config]) ## Request Config These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. ```js { // `url` is the server URL that will be used for the request url: '/user', // `method` is the request method to be used when making the request method: 'get', // default // `baseURL` will be prepended to `url` unless `url` is absolute. // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs // to methods of that instance. baseURL: 'https://some-domain.com/api/', // `transformRequest` allows changes to the request data before it is sent to the server // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, // FormData or Stream // You may modify the headers object. transformRequest: [function (data, headers) { // Do whatever you want to transform the data return data; }], // `transformResponse` allows changes to the response data to be made before // it is passed to then/catch transformResponse: [function (data) { // Do whatever you want to transform the data return data; }], // `headers` are custom headers to be sent headers: {'X-Requested-With': 'XMLHttpRequest'}, // `params` are the URL parameters to be sent with the request // Must be a plain object or a URLSearchParams object params: { ID: 12345 }, // `paramsSerializer` is an optional function in charge of serializing `params` // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) paramsSerializer: function (params) { return Qs.stringify(params, {arrayFormat: 'brackets'}) }, // `data` is the data to be sent as the request body // Only applicable for request methods 'PUT', 'POST', and 'PATCH' // When no `transformRequest` is set, must be of one of the following types: // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams // - Browser only: FormData, File, Blob // - Node only: Stream, Buffer data: { firstName: 'Fred' }, // syntax alternative to send data into the body // method post // only the value is sent, not the key data: 'Country=Brasil&City=Belo Horizonte', // `timeout` specifies the number of milliseconds before the request times out. // If the request takes longer than `timeout`, the request will be aborted. timeout: 1000, // default is `0` (no timeout) // `withCredentials` indicates whether or not cross-site Access-Control requests // should be made using credentials withCredentials: false, // default // `adapter` allows custom handling of requests which makes testing easier. // Return a promise and supply a valid response (see lib/adapters/README.md). adapter: function (config) { /* ... */ }, // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. // This will set an `Authorization` header, overwriting any existing // `Authorization` custom headers you have set using `headers`. // Please note that only HTTP Basic auth is configurable through this parameter. // For Bearer tokens and such, use `Authorization` custom headers instead. auth: { username: 'janedoe', password: 's00pers3cret' }, // `responseType` indicates the type of data that the server will respond with // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' // browser only: 'blob' responseType: 'json', // default // `responseEncoding` indicates encoding to use for decoding responses // Note: Ignored for `responseType` of 'stream' or client-side requests responseEncoding: 'utf8', // default // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token xsrfCookieName: 'XSRF-TOKEN', // default // `xsrfHeaderName` is the name of the http header that carries the xsrf token value xsrfHeaderName: 'X-XSRF-TOKEN', // default // `onUploadProgress` allows handling of progress events for uploads onUploadProgress: function (progressEvent) { // Do whatever you want with the native progress event }, // `onDownloadProgress` allows handling of progress events for downloads onDownloadProgress: function (progressEvent) { // Do whatever you want with the native progress event }, // `maxContentLength` defines the max size of the http response content in bytes allowed maxContentLength: 2000, // `validateStatus` defines whether to resolve or reject the promise for a given // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` // or `undefined`), the promise will be resolved; otherwise, the promise will be // rejected. validateStatus: function (status) { return status >= 200 && status < 300; // default }, // `maxRedirects` defines the maximum number of redirects to follow in node.js. // If set to 0, no redirects will be followed. maxRedirects: 5, // default // `socketPath` defines a UNIX Socket to be used in node.js. // e.g. '/var/run/docker.sock' to send requests to the docker daemon. // Only either `socketPath` or `proxy` can be specified. // If both are specified, `socketPath` is used. socketPath: null, // default // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http // and https requests, respectively, in node.js. This allows options to be added like // `keepAlive` that are not enabled by default. httpAgent: new http.Agent({ keepAlive: true }), httpsAgent: new https.Agent({ keepAlive: true }), // 'proxy' defines the hostname and port of the proxy server. // You can also define your proxy using the conventional `http_proxy` and // `https_proxy` environment variables. If you are using environment variables // for your proxy configuration, you can also define a `no_proxy` environment // variable as a comma-separated list of domains that should not be proxied. // Use `false` to disable proxies, ignoring environment variables. // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and // supplies credentials. // This will set an `Proxy-Authorization` header, overwriting any existing // `Proxy-Authorization` custom headers you have set using `headers`. proxy: { host: '127.0.0.1', port: 9000, auth: { username: 'mikeymike', password: 'rapunz3l' } }, // `cancelToken` specifies a cancel token that can be used to cancel the request // (see Cancellation section below for details) cancelToken: new CancelToken(function (cancel) { }) } ``` ## Response Schema The response for a request contains the following information. ```js { // `data` is the response that was provided by the server data: {}, // `status` is the HTTP status code from the server response status: 200, // `statusText` is the HTTP status message from the server response statusText: 'OK', // `headers` the headers that the server responded with // All header names are lower cased headers: {}, // `config` is the config that was provided to `axios` for the request config: {}, // `request` is the request that generated this response // It is the last ClientRequest instance in node.js (in redirects) // and an XMLHttpRequest instance in the browser request: {} } ``` When using `then`, you will receive the response as follows: ```js axios.get('/user/12345') .then(function (response) { console.log(response.data); console.log(response.status); console.log(response.statusText); console.log(response.headers); console.log(response.config); }); ``` When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. ## Config Defaults You can specify config defaults that will be applied to every request. ### Global axios defaults ```js axios.defaults.baseURL = 'https://api.example.com'; axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; ``` ### Custom instance defaults ```js // Set config defaults when creating the instance const instance = axios.create({ baseURL: 'https://api.example.com' }); // Alter defaults after instance has been created instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; ``` ### Config order of precedence Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. ```js // Create an instance using the config defaults provided by the library // At this point the timeout config value is `0` as is the default for the library const instance = axios.create(); // Override timeout default for the library // Now all requests using this instance will wait 2.5 seconds before timing out instance.defaults.timeout = 2500; // Override timeout for this request as it's known to take a long time instance.get('/longRequest', { timeout: 5000 }); ``` ## Interceptors You can intercept requests or responses before they are handled by `then` or `catch`. ```js // Add a request interceptor axios.interceptors.request.use(function (config) { // Do something before request is sent return config; }, function (error) { // Do something with request error return Promise.reject(error); }); // Add a response interceptor axios.interceptors.response.use(function (response) { // Any status code that lie within the range of 2xx cause this function to trigger // Do something with response data return response; }, function (error) { // Any status codes that falls outside the range of 2xx cause this function to trigger // Do something with response error return Promise.reject(error); }); ``` If you need to remove an interceptor later you can. ```js const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); axios.interceptors.request.eject(myInterceptor); ``` You can add interceptors to a custom instance of axios. ```js const instance = axios.create(); instance.interceptors.request.use(function () {/*...*/}); ``` ## Handling Errors ```js axios.get('/user/12345') .catch(function (error) { if (error.response) { // The request was made and the server responded with a status code // that falls out of the range of 2xx console.log(error.response.data); console.log(error.response.status); console.log(error.response.headers); } else if (error.request) { // The request was made but no response was received // `error.request` is an instance of XMLHttpRequest in the browser and an instance of // http.ClientRequest in node.js console.log(error.request); } else { // Something happened in setting up the request that triggered an Error console.log('Error', error.message); } console.log(error.config); }); ``` Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. ```js axios.get('/user/12345', { validateStatus: function (status) { return status < 500; // Reject only if the status code is greater than or equal to 500 } }) ``` Using `toJSON` you get an object with more information about the HTTP error. ```js axios.get('/user/12345') .catch(function (error) { console.log(error.toJSON()); }); ``` ## Cancellation You can cancel a request using a *cancel token*. > The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). You can create a cancel token using the `CancelToken.source` factory as shown below: ```js const CancelToken = axios.CancelToken; const source = CancelToken.source(); axios.get('/user/12345', { cancelToken: source.token }).catch(function (thrown) { if (axios.isCancel(thrown)) { console.log('Request canceled', thrown.message); } else { // handle error } }); axios.post('/user/12345', { name: 'new name' }, { cancelToken: source.token }) // cancel the request (the message parameter is optional) source.cancel('Operation canceled by the user.'); ``` You can also create a cancel token by passing an executor function to the `CancelToken` constructor: ```js const CancelToken = axios.CancelToken; let cancel; axios.get('/user/12345', { cancelToken: new CancelToken(function executor(c) { // An executor function receives a cancel function as a parameter cancel = c; }) }); // cancel the request cancel(); ``` > Note: you can cancel several requests with the same cancel token. ## Using application/x-www-form-urlencoded format By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. ### Browser In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: ```js const params = new URLSearchParams(); params.append('param1', 'value1'); params.append('param2', 'value2'); axios.post('/foo', params); ``` > Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: ```js const qs = require('qs'); axios.post('/foo', qs.stringify({ 'bar': 123 })); ``` Or in another way (ES6), ```js import qs from 'qs'; const data = { 'bar': 123 }; const options = { method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded' }, data: qs.stringify(data), url, }; axios(options); ``` ### Node.js In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: ```js const querystring = require('querystring'); axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); ``` You can also use the [`qs`](https://github.com/ljharb/qs) library. ###### NOTE The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). ## Semver Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. ## Promises axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). ## TypeScript axios includes [TypeScript](http://typescriptlang.org) definitions. ```typescript import axios from 'axios'; axios.get('/user?ID=12345'); ``` ## Resources * [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) * [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) * [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) * [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) * [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) ## Credits axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. ## License [MIT](LICENSE) Compiler frontend for node.js ============================= Usage ----- For an up to date list of available command line options, see: ``` $> asc --help ``` API --- The API accepts the same options as the CLI but also lets you override stdout and stderr and/or provide a callback. Example: ```js const asc = require("assemblyscript/cli/asc"); asc.ready.then(() => { asc.main([ "myModule.ts", "--binaryFile", "myModule.wasm", "--optimize", "--sourceMap", "--measure" ], { stdout: process.stdout, stderr: process.stderr }, function(err) { if (err) throw err; ... }); }); ``` Available command line options can also be obtained programmatically: ```js const options = require("assemblyscript/cli/asc.json"); ... ``` You can also compile a source string directly, for example in a browser environment: ```js const asc = require("assemblyscript/cli/asc"); asc.ready.then(() => { const { binary, text, stdout, stderr } = asc.compileString(`...`, { optimize: 2 }); }); ... ``` ![](cow.png) Moo! ==== Moo is a highly-optimised tokenizer/lexer generator. Use it to tokenize your strings, before parsing 'em with a parser like [nearley](https://github.com/hardmath123/nearley) or whatever else you're into. * [Fast](#is-it-fast) * [Convenient](#usage) * uses [Regular Expressions](#on-regular-expressions) * tracks [Line Numbers](#line-numbers) * handles [Keywords](#keywords) * supports [States](#states) * custom [Errors](#errors) * is even [Iterable](#iteration) * has no dependencies * 4KB minified + gzipped * Moo! Is it fast? ----------- Yup! Flying-cows-and-singed-steak fast. Moo is the fastest JS tokenizer around. It's **~2–10x** faster than most other tokenizers; it's a **couple orders of magnitude** faster than some of the slower ones. Define your tokens **using regular expressions**. Moo will compile 'em down to a **single RegExp for performance**. It uses the new ES6 **sticky flag** where possible to make things faster; otherwise it falls back to an almost-as-efficient workaround. (For more than you ever wanted to know about this, read [adventures in the land of substrings and RegExps](http://mrale.ph/blog/2016/11/23/making-less-dart-faster.html).) You _might_ be able to go faster still by writing your lexer by hand rather than using RegExps, but that's icky. Oh, and it [avoids parsing RegExps by itself](https://hackernoon.com/the-madness-of-parsing-real-world-javascript-regexps-d9ee336df983#.2l8qu3l76). Because that would be horrible. Usage ----- First, you need to do the needful: `$ npm install moo`, or whatever will ship this code to your computer. Alternatively, grab the `moo.js` file by itself and slap it into your web page via a `<script>` tag; moo is completely standalone. Then you can start roasting your very own lexer/tokenizer: ```js const moo = require('moo') let lexer = moo.compile({ WS: /[ \t]+/, comment: /\/\/.*?$/, number: /0|[1-9][0-9]*/, string: /"(?:\\["\\]|[^\n"\\])*"/, lparen: '(', rparen: ')', keyword: ['while', 'if', 'else', 'moo', 'cows'], NL: { match: /\n/, lineBreaks: true }, }) ``` And now throw some text at it: ```js lexer.reset('while (10) cows\nmoo') lexer.next() // -> { type: 'keyword', value: 'while' } lexer.next() // -> { type: 'WS', value: ' ' } lexer.next() // -> { type: 'lparen', value: '(' } lexer.next() // -> { type: 'number', value: '10' } // ... ``` When you reach the end of Moo's internal buffer, next() will return `undefined`. You can always `reset()` it and feed it more data when that happens. On Regular Expressions ---------------------- RegExps are nifty for making tokenizers, but they can be a bit of a pain. Here are some things to be aware of: * You often want to use **non-greedy quantifiers**: e.g. `*?` instead of `*`. Otherwise your tokens will be longer than you expect: ```js let lexer = moo.compile({ string: /".*"/, // greedy quantifier * // ... }) lexer.reset('"foo" "bar"') lexer.next() // -> { type: 'string', value: 'foo" "bar' } ``` Better: ```js let lexer = moo.compile({ string: /".*?"/, // non-greedy quantifier *? // ... }) lexer.reset('"foo" "bar"') lexer.next() // -> { type: 'string', value: 'foo' } lexer.next() // -> { type: 'space', value: ' ' } lexer.next() // -> { type: 'string', value: 'bar' } ``` * The **order of your rules** matters. Earlier ones will take precedence. ```js moo.compile({ identifier: /[a-z0-9]+/, number: /[0-9]+/, }).reset('42').next() // -> { type: 'identifier', value: '42' } moo.compile({ number: /[0-9]+/, identifier: /[a-z0-9]+/, }).reset('42').next() // -> { type: 'number', value: '42' } ``` * Moo uses **multiline RegExps**. This has a few quirks: for example, the **dot `/./` doesn't include newlines**. Use `[^]` instead if you want to match newlines too. * Since an excluding character ranges like `/[^ ]/` (which matches anything but a space) _will_ include newlines, you have to be careful not to include them by accident! In particular, the whitespace metacharacter `\s` includes newlines. Line Numbers ------------ Moo tracks detailed information about the input for you. It will track line numbers, as long as you **apply the `lineBreaks: true` option to any rules which might contain newlines**. Moo will try to warn you if you forget to do this. Note that this is `false` by default, for performance reasons: counting the number of lines in a matched token has a small cost. For optimal performance, only match newlines inside a dedicated token: ```js newline: {match: '\n', lineBreaks: true}, ``` ### Token Info ### Token objects (returned from `next()`) have the following attributes: * **`type`**: the name of the group, as passed to compile. * **`text`**: the string that was matched. * **`value`**: the string that was matched, transformed by your `value` function (if any). * **`offset`**: the number of bytes from the start of the buffer where the match starts. * **`lineBreaks`**: the number of line breaks found in the match. (Always zero if this rule has `lineBreaks: false`.) * **`line`**: the line number of the beginning of the match, starting from 1. * **`col`**: the column where the match begins, starting from 1. ### Value vs. Text ### The `value` is the same as the `text`, unless you provide a [value transform](#transform). ```js const moo = require('moo') const lexer = moo.compile({ ws: /[ \t]+/, string: {match: /"(?:\\["\\]|[^\n"\\])*"/, value: s => s.slice(1, -1)}, }) lexer.reset('"test"') lexer.next() /* { value: 'test', text: '"test"', ... } */ ``` ### Reset ### Calling `reset()` on your lexer will empty its internal buffer, and set the line, column, and offset counts back to their initial value. If you don't want this, you can `save()` the state, and later pass it as the second argument to `reset()` to explicitly control the internal state of the lexer. ```js    lexer.reset('some line\n') let info = lexer.save() // -> { line: 10 } lexer.next() // -> { line: 10 } lexer.next() // -> { line: 11 } // ... lexer.reset('a different line\n', info) lexer.next() // -> { line: 10 } ``` Keywords -------- Moo makes it convenient to define literals. ```js moo.compile({ lparen: '(', rparen: ')', keyword: ['while', 'if', 'else', 'moo', 'cows'], }) ``` It'll automatically compile them into regular expressions, escaping them where necessary. **Keywords** should be written using the `keywords` transform. ```js moo.compile({ IDEN: {match: /[a-zA-Z]+/, type: moo.keywords({ KW: ['while', 'if', 'else', 'moo', 'cows'], })}, SPACE: {match: /\s+/, lineBreaks: true}, }) ``` ### Why? ### You need to do this to ensure the **longest match** principle applies, even in edge cases. Imagine trying to parse the input `className` with the following rules: ```js keyword: ['class'], identifier: /[a-zA-Z]+/, ``` You'll get _two_ tokens — `['class', 'Name']` -- which is _not_ what you want! If you swap the order of the rules, you'll fix this example; but now you'll lex `class` wrong (as an `identifier`). The keywords helper checks matches against the list of keywords; if any of them match, it uses the type `'keyword'` instead of `'identifier'` (for this example). ### Keyword Types ### Keywords can also have **individual types**. ```js let lexer = moo.compile({ name: {match: /[a-zA-Z]+/, type: moo.keywords({ 'kw-class': 'class', 'kw-def': 'def', 'kw-if': 'if', })}, // ... }) lexer.reset('def foo') lexer.next() // -> { type: 'kw-def', value: 'def' } lexer.next() // space lexer.next() // -> { type: 'name', value: 'foo' } ``` You can use [itt](https://github.com/nathan/itt)'s iterator adapters to make constructing keyword objects easier: ```js itt(['class', 'def', 'if']) .map(k => ['kw-' + k, k]) .toObject() ``` States ------ Moo allows you to define multiple lexer **states**. Each state defines its own separate set of token rules. Your lexer will start off in the first state given to `moo.states({})`. Rules can be annotated with `next`, `push`, and `pop`, to change the current state after that token is matched. A "stack" of past states is kept, which is used by `push` and `pop`. * **`next: 'bar'`** moves to the state named `bar`. (The stack is not changed.) * **`push: 'bar'`** moves to the state named `bar`, and pushes the old state onto the stack. * **`pop: 1`** removes one state from the top of the stack, and moves to that state. (Only `1` is supported.) Only rules from the current state can be matched. You need to copy your rule into all the states you want it to be matched in. For example, to tokenize JS-style string interpolation such as `a${{c: d}}e`, you might use: ```js let lexer = moo.states({ main: { strstart: {match: '`', push: 'lit'}, ident: /\w+/, lbrace: {match: '{', push: 'main'}, rbrace: {match: '}', pop: true}, colon: ':', space: {match: /\s+/, lineBreaks: true}, }, lit: { interp: {match: '${', push: 'main'}, escape: /\\./, strend: {match: '`', pop: true}, const: {match: /(?:[^$`]|\$(?!\{))+/, lineBreaks: true}, }, }) // <= `a${{c: d}}e` // => strstart const interp lbrace ident colon space ident rbrace rbrace const strend ``` The `rbrace` rule is annotated with `pop`, so it moves from the `main` state into either `lit` or `main`, depending on the stack. Errors ------ If none of your rules match, Moo will throw an Error; since it doesn't know what else to do. If you prefer, you can have moo return an error token instead of throwing an exception. The error token will contain the whole of the rest of the buffer. ```js moo.compile({ // ... myError: moo.error, }) moo.reset('invalid') moo.next() // -> { type: 'myError', value: 'invalid', text: 'invalid', offset: 0, lineBreaks: 0, line: 1, col: 1 } moo.next() // -> undefined ``` You can have a token type that both matches tokens _and_ contains error values. ```js moo.compile({ // ... myError: {match: /[\$?`]/, error: true}, }) ``` ### Formatting errors ### If you want to throw an error from your parser, you might find `formatError` helpful. Call it with the offending token: ```js throw new Error(lexer.formatError(token, "invalid syntax")) ``` It returns a string with a pretty error message. ``` Error: invalid syntax at line 2 col 15: totally valid `syntax` ^ ``` Iteration --------- Iterators: we got 'em. ```js for (let here of lexer) { // here = { type: 'number', value: '123', ... } } ``` Create an array of tokens. ```js let tokens = Array.from(lexer); ``` Use [itt](https://github.com/nathan/itt)'s iteration tools with Moo. ```js for (let [here, next] = itt(lexer).lookahead()) { // pass a number if you need more tokens // enjoy! } ``` Transform --------- Moo doesn't allow capturing groups, but you can supply a transform function, `value()`, which will be called on the value before storing it in the Token object. ```js moo.compile({ STRING: [ {match: /"""[^]*?"""/, lineBreaks: true, value: x => x.slice(3, -3)}, {match: /"(?:\\["\\rn]|[^"\\])*?"/, lineBreaks: true, value: x => x.slice(1, -1)}, {match: /'(?:\\['\\rn]|[^'\\])*?'/, lineBreaks: true, value: x => x.slice(1, -1)}, ], // ... }) ``` Contributing ------------ Do check the [FAQ](https://github.com/tjvr/moo/issues?q=label%3Aquestion). Before submitting an issue, [remember...](https://github.com/tjvr/moo/blob/master/.github/CONTRIBUTING.md) # yargs-parser ![ci](https://github.com/yargs/yargs-parser/workflows/ci/badge.svg) [![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) ![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/yargs-parser) The mighty option parser used by [yargs](https://github.com/yargs/yargs). visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. <img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/master/yargs-logo.png"> ## Example ```sh npm i yargs-parser --save ``` ```js const argv = require('yargs-parser')(process.argv.slice(2)) console.log(argv) ``` ```console $ node example.js --foo=33 --bar hello { _: [], foo: 33, bar: 'hello' } ``` _or parse a string!_ ```js const argv = require('yargs-parser')('--foo=99 --bar=33') console.log(argv) ``` ```console { _: [], foo: 99, bar: 33 } ``` Convert an array of mixed types before passing to `yargs-parser`: ```js const parse = require('yargs-parser') parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings ``` ## Deno Example As of `v19` `yargs-parser` supports [Deno](https://github.com/denoland/deno): ```typescript import parser from "https://deno.land/x/yargs_parser/deno.ts"; const argv = parser('--foo=99 --bar=9987930', { string: ['bar'] }) console.log(argv) ``` ## ESM Example As of `v19` `yargs-parser` supports ESM (_both in Node.js and in the browser_): **Node.js:** ```js import parser from 'yargs-parser' const argv = parser('--foo=99 --bar=9987930', { string: ['bar'] }) console.log(argv) ``` **Browsers:** ```html <!doctype html> <body> <script type="module"> import parser from "https://unpkg.com/yargs-parser@19.0.0/browser.js"; const argv = parser('--foo=99 --bar=9987930', { string: ['bar'] }) console.log(argv) </script> </body> ``` ## API ### parser(args, opts={}) Parses command line arguments returning a simple mapping of keys and values. **expects:** * `args`: a string or array of strings representing the options to parse. * `opts`: provide a set of hints indicating how `args` should be parsed: * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.<br> Indicate that keys should be parsed as an array and coerced to booleans / numbers:<br> `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided (or throws an error). For arrays the function is called only once for the entire array:<br> `{coerce: {foo: function (arg) {return modifiedArg}}}`. * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:<br> `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. * `opts.normalize`: `path.normalize()` will be applied to values set to this key. * `opts.number`: keys should be treated as numbers. * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). **returns:** * `obj`: an object representing the parsed value of `args` * `key/value`: key value pairs for each argument and their aliases. * `_`: an array representing the positional arguments. * [optional] `--`: an array with arguments after the end-of-options flag `--`. ### require('yargs-parser').detailed(args, opts={}) Parses a command line string, returning detailed information required by the yargs engine. **expects:** * `args`: a string or array of strings representing options to parse. * `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. **returns:** * `argv`: an object representing the parsed value of `args` * `key/value`: key value pairs for each argument and their aliases. * `_`: an array representing the positional arguments. * [optional] `--`: an array with arguments after the end-of-options flag `--`. * `error`: populated with an error object if an exception occurred during parsing. * `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. * `newAliases`: any new aliases added via camel-case expansion: * `boolean`: `{ fooBar: true }` * `defaulted`: any new argument created by `opts.default`, no aliases included. * `boolean`: `{ foo: true }` * `configuration`: given by default settings and `opts.configuration`. <a name="configuration"></a> ### Configuration The yargs-parser applies several automated transformations on the keys provided in `args`. These features can be turned on and off using the `configuration` field of `opts`. ```js var parsed = parser(['--no-dice'], { configuration: { 'boolean-negation': false } }) ``` ### short option groups * default: `true`. * key: `short-option-groups`. Should a group of short-options be treated as boolean flags? ```console $ node example.js -abc { _: [], a: true, b: true, c: true } ``` _if disabled:_ ```console $ node example.js -abc { _: [], abc: true } ``` ### camel-case expansion * default: `true`. * key: `camel-case-expansion`. Should hyphenated arguments be expanded into camel-case aliases? ```console $ node example.js --foo-bar { _: [], 'foo-bar': true, fooBar: true } ``` _if disabled:_ ```console $ node example.js --foo-bar { _: [], 'foo-bar': true } ``` ### dot-notation * default: `true` * key: `dot-notation` Should keys that contain `.` be treated as objects? ```console $ node example.js --foo.bar { _: [], foo: { bar: true } } ``` _if disabled:_ ```console $ node example.js --foo.bar { _: [], "foo.bar": true } ``` ### parse numbers * default: `true` * key: `parse-numbers` Should keys that look like numbers be treated as such? ```console $ node example.js --foo=99.3 { _: [], foo: 99.3 } ``` _if disabled:_ ```console $ node example.js --foo=99.3 { _: [], foo: "99.3" } ``` ### parse positional numbers * default: `true` * key: `parse-positional-numbers` Should positional keys that look like numbers be treated as such. ```console $ node example.js 99.3 { _: [99.3] } ``` _if disabled:_ ```console $ node example.js 99.3 { _: ['99.3'] } ``` ### boolean negation * default: `true` * key: `boolean-negation` Should variables prefixed with `--no` be treated as negations? ```console $ node example.js --no-foo { _: [], foo: false } ``` _if disabled:_ ```console $ node example.js --no-foo { _: [], "no-foo": true } ``` ### combine arrays * default: `false` * key: `combine-arrays` Should arrays be combined when provided by both command line arguments and a configuration file. ### duplicate arguments array * default: `true` * key: `duplicate-arguments-array` Should arguments be coerced into an array when duplicated: ```console $ node example.js -x 1 -x 2 { _: [], x: [1, 2] } ``` _if disabled:_ ```console $ node example.js -x 1 -x 2 { _: [], x: 2 } ``` ### flatten duplicate arrays * default: `true` * key: `flatten-duplicate-arrays` Should array arguments be coerced into a single array when duplicated: ```console $ node example.js -x 1 2 -x 3 4 { _: [], x: [1, 2, 3, 4] } ``` _if disabled:_ ```console $ node example.js -x 1 2 -x 3 4 { _: [], x: [[1, 2], [3, 4]] } ``` ### greedy arrays * default: `true` * key: `greedy-arrays` Should arrays consume more than one positional argument following their flag. ```console $ node example --arr 1 2 { _[], arr: [1, 2] } ``` _if disabled:_ ```console $ node example --arr 1 2 { _[2], arr: [1] } ``` **Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** ### nargs eats options * default: `false` * key: `nargs-eats-options` Should nargs consume dash options as well as positional arguments. ### negation prefix * default: `no-` * key: `negation-prefix` The prefix to use for negated boolean variables. ```console $ node example.js --no-foo { _: [], foo: false } ``` _if set to `quux`:_ ```console $ node example.js --quuxfoo { _: [], foo: false } ``` ### populate -- * default: `false`. * key: `populate--` Should unparsed flags be stored in `--` or `_`. _If disabled:_ ```console $ node example.js a -b -- x y { _: [ 'a', 'x', 'y' ], b: true } ``` _If enabled:_ ```console $ node example.js a -b -- x y { _: [ 'a' ], '--': [ 'x', 'y' ], b: true } ``` ### set placeholder key * default: `false`. * key: `set-placeholder-key`. Should a placeholder be added for keys not set via the corresponding CLI argument? _If disabled:_ ```console $ node example.js -a 1 -c 2 { _: [], a: 1, c: 2 } ``` _If enabled:_ ```console $ node example.js -a 1 -c 2 { _: [], a: 1, b: undefined, c: 2 } ``` ### halt at non-option * default: `false`. * key: `halt-at-non-option`. Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. _If disabled:_ ```console $ node example.js -a run b -x y { _: [ 'b' ], a: 'run', x: 'y' } ``` _If enabled:_ ```console $ node example.js -a run b -x y { _: [ 'b', '-x', 'y' ], a: 'run' } ``` ### strip aliased * default: `false` * key: `strip-aliased` Should aliases be removed before returning results? _If disabled:_ ```console $ node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } ``` _If enabled:_ ```console $ node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1 } ``` ### strip dashed * default: `false` * key: `strip-dashed` Should dashed keys be removed before returning results? This option has no effect if `camel-case-expansion` is disabled. _If disabled:_ ```console $ node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1 } ``` _If enabled:_ ```console $ node example.js --test-field 1 { _: [], testField: 1 } ``` ### unknown options as args * default: `false` * key: `unknown-options-as-args` Should unknown options be treated like regular arguments? An unknown option is one that is not configured in `opts`. _If disabled_ ```console $ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 { _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } ``` _If enabled_ ```console $ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 { _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } ``` ## Supported Node.js Versions Libraries in this ecosystem make a best effort to track [Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). ## Special Thanks The yargs project evolves from optimist and minimist. It owes its existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ ## License ISC # tr46.js > An implementation of the [Unicode TR46 specification](http://unicode.org/reports/tr46/). ## Installation [Node.js](http://nodejs.org) `>= 6` is required. To install, type this at the command line: ```shell npm install tr46 ``` ## API ### `toASCII(domainName[, options])` Converts a string of Unicode symbols to a case-folded Punycode string of ASCII symbols. Available options: * [`checkBidi`](#checkBidi) * [`checkHyphens`](#checkHyphens) * [`checkJoiners`](#checkJoiners) * [`processingOption`](#processingOption) * [`useSTD3ASCIIRules`](#useSTD3ASCIIRules) * [`verifyDNSLength`](#verifyDNSLength) ### `toUnicode(domainName[, options])` Converts a case-folded Punycode string of ASCII symbols to a string of Unicode symbols. Available options: * [`checkBidi`](#checkBidi) * [`checkHyphens`](#checkHyphens) * [`checkJoiners`](#checkJoiners) * [`useSTD3ASCIIRules`](#useSTD3ASCIIRules) ## Options ### `checkBidi` Type: `Boolean` Default value: `false` When set to `true`, any bi-directional text within the input will be checked for validation. ### `checkHyphens` Type: `Boolean` Default value: `false` When set to `true`, the positions of any hyphen characters within the input will be checked for validation. ### `checkJoiners` Type: `Boolean` Default value: `false` When set to `true`, any word joiner characters within the input will be checked for validation. ### `processingOption` Type: `String` Default value: `"nontransitional"` When set to `"transitional"`, symbols within the input will be validated according to the older IDNA2003 protocol. When set to `"nontransitional"`, the current IDNA2008 protocol will be used. ### `useSTD3ASCIIRules` Type: `Boolean` Default value: `false` When set to `true`, input will be validated according to [STD3 Rules](http://unicode.org/reports/tr46/#STD3_Rules). ### `verifyDNSLength` Type: `Boolean` Default value: `false` When set to `true`, the length of each DNS label within the input will be checked for validation. # emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) _emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. ## Installation Via [npm](https://www.npmjs.com/): ```bash npm install emoji-regex ``` In [Node.js](https://nodejs.org/): ```js const emojiRegex = require('emoji-regex'); // Note: because the regular expression has the global flag set, this module // exports a function that returns the regex rather than exporting the regular // expression itself, to make it impossible to (accidentally) mutate the // original regular expression. const text = ` \u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) \u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji \u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) \u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier `; const regex = emojiRegex(); let match; while (match = regex.exec(text)) { const emoji = match[0]; console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); } ``` Console output: ``` Matched sequence ⌚ — code points: 1 Matched sequence ⌚ — code points: 1 Matched sequence ↔️ — code points: 2 Matched sequence ↔️ — code points: 2 Matched sequence 👩 — code points: 1 Matched sequence 👩 — code points: 1 Matched sequence 👩🏿 — code points: 2 Matched sequence 👩🏿 — code points: 2 ``` To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: ```js const emojiRegex = require('emoji-regex/text.js'); ``` Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: ```js const emojiRegex = require('emoji-regex/es2015/index.js'); const emojiRegexText = require('emoji-regex/es2015/text.js'); ``` ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License _emoji-regex_ is available under the [MIT](https://mths.be/mit) license. # safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] [travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg [travis-url]: https://travis-ci.org/feross/safe-buffer [npm-image]: https://img.shields.io/npm/v/safe-buffer.svg [npm-url]: https://npmjs.org/package/safe-buffer [downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg [downloads-url]: https://npmjs.org/package/safe-buffer [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg [standard-url]: https://standardjs.com #### Safer Node.js Buffer API **Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, `Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** **Uses the built-in implementation when available.** ## install ``` npm install safe-buffer ``` ## usage The goal of this package is to provide a safe replacement for the node.js `Buffer`. It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to the top of your node.js modules: ```js var Buffer = require('safe-buffer').Buffer // Existing buffer code will continue to work without issues: new Buffer('hey', 'utf8') new Buffer([1, 2, 3], 'utf8') new Buffer(obj) new Buffer(16) // create an uninitialized buffer (potentially unsafe) // But you can use these new explicit APIs to make clear what you want: Buffer.from('hey', 'utf8') // convert from many types to a Buffer Buffer.alloc(16) // create a zero-filled buffer (safe) Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) ``` ## api ### Class Method: Buffer.from(array) <!-- YAML added: v3.0.0 --> * `array` {Array} Allocates a new `Buffer` using an `array` of octets. ```js const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); // creates a new Buffer containing ASCII bytes // ['b','u','f','f','e','r'] ``` A `TypeError` will be thrown if `array` is not an `Array`. ### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) <!-- YAML added: v5.10.0 --> * `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or a `new ArrayBuffer()` * `byteOffset` {Number} Default: `0` * `length` {Number} Default: `arrayBuffer.length - byteOffset` When passed a reference to the `.buffer` property of a `TypedArray` instance, the newly created `Buffer` will share the same allocated memory as the TypedArray. ```js const arr = new Uint16Array(2); arr[0] = 5000; arr[1] = 4000; const buf = Buffer.from(arr.buffer); // shares the memory with arr; console.log(buf); // Prints: <Buffer 88 13 a0 0f> // changing the TypedArray changes the Buffer also arr[1] = 6000; console.log(buf); // Prints: <Buffer 88 13 70 17> ``` The optional `byteOffset` and `length` arguments specify a memory range within the `arrayBuffer` that will be shared by the `Buffer`. ```js const ab = new ArrayBuffer(10); const buf = Buffer.from(ab, 0, 2); console.log(buf.length); // Prints: 2 ``` A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. ### Class Method: Buffer.from(buffer) <!-- YAML added: v3.0.0 --> * `buffer` {Buffer} Copies the passed `buffer` data onto a new `Buffer` instance. ```js const buf1 = Buffer.from('buffer'); const buf2 = Buffer.from(buf1); buf1[0] = 0x61; console.log(buf1.toString()); // 'auffer' console.log(buf2.toString()); // 'buffer' (copy is not changed) ``` A `TypeError` will be thrown if `buffer` is not a `Buffer`. ### Class Method: Buffer.from(str[, encoding]) <!-- YAML added: v5.10.0 --> * `str` {String} String to encode. * `encoding` {String} Encoding to use, Default: `'utf8'` Creates a new `Buffer` containing the given JavaScript string `str`. If provided, the `encoding` parameter identifies the character encoding. If not provided, `encoding` defaults to `'utf8'`. ```js const buf1 = Buffer.from('this is a tést'); console.log(buf1.toString()); // prints: this is a tést console.log(buf1.toString('ascii')); // prints: this is a tC)st const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); console.log(buf2.toString()); // prints: this is a tést ``` A `TypeError` will be thrown if `str` is not a string. ### Class Method: Buffer.alloc(size[, fill[, encoding]]) <!-- YAML added: v5.10.0 --> * `size` {Number} * `fill` {Value} Default: `undefined` * `encoding` {String} Default: `utf8` Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the `Buffer` will be *zero-filled*. ```js const buf = Buffer.alloc(5); console.log(buf); // <Buffer 00 00 00 00 00> ``` The `size` must be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will be created if a `size` less than or equal to 0 is specified. If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. See [`buf.fill()`][] for more information. ```js const buf = Buffer.alloc(5, 'a'); console.log(buf); // <Buffer 61 61 61 61 61> ``` If both `fill` and `encoding` are specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill, encoding)`. For example: ```js const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); console.log(buf); // <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64> ``` Calling `Buffer.alloc(size)` can be significantly slower than the alternative `Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance contents will *never contain sensitive data*. A `TypeError` will be thrown if `size` is not a number. ### Class Method: Buffer.allocUnsafe(size) <!-- YAML added: v5.10.0 --> * `size` {Number} Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will be created if a `size` less than or equal to 0 is specified. The underlying memory for `Buffer` instances created in this way is *not initialized*. The contents of the newly created `Buffer` are unknown and *may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such `Buffer` instances to zeroes. ```js const buf = Buffer.allocUnsafe(5); console.log(buf); // <Buffer 78 e0 82 02 01> // (octets will be different, every time) buf.fill(0); console.log(buf); // <Buffer 00 00 00 00 00> ``` A `TypeError` will be thrown if `size` is not a number. Note that the `Buffer` module pre-allocates an internal `Buffer` instance of size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated `new Buffer(size)` constructor) only when `size` is less than or equal to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default value of `Buffer.poolSize` is `8192` but can be modified. Use of this pre-allocated internal memory pool is a key difference between calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The difference is subtle but can be important when an application requires the additional performance that `Buffer.allocUnsafe(size)` provides. ### Class Method: Buffer.allocUnsafeSlow(size) <!-- YAML added: v5.10.0 --> * `size` {Number} Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The `size` must be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will be created if a `size` less than or equal to 0 is specified. The underlying memory for `Buffer` instances created in this way is *not initialized*. The contents of the newly created `Buffer` are unknown and *may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such `Buffer` instances to zeroes. When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, allocations under 4KB are, by default, sliced from a single pre-allocated `Buffer`. This allows applications to avoid the garbage collection overhead of creating many individually allocated Buffers. This approach improves both performance and memory usage by eliminating the need to track and cleanup as many `Persistent` objects. However, in the case where a developer may need to retain a small chunk of memory from a pool for an indeterminate amount of time, it may be appropriate to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then copy out the relevant bits. ```js // need to keep around a few small chunks of memory const store = []; socket.on('readable', () => { const data = socket.read(); // allocate for retained data const sb = Buffer.allocUnsafeSlow(10); // copy the data into the new allocation data.copy(sb, 0, 0, 10); store.push(sb); }); ``` Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* a developer has observed undue memory retention in their applications. A `TypeError` will be thrown if `size` is not a number. ### All the Rest The rest of the `Buffer` API is exactly the same as in node.js. [See the docs](https://nodejs.org/api/buffer.html). ## Related links - [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) - [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) ## Why is `Buffer` unsafe? Today, the node.js `Buffer` constructor is overloaded to handle many different argument types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), `ArrayBuffer`, and also `Number`. The API is optimized for convenience: you can throw any type at it, and it will try to do what you want. Because the Buffer constructor is so powerful, you often see code like this: ```js // Convert UTF-8 strings to hex function toHex (str) { return new Buffer(str).toString('hex') } ``` ***But what happens if `toHex` is called with a `Number` argument?*** ### Remote Memory Disclosure If an attacker can make your program call the `Buffer` constructor with a `Number` argument, then they can make it allocate uninitialized memory from the node.js process. This could potentially disclose TLS private keys, user data, or database passwords. When the `Buffer` constructor is passed a `Number` argument, it returns an **UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like this, you **MUST** overwrite the contents before returning it to the user. From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): > `new Buffer(size)` > > - `size` Number > > The underlying memory for `Buffer` instances created in this way is not initialized. > **The contents of a newly created `Buffer` are unknown and could contain sensitive > data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. (Emphasis our own.) Whenever the programmer intended to create an uninitialized `Buffer` you often see code like this: ```js var buf = new Buffer(16) // Immediately overwrite the uninitialized buffer with data from another buffer for (var i = 0; i < buf.length; i++) { buf[i] = otherBuf[i] } ``` ### Would this ever be a problem in real code? Yes. It's surprisingly common to forget to check the type of your variables in a dynamically-typed language like JavaScript. Usually the consequences of assuming the wrong type is that your program crashes with an uncaught exception. But the failure mode for forgetting to check the type of arguments to the `Buffer` constructor is more catastrophic. Here's an example of a vulnerable service that takes a JSON payload and converts it to hex: ```js // Take a JSON payload {str: "some string"} and convert it to hex var server = http.createServer(function (req, res) { var data = '' req.setEncoding('utf8') req.on('data', function (chunk) { data += chunk }) req.on('end', function () { var body = JSON.parse(data) res.end(new Buffer(body.str).toString('hex')) }) }) server.listen(8080) ``` In this example, an http client just has to send: ```json { "str": 1000 } ``` and it will get back 1,000 bytes of uninitialized memory from the server. This is a very serious bug. It's similar in severity to the [the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process memory by remote attackers. ### Which real-world packages were vulnerable? #### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) [Mathias Buus](https://github.com/mafintosh) and I ([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get them to reveal 20 bytes at a time of uninitialized memory from the node.js process. Here's [the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) that fixed it. We released a new fixed version, created a [Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all vulnerable versions on npm so users will get a warning to upgrade to a newer version. #### [`ws`](https://www.npmjs.com/package/ws) That got us wondering if there were other vulnerable packages. Sure enough, within a short period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the most popular WebSocket implementation in node.js. If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as expected, then uninitialized server memory would be disclosed to the remote peer. These were the vulnerable methods: ```js socket.send(number) socket.ping(number) socket.pong(number) ``` Here's a vulnerable socket server with some echo functionality: ```js server.on('connection', function (socket) { socket.on('message', function (message) { message = JSON.parse(message) if (message.type === 'echo') { socket.send(message.data) // send back the user's message } }) }) ``` `socket.send(number)` called on the server, will disclose server memory. Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue was fixed, with a more detailed explanation. Props to [Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the [Node Security Project disclosure](https://nodesecurity.io/advisories/67). ### What's the solution? It's important that node.js offers a fast way to get memory otherwise performance-critical applications would needlessly get a lot slower. But we need a better way to *signal our intent* as programmers. **When we want uninitialized memory, we should request it explicitly.** Sensitive functionality should not be packed into a developer-friendly API that loosely accepts many different types. This type of API encourages the lazy practice of passing variables in without checking the type very carefully. #### A new API: `Buffer.allocUnsafe(number)` The functionality of creating buffers with uninitialized memory should be part of another API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that frequently gets user input of all sorts of different types passed into it. ```js var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! // Immediately overwrite the uninitialized buffer with data from another buffer for (var i = 0; i < buf.length; i++) { buf[i] = otherBuf[i] } ``` ### How do we fix node.js core? We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as `semver-major`) which defends against one case: ```js var str = 16 new Buffer(str, 'utf8') ``` In this situation, it's implied that the programmer intended the first argument to be a string, since they passed an encoding as a second argument. Today, node.js will allocate uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not what the programmer intended. But this is only a partial solution, since if the programmer does `new Buffer(variable)` (without an `encoding` parameter) there's no way to know what they intended. If `variable` is sometimes a number, then uninitialized memory will sometimes be returned. ### What's the real long-term fix? We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when we need uninitialized memory. But that would break 1000s of packages. ~~We believe the best solution is to:~~ ~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ ~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ #### Update We now support adding three new APIs: - `Buffer.from(value)` - convert from any type to a buffer - `Buffer.alloc(size)` - create a zero-filled buffer - `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size This solves the core problem that affected `ws` and `bittorrent-dht` which is `Buffer(variable)` getting tricked into taking a number argument. This way, existing code continues working and the impact on the npm ecosystem will be minimal. Over time, npm maintainers can migrate performance-critical code to use `Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. ### Conclusion We think there's a serious design issue with the `Buffer` API as it exists today. It promotes insecure software by putting high-risk functionality into a convenient API with friendly "developer ergonomics". This wasn't merely a theoretical exercise because we found the issue in some of the most popular npm packages. Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of `buffer`. ```js var Buffer = require('safe-buffer').Buffer ``` Eventually, we hope that node.js core can switch to this new, safer behavior. We believe the impact on the ecosystem would be minimal since it's not a breaking change. Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while older, insecure packages would magically become safe from this attack vector. ## links - [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) - [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) - [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) ## credit The original issues in `bittorrent-dht` ([disclosure](https://nodesecurity.io/advisories/68)) and `ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by [Mathias Buus](https://github.com/mafintosh) and [Feross Aboukhadijeh](http://feross.org/). Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues and for his work running the [Node Security Project](https://nodesecurity.io/). Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and auditing the code. ## license MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) assemblyscript-json # assemblyscript-json ## Table of contents ### Namespaces - [JSON](modules/json.md) ### Classes - [DecoderState](classes/decoderstate.md) - [JSONDecoder](classes/jsondecoder.md) - [JSONEncoder](classes/jsonencoder.md) - [JSONHandler](classes/jsonhandler.md) - [ThrowingJSONHandler](classes/throwingjsonhandler.md) long.js ======= A Long class for representing a 64 bit two's-complement integer value derived from the [Closure Library](https://github.com/google/closure-library) for stand-alone use and extended with unsigned support. [![Build Status](https://travis-ci.org/dcodeIO/long.js.svg)](https://travis-ci.org/dcodeIO/long.js) Background ---------- As of [ECMA-262 5th Edition](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5), "all the positive and negative integers whose magnitude is no greater than 2<sup>53</sup> are representable in the Number type", which is "representing the doubleprecision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic". The [maximum safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) in JavaScript is 2<sup>53</sup>-1. Example: 2<sup>64</sup>-1 is 1844674407370955**1615** but in JavaScript it evaluates to 1844674407370955**2000**. Furthermore, bitwise operators in JavaScript "deal only with integers in the range −2<sup>31</sup> through 2<sup>31</sup>−1, inclusive, or in the range 0 through 2<sup>32</sup>−1, inclusive. These operators accept any value of the Number type but first convert each such value to one of 2<sup>32</sup> integer values." In some use cases, however, it is required to be able to reliably work with and perform bitwise operations on the full 64 bits. This is where long.js comes into play. Usage ----- The class is compatible with CommonJS and AMD loaders and is exposed globally as `Long` if neither is available. ```javascript var Long = require("long"); var longVal = new Long(0xFFFFFFFF, 0x7FFFFFFF); console.log(longVal.toString()); ... ``` API --- ### Constructor * new **Long**(low: `number`, high: `number`, unsigned?: `boolean`)<br /> Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. See the from* functions below for more convenient ways of constructing Longs. ### Fields * Long#**low**: `number`<br /> The low 32 bits as a signed value. * Long#**high**: `number`<br /> The high 32 bits as a signed value. * Long#**unsigned**: `boolean`<br /> Whether unsigned or not. ### Constants * Long.**ZERO**: `Long`<br /> Signed zero. * Long.**ONE**: `Long`<br /> Signed one. * Long.**NEG_ONE**: `Long`<br /> Signed negative one. * Long.**UZERO**: `Long`<br /> Unsigned zero. * Long.**UONE**: `Long`<br /> Unsigned one. * Long.**MAX_VALUE**: `Long`<br /> Maximum signed value. * Long.**MIN_VALUE**: `Long`<br /> Minimum signed value. * Long.**MAX_UNSIGNED_VALUE**: `Long`<br /> Maximum unsigned value. ### Utility * Long.**isLong**(obj: `*`): `boolean`<br /> Tests if the specified object is a Long. * Long.**fromBits**(lowBits: `number`, highBits: `number`, unsigned?: `boolean`): `Long`<br /> Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. * Long.**fromBytes**(bytes: `number[]`, unsigned?: `boolean`, le?: `boolean`): `Long`<br /> Creates a Long from its byte representation. * Long.**fromBytesLE**(bytes: `number[]`, unsigned?: `boolean`): `Long`<br /> Creates a Long from its little endian byte representation. * Long.**fromBytesBE**(bytes: `number[]`, unsigned?: `boolean`): `Long`<br /> Creates a Long from its big endian byte representation. * Long.**fromInt**(value: `number`, unsigned?: `boolean`): `Long`<br /> Returns a Long representing the given 32 bit integer value. * Long.**fromNumber**(value: `number`, unsigned?: `boolean`): `Long`<br /> Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. * Long.**fromString**(str: `string`, unsigned?: `boolean`, radix?: `number`)<br /> Long.**fromString**(str: `string`, radix: `number`)<br /> Returns a Long representation of the given string, written using the specified radix. * Long.**fromValue**(val: `*`, unsigned?: `boolean`): `Long`<br /> Converts the specified value to a Long using the appropriate from* function for its type. ### Methods * Long#**add**(addend: `Long | number | string`): `Long`<br /> Returns the sum of this and the specified Long. * Long#**and**(other: `Long | number | string`): `Long`<br /> Returns the bitwise AND of this Long and the specified. * Long#**compare**/**comp**(other: `Long | number | string`): `number`<br /> Compares this Long's value with the specified's. Returns `0` if they are the same, `1` if the this is greater and `-1` if the given one is greater. * Long#**divide**/**div**(divisor: `Long | number | string`): `Long`<br /> Returns this Long divided by the specified. * Long#**equals**/**eq**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value equals the specified's. * Long#**getHighBits**(): `number`<br /> Gets the high 32 bits as a signed integer. * Long#**getHighBitsUnsigned**(): `number`<br /> Gets the high 32 bits as an unsigned integer. * Long#**getLowBits**(): `number`<br /> Gets the low 32 bits as a signed integer. * Long#**getLowBitsUnsigned**(): `number`<br /> Gets the low 32 bits as an unsigned integer. * Long#**getNumBitsAbs**(): `number`<br /> Gets the number of bits needed to represent the absolute value of this Long. * Long#**greaterThan**/**gt**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value is greater than the specified's. * Long#**greaterThanOrEqual**/**gte**/**ge**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value is greater than or equal the specified's. * Long#**isEven**(): `boolean`<br /> Tests if this Long's value is even. * Long#**isNegative**(): `boolean`<br /> Tests if this Long's value is negative. * Long#**isOdd**(): `boolean`<br /> Tests if this Long's value is odd. * Long#**isPositive**(): `boolean`<br /> Tests if this Long's value is positive. * Long#**isZero**/**eqz**(): `boolean`<br /> Tests if this Long's value equals zero. * Long#**lessThan**/**lt**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value is less than the specified's. * Long#**lessThanOrEqual**/**lte**/**le**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value is less than or equal the specified's. * Long#**modulo**/**mod**/**rem**(divisor: `Long | number | string`): `Long`<br /> Returns this Long modulo the specified. * Long#**multiply**/**mul**(multiplier: `Long | number | string`): `Long`<br /> Returns the product of this and the specified Long. * Long#**negate**/**neg**(): `Long`<br /> Negates this Long's value. * Long#**not**(): `Long`<br /> Returns the bitwise NOT of this Long. * Long#**notEquals**/**neq**/**ne**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value differs from the specified's. * Long#**or**(other: `Long | number | string`): `Long`<br /> Returns the bitwise OR of this Long and the specified. * Long#**shiftLeft**/**shl**(numBits: `Long | number | string`): `Long`<br /> Returns this Long with bits shifted to the left by the given amount. * Long#**shiftRight**/**shr**(numBits: `Long | number | string`): `Long`<br /> Returns this Long with bits arithmetically shifted to the right by the given amount. * Long#**shiftRightUnsigned**/**shru**/**shr_u**(numBits: `Long | number | string`): `Long`<br /> Returns this Long with bits logically shifted to the right by the given amount. * Long#**subtract**/**sub**(subtrahend: `Long | number | string`): `Long`<br /> Returns the difference of this and the specified Long. * Long#**toBytes**(le?: `boolean`): `number[]`<br /> Converts this Long to its byte representation. * Long#**toBytesLE**(): `number[]`<br /> Converts this Long to its little endian byte representation. * Long#**toBytesBE**(): `number[]`<br /> Converts this Long to its big endian byte representation. * Long#**toInt**(): `number`<br /> Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. * Long#**toNumber**(): `number`<br /> Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). * Long#**toSigned**(): `Long`<br /> Converts this Long to signed. * Long#**toString**(radix?: `number`): `string`<br /> Converts the Long to a string written in the specified radix. * Long#**toUnsigned**(): `Long`<br /> Converts this Long to unsigned. * Long#**xor**(other: `Long | number | string`): `Long`<br /> Returns the bitwise XOR of this Long and the given one. Building -------- To build an UMD bundle to `dist/long.js`, run: ``` $> npm install $> npm run build ``` Running the [tests](./tests): ``` $> npm test ``` # cliui ![ci](https://github.com/yargs/cliui/workflows/ci/badge.svg) [![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) ![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/cliui) easily create complex multi-column command-line-interfaces. ## Example ```js const ui = require('cliui')() ui.div('Usage: $0 [command] [options]') ui.div({ text: 'Options:', padding: [2, 0, 1, 0] }) ui.div( { text: "-f, --file", width: 20, padding: [0, 4, 0, 4] }, { text: "the file to load." + chalk.green("(if this description is long it wraps).") , width: 20 }, { text: chalk.red("[required]"), align: 'right' } ) console.log(ui.toString()) ``` ## Deno/ESM Support As of `v7` `cliui` supports [Deno](https://github.com/denoland/deno) and [ESM](https://nodejs.org/api/esm.html#esm_ecmascript_modules): ```typescript import cliui from "https://deno.land/x/cliui/deno.ts"; const ui = cliui({}) ui.div('Usage: $0 [command] [options]') ui.div({ text: 'Options:', padding: [2, 0, 1, 0] }) ui.div({ text: "-f, --file", width: 20, padding: [0, 4, 0, 4] }) console.log(ui.toString()) ``` <img width="500" src="screenshot.png"> ## Layout DSL cliui exposes a simple layout DSL: If you create a single `ui.div`, passing a string rather than an object: * `\n`: characters will be interpreted as new rows. * `\t`: characters will be interpreted as new columns. * `\s`: characters will be interpreted as padding. **as an example...** ```js var ui = require('./')({ width: 60 }) ui.div( 'Usage: node ./bin/foo.js\n' + ' <regex>\t provide a regex\n' + ' <glob>\t provide a glob\t [required]' ) console.log(ui.toString()) ``` **will output:** ```shell Usage: node ./bin/foo.js <regex> provide a regex <glob> provide a glob [required] ``` ## Methods ```js cliui = require('cliui') ``` ### cliui({width: integer}) Specify the maximum width of the UI being generated. If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`. ### cliui({wrap: boolean}) Enable or disable the wrapping of text in a column. ### cliui.div(column, column, column) Create a row with any number of columns, a column can either be a string, or an object with the following options: * **text:** some text to place in the column. * **width:** the width of a column. * **align:** alignment, `right` or `center`. * **padding:** `[top, right, bottom, left]`. * **border:** should a border be placed around the div? ### cliui.span(column, column, column) Similar to `div`, except the next row will be appended without a new line being created. ### cliui.resetOutput() Resets the UI elements of the current cliui instance, maintaining the values set for `width` and `wrap`. # AssemblyScript Loader A convenient loader for [AssemblyScript](https://assemblyscript.org) modules. Demangles module exports to a friendly object structure compatible with TypeScript definitions and provides useful utility to read/write data from/to memory. [Documentation](https://assemblyscript.org/loader.html) Like `chown -R`. Takes the same arguments as `fs.chown()` ## Follow Redirects Drop-in replacement for Nodes `http` and `https` that automatically follows redirects. [![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) [![Build Status](https://travis-ci.org/follow-redirects/follow-redirects.svg?branch=master)](https://travis-ci.org/follow-redirects/follow-redirects) [![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master) [![Dependency Status](https://david-dm.org/follow-redirects/follow-redirects.svg)](https://david-dm.org/follow-redirects/follow-redirects) [![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) `follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback) modules, with the exception that they will seamlessly follow redirects. ```javascript var http = require('follow-redirects').http; var https = require('follow-redirects').https; http.get('http://bit.ly/900913', function (response) { response.on('data', function (chunk) { console.log(chunk); }); }).on('error', function (err) { console.error(err); }); ``` You can inspect the final redirected URL through the `responseUrl` property on the `response`. If no redirection happened, `responseUrl` is the original request URL. ```javascript https.request({ host: 'bitly.com', path: '/UHfDGO', }, function (response) { console.log(response.responseUrl); // 'http://duckduckgo.com/robots.txt' }); ``` ## Options ### Global options Global options are set directly on the `follow-redirects` module: ```javascript var followRedirects = require('follow-redirects'); followRedirects.maxRedirects = 10; followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB ``` The following global options are supported: - `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. - `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. ### Per-request options Per-request options are set by passing an `options` object: ```javascript var url = require('url'); var followRedirects = require('follow-redirects'); var options = url.parse('http://bit.ly/900913'); options.maxRedirects = 10; http.request(options); ``` In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback), the following per-request options are supported: - `followRedirects` (default: `true`) – whether redirects should be followed. - `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. - `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. - `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }` - `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object. ### Advanced usage By default, `follow-redirects` will use the Node.js default implementations of [`http`](https://nodejs.org/api/http.html) and [`https`](https://nodejs.org/api/https.html). To enable features such as caching and/or intermediate request tracking, you might instead want to wrap `follow-redirects` around custom protocol implementations: ```javascript var followRedirects = require('follow-redirects').wrap({ http: require('your-custom-http'), https: require('your-custom-https'), }); ``` Such custom protocols only need an implementation of the `request` method. ## Browserify Usage Due to the way `XMLHttpRequest` works, the `browserify` versions of `http` and `https` already follow redirects. If you are *only* targeting the browser, then this library has little value for you. If you want to write cross platform code for node and the browser, `follow-redirects` provides a great solution for making the native node modules behave the same as they do in browserified builds in the browser. To avoid bundling unnecessary code you should tell browserify to swap out `follow-redirects` with the standard modules when bundling. To make this easier, you need to change how you require the modules: ```javascript var http = require('follow-redirects/http'); var https = require('follow-redirects/https'); ``` You can then replace `follow-redirects` in your browserify configuration like so: ```javascript "browser": { "follow-redirects/http" : "http", "follow-redirects/https" : "https" } ``` The `browserify-http` module has not kept pace with node development, and no long behaves identically to the native module when running in the browser. If you are experiencing problems, you may want to check out [browserify-http-2](https://www.npmjs.com/package/http-browserify-2). It is more actively maintained and attempts to address a few of the shortcomings of `browserify-http`. In that case, your browserify config should look something like this: ```javascript "browser": { "follow-redirects/http" : "browserify-http-2/http", "follow-redirects/https" : "browserify-http-2/https" } ``` ## Contributing Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues) detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied by tests. You can run the test suite locally with a simple `npm test` command. ## Debug Logging `follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well. ## Authors - Olivier Lalonde (olalonde@gmail.com) - James Talmage (james@talmage.io) - [Ruben Verborgh](https://ruben.verborgh.org/) ## License [https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE](MIT License) binaryen.js =========== **binaryen.js** is a port of [Binaryen](https://github.com/WebAssembly/binaryen) to the Web, allowing you to generate [WebAssembly](https://webassembly.org) using a JavaScript API. <a href="https://github.com/AssemblyScript/binaryen.js/actions?query=workflow%3ABuild"><img src="https://img.shields.io/github/workflow/status/AssemblyScript/binaryen.js/Build/master?label=build&logo=github" alt="Build status" /></a> <a href="https://www.npmjs.com/package/binaryen"><img src="https://img.shields.io/npm/v/binaryen.svg?label=latest&color=007acc&logo=npm" alt="npm version" /></a> <a href="https://www.npmjs.com/package/binaryen"><img src="https://img.shields.io/npm/v/binaryen/nightly.svg?label=nightly&color=007acc&logo=npm" alt="npm nightly version" /></a> Usage ----- ``` $> npm install binaryen ``` ```js var binaryen = require("binaryen"); // Create a module with a single function var myModule = new binaryen.Module(); myModule.addFunction("add", binaryen.createType([ binaryen.i32, binaryen.i32 ]), binaryen.i32, [ binaryen.i32 ], myModule.block(null, [ myModule.local.set(2, myModule.i32.add( myModule.local.get(0, binaryen.i32), myModule.local.get(1, binaryen.i32) ) ), myModule.return( myModule.local.get(2, binaryen.i32) ) ]) ); myModule.addFunctionExport("add", "add"); // Optimize the module using default passes and levels myModule.optimize(); // Validate the module if (!myModule.validate()) throw new Error("validation error"); // Generate text format and binary var textData = myModule.emitText(); var wasmData = myModule.emitBinary(); // Example usage with the WebAssembly API var compiled = new WebAssembly.Module(wasmData); var instance = new WebAssembly.Instance(compiled, {}); console.log(instance.exports.add(41, 1)); ``` The buildbot also publishes nightly versions once a day if there have been changes. The latest nightly can be installed through ``` $> npm install binaryen@nightly ``` or you can use one of the [previous versions](https://github.com/AssemblyScript/binaryen.js/tags) instead if necessary. ### Usage with a CDN * From GitHub via [jsDelivr](https://www.jsdelivr.com):<br /> `https://cdn.jsdelivr.net/gh/AssemblyScript/binaryen.js@VERSION/index.js` * From npm via [jsDelivr](https://www.jsdelivr.com):<br /> `https://cdn.jsdelivr.net/npm/binaryen@VERSION/index.js` * From npm via [unpkg](https://unpkg.com):<br /> `https://unpkg.com/binaryen@VERSION/index.js` Replace `VERSION` with a [specific version](https://github.com/AssemblyScript/binaryen.js/releases) or omit it (not recommended in production) to use master/latest. API --- **Please note** that the Binaryen API is evolving fast and that definitions and documentation provided by the package tend to get out of sync despite our best efforts. It's a bot after all. If you rely on binaryen.js and spot an issue, please consider sending a PR our way by updating [index.d.ts](./index.d.ts) and [README.md](./README.md) to reflect the [current API](https://github.com/WebAssembly/binaryen/blob/master/src/js/binaryen.js-post.js). <!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> ### Contents - [Types](#types) - [Module construction](#module-construction) - [Module manipulation](#module-manipulation) - [Module validation](#module-validation) - [Module optimization](#module-optimization) - [Module creation](#module-creation) - [Expression construction](#expression-construction) - [Control flow](#control-flow) - [Variable accesses](#variable-accesses) - [Integer operations](#integer-operations) - [Floating point operations](#floating-point-operations) - [Datatype conversions](#datatype-conversions) - [Function calls](#function-calls) - [Linear memory accesses](#linear-memory-accesses) - [Host operations](#host-operations) - [Vector operations 🦄](#vector-operations-) - [Atomic memory accesses 🦄](#atomic-memory-accesses-) - [Atomic read-modify-write operations 🦄](#atomic-read-modify-write-operations-) - [Atomic wait and notify operations 🦄](#atomic-wait-and-notify-operations-) - [Sign extension operations 🦄](#sign-extension-operations-) - [Multi-value operations 🦄](#multi-value-operations-) - [Exception handling operations 🦄](#exception-handling-operations-) - [Reference types operations 🦄](#reference-types-operations-) - [Expression manipulation](#expression-manipulation) - [Relooper](#relooper) - [Source maps](#source-maps) - [Debugging](#debugging) <!-- END doctoc generated TOC please keep comment here to allow auto update --> [Future features](http://webassembly.org/docs/future-features/) 🦄 might not be supported by all runtimes. ### Types * **none**: `Type`<br /> The none type, e.g., `void`. * **i32**: `Type`<br /> 32-bit integer type. * **i64**: `Type`<br /> 64-bit integer type. * **f32**: `Type`<br /> 32-bit float type. * **f64**: `Type`<br /> 64-bit float (double) type. * **v128**: `Type`<br /> 128-bit vector type. 🦄 * **funcref**: `Type`<br /> A function reference. 🦄 * **anyref**: `Type`<br /> Any host reference. 🦄 * **nullref**: `Type`<br /> A null reference. 🦄 * **exnref**: `Type`<br /> An exception reference. 🦄 * **unreachable**: `Type`<br /> Special type indicating unreachable code when obtaining information about an expression. * **auto**: `Type`<br /> Special type used in **Module#block** exclusively. Lets the API figure out a block's result type automatically. * **createType**(types: `Type[]`): `Type`<br /> Creates a multi-value type from an array of types. * **expandType**(type: `Type`): `Type[]`<br /> Expands a multi-value type to an array of types. ### Module construction * new **Module**()<br /> Constructs a new module. * **parseText**(text: `string`): `Module`<br /> Creates a module from Binaryen's s-expression text format (not official stack-style text format). * **readBinary**(data: `Uint8Array`): `Module`<br /> Creates a module from binary data. ### Module manipulation * Module#**addFunction**(name: `string`, params: `Type`, results: `Type`, vars: `Type[]`, body: `ExpressionRef`): `FunctionRef`<br /> Adds a function. `vars` indicate additional locals, in the given order. * Module#**getFunction**(name: `string`): `FunctionRef`<br /> Gets a function, by name, * Module#**removeFunction**(name: `string`): `void`<br /> Removes a function, by name. * Module#**getNumFunctions**(): `number`<br /> Gets the number of functions within the module. * Module#**getFunctionByIndex**(index: `number`): `FunctionRef`<br /> Gets the function at the specified index. * Module#**addFunctionImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, params: `Type`, results: `Type`): `void`<br /> Adds a function import. * Module#**addTableImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`): `void`<br /> Adds a table import. There's just one table for now, using name `"0"`. * Module#**addMemoryImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`): `void`<br /> Adds a memory import. There's just one memory for now, using name `"0"`. * Module#**addGlobalImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, globalType: `Type`): `void`<br /> Adds a global variable import. Imported globals must be immutable. * Module#**addFunctionExport**(internalName: `string`, externalName: `string`): `ExportRef`<br /> Adds a function export. * Module#**addTableExport**(internalName: `string`, externalName: `string`): `ExportRef`<br /> Adds a table export. There's just one table for now, using name `"0"`. * Module#**addMemoryExport**(internalName: `string`, externalName: `string`): `ExportRef`<br /> Adds a memory export. There's just one memory for now, using name `"0"`. * Module#**addGlobalExport**(internalName: `string`, externalName: `string`): `ExportRef`<br /> Adds a global variable export. Exported globals must be immutable. * Module#**getNumExports**(): `number`<br /> Gets the number of exports witin the module. * Module#**getExportByIndex**(index: `number`): `ExportRef`<br /> Gets the export at the specified index. * Module#**removeExport**(externalName: `string`): `void`<br /> Removes an export, by external name. * Module#**addGlobal**(name: `string`, type: `Type`, mutable: `number`, value: `ExpressionRef`): `GlobalRef`<br /> Adds a global instance variable. * Module#**getGlobal**(name: `string`): `GlobalRef`<br /> Gets a global, by name, * Module#**removeGlobal**(name: `string`): `void`<br /> Removes a global, by name. * Module#**setFunctionTable**(initial: `number`, maximum: `number`, funcs: `string[]`, offset?: `ExpressionRef`): `void`<br /> Sets the contents of the function table. There's just one table for now, using name `"0"`. * Module#**getFunctionTable**(): `{ imported: boolean, segments: TableElement[] }`<br /> Gets the contents of the function table. * TableElement#**offset**: `ExpressionRef` * TableElement#**names**: `string[]` * Module#**setMemory**(initial: `number`, maximum: `number`, exportName: `string | null`, segments: `MemorySegment[]`, flags?: `number[]`, shared?: `boolean`): `void`<br /> Sets the memory. There's just one memory for now, using name `"0"`. Providing `exportName` also creates a memory export. * MemorySegment#**offset**: `ExpressionRef` * MemorySegment#**data**: `Uint8Array` * MemorySegment#**passive**: `boolean` * Module#**getNumMemorySegments**(): `number`<br /> Gets the number of memory segments within the module. * Module#**getMemorySegmentInfoByIndex**(index: `number`): `MemorySegmentInfo`<br /> Gets information about the memory segment at the specified index. * MemorySegmentInfo#**offset**: `number` * MemorySegmentInfo#**data**: `Uint8Array` * MemorySegmentInfo#**passive**: `boolean` * Module#**setStart**(start: `FunctionRef`): `void`<br /> Sets the start function. * Module#**getFeatures**(): `Features`<br /> Gets the WebAssembly features enabled for this module. Note that the return value may be a bitmask indicating multiple features. Possible feature flags are: * Features.**MVP**: `Features` * Features.**Atomics**: `Features` * Features.**BulkMemory**: `Features` * Features.**MutableGlobals**: `Features` * Features.**NontrappingFPToInt**: `Features` * Features.**SignExt**: `Features` * Features.**SIMD128**: `Features` * Features.**ExceptionHandling**: `Features` * Features.**TailCall**: `Features` * Features.**ReferenceTypes**: `Features` * Features.**Multivalue**: `Features` * Features.**All**: `Features` * Module#**setFeatures**(features: `Features`): `void`<br /> Sets the WebAssembly features enabled for this module. * Module#**addCustomSection**(name: `string`, contents: `Uint8Array`): `void`<br /> Adds a custom section to the binary. * Module#**autoDrop**(): `void`<br /> Enables automatic insertion of `drop` operations where needed. Lets you not worry about dropping when creating your code. * **getFunctionInfo**(ftype: `FunctionRef`: `FunctionInfo`<br /> Obtains information about a function. * FunctionInfo#**name**: `string` * FunctionInfo#**module**: `string | null` (if imported) * FunctionInfo#**base**: `string | null` (if imported) * FunctionInfo#**params**: `Type` * FunctionInfo#**results**: `Type` * FunctionInfo#**vars**: `Type` * FunctionInfo#**body**: `ExpressionRef` * **getGlobalInfo**(global: `GlobalRef`): `GlobalInfo`<br /> Obtains information about a global. * GlobalInfo#**name**: `string` * GlobalInfo#**module**: `string | null` (if imported) * GlobalInfo#**base**: `string | null` (if imported) * GlobalInfo#**type**: `Type` * GlobalInfo#**mutable**: `boolean` * GlobalInfo#**init**: `ExpressionRef` * **getExportInfo**(export_: `ExportRef`): `ExportInfo`<br /> Obtains information about an export. * ExportInfo#**kind**: `ExternalKind` * ExportInfo#**name**: `string` * ExportInfo#**value**: `string` Possible `ExternalKind` values are: * **ExternalFunction**: `ExternalKind` * **ExternalTable**: `ExternalKind` * **ExternalMemory**: `ExternalKind` * **ExternalGlobal**: `ExternalKind` * **ExternalEvent**: `ExternalKind` * **getEventInfo**(event: `EventRef`): `EventInfo`<br /> Obtains information about an event. * EventInfo#**name**: `string` * EventInfo#**module**: `string | null` (if imported) * EventInfo#**base**: `string | null` (if imported) * EventInfo#**attribute**: `number` * EventInfo#**params**: `Type` * EventInfo#**results**: `Type` * **getSideEffects**(expr: `ExpressionRef`, features: `FeatureFlags`): `SideEffects`<br /> Gets the side effects of the specified expression. * SideEffects.**None**: `SideEffects` * SideEffects.**Branches**: `SideEffects` * SideEffects.**Calls**: `SideEffects` * SideEffects.**ReadsLocal**: `SideEffects` * SideEffects.**WritesLocal**: `SideEffects` * SideEffects.**ReadsGlobal**: `SideEffects` * SideEffects.**WritesGlobal**: `SideEffects` * SideEffects.**ReadsMemory**: `SideEffects` * SideEffects.**WritesMemory**: `SideEffects` * SideEffects.**ImplicitTrap**: `SideEffects` * SideEffects.**IsAtomic**: `SideEffects` * SideEffects.**Throws**: `SideEffects` * SideEffects.**Any**: `SideEffects` ### Module validation * Module#**validate**(): `boolean`<br /> Validates the module. Returns `true` if valid, otherwise prints validation errors and returns `false`. ### Module optimization * Module#**optimize**(): `void`<br /> Optimizes the module using the default optimization passes. * Module#**optimizeFunction**(func: `FunctionRef | string`): `void`<br /> Optimizes a single function using the default optimization passes. * Module#**runPasses**(passes: `string[]`): `void`<br /> Runs the specified passes on the module. * Module#**runPassesOnFunction**(func: `FunctionRef | string`, passes: `string[]`): `void`<br /> Runs the specified passes on a single function. * **getOptimizeLevel**(): `number`<br /> Gets the currently set optimize level. `0`, `1`, `2` correspond to `-O0`, `-O1`, `-O2` (default), etc. * **setOptimizeLevel**(level: `number`): `void`<br /> Sets the optimization level to use. `0`, `1`, `2` correspond to `-O0`, `-O1`, `-O2` (default), etc. * **getShrinkLevel**(): `number`<br /> Gets the currently set shrink level. `0`, `1`, `2` correspond to `-O0`, `-Os` (default), `-Oz`. * **setShrinkLevel**(level: `number`): `void`<br /> Sets the shrink level to use. `0`, `1`, `2` correspond to `-O0`, `-Os` (default), `-Oz`. * **getDebugInfo**(): `boolean`<br /> Gets whether generating debug information is currently enabled or not. * **setDebugInfo**(on: `boolean`): `void`<br /> Enables or disables debug information in emitted binaries. * **getLowMemoryUnused**(): `boolean`<br /> Gets whether the low 1K of memory can be considered unused when optimizing. * **setLowMemoryUnused**(on: `boolean`): `void`<br /> Enables or disables whether the low 1K of memory can be considered unused when optimizing. * **getPassArgument**(key: `string`): `string | null`<br /> Gets the value of the specified arbitrary pass argument. * **setPassArgument**(key: `string`, value: `string | null`): `void`<br /> Sets the value of the specified arbitrary pass argument. Removes the respective argument if `value` is `null`. * **clearPassArguments**(): `void`<br /> Clears all arbitrary pass arguments. * **getAlwaysInlineMaxSize**(): `number`<br /> Gets the function size at which we always inline. * **setAlwaysInlineMaxSize**(size: `number`): `void`<br /> Sets the function size at which we always inline. * **getFlexibleInlineMaxSize**(): `number`<br /> Gets the function size which we inline when functions are lightweight. * **setFlexibleInlineMaxSize**(size: `number`): `void`<br /> Sets the function size which we inline when functions are lightweight. * **getOneCallerInlineMaxSize**(): `number`<br /> Gets the function size which we inline when there is only one caller. * **setOneCallerInlineMaxSize**(size: `number`): `void`<br /> Sets the function size which we inline when there is only one caller. ### Module creation * Module#**emitBinary**(): `Uint8Array`<br /> Returns the module in binary format. * Module#**emitBinary**(sourceMapUrl: `string | null`): `BinaryWithSourceMap`<br /> Returns the module in binary format with its source map. If `sourceMapUrl` is `null`, source map generation is skipped. * BinaryWithSourceMap#**binary**: `Uint8Array` * BinaryWithSourceMap#**sourceMap**: `string | null` * Module#**emitText**(): `string`<br /> Returns the module in Binaryen's s-expression text format (not official stack-style text format). * Module#**emitAsmjs**(): `string`<br /> Returns the [asm.js](http://asmjs.org/) representation of the module. * Module#**dispose**(): `void`<br /> Releases the resources held by the module once it isn't needed anymore. ### Expression construction #### [Control flow](http://webassembly.org/docs/semantics/#control-constructs-and-instructions) * Module#**block**(label: `string | null`, children: `ExpressionRef[]`, resultType?: `Type`): `ExpressionRef`<br /> Creates a block. `resultType` defaults to `none`. * Module#**if**(condition: `ExpressionRef`, ifTrue: `ExpressionRef`, ifFalse?: `ExpressionRef`): `ExpressionRef`<br /> Creates an if or if/else combination. * Module#**loop**(label: `string | null`, body: `ExpressionRef`): `ExpressionRef`<br /> Creates a loop. * Module#**br**(label: `string`, condition?: `ExpressionRef`, value?: `ExpressionRef`): `ExpressionRef`<br /> Creates a branch (br) to a label. * Module#**switch**(labels: `string[]`, defaultLabel: `string`, condition: `ExpressionRef`, value?: `ExpressionRef`): `ExpressionRef`<br /> Creates a switch (br_table). * Module#**nop**(): `ExpressionRef`<br /> Creates a no-operation (nop) instruction. * Module#**return**(value?: `ExpressionRef`): `ExpressionRef` Creates a return. * Module#**unreachable**(): `ExpressionRef`<br /> Creates an [unreachable](http://webassembly.org/docs/semantics/#unreachable) instruction that will always trap. * Module#**drop**(value: `ExpressionRef`): `ExpressionRef`<br /> Creates a [drop](http://webassembly.org/docs/semantics/#type-parametric-operators) of a value. * Module#**select**(condition: `ExpressionRef`, ifTrue: `ExpressionRef`, ifFalse: `ExpressionRef`, type?: `Type`): `ExpressionRef`<br /> Creates a [select](http://webassembly.org/docs/semantics/#type-parametric-operators) of one of two values. #### [Variable accesses](http://webassembly.org/docs/semantics/#local-variables) * Module#**local.get**(index: `number`, type: `Type`): `ExpressionRef`<br /> Creates a local.get for the local at the specified index. Note that we must specify the type here as we may not have created the local being accessed yet. * Module#**local.set**(index: `number`, value: `ExpressionRef`): `ExpressionRef`<br /> Creates a local.set for the local at the specified index. * Module#**local.tee**(index: `number`, value: `ExpressionRef`, type: `Type`): `ExpressionRef`<br /> Creates a local.tee for the local at the specified index. A tee differs from a set in that the value remains on the stack. Note that we must specify the type here as we may not have created the local being accessed yet. * Module#**global.get**(name: `string`, type: `Type`): `ExpressionRef`<br /> Creates a global.get for the global with the specified name. Note that we must specify the type here as we may not have created the global being accessed yet. * Module#**global.set**(name: `string`, value: `ExpressionRef`): `ExpressionRef`<br /> Creates a global.set for the global with the specified name. #### [Integer operations](http://webassembly.org/docs/semantics/#32-bit-integer-operators) * Module#i32.**const**(value: `number`): `ExpressionRef` * Module#i32.**clz**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**ctz**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**popcnt**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**eqz**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**div_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**div_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**rem_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**rem_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**shl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**shr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**shr_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**rotl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**rotr**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**le_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` > * Module#i64.**const**(value: `number`): `ExpressionRef` * Module#i64.**clz**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**ctz**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**popcnt**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**eqz**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**div_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**div_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**rem_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**rem_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**shl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**shr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**shr_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**rotl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**rotr**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**le_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` #### [Floating point operations](http://webassembly.org/docs/semantics/#floating-point-operators) * Module#f32.**const**(value: `number`): `ExpressionRef` * Module#f32.**const_bits**(value: `number`): `ExpressionRef` * Module#f32.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**abs**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**ceil**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**floor**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**trunc**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**nearest**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**sqrt**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**copysign**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` > * Module#f64.**const**(value: `number`): `ExpressionRef` * Module#f64.**const_bits**(value: `number`): `ExpressionRef` * Module#f64.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**abs**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**ceil**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**floor**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**trunc**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**nearest**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**sqrt**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**copysign**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` #### [Datatype conversions](http://webassembly.org/docs/semantics/#datatype-conversions-truncations-reinterpretations-promotions-and-demotions) * Module#i32.**trunc_s.f32**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**trunc_s.f64**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**trunc_u.f32**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**trunc_u.f64**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**reinterpret**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**wrap**(value: `ExpressionRef`): `ExpressionRef` > * Module#i64.**trunc_s.f32**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**trunc_s.f64**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**trunc_u.f32**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**trunc_u.f64**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**reinterpret**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**extend_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**extend_u**(value: `ExpressionRef`): `ExpressionRef` > * Module#f32.**reinterpret**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**convert_s.i32**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**convert_s.i64**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**convert_u.i32**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**convert_u.i64**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**demote**(value: `ExpressionRef`): `ExpressionRef` > * Module#f64.**reinterpret**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**convert_s.i32**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**convert_s.i64**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**convert_u.i32**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**convert_u.i64**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**promote**(value: `ExpressionRef`): `ExpressionRef` #### [Function calls](http://webassembly.org/docs/semantics/#calls) * Module#**call**(name: `string`, operands: `ExpressionRef[]`, returnType: `Type`): `ExpressionRef` Creates a call to a function. Note that we must specify the return type here as we may not have created the function being called yet. * Module#**return_call**(name: `string`, operands: `ExpressionRef[]`, returnType: `Type`): `ExpressionRef`<br /> Like **call**, but creates a tail-call. 🦄 * Module#**call_indirect**(target: `ExpressionRef`, operands: `ExpressionRef[]`, params: `Type`, results: `Type`): `ExpressionRef`<br /> Similar to **call**, but calls indirectly, i.e., via a function pointer, so an expression replaces the name as the called value. * Module#**return_call_indirect**(target: `ExpressionRef`, operands: `ExpressionRef[]`, params: `Type`, results: `Type`): `ExpressionRef`<br /> Like **call_indirect**, but creates a tail-call. 🦄 #### [Linear memory accesses](http://webassembly.org/docs/semantics/#linear-memory-accesses) * Module#i32.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**load8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**load8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**load16_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**load16_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**store8**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**store16**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br /> > * Module#i64.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load16_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load16_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load32_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load32_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**store8**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**store16**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**store32**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` > * Module#f32.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#f32.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` > * Module#f64.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#f64.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` #### [Host operations](http://webassembly.org/docs/semantics/#resizing) * Module#**memory.size**(): `ExpressionRef` * Module#**memory.grow**(value: `number`): `ExpressionRef` #### [Vector operations](https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md) 🦄 * Module#v128.**const**(bytes: `Uint8Array`): `ExpressionRef` * Module#v128.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#v128.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#v128.**not**(value: `ExpressionRef`): `ExpressionRef` * Module#v128.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v128.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v128.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v128.**andnot**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v128.**bitselect**(left: `ExpressionRef`, right: `ExpressionRef`, cond: `ExpressionRef`): `ExpressionRef` > * Module#i8x16.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i8x16.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i8x16.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**any_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**all_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**add_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**add_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**sub_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**sub_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**avgr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**narrow_i16x8_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**narrow_i16x8_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` > * Module#i16x8.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i16x8.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i16x8.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**any_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**all_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**add_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**add_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**sub_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**sub_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**avgr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**narrow_i32x4_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**narrow_i32x4_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**widen_low_i8x16_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**widen_high_i8x16_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**widen_low_i8x16_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**widen_high_i8x16_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**load8x8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**load8x8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#i32x4.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i32x4.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i32x4.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**any_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**all_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**dot_i16x8_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**trunc_sat_f32x4_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**trunc_sat_f32x4_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**widen_low_i16x8_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**widen_high_i16x8_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**widen_low_i16x8_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**widen_high_i16x8_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**load16x4_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**load16x4_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#i64x2.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i64x2.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i64x2.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**any_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**all_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**trunc_sat_f64x2_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**trunc_sat_f64x2_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**load32x2_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**load32x2_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#f32x4.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**extract_lane**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#f32x4.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**abs**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**sqrt**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**qfma**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**qfms**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**convert_i32x4_s**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**convert_i32x4_u**(value: `ExpressionRef`): `ExpressionRef` > * Module#f64x2.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**extract_lane**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#f64x2.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**abs**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**sqrt**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**qfma**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**qfms**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**convert_i64x2_s**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**convert_i64x2_u**(value: `ExpressionRef`): `ExpressionRef` > * Module#v8x16.**shuffle**(left: `ExpressionRef`, right: `ExpressionRef`, mask: `Uint8Array`): `ExpressionRef` * Module#v8x16.**swizzle**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v8x16.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#v16x8.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#v32x4.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#v64x2.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` #### [Atomic memory accesses](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#atomic-memory-accesses) 🦄 * Module#i32.**atomic.load**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.load8_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.load16_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.store**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.store8**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.store16**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` > * Module#i64.**atomic.load**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.load8_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.load16_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.load32_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.store**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.store8**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.store16**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.store32**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` #### [Atomic read-modify-write operations](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#read-modify-write) 🦄 * Module#i32.**atomic.rmw.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` > * Module#i64.**atomic.rmw.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` #### [Atomic wait and notify operations](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-notify-operators) 🦄 * Module#i32.**atomic.wait**(ptr: `ExpressionRef`, expected: `ExpressionRef`, timeout: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.wait**(ptr: `ExpressionRef`, expected: `ExpressionRef`, timeout: `ExpressionRef`): `ExpressionRef` * Module#**atomic.notify**(ptr: `ExpressionRef`, notifyCount: `ExpressionRef`): `ExpressionRef` * Module#**atomic.fence**(): `ExpressionRef` #### [Sign extension operations](https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md) 🦄 * Module#i32.**extend8_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**extend16_s**(value: `ExpressionRef`): `ExpressionRef` > * Module#i64.**extend8_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**extend16_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**extend32_s**(value: `ExpressionRef`): `ExpressionRef` #### [Multi-value operations](https://github.com/WebAssembly/multi-value/blob/master/proposals/multi-value/Overview.md) 🦄 Note that these are pseudo instructions enabling Binaryen to reason about multiple values on the stack. * Module#**push**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**pop**(): `ExpressionRef` * Module#i64.**pop**(): `ExpressionRef` * Module#f32.**pop**(): `ExpressionRef` * Module#f64.**pop**(): `ExpressionRef` * Module#v128.**pop**(): `ExpressionRef` * Module#funcref.**pop**(): `ExpressionRef` * Module#anyref.**pop**(): `ExpressionRef` * Module#nullref.**pop**(): `ExpressionRef` * Module#exnref.**pop**(): `ExpressionRef` * Module#tuple.**make**(elements: `ExpressionRef[]`): `ExpressionRef` * Module#tuple.**extract**(tuple: `ExpressionRef`, index: `number`): `ExpressionRef` #### [Exception handling operations](https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md) 🦄 * Module#**try**(body: `ExpressionRef`, catchBody: `ExpressionRef`): `ExpressionRef` * Module#**throw**(event: `string`, operands: `ExpressionRef[]`): `ExpressionRef` * Module#**rethrow**(exnref: `ExpressionRef`): `ExpressionRef` * Module#**br_on_exn**(label: `string`, event: `string`, exnref: `ExpressionRef`): `ExpressionRef` > * Module#**addEvent**(name: `string`, attribute: `number`, params: `Type`, results: `Type`): `Event` * Module#**getEvent**(name: `string`): `Event` * Module#**removeEvent**(name: `stirng`): `void` * Module#**addEventImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, attribute: `number`, params: `Type`, results: `Type`): `void` * Module#**addEventExport**(internalName: `string`, externalName: `string`): `ExportRef` #### [Reference types operations](https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md) 🦄 * Module#ref.**null**(): `ExpressionRef` * Module#ref.**is_null**(value: `ExpressionRef`): `ExpressionRef` * Module#ref.**func**(name: `string`): `ExpressionRef` ### Expression manipulation * **getExpressionId**(expr: `ExpressionRef`): `ExpressionId`<br /> Gets the id (kind) of the specified expression. Possible values are: * **InvalidId**: `ExpressionId` * **BlockId**: `ExpressionId` * **IfId**: `ExpressionId` * **LoopId**: `ExpressionId` * **BreakId**: `ExpressionId` * **SwitchId**: `ExpressionId` * **CallId**: `ExpressionId` * **CallIndirectId**: `ExpressionId` * **LocalGetId**: `ExpressionId` * **LocalSetId**: `ExpressionId` * **GlobalGetId**: `ExpressionId` * **GlobalSetId**: `ExpressionId` * **LoadId**: `ExpressionId` * **StoreId**: `ExpressionId` * **ConstId**: `ExpressionId` * **UnaryId**: `ExpressionId` * **BinaryId**: `ExpressionId` * **SelectId**: `ExpressionId` * **DropId**: `ExpressionId` * **ReturnId**: `ExpressionId` * **HostId**: `ExpressionId` * **NopId**: `ExpressionId` * **UnreachableId**: `ExpressionId` * **AtomicCmpxchgId**: `ExpressionId` * **AtomicRMWId**: `ExpressionId` * **AtomicWaitId**: `ExpressionId` * **AtomicNotifyId**: `ExpressionId` * **AtomicFenceId**: `ExpressionId` * **SIMDExtractId**: `ExpressionId` * **SIMDReplaceId**: `ExpressionId` * **SIMDShuffleId**: `ExpressionId` * **SIMDTernaryId**: `ExpressionId` * **SIMDShiftId**: `ExpressionId` * **SIMDLoadId**: `ExpressionId` * **MemoryInitId**: `ExpressionId` * **DataDropId**: `ExpressionId` * **MemoryCopyId**: `ExpressionId` * **MemoryFillId**: `ExpressionId` * **RefNullId**: `ExpressionId` * **RefIsNullId**: `ExpressionId` * **RefFuncId**: `ExpressionId` * **TryId**: `ExpressionId` * **ThrowId**: `ExpressionId` * **RethrowId**: `ExpressionId` * **BrOnExnId**: `ExpressionId` * **PushId**: `ExpressionId` * **PopId**: `ExpressionId` * **getExpressionType**(expr: `ExpressionRef`): `Type`<br /> Gets the type of the specified expression. * **getExpressionInfo**(expr: `ExpressionRef`): `ExpressionInfo`<br /> Obtains information about an expression, always including: * Info#**id**: `ExpressionId` * Info#**type**: `Type` Additional properties depend on the expression's `id` and are usually equivalent to the respective parameters when creating such an expression: * BlockInfo#**name**: `string` * BlockInfo#**children**: `ExpressionRef[]` > * IfInfo#**condition**: `ExpressionRef` * IfInfo#**ifTrue**: `ExpressionRef` * IfInfo#**ifFalse**: `ExpressionRef | null` > * LoopInfo#**name**: `string` * LoopInfo#**body**: `ExpressionRef` > * BreakInfo#**name**: `string` * BreakInfo#**condition**: `ExpressionRef | null` * BreakInfo#**value**: `ExpressionRef | null` > * SwitchInfo#**names**: `string[]` * SwitchInfo#**defaultName**: `string | null` * SwitchInfo#**condition**: `ExpressionRef` * SwitchInfo#**value**: `ExpressionRef | null` > * CallInfo#**target**: `string` * CallInfo#**operands**: `ExpressionRef[]` > * CallImportInfo#**target**: `string` * CallImportInfo#**operands**: `ExpressionRef[]` > * CallIndirectInfo#**target**: `ExpressionRef` * CallIndirectInfo#**operands**: `ExpressionRef[]` > * LocalGetInfo#**index**: `number` > * LocalSetInfo#**isTee**: `boolean` * LocalSetInfo#**index**: `number` * LocalSetInfo#**value**: `ExpressionRef` > * GlobalGetInfo#**name**: `string` > * GlobalSetInfo#**name**: `string` * GlobalSetInfo#**value**: `ExpressionRef` > * LoadInfo#**isAtomic**: `boolean` * LoadInfo#**isSigned**: `boolean` * LoadInfo#**offset**: `number` * LoadInfo#**bytes**: `number` * LoadInfo#**align**: `number` * LoadInfo#**ptr**: `ExpressionRef` > * StoreInfo#**isAtomic**: `boolean` * StoreInfo#**offset**: `number` * StoreInfo#**bytes**: `number` * StoreInfo#**align**: `number` * StoreInfo#**ptr**: `ExpressionRef` * StoreInfo#**value**: `ExpressionRef` > * ConstInfo#**value**: `number | { low: number, high: number }` > * UnaryInfo#**op**: `number` * UnaryInfo#**value**: `ExpressionRef` > * BinaryInfo#**op**: `number` * BinaryInfo#**left**: `ExpressionRef` * BinaryInfo#**right**: `ExpressionRef` > * SelectInfo#**ifTrue**: `ExpressionRef` * SelectInfo#**ifFalse**: `ExpressionRef` * SelectInfo#**condition**: `ExpressionRef` > * DropInfo#**value**: `ExpressionRef` > * ReturnInfo#**value**: `ExpressionRef | null` > * NopInfo > * UnreachableInfo > * HostInfo#**op**: `number` * HostInfo#**nameOperand**: `string | null` * HostInfo#**operands**: `ExpressionRef[]` > * AtomicRMWInfo#**op**: `number` * AtomicRMWInfo#**bytes**: `number` * AtomicRMWInfo#**offset**: `number` * AtomicRMWInfo#**ptr**: `ExpressionRef` * AtomicRMWInfo#**value**: `ExpressionRef` > * AtomicCmpxchgInfo#**bytes**: `number` * AtomicCmpxchgInfo#**offset**: `number` * AtomicCmpxchgInfo#**ptr**: `ExpressionRef` * AtomicCmpxchgInfo#**expected**: `ExpressionRef` * AtomicCmpxchgInfo#**replacement**: `ExpressionRef` > * AtomicWaitInfo#**ptr**: `ExpressionRef` * AtomicWaitInfo#**expected**: `ExpressionRef` * AtomicWaitInfo#**timeout**: `ExpressionRef` * AtomicWaitInfo#**expectedType**: `Type` > * AtomicNotifyInfo#**ptr**: `ExpressionRef` * AtomicNotifyInfo#**notifyCount**: `ExpressionRef` > * AtomicFenceInfo > * SIMDExtractInfo#**op**: `Op` * SIMDExtractInfo#**vec**: `ExpressionRef` * SIMDExtractInfo#**index**: `ExpressionRef` > * SIMDReplaceInfo#**op**: `Op` * SIMDReplaceInfo#**vec**: `ExpressionRef` * SIMDReplaceInfo#**index**: `ExpressionRef` * SIMDReplaceInfo#**value**: `ExpressionRef` > * SIMDShuffleInfo#**left**: `ExpressionRef` * SIMDShuffleInfo#**right**: `ExpressionRef` * SIMDShuffleInfo#**mask**: `Uint8Array` > * SIMDTernaryInfo#**op**: `Op` * SIMDTernaryInfo#**a**: `ExpressionRef` * SIMDTernaryInfo#**b**: `ExpressionRef` * SIMDTernaryInfo#**c**: `ExpressionRef` > * SIMDShiftInfo#**op**: `Op` * SIMDShiftInfo#**vec**: `ExpressionRef` * SIMDShiftInfo#**shift**: `ExpressionRef` > * SIMDLoadInfo#**op**: `Op` * SIMDLoadInfo#**offset**: `number` * SIMDLoadInfo#**align**: `number` * SIMDLoadInfo#**ptr**: `ExpressionRef` > * MemoryInitInfo#**segment**: `number` * MemoryInitInfo#**dest**: `ExpressionRef` * MemoryInitInfo#**offset**: `ExpressionRef` * MemoryInitInfo#**size**: `ExpressionRef` > * MemoryDropInfo#**segment**: `number` > * MemoryCopyInfo#**dest**: `ExpressionRef` * MemoryCopyInfo#**source**: `ExpressionRef` * MemoryCopyInfo#**size**: `ExpressionRef` > * MemoryFillInfo#**dest**: `ExpressionRef` * MemoryFillInfo#**value**: `ExpressionRef` * MemoryFillInfo#**size**: `ExpressionRef` > * TryInfo#**body**: `ExpressionRef` * TryInfo#**catchBody**: `ExpressionRef` > * RefNullInfo > * RefIsNullInfo#**value**: `ExpressionRef` > * RefFuncInfo#**func**: `string` > * ThrowInfo#**event**: `string` * ThrowInfo#**operands**: `ExpressionRef[]` > * RethrowInfo#**exnref**: `ExpressionRef` > * BrOnExnInfo#**name**: `string` * BrOnExnInfo#**event**: `string` * BrOnExnInfo#**exnref**: `ExpressionRef` > * PopInfo > * PushInfo#**value**: `ExpressionRef` * **emitText**(expression: `ExpressionRef`): `string`<br /> Emits the expression in Binaryen's s-expression text format (not official stack-style text format). * **copyExpression**(expression: `ExpressionRef`): `ExpressionRef`<br /> Creates a deep copy of an expression. ### Relooper * new **Relooper**()<br /> Constructs a relooper instance. This lets you provide an arbitrary CFG, and the relooper will structure it for WebAssembly. * Relooper#**addBlock**(code: `ExpressionRef`): `RelooperBlockRef`<br /> Adds a new block to the CFG, containing the provided code as its body. * Relooper#**addBranch**(from: `RelooperBlockRef`, to: `RelooperBlockRef`, condition: `ExpressionRef`, code: `ExpressionRef`): `void`<br /> Adds a branch from a block to another block, with a condition (or nothing, if this is the default branch to take from the origin - each block must have one such branch), and optional code to execute on the branch (useful for phis). * Relooper#**addBlockWithSwitch**(code: `ExpressionRef`, condition: `ExpressionRef`): `RelooperBlockRef`<br /> Adds a new block, which ends with a switch/br_table, with provided code and condition (that determines where we go in the switch). * Relooper#**addBranchForSwitch**(from: `RelooperBlockRef`, to: `RelooperBlockRef`, indexes: `number[]`, code: `ExpressionRef`): `void`<br /> Adds a branch from a block ending in a switch, to another block, using an array of indexes that determine where to go, and optional code to execute on the branch. * Relooper#**renderAndDispose**(entry: `RelooperBlockRef`, labelHelper: `number`, module: `Module`): `ExpressionRef`<br /> Renders and cleans up the Relooper instance. Call this after you have created all the blocks and branches, giving it the entry block (where control flow begins), a label helper variable (an index of a local we can use, necessary for irreducible control flow), and the module. This returns an expression - normal WebAssembly code - that you can use normally anywhere. ### Source maps * Module#**addDebugInfoFileName**(filename: `string`): `number`<br /> Adds a debug info file name to the module and returns its index. * Module#**getDebugInfoFileName**(index: `number`): `string | null` <br /> Gets the name of the debug info file at the specified index. * Module#**setDebugLocation**(func: `FunctionRef`, expr: `ExpressionRef`, fileIndex: `number`, lineNumber: `number`, columnNumber: `number`): `void`<br /> Sets the debug location of the specified `ExpressionRef` within the specified `FunctionRef`. ### Debugging * Module#**interpret**(): `void`<br /> Runs the module in the interpreter, calling the start function. # node-tar [![Build Status](https://travis-ci.org/npm/node-tar.svg?branch=master)](https://travis-ci.org/npm/node-tar) [Fast](./benchmarks) and full-featured Tar for Node.js The API is designed to mimic the behavior of `tar(1)` on unix systems. If you are familiar with how tar works, most of this will hopefully be straightforward for you. If not, then hopefully this module can teach you useful unix skills that may come in handy someday :) ## Background A "tar file" or "tarball" is an archive of file system entries (directories, files, links, etc.) The name comes from "tape archive". If you run `man tar` on almost any Unix command line, you'll learn quite a bit about what it can do, and its history. Tar has 5 main top-level commands: * `c` Create an archive * `r` Replace entries within an archive * `u` Update entries within an archive (ie, replace if they're newer) * `t` List out the contents of an archive * `x` Extract an archive to disk The other flags and options modify how this top level function works. ## High-Level API These 5 functions are the high-level API. All of them have a single-character name (for unix nerds familiar with `tar(1)`) as well as a long name (for everyone else). All the high-level functions take the following arguments, all three of which are optional and may be omitted. 1. `options` - An optional object specifying various options 2. `paths` - An array of paths to add or extract 3. `callback` - Called when the command is completed, if async. (If sync or no file specified, providing a callback throws a `TypeError`.) If the command is sync (ie, if `options.sync=true`), then the callback is not allowed, since the action will be completed immediately. If a `file` argument is specified, and the command is async, then a `Promise` is returned. In this case, if async, a callback may be provided which is called when the command is completed. If a `file` option is not specified, then a stream is returned. For `create`, this is a readable stream of the generated archive. For `list` and `extract` this is a writable stream that an archive should be written into. If a file is not specified, then a callback is not allowed, because you're already getting a stream to work with. `replace` and `update` only work on existing archives, and so require a `file` argument. Sync commands without a file argument return a stream that acts on its input immediately in the same tick. For readable streams, this means that all of the data is immediately available by calling `stream.read()`. For writable streams, it will be acted upon as soon as it is provided, but this can be at any time. ### Warnings and Errors Tar emits warnings and errors for recoverable and unrecoverable situations, respectively. In many cases, a warning only affects a single entry in an archive, or is simply informing you that it's modifying an entry to comply with the settings provided. Unrecoverable warnings will always raise an error (ie, emit `'error'` on streaming actions, throw for non-streaming sync actions, reject the returned Promise for non-streaming async operations, or call a provided callback with an `Error` as the first argument). Recoverable errors will raise an error only if `strict: true` is set in the options. Respond to (recoverable) warnings by listening to the `warn` event. Handlers receive 3 arguments: - `code` String. One of the error codes below. This may not match `data.code`, which preserves the original error code from fs and zlib. - `message` String. More details about the error. - `data` Metadata about the error. An `Error` object for errors raised by fs and zlib. All fields are attached to errors raisd by tar. Typically contains the following fields, as relevant: - `tarCode` The tar error code. - `code` Either the tar error code, or the error code set by the underlying system. - `file` The archive file being read or written. - `cwd` Working directory for creation and extraction operations. - `entry` The entry object (if it could be created) for `TAR_ENTRY_INFO`, `TAR_ENTRY_INVALID`, and `TAR_ENTRY_ERROR` warnings. - `header` The header object (if it could be created, and the entry could not be created) for `TAR_ENTRY_INFO` and `TAR_ENTRY_INVALID` warnings. - `recoverable` Boolean. If `false`, then the warning will emit an `error`, even in non-strict mode. #### Error Codes * `TAR_ENTRY_INFO` An informative error indicating that an entry is being modified, but otherwise processed normally. For example, removing `/` or `C:\` from absolute paths if `preservePaths` is not set. * `TAR_ENTRY_INVALID` An indication that a given entry is not a valid tar archive entry, and will be skipped. This occurs when: - a checksum fails, - a `linkpath` is missing for a link type, or - a `linkpath` is provided for a non-link type. If every entry in a parsed archive raises an `TAR_ENTRY_INVALID` error, then the archive is presumed to be unrecoverably broken, and `TAR_BAD_ARCHIVE` will be raised. * `TAR_ENTRY_ERROR` The entry appears to be a valid tar archive entry, but encountered an error which prevented it from being unpacked. This occurs when: - an unrecoverable fs error happens during unpacking, - an entry has `..` in the path and `preservePaths` is not set, or - an entry is extracting through a symbolic link, when `preservePaths` is not set. * `TAR_ENTRY_UNSUPPORTED` An indication that a given entry is a valid archive entry, but of a type that is unsupported, and so will be skipped in archive creation or extracting. * `TAR_ABORT` When parsing gzipped-encoded archives, the parser will abort the parse process raise a warning for any zlib errors encountered. Aborts are considered unrecoverable for both parsing and unpacking. * `TAR_BAD_ARCHIVE` The archive file is totally hosed. This can happen for a number of reasons, and always occurs at the end of a parse or extract: - An entry body was truncated before seeing the full number of bytes. - The archive contained only invalid entries, indicating that it is likely not an archive, or at least, not an archive this library can parse. `TAR_BAD_ARCHIVE` is considered informative for parse operations, but unrecoverable for extraction. Note that, if encountered at the end of an extraction, tar WILL still have extracted as much it could from the archive, so there may be some garbage files to clean up. Errors that occur deeper in the system (ie, either the filesystem or zlib) will have their error codes left intact, and a `tarCode` matching one of the above will be added to the warning metadata or the raised error object. Errors generated by tar will have one of the above codes set as the `error.code` field as well, but since errors originating in zlib or fs will have their original codes, it's better to read `error.tarCode` if you wish to see how tar is handling the issue. ### Examples The API mimics the `tar(1)` command line functionality, with aliases for more human-readable option and function names. The goal is that if you know how to use `tar(1)` in Unix, then you know how to use `require('tar')` in JavaScript. To replicate `tar czf my-tarball.tgz files and folders`, you'd do: ```js tar.c( { gzip: <true|gzip options>, file: 'my-tarball.tgz' }, ['some', 'files', 'and', 'folders'] ).then(_ => { .. tarball has been created .. }) ``` To replicate `tar cz files and folders > my-tarball.tgz`, you'd do: ```js tar.c( // or tar.create { gzip: <true|gzip options> }, ['some', 'files', 'and', 'folders'] ).pipe(fs.createWriteStream('my-tarball.tgz')) ``` To replicate `tar xf my-tarball.tgz` you'd do: ```js tar.x( // or tar.extract( { file: 'my-tarball.tgz' } ).then(_=> { .. tarball has been dumped in cwd .. }) ``` To replicate `cat my-tarball.tgz | tar x -C some-dir --strip=1`: ```js fs.createReadStream('my-tarball.tgz').pipe( tar.x({ strip: 1, C: 'some-dir' // alias for cwd:'some-dir', also ok }) ) ``` To replicate `tar tf my-tarball.tgz`, do this: ```js tar.t({ file: 'my-tarball.tgz', onentry: entry => { .. do whatever with it .. } }) ``` To replicate `cat my-tarball.tgz | tar t` do: ```js fs.createReadStream('my-tarball.tgz') .pipe(tar.t()) .on('entry', entry => { .. do whatever with it .. }) ``` To do anything synchronous, add `sync: true` to the options. Note that sync functions don't take a callback and don't return a promise. When the function returns, it's already done. Sync methods without a file argument return a sync stream, which flushes immediately. But, of course, it still won't be done until you `.end()` it. To filter entries, add `filter: <function>` to the options. Tar-creating methods call the filter with `filter(path, stat)`. Tar-reading methods (including extraction) call the filter with `filter(path, entry)`. The filter is called in the `this`-context of the `Pack` or `Unpack` stream object. The arguments list to `tar t` and `tar x` specify a list of filenames to extract or list, so they're equivalent to a filter that tests if the file is in the list. For those who _aren't_ fans of tar's single-character command names: ``` tar.c === tar.create tar.r === tar.replace (appends to archive, file is required) tar.u === tar.update (appends if newer, file is required) tar.x === tar.extract tar.t === tar.list ``` Keep reading for all the command descriptions and options, as well as the low-level API that they are built on. ### tar.c(options, fileList, callback) [alias: tar.create] Create a tarball archive. The `fileList` is an array of paths to add to the tarball. Adding a directory also adds its children recursively. An entry in `fileList` that starts with an `@` symbol is a tar archive whose entries will be added. To add a file that starts with `@`, prepend it with `./`. The following options are supported: - `file` Write the tarball archive to the specified filename. If this is specified, then the callback will be fired when the file has been written, and a promise will be returned that resolves when the file is written. If a filename is not specified, then a Readable Stream will be returned which will emit the file data. [Alias: `f`] - `sync` Act synchronously. If this is set, then any provided file will be fully written after the call to `tar.c`. If this is set, and a file is not provided, then the resulting stream will already have the data ready to `read` or `emit('data')` as soon as you request it. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `strict` Treat warnings as crash-worthy errors. Default false. - `cwd` The current working directory for creating the archive. Defaults to `process.cwd()`. [Alias: `C`] - `prefix` A path portion to prefix onto the entries in the archive. - `gzip` Set to any truthy value to create a gzipped archive, or an object with settings for `zlib.Gzip()` [Alias: `z`] - `filter` A function that gets called with `(path, stat)` for each entry being added. Return `true` to add the entry to the archive, or `false` to omit it. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. [Alias: `P`] - `mode` The mode to set on the created file archive - `noDirRecurse` Do not recursively archive the contents of directories. [Alias: `n`] - `follow` Set to true to pack the targets of symbolic links. Without this option, symbolic links are archived as such. [Alias: `L`, `h`] - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. [Alias: `m`, `no-mtime`] - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. The following options are mostly internal, but can be modified in some advanced use cases, such as re-using caches between runs. - `linkCache` A Map object containing the device and inode value for any file whose nlink is > 1, to identify hard links. - `statCache` A Map object that caches calls `lstat`. - `readdirCache` A Map object that caches calls to `readdir`. - `jobs` A number specifying how many concurrent jobs to run. Defaults to 4. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. ### tar.x(options, fileList, callback) [alias: tar.extract] Extract a tarball archive. The `fileList` is an array of paths to extract from the tarball. If no paths are provided, then all the entries are extracted. If the archive is gzipped, then tar will detect this and unzip it. Note that all directories that are created will be forced to be writable, readable, and listable by their owner, to avoid cases where a directory prevents extraction of child entries by virtue of its mode. Most extraction errors will cause a `warn` event to be emitted. If the `cwd` is missing, or not a directory, then the extraction will fail completely. The following options are supported: - `cwd` Extract files relative to the specified directory. Defaults to `process.cwd()`. If provided, this must exist and must be a directory. [Alias: `C`] - `file` The archive file to extract. If not specified, then a Writable stream is returned where the archive data should be written. [Alias: `f`] - `sync` Create files and directories synchronously. - `strict` Treat warnings as crash-worthy errors. Default false. - `filter` A function that gets called with `(path, entry)` for each entry being unpacked. Return `true` to unpack the entry from the archive, or `false` to skip it. - `newer` Set to true to keep the existing file on disk if it's newer than the file in the archive. [Alias: `keep-newer`, `keep-newer-files`] - `keep` Do not overwrite existing files. In particular, if a file appears more than once in an archive, later copies will not overwrite earlier copies. [Alias: `k`, `keep-existing`] - `preservePaths` Allow absolute paths, paths containing `..`, and extracting through symbolic links. By default, `/` is stripped from absolute paths, `..` paths are not extracted, and any file whose location would be modified by a symbolic link is not extracted. [Alias: `P`] - `unlink` Unlink files before creating them. Without this option, tar overwrites existing files, which preserves existing hardlinks. With this option, existing hardlinks will be broken, as will any symlink that would affect the location of an extracted file. [Alias: `U`] - `strip` Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after applying the filter, but before security checks. [Alias: `strip-components`, `stripComponents`] - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `preserveOwner` If true, tar will set the `uid` and `gid` of extracted entries to the `uid` and `gid` fields in the archive. This defaults to true when run as root, and false otherwise. If false, then files and directories will be set with the owner and group of the user running the process. This is similar to `-p` in `tar(1)`, but ACLs and other system-specific data is never unpacked in this implementation, and modes are set by default already. [Alias: `p`] - `uid` Set to a number to force ownership of all extracted files and folders, and all implicitly created directories, to be owned by the specified user id, regardless of the `uid` field in the archive. Cannot be used along with `preserveOwner`. Requires also setting a `gid` option. - `gid` Set to a number to force ownership of all extracted files and folders, and all implicitly created directories, to be owned by the specified group id, regardless of the `gid` field in the archive. Cannot be used along with `preserveOwner`. Requires also setting a `uid` option. - `noMtime` Set to true to omit writing `mtime` value for extracted entries. [Alias: `m`, `no-mtime`] - `transform` Provide a function that takes an `entry` object, and returns a stream, or any falsey value. If a stream is provided, then that stream's data will be written instead of the contents of the archive entry. If a falsey value is provided, then the entry is written to disk as normal. (To exclude items from extraction, use the `filter` option described above.) - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. The following options are mostly internal, but can be modified in some advanced use cases, such as re-using caches between runs. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `umask` Filter the modes of entries like `process.umask()`. - `dmode` Default mode for directories - `fmode` Default mode for files - `dirCache` A Map object of which directories exist. - `maxMetaEntrySize` The maximum size of meta entries that is supported. Defaults to 1 MB. Note that using an asynchronous stream type with the `transform` option will cause undefined behavior in sync extractions. [MiniPass](http://npm.im/minipass)-based streams are designed for this use case. ### tar.t(options, fileList, callback) [alias: tar.list] List the contents of a tarball archive. The `fileList` is an array of paths to list from the tarball. If no paths are provided, then all the entries are listed. If the archive is gzipped, then tar will detect this and unzip it. Returns an event emitter that emits `entry` events with `tar.ReadEntry` objects. However, they don't emit `'data'` or `'end'` events. (If you want to get actual readable entries, use the `tar.Parse` class instead.) The following options are supported: - `cwd` Extract files relative to the specified directory. Defaults to `process.cwd()`. [Alias: `C`] - `file` The archive file to list. If not specified, then a Writable stream is returned where the archive data should be written. [Alias: `f`] - `sync` Read the specified file synchronously. (This has no effect when a file option isn't specified, because entries are emitted as fast as they are parsed from the stream anyway.) - `strict` Treat warnings as crash-worthy errors. Default false. - `filter` A function that gets called with `(path, entry)` for each entry being listed. Return `true` to emit the entry from the archive, or `false` to skip it. - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. This is important for when both `file` and `sync` are set, because it will be called synchronously. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `noResume` By default, `entry` streams are resumed immediately after the call to `onentry`. Set `noResume: true` to suppress this behavior. Note that by opting into this, the stream will never complete until the entry data is consumed. ### tar.u(options, fileList, callback) [alias: tar.update] Add files to an archive if they are newer than the entry already in the tarball archive. The `fileList` is an array of paths to add to the tarball. Adding a directory also adds its children recursively. An entry in `fileList` that starts with an `@` symbol is a tar archive whose entries will be added. To add a file that starts with `@`, prepend it with `./`. The following options are supported: - `file` Required. Write the tarball archive to the specified filename. [Alias: `f`] - `sync` Act synchronously. If this is set, then any provided file will be fully written after the call to `tar.c`. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `strict` Treat warnings as crash-worthy errors. Default false. - `cwd` The current working directory for adding entries to the archive. Defaults to `process.cwd()`. [Alias: `C`] - `prefix` A path portion to prefix onto the entries in the archive. - `gzip` Set to any truthy value to create a gzipped archive, or an object with settings for `zlib.Gzip()` [Alias: `z`] - `filter` A function that gets called with `(path, stat)` for each entry being added. Return `true` to add the entry to the archive, or `false` to omit it. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. [Alias: `P`] - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `noDirRecurse` Do not recursively archive the contents of directories. [Alias: `n`] - `follow` Set to true to pack the targets of symbolic links. Without this option, symbolic links are archived as such. [Alias: `L`, `h`] - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. [Alias: `m`, `no-mtime`] - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. ### tar.r(options, fileList, callback) [alias: tar.replace] Add files to an existing archive. Because later entries override earlier entries, this effectively replaces any existing entries. The `fileList` is an array of paths to add to the tarball. Adding a directory also adds its children recursively. An entry in `fileList` that starts with an `@` symbol is a tar archive whose entries will be added. To add a file that starts with `@`, prepend it with `./`. The following options are supported: - `file` Required. Write the tarball archive to the specified filename. [Alias: `f`] - `sync` Act synchronously. If this is set, then any provided file will be fully written after the call to `tar.c`. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `strict` Treat warnings as crash-worthy errors. Default false. - `cwd` The current working directory for adding entries to the archive. Defaults to `process.cwd()`. [Alias: `C`] - `prefix` A path portion to prefix onto the entries in the archive. - `gzip` Set to any truthy value to create a gzipped archive, or an object with settings for `zlib.Gzip()` [Alias: `z`] - `filter` A function that gets called with `(path, stat)` for each entry being added. Return `true` to add the entry to the archive, or `false` to omit it. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. [Alias: `P`] - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `noDirRecurse` Do not recursively archive the contents of directories. [Alias: `n`] - `follow` Set to true to pack the targets of symbolic links. Without this option, symbolic links are archived as such. [Alias: `L`, `h`] - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. [Alias: `m`, `no-mtime`] - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. ## Low-Level API ### class tar.Pack A readable tar stream. Has all the standard readable stream interface stuff. `'data'` and `'end'` events, `read()` method, `pause()` and `resume()`, etc. #### constructor(options) The following options are supported: - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `strict` Treat warnings as crash-worthy errors. Default false. - `cwd` The current working directory for creating the archive. Defaults to `process.cwd()`. - `prefix` A path portion to prefix onto the entries in the archive. - `gzip` Set to any truthy value to create a gzipped archive, or an object with settings for `zlib.Gzip()` - `filter` A function that gets called with `(path, stat)` for each entry being added. Return `true` to add the entry to the archive, or `false` to omit it. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. - `linkCache` A Map object containing the device and inode value for any file whose nlink is > 1, to identify hard links. - `statCache` A Map object that caches calls `lstat`. - `readdirCache` A Map object that caches calls to `readdir`. - `jobs` A number specifying how many concurrent jobs to run. Defaults to 4. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `noDirRecurse` Do not recursively archive the contents of directories. - `follow` Set to true to pack the targets of symbolic links. Without this option, symbolic links are archived as such. - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. #### add(path) Adds an entry to the archive. Returns the Pack stream. #### write(path) Adds an entry to the archive. Returns true if flushed. #### end() Finishes the archive. ### class tar.Pack.Sync Synchronous version of `tar.Pack`. ### class tar.Unpack A writable stream that unpacks a tar archive onto the file system. All the normal writable stream stuff is supported. `write()` and `end()` methods, `'drain'` events, etc. Note that all directories that are created will be forced to be writable, readable, and listable by their owner, to avoid cases where a directory prevents extraction of child entries by virtue of its mode. `'close'` is emitted when it's done writing stuff to the file system. Most unpack errors will cause a `warn` event to be emitted. If the `cwd` is missing, or not a directory, then an error will be emitted. #### constructor(options) - `cwd` Extract files relative to the specified directory. Defaults to `process.cwd()`. If provided, this must exist and must be a directory. - `filter` A function that gets called with `(path, entry)` for each entry being unpacked. Return `true` to unpack the entry from the archive, or `false` to skip it. - `newer` Set to true to keep the existing file on disk if it's newer than the file in the archive. - `keep` Do not overwrite existing files. In particular, if a file appears more than once in an archive, later copies will not overwrite earlier copies. - `preservePaths` Allow absolute paths, paths containing `..`, and extracting through symbolic links. By default, `/` is stripped from absolute paths, `..` paths are not extracted, and any file whose location would be modified by a symbolic link is not extracted. - `unlink` Unlink files before creating them. Without this option, tar overwrites existing files, which preserves existing hardlinks. With this option, existing hardlinks will be broken, as will any symlink that would affect the location of an extracted file. - `strip` Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after applying the filter, but before security checks. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `umask` Filter the modes of entries like `process.umask()`. - `dmode` Default mode for directories - `fmode` Default mode for files - `dirCache` A Map object of which directories exist. - `maxMetaEntrySize` The maximum size of meta entries that is supported. Defaults to 1 MB. - `preserveOwner` If true, tar will set the `uid` and `gid` of extracted entries to the `uid` and `gid` fields in the archive. This defaults to true when run as root, and false otherwise. If false, then files and directories will be set with the owner and group of the user running the process. This is similar to `-p` in `tar(1)`, but ACLs and other system-specific data is never unpacked in this implementation, and modes are set by default already. - `win32` True if on a windows platform. Causes behavior where filenames containing `<|>?` chars are converted to windows-compatible values while being unpacked. - `uid` Set to a number to force ownership of all extracted files and folders, and all implicitly created directories, to be owned by the specified user id, regardless of the `uid` field in the archive. Cannot be used along with `preserveOwner`. Requires also setting a `gid` option. - `gid` Set to a number to force ownership of all extracted files and folders, and all implicitly created directories, to be owned by the specified group id, regardless of the `gid` field in the archive. Cannot be used along with `preserveOwner`. Requires also setting a `uid` option. - `noMtime` Set to true to omit writing `mtime` value for extracted entries. - `transform` Provide a function that takes an `entry` object, and returns a stream, or any falsey value. If a stream is provided, then that stream's data will be written instead of the contents of the archive entry. If a falsey value is provided, then the entry is written to disk as normal. (To exclude items from extraction, use the `filter` option described above.) - `strict` Treat warnings as crash-worthy errors. Default false. - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") ### class tar.Unpack.Sync Synchronous version of `tar.Unpack`. Note that using an asynchronous stream type with the `transform` option will cause undefined behavior in sync unpack streams. [MiniPass](http://npm.im/minipass)-based streams are designed for this use case. ### class tar.Parse A writable stream that parses a tar archive stream. All the standard writable stream stuff is supported. If the archive is gzipped, then tar will detect this and unzip it. Emits `'entry'` events with `tar.ReadEntry` objects, which are themselves readable streams that you can pipe wherever. Each `entry` will not emit until the one before it is flushed through, so make sure to either consume the data (with `on('data', ...)` or `.pipe(...)`) or throw it away with `.resume()` to keep the stream flowing. #### constructor(options) Returns an event emitter that emits `entry` events with `tar.ReadEntry` objects. The following options are supported: - `strict` Treat warnings as crash-worthy errors. Default false. - `filter` A function that gets called with `(path, entry)` for each entry being listed. Return `true` to emit the entry from the archive, or `false` to skip it. - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") #### abort(error) Stop all parsing activities. This is called when there are zlib errors. It also emits an unrecoverable warning with the error provided. ### class tar.ReadEntry extends [MiniPass](http://npm.im/minipass) A representation of an entry that is being read out of a tar archive. It has the following fields: - `extended` The extended metadata object provided to the constructor. - `globalExtended` The global extended metadata object provided to the constructor. - `remain` The number of bytes remaining to be written into the stream. - `blockRemain` The number of 512-byte blocks remaining to be written into the stream. - `ignore` Whether this entry should be ignored. - `meta` True if this represents metadata about the next entry, false if it represents a filesystem object. - All the fields from the header, extended header, and global extended header are added to the ReadEntry object. So it has `path`, `type`, `size, `mode`, and so on. #### constructor(header, extended, globalExtended) Create a new ReadEntry object with the specified header, extended header, and global extended header values. ### class tar.WriteEntry extends [MiniPass](http://npm.im/minipass) A representation of an entry that is being written from the file system into a tar archive. Emits data for the Header, and for the Pax Extended Header if one is required, as well as any body data. Creating a WriteEntry for a directory does not also create WriteEntry objects for all of the directory contents. It has the following fields: - `path` The path field that will be written to the archive. By default, this is also the path from the cwd to the file system object. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `myuid` If supported, the uid of the user running the current process. - `myuser` The `env.USER` string if set, or `''`. Set as the entry `uname` field if the file's `uid` matches `this.myuid`. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 1 MB. - `linkCache` A Map object containing the device and inode value for any file whose nlink is > 1, to identify hard links. - `statCache` A Map object that caches calls `lstat`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. - `cwd` The current working directory for creating the archive. Defaults to `process.cwd()`. - `absolute` The absolute path to the entry on the filesystem. By default, this is `path.resolve(this.cwd, this.path)`, but it can be overridden explicitly. - `strict` Treat warnings as crash-worthy errors. Default false. - `win32` True if on a windows platform. Causes behavior where paths replace `\` with `/` and filenames containing the windows-compatible forms of `<|>?:` characters are converted to actual `<|>?:` characters in the archive. - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. #### constructor(path, options) `path` is the path of the entry as it is written in the archive. The following options are supported: - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 1 MB. - `linkCache` A Map object containing the device and inode value for any file whose nlink is > 1, to identify hard links. - `statCache` A Map object that caches calls `lstat`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. - `cwd` The current working directory for creating the archive. Defaults to `process.cwd()`. - `absolute` The absolute path to the entry on the filesystem. By default, this is `path.resolve(this.cwd, this.path)`, but it can be overridden explicitly. - `strict` Treat warnings as crash-worthy errors. Default false. - `win32` True if on a windows platform. Causes behavior where paths replace `\` with `/`. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. - `umask` Set to restrict the modes on the entries in the archive, somewhat like how umask works on file creation. Defaults to `process.umask()` on unix systems, or `0o22` on Windows. #### warn(message, data) If strict, emit an error with the provided message. Othewise, emit a `'warn'` event with the provided message and data. ### class tar.WriteEntry.Sync Synchronous version of tar.WriteEntry ### class tar.WriteEntry.Tar A version of tar.WriteEntry that gets its data from a tar.ReadEntry instead of from the filesystem. #### constructor(readEntry, options) `readEntry` is the entry being read out of another archive. The following options are supported: - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. - `strict` Treat warnings as crash-worthy errors. Default false. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. ### class tar.Header A class for reading and writing header blocks. It has the following fields: - `nullBlock` True if decoding a block which is entirely composed of `0x00` null bytes. (Useful because tar files are terminated by at least 2 null blocks.) - `cksumValid` True if the checksum in the header is valid, false otherwise. - `needPax` True if the values, as encoded, will require a Pax extended header. - `path` The path of the entry. - `mode` The 4 lowest-order octal digits of the file mode. That is, read/write/execute permissions for world, group, and owner, and the setuid, setgid, and sticky bits. - `uid` Numeric user id of the file owner - `gid` Numeric group id of the file owner - `size` Size of the file in bytes - `mtime` Modified time of the file - `cksum` The checksum of the header. This is generated by adding all the bytes of the header block, treating the checksum field itself as all ascii space characters (that is, `0x20`). - `type` The human-readable name of the type of entry this represents, or the alphanumeric key if unknown. - `typeKey` The alphanumeric key for the type of entry this header represents. - `linkpath` The target of Link and SymbolicLink entries. - `uname` Human-readable user name of the file owner - `gname` Human-readable group name of the file owner - `devmaj` The major portion of the device number. Always `0` for files, directories, and links. - `devmin` The minor portion of the device number. Always `0` for files, directories, and links. - `atime` File access time. - `ctime` File change time. #### constructor(data, [offset=0]) `data` is optional. It is either a Buffer that should be interpreted as a tar Header starting at the specified offset and continuing for 512 bytes, or a data object of keys and values to set on the header object, and eventually encode as a tar Header. #### decode(block, offset) Decode the provided buffer starting at the specified offset. Buffer length must be greater than 512 bytes. #### set(data) Set the fields in the data object. #### encode(buffer, offset) Encode the header fields into the buffer at the specified offset. Returns `this.needPax` to indicate whether a Pax Extended Header is required to properly encode the specified data. ### class tar.Pax An object representing a set of key-value pairs in an Pax extended header entry. It has the following fields. Where the same name is used, they have the same semantics as the tar.Header field of the same name. - `global` True if this represents a global extended header, or false if it is for a single entry. - `atime` - `charset` - `comment` - `ctime` - `gid` - `gname` - `linkpath` - `mtime` - `path` - `size` - `uid` - `uname` - `dev` - `ino` - `nlink` #### constructor(object, global) Set the fields set in the object. `global` is a boolean that defaults to false. #### encode() Return a Buffer containing the header and body for the Pax extended header entry, or `null` if there is nothing to encode. #### encodeBody() Return a string representing the body of the pax extended header entry. #### encodeField(fieldName) Return a string representing the key/value encoding for the specified fieldName, or `''` if the field is unset. ### tar.Pax.parse(string, extended, global) Return a new Pax object created by parsing the contents of the string provided. If the `extended` object is set, then also add the fields from that object. (This is necessary because multiple metadata entries can occur in sequence.) ### tar.types A translation table for the `type` field in tar headers. #### tar.types.name.get(code) Get the human-readable name for a given alphanumeric code. #### tar.types.code.get(name) Get the alphanumeric code for a given human-readable name. # brace-expansion [Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) [![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) [![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) [![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) ## Example ```js var expand = require('brace-expansion'); expand('file-{a,b,c}.jpg') // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] expand('-v{,,}') // => ['-v', '-v', '-v'] expand('file{0..2}.jpg') // => ['file0.jpg', 'file1.jpg', 'file2.jpg'] expand('file-{a..c}.jpg') // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] expand('file{2..0}.jpg') // => ['file2.jpg', 'file1.jpg', 'file0.jpg'] expand('file{0..4..2}.jpg') // => ['file0.jpg', 'file2.jpg', 'file4.jpg'] expand('file-{a..e..2}.jpg') // => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] expand('file{00..10..5}.jpg') // => ['file00.jpg', 'file05.jpg', 'file10.jpg'] expand('{{A..C},{a..c}}') // => ['A', 'B', 'C', 'a', 'b', 'c'] expand('ppp{,config,oe{,conf}}') // => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] ``` ## API ```js var expand = require('brace-expansion'); ``` ### var expanded = expand(str) Return an array of all possible and valid expansions of `str`. If none are found, `[str]` is returned. Valid expansions are: ```js /^(.*,)+(.+)?$/ // {a,b,...} ``` A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. ```js /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ // {x..y[..incr]} ``` A numeric sequence from `x` to `y` inclusive, with optional increment. If `x` or `y` start with a leading `0`, all the numbers will be padded to have equal length. Negative numbers and backwards iteration work too. ```js /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ // {x..y[..incr]} ``` An alphabetic sequence from `x` to `y` inclusive, with optional increment. `x` and `y` must be exactly one character, and if given, `incr` must be a number. For compatibility reasons, the string `${` is not eligible for brace expansion. ## Installation With [npm](https://npmjs.org) do: ```bash npm install brace-expansion ``` ## Contributors - [Julian Gruber](https://github.com/juliangruber) - [Isaac Z. Schlueter](https://github.com/isaacs) ## Sponsors This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! ## License (MIT) Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # lodash.sortby v4.7.0 The [lodash](https://lodash.com/) method `_.sortBy` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.sortby ``` In Node.js: ```js var sortBy = require('lodash.sortby'); ``` See the [documentation](https://lodash.com/docs#sortBy) or [package source](https://github.com/lodash/lodash/blob/4.7.0-npm-packages/lodash.sortby) for more details. # fs.realpath A backwards-compatible fs.realpath for Node v6 and above In Node v6, the JavaScript implementation of fs.realpath was replaced with a faster (but less resilient) native implementation. That raises new and platform-specific errors and cannot handle long or excessively symlink-looping paths. This module handles those cases by detecting the new errors and falling back to the JavaScript implementation. On versions of Node prior to v6, it has no effect. ## USAGE ```js var rp = require('fs.realpath') // async version rp.realpath(someLongAndLoopingPath, function (er, real) { // the ELOOP was handled, but it was a bit slower }) // sync version var real = rp.realpathSync(someLongAndLoopingPath) // monkeypatch at your own risk! // This replaces the fs.realpath/fs.realpathSync builtins rp.monkeypatch() // un-do the monkeypatching rp.unmonkeypatch() ``` # minimatch A minimal matching utility. [![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. It works by converting glob expressions into JavaScript `RegExp` objects. ## Usage ```javascript var minimatch = require("minimatch") minimatch("bar.foo", "*.foo") // true! minimatch("bar.foo", "*.bar") // false! minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! ``` ## Features Supports these glob features: * Brace Expansion * Extended glob matching * "Globstar" `**` matching See: * `man sh` * `man bash` * `man 3 fnmatch` * `man 5 gitignore` ## Minimatch Class Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch var mm = new Minimatch(pattern, options) ``` ### Properties * `pattern` The original pattern the minimatch object represents. * `options` The options supplied to the constructor. * `set` A 2-dimensional array of regexp or string expressions. Each row in the array corresponds to a brace-expanded pattern. Each item in the row corresponds to a single path-part. For example, the pattern `{a,b/c}/d` would expand to a set of patterns like: [ [ a, d ] , [ b, c, d ] ] If a portion of the pattern doesn't have any "magic" in it (that is, it's something like `"foo"` rather than `fo*o?`), then it will be left as a string rather than converted to a regular expression. * `regexp` Created by the `makeRe` method. A single regular expression expressing the entire pattern. This is useful in cases where you wish to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. * `negate` True if the pattern is negated. * `comment` True if the pattern is a comment. * `empty` True if the pattern is `""`. ### Methods * `makeRe` Generate the `regexp` member if necessary, and return it. Will return `false` if the pattern is invalid. * `match(fname)` Return true if the filename matches the pattern, or false otherwise. * `matchOne(fileArray, patternArray, partial)` Take a `/`-split filename, and match it against a single row in the `regExpSet`. This method is mainly for internal use, but is exposed so that it can be used by a glob-walker that needs to avoid excessive filesystem calls. All other methods are internal, and will be called as necessary. ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. ```javascript var isJS = minimatch(file, "*.js", { matchBase: true }) ``` ### minimatch.filter(pattern, options) Returns a function that tests its supplied argument, suitable for use with `Array.filter`. Example: ```javascript var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) ``` ### minimatch.match(list, pattern, options) Match against the list of files, in the style of fnmatch or glob. If nothing is matched, and options.nonull is set, then return a list containing the pattern itself. ```javascript var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) ``` ### minimatch.makeRe(pattern, options) Make a regular expression object from the pattern. ## Options All options are `false` by default. ### debug Dump a ton of stuff to stderr. ### nobrace Do not expand `{a,b}` and `{1..3}` brace sets. ### noglobstar Disable `**` matching against multiple folder names. ### dot Allow patterns to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot. Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` is set. ### noext Disable "extglob" style patterns like `+(a|b)`. ### nocase Perform a case-insensitive match. ### nonull When a match is not found by `minimatch.match`, return a list containing the pattern itself if this option is set. When not set, an empty list is returned if there are no matches. ### matchBase If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. ### nocomment Suppress the behavior of treating `#` at the start of a pattern as a comment. ### nonegate Suppress the behavior of treating a leading `!` character as negation. ### flipNegate Returns from negate expressions the same as if they were not negated. (Ie, true on a hit, false on a miss.) ## Comparisons to other fnmatch/glob implementations While strict compliance with the existing standards is a worthwhile goal, some discrepancies exist between minimatch and other implementations, and are intentional. If the pattern starts with a `!` character, then it is negated. Set the `nonegate` flag to suppress this behavior, and treat leading `!` characters normally. This is perhaps relevant if you wish to start the pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` characters at the start of a pattern will negate the pattern multiple times. If a pattern starts with `#`, then it is treated as a comment, and will not match anything. Use `\#` to match a literal `#` at the start of a line, or set the `nocomment` flag to suppress this behavior. The double-star character `**` is supported by default, unless the `noglobstar` flag is set. This is supported in the manner of bsdglob and bash 4.1, where `**` only has special significance if it is the only thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but `a/**b` will not. If an escaped pattern has no matches, and the `nonull` flag is set, then minimatch.match returns the pattern as-provided, rather than interpreting the character escapes. For example, `minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than `"*a?"`. This is akin to setting the `nullglob` option in bash, except that it does not resolve escaped pattern characters. If brace expansion is not disabled, then it is performed before any other interpretation of the glob pattern. Thus, a pattern like `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are checked for validity. Since those two are valid, matching proceeds. # randexp.js randexp will generate a random string that matches a given RegExp Javascript object. [![Build Status](https://secure.travis-ci.org/fent/randexp.js.svg)](http://travis-ci.org/fent/randexp.js) [![Dependency Status](https://david-dm.org/fent/randexp.js.svg)](https://david-dm.org/fent/randexp.js) [![codecov](https://codecov.io/gh/fent/randexp.js/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/randexp.js) # Usage ```js var RandExp = require('randexp'); // supports grouping and piping new RandExp(/hello+ (world|to you)/).gen(); // => hellooooooooooooooooooo world // sets and ranges and references new RandExp(/<([a-z]\w{0,20})>foo<\1>/).gen(); // => <m5xhdg>foo<m5xhdg> // wildcard new RandExp(/random stuff: .+/).gen(); // => random stuff: l3m;Hf9XYbI [YPaxV>U*4-_F!WXQh9>;rH3i l!8.zoh?[utt1OWFQrE ^~8zEQm]~tK // ignore case new RandExp(/xxx xtreme dragon warrior xxx/i).gen(); // => xxx xtReME dRAGON warRiOR xXX // dynamic regexp shortcut new RandExp('(sun|mon|tue|wednes|thurs|fri|satur)day', 'i'); // is the same as new RandExp(new RegExp('(sun|mon|tue|wednes|thurs|fri|satur)day', 'i')); ``` If you're only going to use `gen()` once with a regexp and want slightly shorter syntax for it ```js var randexp = require('randexp').randexp; randexp(/[1-6]/); // 4 randexp('great|good( job)?|excellent'); // great ``` If you miss the old syntax ```js require('randexp').sugar(); /yes|no|maybe|i don't know/.gen(); // maybe ``` # Motivation Regular expressions are used in every language, every programmer is familiar with them. Regex can be used to easily express complex strings. What better way to generate a random string than with a language you can use to express the string you want? Thanks to [String-Random](http://search.cpan.org/~steve/String-Random-0.22/lib/String/Random.pm) for giving me the idea to make this in the first place and [randexp](https://github.com/benburkert/randexp) for the sweet `.gen()` syntax. # Default Range The default generated character range includes printable ASCII. In order to add or remove characters, a `defaultRange` attribute is exposed. you can `subtract(from, to)` and `add(from, to)` ```js var randexp = new RandExp(/random stuff: .+/); randexp.defaultRange.subtract(32, 126); randexp.defaultRange.add(0, 65535); randexp.gen(); // => random stuff: 湐箻ໜ䫴␩⶛㳸長���邓蕲뤀쑡篷皇硬剈궦佔칗븛뀃匫鴔事좍ﯣ⭼ꝏ䭍詳蒂䥂뽭 ``` # Custom PRNG The default randomness is provided by `Math.random()`. If you need to use a seedable or cryptographic PRNG, you can override `RandExp.prototype.randInt` or `randexp.randInt` (where `randexp` is an instance of `RandExp`). `randInt(from, to)` accepts an inclusive range and returns a randomly selected number within that range. # Infinite Repetitionals Repetitional tokens such as `*`, `+`, and `{3,}` have an infinite max range. In this case, randexp looks at its min and adds 100 to it to get a useable max value. If you want to use another int other than 100 you can change the `max` property in `RandExp.prototype` or the RandExp instance. ```js var randexp = new RandExp(/no{1,}/); randexp.max = 1000000; ``` With `RandExp.sugar()` ```js var regexp = /(hi)*/; regexp.max = 1000000; ``` # Bad Regular Expressions There are some regular expressions which can never match any string. * Ones with badly placed positionals such as `/a^/` and `/$c/m`. Randexp will ignore positional tokens. * Back references to non-existing groups like `/(a)\1\2/`. Randexp will ignore those references, returning an empty string for them. If the group exists only after the reference is used such as in `/\1 (hey)/`, it will too be ignored. * Custom negated character sets with two sets inside that cancel each other out. Example: `/[^\w\W]/`. If you give this to randexp, it will return an empty string for this set since it can't match anything. # Projects based on randexp.js ## JSON-Schema Faker Use generators to populate JSON Schema samples. See: [jsf on github](https://github.com/json-schema-faker/json-schema-faker/) and [jsf demo page](http://json-schema-faker.js.org/). # Install ### Node.js npm install randexp ### Browser Download the [minified version](https://github.com/fent/randexp.js/releases) from the latest release. # Tests Tests are written with [mocha](https://mochajs.org) ```bash npm test ``` # License MIT # debug [![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) <img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers. ## Installation ```bash $ npm install debug ``` ## Usage `debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. Example [_app.js_](./examples/node/app.js): ```js var debug = require('debug')('http') , http = require('http') , name = 'My App'; // fake app debug('booting %o', name); http.createServer(function(req, res){ debug(req.method + ' ' + req.url); res.end('hello\n'); }).listen(3000, function(){ debug('listening'); }); // fake worker of some kind require('./worker'); ``` Example [_worker.js_](./examples/node/worker.js): ```js var a = require('debug')('worker:a') , b = require('debug')('worker:b'); function work() { a('doing lots of uninteresting work'); setTimeout(work, Math.random() * 1000); } work(); function workb() { b('doing some work'); setTimeout(workb, Math.random() * 2000); } workb(); ``` The `DEBUG` environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: <img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png"> <img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png"> <img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png"> #### Windows note On Windows the environment variable is set using the `set` command. ```cmd set DEBUG=*,-not_this ``` Note that PowerShell uses different syntax to set environment variables. ```cmd $env:DEBUG = "*,-not_this" ``` Then, run the program to be debugged as usual. ## Namespace Colors Every debug instance has a color generated for it based on its namespace name. This helps when visually parsing the debug output to identify which debug instance a debug line belongs to. #### Node.js In Node.js, colors are enabled when stderr is a TTY. You also _should_ install the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, otherwise debug will only use a small handful of basic colors. <img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png"> #### Web Browser Colors are also enabled on "Web Inspectors" that understand the `%c` formatting option. These are WebKit web inspectors, Firefox ([since version 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) and the Firebug plugin for Firefox (any version). <img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png"> ## Millisecond diff When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. <img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: <img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png"> ## Conventions If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. ## Wildcards The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". ## Environment Variables When running through Node.js, you can set a few environment variables that will change the behavior of the debug logging: | Name | Purpose | |-----------|-------------------------------------------------| | `DEBUG` | Enables/disables specific debugging namespaces. | | `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | | `DEBUG_COLORS`| Whether or not to use colors in the debug output. | | `DEBUG_DEPTH` | Object inspection depth. | | `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | __Note:__ The environment variables beginning with `DEBUG_` end up being converted into an Options object that gets used with `%o`/`%O` formatters. See the Node.js documentation for [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) for the complete list. ## Formatters Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: | Formatter | Representation | |-----------|----------------| | `%O` | Pretty-print an Object on multiple lines. | | `%o` | Pretty-print an Object all on a single line. | | `%s` | String. | | `%d` | Number (both integer and float). | | `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | | `%%` | Single percent sign ('%'). This does not consume an argument. | ### Custom formatters You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: ```js const createDebug = require('debug') createDebug.formatters.h = (v) => { return v.toString('hex') } // …elsewhere const debug = createDebug('foo') debug('this is hex: %h', new Buffer('hello world')) // foo this is hex: 68656c6c6f20776f726c6421 +0ms ``` ## Browser Support You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), if you don't want to build it yourself. Debug's enable state is currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. You can enable this using `localStorage.debug`: ```js localStorage.debug = 'worker:*' ``` And then refresh the page. ```js a = debug('worker:a'); b = debug('worker:b'); setInterval(function(){ a('doing some work'); }, 1000); setInterval(function(){ b('doing some work'); }, 1200); ``` ## Output streams By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: Example [_stdout.js_](./examples/node/stdout.js): ```js var debug = require('debug'); var error = debug('app:error'); // by default stderr is used error('goes to stderr!'); var log = debug('app:log'); // set this namespace to log via console.log log.log = console.log.bind(console); // don't forget to bind to console! log('goes to stdout'); error('still goes to stderr!'); // set all output to go via console.info // overrides all per-namespace log settings debug.log = console.info.bind(console); error('now goes to stdout via console.info'); log('still goes to stdout, but via console.info now'); ``` ## Checking whether a debug target is enabled After you've created a debug instance, you can determine whether or not it is enabled by checking the `enabled` property: ```javascript const debug = require('debug')('http'); if (debug.enabled) { // do stuff... } ``` You can also manually toggle this property to force the debug instance to be enabled or disabled. ## Authors - TJ Holowaychuk - Nathan Rajlich - Andrew Rhyne ## Backers Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] <a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a> ## Sponsors Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] <a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a> ## License (The MIT License) Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # whatwg-url whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/tmpvar/jsdom). ## Specification conformance whatwg-url is currently up to date with the URL spec up to commit [7ae1c69](https://github.com/whatwg/url/commit/7ae1c691c96f0d82fafa24c33aa1e8df9ffbf2bc). For `file:` URLs, whose [origin is left unspecified](https://url.spec.whatwg.org/#concept-url-origin), whatwg-url chooses to use a new opaque origin (which serializes to `"null"`). ## API ### The `URL` and `URLSearchParams` classes The main API is provided by the [`URL`](https://url.spec.whatwg.org/#url-class) and [`URLSearchParams`](https://url.spec.whatwg.org/#interface-urlsearchparams) exports, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use these. ### Low-level URL Standard API The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They mostly operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type. - [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL, encodingOverride })` - [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, encodingOverride, url, stateOverride })` - [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)` - [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)` - [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)` - [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin): `serializeURLOrigin(urlRecord)` - [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)` - [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)` - [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)` - [Percent decode](https://url.spec.whatwg.org/#percent-decode): `percentDecode(buffer)` The `stateOverride` parameter is one of the following strings: - [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state) - [`"scheme"`](https://url.spec.whatwg.org/#scheme-state) - [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state) - [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state) - [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state) - [`"relative"`](https://url.spec.whatwg.org/#relative-state) - [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state) - [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state) - [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state) - [`"authority"`](https://url.spec.whatwg.org/#authority-state) - [`"host"`](https://url.spec.whatwg.org/#host-state) - [`"hostname"`](https://url.spec.whatwg.org/#hostname-state) - [`"port"`](https://url.spec.whatwg.org/#port-state) - [`"file"`](https://url.spec.whatwg.org/#file-state) - [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state) - [`"file host"`](https://url.spec.whatwg.org/#file-host-state) - [`"path start"`](https://url.spec.whatwg.org/#path-start-state) - [`"path"`](https://url.spec.whatwg.org/#path-state) - [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state) - [`"query"`](https://url.spec.whatwg.org/#query-state) - [`"fragment"`](https://url.spec.whatwg.org/#fragment-state) The URL record type has the following API: - [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme) - [`username`](https://url.spec.whatwg.org/#concept-url-username) - [`password`](https://url.spec.whatwg.org/#concept-url-password) - [`host`](https://url.spec.whatwg.org/#concept-url-host) - [`port`](https://url.spec.whatwg.org/#concept-url-port) - [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array) - [`query`](https://url.spec.whatwg.org/#concept-url-query) - [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment) - [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean) These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state. The return value of "failure" in the spec is represented by `null`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ `null`. ## Development instructions First, install [Node.js](https://nodejs.org/). Then, fetch the dependencies of whatwg-url, by running from this directory: npm install To run tests: npm test To generate a coverage report: npm run coverage To build and run the live viewer: npm run build npm run build-live-viewer Serve the contents of the `live-viewer` directory using any web server. ## Supporting whatwg-url The jsdom project (including whatwg-url) is a community-driven project maintained by a team of [volunteers](https://github.com/orgs/jsdom/people). You could support us by: - [Getting professional support for whatwg-url](https://tidelift.com/subscription/pkg/npm-whatwg-url?utm_source=npm-whatwg-url&utm_medium=referral&utm_campaign=readme) as part of a Tidelift subscription. Tidelift helps making open source sustainable for us while giving teams assurances for maintenance, licensing, and security. - Contributing directly to the project. # binary-install Install .tar.gz binary applications via npm ## Usage This library provides a single class `Binary` that takes a download url and some optional arguments. You **must** provide either `name` or `installDirectory` when creating your `Binary`. | option | decription | | ---------------- | --------------------------------------------- | | name | The name of your binary | | installDirectory | A path to the directory to install the binary | If an `installDirectory` is not provided, the binary will be installed at your OS specific config directory. On MacOS it defaults to `~/Library/Preferences/${name}-nodejs` After your `Binary` has been created, you can run `.install()` to install the binary, and `.run()` to run it. ### Example This is meant to be used as a library - create your `Binary` with your desired options, then call `.install()` in the `postinstall` of your `package.json`, `.run()` in the `bin` section of your `package.json`, and `.uninstall()` in the `preuninstall` section of your `package.json`. See [this example project](/example) to see how to create an npm package that installs and runs a binary using the Github releases API. # which-module > Find the module object for something that was require()d [![Build Status](https://travis-ci.org/nexdrew/which-module.svg?branch=master)](https://travis-ci.org/nexdrew/which-module) [![Coverage Status](https://coveralls.io/repos/github/nexdrew/which-module/badge.svg?branch=master)](https://coveralls.io/github/nexdrew/which-module?branch=master) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) Find the `module` object in `require.cache` for something that was `require()`d or `import`ed - essentially a reverse `require()` lookup. Useful for libs that want to e.g. lookup a filename for a module or submodule that it did not `require()` itself. ## Install and Usage ``` npm install --save which-module ``` ```js const whichModule = require('which-module') console.log(whichModule(require('something'))) // Module { // id: '/path/to/project/node_modules/something/index.js', // exports: [Function], // parent: ..., // filename: '/path/to/project/node_modules/something/index.js', // loaded: true, // children: [], // paths: [ '/path/to/project/node_modules/something/node_modules', // '/path/to/project/node_modules', // '/path/to/node_modules', // '/path/node_modules', // '/node_modules' ] } ``` ## API ### `whichModule(exported)` Return the [`module` object](https://nodejs.org/api/modules.html#modules_the_module_object), if any, that represents the given argument in the `require.cache`. `exported` can be anything that was previously `require()`d or `import`ed as a module, submodule, or dependency - which means `exported` is identical to the `module.exports` returned by this method. If `exported` did not come from the `exports` of a `module` in `require.cache`, then this method returns `null`. ## License ISC © Contributors # minizlib A fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding. This module was created to serve the needs of [node-tar](http://npm.im/tar) and [minipass-fetch](http://npm.im/minipass-fetch). Brotli is supported in versions of node with a Brotli binding. ## How does this differ from the streams in `require('zlib')`? First, there are no convenience methods to compress or decompress a buffer. If you want those, use the built-in `zlib` module. This is only streams. That being said, Minipass streams to make it fairly easy to use as one-liners: `new zlib.Deflate().end(data).read()` will return the deflate compressed result. This module compresses and decompresses the data as fast as you feed it in. It is synchronous, and runs on the main process thread. Zlib and Brotli operations can be high CPU, but they're very fast, and doing it this way means much less bookkeeping and artificial deferral. Node's built in zlib streams are built on top of `stream.Transform`. They do the maximally safe thing with respect to consistent asynchrony, buffering, and backpressure. See [Minipass](http://npm.im/minipass) for more on the differences between Node.js core streams and Minipass streams, and the convenience methods provided by that class. ## Classes - Deflate - Inflate - Gzip - Gunzip - DeflateRaw - InflateRaw - Unzip - BrotliCompress (Node v10 and higher) - BrotliDecompress (Node v10 and higher) ## USAGE ```js const zlib = require('minizlib') const input = sourceOfCompressedData() const decode = new zlib.BrotliDecompress() const output = whereToWriteTheDecodedData() input.pipe(decode).pipe(output) ``` ## REPRODUCIBLE BUILDS To create reproducible gzip compressed files across different operating systems, set `portable: true` in the options. This causes minizlib to set the `OS` indicator in byte 9 of the extended gzip header to `0xFF` for 'unknown'. The AssemblyScript Runtime ========================== The runtime provides the functionality necessary to dynamically allocate and deallocate memory of objects, arrays and buffers, as well as collect garbage that is no longer used. The current implementation is either a Two-Color Mark & Sweep (TCMS) garbage collector that must be called manually when the execution stack is unwound or an Incremental Tri-Color Mark & Sweep (ITCMS) garbage collector that is fully automated with a shadow stack, implemented on top of a Two-Level Segregate Fit (TLSF) memory manager. It's not designed to be the fastest of its kind, but intentionally focuses on simplicity and ease of integration until we can replace it with the real deal, i.e. Wasm GC. Interface --------- ### Garbage collector / `--exportRuntime` * **__new**(size: `usize`, id: `u32` = 0): `usize`<br /> Dynamically allocates a GC object of at least the specified size and returns its address. Alignment is guaranteed to be 16 bytes to fit up to v128 values naturally. GC-allocated objects cannot be used with `__realloc` and `__free`. * **__pin**(ptr: `usize`): `usize`<br /> Pins the object pointed to by `ptr` externally so it and its directly reachable members and indirectly reachable objects do not become garbage collected. * **__unpin**(ptr: `usize`): `void`<br /> Unpins the object pointed to by `ptr` externally so it can become garbage collected. * **__collect**(): `void`<br /> Performs a full garbage collection. ### Internals * **__alloc**(size: `usize`): `usize`<br /> Dynamically allocates a chunk of memory of at least the specified size and returns its address. Alignment is guaranteed to be 16 bytes to fit up to v128 values naturally. * **__realloc**(ptr: `usize`, size: `usize`): `usize`<br /> Dynamically changes the size of a chunk of memory, possibly moving it to a new address. * **__free**(ptr: `usize`): `void`<br /> Frees a dynamically allocated chunk of memory by its address. * **__renew**(ptr: `usize`, size: `usize`): `usize`<br /> Like `__realloc`, but for `__new`ed GC objects. * **__link**(parentPtr: `usize`, childPtr: `usize`, expectMultiple: `bool`): `void`<br /> Introduces a link from a parent object to a child object, i.e. upon `parent.field = child`. * **__visit**(ptr: `usize`, cookie: `u32`): `void`<br /> Concrete visitor implementation called during traversal. Cookie can be used to indicate one of multiple operations. * **__visit_globals**(cookie: `u32`): `void`<br /> Calls `__visit` on each global that is of a managed type. * **__visit_members**(ptr: `usize`, cookie: `u32`): `void`<br /> Calls `__visit` on each member of the object pointed to by `ptr`. * **__typeinfo**(id: `u32`): `RTTIFlags`<br /> Obtains the runtime type information for objects with the specified runtime id. Runtime type information is a set of flags indicating whether a type is managed, an array or similar, and what the relevant alignments when creating an instance externally are etc. * **__instanceof**(ptr: `usize`, classId: `u32`): `bool`<br /> Tests if the object pointed to by `ptr` is an instance of the specified class id. ITCMS / `--runtime incremental` ----- The Incremental Tri-Color Mark & Sweep garbage collector maintains a separate shadow stack of managed values in the background to achieve full automation. Maintaining another stack introduces some overhead compared to the simpler Two-Color Mark & Sweep garbage collector, but makes it independent of whether the execution stack is unwound or not when it is invoked, so the garbage collector can run interleaved with the program. There are several constants one can experiment with to tweak ITCMS's automation: * `--use ASC_GC_GRANULARITY=1024`<br /> How often to interrupt. The default of 1024 means "interrupt each 1024 bytes allocated". * `--use ASC_GC_STEPFACTOR=200`<br /> How long to interrupt. The default of 200% means "run at double the speed of allocations". * `--use ASC_GC_IDLEFACTOR=200`<br /> How long to idle. The default of 200% means "wait for memory to double before kicking in again". * `--use ASC_GC_MARKCOST=1`<br /> How costly it is to mark one object. Budget per interrupt is `GRANULARITY * STEPFACTOR / 100`. * `--use ASC_GC_SWEEPCOST=10`<br /> How costly it is to sweep one object. Budget per interrupt is `GRANULARITY * STEPFACTOR / 100`. TCMS / `--runtime minimal` ---- If automation and low pause times aren't strictly necessary, using the Two-Color Mark & Sweep garbage collector instead by invoking collection manually at appropriate times when the execution stack is unwound may be more performant as it simpler and has less overhead. The execution stack is typically unwound when invoking the collector externally, at a place that is not indirectly called from Wasm. STUB / `--runtime stub` ---- The stub is a maximally minimal runtime substitute, consisting of a simple and fast bump allocator with no means of freeing up memory again, except when freeing the respective most recently allocated object on top of the bump. Useful where memory is not a concern, and/or where it is sufficient to destroy the whole module including any potential garbage after execution. See also: [Garbage collection](https://www.assemblyscript.org/garbage-collection.html) # axios // adapters The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. ## Example ```js var settle = require('./../core/settle'); module.exports = function myAdapter(config) { // At this point: // - config has been merged with defaults // - request transformers have already run // - request interceptors have already run // Make the request using config provided // Upon response settle the Promise return new Promise(function(resolve, reject) { var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(resolve, reject, response); // From here: // - response transformers will run // - response interceptors will run }); } ``` Browser-friendly inheritance fully compatible with standard node.js [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). This package exports standard `inherits` from node.js `util` module in node environment, but also provides alternative browser-friendly implementation through [browser field](https://gist.github.com/shtylman/4339901). Alternative implementation is a literal copy of standard one located in standalone module to avoid requiring of `util`. It also has a shim for old browsers with no `Object.create` support. While keeping you sure you are using standard `inherits` implementation in node.js environment, it allows bundlers such as [browserify](https://github.com/substack/node-browserify) to not include full `util` package to your client code if all you need is just `inherits` function. It worth, because browser shim for `util` package is large and `inherits` is often the single function you need from it. It's recommended to use this package instead of `require('util').inherits` for any code that has chances to be used not only in node.js but in browser too. ## usage ```js var inherits = require('inherits'); // then use exactly as the standard one ``` ## note on version ~1.0 Version ~1.0 had completely different motivation and is not compatible neither with 2.0 nor with standard node.js `inherits`. If you are using version ~1.0 and planning to switch to ~2.0, be careful: * new version uses `super_` instead of `super` for referencing superclass * new version overwrites current prototype while old one preserves any existing fields on it # once Only call a function once. ## usage ```javascript var once = require('once') function load (file, cb) { cb = once(cb) loader.load('file') loader.once('load', cb) loader.once('error', cb) } ``` Or add to the Function.prototype in a responsible way: ```javascript // only has to be done once require('once').proto() function load (file, cb) { cb = cb.once() loader.load('file') loader.once('load', cb) loader.once('error', cb) } ``` Ironically, the prototype feature makes this module twice as complicated as necessary. To check whether you function has been called, use `fn.called`. Once the function is called for the first time the return value of the original function is saved in `fn.value` and subsequent calls will continue to return this value. ```javascript var once = require('once') function load (cb) { cb = once(cb) var stream = createStream() stream.once('data', cb) stream.once('end', function () { if (!cb.called) cb(new Error('not found')) }) } ``` ## `once.strict(func)` Throw an error if the function is called twice. Some functions are expected to be called only once. Using `once` for them would potentially hide logical errors. In the example below, the `greet` function has to call the callback only once: ```javascript function greet (name, cb) { // return is missing from the if statement // when no name is passed, the callback is called twice if (!name) cb('Hello anonymous') cb('Hello ' + name) } function log (msg) { console.log(msg) } // this will print 'Hello anonymous' but the logical error will be missed greet(null, once(msg)) // once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time greet(null, once.strict(msg)) ``` # `near-sdk-as` Starter Kit This is a good project to use as a starting point for your AssemblyScript project. ## Samples This repository includes a complete project structure for AssemblyScript contracts targeting the NEAR platform. The example here is very basic. It's a simple contract demonstrating the following concepts: - a single contract - the difference between `view` vs. `change` methods - basic contract storage There are 2 AssemblyScript contracts in this project, each in their own folder: - **simple** in the `src/simple` folder - **singleton** in the `src/singleton` folder ### Simple We say that an AssemblyScript contract is written in the "simple style" when the `index.ts` file (the contract entry point) includes a series of exported functions. In this case, all exported functions become public contract methods. ```ts // return the string 'hello world' export function helloWorld(): string {} // read the given key from account (contract) storage export function read(key: string): string {} // write the given value at the given key to account (contract) storage export function write(key: string, value: string): string {} // private helper method used by read() and write() above private storageReport(): string {} ``` ### Singleton We say that an AssemblyScript contract is written in the "singleton style" when the `index.ts` file (the contract entry point) has a single exported class (the name of the class doesn't matter) that is decorated with `@nearBindgen`. In this case, all methods on the class become public contract methods unless marked `private`. Also, all instance variables are stored as a serialized instance of the class under a special storage key named `STATE`. AssemblyScript uses JSON for storage serialization (as opposed to Rust contracts which use a custom binary serialization format called borsh). ```ts @nearBindgen export class Contract { // return the string 'hello world' helloWorld(): string {} // read the given key from account (contract) storage read(key: string): string {} // write the given value at the given key to account (contract) storage @mutateState() write(key: string, value: string): string {} // private helper method used by read() and write() above private storageReport(): string {} } ``` ## Usage ### Getting started (see below for video recordings of each of the following steps) INSTALL `NEAR CLI` first like this: `npm i -g near-cli` 1. clone this repo to a local folder 2. run `yarn` 3. run `./scripts/1.dev-deploy.sh` 3. run `./scripts/2.use-contract.sh` 4. run `./scripts/2.use-contract.sh` (yes, run it to see changes) 5. run `./scripts/3.cleanup.sh` ### Videos **`1.dev-deploy.sh`** This video shows the build and deployment of the contract. [![asciicast](https://asciinema.org/a/409575.svg)](https://asciinema.org/a/409575) **`2.use-contract.sh`** This video shows contract methods being called. You should run the script twice to see the effect it has on contract state. [![asciicast](https://asciinema.org/a/409577.svg)](https://asciinema.org/a/409577) **`3.cleanup.sh`** This video shows the cleanup script running. Make sure you add the `BENEFICIARY` environment variable. The script will remind you if you forget. ```sh export BENEFICIARY=<your-account-here> # this account receives contract account balance ``` [![asciicast](https://asciinema.org/a/409580.svg)](https://asciinema.org/a/409580) ### Other documentation - See `./scripts/README.md` for documentation about the scripts - Watch this video where Willem Wyndham walks us through refactoring a simple example of a NEAR smart contract written in AssemblyScript https://youtu.be/QP7aveSqRPo ``` There are 2 "styles" of implementing AssemblyScript NEAR contracts: - the contract interface can either be a collection of exported functions - or the contract interface can be the methods of a an exported class We call the second style "Singleton" because there is only one instance of the class which is serialized to the blockchain storage. Rust contracts written for NEAR do this by default with the contract struct. 0:00 noise (to cut) 0:10 Welcome 0:59 Create project starting with "npm init" 2:20 Customize the project for AssemblyScript development 9:25 Import the Counter example and get unit tests passing 18:30 Adapt the Counter example to a Singleton style contract 21:49 Refactoring unit tests to access the new methods 24:45 Review and summary ``` ## The file system ```sh ├── README.md # this file ├── as-pect.config.js # configuration for as-pect (AssemblyScript unit testing) ├── asconfig.json # configuration for AssemblyScript compiler (supports multiple contracts) ├── package.json # NodeJS project manifest ├── scripts │   ├── 1.dev-deploy.sh # helper: build and deploy contracts │   ├── 2.use-contract.sh # helper: call methods on ContractPromise │   ├── 3.cleanup.sh # helper: delete build and deploy artifacts │   └── README.md # documentation for helper scripts ├── src │   ├── as_types.d.ts # AssemblyScript headers for type hints │   ├── simple # Contract 1: "Simple example" │   │   ├── __tests__ │   │   │   ├── as-pect.d.ts # as-pect unit testing headers for type hints │   │   │   └── index.unit.spec.ts # unit tests for contract 1 │   │   ├── asconfig.json # configuration for AssemblyScript compiler (one per contract) │   │   └── assembly │   │   └── index.ts # contract code for contract 1 │   ├── singleton # Contract 2: "Singleton-style example" │   │   ├── __tests__ │   │   │   ├── as-pect.d.ts # as-pect unit testing headers for type hints │   │   │   └── index.unit.spec.ts # unit tests for contract 2 │   │   ├── asconfig.json # configuration for AssemblyScript compiler (one per contract) │   │   └── assembly │   │   └── index.ts # contract code for contract 2 │   ├── tsconfig.json # Typescript configuration │   └── utils.ts # common contract utility functions └── yarn.lock # project manifest version lock ``` You may clone this repo to get started OR create everything from scratch. Please note that, in order to create the AssemblyScript and tests folder structure, you may use the command `asp --init` which will create the following folders and files: ``` ./assembly/ ./assembly/tests/ ./assembly/tests/example.spec.ts ./assembly/tests/as-pect.d.ts ``` # cliui [![Build Status](https://travis-ci.org/yargs/cliui.svg)](https://travis-ci.org/yargs/cliui) [![Coverage Status](https://coveralls.io/repos/yargs/cliui/badge.svg?branch=)](https://coveralls.io/r/yargs/cliui?branch=) [![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) easily create complex multi-column command-line-interfaces. ## Example ```js var ui = require('cliui')() ui.div('Usage: $0 [command] [options]') ui.div({ text: 'Options:', padding: [2, 0, 2, 0] }) ui.div( { text: "-f, --file", width: 20, padding: [0, 4, 0, 4] }, { text: "the file to load." + chalk.green("(if this description is long it wraps).") , width: 20 }, { text: chalk.red("[required]"), align: 'right' } ) console.log(ui.toString()) ``` <img width="500" src="screenshot.png"> ## Layout DSL cliui exposes a simple layout DSL: If you create a single `ui.div`, passing a string rather than an object: * `\n`: characters will be interpreted as new rows. * `\t`: characters will be interpreted as new columns. * `\s`: characters will be interpreted as padding. **as an example...** ```js var ui = require('./')({ width: 60 }) ui.div( 'Usage: node ./bin/foo.js\n' + ' <regex>\t provide a regex\n' + ' <glob>\t provide a glob\t [required]' ) console.log(ui.toString()) ``` **will output:** ```shell Usage: node ./bin/foo.js <regex> provide a regex <glob> provide a glob [required] ``` ## Methods ```js cliui = require('cliui') ``` ### cliui({width: integer}) Specify the maximum width of the UI being generated. If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`. ### cliui({wrap: boolean}) Enable or disable the wrapping of text in a column. ### cliui.div(column, column, column) Create a row with any number of columns, a column can either be a string, or an object with the following options: * **text:** some text to place in the column. * **width:** the width of a column. * **align:** alignment, `right` or `center`. * **padding:** `[top, right, bottom, left]`. * **border:** should a border be placed around the div? ### cliui.span(column, column, column) Similar to `div`, except the next row will be appended without a new line being created. ### cliui.resetOutput() Resets the UI elements of the current cliui instance, maintaining the values set for `width` and `wrap`. # Glob Match files using the patterns the shell uses, like stars and stuff. [![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) This is a glob implementation in JavaScript. It uses the `minimatch` library to do its matching. ![](logo/glob.png) ## Usage Install with npm ``` npm i glob ``` ```javascript var glob = require("glob") // options is optional glob("**/*.js", options, function (er, files) { // files is an array of filenames. // If the `nonull` option is set, and nothing // was found, then files is ["**/*.js"] // er is an error object or null. }) ``` ## Glob Primer "Globs" are the patterns you type when you do stuff like `ls *.js` on the command line, or put `build/*` in a `.gitignore` file. Before parsing the path part patterns, braced sections are expanded into a set. Braced sections start with `{` and end with `}`, with any number of comma-delimited sections within. Braced sections may contain slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. The following characters have special magic meaning when used in a path portion: * `*` Matches 0 or more characters in a single path portion * `?` Matches 1 character * `[...]` Matches a range of characters, similar to a RegExp range. If the first character of the range is `!` or `^` then it matches any character not in the range. * `!(pattern|pattern|pattern)` Matches anything that does not match any of the patterns provided. * `?(pattern|pattern|pattern)` Matches zero or one occurrence of the patterns provided. * `+(pattern|pattern|pattern)` Matches one or more occurrences of the patterns provided. * `*(a|b|c)` Matches zero or more occurrences of the patterns provided * `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns provided * `**` If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches. It does not crawl symlinked directories. ### Dots If a file or directory path portion has a `.` as the first character, then it will not match any glob pattern unless that pattern's corresponding path part also has a `.` as its first character. For example, the pattern `a/.*/c` would match the file at `a/.b/c`. However the pattern `a/*/c` would not, because `*` does not start with a dot character. You can make glob treat dots as normal characters by setting `dot:true` in the options. ### Basename Matching If you set `matchBase:true` in the options, and the pattern has no slashes in it, then it will seek for any file anywhere in the tree with a matching basename. For example, `*.js` would match `test/simple/basic.js`. ### Empty Sets If no matching files are found, then an empty array is returned. This differs from the shell, where the pattern itself is returned. For example: $ echo a*s*d*f a*s*d*f To get the bash-style behavior, set the `nonull:true` in the options. ### See Also: * `man sh` * `man bash` (Search for "Pattern Matching") * `man 3 fnmatch` * `man 5 gitignore` * [minimatch documentation](https://github.com/isaacs/minimatch) ## glob.hasMagic(pattern, [options]) Returns `true` if there are any special characters in the pattern, and `false` otherwise. Note that the options affect the results. If `noext:true` is set in the options object, then `+(a|b)` will not be considered a magic pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` then that is considered magical, unless `nobrace:true` is set in the options. ## glob(pattern, [options], cb) * `pattern` `{String}` Pattern to be matched * `options` `{Object}` * `cb` `{Function}` * `err` `{Error | null}` * `matches` `{Array<String>}` filenames found matching the pattern Perform an asynchronous glob search. ## glob.sync(pattern, [options]) * `pattern` `{String}` Pattern to be matched * `options` `{Object}` * return: `{Array<String>}` filenames found matching the pattern Perform a synchronous glob search. ## Class: glob.Glob Create a Glob object by instantiating the `glob.Glob` class. ```javascript var Glob = require("glob").Glob var mg = new Glob(pattern, options, cb) ``` It's an EventEmitter, and starts walking the filesystem to find matches immediately. ### new glob.Glob(pattern, [options], [cb]) * `pattern` `{String}` pattern to search for * `options` `{Object}` * `cb` `{Function}` Called when an error occurs, or matches are found * `err` `{Error | null}` * `matches` `{Array<String>}` filenames found matching the pattern Note that if the `sync` flag is set in the options, then matches will be immediately available on the `g.found` member. ### Properties * `minimatch` The minimatch object that the glob uses. * `options` The options object passed in. * `aborted` Boolean which is set to true when calling `abort()`. There is no way at this time to continue a glob search after aborting, but you can re-use the statCache to avoid having to duplicate syscalls. * `cache` Convenience object. Each field has the following possible values: * `false` - Path does not exist * `true` - Path exists * `'FILE'` - Path exists, and is not a directory * `'DIR'` - Path exists, and is a directory * `[file, entries, ...]` - Path exists, is a directory, and the array value is the results of `fs.readdir` * `statCache` Cache of `fs.stat` results, to prevent statting the same path multiple times. * `symlinks` A record of which paths are symbolic links, which is relevant in resolving `**` patterns. * `realpathCache` An optional object which is passed to `fs.realpath` to minimize unnecessary syscalls. It is stored on the instantiated Glob object, and may be re-used. ### Events * `end` When the matching is finished, this is emitted with all the matches found. If the `nonull` option is set, and no match was found, then the `matches` list contains the original pattern. The matches are sorted, unless the `nosort` flag is set. * `match` Every time a match is found, this is emitted with the specific thing that matched. It is not deduplicated or resolved to a realpath. * `error` Emitted when an unexpected error is encountered, or whenever any fs error occurs if `options.strict` is set. * `abort` When `abort()` is called, this event is raised. ### Methods * `pause` Temporarily stop the search * `resume` Resume the search * `abort` Stop the search forever ### Options All the options that can be passed to Minimatch can also be passed to Glob to change pattern matching behavior. Also, some have been added, or have glob-specific ramifications. All options are false by default, unless otherwise noted. All options are added to the Glob object, as well. If you are running many `glob` operations, you can pass a Glob object as the `options` argument to a subsequent operation to shortcut some `stat` and `readdir` calls. At the very least, you may pass in shared `symlinks`, `statCache`, `realpathCache`, and `cache` options, so that parallel glob operations will be sped up by sharing information about the filesystem. * `cwd` The current working directory in which to search. Defaults to `process.cwd()`. * `root` The place where patterns starting with `/` will be mounted onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix systems, and `C:\` or some such on Windows.) * `dot` Include `.dot` files in normal matches and `globstar` matches. Note that an explicit dot in a portion of the pattern will always match dot files. * `nomount` By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid filesystem path is returned. Set this flag to disable that behavior. * `mark` Add a `/` character to directory matches. Note that this requires additional stat calls. * `nosort` Don't sort the results. * `stat` Set to true to stat *all* results. This reduces performance somewhat, and is completely unnecessary, unless `readdir` is presumed to be an untrustworthy indicator of file existence. * `silent` When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. Set the `silent` option to true to suppress these warnings. * `strict` When an unusual error is encountered when attempting to read a directory, the process will just continue on in search of other matches. Set the `strict` option to raise an error in these cases. * `cache` See `cache` property above. Pass in a previously generated cache object to save some fs calls. * `statCache` A cache of results of filesystem information, to prevent unnecessary stat calls. While it should not normally be necessary to set this, you may pass the statCache from one glob() call to the options object of another, if you know that the filesystem will not change between calls. (See "Race Conditions" below.) * `symlinks` A cache of known symbolic links. You may pass in a previously generated `symlinks` object to save `lstat` calls when resolving `**` matches. * `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. * `nounique` In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set. By default, this implementation prevents duplicates in the result set. Set this flag to disable that behavior. * `nonull` Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3). * `debug` Set to enable debug logging in minimatch and glob. * `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. * `noglobstar` Do not match `**` against multiple filenames. (Ie, treat it as a normal `*` instead.) * `noext` Do not match `+(a|b)` "extglob" patterns. * `nocase` Perform a case-insensitive match. Note: on case-insensitive filesystems, non-magic patterns will match by default, since `stat` and `readdir` will not raise errors. * `matchBase` Perform a basename-only match if the pattern does not contain any slash characters. That is, `*.js` would be treated as equivalent to `**/*.js`, matching all js files in all directories. * `nodir` Do not match directories, only files. (Note: to match *only* directories, simply put a `/` at the end of the pattern.) * `ignore` Add a pattern or an array of glob patterns to exclude matches. Note: `ignore` patterns are *always* in `dot:true` mode, regardless of any other settings. * `follow` Follow symlinked directories when expanding `**` patterns. Note that this can result in a lot of duplicate references in the presence of cyclic links. * `realpath` Set to true to call `fs.realpath` on all of the results. In the case of a symlink that cannot be resolved, the full absolute path to the matched entry is returned (though it will usually be a broken symlink) * `absolute` Set to true to always receive absolute paths for matched files. Unlike `realpath`, this also affects the values returned in the `match` event. ## Comparisons to other fnmatch/glob implementations While strict compliance with the existing standards is a worthwhile goal, some discrepancies exist between node-glob and other implementations, and are intentional. The double-star character `**` is supported by default, unless the `noglobstar` flag is set. This is supported in the manner of bsdglob and bash 4.3, where `**` only has special significance if it is the only thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but `a/**b` will not. Note that symlinked directories are not crawled as part of a `**`, though their contents may match against subsequent portions of the pattern. This prevents infinite loops and duplicates and the like. If an escaped pattern has no matches, and the `nonull` flag is set, then glob returns the pattern as-provided, rather than interpreting the character escapes. For example, `glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than `"*a?"`. This is akin to setting the `nullglob` option in bash, except that it does not resolve escaped pattern characters. If brace expansion is not disabled, then it is performed before any other interpretation of the glob pattern. Thus, a pattern like `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are checked for validity. Since those two are valid, matching proceeds. ### Comments and Negation Previously, this module let you mark a pattern as a "comment" if it started with a `#` character, or a "negated" pattern if it started with a `!` character. These options were deprecated in version 5, and removed in version 6. To specify things that should not match, use the `ignore` option. ## Windows **Please only use forward-slashes in glob expressions.** Though windows uses either `/` or `\` as its path separator, only `/` characters are used by this glob implementation. You must use forward-slashes **only** in glob expressions. Back-slashes will always be interpreted as escape characters, not path separators. Results from absolute patterns such as `/foo/*` are mounted onto the root setting using `path.join`. On windows, this will by default result in `/foo/*` matching `C:\foo\bar.txt`. ## Race Conditions Glob searching, by its very nature, is susceptible to race conditions, since it relies on directory walking and such. As a result, it is possible that a file that exists when glob looks for it may have been deleted or modified by the time it returns the result. As part of its internal implementation, this program caches all stat and readdir calls that it makes, in order to cut down on system overhead. However, this also makes it even more susceptible to races, especially if the cache or statCache objects are reused between glob calls. Users are thus advised not to use a glob result as a guarantee of filesystem state in the face of rapid changes. For the vast majority of operations, this is never a problem. ## Glob Logo Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). ## Contributing Any change to behavior (including bugfixes) must come with a test. Patches that fail tests or reduce performance will be rejected. ``` # to run tests npm test # to re-generate test fixtures npm run test-regen # to benchmark against bash/zsh npm run bench # to profile javascript npm run prof ``` ![](oh-my-glob.gif) # Near Bindings Generator Transforms the Assembyscript AST to serialize exported functions and add `encode` and `decode` functions for generating and parsing JSON strings. ## Using via CLI After installling, `npm install nearprotocol/near-bindgen-as`, it can be added to the cli arguments of the assemblyscript compiler you must add the following: ```bash asc <file> --transform near-bindgen-as ... ``` This module also adds a binary `near-asc` which adds the default arguments required to build near contracts as well as the transformer. ```bash near-asc <input file> <output file> ``` ## Using a script to compile Another way is to add a file such as `asconfig.js` such as: ```js const compile = require("near-bindgen-as/compiler").compile; compile("assembly/index.ts", // input file "out/index.wasm", // output file [ // "-O1", // Optional arguments "--debug", "--measure" ], // Prints out the final cli arguments passed to compiler. {verbose: true} ); ``` It can then be built with `node asconfig.js`. There is an example of this in the test directory. # Web IDL Type Conversions on JavaScript Values This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [Web IDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types). The goal is that you should be able to write code like ```js "use strict"; const conversions = require("webidl-conversions"); function doStuff(x, y) { x = conversions["boolean"](x); y = conversions["unsigned long"](y); // actual algorithm code here } ``` and your function `doStuff` will behave the same as a Web IDL operation declared as ```webidl void doStuff(boolean x, unsigned long y); ``` ## API This package's main module's default export is an object with a variety of methods, each corresponding to a different Web IDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the Web IDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the Web IDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float). Each method also accepts a second, optional, parameter for miscellaneous options. For conversion methods that throw errors, a string option `{ context }` may be provided to provide more information in the error message. (For example, `conversions["float"](NaN, { context: "Argument 1 of Interface's operation" })` will throw an error with message `"Argument 1 of Interface's operation is not a finite floating-point value."`) Specific conversions may also accept other options, the details of which can be found below. ## Conversions implemented Conversions for all of the basic types from the Web IDL specification are implemented: - [`any`](https://heycam.github.io/webidl/#es-any) - [`void`](https://heycam.github.io/webidl/#es-void) - [`boolean`](https://heycam.github.io/webidl/#es-boolean) - [Integer types](https://heycam.github.io/webidl/#es-integer-types), which can additionally be provided the boolean options `{ clamp, enforceRange }` as a second parameter - [`float`](https://heycam.github.io/webidl/#es-float), [`unrestricted float`](https://heycam.github.io/webidl/#es-unrestricted-float) - [`double`](https://heycam.github.io/webidl/#es-double), [`unrestricted double`](https://heycam.github.io/webidl/#es-unrestricted-double) - [`DOMString`](https://heycam.github.io/webidl/#es-DOMString), which can additionally be provided the boolean option `{ treatNullAsEmptyString }` as a second parameter - [`ByteString`](https://heycam.github.io/webidl/#es-ByteString), [`USVString`](https://heycam.github.io/webidl/#es-USVString) - [`object`](https://heycam.github.io/webidl/#es-object) - [`Error`](https://heycam.github.io/webidl/#es-Error) - [Buffer source types](https://heycam.github.io/webidl/#es-buffer-source-types) Additionally, for convenience, the following derived type definitions are implemented: - [`ArrayBufferView`](https://heycam.github.io/webidl/#ArrayBufferView) - [`BufferSource`](https://heycam.github.io/webidl/#BufferSource) - [`DOMTimeStamp`](https://heycam.github.io/webidl/#DOMTimeStamp) - [`Function`](https://heycam.github.io/webidl/#Function) - [`VoidFunction`](https://heycam.github.io/webidl/#VoidFunction) (although it will not censor the return type) Derived types, such as nullable types, promise types, sequences, records, etc. are not handled by this library. You may wish to investigate the [webidl2js](https://github.com/jsdom/webidl2js) project. ### A note on the `long long` types The `long long` and `unsigned long long` Web IDL types can hold values that cannot be stored in JavaScript numbers, so the conversion is imperfect. For example, converting the JavaScript number `18446744073709552000` to a Web IDL `long long` is supposed to produce the Web IDL value `-18446744073709551232`. Since we are representing our Web IDL values in JavaScript, we can't represent `-18446744073709551232`, so we instead the best we could do is `-18446744073709552000` as the output. This library actually doesn't even get that far. Producing those results would require doing accurate modular arithmetic on 64-bit intermediate values, but JavaScript does not make this easy. We could pull in a big-integer library as a dependency, but in lieu of that, we for now have decided to just produce inaccurate results if you pass in numbers that are not strictly between `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER`. ## Background What's actually going on here, conceptually, is pretty weird. Let's try to explain. Web IDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on Web IDL values, i.e. instances of Web IDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a Web IDL value of [Web IDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules. Separately from its type system, Web IDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given Web IDL operation, how does that get converted into a Web IDL value? For example, a JavaScript `true` passed in the position of a Web IDL `boolean` argument becomes a Web IDL `true`. But, a JavaScript `true` passed in the position of a [Web IDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a Web IDL `1`. And so on. Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the Web IDL algorithms, they don't actually use Web IDL values, since those aren't "real" outside of specs. Instead, implementations apply the Web IDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`. The upside of all this is that implementations can abstract all the conversion logic away, letting Web IDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of Web IDL, in a nutshell. And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given Web IDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ Web IDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ Web IDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a Web IDL `1` in an unsigned long context, which then becomes a JavaScript `1`. ## Don't use this Seriously, why would you ever use this? You really shouldn't. Web IDL is … strange, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from Web IDL. In general, your JavaScript should not be trying to become more like Web IDL; if anything, we should fix Web IDL to make it more like JavaScript. The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in Web IDL. Its main consumer is the [jsdom](https://github.com/tmpvar/jsdom) project. # y18n [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) The bare-bones internationalization library used by yargs. Inspired by [i18n](https://www.npmjs.com/package/i18n). ## Examples _simple string translation:_ ```js var __ = require('y18n').__ console.log(__('my awesome string %s', 'foo')) ``` output: `my awesome string foo` _using tagged template literals_ ```js var __ = require('y18n').__ var str = 'foo' console.log(__`my awesome string ${str}`) ``` output: `my awesome string foo` _pluralization support:_ ```js var __n = require('y18n').__n console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')) ``` output: `2 fishes foo` ## JSON Language Files The JSON language files should be stored in a `./locales` folder. File names correspond to locales, e.g., `en.json`, `pirate.json`. When strings are observed for the first time they will be added to the JSON file corresponding to the current locale. ## Methods ### require('y18n')(config) Create an instance of y18n with the config provided, options include: * `directory`: the locale directory, default `./locales`. * `updateFiles`: should newly observed strings be updated in file, default `true`. * `locale`: what locale should be used. * `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) be allowed if a file matching the locale does not exist (e.g. `en_US.json`), default `true`. ### y18n.\_\_(str, arg, arg, arg) Print a localized string, `%s` will be replaced with `arg`s. This function can also be used as a tag for a template literal. You can use it like this: <code>__&#96;hello ${'world'}&#96;</code>. This will be equivalent to `__('hello %s', 'world')`. ### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) Print a localized string with appropriate pluralization. If `%d` is provided in the string, the `count` will replace this placeholder. ### y18n.setLocale(str) Set the current locale being used. ### y18n.getLocale() What locale is currently being used? ### y18n.updateLocale(obj) Update the current locale with the key value pairs in `obj`. ## License ISC [travis-url]: https://travis-ci.org/yargs/y18n [travis-image]: https://img.shields.io/travis/yargs/y18n.svg [coveralls-url]: https://coveralls.io/github/yargs/y18n [coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg [npm-url]: https://npmjs.org/package/y18n [npm-image]: https://img.shields.io/npm/v/y18n.svg [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: https://github.com/feross/standard discontinuous-range =================== ``` DiscontinuousRange(1, 10).subtract(4, 6); // [ 1-3, 7-10 ] ``` [![Build Status](https://travis-ci.org/dtudury/discontinuous-range.png)](https://travis-ci.org/dtudury/discontinuous-range) this is a pretty simple module, but it exists to service another project so this'll be pretty lacking documentation. reading the test to see how this works may help. otherwise, here's an example that I think pretty much sums it up ###Example ``` var all_numbers = new DiscontinuousRange(1, 100); var bad_numbers = DiscontinuousRange(13).add(8).add(60,80); var good_numbers = all_numbers.clone().subtract(bad_numbers); console.log(good_numbers.toString()); //[ 1-7, 9-12, 14-59, 81-100 ] var random_good_number = good_numbers.index(Math.floor(Math.random() * good_numbers.length)); ``` # minipass A _very_ minimal implementation of a [PassThrough stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) [It's very fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) for objects, strings, and buffers. Supports pipe()ing (including multi-pipe() and backpressure transmission), buffering data until either a `data` event handler or `pipe()` is added (so you don't lose the first chunk), and most other cases where PassThrough is a good idea. There is a `read()` method, but it's much more efficient to consume data from this stream via `'data'` events or by calling `pipe()` into some other stream. Calling `read()` requires the buffer to be flattened in some cases, which requires copying memory. There is also no `unpipe()` method. Once you start piping, there is no stopping it! If you set `objectMode: true` in the options, then whatever is written will be emitted. Otherwise, it'll do a minimal amount of Buffer copying to ensure proper Streams semantics when `read(n)` is called. `objectMode` can also be set by doing `stream.objectMode = true`, or by writing any non-string/non-buffer data. `objectMode` cannot be set to false once it is set. This is not a `through` or `through2` stream. It doesn't transform the data, it just passes it right through. If you want to transform the data, extend the class, and override the `write()` method. Once you're done transforming the data however you want, call `super.write()` with the transform output. For some examples of streams that extend Minipass in various ways, check out: - [minizlib](http://npm.im/minizlib) - [fs-minipass](http://npm.im/fs-minipass) - [tar](http://npm.im/tar) - [minipass-collect](http://npm.im/minipass-collect) - [minipass-flush](http://npm.im/minipass-flush) - [minipass-pipeline](http://npm.im/minipass-pipeline) - [tap](http://npm.im/tap) - [tap-parser](http://npm.im/tap) - [treport](http://npm.im/tap) - [minipass-fetch](http://npm.im/minipass-fetch) - [pacote](http://npm.im/pacote) - [make-fetch-happen](http://npm.im/make-fetch-happen) - [cacache](http://npm.im/cacache) - [ssri](http://npm.im/ssri) - [npm-registry-fetch](http://npm.im/npm-registry-fetch) - [minipass-json-stream](http://npm.im/minipass-json-stream) - [minipass-sized](http://npm.im/minipass-sized) ## Differences from Node.js Streams There are several things that make Minipass streams different from (and in some ways superior to) Node.js core streams. Please read these caveats if you are familiar with noode-core streams and intend to use Minipass streams in your programs. ### Timing Minipass streams are designed to support synchronous use-cases. Thus, data is emitted as soon as it is available, always. It is buffered until read, but no longer. Another way to look at it is that Minipass streams are exactly as synchronous as the logic that writes into them. This can be surprising if your code relies on `PassThrough.write()` always providing data on the next tick rather than the current one, or being able to call `resume()` and not have the entire buffer disappear immediately. However, without this synchronicity guarantee, there would be no way for Minipass to achieve the speeds it does, or support the synchronous use cases that it does. Simply put, waiting takes time. This non-deferring approach makes Minipass streams much easier to reason about, especially in the context of Promises and other flow-control mechanisms. ### No High/Low Water Marks Node.js core streams will optimistically fill up a buffer, returning `true` on all writes until the limit is hit, even if the data has nowhere to go. Then, they will not attempt to draw more data in until the buffer size dips below a minimum value. Minipass streams are much simpler. The `write()` method will return `true` if the data has somewhere to go (which is to say, given the timing guarantees, that the data is already there by the time `write()` returns). If the data has nowhere to go, then `write()` returns false, and the data sits in a buffer, to be drained out immediately as soon as anyone consumes it. ### Hazards of Buffering (or: Why Minipass Is So Fast) Since data written to a Minipass stream is immediately written all the way through the pipeline, and `write()` always returns true/false based on whether the data was fully flushed, backpressure is communicated immediately to the upstream caller. This minimizes buffering. Consider this case: ```js const {PassThrough} = require('stream') const p1 = new PassThrough({ highWaterMark: 1024 }) const p2 = new PassThrough({ highWaterMark: 1024 }) const p3 = new PassThrough({ highWaterMark: 1024 }) const p4 = new PassThrough({ highWaterMark: 1024 }) p1.pipe(p2).pipe(p3).pipe(p4) p4.on('data', () => console.log('made it through')) // this returns false and buffers, then writes to p2 on next tick (1) // p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) // p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) // p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' // on next tick (4) // p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and // 'drain' on next tick (5) // p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) // p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next // tick (7) p1.write(Buffer.alloc(2048)) // returns false ``` Along the way, the data was buffered and deferred at each stage, and multiple event deferrals happened, for an unblocked pipeline where it was perfectly safe to write all the way through! Furthermore, setting a `highWaterMark` of `1024` might lead someone reading the code to think an advisory maximum of 1KiB is being set for the pipeline. However, the actual advisory buffering level is the _sum_ of `highWaterMark` values, since each one has its own bucket. Consider the Minipass case: ```js const m1 = new Minipass() const m2 = new Minipass() const m3 = new Minipass() const m4 = new Minipass() m1.pipe(m2).pipe(m3).pipe(m4) m4.on('data', () => console.log('made it through')) // m1 is flowing, so it writes the data to m2 immediately // m2 is flowing, so it writes the data to m3 immediately // m3 is flowing, so it writes the data to m4 immediately // m4 is flowing, so it fires the 'data' event immediately, returns true // m4's write returned true, so m3 is still flowing, returns true // m3's write returned true, so m2 is still flowing, returns true // m2's write returned true, so m1 is still flowing, returns true // No event deferrals or buffering along the way! m1.write(Buffer.alloc(2048)) // returns true ``` It is extremely unlikely that you _don't_ want to buffer any data written, or _ever_ buffer data that can be flushed all the way through. Neither node-core streams nor Minipass ever fail to buffer written data, but node-core streams do a lot of unnecessary buffering and pausing. As always, the faster implementation is the one that does less stuff and waits less time to do it. ### Immediately emit `end` for empty streams (when not paused) If a stream is not paused, and `end()` is called before writing any data into it, then it will emit `end` immediately. If you have logic that occurs on the `end` event which you don't want to potentially happen immediately (for example, closing file descriptors, moving on to the next entry in an archive parse stream, etc.) then be sure to call `stream.pause()` on creation, and then `stream.resume()` once you are ready to respond to the `end` event. ### Emit `end` When Asked One hazard of immediately emitting `'end'` is that you may not yet have had a chance to add a listener. In order to avoid this hazard, Minipass streams safely re-emit the `'end'` event if a new listener is added after `'end'` has been emitted. Ie, if you do `stream.on('end', someFunction)`, and the stream has already emitted `end`, then it will call the handler right away. (You can think of this somewhat like attaching a new `.then(fn)` to a previously-resolved Promise.) To prevent calling handlers multiple times who would not expect multiple ends to occur, all listeners are removed from the `'end'` event whenever it is emitted. ### Impact of "immediate flow" on Tee-streams A "tee stream" is a stream piping to multiple destinations: ```js const tee = new Minipass() t.pipe(dest1) t.pipe(dest2) t.write('foo') // goes to both destinations ``` Since Minipass streams _immediately_ process any pending data through the pipeline when a new pipe destination is added, this can have surprising effects, especially when a stream comes in from some other function and may or may not have data in its buffer. ```js // WARNING! WILL LOSE DATA! const src = new Minipass() src.write('foo') src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone src.pipe(dest2) // gets nothing! ``` The solution is to create a dedicated tee-stream junction that pipes to both locations, and then pipe to _that_ instead. ```js // Safe example: tee to both places const src = new Minipass() src.write('foo') const tee = new Minipass() tee.pipe(dest1) tee.pipe(dest2) src.pipe(tee) // tee gets 'foo', pipes to both locations ``` The same caveat applies to `on('data')` event listeners. The first one added will _immediately_ receive all of the data, leaving nothing for the second: ```js // WARNING! WILL LOSE DATA! const src = new Minipass() src.write('foo') src.on('data', handler1) // receives 'foo' right away src.on('data', handler2) // nothing to see here! ``` Using a dedicated tee-stream can be used in this case as well: ```js // Safe example: tee to both data handlers const src = new Minipass() src.write('foo') const tee = new Minipass() tee.on('data', handler1) tee.on('data', handler2) src.pipe(tee) ``` ## USAGE It's a stream! Use it like a stream and it'll most likely do what you want. ```js const Minipass = require('minipass') const mp = new Minipass(options) // optional: { encoding, objectMode } mp.write('foo') mp.pipe(someOtherStream) mp.end('bar') ``` ### OPTIONS * `encoding` How would you like the data coming _out_ of the stream to be encoded? Accepts any values that can be passed to `Buffer.toString()`. * `objectMode` Emit data exactly as it comes in. This will be flipped on by default if you write() something other than a string or Buffer at any point. Setting `objectMode: true` will prevent setting any encoding value. ### API Implements the user-facing portions of Node.js's `Readable` and `Writable` streams. ### Methods * `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the base Minipass class, the same data will come out.) Returns `false` if the stream will buffer the next write, or true if it's still in "flowing" mode. * `end([chunk, [encoding]], [callback])` - Signal that you have no more data to write. This will queue an `end` event to be fired when all the data has been consumed. * `setEncoding(encoding)` - Set the encoding for data coming of the stream. This can only be done once. * `pause()` - No more data for a while, please. This also prevents `end` from being emitted for empty streams until the stream is resumed. * `resume()` - Resume the stream. If there's data in the buffer, it is all discarded. Any buffered events are immediately emitted. * `pipe(dest)` - Send all output to the stream provided. There is no way to unpipe. When data is emitted, it is immediately written to any and all pipe destinations. * `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. Some events are given special treatment, however. (See below under "events".) * `promise()` - Returns a Promise that resolves when the stream emits `end`, or rejects if the stream emits `error`. * `collect()` - Return a Promise that resolves on `end` with an array containing each chunk of data that was emitted, or rejects if the stream emits `error`. Note that this consumes the stream data. * `concat()` - Same as `collect()`, but concatenates the data into a single Buffer object. Will reject the returned promise if the stream is in objectMode, or if it goes into objectMode by the end of the data. * `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not provided, then consume all of it. If `n` bytes are not available, then it returns null. **Note** consuming streams in this way is less efficient, and can lead to unnecessary Buffer copying. * `destroy([er])` - Destroy the stream. If an error is provided, then an `'error'` event is emitted. If the stream has a `close()` method, and has not emitted a `'close'` event yet, then `stream.close()` will be called. Any Promises returned by `.promise()`, `.collect()` or `.concat()` will be rejected. After being destroyed, writing to the stream will emit an error. No more data will be emitted if the stream is destroyed, even if it was previously buffered. ### Properties * `bufferLength` Read-only. Total number of bytes buffered, or in the case of objectMode, the total number of objects. * `encoding` The encoding that has been set. (Setting this is equivalent to calling `setEncoding(enc)` and has the same prohibition against setting multiple times.) * `flowing` Read-only. Boolean indicating whether a chunk written to the stream will be immediately emitted. * `emittedEnd` Read-only. Boolean indicating whether the end-ish events (ie, `end`, `prefinish`, `finish`) have been emitted. Note that listening on any end-ish event will immediateyl re-emit it if it has already been emitted. * `writable` Whether the stream is writable. Default `true`. Set to `false` when `end()` * `readable` Whether the stream is readable. Default `true`. * `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written to the stream that have not yet been emitted. (It's probably a bad idea to mess with this.) * `pipes` A [yallist](http://npm.im/yallist) linked list of streams that this stream is piping into. (It's probably a bad idea to mess with this.) * `destroyed` A getter that indicates whether the stream was destroyed. * `paused` True if the stream has been explicitly paused, otherwise false. * `objectMode` Indicates whether the stream is in `objectMode`. Once set to `true`, it cannot be set to `false`. ### Events * `data` Emitted when there's data to read. Argument is the data to read. This is never emitted while not flowing. If a listener is attached, that will resume the stream. * `end` Emitted when there's no more data to read. This will be emitted immediately for empty streams when `end()` is called. If a listener is attached, and `end` was already emitted, then it will be emitted again. All listeners are removed when `end` is emitted. * `prefinish` An end-ish event that follows the same logic as `end` and is emitted in the same conditions where `end` is emitted. Emitted after `'end'`. * `finish` An end-ish event that follows the same logic as `end` and is emitted in the same conditions where `end` is emitted. Emitted after `'prefinish'`. * `close` An indication that an underlying resource has been released. Minipass does not emit this event, but will defer it until after `end` has been emitted, since it throws off some stream libraries otherwise. * `drain` Emitted when the internal buffer empties, and it is again suitable to `write()` into the stream. * `readable` Emitted when data is buffered and ready to be read by a consumer. * `resume` Emitted when stream changes state from buffering to flowing mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event listener is added.) ### Static Methods * `Minipass.isStream(stream)` Returns `true` if the argument is a stream, and false otherwise. To be considered a stream, the object must be either an instance of Minipass, or an EventEmitter that has either a `pipe()` method, or both `write()` and `end()` methods. (Pretty much any stream in node-land will return `true` for this.) ## EXAMPLES Here are some examples of things you can do with Minipass streams. ### simple "are you done yet" promise ```js mp.promise().then(() => { // stream is finished }, er => { // stream emitted an error }) ``` ### collecting ```js mp.collect().then(all => { // all is an array of all the data emitted // encoding is supported in this case, so // so the result will be a collection of strings if // an encoding is specified, or buffers/objects if not. // // In an async function, you may do // const data = await stream.collect() }) ``` ### collecting into a single blob This is a bit slower because it concatenates the data into one chunk for you, but if you're going to do it yourself anyway, it's convenient this way: ```js mp.concat().then(onebigchunk => { // onebigchunk is a string if the stream // had an encoding set, or a buffer otherwise. }) ``` ### iteration You can iterate over streams synchronously or asynchronously in platforms that support it. Synchronous iteration will end when the currently available data is consumed, even if the `end` event has not been reached. In string and buffer mode, the data is concatenated, so unless multiple writes are occurring in the same tick as the `read()`, sync iteration loops will generally only have a single iteration. To consume chunks in this way exactly as they have been written, with no flattening, create the stream with the `{ objectMode: true }` option. ```js const mp = new Minipass({ objectMode: true }) mp.write('a') mp.write('b') for (let letter of mp) { console.log(letter) // a, b } mp.write('c') mp.write('d') for (let letter of mp) { console.log(letter) // c, d } mp.write('e') mp.end() for (let letter of mp) { console.log(letter) // e } for (let letter of mp) { console.log(letter) // nothing } ``` Asynchronous iteration will continue until the end event is reached, consuming all of the data. ```js const mp = new Minipass({ encoding: 'utf8' }) // some source of some data let i = 5 const inter = setInterval(() => { if (i --> 0) mp.write(Buffer.from('foo\n', 'utf8')) else { mp.end() clearInterval(inter) } }, 100) // consume the data with asynchronous iteration async function consume () { for await (let chunk of mp) { console.log(chunk) } return 'ok' } consume().then(res => console.log(res)) // logs `foo\n` 5 times, and then `ok` ``` ### subclass that `console.log()`s everything written into it ```js class Logger extends Minipass { write (chunk, encoding, callback) { console.log('WRITE', chunk, encoding) return super.write(chunk, encoding, callback) } end (chunk, encoding, callback) { console.log('END', chunk, encoding) return super.end(chunk, encoding, callback) } } someSource.pipe(new Logger()).pipe(someDest) ``` ### same thing, but using an inline anonymous class ```js // js classes are fun someSource .pipe(new (class extends Minipass { emit (ev, ...data) { // let's also log events, because debugging some weird thing console.log('EMIT', ev) return super.emit(ev, ...data) } write (chunk, encoding, callback) { console.log('WRITE', chunk, encoding) return super.write(chunk, encoding, callback) } end (chunk, encoding, callback) { console.log('END', chunk, encoding) return super.end(chunk, encoding, callback) } })) .pipe(someDest) ``` ### subclass that defers 'end' for some reason ```js class SlowEnd extends Minipass { emit (ev, ...args) { if (ev === 'end') { console.log('going to end, hold on a sec') setTimeout(() => { console.log('ok, ready to end now') super.emit('end', ...args) }, 100) } else { return super.emit(ev, ...args) } } } ``` ### transform that creates newline-delimited JSON ```js class NDJSONEncode extends Minipass { write (obj, cb) { try { // JSON.stringify can throw, emit an error on that return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) } catch (er) { this.emit('error', er) } } end (obj, cb) { if (typeof obj === 'function') { cb = obj obj = undefined } if (obj !== undefined) { this.write(obj) } return super.end(cb) } } ``` ### transform that parses newline-delimited JSON ```js class NDJSONDecode extends Minipass { constructor (options) { // always be in object mode, as far as Minipass is concerned super({ objectMode: true }) this._jsonBuffer = '' } write (chunk, encoding, cb) { if (typeof chunk === 'string' && typeof encoding === 'string' && encoding !== 'utf8') { chunk = Buffer.from(chunk, encoding).toString() } else if (Buffer.isBuffer(chunk)) chunk = chunk.toString() } if (typeof encoding === 'function') { cb = encoding } const jsonData = (this._jsonBuffer + chunk).split('\n') this._jsonBuffer = jsonData.pop() for (let i = 0; i < jsonData.length; i++) { let parsed try { super.write(parsed) } catch (er) { this.emit('error', er) continue } } if (cb) cb() } } ``` [![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. Install with `npm install rimraf`, or just drop rimraf.js somewhere. ## API `rimraf(f, [opts], callback)` The first parameter will be interpreted as a globbing pattern for files. If you want to disable globbing you can do so with `opts.disableGlob` (defaults to `false`). This might be handy, for instance, if you have filenames that contain globbing wildcard characters. The callback will be called with an error if there is one. Certain errors are handled for you: * Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of `opts.maxBusyTries` times before giving up, adding 100ms of wait between each attempt. The default `maxBusyTries` is 3. * `ENOENT` - If the file doesn't exist, rimraf will return successfully, since your desired outcome is already the case. * `EMFILE` - Since `readdir` requires opening a file descriptor, it's possible to hit `EMFILE` if too many file descriptors are in use. In the sync case, there's nothing to be done for this. But in the async case, rimraf will gradually back off with timeouts up to `opts.emfileWait` ms, which defaults to 1000. ## options * unlink, chmod, stat, lstat, rmdir, readdir, unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync In order to use a custom file system library, you can override specific fs functions on the options object. If any of these functions are present on the options object, then the supplied function will be used instead of the default fs method. Sync methods are only relevant for `rimraf.sync()`, of course. For example: ```javascript var myCustomFS = require('some-custom-fs') rimraf('some-thing', myCustomFS, callback) ``` * maxBusyTries If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered on Windows systems, then rimraf will retry with a linear backoff wait of 100ms longer on each try. The default maxBusyTries is 3. Only relevant for async usage. * emfileWait If an `EMFILE` error is encountered, then rimraf will retry repeatedly with a linear backoff of 1ms longer on each try, until the timeout counter hits this max. The default limit is 1000. If you repeatedly encounter `EMFILE` errors, then consider using [graceful-fs](http://npm.im/graceful-fs) in your program. Only relevant for async usage. * glob Set to `false` to disable [glob](http://npm.im/glob) pattern matching. Set to an object to pass options to the glob module. The default glob options are `{ nosort: true, silent: true }`. Glob version 6 is used in this module. Relevant for both sync and async usage. * disableGlob Set to any non-falsey value to disable globbing entirely. (Equivalent to setting `glob: false`.) ## rimraf.sync It can remove stuff synchronously, too. But that's not so good. Use the async API. It's better. ## CLI If installed with `npm install rimraf -g` it can be used as a global command `rimraf <path> [<path> ...]` which is useful for cross platform support. ## mkdirp If you need to create a directory recursively, check out [mkdirp](https://github.com/substack/node-mkdirp). [![NPM registry](https://img.shields.io/npm/v/as-bignum.svg?style=for-the-badge)](https://www.npmjs.com/package/as-bignum)[![Build Status](https://img.shields.io/travis/com/MaxGraey/as-bignum/master?style=for-the-badge)](https://travis-ci.com/MaxGraey/as-bignum)[![NPM license](https://img.shields.io/badge/license-Apache%202.0-ba68c8.svg?style=for-the-badge)](LICENSE.md) ## Work in progress --- ### WebAssembly fixed length big numbers written on [AssemblyScript](https://github.com/AssemblyScript/assemblyscript) Provide wide numeric types such as `u128`, `u256`, `i128`, `i256` and fixed points and also its arithmetic operations. Namespace `safe` contain equivalents with overflow/underflow traps. All kind of types pretty useful for economical and cryptographic usages and provide deterministic behavior. ### Install > yarn add as-bignum or > npm i as-bignum ### Usage via AssemblyScript ```ts import { u128 } from "as-bignum"; declare function logF64(value: f64): void; declare function logU128(hi: u64, lo: u64): void; var a = u128.One; var b = u128.from(-32); // same as u128.from<i32>(-32) var c = new u128(0x1, -0xF); var d = u128.from(0x0123456789ABCDEF); // same as u128.from<i64>(0x0123456789ABCDEF) var e = u128.from('0x0123456789ABCDEF01234567'); var f = u128.fromString('11100010101100101', 2); // same as u128.from('0b11100010101100101') var r = d / c + (b << 5) + e; logF64(r.as<f64>()); logU128(r.hi, r.lo); ``` ### Usage via JavaScript/Typescript ```ts TODO ``` ### List of types - [x] [`u128`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/u128.ts) unsigned type (tested) - [ ] [`u256`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/u256.ts) unsigned type (very basic) - [ ] `i128` signed type - [ ] `i256` signed type --- - [x] [`safe.u128`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/safe/u128.ts) unsigned type (tested) - [ ] `safe.u256` unsigned type - [ ] `safe.i128` signed type - [ ] `safe.i256` signed type --- - [ ] [`fp128<Q>`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/fixed/fp128.ts) generic fixed point signed type٭ (very basic for now) - [ ] `fp256<Q>` generic fixed point signed type٭ --- - [ ] `safe.fp128<Q>` generic fixed point signed type٭ - [ ] `safe.fp256<Q>` generic fixed point signed type٭ ٭ _typename_ `Q` _is a type representing count of fractional bits_ # y18n [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) The bare-bones internationalization library used by yargs. Inspired by [i18n](https://www.npmjs.com/package/i18n). ## Examples _simple string translation:_ ```js const __ = require('y18n')().__; console.log(__('my awesome string %s', 'foo')); ``` output: `my awesome string foo` _using tagged template literals_ ```js const __ = require('y18n')().__; const str = 'foo'; console.log(__`my awesome string ${str}`); ``` output: `my awesome string foo` _pluralization support:_ ```js const __n = require('y18n')().__n; console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')); ``` output: `2 fishes foo` ## Deno Example As of `v5` `y18n` supports [Deno](https://github.com/denoland/deno): ```typescript import y18n from "https://deno.land/x/y18n/deno.ts"; const __ = y18n({ locale: 'pirate', directory: './test/locales' }).__ console.info(__`Hi, ${'Ben'} ${'Coe'}!`) ``` You will need to run with `--allow-read` to load alternative locales. ## JSON Language Files The JSON language files should be stored in a `./locales` folder. File names correspond to locales, e.g., `en.json`, `pirate.json`. When strings are observed for the first time they will be added to the JSON file corresponding to the current locale. ## Methods ### require('y18n')(config) Create an instance of y18n with the config provided, options include: * `directory`: the locale directory, default `./locales`. * `updateFiles`: should newly observed strings be updated in file, default `true`. * `locale`: what locale should be used. * `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) be allowed if a file matching the locale does not exist (e.g. `en_US.json`), default `true`. ### y18n.\_\_(str, arg, arg, arg) Print a localized string, `%s` will be replaced with `arg`s. This function can also be used as a tag for a template literal. You can use it like this: <code>__&#96;hello ${'world'}&#96;</code>. This will be equivalent to `__('hello %s', 'world')`. ### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) Print a localized string with appropriate pluralization. If `%d` is provided in the string, the `count` will replace this placeholder. ### y18n.setLocale(str) Set the current locale being used. ### y18n.getLocale() What locale is currently being used? ### y18n.updateLocale(obj) Update the current locale with the key value pairs in `obj`. ## Supported Node.js Versions Libraries in this ecosystem make a best effort to track [Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). ## License ISC [npm-url]: https://npmjs.org/package/y18n [npm-image]: https://img.shields.io/npm/v/y18n.svg [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: https://github.com/feross/standard # fs-minipass Filesystem streams based on [minipass](http://npm.im/minipass). 4 classes are exported: - ReadStream - ReadStreamSync - WriteStream - WriteStreamSync When using `ReadStreamSync`, all of the data is made available immediately upon consuming the stream. Nothing is buffered in memory when the stream is constructed. If the stream is piped to a writer, then it will synchronously `read()` and emit data into the writer as fast as the writer can consume it. (That is, it will respect backpressure.) If you call `stream.read()` then it will read the entire file and return the contents. When using `WriteStreamSync`, every write is flushed to the file synchronously. If your writes all come in a single tick, then it'll write it all out in a single tick. It's as synchronous as you are. The async versions work much like their node builtin counterparts, with the exception of introducing significantly less Stream machinery overhead. ## USAGE It's just streams, you pipe them or read() them or write() to them. ```js const fsm = require('fs-minipass') const readStream = new fsm.ReadStream('file.txt') const writeStream = new fsm.WriteStream('output.txt') writeStream.write('some file header or whatever\n') readStream.pipe(writeStream) ``` ## ReadStream(path, options) Path string is required, but somewhat irrelevant if an open file descriptor is passed in as an option. Options: - `fd` Pass in a numeric file descriptor, if the file is already open. - `readSize` The size of reads to do, defaults to 16MB - `size` The size of the file, if known. Prevents zero-byte read() call at the end. - `autoClose` Set to `false` to prevent the file descriptor from being closed when the file is done being read. ## WriteStream(path, options) Path string is required, but somewhat irrelevant if an open file descriptor is passed in as an option. Options: - `fd` Pass in a numeric file descriptor, if the file is already open. - `mode` The mode to create the file with. Defaults to `0o666`. - `start` The position in the file to start reading. If not specified, then the file will start writing at position zero, and be truncated by default. - `autoClose` Set to `false` to prevent the file descriptor from being closed when the stream is ended. - `flags` Flags to use when opening the file. Irrelevant if `fd` is passed in, since file won't be opened in that case. Defaults to `'a'` if a `pos` is specified, or `'w'` otherwise. # wrappy Callback wrapping utility ## USAGE ```javascript var wrappy = require("wrappy") // var wrapper = wrappy(wrapperFunction) // make sure a cb is called only once // See also: http://npm.im/once for this specific use case var once = wrappy(function (cb) { var called = false return function () { if (called) return called = true return cb.apply(this, arguments) } }) function printBoo () { console.log('boo') } // has some rando property printBoo.iAmBooPrinter = true var onlyPrintOnce = once(printBoo) onlyPrintOnce() // prints 'boo' onlyPrintOnce() // does nothing // random property is retained! assert.equal(onlyPrintOnce.iAmBooPrinter, true) ``` # jsdiff [![Build Status](https://secure.travis-ci.org/kpdecker/jsdiff.svg)](http://travis-ci.org/kpdecker/jsdiff) [![Sauce Test Status](https://saucelabs.com/buildstatus/jsdiff)](https://saucelabs.com/u/jsdiff) A javascript text differencing implementation. Based on the algorithm proposed in ["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927). ## Installation ```bash npm install diff --save ``` ## API * `Diff.diffChars(oldStr, newStr[, options])` - diffs two blocks of text, comparing character by character. Returns a list of change objects (See below). Options * `ignoreCase`: `true` to ignore casing difference. Defaults to `false`. * `Diff.diffWords(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, ignoring whitespace. Returns a list of change objects (See below). Options * `ignoreCase`: Same as in `diffChars`. * `Diff.diffWordsWithSpace(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, treating whitespace as significant. Returns a list of change objects (See below). * `Diff.diffLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line. Options * `ignoreWhitespace`: `true` to ignore leading and trailing whitespace. This is the same as `diffTrimmedLines` * `newlineIsToken`: `true` to treat newline characters as separate tokens. This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human friendly form of `diffLines` and `diffLines` is better suited for patches and other computer friendly output. Returns a list of change objects (See below). * `Diff.diffTrimmedLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace. Returns a list of change objects (See below). * `Diff.diffSentences(oldStr, newStr[, options])` - diffs two blocks of text, comparing sentence by sentence. Returns a list of change objects (See below). * `Diff.diffCss(oldStr, newStr[, options])` - diffs two blocks of text, comparing CSS tokens. Returns a list of change objects (See below). * `Diff.diffJson(oldObj, newObj[, options])` - diffs two JSON objects, comparing the fields defined on each. The order of fields, etc does not matter in this comparison. Returns a list of change objects (See below). * `Diff.diffArrays(oldArr, newArr[, options])` - diffs two arrays, comparing each item for strict equality (===). Options * `comparator`: `function(left, right)` for custom equality checks Returns a list of change objects (See below). * `Diff.createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch. Parameters: * `oldFileName` : String to be output in the filename section of the patch for the removals * `newFileName` : String to be output in the filename section of the patch for the additions * `oldStr` : Original string value * `newStr` : New string value * `oldHeader` : Additional information to include in the old file header * `newHeader` : Additional information to include in the new file header * `options` : An object with options. Currently, only `context` is supported and describes how many lines of context should be included. * `Diff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch. Just like Diff.createTwoFilesPatch, but with oldFileName being equal to newFileName. * `Diff.structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)` - returns an object with an array of hunk objects. This method is similar to createTwoFilesPatch, but returns a data structure suitable for further processing. Parameters are the same as createTwoFilesPatch. The data structure returned may look like this: ```js { oldFileName: 'oldfile', newFileName: 'newfile', oldHeader: 'header1', newHeader: 'header2', hunks: [{ oldStart: 1, oldLines: 3, newStart: 1, newLines: 3, lines: [' line2', ' line3', '-line4', '+line5', '\\ No newline at end of file'], }] } ``` * `Diff.applyPatch(source, patch[, options])` - applies a unified diff patch. Return a string containing new version of provided data. `patch` may be a string diff or the output from the `parsePatch` or `structuredPatch` methods. The optional `options` object may have the following keys: - `fuzzFactor`: Number of lines that are allowed to differ before rejecting a patch. Defaults to 0. - `compareLine(lineNumber, line, operation, patchContent)`: Callback used to compare to given lines to determine if they should be considered equal when patching. Defaults to strict equality but may be overridden to provide fuzzier comparison. Should return false if the lines should be rejected. * `Diff.applyPatches(patch, options)` - applies one or more patches. This method will iterate over the contents of the patch and apply to data provided through callbacks. The general flow for each patch index is: - `options.loadFile(index, callback)` is called. The caller should then load the contents of the file and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution. - `options.patched(index, content, callback)` is called once the patch has been applied. `content` will be the return value from `applyPatch`. When it's ready, the caller should call `callback(err)` callback. Passing an `err` will terminate further patch execution. Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made. * `Diff.parsePatch(diffStr)` - Parses a patch into structured data Return a JSON object representation of the a patch, suitable for use with the `applyPatch` method. This parses to the same structure returned by `Diff.structuredPatch`. * `convertChangesToXML(changes)` - converts a list of changes to a serialized XML format All methods above which accept the optional `callback` method will run in sync mode when that parameter is omitted and in async mode when supplied. This allows for larger diffs without blocking the event loop. This may be passed either directly as the final parameter or as the `callback` field in the `options` object. ### Change Objects Many of the methods above return change objects. These objects consist of the following fields: * `value`: Text content * `added`: True if the value was inserted into the new string * `removed`: True if the value was removed from the old string Note that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner. ## Examples Basic example in Node ```js require('colors'); const Diff = require('diff'); const one = 'beep boop'; const other = 'beep boob blah'; const diff = Diff.diffChars(one, other); diff.forEach((part) => { // green for additions, red for deletions // grey for common parts const color = part.added ? 'green' : part.removed ? 'red' : 'grey'; process.stderr.write(part.value[color]); }); console.log(); ``` Running the above program should yield <img src="images/node_example.png" alt="Node Example"> Basic example in a web page ```html <pre id="display"></pre> <script src="diff.js"></script> <script> const one = 'beep boop', other = 'beep boob blah', color = ''; let span = null; const diff = Diff.diffChars(one, other), display = document.getElementById('display'), fragment = document.createDocumentFragment(); diff.forEach((part) => { // green for additions, red for deletions // grey for common parts const color = part.added ? 'green' : part.removed ? 'red' : 'grey'; span = document.createElement('span'); span.style.color = color; span.appendChild(document .createTextNode(part.value)); fragment.appendChild(span); }); display.appendChild(fragment); </script> ``` Open the above .html file in a browser and you should see <img src="images/web_example.png" alt="Node Example"> **[Full online demo](http://kpdecker.github.com/jsdiff)** ## Compatibility [![Sauce Test Status](https://saucelabs.com/browser-matrix/jsdiff.svg)](https://saucelabs.com/u/jsdiff) jsdiff supports all ES3 environments with some known issues on IE8 and below. Under these browsers some diff algorithms such as word diff and others may fail due to lack of support for capturing groups in the `split` operation. ## License See [LICENSE](https://github.com/kpdecker/jsdiff/blob/master/LICENSE). # base-x [![NPM Package](https://img.shields.io/npm/v/base-x.svg?style=flat-square)](https://www.npmjs.org/package/base-x) [![Build Status](https://img.shields.io/travis/cryptocoinjs/base-x.svg?branch=master&style=flat-square)](https://travis-ci.org/cryptocoinjs/base-x) [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) Fast base encoding / decoding of any given alphabet using bitcoin style leading zero compression. **WARNING:** This module is **NOT RFC3548** compliant, it cannot be used for base16 (hex), base32, or base64 encoding in a standards compliant manner. ## Example Base58 ``` javascript var BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' var bs58 = require('base-x')(BASE58) var decoded = bs58.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr') console.log(decoded) // => <Buffer 80 ed db dc 11 68 f1 da ea db d3 e4 4c 1e 3f 8f 5a 28 4c 20 29 f7 8a d2 6a f9 85 83 a4 99 de 5b 19> console.log(bs58.encode(decoded)) // => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr ``` ### Alphabets See below for a list of commonly recognized alphabets, and their respective base. Base | Alphabet ------------- | ------------- 2 | `01` 8 | `01234567` 11 | `0123456789a` 16 | `0123456789abcdef` 32 | `0123456789ABCDEFGHJKMNPQRSTVWXYZ` 32 | `ybndrfg8ejkmcpqxot1uwisza345h769` (z-base-32) 36 | `0123456789abcdefghijklmnopqrstuvwxyz` 58 | `123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz` 62 | `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` 64 | `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/` 66 | `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~` ## How it works It encodes octet arrays by doing long divisions on all significant digits in the array, creating a representation of that number in the new base. Then for every leading zero in the input (not significant as a number) it will encode as a single leader character. This is the first in the alphabet and will decode as 8 bits. The other characters depend upon the base. For example, a base58 alphabet packs roughly 5.858 bits per character. This means the encoded string 000f (using a base16, 0-f alphabet) will actually decode to 4 bytes unlike a canonical hex encoding which uniformly packs 4 bits into each character. While unusual, this does mean that no padding is required and it works for bases like 43. ## LICENSE [MIT](LICENSE) A direct derivation of the base58 implementation from [`bitcoin/bitcoin`](https://github.com/bitcoin/bitcoin/blob/f1e2f2a85962c1664e4e55471061af0eaa798d40/src/base58.cpp), generalized for variable length alphabets. # ASBuild A simple build tool for [AssemblyScript](https://assemblyscript.org) projects, similar to `cargo`, etc. ## Usage ``` asb [entry file] [options] -- [args passed to asc] ``` ### Background AssemblyScript greater than v0.14.4 provides a `asconfig.json` configuration file that can be used to describe the options for building a project. ASBuild uses this and some defaults to create an easier CLI interface. ### Defaults #### Project structure ``` project/ package.json asconfig.json assembly/ index.ts build/ release/ project.wasm debug/ project.wasm ``` - If no entry file passed and no `entry` field is in `asconfig.json`, `project/assembly/index.ts` is assumed. - `asconfig.json` allows for options for different compile targets, e.g. release, debug, etc. `asc` defaults to the release target. - The default build directory is `./build`, and artifacts are placed at `./build/<target>/packageName.wasm`. ### Workspaces If a `workspace` field is added to a top level `asconfig.json` file, then each path in the array is built and placed into the top level `outDir`. For example, `asconfig.json`: ```json { "workspaces": ["a", "b"] } ``` Running `asb` in the directory below will use the top level build directory to place all the binaries. ``` project/ package.json asconfig.json a/ asconfig.json assembly/ index.ts b/ asconfig.json assembly/ index.ts build/ release/ a.wasm b.wasm debug/ a.wasm b.wasm ``` To see an example in action check out the [test workspace](./test) [![build status](https://secure.travis-ci.org/dankogai/js-base64.png)](http://travis-ci.org/dankogai/js-base64) # base64.js Yet another [Base64] transcoder. [Base64]: http://en.wikipedia.org/wiki/Base64 ## HEADS UP In version 3.0 `js-base64` switch to ES2015 module so it is no longer compatible with legacy browsers like IE (see below). And since version 3.3 it is written in TypeScript. Now `base64.mjs` is compiled from `base64.ts` then `base64.js` is generated from `base64.mjs`. ## Install ```shell $ npm install --save js-base64 ``` ## Usage ### In Browser Locally… ```html <script src="base64.js"></script> ``` … or Directly from CDN. In which case you don't even need to install. ```html <script src="https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.min.js"></script> ``` This good old way loads `Base64` in the global context (`window`). Though `Base64.noConflict()` is made available, you should consider using ES6 Module to avoid tainting `window`. ### As an ES6 Module locally… ```javascript import { Base64 } from 'js-base64'; ``` ```javascript // or if you prefer no Base64 namespace import { encode, decode } from 'js-base64'; ``` or even remotely. ```html <script type="module"> // note jsdelivr.net does not automatically minify .mjs import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.mjs'; </script> ``` ```html <script type="module"> // or if you prefer no Base64 namespace import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.mjs'; </script> ``` ### node.js (commonjs) ```javascript const {Base64} = require('js-base64'); ``` Unlike the case above, the global context is no longer modified. You can also use [esm] to `import` instead of `require`. [esm]: https://github.com/standard-things/esm ```javascript require=require('esm')(module); import {Base64} from 'js-base64'; ``` ## SYNOPSIS ```javascript let latin = 'dankogai'; let utf8 = '小飼弾' let u8s = new Uint8Array([100,97,110,107,111,103,97,105]); Base64.encode(latin); // ZGFua29nYWk= Base64.btoa(latin); // ZGFua29nYWk= Base64.btoa(utf8); // raises exception Base64.fromUint8Array(u8s); // ZGFua29nYWk= Base64.fromUint8Array(u8s, true); // ZGFua29nYW which is URI safe Base64.encode(utf8); // 5bCP6aO85by+ Base64.encode(utf8, true) // 5bCP6aO85by- Base64.encodeURI(utf8); // 5bCP6aO85by- ``` ```javascript Base64.decode( 'ZGFua29nYWk=');// dankogai Base64.atob( 'ZGFua29nYWk=');// dankogai Base64.atob( '5bCP6aO85by+');// '小飼弾' which is nonsense Base64.toUint8Array('ZGFua29nYWk=');// u8s above Base64.decode( '5bCP6aO85by+');// 小飼弾 // note .decodeURI() is unnecessary since it accepts both flavors Base64.decode( '5bCP6aO85by-');// 小飼弾 ``` ```javascript Base64.isValid(0); // false: 0 is not string Base64.isValid(''); // true: a valid Base64-encoded empty byte Base64.isValid('ZA=='); // true: a valid Base64-encoded 'd' Base64.isValid('Z A='); // true: whitespaces are okay Base64.isValid('ZA'); // true: padding ='s can be omitted Base64.isValid('++'); // true: can be non URL-safe Base64.isValid('--'); // true: or URL-safe Base64.isValid('+-'); // false: can't mix both ``` ### Built-in Extensions By default `Base64` leaves built-in prototypes untouched. But you can extend them as below. ```javascript // you have to explicitly extend String.prototype Base64.extendString(); // once extended, you can do the following 'dankogai'.toBase64(); // ZGFua29nYWk= '小飼弾'.toBase64(); // 5bCP6aO85by+ '小飼弾'.toBase64(true); // 5bCP6aO85by- '小飼弾'.toBase64URI(); // 5bCP6aO85by- ab alias of .toBase64(true) '小飼弾'.toBase64URL(); // 5bCP6aO85by- an alias of .toBase64URI() 'ZGFua29nYWk='.fromBase64(); // dankogai '5bCP6aO85by+'.fromBase64(); // 小飼弾 '5bCP6aO85by-'.fromBase64(); // 小飼弾 '5bCP6aO85by-'.toUint8Array();// u8s above ``` ```javascript // you have to explicitly extend String.prototype Base64.extendString(); // once extended, you can do the following u8s.toBase64(); // 'ZGFua29nYWk=' u8s.toBase64URI(); // 'ZGFua29nYWk' u8s.toBase64URL(); // 'ZGFua29nYWk' an alias of .toBase64URI() ``` ```javascript // extend all at once Base64.extendBuiltins() ``` ## `.decode()` vs `.atob` (and `.encode()` vs `btoa()`) Suppose you have: ``` var pngBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="; ``` Which is a Base64-encoded 1x1 transparent PNG, **DO NOT USE** `Base64.decode(pngBase64)`.  Use `Base64.atob(pngBase64)` instead.  `Base64.decode()` decodes to UTF-8 string while `Base64.atob()` decodes to bytes, which is compatible to browser built-in `atob()` (Which is absent in node.js).  The same rule applies to the opposite direction. Or even better, `Base64.toUint8Array(pngBase64)`. ### If you really, really need an ES5 version You can transpiles to an ES5 that runs on IE11. Do the following in your shell. ```shell $ make base64.es5.js ``` # <img src="./logo.png" alt="bn.js" width="160" height="160" /> > BigNum in pure javascript [![Build Status](https://secure.travis-ci.org/indutny/bn.js.png)](http://travis-ci.org/indutny/bn.js) ## Install `npm install --save bn.js` ## Usage ```js const BN = require('bn.js'); var a = new BN('dead', 16); var b = new BN('101010', 2); var res = a.add(b); console.log(res.toString(10)); // 57047 ``` **Note**: decimals are not supported in this library. ## Notation ### Prefixes There are several prefixes to instructions that affect the way the work. Here is the list of them in the order of appearance in the function name: * `i` - perform operation in-place, storing the result in the host object (on which the method was invoked). Might be used to avoid number allocation costs * `u` - unsigned, ignore the sign of operands when performing operation, or always return positive value. Second case applies to reduction operations like `mod()`. In such cases if the result will be negative - modulo will be added to the result to make it positive ### Postfixes * `n` - the argument of the function must be a plain JavaScript Number. Decimals are not supported. * `rn` - both argument and return value of the function are plain JavaScript Numbers. Decimals are not supported. ### Examples * `a.iadd(b)` - perform addition on `a` and `b`, storing the result in `a` * `a.umod(b)` - reduce `a` modulo `b`, returning positive value * `a.iushln(13)` - shift bits of `a` left by 13 ## Instructions Prefixes/postfixes are put in parens at the of the line. `endian` - could be either `le` (little-endian) or `be` (big-endian). ### Utilities * `a.clone()` - clone number * `a.toString(base, length)` - convert to base-string and pad with zeroes * `a.toNumber()` - convert to Javascript Number (limited to 53 bits) * `a.toJSON()` - convert to JSON compatible hex string (alias of `toString(16)`) * `a.toArray(endian, length)` - convert to byte `Array`, and optionally zero pad to length, throwing if already exceeding * `a.toArrayLike(type, endian, length)` - convert to an instance of `type`, which must behave like an `Array` * `a.toBuffer(endian, length)` - convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: `a.toArrayLike(Buffer, endian, length)` * `a.bitLength()` - get number of bits occupied * `a.zeroBits()` - return number of less-significant consequent zero bits (example: `1010000` has 4 zero bits) * `a.byteLength()` - return number of bytes occupied * `a.isNeg()` - true if the number is negative * `a.isEven()` - no comments * `a.isOdd()` - no comments * `a.isZero()` - no comments * `a.cmp(b)` - compare numbers and return `-1` (a `<` b), `0` (a `==` b), or `1` (a `>` b) depending on the comparison result (`ucmp`, `cmpn`) * `a.lt(b)` - `a` less than `b` (`n`) * `a.lte(b)` - `a` less than or equals `b` (`n`) * `a.gt(b)` - `a` greater than `b` (`n`) * `a.gte(b)` - `a` greater than or equals `b` (`n`) * `a.eq(b)` - `a` equals `b` (`n`) * `a.toTwos(width)` - convert to two's complement representation, where `width` is bit width * `a.fromTwos(width)` - convert from two's complement representation, where `width` is the bit width * `BN.isBN(object)` - returns true if the supplied `object` is a BN.js instance * `BN.max(a, b)` - return `a` if `a` bigger than `b` * `BN.min(a, b)` - return `a` if `a` less than `b` ### Arithmetics * `a.neg()` - negate sign (`i`) * `a.abs()` - absolute value (`i`) * `a.add(b)` - addition (`i`, `n`, `in`) * `a.sub(b)` - subtraction (`i`, `n`, `in`) * `a.mul(b)` - multiply (`i`, `n`, `in`) * `a.sqr()` - square (`i`) * `a.pow(b)` - raise `a` to the power of `b` * `a.div(b)` - divide (`divn`, `idivn`) * `a.mod(b)` - reduct (`u`, `n`) (but no `umodn`) * `a.divmod(b)` - quotient and modulus obtained by dividing * `a.divRound(b)` - rounded division ### Bit operations * `a.or(b)` - or (`i`, `u`, `iu`) * `a.and(b)` - and (`i`, `u`, `iu`, `andln`) (NOTE: `andln` is going to be replaced with `andn` in future) * `a.xor(b)` - xor (`i`, `u`, `iu`) * `a.setn(b, value)` - set specified bit to `value` * `a.shln(b)` - shift left (`i`, `u`, `iu`) * `a.shrn(b)` - shift right (`i`, `u`, `iu`) * `a.testn(b)` - test if specified bit is set * `a.maskn(b)` - clear bits with indexes higher or equal to `b` (`i`) * `a.bincn(b)` - add `1 << b` to the number * `a.notn(w)` - not (for the width specified by `w`) (`i`) ### Reduction * `a.gcd(b)` - GCD * `a.egcd(b)` - Extended GCD results (`{ a: ..., b: ..., gcd: ... }`) * `a.invm(b)` - inverse `a` modulo `b` ## Fast reduction When doing lots of reductions using the same modulo, it might be beneficial to use some tricks: like [Montgomery multiplication][0], or using special algorithm for [Mersenne Prime][1]. ### Reduction context To enable this tricks one should create a reduction context: ```js var red = BN.red(num); ``` where `num` is just a BN instance. Or: ```js var red = BN.red(primeName); ``` Where `primeName` is either of these [Mersenne Primes][1]: * `'k256'` * `'p224'` * `'p192'` * `'p25519'` Or: ```js var red = BN.mont(num); ``` To reduce numbers with [Montgomery trick][0]. `.mont()` is generally faster than `.red(num)`, but slower than `BN.red(primeName)`. ### Converting numbers Before performing anything in reduction context - numbers should be converted to it. Usually, this means that one should: * Convert inputs to reducted ones * Operate on them in reduction context * Convert outputs back from the reduction context Here is how one may convert numbers to `red`: ```js var redA = a.toRed(red); ``` Where `red` is a reduction context created using instructions above Here is how to convert them back: ```js var a = redA.fromRed(); ``` ### Red instructions Most of the instructions from the very start of this readme have their counterparts in red context: * `a.redAdd(b)`, `a.redIAdd(b)` * `a.redSub(b)`, `a.redISub(b)` * `a.redShl(num)` * `a.redMul(b)`, `a.redIMul(b)` * `a.redSqr()`, `a.redISqr()` * `a.redSqrt()` - square root modulo reduction context's prime * `a.redInvm()` - modular inverse of the number * `a.redNeg()` * `a.redPow(b)` - modular exponentiation ### Number Size Optimized for elliptic curves that work with 256-bit numbers. There is no limitation on the size of the numbers. ## LICENSE This software is licensed under the MIT License. [0]: https://en.wikipedia.org/wiki/Montgomery_modular_multiplication [1]: https://en.wikipedia.org/wiki/Mersenne_prime <p align="center"> <a href="https://assemblyscript.org" target="_blank" rel="noopener"><img width="100" src="https://avatars1.githubusercontent.com/u/28916798?s=200&v=4" alt="AssemblyScript logo"></a> </p> <p align="center"> <a href="https://github.com/AssemblyScript/assemblyscript/actions?query=workflow%3ATest"><img src="https://img.shields.io/github/workflow/status/AssemblyScript/assemblyscript/Test/master?label=test&logo=github" alt="Test status" /></a> <a href="https://github.com/AssemblyScript/assemblyscript/actions?query=workflow%3APublish"><img src="https://img.shields.io/github/workflow/status/AssemblyScript/assemblyscript/Publish/master?label=publish&logo=github" alt="Publish status" /></a> <a href="https://www.npmjs.com/package/assemblyscript"><img src="https://img.shields.io/npm/v/assemblyscript.svg?label=compiler&color=007acc&logo=npm" alt="npm compiler version" /></a> <a href="https://www.npmjs.com/package/@assemblyscript/loader"><img src="https://img.shields.io/npm/v/@assemblyscript/loader.svg?label=loader&color=007acc&logo=npm" alt="npm loader version" /></a> <a href="https://discord.gg/assemblyscript"><img src="https://img.shields.io/discord/721472913886281818.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2" alt="Discord online" /></a> </p> <p align="justify"><strong>AssemblyScript</strong> compiles a strict variant of <a href="http://www.typescriptlang.org">TypeScript</a> (basically JavaScript with types) to <a href="http://webassembly.org">WebAssembly</a> using <a href="https://github.com/WebAssembly/binaryen">Binaryen</a>. It generates lean and mean WebAssembly modules while being just an <code>npm install</code> away.</p> <h3 align="center"> <a href="https://assemblyscript.org">About</a> &nbsp;·&nbsp; <a href="https://assemblyscript.org/introduction.html">Introduction</a> &nbsp;·&nbsp; <a href="https://assemblyscript.org/quick-start.html">Quick&nbsp;start</a> &nbsp;·&nbsp; <a href="https://assemblyscript.org/examples.html">Examples</a> &nbsp;·&nbsp; <a href="https://assemblyscript.org/development.html">Development&nbsp;instructions</a> </h3> <br> <h2 align="center">Contributors</h2> <p align="center"> <a href="https://assemblyscript.org/#contributors"><img src="https://assemblyscript.org/contributors.svg" alt="Contributor logos" width="720" /></a> </p> <h2 align="center">Thanks to our sponsors!</h2> <p align="justify">Most of the core team members and most contributors do this open source work in their free time. If you use AssemblyScript for a serious task or plan to do so, and you'd like us to invest more time on it, <a href="https://opencollective.com/assemblyscript/donate" target="_blank" rel="noopener">please donate</a> to our <a href="https://opencollective.com/assemblyscript" target="_blank" rel="noopener">OpenCollective</a>. By sponsoring this project, your logo will show up below. Thank you so much for your support!</p> <p align="center"> <a href="https://assemblyscript.org/#sponsors"><img src="https://assemblyscript.org/sponsors.svg" alt="Sponsor logos" width="720" /></a> </p> # AssemblyScript Rtrace A tiny utility to sanitize the AssemblyScript runtime. Records allocations and frees performed by the runtime and emits an error if something is off. Also checks for leaks. Instructions ------------ Compile your module that uses the full or half runtime with `-use ASC_RTRACE=1 --explicitStart` and include an instance of this module as the import named `rtrace`. ```js const rtrace = new Rtrace({ onerror(err, info) { // handle error }, oninfo(msg) { // print message, optional }, getMemory() { // obtain the module's memory, // e.g. with --explicitStart: return instance.exports.memory; } }); const { module, instance } = await WebAssembly.instantiate(..., rtrace.install({ ...imports... }) ); instance.exports._start(); ... if (rtrace.active) { let leakCount = rtr.check(); if (leakCount) { // handle error } } ``` Note that references in globals which are not cleared before collection is performed appear as leaks, including their inner members. A TypedArray would leak itself and its backing ArrayBuffer in this case for example. This is perfectly normal and clearing all globals avoids this. # near-sdk-core This package contain a convenient interface for interacting with NEAR's host runtime. To see the functions that are provided by the host node see [`env.ts`](./assembly/env/env.ts). <p align="center"> <img width="250" src="/yargs-logo.png"> </p> <h1 align="center"> Yargs </h1> <p align="center"> <b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b> </p> <br> [![Build Status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] [![Coverage][coverage-image]][coverage-url] [![Conventional Commits][conventional-commits-image]][conventional-commits-url] [![Slack][slack-image]][slack-url] ## Description : Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It gives you: * commands and (grouped) options (`my-program.js serve --port=5000`). * a dynamically generated help menu based on your arguments. > <img width="400" src="/screen.png"> * bash-completion shortcuts for commands and options. * and [tons more](/docs/api.md). ## Installation Stable version: ```bash npm i yargs ``` Bleeding edge version with the most recent features: ```bash npm i yargs@next ``` ## Usage : ### Simple Example ```javascript #!/usr/bin/env node const {argv} = require('yargs') if (argv.ships > 3 && argv.distance < 53.5) { console.log('Plunder more riffiwobbles!') } else { console.log('Retreat from the xupptumblers!') } ``` ```bash $ ./plunder.js --ships=4 --distance=22 Plunder more riffiwobbles! $ ./plunder.js --ships 12 --distance 98.7 Retreat from the xupptumblers! ``` ### Complex Example ```javascript #!/usr/bin/env node require('yargs') // eslint-disable-line .command('serve [port]', 'start the server', (yargs) => { yargs .positional('port', { describe: 'port to bind on', default: 5000 }) }, (argv) => { if (argv.verbose) console.info(`start server on :${argv.port}`) serve(argv.port) }) .option('verbose', { alias: 'v', type: 'boolean', description: 'Run with verbose logging' }) .argv ``` Run the example above with `--help` to see the help for the application. ## TypeScript yargs has type definitions at [@types/yargs][type-definitions]. ``` npm i @types/yargs --save-dev ``` See usage examples in [docs](/docs/typescript.md). ## Webpack See usage examples of yargs with webpack in [docs](/docs/webpack.md). ## Community : Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). ## Documentation : ### Table of Contents * [Yargs' API](/docs/api.md) * [Examples](/docs/examples.md) * [Parsing Tricks](/docs/tricks.md) * [Stop the Parser](/docs/tricks.md#stop) * [Negating Boolean Arguments](/docs/tricks.md#negate) * [Numbers](/docs/tricks.md#numbers) * [Arrays](/docs/tricks.md#arrays) * [Objects](/docs/tricks.md#objects) * [Quotes](/docs/tricks.md#quotes) * [Advanced Topics](/docs/advanced.md) * [Composing Your App Using Commands](/docs/advanced.md#commands) * [Building Configurable CLI Apps](/docs/advanced.md#configuration) * [Customizing Yargs' Parser](/docs/advanced.md#customizing) * [Contributing](/contributing.md) [travis-url]: https://travis-ci.org/yargs/yargs [travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg [npm-url]: https://www.npmjs.com/package/yargs [npm-image]: https://img.shields.io/npm/v/yargs.svg [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: http://standardjs.com/ [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg [conventional-commits-url]: https://conventionalcommits.org/ [slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg [slack-url]: http://devtoolscommunity.herokuapp.com [type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs [coverage-image]: https://img.shields.io/nycrc/yargs/yargs [coverage-url]: https://github.com/yargs/yargs/blob/master/.nycrc # axios // core The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: - Dispatching requests - Managing interceptors - Handling config # assemblyscript-json ![npm version](https://img.shields.io/npm/v/assemblyscript-json) ![npm downloads per month](https://img.shields.io/npm/dm/assemblyscript-json) JSON encoder / decoder for AssemblyScript. Special thanks to https://github.com/MaxGraey/bignum.wasm for basic unit testing infra for AssemblyScript. ## Installation `assemblyscript-json` is available as a [npm package](https://www.npmjs.com/package/assemblyscript-json). You can install `assemblyscript-json` in your AssemblyScript project by running: `npm install --save assemblyscript-json` ## Usage ### Parsing JSON ```typescript import { JSON } from "assemblyscript-json"; // Parse an object using the JSON object let jsonObj: JSON.Obj = <JSON.Obj>(JSON.parse('{"hello": "world", "value": 24}')); // We can then use the .getX functions to read from the object if you know it's type // This will return the appropriate JSON.X value if the key exists, or null if the key does not exist let worldOrNull: JSON.Str | null = jsonObj.getString("hello"); // This will return a JSON.Str or null if (worldOrNull != null) { // use .valueOf() to turn the high level JSON.Str type into a string let world: string = worldOrNull.valueOf(); } let numOrNull: JSON.Num | null = jsonObj.getNum("value"); if (numOrNull != null) { // use .valueOf() to turn the high level JSON.Num type into a f64 let value: f64 = numOrNull.valueOf(); } // If you don't know the value type, get the parent JSON.Value let valueOrNull: JSON.Value | null = jsonObj.getValue("hello"); if (valueOrNull != null) { let value: JSON.Value = changetype<JSON.Value>(valueOrNull); // Next we could figure out what type we are if(value.isString) { // value.isString would be true, so we can cast to a string let stringValue: string = changetype<JSON.Str>(value).toString(); // Do something with string value } } ``` ### Encoding JSON ```typescript import { JSONEncoder } from "assemblyscript-json"; // Create encoder let encoder = new JSONEncoder(); // Construct necessary object encoder.pushObject("obj"); encoder.setInteger("int", 10); encoder.setString("str", ""); encoder.popObject(); // Get serialized data let json: Uint8Array = encoder.serialize(); // Or get serialized data as string let jsonString: string = encoder.toString(); assert(jsonString, '"obj": {"int": 10, "str": ""}'); // True! ``` ### Custom JSON Deserializers ```typescript import { JSONDecoder, JSONHandler } from "assemblyscript-json"; // Events need to be received by custom object extending JSONHandler. // NOTE: All methods are optional to implement. class MyJSONEventsHandler extends JSONHandler { setString(name: string, value: string): void { // Handle field } setBoolean(name: string, value: bool): void { // Handle field } setNull(name: string): void { // Handle field } setInteger(name: string, value: i64): void { // Handle field } setFloat(name: string, value: f64): void { // Handle field } pushArray(name: string): bool { // Handle array start // true means that nested object needs to be traversed, false otherwise // Note that returning false means JSONDecoder.startIndex need to be updated by handler return true; } popArray(): void { // Handle array end } pushObject(name: string): bool { // Handle object start // true means that nested object needs to be traversed, false otherwise // Note that returning false means JSONDecoder.startIndex need to be updated by handler return true; } popObject(): void { // Handle object end } } // Create decoder let decoder = new JSONDecoder<MyJSONEventsHandler>(new MyJSONEventsHandler()); // Create a byte buffer of our JSON. NOTE: Deserializers work on UTF8 string buffers. let jsonString = '{"hello": "world"}'; let jsonBuffer = Uint8Array.wrap(String.UTF8.encode(jsonString)); // Parse JSON decoder.deserialize(jsonBuffer); // This will send events to MyJSONEventsHandler ``` Feel free to look through the [tests](https://github.com/nearprotocol/assemblyscript-json/tree/master/assembly/__tests__) for more usage examples. ## Reference Documentation Reference API Documentation can be found in the [docs directory](./docs). ## License [MIT](./LICENSE) ## Setting up your terminal The scripts in this folder are designed to help you demonstrate the behavior of the contract(s) in this project. It uses the following setup: ```sh # set your terminal up to have 2 windows, A and B like this: ┌─────────────────────────────────┬─────────────────────────────────┐ │ │ │ │ │ │ │ A │ B │ │ │ │ │ │ │ └─────────────────────────────────┴─────────────────────────────────┘ ``` ### Terminal **A** *This window is used to compile, deploy and control the contract* - Environment ```sh export CONTRACT= # depends on deployment export OWNER= # any account you control # for example # export CONTRACT=dev-1615190770786-2702449 # export OWNER=sherif.testnet ``` - Commands _helper scripts_ ```sh 1.dev-deploy.sh # helper: build and deploy contracts 2.use-contract.sh # helper: call methods on ContractPromise 3.cleanup.sh # helper: delete build and deploy artifacts ``` ### Terminal **B** *This window is used to render the contract account storage* - Environment ```sh export CONTRACT= # depends on deployment # for example # export CONTRACT=dev-1615190770786-2702449 ``` - Commands ```sh # monitor contract storage using near-account-utils # https://github.com/near-examples/near-account-utils watch -d -n 1 yarn storage $CONTRACT ``` --- ## OS Support ### Linux - The `watch` command is supported natively on Linux - To learn more about any of these shell commands take a look at [explainshell.com](https://explainshell.com) ### MacOS - Consider `brew info visionmedia-watch` (or `brew install watch`) ### Windows - Consider this article: [What is the Windows analog of the Linux watch command?](https://superuser.com/questions/191063/what-is-the-windows-analog-of-the-linuo-watch-command#191068) A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. [![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) ```js var colors = require('color-name'); colors.red //[255,0,0] ``` <a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a> # Visitor utilities for AssemblyScript Compiler transformers ## Example ### List Fields The transformer: ```ts import { ClassDeclaration, FieldDeclaration, MethodDeclaration, } from "../../as"; import { ClassDecorator, registerDecorator } from "../decorator"; import { toString } from "../utils"; class ListMembers extends ClassDecorator { visitFieldDeclaration(node: FieldDeclaration): void { if (!node.name) console.log(toString(node) + "\n"); const name = toString(node.name); const _type = toString(node.type!); this.stdout.write(name + ": " + _type + "\n"); } visitMethodDeclaration(node: MethodDeclaration): void { const name = toString(node.name); if (name == "constructor") { return; } const sig = toString(node.signature); this.stdout.write(name + ": " + sig + "\n"); } visitClassDeclaration(node: ClassDeclaration): void { this.visit(node.members); } get name(): string { return "list"; } } export = registerDecorator(new ListMembers()); ``` assembly/foo.ts: ```ts @list class Foo { a: u8; b: bool; i: i32; } ``` And then compile with `--transform` flag: ``` asc assembly/foo.ts --transform ./dist/examples/list --noEmit ``` Which prints the following to the console: ``` a: u8 b: bool i: i32 ```
Houselearn_Near-justart-market
README.md lib assets badge.svg logo.svg interfaces.ts typeFormat.ts types declarations.d.ts utils config.ts market.ts next-env.d.ts next.config.js package-lock.json package.json pages styles.css postcss.config.js tailwind.config.js tsconfig.json
# Near JustArt Market DApp An Art market where people can buy and sell art items. [Demo Link](https://near-justart-market.vercel.app/) Features - Users can create new listings, where they set the upload the data on the art item. - Users can view their own listings or items they've bought in the my-items page. - There is an option for users to relist an item they've bought, and also change the price of that item. #### Please Note: Due to deployment issues, I had to move the contract files to the a new repo. [repo link](https://github.com/Houselearn/Near-justart-market-contract) # Next.js + Tailwind CSS Example This example shows how to use [Tailwind CSS](https://tailwindcss.com/) [(v2.2)](https://blog.tailwindcss.com/tailwindcss-2-2) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs). It uses the new [`Just-in-Time Mode`](https://tailwindcss.com/docs/just-in-time-mode) for Tailwind CSS. ## Preview Preview the example live on [StackBlitz](http://stackblitz.com/): [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-tailwindcss) ## Deploy your own Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example): [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss&project-name=with-tailwindcss&repository-name=with-tailwindcss) ## How to use Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: ```bash npx create-next-app --example with-tailwindcss with-tailwindcss-app # or yarn create next-app --example with-tailwindcss with-tailwindcss-app ``` Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
NEAR-Edu_near.science
.eslintrc.js README.md babel.config.js package.json postcss.config.js public index.html src main.js router index.js tailwind.config.js
# near.science ## Project setup ``` yarn install ``` ### Compiles and hot-reloads for development ``` yarn serve ``` ### Compiles and minifies for production ``` yarn build ``` ### Lints and fixes files ``` yarn lint ``` ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/).
gautamprikshit1_near-registery
.gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs target .rustc_info.json debug .fingerprint Inflector-246735fe249e5da4 lib-inflector.json ahash-0cdd75fa2a1a666c build-script-build-script-build.json ahash-1542ddc7e66e9d2a lib-ahash.json ahash-6f2d93f770ccc2e7 run-build-script-build-script-build.json arrayref-e3c1ab0608993ffe lib-arrayref.json arrayvec-7b7196459cbda176 lib-arrayvec.json arrayvec-c1fdee3f62df801b lib-arrayvec.json autocfg-5788d3b0c0ad14fb lib-autocfg.json base64-5b8949c46808a734 lib-base64.json base64-7d332dfac4b3bca8 lib-base64.json bitvec-a083ed3eaa4e996f lib-bitvec.json blake2-18532b67534bd96e lib-blake2.json block-buffer-1a60e07fed1109a2 lib-block-buffer.json block-buffer-b4c54c9d05ff654b lib-block-buffer.json borsh-0e277b2637173eed lib-borsh.json borsh-derive-ba32b9239c6cc9aa lib-borsh-derive.json borsh-derive-internal-08b8ea99ff7b6fa4 lib-borsh-derive-internal.json borsh-schema-derive-internal-a8d941446d549ae4 lib-borsh-schema-derive-internal.json bs58-412807631338ca1b lib-bs58.json byte-slice-cast-a241ff6c431a9c73 lib-byte-slice-cast.json byteorder-2ec35b1f555d9c86 lib-byteorder.json bytesize-2480cd8661bb4f72 lib-bytesize.json c2-chacha-f822913d6f7b25bb lib-c2-chacha.json cc-6b084f14911340e8 lib-cc.json cfg-if-81c3651d70dd4895 lib-cfg-if.json cfg-if-88879d2dc0fa106c lib-cfg-if.json cfg-if-d7aa02586377abc4 lib-cfg-if.json chrono-559fed35b775beff lib-chrono.json cipher-debefcfdaa3d675c lib-cipher.json convert_case-655c49d6e0dcc7cc lib-convert_case.json cpufeatures-4b33293013674e98 lib-cpufeatures.json crunchy-0f02c0924b8b55a5 lib-crunchy.json crunchy-9644416eeb01b607 build-script-build-script-build.json crunchy-aabcbffd6edd19d2 run-build-script-build-script-build.json crypto-common-53f532889ff2a826 lib-crypto-common.json crypto-mac-fbab0c05447aa22d lib-crypto-mac.json curve25519-dalek-069f14e2627f8cb8 lib-curve25519-dalek.json derive_more-2ef5932f24bce1ae lib-derive_more.json digest-532895f37b087151 lib-digest.json digest-c2807daa7edaa1de lib-digest.json easy-ext-87ff04026585d8c3 lib-easy-ext.json ed25519-83eb1ed97b36a22c lib-ed25519.json ed25519-dalek-add9c9fe6ba168a6 lib-ed25519-dalek.json fixed-hash-71a6bef7bd3d12dd lib-fixed-hash.json funty-4da8dd918c7bdfe9 lib-funty.json generic-array-2e896cac661b8174 build-script-build-script-build.json generic-array-7093b739253cbe01 lib-generic_array.json generic-array-8b51ff917b0077f2 run-build-script-build-script-build.json getrandom-10f5caf9de247d9f lib-getrandom.json getrandom-36297059db75960d build-script-build-script-build.json getrandom-5f7a972f62505a7c run-build-script-build-script-build.json getrandom-68d0f04548f69e62 lib-getrandom.json hashbrown-2e9e3fad92cc065b lib-hashbrown.json heck-9e7a19df27fc9ca0 lib-heck.json hello_near-3d7e1b2ff7342f56 test-lib-hello_near.json hello_near-b7306f57adb44b5a lib-hello_near.json hex-52738f6114d4bb1b lib-hex.json iana-time-zone-10c92362910e0629 lib-iana-time-zone.json impl-codec-26e32d33449bc0e2 lib-impl-codec.json impl-trait-for-tuples-0cccca6c5faf8c09 lib-impl-trait-for-tuples.json itoa-fd91f5642b82eb5d lib-itoa.json keccak-034dcf60a32ff2e2 lib-keccak.json libc-01262895fd546c44 run-build-script-build-script-build.json libc-a69cabf18cf11206 lib-libc.json libc-de9ae1dce6a72901 build-script-build-script-build.json memory_units-d74d4a9f28ff0cdb lib-memory_units.json near-account-id-9626691f594b2031 lib-near-account-id.json near-crypto-4e8ab8df8d132744 lib-near-crypto.json near-primitives-c658b6d63d7a97fe lib-near-primitives.json near-primitives-core-c58d2daf9ff325ec lib-near-primitives-core.json near-rpc-error-core-c724a91fb5088c52 lib-near-rpc-error-core.json near-rpc-error-macro-d1f3cb086daf7b6b lib-near-rpc-error-macro.json near-sdk-2ee92a25935770eb lib-near-sdk.json near-sdk-macros-05f6eba920c16386 lib-near-sdk-macros.json near-sys-5a1a971ef56058ec lib-near-sys.json near-vm-errors-503610d41686ef8e lib-near-vm-errors.json near-vm-logic-c347c71da3c39179 lib-near-vm-logic.json num-bigint-1c304164cfe6950d lib-num-bigint.json num-bigint-367158ec983bcdce build-script-build-script-build.json num-bigint-858858fe18bea3f0 run-build-script-build-script-build.json num-integer-6785980c957e4b59 run-build-script-build-script-build.json num-integer-a10e617db7097973 lib-num-integer.json num-integer-a7f3848711a5174d build-script-build-script-build.json num-rational-0914a9f0e3d06aa1 run-build-script-build-script-build.json num-rational-444ec278a5c00850 build-script-build-script-build.json num-rational-88f91993d2853d77 lib-num-rational.json num-traits-938ecca558738590 run-build-script-build-script-build.json num-traits-93c14c7be9f7f447 build-script-build-script-build.json num-traits-eaedcaba01aaed04 lib-num-traits.json once_cell-70e1affe12711084 lib-once_cell.json once_cell-845677a9c6715e42 lib-once_cell.json opaque-debug-16f6e42b6cf5c5fb lib-opaque-debug.json parity-scale-codec-5391d581923e7015 lib-parity-scale-codec.json parity-scale-codec-derive-ed57cb7e20ea535c lib-parity-scale-codec-derive.json parity-secp256k1-cfad118dd9298605 run-build-script-build-script-build.json parity-secp256k1-e55b3ae99b6919cc build-script-build-script-build.json parity-secp256k1-ea07c88feea23508 lib-secp256k1.json ppv-lite86-b0e8655cb1d00dab lib-ppv-lite86.json primitive-types-aba948829778d773 lib-primitive-types.json proc-macro-crate-7e1ace335dbcfc2b lib-proc-macro-crate.json proc-macro-crate-f8ac97f474bd23f1 lib-proc-macro-crate.json proc-macro2-00e264a5df0578a8 run-build-script-build-script-build.json proc-macro2-1af62450dcf11fe8 lib-proc-macro2.json proc-macro2-ea228cd548991f68 build-script-build-script-build.json quote-2302df77fd6b8693 lib-quote.json quote-6f32dcb50911c370 run-build-script-build-script-build.json quote-8d91d231e165eab2 build-script-build-script-build.json radium-2fff01203f227370 lib-radium.json radium-a09decb2f069205f build-script-build-script-build.json radium-c430a401a4eb8865 run-build-script-build-script-build.json rand-0429f3734b042aa5 lib-rand.json rand-b3934b181b1e28d3 lib-rand.json rand_chacha-12ae20f2fa021550 lib-rand_chacha.json rand_chacha-e56a07326a222aee lib-rand_chacha.json rand_core-b3da97671bc045c6 lib-rand_core.json rand_core-ee0c9d5cedcb385d lib-rand_core.json reed-solomon-erasure-351bab3a9c36a3a1 build-script-build-script-build.json reed-solomon-erasure-c650a6ba4cc25201 lib-reed-solomon-erasure.json reed-solomon-erasure-d0a3d5dbad8d946d run-build-script-build-script-build.json ripemd-274aba4d43e9aea9 lib-ripemd.json rustc-hex-c23693ed855c9f10 lib-rustc-hex.json rustversion-1d0d367001aaa471 build-script-build-script-build.json rustversion-9700b6c7e7527b6d run-build-script-build-script-build.json rustversion-b092ff0e7959aaa5 lib-rustversion.json ryu-ffbc68cf52cffe5e lib-ryu.json serde-079c49447ef440e7 build-script-build-script-build.json serde-18274dc17a20fb0d run-build-script-build-script-build.json serde-3fa05aa5be45a427 build-script-build-script-build.json serde-45b60d479f870622 lib-serde.json serde-835c896335e7d3b6 run-build-script-build-script-build.json serde-cc6d1d9bbeab7d6f lib-serde.json serde_derive-18e55da232277cea run-build-script-build-script-build.json serde_derive-2c695e5951adad78 lib-serde_derive.json serde_derive-ddb947bb0d63c263 build-script-build-script-build.json serde_json-193cdafaa318d664 lib-serde_json.json serde_json-b9a1924900dc5b89 build-script-build-script-build.json serde_json-edcde81d9dd6ec22 run-build-script-build-script-build.json sha2-729036efe6c21628 lib-sha2.json sha2-9c8e1fe4a448f914 lib-sha2.json sha3-5773af6981c89612 lib-sha3.json signature-47db5a1904718386 lib-signature.json smallvec-95884ad3df096f0f lib-smallvec.json smart-default-38f294fa58ce41d1 lib-smart-default.json static_assertions-8ed3a81d970c74d9 lib-static_assertions.json strum-6ca1004534b00fe7 lib-strum.json strum_macros-cc90b516506427af lib-strum_macros.json subtle-ee03eb150b2be5d2 lib-subtle.json syn-168d5a3d3a5d3b7a run-build-script-build-script-build.json syn-22e750745ad3cf2f build-script-build-script-build.json syn-3456db3a4374fbf9 lib-syn.json synstructure-98799c37e16395de lib-synstructure.json tap-f80be254f658780f lib-tap.json thiserror-20ec6ae62930b711 lib-thiserror.json thiserror-3287fd6b4b6a46aa run-build-script-build-script-build.json thiserror-3b7a0f0931da5897 build-script-build-script-build.json thiserror-e16e8abaf1b9214d lib-thiserror.json thiserror-impl-367d7e3f85360077 lib-thiserror-impl.json time-6512d944a6444a37 lib-time.json toml-869d3f53770db61f lib-toml.json typenum-11848c0af9314bcc run-build-script-build-script-main.json typenum-e88f9767296c4856 build-script-build-script-main.json typenum-fa5adaf555b55ba1 lib-typenum.json uint-62530ea0a30d479e lib-uint.json unicode-ident-4f26ae5bfa30ad8f lib-unicode-ident.json unicode-xid-3299144a4a74e236 lib-unicode-xid.json version_check-bf6ae18cbaff31d1 lib-version_check.json wee_alloc-122a5aea4ecee524 run-build-script-build-script-build.json wee_alloc-3501fda4c2655a8e build-script-build-script-build.json wee_alloc-7069b1a8d0edb089 lib-wee_alloc.json wyz-737daa74e42b0012 lib-wyz.json zeroize-290e0c4ae15e7911 lib-zeroize.json zeroize_derive-6d1219515c7a019e lib-zeroize_derive.json build crunchy-aabcbffd6edd19d2 out lib.rs num-bigint-858858fe18bea3f0 out radix_bases.rs parity-secp256k1-cfad118dd9298605 out flag_check.c reed-solomon-erasure-d0a3d5dbad8d946d out table.rs thiserror-3287fd6b4b6a46aa out probe.rs typenum-11848c0af9314bcc out consts.rs op.rs tests.rs wee_alloc-122a5aea4ecee524 out wee_alloc_static_array_backend_size_bytes.txt release .fingerprint Inflector-6a11d8a60176e792 lib-inflector.json ahash-3b7f7ee582eed7d1 build-script-build-script-build.json borsh-derive-45c49247fcad8919 lib-borsh-derive.json borsh-derive-internal-8515051f4921ec9e lib-borsh-derive-internal.json borsh-schema-derive-internal-2b1d8b980e5e5c27 lib-borsh-schema-derive-internal.json crunchy-bbaf8b70831ca6d7 build-script-build-script-build.json near-sdk-macros-e8923e7a414572c3 lib-near-sdk-macros.json proc-macro-crate-6b3548c17276046e lib-proc-macro-crate.json proc-macro2-303bfabee38a0b5c run-build-script-build-script-build.json proc-macro2-9266d07e65ccba26 lib-proc-macro2.json proc-macro2-ca8ed49512c3f920 build-script-build-script-build.json quote-9644046bfaa42b6d lib-quote.json quote-e842305165bb633e build-script-build-script-build.json quote-f9c1c18eb047d1d6 run-build-script-build-script-build.json serde-1fc7a8ce0c43b61b build-script-build-script-build.json serde-71af204f72d6f3ef build-script-build-script-build.json serde-80b7f2fe72604baa lib-serde.json serde-985e5916b6d9af9b run-build-script-build-script-build.json serde_derive-1c0807fa56aabaee build-script-build-script-build.json serde_derive-3470dd9393dd8e04 lib-serde_derive.json serde_derive-ab4259de4054141b run-build-script-build-script-build.json serde_json-7e4306060a5f5b0c build-script-build-script-build.json syn-4e7114a4650eee54 run-build-script-build-script-build.json syn-62687cf69e2dc60a lib-syn.json syn-907f3c567adfe8fe build-script-build-script-build.json toml-3f5e0c86326bad77 lib-toml.json unicode-ident-be2768c137042b2b lib-unicode-ident.json version_check-a1d279563b5e0a70 lib-version_check.json wee_alloc-3b0c988295c5eec9 build-script-build-script-build.json wasm32-unknown-unknown release .fingerprint ahash-3917b9cb12b53331 lib-ahash.json ahash-e95e5e57677ae54f run-build-script-build-script-build.json base64-95342496a81d483a lib-base64.json borsh-bfbaa9d9455ecb23 lib-borsh.json bs58-d2bc7bd1817d3284 lib-bs58.json byteorder-c9313783adbd53c0 lib-byteorder.json cfg-if-d118b9ca605fb693 lib-cfg-if.json crunchy-68ce64eacb137409 run-build-script-build-script-build.json crunchy-adf07b9317a8cde6 lib-crunchy.json hashbrown-8ee6862767ae2499 lib-hashbrown.json hello_near-00ca379cccdf6430 lib-hello_near.json hex-f0488fb54e1e7b8c lib-hex.json itoa-28042e22a28fbdc3 lib-itoa.json memory_units-b72db6b32697646c lib-memory_units.json near-sdk-25e88c4274316395 lib-near-sdk.json near-sys-9c44048c1dc48395 lib-near-sys.json once_cell-e5aa893d7a5382fe lib-once_cell.json ryu-7651fa6d4ad031fb lib-ryu.json serde-dd95ed6762d04924 lib-serde.json serde-e9c22eb91c3e6d9e run-build-script-build-script-build.json serde_json-581955dd607ff884 lib-serde_json.json serde_json-75cd7744ed7e0d81 run-build-script-build-script-build.json static_assertions-01bf92f097949be1 lib-static_assertions.json uint-620c8c8b561ca395 lib-uint.json wee_alloc-2a826c7b0ffc0159 run-build-script-build-script-build.json wee_alloc-6c4b816c90425c51 lib-wee_alloc.json build crunchy-68ce64eacb137409 out lib.rs wee_alloc-2a826c7b0ffc0159 out wee_alloc_static_array_backend_size_bytes.txt integration-tests Cargo.toml src tests.rs package-lock.json package.json
# Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"message":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. near-blank-project ================== This app was initialized with [create-near-app] #This is the rust version of the contract available at https://github.com/viraja1/near-registry. Quick Start =========== If you haven't installed dependencies during setup: npm install Build and deploy your contract to TestNet with a temporary dev account: npm run deploy Test your contract: npm test If you have a frontend, run `npm start`. This will run a dev server. Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages
FranklinWaller_seda-rust
.devcontainer devcontainer.json docker-compose.yml .github ISSUE_TEMPLATE.md ISSUE_TEMPLATE bug.md config.yml documentation.md feature.md PULL_REQUEST_TEMPLATE.md workflows push.yml .rustfmt.toml CLI.md CONTRIBUTING.md Cargo.toml DEVELOPING.md LICENSE.md README.md | chains Cargo.toml src another_chain.rs chain_adapter_trait.rs errors.rs lib.rs near_chain.rs cli Cargo.toml src cli commands init.rs mod.rs node bridge.rs get mod.rs node.rs nodes.rs mod.rs peers add.rs discover.rs list.rs mod.rs remove.rs register.rs unregister.rs update.rs run.rs sub_chain call.rs mod.rs view.rs mod.rs errors.rs main.rs common Cargo.toml src lib.rs node get.rs mod.rs register.rs update.rs config Cargo.toml src config.rs configs delegate.rs logger.rs macros.rs main_chain another_config.rs mod.rs near.rs mod.rs node.rs p2p.rs errors.rs lib.rs contracts .cargo config.toml Cargo.toml launch-local-near-cluster.sh src batch.rs batch_test.rs committee.rs committee_selection_test.rs consts.rs dao.rs dao_test.rs data_request.rs data_request_test.rs epoch.rs fungible_token.rs fungible_token_test.rs integration_test.rs lib.rs merkle.rs node_registry.rs node_registry_test.rs slot.rs slot_test.rs storage.rs test_utils.rs verify.rs verify_test.rs crypto Cargo.toml src errors.rs keypair.rs lib.rs master_key.rs test.rs delegate-cli Cargo.toml src cli commands mod.rs register.rs setup.rs stake.rs top_up.rs errors.rs mod.rs utils.rs main.rs example.config.toml logger Cargo.toml src lib.rs node Cargo.toml src app job_manager.rs job_manager_test.rs mod.rs p2p_message_handler.rs shutdown.rs errors.rs event_queue.rs event_queue_handler.rs event_queue_test.rs host batch_tick.rs chain_call.rs chain_view.rs db_get.rs db_set.rs http_fetch.rs mod.rs runtime_host.rs set_app_addr.rs trigger_event.rs lib.rs rpc.rs runtime_job.rs p2p Cargo.toml src errors.rs lib.rs libp2p behaviour.rs discovery_status.rs libp2p_test.rs mod.rs peer_list.rs transport.rs runtime core Cargo.toml src config.rs context.rs errors.rs host_adapter.rs imports.rs lib.rs promise mod.rs promise_queue.rs runtime.rs runtime_test.rs storage in_memory_adapter.rs in_memory_adapter_test.rs memory_adapter.rs mod.rs test_host.rs vm_result.rs macros Cargo.toml src lib.rs sdk Cargo.toml src bytes.rs chain.rs errors.rs events.rs level.rs lib.rs near.rs p2p.rs promises actions.rs mod.rs promise.rs url.rs wasm bn254.rs call.rs chain_interactor.rs database.rs env.rs execution.rs http.rs log.rs memory.rs mod.rs p2p.rs promise.rs raw.rs tooling debug Cargo.toml src main.rs rpc mod.rs start.rs stop.rs test_rpc.rs wasm cli Cargo.toml src main.rs consensus Cargo.toml src main.rs message.rs tasks batch.rs bridge.rs mod.rs p2p.rs types batch_signature.rs mod.rs test demo-cli Cargo.toml src main.rs promise-wasm-bin Cargo.toml src main.rs
<p align="center"> <a href="https://seda.xyz/"> <img width="90%" alt="seda-rust" src="https://www.seda.xyz/images/footer/footer-image.png"> </a> </p> <h1 align="center"> SEDA Rust </h1> [![Build Status][actions-badge]][actions-url] [![GitHub Stars][github-stars-badge]](https://github.com/sedaprotocol/seda-rust) [![GitHub Contributors][github-contributors-badge]](https://github.com/sedaprotocol/seda-rust/graphs/contributors) [![Discord chat][discord-badge]][discord-url] [![Twitter][twitter-badge]][twitter-url] <!-- once we publish seda: [![Crates.io][crates-badge]][crates-url] [crates-badge]: https://img.shields.io/crates/v/seda [crates-url]: https://crates.io/crates/seda --> [actions-badge]: https://github.com/sedaprotocol/seda-rust/actions/workflows/push.yml/badge.svg [actions-url]: https://github.com/sedaprotocol/seda-rust/actions/workflows/push.yml+branch%3Amain [github-stars-badge]: https://img.shields.io/github/stars/sedaprotocol/seda-rust.svg?style=flat-square&label=github%20stars [github-contributors-badge]: https://img.shields.io/github/contributors/sedaprotocol/seda-rust.svg?style=flat-square [discord-badge]: https://img.shields.io/discord/500028886025895936.svg?logo=discord&style=flat-square [discord-url]: https://discord.gg/seda [twitter-badge]: https://img.shields.io/twitter/url/https/twitter.com/SedaProtocol.svg?style=social&label=Follow%20%40SedaProtocol [twitter-url]: https://twitter.com/SedaProtocol Open source Rust implementation of the [SEDA Protocol](https://docs.seda.xyz/). **NOTE** this repo adheres to the [GPLv3 license](LICENSE.md). To learn how to build a local version, please read [developing](DEVELOPING.md). To learn how to contribute, please read [contributing](CONTRIBUTING.md). ## Dependencies There are currently no dependencies. ## Configuration The configuration for the `node` and the `CLI` commands. ### TOML File Config is written in [TOML](https://toml.io/en/) and read by default from your operating systems app config location. - Unix Systems(Mac & Linux) `/etc/seda-rust/config.toml` - Windows `C:\\ProgramData\\seda-rust\\config.toml` On the first run, a default configuration generates. You need to specify some fields via the command line interface or from environment variables. Some fields below are not required, as they have default values, or you can pass them through the [environment variables](#env) or the [CLI](CLI.md). For the sake of documentation, here the names of variables will be followed by parentheses with symbols inside: - ? - means the field is entirely optional and has a default value. - ! - means it's overwritable by an environment variable. - \* - means it's overwritable by the cli. You can look at the example configuration [here](example.config.toml). #### Fields - seda_server_address(?!) - Defines the address for seda to run its RPC server on. - seda_server_port(?!) - Defines the port for seda to run its RPC server on. - chains - All config fields related to the supported chains. - near - All config fields related to the near chain. - chain_rpc_url(!\*) - The near server URL. - node - All config fields related to the seda node. - contract_account_id(\*) - Your near contract account id. - deposit(?\*) - The deposit amount. - gas(?\*) - The gas amount. - job_manager_interval_ms(?\*) - How often the node runs jobs. - p2p_server_address(?\*) - The address to run the p2p server on. - p2p_known_peers(?\*) - The list of known peers for the node. - public_key(\*) - Your near public key. - runtime_worker_threads(?\*) - The number of threads the node can use to spin up jobs. - seda_chain_secret_key(!\*) - Your near secret key. - seda_secret_key(!\*) - Your node secret key. - seda_sk_file_path(!\*) - Your node secret key file path. - signer_account_id(\*) - Your near signer account id. - logging - All config fields related to the seda logger. - log_file_path(?!\*) - The path where the log file will write. ### ENV SEDA configuration uses the following ENV variables if they exist. **NOTE**: You can use a `.env` file to overwrite the env variables more easily.~~~ | Name | Description | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `SEDA_CONFIG_PATH` | Defines an alternative path for the seda configuration file to be. | | `SEDA_LOG_FILE_PATH` | Overwrites the config `logging.log_file_path` field. | | `SEDA_NEAR_RPC_URL` | Overwrites the config `near_chain.chain_rpc_url` field. | | `SEDA_CHAIN_SECRET_KEY` | Overwrites the config `node.seda_chain_secret_key` field. | `SEDA_SECRET_KEY` | Overwrites the config `node.seda_secret_key` field. | | `SEDA_SERVER_ADDRESS` | Overwrites the config `seda_server_address` field. | | `SEDA_SERVER_PORT` | Overwrites the config `seda_server_port` field. | | `RUST_LOG` | Controlled via the [tracing_subscriber](https://docs.rs/tracing-subscriber/0.3.16/tracing_subscriber/struct.EnvFilter.html) crate. |
il3ven_raaz
.github workflows node.js.yml rust.yml Readme.md contract Cargo.toml README.md build.bat build.sh src lib.rs test.sh package-lock.json package.json public index.html src config.js index.js index.module.css init.js
# Rust Smart Contract Template ## Getting started To get started with this template: 1. Click the "Use this template" button to create a new repo based on this template 2. Update line 2 of `Cargo.toml` with your project name 3. Update line 4 of `Cargo.toml` with your project author names 4. Set up the [prerequisites](https://github.com/near/near-sdk-rs#pre-requisites) 5. Begin writing your smart contract in `src/lib.rs` 6. Test the contract `cargo test -- --nocapture` 8. Build the contract `RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown --release` **Get more info at:** * [Rust Smart Contract Quick Start](https://docs.near.org/docs/develop/contracts/rust/intro) * [Rust SDK Book](https://www.near-sdk.io/)
klyvechen_near-ua-zoo
market-simple Cargo.toml build.sh src external.rs ft_callbacks.rs internal.rs lib.rs nft_callbacks.rs sale.rs sale_views.rs ua-zoo-be server.js uploadMiddleware.js ua-zoo-contract Cargo.toml README.md build.sh flags.sh nft Cargo.toml src lib.rs payouts.rs royalty.rs test-approval-receiver Cargo.toml src lib.rs test-token-receiver Cargo.toml src lib.rs tests sim main.rs test_approval.rs test_core.rs test_enumeration.rs utils.rs ua-zoo-fe README.md package-lock.json package.json public index.html manifest.json robots.txt src App.css App.js App.test.js Home.js ImageUploader.js Market.js UaZoo.js index.css index.js logo.svg reportWebVitals.js setupTests.js styles.css utils axiosUtil.js nftUtil.js util.js
# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in your browser. The page will reload when you make changes.\ You may also see any lint errors in the console. ### `npm test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `npm run build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ### `npm run eject` **Note: this is a one-way operation. Once you `eject`, you can't go back!** If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/). ### Code Splitting This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) ### Analyzing the Bundle Size This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) ### Making a Progressive Web App This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) ### Advanced Configuration This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) ### Deployment This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) ### `npm run build` fails to minify This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) Non-fungible Token (NFT) =================== [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/near-examples/NFT) This repository includes an example implementation of a [non-fungible token] contract which uses [near-contract-standards] and [simulation] tests. [non-fungible token]: https://nomicon.io/Standards/NonFungibleToken/README.html [near-contract-standards]: https://github.com/near/near-sdk-rs/tree/master/near-contract-standards [simulation]: https://github.com/near/near-sdk-rs/tree/master/near-sdk-sim Prerequisites ============= If you're using Gitpod, you can skip this step. * Make sure Rust is installed per the prerequisites in [`near-sdk-rs`](https://github.com/near/near-sdk-rs). * Make sure [near-cli](https://github.com/near/near-cli) is installed. Explore this contract ===================== The source for this contract is in `nft/src/lib.rs`. It provides methods to manage access to tokens, transfer tokens, check access, and get token owner. Note, some further exploration inside the rust macros is needed to see how the `NonFungibleToken` contract is implemented. Building this contract ====================== Run the following, and we'll build our rust project up via cargo. This will generate our WASM binaries into our `res/` directory. This is the smart contract we'll be deploying onto the NEAR blockchain later. ```bash ./build.sh ``` Testing this contract ===================== We have some tests that you can run. For example, the following will run our simple tests to verify that our contract code is working. ```bash cargo test -- --nocapture ``` The more complex simulation tests aren't run with this command, but we can find them in `tests/sim`. Using this contract =================== ### Quickest deploy You can build and deploy this smart contract to a development account. [Dev Accounts](https://docs.near.org/docs/concepts/account#dev-accounts) are auto-generated accounts to assist in developing and testing smart contracts. Please see the [Standard deploy](#standard-deploy) section for creating a more personalized account to deploy to. ```bash near dev-deploy --wasmFile res/non_fungible_token.wasm ``` Behind the scenes, this is creating an account and deploying a contract to it. On the console, notice a message like: >Done deploying to dev-1234567890123 In this instance, the account is `dev-1234567890123`. A file has been created containing a key pair to the account, located at `neardev/dev-account`. To make the next few steps easier, we're going to set an environment variable containing this development account id and use that when copy/pasting commands. Run this command to set the environment variable: ```bash source neardev/dev-account.env ``` You can tell if the environment variable is set correctly if your command line prints the account name after this command: ```bash echo $CONTRACT_NAME ``` The next command will initialize the contract using the `new` method: ```bash near call $CONTRACT_NAME new_default_meta '{"owner_id": "'$CONTRACT_NAME'"}' --accountId $CONTRACT_NAME ``` To view the NFT metadata: ```bash near view $CONTRACT_NAME nft_metadata ``` ### Standard deploy This smart contract will get deployed to your NEAR account. For this example, please create a new NEAR account. Because NEAR allows the ability to upgrade contracts on the same account, initialization functions must be cleared. If you'd like to run this example on a NEAR account that has had prior contracts deployed, please use the `near-cli` command `near delete`, and then recreate it in Wallet. To create (or recreate) an account, please follow the directions in [Test Wallet](https://wallet.testnet.near.org) or ([NEAR Wallet](https://wallet.near.org/) if we're using `mainnet`). In the project root, log in to your newly created account with `near-cli` by following the instructions after this command. near login To make this tutorial easier to copy/paste, we're going to set an environment variable for our account id. In the below command, replace `MY_ACCOUNT_NAME` with the account name we just logged in with, including the `.testnet` (or `.near` for `mainnet`): ID=MY_ACCOUNT_NAME We can tell if the environment variable is set correctly if our command line prints the account name after this command: echo $ID Now we can deploy the compiled contract in this example to your account: near deploy --wasmFile res/non_fungible_token.wasm --accountId $ID NFT contract should be initialized before usage. More info about the metadata at [nomicon.io](https://nomicon.io/Standards/NonFungibleToken/Metadata.html). But for now, we'll initialize with the default metadata. near call $ID new_default_meta '{"owner_id": "'$ID'"}' --accountId $ID We'll be able to view our metadata right after: near view $ID nft_metadata Then, let's mint our first token. This will create a NFT based on Olympus Mons where only one copy exists: near call $ID nft_mint '{"token_id": "0", "receiver_id": "'$ID'", "token_metadata": { "title": "Olympus Mons", "description": "Tallest mountain in charted solar system", "media": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Olympus_Mons_alt.jpg/1024px-Olympus_Mons_alt.jpg", "copies": 1}}' --accountId $ID --deposit 0.1 Transferring our NFT ==================== Let's set up an account to transfer our freshly minted token to. This account will be a sub-account of the NEAR account we logged in with originally via `near login`. near create-account alice.$ID --masterAccount $ID --initialBalance 10 Checking Alice's account for tokens: near view $ID nft_tokens_for_owner '{"account_id": "'alice.$ID'"}' Then we'll transfer over the NFT into Alice's account. Exactly 1 yoctoNEAR of deposit should be attached: near call $ID nft_transfer '{"token_id": "0", "receiver_id": "alice.'$ID'", "memo": "transfer ownership"}' --accountId $ID --depositYocto 1 Checking Alice's account again shows us that she has the Olympus Mons token. Notes ===== * The maximum balance value is limited by U128 (2**128 - 1). * JSON calls should pass U128 as a base-10 string. E.g. "100". * This does not include escrow functionality, as ft_transfer_call provides a superior approach. An escrow system can, of course, be added as a separate contract or additional functionality within this contract. AssemblyScript ============== Currently, AssemblyScript is not supported for this example. An old version can be found in the [NEP4 example](https://github.com/near-examples/NFT/releases/tag/nep4-example), but this is not recommended as it is out of date and does not follow the standards the NEAR SDK has set currently.
NEARFT_API
.eslintrc.yml .github ISSUE_TEMPLATE bug_report.md feature_request.md dependabot.yml workflows docs.yml stale.yml .gitpod.yml .travis.yml CODE_OF_CONDUCT.md CONTRIBUTING.md README.md browser-exports.js dangerfile.ts examples cookbook README.md accounts access-keys README.md create-full-access-key.js create-function-access-key.js delete-access-key.js create-mainnet-account.js create-testnet-account.js package.json transactions batch-transactions.js get-tx-detail.js get-tx-status.js utils calculate-gas.js deploy-contract.js get-state.js unwrap-near.js verify-signature.js wrap-near.js quick-reference.md | fetch_error_schema.js jest.config.js lib account.d.ts account.js account_creator.d.ts account_creator.js account_multisig.d.ts account_multisig.js browser-connect.d.ts browser-connect.js browser-index.d.ts browser-index.js common-index.d.ts common-index.js connect.d.ts connect.js connection.d.ts connection.js constants.d.ts constants.js contract.d.ts contract.js generated rpc_error_schema.json index.d.ts index.js key_stores browser-index.d.ts browser-index.js browser_local_storage_key_store.d.ts browser_local_storage_key_store.js in_memory_key_store.d.ts in_memory_key_store.js index.d.ts index.js keystore.d.ts keystore.js merge_key_store.d.ts merge_key_store.js unencrypted_file_system_keystore.d.ts unencrypted_file_system_keystore.js near.d.ts near.js providers index.d.ts index.js json-rpc-provider.d.ts json-rpc-provider.js provider.d.ts provider.js res error_messages.d.ts error_messages.json signer.d.ts signer.js transaction.d.ts transaction.js utils enums.d.ts enums.js errors.d.ts errors.js exponential-backoff.d.ts exponential-backoff.js format.d.ts format.js index.d.ts index.js key_pair.d.ts key_pair.js network.d.ts network.js rpc_errors.d.ts rpc_errors.js serialize.d.ts serialize.js setup-node-fetch.d.ts setup-node-fetch.js web.d.ts web.js validators.d.ts validators.js wallet-account.d.ts wallet-account.js package.json src .eslintrc.yml account.ts account_creator.ts account_multisig.ts browser-connect.ts browser-index.ts common-index.ts connect.ts connection.ts constants.ts contract.ts generated rpc_error_schema.json index.ts key_stores browser-index.ts browser_local_storage_key_store.ts in_memory_key_store.ts index.ts keystore.ts merge_key_store.ts unencrypted_file_system_keystore.ts near.ts providers index.ts json-rpc-provider.ts provider.ts res error_messages.json signer.ts transaction.ts utils enums.ts errors.ts exponential-backoff.ts format.ts index.ts key_pair.ts rpc_errors.ts serialize.ts setup-node-fetch.ts web.ts validators.ts wallet-account.ts test .eslintrc.yml account.access_key.test.js account.test.js account_multisig.test.js config.js contract.test.js data signed_transaction1.json transaction1.json key_pair.test.js key_stores browser_keystore.test.js in_memory_keystore.test.js keystore_common.js merge_keystore.test.js unencrypted_file_system_keystore.test.js promise.test.js providers.test.js serialize.test.js signer.test.js test-utils.js transaction.test.js utils format.test.js rpc-errors.test.js validator.test.js wallet-account.test.js tsconfig.json typedoc.json
# NEAR-API-JS Cookbook > Collection of common use cases for [`near-api-js`](https://github.com/near/near-api-js). --- ## Overview | Name | Description | | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | **ACCOUNTS** | | | [Create Account](./accounts/create-testnet-account.js) | Create [NEAR accounts](https://docs.near.org/docs/concepts/account) without using NEAR Wallet. | | [Access Key Rotation](./accounts/access-keys/README.md) | Create and delete [access keys](https://docs.near.org/docs/concepts/account#access-keys) for added security. | | **TRANSACTIONS** | | | [Get Transaction Status](./transactions/get-tx-status.js) | Gets transaction status using a tx hash and associated account/contract ID. | | [Recent Transaction Details](./transactions/get-tx-detail.js) | Get recent transaction details without using an [indexing](https://docs.near.org/docs/concepts/indexer) service. | | [Batch Transactions](./transactions/batch-transactions.js) | Sign and send multiple [transactions](https://docs.near.org/docs/concepts/transaction). | | **UTILS** | | | [Deploy Contract](./utils/deploy-contract.js) | Deploys a contract using a pre-compiled .wasm file | | [Calculate Gas](./utils/calculate-gas.js) | Calculate [gas burnt](https://docs.near.org/docs/concepts/gas) from any contract call. | | [Read State w/o Account](./utils/get-state.js) | Read state of a contract without instantiating an account. | --- ## Requirements - [NEAR Account](https://docs.near.org/docs/develop/basics/create-account) - [Node.js](https://nodejs.org/en/download/package-manager/) - [npm](https://www.npmjs.com/get-npm) or [Yarn](https://yarnpkg.com/getting-started/install) --- ## Setup 1. Navigate to the root directory ```bash cd ../.. ``` 2. Install dependencies ```bash npm install ``` 3. Navigate back to the cookbook directory ```bash cd examples/cookbook ``` 4. Run Commands Example: ```bash node utils/get-state ``` # Access Key Rotation > When rotating access keys be sure to follow these three steps in order. 1) Create new [full access key](./create-full-access-key.js) or [function access key](./create-function-access-key.js). 2) Confirm key creation 3) [Delete old access key](./delete-access-key.js) # near-api-js [![Build Status](https://travis-ci.com/near/near-api-js.svg?branch=master)](https://travis-ci.com/near/near-api-js) [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/near/near-api-js) A JavaScript/TypeScript library for development of DApps on the NEAR platform # Documentation [Read the TypeDoc API documentation](https://near.github.io/near-api-js/) --- # Examples ## [Quick Reference](https://github.com/near/near-api-js/blob/master/examples/quick-reference.md) _(Cheat sheet / quick reference)_ ## [Cookbook](https://github.com/near/near-api-js/blob/master/examples/cookbook/README.md) _(Common use cases / more complex examples)_ --- # Contribute to this library 1. Install dependencies yarn 2. Run continuous build with: yarn build -- -w # Publish Prepare `dist` version by running: yarn dist When publishing to npm use [np](https://github.com/sindresorhus/np). --- # Integration Test Start the node by following instructions from [nearcore](https://github.com/nearprotocol/nearcore), then yarn test Tests use sample contract from `near-hello` npm package, see https://github.com/nearprotocol/near-hello # Update error schema Follow next steps: 1. [Change hash for the commit with errors in the nearcore](https://github.com/near/near-api-js/blob/master/gen_error_types.js#L7-L9) 2. Fetch new schema: `node fetch_error_schema.js` 3. `yarn build` to update `lib/**.js` files # License This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE](LICENSE) and [LICENSE-APACHE](LICENSE-APACHE) for details.
gencoglutugrul_near-bootcamp-practise-1
README.md as-pect.config.js asconfig.json package.json scripts 1.dev-deploy.sh 2.use-contract.sh 3.cleanup.sh README.md src as_types.d.ts simple __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts singleton __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts tsconfig.json utils.ts
## Setting up your terminal The scripts in this folder are designed to help you demonstrate the behavior of the contract(s) in this project. It uses the following setup: ```sh # set your terminal up to have 2 windows, A and B like this: ┌─────────────────────────────────┬─────────────────────────────────┐ │ │ │ │ │ │ │ A │ B │ │ │ │ │ │ │ └─────────────────────────────────┴─────────────────────────────────┘ ``` ### Terminal **A** *This window is used to compile, deploy and control the contract* - Environment ```sh export CONTRACT= # depends on deployment export OWNER= # any account you control # for example # export CONTRACT=dev-1615190770786-2702449 # export OWNER=sherif.testnet ``` - Commands _helper scripts_ ```sh 1.dev-deploy.sh # helper: build and deploy contracts 2.use-contract.sh # helper: call methods on ContractPromise 3.cleanup.sh # helper: delete build and deploy artifacts ``` ### Terminal **B** *This window is used to render the contract account storage* - Environment ```sh export CONTRACT= # depends on deployment # for example # export CONTRACT=dev-1615190770786-2702449 ``` - Commands ```sh # monitor contract storage using near-account-utils # https://github.com/near-examples/near-account-utils watch -d -n 1 yarn storage $CONTRACT ``` --- ## OS Support ### Linux - The `watch` command is supported natively on Linux - To learn more about any of these shell commands take a look at [explainshell.com](https://explainshell.com) ### MacOS - Consider `brew info visionmedia-watch` (or `brew install watch`) ### Windows - Consider this article: [What is the Windows analog of the Linux watch command?](https://superuser.com/questions/191063/what-is-the-windows-analog-of-the-linuo-watch-command#191068) # `near-sdk-as` Starter Kit This is a good project to use as a starting point for your AssemblyScript project. ## Samples This repository includes a complete project structure for AssemblyScript contracts targeting the NEAR platform. The example here is very basic. It's a simple contract demonstrating the following concepts: - a single contract - the difference between `view` vs. `change` methods - basic contract storage There are 2 AssemblyScript contracts in this project, each in their own folder: - **simple** in the `src/simple` folder - **singleton** in the `src/singleton` folder ### Simple We say that an AssemblyScript contract is written in the "simple style" when the `index.ts` file (the contract entry point) includes a series of exported functions. In this case, all exported functions become public contract methods. ```ts // return the string 'hello world' export function helloWorld(): string {} // read the given key from account (contract) storage export function read(key: string): string {} // write the given value at the given key to account (contract) storage export function write(key: string, value: string): string {} // private helper method used by read() and write() above private storageReport(): string {} ``` ### Singleton We say that an AssemblyScript contract is written in the "singleton style" when the `index.ts` file (the contract entry point) has a single exported class (the name of the class doesn't matter) that is decorated with `@nearBindgen`. In this case, all methods on the class become public contract methods unless marked `private`. Also, all instance variables are stored as a serialized instance of the class under a special storage key named `STATE`. AssemblyScript uses JSON for storage serialization (as opposed to Rust contracts which use a custom binary serialization format called borsh). ```ts @nearBindgen export class Contract { // return the string 'hello world' helloWorld(): string {} // read the given key from account (contract) storage read(key: string): string {} // write the given value at the given key to account (contract) storage @mutateState() write(key: string, value: string): string {} // private helper method used by read() and write() above private storageReport(): string {} } ``` ## Usage ### Getting started (see below for video recordings of each of the following steps) INSTALL `NEAR CLI` first like this: `npm i -g near-cli` 1. clone this repo to a local folder 2. run `yarn` 3. run `./scripts/1.dev-deploy.sh` 3. run `./scripts/2.use-contract.sh` 4. run `./scripts/2.use-contract.sh` (yes, run it to see changes) 5. run `./scripts/3.cleanup.sh` ### Videos **`1.dev-deploy.sh`** This video shows the build and deployment of the contract. [![asciicast](https://asciinema.org/a/409575.svg)](https://asciinema.org/a/409575) **`2.use-contract.sh`** This video shows contract methods being called. You should run the script twice to see the effect it has on contract state. [![asciicast](https://asciinema.org/a/409577.svg)](https://asciinema.org/a/409577) **`3.cleanup.sh`** This video shows the cleanup script running. Make sure you add the `BENEFICIARY` environment variable. The script will remind you if you forget. ```sh export BENEFICIARY=<your-account-here> # this account receives contract account balance ``` [![asciicast](https://asciinema.org/a/409580.svg)](https://asciinema.org/a/409580) ### Other documentation - See `./scripts/README.md` for documentation about the scripts - Watch this video where Willem Wyndham walks us through refactoring a simple example of a NEAR smart contract written in AssemblyScript https://youtu.be/QP7aveSqRPo ``` There are 2 "styles" of implementing AssemblyScript NEAR contracts: - the contract interface can either be a collection of exported functions - or the contract interface can be the methods of a an exported class We call the second style "Singleton" because there is only one instance of the class which is serialized to the blockchain storage. Rust contracts written for NEAR do this by default with the contract struct. 0:00 noise (to cut) 0:10 Welcome 0:59 Create project starting with "npm init" 2:20 Customize the project for AssemblyScript development 9:25 Import the Counter example and get unit tests passing 18:30 Adapt the Counter example to a Singleton style contract 21:49 Refactoring unit tests to access the new methods 24:45 Review and summary ``` ## The file system ```sh ├── README.md # this file ├── as-pect.config.js # configuration for as-pect (AssemblyScript unit testing) ├── asconfig.json # configuration for AssemblyScript compiler (supports multiple contracts) ├── package.json # NodeJS project manifest ├── scripts │   ├── 1.dev-deploy.sh # helper: build and deploy contracts │   ├── 2.use-contract.sh # helper: call methods on ContractPromise │   ├── 3.cleanup.sh # helper: delete build and deploy artifacts │   └── README.md # documentation for helper scripts ├── src │   ├── as_types.d.ts # AssemblyScript headers for type hints │   ├── simple # Contract 1: "Simple example" │   │   ├── __tests__ │   │   │   ├── as-pect.d.ts # as-pect unit testing headers for type hints │   │   │   └── index.unit.spec.ts # unit tests for contract 1 │   │   ├── asconfig.json # configuration for AssemblyScript compiler (one per contract) │   │   └── assembly │   │   └── index.ts # contract code for contract 1 │   ├── singleton # Contract 2: "Singleton-style example" │   │   ├── __tests__ │   │   │   ├── as-pect.d.ts # as-pect unit testing headers for type hints │   │   │   └── index.unit.spec.ts # unit tests for contract 2 │   │   ├── asconfig.json # configuration for AssemblyScript compiler (one per contract) │   │   └── assembly │   │   └── index.ts # contract code for contract 2 │   ├── tsconfig.json # Typescript configuration │   └── utils.ts # common contract utility functions └── yarn.lock # project manifest version lock ``` You may clone this repo to get started OR create everything from scratch. Please note that, in order to create the AssemblyScript and tests folder structure, you may use the command `asp --init` which will create the following folders and files: ``` ./assembly/ ./assembly/tests/ ./assembly/tests/example.spec.ts ./assembly/tests/as-pect.d.ts ```
hermes1108_near-nft-smart-contract
.github dependabot.yml workflows tests.yml .gitpod.yml Cargo.toml README-Windows.md README.md integration-tests rs Cargo.toml src tests.rs ts package.json src main.ava.ts utils.ts nft Cargo.toml src lib.rs res README.md scripts build.bat build.sh flags.sh test-approval-receiver Cargo.toml src lib.rs test-token-receiver Cargo.toml src lib.rs
# Folder that contains wasm files Non-fungible Token (NFT) =================== >**Note**: If you'd like to learn how to create an NFT contract from scratch that explores every aspect of the [NEP-171](https://github.com/near/NEPs/blob/master/neps/nep-0171.md) standard including an NFT marketplace, check out the NFT [Zero to Hero Tutorial](https://docs.near.org/docs/tutorials/contracts/nfts/introduction). [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/near-examples/NFT) This repository includes an example implementation of a [non-fungible token] contract which uses [near-contract-standards] and workspaces-js and -rs tests. [non-fungible token]: https://nomicon.io/Standards/NonFungibleToken/README.html [near-contract-standards]: https://github.com/near/near-sdk-rs/tree/master/near-contract-standards [simulation]: https://github.com/near/near-sdk-rs/tree/master/near-sdk-sim Prerequisites ============= If you're using Gitpod, you can skip this step. * Make sure Rust is installed per the prerequisites in [`near-sdk-rs`](https://github.com/near/near-sdk-rs). * Make sure [near-cli](https://github.com/near/near-cli) is installed. Explore this contract ===================== The source for this contract is in `nft/src/lib.rs`. It provides methods to manage access to tokens, transfer tokens, check access, and get token owner. Note, some further exploration inside the rust macros is needed to see how the `NonFungibleToken` contract is implemented. Building this contract ====================== Run the following, and we'll build our rust project up via cargo. This will generate our WASM binaries into our `res/` directory. This is the smart contract we'll be deploying onto the NEAR blockchain later. ```bash ./scripts/build.sh ``` Testing this contract ===================== We have some tests that you can run. For example, the following will run our simple tests to verify that our contract code is working. *Unit Tests* ```bash cd nft cargo test -- --nocapture ``` *Integration Tests* *Rust* ```bash cd integration-tests/rs cargo run --example integration-tests ``` *TypeScript* ```bash cd integration-tests/ts yarn && yarn test ``` Using this contract =================== ### Quickest deploy You can build and deploy this smart contract to a development account. [Dev Accounts](https://docs.near.org/docs/concepts/account#dev-accounts) are auto-generated accounts to assist in developing and testing smart contracts. Please see the [Standard deploy](#standard-deploy) section for creating a more personalized account to deploy to. ```bash near dev-deploy --wasmFile res/non_fungible_token.wasm ``` Behind the scenes, this is creating an account and deploying a contract to it. On the console, notice a message like: >Done deploying to dev-1234567890123 In this instance, the account is `dev-1234567890123`. A file has been created containing a key pair to the account, located at `neardev/dev-account`. To make the next few steps easier, we're going to set an environment variable containing this development account id and use that when copy/pasting commands. Run this command to set the environment variable: ```bash source neardev/dev-account.env ``` You can tell if the environment variable is set correctly if your command line prints the account name after this command: ```bash echo $CONTRACT_NAME ``` The next command will initialize the contract using the `new` method: ```bash near call $CONTRACT_NAME new_default_meta '{"owner_id": "'$CONTRACT_NAME'"}' --accountId $CONTRACT_NAME ``` To view the NFT metadata: ```bash near view $CONTRACT_NAME nft_metadata ``` ### Standard deploy This smart contract will get deployed to your NEAR account. For this example, please create a new NEAR account. Because NEAR allows the ability to upgrade contracts on the same account, initialization functions must be cleared. If you'd like to run this example on a NEAR account that has had prior contracts deployed, please use the `near-cli` command `near delete`, and then recreate it in Wallet. To create (or recreate) an account, please follow the directions in [Test Wallet](https://wallet.testnet.near.org) or ([NEAR Wallet](https://wallet.near.org/) if we're using `mainnet`). In the project root, log in to your newly created account with `near-cli` by following the instructions after this command. near login To make this tutorial easier to copy/paste, we're going to set an environment variable for our account id. In the below command, replace `MY_ACCOUNT_NAME` with the account name we just logged in with, including the `.testnet` (or `.near` for `mainnet`): ID=MY_ACCOUNT_NAME We can tell if the environment variable is set correctly if our command line prints the account name after this command: echo $ID Now we can deploy the compiled contract in this example to your account: near deploy --wasmFile res/non_fungible_token.wasm --accountId $ID NFT contract should be initialized before usage. More info about the metadata at [nomicon.io](https://nomicon.io/Standards/NonFungibleToken/Metadata.html). But for now, we'll initialize with the default metadata. near call $ID new_default_meta '{"owner_id": "'$ID'"}' --accountId $ID We'll be able to view our metadata right after: near view $ID nft_metadata Then, let's mint our first token. This will create a NFT based on Olympus Mons where only one copy exists: near call $ID nft_mint '{"token_id": "0", "receiver_id": "'$ID'", "token_metadata": { "title": "Olympus Mons", "description": "Tallest mountain in charted solar system", "media": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Olympus_Mons_alt.jpg/1024px-Olympus_Mons_alt.jpg", "copies": 1}}' --accountId $ID --deposit 0.1 Transferring our NFT ==================== Let's set up an account to transfer our freshly minted token to. This account will be a sub-account of the NEAR account we logged in with originally via `near login`. near create-account alice.$ID --masterAccount $ID --initialBalance 10 Checking Alice's account for tokens: near view $ID nft_tokens_for_owner '{"account_id": "'alice.$ID'"}' Then we'll transfer over the NFT into Alice's account. Exactly 1 yoctoNEAR of deposit should be attached: near call $ID nft_transfer '{"token_id": "0", "receiver_id": "alice.'$ID'", "memo": "transfer ownership"}' --accountId $ID --depositYocto 1 Checking Alice's account again shows us that she has the Olympus Mons token. Notes ===== * The maximum balance value is limited by U128 (2**128 - 1). * JSON calls should pass U128 as a base-10 string. E.g. "100". * This does not include escrow functionality, as ft_transfer_call provides a superior approach. An escrow system can, of course, be added as a separate contract or additional functionality within this contract. AssemblyScript ============== Currently, AssemblyScript is not supported for this example. An old version can be found in the [NEP4 example](https://github.com/near-examples/NFT/releases/tag/nep4-example), but this is not recommended as it is out of date and does not follow the standards the NEAR SDK has set currently.
nguyentrungson97_donate-near-app
.gitpod.yml README.md babel.config.js contract Cargo.toml README.md compile.js src donation.rs lib.rs post.rs target .rustc_info.json debug .fingerprint Inflector-c436f7f0ac4cac71 lib-inflector.json ahash-9f755501bff2d7f3 lib-ahash.json aho-corasick-ae3090ca591dce65 lib-aho_corasick.json autocfg-9256c11c5a94315c lib-autocfg.json base64-63fa1d9b157223de lib-base64.json block-buffer-57fde2cff3b49446 lib-block-buffer.json block-buffer-e9ecae2197b6969a lib-block-buffer.json block-padding-3a7495d2f07e71d1 lib-block-padding.json borsh-4c3a68e38b4cca32 lib-borsh.json borsh-derive-4ceaabc5dd04bd8c lib-borsh-derive.json borsh-derive-internal-a4b50dd4391e6a8d lib-borsh-derive-internal.json borsh-schema-derive-internal-f225755753cda604 lib-borsh-schema-derive-internal.json bs58-1801d0e23fc90040 lib-bs58.json byte-tools-56486ed1cc5eaf5f lib-byte-tools.json byteorder-390f4de49b33fbe5 build-script-build-script-build.json byteorder-7791d47f4ddbfc75 lib-byteorder.json byteorder-d77aa010d83d8b2e run-build-script-build-script-build.json cfg-if-2079fcd564b2b5d6 lib-cfg-if.json cfg-if-7e74d31581507915 lib-cfg-if.json convert_case-6aefe2f3d987d223 lib-convert_case.json cpuid-bool-268a49a2cdc971ab lib-cpuid-bool.json derive_more-5255bfa3b62e923e lib-derive_more.json digest-53078385c4a4789d lib-digest.json digest-6981c26d6482694e lib-digest.json generic-array-2ca68d944663b98e build-script-build-script-build.json generic-array-41ceff17e6c9f303 lib-generic_array.json generic-array-75afd98fd71f772e lib-generic_array.json generic-array-edaf070b8515c940 run-build-script-build-script-build.json greeter-98ace302c5fafa12 lib-greeter.json greeter-ccd0a55903010ee6 test-lib-greeter.json hashbrown-376c4e72037f389f run-build-script-build-script-build.json hashbrown-a3aee600bf90c851 build-script-build-script-build.json hashbrown-a8671ea72407354d lib-hashbrown.json hashbrown-cc0873b95a3962ff lib-hashbrown.json hex-f285e0a400276b11 lib-hex.json indexmap-b5b2936f08563f02 run-build-script-build-script-build.json indexmap-d783966786b01c6b build-script-build-script-build.json indexmap-f66d4c008314b4ba lib-indexmap.json itoa-334a999bacc48d3a lib-itoa.json keccak-1e0e12c090d36ea1 lib-keccak.json lazy_static-13a7b4f24d55cf9a lib-lazy_static.json libc-776832e16d6fe779 run-build-script-build-script-build.json libc-ab145babf30c9e9f build-script-build-script-build.json libc-f426e886b2f0c366 lib-libc.json memchr-18021bf2e0504af3 build-script-build-script-build.json memchr-450f5acec12ed67d lib-memchr.json memchr-88cbb3a1f07aeacc run-build-script-build-script-build.json memory_units-50d579d213a1cb67 lib-memory_units.json near-primitives-core-0dd137568cb1e364 lib-near-primitives-core.json near-rpc-error-core-d66a3bd0b42b0618 lib-near-rpc-error-core.json near-rpc-error-macro-438c4d8046055ab7 lib-near-rpc-error-macro.json near-runtime-utils-9c48969c7d5572a2 lib-near-runtime-utils.json near-sdk-53e689c0c512bafc lib-near-sdk.json near-sdk-core-05f819364f7a560b lib-near-sdk-core.json near-sdk-macros-c527437a538e59b5 lib-near-sdk-macros.json near-vm-errors-c842c16fa89e6ab3 lib-near-vm-errors.json near-vm-logic-05ceab3f018439db lib-near-vm-logic.json num-bigint-24878def5e0a4e95 run-build-script-build-script-build.json num-bigint-2ecc5aa16ac5fa11 build-script-build-script-build.json num-bigint-a7d3be7dd10282ae lib-num-bigint.json num-integer-0dc92eae980549ce build-script-build-script-build.json num-integer-74855f9b7705c43f lib-num-integer.json num-integer-bfcb27fa88a06435 run-build-script-build-script-build.json num-rational-12af88293d7b8515 lib-num-rational.json num-rational-5cee69414ba13397 build-script-build-script-build.json num-rational-e41c1ae7c12fd05a run-build-script-build-script-build.json num-traits-148ddaa8ac8aed3d build-script-build-script-build.json num-traits-8e953e38a64545d6 lib-num-traits.json num-traits-e9e69ac574c21b5e run-build-script-build-script-build.json opaque-debug-0d82ef37e467c2b8 lib-opaque-debug.json opaque-debug-a65cf95eb5d006ec lib-opaque-debug.json proc-macro-crate-f8a29538f3d5d264 lib-proc-macro-crate.json proc-macro2-199e7d79ea890f98 build-script-build-script-build.json proc-macro2-666f73db07a53a8d lib-proc-macro2.json proc-macro2-bd2c37d8933f4808 run-build-script-build-script-build.json quote-9bda4ac1e186b791 lib-quote.json regex-a2c41a6cc15b3822 lib-regex.json regex-syntax-d7c11b832110c256 lib-regex-syntax.json ryu-05927dde86fed045 run-build-script-build-script-build.json ryu-71b733cfce4d5fb9 build-script-build-script-build.json ryu-9d8a66d1893ee378 lib-ryu.json serde-4e5700cebad65fe6 run-build-script-build-script-build.json serde-61b3756bc6d1e581 lib-serde.json serde-ce79dbda8006d582 build-script-build-script-build.json serde_derive-0735097b743a1fb7 build-script-build-script-build.json serde_derive-3fa5b2f0604dda9d lib-serde_derive.json serde_derive-a081d5fd2c137a9a run-build-script-build-script-build.json serde_json-5c67599c92665964 lib-serde_json.json serde_json-8d57a558bc719086 run-build-script-build-script-build.json serde_json-e672e5dc6dad8890 build-script-build-script-build.json sha2-c2f099a0789a277c lib-sha2.json sha3-2e4ba80aa2b1859b lib-sha3.json syn-5d4f461e709da010 lib-syn.json syn-a2e6dc1d550d999e run-build-script-build-script-build.json syn-c998c8ac30099f7a build-script-build-script-build.json toml-d192d9fbebd5cb61 lib-toml.json typenum-92573e41ef1e85e1 run-build-script-build-script-main.json typenum-9fdca179d12f05c5 build-script-build-script-main.json typenum-d035dff2c357cbef lib-typenum.json unicode-xid-a53958b7612b2e15 lib-unicode-xid.json version_check-45c9caec9b6617f4 lib-version_check.json wee_alloc-7be831d572df228e lib-wee_alloc.json wee_alloc-b724ac321ae537f6 build-script-build-script-build.json wee_alloc-e2cb34bd00ad2611 run-build-script-build-script-build.json build num-bigint-24878def5e0a4e95 out radix_bases.rs typenum-92573e41ef1e85e1 out consts.rs op.rs tests.rs wee_alloc-e2cb34bd00ad2611 out wee_alloc_static_array_backend_size_bytes.txt wasm32-unknown-unknown debug .fingerprint ahash-1e4f7001357845d9 lib-ahash.json aho-corasick-4e2f89079b9e00e0 lib-aho_corasick.json base64-24b7b79876c360ef lib-base64.json block-buffer-37003fcc48ccf01d lib-block-buffer.json block-buffer-a4f1735d27d7a03f lib-block-buffer.json block-padding-338643242f2dae2c lib-block-padding.json borsh-dc5eef91f25dddab lib-borsh.json bs58-c1405f3d470899a9 lib-bs58.json byte-tools-135d698576218f7f lib-byte-tools.json byteorder-08f29ea8d461900c run-build-script-build-script-build.json byteorder-dd42706ea898e564 lib-byteorder.json cfg-if-8cd778ce3477266f lib-cfg-if.json cfg-if-f786cbb548399339 lib-cfg-if.json digest-19541f9b7e0c7774 lib-digest.json digest-735ab6181239f6d2 lib-digest.json generic-array-25c6d4dda83f7be7 run-build-script-build-script-build.json generic-array-d996d3171b5da4ba lib-generic_array.json generic-array-fa1caae96ee63780 lib-generic_array.json greeter-98ace302c5fafa12 lib-greeter.json hashbrown-b3cfd744f48b3b6e lib-hashbrown.json hashbrown-e4a4c2f7e2717426 lib-hashbrown.json hashbrown-f3541e9aee499733 run-build-script-build-script-build.json hex-c604b67ad129b15c lib-hex.json indexmap-003f41db7a36cd3b run-build-script-build-script-build.json indexmap-b8bfbab8f475b75f lib-indexmap.json itoa-e60cf4857d9d2913 lib-itoa.json keccak-d4c6e65621b821f6 lib-keccak.json lazy_static-15a36e6855247c67 lib-lazy_static.json memchr-29e30936df02ad7c run-build-script-build-script-build.json memchr-d3aaac5f8308eb58 lib-memchr.json memory_units-90906d142a260054 lib-memory_units.json near-primitives-core-8eab4af63289cca4 lib-near-primitives-core.json near-runtime-utils-305f43dd617f4a70 lib-near-runtime-utils.json near-sdk-f66bacd755fc9d77 lib-near-sdk.json near-vm-errors-e5fbb2c274b4a5ef lib-near-vm-errors.json near-vm-logic-26e22134f5e27306 lib-near-vm-logic.json num-bigint-5fedcba82e247578 lib-num-bigint.json num-bigint-692978290ad6ac51 run-build-script-build-script-build.json num-integer-6bdbe1733947e393 run-build-script-build-script-build.json num-integer-72c4894d57403887 lib-num-integer.json num-rational-c333a4fa265eb85d run-build-script-build-script-build.json num-rational-f4f592a6b0c04ec3 lib-num-rational.json num-traits-28f28195512e15b0 lib-num-traits.json num-traits-838e9f4f81aae4f8 run-build-script-build-script-build.json opaque-debug-19d0f9d6d6732dda lib-opaque-debug.json opaque-debug-d4218c184d36d52a lib-opaque-debug.json regex-348a33fe5c87c03d lib-regex.json regex-syntax-cd626ce4deb5f357 lib-regex-syntax.json ryu-1c89b4c0977fa398 lib-ryu.json ryu-618a27724935a027 run-build-script-build-script-build.json serde-c480407a95773cc0 lib-serde.json serde-f83c67a06a5b12c5 run-build-script-build-script-build.json serde_json-2effd68d351abc28 lib-serde_json.json serde_json-6c28b4927146d49d run-build-script-build-script-build.json sha2-0f67ed3ef159a91a lib-sha2.json sha3-2517d071adfa8028 lib-sha3.json typenum-765fe82de63af7f0 run-build-script-build-script-main.json typenum-b3f9023e815d815e lib-typenum.json wee_alloc-70e83ed96f4a461b lib-wee_alloc.json wee_alloc-96614ccff1c83e60 run-build-script-build-script-build.json build num-bigint-692978290ad6ac51 out radix_bases.rs typenum-765fe82de63af7f0 out consts.rs op.rs tests.rs wee_alloc-96614ccff1c83e60 out wee_alloc_static_array_backend_size_bytes.txt package.json src App.js __mocks__ fileMock.js assets logo-black.svg logo-white.svg config.js global.css index.html index.js jest.init.js main.test.js utils.js wallet login index.html
news-near-app ================== This [React] app was initialized with [create-near-app] Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install dependencies: `yarn install` 3. Run the local development server: `yarn dev` (see `package.json` for a full list of `scripts` you can run with `yarn`) Now you'll have a local development environment backed by the NEAR TestNet! Go ahead and play with the app and the code. As you make code changes, the app will automatically reload. Exploring The Code ================== 1. The "backend" code lives in the `/contract` folder. See the README there for more info. 2. The frontend code lives in the `/src` folder. `/src/index.html` is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and the smart contract. See `contract/README` for info about how it's tested. The frontend code gets tested with [jest]. You can run both of these at once with `yarn run test`. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally: yarn install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `news-near-app.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `news-near-app.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account news-near-app.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'news-near-app.YOUR-NAME.testnet' Step 3: deploy! --------------- One command: yarn deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contract to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [React]: https://reactjs.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages news-near-app Smart Contract ================== A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard Rust tests using [cargo] with a `--nocapture` flag so that you can see any debug info you print to the console. [smart contract]: https://docs.near.org/docs/develop/contracts/overview [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://github.com/near/near-sdk-rs#pre-requisites [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html
esaminu_test-rs-boilerplate-1063
.eslintrc.yml .github ISSUE_TEMPLATE 01_BUG_REPORT.md 02_FEATURE_REQUEST.md 03_CODEBASE_IMPROVEMENT.md 04_SUPPORT_QUESTION.md config.yml PULL_REQUEST_TEMPLATE.md labels.yml workflows codeql.yml deploy-to-console.yml labels.yml lock.yml pr-labels.yml stale.yml .gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs docs CODE_OF_CONDUCT.md CONTRIBUTING.md SECURITY.md frontend App.js assets global.css logo-black.svg logo-white.svg index.html index.js near-interface.js near-wallet.js package.json start.sh ui-components.js integration-tests Cargo.toml src tests.rs package.json
# Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"message":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. <h1 align="center"> <a href="https://github.com/near/boilerplate-template-rs"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_light.png"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> <img alt="" src="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> </picture> </a> </h1> <div align="center"> Rust Boilerplate Template <br /> <br /> <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=bug&template=01_BUG_REPORT.md&title=bug%3A+">Report a Bug</a> · <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=enhancement&template=02_FEATURE_REQUEST.md&title=feat%3A+">Request a Feature</a> . <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+">Ask a Question</a> </div> <div align="center"> <br /> [![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) [![code with love by near](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-near-ff1414.svg?style=flat-square)](https://github.com/near) </div> <details open="open"> <summary>Table of Contents</summary> - [About](#about) - [Built With](#built-with) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Installation](#installation) - [Usage](#usage) - [Roadmap](#roadmap) - [Support](#support) - [Project assistance](#project-assistance) - [Contributing](#contributing) - [Authors & contributors](#authors--contributors) - [Security](#security) </details> --- ## About This project is created for easy-to-start as a React + Rust skeleton template in the Pagoda Gallery. It was initialized with [create-near-app]. Clone it and start to build your own gallery project! ### Built With [create-near-app], [amazing-github-template](https://github.com/dec0dOS/amazing-github-template) Getting Started ================== ### Prerequisites Make sure you have a [current version of Node.js](https://nodejs.org/en/about/releases/) installed – we are targeting versions `16+`. Read about other [prerequisites](https://docs.near.org/develop/prerequisites) in our docs. ### Installation Install all dependencies: npm install Build your contract: npm run build Deploy your contract to TestNet with a temporary dev account: npm run deploy Usage ===== Test your contract: npm test Start your frontend: npm start Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages ## Roadmap See the [open issues](https://github.com/near/boilerplate-template-rs/issues) for a list of proposed features (and known issues). - [Top Feature Requests](https://github.com/near/boilerplate-template-rs/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Top Bugs](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Newest Bugs](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aopen+is%3Aissue+label%3Abug) ## Support Reach out to the maintainer: - [GitHub issues](https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+) ## Project assistance If you want to say **thank you** or/and support active development of Rust Boilerplate Template: - Add a [GitHub Star](https://github.com/near/boilerplate-template-rs) to the project. - Tweet about the Rust Boilerplate Template. - Write interesting articles about the project on [Dev.to](https://dev.to/), [Medium](https://medium.com/) or your personal blog. Together, we can make Rust Boilerplate Template **better**! ## Contributing First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**. Please read [our contribution guidelines](docs/CONTRIBUTING.md), and thank you for being involved! ## Authors & contributors The original setup of this repository is by [Dmitriy Sheleg](https://github.com/shelegdmitriy). For a full list of all authors and contributors, see [the contributors page](https://github.com/near/boilerplate-template-rs/contributors). ## Security Rust Boilerplate Template follows good practices of security, but 100% security cannot be assured. Rust Boilerplate Template is provided **"as is"** without any **warranty**. Use at your own risk. _For more information and to report security issues, please refer to our [security documentation](docs/SECURITY.md)._
Houselearn_near101
README.md contract README.md asconfig.json assembly as_types.d.ts index.ts model.ts tsconfig.json package.json lib assets badge.svg logo.svg interfaces.ts typeFormat.ts types declarations.d.ts utils config.ts market.ts netlify.toml next-env.d.ts next.config.js package-lock.json package.json pages styles.css postcss.config.js tailwind.config.js tsconfig.json
# NFT Market UI ### Development Clone the repo and install dependencies. ``` yarn ``` Run local development server ``` yarn dev ``` # Prerequsities Install the next tools: * `node` * `yarn` * `near-cli` Also, you'd need a code editor of choice. In this course we are going to use Visual Studio Code. ## Create project structure The next directories and files must be created to proceed with smart contracts: * assembly/ - this directory contains smart contracts source code * asconfig.json - contains most of configuration properties * assembly/tsconfig.json ### `assembly/asconfig.json` By default it's needed to add the next content to the file. By adding this, we just extend the configuration provided by `near-sdk-as`. ``` { "extends": "near-sdk-as/asconfig.json" } ``` ### `assembly/tsconfig.json` The purpose of this file is to specify compiler options and root level files that are necessary for a TypeScript project to be compiled. Also, this file implies that the directory where `tsconfig.json` is located is the root of the TypeScript project. ``` { "extends": "../node_modules/assemblyscript/std/assembly.json", "include": [ "./**/*.ts" ] } ``` ### `as_types.d.ts` This files declares that some type names must be included in the compilation. In this case, names are imported from `near-sdk-as` ``` /// <reference types="near-sdk-as/assembly/as_types" /> ``` ## Initialize project Run the next commands in a terminal window (in the project's root): ``` yarn init ``` It will create a `package.json` file where development dependencies can be added. Run the next command to add `near-sdk-as` to the project: ``` yarn add -D near-sdk-as ``` The next step is to create an entry file for the smart contract - create `index.ts` file in the `assembly` directory. The resulting project structure should be like this: ``` ├── asconfig.json ├── assembly │   ├── as_types.d.ts │   ├── index.ts │   └── tsconfig.json ├── package.json └── yarn.lock ``` # Compile, build and deployt the smart contract ## Compile & build a smart contract Before a smart contract can be deployed, it must be built as `.wasm`. To do that, the next command should be run from the project's root: ``` yarn asb ``` The output of this command is a `.wasm` file that is placed into `${PROJECT_ROOT}/build/release` directory. ## Login to an account in a shell In order to deploy a contract from via terminal, account's credentials are needed. To get the credentials, run the next command in a terminal window: ``` near login ``` It opens a wallet url in a browser where you can login to your account (or selected one of the existing accounts if you have one). As the result the session in the terminal window is authenticated and you can start deploying contracts and view/call functions. ## Deploy a smart contract To deploy a smart contract, run the next command from in a terminal window: ``` near deploy ${PATH_TO_WASM} --accountId=${ACCOUNT_NAME} ``` where: * `${ACCOUNT_NAME}` - an account name that should be used to deploy a smart contract * `${CONTRACT_NAME}` - an account name that should be used for the contract (we will use the same value as for `${ACCOUNT_NAME}`) * `${PATH_TO_WASM}` - a path to the `.wasm` file issued by the `yarn asb` command - `${PROJECT_ROOT}/build/release/some_name.wasm` ## Contract interaction There are two types of functions in `near`: * `view` functions are used to read state hence they are free. Nothing is modified/persisted when a `view` function is called. * `call` functions are used to modify state of the data stored in the blockchain.
esaminu_console-donation-template-2523
.github scripts runfe.sh workflows deploy-to-console.yml readme.yml tests.yml .gitpod.yml README.md contract README.md build.sh deploy.sh package-lock.json package.json src contract.ts model.ts utils.ts tsconfig.json integration-tests package-lock.json package.json src main.ava.ts package-lock.json package.json
# Donation 💸 [![](https://img.shields.io/badge/⋈%20Examples-Basics-green)](https://docs.near.org/tutorials/welcome) [![](https://img.shields.io/badge/Gitpod-Ready-orange)](https://gitpod.io/#/https://github.com/near-examples/donation-js) [![](https://img.shields.io/badge/Contract-js-yellow)](https://docs.near.org/develop/contracts/anatomy) [![](https://img.shields.io/badge/Frontend-JS-yellow)](https://docs.near.org/develop/integrate/frontend) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fnear-examples%2Fdonation-js%2Fbadge&style=flat&label=Tests)](https://actions-badge.atrox.dev/near-examples/donation-js/goto) Our Donation example enables to forward money to an account while keeping track of it. It is one of the simplest examples on making a contract receive and send money. ![](https://docs.near.org/assets/images/donation-7cf65e5e131274fd1ae9aa34bc465bb8.png) # What This Example Shows 1. How to receive and transfer $NEAR on a contract. 2. How to divide a project into multiple modules. 3. How to handle the storage costs. 4. How to handle transaction results. 5. How to use a `Map`. <br /> # Quickstart Clone this repository locally or [**open it in gitpod**](https://gitpod.io/#/github.com/near-examples/donation-js). Then follow these steps: ### 1. Install Dependencies ```bash npm install ``` ### 2. Test the Contract Deploy your contract in a sandbox and simulate interactions from users. ```bash npm test ``` ### 3. Deploy the Contract Build the contract and deploy it in a testnet account ```bash npm run deploy ``` --- # Learn More 1. Learn more about the contract through its [README](./contract/README.md). 2. Check [**our documentation**](https://docs.near.org/develop/welcome). # Donation Contract The smart contract exposes methods to handle donating $NEAR to a `beneficiary`. ```ts @call donate() { // Get who is calling the method and how much $NEAR they attached let donor = near.predecessorAccountId(); let donationAmount: bigint = near.attachedDeposit() as bigint; let donatedSoFar = this.donations.get(donor) === null? BigInt(0) : BigInt(this.donations.get(donor) as string) let toTransfer = donationAmount; // This is the user's first donation, lets register it, which increases storage if(donatedSoFar == BigInt(0)) { assert(donationAmount > STORAGE_COST, `Attach at least ${STORAGE_COST} yoctoNEAR`); // Subtract the storage cost to the amount to transfer toTransfer -= STORAGE_COST } // Persist in storage the amount donated so far donatedSoFar += donationAmount this.donations.set(donor, donatedSoFar.toString()) // Send the money to the beneficiary const promise = near.promiseBatchCreate(this.beneficiary) near.promiseBatchActionTransfer(promise, toTransfer) // Return the total amount donated so far return donatedSoFar.toString() } ``` <br /> # Quickstart 1. Make sure you have installed [node.js](https://nodejs.org/en/download/package-manager/) >= 16. 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash npm run deploy ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` The contract will be automatically initialized with a default `beneficiary`. To initialize the contract yourself do: ```bash # Use near-cli to initialize contract (optional) near call <dev-account> init '{"beneficiary":"<account>"}' --accountId <dev-account> ``` <br /> ## 2. Get Beneficiary `beneficiary` is a read-only method (`view` method) that returns the beneficiary of the donations. `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash near view <dev-account> beneficiary ``` <br /> ## 3. Get Number of Donations `donate` forwards any attached money to the `beneficiary` while keeping track of it. `donate` is a payable method for which can only be invoked using a NEAR account. The account needs to attach money and pay GAS for the transaction. ```bash # Use near-cli to donate 1 NEAR near call <dev-account> donate --amount 1 --accountId <account> ``` **Tip:** If you would like to `donate` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`.
hack-a-chain-software_near-rust-contract-standard
readme.md sample_contract Cargo.toml readme.md src actions callback_actions.rs guardian_actions.rs mod.rs owner_actions.rs user_actions.rs complex_personalized_struct internal_data_structure.rs mod.rs errors.rs events.rs ext_interface.rs internal_structs.md lib.rs personalized_struct.rs readme.md utils.rs unit_testing_guidelines.md
frol_near-birthday-quest-v2
Cargo.toml README.md src lib.rs
# Happy Birthday Quest! In order to crack this quest you will need to have at least one FT token (`lolcoin.qbit.near`), at least one NFT token (https://paras.id), and a secret code. Learn your way through how to transfer tokens to `birthday-quest.near` with [FT](https://nomicon.io/Standards/Tokens/FungibleToken/Core) and [NFT](https://nomicon.io/Standards/Tokens/NonFungibleToken/Core) standards (`ft_transfer_call` and `nft_transfer_call`). [NEAR CLI RS](https://near.cli.rs) is all you need to hack the quest.
Mjndai7_Toledo
Cargo.toml README.md build.sh deploy.sh dev-deploy.sh init-args.js rustfmt.toml src contract.rs lib.rs utils.rs
# NEAR Smart Contract Rust Template Project structure for writing smart contracts in Rust for NEAR Protocol # Required Software - Rust 1.58 + cargo - Node.js - NEAR CLI 3.1 # Authors - Jacob Lindahl <jacob@near.foundation> [@sudo_build](https://twitter.com/sudo_build)
near_pagoda-relayer-rs
.github workflows docker-image.yml rust.yml Cargo.toml README.md account_keys nomnomnom.testnet.json config.toml docker-compose.yml examples README.md configs basic_whitelist.toml exchange_withdraw.toml fastauth.toml no_filters.toml pay_with_ft.toml redis.toml shared_storage.toml whitelist_senders.toml multikey_setup.sh Access key info src error.rs main.rs redis_fns.rs rpc_conf.rs schemas.rs shared_storage.rs UNIT TESTS
# Pagoda Relayer ## What is a Relayer? At a high level, the Relayer is a http server that relays transactions to the NEAR network via RPC on behalf of new users who haven't yet acquired NEAR as part of the onboarding process. The entity running the relayer covers the gas costs for the end users who are signing the transactions. ## How does a Relayer work? This functionality depends on [NEP-366: Meta Transactions](https://github.com/near/NEPs/pull/366). Technically, the end user (client) creates a `SignedDelegateAction` that contains the data necessary to construct a `Transaction`, signs the `SignedDelegateAction` using their key, which is then serialized and sent to the relayer (server) as payload of a POST request. When the request is received, the relayer uses its own key to sign a `Transaction` using the fields in the `SignedDelegateAction` as input to create a `SignedTransaction`. The `SignedTransaction` is then sent to the network via RPC call and the result is then sent back to the client. ## Why use a Relayer? 1. Your users are new to NEAR and don't have any gas to cover transactions 2. Your users have an account on NEAR, but only have a Fungible Token Balance. They can now use the FT to pay for gas 3. As an enterprise or a large startup you want to seamlessly onboard your existing users onto NEAR without needing them to worry about gas costs and seed phrases 4. As an enterprise or large startup you have a userbase that can generate large spikes of user activity that would congest the network. In this case, the relayer acts as a queue for low urgency transactions 5. In exchange for covering the gas fee costs, relayer operators can limit where users spend their assets while allowing users to have custody and ownership of their assets 6. Capital Efficiency: Without relayer if your business has 1M users they would have to be allocated 0.25 NEAR to cover their gas costs totalling 250k NEAR. However, only ~10% of the users would actually use the full allowance and a large amount of the 250k NEAR is just sitting there unused. So using the relayer, you can allocate 50k NEAR as a global pool of capital for your users, which can refilled on an as needed basis. ## Features These features can be mixed and matched "à la carte". Use of one feature does not preclude the use of any other feature unless specified. See the `/examples` directory for example configs corresponding to different use cases. NOTE: If integrating with fastauth make sure to enable feature flags: `cargo build --features fastauth_features,shared_storage`. If using shared storage, make sure to enable feature flags: `cargo build --features shared_storage` 1. Sign and send Meta Transactions to the RPC to cover the gas costs of end users while allowing them to maintain custody of their funds and approve transactions (`/relay`, `/send_meta_tx`, `/send_meta_tx_async`, `/send_meta_tx_nopoll`) 2. Sign Meta Transactions returning a Signed Meta Transaction to be sent to the RPC later - (`/sign_meta_tx`, `/sign_meta_tx_no_filter`) 3. Only pay for users interacting with certain contracts by whitelisting contracts addresses (`whitelisted_contracts` in `config.toml`) 4. Specify gas cost allowances for all accounts (`/update_all_allowances`) or on a per-user account basis (`/create_account_atomic`, `/register_account`, `/update_allowance`) and keep track of allowances (`/get_allowance`) 5. Specify the accounts for which the relayer will cover gas fees (`whitelisted_delegate_action_receiver_ids` in `config.toml`) 6. Only allow users to register if they have a unique Oauth Token (`/create_account_atomic`, `/register_account`) 7. Relayer Key Rotation: `keys_filenames` in `config.toml` 8. Integrate with [Fastauth SDK](https://docs.near.org/tools/fastauth-sdk). See `/examples/configs/fastauth.toml` 9. Mix and Match config options - see `examples/configs` ### Features - COMING SOON 1. Allow users to pay for gas fees using Fungible Tokens they hold. This can be implemented by either: 1. Swapping the FT for NEAR using a DEX like [Ref finance](https://app.ref.finance/) OR 2. Sending the FT to a burn address that is verified by the relayer and the relayer covers the equivalent amount of gas in NEAR 2. Cover storage deposit costs by deploying a storage contract 3. automated relayer funds "top up" service 4. Put transactions in a queue to minimize network congestion - expected early-mid 2024 5. Multichain relayers - expected early-mid 2024 ## API Spec <a id="api_spc"></a> For more details on the following endpoint and to try them out, please [setup your local dev env](#basic_setup). After you have started the server with `cargo run`, open http://0.0.0.0:3030/swagger-ui/#/ in your browser to view the swagger docs and test out the endpoints with the example payloads. Alternatively, you can open http://0.0.0.0:3030/rapidoc#overview for the rapidocs. Both swagger and rapidoc are based on the openapi standard and generated using the [utoipa crate](https://crates.io/crates/utoipa). These are helpful starter api docs and payloads, but not all example payloads will work on the endpoints in swagger-ui or rapidoc. #### Known issues 1. the SignedDelegateAction is not supported by the openapi schema. Replace ```json "signed_delegate_action": "string" ``` with ```json "signed_delegate_action": { "delegate_action": { "actions": [{ "Transfer": { "deposit": "1" } }], "max_block_height": 122790412, "nonce": 103066617000686, "public_key": "ed25519:89GtfFzez3opomVpwa7i4m3nptHtc7Ha514XHMWszQtL", "receiver_id": "relayer.pagodaplatform.near", "sender_id": "relayer.pagodaplatform.near" }, "signature": "ed25519:5uJu7KapH89h9cQm5btE1DKnbiFXSZNT7McDw5LHy8pdAt5Mz9DfuyQZadGgFExo88or9152iwcw2q12rnFWa6bg" } ``` 2. The `/relay` endpoint is [borsh](https://github.com/near/borsh) serialized representation of SignedDelegateAction (as opposed to json) and thus does not work with swagger or rapidoc. Please use a borsh serialized SignedDelegateAction that will look like: ```json { "borsh_signed_delegate_action": [64, 0, 0, 0, 49, 48, 97, 102, 100, 99, 98, 101, 99, 99, 55, 100, 54, 55, 57, 57, 102, 102, 52, 48, 48, 49, 98, 56, 56, 100, 53, 56, 97, 57, 56, 50, 51, 55, 98, 98, 49, 100, 55, 100, 54, 100, 48, 99, 98, 99, 54, 102, 57, 100, 99, 102, 100, 57, 49, 51, 56, 97, 57, 50, 57, 53, 55, 56, 11, 0, 0, 0, 116, 111, 107, 101, 110, 46, 115, 119, 101, 97, 116, 2, 0, 0, 0, 2, 11, 0, 0, 0, 102, 116, 95, 116, 114, 97, 110, 115, 102, 101, 114, 139, 0, 0, 0, 123, 34, 114, 101, 99, 101, 105, 118, 101, 114, 95, 105, 100, 34, 58, 34, 101, 100, 100, 51, 97, 49, 55, 97, 99, 50, 51, 55, 102, 102, 98, 51, 50, 54, 54, 98, 48, 98, 101, 55, 48, 98, 100, 101, 97, 49, 48, 52, 53, 51, 50, 97, 101, 48, 98, 50, 101, 100, 102, 49, 48, 100, 57, 99, 50, 97, 53, 97, 48, 49, 53, 101, 52, 56, 99, 97, 52, 54, 52, 57, 34, 44, 34, 97, 109, 111, 117, 110, 116, 34, 58, 34, 49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 34, 44, 34, 109, 101, 109, 111, 34, 58, 34, 115, 119, 58, 116, 58, 57, 107, 118, 74, 69, 86, 119, 71, 107, 101, 34, 125, 0, 224, 6, 161, 187, 12, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 11, 0, 0, 0, 102, 116, 95, 116, 114, 97, 110, 115, 102, 101, 114, 88, 0, 0, 0, 123, 34, 114, 101, 99, 101, 105, 118, 101, 114, 95, 105, 100, 34, 58, 34, 102, 101, 101, 115, 46, 115, 119, 101], "signature": "ed25519:3oBH35ETxwj2MJJmiQtB4WLps7CNBvhZ33y2zuamPjgbWVLBgUr47sLGVBmuoiA5nXtra9CJMEiHQNWZB8saGnFW" } ``` 3. The `/get_allowance` endpoint doesn't work in swagger, but works fine in Postman ¯\_(ツ)_/¯ For more extensive testing, especially when you've deployed the relayer to multiple environments, it is recommended that you use Postman or some other api testing service. - POST `/relay` - POST `/send_meta_tx` - POST `/send_meta_tx_async` - POST `/send_meta_tx_nopoll` - POST `/sign_meta_tx` - POST `/sign_meta_tx_no_filter` - GET `/get_allowance` - POST `/update_allowance` - POST `/update_all_allowances` - POST `/create_account_atomic` - POST `/register_account` ## Basic Setup - Local Dev <a id="basic_setup"></a> 1. [Install Rust for NEAR Development](https://docs.near.org/sdk/rust/get-started) 2. If you don't have a NEAR account, [create one](https://docs.near.org/concepts/basics/accounts/creating-accounts) 3. With the account from step 2, create a json file in this directory in the format `[{"account_id":"example.testnet","public_key":"ed25519:98GtfFzez3opomVpwa7i4m3nptHtc7Ha514XHMWszLtQ","private_key":"ed25519:YWuyKVQHE3rJQYRC3pRGV56o1qEtA1PnMYPDEtroc5kX4A4mWrJwF7XkzGe7JWNMABbtY4XFDBJEzgLyfPkwpzC"}]` using a [Full Access Key](https://docs.near.org/concepts/basics/accounts/access-keys#key-types) from an account that has enough NEAR to cover the gas costs of transactions your server will be relaying. Usually, this will be a copy of the json file found in the `.near-credentials` directory. 4. Update values in `config.toml` 5. Open up the `port` from `config.toml` in your machine's network settings 6. Run the server using `cargo run`. 7. Send a Meta Transaction! - Get the most latest `block_height` and `nonce` for the public key on the account creating the `signed_delegate_action` by calling: POST https://rpc.testnet.near.org/ ``` { "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "view_access_key", "finality": "final", "account_id": "your_account.testnet", "public_key": "ed25519:7PjxWgJ7bWu9KAcunaUjvcd6Ct6ugaGaWLGQ7aSG4buS" } } ``` which returns: ``` { "jsonrpc": "2.0", "result": { "block_hash": "7cwPTgH7WgctP1dGKu3kNpa7CHGww9BLTvLvDumHEfPD", "block_height": 161633049, "nonce": 157762570000389, "permission": "FullAccess" }, "id": "dontcare" } ``` - Use the `block_height` + 100 (or some other reasonable buffer) and `nonce` + 1 to create `delegate_action` ``` { "delegate_action": { "actions": [ { "Transfer": { "deposit": "1" } } ], "max_block_height": 161633149, "nonce": 157762570000390, "public_key": "ed25519:89GtfFzez3opomVpwa7i4m3nptHtc7Ha514XHMWszQtL", "receiver_id": "reciever_account.testnet", "sender_id": "your_account.testnet" } } ``` - sign the `delegate_action`. Ensure the signature is base64 encoded. An example to do this using Rust [near_primitives](https://crates.io/crates/near-primitives) and [near_crypto](https://crates.io/crates/near-crypto) would look like (you need to adjust for your setup using the json created): ``` let signer: InMemorySigner = InMemorySigner::from_file(/* &std::path::Path -- YOUR FILE HERE, should include public key to sign with */); let signed_meta_tx = Transaction { nonce, block_hash, signer_id, public_key, receiver_id, actions, } .sign(&signer); ``` - add the newly created signature to create the `signed_delegate_action` and send it to the relayer running locally by calling: POST http://localhost:3030/send_meta_tx ``` { "delegate_action": { "actions": [ { "Transfer": { "deposit": "1" } } ], "max_block_height": 161633149, "nonce": 157762570000390, "public_key": "ed25519:89GtfFzez3opomVpwa7i4m3nptHtc7Ha514XHMWszQtL", "receiver_id": "reciever_account.testnet", "sender_id": "your_account.testnet" }, "signature": "ed25519:5uJu7KapH89h9cQm5btE1DKnbiFXSZNT7McDw5LHy8pdAt5Mz9DfuyQZadGgFExo88or9152iwcw2q12rnFWa6bg" } ``` 8. (OPTIONAL) To run with logs (tracing) enabled run `RUST_LOG=tower_http=debug cargo run` 9. (OPTIONAL) If integrating with fastauth make sure to enable feature flags: `cargo build --features fastauth_features,shared_storage`. If using shared storage, make sure to enable feature flags: `cargo build --features shared_storage` ## Redis Setup - OPTIONAL NOTE: this is only needed if you intend to use whitelisting, allowances, and oauth functionality 1. [Install redis](https://redis.io/docs/getting-started/installation/). Steps 2 & 3 assume redis installed on machine instead of docker setup. If you're connecting to a redis instance running in gcp, follow the above steps to connect to a vm that will forward requests from your local relayer server to redis running in gcp: https://cloud.google.com/memorystore/docs/redis/connect-redis-instance#connecting_from_a_local_machine_with_port_forwarding 2. Run `redis-server --bind 127.0.0.1 --port 6379` - make sure the port matches the `redis_url` in the `config.toml`. 3. Run `redis-cli -h 127.0.0.1 -p 6379` ## Multiple Key Generation - OPTIONAL, but recommended for high throughput to prevent nonce race conditions Option A using the [near-cli-rs](https://github.com/near/near-cli-rs): 1. [Install near-cli-rs](https://github.com/near/near-cli-rs/releases/) 2. Make sure you're using the appropriate network: `echo $NEAR_ENV`. To change it, `export NEAR_ENV=testnet` 3. run `chmod 755 multikey_setup.sh` 4. run `./multikey_setup.sh` Option B using the [near-cli](https://github.com/near/near-cli): 1. [Install NEAR CLI](https://docs.near.org/tools/near-cli#installation) 1. NOTE this guide was created using near-cli version 4.0.5. 2. Make sure you're using the appropriate network: `echo $NEAR_ENV`. To change it, `export NEAR_ENV=testnet` 3. Make sure your keys you want to use for the relayer have a `'FullAccess'` access_key by running `near keys your_relayer_account.testnet`. This is required to create more keys. You need to have access to at least 1 `'FullAccess'` access_key 4. Generate a new implicit key: `near generate-key` 1. This will output something like `Seed phrase: word0 word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 Key pair: {"publicKey":"ed25519:GdsF992LXiwNiAGUtxL7VbcPBAckbYBZubF6fTYrVY5Q","secretKey":"ed25519:17f3csiNEdrwxRXe9e4yU9f2ZxSgKBwbQ4bbkVoxiGcEdmtvDLikjhJSExTmcrMP6v6Ex6KXmgrUGdMDhB1dPs4P"}"` 5. Add the newly generated key to the relayer account: `near add-key your_relayer_account.testnet ed25519:GdsF992LXiwNiAGUtxL7VbcPBAckbYBZubF6fTYrVY5Q` 1. This will output something like: `Adding full access key = ed25519:GdsF992LXiwNiAGUtxL7VbcPBAckbYBZubF6fTYrVY5Q to your_relayer_account.testnet. Key added to account, but not stored locally. Transaction Id Bur9nJxos4f5cbibYXugZQQmZ4Uo2jsHYiVUwPT7AZMG Open the explorer for more info: https://www.nearblocks.io/txns/Bur9nJxos4f5cbibYXugZQQmZ4Uo2jsHYiVUwPT7AZMG` 6. Repeat steps 4 & 5 until you have the desired number of keys. Anywhere between 5-20 full access keys added to the relayer account works for most cases. 7. To double-check your keys were successfully added to the account run `near keys your_relayer_account.testnet` again, and you should see the newly added full access keys 8. Copy public and private (secret) key contents of the newly generated keys output in steps 4, 5 into the json file (`your_relayer_account.testnet.json` in the example) in the `account_keys` directory. You will now have a list of jsons with each json containing 3 entries: account_id, public_key, secret_key in the file. 1. NOTE: the `"account_id"` for all the keys will be your `your_relayer_account.testnet` account id since you added them to your account (not the implicit account ids from when the were generated) 9. Make sure the `key_filename` in `config.toml` matches your (i.e. `"your_relayer_account.testnet.json"`) to the `keys_filenames` list in `config.toml` ## Unit Testing 1. Run unit tests with `cargo test` ## Performance Testing 1. Remove the `#[ignore]` attribute above `test_relay_with_load()` testing function and run the test 2. Flame Tracing https://crates.io/crates/tracing-flame - Set `flametrace_performance = true` in `config.toml` - run `cargo run`, while sending requests to the endpoints of the functions you want to examine the performance of. - Stop the execution of the `cargo run` process. - Install inferno `cargo install inferno` - Generate the flamegraph from the `tracing.folded` file generated while running the relayer: `cat tracing.folded | inferno-flamegraph > tracing-flamegraph.svg` - Generate a flamechart: `cat tracing.folded | inferno-flamegraph --flamechart > tracing-flamechart.svg` ## Docker Deployment 1. Update `config.toml` as per your requirements. 2. Add any account key json files you need to use to the `account_keys` directory. 3. Update the `key_filenames` and `num_keys` parameter in the `config.toml` based on the keys you store in the `account_keys` directory. 4. Run command `docker compose up` this will create a `pagoda-relayer-rs` and `redis` container Run command `docker compose down` to stop the containers 5. Test the endpoints. See [API Spec](#api_spec) ## Cloud Deployment Terraform scripts are located in this repo: https://github.com/near/terraform-near-relayer The Relayer is best deployed in a serverless environment, such as AWS Lambda or GCP Cloud Run, to optimally manage automatic scalability and optimize cost. Alternatively, the relayer can be deployed on a VM instance if the expected traffic to the relayer (and thus the CPU, RAM requirements) is well known ahead of time. For security, it is recommended that the Full Access Key credentials are stored in a Secret Manager Service. NOTE: there should not be an large amount of funds stored on the relayer account associated with the signing key. It is better to periodically "top up" the relayer account. "Top up" Service coming soon... # Example Configs This directory contains example configs corresponding to different use cases. Please note that these are for reference only and you should be updating the values in the `config.toml` file found in the `pagoda-relayer-rs` directory. ## Configs and Usecases - `no_filters.toml` - This is a config for a relayer that covers gas for all user transactions to all contracts with no filters. To prevent abuse, this should only be used if there's only a secure backend calling the relayer - `basic_whitelist.toml` - This is a config for a basic relayer that covers gas for user transactions to interact with a whitelisted set of contracts - `redis.toml` - This is a config for a relayer that covers gas for user transactions up to a allowance specified in Redis to interact with a whitelisted set of contracts. - Allowances are on a per-account id basis and on signup (account creation in redis and on-chain) an oauth token is required to help with sybil resistance - `fastauth.toml` - This is a config for use if you intend to integrate with [fastuath sdk](https://docs.near.org/tools/fastauth-sdk) - It covers gas for user transactions up to a allowance specified in Redis to interact with a whitelisted set of contracts. - Allowances are on a per-account id basis and on signup (account creation in redis and on-chain) an oauth token is required to help with sybil resistance - This also makes use of a shared storage functionality on the near social db contract - and a whitelisted sender (whitelisted_delegate_action_receiver_ids) - `pay_with_ft.toml` - This is a config for a relayer that ensures there's FTs sent to a burn address used to cover the equivalent amount of gas for user transactions to interact with a whitelisted set of contracts - `whitelist_senders.toml` (whitelisted_delegate_action_receiver_ids) - This is a config for a relayer that covers gas for a whitelisted set of users' transactions to interact with a whitelisted set of contracts - `shared_storage.toml` - This is a config for a relayer that covers BOTH gas AND storage fees for user transactions to interact with a whitelisted set of contracts - be sure to include shared storage logic based on https://github.com/NearSocial/social-db/blob/master/contract/src/shared_storage.rs in your contract that is being whitelisted - `exchange_withdraw.toml` - This is a config for a relayer where an exchange running the relayer covers user withdraw fees when they are withdrawing stablecoins on NEAR (ie USDT or USDC)
NEARFoundation_ui.grants
.eslintrc.js README.md __tests__ MANUAL_TESTING.md mocks browser.ts handlers.ts index.ts server.ts config currency.ts grants.ts near.ts constants index.ts contexts GrantContext.ts form-schemas fullMilestoneSubmissionFormSchema.ts grantApplicationFormSchema.ts milestoneSubmissionFormSchema.ts hooks useAccountSignature.ts useDaoContract.ts useGrant.ts useGrantStatus.ts useMilestonesStatus.ts useOnceCall.ts modules hellosign-embedded-react useHellosignEmbedded.ts near-api-react config index.ts context NearContext.ts hooks useContract.ts useNear.ts useNetworkId.ts useSigner.ts useWallet.ts next-env.d.ts next-i18next.config.js next.config.js package-lock.json package.json prettier.config.js public images logo.svg locales en common.json grant.json grants.json home.json login.json logout.json milestone.json mockServiceWorker.js vercel.svg services apiService.ts currencyConverter.ts helloSignService.ts invoiceService.ts sputnikContractService.ts styles AccountDropdown.module.css Home.module.css Login.module.css globals.css tsconfig.json types AttachmentInterface.ts GrantApplicationInterface.ts MilestoneInterface.ts NearApiSignatureInterface.ts SputnikContractInterface.ts utilities budgetCalculator.ts createProposalDescription.ts createValidationUtilities.ts getCountry.ts grantFormCustomExtraValidators.ts parseCookies.ts parseMilestonesDates.ts
⚠️ This repo has been archived, and moved to https://github.com/NEARFoundation/fund3r # ui.grants [![NEAR](https://img.shields.io/badge/NEAR-%E2%8B%88-111111.svg)](https://near.org/) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE) > Easy to set up end to end grant application form for DAOs on NEAR Protocol ## Repositories - [ui.grants](https://github.com/NEARFoundation/ui.grants) - [api.grants](https://github.com/NEARFoundation/api.grants) - [admin.grants](https://github.com/NEARFoundation/admin.grants) ## Technology stack - Blockchain: **[NEAR](https://near.org/)** - Smart Contracts: **[Sputnik DAO Factory V2](https://github.com/near-daos/sputnik-dao-contract/tree/main/sputnikdao-factory2), [Sputnik DAO V2](https://github.com/near-daos/sputnik-dao-contract/tree/main/sputnikdao2)** - Package manager: **[NPM](https://www.npmjs.com/)** - Core programming language: **[TypeScript](https://www.typescriptlang.org/)** - Application framework: **[NextJS](https://nextjs.org/)** - Code quality: **[Eslint](https://eslint.org/), [Prettier](https://prettier.io/)** - UI Framework: **[Mantine UI](https://mantine.dev/)** - Internationalization: **[next-i18nnext](https://github.com/isaachinman/next-i18next)** - Form validation: **[zod](https://github.com/colinhacks/zod)** - HTTP client: **[Axios](https://github.com/axios/axios)** - Query hooks: **[React Query](https://react-query.tanstack.com/)** - Contract Signature: **[hellosign](https://github.com/HelloFax/hellosign-nodejs-sdk)** - KYC: **[KYC DAO](https://github.com/kycdao)** - Scheduling: **[Calendly](https://developer.calendly.com/)** ## Guides ### Configuration ```bash cp .env.dist .env # set up variables on .env ``` ### Installation ```bash npm install ``` Set up .env ### Development ```bash npm run dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. ### Deployment ```bash npm install && npm run build npm run start ``` ### Testing No tested are implemented yet. Check the [Manual Testing](__tests__/MANUAL_TESTING.md) guide. ## Authors - [Sandoche](https://github.com/sandoche)
ninjadev0706_nft-mint-website
README.md contract Cargo.toml README.md build.sh built.sh compile.js src approval.rs enumeration.rs events.rs internal.rs lib.rs metadata.rs mint.rs nft_core.rs royalty.rs variable.sh package.json src App.js Components InfoBubble.js MintingTool.js __mocks__ fileMock.js assets logo-black.svg logo-white.svg near_icon.svg near_logo_wht.svg config.js global.css index.html index.js jest.init.js main.test.js utils.js wallet login index.html
nft-mint-frontend ================== This [React] app was initialized with [create-near-app] Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install dependencies: `yarn install` 3. Run the local development server: `yarn dev` (see `package.json` for a full list of `scripts` you can run with `yarn`) Now you'll have a local development environment backed by the NEAR TestNet! Go ahead and play with the app and the code. As you make code changes, the app will automatically reload. Exploring The Code ================== 1. The "backend" code lives in the `/contract` folder. See the README there for more info. 2. The frontend code lives in the `/src` folder. `/src/index.html` is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and the smart contract. See `contract/README` for info about how it's tested. The frontend code gets tested with [jest]. You can run both of these at once with `yarn run test`. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally: yarn install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `nft-mint-frontend.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `nft-mint-frontend.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account nft-mint-frontend.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'nft-mint-frontend.YOUR-NAME.testnet' Step 3: deploy! --------------- One command: yarn deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contract to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [React]: https://reactjs.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages nft-mint-frontend Smart Contract ================== A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard Rust tests using [cargo] with a `--nocapture` flag so that you can see any debug info you print to the console. [smart contract]: https://docs.near.org/docs/develop/contracts/overview [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://github.com/near/near-sdk-rs#pre-requisites [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html
near-examples_lake-indexer-start-options
.github workflows tests.yml Cargo.toml README.md src main.rs
# lake-indexer-start-options This is a source code for the tutorial [Extending Lake indexer with start options](https://near-indexers.io/tutorials/lake/lake-start-options). It shows how to implement start options to your indexer built on top of [NEAR Lake Framework](https://github.com/near/near-lake-framework): - from specified block height (out of the box) ```bash ./target/release/indexer mainnet from-block 65359506 ``` - from the latest final block from the network ```bash ./target/release/indexer mainnet from-latest ``` - from the block indexer has indexed the last before it was interrupted
near_boilerplate-template-loyalty-program-with-ft-dev
.eslintrc.yml .github ISSUE_TEMPLATE 01_BUG_REPORT.md 02_FEATURE_REQUEST.md 03_CODEBASE_IMPROVEMENT.md 04_SUPPORT_QUESTION.md BOUNTY.yml config.yml PULL_REQUEST_TEMPLATE.md labels.yml workflows codeql.yml deploy-to-console.yml labels.yml lock.yml pr-labels.yml stale.yml .gitpod.yml README.md contracts Cargo.toml build.sh deploy.sh fungible-token Cargo.toml src lib.rs manager-contract Cargo.toml src lib.rs reward-factory Cargo.toml src deploy.rs lib.rs docs CODE_OF_CONDUCT.md CONTRIBUTING.md SECURITY.md frontend assets global.css logo-black.svg logo-white.svg components HeaderSection index.js Loader index.js LoyaltyPrograms index.js PageBackground index.js Sign SignInButton.js SignOutButton.js index.js WelcomeSection index.js index.html modules Customer Header index.js ProgramIsActive AccountDetails.js BuyWithCC.js BuyWithTokens.js ListOfTx.js index.js ProgramNotActive LoyaltyPrograms.js index.js Rules index.js Welcome index.js index.js Merchant Header index.js SignedIn RewardProgramDetails.js RewardProgramForm.js index.js SignedOut index.js Welcome Welcome.js index.js next.config.js package-lock.json package.json pages _app.js _document.js customer.js index.js merchant.js postcss.config.js start.sh styles globals.css tailwind.config.js tsconfig.json utils backend.js customer.js near-ft-factory.js near-ft-token.js near-interface.js utils.js wallet-selector.js integration-tests package-lock.json package.json src main.ava.ts package-lock.json package.json
<h1 align="center"> <a href="https://github.com/near/boilerplate-template-rs"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_light.png"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> <img alt="" src="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> </picture> </a> </h1> <div align="center"> Rust Boilerplate Template <br /> <br /> <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=bug&template=01_BUG_REPORT.md&title=bug%3A+">Report a Bug</a> · <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=enhancement&template=02_FEATURE_REQUEST.md&title=feat%3A+">Request a Feature</a> . <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+">Ask a Question</a> </div> <div align="center"> <br /> [![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) [![code with love by near](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-near-ff1414.svg?style=flat-square)](https://github.com/near) </div> <details open="open"> <summary>Table of Contents</summary> - [About](#about) - [Built With](#built-with) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Installation](#installation) - [Overview](#overview) - [Contracts](#contracts) - [Frontend](#frontend) - [Backend.js](#backendjs) - [Usage](#usage) - [Roadmap](#roadmap) - [Support](#support) - [Project assistance](#project-assistance) - [Contributing](#contributing) - [Authors & contributors](#authors--contributors) - [Security](#security) </details> --- # Loyalty Program with Fungible Tokens ## About This project is created for easy-to-start as a React + Rust loyalty program with fungible tokens template in the Pagoda Gallery. It was initialized with [create-near-app]. Use this template and start to build your own gallery project! ### Built With [create-near-app] Getting Started ================== ### Prerequisites Make sure you have a [current version of Node.js](https://nodejs.org/en/about/releases/) installed – we are targeting versions `16+`. Read about other [prerequisites](https://docs.near.org/develop/prerequisites) in our docs. ### Installation Install all dependencies: npm install Build your contract: npm run build Deploy your contract to TestNet with a temporary dev account: npm run deploy **Important note**: only the factory contract is and should be deployed. This is done automatically when using `npm run deploy` command. Two other contracts (ft contract and manager contract) should only be deployed by the factory contract. Overview ================ The loyalty program with the fungible token template provides a way for merchants to create a fungible token program with just a few clicks. The template consists of the following modules: * 3 smart contracts: factory contract, fungible token contract and manager contract * backend.js that serves as a web2 backend * frontend that provides the UI for the customer and the merchant ## Contracts This template features three smart contracts: * factory contract - this is the contract that is deployed by the user. The contract uses a factory pattern to deploy fungible token contract and manager contract for each merchant that logs in and creates a loyalty program with the UI. See [factory-rust](https://github.com/near-examples/factory-rust) for a simple factory pattern. * fungible token contract - this is a standard fungible token contract. Read more about the FTs [here](https://docs.near.org/develop/relevant-contracts/ft). * manager contract - this contract manages the whole loaylty program flow ## Frontend Frontend consists of two views: * merchant view - this is the view where a merchant can create a loyalty program. The merchant needs to log in first. * customer view - the view used by the customer to use the loyalty program and gain fungible tokens. This view is hidden until a merchant creates a loaylty program. The customer does not have to log in or create an account in order to use the loyalty program. ## Backend.js Backend.js is a simple web2 backend simulated on the frontend in this template. Usage ===== Start your frontend: npm run dev **Important note**: This project uses a browser local storage to store important data. Be sure to always run it in the same browser. It won't work in an incognito mode. Test your contract: npm test Exploring The App ================= The project deploys a pair of contracts for each merchant. The naming convention for those is: Manager contract: `{random id tied to a merchant}-manager.{factory address}` FT contract: `{random id tied to a merchant}-ft.{factory address}` A customer account is created as a subaccount of a manager contract: `{random string of 4 chars}.{random id tied to a merchant}-manager.{factory address}` Exploring The Code ================== 1. The smart-contract code lives in the `/contracts` folder. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/pages/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. There is a backend code in the `backend.js` file in the `frontend` directory. This code simulates a web2 backend. 4. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. ## Security Loyalty Program with Fungible Tokens Template follows good practices of security, but 100% security cannot be assured. Loyalty Program with Fungible Tokens Template is provided **"as is"** without any **warranty**. Use at your own risk.
near-examples_bos-gateway
README.md near-wallet.js next-env.d.ts next.config.js package-lock.json package.json src assets images near-logo-black.svg near-logotype.svg near_social_combo.svg near_social_icon.svg vs_code_icon.svg components lib Spinner index.ts Toast README.md api.ts index.ts store.ts styles.ts data bos-components.ts web3.ts hooks useBosComponents.ts useBosLoaderInitializer.ts useFlags.ts useHashUrlBackwardsCompatibility.ts useScrollBlock.ts useSignInRedirect.ts index.d.ts lib selector setup.js wallet.js stores auth.ts bos-loader.ts current-component.ts vm.ts styles globals.css theme.css utils auth.js config.ts firebase.ts form-validation.ts keypom-options.ts types.ts tsconfig.json types rudderstack-analytics.ts
# Toast Implemented via Radix primitives: https://www.radix-ui.com/docs/primitives/components/toast _If the current props and Stitches style overrides aren't enough to cover your use case, feel free to implement your own component using the Radix primitives directly._ ## Example Using the `openToast` API allows you to easily open a toast from any context: ```tsx import { openToast } from '@/components/lib/Toast'; ... <Button onClick={() => openToast({ type: 'ERROR', title: 'Toast Title', description: 'This is a great toast description.', }) } > Open a Toast </Button> ``` You can pass other options too: ```tsx <Button onClick={() => openToast({ type: 'SUCCESS', // SUCCESS | INFO | ERROR title: 'Toast Title', description: 'This is a great toast description.', icon: 'ph-bold ph-pizza', // https://phosphoricons.com/ duration: 20000, // milliseconds (pass Infinity to disable auto close) }) } > Open a Toast </Button> ``` ## Deduplicate If you need to ensure only a single instance of a toast is ever displayed at once, you can deduplicate by passing a unique `id` key. If a toast with the passed `id` is currently open, a new toast will not be opened: ```tsx <Button onClick={() => openToast({ id: 'my-unique-toast', title: 'Toast Title', description: 'This is a great toast description.', }) } > Deduplicated Toast </Button> ``` ## Custom Toast If you need something more custom, you can render a custom toast using `lib/Toast/Toaster.tsx` as an example like so: ```tsx import * as Toast from '@/components/lib/Toast'; ... <Toast.Provider duration={5000}> <Toast.Root open={isOpen} onOpenChange={setIsOpen}> <Toast.Title>My Title</Toast.Title> <Toast.Description>My Description</Toast.Description> <Toast.CloseButton /> </Toast.Root> <Toast.Viewport /> </Toast.Provider> ``` # Gateway The gateway is a Next JS app that serves the frontend and loads the `bos-components`. ## Setup & Development Initialize repo in the root: ``` yarn ``` Start development server: ``` cd gateway && yarn run dev ``` ## Local Component Development 1. Run an instance of a component server like [near/bos-loader](https://github.com/near/bos-loader) 2. Run from the project root: ``` bos-loader sweeter.testnet -p ./bos-components/src ``` 3. Open the `/flags` route of your viewer and set the BOS Loader URL e.g. `http://127.0.0.1:3030` Note: there is no hot reload, you must refresh the page to see component changes
On0n0k1_NCD.L1--Chess
Cargo.toml README.md package-lock.json src board.rs game.rs lib.rs movement.rs movement report.rs step.rs pieces.rs pieces bishop.rs empty.rs king.rs knight.rs pawn.rs piece.rs piece_ext.rs queen.rs rook.rs player.rs player errors.rs player.rs players.rs turn.rs
# NCD.L1--Chess A chess game for the NEAR network. The pieces move properly, but I still need to implement some kind of authentication for the players. Also need to properly implement testing/better documentation. But it's still useful as a study material though. ## Recommendations (How I'm building this project) For testing the project, I usually create a subaccount, deploy to it, run my functions and then delete the subaccount. Call "near login" to enter your main account. Let's say I have a testnet account called "a-test-account.testnet". In that case, I call "near create-account rust-tests.a-test-account.testnet --masterAccount a-test-account.testnet --initialBalance 100" to create a subaccount with name rust-tests and a deposit of 100 NEAR. When I'm done using the deployed project, I would call "near delete rust-tests.a-test-account.testnet a-test-account.testnet", which means the subaccount gets deleted and all the remaining NEAR is transferred back to a-tests-account.testnet. ## Compiling and deploying this chess game. Bring a terminal to this folder. cargo +nightly build --target wasm32-unknown-unknown --release Might need to add wasm32-unknown-unknown before doing the above. A message will show up saying it. cd ./target/wasm32-unknown-unknown/release To reach the folder with the compiled wasm. near deploy --accountId rust-tests.a-test-account.testnet --wasmFile ./chess.wasm If everything goes well, the subaccount now contains the compiled project. We can run it's functions remotely. ## Functions available Check lib.rs to see available functions. Functions with &self can be called with view. Functions with &mut self can be called with call. ### Example for view: near view rust-tests.a-tests-account.testnet get_board '{}' Will print a very ugly version of the board. It's stored as 64 bytes, so we can't expect much from it. Numbers go from 0 to 12, here's what they mean: - 0: Empty piece; - 1: White Pawn; - 2: White Rook; - 3: White Knight; - 4: White Bishop; - 5: White Queen; - 6: White King; - 7: Black Pawn; - 8: Black Rook; - 9: Black Knight; - 10: Black Bishop; - 11: Black Queen; - 12: Black King ### Another example for view: near view rust-tests.a-tests-account.testnet get_piece_name '{"col": 7, "row": 7}' Will get the piece in the bottom right corner of the board. A "White Rook". Columns and rows go from 0 to 7, get_piece_name_index does the same thing but you use the index of the entire board instead. For the same position the index would be 63. ### An example for call: near call rust-tests.a-tests-account.testnet move_to '{"current_col": 0, "current_row": 6, "target_col": 0, "target_row": 4}' --account-id a-tests-account.testnet Will make the bottom white pawn move forward two steps (If it's the white player's turn). There's also a function to reset the game and get the game status. Please check them out. ### Costs I ran the methods from the tests sections in the main lib file. Checking in the explorer, the gas used to deploy the contract was 25TGas. To run each move function the gas cost was 6TGas. To run the last move function that caused the checkmate, the gas cost was 7TGas. Multiply it by the cost in https://explorer.near.org/ to get the cost in Near for each move function. At the time of writing this section of the README (jan 6 2022). The cost for each TGas is 0.0001 Ⓝ. The cost for each Ⓝ is U$16.02 . So each function call will cost 0.009612 dollars (TGas used * TGas cost * NearCost(dollars)). A chess match takes from 40 to 60 moves to end. So a player should play around 2 matches for each dollar spent. In other words, mining near must be very worthwhile right now. I'm not an expert in mining, don't rely too much on my word please.
keypom_claim-page-boilerplate
.prettierrc.js README.md build asset-manifest.json index.html manifest.json robots.txt static css main.cc79aba3.css js 787.d8720906.chunk.js main.8fcccbb1.js.LICENSE.txt config-overrides.js package-lock.json package.json postcss.config.js public index.html manifest.json robots.txt src components LoadingModal index.ts MultipleChoice index.ts RegistrationForm index.ts SquaresBG index.ts index.css logo.svg react-app-env.d.ts reportWebVitals.ts routes Error index.ts Home Home.css index.ts Root index.ts Success index.ts setupTests.ts util ft-create.d.ts ft-create.js tailwind.config.js tsconfig.json
# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. ### `npm test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `npm run build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ### `npm run eject` **Note: this is a one-way operation. Once you `eject`, you can’t go back!** If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/).
Jmen_hello-near-contract-testing
README.md integration.test.js package.json
# hello-near-contract-testing
humanshield89_parse-near-auth-adapter
.prettierrc.json README.md package-lock.json package.json src index.js lib CloudCode NearAuthCloudCode.js NearAuthAdapter.js Utils.js data NearSignToken class.js struct.js WrappedBaseParseObj class.js struct.js
# Near wallet Auth Adapter for parse server This package allows parse users to login using their near wallets ## Install ```shell npm i parse-near-auth-adapter ``` or if you prefer `yarn` ```shell yarn add parse-near-auth-adapter ``` ## Setup 1. Add NearAuthAdapter to your parse server options ```javascript const { NearAuthAdapter } = require("parse-near-auth-adapter"); const parseServerApi = new ParseServer({ ...restOfParseOptions, auth: { NearAuthAdapter: { module: NearAuthAdapter, tokenValidity: 10000, // how long a signToken is valid in milis (default 15seconds) connectionConfig: { networkId: "testnet", // if main net change this to main net nodeUrl: "https://rpc.testnet.near.org", // change to match network id walletUrl: "https://wallet.testnet.near.org", // change to match network id helperUrl: "https://helper.testnet.near.org", // change to match network id explorerUrl: "https://explorer.testnet.near.org", // change to match network id }, }, }, }); ``` 2. Setup Cloud code ```javascript const { setupNearAuthAdapterCloudCode } = require("parse-near-auth-adapter"); // setup your other cloud functions setupNearAuthAdapterCloudCode(); // this will set one cloud function used to generate tokens ``` You are all set now, you can start using it on clients ## Client side example (Linking Users) ```javascript import * as nearAPI from "near-api-js"; import { sha256 } from "js-sha256"; // we assume you already signin to near wallet via wallet.requestSignIn() // we assume Parse user is already signin const linkWallet = async () => { const currentWallet = { accountId: walletConnection.getAccountId(), balance: (await walletConnection.account().state()).amount, }; // this means the near wallet is not connected to your website (use the near requestSignin to connect near wallet to your website) if (!currentWallet?.accountId) return; const res = await Parse.Cloud.run("getNearSignToken", { walletId: currentUser?.accountId }).catch((error) => { // handle error }); // this is the token that needs to be signed const token = res?.data?.get("token"); // get the signer from the wallet connection const signer = (await wallet.account()).connection.signer; // get the keyPar for the signer const key = await signer.keyStore.getKey(nearConfig.networkId, currentUser.accountId); // sha256 the token to prepare for signing const digestedToken = new Uint8Array(sha256.array(token)); // sign using the key pair const signed = await key.sign(digestedToken, currentUser.accountId, nearConfig.networkId); // get string representation of public key const publicKey = key.publicKey.toString(); // get hex representation of the signature const signature = Buffer.from(signed.signature).toString("hex"); // id is the connected near wallet accountId const id = currentUser.accountId; // more details on the please visit: // https://docs.parseplatform.org/js/guide/#linking-users // The NearAuthAdapter expects this authdata const authData = { publicKey, signature, id, token }; let provider; provider = { authenticate: (options) => { options.success(provider, { ...authData }); }, restoreAuthentication() { return true; }, getAuthType() { return "NearAuthAdapter"; }, getAuthData() { return { authData: { ...authData, }, }; }, }; // get current logged in Parse User const user = await Parse.User.currentAsync(); // register the provider to allow linking await Parse.User._registerAuthenticationProvider(provider); // link user with the provider await user.linkWith(provider.getAuthType(), authData).catch((error) => { // handle error }); // check if linked user._isLinked(provider); // should be true }; ``` ## Client side example (Login) ```javascript const login = async () => { const currentWallet = { accountId: walletConnection.getAccountId(), balance: (await walletConnection.account().state()).amount, }; // this means the near wallet is not connected to your website (use the near requestSignin to connect near wallet to your website) if (!currentWallet?.accountId) return; // call cloud function to get a fresh token const res = await Parse.Cloud.run("getNearSignToken", { walletId: currentUser?.accountId }).catch((error) => { // handle error }); // this is the token that needs to be signed const token = res?.data?.get("token"); // get the signer from the wallet connection const signer = (await wallet.account()).connection.signer; // get the keyPar for the signer const key = await signer.keyStore.getKey(nearConfig.networkId, currentUser.accountId); // sha256 the token to prepare for signing const digestedToken = new Uint8Array(sha256.array(token)); // sign using the key pair const signed = await key.sign(digestedToken, currentUser.accountId, nearConfig.networkId); // get string representation of public key const publicKey = key.publicKey.toString(); // get hex representation of the signature const signature = Buffer.from(signed.signature).toString("hex"); // id is the connected near wallet accountId const id = currentUser.accountId; // more details on the please visit: // https://docs.parseplatform.org/js/guide/#linking-users // The NearAuthAdapter expects this authdata const authData = { publicKey, signature, id, token }; const user = await Parse.User.LogInWith("NearAuthAdapter", { authData, }).catch((error) => { // handle error // probably no linked wallet , or signature mismatch }); if (user) { // user is the currently logged in user } }; ``` ## How Does it work ? The Near Auth adapter is simple and straight forward, these are the steps 1. client requests a token (the token is a randomly generated base64Url string) 2. client hashes the token using sha256 and then sign it through the near-js-api 3. client sends to Parse Server the near accountId, publicKey as string (from the pair that signed the token), the token as string, and a hex string representation of the signature 4. Parse server will check the following and only link/login if all pass: - the provided publicKey is actually a valid accessKey that belongs the provided near accountID - The token is a valid token generated by parse server and is not older than 5 minutes - the signature is valid ## Licence: Project is distributed under MIT license. ## contributions Contributions are welcomes ## Sponsors This adapter was made possible by [agoraneos](https://agoraneos.com/)
near_neardevhub-contract
.devcontainer devcontainer.json post-create.sh .github workflows main.yml release.yml Cargo.toml README.md community-factory Cargo.toml src lib.rs community Cargo.toml src lib.rs devhub_common Cargo.toml src lib.rs discussions Cargo.toml src lib.rs rust-toolchain.toml rustfmt.toml src access_control members.rs mod.rs rules.rs community mod.rs debug.rs lib.rs migrations.rs notify.rs post attestation.rs comment.rs github.rs idea.rs like.rs mod.rs solution.rs sponsorship.rs proposal mod.rs repost.rs timeline.rs repost.rs stats.rs str_serializers.rs test.sh tests README.md communities.rs migration.rs proposals.rs test_env.rs
# NEAR DevHub Contract ## Overview The smart contract responsible for managing the communities, posts, and permissions made available via the [NEAR DevHub frontend](https://neardevhub.org). The repository for the frontend widgets can be found [here](https://github.com/NEAR-DevHub/neardevhub-bos). ## Getting Started ### Prerequisites Before starting, make sure you have the following installed: 1. [cargo-near](https://github.com/near/cargo-near), to easily create testnet accounts, build and deploy contracts. 2. [NEAR CLI RS](https://github.com/near/near-cli-rs), to interact with the contract. ## Building From the root directory, run: ```sh cd discussions cargo near build cd ../community cargo near build cd ../community-factory cargo near build cd .. cargo near build ``` ## Running Tests From the root directory, run: ```sh cargo test ``` ## Deploying Using [cargo-near](https://github.com/near/cargo-near), run the following command. Be sure to set your own account id and corresponding network. ```sh cargo near deploy {{account.near}} cd community-factory cargo near deploy {{community.account.near}} ``` # Integration Test using near-workspaces-rs This codebase is designed to deploy and test the Devhub contract on a Sandbox node. ## Dependencies - Rust: For writing the test suite. - `near-workspaces`: A custom library for handling contract calls. - `near_units`: For handling NEAR unit conversions. - `serde_json`: For JSON serialization and deserialization. ### How to Run To run the test, use the following command: ```bash cargo test ```
modelomaker812_near-wallet-integration
.github dependabot.yml workflows tests.yml .gitpod.yml .travis.yml LICENSE-APACHE.txt LICENSE-MIT.txt README-Gitpod.md README.md as-pect.config.js asconfig.json assembly __tests__ as-pect.d.ts main.spec.ts as_types.d.ts index.ts model.ts tsconfig.json neardev shared-test-staging test.near.json shared-test test.near.json package.json src config.js index.html loader.html main.js styles.css test-setup.js test.js
Example of NEAR Wallet integration ================================== [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/near-examples/wallet-example) <!-- MAGIC COMMENT: DO NOT DELETE! Everything above this line is hidden on NEAR Examples page --> This example demonstrates how to integrate your application with NEAR Wallet. The contract is quite simple. It can store the account_id of last sender and return it. It also shows how you can debug contracts using logs. ## Getting started There are two ways to run this project. The first is the quick and a good way to instantly become familiar with this example. Once familiar, the next step is for a developer to create their own NEAR account and deploy the contract to testnet. This is covered in the following section. There's a button at the top of this file that says "Open in Gitpod." This will open the project in a new tab with an integrated development environment. The other option is to clone this repository and follow the same instructions. ### Quickest option 1. Install dependencies: ``` yarn --frozen-lockfile ``` 2. Build and deploy this smart contract to a development account. This development account will be created automatically and is not intended for reuse: ``` yarn dev ``` Your command line which will display a link to localhost similar to: ```bash Server running at http://localhost:1234 ``` Please open that link your browser to continue and see how to log in with NEAR Wallet in a simple webapp. ### Standard deploy option In this second option, the smart contract will get deployed to a specific account created with the NEAR Wallet. 1. Ensure `near-cli` is installed by running: ``` near --version ``` If needed, install `near-cli`: ``` npm install near-cli -g ``` 2. If you do not have a NEAR account, please create one with [NEAR Wallet](wallet.testnet.near.org). In the project root, login with `near-cli` by following the instructions after this command: ``` near login ``` 3. Modify the top of `src/config.js`, changing the `CONTRACT_NAME` to be the NEAR account that was just used to log in. ```javascript … const CONTRACT_NAME = process.env.CONTRACT_NAME || 'YOUR_ACCOUNT_NAME_HERE'; /* TODO: fill this in! */ … ``` 4. Start the example! ``` yarn start ``` ## To Test ``` yarn asp // as-pect tests yarn jest // integration tests yarn test // both ``` ## To Explore - `assembly/main.ts` for the contract code - `src/index.html` for the front-end HTML - `src/main.js` for the JavaScript front-end code and how to integrate contracts - `src/test.js` for the JS tests for the contract ## Data collection By using Gitpod in this project, you agree to opt-in to basic, anonymous analytics. No personal information is transmitted. Instead, these usage statistics aid in discovering potential bugs and user flow information.
priyansuhub_PriNearStarterTemplate
as-pect.config.js asconfig.json assembly __tests__ as-pect.d.ts example.spec.ts index.ts tsconfig.json package.json tsconfig.json
ilyar_near-checksum
.cargo audit.toml config.toml .github workflows contract.yml Cargo.toml docs readme.md readme.md src lib.rs tests integration add_simulate.rs gas_simulate.rs has_simulate.rs main.rs utils.rs
NEARFoundation_community-near-lockups
.gitpod.yml .idea encodings.xml misc.xml modules.xml php.xml README.md babel.config.js package.json src App.js __mocks__ fileMock.js assets logo-black.svg logo-white.svg config.js global.css index.html index.js jest.init.js main.test.js utils.js utils Loading.js funcs.js ledger.js store.js wallet login index.html Ledger support
near-lockups ================== This [React] app was initialized with [create-near-app] Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install dependencies: `yarn install` 3. Run the local development server: `yarn dev` (see `package.json` for a full list of `scripts` you can run with `yarn`) Now you'll have a local development environment backed by the NEAR TestNet! Go ahead and play with the app and the code. As you make code changes, the app will automatically reload. Exploring The Code ================== 1. The "backend" code lives in the `/contract` folder. See the README there for more info. 2. The frontend code lives in the `/src` folder. `/src/index.html` is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and the smart contract. See `contract/README` for info about how it's tested. The frontend code gets tested with [jest]. You can run both of these at once with `yarn run test`. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally: yarn install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-lockups.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-lockups.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-lockups.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-lockups.YOUR-NAME.testnet' Step 3: deploy! --------------- One command: yarn deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contract to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [React]: https://reactjs.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages
Lightency-io_LightencyDapp
.gitpod.yml README.md Rewardercontract Cargo.toml README.md build.sh deploy.sh src lib.rs contract Cargo.toml README.md neardev dev-account.env src lib.rs energy_pool_contract Cargo.toml README.md build.sh deploy.sh neardev dev-account.env src lib.rs energydao .gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs integration-tests Cargo.toml src tests.rs frontend App.js Routes.js assets css global.css img index.js logo-black.svg logo-white.svg swaps Etoro_logo.svg components dao createProposal.js dashboards.js proposals.js governance charts chart1.js forms createDao.js tables daoList.js hooks useWhitelist.js layouts Reusables LineChart.js layout.js styles.js shared Clock Clock.js Footer footer.js style.js Loading loader2.js loading.js styles.js Navbar navbar.js style.js Sidebar sidebar.js styles.js vesting data vestingPacks.js tables MyVestingList.js vestingList.js config.js data Whitelist.js dist Etoro_logo.ba873066.svg auto.0965e03f.js index.1afa09c0.css index.html primeicons.cdbe9e7f.svg index.html index.js near-api.js near-config.js package-lock.json package.json pages CouncilPage.js DaoPage.js GovernancePage.js HomePage.js OnDevelopmentModPage.js StakePage.js StakingPoolPage.js SwapPage.js VestingPage.js VotingPage.js styles globalStyles.js theme.js variables.js ui-components.js utils.js utils isWhitelisted.js keccak256.js timeConverter.js ft Cargo.toml build.sh src lib.rs integration-tests Cargo.toml src tests.rs package-lock.json package.json rewardpoolcontract Cargo.toml README.md build.sh deploy.sh src lib.rs rewardscontraclatest Cargo.toml README.md build.sh deploy.sh src lib.rs staking .gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs integration-tests Cargo.toml src tests.rs package-lock.json package.json stakingpool .gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs integration-tests Cargo.toml src tests.rs treasurydao .gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs integration-tests Cargo.toml src tests.rs package-lock.json package.json vesting Cargo.toml README.md build.sh deploy.sh neardev dev-account.env src lib.rs
# Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"greeting":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"greeting":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. <img src="https://res.cloudinary.com/habibii/image/upload/v1669067156/Sans_titre-3_muu0ga.jpg" align="center" style="width: 100%" /> <img src="https://rishavanand.github.io/static/images/greetings.gif" align="center" style="width: 100%" /> About Lightency: ================== Lightency is a Web3 green energy startup built on the NEAR protocol. Lightency utilizes the pillars of blockchain technology and expertise in renewable energies to work around several axes pertaining to energy management and monetization. Lightency adds a sustainable and environmentally-conscious spice to Defi by creating a one-stop liquidity pool to finance green energy projects and allow for sustainable staking and vesting mechanisms. Lightency’s Energy Fund accelerates the creation and implementation of industry-shifting green energy projects worldwide. Crypto and Energy VCs will get above-market returns and a seat at the Lightency DAO council by investing in the fund. The fund is governed by a DAO composed of the project’s team and the contributing investors. DAO Council Members can initiate proposals to transfer funds from one DAO to another or to fund green energy projects, and decisions go through the voting procedure. Furthermore, Lightency’s Powerchain redefines energy management through blockchain-optimized microgrids and opens a portal for self-sustained communities to produce and consume energy locally and efficiently. ## Acknowledgements - The voting mechanism is: Democratic. - Only council and community members are part of the Lightency DAO. - A community member must be an LTS staker - A council member can be Lightency team member or strategic investor, or partner. - A watchdog is an algorithm that is created to execute initiated proposals when the voting period expires. # The contracts below are the deliverables of Milestone 2 of the NEAR Foundation Grant. ## LTS smart contract ([lts_token.near](https://github.com/Lightency/LightencyDapp/blob/master/ft/src/lib.rs)) : * ``Mint`` function: A function to mint Light tokens * ``Burn`` function: A function to burn Light tokens * ``Ft_balance_of``: A function to receive Light token balance by account id * ``Transfer`` function: a function to send Light tokens to an identified wallet * ``Stake`` function: a cross-call function that adds a Light token staker to the list of stakers. ## Treasury DAO smart contract ([treasurydao.near](https://github.com/Lightency/LightencyDapp/blob/master/treasurydao/contract/src/lib.rs)) : * ``Create_proposal`` function: A function to create proposals in the treasury DAO. Only council members can use this function. There are four types of proposals : - Fund energy pool - Add a council member to the DAO - Borrow stable coins from burrow - Borrow stable coins from compound Every proposal has an expiration date. Following the expiration of the proposal, an off-chain cron will execute the task immediately and autonomously. * ``Add_vote`` function: this function is designated for council and community DAO members . Members submit an irrevocable Yes or No vote. * ``Add_council`` function: This function adds a council member to the DAO. After the voting period has ended, a watchdog is required to proceed with the function. * ``Add_community`` function: This function adds a user to the DAO as a community member. * ``Get_specific_proposal`` function: This function extracts a specific proposal by its ID. * ``Get_proposals`` function: This function extracts the list of all proposals. * ``Get_communities``: This function extracts the list of all community members * ``Get_councils``: This function extracts the list of all council members. * ``Check_council`` function: This function verifies if the user is a council member * ``Check_member`` function: This function verifies if the user is a community member * ``fund`` function: This function is delivered by the Lightency watchdog. This function is executed after the agreement of the proposal of type "fund energy pool." This function will send Light tokens from the Treasury Pool to the Energy Pool. ## Staking wallet smart contract ([staking_contract.near](https://github.com/Lightency/LightencyDapp/blob/master/staking/contract/src/lib.rs)) : * ``Unstake`` : This function deducts the demanded unstake amount.In case of no staked funds remaining, the interested member will be removed from the Stakers list. Hence, the member loses their status as a community member. * ``Withdraw``: This function withdraws the unstaked amount. The Light tokens will be transferred immediately to the staker. ## Staking pool smart contract ([lightencypool.near](https://github.com/Lightency/LightencyDapp/blob/master/stakingpool/contract/src/lib.rs)) : * ``Transfer_lts``: This function is executed when the staker asks for their stake to be removed. The assets will be transferred to the staking wallet. ## Rewarder smart contract ([rewarder_contract.near ](https://github.com/Lightency/LightencyDapp/blob/master/rewardscontraclatest/src/lib.rs)) : * ``Add_staker``: This function adds a staker to the list of stakers. * ``Check_staker``: This function verifies a staker’s authenticity. * ``Get_total_staked``: this function returns the total amount staked in the pool. * ``Unstake``: This function adds a staker to the list of unstakers. * ``Withdraw_reward``: This function allows the user to withdraw their staking reward. * ``Get_total_amount_per_wallet``: This function daily returns the amount of reward of every registered staker. * ``Caculate_reward``: This function calculates the reward of every staker and returns the amount of daily yield. * ``Update_reward``: This function is used by the Lightency watchdog. The cron will distribute the rewards to every staker daily. ## Vesting smart contract ([ lightency_vesting.near ](https://github.com/Lightency/LightencyDapp/blob/master/vesting/src/lib.rs)) : * ``Get_all_vestors``: This function returns the list of all vestors. * ``Get_vestor``: This function returns a vestor through its ID. * ``Get_total_locked_amount``: This function returns all the locked light tokens in the smart contract * ``Get_total_unlocked_amount``: this function returns all the unlocked like tokens in the smart contract * ``Add_lockup``: This function adds a vesting schedule to the vestor. * ``Refresh``: This function verifies if the vester can unlock their token. If they do, the Light tokens will be immediately transferred to them. ## Create an energy certificate in a form of an NFT smart contract ([ nft-lightency.near ](https://github.com/Lightency/metabuild-rec-platform)) : * ``nft_mint()`` : A function to mint an energy certificate with an NFT. * ``nft_approve()`` : A function to grant escrow access to rec_lightency.near contract ## Fractionalizing an energy certificate (NFT) into shares (FTs) smart contract ([ lightency_rec.near ](https://github.com/Lightency/metabuild-rec-platform)) : * ``fill_share_holders()``: A function to assign to each accountId a number of shares from that REC (NFT) * ``securitize()``: A function to fractionalize the REC (NFT), be transferred and a shares contract will be created under the ID of ``[nft-lightency-near- <tokenId>.lightency_rec.near]`` according to what we did with ``fill_share_holders()`` : each accontId and how many shares he owns. The Shares Contract (nft-lightency-near- <tokenId>.lightency_rec.near) *ft_balance_of() : A function to view how many that accountId own shares near-blank-project ================== This app was initialized with [create-near-app] Quick Start =========== If you haven't installed dependencies during setup: npm install Build and deploy your contract to TestNet with a temporary dev account: npm run deploy Test your contract: npm test If you have a frontend, run `npm start`. This will run a dev server. Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"message":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. near-blank-project ================== This app was initialized with [create-near-app] Quick Start =========== If you haven't installed dependencies during setup: npm install Build and deploy your contract to TestNet with a temporary dev account: npm run deploy Test your contract: npm test If you have a frontend, run `npm start`. This will run a dev server. Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages near-blank-project ================== This app was initialized with [create-near-app] Quick Start =========== If you haven't installed dependencies during setup: npm install Build and deploy your contract to TestNet with a temporary dev account: npm run deploy Test your contract: npm test If you have a frontend, run `npm start`. This will run a dev server. Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"greeting":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"message":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. near-blank-project ================== This app was initialized with [create-near-app] Quick Start =========== If you haven't installed dependencies during setup: npm install Build and deploy your contract to TestNet with a temporary dev account: npm run deploy Test your contract: npm test If you have a frontend, run `npm start`. This will run a dev server. Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages Hello NEAR! ================================= A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. 2. There are two functions to the smart contract: `get_greeting` and `set_greeting`. 3. Tests: You can run smart contract tests with the `cargo test`. [smart contract]: https://docs.near.org/develop/welcome [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://docs.near.org/develop/prerequisites#rust-and-wasm [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"greeting":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"greeting":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"greeting":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"greeting":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`.
near-multicall_nearcon22
Cargo.toml README.md build.sh contract .cargo config.toml Cargo.toml src lib.rs core Cargo.toml src lib.rs host Cargo.toml src main.rs methods Cargo.toml build.rs guest Cargo.toml build.rs src bin provedrop.rs src lib.rs neardev dev-account.env web client README.md merkle Cargo.toml pkg drop_merkle.d.ts drop_merkle.js drop_merkle_bg.wasm.d.ts package.json src lib.rs package.json public index.html manifest.json robots.txt src constants addresses.ts routes.ts urls.ts contracts airdrop.ts logo.svg main.css near-config.ts react-app-env.d.ts reportWebVitals.ts setupTests.ts utils wallet.ts window.ts tsconfig.json webpack.config.js server Cargo.toml src main.rs
# nearcon22 Submission for the NEARCON2022 Hackerthon # Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `yarn start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. ### `yarn test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `yarn build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ### `yarn eject` **Note: this is a one-way operation. Once you `eject`, you can’t go back!** If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/).
isabella232_near-protocol-contracts
LICENSE.md README.md client Cargo.toml src lib.rs near-link-token Cargo.toml README.md src lib.rs oracle Cargo.toml README.md src lib.rs
# Oracle The [Chainlink Oracle contract](https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.6/Oracle.sol) ported to Rust. ## Testing To test run: ```bash cargo test --package oracle -- --nocapture ``` # Fungible token Example implementation of a Fungible Token Standard (NEP#21). NOTES: - The maximum balance value is limited by U128 (2\*\*128 - 1). - JSON calls should pass U128 as a base-10 string. E.g. "100". - The contract optimizes the inner trie structure by hashing account IDs. It will prevent some abuse of deep tries. Shouldn't be an issue, once NEAR clients implement full hashing of keys. - This contract doesn't optimize the amount of storage, since any account can create unlimited amount of allowances to other accounts. It's unclear how to address this issue unless, this contract limits the total number of different allowances possible at the same time. And even if it limits the total number, it's still possible to transfer small amounts to multiple accounts. ## Building To build run: ```bash ./build ``` ## Testing To test run: ```bash cargo test --package fungible-token -- --nocapture ``` # Integrating NEAR and Chainlink This repository serves to demonstrate how a smart contract on NEAR can access off-chain data using an incentivized oracle solution with fungible tokens as payments. This repository is in continual development and tracking issues [here](https://github.com/smartcontractkit/near-protocol-contracts/issues). There are a number of subdirectories in the project that represent the moving pieces of a simple oracle system. - Client Contract (The contract that wants a token price from an off-chain API) - Oracle Contract (An on-chain smart contract that accepts a fungible token payment and stores a request to be processed off-chain) - Oracle Node (An off-chain machine continuously polling the Oracle Contract on NEAR, and fulfilling requests) - **Note**: code for the Oracle Node is not included in this repository, but one can use an oracle protocol like Chainlink - Fungible Token (The token paid by the Client Contract to the Oracle Contract in exchange for getting an answer to the Client's request) ![Chainlink and NEAR diagram](assets/chainlink-diagram.png) ## Get NEAR-CLI, Rust, and set up testnet accounts We'll be using [NEAR CLI](https://docs.near.org/docs/development/near-cli), a command line tool that makes things simpler. Please have [NodeJS version 12 or greater](https://nodejs.org/en/download/package-manager/). Then install globally with: ```bash npm install -g near-cli ``` These smart contracts are written in Rust. Please follow these directions to get Rust going on your local machine. Install Rustup: ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` ([Official documentation](https://www.rust-lang.org/tools/install)) Follow the directions which includes running: ```bash source $HOME/.cargo/env ``` Add wasm target to your toolchain: ```bash rustup target add wasm32-unknown-unknown ``` ([Info on wasm32-unknown-unknown](https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/webassembly-support.html)) Rust is now ready on your machine. Next, create a NEAR testnet account with [Wallet](https://wallet.testnet.near.org). Set an environment variable to use in these examples. For instance, if your test account is `oracle.testnet` set it like so in your terminal: ```bash export NEAR_ACCT=oracle.testnet ``` (**Windows users**: please look into using `set` instead of `export`, surrounding the environment variable in `%` instead of beginning with `$`, and using escaped double-quotes `\"` where necessary instead of the single-quotes provided in these instructions.) Create sub-accounts:: ```bash near create-account oracle.$NEAR_ACCT --masterAccount $NEAR_ACCT near create-account client.$NEAR_ACCT --masterAccount $NEAR_ACCT near create-account oracle-node.$NEAR_ACCT --masterAccount $NEAR_ACCT near create-account near-link.$NEAR_ACCT --masterAccount $NEAR_ACCT ``` We've gone over the different roles earlier, but let's focus on what will happen to get a request fulfilled. **Client Contract** will call the **Oracle Contract** to make a request for external data. **Client Contract** gives the **Oracle Contract** an allowance to take NEAR LINK from it. Before officially adding the request, it will `transfer_from` to capture the payment, keeping track of this amount in the `withdrawable_token` state variable. The **Oracle Node** will be continuously polling the state of its **Oracle Contract** using the paginated `get_requests` function. The **Oracle Node** will get the API results needed, and send back the answer to the **Oracle Contract**. The **Oracle Contract** makes a cross-contract call to the callback address (NEAR account) at the callback method provided. It has now fulfilled the request and removes it from state. ## Build, deploy, and initialize Let's begin! Build the oracle, client, and NEAR LINK contracts with: ```bash ./build ``` Run all tests: ```bash ./test ``` Then deploy and instantiate like so… NEAR LINK ```bash near deploy --accountId near-link.$NEAR_ACCT --wasmFile near-link-token/res/near_link_token.wasm --initFunction new --initArgs '{"owner_id": "near-link.'$NEAR_ACCT'", "total_supply": "1000000"}' ``` Oracle contract ```bash near deploy --accountId oracle.$NEAR_ACCT --wasmFile oracle/res/oracle.wasm --initFunction new --initArgs '{"link_id": "near-link.'$NEAR_ACCT'", "owner_id": "oracle.'$NEAR_ACCT'"}' ``` Client contract ```bash near deploy --accountId client.$NEAR_ACCT --wasmFile client/res/client.wasm --initFunction new --initArgs '{"oracle_account": "oracle.'$NEAR_ACCT'"}' ``` ## Minor housekeeping Before the **oracle node** can fulfill the request, they must be authorized. We might as well do this from the get-go. ```bash near call oracle.$NEAR_ACCT add_authorization '{"node": "oracle-node.'$NEAR_ACCT'"}' --accountId oracle.$NEAR_ACCT ``` (Optional) Check authorization to confirm: ```bash near view oracle.$NEAR_ACCT is_authorized '{"node": "oracle-node.'$NEAR_ACCT'"}' ``` ## Give fungible tokens and set allowances Give 50 NEAR LINK to client: ```bash near call near-link.$NEAR_ACCT transfer '{"new_owner_id": "client.'$NEAR_ACCT'", "amount": "50"}' --accountId near-link.$NEAR_ACCT --amount .0365 ``` **Note**: above, we use the `amount` flag in order to pay for the state required. (See more about [state staking here](https://docs.near.org/docs/concepts/storage)) (Optional) Check balance to confirm: ```bash near view near-link.$NEAR_ACCT get_balance '{"owner_id": "client.'$NEAR_ACCT'"}' ``` **client contract** gives **oracle contract** allowance to spend 20 NEAR LINK on their behalf: ```bash near call near-link.$NEAR_ACCT inc_allowance '{"escrow_account_id": "oracle.'$NEAR_ACCT'", "amount": "20"}' --accountId client.$NEAR_ACCT --amount .0696 ``` (Optional) Check allowance to confirm: ```bash near view near-link.$NEAR_ACCT get_allowance '{"owner_id": "client.'$NEAR_ACCT'", "escrow_account_id": "oracle.'$NEAR_ACCT'"}' ``` ## Make a request Let's make a request to a Chainlink node and request an ETH-USD price: - Packed JSON arguments: `{"get":"https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD","path":"USD","times":100}` - Base64 encoded arguments: `eyJnZXQiOiJodHRwczovL21pbi1hcGkuY3J5cHRvY29tcGFyZS5jb20vZGF0YS9wcmljZT9mc3ltPUVUSCZ0c3ltcz1VU0QiLCJwYXRoIjoiVVNEIiwidGltZXMiOjEwMH0=` We'll show two ways to have the client contract send the oracle contract a request. First, we'll directly call the oracle contract using the key pair (i.e. keys) from the client contract. 1. **Client contract** makes a direct request to **oracle contract** with payment of 10 NEAR LINK. We can do this because we have the key pair for the client contract. ```bash near call oracle.$NEAR_ACCT request '{"payment": "10", "spec_id": "dW5pcXVlIHNwZWMgaWQ=", "callback_address": "client.'$NEAR_ACCT'", "callback_method": "token_price_callback", "nonce": "1", "data_version": "1", "data": "eyJnZXQiOiJodHRwczovL21pbi1hcGkuY3J5cHRvY29tcGFyZS5jb20vZGF0YS9wcmljZT9mc3ltPUVUSCZ0c3ltcz1VU0QiLCJwYXRoIjoiVVNEIiwidGltZXMiOjEwMH0="}' --accountId client.$NEAR_ACCT --gas 300000000000000 ``` 2. **Any NEAR account** calls the **client contract**, providing request arguments. Upon receiving this, the **client contract** sends a cross-contract call to the **oracle contract** to store the request. (Payment and other values are hardcoded here, the nonce is automatically incremented. This assumes that the **client contract** contract only wants to use one oracle contract.) ```bash near call client.$NEAR_ACCT get_token_price '{"symbol": "eyJnZXQiOiJodHRwczovL21pbi1hcGkuY3J5cHRvY29tcGFyZS5jb20vZGF0YS9wcmljZT9mc3ltPUVUSCZ0c3ltcz1VU0QiLCJwYXRoIjoiVVNEIiwidGltZXMiOjEwMH0=", "spec_id": "dW5pcXVlIHNwZWMgaWQ="}' --accountId client.$NEAR_ACCT --gas 300000000000000 ``` ## View pending requests The oracle node is continually polling the state of the **oracle contract** to see the paginated request _summary_. This shows which accounts have requests pending and the total amount of pending requests: ```bash near view oracle.$NEAR_ACCT get_requests_summary '{"max_num_accounts": "10"}' ``` **Note**: aside from `get_requests_summary` there is also `get_requests_summary_from`. Since the [`TreeMap` data structure](https://docs.rs/near-sdk/1.0.0/near_sdk/collections/struct.TreeMap.html) is ordered, the former will list the first N (`max_num_accounts`). Usage of `get_requests_summary_from` is for paging, providing a window of results to return. Please see function details for parameters and usage. For folks who prefer to see a more low-level approach to hitting the RPC, here's the [curl](https://en.wikipedia.org/wiki/CURL) command performing the same query: ```bash curl -d '{"jsonrpc": "2.0", "method": "query", "id": "chainlink", "params": {"request_type": "call_function", "finality": "final", "account_id": "oracle.'$NEAR_ACCT'", "method_name": "get_requests_summary", "args_base64": "eyJtYXhfbnVtX2FjY291bnRzIjogIjEwIn0="}}' -H 'Content-Type: application/json' https://rpc.testnet.near.org ``` The above will return something like: ```json { "jsonrpc": "2.0", "result": { "result": [ 91, 123, 34, 97, 99, 99, 111, 117, 110, 116, 34, 58, 34, 99, 108, 105, 101, 110, 116, 46, 100, 101, 109, 111, 46, 116, 101, 115, 116, 110, 101, 116, 34, 44, 34, 116, 111, 116, 97, 108, 95, 114, 101, 113, 117, 101, 115, 116, 115, 34, 58, 49, 125, 93 ], "logs": [], "block_height": 10551293, "block_hash": "Ljh67tYk5bGXPu9TamJNG4vHp18cEBDxebKHpEUeZEo" }, "id": "chainlink" } ``` We'll outline a quick way to see the results if the machine has [Python installed](https://docs.python-guide.org/starting/install3/osx/). Copy the value of the innermost `result` key, which is an array of unsigned 8-bit integers. Open the Python REPL with the command `python` and see the prompt with `>>>`. Enter the below replacing BYTE_ARRAY with the the innermost result value (including the square brackets): ```python res = BYTE_ARRAY ``` then: ```python ''.join(chr(x) for x in res) ``` and python will print something like: ```text '[{"account":"client.demo.testnet","total_requests":1}]' ``` The previous command (calling the method `get_requests_summary`) is useful if there has been significant scaling from many client accounts/contracts. To see the individual requests for a particular user, use the following command: ```bash near view oracle.$NEAR_ACCT get_requests '{"account": "client.'$NEAR_ACCT'", "max_requests": "10"}' ``` The **oracle node** uses the passed request arguments to fetch the price of (for example) Basic Attention Token (BAT) and finds it is at \$0.19 per token. The data `0.19` as a `Vec<u8>` is `MTkuMQ==` There's a third method to get all the requests, ordered by account name and nonce, where a specified maximum number of results is provided. ```bash near view oracle.$NEAR_ACCT get_all_requests '{"max_num_accounts": "100", "max_requests": "100"}' ``` ## Fulfill the request **Oracle Node** uses its NEAR account keys to fulfill the request: ```bash near call oracle.$NEAR_ACCT fulfill_request '{"account": "client.'$NEAR_ACCT'", "nonce": "0", "data": "MTkuMQ=="}' --accountId oracle-node.$NEAR_ACCT --gas 300000000000000 ``` (Optional) Check the **client contract** for the values it has saved: ```bash near view client.$NEAR_ACCT get_received_vals '{"max": "100"}' ``` ## Check final balance/allowance (Optional) Check the balance of **client contract**: ```bash near view near-link.$NEAR_ACCT get_balance '{"owner_id": "client.'$NEAR_ACCT'"}' ``` Expect `40` (Optional) Check the allowance of **oracle contract**: ```bash near view near-link.$NEAR_ACCT get_allowance '{"owner_id": "client.'$NEAR_ACCT'", "escrow_account_id": "oracle.'$NEAR_ACCT'"}' ``` Expect `10` The oracle node and oracle contract are assumed to be owned by the same person/entity. The oracle contract has "withdrawable tokens" that can be taken when it's most convenient. Some oracles may choose to transfer these tokens immediately after fulfillment. Here we are using the withdrawable pattern, where gas is conserved by not transferring after each request fulfillment. Also, when the feature of cancelling requests is implemented, the withdrawable tokens is used to ensure the correct amount of fungible tokens can be withdrawn without interfering with possible cancellations within a given period. ## Withdraw tokens (Optional) Check the withdrawable tokens on the oracle contract with this command: ```bash near view oracle.$NEAR_ACCT get_withdrawable_tokens ``` (Optional) Check the fungible token balance of the client and the base account we'll be extracting to it. (This is the original account we set the `NEAR_ACCT` environment variable to, for demonstration purposes) ```bash near view near-link.$NEAR_ACCT get_balance '{"owner_id": "oracle.'$NEAR_ACCT'"}' near view near-link.$NEAR_ACCT get_balance '{"owner_id": "'$NEAR_ACCT'"}' ``` Finally, withdraw the fungible tokens from the oracle contract into the oracle node, the base account, who presumably owns both the oracle node and oracle contract. ```bash near call oracle.$NEAR_ACCT withdraw '{"recipient": "oracle-node.'$NEAR_ACCT'", "amount": "10"}' --accountId oracle.$NEAR_ACCT --gas 300000000000000 ``` You may use the previous two `get_balance` view methods to confirm that the fungible tokens have indeed been withdrawn. ## Notes The client is responsible for making sure there is enough allowance for fungible token transfers. It may be advised to add a cushion in addition to expected fungible token transfers as duplicate requests will also decrease allowance. **Scenario**: a client accidentally sends the same request or a request with the same nonce. The fungible token transfer occurs, decrementing the allowance on the fungible token contract. Then it is found that it's a duplicate, and the fungible tokens are returned. In this case, the allowance will not be increased as this can only be done by the client itself. One way to handle this is for the client to have logic to increase the allowance if it receives the response indicating a duplicate request has been sent. Another way might be to increase the allowance before each request. Again, this decision is up to the owner of the client contract. ## Outstanding work There are various issues opened in this repository. As mentioned early in this document, this is an ever-growing repository. Soon we'll implement using the expiration to allow the client contract to cancel their request and receive the tokens back if it's within the window. There's also work in terms of setting up the [PreCoordinator](https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.5/PreCoordinator.sol) and whatnot. Contributors are welcome to get involved!
mtengineer90_NearDeveloper1
README.md as-pect.config.js asconfig.json package.json scripts 1.dev-deploy.sh 2.use-contract.sh 3.cleanup.sh README.md src as_types.d.ts simple __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts singleton __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts tsconfig.json utils.ts
## Setting up your terminal The scripts in this folder are designed to help you demonstrate the behavior of the contract(s) in this project. It uses the following setup: ```sh # set your terminal up to have 2 windows, A and B like this: ┌─────────────────────────────────┬─────────────────────────────────┐ │ │ │ │ │ │ │ A │ B │ │ │ │ │ │ │ └─────────────────────────────────┴─────────────────────────────────┘ ``` ### Terminal **A** *This window is used to compile, deploy and control the contract* - Environment ```sh export CONTRACT= # depends on deployment export OWNER= # any account you control # for example # export CONTRACT=dev-1615190770786-2702449 # export OWNER=sherif.testnet ``` - Commands _helper scripts_ ```sh 1.dev-deploy.sh # helper: build and deploy contracts 2.use-contract.sh # helper: call methods on ContractPromise 3.cleanup.sh # helper: delete build and deploy artifacts ``` ### Terminal **B** *This window is used to render the contract account storage* - Environment ```sh export CONTRACT= # depends on deployment # for example # export CONTRACT=dev-1615190770786-2702449 ``` - Commands ```sh # monitor contract storage using near-account-utils # https://github.com/near-examples/near-account-utils watch -d -n 1 yarn storage $CONTRACT ``` --- ## OS Support ### Linux - The `watch` command is supported natively on Linux - To learn more about any of these shell commands take a look at [explainshell.com](https://explainshell.com) ### MacOS - Consider `brew info visionmedia-watch` (or `brew install watch`) ### Windows - Consider this article: [What is the Windows analog of the Linux watch command?](https://superuser.com/questions/191063/what-is-the-windows-analog-of-the-linuo-watch-command#191068) # `near-sdk-as` Starter Kit This is a good project to use as a starting point for your AssemblyScript project. ## Samples This repository includes a complete project structure for AssemblyScript contracts targeting the NEAR platform. The example here is very basic. It's a simple contract demonstrating the following concepts: - a single contract - the difference between `view` vs. `change` methods - basic contract storage There are 2 AssemblyScript contracts in this project, each in their own folder: - **simple** in the `src/simple` folder - **singleton** in the `src/singleton` folder ### Simple We say that an AssemblyScript contract is written in the "simple style" when the `index.ts` file (the contract entry point) includes a series of exported functions. In this case, all exported functions become public contract methods. ```ts // return the string 'hello world' export function helloWorld(): string {} // read the given key from account (contract) storage export function read(key: string): string {} // write the given value at the given key to account (contract) storage export function write(key: string, value: string): string {} // private helper method used by read() and write() above private storageReport(): string {} ``` ### Singleton We say that an AssemblyScript contract is written in the "singleton style" when the `index.ts` file (the contract entry point) has a single exported class (the name of the class doesn't matter) that is decorated with `@nearBindgen`. In this case, all methods on the class become public contract methods unless marked `private`. Also, all instance variables are stored as a serialized instance of the class under a special storage key named `STATE`. AssemblyScript uses JSON for storage serialization (as opposed to Rust contracts which use a custom binary serialization format called borsh). ```ts @nearBindgen export class Contract { // return the string 'hello world' helloWorld(): string {} // read the given key from account (contract) storage read(key: string): string {} // write the given value at the given key to account (contract) storage @mutateState() write(key: string, value: string): string {} // private helper method used by read() and write() above private storageReport(): string {} } ``` ## Usage ### Getting started (see below for video recordings of each of the following steps) INSTALL `NEAR CLI` first like this: `npm i -g near-cli` 1. clone this repo to a local folder 2. run `yarn` 3. run `./scripts/1.dev-deploy.sh` 3. run `./scripts/2.use-contract.sh` 4. run `./scripts/2.use-contract.sh` (yes, run it to see changes) 5. run `./scripts/3.cleanup.sh` ### Videos **`1.dev-deploy.sh`** This video shows the build and deployment of the contract. [![asciicast](https://asciinema.org/a/409575.svg)](https://asciinema.org/a/409575) **`2.use-contract.sh`** This video shows contract methods being called. You should run the script twice to see the effect it has on contract state. [![asciicast](https://asciinema.org/a/409577.svg)](https://asciinema.org/a/409577) **`3.cleanup.sh`** This video shows the cleanup script running. Make sure you add the `BENEFICIARY` environment variable. The script will remind you if you forget. ```sh export BENEFICIARY=<your-account-here> # this account receives contract account balance ``` [![asciicast](https://asciinema.org/a/409580.svg)](https://asciinema.org/a/409580) ### Other documentation - See `./scripts/README.md` for documentation about the scripts - Watch this video where Willem Wyndham walks us through refactoring a simple example of a NEAR smart contract written in AssemblyScript https://youtu.be/QP7aveSqRPo ``` There are 2 "styles" of implementing AssemblyScript NEAR contracts: - the contract interface can either be a collection of exported functions - or the contract interface can be the methods of a an exported class We call the second style "Singleton" because there is only one instance of the class which is serialized to the blockchain storage. Rust contracts written for NEAR do this by default with the contract struct. 0:00 noise (to cut) 0:10 Welcome 0:59 Create project starting with "npm init" 2:20 Customize the project for AssemblyScript development 9:25 Import the Counter example and get unit tests passing 18:30 Adapt the Counter example to a Singleton style contract 21:49 Refactoring unit tests to access the new methods 24:45 Review and summary ``` ## The file system ```sh ├── README.md # this file ├── as-pect.config.js # configuration for as-pect (AssemblyScript unit testing) ├── asconfig.json # configuration for AssemblyScript compiler (supports multiple contracts) ├── package.json # NodeJS project manifest ├── scripts │   ├── 1.dev-deploy.sh # helper: build and deploy contracts │   ├── 2.use-contract.sh # helper: call methods on ContractPromise │   ├── 3.cleanup.sh # helper: delete build and deploy artifacts │   └── README.md # documentation for helper scripts ├── src │   ├── as_types.d.ts # AssemblyScript headers for type hints │   ├── simple # Contract 1: "Simple example" │   │   ├── __tests__ │   │   │   ├── as-pect.d.ts # as-pect unit testing headers for type hints │   │   │   └── index.unit.spec.ts # unit tests for contract 1 │   │   ├── asconfig.json # configuration for AssemblyScript compiler (one per contract) │   │   └── assembly │   │   └── index.ts # contract code for contract 1 │   ├── singleton # Contract 2: "Singleton-style example" │   │   ├── __tests__ │   │   │   ├── as-pect.d.ts # as-pect unit testing headers for type hints │   │   │   └── index.unit.spec.ts # unit tests for contract 2 │   │   ├── asconfig.json # configuration for AssemblyScript compiler (one per contract) │   │   └── assembly │   │   └── index.ts # contract code for contract 2 │   ├── tsconfig.json # Typescript configuration │   └── utils.ts # common contract utility functions └── yarn.lock # project manifest version lock ``` You may clone this repo to get started OR create everything from scratch. Please note that, in order to create the AssemblyScript and tests folder structure, you may use the command `asp --init` which will create the following folders and files: ``` ./assembly/ ./assembly/tests/ ./assembly/tests/example.spec.ts ./assembly/tests/as-pect.d.ts ```
intellichain555_Varda_nft_Staking
.vs ProjectSettings.json VSWorkspaceState.json README.md docs css animate.css bbp-theme.css bbpress.css bootstrap-timepicker.css bootstrap.min.css buddypress-theme.css buddypress.css colors 20 color scheme.txt c1.css c10.css c11.css c12.css c13.css c14.css c15.css c16.css c17.css c18.css c19.css c2.css c20.css c3.css c4.css c5.css c6.css c7.css c8.css c9.css example.css flaticon.css font-awesome.min.css icomoon.css jquery-ui.min.css jquery.bxslider.css jquery.fullPage.css jquery.gridder.min.css jquery.pagepiling.css jquery.sidr.dark.css jquery.timepicker.css lightbox.css magnific-popup.css main.css media-queries.css multiscroll.css onepage-scroll.css owl.carousel.css prettyPhoto.css selectize.default.css supersized.css fonts flaticons flaticon.html flaticon.svg fontawesome-webfont.svg mission-script mission-script-webfont.svg img misc vault.svg index.html js app.js bootstrap-progressbar.min.js bootstrap-timepicker.js bootstrap.min.js form.min.js img-filter jquery.gray.min.js jflickrfeed.min.js jquery-countTo.js jquery-migrate.min.js jquery-ui.min.js jquery-validation.min.js jquery.appear.js jquery.backstretch.min.js jquery.bxslider.min.js jquery.circliful.min.js jquery.countdown.js jquery.easing.min.js jquery.easypiechart.js jquery.fullPage.min.js jquery.isotope.min.js jquery.magnific-popup.min.js jquery.mb.YTPlayer.js jquery.multiscroll.min.js jquery.nav.js jquery.nicescroll.min.js jquery.pagepiling.min.js jquery.parallax-1.1.3.js jquery.prettySocial.min.js jquery.scrollNav.min.js jquery.selectbox-0.2.min.js jquery.singlePageNav.min.js jquery.stellar.min.js jquery.superslides.min.js jquery.ticker.js jquery.timepicker.min.js jquery.tubular.1.0.js jquery.webticker.min.js jquery.zoom.min.js kenburned.min.js lightbox.min.js main.js masonry.pkgd.js mediaelement-and-player.min.js okvideo.min.js owl.carousel.min.js particles.min.js selectize.min.js supersized.3.2.7.min.js theme supersized.shutter.css supersized.shutter.min.js tweetie.min.js vendor jquery-1.11.1.min.js modernizr-2.6.2.min.js owl.carousel.css owl.carousel.min.js wow.min.js shortcodes css camera.css eislideshow.css elastislide.css flexslider.css fonts flexslider-icon.svg glyphicons-halflings-regular.svg icomoon.svg iconmoon.css liteaccordion.css main.css media-queries.css nivo-slider.css owl.carousel.css prettyPhoto.css slicebox.css fonts flexslider-icon.svg glyphicons-halflings-regular.svg icomoon.svg images camera slides thumbs _notes dwsync.xml js camera.min.js jquery.eislideshow.js jquery.flexslider-min.js jquery.nivo.slider.pack.js jquery.prettyPhoto.js jquery.slicebox.min.js jquery.zaccordion.min.js main.js owl.carousel.js syntax-highlighter scripts prettify.min.css prettify.min.js Header Top navbar nav nav4 Mega Menu Header 2 Header 6 Header 14 header 15 header 16 header 17 index 18 vertical nav header19 Header 21 Header 22 Header 23 Header 24 Home 25 Header 25 Header 27 Home 27 Header 28 Home 28 Dropdown Timeline Blog Post Comment Section Right SIdebar Related Products compare page Shop Header Shop Intro shop 2 product single Promo Block Product shop list view Look book top-nav type 3 End top-nav photography Home Shop 3 utils definition addOptionMethod plugin bridge bridget module definition helpers measurements setup box sizing getSize match appendToFragment query matchChild matchesSelector get style Outlayer definition CSS3 support Item transition events show hide remove transport vars Outlayer init & layout ignore & stamps resize methods destroy data create Outlayer class declarative jQuery bridge fin masonryDefinition market-contract Cargo.toml README.md build.bat build.sh src external.rs internal.rs lib.rs nft_callbacks.rs sale.rs sale_views.rs target .rustc_info.json release .fingerprint Inflector-eefff05c7d46c877 lib-inflector.json borsh-derive-b491eae712100637 lib-borsh-derive.json borsh-derive-internal-72394e1757885ab2 lib-borsh-derive-internal.json borsh-schema-derive-internal-610ba8b50147dd31 lib-borsh-schema-derive-internal.json near-sdk-macros-96eb3ea3f23a1879 lib-near-sdk-macros.json proc-macro-crate-2823ff77b3ab6fb0 lib-proc-macro-crate.json proc-macro2-4030cb0f8c968e50 run-build-script-build-script-build.json proc-macro2-67c2de1ec123e26d build-script-build-script-build.json proc-macro2-f946fa795ebef0fc lib-proc-macro2.json quote-80e58a7b551e88bc build-script-build-script-build.json quote-910bca9e52506b04 run-build-script-build-script-build.json quote-9d85468741da81ac lib-quote.json serde-0ecebeb49c0e6335 build-script-build-script-build.json serde-7f3251c34bb0e02e build-script-build-script-build.json serde-cc24184094fb238c run-build-script-build-script-build.json serde-fe5cddac00626071 lib-serde.json serde_derive-230cba5644c25c81 build-script-build-script-build.json serde_derive-cf9f6279aa29830d run-build-script-build-script-build.json serde_derive-eae167c48591007c lib-serde_derive.json serde_json-f8f7e43b70d39d1e build-script-build-script-build.json syn-54b76c2546894437 run-build-script-build-script-build.json syn-6f58dc400523ff1c build-script-build-script-build.json syn-9750a38c8ce5104f lib-syn.json toml-4386a44d29578f9a lib-toml.json unicode-ident-3dd42b73067f241c lib-unicode-ident.json wee_alloc-56f41bf66950ca1a build-script-build-script-build.json wasm32-unknown-unknown release .fingerprint ahash-3f602f2bb35305d5 lib-ahash.json base64-0266aaf2a36d6a95 lib-base64.json borsh-a5de240548f9615f lib-borsh.json bs58-f4b2e40280ca61bd lib-bs58.json cfg-if-4b6f1020c71c4854 lib-cfg-if.json hashbrown-452902ff07dbf6b7 lib-hashbrown.json itoa-1c3a7055d9d395f5 lib-itoa.json market_contract-6e15390f7cc1997f lib-market_contract.json memory_units-a3e83b33528dff62 lib-memory_units.json near-sdk-d48ba8b94c8a3427 lib-near-sdk.json near-sys-618ec7eacf1f9b09 lib-near-sys.json ryu-2d389de58ee6911b lib-ryu.json serde-e9deb7b197c996be run-build-script-build-script-build.json serde-ea12001a2526a1bf lib-serde.json serde_json-9dcdc1d3acc3006e lib-serde_json.json serde_json-e4724fc972c3e70a run-build-script-build-script-build.json wee_alloc-034861dc56ef4c30 run-build-script-build-script-build.json wee_alloc-deb6b3e0ff371f74 lib-wee_alloc.json build wee_alloc-034861dc56ef4c30 out wee_alloc_static_array_backend_size_bytes.txt neardev dev-account.env nft-contract Cargo.toml README.md build.bat build.sh compile.js src approval.rs auction.rs auction_view.rs enumeration.rs events.rs external.rs internal.rs lib.rs metadata.rs mint.rs nft_auction_callback.rs nft_callbacks.rs nft_core.rs royalty.rs sale.rs sale_views.rs utils.rs test.sh package-lock.json package.json public index.html logo-white.7fec831f.svg logo-white.c927fc35.svg near-logo.ae93346c.svg src.e31bb0bc.css src App.css App.js ArtDetails.js Collections.js Modals ModalBuy.js ModalSale.js ModalTransferNFT.js assets custom-styles.css logo-black.svg logo-white.svg near-logo.svg near_icon.svg near_logo_wht.svg config.js fonts OFL.txt README.txt index.html index.js utils.js
# TBD nft-mint-frontend Smart Contract ================== A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard Rust tests using [cargo] with a `--nocapture` flag so that you can see any debug info you print to the console. [smart contract]: https://docs.near.org/docs/develop/contracts/overview [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://github.com/near/near-sdk-rs#pre-requisites [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html ======= This marketplace is published under MIT license, so you can clone an use it as you like, here are the instructions to run it and the info about the Varda project. If you need help setting up the project consider [buying my NFTs here](https://paras.id/jilt.near/creation) to get a free setup of the marketplace on your favourite hosting. Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install dependencies: `yarn install` 3. Run the local development server: `yarn dev` (see `package.json` for a full list of `scripts` you can run with `yarn`) Now you'll have a local development environment backed by the NEAR TestNet! Go ahead and play with the app and the code. As you make code changes, the app will automatically reload. Exploring The Code ================== 1. The "backend" code lives in the `/contract` folder. See the README there for more info. 2. The frontend code lives in the `/src` folder. `/src/index.html` is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and the smart contract. See `contract/README` for info about how it's tested. The frontend code gets tested with [jest]. You can run both of these at once with `yarn run test`. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally: yarn install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `nft-mint-frontend.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `nft-mint-frontend.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account nft-mint-frontend.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'nft-mint-frontend.YOUR-NAME.testnet' Step 3: deploy! --------------- One command: yarn deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contract to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. Step 4: initialize the contract ------------------------------- `near call $NFT_CONTRACT_ID new_default_meta '{"owner_id": "'$NFT_CONTRACT_ID'"}' --accountId $NFT_CONTRACT_ID` Step 5: remember to allow minting to the artists near account for them to be able to mint `near call $NFT_CONTRACT_ID allow_minting_access '{"account_id": "xxx.near"}' --accountId $NFT_CONTRACT_ID` And on the allowlist constant in app.js line 53 thanks to [Ben Kurrek](https://github.com/BenKurrek) for his contribution to this part of the code. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [React]: https://reactjs.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages >>>>>>> 4f7a76af9674e39c244036d8c80c7beeee5f9bca # Varda NFT market implementation Using the PoC backbone for NFT Marketplaces on NEAR Protocol. [Reference](https://nomicon.io/Standards/NonFungibleToken/README.html) ## ToDo: - [ ] add stNEAR as a trading ft - [ ] implement [Narwallet](https://narwallets.github.io/meta-pool/) with Varda Vault NEARNFT dispay for unlockable content ## Varda strategy game and staking mechanics explained [![Varda strategy game and staking mechanics explained](https://img.youtube.com/vi/xM8EhLeGOEI/0.jpg)](https://www.youtube.com/watch?v=xM8EhLeGOEI) ## Varda cultural reference [![Varda cultural reference](https://img.youtube.com/vi/6rOkVq8qPrs/0.jpg)](https://www.youtube.com/watch?v=6rOkVq8qPrs) [Varda Tokenomics](https://varda-vision.medium.com/) ## Progress: - [x] basic purchase of NFT with FT - [x] demo pay out royalties (FTs and NEAR) - [x] test and determine standards for markets (best practice?) to buy/sell NFTs (finish standard) with FTs (already standard) - [x] demo some basic auction types, secondary markets and - [x] frontend example - [x] first pass / internal audit - [ ] connect with bridged tokens e.g. buy and sell with wETH/nDAI (or whatever we call these) - [ ] add ability to migrate NFT to ethereum blockchain using rainbowbridge/aurora ## Notes: High level diagram of NFT sale on Market using Fungible Token: ![image](https://user-images.githubusercontent.com/321340/113903355-bea71e80-9785-11eb-8ab3-9c2f0d23466f.png) Remove the FT steps for NEAR transfers (but nft_transfer_payout and resolve_purchase still the same). Differences from `nft-simple` NFT standard reference implementation: - anyone can mint an NFT - Optional token_type - capped supply by token_type - lock transfers by token_token - enumerable.rs ## Working **Frontend App Demo: `/test/app.test.js/`** - install, deploy, test `yarn && yarn test:deploy` - run app - `yarn start` **App Tests: `/test/app.test.js/`** - install, deploy, test `yarn && yarn test:deploy` - if you update contracts - `yarn test:deploy` - if you update tests only - `yarn test` # NFT Specific Notes Associated Video Demos (most recent at top) [![NEAR Protocol - Demo NFT Marketplace Walkthough](https://img.youtube.com/vi/AevmMAtkIr4/0.jpg)](https://www.youtube.com/watch?v=AevmMAtkIr4) [![Live App Review 19 - NFT Marketplace with Fungible Token Transfers and Royalty Distribution](https://img.youtube.com/vi/sGTC3rs8OJQ/0.jpg)](https://youtu.be/sGTC3rs8OJQ) Some additional ideas around user onboarding: [![NEAR Protocol - NFT Launcher & Easy User Onboarding Demo - Hackathon Starter Kit!](https://img.youtube.com/vi/59Lzt1PFF6I/0.jpg)](https://www.youtube.com/watch?v=59Lzt1PFF6I) # Detailed Installation / Quickstart #### If you don't have Rust Install Rust https://rustup.rs/ #### If you have never used near-cli 1. Install near-cli: `npm i -g near-cli` 2. Create testnet account: [Wallet](https://wallet.testnet.near.org) 3. Login: `near login` #### Installing and Running Tests for this Example 1. Install everything: `yarn && (cd server && yarn)` 2. Deploy the contract and run the app tests: `yarn test:deploy` 3. (WIP) Start server and run server tests: `cd server && yarn start` then in another terminal from the root `yarn test:server` #### Notes - If you ONLY change the JS tests use `yarn test`. - If you change the contract run `yarn test:deploy` again. - If you run out of funds in the dev account run `yarn test:deploy` again. - If you change the dev account (yarn test:deploy) the server should restart automatically, but you may need to restart the app and sign out/in again with NEAR Wallet. ### Moar Context There's 3 main areas to explore: - frontend app - shows how to create guest accounts that are added to the app contract via the nodejs server. Guests can mind NFTs, put them up for sale and earn NEAR tokens. When the guest has NEAR they can upgrade their account to a full account. - app.test.js (demos frontend only tests) ### Owner Account, Token Account, etc... The tests are set up to auto generate the dev account each time you run `test:deploy` **e.g. you will get a new NFT contract address each time you run a test**. This is just for testing. You can obviously deploy a token to a fixed address on testnet / mainnet, it's an easy config update. #### Guests Account (key and tx gas sponsorship) When you run app / server tests. There's a contract deployed and a special account created `guests.OWNER_ACCOUNT_ID` to manage the sponsored users (the ones you will pay for gas fees while onboarding). This special "guests" account is different from the test guest account `bob.TOKEN_ID.OWNER_ACCOUNT_ID`. It is an account, different from the owner or token accounts, that manages the guests keys. #### Guest Accounts The guest users can `claim_drop, ft_transfer_guest` and receive tokens from other users, e.g. in the server tests the owner transfers tokens to the guest account via API call and using client side code. Then, following the server tests, the guest transfers tokens to alice (who is a real NEAR account e.g. she pays her own gas). Finally, the guest upgrades themselves to a real NEAR account, something demoed in the video. It's a lot to digest but if you focus on the `/test/app.test.js` you will start to see the patterns. # Background One of the issues with onboarding new users to crypto is that they need to have crypto to do anything e.g. mint an NFT. A creator, artist or community might want to drop a bunch of free minting options to their fans for them to mint user generated content, but the audience has (1) no crypto to pay for fees (2) no wallet (3) no concept of crypto or blockchain; prior to the drop. So let's solve these issues by allowing users to generate content the traditional Web2 way! We do a demo of creating a "guest" named account for an app where the gas fees are sponsored by a special app account called "guests.APP_NAME.near". The guest account doesn't exist (sometimes called a virtual or contract account) until the user creates and sells and NFT that generates some NEAR tokens and then they can upgrade to a real account. Until then their name is reserved because only the app is able to create "USERNAME.APP_NAME.near". This has many advantages for user onboarding, where users can use the app immediately and later can be upgraded to a full account. The users also don't have to move any assets - namely the fungible tokens they earned as a guest user. ## Installation Beyond having npm and node (latest versions), you should have Rust installed. I recommend nightly because living on the edge is fun. https://rustup.rs/ Also recommend installing near-cli globally `npm i -g near-cli` Everything else can be installed via: `yarn` `cd server && yarn` ## NEAR Config There is only one config.js file found in `src/config.js`, this is also used for running tests. Using `src/config.js` you can set up your different environments. Use `REACT_APP_ENV` to switch environments e.g. in `package.json` script `deploy`. ## Running Tests You can run unit tests in the Rust contracts themselves, but it may be more useful to JS tests against testnet itself. Note: to run the app and server tests make sure you install and start the server. - cd server - yarn && yarn start Commands: - `test` will simply run app tests against the contract already deployed. You can mess around with `app.test.js` and try different frontend stuff - `test:deploy` - will deploy a new dev account (`/neardev`) and deploy a new contract to this account, then run `test` - `test:server` - will test the server, make sure you start it (see "Note" above) - `test:unit` - runs the rust unit tests If you've changed your contract or your dev account has run out of funds use `test:deploy`, if you're updating your JS tests only then use `test`. ## Test Utils There are helpers in `test/test-utils.js` that take care of: 1. creating a near connection and establishing a keystore for the dev account 2. creating test accounts each time a test is run 3. establishing a contract instance so you can call methods You can change the default funding amount for test accounts in `src/config.js` ## Using the NEAR Config in your app In `src/state/near.js` you will see that `src/config.js` is loaded as a function. This is to satisfy the jest/node test runner. You can destructure any properies of the config easily in any module you import it in like this: ``` // example file app.js import getConfig from '../config'; export const { GAS, networkId, nodeUrl, walletUrl, nameSuffix, contractName, } = getConfig(); ``` Note the export const in the destructuring? Now you can import these like so: ``` //example file Component.js import { GAS } from '../app.js' ... await contract.withdraw({ amount: parseNearAmount('1') }, GAS) ... ``` # React 17, Parcel with useContext and useReducer - Bundled with Parcel 2.0 (@next) && eslint - *Minimal all-in-one state management with async/await support* ## Getting Started: State Store & useContext >The following steps describe how to use `src/utils/state` to create and use your own `store` and `StateProvider`. 1. Create a file e.g. `/state/app.js` and add the following code ```js import { State } from '../utils/state'; // example const initialState = { app: { mounted: false } }; export const { store, Provider } = State(initialState); ``` 2. Now in your `index.js` wrap your `App` component with the `StateProvider` ```js import { Provider } from './state/app'; ReactDOM.render( <Provider> <App /> </Provider>, document.getElementById('root') ); ``` 3. Finally in `App.js` you can `useContext(store)` ```js const { state, dispatch, update } = useContext(store); ``` ## Usage in Components ### Print out state values ```js <p>Hello {state.foo && state.foo.bar.hello}</p> ``` ### Update state directly in component functions ```js const handleClick = () => { update('clicked', !state.clicked); }; ``` ### Dispatch a state update function (action listener) ```js const onMount = () => { dispatch(onAppMount('world')); }; useEffect(onMount, []); ``` ## Dispatched Functions with context (update, getState, dispatch) When a function is called using dispatch, it expects arguments passed in to the outer function and the inner function returned to be async with the following json args: `{ update, getState, dispatch }` Example of a call: ```js dispatch(onAppMount('world')); ``` All dispatched methods **and** update calls are async and can be awaited. It also doesn't matter what file/module the functions are in, since the json args provide all the context needed for updates to state. For example: ```js import { helloWorld } from './hello'; export const onAppMount = (message) => async ({ update, getState, dispatch }) => { update('app', { mounted: true }); update('clicked', false); update('data', { mounted: true }); await update('', { data: { mounted: false } }); console.log('getState', getState()); update('foo.bar', { hello: true }); update('foo.bar', { hello: false, goodbye: true }); update('foo', { bar: { hello: true, goodbye: false } }); update('foo.bar.goodbye', true); await new Promise((resolve) => setTimeout(() => { console.log('getState', getState()); resolve(); }, 2000)); dispatch(helloWorld(message)); }; ``` ## Prefixing store and Provider The default names the `State` factory method returns are `store` and `Provider`. However, if you want multiple stores and provider contexts you can pass an additional `prefix` argument to disambiguate. ```js export const { appStore, AppProvider } = State(initialState, 'app'); ``` ## Performance and memo The updating of a single store, even several levels down, is quite quick. If you're worried about components re-rendering, use `memo`: ```js import React, { memo } from 'react'; const HelloMessage = memo(({ message }) => { console.log('rendered message'); return <p>Hello { message }</p>; }); export default HelloMessage; ``` Higher up the component hierarchy you might have: ```js const App = () => { const { state, dispatch, update } = useContext(appStore); ... const handleClick = () => { update('clicked', !state.clicked); }; return ( <div className="root"> <HelloMessage message={state.foo && state.foo.bar.hello} /> <p>clicked: {JSON.stringify(state.clicked)}</p> <button onClick={handleClick}>Click Me</button> </div> ); }; ``` When the button is clicked, the component HelloMessage will not re-render, it's value has been memoized (cached). Using this method you can easily prevent performance intensive state updates in further down components until they are neccessary. Reference: - https://reactjs.org/docs/context.html - https://dmitripavlutin.com/use-react-memo-wisely/
huynguyen1212_spk-frontend
README.md internals generators components index.js containers index.js index.js scripts extract-language.js package.json public index.html manifest.json robots.txt server.js src api axios.ts url.ts assets images check-solid.svg home preloader.svg img-error.svg languages en.json vi.json components Call jitsi.ts Loading icon-loading.svg configs names.ts containers Advisors store actions.ts constants.ts message-trans.ts reducers.ts selecters.ts types.ts style index.ts App store actions.ts constants.ts reducers.ts selecters.ts types.ts Booking store actions.ts constants.ts message-trans.ts reducers.ts selecters.ts types.ts style index.ts Home data index.ts message.ts store actions.ts constants.ts reducers.ts types.ts styles index.ts Layout store actions.ts constants.ts message-trans.ts reducers.ts selecters.ts types.ts style index.ts Meeting store actions.ts constants.ts message-trans.ts reducers.ts selecters.ts types.ts style index.ts Students store actions.ts constants.ts message-trans.ts reducers.ts selecters.ts types.ts style index.ts helpers index.ts regex.ts translate.ts hooks useCountRenders.ts useDetectClickOutSide.ts useModal.ts useScrollTop.ts near-interface.js react-app-env.d.ts redux root-reducers.ts store.js useInjectReducer.ts reportWebVitals.ts serviceWorker.ts setupTests.ts styles fonts.css readme.md theme.ts tsconfig.json
# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `yarn start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. ### `yarn test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `yarn build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ### `yarn eject` **Note: this is a one-way operation. Once you `eject`, you can’t go back!** If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/).
MartinTale_deadly-affection
.env README.md block.svg compare.js externs.js index.html near-api-js.min.js package-lock.json package.json smart-contract.ts split-3.svg src components button.ts external-link.ts link-setting.ts modal.ts music.ts screens.ts toggle-setting.ts data levels.ts entities base.ts block.ts collectable.ts empty.ts end.ts split.ts start.ts tunnel.ts turn-one-side.ts turn-two-sides.ts helpers particles.ts redom.ts svgs.ts utilities.ts index.ts screens game.ts levels.ts systems coil.ts game.ts near.ts play.ts state.ts zzfx.ts zzfxm.ts styles.css tsconfig.json tunnel.svg turn-one-side.svg turn-two-sides.svg vite.config.ts
Deadly Affection is a puzzle game where you (Necromancer) long for eternal love with Fairy but only Death is eternal so you bring her to your realm. # How to Play Rotate tiles and pipes using left/right click to target death beam from Necromancer to Fairy. Collect hearts along the way for bonus challenge. # NEAR You can log in with NEAR to - see and access your previous purchases; - unlock/buy 3 extra levels; - leave a tip; - and see your transaction history stored on the blockchain. # Arcadia You can log in to - see and use your Arcadians; - or pick one of the randomly selected Arcadians; - picking Arcadian changes the theme/colors of the game and UI and uses selected Arcadian as the main character. # OP Games - Interoperable - the game uses NFTs that can be used as main characters, in addition to completely changing the theme/atmosphere of the game - Open Source - the game is open source and publicly available on GitHub - Unstoppable - - I'm working on a level editor for the game that anyone will be able to use and share their levels to be played by all others - - There wasn't space for it within 13kb but this will enable the game to go on forever with user-generated content together with improvements to the game by it being Open Source - - Last but not least, I'm working on randomly/procedurally generated levels in various difficulties to serve as daily challenges for users # Web Monetization (Coil) You can enable web monetization to unlock 3 extra levels and see how much you have supported the game. # Credits Everything (almost), including art, design, music, sound, and game was created by me - Martin Tale (https://martintale.com/) - Social and GUI icons from respective platforms and https://iconmonstr.com/ - Fairy and Joystick icon by Delapouite (http://delapouite.com) under CC BY 3.0; - Crowned Skull icon by Lorc (http://lorcblog.blogspot.com) under CC BY 3.0; - Heart icon by Skoll (https://game-icons.net/) under CC BY 3.0; ## Usage ### Dev server Start the dev server with hot reload: ```bash npm run dev ``` ### Production build Create a final production build: ```bash npm run build ```
esaminu_console-donation-template-87867hjg
.github scripts runfe.sh workflows deploy-to-console.yml readme.yml tests.yml .gitpod.yml README.md contract README.md build.sh deploy.sh package-lock.json package.json src contract.ts model.ts utils.ts tsconfig.json integration-tests package-lock.json package.json src main.ava.ts package-lock.json package.json
# Donation 💸 [![](https://img.shields.io/badge/⋈%20Examples-Basics-green)](https://docs.near.org/tutorials/welcome) [![](https://img.shields.io/badge/Gitpod-Ready-orange)](https://gitpod.io/#/https://github.com/near-examples/donation-js) [![](https://img.shields.io/badge/Contract-js-yellow)](https://docs.near.org/develop/contracts/anatomy) [![](https://img.shields.io/badge/Frontend-JS-yellow)](https://docs.near.org/develop/integrate/frontend) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fnear-examples%2Fdonation-js%2Fbadge&style=flat&label=Tests)](https://actions-badge.atrox.dev/near-examples/donation-js/goto) Our Donation example enables to forward money to an account while keeping track of it. It is one of the simplest examples on making a contract receive and send money. ![](https://docs.near.org/assets/images/donation-7cf65e5e131274fd1ae9aa34bc465bb8.png) # What This Example Shows 1. How to receive and transfer $NEAR on a contract. 2. How to divide a project into multiple modules. 3. How to handle the storage costs. 4. How to handle transaction results. 5. How to use a `Map`. <br /> # Quickstart Clone this repository locally or [**open it in gitpod**](https://gitpod.io/#/github.com/near-examples/donation-js). Then follow these steps: ### 1. Install Dependencies ```bash npm install ``` ### 2. Test the Contract Deploy your contract in a sandbox and simulate interactions from users. ```bash npm test ``` ### 3. Deploy the Contract Build the contract and deploy it in a testnet account ```bash npm run deploy ``` --- # Learn More 1. Learn more about the contract through its [README](./contract/README.md). 2. Check [**our documentation**](https://docs.near.org/develop/welcome). # Donation Contract The smart contract exposes methods to handle donating $NEAR to a `beneficiary`. ```ts @call donate() { // Get who is calling the method and how much $NEAR they attached let donor = near.predecessorAccountId(); let donationAmount: bigint = near.attachedDeposit() as bigint; let donatedSoFar = this.donations.get(donor) === null? BigInt(0) : BigInt(this.donations.get(donor) as string) let toTransfer = donationAmount; // This is the user's first donation, lets register it, which increases storage if(donatedSoFar == BigInt(0)) { assert(donationAmount > STORAGE_COST, `Attach at least ${STORAGE_COST} yoctoNEAR`); // Subtract the storage cost to the amount to transfer toTransfer -= STORAGE_COST } // Persist in storage the amount donated so far donatedSoFar += donationAmount this.donations.set(donor, donatedSoFar.toString()) // Send the money to the beneficiary const promise = near.promiseBatchCreate(this.beneficiary) near.promiseBatchActionTransfer(promise, toTransfer) // Return the total amount donated so far return donatedSoFar.toString() } ``` <br /> # Quickstart 1. Make sure you have installed [node.js](https://nodejs.org/en/download/package-manager/) >= 16. 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash npm run deploy ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` The contract will be automatically initialized with a default `beneficiary`. To initialize the contract yourself do: ```bash # Use near-cli to initialize contract (optional) near call <dev-account> init '{"beneficiary":"<account>"}' --accountId <dev-account> ``` <br /> ## 2. Get Beneficiary `beneficiary` is a read-only method (`view` method) that returns the beneficiary of the donations. `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash near view <dev-account> beneficiary ``` <br /> ## 3. Get Number of Donations `donate` forwards any attached money to the `beneficiary` while keeping track of it. `donate` is a payable method for which can only be invoked using a NEAR account. The account needs to attach money and pay GAS for the transaction. ```bash # Use near-cli to donate 1 NEAR near call <dev-account> donate --amount 1 --accountId <account> ``` **Tip:** If you would like to `donate` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`.
Grrialt_post_feed
.gitpod.yml .idea modules.xml prettier.xml vcs.xml watcherTasks.xml README.md contract README.md build.sh deploy.sh package.json src contract.ts model.ts tsconfig.json frontend .cypress cypress.config.js e2e postChain.cy.ts tsconfig.json index.html model.ts near-interface.ts near-wallet.ts package.json start.sh integration-tests package.json src main.ava.ts package.json tsconfig.json
# Smart Contract The smart contract stores messages from users. Messages can be `premium` if the user attaches sufficient money (0.1 $NEAR). ```ts this.messages = []; @call // Public - Adds a new message. add_message({ text }: { text: string }) { // If the user attaches more than 0.1N the message is premium const premium = near.attachedDeposit() >= BigInt(POINT_ONE); const sender = near.predecessorAccountId(); const message = new PostedMessage({premium, sender, text}); this.messages.push(message); } @view // Returns an array of messages. get_messages({ fromIndex = 0, limit = 10 }: { fromIndex: number, limit: number }): PostedMessage[] { return this.messages.slice(fromIndex, fromIndex + limit); } ``` <br /> # Quickstart 1. Make sure you have installed [node.js](https://nodejs.org/en/download/package-manager/) >= 16. 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash npm run deploy ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Stored Messages `get_messages` is a read-only method (`view` method) that returns a slice of the vector `messages`. `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash near view <dev-account> get_messages '{"from_index":0, "limit":10}' ``` <br /> ## 3. Add a Message `add_message` adds a message to the vector of `messages` and marks it as premium if the user attached more than `0.1 NEAR`. `add_message` is a payable method for which can only be invoked using a NEAR account. The account needs to attach money and pay GAS for the transaction. ```bash # Use near-cli to donate 1 NEAR near call <dev-account> add_message '{"text": "a message"}' --amount 0.1 --accountId <account> ``` **Tip:** If you would like to add a message using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. # Quickstart ### 1. Install Dependencies ```bash npm install ``` ### 2. Test the Contract Deploy your contract in a sandbox and simulate interactions from users. ```bash npm test ``` ### 3. Deploy the Contract Build the contract and deploy it in a testnet account ```bash npm run deploy ``` ### 4. Start the Frontend Start the web application to interact with your smart contract ```bash npm start ``` --- # Learn More 1. Learn more about the contract through its [README](./contract/README.md). 2. Check [**NEAR documentation**](https://docs.near.org/develop/welcome).
NicholsonTsang_NearProtocolExample
.github dependabot.yml workflows tests.yml .gitpod.yml .travis.yml LICENSE-APACHE.txt LICENSE-MIT.txt README-Gitpod.md README.md as-pect.config.js asconfig.json assembly __tests__ as-pect.d.ts main.spec.ts as_types.d.ts index.ts model.ts tsconfig.json neardev shared-test-staging test.near.json shared-test test.near.json package.json src config.js index.html loader.html main.js styles.css test-setup.js test.js
Example of NEAR Wallet integration ================================== [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/near-examples/wallet-example) <!-- MAGIC COMMENT: DO NOT DELETE! Everything above this line is hidden on NEAR Examples page --> This example demonstrates how to integrate your application with NEAR Wallet. The contract is quite simple. It can store the account_id of last sender and return it. It also shows how you can debug contracts using logs. ## Getting started There are two ways to run this project. The first is the quick and a good way to instantly become familiar with this example. Once familiar, the next step is for a developer to create their own NEAR account and deploy the contract to testnet. This is covered in the following section. There's a button at the top of this file that says "Open in Gitpod." This will open the project in a new tab with an integrated development environment. The other option is to clone this repository and follow the same instructions. ### Quickest option 1. Install dependencies: ``` yarn --frozen-lockfile ``` 2. Build and deploy this smart contract to a development account. This development account will be created automatically and is not intended for reuse: ``` yarn dev ``` Your command line which will display a link to localhost similar to: ```bash Server running at http://localhost:1234 ``` Please open that link your browser to continue and see how to log in with NEAR Wallet in a simple webapp. ### Standard deploy option In this second option, the smart contract will get deployed to a specific account created with the NEAR Wallet. 1. Ensure `near-cli` is installed by running: ``` near --version ``` If needed, install `near-cli`: ``` npm install near-cli -g ``` 2. If you do not have a NEAR account, please create one with [NEAR Wallet](wallet.testnet.near.org). In the project root, login with `near-cli` by following the instructions after this command: ``` near login ``` 3. Modify the top of `src/config.js`, changing the `CONTRACT_NAME` to be the NEAR account that was just used to log in. ```javascript … const CONTRACT_NAME = process.env.CONTRACT_NAME || 'YOUR_ACCOUNT_NAME_HERE'; /* TODO: fill this in! */ … ``` 4. Start the example! ``` yarn start ``` ## To Test ``` yarn asp // as-pect tests yarn jest // integration tests yarn test // both ``` ## To Explore - `assembly/main.ts` for the contract code - `src/index.html` for the front-end HTML - `src/main.js` for the JavaScript front-end code and how to integrate contracts - `src/test.js` for the JS tests for the contract ## Data collection By using Gitpod in this project, you agree to opt-in to basic, anonymous analytics. No personal information is transmitted. Instead, these usage statistics aid in discovering potential bugs and user flow information.
esaminu123_console-boilerplate-template-js-69-sdf
.eslintrc.yml .github ISSUE_TEMPLATE 01_BUG_REPORT.md 02_FEATURE_REQUEST.md 03_CODEBASE_IMPROVEMENT.md 04_SUPPORT_QUESTION.md config.yml PULL_REQUEST_TEMPLATE.md labels.yml workflows codeql.yml deploy-to-console.yml labels.yml lock.yml pr-labels.yml stale.yml .gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs docs CODE_OF_CONDUCT.md CONTRIBUTING.md SECURITY.md frontend App.js assets global.css logo-black.svg logo-white.svg index.html index.js near-interface.js near-wallet.js package.json start.sh ui-components.js integration-tests Cargo.toml src tests.rs package.json
<h1 align="center"> <a href="https://github.com/near/boilerplate-template-rs"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_light.png"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> <img alt="" src="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> </picture> </a> </h1> <div align="center"> Rust Boilerplate Template <br /> <br /> <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=bug&template=01_BUG_REPORT.md&title=bug%3A+">Report a Bug</a> · <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=enhancement&template=02_FEATURE_REQUEST.md&title=feat%3A+">Request a Feature</a> . <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+">Ask a Question</a> </div> <div align="center"> <br /> [![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) [![code with love by near](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-near-ff1414.svg?style=flat-square)](https://github.com/near) </div> <details open="open"> <summary>Table of Contents</summary> - [About](#about) - [Built With](#built-with) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Installation](#installation) - [Usage](#usage) - [Roadmap](#roadmap) - [Support](#support) - [Project assistance](#project-assistance) - [Contributing](#contributing) - [Authors & contributors](#authors--contributors) - [Security](#security) </details> --- ## About This project is created for easy-to-start as a React + Rust skeleton template in the Pagoda Gallery. It was initialized with [create-near-app]. Clone it and start to build your own gallery project! ### Built With [create-near-app], [amazing-github-template](https://github.com/dec0dOS/amazing-github-template) Getting Started ================== ### Prerequisites Make sure you have a [current version of Node.js](https://nodejs.org/en/about/releases/) installed – we are targeting versions `16+`. Read about other [prerequisites](https://docs.near.org/develop/prerequisites) in our docs. ### Installation Install all dependencies: npm install Build your contract: npm run build Deploy your contract to TestNet with a temporary dev account: npm run deploy Usage ===== Test your contract: npm test Start your frontend: npm start Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages ## Roadmap See the [open issues](https://github.com/near/boilerplate-template-rs/issues) for a list of proposed features (and known issues). - [Top Feature Requests](https://github.com/near/boilerplate-template-rs/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Top Bugs](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Newest Bugs](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aopen+is%3Aissue+label%3Abug) ## Support Reach out to the maintainer: - [GitHub issues](https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+) ## Project assistance If you want to say **thank you** or/and support active development of Rust Boilerplate Template: - Add a [GitHub Star](https://github.com/near/boilerplate-template-rs) to the project. - Tweet about the Rust Boilerplate Template. - Write interesting articles about the project on [Dev.to](https://dev.to/), [Medium](https://medium.com/) or your personal blog. Together, we can make Rust Boilerplate Template **better**! ## Contributing First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**. Please read [our contribution guidelines](docs/CONTRIBUTING.md), and thank you for being involved! ## Authors & contributors The original setup of this repository is by [Dmitriy Sheleg](https://github.com/shelegdmitriy). For a full list of all authors and contributors, see [the contributors page](https://github.com/near/boilerplate-template-rs/contributors). ## Security Rust Boilerplate Template follows good practices of security, but 100% security cannot be assured. Rust Boilerplate Template is provided **"as is"** without any **warranty**. Use at your own risk. _For more information and to report security issues, please refer to our [security documentation](docs/SECURITY.md)._ # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"message":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`.
pinkpaper_pink-paper-frontend
.htaccess 404.php README.md about-us.php about-us2.php about.php all-post.php all-writers.php assets avatar jquery.letterpic.min.js bootstrap css bootstrap-grid.css bootstrap-grid.min.css bootstrap-grid.rtl.css bootstrap-grid.rtl.min.css bootstrap-reboot.css bootstrap-reboot.min.css bootstrap-reboot.rtl.css bootstrap-reboot.rtl.min.css bootstrap-utilities.css bootstrap-utilities.min.css bootstrap-utilities.rtl.css bootstrap-utilities.rtl.min.css bootstrap.css bootstrap.min.css bootstrap.rtl.css bootstrap.rtl.min.css js bootstrap.bundle.js bootstrap.bundle.min.js bootstrap.esm.js bootstrap.esm.min.js bootstrap.js bootstrap.min.js css app.css croudFundingUI.css flatpickr.min.css loader.css medium.css messageBox.css newLoader.css success.css theme theme-2.css dropify css demo.css dropify.css dropify.min.css fonts dropify.svg js dropify.js dropify.min.js feather feather.min.js images access_denied.svg box.svg chat.svg insta.svg ipfs.svg logo logo (2).svg logo.svg moon-solid.svg post.svg metamask-fox.svg no_data.svg page_not_found.svg jquery jquery-3.4.1.min.js js Typewriter.js app.js flatpickr.js loader.js moment-duration-format.min.js moment.min.js neoLogin.js popr popr.css popr.js popr.min.js mediumEditor css medium-editor-insert-plugin-frontend.css medium-editor-insert-plugin-frontend.min.css medium-editor-insert-plugin.css medium-editor-insert-plugin.min.css medium-editor.css medium-editor.min.css themes beagle.css beagle.min.css bootstrap.css bootstrap.min.css default.css default.min.css flat.css flat.min.css mani.css mani.min.css roman.css roman.min.css tim.css tim.min.css js medium-editor-insert-plugin.js medium-editor-insert-plugin.min.js medium-editor-mobile-plugin.js medium-editor-mobile-plugin.min.js medium-editor.js medium-editor.min.js readingTime readingtime.js sweetalert jquery.sweet-alert.custom.js sweetalert-dev.js sweetalert.css sweetalert.min.js tagify jQuery.tagify.min.js react.tagify.js tagify.css tagify.esm.js tagify.js tagify.min.css tagify.min.js tagify.polyfills.min.js toastr toastr.css toastr.min.css toastr.min.js switch network code start switch network code end audience-stats.php audience-stats2.php contact-us.php contact-us2.php contract bnb bnbContract.js bnbFactoryContract.js bnbProjectFunding.js contract.js factoryContract.js matic maticContract.js maticFactoryContract.js maticProjectFunding.js neo neoContract.js rawManifest.js projectFunding.js cookies-policy.php create-story.php create-story2.php dashboard aboutus.php add-tag.php add-user.php add_category_home_sample.php add_category_sample.php addpost.php all-tags.php all-users.php allpost.php apex.php assets Date-Time-Picker-Bootstrap-4 .jscs.json .travis.yml CONTRIBUTING.md Gruntfile.js README.md bower.json build css bootstrap-datetimepicker.css bootstrap-datetimepicker.min.css js bootstrap-datetimepicker.min.js component.json composer.json docs ChangeLog.md ContributorsGuide.md Events.md Extras.md FAQ.md Functions.md Installing.md Options.md Version 4 Changelog.md Version 4 Contributors guide.md index.md theme base.html browserconfig.xml content.html css base.css prettify-1.0.css js base.js prettify-1.0.min.js manifest.json nav.html toc.html mkdocs.yml package.json src js bootstrap-datetimepicker.js less bootstrap-datetimepicker-build.css nuget install.ps1 sass bootstrap-datetimepicker-build.css tasks bump_version.js test publicApiSpec.js screen-capture base.html compile.js index.js t1.html t2.html t3.html t4.html t5.html timezoneDataHelper.js bootstrap-datepicker bootstrap-datepicker.min.css bootstrap-datepicker.min.js bootstrap-daterangepicker daterangepicker.css daterangepicker.js bootstrap-material-datetimepicker LICENSE.md README.md bower.json css bootstrap-material-datetimepicker.css font Material-Design-Icons.svg index.html js bootstrap-material-datetimepicker.js package.json ckeditor CHANGES.md LICENSE.md README.md adapters jquery.js build-config.js ckeditor.js config.js contents.css lang en.js plugins a11yhelp dialogs a11yhelp.js lang _translationstatus.txt af.js ar.js az.js bg.js ca.js cs.js cy.js da.js de-ch.js de.js el.js en-au.js en-gb.js en.js eo.js es-mx.js es.js et.js eu.js fa.js fi.js fo.js fr-ca.js fr.js gl.js gu.js he.js hi.js hr.js hu.js id.js it.js ja.js km.js ko.js ku.js lt.js lv.js mk.js mn.js nb.js nl.js no.js oc.js pl.js pt-br.js pt.js ro.js ru.js si.js sk.js sl.js sq.js sr-latn.js sr.js sv.js th.js tr.js tt.js ug.js uk.js vi.js zh-cn.js zh.js autocomplete skins default.css clipboard dialogs paste.js contents dialogs contents.js plugin.js styles styles.css dialog dialogDefinition.js styles dialog.css emojione .bower.json README.md bower.json dialogs emojione.js libs emojione emojione.min.js styles emojione-awesome.css emojione.css image dialogs image.js link dialogs anchor.js link.js pastefromgdocs filter default.js pastefromlibreoffice filter default.js pastetools filter common.js image.js simplebutton README.md dialogs simplebutton.js plugin.js specialchar dialogs lang _translationstatus.txt af.js ar.js az.js bg.js ca.js cs.js cy.js da.js de-ch.js de.js el.js en-au.js en-ca.js en-gb.js en.js eo.js es-mx.js es.js et.js eu.js fa.js fi.js fr-ca.js fr.js gl.js he.js hr.js hu.js id.js it.js ja.js km.js ko.js ku.js lt.js lv.js nb.js nl.js no.js oc.js pl.js pt-br.js pt.js ro.js ru.js si.js sk.js sl.js sq.js sr-latn.js sr.js sv.js th.js tr.js tt.js ug.js uk.js vi.js zh-cn.js zh.js specialchar.js table dialogs table.js tableselection styles tableselection.css tabletools dialogs tableCell.js toc lang de.js en.js plugin.js release-notes.txt uploadfile plugin.js youtube lang ar.js bg.js cs.js de.js el.js en.js es.js et.js eu.js fi.js fr.js he.js hu.js it.js ja.js ko.js nb.js nl.js nn.js pl.js pt-br.js pt.js ru.js sk.js tr.js uk.js vi.js zh.js plugin.js samples css samples.css img logo.svg index.html js sample.js sf.js old ajax.html api.html appendto.html assets outputxhtml outputxhtml.css posteddata.php uilanguages languages.js datafiltering.html dialog assets my_dialog.js dialog.html divreplace.html enterkey enterkey.html htmlwriter assets outputforflash swfobject.js outputforflash.html outputhtml.html index.html inlineall.html inlinebycode.html inlinetextarea.html jquery.html magicline magicline.html readonly.html replacebyclass.html replacebycode.html sample.css sample.js sample_posteddata.php tabindex.html toolbar toolbar.html uicolor.html uilanguages.html wysiwygarea fullpage.html xhtmlstyle.html toolbarconfigurator css fontello.css font LICENSE.txt config.json fontello.svg index.html js abstracttoolbarmodifier.js fulltoolbareditor.js toolbarmodifier.js toolbartextmodifier.js lib codemirror codemirror.css codemirror.js javascript.js neo.css show-hint.css show-hint.js skins minimalist dialog.css dialog_ie.css dialog_ie7.css dialog_ie8.css dialog_iequirks.css editor.css editor_gecko.css editor_ie.css editor_ie7.css editor_ie8.css editor_iequirks.css readme.md moono-lisa dialog.css dialog_ie.css dialog_ie8.css dialog_iequirks.css editor.css editor_gecko.css editor_ie.css editor_ie8.css editor_iequirks.css readme.md moonocolor dialog.css dialog_ie.css dialog_ie7.css dialog_ie8.css dialog_iequirks.css editor.css editor_gecko.css editor_ie.css editor_ie7.css editor_ie8.css editor_iequirks.css readme.md n1theme dialog.css dialog_ie.css dialog_ie8.css dialog_iequirks.css editor.css editor_gecko.css editor_ie.css editor_ie8.css editor_iequirks.css readme.md styles.js vendor promise.js clockpicker dist bootstrap-clockpicker.css bootstrap-clockpicker.js bootstrap-clockpicker.min.css bootstrap-clockpicker.min.js jquery-clockpicker.css jquery-clockpicker.js jquery-clockpicker.min.css jquery-clockpicker.min.js css admin2.css admin3.css admin4.css connect.css connect.min.css custom.css dark_theme.css ericjgagnon-wickedpicker-2a8950a LICENSE.md README.md bower.json dist wickedpicker.min.css wickedpicker.min.js fonts fontello.svg src wickedpicker.js stylesheets wickedpicker.css images 404.svg 404_blue.svg 404_green.svg 404_purple.svg 500.svg 500_blue.svg 500_green.svg 500_purple.svg brand_logo.svg login.svg login_blue.svg login_green.svg login_purple.svg setup_wizard_re_nday.svg js connect.js connect.min.js dataTables.select.min.js jquery-ui.min.js pages blockui.js calendar.js charts.js dashboard.js datatables.js mailbox.js select2.js session.js todo.js tree.js moment min locales.js locales.min.js moment-with-locales.js moment-with-locales.min.js moment.min.js moment.js src lib create check-overflow.js date-from-array.js from-anything.js from-array.js from-object.js from-string-and-array.js from-string-and-format.js from-string.js local.js parsing-flags.js utc.js valid.js duration abs.js add-subtract.js as.js bubble.js constructor.js create.js duration.js get.js humanize.js iso-string.js prototype.js format format.js locale calendar.js constructor.js en.js formats.js invalid.js lists.js locale.js locales.js ordinal.js pre-post-format.js prototype.js relative.js set.js moment add-subtract.js calendar.js clone.js compare.js constructor.js diff.js format.js from.js get-set.js locale.js min-max.js moment.js prototype.js start-end-of.js to-type.js to.js valid.js parse regex.js token.js units aliases.js constants.js day-of-month.js day-of-week.js day-of-year.js hour.js millisecond.js minute.js month.js offset.js quarter.js second.js timestamp.js timezone.js units.js week-year.js week.js year.js utils abs-ceil.js abs-floor.js compare-arrays.js defaults.js deprecate.js extend.js has-own-prop.js hooks.js is-array.js is-date.js map.js to-int.js zero-fill.js locale af.js ar-ma.js ar-sa.js ar-tn.js ar.js az.js be.js bg.js bn.js bo.js br.js bs.js ca.js cs.js cv.js cy.js da.js de-at.js de.js el.js en-au.js en-ca.js en-gb.js eo.js es.js et.js eu.js fa.js fi.js fo.js fr-ca.js fr.js fy.js gl.js he.js hi.js hr.js hu.js hy-am.js id.js is.js it.js ja.js jv.js ka.js km.js ko.js lb.js lt.js lv.js me.js mk.js ml.js mr.js ms-my.js ms.js my.js nb.js ne.js nl.js nn.js pl.js pt-br.js pt.js ro.js ru.js si.js sk.js sl.js sq.js sr-cyrl.js sr.js sv.js ta.js th.js tl-ph.js tr.js tzl.js tzm-latn.js tzm.js uk.js uz.js vi.js zh-cn.js zh-tw.js moment.js plugins DataTables DataTables-1.10.20 css dataTables.bootstrap.css dataTables.bootstrap.min.css dataTables.bootstrap4.css dataTables.bootstrap4.min.css dataTables.foundation.css dataTables.foundation.min.css dataTables.jqueryui.css dataTables.jqueryui.min.css dataTables.semanticui.css dataTables.semanticui.min.css jquery.dataTables.css jquery.dataTables.min.css js dataTables.bootstrap.js dataTables.bootstrap.min.js dataTables.bootstrap4.js dataTables.bootstrap4.min.js dataTables.foundation.js dataTables.foundation.min.js dataTables.jqueryui.js dataTables.jqueryui.min.js dataTables.semanticui.js dataTables.semanticui.min.js jquery.dataTables.js jquery.dataTables.min.js dataTables.select.min.js datatables.css datatables.js datatables.min.css datatables.min.js apexcharts .eslintrc.js dist apexcharts.common.js apexcharts.css apexcharts.esm.js apexcharts.js apexcharts.min.js locales de.json el.json en.json es.json fr.json hi.json id.json pt-br.json ru.json package.json samples assets github-data.js irregular-data-series.js ohlc.js series1000.js stock-prices.js styles.css react area area-datetime.html area-github-style.html area-spline.html area-with-missing-data.html area-with-negative.html basic-area.html stacked-area.html timeseries-with-irregular-data.html bar bar-with-custom-data-labels.html bar-with-images.html bar-with-negative.html basic-bar.html grouped-bar.html patterned-bar.html rangebar.html stacked-bar-100.html stacked-bar.html timeline.html bubble 3d-bubble.html simple-bubble.html candlestick basic.html candlestick-bar.html column basic-column.html column-with-data-labels.html column-with-negative.html column-with-rotated-labels.html data.js distributed-columns.html dynamic-loaded-chart.html range-column.html stacked-column-100.html stacked-column.html heatmap basic.html color-range.html multiple-color-scales-flipped.html multiple-color.html rounded.html line basic-line.html brush-charts.html dashed-line.html gradient-line.html line-with-annotations.html line-with-data-labels.html line-with-image.html line-with-missing-data.html logarithmic-line.html realtime.html stepline.html syncing-charts.html zoomable-timeseries.html mixed line-area.html line-column-area.html line-column.html line-scatter.html multiple-yaxes.html pie donut-update.html donut-with-pattern.html gradient-donut.html monochrome-pie.html pie-with-image.html simple-donut.html simple-pie.html radar basic-radar.html radar-multiple-series.html radar-with-polygon-fill.html radialBar circle-chart-multiple.html circle-chart-with-image.html circle-chart.html circle-custom-angle.html circle-gradient.html semi-circle-chart.html stroked-gauge.html scatter scatter-basic.html scatter-datetime.html scatter-images.html sparklines sparklines.html vanilla-js area area-datetime.html area-github-style.html area-range.html area-spline.html area-with-missing-data.html area-with-negative.html basic-area.html stacked-area.html timeseries-with-irregular-data.html bar bar-with-custom-data-labels.html bar-with-images.html bar-with-negative.html basic-bar.html grouped-bar.html patterned-bar.html rangebar.html stacked-bar-100.html stacked-bar.html timeline.html bubble 3d-bubble.html simple-bubble.html candlestick basic.html candlestick-bar.html column basic-column.html column-with-data-labels.html column-with-negative.html column-with-rotated-labels.html data-color.html data.js distributed-columns.html dynamic-loaded-chart.html histogram.html range-column.html stacked-column-100.html stacked-column.html dashboards dark assets scripts.js styles.css index.html material assets scripts.js styles.css index.html modern assets data.js scripts.js styles.css index.html realtime assets scripts.js styles.css index.html heatmap basic.html color-range.html multiple-color-scales-flipped.html multiple-color.html rounded.html line basic-line.html brush-charts.html dashed-line.html gradient-line.html line-with-annotations.html line-with-data-labels.html line-with-image.html line-with-missing-data.html logarithmic-line.html realtime.html stepline.html syncing-charts.html zoomable-timeseries.html misc annotations-example.html custom-legend.html init-from-attrs.html minMaxPoints.html range-annotations-example.html range-annotations-inverted-axis-example.html mixed line-area.html line-column-area.html line-column.html line-scatter.html multiple-yaxes.html pie donut-update.html donut-with-pattern.html gradient-donut.html monochrome-pie.html pie-with-image.html simple-donut.html simple-pie.html radar basic-radar.html radar-multiple-series.html radar-with-polygon-fill.html radialBar circle-chart-multiple.html circle-chart-with-image.html circle-chart.html circle-custom-angle.html circle-gradient.html semi-circle-chart.html stroked-gauge.html scatter scatter-basic.html scatter-datetime.html scatter-images.html sparklines sparklines.html vue area area-datetime.html area-github-style.html area-spline.html area-with-missing-data.html area-with-negative.html basic-area.html stacked-area.html timeseries-with-irregular-data.html bar bar-with-custom-data-labels.html bar-with-images.html bar-with-negative.html basic-bar.html grouped-bar.html patterned-bar.html rangebar.html stacked-bar-100.html stacked-bar.html timeline.html bubble 3d-bubble.html simple-bubble.html candlestick basic.html candlestick-bar.html column basic-column.html column-with-data-labels.html column-with-negative.html column-with-rotated-labels.html data.js distributed-columns.html dynamic-loaded-chart.html range-column.html stacked-column-100.html stacked-column.html heatmap basic.html color-range.html multiple-color-scales-flipped.html multiple-color.html rounded.html line basic-line.html brush-charts.html dashed-line.html gradient-line.html line-with-annotations.html line-with-data-labels.html line-with-image.html line-with-missing-data.html logarithmic-line.html realtime.html stepline.html syncing-charts.html zoomable-timeseries.html mixed line-area.html line-column-area.html line-column.html line-scatter.html multiple-yaxes.html pie donut-update.html donut-with-pattern.html gradient-donut.html monochrome-pie.html pie-with-image.html simple-donut.html simple-pie.html radar basic-radar.html radar-multiple-series.html radar-with-polygon-fill.html radialBar circle-chart-multiple.html circle-chart-with-image.html circle-chart.html circle-custom-angle.html circle-gradient.html semi-circle-chart.html stroked-gauge.html scatter scatter-basic.html scatter-datetime.html scatter-images.html sparklines sparklines.html blockui jquery.blockUI.js bootstrap css bootstrap-grid.css bootstrap-grid.min.css bootstrap-reboot.css bootstrap-reboot.min.css bootstrap.css bootstrap.min.css js bootstrap.bundle.js bootstrap.bundle.min.js bootstrap.js bootstrap.min.js popper.min.js chartjs chart.min.js d3 d3.js d3.min.js dropify README.md dist css demo.css dropify.css dropify.min.css fonts dropify.svg js dropify.js dropify.min.js gulpfile.js index.html package.json src fonts dropify.svg js dropify.js sass demo.css flot excanvas.js excanvas.min.js jquery.colorhelpers.js jquery.colorhelpers.min.js jquery.flot.canvas.js jquery.flot.canvas.min.js jquery.flot.categories.js jquery.flot.categories.min.js jquery.flot.crosshair.js jquery.flot.crosshair.min.js jquery.flot.errorbars.js jquery.flot.errorbars.min.js jquery.flot.fillbetween.js jquery.flot.fillbetween.min.js jquery.flot.image.js jquery.flot.image.min.js jquery.flot.js jquery.flot.min.js jquery.flot.navigate.js jquery.flot.navigate.min.js jquery.flot.pie.js jquery.flot.pie.min.js jquery.flot.resize.js jquery.flot.resize.min.js jquery.flot.selection.js jquery.flot.selection.min.js jquery.flot.stack.js jquery.flot.stack.min.js jquery.flot.symbol.js jquery.flot.symbol.min.js jquery.flot.threshold.js jquery.flot.threshold.min.js jquery.flot.time.js jquery.flot.time.min.js jquery.flot.tooltip.js jquery.flot.tooltip.min.js jquery.flot.tooltip.source.js font-awesome LICENSE.txt css all.css all.min.css brands.css brands.min.css fontawesome.css fontawesome.min.css regular.css regular.min.css solid.css solid.min.css svg-with-js.css svg-with-js.min.css v4-shims.css v4-shims.min.css js brands.js brands.min.js fontawesome.js fontawesome.min.js regular.js regular.min.js solid.js solid.min.js v4-shims.js v4-shims.min.js metadata categories.yml icons.yml shims.json shims.yml sponsors.yml scss brands.css fontawesome.css regular.css solid.css v4-shims.css sprites brands.svg regular.svg solid.svg svgs brands 500px.svg accessible-icon.svg accusoft.svg acquisitions-incorporated.svg adn.svg adversal.svg affiliatetheme.svg algolia.svg alipay.svg amazon-pay.svg amazon.svg amilia.svg android.svg angellist.svg angrycreative.svg angular.svg app-store-ios.svg app-store.svg apper.svg apple-pay.svg apple.svg asymmetrik.svg audible.svg autoprefixer.svg avianex.svg aviato.svg aws.svg bandcamp.svg behance-square.svg behance.svg bimobject.svg bitbucket.svg bitcoin.svg bity.svg black-tie.svg blackberry.svg blogger-b.svg blogger.svg bluetooth-b.svg bluetooth.svg btc.svg buromobelexperte.svg buysellads.svg cc-amazon-pay.svg cc-amex.svg cc-apple-pay.svg cc-diners-club.svg cc-discover.svg cc-jcb.svg cc-mastercard.svg cc-paypal.svg cc-stripe.svg cc-visa.svg centercode.svg chrome.svg cloudscale.svg cloudsmith.svg cloudversify.svg codepen.svg codiepie.svg connectdevelop.svg contao.svg cpanel.svg creative-commons-by.svg creative-commons-nc-eu.svg creative-commons-nc-jp.svg creative-commons-nc.svg creative-commons-nd.svg creative-commons-pd-alt.svg creative-commons-pd.svg creative-commons-remix.svg creative-commons-sa.svg creative-commons-sampling-plus.svg creative-commons-sampling.svg creative-commons-share.svg creative-commons-zero.svg creative-commons.svg critical-role.svg css3-alt.svg css3.svg cuttlefish.svg d-and-d-beyond.svg d-and-d.svg dashcube.svg delicious.svg deploydog.svg deskpro.svg dev.svg deviantart.svg digg.svg digital-ocean.svg discord.svg discourse.svg dochub.svg docker.svg draft2digital.svg dribbble-square.svg dribbble.svg dropbox.svg drupal.svg dyalog.svg earlybirds.svg ebay.svg edge.svg elementor.svg ello.svg ember.svg empire.svg envira.svg erlang.svg ethereum.svg etsy.svg expeditedssl.svg facebook-f.svg facebook-messenger.svg facebook-square.svg facebook.svg fantasy-flight-games.svg firefox.svg first-order-alt.svg first-order.svg firstdraft.svg flickr.svg flipboard.svg fly.svg font-awesome-alt.svg font-awesome-flag.svg font-awesome-logo-full.svg font-awesome.svg fonticons-fi.svg fonticons.svg fort-awesome-alt.svg fort-awesome.svg forumbee.svg foursquare.svg free-code-camp.svg freebsd.svg fulcrum.svg galactic-republic.svg galactic-senate.svg get-pocket.svg gg-circle.svg gg.svg git-square.svg git.svg github-alt.svg github-square.svg github.svg gitkraken.svg gitlab.svg gitter.svg glide-g.svg glide.svg gofore.svg goodreads-g.svg goodreads.svg google-drive.svg google-play.svg google-plus-g.svg google-plus-square.svg google-plus.svg google-wallet.svg google.svg gratipay.svg grav.svg gripfire.svg grunt.svg gulp.svg hacker-news-square.svg hacker-news.svg hackerrank.svg hips.svg hire-a-helper.svg hooli.svg hornbill.svg hotjar.svg houzz.svg html5.svg hubspot.svg imdb.svg instagram.svg internet-explorer.svg ioxhost.svg itunes-note.svg itunes.svg java.svg jedi-order.svg jenkins.svg joget.svg joomla.svg js-square.svg js.svg jsfiddle.svg kaggle.svg keybase.svg keycdn.svg kickstarter-k.svg kickstarter.svg korvue.svg laravel.svg lastfm-square.svg lastfm.svg leanpub.svg less.svg line.svg linkedin-in.svg linkedin.svg linode.svg linux.svg lyft.svg magento.svg mailchimp.svg mandalorian.svg markdown.svg mastodon.svg maxcdn.svg medapps.svg medium-m.svg medium.svg medrt.svg meetup.svg megaport.svg microsoft.svg mix.svg mixcloud.svg mizuni.svg modx.svg monero.svg napster.svg neos.svg nimblr.svg nintendo-switch.svg node-js.svg node.svg npm.svg ns8.svg nutritionix.svg odnoklassniki-square.svg odnoklassniki.svg old-republic.svg opencart.svg openid.svg opera.svg optin-monster.svg osi.svg page4.svg pagelines.svg palfed.svg patreon.svg paypal.svg penny-arcade.svg periscope.svg phabricator.svg phoenix-framework.svg phoenix-squadron.svg php.svg pied-piper-alt.svg pied-piper-hat.svg pied-piper-pp.svg pied-piper.svg pinterest-p.svg pinterest-square.svg pinterest.svg playstation.svg product-hunt.svg pushed.svg python.svg qq.svg quinscape.svg quora.svg r-project.svg ravelry.svg react.svg reacteurope.svg readme.svg rebel.svg red-river.svg reddit-alien.svg reddit-square.svg reddit.svg renren.svg replyd.svg researchgate.svg resolving.svg rev.svg rocketchat.svg rockrms.svg safari.svg sass.svg schlix.svg scribd.svg searchengin.svg sellcast.svg sellsy.svg servicestack.svg shirtsinbulk.svg shopware.svg simplybuilt.svg sistrix.svg sith.svg skyatlas.svg skype.svg slack-hash.svg slack.svg slideshare.svg snapchat-ghost.svg snapchat-square.svg snapchat.svg soundcloud.svg speakap.svg spotify.svg squarespace.svg stack-exchange.svg stack-overflow.svg staylinked.svg steam-square.svg steam-symbol.svg steam.svg sticker-mule.svg strava.svg stripe-s.svg stripe.svg studiovinari.svg stumbleupon-circle.svg stumbleupon.svg superpowers.svg supple.svg teamspeak.svg telegram-plane.svg telegram.svg tencent-weibo.svg the-red-yeti.svg themeco.svg themeisle.svg think-peaks.svg trade-federation.svg trello.svg tripadvisor.svg tumblr-square.svg tumblr.svg twitch.svg twitter-square.svg twitter.svg typo3.svg uber.svg uikit.svg uniregistry.svg untappd.svg usb.svg ussunnah.svg vaadin.svg viacoin.svg viadeo-square.svg viadeo.svg viber.svg vimeo-square.svg vimeo-v.svg vimeo.svg vine.svg vk.svg vnv.svg vuejs.svg weebly.svg weibo.svg weixin.svg whatsapp-square.svg whatsapp.svg whmcs.svg wikipedia-w.svg windows.svg wix.svg wizards-of-the-coast.svg wolf-pack-battalion.svg wordpress-simple.svg wordpress.svg wpbeginner.svg wpexplorer.svg wpforms.svg wpressr.svg xbox.svg xing-square.svg xing.svg y-combinator.svg yahoo.svg yandex-international.svg yandex.svg yelp.svg yoast.svg youtube-square.svg youtube.svg zhihu.svg regular address-book.svg address-card.svg angry.svg arrow-alt-circle-down.svg arrow-alt-circle-left.svg arrow-alt-circle-right.svg arrow-alt-circle-up.svg bell-slash.svg bell.svg bookmark.svg building.svg calendar-alt.svg calendar-check.svg calendar-minus.svg calendar-plus.svg calendar-times.svg calendar.svg caret-square-down.svg caret-square-left.svg caret-square-right.svg caret-square-up.svg chart-bar.svg check-circle.svg check-square.svg circle.svg clipboard.svg clock.svg clone.svg closed-captioning.svg comment-alt.svg comment-dots.svg comment.svg comments.svg compass.svg copy.svg copyright.svg credit-card.svg dizzy.svg dot-circle.svg edit.svg envelope-open.svg envelope.svg eye-slash.svg eye.svg file-alt.svg file-archive.svg file-audio.svg file-code.svg file-excel.svg file-image.svg file-pdf.svg file-powerpoint.svg file-video.svg file-word.svg file.svg flag.svg flushed.svg folder-open.svg folder.svg font-awesome-logo-full.svg frown-open.svg frown.svg futbol.svg gem.svg grimace.svg grin-alt.svg grin-beam-sweat.svg grin-beam.svg grin-hearts.svg grin-squint-tears.svg grin-squint.svg grin-stars.svg grin-tears.svg grin-tongue-squint.svg grin-tongue-wink.svg grin-tongue.svg grin-wink.svg grin.svg hand-lizard.svg hand-paper.svg hand-peace.svg hand-point-down.svg hand-point-left.svg hand-point-right.svg hand-point-up.svg hand-pointer.svg hand-rock.svg hand-scissors.svg hand-spock.svg handshake.svg hdd.svg heart.svg hospital.svg hourglass.svg id-badge.svg id-card.svg image.svg images.svg keyboard.svg kiss-beam.svg kiss-wink-heart.svg kiss.svg laugh-beam.svg laugh-squint.svg laugh-wink.svg laugh.svg lemon.svg life-ring.svg lightbulb.svg list-alt.svg map.svg meh-blank.svg meh-rolling-eyes.svg meh.svg minus-square.svg money-bill-alt.svg moon.svg newspaper.svg object-group.svg object-ungroup.svg paper-plane.svg pause-circle.svg play-circle.svg plus-square.svg question-circle.svg registered.svg sad-cry.svg sad-tear.svg save.svg share-square.svg smile-beam.svg smile-wink.svg smile.svg snowflake.svg square.svg star-half.svg star.svg sticky-note.svg stop-circle.svg sun.svg surprise.svg thumbs-down.svg thumbs-up.svg times-circle.svg tired.svg trash-alt.svg user-circle.svg user.svg window-close.svg window-maximize.svg window-minimize.svg window-restore.svg solid ad.svg address-book.svg address-card.svg adjust.svg air-freshener.svg align-center.svg align-justify.svg align-left.svg align-right.svg allergies.svg ambulance.svg american-sign-language-interpreting.svg anchor.svg angle-double-down.svg angle-double-left.svg angle-double-right.svg angle-double-up.svg angle-down.svg angle-left.svg angle-right.svg angle-up.svg angry.svg ankh.svg apple-alt.svg archive.svg archway.svg arrow-alt-circle-down.svg arrow-alt-circle-left.svg arrow-alt-circle-right.svg arrow-alt-circle-up.svg arrow-circle-down.svg arrow-circle-left.svg arrow-circle-right.svg arrow-circle-up.svg arrow-down.svg arrow-left.svg arrow-right.svg arrow-up.svg arrows-alt-h.svg arrows-alt-v.svg arrows-alt.svg assistive-listening-systems.svg asterisk.svg at.svg atlas.svg atom.svg audio-description.svg award.svg backspace.svg backward.svg balance-scale.svg ban.svg band-aid.svg barcode.svg bars.svg baseball-ball.svg basketball-ball.svg bath.svg battery-empty.svg battery-full.svg battery-half.svg battery-quarter.svg battery-three-quarters.svg bed.svg beer.svg bell-slash.svg bell.svg bezier-curve.svg bible.svg bicycle.svg binoculars.svg birthday-cake.svg blender-phone.svg blender.svg blind.svg bold.svg bolt.svg bomb.svg bone.svg bong.svg book-dead.svg book-open.svg book-reader.svg book.svg bookmark.svg bowling-ball.svg box-open.svg box.svg boxes.svg braille.svg brain.svg briefcase-medical.svg briefcase.svg broadcast-tower.svg broom.svg brush.svg bug.svg building.svg bullhorn.svg bullseye.svg burn.svg bus-alt.svg bus.svg business-time.svg calculator.svg calendar-alt.svg calendar-check.svg calendar-minus.svg calendar-plus.svg calendar-times.svg calendar.svg camera-retro.svg camera.svg campground.svg cannabis.svg capsules.svg car-alt.svg car-battery.svg car-crash.svg car-side.svg car.svg caret-down.svg caret-left.svg caret-right.svg caret-square-down.svg caret-square-left.svg caret-square-right.svg caret-square-up.svg caret-up.svg cart-arrow-down.svg cart-plus.svg cat.svg certificate.svg chair.svg chalkboard-teacher.svg chalkboard.svg charging-station.svg chart-area.svg chart-bar.svg chart-line.svg chart-pie.svg check-circle.svg check-double.svg check-square.svg check.svg chess-bishop.svg chess-board.svg chess-king.svg chess-knight.svg chess-pawn.svg chess-queen.svg chess-rook.svg chess.svg chevron-circle-down.svg chevron-circle-left.svg chevron-circle-right.svg chevron-circle-up.svg chevron-down.svg chevron-left.svg chevron-right.svg chevron-up.svg child.svg church.svg circle-notch.svg circle.svg city.svg clipboard-check.svg clipboard-list.svg clipboard.svg clock.svg clone.svg closed-captioning.svg cloud-download-alt.svg cloud-meatball.svg cloud-moon-rain.svg cloud-moon.svg cloud-rain.svg cloud-showers-heavy.svg cloud-sun-rain.svg cloud-sun.svg cloud-upload-alt.svg cloud.svg cocktail.svg code-branch.svg code.svg coffee.svg cog.svg cogs.svg coins.svg columns.svg comment-alt.svg comment-dollar.svg comment-dots.svg comment-slash.svg comment.svg comments-dollar.svg comments.svg compact-disc.svg compass.svg compress.svg concierge-bell.svg cookie-bite.svg cookie.svg copy.svg copyright.svg couch.svg credit-card.svg crop-alt.svg crop.svg cross.svg crosshairs.svg crow.svg crown.svg cube.svg cubes.svg cut.svg database.svg deaf.svg democrat.svg desktop.svg dharmachakra.svg diagnoses.svg dice-d20.svg dice-d6.svg dice-five.svg dice-four.svg dice-one.svg dice-six.svg dice-three.svg dice-two.svg dice.svg digital-tachograph.svg directions.svg divide.svg dizzy.svg dna.svg dog.svg dollar-sign.svg dolly-flatbed.svg dolly.svg donate.svg door-closed.svg door-open.svg dot-circle.svg dove.svg download.svg drafting-compass.svg dragon.svg draw-polygon.svg drum-steelpan.svg drum.svg drumstick-bite.svg dumbbell.svg dungeon.svg edit.svg eject.svg ellipsis-h.svg ellipsis-v.svg envelope-open-text.svg envelope-open.svg envelope-square.svg envelope.svg equals.svg eraser.svg euro-sign.svg exchange-alt.svg exclamation-circle.svg exclamation-triangle.svg exclamation.svg expand-arrows-alt.svg expand.svg external-link-alt.svg external-link-square-alt.svg eye-dropper.svg eye-slash.svg eye.svg fast-backward.svg fast-forward.svg fax.svg feather-alt.svg feather.svg female.svg fighter-jet.svg file-alt.svg file-archive.svg file-audio.svg file-code.svg file-contract.svg file-csv.svg file-download.svg file-excel.svg file-export.svg file-image.svg file-import.svg file-invoice-dollar.svg file-invoice.svg file-medical-alt.svg file-medical.svg file-pdf.svg file-powerpoint.svg file-prescription.svg file-signature.svg file-upload.svg file-video.svg file-word.svg file.svg fill-drip.svg fill.svg film.svg filter.svg fingerprint.svg fire-extinguisher.svg fire.svg first-aid.svg fish.svg fist-raised.svg flag-checkered.svg flag-usa.svg flag.svg flask.svg flushed.svg folder-minus.svg folder-open.svg folder-plus.svg folder.svg font-awesome-logo-full.svg font.svg football-ball.svg forward.svg frog.svg frown-open.svg frown.svg funnel-dollar.svg futbol.svg gamepad.svg gas-pump.svg gavel.svg gem.svg genderless.svg ghost.svg gift.svg glass-martini-alt.svg glass-martini.svg glasses.svg globe-africa.svg globe-americas.svg globe-asia.svg globe.svg golf-ball.svg gopuram.svg graduation-cap.svg greater-than-equal.svg greater-than.svg grimace.svg grin-alt.svg grin-beam-sweat.svg grin-beam.svg grin-hearts.svg grin-squint-tears.svg grin-squint.svg grin-stars.svg grin-tears.svg grin-tongue-squint.svg grin-tongue-wink.svg grin-tongue.svg grin-wink.svg grin.svg grip-horizontal.svg grip-vertical.svg h-square.svg hammer.svg hamsa.svg hand-holding-heart.svg hand-holding-usd.svg hand-holding.svg hand-lizard.svg hand-paper.svg hand-peace.svg hand-point-down.svg hand-point-left.svg hand-point-right.svg hand-point-up.svg hand-pointer.svg hand-rock.svg hand-scissors.svg hand-spock.svg hands-helping.svg hands.svg handshake.svg hanukiah.svg hashtag.svg hat-wizard.svg haykal.svg hdd.svg heading.svg headphones-alt.svg headphones.svg headset.svg heart.svg heartbeat.svg helicopter.svg highlighter.svg hiking.svg hippo.svg history.svg hockey-puck.svg home.svg horse.svg hospital-alt.svg hospital-symbol.svg hospital.svg hot-tub.svg hotel.svg hourglass-end.svg hourglass-half.svg hourglass-start.svg hourglass.svg house-damage.svg hryvnia.svg i-cursor.svg id-badge.svg id-card-alt.svg id-card.svg image.svg images.svg inbox.svg indent.svg industry.svg infinity.svg info-circle.svg info.svg italic.svg jedi.svg joint.svg journal-whills.svg kaaba.svg key.svg keyboard.svg khanda.svg kiss-beam.svg kiss-wink-heart.svg kiss.svg kiwi-bird.svg landmark.svg language.svg laptop-code.svg laptop.svg laugh-beam.svg laugh-squint.svg laugh-wink.svg laugh.svg layer-group.svg leaf.svg lemon.svg less-than-equal.svg less-than.svg level-down-alt.svg level-up-alt.svg life-ring.svg lightbulb.svg link.svg lira-sign.svg list-alt.svg list-ol.svg list-ul.svg list.svg location-arrow.svg lock-open.svg lock.svg long-arrow-alt-down.svg long-arrow-alt-left.svg long-arrow-alt-right.svg long-arrow-alt-up.svg low-vision.svg luggage-cart.svg magic.svg magnet.svg mail-bulk.svg male.svg map-marked-alt.svg map-marked.svg map-marker-alt.svg map-marker.svg map-pin.svg map-signs.svg map.svg marker.svg mars-double.svg mars-stroke-h.svg mars-stroke-v.svg mars-stroke.svg mars.svg mask.svg medal.svg medkit.svg meh-blank.svg meh-rolling-eyes.svg meh.svg memory.svg menorah.svg mercury.svg meteor.svg microchip.svg microphone-alt-slash.svg microphone-alt.svg microphone-slash.svg microphone.svg microscope.svg minus-circle.svg minus-square.svg minus.svg mobile-alt.svg mobile.svg money-bill-alt.svg money-bill-wave-alt.svg money-bill-wave.svg money-bill.svg money-check-alt.svg money-check.svg monument.svg moon.svg mortar-pestle.svg mosque.svg motorcycle.svg mountain.svg mouse-pointer.svg music.svg network-wired.svg neuter.svg newspaper.svg not-equal.svg notes-medical.svg object-group.svg object-ungroup.svg oil-can.svg om.svg otter.svg outdent.svg paint-brush.svg paint-roller.svg palette.svg pallet.svg paper-plane.svg paperclip.svg parachute-box.svg paragraph.svg parking.svg passport.svg pastafarianism.svg paste.svg pause-circle.svg pause.svg paw.svg peace.svg pen-alt.svg pen-fancy.svg pen-nib.svg pen-square.svg pen.svg pencil-alt.svg pencil-ruler.svg people-carry.svg percent.svg percentage.svg person-booth.svg phone-slash.svg phone-square.svg phone-volume.svg phone.svg piggy-bank.svg pills.svg place-of-worship.svg plane-arrival.svg plane-departure.svg plane.svg play-circle.svg play.svg plug.svg plus-circle.svg plus-square.svg plus.svg podcast.svg poll-h.svg poll.svg poo-storm.svg poo.svg poop.svg portrait.svg pound-sign.svg power-off.svg pray.svg praying-hands.svg prescription-bottle-alt.svg prescription-bottle.svg prescription.svg print.svg procedures.svg project-diagram.svg puzzle-piece.svg qrcode.svg question-circle.svg question.svg quidditch.svg quote-left.svg quote-right.svg quran.svg rainbow.svg random.svg receipt.svg recycle.svg redo-alt.svg redo.svg registered.svg reply-all.svg reply.svg republican.svg retweet.svg ribbon.svg ring.svg road.svg robot.svg rocket.svg route.svg rss-square.svg rss.svg ruble-sign.svg ruler-combined.svg ruler-horizontal.svg ruler-vertical.svg ruler.svg running.svg rupee-sign.svg sad-cry.svg sad-tear.svg save.svg school.svg screwdriver.svg scroll.svg search-dollar.svg search-location.svg search-minus.svg search-plus.svg search.svg seedling.svg server.svg shapes.svg share-alt-square.svg share-alt.svg share-square.svg share.svg shekel-sign.svg shield-alt.svg ship.svg shipping-fast.svg shoe-prints.svg shopping-bag.svg shopping-basket.svg shopping-cart.svg shower.svg shuttle-van.svg sign-in-alt.svg sign-language.svg sign-out-alt.svg sign.svg signal.svg signature.svg sitemap.svg skull-crossbones.svg skull.svg slash.svg sliders-h.svg smile-beam.svg smile-wink.svg smile.svg smog.svg smoking-ban.svg smoking.svg snowflake.svg socks.svg solar-panel.svg sort-alpha-down.svg sort-alpha-up.svg sort-amount-down.svg sort-amount-up.svg sort-down.svg sort-numeric-down.svg sort-numeric-up.svg sort-up.svg sort.svg spa.svg space-shuttle.svg spider.svg spinner.svg splotch.svg spray-can.svg square-full.svg square-root-alt.svg square.svg stamp.svg star-and-crescent.svg star-half-alt.svg star-half.svg star-of-david.svg star-of-life.svg star.svg step-backward.svg step-forward.svg stethoscope.svg sticky-note.svg stop-circle.svg stop.svg stopwatch.svg store-alt.svg store.svg stream.svg street-view.svg strikethrough.svg stroopwafel.svg subscript.svg subway.svg suitcase-rolling.svg suitcase.svg sun.svg superscript.svg surprise.svg swatchbook.svg swimmer.svg swimming-pool.svg synagogue.svg sync-alt.svg sync.svg syringe.svg table-tennis.svg table.svg tablet-alt.svg tablet.svg tablets.svg tachometer-alt.svg tag.svg tags.svg tape.svg tasks.svg taxi.svg teeth-open.svg teeth.svg temperature-high.svg temperature-low.svg terminal.svg text-height.svg text-width.svg th-large.svg th-list.svg th.svg theater-masks.svg thermometer-empty.svg thermometer-full.svg thermometer-half.svg thermometer-quarter.svg thermometer-three-quarters.svg thermometer.svg thumbs-down.svg thumbs-up.svg thumbtack.svg ticket-alt.svg times-circle.svg times.svg tint-slash.svg tint.svg tired.svg toggle-off.svg toggle-on.svg toilet-paper.svg toolbox.svg tooth.svg torah.svg torii-gate.svg tractor.svg trademark.svg traffic-light.svg train.svg transgender-alt.svg transgender.svg trash-alt.svg trash.svg tree.svg trophy.svg truck-loading.svg truck-monster.svg truck-moving.svg truck-pickup.svg truck.svg tshirt.svg tty.svg tv.svg umbrella-beach.svg umbrella.svg underline.svg undo-alt.svg undo.svg universal-access.svg university.svg unlink.svg unlock-alt.svg unlock.svg upload.svg user-alt-slash.svg user-alt.svg user-astronaut.svg user-check.svg user-circle.svg user-clock.svg user-cog.svg user-edit.svg user-friends.svg user-graduate.svg user-injured.svg user-lock.svg user-md.svg user-minus.svg user-ninja.svg user-plus.svg user-secret.svg user-shield.svg user-slash.svg user-tag.svg user-tie.svg user-times.svg user.svg users-cog.svg users.svg utensil-spoon.svg utensils.svg vector-square.svg venus-double.svg venus-mars.svg venus.svg vial.svg vials.svg video-slash.svg video.svg vihara.svg volleyball-ball.svg volume-down.svg volume-mute.svg volume-off.svg volume-up.svg vote-yea.svg vr-cardboard.svg walking.svg wallet.svg warehouse.svg water.svg weight-hanging.svg weight.svg wheelchair.svg wifi.svg wind.svg window-close.svg window-maximize.svg window-minimize.svg window-restore.svg wine-bottle.svg wine-glass-alt.svg wine-glass.svg won-sign.svg wrench.svg x-ray.svg yen-sign.svg yin-yang.svg webfonts fa-brands-400.svg fa-regular-400.svg fa-solid-900.svg fullcalendar LICENSE.txt README.md examples background-events.html daygrid-views.html external-dragging-2cals.html external-dragging-builtin.html full-height.html google-calendar.html js theme-chooser.js json.html json events.json list-views.html locales.html month-view.html php get-events.php get-time-zones.php utils.php rrule.html selectable.html theming.html time-zones.html timegrid-views.html week-numbers.html packages bootstrap LICENSE.txt README.md main.css main.d.ts main.esm.js main.js main.min.css main.min.js package.json bundle google-calendar.js google-calendar.min.js locales-all.js locales-all.min.js locales af.js ar-dz.js ar-kw.js ar-ly.js ar-ma.js ar-sa.js ar-tn.js ar.js bg.js bs.js ca.js cs.js da.js de.js el.js en-au.js en-gb.js en-nz.js es-us.js es.js et.js eu.js fa.js fi.js fr-ca.js fr-ch.js fr.js gl.js he.js hi.js hr.js hu.js id.js is.js it.js ja.js ka.js kk.js ko.js lb.js lt.js lv.js mk.js ms.js nb.js nl.js nn.js pl.js pt-br.js pt.js ro.js ru.js sk.js sl.js sq.js sr-cyrl.js sr.js sv.js th.js tr.js uk.js vi.js zh-cn.js zh-tw.js luxon.js luxon.min.js moment-timezone.js moment-timezone.min.js moment.js moment.min.js rrule.js rrule.min.js core LICENSE.txt README.md locales-all.js locales-all.min.js locales af.js ar-dz.js ar-kw.js ar-ly.js ar-ma.js ar-sa.js ar-tn.js ar.js az.js bg.js bs.js ca.js cs.js da.js de.js el.js en-au.js en-gb.js en-nz.js es-us.js es.js et.js eu.js fa.js fi.js fr-ca.js fr-ch.js fr.js gl.js he.js hi.js hr.js hu.js id.js is.js it.js ja.js ka.js kk.js ko.js lb.js lt.js lv.js mk.js ms.js nb.js nl.js nn.js pl.js pt-br.js pt.js ro.js ru.js sk.js sl.js sq.js sr-cyrl.js sr.js sv.js th.js tr.js ug.js uk.js uz.js vi.js zh-cn.js zh-tw.js main.css main.d.ts main.esm.js main.js main.min.css main.min.js package.json daygrid LICENSE.txt README.md main.css main.d.ts main.esm.js main.js main.min.css main.min.js package.json google-calendar LICENSE.txt README.md main.d.ts main.esm.js main.js main.min.js package.json interaction LICENSE.txt README.md main.d.ts main.esm.js main.js main.min.js package.json list LICENSE.txt README.md main.css main.d.ts main.esm.js main.js main.min.css main.min.js package.json luxon LICENSE.txt README.md main.d.ts main.esm.js main.js main.min.js package.json moment-timezone LICENSE.txt README.md main.d.ts main.esm.js main.js main.min.js package.json moment LICENSE.txt README.md main.d.ts main.esm.js main.js main.min.js package.json rrule LICENSE.txt README.md main.d.ts main.esm.js main.js main.min.js package.json timegrid LICENSE.txt README.md main.css main.d.ts main.esm.js main.js main.min.css main.min.js package.json vendor rrule.js idle-timer .travis.yml CHANGELOG.md CONTRIBUTING.md Gruntfile.js README.md bower.json demos autologout.html autologoutsync.html defaultbinding.html index.html respond.proxy.js dist idle-timer.0.9.3.js idle-timer.0.9.3.min.js idle-timer.1.0.0.js idle-timer.1.0.0.min.js idle-timer.1.0.1.js idle-timer.1.0.1.min.js idle-timer.1.1.0.js idle-timer.1.1.0.min.js idle-timer.js idle-timer.min.js idle-timer.jquery.json jquery-idletimer.sln libs jquery-loader.js jquery jquery.js qunit qunit.css qunit.js package.json src idle-timer.js test idle-timer.html idle-timer_test.js jquery-slimscroll jquery.slimscroll.js jquery.slimscroll.min.js jquery-sparkline jquery.sparkline.min.js jquery jquery-3.4.1.min.js nvd3 nv.d3.css nv.d3.js nv.d3.min.css nv.d3.min.js package-lock.json select2 css select2.css select2.min.css js i18n af.js ar.js az.js bg.js bn.js bs.js ca.js cs.js da.js de.js dsb.js el.js en.js es.js et.js eu.js fa.js fi.js fr.js gl.js he.js hi.js hr.js hsb.js hu.js hy.js id.js is.js it.js ja.js ka.js km.js ko.js lt.js lv.js mk.js ms.js nb.js ne.js nl.js pl.js ps.js pt-BR.js pt.js ro.js ru.js sk.js sl.js sq.js sr-Cyrl.js sr.js sv.js th.js tk.js tr.js uk.js vi.js zh-CN.js zh-TW.js select2.full.js select2.full.min.js select2.js select2.min.js treejs jstree.js jstree.min.js themes default-dark style.css style.min.css default style.css style.min.css sweetalert jquery.sweet-alert.custom.js sweetalert-dev.js sweetalert.css sweetalert.min.js tagify .github ISSUE_TEMPLATE bug_report.md feature_request.md help-with-something.md README.md dist jQuery.tagify.min.js react.tagify.js tagify.css tagify.min.js tagify.polyfills.min.js docs codepen.css codepen.js logo.svg readme-header.svg gulpfile.js index.html jest-puppeteer.config.js package.json roadmap.md src parts EventDispatcher.js defaults.js dropdown.js events.js helpers.js templates.js polyfills Array.findIndex.js Array.includes.js Array.some.js AutoUrlDetect.js Element.classList.js Element.closest.js Element.matches.js Event.js NodeList.forEach.js Object.assign.js String.includes.js String.trim.js es6-promise.js react.tagify.js tagify.css tagify.js tagify.polyfills.js timepicker bootstrap-timepicker.min.css bootstrap-timepicker.min.js change-password.php commentbypost.php comments.php contactus.php contactview.php cookies-policy.php edit_category_sample.php editcomment.php editor.php editorchoice.php editpost.php editsubcomment.php edittag.php edituser.php followusers.php inc page_footer.php page_header.php sidebar.php index.php inputletter.php login.php logout.php metamask.php nav.php newsletter.php php add-post.php addCategory_sample.php addTag.php addcomment.php adduser.php block.php blockmeta.php blockpost.php controllerUserData.php deletecomments.php deletepost.php deletesubcomment.php deletetag.php deleteuser.php drawchart.php drawchart2.php edit-comment.php edit-post.php edit-subcomment.php edit-tag.php edit-user.php editCategory_sample.php editicons.php editlogo.php mail.php reply-comment.php trashpost.php trashretrieve.php unblock.php unblockmeta.php unblockpost.php update_terms.php updateabout.php updatec-policy.php updatep_policy.php updatepass.php upsocial.php postlike.php privacy-policy.php replycomment.php savepost.php sendmail.php social.php terms.php trash-stories.php viewcomments.php viewlogo.php viewpost.php viewuser.php | |-----------------| add the SVG elements for each boxPlot |:---------:| dist .vscode settings.json index.html dist2 index.html edit-story.php edit-story2.php email template index.html reset.html verify.html extra.php MODAL STYLE follow_action.php followers.php following.php forgot-password.php frontend web3-login.js web3-modal.js header.php home.php home2.php idriss.html inbox.php include components editorChoice.php editorPicks.php newsletter.php profileHeaderDetails.php profilePageLeftDiv.php relatedPosts.php tags.php topics.php trendingPosts.php footer.php header.php side-menu-medium-bottom.php side-menu-medium-top.php side-menu-medium.php sidebar.php signup-user.php index.php loadMoreViewsData.php login-user-mm.php login-user-mm2.php login-user.php logout-user.php metamask_login.html more-loading.css new-password.php notifications.php package-lock.json password-changed.php php add-contact-us.php addComments.php addSubcomments.php addTag.php addmetaaddress.php argent.php autosave_stories.php changestatusmeta.php controllerUserData.php crowd_funding.php deleteStory.php deletecomment.php deletesubcomment.php draft_article_sort.php draft_article_sort2.php edit-settings.php fetchAddressToName.php followUser.php follow_action.php followtopic.php for_you_content.php getTags.php likePost.php loadMoreDraftData.php loadMoreFollowerData.php loadMoreFollowingData.php loadMoreFollowingPost.php loadMoreLatestPost.php loadMoreProfilePost.php loadMorePublishedData.php loadMoreReadingPost.php loadMoreRecommendedPost.php loadMoreScheduleData.php loadMoreSearchData.php loadMoreTopicPost.php loadMoreUnlistedData.php loadMoreViewsData.php neo-login.php publish_stories.php pulished_article_sort.php pulished_article_sort2.php queryPHP.php registeruser.php routes.php savePost.php schedule_article_sort.php schedule_cron.php unfollowUser.php unfollowtopic.php unlikePost.php unlink.php unlisted_article_sort.php unsavePost.php unstoppableLogin.php update_autosave_story.php updatemetaaddress.php uploadDonate.php uploadDonateNeo.php uploadIpfs.php withdraw_fund.php new code add new code end social media setting start privacy-policy.php profile.php profile2.php reading-list.php reading-list2.php reset-code.php router.php routes.php search.php search2.php signup-user.php signup-user2.php single-post.php success model new code start transation success code start transation success code end single-post2.php sitemap.php stories.php stories2.php style.css terms_of_use.php test.json test.php text.php theme medium-single-theme-0.php medium-single-theme-5.php theme-0.php theme-1.php theme-2.php theme-3.php theme-4.php theme-5.php topic.php topic2.php transaction-examples package.json send-tokens-deconstructed.js send-tokens-easy.js trending-post.php user-otp.php user-settings.php twitter instagram linkedin facebook user-settings2.php user-stats.php user-stats2.php withdraw-fund.php withdraw-fund2.php
# FullCalendar Luxon Plugin A connector to the Luxon date library [View the docs &raquo;](https://fullcalendar.io/docs/luxon-plugin) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # FullCalendar Time Grid Plugin Display your events on a grid of time slots [View the docs &raquo;](https://fullcalendar.io/docs/timegrid-view) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # FullCalendar Day Grid Plugin Display events on Month view or DayGrid view [View the docs &raquo;](https://fullcalendar.io/docs/month-view) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) ![Dropify](src/images/cover.jpg) Dropify ========= Override your input files with style. Demo here : [http://jeremyfagis.github.io/dropify](http://jeremyfagis.github.io/dropify/) ## Dependency [jQuery](https://github.com/jquery/jquery) is required to do the magic. ## Installation Clone the project in your workspace $ git clone git@github.com:JeremyFagis/dropify.git $ cd dropify Download packages $ npm install Compile assets $ gulp build ## Compilation # All compilations and watch. You will have minified and not minified files. $ gulp # Dev compilation (watch & no-minification) $ gulp --dev # Prod compilation, you will have minified and not minified files $ gulp build # Prod compilation, you will have only minified files $ gulp build --dev ## NPM Package [www.npmjs.com/package/dropify](https://www.npmjs.com/package/dropify) ## Usage You have to include __[dist/js/dropify.js](dist/js/dropify.js)__, __[dist/css/dropify.css](dist/css/dropify.css)__ and __dist/fonts/*__ to your project, then you juste have to init the jQuery plugin like that : ```javascript $('.dropify').dropify(); ``` ## Options * __defaultFile:__ If there is a default file on the input. You can use options when you use the plugin or directly __data-default-file="url_of_your_file"__ on you DOM element (it's recommended). ```html <input type="file" class="dropify" data-default-file="url_of_your_file" /> ``` * __height:__ Set the height of your dropify element. For exemple you want 300px height, you have to add the attribute __data-height="300"__ on your DOM element. ```html <input type="file" class="dropify" data-height="300" /> ``` * __maxFileSize:__ Set the max filesize of the uploaded document. An error will be display if the file size is bigger than the option. You can use unit like K, M and G. ```html <input type="file" class="dropify" data-max-file-size="3M" /> ``` * __minWidth:__ Set the min width allowed. An error will be display if the width is smaller than the option. ```html <input type="file" class="dropify" data-min-width="400" /> ``` * __maxWidth:__ Set the max width allowed. An error will be display if the width is bigger than the option. ```html <input type="file" class="dropify" data-max-width="1000" /> ``` * __minHeight:__ Set the min height allowed. An error will be display if the width is smaller than the option. ```html <input type="file" class="dropify" data-min-height="400" /> ``` * __maxHeight:__ Set the max height allowed. An error will be display if the width is bigger than the option. ```html <input type="file" class="dropify" data-max-height="1000" /> ``` * __disabled:__ You can disable the input if you add the attr __disabled="disabled"__. ```html <input type="file" class="dropify" disabled="disabled" /> ``` * __showRemove:__ You can hide the remove button if you add the attr __data-show-remove="false"__. Default: true. ```html <input type="file" class="dropify" data-show-remove="false" /> ``` * __showLoader:__ You can hide the loader if you add the attr __data-show-loader="false"__. Default: true. ```html <input type="file" class="dropify" data-show-loader="false" /> ``` * __showErrors:__ You can hide errors if you add the attr __data-show-loader="false"__. Default: true. ```html <input type="file" class="dropify" data-show-errors="true" /> ``` * __errorsPosition:__ You can choose where you want to display the errors, overlay or outside. Default: overlay. ```html <input type="file" class="dropify" data-errors-position="outside" /> ``` * __allowedFormats:__ You can allow/deny pictures formats. If you add the attr __data-allowed-formats="portrait square"__ only portrait and square picture will be allowed. Default: ['portrait', 'square', 'landscape']. ```html <input type="file" class="dropify" data-allowed-formats="portrait square" /> ``` * __messages:__ You can translate default messages. You juste have to add an options array when you init the plugin. This messages will be replaced in the __tpl__ option. ```javascript $('.dropify').dropify({ messages: { 'default': 'Drag and drop a file here or click', 'replace': 'Drag and drop or click to replace', 'remove': 'Remove', 'error': 'Ooops, something wrong appended.' } } ``` * __error:__ You can translate default errors messages. You juste have to add an options array when you init the plugin. __{{ value }}__ text will be replaced by the option. ```javascript $('.dropify').dropify({ error: { 'fileSize': 'The file size is too big ({{ value }} max).', 'minWidth': 'The image width is too small ({{ value }}}px min).', 'maxWidth': 'The image width is too big ({{ value }}}px max).', 'minHeight': 'The image height is too small ({{ value }}}px min).', 'maxHeight': 'The image height is too big ({{ value }}px max).', 'imageFormat': 'The image format is not allowed ({{ value }} only).' } } ``` * __tpl:__ You can update default template. You juste have to add an options array when you init the plugin. ```javascript $('.dropify').dropify({ tpl: { wrap: '<div class="dropify-wrapper"></div>', loader: '<div class="dropify-loader"></div>', message: '<div class="dropify-message"><span class="file-icon" /> <p>{{ default }}</p></div>', preview: '<div class="dropify-preview"><span class="dropify-render"></span><div class="dropify-infos"><div class="dropify-infos-inner"><p class="dropify-infos-message">{{ replace }}</p></div></div></div>', filename: '<p class="dropify-filename"><span class="file-icon"></span> <span class="dropify-filename-inner"></span></p>', clearButton: '<button type="button" class="dropify-clear">{{ remove }}</button>', errorLine: '<p class="dropify-error">{{ error }}</p>', errorsContainer: '<div class="dropify-errors-container"><ul></ul></div>' } } ``` ## Events * __dropify.beforeClear:__ This event is called when you click on the "remove" button, just before clearing the Dropify. You can access to all the Dropify object properties using __element.xxxx__. See how to use it. ```javascript var drEvent = $('.dropify').dropify(); drEvent.on('dropify.beforeClear', function(event, element){ return confirm("Do you really want to delete \"" + element.filename + "\" ?"); }); ``` * __dropify.afterClear:__ This event is called after the Dropify is clear. You can access to all the Dropify object properties using __element.xxxx__. See how to use it. ```javascript var drEvent = $('.dropify').dropify(); drEvent.on('dropify.afterClear', function(event, element){ alert('File deleted'); }); ``` * __dropify.errors:__ This event is called when there is one or more error during process. See how to use it. ```javascript var drEvent = $('.dropify').dropify(); drEvent.on('dropify.errors', function(event, element){ alert('Has Errors!'); }); ``` * __dropify.error.xxxxx:__ In addition to the event __dropify.errors:__, you can bind errors events one by one. See how to use it. ```javascript var drEvent = $('.dropify').dropify(); drEvent.on('dropify.error.fileSize', function(event, element){ alert('Filesize error message!'); }); drEvent.on('dropify.error.minWidth', function(event, element){ alert('Min width error message!'); }); drEvent.on('dropify.error.maxWidth', function(event, element){ alert('Max width error message!'); }); drEvent.on('dropify.error.minHeight', function(event, element){ alert('Min height error message!'); }); drEvent.on('dropify.error.maxHeight', function(event, element){ alert('Max height error message!'); }); drEvent.on('dropify.error.imageFormat', function(event, element){ alert('Image format error message!'); }); ``` CKEditor 4 ========== Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. https://ckeditor.com - See LICENSE.md for license information. CKEditor 4 is a text editor to be used inside web pages. It's not a replacement for desktop text editors like Word or OpenOffice, but a component to be used as part of web applications and websites. ## Documentation The full editor documentation is available online at the following address: https://ckeditor.com/docs/ ## Installation Installing CKEditor is an easy task. Just follow these simple steps: 1. **Download** the latest version from the CKEditor website: https://ckeditor.com. You should have already completed this step, but be sure you have the very latest version. 2. **Extract** (decompress) the downloaded file into the root of your website. **Note:** CKEditor is by default installed in the `ckeditor` folder. You can place the files in whichever you want though. ## Checking Your Installation The editor comes with a few sample pages that can be used to verify that installation proceeded properly. Take a look at the `samples` directory. To test your installation, just call the following page at your website: http://<your site>/<CKEditor installation path>/samples/index.html For example: http://www.example.com/ckeditor/samples/index.html # FullCalendar Core Package Provides core functionality, including the Calendar class [View the docs &raquo;](https://fullcalendar.io/docs/initialize-es6) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # FullCalendar List View Plugin View your events as a bulleted list [View the docs &raquo;](https://fullcalendar.io/docs/list-view) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # FullCalendar RRule Plugin A connector to the RRule library, for recurring events [View the docs &raquo;](https://fullcalendar.io/docs/rrule-plugin) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) jQuery Idle Timer Plugin ======================== [![Build Status](https://travis-ci.org/thorst/jquery-idletimer.svg?branch=master)](https://travis-ci.org/thorst/jquery-idletimer) [![Dependency Status](https://david-dm.org/thorst/jquery-idletimer.svg?theme=shields.io)](https://david-dm.org/thorst/jquery-idletimer) [![devDependency Status](https://david-dm.org/thorst/jquery-idletimer/dev-status.svg?theme=shields.io)](https://david-dm.org/thorst/jquery-idletimer#info=devDependencies) [![Coverage Status](http://img.shields.io/coveralls/thorst/jquery-idletimer.svg)](https://coveralls.io/r/thorst/jquery-idletimer?branch=master) Demo -------- https://thorst.github.io/jquery-idletimer/index.html Download -------- * [Compressed ~3kb](https://raw.github.com/thorst/jquery-idletimer/master/dist/idle-timer.min.js) * [Uncompressed ~11kb](https://raw.github.com/thorst/jquery-idletimer/master/dist/idle-timer.js) Purpose ------- Fires a custom event when the user is "idle". Idle is defined by not... * moving the mouse * scrolling the mouse wheel * using the keyboard Usage ----- There are two ways to instantiate. Either statically, or on an element. Element bound timers will only watch for events inside of them. You may just want page-level activity, in which case you may set up your timers on `document`, `document.documentElement`, and `document.body`. Instantiate returns jQuery for chaining. ```javascript $(function() { // binds to document - shorthand $.idleTimer(); // binds to document - explicit $( document ).idleTimer(); // bind to different element $( "#myTextArea" ).idleTimer(); }); ``` Options ----- You can configure the settings several ways ```javascript $(function() { // idleTimer() with all defaults $( document ).idleTimer( ); // idleTimer() takes an optional numeric argument that defines just the idle timeout // timeout is in milliseconds $( document ).idleTimer( 10000 ); // idleTimer() takes an optional object argument that defines any/all setting $( document ).idleTimer( { timeout:10000, idle:true }); /* * Here are the possible settings * you can omit any or all of them */ // indicates if the user is idle idle [default:false] // the timeout period timeout [default:30000] // activity is any one of these events events [default:'mousemove keydown wheel DOMMouseScroll mousewheel mousedown touchstart touchmove MSPointerDown MSPointerMove'] // If set, the use a localStorage key to sync activity across browser tabs/windows timerSyncId [default:null] }); ``` Events ----- When a users state changes a custom events get triggered. There are several parameters passed to your handler for you to use. ```javascript $(function() { $( document ).on( "idle.idleTimer", function(event, elem, obj){ // function you want to fire when the user goes idle }); $( document ).on( "active.idleTimer", function(event, elem, obj, triggerevent){ // function you want to fire when the user becomes active again }); /* * Here are the arguments */ // event // will be either idle.idleTimer or active.idleTimer // use event.stopPropagation(); to stop element from bubbling up to document // elem // is the element that the event was triggered on // obj // is a copy of the internal data used by idleTimer // triggerevent // is the initial event that triggered the element to become active // obviously for idle state this will be undefined }); ``` Methods ----- There are several methods to invoke ```javascript $(function() { // stop the timer, removes data, removes event bindings // to come back from this you will need to instantiate again // returns: jQuery $( document ).idleTimer("destroy"); // save remaining time, and stops the timer // returns: jQuery $( document ).idleTimer("pause"); // starts timer with remaining time // returns: jQuery $( document ).idleTimer("resume"); // restore initial idle state, and restart the timer // returns: jQuery $( document ).idleTimer("reset"); // get time left until idle, if idle return 0 // returns: number $( document ).idleTimer("getRemainingTime"); // get time elapsed (in ms) since the user went idle/active // if idle, how have you been idle, if active, how long have you been active // returns: number $( document ).idleTimer("getElapsedTime"); // get time last active event fired // returns: number $( document ).idleTimer("getLastActiveTime"); // you can also query if it's "idle" or "active" // returns: bool $( document ).idleTimer("isIdle"); }); ``` Pre-Req ------- jQuery 1.7 (tested with 1.11.0) Intended Browser Support ------- ####Desktop * >=IE8 * Firefox n-1 * Chrome n-1 * Safari n ####Mobile * iOS n-1 * Android (version?) * Windows Phone IEMobile/10.0 Links ------- * [jQuery plugin repo listing](http://plugins.jquery.com/idle-timer/) * [cdn](http://cdnjs.com/libraries/jquery-idletimer/) * [nuget]() - coming soon * [Eric Hynds Idle Timeout plugin](https://github.com/ehynds/jquery-idle-timeout) (note we have similar functionality [here](http://thorst.github.io/jquery-idletimer/prod/demos/autologout.html)) Playground ------- * [js fiddle](http://jsfiddle.net/thorst/2aGL4/) * [css deck](http://cssdeck.com/labs/sosoro3m) Version History ------- | Version | Author | Released | Links | | --------------------------------------- |-----------------| ---------- | ----------------------------- | | [1.0.0](https://raw.github.com/thorst/jquery-idletimer/master/dist/idle-timer.1.0.0.min.js) | Todd Horst | 03/10/2014 | [Change Log](CHANGELOG.md) - [Breaking Changes](CHANGELOG.md#breaking-changes) | | [0.9.3](https://raw.github.com/thorst/jquery-idletimer/master/dist/idle-timer.0.9.3.min.js) | Mike Sherov | 08/04/2013 | Author History ------- * Nicholas C. Zakas (yui Version) [idleTimer Blog](http://www.nczonline.net/blog/2009/06/02/detecting-if-the-user-is-idle-with-javascript-and-yui-3/) | [Github Profile](https://github.com/nzakas) | [Github](https://github.com/nzakas/jstools/) * Paul Irish (initial jQuery Version) [idleTimer Blog](http://paulirish.com/2009/jquery-idletimer-plugin/) | [Github Profile](https://github.com/paulirish) | [Github](https://github.com/paulirish/jquery-idletimer/) * Mike Sherov (transfered from Paul) [Github Profile](https://github.com/mikesherov) * Todd Horst (transfered from Mike) [Github Profile](https://github.com/thorst) Bug? ------- Please create a [fiddle](http://jsfiddle.net/thorst/2aGL4/4/) and [submit a ticket](https://github.com/thorst/jquery-idletimer/issues/new) ![Logo](https://pinkpaper.xyz/img/logo.png) # Pink Papers Start curating your thoughts in a decentralized and autonomous environment for your communities to browse without perjury and risk of prosecution from anywhere around the globe. ## How to Connect First you have to install [metamask extension](https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en) or metamask software to connect with network - Press login button and login with metamask. - After successfull login, enter your name and email id. - After email id you get an otp on your email for verification, enter otp and verify your email. - Now you are ready to write your stories or article. ## How to write story - Go to the profile menu and click on "write a story". - Write story title. - Write your article. You can select words to show headings type and other editor menu. - Click on Main Settings and select an image for story. - You can pin your story on homepage or you can unlist it. - Enter metatag seperation with , ex:- newkeyword,mars,hello - Click published button to publish your article. - After successfull published you can see your story on homepage. ## How to Donate Contributions are always welcome! #### If you want to donate some crypto to author you can follow this process - - Click on donate button, make sure you are on required network. - Select your amount would you like to donate to author. - Press donate button, a popup will appear on your screen for confirmation, click ok to confirm it. - After successfull donation a thank you popup will appear with transaction ID. - You can click the transaction ID to view your transaction details. ## Contributions Contributions are welcomed :) # bootstrap-material-datetimepicker Material DateTimePicker Originaly designed for Bootstrap Material, the V2.0 is now completely standalone and responsive. ### Updates | Date | Author | Description | | ----------------- | ----------------- | ------------------------------------------------------ | | 2016-04-08 | donovansolms | Disable specific days (#60 and #97) | | 2016-04-08 | T00rk | Fixed #85 | | 2016-04-08 | FoxyCorndog | Fix PM overwrite bug | | 2016-02-17 | T00rk | Changed Clock to SVG | | 2016-02-04 | T00rk | Added a "Now" button (#38) | | 2016-01-30 | T00rk | Switch view on click (#39, #47) | | 2016-01-29 | T00rk | Added "clear button" (#48) | | 2016-01-29 | T00rk | Replace rem by em (#26) | | 2016-01-29 | T00rk | Display 24H clock (#54) | | 2016-01-29 | T00rk | Close on "ESC" (#52) | | 2015-10-19 | drblue | Fixed erroneous package.json-file | | 2015-10-19 | Perdona | Fix auto resize when month has 6 weeks | | 2015-07-01 | T00rk | Redesigned element without using modal | | 2015-06-16 | T00rk | Use Timepicker alone / Display short time (12 hours) | | 2015-06-13 | T00rk | Fixed issue with HTML value tag | | 2015-05-25 | T00rk | Changed repo name to bootstrap-material-datetimepicker * | | 2015-05-12 | T00rk | Added parameters for button text | | 2015-05-05 | Sovanna | FIX undefined _minDate in isBeforeMaxDate func | | 2015-04-10 | T00rk | Little change in clock design | | 2015-04-10 | Peterzen | Added bower and requirejs support | | 2015-04-08 | T00rk | Fixed problem on locale switch | | 2015-03-04 | T00rk | Added Time picker | (\*) File names have been changed bootstrap-material-datepicker.js => bootstrap-material-date**time**picker.js bootstrap-material-datepicker.css => bootstrap-material-date**time**picker.css ### Prerequisites jquery [http://jquery.com/download/](http://jquery.com/download/) momentjs [http://momentjs.com/](http://momentjs.com/) Google Material Icon Font `<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">` ### Live Example [Live example](http://t00rk.github.io/bootstrap-material-datetimepicker/) ### Usage $('input').bootstrapMaterialDatePicker(); ### bower bower install bootstrap-material-datetimepicker ### Parameters | Name | Type | Description | | ----------------- | ----------------------------- | --------------------------------------------- | | **format** | String | MomentJS Format | | **shortTime** | Boolean | true => Display 12 hours AM|PM | | **minDate** | (String\|Date\|Moment) | Minimum selectable date | | **maxDate** | (String\|Date\|Moment) | Maximum selectable date | | **currentDate** | (String\|Date\|Moment) | Initial Date | | **year** | Boolean | true => Has Yearpicker | | **date** | Boolean | true => Has Datepicker | | **disabledDays** | Array | Array containing day indices (1-7) to disable | | **time** | Boolean | true => Has Timepicker | | **clearButton** | Boolean | true => Show Clear Button | | **nowButton** | Boolean | true => Show Now Button | | **switchOnClick** | Boolean | true => Switch view on click (default: false) | | **cancelText** | String | Text for the cancel button (default: Cancel) | | **okText** | String | Text for the OK button (default: OK) | | **clearText** | String | Text for the Clear button (default: Clear) | | **nowText** | String | Text for the Now button (default: Now) | | **triggerEvent** | String | Event to fire the calendar (default: focus) | | **monthPicker** | Boolean | true => Act as monthpicker (hide calendar) (default: false) | ### Events | Name | Parameters | Description | | ----------------- | ------------------------- | ------------------------------------------------- | | **beforeChange** | event, date | OK button is clicked | | **change** | event, date | OK button is clicked and input value is changed | | **yearSelected** | event, date | New year is selected | | **dateSelected** | event, date | New date is selected | | **open** | event | datepicker is opened | | **close** | event | datepicker is closed | ### Methods $('input').bootstrapMaterialDatePicker('setDate', moment()); | Name | Parameter | Description | | ----------------- | ------------------------- | ----------------------------- | | **setDate** | (String\|Date\|Moment) | Set initial date | | **setMinDate** | (String\|Date\|Moment) | Set minimum selectable date | | **setMaxDate** | (String\|Date\|Moment) | Set maximum selectable date | | **destroy** | NULL | Destroy the datepicker | # FullCalendar Bootstrap Plugin Bootstrap 4 theming for your calendar [View the docs &raquo;](https://fullcalendar.io/docs/bootstrap-theme) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # Emojione for CKEditor This plugin integrates the emojione library into the CKEditor. The plugin allows you to add all known emojis into your content in unicode format. Plugin on the [CKEditor website](http://ckeditor.com/addon/emojione) Try our [Demo](http://ckeditor-emojione-demo.braune-digital.com) You can install the dependencies and the plugin with bower: ``` bower install ckeditor bower install emojione bower install ckeditor-emojione ``` After that you can register the plugin within your CKeditor configuration: ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>CKEditor</title> <script src="bower_components/emojione/lib/js/emojione.js"></script> <script src="bower_components/ckeditor/ckeditor.js"></script> </head> <body> <form> <textarea name="editor" id="editor" rows="10" cols="80"> This is my textarea to be replaced with CKEditor. </textarea> <script> CKEDITOR.plugins.addExternal('emojione', '../../bower_components/ckeditor-emojione/', 'plugin.js'); CKEDITOR.config.extraPlugins = 'emojione'; CKEDITOR.replace( 'editor' ); </script> </form> </body> </html> ``` This addon has been inspired by the [smiley plugin](https://github.com/ckeditor/ckeditor-dev/tree/master/plugins/smiley) and added support for native emojis. # FullCalendar Google Calendar Plugin Fetch events from a public Google Calendar feed [View the docs &raquo;](https://fullcalendar.io/docs/google-calendar) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # FullCalendar Interaction Plugin Provides functionality for event drag-n-drop, resizing, dateClick, and selectable actions [View the docs &raquo;](https://fullcalendar.io/docs/editable) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # FullCalendar Moment Plugin A connector to the MomentJS date library [View the docs &raquo;](https://fullcalendar.io/docs/moment-plugins) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # Add-on Installation Instructions Enable the plugin by using the extraPlugins configuration setting ``` config.extraPlugins = 'simplebutton'; ``` If you use `sourcedialog` plugin, you need to enable `allowedContent` option ``` config.allowedContent = true; ``` # Add item with custom toolbar ``` config.toolbar = [ ... { name: 'other', items: ['simplebutton'] } ] ``` # My other plugin [Video Snapshot](http://train255.github.io/videosnapshot/) # Datetimepicker for Bootstrap 4 [![Build Status](https://travis-ci.org/pingcheng/bootstrap4-datetimepicker.svg?branch=master)](https://travis-ci.org/pingcheng/bootstrap4-datetimepicker) The js and css files had been changed to the suit Bootstrap v4. Since Bootstrap 4 removed the glyphicon, I replaced all icons with font-awesome v4, please includes the font-awesome css as well. You can override font icon class like this - ```js // Using font-awesome 5 icons $.extend(true, $.fn.datetimepicker.defaults, { icons: { time: 'far fa-clock', date: 'far fa-calendar', up: 'fas fa-arrow-up', down: 'fas fa-arrow-down', previous: 'fas fa-chevron-left', next: 'fas fa-chevron-right', today: 'fas fa-calendar-check', clear: 'far fa-trash-alt', close: 'far fa-times-circle' } }); ``` Click [here](http://eonasdan.github.io/bootstrap-datetimepicker/) for the official usage documentation. ## Install ``` npm install pc-bootstrap4-datetimepicker ``` ## Changes * JS DOM class name control * CSS stylesheet * Replaced glyphicon with font-awesome icons # FullCalendar Moment Timezone Plugin A connector to the moment-timezone library [View the docs &raquo;](https://fullcalendar.io/docs/moment-plugins#moment-timezone) This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar) # Wickedpicker ## wickedpicker.js - A simple jQuery timepicker ## Requirements * [jQuery](http://jquery.com/download/) (>= 1.9) ## Installation ```shell $ bower install wickedpicker ``` ## Usage #### In your HTML ```html <body> .... <input type="text" name="timepicker" class="timepicker"/> .... <script type="text/javascript" src="jquery-1.11.3.min.js"></script> <script type="text/javascript" src="wickedpicker.js"></script> </body> ``` #### In your JavaScript file ```javascript $('.timepicker').wickedpicker(); ``` #### Options ```javascript var options = { now: "12:35", //hh:mm 24 hour format only, defaults to current time twentyFour: false, //Display 24 hour format, defaults to false upArrow: 'wickedpicker__controls__control-up', //The up arrow class selector to use, for custom CSS downArrow: 'wickedpicker__controls__control-down', //The down arrow class selector to use, for custom CSS close: 'wickedpicker__close', //The close class selector to use, for custom CSS hoverState: 'hover-state', //The hover state class to use, for custom CSS title: 'Timepicker', //The Wickedpicker's title, showSeconds: false, //Whether or not to show seconds, timeSeparator: ' : ', // The string to put in between hours and minutes (and seconds) secondsInterval: 1, //Change interval for seconds, defaults to 1, minutesInterval: 1, //Change interval for minutes, defaults to 1 beforeShow: null, //A function to be called before the Wickedpicker is shown afterShow: null, //A function to be called after the Wickedpicker is closed/hidden show: null, //A function to be called when the Wickedpicker is shown clearable: false, //Make the picker's input clearable (has clickable "x") }; $('.timepicker').wickedpicker(options); ``` #### Methods 'time' get the current time inside of the input element that has a wickedpicker attached to it. ```javascript $('.timepicker').wickedpicker('time'); ``` If multiple input fields have the same class and instantiate a wickedpicker then pass the index of the timepicker you'd like to select ```javascript $('.timepicker').wickedpicker('time', 0); ``` #### Functionality The Wickedpicker opens when the bound input is clicked, or focused on (try tabbing), and it can be closed by either clicking the X, by clicking outside of it, or by pressing esc. The arrows icons increase or decrease their associated time values or toggle the meridiem. The values can also be changed using the up and down keys when focused on. To move to the next value just press the left or right arrow key. For more checkout [Wickedpicker gh-pages](http://ericjgagnon.github.io/wickedpicker/) ## License Copyright (c) 2015-2016 Eric Gagnon Licensed under the MIT license. # FullCalendar [![Build Status](https://travis-ci.com/fullcalendar/fullcalendar.svg?branch=master)](https://travis-ci.com/fullcalendar/fullcalendar) A full-sized drag & drop JavaScript event calendar - [Project website and demos](http://fullcalendar.io/) - [Documentation](http://fullcalendar.io/docs) - [Support](http://fullcalendar.io/support) - [Contributing](CONTRIBUTING.md) - [Changelog](CHANGELOG.md) - [License](LICENSE.txt) *From the blog*: [Changes in the Upcoming v5](https://fullcalendar.io/blog/2020/02/changes-in-the-upcoming-v5) <h1 align="center"> <a href='https://yaireo.github.io/tagify'><img src="/docs/readme-header.svg" width="320" height="160"><a/> <br><br> <a href='https://yaireo.github.io/tagify'>Tagify</a> - <em>tags</em> input component </h1> <p align="center"> Transforms an input field or a textarea into a <em>Tags component</em>, in an easy, customizable way, with great performance and small code footprint, exploded with features. <br> <strong>Vanilla</strong> ⚡ <strong>React</strong> ⚡ <strong>Vue</strong> ⚡ <strong>Angular</strong> <p> <h3 align="center"> 👉 <a href="https://yaireo.github.io/tagify">See Demos</a> 👈 </h3> <p align="center"> <a href='https://www.npmjs.com/package/@yaireo/tagify'> <img src="https://img.shields.io/npm/v/@yaireo/tagify.svg" /> </a> <a href='https://simple.wikipedia.org/wiki/MIT_License'> <img src="https://img.shields.io/badge/license-MIT-lightgrey" /> </a> <img src="https://img.shields.io/bundlephobia/minzip/@yaireo/tagify" /> <img src="https://img.shields.io/npm/dw/@yaireo/tagify" /> </p> <p align="center"> <img src="/docs/mix3.gif?sanitize=true" /> <img src="/docs/demo.gif?sanitize=true" /> </p> ## Table of Contents <!--ts--> - [Table of Contents](#table-of-contents) - [Installation](#installation) - [Usage (in your bundle):](#usage-in-your-bundle) - [Features](#features) - [Building the project](#building-the-project) - [Adding tags dynamically](#adding-tags-dynamically) - [Output value](#output-value) - [Modify original input value format](#modify-original-input-value-format) - [Ajax whitelist](#ajax-whitelist) - [Edit tags](#edit-tags) - [Drag & Sort](#drag--sort) - [Integration example:](#integration-example) - [DOM Templates](#dom-templates) - [Suggestions selectbox](#suggestions-selectbox) - [Example for a suggestion item alias](#example-for-a-suggestion-item-alias) - [Example whitelist:](#example-whitelist) - [Mixed-Content](#mixed-content) - [Single-Value](#single-value) - [React](#react) - [Update regarding `onChange` prop:](#update-regarding-onchange-prop) - [Updating the component's state](#updating-the-components-state) - [jQuery version](#jquery-version) - [CSS Variables](#css-variables) - [Full list of Tagify's SCSS variables](#full-list-of-tagifys-scss-variables) - [Methods](#methods) - [Events](#events) - [Hooks](#hooks) - [Settings](#settings) <!--te--> ## Installation ```sh npm i @yaireo/tagify --save ``` ### Usage (in your bundle): [live demo using Parcel as bundler](https://codesandbox.io/s/simple-tagify-setup-6pfi2) ```js import Tagify from '@yaireo/tagify' var tagify = new Tagify(...) ``` > Don't forget to **include `tagify.css`** file in your project. > CSS location: `@yaireo/tagify/dist/tagify.css` > SCSS location: `@yaireo/tagify/src/tagify.scss` > [See SCSS usecase & example](https://github.com/yairEO/tagify/pull/282) ## Features * Can be applied on input & textarea elements * Supports [mix content](#mixed-content) (text and tags together) * Supports [single-value](#single-value) mode (like `<select>`) * Supports whitelist/blacklist * Supports Templates for: <em>component wrapper</em>, <em>tag items</em>, <em>suggestion list</em> & <em>suggestion items</em> * Shows suggestions selectbox (flexiable settings & styling) at *full (component) width* or *next to* the typed texted (caret) * Allows setting suggestions' [aliases](#example-for-a-suggestion-item-alias) for easier fuzzy-searching * Auto-suggest input as-you-type with ability to auto-complete * Can paste in multiple values: `tag 1, tag 2, tag 3` or even newline-separated tags * Tags can be created by Regex delimiter or by pressing the "Enter" key / focusing of the input * Validate tags by Regex *pattern* or by function * Tags may be [editable](#edit-tags) (double-click) * <del>ARIA accessibility support</del>(Component too generic for any meaningful ARIA) * Supports read-only mode to the whole componenet or per-tag * Each tag can have any properties desired (class, data-whatever, readonly...) * Automatically disallow duplicate tags (vis "settings" object) * Has built-in CSS loader, if needed (Ex. <em>AJAX</em> whitelist pulling) * Tags can be trimmed via `hellip` by giving `max-width` to the `tag` element in your `CSS` * Easily change direction to RTL (via the SCSS file) * Internet Explorer - A polyfill script should be used: `tagify.polyfills.min.js` (in `/dist`) * Many useful custom [events](#events) * Original input/textarea element values kept in sync with Tagify ## Building the project Simply run `gulp` in your terminal, from the project's path ([Gulp](https://gulpjs.com) should be installed first). Source files are this path: `/src/` Output files, which are automatically generated using Gulp, are in: `/dist/` The rest of the files are most likely irrelevant. ## Adding tags dynamically ```javascript var tagify = new Tagify(...); tagify.addTags(["banana", "orange", "apple"]) // or add tags with pre-defined propeties tagify.addTags([{value:"banana", color:"yellow"}, {value:"apple", color:"red"}, {value:"watermelon", color:"green"}]) ``` ## Output value There are two possible ways to get the value of the tags: 1. Access the tagify's instance's `value` prop: `tagify.value` (Array of tags) 2. Access the *original* input's value: `inputElm.value` (Stringified Array of tags) The most common way is to simply listen to the `change` event on the *original input* ```javascript var inputElm = document.querySelector, tagify = new Tagify (inputElm); inputElm.addEventListener('change', onChange) function onChange(e){ // outputs a String console.log(e.target.value) } ``` ### [Modify original input value format](https://jsbin.com/paxijaj/edit?html,js,output) Default format is a JSON string:<br> `'[{"value":"cat"}, {"value":"dog"}]'` I **recommend** keeping this because some situations might have values such as addresses (tags contain commas):<br> `'[{"value":"Apt. 2A, Jacksonville, FL 39404"}, {"value":"Forrest Ray, 191-103 Integer Rd., Corona New Mexico"}]'` Another example for complex tags state might be disabled tags, or ones with custom identifier *class*:<br> *(tags can be clicked, so delevopers can choose to use this to disable/enable tags)*<br> `'[{"value":"cat", "disabled":true}, {"value":"dog"}, {"value":"bird", "class":"color-green"}]'` To change the format, assuming your tags have no commas and are fairly simple: ```js var tagify = new Tagify(inputElm, { originalInputValueFormat: valuesArr => valuesArr.map(item => item.value).join(',') }) ``` **Output:**<br> `"cat,dog"` ## Ajax whitelist Dynamically-loaded suggestions list (*whitelist*) from the server (as the user types) is a frequent need to many. Tagify comes with its own loading animation, which is a very lightweight CSS-only code, and the <em>loading</em> state is controlled by the method `tagify.loading` which accepts `true` or `false` as arguments. Below is a basic example using the `fetch` API. I advise to abort the last request on any input before starting a new request. <details> <summary>Example:</summary> ```javascript var input = document.querySelector('input'), tagify = new Tagify(input, {whitelist:[]}), controller; // for aborting the call // listen to any keystrokes which modify tagify's input tagify.on('input', onInput) function onInput( e ){ var value = e.detail.value; tagify.settings.whitelist.length = 0; // reset the whitelist // https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort controller && controller.abort(); controller = new AbortController(); // show loading animation and hide the suggestions dropdown tagify.loading(true).dropdown.hide.call(tagify) fetch('http://get_suggestions.com?value=' + value, {signal:controller.signal}) .then(RES => RES.json()) .then(function(whitelist){ // update inwhitelist Array in-place tagify.settings.whitelist.splice(0, whitelist.length, ...whitelist) tagify.loading(false).dropdown.show.call(tagify, value); // render the suggestions dropdown }) } ``` </details> ## Edit tags Tags which aren't `read-only` can be edited by double-clicking them (by default) or by changing the `editTags` *setting* to `1`, making tags editable by single-clicking them. The value is saved on `blur` or by pressing `enter` key. Pressing `Escape` will revert the change trigger `blur`. <kbd>ctrl</kbd><kbd>z</kbd> will revert the change if an edited tag was marked as not valid (perhaps duplicate or blacklisted) To prevent *all* tags from being allowed to be editable, set the `editTags` setting to `false` (or `null`).<br> To do the same but for specific tag(s), set those tags' data with `editable` property set to `false`: ```html <input value='[{"value":"foo", "editable":false}, {"value":"bar"}]'> ``` ## Drag & Sort To be able to sort tags by draging, a 3rd-party script is needed. I have made a very simple *drag & drop* (~`11kb` *unminified*) script which uses [HTML5 native API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API) and it is available to download via [NPM](https://www.npmjs.com/package/@yaireo/dragsort) or [Github](https://github.com/yairEO/dragsort) but any other *drag & drop* script may possibly work. I could not find in the whole internet a decent lightweight script. ### [Integration example](https://codepen.io/vsync/pen/jOqYOVJ): ```js var tagify = new Tagify(inputElement) // bind "DragSort" to Tagify's main element and tell // it that all the items with the below "selector" are "draggable" var dragsort = new DragSort(tagify.DOM.scope, { selector: '.'+tagify.settings.classNames.tag, callbacks: { dragEnd: onDragEnd } }) // must update Tagify's value according to the re-ordered nodes in the DOM function onDragEnd(elm){ tagify.updateValueByDOMTags() } ``` ## DOM Templates It's possible to control the templates for some of the HTML elements tagify is using by modifying the `settings.templates` Object with your own custom functions which **must return** an *HTML string*. Available templates are: `wrapper`, `tag`, `dropdown`, `dropdownItem` and the optional `dropdownItemNoMatch` which is a special template for rendering a suggestion item (in the dropdown list) only if there were no matches found for the typed input. [View templates](https://github.com/yairEO/tagify/blob/master/src/parts/templates.js) ## Suggestions selectbox The suggestions selectbox is shown is a whitelist Array of Strings or Objects was passed in the settings when the Tagify instance was created. Suggestions list will only be rendered if there are at least two matching suggestions (case-insensitive). The selectbox dropdown will be appended to the document's `<body>` element and will be rendered by default in a position below (bottom of) the Tagify element. Using the keyboard arrows up/down will highlight an option from the list, and hitting the Enter key to select. It is possible to tweak the selectbox dropdown via 2 settings: - `enabled` - this is a numeral value which tells Tagify when to show the suggestions dropdown, when a minimum of N characters were typed. - `maxItems` - Limits the number of items the suggestions selectbox will render ```javascript var input = document.querySelector('input'), tagify = new Tagify(input, { whitelist : ['aaa', 'aaab', 'aaabb', 'aaabc', 'aaabd', 'aaabe', 'aaac', 'aaacc'], dropdown : { classname : "color-blue", enabled : 0, // show the dropdown immediately on focus maxItems : 5, position : "text", // place the dropdown near the typed text closeOnSelect : false, // keep the dropdown open after selecting a suggestion highlightFirst: true } }); ``` <p align="center"><b>Will render</b></p> ```html <div class="tagify__dropdown tagify__dropdown--text" style="left:993.5px; top:106.375px; width:616px;"> <div class="tagify__dropdown__wrapper"> <div class="tagify__dropdown__item tagify__dropdown__item--active" value="aaab">aaab</div> <div class="tagify__dropdown__item" value="aaabb">aaabb</div> <div class="tagify__dropdown__item" value="aaabc">aaabc</div> <div class="tagify__dropdown__item" value="aaabd">aaabd</div> <div class="tagify__dropdown__item" value="aaabe">aaabe</div> </div> </div> ``` By default searching the suggestions is using [fuzzy-search](https://en.wikipedia.org/wiki/Approximate_string_matching) (see [settings](#settings)). If you wish to assign *alias* to items (in your suggestion list), add the `searchBy` property to *whitelist* items you wish to have an *alias* for. In the below example, typing a part of a string which is included in the `searchBy` property, for example *`land midd"`* - the suggested item which match the value "Israel" will be rendered in the suggestions (dropdown) list. ### [Example](https://yaireo.github.io/tagify/#section-extra-properties) for a suggestion item alias ```javascript whitelist = [ ... { value:'Israel', code:'IL', searchBy:'holy land, desert, middle east' }, ... ] ``` Another handy setting is `dropdown.searchKeys` which, like the above `dropdown.searchBy` setting, allows expanding the search of any typed terms to more than the `value` property of the whitelist items (if items are a *Collection*). ### Example whitelist: ```javascript [ { value : 123456, nickname : "foo", email : "foo@mail.com" }, { value : 987654, nickname : "bar", email : "bar@mail.com" }, ...more.. ] ``` // setting to search in other keys: ```javascript { dropdown: { searchKeys: ["nickname", "email"] // fuzzy-search matching for those whitelist items' properties } } ``` ## Mixed-Content [See demo here](https://yaireo.github.io/tagify/#section-mix) This feature must be toggled using these [settings](#settings): ```js { // mixTagsInterpolator: ["{{", "}}"], // optional: interpolation before & after string mode: 'mix', // <-- Enable mixed-content pattern: /@|#/ // <-- Text starting with @ or # (if single, String can be used here instead of Regex) } ``` When mixing text with tags, the original textarea (or input) element will have a value as follows: [[cartman]]⁠ and [[kyle]]⁠ do not know [[Homer simpson]]⁠ If the inital value of the textarea or input is formatted as the above example, tagify will try to automatically convert everything between `[[` & `]]` to a tag, if tag exists in the *whitelist*, so make sure when the Tagify instance is initialized, that it has tags with the correct `value` property that match the same values that appear between `[[` & `]]`. Applying the setting `dropdown.position:"text"` is encouraged for mixed-content tags, because the suggestions list weird when there is already a lot of content at multiple lines. If a tag does not exists in the *whitelist*, it may be created by the user and all you should do is listen to the `add` event and update your local/remote state. ## Single-Value Similar to native `<Select>` element, but allows typing text as value. ## React See [**live demo**](https://codesandbox.io/s/tagify-react-wrapper-oempc) for React integration examples. A Tagify React component is exported from [`react.tagify.js`](https://github.com/yairEO/tagify/blob/master/dist/react.tagify.js): ### Update regarding `onChange` prop: I have changed how the `onChange` works internally within the Wrapper of Tagify so as of *March 30, 2021* the `e` argument will include a `detail` parameter with the value as string. There is no more `e.target`, and to access the original DOM input element, do this: `e.detail.tagify.DOM.originalInput`. > Note: You will need to inport Tagify's CSS also, either by javasceript or by SCSS `@import` (which is preferable) ```javascript import Tags from "@yaireo/tagify/dist/react.tagify" // React-wrapper file import "@yaireo/tagify/dist/tagify.css" // Tagify CSS const App = () => { return ( <Tags tagifyRef={tagifyRef} // optional Ref object for the Tagify instance itself, to get access to inner-methods settings={settings} // tagify settings object value="a,b,c" {...tagifyProps} // dynamic props such as "loading", "showDropdown:'abc'", "value" onChange={ e => console.log("CHANGED:", JSON.parse(e.detail.value)) } /> ) }) ``` To gain full access to Tagify's (instance) inner methods, A custom `ref` can be used: ```jsx ... const tagifyRef = useRef() ... <Tags tagifyRef={tagifyRef} ... /> // or mix-mode <MixedTags settings={...} onChange={...} value={`This is a textarea which mixes text with [[{"value":"tags"}]].`} /> ``` `<MixedTags>` component is a shorthand for `<Tags InputMode="textarea">` #### Updating the component's state The `settings` prop is **only used once** in the initialization process, please do not update it afterwards. --- <details> <summary>📖 List of (React) props for the <code>&lt;Tags/&gt;</code> component</summary> Prop | Type | Updatable | Info ----------------------- | ------------------------- |:---------:| ----------------------------------------------------------- settings | <sub>Object</sub> | | See [*settings* section](#settings) name | <sub>String</sub> | ✔ | `<input>`'s element `name` attribute value | <sub>String/Array</sub> | ✔ | Initial value. defaultValue | <sub>String/Array</sub> | | Same as `value prop placeholder | <sub>String</sub> | ✔ | placeholder text for the component readOnly | <sub>Boolean</sub> | ✔ | Toggles `readonly` state. With capital `O`. tagifyRef | <sub>Object</sub> | | `useRef` hook refference for the component inner instance of vailla *Tagify* (for methods access) showFilteredDropdown | <sub>Boolean/String</sub> | ✔ | if `true` shows the suggestions dropdown. if assigned a String, show the dropdown pre-filtered. loading | <sub>Boolean</sub> | ✔ | Toggles `loading` state for the whole component whitelist | <sub>Array</sub> | ✔ | Sets the `whitelist` which is the basis for the suggestions dropdown & autocomplete className | <sub>String</sub> | | Component's optional class name to be added InputMode | <sub>String</sub> | | `"textarea"` will create a `<textarea>` (hidden) element instead of the default `<input>` and automatically make Tagify act as [*"mix mode"*](#mixed-content) autoFocus | <sub>Boolean</sub> | | Should the component have focus on mount. Must be unique, per-page. children | <sub>String/Array</sub> | | `value`/`defaultValue` props are prefered onChange | <sub>Function</sub> | | See [*events* section](#events) onInput | <sub>Function</sub> | | See [*events* section](#events) onAdd | <sub>Function</sub> | | See [*events* section](#events) onRemove | <sub>Function</sub> | | See [*events* section](#events) onInvalid | <sub>Function</sub> | | See [*events* section](#events) onClick | <sub>Function</sub> | | See [*events* section](#events) onKeydown | <sub>Function</sub> | | See [*events* section](#events) onFocus | <sub>Function</sub> | | See [*events* section](#events) onBlur | <sub>Function</sub> | | See [*events* section](#events) onEditInput | <sub>Function</sub> | | See [*events* section](#events) onEditBeforeUpdate | <sub>Function</sub> | | See [*events* section](#events) onEditUpdated | <sub>Function</sub> | | See [*events* section](#events) onEditStart | <sub>Function</sub> | | See [*events* section](#events) onEditKeydown | <sub>Function</sub> | | See [*events* section](#events) onDropdownShow | <sub>Function</sub> | | See [*events* section](#events) onDropdownHide | <sub>Function</sub> | | See [*events* section](#events) onDropdownSelect | <sub>Function</sub> | | See [*events* section](#events) onDropdownScroll | <sub>Function</sub> | | See [*events* section](#events) onDropdownNoMatch | <sub>Function</sub> | | See [*events* section](#events) onDropdownUpdated | <sub>Function</sub> | | See [*events* section](#events) </details> --- ## jQuery version `jQuery.tagify.js` A jQuery wrapper verison is also available, but I advise not using it because it's basically the exact same as the "normal" script (non-jqueryfied) and all the jQuery's wrapper does is allowing to chain the event listeners for ('add', 'remove', 'invalid') ```javascript $('[name=tags]') .tagify() .on('add', function(e, tagData){ console.log('added', ...tagData) // data, index, and DOM node }); ``` Accessing methods can be done via the [`.data('tagify')`](https://api.jquery.com/data): ```javascript $('[name=tags]').tagify(); // get tags from the server (ajax) and add them: $('[name=tags]').data('tagify').addTags('aaa, bbb, ccc') ```` ## HTML input & textarea attributes The below list of *attributes* affect *Tagify*.<br> These can also be set by Tagify [settings](#settings) Object manually, and not *declerativly* (via attributes). Attribute | Example | Info ----------------- | ----------------------------------------------------- | -------------------- [pattern](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern) | <pre lang=html>`<input pattern='^[A-Za-z_✲ ]{1,15}$'>`</pre> | Tag Regex pattern which tag input is validated by. [placeholder](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefplaceholder) | <pre lang=html>`<input placeholder='please type your tags'>`</pre> | This attribute's value will be used as a constant placeholder, which is visible unless something is being typed. readOnly | <pre lang=html>`<input readOnly>`</pre> | No user-interaction (add/remove/edit) allowed. autofocus | <pre lang=html>`<input autofocus>`</pre> | Automatically focus the the Tagify component when the component is loaded required | <pre lang=html>`<input required>`</pre> | Adds a `required` attribute to the Tagify wrapper element. Does nothing more. ## FAQ List of questions & scenarios which might come up during development with Tagify: <details> <summary><strong>tags/whitelist data strcture</strong></summary> Tagify does not accept just *any* kind of data structure.<br> If a tag data is represented as an `Object`, it **must** contain a **unique** property `value` which Tagify uses to check if a tag already exists, among other things, so make sure it is present. **Incorrect** ```javascript [{ "id":1, "name":"foo bar" }] ``` **Correct** ```javascript [{ "id":1, "value": 1, "name":"foo bar" }] ``` ```javascript [{ "value":1, "name":"foo bar" }] ``` ```javascript [{ "value":"foo bar" }] ``` ```javascript // ad a simple array of Strings ["foo bar"] ``` </details> --- <details> <summary><strong>Save changes (Ex. to a server)</strong></summary> In framework-less projects, the developer should save the state of the Tagify component (somewhere), and the question is:<br/> **when should the state be saved?** On every change made to *Tagify's* internal state (`tagify.value` via the `update()` method).<br> ```javascript var tagify = new Tagify(...) // listen to "change" events on the "original" input/textarea element tagify.DOM.originalInput.addEventListener('change', onTagsChange) // This example uses async/await but you can use Promises, of course, if you prefer. async function onTagsChange(e){ const {name, value} = e.target // "imaginary" async function "saveToServer" should get the field's name & value await saveToServer(name, value) } ``` If you are using *React/Vue/Angular* or any "modern" framework, then you already know how to attach "onChange" event listeners to your `<input>`/`<textarea>` elements, so the above is irrelevant. </details> ---- <details> <summary><strong>Render tags in one single line</strong></summary> Stopping tags from wrapping to new lines, add this to your `.tagify` *selector CSS Rule*: ```css flex-wrap: nowrap; ```` </details> ---- <details> <summary><strong>Submit on `Enter` key</strong></summary> Tagify internally has `state` property, per `Tagify` instance and this may be useful for a variety of things when implementing a specific scenario. ```js var tagify = new Tagify(...) var formElm = document.forms[0]; // just an example tagify.on('keydown', onTagifyKeyDown) function onTagifyKeyDown(e){ if( e.key == 'Enter' && // "enter" key pressed !tagify.state.inputText && // assuming user is not in the middle oy adding a tag !tagify.state.editing // user not editing a tag ){ setTimeout(() => formElm.submit()) // put some buffer to make sure tagify has done with whatever, to be on the safe-side } } ``` </details> --- * [Double-click tag fires both "edit" & "click" custom events](https://github.com/yairEO/tagify/issues/247) * [Manualy open the suggestions dropdown](https://github.com/yairEO/tagify/issues/254) * [Render your own suggestions dropdown](https://github.com/yairEO/tagify/issues/244) * [Allow max length on mix mode](https://github.com/yairEO/tagify/issues/252) * [Always show dropdown](https://github.com/yairEO/tagify/issues/253) * [Limit the length of a tag value (minimum & maximum)](https://github.com/yairEO/tagify/issues/245) * [*Mixed mode* initial value](https://github.com/yairEO/tagify/issues/237) * [Random colors for each tag](https://github.com/yairEO/tagify/issues/223) * [Format input value for server side](https://github.com/yairEO/tagify/issues/220) * [Writing to tagify textarea](https://github.com/yairEO/tagify/issues/294) * [Scroll all tags within one line, instead of growing vertically](https://github.com/yairEO/tagify/issues/145) * [Insert emoji at caret location when editing a tag](https://github.com/yairEO/tagify/issues/365) * [propagate `change` event](https://github.com/yairEO/tagify/issues/413) * [Manually update tag data after it was added](https://github.com/yairEO/tagify/issues/433) * [Ajax Whitelist with "enforceWhitelist" setting enabled](https://github.com/yairEO/tagify/issues/465) * [Custom (multiple) tag validation & AJAX](https://github.com/yairEO/tagify/issues/474) * [Make tags from pasted multi-line text](https://github.com/yairEO/tagify/issues/160) * [Add a tag at *caret* position in *mixed mode*](https://github.com/yairEO/tagify/issues/524#issuecomment-699140465) ## CSS Variables > Learn more about [CSS Variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)) (custom properties) Tagify's utilizes *CSS variables* which allow easy customization without the need to manually write CSS. If you do wish to heavily style your Tagify components, then you can (and should) use the below variables within your modified styles as much as you can. For a *live* example, see the [demos page](https://yaireo.github.io/tagify/#section-different-look). Name | Info ------------------------------- | -------------------------------- --tags-border-color | The outer border color which surrounds tagify --tags-hover-border-color | *hover* state --tags-focus-border-color | *focus* state --tag-bg | Tag background color --tag-hover | Tag background color on hover (mouse) --tag-text-color | Tag text color --tag-text-color--edit | Tag text color when a Tag is being edited --tag-pad | Tag padding, from all sides. Ex. `.3em .5em` --tag--min-width | Minimum Tag width --tag--max-width | Maximum tag width, which gets trimmed with *hellip* after --tag-inset-shadow-size | This is the inner shadow size, which dictates the color of the Tags.<br>It's important the size fits *exactly* to the tag.<br>Change this if you change the `--tag-pad` or fontsize. --tag-invalid-color | For border color of edited tags with invalid value being typed into them --tag-invalid-bg | Background color for invalid Tags. --tag-remove-bg | Tag background color when hovering the `×` button. --tag-remove-btn-color | Remove (`×`) button text color --tag-remove-btn-bg | Remove (`×`) button background color --tag-remove-btn-bg--hover | Remove (`×`) button hover background color --loader-size | Loading animation size. `1em` is pretty big, default is a bit less. --tag-hide-transition | Controls the transition property when a tag is removed. default is '.3s' --placeholder-color | Placeholder text color --placeholder-color-focus | Placeholder text color when Tagify has focus and no input was typed --input-color | Input text color ### Full list of Tagify's [SCSS variables](https://github.com/yairEO/tagify/blob/master/src/tagify.scss#L9-L24) ## Methods `Tagify` is [prototype](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes) based and There are many methods, but I've chosen to list the most relevant ones: Name | Parameters | Info -------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- `destroy` | | Reverts the input element back as it was before Tagify was applied `removeAllTags` | | Removes all tags and resets the original input tag's value property `addTags` | <ol><li>`Array`/`String`/`Object` tag(s) to add</li><li>`Boolean` clear input after adding</li><li>`Boolean` - skip adding invalids</li><ol> | Accepts a String (word, single or multiple with a delimiter), an Array of Objects (see above) or Strings. `addMixTags` | `Array`/`String` | Bypasses the normalization process in `addTags`, forcefully adding tags at the last caret location or at the end, if there's no last caret location saved (at `tagify.state.selection`) `removeTags` | <ol><li>`Array`/`HTMLElement`/`String` tag(s) to remove</li><li>`silent` does not update the component's value</li><li>`tranDuration` Transition duration (in `ms`)</li></ul> | (#502) Remove single/multiple Tags. When nothing passed, removes last tag. <ul><li>`silent` - A flag, which when turned on, does not remove any value and does not update the original input value but simply removes the tag from tagify</li><li>`tranDuration` - delay for animation, after which the tag will be removed from the DOM</li></ul> `addEmptyTag` | `Object` <sub>(`tagData`)</sub> | Create an empty tag (optionally with pre-defined data) and enters "edit" mode directly. [See demo](https://yaireo.github.io/tagify#section-different-look) `loadOriginalValues` | `String`/`Array` | Converts the input's value into tags. This method gets called automatically when instansiating Tagify. Also works for mixed-tags `getWhitelistItemsByValue` | `Object` | `{value}` - return an Array of found matching items (case-insensitive) `getTagIndexByValue` | `String` | Returns the index of a specific tag, by value `getTagElmByValue` | `String` | Returns the first matched tag node, if found `isTagDuplicate` | `String` | Returns how many tags already exists with that value `parseMixTags` | `String` | Converts a String argument (`[[foo]]⁠ and [[bar]]⁠ are..`) into HTML with mixed tags & texts `getTagElms` | | Returns a DOM nodes list of all the tags `getTagElmByValue` | `String` | Returns a specific tag DOM node by value `tagData` | `HTMLElement`, `Object` | set/get tag data on a tag element (has`.tagify__tag` class by default) `editTag` | `HTMLElement` | Goes to edit-mode in a specific tag `replaceTag` | `tagElm`, `Object` <sub>(`tagData`)</sub> | Exit a tag's edit-mode. if "tagData" exists, replace the tag element with new data and update Tagify value `loading` | `Boolean` | toggle loading state on/off (Ex. AJAX whitelist pulling) `tagLoading` | `HTMLElement`, Boolean | same as above but for a specific tag element `createTagElem` | `Object` <sub>(`tagData`)</sub> | Returns a tag element from the supplied tag data `injectAtCaret` | `HTMLElement` <sub>(`injectedNode`)</sub>, `Object` <sub>(`range`)</sub> | Injects text or HTML node at last caret position. `range` parameter is *optional* `placeCaretAfterNode` | `HTMLElement` | Places the caret after a given node `insertAfterTag` | `HTMLElement` <sub>(tag element)</sub>, `HTMLElement`/`String` <sub>(whatever to insert after)</sub> | `toggleClass` | `Boolean` | Toggles `class` on the main *tagify* container (`scope`) `dropdown.selectAll` | | Add **all** whitelist items as tags and close the suggestion dropdown `updateValueByDOMTags` | | Iterate tag DOM nodes and re-build the `tagify.value` array (call this if tags get sorted manually) `parseTemplate` | `String`/`Function` <sub>(template name or function)</sub>, `Array` <sub>(data)</sub> | converts a template string (by selecting one from the `settings.templates` by name or supplying a template function which returns a String) into a DOM node `setReadonly` | `Boolean` | Toggles "readonly" mode on/off ## Events All triggered events return the instance's scope (tagify).<br> See `e.detail` for custom event additional data. <details> <summary>Example 1</summary> ```javascript var tagify = new Tagify(...) // events can be chainable, and multiple events may be binded for the same callback tagify .on('input', e => console.log(e.detail)) .on('edit:input edit:updated edit:start edit:keydown', e => console.log(e.type, e.detail)) ``` </details> <details> <summary>Example 2</summary> ```javascript var tagify = new Tagify(inputNode, { callbacks: { "change": (e) => console.log(e.detail)) "dropdown:show": (e) => console.log(e.detail)) } }) ``` </details> Name | Info ------------------ | -------------------------------------------------------------------------- change | Any change to the value has occured. `e.details.value` callback listener argument is a *String* add | A tag has been added remove | A tag has been removed ([use `removeTag`](https://github.com/yairEO/tagify/issues/222) instead with *jQuery*) invalid | A tag has been added but did not pass vaildation. See [event detail](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events) input | [Input](https://developer.mozilla.org/en-US/docs/Web/Events/input) event, when a tag is being typed/edited. `e.detail` exposes `value`, `inputElm` & `isValid` click | Clicking a tag. Exposes the tag element, its index & data dblclick | Double-clicking a tag keydown | When tagify input has focus and a key was pressed focus | The component currently has focus blur | The component lost focus edit:input | Typing inside an edited tag edit:beforeUpdate | Just before a tag has been updated, while still in "edit" mode edit:updated | A tag as been updated (changed view editing or by directly calling the `replaceTag()` method) edit:start | A tag is now in "edit mode" edit:keydown | keydown event while an edited tag is in focus dropdown:show | Suggestions dropdown is to be rendered. The dropdown DOM node is passed in the callback, [see demo](https://yaireo.github.io/tagify/#section-basic). dropdown:hide | Suggestions dropdown has been removed from the DOM dropdown:select | Suggestions dropdown item selected (by mouse/keyboard/touch) dropdown:scroll | Tells the percentage scrolled. (`event.detail.percentage`) dropdown:noMatch | No whitelist suggestion item matched for the the typed input. At this point it is possible to manually set `tagify.suggestedListItems` to any possible custom value, for example: `[{ value:"default" }]` dropdown:updated | Fired when the dropdown list is re-filtered while suggestions list is visible and a tag was removed so it was re-added as a suggestion ## Hooks **Promise**-based hooks for *async* program flow scenarios. Allows to "hook" (intervene) at certain points of the program, which were selected as a suitable place to **pause** the program flow and wait for further instructions on how/if to procceed. <details> <summary>For example, if a developer wishes to add a (native) confirmation popup before a tag is removed (by a user action): </summary> ```javascript var input = document.querySelector('input') var tagify = new Tagify(input,{ hooks: { /** * Removes a tag * @param {Array} tags [Array of Objects [{node:..., data:...}, {...}, ...]] */ beforeRemoveTag : function( tags ){ return new Promise((resolve, reject) => { confirm("Remove " + tags[0].data.value + "?") ? resolve() : reject() }) } } }) ``` </details> Name | Parameters | Info ---------------------- | ------------------------------------------- | -------------------------------------------------------------------------- beforeRemoveTag | Array <sub>(of Objects)</sub> | [Example](https://jsbin.com/xoseyux/edit?html,js,output) suggestionClick | Object <sub>(click event data)</sub> | [Example](https://jsbin.com/tuwihuf/edit?html,js,output) beforePaste | `tagify`, `pastedText`, `clipboardData` | Before pasted text was added to Tagify. *Resolve* with new paste value if needed ## [Settings](https://github.com/yairEO/tagify/blob/master/src/parts/defaults.js#L1) Name | Type | Default | Info ------------------------- | ---------------------------- | ------------------------------------------- | -------------------------------------------------------------------------- tagTextProp | <sub>String</sub> | `"value"` | Tag data Object property which will be displayed as the tag's text. Remember to keep "value" property <em>unique</em>. placeholder | <sub>String</sub> | | Placeholder text. If this attribute is set on an input/textarea element it will override this setting delimiters | <sub>String</sub> | `","` | [RegEx **string**] split tags by any of these delimiters. Example delimeters: ",&#124;.&#124; " (*comma*, *dot* or *whitespace*) pattern | <sub>String/RegEx</sub> | null | Validate input by RegEx pattern (can also be applied on the input itself as an attribute) Ex: `/[1-9]/` mode | <sub>String</sub> | null | Use `select` for single-value dropdown-like select box. See `mix` as value to allow mixed-content. The 'pattern' setting must be set to some character. mixTagsInterpolator | <sub>Array</sub> | <sub>`['[[', ']]']`</sub> | Interpolation for mix mode. Everything between these will become a tag mixTagsAllowedAfter | <sub>RegEx</sub> | <sub>`/,\|\.\|\:\|\s/`</sub> | Define conditions in which typed mix-tags content is allowing a tag to be created after. duplicates | <sub>Boolean</sub> | false | Should duplicate tags be allowed or not trim | <sub>Boolean</sub> | true | If `true` trim the tag's value (remove before/after whitespaces) enforceWhitelist | <sub>Boolean</sub> | false | Should ONLY use tags allowed in whitelist.<br>In `mix-mode`, setting it to `false` will not allow creating new tags. autoComplete.enabled | <sub>Boolean</sub> | true | Tries to suggest the input's value while typing (match from whitelist) by adding the rest of term as grayed-out text autoComplete.rightKey | <sub>Boolean</sub> | false | If `true`, when `→` is pressed, use the suggested value to create a tag, else just auto-completes the input. In mixed-mode this is ignored and treated as "true" whitelist | <sub>Array</sub> | [] | An array of allowed tags (*Strings* or *Objects*). When using *Objects* in the *whitelist* array a `value` property is a must & should be unique. <br/>Also, the *whitelist used for auto-completion when `autoCompletion.enabled` is `true` blacklist | <sub>Array</sub> | [] | An array of tags which aren't allowed addTagOnBlur | <sub>Boolean</sub> | true | Automatically adds the text which was inputed as a tag when blur event happens callbacks | <sub>Object</sub> | {} | Exposed callbacks object to be triggered on events: `'add'` / `'remove'` tags maxTags | <sub>Number</sub> | Infinity | Maximum number of allowed tags. when reached, adds a class "tagify--hasMaxTags" to `<Tags>` editTags | <sub>Object/Number</sub> | {} | `false` or `null` will disallow editing editTags.*clicks* | <sub>Number</sub> | 2 | Number of clicks to enter "edit-mode": 1 for single click. Any other value is considered as double-click editTags.*keepInvalid* | <sub>Boolean</sub> | true | keeps invalid edits as-is until `esc` is pressed while in focus templates | <sub>Object</sub> | <sub>`wrapper`, `tag`, `dropdownItem`</sub> | Object consisting of functions which return template strings validate | <sub>Function</sub> | | If the `pattern` setting does not meet your needs, use this function, which recieves *tag data object* as an argument and should return `true` if validaiton passed or `false`/`string` of not. A *string* may be returned as the reason of the validation failure. transformTag | <sub>Function</sub> | | Takes a tag data as argument and allows mutating it before a tag is created or edited.<br>Should not `return` anything, only **mutate**. keepInvalidTags | <sub>Boolean</sub> | false | If `true`, do not remove tags which did not pass validation skipInvalid | <sub>Boolean</sub> | false | If `true`, do not add invalid, temporary, tags before automatically removing them backspace | <sub>*</sub> | true | On pressing backspace key:<br> `true` - remove last tag <br>`edit` - edit last tag originalInputValueFormat | <sub>Function</sub> | | If you wish your original input/textarea `value` property format to other than the default (which I recommend keeping) you may use this and make sure it returns a *string*. mixMode.*insertAfterTag* | <sub>Node/String</sub> | `\u00A0` | `node` or `string` to add after a tag added | a11y.*focusableTags* | <sub>Boolean</sub> | false | allows tags to get focus, and also to be deleted via <kbd>Backspace</kbd> dropdown.*enabled* | <sub>Number</sub> | 2 | Minimum characters input for showing a suggestions list. `false` will not render a suggestions list. dropdown.*caseSensitive* | <sub>Boolean</sub> | false | if `true`, match **exact** item when a suggestion is selected (from the dropdown) and also more strict matching for dulpicate items. **Ensure** `fuzzySearch` is `false` for this to work. dropdown.*maxItems* | <sub>Number</sub> | 10 | Maximum items to show in the suggestions list dropdown.*classname* | <sub>String</sub> | `""` | Custom *classname* for the dropdown suggestions selectbox dropdown.*fuzzySearch* | <sub>Boolean</sub> | true | Enables filtering dropdown items values' by string *containing* and not only *beginning* dropdown.*accentedSearch* | <sub>Boolean</sub> | true | Enable searching for <em>accented</em> items in the whitelist without typing exact match (#491) dropdown.*position* | <sub>String</sub> | `"all"` | <ul><li>`manual` - will not render the dropdown, and you would need to do it yourself. [See demo](https://yaireo.github.io/tagify/#section-manual-suggestions)</li><li>`text` - places the dropdown next to the caret</li><li>`input` - places the dropdown next to the input (useful in rare situations)</li><li>`all` - normal, full-width design</li></ul> dropdown.*highlightFirst* | <sub>Boolean</sub> | false | When a suggestions list is shown, highlight the first item, and also suggest it in the input (The suggestion can be accepted with <kbd>→</kbd> key) dropdown.*closeOnSelect* | <sub>Boolean</sub> | true | close the dropdown after selecting an item, if `enabled:0` is set (which means always show dropdown on focus) dropdown.*clearOnSelect* | <sub>Boolean</sub> | true | Keep typed text after selecting a suggestion dropdown.*mapValueTo* | <sub>Function/String</sub> | | If whitelist is an Array of Objects:<br>Ex. `[{value:'foo', email:'foo@a.com'},...]`)<br> this setting controlls which data <em>key</em> will be printed in the dropdown.<br> Ex.1: `mapValueTo: data => "To:" + data.email`<br>Ex.2: `mapValueTo: "email"` dropdown.*searchKeys* | <sub>Array</sub> | <sub>`["value", "searchBy"]`</sub> | When a user types something and trying to match the whitelist items for suggestions, this setting allows matching other keys of a whitelist objects dropdown.*appendTarget* | <sub>HTMLNode</sub> | `document.body` | Target-Node which the *suggestions dropdown* is appended to (*only when rendered*) dropdown.*placeAbove* | <sub>Boolean</sub> | | If defined, will force the placement of the dropdown in respect to the Boolean value: `true` will always show the suggestions dropdown above the input field and `false` will always show it below. By default this setting it not defined and the placement of the dropdown is automatically decided according to the space availble, where opening it *below* the input is preferred.
keypom_fydp-contracts
.vscode settings.json Cargo.toml README.md assets CODE_OF_CONDUCT.md build.sh contract Cargo.toml src assets ft_asset ft_balances.rs ft_claims.rs ft_refunds.rs internal_ft_core.rs mod.rs function_call fc_claims.rs helpers.rs internal_fc_core.rs mod.rs models.rs mod.rs nft_asset internal_nft_core.rs mod.rs nft_balances.rs nft_claims.rs nft_refunds.rs drop_claiming claim_callbacks.rs claims.rs helpers.rs mod.rs drop_creation add_keys.rs create_drop.rs helpers.rs mod.rs drop_deletion.rs funder_info.rs helpers.rs internals constants gas_amounts.rs mod.rs strings.rs events events_core.rs helpers.rs keypom.rs mod.rs nfts.rs mod.rs types.rs lib.rs models config.rs external implementations.rs mod.rs models.rs internal implementations.rs mod.rs models.rs mod.rs standard.rs nft_keys approval.rs enumeration.rs internal.rs metadata.rs mod.rs nft_core.rs royalty.rs owner.rs views drops.rs funder.rs helpers.rs keys.rs mod.rs General Create Account & Claim Claim Shared Constants Assets Access Key Method Names NFT Standard Stuff Keypom Standard Asset IDs Owner Only Things Drops NFT Keys Utility deploy dummyData.ts eventZombie.ts interfaces.ts keyPairs.json rsaTest.ts utils.ts funder_metadata.txt integration-tests Cargo.toml src helpers.rs models.rs tests.rs package.json
<p align="center"> <img src="assets/claimed-linkdrop.png" alt="Logo" style="width: 35%; height: 35%"> <br /> </p> <div align="center"> <h1> Keypom </h1> Limitless possibilities in the palm of your hand. </div> <div align="center"> <br /> [![made by BenKurrek](https://img.shields.io/badge/made%20by-BenKurrek-ff1414.svg?style=flat-square)](https://github.com/BenKurrek) [![made by mattlockyer](https://img.shields.io/badge/made%20by-MattLockyer-ff1414.svg?style=flat-square)](https://github.com/mattlockyer) </div> <details open="open"> <summary>Table of Contents</summary> - [About](#about) - [Introduction](#introduction) - [Comparable Solutions](#comparable-solutions) - [Our Solution](#our-solution) - [Drop Customization](#shared-drop-customization) - [Primary Market Public Sale for Keys](#primary-market-public-sale-for-keys) - [Simple Drops](#simple-drops) - [NFT Drops](#non-fungible-token-drops) - [FT Drops](#fungible-token-drops) - [Function Call Drops](#function-call-drops) - [How It Works](#how-do-fc-drops-work) - [Security](#security-for-fc-drops) - [User-Provided Args](#user-provided-arguments) - [Use Cases](#fc-drop-use-cases) - [Password Protected Keys](#password-protected-keys) - [dApp Free Trials for Users](#dapp-free-trials-for-users) - [Costs](#costs) - [Per Drop](#per-drop) - [Per Key](#per-key) - [Deleting Keys and Drops](#deleting-keys-and-drops) - [Automatic Refunds](#automatic-refunds-when-keys-are-used) - [Account Balances](#account-balances-for-smooth-ux) - [How Linkdrops Work](#how-linkdrops-work) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Deploy Scripts](#deploy-scripts) - [Query Information From Keypom](#query-information-from-keypom) - [Key Specific](#key-specific) - [Drop Specific](#drop-specific) - [Running Tests](#running-the-keypom-tests) - [Contributing](#contributing) - [Acknowledgements](#acknowledgements) </details> --- # About <tr> <td> > To view our debut talk at NEARCON 2022, click [here](https://www.youtube.com/watch?v=J-BOnfhHV50). Keypom is an access key factory created as a result of 3 common problems that arose in the ecosystem. 1. People want a *cheap, customizable, and unique* onboarding experience for users. 2. Companies don't want to expose **full access keys** in their backend servers. 3. dApps want a *smooth UX* with zero barrier to entry onboarding. The contract was initially created as a way to handle the 1 $NEAR minimum deposit required for creating linkdrops using the [regular linkdrop contract](https://github.com/near/near-linkdrop/blob/f24f2608e1558db773f2408a28849d330abb3881/src/lib.rs#L18). If users wanted to create linkdrops, they needed to attach a **minimum** of 1 $NEAR. This made it costly and unscalable for projects that wanted to mass onboard onto NEAR. Keypom, on the other hand, has been highly optimized to allow for the lowest possible costs. ## Introduction Blockchain technology comes with many benefits such as sovereign ownership, digital rights, privacy, freedom, peer to peer coordination and much more. The problem with this technology, however, is that there is an extremely high barrier to entry for an everyday individual. None of it matters if nobody can onboard. It’s confusing to create and fund a crypto wallet. People are unfamiliar with the process, technical jargon, and the general flow. NEAR’s account model is powerful, but extremely underutilized because it’s complex for developers to take full advantage of. Keypom wraps this up in a single API call. With NEAR’s goal of onboarding 1 billion users to Web3, there needs to be a solution to this high barrier to entry for developers building on NEAR and users onboarding to their apps and the NEAR ecosystem. Below is a table outlining the minimum costs to onboard a new user onto NEAR with a named account. | | 1 Account | 1,000 Accounts | 1,000,000 Accounts | |----------------------|-----------------|-----------------|--------------------| | Traditional Linkdrop | ~1 NEAR | ~1,003 NEAR | ~1,002,840 NEAR | | Keypom | ~0.0035 NEAR | ~3.5 NEAR | ~3,500 NEAR | | | ~99.65% Cheaper | ~99.65% Cheaper | ~99.65% Cheaper | Keypom allows anyone to create highly customizable onboarding experiences for their users. These experiences can be both for new, or existing users. If someone already has a wallet, they can still use a Keypom link to experience an app, and then transfer the assets later. ## Comparable Solutions | | **Keypom** | **NEAR Drop** | **Satori** | |----------------------------------------------|------------|---------------|------------| | NEAR Drop | ✅ | ✅ | ❌ | | FT Drop | ✅ | ❌ | ❌ | | NFT Drop | ✅ | ❌ | ✅ | | Function Call Drop | ✅ | ❌ | ❌ | | Embeddable in Dapps | ✅ | ❌ | ❌ | | Wallet Selector Integration | ✅ | ❌ | ❌ | | No Fee | ✅ | Maybe? | ❌ | | No Backend / 3rd Party | ✅ | ✅ | ❌ | | Campaigns | ✅ | ✅ | ✅ | | Multi-Step e.g. Tickets click > scan > claim | ✅ | ❌ | ❌ | | Password Protected Drops | ✅ | ❌ | ❌ | | Timed Drops e.g. recurring payments | ✅ | ❌ | ❌ | | Custom Names e.g. user.myapp.near | ✅ | ❌ | ❌ | # Our Solution Keypom allows for the creation of highly customizable access keys. These keys can be thought of as having their own *smart contracts*. Each access key derives from what's known as a *drop*. These drops outline the different functionalities and behaviors the key will have. A drop can be thought of as a bucket that access keys belong to. You can create many different buckets and fill them each with their own keys. Each key will act in accordance to the drop, or bucket, it belongs to. A drop can be one of four different types: 1. Simple drop. 2. Non Fungible Token drop. 3. Fungible Token drop. 4. Function Call drop. # Shared Drop Customization While each *type* of drop has its own set of customizable features, there are some that are shared by **all drops** These are outlined below. ```rust /// Each time a key is used, how much $NEAR should be sent to the claiming account (can be 0). pub deposit_per_use: u128, /// How much Gas should be attached when the key is used. The default is 100 TGas as this is /// what's used by the NEAR wallet. pub required_gas: Gas, /// The drop as a whole can have a config as well pub config: Option<DropConfig>, /// Metadata for the drop in the form of stringified JSON. The format is completely up to the /// user and there are no standards for format. pub metadata: LazyOption<DropMetadata>, ``` Within the config, there are a suite of features that can be customized as well: ```rust /// How many uses can each key have before it's deleted. If None, default to 1. pub uses_per_key: Option<u64>, /// Override the global root account that sub-accounts will have (near or testnet). This allows /// users to create specific drops that can create sub-accounts of a predefined root. /// For example, Fayyr could specify a root of `fayyr.near` By which all sub-accounts will then /// be `ACCOUNT.fayyr.near` pub root_account_id: Option<AccountId>, // /Any time based configurations pub time: Option<TimeConfig>, /// Public sale config options pub sale: Option<PublicSaleConfig>, /// Any usage specific configurations pub usage: Option<UsageConfig>, ``` ## Time Based Customizations Keypom allows users to customize time-based configurations as outlined below. ```rust pub struct TimeConfig { /// Minimum block timestamp before keys can be used. If None, keys can be used immediately /// Measured in number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC. pub start: Option<u64>, /// Block timestamp that keys must be before. If None, keys can be used indefinitely /// Measured in number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC. pub end: Option<u64>, /// Time interval between each key use. If None, there is no delay between key uses. /// Measured in number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC. pub throttle: Option<u64>, /// Interval of time after the `start_timestamp` that must pass before a key can be used. /// If multiple intervals pass, the key can be used multiple times. This has nothing to do /// With the throttle timestamp. It only pertains to the start timestamp and the current /// timestamp. The last_used timestamp is not taken into account. /// Measured in number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC. pub interval: Option<u64>, } ``` ## Usage Based Customizations In addition to time-based configurations, the funder can customize behaviors pertaining to key usages. ```rust pub struct UsageConfig { /// Can the access key only call the claim method_name? Default to both method_name callable pub permissions: Option<ClaimPermissions>, /// If claim is called, refund the deposit to the owner's balance. If None, default to false. pub refund_deposit: Option<bool>, /// Should the drop be automatically deleted when all the keys are used? This is defaulted to false and /// Must be overwritten pub auto_delete_drop: Option<bool>, /// When this drop is deleted and it is the owner's *last* drop, automatically withdraw their balance. pub auto_withdraw: Option<bool>, /// When calling `create_account` on the root account, which keypom args should be attached to the payload. pub account_creation_fields: Option<KeypomArgs>, } ``` ## Primary Market Public Sale for Keys The last type of customization available to the funder is the ability to create a public sale for access keys in a drop. The funder can create a drop and let people add keys to it on an as-needed basis. The sale configurations are outlined below. ```rust pub struct PublicSaleConfig { /// Maximum number of keys that can be added to this drop. If None, there is no max. pub max_num_keys: Option<u64>, /// Amount of $NEAR that the user needs to attach (if they are not the funder) on top of costs. This amount will be /// Automatically sent to the funder's balance. If None, the keys are free to the public. pub price_per_key: Option<u128>, /// Which accounts are allowed to add keys? pub allowlist: Option<LookupSet<AccountId>>, /// Which accounts are NOT allowed to add keys? pub blocklist: Option<LookupSet<AccountId>>, /// Should the revenue generated be sent to the funder's account balance or /// automatically withdrawn and sent to their NEAR wallet? pub auto_withdraw_funds: Option<bool>, /// Minimum block timestamp before the public sale starts. If None, keys can be added immediately /// Measured in number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC. pub start: Option<u64>, /// Block timestamp dictating the end of the public sale. If None, keys can be added indefinitely /// Measured in number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC. pub end: Option<u64>, } ``` ### Use-Cases for Public Sales Giving the funder the ability to sell access keys to a drop introduces a ton of awesome use-cases and has a slew of benefits: - Everything is decentralized and on-chain. There is no need to trust a third party to hold the keys. - Keys are created on an as-needed basis. This *drastically reduces up-front costs* for the drop funder. - Since keys are created only when users want them, there is no chance that through distribution, the private key gets compromised. The key is created *when the user purchases it*. - Everything *can* remain anonymous and private since people can purchase access keys with their crypto wallets. Having a public sale allows for an on-chain distribution mechanism for access keys. Let's look at two examples where this can be used. #### Example 1: Ticketing Imagine there is an event organizer that wants to host with a guest-list of 100,000 people. Without doing a public sale, the organizer would need to spend a lot of $NEAR up-front to create all 100 thousand access keys. At this point, they would need to find a way to distribute all the keys. With a public sale, the organizer can set a price per key, an allowlist, a blocklist, and even a start date for when the sale goes live. At this point, the keys would be lazily purchased by people coming to the event. This not only reduces the up-front cost for the funder but it can also provide more accurate data on how many people are actually coming to the event. #### Example 2: Selling Function Calls Access keys can be used for much more than just POAPs, onboarding or tickets. When using FC Drops, the keys can execute functions on external contracts. This feature can be used in conjunction with the public sale to create a marketplace for gated function calls. Imagine a simple guest-book smart contract that only allowed people to sign the book if they had a valid Keypom access key. Whoever signed the guest-book had access to all VIP events at NEARCon. You could lock access to signing the guest-book behind a Keypom drop and setup a public sale. #### Example 3: NFT Collections A very common scenario is an artist launching a new NFT collection. The artist can setup a custom marketplace whereby the keys are lazily minted and sold to the public. They can then create a custom website that takes a Keypom link and brings the user through a unique, creative experience before the NFT is minted and a wallet is optionally created. People that purchase the links can either use them to send the NFT to their existing wallet or create an entirely new wallet. ## Simple Drops The most basic type of drop is the simple kind. Any keys that are part of a simple drop can only be used for 1 thing: **transferring $NEAR**. Once the key is claimed, the claiming account will receive the $NEAR specified in the `deposit_per_use`. Simple drops are a great way to send $NEAR to claiming accounts while not storing a lot of information on the contract. Below are a couple use cases. ### Backend Servers Let's say you have a backend server that should send 10 $NEAR to the first 3 people that redeem an NFT. Rather than exposing your full access key in the backend server, you could create a simple drop that either has 3 keys or 1 key that is claimable 3 times. In the drop, you'd specify that each time the key is claimed, the specified account would receive 10 $NEAR. ### Recurring Payments Recurring payments are quite a common situation. If you need to send someone 10 $NEAR once a month for 6 months, you could create a simple drop that has a usage config with an `interval` of 1 month. In addition, you can set the time based config to have a `start` of next week. Everytime the key is used, 10 $NEAR is sent to the account. If the contractor missed a month's payment, they can claim the key late but can never use the key more than what is intended. <p align="center"> <img src="assets/flowcharts/recurring_payments.png" style="width: 65%; height: 65%" alt="Logo"> </p> ### Quick Onboarding If you need to quickly onboard users onto NEAR, you could create a simple drop with a small amount of $NEAR (enough to create a wallet) and set the usage's permissions to be `create_account_and_claim`. This means that the key can only be used to create accounts. You can then add keys as you wish to the drop and give them out to users so they can create accounts and be onboarded onto NEAR. ### Lazy Registering Keys A unique use-case for simple drops is the ability to lazy register key uses. This allows the funder to batch create many keys at a time while only paying for basic fees such as the storage used and the key's allowance. The funder would **not** need to pay for the `deposit_per_use` of each key up front. They can instead register individual key uses as they are needed. With this scenario, if an organization wanted to onboard users with a linkdrop valued at 10 $NEAR, they could create 1000 keys without needing to pay 1000 * 10 = 10,000 $NEAR up-front. They could then register keys on an as-needed basis. If they need to register 25 keys at a time, they can do this by simply calling the `register_uses` function. ## Non-Fungible Token Drops Non-Fungible Token drops are a special type that allows users to "preload" the drop with NFTs. These tokens will then be *automatically* sent to the **claiming user**. The claiming flow is fairly similar to simple drops in that users can either create an account or claim to an existing one. NFT drops are essentially a wrapper around simple drops. All the functionalities that simple drops have are carried over but now, users can receive an NFT as well as $NEAR. This brings introduces some customization and uniqueness to the use-cases. ### How does it work? Every drop has a field known as `registered_uses`. This tells the contract how many uses the drop has across all its keys. For basic simple drops that are *not* lazy registering keys, this field doesn't matter since all the uses are paid for up-front when the drop is created or when keys are added. With NFT drops, however, there is a 2 step process: - Firstly, the drop is created and all the $NEAR required is pre-paid for. This is the same as simple drops, however, the `registered_uses` are set to 0. - Once the drop is created, the owner must send the contract the NFTs in order for keys to be usable. This process is done through the `nft_transfer_call` workflow baked into the NFT standards. It's up to the owner to facilitate this process. Whenever the contract receives tokens, it will push the ID to a vector. These IDs are **popped** off whenever a key is used. A user will receive the most recent token sent to the contract as the vector is acting like a *stack*. ### NFT Config Along with the default global configurations for drops, if you'd like to create an NFT drop, you must specify the following pieces of information when the drop is created. ```rust pub struct NFTDataConfig { /// Which account ID will be sending the NFTs to the contract. If this is not specified, anyone can send NFTs for the specific drop. pub sender_id: Option<AccountId>, /// Which contract will the NFTs live on pub contract_id: AccountId, } ``` By specifying this information, the drop is locked into only accepting NFTs from the specific contract and optionally from a specified sender account. ### Use Cases NFT drops work really well for when you want to send a *pre-existing* NFT to a user along with some $NEAR. Since NFT drops are a light wrapper around simple drops, most of the use-cases are the same although people can now get NFTs as well. This means you can onboard a user with some $NEAR **and** they *get an NFT* too. ## Fungible Token Drops A Fungible Token drop is also a light wrapper around the simple drop. It works very similarly to how its NFT counterpart does. First, you'll need to create the drop and then you can fund it with assets and register key uses. You can preload a drop with as many FTs as you'd like even if you don't have the keys yet. This will spike the `registered_uses` and then you can create keys and slowly eat away from this "total supply" overtime. If the drop runs out, you can send it more FTs to top up. All the keys in the FT drop will share from this supply and everytime a key is used, the `registered_uses` will decrement and the "total supply" will get smaller. ### How does it work? As mentioned in the NFT section, every drop has a field known as `registered_uses`. This tells the contract how many uses the drop has across all its keys. For basic simple drops that are *not* lazy registering keys, this field doesn't matter since all the uses are paid for up-front when the drop is created or when keys are added. With FT drops, however, there is a 2 step process: - Firstly, the drop is created and all the $NEAR required is pre-paid for. This is the same as simple drops, however, the `registered_uses` are set to 0. - Once the drop is created, the owner must send the contract the FTs in order for keys to be usable. This process is done through the `ft_transfer_call` workflow baked into the FT standards. It's up to the owner to facilitate this process. ### FT Config Along with the default global configurations for drops, if you'd like to create a FT drop, you must specify the following pieces of information when the drop is created. ```rust pub struct FTDataConfig { /// The contract that the FTs live on. pub contract_id: AccountId, /// The account ID that will be sending the FTs to the contract. If this is not specified, anyone can send FTs for the specific drop. pub sender_id: Option<AccountId>, /// How many FTs should the contract send *each time* a key is used. pub balance_per_use: U128, } ``` By specifying this information, the drop is locked into only accepting FTs from the specific contract and optionally from a specified sender account. you can send as many FTs as you'd like and can over-pay, you *must* send at **least** enough FTs in one call to cover 1 use. As an example, if a drop is created such that 10 FTs will be sent when a key is used, you must send **at least 10** and cannot break it up into separate calls where you send 5 one time and 5 another. ### Use Cases FT drops have some awesome flexibility due to the fact that they support all the functionalities of the Simple drops, just with more use-cases and possibilities. Let's look at some use cases to see how fungible token drops can be used. #### Recurring Payments Recurring payments are quite a common situation. Let's say you need to send someone $50 USDC every week. You could create a key with 5 uses that has a time config `interval` of 1 week. You would then pre-load maybe the first week's deposit of $50 USDC and register 1 use or you could send $500 USDC for the first 10 weeks. At that point, you would simply hand over the key to the user and they can claim once a week. #### Backend Servers Taking the recurring payments problem to another level, imagine that instead of leaving the claims up to the contractor, you wanted to automatically pay them through a backend server. They would give you their NEAR account and you would send them FTs. The problem is that you don't want to expose your full access key in the server. By creating a FT drop, you can store **only the function call access key** created by Keypom in the server. Your backend would them use the key to call the `claim` function and pass in the user's account ID to send them the FTs. #### Creating a Wallet with FTs Another awesome use-case is to allow users to be onboarded onto NEAR and **also** receive FTs. As an example, You could do a promotion where you're giving away $10 USDC to the first 100 users that sign up to your mailing list. You can also give away QR codes at events that contain a new fungible token that you're launching. You can simply create a FT drop and pre-load it with the FT of your choice. In addition, you can give it 0.02 $NEAR for new wallets that are created. You can pair this with setting the usage config's `refund_deposit` flag to true which would make it so that if anyone claims the fungible tokens and they *already have a wallet*, it will automatically refund you the 0.02 $NEAR. That money should only be used for the creation of new wallets. Since your focus is on the fungible tokens, you don't want to **force users** to create a new wallet if they have one already by specifying the usage permissions to be `create_account_and_claim` but instead, you want to be refunded in case they do. ## Function Call Drops Function call drops are by far the most powerful feature that Keypom provides. FC drops allow **any** method on **any** contract to be executed (with some exceptions). In addition, there are a huge variety of customizations and features you can choose from when defining the drop that come on top of the global options. The possibilities are almost endless. State of the art NFT ticketing, lazy minting NFTs, auto registration into DAOs, analytics for marketing at events and much more. ### How do FC Drops work? Unlike NFT and FT drops, the function calls must have everything paid for **upfront**. There is no two step process so the creation is similar to Simple drops. Once the drop is created and keys are added, you can immediately start using it. #### Function Call Config When creating the drop, you have quite a lot of customization available. At the top level, there is a FC drop global config similar to how the *general* config works. ```rust pub struct FCConfig { /// How much GAS should be attached to the function call if it's a regular claim. /// If this is used, you *cannot* go through conventional linkdrop apps such as mynearwallet /// since those *always* attach 100 TGas no matter what. In addition, you will only be able to /// call `claim` if this is specified. You cannot have an `attached_gas` parameter and also /// call `create_account_and_claim. pub attached_gas: Option<Gas>, } ``` #### Method Data In addition to the global config, the user can specify a set of what's known as `MethodData`. This represents the information for the function being called. Within this data, there are also a few optional configurations you can use to extend your use cases. You'll see how powerful these can be in the use cases [section](#use-cases). ```rust pub struct MethodData { /// Contract that will be called pub receiver_id: AccountId, /// Method to call on receiver_id contract pub method_name: String, /// Arguments to pass in (stringified JSON) pub args: String, /// Amount of yoctoNEAR to attach along with the call pub attached_deposit: U128, /// Specifies what field the claiming account ID should go in when calling the function /// If None, this isn't attached to the args pub account_id_field: Option<String>, /// Specifies what field the drop ID should go in when calling the function. To insert into nested objects, use periods to separate. For example, to insert into args.metadata.field, you would specify "metadata.field" /// If Some(String), attach drop ID to args. Else, don't attach. pub drop_id_field: Option<String>, /// Specifies what field the key ID should go in when calling the function. To insert into nested objects, use periods to separate. For example, to insert into args.metadata.field, you would specify "metadata.field" /// If Some(String), attach key ID to args. Else, don't attach. pub key_id_field: Option<String>, // Specifies what field the funder id should go in when calling the function. To insert into nested objects, use periods to separate. For example, to insert into args.metadata.field, you would specify "metadata.field" // If Some(string), attach the funder ID to the args. Else, don't attach. pub funder_id_field: Option<String>, // What permissions does the user have when providing custom arguments to the function call? // By default, the user cannot provide any custom arguments pub user_args_rule: Option<UserArgsRule>, } ``` The MethodData keeps track of the method being called, receiver, arguments, and attached deposit. In addition, there are some optional fields that can be used to extend the use cases. If you have a contract that requires some more context from Keypom such as the funder ID, drop ID, key ID, and account ID that used the key, these can all be specified. We've kept it generic such that you can specify the actual argument name that these will be passed in as. For example, if you had a contract that would lazy mint an NFT and it required the account to be passed in as `receiver_id`, you could specify an `account_id_field` set to `receiver_id` such that Keypom will automatically pass in the account ID that used the key under the field `receiver_id`. Similarly, inserting fields into nested arguments is quite trivial. Let's say you wanted to insert the account ID that claimed the drop into the `receiver_id` under metadata for the following args: ```json args: { "token_id": "foobar", "metadata": { "receiver_id": INSERT_HERE } } ``` You could specify the `account_id_field` as `metadata.receiver_id` and Keypom will automatically create the `receiver_id` field and insert it into `metadata`. This would work whether or not `metadata` was already present in the args. > **NOTE:** The location for inserting the arguments *cannot* collide with another entry. In the above example, `token_id.receiver_id` could *NOT* be specified since `token_id` is mapped to `foobar` already. This logic extends to the drop ID, and key Id as well. #### Key Uses For **every key use**, you can specify a *vector* of `MethodData` which allows you to execute multiple function calls each time a key is used. These calls are scheduled 1 by 1 using a simple for loop. This means that most of the time, the function calls will be executed in the order specified in the vector but it is not *guaranteed*. It's important to note that the Gas available is split evenly between *all* the function calls and if there are too many, you might run into issues with not having enough Gas. You're responsible for ensuring that this doesn't happen. The vector of `MethodData` is *optional* for each key use. If a key use has `null` rather than `Some(Vector<MethodData>)`, it will decrement the uses and work as normal such that the `timestamp, `start` etc. are enforced. The only difference is that after the key uses are decremented and these checks are performed, the execution **finishes early**. The null case does **not** create an account or send *any* funds. It doesn't invoke any function calls and simply *returns once the checks are done*. This makes the null case act as a "burner" where you disregard any logic. This has many uses which will be explored in the use cases [section](#use-cases). If a key has more than 1 use, you can specify a *different vector* of `MethodData` for **each use**. As an example, you could specify that the first use will result in a null case and the second use will result in a lazy minting function being called. If you have multiple uses but want them all to do the same thing, you don't have to repeat the same data. Passing in only 1 vector of `MethodData` will result in **all the uses** inheriting that data. ### Security for FC Drops Since all FC drops will be signed by the Keypom contract, there are a few restrictions in place to avoid malicious behaviors. To avoid users from stealing registered assets from other drops, the following methods cannot be called via FC Drops: ```rust /// Which methods are prohibited from being called by an FC drop const DEFAULT_PROHIBITED_FC_METHODS: [&str; 6] = [ "nft_transfer", "nft_transfer_call", "nft_approve", "nft_transfer_payout", "ft_transfer", "ft_transfer_call", ]; ``` In addition, the Keypom contract cannot be the receiver of any function call. This is to avoid people from calling private methods through FC Drops. #### Keypom Arguments When a key is used and a function is called, there is a data structure that is **automatically** attached to the arguments. This is known as the `keypom_args`. It contains the information that the drop creator specified in the `MethodData`. ```rust pub struct KeypomArgs { pub account_id_field: Option<String>, pub drop_id_field: Option<String>, pub key_id_field: Option<String>, pub funder_id_field: Option<String> } ``` ##### Motivation Let's say there was an exclusive NFT contract that allowed the Keypom contract to mint NFTs as part of an FC drop. Only Keypom was given access to mint the NFTs so they could be given out as linkdrops. The organizer only wanted links that were part of their drop to be valid. For this reason, the NFT contract would only mint if Keypom called the `nft_mint` function and there was a field `series` passed in and it was equal to the drop ID created by the organizer. Let's say the owner created an exclusive drop that happened to have a drop ID of 5. They could then go to the NFT contract and restrict NFTs to only be minted if: - `series` had a value of 5. - The Keypom contract was the one calling the function. In order for this to work, when creating the drop, the owner would need to specify that the`drop_id_field` was set to a value of `series` such that the drop ID is correctly passed into the function. The problem with this approach is that the NFT contract has no way of knowing which arguments were sent by the **user** when the drop was created `as part of the MethodData `args` and which arguments are automatically populated by the Keypom contract. There is nothing stopping a malicious user from creating a new drop that has an ID of 6 but hardcoding in the actual arguments that `series` should have a value of 5. In this case, the malicious drop would have *no* `drop_id_field` and the NFT contract would have no way of knowing that the `series` value is malicious. This can be prevented if a new field is introduced representing what was automatically injected by the Keypom contract itself. At the end of the day, Keypom will **always** send correct information to the receiving contracts. If those contracts have a way to know what has been sent by Keypom and what has been manually set by users, the problem is solved. In the above scenario, the NFT contract would simply add an assertion that the `keypom_args` had the `account_id_field` set to `Some(series)` meaning that the incoming `series` field was set by Keypom and not by a malicious user. ### User Provided Arguments In the `MethodData`, there is an optional field that determines whether or not users can provide their own arguments when claiming a linkdrop and what that behaviour will look like. This is known as the `user_args_rule` and can be one of the following: ```rs /// When a user provides arguments for FC drops in `claim` or `create_account_and_claim`, what behaviour is expected? /// For `AllUser`, any arguments provided by the user will completely overwrite any previous args provided by the drop creator. /// For `FunderPreferred`, any arguments provided by the user will be concatenated with the arguments provided by the drop creator. If there are any duplicate args, the drop funder's arguments will be used. /// For `UserPreferred`, any arguments provided by the user will be concatenated with the arguments provided by the drop creator, but if there are any duplicate keys, the user's arguments will overwrite the drop funder's. pub enum UserArgsRule { AllUser, FunderPreferred, UserPreferred } ``` By default, if `user_args_rule` is `None` / not provided, any user provided arguments will be completely disregarded. It would act as if the user provided *no args* in the first place. These user arguments must be passed in via the `fc_args` field in `claim` and `create_account_and_claim`. This field is of type `Option<Vec<Option<String>>>` indicating that it's optional to provide the args and for each claim, a set of args can be provided. If, for a specific method, args shouldn't be passed in, the vector can have `None` as the value. The order of the args must match the order of the methods that will be executed. > **NOTE:** If a user provides `fc_args`, the length of the vector *MUST* match the number of methods being executed during the claim. #### All User If `user_args_rule` is set to `AllUser`, any arguments provided by the user will completely *overwrite* any previous args provided by the drop creator. If no args as passed in by the user, the drop creator's original args will be used. As an example, if the method data was: ```js args: JSON.stringify({ "foo": "bar", "baz": { "foo": "bar } }) ``` And the user provided the following args: ```js fc_args: JSON.stringify({ "new_field": "new_value" }) ``` Keypom would completely overwrite the funder's previous args and use the user's `fc_args` instead. #### Funder Preferred If `user_args_rule` is set to `FunderPreferred`, any arguments provided by the user will be concatenated with the arguments provided by the drop creator. If there are any duplicate args, the drop funder's arguments will be prioritized / used. As an example, if the funder args were: ```js args: JSON.stringify({ "funder_field": "funder_value", "object": { "funder_field": "funder_value" } }) ``` And the user provided the following args: ```js fc_args: JSON.stringify({ "funder_field": "user_value", "object": { "funder_field": "user_value", "user_field": "user_value" } }) ``` Keypom would take the user args and merge them together with the funder's but prioritize any fields that are funder specified. The resulting output would be: ```js args: JSON.stringify({ "funder_field": "funder_value", "object": { "funder_field": "funder_value", "user_field": "user_value" } }) ``` #### User Preferred If `user_args_rule` is set to `UserPreferred`, any arguments provided by the user will be concatenated with the arguments provided by the drop creator, but if there are any duplicate keys, the *user's arguments* will overwrite the drop funder's. As an example, if the funder args were: ```js args: JSON.stringify({ "funder_field": "funder_value", "object": { "funder_field": "funder_value" } }) ``` And the user provided the following args: ```js fc_args: JSON.stringify({ "object": { "funder_field": "user_value", "user_field": "user_value" } }) ``` Keypom would take the user args and merge them together with the funder's but prioritize any fields that are *user specified*. The resulting output would be: ```js args: JSON.stringify({ "funder_field": "funder_value", "object": { "funder_field": "user_value", "user_field": "user_value" } }) ``` ### FC Drop Use Cases Function call drops are the bread and butter of the Keypom contract. They are the most powerful and complex drops that can currently be created. With this complexity, there are an almost infinite number of use-cases that arise. #### Proof of Attendance Protocols A very common use case in the space is what's known as Proof of Attendance. Often times when people go to events, they want a way to prove that they were there. Some traditional approaches would be to submit your wallet address and you would be sent an NFT or some other form of proof at a later date. The problem with this is that it has a very high barrier to entry. Not everyone has a wallet. With Keypom, you can create a function call drop that allows people to onboard onto NEAR if they don't have a wallet or if they do, they can simply use that. As part of the onboarding / claiming process, they would receive some sort of proof of attendance such as an NFT. This can be lazy minted on-demand such that storage isn't paid up-front for all the tokens. At this point, the event organizers or the funder can distribute links to people that attend the event in-person. These links would then be claimed by users and they would receive the proof of attendance. #### Auto Registration into DAOs DAOs are a raging topic in crypto. The problem with DAOs, however, is there is a barrier to entry for users that aren't familiar with the specific chain they're built on top of. Users might not have wallets or understand how to interact with contracts. On the contrary, they might be very well versed or immersed in the DAO's topics. They shouldn't be required to create a wallet and learn the onboarding process. With Keypom, you can create a function call drop with the main purpose of registering users into a DAO. For people that have a wallet, this will act as an easy way of registering them with the click of a link. For users that don't have a wallet and are unfamiliar with NEAR, they can be onboarded and registered into the DAO with the same click of a link. #### Multisig Contracts Another amazing use-case for Keypom is allowing multisig contracts to have ZERO barrier to entry. Often times when using a multisig contract, you will entrust a key to a trusted party. This party might have no idea what NEAR is or how to interact with your contract. With Keypom, you can create a drop that will allow them to sign their transaction with a click of a link. No NEAR wallet is needed and no knowledge of the chain is required. At the end of the day, from the users perspective, they are given a link and when they click it, their portion of the multisig transaction is signed. The action is only performed on the multisig contract once all links have been clicked. This is an extremely powerful way of doing accomplishing multisig transactions with zero barrier to entry. The users don't even need to create a new account. They can simply call `claim` when the link is clicked which will fire the cross-contract call to the multisig contract and pass in the keypom arguments that will be cross-checked by that contract. #### NFT Ticketing The problem with current NFT ticketing systems is that they require users to have a wallet. This is a huge barrier to entry for people that are attending events but don't have wallets. In addition, there is often no proof of attendance for the event as the NFT is burned in order to get into the event which requires an internet connection. Keypom aims to solve these problems by having a ticketing system that has the following features. - No wallet is needed to enter the event or receive a POAP. - No wifi is needed at the door. - An NFT is minted on-demand for each user that attends the event. - Users can optionally onboard onto NEAR if they don't have a wallet. In addition, some way to provide analytics to event organizers that contains information such as links that were: - Given out but not clicked at all. - Clicked but not attended. - Partially claimed indicating the number of people that attended but did not onboard or receive a POAP. - Fully claimed indicating the number of people that attended and received a POAP. In order to accomplish this, you can create a drop that has 3 uses per key. These uses would be: 1. Array(`null`) 2. Array(`null`) 3. Array(function call to POAP contract to lazy mint an NFT) The event organizer would create the links and distribute them to people however they see fit. When a user receives the link, the first claim is automatically fired. This is a `null` case so nothing happens except for the fact that the key uses are decremented. At this point, the organizer knows that the user has clicked the link since the uses have been decremented. The next claim happens **only** when the user is at the door. Keypom would expose a QR code that can only be scanned by the bouncer's phone. This QR code would appear once the first link is clicked and contains the private key for the link. At the event, they wouldn't need any wifi to get in as they only need to show the bouncer the QR code. Once the bouncer scans it, the site would ensure that they have exactly 2 out of the 3 uses left. If they don't, they're not let in. At that point, a use is decremented from the key and the next time they visit the ticket page (when they have internet), they would be able to claim the final use and be onboarded / receive a POAP. <p align="center"> <img src="assets/flowcharts/ticketing.png" style="width: 65%; height: 65%" alt="Logo"> </p> ## Password Protected Keys Password protecting key uses is an extremely powerful feature that can unlock many use-cases. Keypom has baked flexibility and customization into the contract such that almost all use-cases involving password protection can be accomplished. Whenever a key is added to a drop, it can have a unique password for each individual use, or it can one password for all uses in general. ### How Does It Work? The Keypom implementation has been carefully designed so that users can't look at the NEAR Explorer to view what was passed into the contract either when the drop was created or when a key was used to try and copy those passwords. We also want passwords to be unique across keys so that if you know the password for 1 key, it doesn't work on a different key. In order to accomplish this, we use the concept of hashing. Imagine you have a drop with 2 keys and you want to password protect each key. Rather than forcing the drop funder to input a unique password for each key and having them remember each one, we can have them input a single **base password** and derive unique passwords from it that are paired with the key's public key. This is the most scalable option as it allows the drop funder to only need to remember 1 password and they can derive all the other ones using the hashing algorithm and public key. In the above scenario, let's say the funder inputs the base password as `mypassword1`. If a user wanted to claim the first key, they would need to input into the contract: `hash("mypassword1" + key1_public_key)` The funder would need to give the user this hash somehow (such as embedding it into the link or having an app that can derive it). It's important to note that the funder should probably **NOT** give them the base password otherwise the user could derive the passwords for all other keys (assuming those keys have the same base password). ### What is Stored On-Chain? How does Keypom verify that the user passed in the correct password? If the funder were to simply pass in `hash("mypassword1" + key1_public_key)` into the contract as an argument when the key is created, users could just look at the NEAR Explorer and copy that value. Instead, the funder needs to pass in a double hash when the key is created: `hash(hash("mypassword1" + key1_public_key))`. This is the value that is stored on-chain and when the user tries to claim the key, they would pass in just the single hash: `hash("mypassword1" + key1_public_key)`. The contract would then compute `hash(hash("mypassword1" + key1_public_key))` and compare it to the value stored on-chain. If they match, the key is claimed. Using this method, the base password is not exposed to the user, nobody can look on-chain or at the NEAR explorer and derive the password, and the password is unique across multiple keys. ## Passwords Per Key Use Unlike the passwords per key which is the same for all uses of a key, the drop creator can specify a password for each individual key use. This password follows the same pattern as the passwords per key in that the funder inputs a `hash(hash(SOMETHING))` and then the user would input `hash(SOMETHING)` and the contract would hash this and compare it to the value stored on-chain. The difference is that each individual key use can have a different value stored on-chain such that the user can be forced to input a different hash each time. This `SOMETHING` that is hashed can be similar to the global password per key example but this time, the desired key use is added: `hash("mypassword1" + key1_public_key + use_number)` In order to pass in the passwords per use, a new data structure is introduced so you only need to pass in passwords for the uses that have them. This is known as the `JsonPasswordForUse` and is as follows: ```rust pub struct JsonPasswordForUse { /// What is the password for this use (such as `hash("mypassword1" + key1_public_key + use_number)`) pub pw: String, /// Which use does this pertain to pub key_use: u64 } ```` ## Adding Your First Password Whenever keys are added to Keypom, if there's passwords involved, they must be passed in using the following format. ```rust passwords_per_use: Option<Vec<Option<Vec<JsonPasswordForUse>>>>, passwords_per_key: Option<Vec<Option<String>>>, ``` Each key that is being added either has a password, or doesn't. This is through the `Vec<Option<>`. This vector **MUST** be the same length as the number of keys created.This doesn't mean that every key needs a password, but the Vector must be the same length as the keys. As an example, if you wanted to add 3 keys to a drop and wanted only the first and last key to have a password_per_key, you would pass in: ```rust passwords_per_key: Some(vec![Some(hash(hash(STUFF))), None, Some(hash(hash(STUFF2)))]) ``` ## Complex Example To help solidify the concept of password protected keys, let's go through a complex example. Imagine Alice created a drop with a `uses_per_key` of 3. She wants to create 4 keys: - Key A: No password protection. - Key B: Password for uses 1 and 2. - Key C: Password for use 1 only. - Key D: Password that doesn't depend on the use. In this case, for Keys B and C, they will have the same base password but Alice wants to switch things up and have a different base password for Key D. When these keys are added on-chain, the `passwords_per_key` will be passed in as such: ```rust passwords_per_key: Some(vec![ None, // Key A None, // Key B None, // Key C // Key D Some( hash(hash("key_d_base_password" + key_d_public_key)) ), ]), ``` The passwords for Key B and Key C will be passed in as such: ```rust passwords_per_use: Some(vec![ None, // Key A // Key B vec![ { pw: hash(hash("keys_bc_base_password" + key_b_public_key + "1")), key_use: 1 }, { pw: hash(hash("keys_bc_base_password" + key_b_public_key + "2")), key_use: 2 } ] // Key C vec![ { pw: hash(hash("keys_bc_base_password" + key_c_public_key + "1")), key_use: 1 } ] None // Key D ]), ``` The drop funder would then give the keys out to people: ### Key A Alice gives Bob Key A and he would be able to claim it 3 times with no password required. ### Key D Alice gives Charlie Key D and he would be able to claim it 3 times with the hashed global key password: `hash("key_d_base_password" + key_d_public_key)`. When Charlie uses the key, he would input the password `hash("key_d_base_password" + key_d_public_key)` and the contract would hash that and check to see if it matches what is stored on-chain (which it does). If anyone tried to look at what Charlie passes in through the explorer, it wouldn't work since his hash contains the public key for key D and as such it is only valid for Key D. Similarly, if Charlie tried to look at the explorer when Alice created the keys and attempted to pass in `hash(hash("key_d_base_password" + key_d_public_key))`, the contract would attempt to hash this and it would NOT match up with what's in the storage. ### Key B Alice gives Eve Key B and she would need a password for claim 1 and 2. For the first claim, she needs to pass in: `hash("keys_bc_base_password" + key_b_public_key + "1")`. The contract would then check and see if the hashed version of this matches up with what's stored on-chain for that use. The second time Eve uses the key, she needs to pass in `hash("keys_bc_base_password" + key_b_public_key + "2")` and the same check is done. If Eve tries to pass in `hash("keys_bc_base_password" + key_b_public_key + "1")` for the second key use, the contract would hash it and check: ``` hash(hash("keys_bc_base_password" + key_b_public_key + "1")) == hash(hash("keys_bc_base_password" + key_b_public_key + "2")) ``` Which is incorrect and the key would not be claimed. Once Eve uses the key 2 times, the last claim is not password protected and she's free to claim it. Key C is similar to Key B except that it only has 1 password for the first use. ## Use-Cases Password protecting key uses is a true game changer for a lot of use-cases spanning from ticketing to simple marketing and engagement. #### Ticketing and POAPs Imagine you had an event and wanted to give out exclusive POAPs to people that came. You didn't want to force users to: - Have a NEAR wallet - Have wifi at the door. - Burn NFTs or tokens to get into the event. The important thing to note is that by using password protected key uses, you can **GUARANTEE** that anyone that received a POAP had to **PHYSICALLY** show up to the event. This is because the POAP would be guarded by a password. You could create a ticketing event using Keypom as outlined in the [Ticketing](#nft-ticketing) section and have a key with 2 uses. The first use would be password protected and the second use is not. The first use will get you through the door and into the event and the second contains the exclusive POAP and can onboard you. This means that anyone with the ticket, or key, can only receive the POAP if they know the password. You can have a scanner app that would scan people's tickets (tickets are just the private key). In this scanner app, the *base password* is stored and whenever the ticket is scanned, the public key is taken and the following hash is created: `hash(base password + public key)` This hash is then used to claim a use of the key and you will be let into the party. The scanner app can deterministically generate all the necessary hashes for all the tickets by simply scanning the QR code (which has the private key exposed). The tickets are worthless unless you actually show up to the event and are scanned. Once you're scanned, you can refresh your ticket page and the use the second key claim which is not password protected. This use contains the exclusive POAP and you can onboard onto NEAR. #### Marketing and Engagement Let's say that you're at an event and want people to show up to your talks and learn about your project. You can have a scanner app similar to the one mentioned in the ticketing scenario that derives the password for any use on any key. At the beginning of the event, you can give out a bunch of keys that have progressively increasing rewards gated by a password. At the end, the last key use contains a special reward that is only unlocked if the user has claimed all the previous key uses. In order for these uses to be unlocked, People must show up to your talks and get scanned. The scanner will derive the necessary password and unlock the rewards. Users will only get the exclusive reward if they come to ALL your talks. This idea can be further expanded outside the physical realm to boost engagement on your websites as an example: You want users to interact with new features of your site or join your mailing list. You can have links where uses are ONLY unlocked if the user interacts with special parts of your site such as buying a new NFT or joining your mailing list or clicking an easter egg button on your site etc. ## dApp Free Trials for Users In the upcoming Keypom V2.0, dApps will be able to integrate the Keypom wallet selector plugging to allow for free trials for their users. One of the biggest pain-points with Web3 at the moment is the fact that users need to fund wallets *before* they interact with a dApp. In Web2, a user can find value in an application by using it before they go through the messy onboarding process. Why can't Web3 be the same? Keypom will allow apps to create links that will automatically sign users into their applications and give them a free trial of the app. The user will be able to interact with things, spend $NEAR, sign transactions and gather assets through the trial. A unique feature of this is that the user will *never be redirected to the NEAR wallet* to approve transactions. Keypom will provide a seamless user experience where users can find value in applications. Once the free trial is over and users have collected assets / $NEAR through interacting with the dApp, they can *THEN* choose to onboard. With Keypom's technology, users will be locked into only interacting with the dApp specified in the link. Users can't rug the application and steal the $NEAR embedded in the link. The funds are allocated for 1 thing and 1 thing only: free trials of that one specific dApp. <p align="center"> <img src="assets/flowcharts/trial_accounts.png" style="width: 65%; height: 65%" alt="Logo"> </p> # Costs It is important to note that the Keypom contract is 100% **FEE FREE** and will remain that way for the *forseeable future*. This contract is a public good and is meant to inspire change in the NEAR ecosystem. With that being said, there are several mandatory costs that must be taken into account when using Keypom. These costs are broken down into two categories: per key and per drop. > **NOTE:** Creating an empty drop and then adding 100 keys in separate calls will incur the same cost as creating a drop with 100 keys in the same call. ## Per Drop When creating an empty drop, there is only one cost to keep in mind regardless of the drop type: - Storage cost (**~0.006 $NEAR** for simple drops) ## Per Key Whenever keys are added to a drop (either when the drop is first created or at a later date), the costs are outlined below. ### Key Costs for Simple Drop - $NEAR sent whenever the key is used (can be 0). - Access key allowance (**~0.0187 $NEAR per use**). - Storage for creating access key (**0.001 $NEAR**). - Storage cost (**~0.006 $NEAR** for simple drops) ### Additional Costs for NFT Drops Since keys aren't registered for use until **after** the contract has received the NFT, we don't know how much storage the token IDs will use on the contract. To combat this, the Keypom contract will automatically measure the storage used up for storing each token ID in the `nft_on_transfer` function and that $NEAR will be taken from the funder's balance. ### Additional Costs for FT Drops Since accounts claiming FTs may or may not be registered on the Fungible Token contract, Keypom will automatically try to register **all** accounts. This means that the drop creators must front the cost of registering users depending on the `storage_balance_bounds` returned from the FT contract. This applies to every use for every key. In addition, Keypom must be registered on the FT contract. If you create a FT drop and are the first person to ever do so for a specific FT contract on Keypom, Keypom will be automatically registered when the drop is created. This is a one time cost and once it is done, no other account will need to register Keypom for that specific FT contract. ### Additional Costs for FC Drops Drop creators have a ton of customization available to them when creation Function Call drops. A cost that they might incur is the attached deposit being sent alongside the function call. Keypom will charge creators for all the attached deposits they specify. > **NOTE:** The storage costs are dynamically calculated and will vary depending on the information you store on-chain. ## Deleting Keys and Drops Creators have the ability to delete drops and keys at any time. In this case, **all** the initial costs they incurred for the remaining keys will be refunded to them (minus Gas fees of course). ## Automatic Refunds When Keys are Used One way that Keypom optimizes the fee structure is by performing automatic refunds for some of the initial costs that creators pay for when keys are used. All the storage that is freed along with any unused allowance is automatically sent back to the creator whenever a key is used. This model drastically reduces the overall costs of creating drops and creates incentives for the keys to be used. ## Account Balances for Smooth UX In order to make the UX of using Keypom seamless, the contract introduces a debiting account model. All costs and refunds go through your account's balance which is stored on the contract. This balance can be topped up or withdrawn at any moment using the `add_to_balance()` and `withdraw_from_balance()` functions. This account balance is not *required*, however. You can create a drop by attaching a deposit to the call. Keep in mind that this will create an account balance for you behind the scenes, however. </td> </tr> </table> ## Built With - [near-sdk-rs](https://github.com/near/near-sdk-rs) - [near-api-js](https://github.com/near/near-api-js) # How Linkdrops Work For some background as to how linkdrops works on NEAR: *The funder that has an account and some $NEAR:* - creates a keypair locally `(pubKey1, privKey1)`. The blockchain doesn't know of this key's existence yet since it's all local for now. - calls `send` on the contract and passes in the `pubKey1` as an argument as well as the desired `balance` for the linkdrop. - The contract will map the `pubKey1` to the desired `balance` for the linkdrop. - The contract will then add the `pubKey1` as a **function call access key** with the ability to call `claim` and `create_account_and_claim`. This means that anyone with the `privKey1` that was created locally, can claim this linkdrop. - Funder will then create a link to send to someone that contains this `privKey1`. The link follows the following format: ``` wallet.testnet.near.org/linkdrop/{fundingContractAccountId}/{linkdropKeyPairSecretKey}?redirectUrl={redirectUrl} ``` * `fundingContractAccountId`: The contract accountId that was used to send the funds. * `linkdropKeyPairSecretKey`: The corresponding secret key to the public key sent to the contract. * `redirectUrl`: The url that wallet will redirect to after funds are successfully claimed to an existing account. The URL is sent the accountId used to claim the funds as a query param. *The receiver of the link that is claiming the linkdrop:* - Receives the link which includes `privKey1` and sends them to the NEAR wallet. - Wallet creates a new keypair `(pubKey2, privKey2)` locally. The blockchain doesn't know of this key's existence yet since it's all local for now. - Receiver will then choose an account ID such as `new_account.near`. - Wallet will then use the `privKey1` which has access to call `claim` and `create_account_and_claim` in order to call `create_account_and_claim` on the contract. - It will pass in `pubKey2` which will be used to create a full access key for the new account. - The contract will create the new account and transfer the funds to it alongside any NFT or fungible tokens pre-loaded. </p> # Getting Started There are several ways to get started using Keypom. You can use the NEAR CLI, our Keypom application, our Keypom SDK and more. In this section, we will go over how you can interact with Keypom and create drops using the NEAR-API-JS library and write simple node scripts. ## Prerequisites In order to successfully interact with this contract using the deploy scripts, you should have the following: - [NEAR account](https://docs.near.org/concepts/basics/account) - [Node JS](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) ## Deploy Scripts There are 4 deploy scripts that have been made available for you to use and easily create Keypom links. These are for: - Simple Drops - NFT Drops - FT Drops - Function Call Drops Each drop type deploy script has a version using `NEAR-API-JS`, and a version using the `Keypom-JS SDK`. The file tree for these scripts is shown below. ```bash /deploy ├── ft │ └── configurations.js │ └── ft-create-sdk.js │ └── ft-create.js │ ├── function-call │ └── configurations.js │ └── fc-create-sdk.js │ └── fc-create.js │ ├── nft │ └── configurations.js │ └── nft-create-sdk-minted.js │ └── nft-create-sdk-owned.js │ └── nft-create.js │ ├── simple │ └── configurations.js │ └── simple-create-sdk.js │ └── simple-create.js │ ├── utils ``` In order to use these scripts, open the `deploy/` directory and modify the `configurations.js` file for the drop you want to create. In this file, you can specify important information such as the number of keys you wish to create, the amount of $NEAR you want to send, how many uses per key etc. You must specify the account that you will fund the drops with under the `FUNDING_ACCOUNT_ID` variable. This account needs to have keys stored in your `~/.near-credentials` folder. To do this, simply run `near login` on your terminal and follow the prompts using the NEAR CLI. Once the `configurations.js` file has been modified to your liking, navigate back to the root directory and run the deploy script. For simple drops: ``` // Using NEAR-API-JS yarn simple // Using SDK yarn simple-sdk ``` For FT drops: ``` // Using NEAR-API-JS yarn ft // Using SDK yarn ft-sdk ``` For NFT drops: ``` // Using NEAR-API-JS yarn nft // Using SDK yarn nft-sdk ``` For Function Call drops: ``` // Using NEAR-API-JS yarn fc // Using SDK yarn fc-sdk ``` # Query Information From Keypom Keypom allows users to query a suite of different information from the contract. This information can be broken down into two separate objects that are returned. JsonDrops and JsonKeys. ```rs pub struct JsonDrop { // Drop ID for this drop pub drop_id: DropId, // owner of this specific drop pub owner_id: AccountId, // Balance for all keys of this drop. Can be 0 if specified. pub deposit_per_use: U128, // Every drop must have a type pub drop_type: JsonDropType, // The drop as a whole can have a config as well pub config: Option<DropConfig>, // Metadata for the drop pub metadata: Option<DropMetadata>, // How many uses are registered pub registered_uses: u64, // Ensure this drop can only be used when the function has the required gas to attach pub required_gas: Gas, // Keep track of the next nonce to give out to a key pub next_key_id: u64, } pub struct JsonKeyInfo { // Drop ID for the specific drop pub drop_id: DropId, pub pk: PublicKey, // How many uses this key has left. Once 0 is reached, the key is deleted pub remaining_uses: u64, // When was the last time the key was used pub last_used: u64, // How much allowance does the key have left. When the key is deleted, this is refunded to the funder's balance. pub allowance: u128, // Nonce for the current key. pub key_id: u64, } ``` ## Key Specific - **`get_key_balance(key: PublicKey)`**: Returns the $NEAR that will be sent to the claiming account when the key is used - **`get_key_total_supply()`**: Returns the total number of keys currently on the contract - **`get_keys(from_index: Option<U128>, limit: Option<u64>)`**: Paginate through all keys on the contract and return a vector of key info - **`get_key_information(key: PublicKey)`**: Return the key info for a specific key - **`get_key_information_batch(keys: Vec<PublicKey>)`**: Return a vector of key info for a set of public keys ## Drop Specific - **`get_drop_information(drop_id: Option<DropId>, key: Option<PublicKey>)`**: Return the drop info for a specific drop. This can be queried for by either passing in the drop ID or a public key. - **`get_key_supply_for_drop(drop_id: DropId)`**: Return the total number of keys for a specific drop - **`get_keys_for_drop(drop_id: DropId, from_index: Option<U128>, limit: Option<u64>)`**: Paginate through all keys for a specific drop and return a vector of key info - **`get_drop_supply_for_owner(account_id: AccountId)`**: Return the total number of drops for a specific account - **`get_drops_for_owner(account_id: AccountId, from_index: Option<U128>, limit: Option<u64>)`**: Paginate through all drops for a specific account and return a vector of drop info - **`get_nft_supply_for_drop(drop_id: DropId)`**: Get the total number of NFTs registered for a given drop. - **`get_nft_token_ids_for_drop(drop_id: DropId, from_index: Option<U128>, limit: Option<u64>)`**: Paginate through token IDs for a given drop - **`get_next_drop_id()`**: Get the next drop ID that will be used for a new drop ### Utility - **`get_root_account()`**: Get the global root account that all created accounts with be based off. - **`get_user_balance()`**: Get the current user balance for a specific account. # Running the Keypom Tests We have put together a suite of test cases that can be found in the `__tests__` folder. These range anywhere from simple config tests all the way to full blown ticketing and POAPs. In the `__tests__` folder, there are sub-folders with each type of test. Some of these sub-folders contain a `utils` folder with some utility functions used. All the tests use `workspaces-js`. In order to run all the tests, run the following command. ```bash yarn && yarn test ``` This will run through each test 1 by 1. If you wish to only run a set of specific tests, the full list of commands can be found below. ```bash "test:internals" "test:stage1" "test:stage1:simple" "test:ticketing" "test:poaps" "test:configs" "test:nft-drops" "test:ft-drops" "test:profiling" "test:passwords" ``` # Contributing First off, thanks for taking the time to contribute! Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**. Please try to create bug reports that are: - _Reproducible._ Include steps to reproduce the problem. - _Specific._ Include as much detail as possible: which version, what environment, etc. - _Unique._ Do not duplicate existing opened issues. - _Scoped to a Single Bug._ One bug per report. Please adhere to this project's [code of conduct](docs/CODE_OF_CONDUCT.md). You can use [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) to check for common markdown style inconsistency. # License This project is licensed under the **GPL License**. # Acknowledgements Thanks for these awesome resources that were used during the development of the **Keypom Contract**: - <https://github.com/dec0dOS/amazing-github-template> - <https://github.com/near/near-linkdrop> - <https://github.com/near/near-wallet/blob/master/packages/frontend/docs/Linkdrop.md>
Kerite_Amm-Demo
Cargo.toml README.md src ft.rs lib.rs
```shell near view kerite.testnet get_balance_a near view kerite.testnet get_balance_b near call test-token-a.testnet storage_deposit --accountId kerite.testnet --amount 0.00125 near call test-token-a.testnet ft_transfer '{"receiver_id": "kerite.testnet", "amount": "200"}' --accountId test-token-a.testnet --depositYocto 1 near call kerite.testnet add_liquidity '{"token": "test-token-a.testnet", "amount_in": 200}' --accountId keriteal.testnet near call test-token-b.testnet storage_deposit --accountId kerite.testnet --amount 0.00125 near call test-token-b.testnet ft_transfer '{"receiver_id": "kerite.testnet", "amount": "2000"}' --accountId test-token-b.testnet --depositYocto 1 near call kerite.testnet add_liquidity '{"token": "test-token-b.testnet", "amount_in": 2000}' --accountId keriteal.testnet near call test-token-a.testnet storage_deposit --accountId user-test-amm-1.testnet --amount 0.00125 near call test-token-b.testnet storage_deposit --accountId user-test-amm-1.testnet --amount 0.00125 near call test-token-b.testnet ft_transfer '{"receiver_id": "kerite.testnet", "amount": "40"}' --accountId test-token-b.testnet --depositYocto 1 near call kerite.testnet swap '{"token_in": "test-token-b.testnet", "amount_in": 40}' --accountId user-test-amm-1.testnet --depositYocto 1 ```
gfirik_crossword-contract
Cargo.toml README.md build.bat build.sh src lib.rs test.sh
# Rust Smart Contract Template ## Getting started To get started with this template: 1. Click the "Use this template" button to create a new repo based on this template 2. Update line 2 of `Cargo.toml` with your project name 3. Update line 4 of `Cargo.toml` with your project author names 4. Set up the [prerequisites](https://github.com/near/near-sdk-rs#pre-requisites) 5. Begin writing your smart contract in `src/lib.rs` 6. Test the contract `cargo test -- --nocapture` 8. Build the contract `RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown --release` **Get more info at:** * [Rust Smart Contract Quick Start](https://docs.near.org/develop/prerequisites) * [Rust SDK Book](https://www.near-sdk.io/)
MoniaBellil_Questionner
.env docker-compose.yml qstn_backend README.md config index.js passport-setup.js index.js loaders mongoose.js middlewares passport.js models User.js UserSur.js nft.js package-lock.json package.json routes UserSur.js nfts.js questions.js users.js services Auth.js Survey.js UserSur.js nfts.js questions.js qstn_frontend README.md assembly __tests__ as-pect.d.ts main.spec.ts as_types.d.ts index.ts model.ts tsconfig.json config-overrides.js package-lock.json package.json public index.html manifest.json robots.txt src App.js assets fonts inter inter.css poppins poppins.css img - OR -.svg Google.svg Near.svg avatar-admin.svg bg.svg bitcointalk.svg blockstack.svg carbon_badge.svg dollar.svg github.svg left.svg main-bg.svg nft.svg producthunt.svg profile.svg question.svg reddit.svg right.svg store.svg twitter-social.svg twitter.svg users.svg axiosConfig index.js config.js index.css index.js pages admin-en sidenav sideNav.style.css survey surveryCreator.style.css admin upload-nft components upload upload.style.css authentication authStyle auth.style.css components textField.style.css utils index.js end-user nft nft.style.css profile components edit editProfile.style.css walkthrough components Questions question.css walkthrough.style.css landing landing.style.css terms Terms.styles.css shared navbar navbar.style.css sideNav sideNav.style.css socialMedia socialMedia.style.css terms termsfaq.style.css store actions auth auth.js config.js near.js types.js points points.js types.js reducers auth.js index.js points.js store.js style Buttons.css global.styles.css utils arraysAndFuncs.js setAuthToken.js
# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in your browser. The page will reload when you make changes.\ You may also see any lint errors in the console. ### `npm test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `npm run build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ### `npm run eject` **Note: this is a one-way operation. Once you `eject`, you can't go back!** If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/). ### Code Splitting This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) ### Analyzing the Bundle Size This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) ### Making a Progressive Web App This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) ### Advanced Configuration This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) ### Deployment This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) ### `npm run build` fails to minify This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
esaminu_test-rs-boilerplate-106f
.eslintrc.yml .github ISSUE_TEMPLATE 01_BUG_REPORT.md 02_FEATURE_REQUEST.md 03_CODEBASE_IMPROVEMENT.md 04_SUPPORT_QUESTION.md config.yml PULL_REQUEST_TEMPLATE.md labels.yml workflows codeql.yml deploy-to-console.yml labels.yml lock.yml pr-labels.yml stale.yml .gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs docs CODE_OF_CONDUCT.md CONTRIBUTING.md SECURITY.md frontend App.js assets global.css logo-black.svg logo-white.svg index.html index.js near-interface.js near-wallet.js package.json start.sh ui-components.js integration-tests Cargo.toml src tests.rs package.json
# Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"message":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`. <h1 align="center"> <a href="https://github.com/near/boilerplate-template-rs"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_light.png"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> <img alt="" src="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> </picture> </a> </h1> <div align="center"> Rust Boilerplate Template <br /> <br /> <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=bug&template=01_BUG_REPORT.md&title=bug%3A+">Report a Bug</a> · <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=enhancement&template=02_FEATURE_REQUEST.md&title=feat%3A+">Request a Feature</a> . <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+">Ask a Question</a> </div> <div align="center"> <br /> [![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) [![code with love by near](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-near-ff1414.svg?style=flat-square)](https://github.com/near) </div> <details open="open"> <summary>Table of Contents</summary> - [About](#about) - [Built With](#built-with) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Installation](#installation) - [Usage](#usage) - [Roadmap](#roadmap) - [Support](#support) - [Project assistance](#project-assistance) - [Contributing](#contributing) - [Authors & contributors](#authors--contributors) - [Security](#security) </details> --- ## About This project is created for easy-to-start as a React + Rust skeleton template in the Pagoda Gallery. It was initialized with [create-near-app]. Clone it and start to build your own gallery project! ### Built With [create-near-app], [amazing-github-template](https://github.com/dec0dOS/amazing-github-template) Getting Started ================== ### Prerequisites Make sure you have a [current version of Node.js](https://nodejs.org/en/about/releases/) installed – we are targeting versions `16+`. Read about other [prerequisites](https://docs.near.org/develop/prerequisites) in our docs. ### Installation Install all dependencies: npm install Build your contract: npm run build Deploy your contract to TestNet with a temporary dev account: npm run deploy Usage ===== Test your contract: npm test Start your frontend: npm start Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages ## Roadmap See the [open issues](https://github.com/near/boilerplate-template-rs/issues) for a list of proposed features (and known issues). - [Top Feature Requests](https://github.com/near/boilerplate-template-rs/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Top Bugs](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Newest Bugs](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aopen+is%3Aissue+label%3Abug) ## Support Reach out to the maintainer: - [GitHub issues](https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+) ## Project assistance If you want to say **thank you** or/and support active development of Rust Boilerplate Template: - Add a [GitHub Star](https://github.com/near/boilerplate-template-rs) to the project. - Tweet about the Rust Boilerplate Template. - Write interesting articles about the project on [Dev.to](https://dev.to/), [Medium](https://medium.com/) or your personal blog. Together, we can make Rust Boilerplate Template **better**! ## Contributing First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**. Please read [our contribution guidelines](docs/CONTRIBUTING.md), and thank you for being involved! ## Authors & contributors The original setup of this repository is by [Dmitriy Sheleg](https://github.com/shelegdmitriy). For a full list of all authors and contributors, see [the contributors page](https://github.com/near/boilerplate-template-rs/contributors). ## Security Rust Boilerplate Template follows good practices of security, but 100% security cannot be assured. Rust Boilerplate Template is provided **"as is"** without any **warranty**. Use at your own risk. _For more information and to report security issues, please refer to our [security documentation](docs/SECURITY.md)._
NEARBuilders_NEARSocial
README.md jsons massfollow.json
# NEARSocial Widgets, function calls, docs, etc for NEAR.social
near_wallet-experience
.github ISSUE_TEMPLATE 02_FEATURE_REQUEST.md BOUNTY.yml bug---defect---problem.md config.yml epic-template.md issue-template.md PULL_REQUEST_TEMPLATE.md workflows build.yml codeql.yml lock.yml stale.yml README.md docs CODE_OF_CONDUCT.md CONTRIBUTING.md SECURITY.md frontend .eslintrc.json .prettierrc.json hooks wallet-selector.ts next.config.js package-lock.json package.json pages api hello.ts postcss.config.js public next.svg thirteen.svg vercel.svg styles globals.css tailwind.config.js tsconfig.json package-lock.json package.json
<h1 align="center"> <a href="https://github.com/shelegdmitriy/boilerplate-template-frontend"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/shelegdmitriy/boilerplate-template-frontend/main/docs/images/pagoda_logo_light.png"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/shelegdmitriy/boilerplate-template-frontend/main/docs/images/pagoda_logo_dark.png"> <img alt="" src="https://raw.githubusercontent.com/shelegdmitriy/boilerplate-template-frontend/main/docs/images/pagoda_logo_dark.png"> </picture> </a> </h1> <div align="center"> Boilerplate Template Frontend React <br /> <br /> <a href="https://github.com/shelegdmitriy/boilerplate-template-frontend/issues/new?assignees=&labels=bug&template=01_BUG_REPORT.md&title=bug%3A+">Report a Bug</a> · <a href="https://github.com/shelegdmitriy/boilerplate-template-frontend/issues/new?assignees=&labels=enhancement&template=02_FEATURE_REQUEST.md&title=feat%3A+">Request a Feature</a> . <a href="https://github.com/shelegdmitriy/boilerplate-template-frontend/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+">Ask a Question</a> </div> <div align="center"> <br /> [![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/shelegdmitriy/boilerplate-template-frontend/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) [![code with love by shelegdmitriy](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-shelegdmitriy-ff1414.svg?style=flat-square)](https://github.com/shelegdmitriy) </div> <details open="open"> <summary>Table of Contents</summary> - [About](#about) - [Built With](#built-with) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Installation](#installation) - [Usage](#usage) - [Deploy on Vercel](#deploy-on-vercel) - [Roadmap](#roadmap) - [Support](#support) - [Project assistance](#project-assistance) - [Contributing](#contributing) - [Authors & contributors](#authors--contributors) - [Security](#security) </details> --- ## About This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) and [`tailwindcss`](https://tailwindcss.com/docs/guides/nextjs) created for other boilerplate templates to easily set up and maintain a frontend part ony. ### Built With [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app), [`tailwindcss`](https://tailwindcss.com/docs/guides/nextjs), [`tailwindui`](https://tailwindui.com/), [`@headlessui/react`](https://headlessui.com/), [`@heroicons/react`](https://heroicons.com/), [`amazing-github-template`](https://github.com/dec0dOS/amazing-github-template) Getting Started ================== ### Prerequisites Make sure you have a [current version of Node.js](https://nodejs.org/en/about/releases/) installed – we are targeting versions `18>`. Read about other [prerequisites](https://docs.near.org/develop/prerequisites) in our docs. ### Installation Install all dependencies: npm install Usage ===== Start your frontend: npm run dev Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. Exploring The Code ================== 1. You can start editing the page by modifying `frontend/pages/index.tsx`. The page auto-updates as you edit the file. 2. [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `frontend/pages/api/hello.ts`. 3. The `frontend/pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. 4. This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-next-app]: https://github.com/vercel/next.js/tree/canary/packages/create-next-app [Node.js]: https://nodejs.org/en/download/package-manager [tailwindcss]: https://tailwindcss.com/docs/guides/nextjs You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! ## Deploy on Vercel The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. ## Roadmap See the [open issues](https://github.com/shelegdmitriy/boilerplate-template-frontend/issues) for a list of proposed features (and known issues). - [Top Feature Requests](https://github.com/shelegdmitriy/boilerplate-template-frontend/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Top Bugs](https://github.com/shelegdmitriy/boilerplate-template-frontend/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Newest Bugs](https://github.com/shelegdmitriy/boilerplate-template-frontend/issues?q=is%3Aopen+is%3Aissue+label%3Abug) ## Support Reach out to the maintainer: - [GitHub issues](https://github.com/shelegdmitriy/boilerplate-template-frontend/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+) ## Project assistance If you want to say **thank you** or/and support active development of Boilerplate Template Frontend React: - Add a [GitHub Star](https://github.com/shelegdmitriy/boilerplate-template-frontend) to the project. - Tweet about the Boilerplate Template Frontend React. - Write interesting articles about the project on [Dev.to](https://dev.to/), [Medium](https://medium.com/) or your personal blog. Together, we can make Boilerplate Template Frontend React **better**! ## Contributing First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**. Please read [our contribution guidelines](docs/CONTRIBUTING.md), and thank you for being involved! ## Authors & contributors The original setup of this repository is by [Dmitriy Sheleg](https://github.com/shelegdmitriy). For a full list of all authors and contributors, see [the contributors page](https://github.com/shelegdmitriy/boilerplate-template-frontend/contributors). ## Security Boilerplate Template Frontend React follows good practices of security, but 100% security cannot be assured. Boilerplate Template Frontend React is provided **"as is"** without any **warranty**. Use at your own risk. _For more information and to report security issues, please refer to our [security documentation](docs/SECURITY.md)._
neararabic_lend-me
README.md | android app src debug AndroidManifest.xml main AndroidManifest.xml res drawable-v21 launch_background.xml drawable launch_background.xml values-night styles.xml values styles.xml profile AndroidManifest.xml contract README.md __tests__ as-pect.d.ts index.unit.spec.ts as-pect.config.js asconfig.json assembly as_types.d.ts index.ts models.ts tsconfig.json package.json ios Runner AppDelegate.swift Assets.xcassets AppIcon.appiconset Contents.json LaunchImage.imageset Contents.json README.md Runner-Bridging-Header.h linux CMakeLists.txt flutter CMakeLists.txt generated_plugin_registrant.h my_application.h macos Flutter GeneratedPluginRegistrant.swift Runner AppDelegate.swift Assets.xcassets AppIcon.appiconset Contents.json MainFlutterWindow.swift web index.html manifest.json windows CMakeLists.txt flutter CMakeLists.txt generated_plugin_registrant.h runner CMakeLists.txt flutter_window.cpp flutter_window.h main.cpp resource.h utils.cpp utils.h win32_window.cpp win32_window.h
# Lend Me Smartcontract This is the Lend Me dApp smart contract Lend and borrow on NEAR using an easy to use mobile app build with Flutter that works on IOS and Android and interacts with the user wallets, the near blockchain, and the lendme smart-contract on chain using [near-api-flutter](https://pub.dev/packages/near_api_flutter/score). ## Important Links [dApp repo](https://github.com/neararabic/lend-me) # Launch Screen Assets You can customize the launch screen with your own desired assets by replacing the image files in this directory. You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. # Lend Me Lend and borrow on NEAR using an easy to use mobile app build with Flutter that works on IOS and Android and interacts with the user wallets, the near blockchain, and the lendme smart-contract on chain using [near-api-flutter](https://pub.dev/packages/near_api_flutter/score). ## Important Links - [APK download](https://drive.google.com/file/d/14prBgaMlOTgOo4yAVV-DibJd7ZWOW3QJ/view?usp=sharing) - [Smartcontract](https://github.com/neararabic/lend-me/tree/main/contract) ## Features | Login using NEAR Wallet | Create a borrow request | Create a borrow request | | ------------- | ------------- | ------------- | | <img src="https://user-images.githubusercontent.com/34034904/202174781-68be7371-6332-4294-88e5-d39c38f03bc5.png" width="250"> | <img src="https://user-images.githubusercontent.com/34034904/202176010-7a833996-5754-4f57-a180-6973d56d058a.png" width="250"> | <img src="https://user-images.githubusercontent.com/34034904/202175715-7fa26717-e94b-4498-8a58-6b1968747675.png" width="250"> | | Lend money | See ledger (Borrows and lends) | Payback | | ------------- | ------------- | ------------- | | <img src="https://user-images.githubusercontent.com/34034904/202176176-96b1081c-f7b7-4862-8ee4-eba50865063b.png" width="250"> | <img src="https://user-images.githubusercontent.com/34034904/202176472-1636e2e6-79cd-4266-8489-880a18a3e349.png" width="250"> | <img src="https://user-images.githubusercontent.com/34034904/202176764-58ec4074-ee58-49a8-b043-45538b7fec13.png" width="250"> | ## Packages Used - cupertino_icons: ^1.0.2 - near_api_flutter: ^0.0.13-alpha - shared_preferences: ^2.0.15 - provider: ^6.0.3 - flutter_launcher_icons: ^0.10.0
open-web-academy_SOL-BlockJobs
.vscode settings.json README.md hardhat.config.js package-lock.json package.json scripts sample-script.js test sample-test.js
# Basic Sample Hardhat Project This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts. Try running some of the following tasks: ```shell npx hardhat accounts npx hardhat compile npx hardhat clean npx hardhat test npx hardhat node node scripts/sample-script.js npx hardhat help ```
jian7061_near-marketplace-front
README.md package.json public index.html manifest.json robots.txt src App.css App.js App.test.js components Wallet.js marketplace AddProduct.js Product.js Products.js utils Cover.js Loader.js Notifications.js index.css index.js reportWebVitals.js utils config.js marketplace.js near.js
## LiveDemo https://jian7061.github.io/near-marketplace-front
Amira1502_solana-hackathon-elaco
README.md app .eslintrc.json .github dependabot.yml workflows frontend.yml README.md next-env.d.ts next.config.js package.json postcss.config.js public vercel.svg src models types.ts pages api hello.ts styles globals.css style.js utils explorer.ts tailwind.config.js tsconfig.json program Anchor.toml Cargo.toml README.md migrations deploy.ts package.json programs elaco-solana Cargo.toml Xargo.toml src lib.rs tests elaco-solana.ts tsconfig.json
<a name="readme-top"></a> [![LinkedIn][linkedin-shield]][linkedin-url] <!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/Amira1502/solana-hackathon-elaco"> <img src="https://github.com/Amira1502/solana-hackathon-elaco/blob/master/app/public/logo.png" alt="Logo" width="80" height="80"> </a> <h3 align="center">Elaco</h3> <p align="center"> Elaco is a web3 platform where you can learn and get paid on NEAR to work on open source software in Python, Rust, Ruby, JavaScript, Solidity, HTML, CSS, Design, and more. <br /> <a href="https://docs.google.com/presentation/d/1xtrO0wN-lu5iWtvNC389wLauVxTpzeWPTlfLPYcEsp4/edit#slide=id.gcc9050bdf8_0_388"><strong>Pitch Deck »</a> <br /> <a href="https://www.youtube.com/watch?v=OWrH-FxUG_E">View Demo »</a> </p> </div> <!-- TABLE OF CONTENTS --> <details> <summary>Table of Contents</summary> <ol> <li> <a href="#about-the-project">About The Project</a> <ul> <li><a href="#built-with">Built With</a></li> </ul> </li> <li><a href="#usage">Usage</a></li> <li><a href="#roadmap">Roadmap</a></li> <li><a href="#contact">Contact</a></li> </ol> </details> <!-- ABOUT THE PROJECT --> ## About The Project [![Product Name Screen Shot][product-screenshot]](https://example.com) In ELACO, contributor can easily monetize their skills. Whether it's Bugs, Features, or Security Issues, Just select an open issue, work on a project, collaborate, build your skills, and get Paid on Solana after code is accepted by the bounty submitter. <p align="right">(<a href="#readme-top">back to top</a>)</p> ### Built With * [![Anchor][Anchor.com]][anchor-url] * [![Solana][Solana.com]][Solana-url] * [![Next][Next.js]][Next-url] * [![React][React.js]][React-url] * [![Tailwind][Tailwind.com]][Tailwind-url] <p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- USAGE EXAMPLES --> ## Usage As a Funder : <br /> 1 Post A Bounty : Fund a well specified issue on your Github repo which is a good candidate for external contribution. <br /> 2 Work With A Elacoiner : Provide a Elacoiner with a timeline and collaborate to complete the task. <br /> 3 Grow Your Project : Merge the Elacoiner’s contribution, pay for a job well done, and grow a healthy open source ecosystem. <br /> As a Contributor : <br /> 1 Find An Open Bounty : Whether it's Bugs, Features, or Security Issues, Elaco's Issue Explorer is the easiest way to find paid work in open source. <br /> 2 Build Something Great : Select an open issue, work on a project, collaborate, build your skills, and contribute towards the open source projects. <br /> 3 Get Paid : Payments are Ethereum-based, & released automatically after code is accepted by the bounty submitter. <br /> <p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- ROADMAP --> ## Roadmap - [ ] ELACO TOKEN : * Withdraw them and exchange them to SOLANA; * Gouvernance DAO - [ ] NFT PROFILE : In ELACO, each profile is an NFT, all the user’s code on the network are linked to this profile, which allows : * Establish the authorship of his code * Keep it on your wallet * Effectively fighting bot and fakes <p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- CONTACT --> ## Contact Your Name - [@amiranasri88](https://twitter.com/amiranasri88) - nasriamira88@gmail.com Project Link: [https://github.com/Amira1502/solana-hackathon-elaco](https://github.com/Amira1502/solana-hackathon-elaco) <p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 [linkedin-url]: https://www.linkedin.com/in/amira-nasri-135582112/ [product-screenshot]: app/public/landing.png [Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white [Next-url]: https://nextjs.org/ [React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB [React-url]: https://reactjs.org/ [Tailwind.com]: https://img.shields.io/badge/Tailwind-563D7C?style=for-the-badge&logo=tailwind&logoColor=white [Tailwind-url]: https://tailwindcss.com/ [Anchor.com]: https://img.shields.io/badge/Anchor-20232A?style=for-the-badge&logo=anchor&logoColor=white [Anchor-url]: https://www.anchor-lang.com/ [Solana.com]: https://img.shields.io/badge/Solana-20232A?style=for-the-badge&logo=solana&logoColor=white [Solana-url]: https://solana.com/ # Anchor Solana Program ```shell anchor build anchor deploy ``` Copy the **program ID** from the output logs; paste it in `Anchor.toml` & `lib.rs`. ```shell anchor build anchor deploy yarn install yarn add ts-mocha anchor run test ``` # Solana dApp Scaffold Next The Solana dApp Scaffold repos are meant to house good starting scaffolds for ecosystem developers to get up and running quickly with a front end client UI that integrates several common features found in dApps with some basic usage examples. Wallet Integration. State management. Components examples. Notifications. Setup recommendations. Responsive | Desktop :-------------------------:|:-------------------------: ![](scaffold-mobile.png) | ![](scaffold-desktop.png) ## Getting Started This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). The responsive version for wallets and wallet adapter may not function or work as expected for mobile based on plugin and wallet compatibility. For more code examples and implementations please visit the [Solana Cookbook](https://solanacookbook.com/) ## Installation ```bash npm install # or yarn install ``` ## Build and Run Next, run the development server: ```bash npm run dev # or yarn dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. ## Features Each Scaffold will contain at least the following features: ``` Wallet Integration with Auto Connec / Refresh State Management Components: One or more components demonstrating state management Web3 Js: Examples of one or more uses of web3 js including a transaction with a connection provider Sample navigation and page changing to demonstate state Clean Simple Styling Notifications (optional): Example of using a notification system ``` A Solana Components Repo will be released in the near future to house a common components library. ### Structure The scaffold project structure may vary based on the front end framework being utilized. The below is an example structure for the Next js Scaffold. ``` ├── public : publically hosted files ├── src : primary code folders and files │ ├── components : should house anything considered a resuable UI component │ ├── contexts` : any context considered reusable and useuful to many compoennts that can be passed down through a component tree │ ├── hooks` : any functions that let you 'hook' into react state or lifecycle features from function components │ ├── models` : any data structure that may be reused throughout the project │ ├── pages` : the pages that host meta data and the intended `View` for the page │ ├── stores` : stores used in state management │ ├── styles` : contain any global and reusable styles │ ├── utils` : any other functionality considered reusable code that can be referenced │ ├── views` : contains the actual views of the project that include the main content and components within style, package, configuration, and other project files ``` ## Contributing Anyone is welcome to create an issue to build, discuss or request a new feature or update to the existing code base. Please keep in mind the following when submitting an issue. We consider merging high value features that may be utilized by the majority of scaffold users. If this is not a common feature or fix, consider adding it to the component library or cookbook. Please refer to the project's architecture and style when contributing. If submitting a feature, please reference the project structure shown above and try to follow the overall architecture and style presented in the existing scaffold. ### Committing To choose a task or make your own, do the following: 1. [Add an issue](https://github.com/solana-dev-adv/solana-dapp-next/issues/new) for the task and assign it to yourself or comment on the issue 2. Make a draft PR referencing the issue. The general flow for making a contribution: 1. Fork the repo on GitHub 2. Clone the project to your own machine 3. Commit changes to your own branch 4. Push your work back up to your fork 5. Submit a Pull request so that we can review your changes **NOTE**: Be sure to merge the latest from "upstream" before making a pull request! You can find tasks on the [project board](https://github.com/solana-dev-adv/solana-dapp-next/projects/1) or create an issue and assign it to yourself. ## Learn More Next Js To learn more about Next.js, take a look at the following resources: - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! ## Deploy on Vercel The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
LouisDonDaza_ielec
.gitpod.yml README.md babel.config.js contract README.md as-pect.config.js asconfig.json assembly __tests__ as-pect.d.ts main.spec.ts as_types.d.ts index.ts tsconfig.json compile.js node_modules .bin acorn.cmd acorn.ps1 asb.cmd asb.ps1 asbuild.cmd asbuild.ps1 asc.cmd asc.ps1 asinit.cmd asinit.ps1 asp.cmd asp.ps1 aspect.cmd aspect.ps1 assemblyscript-build.cmd assemblyscript-build.ps1 eslint.cmd eslint.ps1 esparse.cmd esparse.ps1 esvalidate.cmd esvalidate.ps1 js-yaml.cmd js-yaml.ps1 mkdirp.cmd mkdirp.ps1 near-vm-as.cmd near-vm-as.ps1 near-vm.cmd near-vm.ps1 nearley-railroad.cmd nearley-railroad.ps1 nearley-test.cmd nearley-test.ps1 nearley-unparse.cmd nearley-unparse.ps1 nearleyc.cmd nearleyc.ps1 node-which.cmd node-which.ps1 resolve.cmd resolve.ps1 rimraf.cmd rimraf.ps1 semver.cmd semver.ps1 shjs.cmd shjs.ps1 wasm-opt.cmd wasm-opt.ps1 .package-lock.json @as-covers assembly CONTRIBUTING.md README.md index.ts package.json tsconfig.json core CONTRIBUTING.md README.md package.json glue README.md lib index.d.ts index.js package.json transform README.md lib index.d.ts index.js util.d.ts util.js node_modules visitor-as .github workflows test.yml README.md as index.d.ts index.js asconfig.json dist astBuilder.d.ts astBuilder.js base.d.ts base.js baseTransform.d.ts baseTransform.js decorator.d.ts decorator.js examples capitalize.d.ts capitalize.js exportAs.d.ts exportAs.js functionCallTransform.d.ts functionCallTransform.js includeBytesTransform.d.ts includeBytesTransform.js list.d.ts list.js toString.d.ts toString.js index.d.ts index.js path.d.ts path.js simpleParser.d.ts simpleParser.js transformRange.d.ts transformRange.js transformer.d.ts transformer.js utils.d.ts utils.js visitor.d.ts visitor.js package.json tsconfig.json package.json @as-pect assembly README.md assembly index.ts internal Actual.ts Expectation.ts Expected.ts Reflect.ts ReflectedValueType.ts Test.ts assert.ts call.ts comparison toIncludeComparison.ts toIncludeEqualComparison.ts log.ts noOp.ts package.json types as-pect.d.ts as-pect.portable.d.ts env.d.ts cli README.md init as-pect.config.js env.d.ts example.spec.ts init-types.d.ts portable-types.d.ts lib as-pect.cli.amd.d.ts as-pect.cli.amd.js help.d.ts help.js index.d.ts index.js init.d.ts init.js portable.d.ts portable.js run.d.ts run.js test.d.ts test.js types.d.ts types.js util CommandLineArg.d.ts CommandLineArg.js IConfiguration.d.ts IConfiguration.js asciiArt.d.ts asciiArt.js collectReporter.d.ts collectReporter.js getTestEntryFiles.d.ts getTestEntryFiles.js removeFile.d.ts removeFile.js strings.d.ts strings.js writeFile.d.ts writeFile.js worklets ICommand.d.ts ICommand.js compiler.d.ts compiler.js package.json core README.md lib as-pect.core.amd.d.ts as-pect.core.amd.js index.d.ts index.js reporter CombinationReporter.d.ts CombinationReporter.js EmptyReporter.d.ts EmptyReporter.js IReporter.d.ts IReporter.js SummaryReporter.d.ts SummaryReporter.js VerboseReporter.d.ts VerboseReporter.js test IWarning.d.ts IWarning.js TestContext.d.ts TestContext.js TestNode.d.ts TestNode.js transform assemblyscript.d.ts assemblyscript.js createAddReflectedValueKeyValuePairsMember.d.ts createAddReflectedValueKeyValuePairsMember.js createGenericTypeParameter.d.ts createGenericTypeParameter.js createStrictEqualsMember.d.ts createStrictEqualsMember.js emptyTransformer.d.ts emptyTransformer.js hash.d.ts hash.js index.d.ts index.js util IAspectExports.d.ts IAspectExports.js IWriteable.d.ts IWriteable.js ReflectedValue.d.ts ReflectedValue.js TestNodeType.d.ts TestNodeType.js rTrace.d.ts rTrace.js stringifyReflectedValue.d.ts stringifyReflectedValue.js timeDifference.d.ts timeDifference.js wasmTools.d.ts wasmTools.js package.json csv-reporter index.ts lib as-pect.csv-reporter.amd.d.ts as-pect.csv-reporter.amd.js index.d.ts index.js package.json readme.md tsconfig.json json-reporter index.ts lib as-pect.json-reporter.amd.d.ts as-pect.json-reporter.amd.js index.d.ts index.js package.json readme.md tsconfig.json snapshots __tests__ snapshot.spec.ts jest.config.js lib Snapshot.d.ts Snapshot.js SnapshotDiff.d.ts SnapshotDiff.js SnapshotDiffResult.d.ts SnapshotDiffResult.js as-pect.core.amd.d.ts as-pect.core.amd.js index.d.ts index.js parser grammar.d.ts grammar.js package.json src Snapshot.ts SnapshotDiff.ts SnapshotDiffResult.ts index.ts parser grammar.ts tsconfig.json @assemblyscript loader README.md index.d.ts index.js package.json umd index.d.ts index.js package.json @babel code-frame README.md lib index.js package.json helper-validator-identifier README.md lib identifier.js index.js keyword.js package.json scripts generate-identifier-regex.js highlight README.md lib index.js node_modules ansi-styles index.js package.json readme.md chalk index.js package.json readme.md templates.js types index.d.ts color-convert CHANGELOG.md README.md conversions.js index.js package.json route.js color-name .eslintrc.json README.md index.js package.json test.js escape-string-regexp index.js package.json readme.md has-flag index.js package.json readme.md supports-color browser.js index.js package.json readme.md package.json @eslint eslintrc CHANGELOG.md README.md conf config-schema.js environments.js eslint-all.js eslint-recommended.js lib cascading-config-array-factory.js config-array-factory.js config-array config-array.js config-dependency.js extracted-config.js ignore-pattern.js index.js override-tester.js flat-compat.js index.js shared ajv.js config-ops.js config-validator.js deprecation-warnings.js naming.js relative-module-resolver.js types.js package.json @humanwhocodes config-array README.md api.js package.json object-schema .eslintrc.js .github workflows nodejs-test.yml release-please.yml CHANGELOG.md README.md package.json src index.js merge-strategy.js object-schema.js validation-strategy.js tests merge-strategy.js object-schema.js validation-strategy.js acorn-jsx README.md index.d.ts index.js package.json xhtml.js acorn CHANGELOG.md README.md dist acorn.d.ts acorn.js acorn.mjs.d.ts bin.js package.json ajv .tonic_example.js README.md dist ajv.bundle.js ajv.min.js lib ajv.d.ts ajv.js cache.js compile async.js equal.js error_classes.js formats.js index.js resolve.js rules.js schema_obj.js ucs2length.js util.js data.js definition_schema.js dotjs README.md _limit.js _limitItems.js _limitLength.js _limitProperties.js allOf.js anyOf.js comment.js const.js contains.js custom.js dependencies.js enum.js format.js if.js index.js items.js multipleOf.js not.js oneOf.js pattern.js properties.js propertyNames.js ref.js required.js uniqueItems.js validate.js keyword.js refs data.json json-schema-draft-04.json json-schema-draft-06.json json-schema-draft-07.json json-schema-secure.json package.json scripts .eslintrc.yml bundle.js compile-dots.js ansi-colors README.md index.js package.json symbols.js types index.d.ts ansi-regex index.d.ts index.js package.json readme.md ansi-styles index.d.ts index.js package.json readme.md argparse CHANGELOG.md README.md index.js lib action.js action append.js append constant.js count.js help.js store.js store constant.js false.js true.js subparsers.js version.js action_container.js argparse.js argument error.js exclusive.js group.js argument_parser.js const.js help added_formatters.js formatter.js namespace.js utils.js package.json as-bignum README.md assembly __tests__ as-pect.d.ts i128.spec.as.ts safe_u128.spec.as.ts u128.spec.as.ts u256.spec.as.ts utils.ts fixed fp128.ts fp256.ts index.ts safe fp128.ts fp256.ts types.ts globals.ts index.ts integer i128.ts i256.ts index.ts safe i128.ts i256.ts i64.ts index.ts u128.ts u256.ts u64.ts u128.ts u256.ts tsconfig.json utils.ts package.json asbuild README.md dist cli.d.ts cli.js commands build.d.ts build.js fmt.d.ts fmt.js index.d.ts index.js init cmd.d.ts cmd.js files asconfigJson.d.ts asconfigJson.js aspecConfig.d.ts aspecConfig.js assembly_files.d.ts assembly_files.js eslintConfig.d.ts eslintConfig.js gitignores.d.ts gitignores.js index.d.ts index.js indexJs.d.ts indexJs.js packageJson.d.ts packageJson.js test_files.d.ts test_files.js index.d.ts index.js interfaces.d.ts interfaces.js run.d.ts run.js test.d.ts test.js index.d.ts index.js main.d.ts main.js utils.d.ts utils.js index.js node_modules cliui CHANGELOG.md LICENSE.txt README.md index.js package.json wrap-ansi index.js package.json readme.md y18n CHANGELOG.md README.md index.js package.json yargs-parser CHANGELOG.md LICENSE.txt README.md index.js lib tokenize-arg-string.js package.json yargs CHANGELOG.md README.md build lib apply-extends.d.ts apply-extends.js argsert.d.ts argsert.js command.d.ts command.js common-types.d.ts common-types.js completion-templates.d.ts completion-templates.js completion.d.ts completion.js is-promise.d.ts is-promise.js levenshtein.d.ts levenshtein.js middleware.d.ts middleware.js obj-filter.d.ts obj-filter.js parse-command.d.ts parse-command.js process-argv.d.ts process-argv.js usage.d.ts usage.js validation.d.ts validation.js yargs.d.ts yargs.js yerror.d.ts yerror.js index.js locales be.json de.json en.json es.json fi.json fr.json hi.json hu.json id.json it.json ja.json ko.json nb.json nl.json nn.json pirate.json pl.json pt.json pt_BR.json ru.json th.json tr.json zh_CN.json zh_TW.json package.json yargs.js package.json assemblyscript-json .eslintrc.js .travis.yml README.md assembly JSON.ts decoder.ts encoder.ts index.ts tsconfig.json util index.ts index.js package.json temp-docs README.md classes decoderstate.md json.arr.md json.bool.md json.float.md json.integer.md json.null.md json.num.md json.obj.md json.str.md json.value.md jsondecoder.md jsonencoder.md jsonhandler.md throwingjsonhandler.md modules json.md assemblyscript-regex .eslintrc.js .github workflows benchmark.yml release.yml test.yml README.md as-pect.config.js asconfig.empty.json asconfig.json assembly __spec_tests__ generated.spec.ts __tests__ alterations.spec.ts as-pect.d.ts boundary-assertions.spec.ts capture-group.spec.ts character-classes.spec.ts character-sets.spec.ts characters.ts empty.ts quantifiers.spec.ts range-quantifiers.spec.ts regex.spec.ts utils.ts char.ts env.ts index.ts nfa matcher.ts nfa.ts types.ts walker.ts parser node.ts parser.ts string-iterator.ts walker.ts regexp.ts tsconfig.json util.ts benchmark benchmark.js package.json spec test-generator.js ts index.ts tsconfig.json assemblyscript-temporal .github workflows node.js.yml release.yml .vscode launch.json README.md as-pect.config.js asconfig.empty.json asconfig.json assembly __tests__ README.md as-pect.d.ts date.spec.ts duration.spec.ts empty.ts plaindate.spec.ts plaindatetime.spec.ts plainmonthday.spec.ts plaintime.spec.ts plainyearmonth.spec.ts timezone.spec.ts zoneddatetime.spec.ts constants.ts date.ts duration.ts enums.ts env.ts index.ts instant.ts now.ts plaindate.ts plaindatetime.ts plainmonthday.ts plaintime.ts plainyearmonth.ts timezone.ts tsconfig.json tz __tests__ index.spec.ts rule.spec.ts zone.spec.ts iana.ts index.ts rule.ts zone.ts utils.ts zoneddatetime.ts development.md package.json tzdb README.md iana theory.html zoneinfo2tdf.pl assemblyscript README.md cli README.md asc.d.ts asc.js asc.json shim README.md fs.js path.js process.js transform.d.ts transform.js util colors.d.ts colors.js find.d.ts find.js mkdirp.d.ts mkdirp.js options.d.ts options.js utf8.d.ts utf8.js dist asc.js assemblyscript.d.ts assemblyscript.js sdk.js index.d.ts index.js lib loader README.md index.d.ts index.js package.json umd index.d.ts index.js package.json rtrace README.md bin rtplot.js index.d.ts index.js package.json umd index.d.ts index.js package.json package-lock.json package.json std README.md assembly.json assembly array.ts arraybuffer.ts atomics.ts bindings Date.ts Math.ts Reflect.ts asyncify.ts console.ts wasi.ts wasi_snapshot_preview1.ts wasi_unstable.ts builtins.ts compat.ts console.ts crypto.ts dataview.ts date.ts diagnostics.ts error.ts function.ts index.d.ts iterator.ts map.ts math.ts memory.ts number.ts object.ts polyfills.ts process.ts reference.ts regexp.ts rt.ts rt README.md common.ts index-incremental.ts index-minimal.ts index-stub.ts index.d.ts itcms.ts rtrace.ts stub.ts tcms.ts tlsf.ts set.ts shared feature.ts target.ts tsconfig.json typeinfo.ts staticarray.ts string.ts symbol.ts table.ts tsconfig.json typedarray.ts uri.ts util casemap.ts error.ts hash.ts math.ts memory.ts number.ts sort.ts string.ts uri.ts vector.ts wasi index.ts portable.json portable index.d.ts index.js types assembly index.d.ts package.json portable index.d.ts package.json tsconfig-base.json astral-regex index.d.ts index.js package.json readme.md axios CHANGELOG.md README.md UPGRADE_GUIDE.md dist axios.js axios.min.js index.d.ts index.js lib adapters README.md http.js xhr.js axios.js cancel Cancel.js CancelToken.js isCancel.js core Axios.js InterceptorManager.js README.md buildFullPath.js createError.js dispatchRequest.js enhanceError.js mergeConfig.js settle.js transformData.js defaults.js helpers README.md bind.js buildURL.js combineURLs.js cookies.js deprecatedMethod.js isAbsoluteURL.js isURLSameOrigin.js normalizeHeaderName.js parseHeaders.js spread.js utils.js package.json balanced-match .github FUNDING.yml LICENSE.md README.md index.js package.json base-x LICENSE.md README.md package.json src index.d.ts index.js binary-install README.md example binary.js package.json run.js index.js package.json src binary.js binaryen README.md index.d.ts package-lock.json package.json wasm.d.ts bn.js CHANGELOG.md README.md lib bn.js package.json brace-expansion README.md index.js package.json bs58 CHANGELOG.md README.md index.js package.json callsites index.d.ts index.js package.json readme.md camelcase index.d.ts index.js package.json readme.md chalk index.d.ts package.json readme.md source index.js templates.js util.js chownr README.md chownr.js package.json cliui CHANGELOG.md LICENSE.txt README.md build lib index.js string-utils.js package.json color-convert CHANGELOG.md README.md conversions.js index.js package.json route.js color-name README.md index.js package.json commander CHANGELOG.md Readme.md index.js package.json typings index.d.ts concat-map .travis.yml example map.js index.js package.json test map.js cross-spawn CHANGELOG.md README.md index.js lib enoent.js parse.js util escape.js readShebang.js resolveCommand.js package.json csv-stringify README.md lib browser index.js sync.js es5 index.d.ts index.js sync.d.ts sync.js index.d.ts index.js sync.d.ts sync.js package.json debug README.md package.json src browser.js common.js index.js node.js decamelize index.js package.json readme.md deep-is .travis.yml example cmp.js index.js package.json test NaN.js cmp.js neg-vs-pos-0.js diff CONTRIBUTING.md README.md dist diff.js lib convert dmp.js xml.js diff array.js base.js character.js css.js json.js line.js sentence.js word.js index.es6.js index.js patch apply.js create.js merge.js parse.js util array.js distance-iterator.js params.js package.json release-notes.md runtime.js discontinuous-range .travis.yml README.md index.js package.json test main-test.js doctrine CHANGELOG.md README.md lib doctrine.js typed.js utility.js package.json emoji-regex LICENSE-MIT.txt README.md es2015 index.js text.js index.d.ts index.js package.json text.js enquirer CHANGELOG.md README.md index.d.ts index.js lib ansi.js combos.js completer.js interpolate.js keypress.js placeholder.js prompt.js prompts autocomplete.js basicauth.js confirm.js editable.js form.js index.js input.js invisible.js list.js multiselect.js numeral.js password.js quiz.js scale.js select.js snippet.js sort.js survey.js text.js toggle.js render.js roles.js state.js styles.js symbols.js theme.js timer.js types array.js auth.js boolean.js index.js number.js string.js utils.js package.json env-paths index.d.ts index.js package.json readme.md escalade dist index.js index.d.ts package.json readme.md sync index.d.ts index.js escape-string-regexp index.d.ts index.js package.json readme.md eslint-scope CHANGELOG.md README.md lib definition.js index.js pattern-visitor.js reference.js referencer.js scope-manager.js scope.js variable.js package.json eslint-utils README.md index.js node_modules eslint-visitor-keys CHANGELOG.md README.md lib index.js visitor-keys.json package.json package.json eslint-visitor-keys CHANGELOG.md README.md lib index.js visitor-keys.json package.json eslint CHANGELOG.md README.md bin eslint.js conf category-list.json config-schema.js default-cli-options.js eslint-all.js eslint-recommended.js replacements.json lib api.js cli-engine cli-engine.js file-enumerator.js formatters checkstyle.js codeframe.js compact.js html.js jslint-xml.js json-with-metadata.js json.js junit.js stylish.js table.js tap.js unix.js visualstudio.js hash.js index.js lint-result-cache.js load-rules.js xml-escape.js cli.js config default-config.js flat-config-array.js flat-config-schema.js rule-validator.js eslint eslint.js index.js init autoconfig.js config-file.js config-initializer.js config-rule.js npm-utils.js source-code-utils.js linter apply-disable-directives.js code-path-analysis code-path-analyzer.js code-path-segment.js code-path-state.js code-path.js debug-helpers.js fork-context.js id-generator.js config-comment-parser.js index.js interpolate.js linter.js node-event-generator.js report-translator.js rule-fixer.js rules.js safe-emitter.js source-code-fixer.js timing.js options.js rule-tester index.js rule-tester.js rules accessor-pairs.js array-bracket-newline.js array-bracket-spacing.js array-callback-return.js array-element-newline.js arrow-body-style.js arrow-parens.js arrow-spacing.js block-scoped-var.js block-spacing.js brace-style.js callback-return.js camelcase.js capitalized-comments.js class-methods-use-this.js comma-dangle.js comma-spacing.js comma-style.js complexity.js computed-property-spacing.js consistent-return.js consistent-this.js constructor-super.js curly.js default-case-last.js default-case.js default-param-last.js dot-location.js dot-notation.js eol-last.js eqeqeq.js for-direction.js func-call-spacing.js func-name-matching.js func-names.js func-style.js function-call-argument-newline.js function-paren-newline.js generator-star-spacing.js getter-return.js global-require.js grouped-accessor-pairs.js guard-for-in.js handle-callback-err.js id-blacklist.js id-denylist.js id-length.js id-match.js implicit-arrow-linebreak.js indent-legacy.js indent.js index.js init-declarations.js jsx-quotes.js key-spacing.js keyword-spacing.js line-comment-position.js linebreak-style.js lines-around-comment.js lines-around-directive.js lines-between-class-members.js max-classes-per-file.js max-depth.js max-len.js max-lines-per-function.js max-lines.js max-nested-callbacks.js max-params.js max-statements-per-line.js max-statements.js multiline-comment-style.js multiline-ternary.js new-cap.js new-parens.js newline-after-var.js newline-before-return.js newline-per-chained-call.js no-alert.js no-array-constructor.js no-async-promise-executor.js no-await-in-loop.js no-bitwise.js no-buffer-constructor.js no-caller.js no-case-declarations.js no-catch-shadow.js no-class-assign.js no-compare-neg-zero.js no-cond-assign.js no-confusing-arrow.js no-console.js no-const-assign.js no-constant-condition.js no-constructor-return.js no-continue.js no-control-regex.js no-debugger.js no-delete-var.js no-div-regex.js no-dupe-args.js no-dupe-class-members.js no-dupe-else-if.js no-dupe-keys.js no-duplicate-case.js no-duplicate-imports.js no-else-return.js no-empty-character-class.js no-empty-function.js no-empty-pattern.js no-empty.js no-eq-null.js no-eval.js no-ex-assign.js no-extend-native.js no-extra-bind.js no-extra-boolean-cast.js no-extra-label.js no-extra-parens.js no-extra-semi.js no-fallthrough.js no-floating-decimal.js no-func-assign.js no-global-assign.js no-implicit-coercion.js no-implicit-globals.js no-implied-eval.js no-import-assign.js no-inline-comments.js no-inner-declarations.js no-invalid-regexp.js no-invalid-this.js no-irregular-whitespace.js no-iterator.js no-label-var.js no-labels.js no-lone-blocks.js no-lonely-if.js no-loop-func.js no-loss-of-precision.js no-magic-numbers.js no-misleading-character-class.js no-mixed-operators.js no-mixed-requires.js no-mixed-spaces-and-tabs.js no-multi-assign.js no-multi-spaces.js no-multi-str.js no-multiple-empty-lines.js no-native-reassign.js no-negated-condition.js no-negated-in-lhs.js no-nested-ternary.js no-new-func.js no-new-object.js no-new-require.js no-new-symbol.js no-new-wrappers.js no-new.js no-nonoctal-decimal-escape.js no-obj-calls.js no-octal-escape.js no-octal.js no-param-reassign.js no-path-concat.js no-plusplus.js no-process-env.js no-process-exit.js no-promise-executor-return.js no-proto.js no-prototype-builtins.js no-redeclare.js no-regex-spaces.js no-restricted-exports.js no-restricted-globals.js no-restricted-imports.js no-restricted-modules.js no-restricted-properties.js no-restricted-syntax.js no-return-assign.js no-return-await.js no-script-url.js no-self-assign.js no-self-compare.js no-sequences.js no-setter-return.js no-shadow-restricted-names.js no-shadow.js no-spaced-func.js no-sparse-arrays.js no-sync.js no-tabs.js no-template-curly-in-string.js no-ternary.js no-this-before-super.js no-throw-literal.js no-trailing-spaces.js no-undef-init.js no-undef.js no-undefined.js no-underscore-dangle.js no-unexpected-multiline.js no-unmodified-loop-condition.js no-unneeded-ternary.js no-unreachable-loop.js no-unreachable.js no-unsafe-finally.js no-unsafe-negation.js no-unsafe-optional-chaining.js no-unused-expressions.js no-unused-labels.js no-unused-vars.js no-use-before-define.js no-useless-backreference.js no-useless-call.js no-useless-catch.js no-useless-computed-key.js no-useless-concat.js no-useless-constructor.js no-useless-escape.js no-useless-rename.js no-useless-return.js no-var.js no-void.js no-warning-comments.js no-whitespace-before-property.js no-with.js nonblock-statement-body-position.js object-curly-newline.js object-curly-spacing.js object-property-newline.js object-shorthand.js one-var-declaration-per-line.js one-var.js operator-assignment.js operator-linebreak.js padded-blocks.js padding-line-between-statements.js prefer-arrow-callback.js prefer-const.js prefer-destructuring.js prefer-exponentiation-operator.js prefer-named-capture-group.js prefer-numeric-literals.js prefer-object-spread.js prefer-promise-reject-errors.js prefer-reflect.js prefer-regex-literals.js prefer-rest-params.js prefer-spread.js prefer-template.js quote-props.js quotes.js radix.js require-atomic-updates.js require-await.js require-jsdoc.js require-unicode-regexp.js require-yield.js rest-spread-spacing.js semi-spacing.js semi-style.js semi.js sort-imports.js sort-keys.js sort-vars.js space-before-blocks.js space-before-function-paren.js space-in-parens.js space-infix-ops.js space-unary-ops.js spaced-comment.js strict.js switch-colon-spacing.js symbol-description.js template-curly-spacing.js template-tag-spacing.js unicode-bom.js use-isnan.js utils ast-utils.js fix-tracker.js keywords.js lazy-loading-rule-map.js patterns letters.js unicode index.js is-combining-character.js is-emoji-modifier.js is-regional-indicator-symbol.js is-surrogate-pair.js valid-jsdoc.js valid-typeof.js vars-on-top.js wrap-iife.js wrap-regex.js yield-star-spacing.js yoda.js shared ajv.js ast-utils.js config-validator.js deprecation-warnings.js logging.js relative-module-resolver.js runtime-info.js string-utils.js traverser.js types.js source-code index.js source-code.js token-store backward-token-comment-cursor.js backward-token-cursor.js cursor.js cursors.js decorative-cursor.js filter-cursor.js forward-token-comment-cursor.js forward-token-cursor.js index.js limit-cursor.js padded-token-cursor.js skip-cursor.js utils.js messages all-files-ignored.js extend-config-missing.js failed-to-read-json.js file-not-found.js no-config-found.js plugin-conflict.js plugin-invalid.js plugin-missing.js print-config-with-directory-path.js whitespace-found.js package.json espree CHANGELOG.md README.md espree.js lib ast-node-types.js espree.js features.js options.js token-translator.js visitor-keys.js node_modules eslint-visitor-keys CHANGELOG.md README.md lib index.js visitor-keys.json package.json package.json esprima README.md bin esparse.js esvalidate.js dist esprima.js package.json esquery README.md dist esquery.esm.js esquery.esm.min.js esquery.js esquery.lite.js esquery.lite.min.js esquery.min.js license.txt node_modules estraverse README.md estraverse.js gulpfile.js package.json package.json parser.js esrecurse README.md esrecurse.js gulpfile.babel.js node_modules estraverse README.md estraverse.js gulpfile.js package.json package.json estraverse README.md estraverse.js gulpfile.js package.json esutils README.md lib ast.js code.js keyword.js utils.js package.json fast-deep-equal README.md es6 index.d.ts index.js react.d.ts react.js index.d.ts index.js package.json react.d.ts react.js fast-json-stable-stringify .eslintrc.yml .github FUNDING.yml .travis.yml README.md benchmark index.js test.json example key_cmp.js nested.js str.js value_cmp.js index.d.ts index.js package.json test cmp.js nested.js str.js to-json.js fast-levenshtein LICENSE.md README.md levenshtein.js package.json file-entry-cache README.md cache.js changelog.md package.json find-up index.d.ts index.js package.json readme.md flat-cache README.md changelog.md package.json src cache.js del.js utils.js flatted .github FUNDING.yml workflows node.js.yml README.md SPECS.md cjs index.js package.json es.js esm index.js index.js min.js package.json php flatted.php types.d.ts follow-redirects README.md http.js https.js index.js node_modules debug .coveralls.yml .travis.yml CHANGELOG.md README.md karma.conf.js node.js package.json src browser.js debug.js index.js node.js ms index.js license.md package.json readme.md package.json fs-minipass README.md index.js package.json fs.realpath README.md index.js old.js package.json function-bind .jscs.json .travis.yml README.md implementation.js index.js package.json test index.js functional-red-black-tree README.md bench test.js package.json rbtree.js test test.js get-caller-file LICENSE.md README.md index.d.ts index.js package.json glob-parent CHANGELOG.md README.md index.js package.json glob README.md common.js glob.js package.json sync.js globals globals.json index.d.ts index.js package.json readme.md has-flag index.d.ts index.js package.json readme.md has README.md package.json src index.js test index.js hasurl README.md index.js package.json ignore CHANGELOG.md README.md index.d.ts index.js legacy.js package.json import-fresh index.d.ts index.js package.json readme.md imurmurhash README.md imurmurhash.js imurmurhash.min.js package.json inflight README.md inflight.js package.json inherits README.md inherits.js inherits_browser.js package.json interpret README.md index.js mjs-stub.js package.json is-core-module CHANGELOG.md README.md core.json index.js package.json test index.js is-extglob README.md index.js package.json is-fullwidth-code-point index.d.ts index.js package.json readme.md is-glob README.md index.js package.json isarray .travis.yml README.md component.json index.js package.json test.js isexe README.md index.js mode.js package.json test basic.js windows.js isobject README.md index.js package.json js-base64 LICENSE.md README.md base64.d.ts base64.js package.json js-tokens CHANGELOG.md README.md index.js package.json js-yaml CHANGELOG.md README.md bin js-yaml.js dist js-yaml.js js-yaml.min.js index.js lib js-yaml.js js-yaml common.js dumper.js exception.js loader.js mark.js schema.js schema core.js default_full.js default_safe.js failsafe.js json.js type.js type binary.js bool.js float.js int.js js function.js regexp.js undefined.js map.js merge.js null.js omap.js pairs.js seq.js set.js str.js timestamp.js package.json json-schema-traverse .eslintrc.yml .travis.yml README.md index.js package.json spec .eslintrc.yml fixtures schema.js index.spec.js json-stable-stringify-without-jsonify .travis.yml example key_cmp.js nested.js str.js value_cmp.js index.js package.json test cmp.js nested.js replacer.js space.js str.js to-json.js levn README.md lib cast.js index.js parse-string.js package.json line-column README.md lib line-column.js package.json locate-path index.d.ts index.js package.json readme.md lodash.clonedeep README.md index.js package.json lodash.merge README.md index.js package.json lodash.sortby README.md index.js package.json lodash.truncate README.md index.js package.json long README.md dist long.js index.js package.json src long.js lru-cache README.md index.js package.json minimatch README.md minimatch.js package.json minimist .travis.yml example parse.js index.js package.json test all_bool.js bool.js dash.js default_bool.js dotted.js kv_short.js long.js num.js parse.js parse_modified.js proto.js short.js stop_early.js unknown.js whitespace.js minipass README.md index.js package.json minizlib README.md constants.js index.js package.json mkdirp bin cmd.js usage.txt index.js package.json moo README.md moo.js package.json ms index.js license.md package.json readme.md natural-compare README.md index.js package.json near-mock-vm assembly __tests__ main.ts context.ts index.ts outcome.ts vm.ts bin bin.js package.json pkg near_mock_vm.d.ts near_mock_vm.js package.json vm dist cli.d.ts cli.js context.d.ts context.js index.d.ts index.js memory.d.ts memory.js runner.d.ts runner.js utils.d.ts utils.js index.js near-sdk-as as-pect.config.js as_types.d.ts asconfig.json asp.asconfig.json assembly __tests__ as-pect.d.ts assert.spec.ts avl-tree.spec.ts bignum.spec.ts contract.spec.ts contract.ts data.txt empty.ts generic.ts includeBytes.spec.ts main.ts max-heap.spec.ts model.ts near.spec.ts persistent-set.spec.ts promise.spec.ts rollback.spec.ts roundtrip.spec.ts runtime.spec.ts unordered-map.spec.ts util.ts utils.spec.ts as_types.d.ts bindgen.ts index.ts json.lib.ts tsconfig.json vm __tests__ vm.include.ts index.ts compiler.js imports.js package.json near-sdk-bindgen README.md assembly index.ts compiler.js dist JSONBuilder.d.ts JSONBuilder.js classExporter.d.ts classExporter.js index.d.ts index.js transformer.d.ts transformer.js typeChecker.d.ts typeChecker.js utils.d.ts utils.js index.js package.json near-sdk-core README.md asconfig.json assembly as_types.d.ts base58.ts base64.ts bignum.ts collections avlTree.ts index.ts maxHeap.ts persistentDeque.ts persistentMap.ts persistentSet.ts persistentUnorderedMap.ts persistentVector.ts util.ts contract.ts datetime.ts env env.ts index.ts runtime_api.ts index.ts logging.ts math.ts promise.ts storage.ts tsconfig.json util.ts docs assets css main.css js main.js search.json classes _sdk_core_assembly_collections_avltree_.avltree.html _sdk_core_assembly_collections_avltree_.avltreenode.html _sdk_core_assembly_collections_avltree_.childparentpair.html _sdk_core_assembly_collections_avltree_.nullable.html _sdk_core_assembly_collections_persistentdeque_.persistentdeque.html _sdk_core_assembly_collections_persistentmap_.persistentmap.html _sdk_core_assembly_collections_persistentset_.persistentset.html _sdk_core_assembly_collections_persistentunorderedmap_.persistentunorderedmap.html _sdk_core_assembly_collections_persistentvector_.persistentvector.html _sdk_core_assembly_contract_.context-1.html _sdk_core_assembly_contract_.contractpromise.html _sdk_core_assembly_contract_.contractpromiseresult.html _sdk_core_assembly_math_.rng.html _sdk_core_assembly_promise_.contractpromisebatch.html _sdk_core_assembly_storage_.storage-1.html globals.html index.html modules _sdk_core_assembly_base58_.base58.html _sdk_core_assembly_base58_.html _sdk_core_assembly_base64_.base64.html _sdk_core_assembly_base64_.html _sdk_core_assembly_collections_avltree_.html _sdk_core_assembly_collections_index_.collections.html _sdk_core_assembly_collections_index_.html _sdk_core_assembly_collections_persistentdeque_.html _sdk_core_assembly_collections_persistentmap_.html _sdk_core_assembly_collections_persistentset_.html _sdk_core_assembly_collections_persistentunorderedmap_.html _sdk_core_assembly_collections_persistentvector_.html _sdk_core_assembly_collections_util_.html _sdk_core_assembly_contract_.html _sdk_core_assembly_env_env_.env.html _sdk_core_assembly_env_env_.html _sdk_core_assembly_env_index_.html _sdk_core_assembly_env_runtime_api_.html _sdk_core_assembly_index_.html _sdk_core_assembly_logging_.html _sdk_core_assembly_logging_.logging.html _sdk_core_assembly_math_.html _sdk_core_assembly_math_.math.html _sdk_core_assembly_promise_.html _sdk_core_assembly_storage_.html _sdk_core_assembly_util_.html _sdk_core_assembly_util_.util.html package.json near-sdk-simulator __tests__ avl-tree-contract.spec.ts cross.spec.ts empty.spec.ts exportAs.spec.ts singleton-no-constructor.spec.ts singleton.spec.ts asconfig.js asconfig.json assembly __tests__ avlTreeContract.ts empty.ts exportAs.ts model.ts sentences.ts singleton-fail.ts singleton-no-constructor.ts singleton.ts words.ts as_types.d.ts tsconfig.json dist bin.d.ts bin.js context.d.ts context.js index.d.ts index.js runtime.d.ts runtime.js types.d.ts types.js utils.d.ts utils.js jest.config.js out assembly __tests__ empty.ts exportAs.ts model.ts sentences.ts singleton copy.ts singleton-no-constructor.ts singleton.ts package.json src context.ts index.ts runtime.ts types.ts utils.ts tsconfig.json near-vm getBinary.js install.js package.json run.js uninstall.js nearley LICENSE.txt README.md bin nearley-railroad.js nearley-test.js nearley-unparse.js nearleyc.js lib compile.js generate.js lint.js nearley-language-bootstrapped.js nearley.js stream.js unparse.js package.json once README.md once.js package.json optionator CHANGELOG.md README.md lib help.js index.js util.js package.json p-limit index.d.ts index.js package.json readme.md p-locate index.d.ts index.js package.json readme.md p-try index.d.ts index.js package.json readme.md parent-module index.js package.json readme.md path-exists index.d.ts index.js package.json readme.md path-is-absolute index.js package.json readme.md path-key index.d.ts index.js package.json readme.md path-parse README.md index.js package.json prelude-ls CHANGELOG.md README.md lib Func.js List.js Num.js Obj.js Str.js index.js package.json progress CHANGELOG.md Readme.md index.js lib node-progress.js package.json punycode LICENSE-MIT.txt README.md package.json punycode.es6.js punycode.js railroad-diagrams README.md example.html generator.html package.json railroad-diagrams.css railroad-diagrams.js railroad_diagrams.py randexp README.md lib randexp.js package.json rechoir .travis.yml README.md index.js lib extension.js normalize.js register.js package.json regexpp README.md index.d.ts index.js package.json require-directory .travis.yml index.js package.json require-from-string index.js package.json readme.md require-main-filename CHANGELOG.md LICENSE.txt README.md index.js package.json resolve-from index.js package.json readme.md resolve .github FUNDING.yml SECURITY.md appveyor.yml async.js example async.js sync.js index.js lib async.js caller.js core.js core.json homedir.js is-core.js node-modules-paths.js normalize-options.js sync.js package.json sync.js test core.js dotdot.js dotdot abc index.js index.js faulty_basedir.js filter.js filter_sync.js home_paths.js home_paths_sync.js mock.js mock_sync.js module_dir.js module_dir xmodules aaa index.js ymodules aaa index.js zmodules bbb main.js package.json node-modules-paths.js node_path.js node_path x aaa index.js ccc index.js y bbb index.js ccc index.js nonstring.js pathfilter.js pathfilter deep_ref main.js precedence.js precedence aaa.js aaa index.js main.js bbb.js bbb main.js resolver.js resolver baz doom.js package.json quux.js browser_field a.js b.js package.json cup.coffee dot_main index.js package.json dot_slash_main index.js package.json foo.js incorrect_main index.js package.json invalid_main package.json malformed_package_json index.js package.json mug.coffee mug.js multirepo lerna.json package.json packages package-a index.js package.json package-b index.js package.json nested_symlinks mylib async.js package.json sync.js other_path lib other-lib.js root.js quux foo index.js same_names foo.js foo index.js symlinked _ node_modules foo.js package bar.js package.json without_basedir main.js resolver_sync.js shadowed_core.js shadowed_core node_modules util index.js subdirs.js symlinks.js ret README.md lib index.js positions.js sets.js types.js util.js package.json rimraf CHANGELOG.md README.md bin.js package.json rimraf.js safe-buffer README.md index.d.ts index.js package.json semver README.md bin semver.js classes comparator.js index.js range.js semver.js functions clean.js cmp.js coerce.js compare-build.js compare-loose.js compare.js diff.js eq.js gt.js gte.js inc.js lt.js lte.js major.js minor.js neq.js parse.js patch.js prerelease.js rcompare.js rsort.js satisfies.js sort.js valid.js index.js internal constants.js debug.js identifiers.js parse-options.js re.js package.json preload.js ranges gtr.js intersects.js ltr.js max-satisfying.js min-satisfying.js min-version.js outside.js simplify.js subset.js to-comparators.js valid.js set-blocking CHANGELOG.md LICENSE.txt README.md index.js package.json shebang-command index.js package.json readme.md shebang-regex index.d.ts index.js package.json readme.md shelljs CHANGELOG.md README.md commands.js global.js make.js package.json plugin.js shell.js src cat.js cd.js chmod.js common.js cp.js dirs.js echo.js error.js exec-child.js exec.js find.js grep.js head.js ln.js ls.js mkdir.js mv.js popd.js pushd.js pwd.js rm.js sed.js set.js sort.js tail.js tempdir.js test.js to.js toEnd.js touch.js uniq.js which.js slice-ansi index.js package.json readme.md sprintf-js README.md bower.json demo angular.html dist angular-sprintf.min.js sprintf.min.js gruntfile.js package.json src angular-sprintf.js sprintf.js test test.js string-width index.d.ts index.js package.json readme.md strip-ansi index.d.ts index.js package.json readme.md strip-json-comments index.d.ts index.js package.json readme.md supports-color browser.js index.js package.json readme.md supports-preserve-symlinks-flag .github FUNDING.yml CHANGELOG.md README.md browser.js index.js package.json test index.js table README.md dist src alignSpanningCell.d.ts alignSpanningCell.js alignString.d.ts alignString.js alignTableData.d.ts alignTableData.js calculateCellHeight.d.ts calculateCellHeight.js calculateMaximumColumnWidths.d.ts calculateMaximumColumnWidths.js calculateOutputColumnWidths.d.ts calculateOutputColumnWidths.js calculateRowHeights.d.ts calculateRowHeights.js calculateSpanningCellWidth.d.ts calculateSpanningCellWidth.js createStream.d.ts createStream.js drawBorder.d.ts drawBorder.js drawContent.d.ts drawContent.js drawRow.d.ts drawRow.js drawTable.d.ts drawTable.js generated validators.d.ts validators.js getBorderCharacters.d.ts getBorderCharacters.js index.d.ts index.js injectHeaderConfig.d.ts injectHeaderConfig.js makeRangeConfig.d.ts makeRangeConfig.js makeStreamConfig.d.ts makeStreamConfig.js makeTableConfig.d.ts makeTableConfig.js mapDataUsingRowHeights.d.ts mapDataUsingRowHeights.js padTableData.d.ts padTableData.js schemas config.json shared.json streamConfig.json spanningCellManager.d.ts spanningCellManager.js stringifyTableData.d.ts stringifyTableData.js table.d.ts table.js truncateTableData.d.ts truncateTableData.js types api.d.ts api.js internal.d.ts internal.js utils.d.ts utils.js validateConfig.d.ts validateConfig.js validateSpanningCellConfig.d.ts validateSpanningCellConfig.js validateTableData.d.ts validateTableData.js wrapCell.d.ts wrapCell.js wrapString.d.ts wrapString.js wrapWord.d.ts wrapWord.js node_modules ajv .runkit_example.js README.md dist 2019.d.ts 2019.js 2020.d.ts 2020.js ajv.d.ts ajv.js compile codegen code.d.ts code.js index.d.ts index.js scope.d.ts scope.js errors.d.ts errors.js index.d.ts index.js jtd parse.d.ts parse.js serialize.d.ts serialize.js types.d.ts types.js names.d.ts names.js ref_error.d.ts ref_error.js resolve.d.ts resolve.js rules.d.ts rules.js util.d.ts util.js validate applicability.d.ts applicability.js boolSchema.d.ts boolSchema.js dataType.d.ts dataType.js defaults.d.ts defaults.js index.d.ts index.js keyword.d.ts keyword.js subschema.d.ts subschema.js core.d.ts core.js jtd.d.ts jtd.js refs data.json json-schema-2019-09 index.d.ts index.js meta applicator.json content.json core.json format.json meta-data.json validation.json schema.json json-schema-2020-12 index.d.ts index.js meta applicator.json content.json core.json format-annotation.json meta-data.json unevaluated.json validation.json schema.json json-schema-draft-06.json json-schema-draft-07.json json-schema-secure.json jtd-schema.d.ts jtd-schema.js runtime equal.d.ts equal.js parseJson.d.ts parseJson.js quote.d.ts quote.js re2.d.ts re2.js timestamp.d.ts timestamp.js ucs2length.d.ts ucs2length.js uri.d.ts uri.js validation_error.d.ts validation_error.js standalone index.d.ts index.js instance.d.ts instance.js types index.d.ts index.js json-schema.d.ts json-schema.js jtd-schema.d.ts jtd-schema.js vocabularies applicator additionalItems.d.ts additionalItems.js additionalProperties.d.ts additionalProperties.js allOf.d.ts allOf.js anyOf.d.ts anyOf.js contains.d.ts contains.js dependencies.d.ts dependencies.js dependentSchemas.d.ts dependentSchemas.js if.d.ts if.js index.d.ts index.js items.d.ts items.js items2020.d.ts items2020.js not.d.ts not.js oneOf.d.ts oneOf.js patternProperties.d.ts patternProperties.js prefixItems.d.ts prefixItems.js properties.d.ts properties.js propertyNames.d.ts propertyNames.js thenElse.d.ts thenElse.js code.d.ts code.js core id.d.ts id.js index.d.ts index.js ref.d.ts ref.js discriminator index.d.ts index.js types.d.ts types.js draft2020.d.ts draft2020.js draft7.d.ts draft7.js dynamic dynamicAnchor.d.ts dynamicAnchor.js dynamicRef.d.ts dynamicRef.js index.d.ts index.js recursiveAnchor.d.ts recursiveAnchor.js recursiveRef.d.ts recursiveRef.js errors.d.ts errors.js format format.d.ts format.js index.d.ts index.js jtd discriminator.d.ts discriminator.js elements.d.ts elements.js enum.d.ts enum.js error.d.ts error.js index.d.ts index.js metadata.d.ts metadata.js nullable.d.ts nullable.js optionalProperties.d.ts optionalProperties.js properties.d.ts properties.js ref.d.ts ref.js type.d.ts type.js union.d.ts union.js values.d.ts values.js metadata.d.ts metadata.js next.d.ts next.js unevaluated index.d.ts index.js unevaluatedItems.d.ts unevaluatedItems.js unevaluatedProperties.d.ts unevaluatedProperties.js validation const.d.ts const.js dependentRequired.d.ts dependentRequired.js enum.d.ts enum.js index.d.ts index.js limitContains.d.ts limitContains.js limitItems.d.ts limitItems.js limitLength.d.ts limitLength.js limitNumber.d.ts limitNumber.js limitProperties.d.ts limitProperties.js multipleOf.d.ts multipleOf.js pattern.d.ts pattern.js required.d.ts required.js uniqueItems.d.ts uniqueItems.js lib 2019.ts 2020.ts ajv.ts compile codegen code.ts index.ts scope.ts errors.ts index.ts jtd parse.ts serialize.ts types.ts names.ts ref_error.ts resolve.ts rules.ts util.ts validate applicability.ts boolSchema.ts dataType.ts defaults.ts index.ts keyword.ts subschema.ts core.ts jtd.ts refs data.json json-schema-2019-09 index.ts meta applicator.json content.json core.json format.json meta-data.json validation.json schema.json json-schema-2020-12 index.ts meta applicator.json content.json core.json format-annotation.json meta-data.json unevaluated.json validation.json schema.json json-schema-draft-06.json json-schema-draft-07.json json-schema-secure.json jtd-schema.ts runtime equal.ts parseJson.ts quote.ts re2.ts timestamp.ts ucs2length.ts uri.ts validation_error.ts standalone index.ts instance.ts types index.ts json-schema.ts jtd-schema.ts vocabularies applicator additionalItems.ts additionalProperties.ts allOf.ts anyOf.ts contains.ts dependencies.ts dependentSchemas.ts if.ts index.ts items.ts items2020.ts not.ts oneOf.ts patternProperties.ts prefixItems.ts properties.ts propertyNames.ts thenElse.ts code.ts core id.ts index.ts ref.ts discriminator index.ts types.ts draft2020.ts draft7.ts dynamic dynamicAnchor.ts dynamicRef.ts index.ts recursiveAnchor.ts recursiveRef.ts errors.ts format format.ts index.ts jtd discriminator.ts elements.ts enum.ts error.ts index.ts metadata.ts nullable.ts optionalProperties.ts properties.ts ref.ts type.ts union.ts values.ts metadata.ts next.ts unevaluated index.ts unevaluatedItems.ts unevaluatedProperties.ts validation const.ts dependentRequired.ts enum.ts index.ts limitContains.ts limitItems.ts limitLength.ts limitNumber.ts limitProperties.ts multipleOf.ts pattern.ts required.ts uniqueItems.ts package.json json-schema-traverse .eslintrc.yml .github FUNDING.yml workflows build.yml publish.yml README.md index.d.ts index.js package.json spec .eslintrc.yml fixtures schema.js index.spec.js package.json tar README.md index.js lib create.js extract.js get-write-flag.js header.js high-level-opt.js large-numbers.js list.js mkdir.js mode-fix.js normalize-windows-path.js pack.js parse.js path-reservations.js pax.js read-entry.js replace.js strip-absolute-path.js strip-trailing-slashes.js types.js unpack.js update.js warn-mixin.js winchars.js write-entry.js package.json text-table .travis.yml example align.js center.js dotalign.js doubledot.js table.js index.js package.json test align.js ansi-colors.js center.js dotalign.js doubledot.js table.js tr46 LICENSE.md README.md index.js lib mappingTable.json regexes.js package.json ts-mixer CHANGELOG.md README.md dist cjs decorator.js index.js mixin-tracking.js mixins.js proxy.js settings.js types.js util.js esm index.js index.min.js types decorator.d.ts index.d.ts mixin-tracking.d.ts mixins.d.ts proxy.d.ts settings.d.ts types.d.ts util.d.ts package.json type-check README.md lib check.js index.js parse-type.js package.json type-fest base.d.ts index.d.ts package.json readme.md source async-return-type.d.ts asyncify.d.ts basic.d.ts conditional-except.d.ts conditional-keys.d.ts conditional-pick.d.ts entries.d.ts entry.d.ts except.d.ts fixed-length-array.d.ts iterable-element.d.ts literal-union.d.ts merge-exclusive.d.ts merge.d.ts mutable.d.ts opaque.d.ts package-json.d.ts partial-deep.d.ts promisable.d.ts promise-value.d.ts readonly-deep.d.ts require-at-least-one.d.ts require-exactly-one.d.ts set-optional.d.ts set-required.d.ts set-return-type.d.ts stringified.d.ts tsconfig-json.d.ts union-to-intersection.d.ts utilities.d.ts value-of.d.ts ts41 camel-case.d.ts delimiter-case.d.ts index.d.ts kebab-case.d.ts pascal-case.d.ts snake-case.d.ts universal-url README.md browser.js index.js package.json uri-js README.md dist es5 uri.all.d.ts uri.all.js uri.all.min.d.ts uri.all.min.js esnext index.d.ts index.js regexps-iri.d.ts regexps-iri.js regexps-uri.d.ts regexps-uri.js schemes http.d.ts http.js https.d.ts https.js mailto.d.ts mailto.js urn-uuid.d.ts urn-uuid.js urn.d.ts urn.js ws.d.ts ws.js wss.d.ts wss.js uri.d.ts uri.js util.d.ts util.js package.json v8-compile-cache CHANGELOG.md README.md package.json v8-compile-cache.js visitor-as .github workflows test.yml README.md as index.d.ts index.js asconfig.json dist astBuilder.d.ts astBuilder.js base.d.ts base.js baseTransform.d.ts baseTransform.js decorator.d.ts decorator.js examples capitalize.d.ts capitalize.js exportAs.d.ts exportAs.js functionCallTransform.d.ts functionCallTransform.js includeBytesTransform.d.ts includeBytesTransform.js list.d.ts list.js index.d.ts index.js path.d.ts path.js simpleParser.d.ts simpleParser.js transformer.d.ts transformer.js utils.d.ts utils.js visitor.d.ts visitor.js package.json tsconfig.json webidl-conversions LICENSE.md README.md lib index.js package.json whatwg-url LICENSE.txt README.md lib URL-impl.js URL.js URLSearchParams-impl.js URLSearchParams.js infra.js public-api.js url-state-machine.js urlencoded.js utils.js package.json which-module CHANGELOG.md README.md index.js package.json which CHANGELOG.md README.md package.json which.js word-wrap README.md index.d.ts index.js package.json wrap-ansi index.js package.json readme.md wrappy README.md package.json wrappy.js y18n CHANGELOG.md README.md build lib cjs.js index.js platform-shims node.js package.json yallist README.md iterator.js package.json yallist.js yargs-parser CHANGELOG.md LICENSE.txt README.md browser.js build lib index.js string-utils.js tokenize-arg-string.js yargs-parser-types.js yargs-parser.js package.json yargs CHANGELOG.md README.md build lib argsert.js command.js completion-templates.js completion.js middleware.js parse-command.js typings common-types.js yargs-parser-types.js usage.js utils apply-extends.js is-promise.js levenshtein.js obj-filter.js process-argv.js set-blocking.js which-module.js validation.js yargs-factory.js yerror.js helpers index.js package.json locales be.json de.json en.json es.json fi.json fr.json hi.json hu.json id.json it.json ja.json ko.json nb.json nl.json nn.json pirate.json pl.json pt.json pt_BR.json ru.json th.json tr.json zh_CN.json zh_TW.json package.json package-lock.json package.json | features not yet implemented issues with the tests differences between PCRE and JS regex | | | dist global.2a63a4c9.css global.e50bbfba.css global.e50bbfba.js index.html loadingcircles.8ac24591.svg loadingcircles.d7c1628a.svg logo-black.eab7a939.svg logo-white.7fec831f.svg src.0dd31413.js src.26704923.css src.2cb130b6.js src.3bbf1348.js src.7d153e50.js src.8593f69a.css src.9c2ec7ff.js src.a4dbd1a1.js src.b99b378f.js src.e31bb0bc.css package.json src App.js Components Home.js Landing.js NewPoll.js PollingStation.js VoteCheck.js __mocks__ fileMock.js assets loadingcircles.svg logo-black.svg logo-white.svg config.js global.css index.html index.js jest.init.js main.test.js utils.js wallet login index.html
[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. Install with `npm install rimraf`, or just drop rimraf.js somewhere. ## API `rimraf(f, [opts], callback)` The first parameter will be interpreted as a globbing pattern for files. If you want to disable globbing you can do so with `opts.disableGlob` (defaults to `false`). This might be handy, for instance, if you have filenames that contain globbing wildcard characters. The callback will be called with an error if there is one. Certain errors are handled for you: * Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of `opts.maxBusyTries` times before giving up, adding 100ms of wait between each attempt. The default `maxBusyTries` is 3. * `ENOENT` - If the file doesn't exist, rimraf will return successfully, since your desired outcome is already the case. * `EMFILE` - Since `readdir` requires opening a file descriptor, it's possible to hit `EMFILE` if too many file descriptors are in use. In the sync case, there's nothing to be done for this. But in the async case, rimraf will gradually back off with timeouts up to `opts.emfileWait` ms, which defaults to 1000. ## options * unlink, chmod, stat, lstat, rmdir, readdir, unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync In order to use a custom file system library, you can override specific fs functions on the options object. If any of these functions are present on the options object, then the supplied function will be used instead of the default fs method. Sync methods are only relevant for `rimraf.sync()`, of course. For example: ```javascript var myCustomFS = require('some-custom-fs') rimraf('some-thing', myCustomFS, callback) ``` * maxBusyTries If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered on Windows systems, then rimraf will retry with a linear backoff wait of 100ms longer on each try. The default maxBusyTries is 3. Only relevant for async usage. * emfileWait If an `EMFILE` error is encountered, then rimraf will retry repeatedly with a linear backoff of 1ms longer on each try, until the timeout counter hits this max. The default limit is 1000. If you repeatedly encounter `EMFILE` errors, then consider using [graceful-fs](http://npm.im/graceful-fs) in your program. Only relevant for async usage. * glob Set to `false` to disable [glob](http://npm.im/glob) pattern matching. Set to an object to pass options to the glob module. The default glob options are `{ nosort: true, silent: true }`. Glob version 6 is used in this module. Relevant for both sync and async usage. * disableGlob Set to any non-falsey value to disable globbing entirely. (Equivalent to setting `glob: false`.) ## rimraf.sync It can remove stuff synchronously, too. But that's not so good. Use the async API. It's better. ## CLI If installed with `npm install rimraf -g` it can be used as a global command `rimraf <path> [<path> ...]` which is useful for cross platform support. ## mkdirp If you need to create a directory recursively, check out [mkdirp](https://github.com/substack/node-mkdirp). # is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) > Returns true if a string has an extglob. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save is-extglob ``` ## Usage ```js var isExtglob = require('is-extglob'); ``` **True** ```js isExtglob('?(abc)'); isExtglob('@(abc)'); isExtglob('!(abc)'); isExtglob('*(abc)'); isExtglob('+(abc)'); ``` **False** Escaped extglobs: ```js isExtglob('\\?(abc)'); isExtglob('\\@(abc)'); isExtglob('\\!(abc)'); isExtglob('\\*(abc)'); isExtglob('\\+(abc)'); ``` Everything else... ```js isExtglob('foo.js'); isExtglob('!foo.js'); isExtglob('*.js'); isExtglob('**/abc.js'); isExtglob('abc/*.js'); isExtglob('abc/(aaa|bbb).js'); isExtglob('abc/[a-z].js'); isExtglob('abc/{a,b}.js'); isExtglob('abc/?.js'); isExtglob('abc.js'); isExtglob('abc/def/ghi.js'); ``` ## History **v2.0** Adds support for escaping. Escaped exglobs no longer return true. ## About ### Related projects * [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") * [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") * [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") ### Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). ### Building docs _(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ To generate the readme and API documentation with [verb](https://github.com/verbose/verb): ```sh $ npm install -g verb verb-generate-readme && verb ``` ### Running tests Install dev dependencies: ```sh $ npm install -d && npm test ``` ### Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ### License Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ # color-convert [![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) Color-convert is a color conversion library for JavaScript and node. It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): ```js var convert = require('color-convert'); convert.rgb.hsl(140, 200, 100); // [96, 48, 59] convert.keyword.rgb('blue'); // [0, 0, 255] var rgbChannels = convert.rgb.channels; // 3 var cmykChannels = convert.cmyk.channels; // 4 var ansiChannels = convert.ansi16.channels; // 1 ``` # Install ```console $ npm install color-convert ``` # API Simply get the property of the _from_ and _to_ conversion that you're looking for. All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). ```js var convert = require('color-convert'); // Hex to LAB convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] // RGB to CMYK convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] ``` ### Arrays All functions that accept multiple arguments also support passing an array. Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) ```js var convert = require('color-convert'); convert.rgb.hex(123, 45, 67); // '7B2D43' convert.rgb.hex([123, 45, 67]); // '7B2D43' ``` ## Routing Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). # Contribute If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. # License Copyright &copy; 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) ======== A regex that tokenizes JavaScript. ```js var jsTokens = require("js-tokens").default var jsString = "var foo=opts.foo;\n..." jsString.match(jsTokens) // ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] ``` Installation ============ `npm install js-tokens` ```js import jsTokens from "js-tokens" // or: var jsTokens = require("js-tokens").default ``` Usage ===== ### `jsTokens` ### A regex with the `g` flag that matches JavaScript tokens. The regex _always_ matches, even invalid JavaScript and the empty string. The next match is always directly after the previous. ### `var token = matchToToken(match)` ### ```js import {matchToToken} from "js-tokens" // or: var matchToToken = require("js-tokens").matchToToken ``` Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: String, value: String}` object. The following types are available: - string - comment - regex - number - name - punctuator - whitespace - invalid Multi-line comments and strings also have a `closed` property indicating if the token was closed or not (see below). Comments and strings both come in several flavors. To distinguish them, check if the token starts with `//`, `/*`, `'`, `"` or `` ` ``. Names are ECMAScript IdentifierNames, that is, including both identifiers and keywords. You may use [is-keyword-js] to tell them apart. Whitespace includes both line terminators and other whitespace. [is-keyword-js]: https://github.com/crissdev/is-keyword-js ECMAScript support ================== The intention is to always support the latest ECMAScript version whose feature set has been finalized. If adding support for a newer version requires changes, a new version with a major verion bump will be released. Currently, ECMAScript 2018 is supported. Invalid code handling ===================== Unterminated strings are still matched as strings. JavaScript strings cannot contain (unescaped) newlines, so unterminated strings simply end at the end of the line. Unterminated template strings can contain unescaped newlines, though, so they go on to the end of input. Unterminated multi-line comments are also still matched as comments. They simply go on to the end of the input. Unterminated regex literals are likely matched as division and whatever is inside the regex. Invalid ASCII characters have their own capturing group. Invalid non-ASCII characters are treated as names, to simplify the matching of names (except unicode spaces which are treated as whitespace). Note: See also the [ES2018](#es2018) section. Regex literals may contain invalid regex syntax. They are still matched as regex literals. They may also contain repeated regex flags, to keep the regex simple. Strings may contain invalid escape sequences. Limitations =========== Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be perfect. But that’s not the point either. You may compare jsTokens with [esprima] by using `esprima-compare.js`. See `npm run esprima-compare`! [esprima]: http://esprima.org/ ### Template string interpolation ### Template strings are matched as single tokens, from the starting `` ` `` to the ending `` ` ``, including interpolations (whose tokens are not matched individually). Matching template string interpolations requires recursive balancing of `{` and `}`—something that JavaScript regexes cannot do. Only one level of nesting is supported. ### Division and regex literals collision ### Consider this example: ```js var g = 9.82 var number = bar / 2/g var regex = / 2/g ``` A human can easily understand that in the `number` line we’re dealing with division, and in the `regex` line we’re dealing with a regex literal. How come? Because humans can look at the whole code to put the `/` characters in context. A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also look backwards. See the [ES2018](#es2018) section). When the `jsTokens` regex scans throught the above, it will see the following at the end of both the `number` and `regex` rows: ```js / 2/g ``` It is then impossible to know if that is a regex literal, or part of an expression dealing with division. Here is a similar case: ```js foo /= 2/g foo(/= 2/g) ``` The first line divides the `foo` variable with `2/g`. The second line calls the `foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only sees forwards, it cannot tell the two cases apart. There are some cases where we _can_ tell division and regex literals apart, though. First off, we have the simple cases where there’s only one slash in the line: ```js var foo = 2/g foo /= 2 ``` Regex literals cannot contain newlines, so the above cases are correctly identified as division. Things are only problematic when there are more than one non-comment slash in a single line. Secondly, not every character is a valid regex flag. ```js var number = bar / 2/e ``` The above example is also correctly identified as division, because `e` is not a valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` (any letter) as flags, but it is not worth it since it increases the amount of ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are allowed. This means that the above example will be identified as division as long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 characters long. Lastly, we can look _forward_ for information. - If the token following what looks like a regex literal is not valid after a regex literal, but is valid in a division expression, then the regex literal is treated as division instead. For example, a flagless regex cannot be followed by a string, number or name, but all of those three can be the denominator of a division. - Generally, if what looks like a regex literal is followed by an operator, the regex literal is treated as division instead. This is because regexes are seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division could likely be part of such an expression. Please consult the regex source and the test cases for precise information on when regex or division is matched (should you need to know). In short, you could sum it up as: If the end of a statement looks like a regex literal (even if it isn’t), it will be treated as one. Otherwise it should work as expected (if you write sane code). ### ES2018 ### ES2018 added some nice regex improvements to the language. - [Unicode property escapes] should allow telling names and invalid non-ASCII characters apart without blowing up the regex size. - [Lookbehind assertions] should allow matching telling division and regex literals apart in more cases. - [Named capture groups] might simplify some things. These things would be nice to do, but are not critical. They probably have to wait until the oldest maintained Node.js LTS release supports those features. [Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html [Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html [Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html License ======= [MIT](LICENSE). # lodash.merge v4.6.2 The [Lodash](https://lodash.com/) method `_.merge` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.merge ``` In Node.js: ```js var merge = require('lodash.merge'); ``` See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/4.6.2-npm-packages/lodash.merge) for more details. # inflight Add callbacks to requests in flight to avoid async duplication ## USAGE ```javascript var inflight = require('inflight') // some request that does some stuff function req(key, callback) { // key is any random string. like a url or filename or whatever. // // will return either a falsey value, indicating that the // request for this key is already in flight, or a new callback // which when called will call all callbacks passed to inflightk // with the same key callback = inflight(key, callback) // If we got a falsey value back, then there's already a req going if (!callback) return // this is where you'd fetch the url or whatever // callback is also once()-ified, so it can safely be assigned // to multiple events etc. First call wins. setTimeout(function() { callback(null, key) }, 100) } // only assigns a single setTimeout // when it dings, all cbs get called req('foo', cb1) req('foo', cb2) req('foo', cb3) req('foo', cb4) ``` # cliui ![ci](https://github.com/yargs/cliui/workflows/ci/badge.svg) [![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) ![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/cliui) easily create complex multi-column command-line-interfaces. ## Example ```js const ui = require('cliui')() ui.div('Usage: $0 [command] [options]') ui.div({ text: 'Options:', padding: [2, 0, 1, 0] }) ui.div( { text: "-f, --file", width: 20, padding: [0, 4, 0, 4] }, { text: "the file to load." + chalk.green("(if this description is long it wraps).") , width: 20 }, { text: chalk.red("[required]"), align: 'right' } ) console.log(ui.toString()) ``` ## Deno/ESM Support As of `v7` `cliui` supports [Deno](https://github.com/denoland/deno) and [ESM](https://nodejs.org/api/esm.html#esm_ecmascript_modules): ```typescript import cliui from "https://deno.land/x/cliui/deno.ts"; const ui = cliui({}) ui.div('Usage: $0 [command] [options]') ui.div({ text: 'Options:', padding: [2, 0, 1, 0] }) ui.div({ text: "-f, --file", width: 20, padding: [0, 4, 0, 4] }) console.log(ui.toString()) ``` <img width="500" src="screenshot.png"> ## Layout DSL cliui exposes a simple layout DSL: If you create a single `ui.div`, passing a string rather than an object: * `\n`: characters will be interpreted as new rows. * `\t`: characters will be interpreted as new columns. * `\s`: characters will be interpreted as padding. **as an example...** ```js var ui = require('./')({ width: 60 }) ui.div( 'Usage: node ./bin/foo.js\n' + ' <regex>\t provide a regex\n' + ' <glob>\t provide a glob\t [required]' ) console.log(ui.toString()) ``` **will output:** ```shell Usage: node ./bin/foo.js <regex> provide a regex <glob> provide a glob [required] ``` ## Methods ```js cliui = require('cliui') ``` ### cliui({width: integer}) Specify the maximum width of the UI being generated. If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`. ### cliui({wrap: boolean}) Enable or disable the wrapping of text in a column. ### cliui.div(column, column, column) Create a row with any number of columns, a column can either be a string, or an object with the following options: * **text:** some text to place in the column. * **width:** the width of a column. * **align:** alignment, `right` or `center`. * **padding:** `[top, right, bottom, left]`. * **border:** should a border be placed around the div? ### cliui.span(column, column, column) Similar to `div`, except the next row will be appended without a new line being created. ### cliui.resetOutput() Resets the UI elements of the current cliui instance, maintaining the values set for `width` and `wrap`. # get-caller-file [![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master) This is a utility, which allows a function to figure out from which file it was invoked. It does so by inspecting v8's stack trace at the time it is invoked. Inspired by http://stackoverflow.com/questions/13227489 *note: this relies on Node/V8 specific APIs, as such other runtimes may not work* ## Installation ```bash yarn add get-caller-file ``` ## Usage Given: ```js // ./foo.js const getCallerFile = require('get-caller-file'); module.exports = function() { return getCallerFile(); // figures out who called it }; ``` ```js // index.js const foo = require('./foo'); foo() // => /full/path/to/this/file/index.js ``` ## Options: * `getCallerFile(position = 2)`: where position is stack frame whos fileName we want. # ESLint Scope ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). ## Usage Install: ``` npm i eslint-scope --save ``` Example: ```js var eslintScope = require('eslint-scope'); var espree = require('espree'); var estraverse = require('estraverse'); var ast = espree.parse(code); var scopeManager = eslintScope.analyze(ast); var currentScope = scopeManager.acquire(ast); // global scope estraverse.traverse(ast, { enter: function(node, parent) { // do stuff if (/Function/.test(node.type)) { currentScope = scopeManager.acquire(node); // get current function scope } }, leave: function(node, parent) { if (/Function/.test(node.type)) { currentScope = currentScope.upper; // set to parent scope } // do stuff } }); ``` ## Contributing Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues). ## Build Commands * `npm test` - run all linting and tests * `npm run lint` - run all linting ## License ESLint Scope is licensed under a permissive BSD 2-clause license. <p align="center"> <a href="https://gulpjs.com"> <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png"> </a> </p> # glob-parent [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] Extract the non-magic parent path from a glob string. ## Usage ```js var globParent = require('glob-parent'); globParent('path/to/*.js'); // 'path/to' globParent('/root/path/to/*.js'); // '/root/path/to' globParent('/*.js'); // '/' globParent('*.js'); // '.' globParent('**/*.js'); // '.' globParent('path/{to,from}'); // 'path' globParent('path/!(to|from)'); // 'path' globParent('path/?(to|from)'); // 'path' globParent('path/+(to|from)'); // 'path' globParent('path/*(to|from)'); // 'path' globParent('path/@(to|from)'); // 'path' globParent('path/**/*'); // 'path' // if provided a non-glob path, returns the nearest dir globParent('path/foo/bar.js'); // 'path/foo' globParent('path/foo/'); // 'path/foo' globParent('path/foo'); // 'path' (see issue #3 for details) ``` ## API ### `globParent(maybeGlobString, [options])` Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. #### options ```js { // Disables the automatic conversion of slashes for Windows flipBackslashes: true } ``` ## Escaping The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: - `?` (question mark) unless used as a path segment alone - `*` (asterisk) - `|` (pipe) - `(` (opening parenthesis) - `)` (closing parenthesis) - `{` (opening curly brace) - `}` (closing curly brace) - `[` (opening bracket) - `]` (closing bracket) **Example** ```js globParent('foo/[bar]/') // 'foo' globParent('foo/\\[bar]/') // 'foo/[bar]' ``` ## Limitations ### Braces & Brackets This library attempts a quick and imperfect method of determining which path parts have glob magic without fully parsing/lexing the pattern. There are some advanced use cases that can trip it up, such as nested braces where the outer pair is escaped and the inner one contains a path separator. If you find yourself in the unlikely circumstance of being affected by this or need to ensure higher-fidelity glob handling in your library, it is recommended that you pre-process your input with [expand-braces] and/or [expand-brackets]. ### Windows Backslashes are not valid path separators for globs. If a path with backslashes is provided anyway, for simple cases, glob-parent will replace the path separator for you and return the non-glob parent path (now with forward-slashes, which are still valid as Windows path separators). This cannot be used in conjunction with escape characters. ```js // BAD globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' // GOOD globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' ``` If you are using escape characters for a pattern without path parts (i.e. relative to `cwd`), prefix with `./` to avoid confusing glob-parent. ```js // BAD globParent('foo \\[bar]') // 'foo ' globParent('foo \\[bar]*') // 'foo ' // GOOD globParent('./foo \\[bar]') // 'foo [bar]' globParent('./foo \\[bar]*') // '.' ``` ## License ISC [expand-braces]: https://github.com/jonschlinkert/expand-braces [expand-brackets]: https://github.com/jonschlinkert/expand-brackets [downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg [npm-url]: https://www.npmjs.com/package/glob-parent [npm-image]: https://img.shields.io/npm/v/glob-parent.svg [azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master [azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master [travis-url]: https://travis-ci.org/gulpjs/glob-parent [travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci [appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent [appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor [coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent [coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg [gitter-url]: https://gitter.im/gulpjs/gulp [gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg [![Build Status](https://api.travis-ci.org/adaltas/node-csv-stringify.svg)](https://travis-ci.org/#!/adaltas/node-csv-stringify) [![NPM](https://img.shields.io/npm/dm/csv-stringify)](https://www.npmjs.com/package/csv-stringify) [![NPM](https://img.shields.io/npm/v/csv-stringify)](https://www.npmjs.com/package/csv-stringify) This package is a stringifier converting records into a CSV text and implementing the Node.js [`stream.Transform` API](https://nodejs.org/api/stream.html). It also provides the easier synchronous and callback-based APIs for conveniency. It is both extremely easy to use and powerful. It was first released in 2010 and is tested against big data sets by a large community. ## Documentation * [Project homepage](http://csv.js.org/stringify/) * [API](http://csv.js.org/stringify/api/) * [Options](http://csv.js.org/stringify/options/) * [Examples](http://csv.js.org/stringify/examples/) ## Main features * Follow the Node.js streaming API * Simplicity with the optional callback API * Support for custom formatters, delimiters, quotes, escape characters and header * Support big datasets * Complete test coverage and samples for inspiration * Only 1 external dependency * to be used conjointly with `csv-generate`, `csv-parse` and `stream-transform` * MIT License ## Usage The module is built on the Node.js Stream API. For the sake of simplicity, a simple callback API is also provided. To give you a quick look, here's an example of the callback API: ```javascript const stringify = require('csv-stringify') const assert = require('assert') // import stringify from 'csv-stringify' // import assert from 'assert/strict' const input = [ [ '1', '2', '3', '4' ], [ 'a', 'b', 'c', 'd' ] ] stringify(input, function(err, output) { const expected = '1,2,3,4\na,b,c,d\n' assert.strictEqual(output, expected, `output.should.eql ${expected}`) console.log("Passed.", output) }) ``` ## Development Tests are executed with mocha. To install it, run `npm install` followed by `npm test`. It will install mocha and its dependencies in your project "node_modules" directory and run the test suite. The tests run against the CoffeeScript source files. To generate the JavaScript files, run `npm run build`. The test suite is run online with [Travis](https://travis-ci.org/#!/adaltas/node-csv-stringify). See the [Travis definition file](https://github.com/adaltas/node-csv-stringify/blob/master/.travis.yml) to view the tested Node.js version. ## Contributors * David Worms: <https://github.com/wdavidw> [csv_home]: https://github.com/adaltas/node-csv [stream_transform]: http://nodejs.org/api/stream.html#stream_class_stream_transform [examples]: http://csv.js.org/stringify/examples/ [csv]: https://github.com/adaltas/node-csv # Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/codecov/c/github/bestiejs/punycode.js.svg)](https://codecov.io/gh/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: * [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) * [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) * [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) * [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) * [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). The current version supports recent versions of Node.js only. It provides a CommonJS module and an ES6 module. For the old version that offers the same functionality with broader support, including Rhino, Ringo, Narwhal, and web browsers, see [v1.4.1](https://github.com/bestiejs/punycode.js/releases/tag/v1.4.1). ## Installation Via [npm](https://www.npmjs.com/): ```bash npm install punycode --save ``` In [Node.js](https://nodejs.org/): ```js const punycode = require('punycode'); ``` ## API ### `punycode.decode(string)` Converts a Punycode string of ASCII symbols to a string of Unicode symbols. ```js // decode domain name parts punycode.decode('maana-pta'); // 'mañana' punycode.decode('--dqo34k'); // '☃-⌘' ``` ### `punycode.encode(string)` Converts a string of Unicode symbols to a Punycode string of ASCII symbols. ```js // encode domain name parts punycode.encode('mañana'); // 'maana-pta' punycode.encode('☃-⌘'); // '--dqo34k' ``` ### `punycode.toUnicode(input)` Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. ```js // decode domain names punycode.toUnicode('xn--maana-pta.com'); // → 'mañana.com' punycode.toUnicode('xn----dqo34k.com'); // → '☃-⌘.com' // decode email addresses punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); // → 'джумла@джpумлатест.bрфa' ``` ### `punycode.toASCII(input)` Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. ```js // encode domain names punycode.toASCII('mañana.com'); // → 'xn--maana-pta.com' punycode.toASCII('☃-⌘.com'); // → 'xn----dqo34k.com' // encode email addresses punycode.toASCII('джумла@джpумлатест.bрфa'); // → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' ``` ### `punycode.ucs2` #### `punycode.ucs2.decode(string)` Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. ```js punycode.ucs2.decode('abc'); // → [0x61, 0x62, 0x63] // surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: punycode.ucs2.decode('\uD834\uDF06'); // → [0x1D306] ``` #### `punycode.ucs2.encode(codePoints)` Creates a string based on an array of numeric code point values. ```js punycode.ucs2.encode([0x61, 0x62, 0x63]); // → 'abc' punycode.ucs2.encode([0x1D306]); // → '\uD834\uDF06' ``` ### `punycode.version` A string representing the current Punycode.js version number. ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License Punycode.js is available under the [MIT](https://mths.be/mit) license. # path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) > Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). ## Install ``` $ npm install --save path-parse ``` ## Usage ```js var pathParse = require('path-parse'); pathParse('/home/user/dir/file.txt'); //=> { // root : "/", // dir : "/home/user/dir", // base : "file.txt", // ext : ".txt", // name : "file" // } ``` ## API See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. ### pathParse(path) ### pathParse.posix(path) The Posix specific version. ### pathParse.win32(path) The Windows specific version. ## License MIT © [Javier Blanco](http://jbgutierrez.info) # debug [![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) <img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers. ## Installation ```bash $ npm install debug ``` ## Usage `debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. Example [_app.js_](./examples/node/app.js): ```js var debug = require('debug')('http') , http = require('http') , name = 'My App'; // fake app debug('booting %o', name); http.createServer(function(req, res){ debug(req.method + ' ' + req.url); res.end('hello\n'); }).listen(3000, function(){ debug('listening'); }); // fake worker of some kind require('./worker'); ``` Example [_worker.js_](./examples/node/worker.js): ```js var a = require('debug')('worker:a') , b = require('debug')('worker:b'); function work() { a('doing lots of uninteresting work'); setTimeout(work, Math.random() * 1000); } work(); function workb() { b('doing some work'); setTimeout(workb, Math.random() * 2000); } workb(); ``` The `DEBUG` environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: <img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png"> <img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png"> <img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png"> #### Windows note On Windows the environment variable is set using the `set` command. ```cmd set DEBUG=*,-not_this ``` Note that PowerShell uses different syntax to set environment variables. ```cmd $env:DEBUG = "*,-not_this" ``` Then, run the program to be debugged as usual. ## Namespace Colors Every debug instance has a color generated for it based on its namespace name. This helps when visually parsing the debug output to identify which debug instance a debug line belongs to. #### Node.js In Node.js, colors are enabled when stderr is a TTY. You also _should_ install the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, otherwise debug will only use a small handful of basic colors. <img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png"> #### Web Browser Colors are also enabled on "Web Inspectors" that understand the `%c` formatting option. These are WebKit web inspectors, Firefox ([since version 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) and the Firebug plugin for Firefox (any version). <img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png"> ## Millisecond diff When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. <img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: <img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png"> ## Conventions If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. ## Wildcards The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". ## Environment Variables When running through Node.js, you can set a few environment variables that will change the behavior of the debug logging: | Name | Purpose | |-----------|-------------------------------------------------| | `DEBUG` | Enables/disables specific debugging namespaces. | | `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | | `DEBUG_COLORS`| Whether or not to use colors in the debug output. | | `DEBUG_DEPTH` | Object inspection depth. | | `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | __Note:__ The environment variables beginning with `DEBUG_` end up being converted into an Options object that gets used with `%o`/`%O` formatters. See the Node.js documentation for [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) for the complete list. ## Formatters Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: | Formatter | Representation | |-----------|----------------| | `%O` | Pretty-print an Object on multiple lines. | | `%o` | Pretty-print an Object all on a single line. | | `%s` | String. | | `%d` | Number (both integer and float). | | `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | | `%%` | Single percent sign ('%'). This does not consume an argument. | ### Custom formatters You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: ```js const createDebug = require('debug') createDebug.formatters.h = (v) => { return v.toString('hex') } // …elsewhere const debug = createDebug('foo') debug('this is hex: %h', new Buffer('hello world')) // foo this is hex: 68656c6c6f20776f726c6421 +0ms ``` ## Browser Support You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), if you don't want to build it yourself. Debug's enable state is currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. You can enable this using `localStorage.debug`: ```js localStorage.debug = 'worker:*' ``` And then refresh the page. ```js a = debug('worker:a'); b = debug('worker:b'); setInterval(function(){ a('doing some work'); }, 1000); setInterval(function(){ b('doing some work'); }, 1200); ``` ## Output streams By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: Example [_stdout.js_](./examples/node/stdout.js): ```js var debug = require('debug'); var error = debug('app:error'); // by default stderr is used error('goes to stderr!'); var log = debug('app:log'); // set this namespace to log via console.log log.log = console.log.bind(console); // don't forget to bind to console! log('goes to stdout'); error('still goes to stderr!'); // set all output to go via console.info // overrides all per-namespace log settings debug.log = console.info.bind(console); error('now goes to stdout via console.info'); log('still goes to stdout, but via console.info now'); ``` ## Checking whether a debug target is enabled After you've created a debug instance, you can determine whether or not it is enabled by checking the `enabled` property: ```javascript const debug = require('debug')('http'); if (debug.enabled) { // do stuff... } ``` You can also manually toggle this property to force the debug instance to be enabled or disabled. ## Authors - TJ Holowaychuk - Nathan Rajlich - Andrew Rhyne ## Backers Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] <a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a> ## Sponsors Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] <a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a> ## License (The MIT License) Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # `asbuild` [![Stars](https://img.shields.io/github/stars/AssemblyScript/asbuild.svg?style=social&maxAge=3600&label=Star)](https://github.com/AssemblyScript/asbuild/stargazers) *A simple build tool for [AssemblyScript](https://assemblyscript.org) projects, similar to `cargo`, etc.* ## 🚩 Table of Contents - [Installing](#-installing) - [Usage](#-usage) - [`asb init`](#asb-init---create-an-empty-project) - [`asb test`](#asb-test---run-as-pect-tests) - [`asb fmt`](#asb-fmt---format-as-files-using-eslint) - [`asb run`](#asb-run---run-a-wasi-binary) - [`asb build`](#asb-build---compile-the-project-using-asc) - [Background](#-background) ## 🔧 Installing Install it globally ``` npm install -g asbuild ``` Or, locally as dev dependencies ``` npm install --save-dev asbuild ``` ## 💡 Usage ``` Build tool for AssemblyScript projects. Usage: asb [command] [options] Commands: asb Alias of build command, to maintain back-ward compatibility [default] asb build Compile a local package and all of its dependencies [aliases: compile, make] asb init [baseDir] Create a new AS package in an given directory asb test Run as-pect tests asb fmt [paths..] This utility formats current module using eslint. [aliases: format, lint] Options: --version Show version number [boolean] --help Show help [boolean] ``` ### `asb init` - Create an empty project ``` asb init [baseDir] Create a new AS package in an given directory Positionals: baseDir Create a sample AS project in this directory [string] [default: "."] Options: --version Show version number [boolean] --help Show help [boolean] --yes Skip the interactive prompt [boolean] [default: false] ``` ### `asb test` - Run as-pect tests ``` asb test Run as-pect tests USAGE: asb test [options] -- [aspect_options] Options: --version Show version number [boolean] --help Show help [boolean] --verbose, --vv Print out arguments passed to as-pect [boolean] [default: false] ``` ### `asb fmt` - Format AS files using ESlint ``` asb fmt [paths..] This utility formats current module using eslint. Positionals: paths Paths to format [array] [default: ["."]] Initialisation: --init Generates recommended eslint config for AS Projects [boolean] Miscellaneous --lint, --dry-run Tries to fix problems without saving the changes to the file system [boolean] [default: false] Options: --version Show version number [boolean] --help Show help ``` ### `asb run` - Run a WASI binary ``` asb run Run a WASI binary USAGE: asb run [options] [binary path] -- [binary options] Positionals: binary path to Wasm binary [string] [required] Options: --version Show version number [boolean] --help Show help [boolean] --preopen, -p comma separated list of directories to open. [default: "."] ``` ### `asb build` - Compile the project using asc ``` asb build Compile a local package and all of its dependencies USAGE: asb build [entry_file] [options] -- [asc_options] Options: --version Show version number [boolean] --help Show help [boolean] --baseDir, -d Base directory of project. [string] [default: "."] --config, -c Path to asconfig file [string] [default: "./asconfig.json"] --wat Output wat file to outDir [boolean] [default: false] --outDir Directory to place built binaries. Default "./build/<target>/" [string] --target Target for compilation [string] [default: "release"] --verbose Print out arguments passed to asc [boolean] [default: false] Examples: asb build Build release of 'assembly/index.ts to build/release/packageName.wasm asb build --target release Build a release binary asb build -- --measure Pass argument to 'asc' ``` #### Defaults ##### Project structure ``` project/ package.json asconfig.json assembly/ index.ts build/ release/ project.wasm debug/ project.wasm ``` - If no entry file passed and no `entry` field is in `asconfig.json`, `project/assembly/index.ts` is assumed. - `asconfig.json` allows for options for different compile targets, e.g. release, debug, etc. `asc` defaults to the release target. - The default build directory is `./build`, and artifacts are placed at `./build/<target>/packageName.wasm`. ##### Workspaces If a `workspace` field is added to a top level `asconfig.json` file, then each path in the array is built and placed into the top level `outDir`. For example, `asconfig.json`: ```json { "workspaces": ["a", "b"] } ``` Running `asb` in the directory below will use the top level build directory to place all the binaries. ``` project/ package.json asconfig.json a/ asconfig.json assembly/ index.ts b/ asconfig.json assembly/ index.ts build/ release/ a.wasm b.wasm debug/ a.wasm b.wasm ``` To see an example in action check out the [test workspace](./tests/build_test) ## 📖 Background Asbuild started as wrapper around `asc` to provide an easier CLI interface and now has been extened to support other commands like `init`, `test` and `fmt` just like `cargo` to become a one stop build tool for AS Projects. ## 📜 License This library is provided under the open-source [MIT license](https://choosealicense.com/licenses/mit/). # wrappy Callback wrapping utility ## USAGE ```javascript var wrappy = require("wrappy") // var wrapper = wrappy(wrapperFunction) // make sure a cb is called only once // See also: http://npm.im/once for this specific use case var once = wrappy(function (cb) { var called = false return function () { if (called) return called = true return cb.apply(this, arguments) } }) function printBoo () { console.log('boo') } // has some rando property printBoo.iAmBooPrinter = true var onlyPrintOnce = once(printBoo) onlyPrintOnce() // prints 'boo' onlyPrintOnce() // does nothing // random property is retained! assert.equal(onlyPrintOnce.iAmBooPrinter, true) ``` semver(1) -- The semantic versioner for npm =========================================== ## Install ```bash npm install semver ```` ## Usage As a node module: ```js const semver = require('semver') semver.valid('1.2.3') // '1.2.3' semver.valid('a.b.c') // null semver.clean(' =v1.2.3 ') // '1.2.3' semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true semver.gt('1.2.3', '9.8.7') // false semver.lt('1.2.3', '9.8.7') // true semver.minVersion('>=1.0.0') // '1.0.0' semver.valid(semver.coerce('v2')) // '2.0.0' semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' ``` You can also just load the module for the function that you care about, if you'd like to minimize your footprint. ```js // load the whole API at once in a single object const semver = require('semver') // or just load the bits you need // all of them listed here, just pick and choose what you want // classes const SemVer = require('semver/classes/semver') const Comparator = require('semver/classes/comparator') const Range = require('semver/classes/range') // functions for working with versions const semverParse = require('semver/functions/parse') const semverValid = require('semver/functions/valid') const semverClean = require('semver/functions/clean') const semverInc = require('semver/functions/inc') const semverDiff = require('semver/functions/diff') const semverMajor = require('semver/functions/major') const semverMinor = require('semver/functions/minor') const semverPatch = require('semver/functions/patch') const semverPrerelease = require('semver/functions/prerelease') const semverCompare = require('semver/functions/compare') const semverRcompare = require('semver/functions/rcompare') const semverCompareLoose = require('semver/functions/compare-loose') const semverCompareBuild = require('semver/functions/compare-build') const semverSort = require('semver/functions/sort') const semverRsort = require('semver/functions/rsort') // low-level comparators between versions const semverGt = require('semver/functions/gt') const semverLt = require('semver/functions/lt') const semverEq = require('semver/functions/eq') const semverNeq = require('semver/functions/neq') const semverGte = require('semver/functions/gte') const semverLte = require('semver/functions/lte') const semverCmp = require('semver/functions/cmp') const semverCoerce = require('semver/functions/coerce') // working with ranges const semverSatisfies = require('semver/functions/satisfies') const semverMaxSatisfying = require('semver/ranges/max-satisfying') const semverMinSatisfying = require('semver/ranges/min-satisfying') const semverToComparators = require('semver/ranges/to-comparators') const semverMinVersion = require('semver/ranges/min-version') const semverValidRange = require('semver/ranges/valid') const semverOutside = require('semver/ranges/outside') const semverGtr = require('semver/ranges/gtr') const semverLtr = require('semver/ranges/ltr') const semverIntersects = require('semver/ranges/intersects') const simplifyRange = require('semver/ranges/simplify') const rangeSubset = require('semver/ranges/subset') ``` As a command-line utility: ``` $ semver -h A JavaScript implementation of the https://semver.org/ specification Copyright Isaac Z. Schlueter Usage: semver [options] <version> [<version> [...]] Prints valid versions sorted by SemVer precedence Options: -r --range <range> Print versions that match the specified range. -i --increment [<level>] Increment a version by the specified level. Level can be one of: major, minor, patch, premajor, preminor, prepatch, or prerelease. Default level is 'patch'. Only one version may be specified. --preid <identifier> Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -l --loose Interpret versions and ranges loosely -p --include-prerelease Always include prerelease versions in range matching -c --coerce Coerce a string into SemVer if possible (does not imply --loose) --rtl Coerce version strings right to left --ltr Coerce version strings left to right (default) Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. ``` ## Versions A "version" is described by the `v2.0.0` specification found at <https://semver.org/>. A leading `"="` or `"v"` character is stripped off and ignored. ## Ranges A `version range` is a set of `comparators` which specify versions that satisfy the range. A `comparator` is composed of an `operator` and a `version`. The set of primitive `operators` is: * `<` Less than * `<=` Less than or equal to * `>` Greater than * `>=` Greater than or equal to * `=` Equal. If no operator is specified, then equality is assumed, so this operator is optional, but MAY be included. For example, the comparator `>=1.2.7` would match the versions `1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` or `1.1.0`. Comparators can be joined by whitespace to form a `comparator set`, which is satisfied by the **intersection** of all of the comparators it includes. A range is composed of one or more comparator sets, joined by `||`. A version matches a range if and only if every comparator in at least one of the `||`-separated comparator sets is satisfied by the version. For example, the range `>=1.2.7 <1.3.0` would match the versions `1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, or `1.1.0`. The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, `1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. ### Prerelease Tags If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then it will only be allowed to satisfy comparator sets if at least one comparator with the same `[major, minor, patch]` tuple also has a prerelease tag. For example, the range `>1.2.3-alpha.3` would be allowed to match the version `1.2.3-alpha.7`, but it would *not* be satisfied by `3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater than" `1.2.3-alpha.3` according to the SemVer sort rules. The version range only accepts prerelease tags on the `1.2.3` version. The version `3.4.5` *would* satisfy the range, because it does not have a prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. The purpose for this behavior is twofold. First, prerelease versions frequently are updated very quickly, and contain many breaking changes that are (by the author's design) not yet fit for public consumption. Therefore, by default, they are excluded from range matching semantics. Second, a user who has opted into using a prerelease version has clearly indicated the intent to use *that specific* set of alpha/beta/rc versions. By including a prerelease tag in the range, the user is indicating that they are aware of the risk. However, it is still not appropriate to assume that they have opted into taking a similar risk on the *next* set of prerelease versions. Note that this behavior can be suppressed (treating all prerelease versions as if they were normal versions, for the purpose of range matching) by setting the `includePrerelease` flag on the options object to any [functions](https://github.com/npm/node-semver#functions) that do range matching. #### Prerelease Identifiers The method `.inc` takes an additional `identifier` string argument that will append the value of the string as a prerelease identifier: ```javascript semver.inc('1.2.3', 'prerelease', 'beta') // '1.2.4-beta.0' ``` command-line example: ```bash $ semver 1.2.3 -i prerelease --preid beta 1.2.4-beta.0 ``` Which then can be used to increment further: ```bash $ semver 1.2.4-beta.0 -i prerelease 1.2.4-beta.1 ``` ### Advanced Range Syntax Advanced range syntax desugars to primitive comparators in deterministic ways. Advanced ranges may be combined in the same way as primitive comparators using white space or `||`. #### Hyphen Ranges `X.Y.Z - A.B.C` Specifies an inclusive set. * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` If a partial version is provided as the first version in the inclusive range, then the missing pieces are replaced with zeroes. * `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` If a partial version is provided as the second version in the inclusive range, then all versions that start with the supplied parts of the tuple are accepted, but nothing that would be greater than the provided tuple parts. * `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` * `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` #### X-Ranges `1.2.x` `1.X` `1.2.*` `*` Any of `X`, `x`, or `*` may be used to "stand in" for one of the numeric values in the `[major, minor, patch]` tuple. * `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless `includePrerelease` is specified, in which case any version at all satisfies) * `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) * `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) A partial version range is treated as an X-Range, so the special character is in fact optional. * `""` (empty string) := `*` := `>=0.0.0` * `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` * `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` #### Tilde Ranges `~1.2.3` `~1.2` `~1` Allows patch-level changes if a minor version is specified on the comparator. Allows minor-level changes if not. * `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` * `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) * `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) * `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` * `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) * `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) * `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in the `1.2.3` version will be allowed, if they are greater than or equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but `1.2.4-beta.2` would not, because it is a prerelease of a different `[major, minor, patch]` tuple. #### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` Allows changes that do not modify the left-most non-zero element in the `[major, minor, patch]` tuple. In other words, this allows patch and minor updates for versions `1.0.0` and above, patch updates for versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. Many authors treat a `0.x` version as if the `x` were the major "breaking-change" indicator. Caret ranges are ideal when an author may make breaking changes between `0.2.4` and `0.3.0` releases, which is a common practice. However, it presumes that there will *not* be breaking changes between `0.2.4` and `0.2.5`. It allows for changes that are presumed to be additive (but non-breaking), according to commonly observed practices. * `^1.2.3` := `>=1.2.3 <2.0.0-0` * `^0.2.3` := `>=0.2.3 <0.3.0-0` * `^0.0.3` := `>=0.0.3 <0.0.4-0` * `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in the `1.2.3` version will be allowed, if they are greater than or equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but `1.2.4-beta.2` would not, because it is a prerelease of a different `[major, minor, patch]` tuple. * `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the `0.0.3` version *only* will be allowed, if they are greater than or equal to `beta`. So, `0.0.3-pr.2` would be allowed. When parsing caret ranges, a missing `patch` value desugars to the number `0`, but will allow flexibility within that value, even if the major and minor versions are both `0`. * `^1.2.x` := `>=1.2.0 <2.0.0-0` * `^0.0.x` := `>=0.0.0 <0.1.0-0` * `^0.0` := `>=0.0.0 <0.1.0-0` A missing `minor` and `patch` values will desugar to zero, but also allow flexibility within those values, even if the major version is zero. * `^1.x` := `>=1.0.0 <2.0.0-0` * `^0.x` := `>=0.0.0 <1.0.0-0` ### Range Grammar Putting all this together, here is a Backus-Naur grammar for ranges, for the benefit of parser authors: ```bnf range-set ::= range ( logical-or range ) * logical-or ::= ( ' ' ) * '||' ( ' ' ) * range ::= hyphen | simple ( ' ' simple ) * | '' hyphen ::= partial ' - ' partial simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? pre ::= parts build ::= parts parts ::= part ( '.' part ) * part ::= nr | [-0-9A-Za-z]+ ``` ## Functions All methods and classes take a final `options` object argument. All options in this object are `false` by default. The options supported are: - `loose` Be more forgiving about not-quite-valid semver strings. (Any resulting output will always be 100% strict compliant, of course.) For backwards compatibility reasons, if the `options` argument is a boolean value instead of an object, it is interpreted to be the `loose` param. - `includePrerelease` Set to suppress the [default behavior](https://github.com/npm/node-semver#prerelease-tags) of excluding prerelease tagged versions from ranges unless they are explicitly opted into. Strict-mode Comparators and Ranges will be strict about the SemVer strings that they parse. * `valid(v)`: Return the parsed version, or null if it's not valid. * `inc(v, release)`: Return the version incremented by the release type (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), or null if it's not valid * `premajor` in one call will bump the version up to the next major version and down to a prerelease of that major version. `preminor`, and `prepatch` work the same way. * If called from a non-prerelease version, the `prerelease` will work the same as `prepatch`. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it. * `prerelease(v)`: Returns an array of prerelease components, or null if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` * `major(v)`: Return the major version number. * `minor(v)`: Return the minor version number. * `patch(v)`: Return the patch version number. * `intersects(r1, r2, loose)`: Return true if the two supplied ranges or comparators intersect. * `parse(v)`: Attempt to parse a string as a semantic version, returning either a `SemVer` object or `null`. ### Comparison * `gt(v1, v2)`: `v1 > v2` * `gte(v1, v2)`: `v1 >= v2` * `lt(v1, v2)`: `v1 < v2` * `lte(v1, v2)`: `v1 <= v2` * `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. * `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. * `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call the corresponding function above. `"==="` and `"!=="` do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided. * `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. * `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions in descending order when passed to `Array.sort()`. * `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions are equal. Sorts in ascending order if passed to `Array.sort()`. `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. * `diff(v1, v2)`: Returns difference between two versions by the release type (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), or null if the versions are the same. ### Comparators * `intersects(comparator)`: Return true if the comparators intersect ### Ranges * `validRange(range)`: Return the valid range or null if it's not valid * `satisfies(version, range)`: Return true if the version satisfies the range. * `maxSatisfying(versions, range)`: Return the highest version in the list that satisfies the range, or `null` if none of them do. * `minSatisfying(versions, range)`: Return the lowest version in the list that satisfies the range, or `null` if none of them do. * `minVersion(range)`: Return the lowest version that can possibly match the given range. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the versions possible in the range. * `outside(version, range, hilo)`: Return true if the version is outside the bounds of the range in either the high or low direction. The `hilo` argument must be either the string `'>'` or `'<'`. (This is the function called by `gtr` and `ltr`.) * `intersects(range)`: Return true if any of the ranges comparators intersect * `simplifyRange(versions, range)`: Return a "simplified" range that matches the same items in `versions` list as the range specified. Note that it does *not* guarantee that it would match the same versions in all cases, only for the set of versions provided. This is useful when generating ranges by joining together multiple versions with `||` programmatically, to provide the user with something a bit more ergonomic. If the provided range is shorter in string-length than the generated range, then that is returned. * `subset(subRange, superRange)`: Return `true` if the `subRange` range is entirely contained by the `superRange` range. Note that, since ranges may be non-contiguous, a version might not be greater than a range, less than a range, *or* satisfy a range! For example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` until `2.0.0`, so the version `1.2.10` would not be greater than the range (because `2.0.1` satisfies, which is higher), nor less than the range (since `1.2.8` satisfies, which is lower), and it also does not satisfy the range. If you want to know if a version satisfies or does not satisfy a range, use the `satisfies(version, range)` function. ### Coercion * `coerce(version, options)`: Coerces a string to semver if possible This aims to provide a very forgiving translation of a non-semver string to semver. It looks for the first digit in a string, and consumes all remaining characters which satisfy at least a partial semver (e.g., `1`, `1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes `3.4.0`). Only text which lacks digits will fail coercion (`version one` is not valid). The maximum length for any semver component considered for coercion is 16 characters; longer components will be ignored (`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value components are invalid (`9999999999999999.4.7.4` is likely invalid). If the `options.rtl` flag is set, then `coerce` will return the right-most coercible tuple that does not share an ending index with a longer coercible tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not `4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of any other overlapping SemVer tuple. ### Clean * `clean(version)`: Clean a string to be a valid semver if possible This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. ex. * `s.clean(' = v 2.1.5foo')`: `null` * `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` * `s.clean(' = v 2.1.5-foo')`: `null` * `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` * `s.clean('=v2.1.5')`: `'2.1.5'` * `s.clean(' =v2.1.5')`: `2.1.5` * `s.clean(' 2.1.5 ')`: `'2.1.5'` * `s.clean('~1.0.0')`: `null` ## Exported Modules <!-- TODO: Make sure that all of these items are documented (classes aren't, eg), and then pull the module name into the documentation for that specific thing. --> You may pull in just the part of this semver utility that you need, if you are sensitive to packing and tree-shaking concerns. The main `require('semver')` export uses getter functions to lazily load the parts of the API that are used. The following modules are available: * `require('semver')` * `require('semver/classes')` * `require('semver/classes/comparator')` * `require('semver/classes/range')` * `require('semver/classes/semver')` * `require('semver/functions/clean')` * `require('semver/functions/cmp')` * `require('semver/functions/coerce')` * `require('semver/functions/compare')` * `require('semver/functions/compare-build')` * `require('semver/functions/compare-loose')` * `require('semver/functions/diff')` * `require('semver/functions/eq')` * `require('semver/functions/gt')` * `require('semver/functions/gte')` * `require('semver/functions/inc')` * `require('semver/functions/lt')` * `require('semver/functions/lte')` * `require('semver/functions/major')` * `require('semver/functions/minor')` * `require('semver/functions/neq')` * `require('semver/functions/parse')` * `require('semver/functions/patch')` * `require('semver/functions/prerelease')` * `require('semver/functions/rcompare')` * `require('semver/functions/rsort')` * `require('semver/functions/satisfies')` * `require('semver/functions/sort')` * `require('semver/functions/valid')` * `require('semver/ranges/gtr')` * `require('semver/ranges/intersects')` * `require('semver/ranges/ltr')` * `require('semver/ranges/max-satisfying')` * `require('semver/ranges/min-satisfying')` * `require('semver/ranges/min-version')` * `require('semver/ranges/outside')` * `require('semver/ranges/to-comparators')` * `require('semver/ranges/valid')` blockvote Smart Contract ================== A [smart contract] written in [AssemblyScript] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install [Node.js] ≥ 12 Exploring The Code ================== 1. The main smart contract code lives in `assembly/index.ts`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard AssemblyScript tests using [as-pect]. [smart contract]: https://docs.near.org/docs/develop/contracts/overview [AssemblyScript]: https://www.assemblyscript.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [as-pect]: https://www.npmjs.com/package/@as-pect/cli # eslint-visitor-keys [![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) [![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) [![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) [![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) Constants and utilities about visitor keys to traverse AST. ## 💿 Installation Use [npm] to install. ```bash $ npm install eslint-visitor-keys ``` ### Requirements - [Node.js] 10.0.0 or later. ## 📖 Usage ```js const evk = require("eslint-visitor-keys") ``` ### evk.KEYS > type: `{ [type: string]: string[] | undefined }` Visitor keys. This keys are frozen. This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. For example: ``` console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] ``` ### evk.getKeys(node) > type: `(node: object) => string[]` Get the visitor keys of a given AST node. This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. This will be used to traverse unknown nodes. For example: ``` const node = { type: "AssignmentExpression", left: { type: "Identifier", name: "foo" }, right: { type: "Literal", value: 0 } } console.log(evk.getKeys(node)) // → ["type", "left", "right"] ``` ### evk.unionWith(additionalKeys) > type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` Make the union set with `evk.KEYS` and the given keys. - The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. - It removes duplicated keys as keeping the first one. For example: ``` console.log(evk.unionWith({ MethodDefinition: ["decorators"] })) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } ``` ## 📰 Change log See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). ## 🍻 Contributing Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). ### Development commands - `npm test` runs tests and measures code coverage. - `npm run lint` checks source codes with ESLint. - `npm run coverage` opens the code coverage report of the previous test with your default browser. - `npm run release` publishes this package to [npm] registory. [npm]: https://www.npmjs.com/ [Node.js]: https://nodejs.org/en/ [ESTree]: https://github.com/estree/estree ## Test Strategy - tests are copied from the [polyfill implementation](https://github.com/tc39/proposal-temporal/tree/main/polyfill/test) - tests should be removed if they relate to features that do not make sense for TS/AS, i.e. tests that validate the shape of an object do not make sense in a language with compile-time type checking - tests that fail because a feature has not been implemented yet should be left as failures. # which-module > Find the module object for something that was require()d [![Build Status](https://travis-ci.org/nexdrew/which-module.svg?branch=master)](https://travis-ci.org/nexdrew/which-module) [![Coverage Status](https://coveralls.io/repos/github/nexdrew/which-module/badge.svg?branch=master)](https://coveralls.io/github/nexdrew/which-module?branch=master) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) Find the `module` object in `require.cache` for something that was `require()`d or `import`ed - essentially a reverse `require()` lookup. Useful for libs that want to e.g. lookup a filename for a module or submodule that it did not `require()` itself. ## Install and Usage ``` npm install --save which-module ``` ```js const whichModule = require('which-module') console.log(whichModule(require('something'))) // Module { // id: '/path/to/project/node_modules/something/index.js', // exports: [Function], // parent: ..., // filename: '/path/to/project/node_modules/something/index.js', // loaded: true, // children: [], // paths: [ '/path/to/project/node_modules/something/node_modules', // '/path/to/project/node_modules', // '/path/to/node_modules', // '/path/node_modules', // '/node_modules' ] } ``` ## API ### `whichModule(exported)` Return the [`module` object](https://nodejs.org/api/modules.html#modules_the_module_object), if any, that represents the given argument in the `require.cache`. `exported` can be anything that was previously `require()`d or `import`ed as a module, submodule, or dependency - which means `exported` is identical to the `module.exports` returned by this method. If `exported` did not come from the `exports` of a `module` in `require.cache`, then this method returns `null`. ## License ISC © Contributors ## Follow Redirects Drop-in replacement for Nodes `http` and `https` that automatically follows redirects. [![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) [![Build Status](https://travis-ci.org/follow-redirects/follow-redirects.svg?branch=master)](https://travis-ci.org/follow-redirects/follow-redirects) [![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master) [![Dependency Status](https://david-dm.org/follow-redirects/follow-redirects.svg)](https://david-dm.org/follow-redirects/follow-redirects) [![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) `follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback) modules, with the exception that they will seamlessly follow redirects. ```javascript var http = require('follow-redirects').http; var https = require('follow-redirects').https; http.get('http://bit.ly/900913', function (response) { response.on('data', function (chunk) { console.log(chunk); }); }).on('error', function (err) { console.error(err); }); ``` You can inspect the final redirected URL through the `responseUrl` property on the `response`. If no redirection happened, `responseUrl` is the original request URL. ```javascript https.request({ host: 'bitly.com', path: '/UHfDGO', }, function (response) { console.log(response.responseUrl); // 'http://duckduckgo.com/robots.txt' }); ``` ## Options ### Global options Global options are set directly on the `follow-redirects` module: ```javascript var followRedirects = require('follow-redirects'); followRedirects.maxRedirects = 10; followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB ``` The following global options are supported: - `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. - `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. ### Per-request options Per-request options are set by passing an `options` object: ```javascript var url = require('url'); var followRedirects = require('follow-redirects'); var options = url.parse('http://bit.ly/900913'); options.maxRedirects = 10; http.request(options); ``` In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback), the following per-request options are supported: - `followRedirects` (default: `true`) – whether redirects should be followed. - `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. - `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. - `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }` - `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object. ### Advanced usage By default, `follow-redirects` will use the Node.js default implementations of [`http`](https://nodejs.org/api/http.html) and [`https`](https://nodejs.org/api/https.html). To enable features such as caching and/or intermediate request tracking, you might instead want to wrap `follow-redirects` around custom protocol implementations: ```javascript var followRedirects = require('follow-redirects').wrap({ http: require('your-custom-http'), https: require('your-custom-https'), }); ``` Such custom protocols only need an implementation of the `request` method. ## Browserify Usage Due to the way `XMLHttpRequest` works, the `browserify` versions of `http` and `https` already follow redirects. If you are *only* targeting the browser, then this library has little value for you. If you want to write cross platform code for node and the browser, `follow-redirects` provides a great solution for making the native node modules behave the same as they do in browserified builds in the browser. To avoid bundling unnecessary code you should tell browserify to swap out `follow-redirects` with the standard modules when bundling. To make this easier, you need to change how you require the modules: ```javascript var http = require('follow-redirects/http'); var https = require('follow-redirects/https'); ``` You can then replace `follow-redirects` in your browserify configuration like so: ```javascript "browser": { "follow-redirects/http" : "http", "follow-redirects/https" : "https" } ``` The `browserify-http` module has not kept pace with node development, and no long behaves identically to the native module when running in the browser. If you are experiencing problems, you may want to check out [browserify-http-2](https://www.npmjs.com/package/http-browserify-2). It is more actively maintained and attempts to address a few of the shortcomings of `browserify-http`. In that case, your browserify config should look something like this: ```javascript "browser": { "follow-redirects/http" : "browserify-http-2/http", "follow-redirects/https" : "browserify-http-2/https" } ``` ## Contributing Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues) detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied by tests. You can run the test suite locally with a simple `npm test` command. ## Debug Logging `follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well. ## Authors - Olivier Lalonde (olalonde@gmail.com) - James Talmage (james@talmage.io) - [Ruben Verborgh](https://ruben.verborgh.org/) ## License [https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE](MIT License) # isarray `Array#isArray` for older browsers. [![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) [![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) [![browser support](https://ci.testling.com/juliangruber/isarray.png) ](https://ci.testling.com/juliangruber/isarray) ## Usage ```js var isArray = require('isarray'); console.log(isArray([])); // => true console.log(isArray({})); // => false ``` ## Installation With [npm](http://npmjs.org) do ```bash $ npm install isarray ``` Then bundle for the browser with [browserify](https://github.com/substack/browserify). With [component](http://component.io) do ```bash $ component install juliangruber/isarray ``` ## License (MIT) Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] [![Downloads][downloads-image]][downloads-url] [![Join the chat at https://gitter.im/eslint/doctrine](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/doctrine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) # Doctrine Doctrine is a [JSDoc](http://usejsdoc.org) parser that parses documentation comments from JavaScript (you need to pass in the comment, not a whole JavaScript file). ## Installation You can install Doctrine using [npm](https://npmjs.com): ``` $ npm install doctrine --save-dev ``` Doctrine can also be used in web browsers using [Browserify](http://browserify.org). ## Usage Require doctrine inside of your JavaScript: ```js var doctrine = require("doctrine"); ``` ### parse() The primary method is `parse()`, which accepts two arguments: the JSDoc comment to parse and an optional options object. The available options are: * `unwrap` - set to `true` to delete the leading `/**`, any `*` that begins a line, and the trailing `*/` from the source text. Default: `false`. * `tags` - an array of tags to return. When specified, Doctrine returns only tags in this array. For example, if `tags` is `["param"]`, then only `@param` tags will be returned. Default: `null`. * `recoverable` - set to `true` to keep parsing even when syntax errors occur. Default: `false`. * `sloppy` - set to `true` to allow optional parameters to be specified in brackets (`@param {string} [foo]`). Default: `false`. * `lineNumbers` - set to `true` to add `lineNumber` to each node, specifying the line on which the node is found in the source. Default: `false`. * `range` - set to `true` to add `range` to each node, specifying the start and end index of the node in the original comment. Default: `false`. Here's a simple example: ```js var ast = doctrine.parse( [ "/**", " * This function comment is parsed by doctrine", " * @param {{ok:String}} userName", "*/" ].join('\n'), { unwrap: true }); ``` This example returns the following AST: { "description": "This function comment is parsed by doctrine", "tags": [ { "title": "param", "description": null, "type": { "type": "RecordType", "fields": [ { "type": "FieldType", "key": "ok", "value": { "type": "NameExpression", "name": "String" } } ] }, "name": "userName" } ] } See the [demo page](http://eslint.org/doctrine/demo/) more detail. ## Team These folks keep the project moving and are resources for help: * Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead * Yusuke Suzuki ([@constellation](https://github.com/constellation)) - reviewer ## Contributing Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/doctrine/issues). ## Frequently Asked Questions ### Can I pass a whole JavaScript file to Doctrine? No. Doctrine can only parse JSDoc comments, so you'll need to pass just the JSDoc comment to Doctrine in order to work. ### License #### doctrine Copyright JS Foundation and other contributors, https://js.foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #### esprima some of functions is derived from esprima Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) (twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)) and other contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #### closure-compiler some of extensions is derived from closure-compiler Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ ### Where to ask for help? Join our [Chatroom](https://gitter.im/eslint/doctrine) [npm-image]: https://img.shields.io/npm/v/doctrine.svg?style=flat-square [npm-url]: https://www.npmjs.com/package/doctrine [travis-image]: https://img.shields.io/travis/eslint/doctrine/master.svg?style=flat-square [travis-url]: https://travis-ci.org/eslint/doctrine [coveralls-image]: https://img.shields.io/coveralls/eslint/doctrine/master.svg?style=flat-square [coveralls-url]: https://coveralls.io/r/eslint/doctrine?branch=master [downloads-image]: http://img.shields.io/npm/dm/doctrine.svg?style=flat-square [downloads-url]: https://www.npmjs.com/package/doctrine # assemblyscript-json ![npm version](https://img.shields.io/npm/v/assemblyscript-json) ![npm downloads per month](https://img.shields.io/npm/dm/assemblyscript-json) JSON encoder / decoder for AssemblyScript. Special thanks to https://github.com/MaxGraey/bignum.wasm for basic unit testing infra for AssemblyScript. ## Installation `assemblyscript-json` is available as a [npm package](https://www.npmjs.com/package/assemblyscript-json). You can install `assemblyscript-json` in your AssemblyScript project by running: `npm install --save assemblyscript-json` ## Usage ### Parsing JSON ```typescript import { JSON } from "assemblyscript-json"; // Parse an object using the JSON object let jsonObj: JSON.Obj = <JSON.Obj>(JSON.parse('{"hello": "world", "value": 24}')); // We can then use the .getX functions to read from the object if you know it's type // This will return the appropriate JSON.X value if the key exists, or null if the key does not exist let worldOrNull: JSON.Str | null = jsonObj.getString("hello"); // This will return a JSON.Str or null if (worldOrNull != null) { // use .valueOf() to turn the high level JSON.Str type into a string let world: string = worldOrNull.valueOf(); } let numOrNull: JSON.Num | null = jsonObj.getNum("value"); if (numOrNull != null) { // use .valueOf() to turn the high level JSON.Num type into a f64 let value: f64 = numOrNull.valueOf(); } // If you don't know the value type, get the parent JSON.Value let valueOrNull: JSON.Value | null = jsonObj.getValue("hello"); if (valueOrNull != null) { let value = <JSON.Value>valueOrNull; // Next we could figure out what type we are if(value.isString) { // value.isString would be true, so we can cast to a string let innerString = (<JSON.Str>value).valueOf(); let jsonString = (<JSON.Str>value).stringify(); // Do something with string value } } ``` ### Encoding JSON ```typescript import { JSONEncoder } from "assemblyscript-json"; // Create encoder let encoder = new JSONEncoder(); // Construct necessary object encoder.pushObject("obj"); encoder.setInteger("int", 10); encoder.setString("str", ""); encoder.popObject(); // Get serialized data let json: Uint8Array = encoder.serialize(); // Or get serialized data as string let jsonString: string = encoder.stringify(); assert(jsonString, '"obj": {"int": 10, "str": ""}'); // True! ``` ### Custom JSON Deserializers ```typescript import { JSONDecoder, JSONHandler } from "assemblyscript-json"; // Events need to be received by custom object extending JSONHandler. // NOTE: All methods are optional to implement. class MyJSONEventsHandler extends JSONHandler { setString(name: string, value: string): void { // Handle field } setBoolean(name: string, value: bool): void { // Handle field } setNull(name: string): void { // Handle field } setInteger(name: string, value: i64): void { // Handle field } setFloat(name: string, value: f64): void { // Handle field } pushArray(name: string): bool { // Handle array start // true means that nested object needs to be traversed, false otherwise // Note that returning false means JSONDecoder.startIndex need to be updated by handler return true; } popArray(): void { // Handle array end } pushObject(name: string): bool { // Handle object start // true means that nested object needs to be traversed, false otherwise // Note that returning false means JSONDecoder.startIndex need to be updated by handler return true; } popObject(): void { // Handle object end } } // Create decoder let decoder = new JSONDecoder<MyJSONEventsHandler>(new MyJSONEventsHandler()); // Create a byte buffer of our JSON. NOTE: Deserializers work on UTF8 string buffers. let jsonString = '{"hello": "world"}'; let jsonBuffer = Uint8Array.wrap(String.UTF8.encode(jsonString)); // Parse JSON decoder.deserialize(jsonBuffer); // This will send events to MyJSONEventsHandler ``` Feel free to look through the [tests](https://github.com/nearprotocol/assemblyscript-json/tree/master/assembly/__tests__) for more usage examples. ## Reference Documentation Reference API Documentation can be found in the [docs directory](./docs). ## License [MIT](./LICENSE) # yargs-parser [![Build Status](https://travis-ci.org/yargs/yargs-parser.svg)](https://travis-ci.org/yargs/yargs-parser) [![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) The mighty option parser used by [yargs](https://github.com/yargs/yargs). visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. <img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/master/yargs-logo.png"> ## Example ```sh npm i yargs-parser --save ``` ```js var argv = require('yargs-parser')(process.argv.slice(2)) console.log(argv) ``` ```sh node example.js --foo=33 --bar hello { _: [], foo: 33, bar: 'hello' } ``` _or parse a string!_ ```js var argv = require('yargs-parser')('--foo=99 --bar=33') console.log(argv) ``` ```sh { _: [], foo: 99, bar: 33 } ``` Convert an array of mixed types before passing to `yargs-parser`: ```js var parse = require('yargs-parser') parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings ``` ## API ### require('yargs-parser')(args, opts={}) Parses command line arguments returning a simple mapping of keys and values. **expects:** * `args`: a string or array of strings representing the options to parse. * `opts`: provide a set of hints indicating how `args` should be parsed: * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.<br> Indicate that keys should be parsed as an array and coerced to booleans / numbers:<br> `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided (or throws an error). For arrays the function is called only once for the entire array:<br> `{coerce: {foo: function (arg) {return modifiedArg}}}`. * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:<br> `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. * `opts.normalize`: `path.normalize()` will be applied to values set to this key. * `opts.number`: keys should be treated as numbers. * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). **returns:** * `obj`: an object representing the parsed value of `args` * `key/value`: key value pairs for each argument and their aliases. * `_`: an array representing the positional arguments. * [optional] `--`: an array with arguments after the end-of-options flag `--`. ### require('yargs-parser').detailed(args, opts={}) Parses a command line string, returning detailed information required by the yargs engine. **expects:** * `args`: a string or array of strings representing options to parse. * `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. **returns:** * `argv`: an object representing the parsed value of `args` * `key/value`: key value pairs for each argument and their aliases. * `_`: an array representing the positional arguments. * [optional] `--`: an array with arguments after the end-of-options flag `--`. * `error`: populated with an error object if an exception occurred during parsing. * `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. * `newAliases`: any new aliases added via camel-case expansion: * `boolean`: `{ fooBar: true }` * `defaulted`: any new argument created by `opts.default`, no aliases included. * `boolean`: `{ foo: true }` * `configuration`: given by default settings and `opts.configuration`. <a name="configuration"></a> ### Configuration The yargs-parser applies several automated transformations on the keys provided in `args`. These features can be turned on and off using the `configuration` field of `opts`. ```js var parsed = parser(['--no-dice'], { configuration: { 'boolean-negation': false } }) ``` ### short option groups * default: `true`. * key: `short-option-groups`. Should a group of short-options be treated as boolean flags? ```sh node example.js -abc { _: [], a: true, b: true, c: true } ``` _if disabled:_ ```sh node example.js -abc { _: [], abc: true } ``` ### camel-case expansion * default: `true`. * key: `camel-case-expansion`. Should hyphenated arguments be expanded into camel-case aliases? ```sh node example.js --foo-bar { _: [], 'foo-bar': true, fooBar: true } ``` _if disabled:_ ```sh node example.js --foo-bar { _: [], 'foo-bar': true } ``` ### dot-notation * default: `true` * key: `dot-notation` Should keys that contain `.` be treated as objects? ```sh node example.js --foo.bar { _: [], foo: { bar: true } } ``` _if disabled:_ ```sh node example.js --foo.bar { _: [], "foo.bar": true } ``` ### parse numbers * default: `true` * key: `parse-numbers` Should keys that look like numbers be treated as such? ```sh node example.js --foo=99.3 { _: [], foo: 99.3 } ``` _if disabled:_ ```sh node example.js --foo=99.3 { _: [], foo: "99.3" } ``` ### boolean negation * default: `true` * key: `boolean-negation` Should variables prefixed with `--no` be treated as negations? ```sh node example.js --no-foo { _: [], foo: false } ``` _if disabled:_ ```sh node example.js --no-foo { _: [], "no-foo": true } ``` ### combine arrays * default: `false` * key: `combine-arrays` Should arrays be combined when provided by both command line arguments and a configuration file. ### duplicate arguments array * default: `true` * key: `duplicate-arguments-array` Should arguments be coerced into an array when duplicated: ```sh node example.js -x 1 -x 2 { _: [], x: [1, 2] } ``` _if disabled:_ ```sh node example.js -x 1 -x 2 { _: [], x: 2 } ``` ### flatten duplicate arrays * default: `true` * key: `flatten-duplicate-arrays` Should array arguments be coerced into a single array when duplicated: ```sh node example.js -x 1 2 -x 3 4 { _: [], x: [1, 2, 3, 4] } ``` _if disabled:_ ```sh node example.js -x 1 2 -x 3 4 { _: [], x: [[1, 2], [3, 4]] } ``` ### greedy arrays * default: `true` * key: `greedy-arrays` Should arrays consume more than one positional argument following their flag. ```sh node example --arr 1 2 { _[], arr: [1, 2] } ``` _if disabled:_ ```sh node example --arr 1 2 { _[2], arr: [1] } ``` **Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** ### nargs eats options * default: `false` * key: `nargs-eats-options` Should nargs consume dash options as well as positional arguments. ### negation prefix * default: `no-` * key: `negation-prefix` The prefix to use for negated boolean variables. ```sh node example.js --no-foo { _: [], foo: false } ``` _if set to `quux`:_ ```sh node example.js --quuxfoo { _: [], foo: false } ``` ### populate -- * default: `false`. * key: `populate--` Should unparsed flags be stored in `--` or `_`. _If disabled:_ ```sh node example.js a -b -- x y { _: [ 'a', 'x', 'y' ], b: true } ``` _If enabled:_ ```sh node example.js a -b -- x y { _: [ 'a' ], '--': [ 'x', 'y' ], b: true } ``` ### set placeholder key * default: `false`. * key: `set-placeholder-key`. Should a placeholder be added for keys not set via the corresponding CLI argument? _If disabled:_ ```sh node example.js -a 1 -c 2 { _: [], a: 1, c: 2 } ``` _If enabled:_ ```sh node example.js -a 1 -c 2 { _: [], a: 1, b: undefined, c: 2 } ``` ### halt at non-option * default: `false`. * key: `halt-at-non-option`. Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. _If disabled:_ ```sh node example.js -a run b -x y { _: [ 'b' ], a: 'run', x: 'y' } ``` _If enabled:_ ```sh node example.js -a run b -x y { _: [ 'b', '-x', 'y' ], a: 'run' } ``` ### strip aliased * default: `false` * key: `strip-aliased` Should aliases be removed before returning results? _If disabled:_ ```sh node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } ``` _If enabled:_ ```sh node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1 } ``` ### strip dashed * default: `false` * key: `strip-dashed` Should dashed keys be removed before returning results? This option has no effect if `camel-case-expansion` is disabled. _If disabled:_ ```sh node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1 } ``` _If enabled:_ ```sh node example.js --test-field 1 { _: [], testField: 1 } ``` ### unknown options as args * default: `false` * key: `unknown-options-as-args` Should unknown options be treated like regular arguments? An unknown option is one that is not configured in `opts`. _If disabled_ ```sh node example.js --unknown-option --known-option 2 --string-option --unknown-option2 { _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } ``` _If enabled_ ```sh node example.js --unknown-option --known-option 2 --string-option --unknown-option2 { _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } ``` ## Special Thanks The yargs project evolves from optimist and minimist. It owes its existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ ## License ISC discontinuous-range =================== ``` DiscontinuousRange(1, 10).subtract(4, 6); // [ 1-3, 7-10 ] ``` [![Build Status](https://travis-ci.org/dtudury/discontinuous-range.png)](https://travis-ci.org/dtudury/discontinuous-range) this is a pretty simple module, but it exists to service another project so this'll be pretty lacking documentation. reading the test to see how this works may help. otherwise, here's an example that I think pretty much sums it up ###Example ``` var all_numbers = new DiscontinuousRange(1, 100); var bad_numbers = DiscontinuousRange(13).add(8).add(60,80); var good_numbers = all_numbers.clone().subtract(bad_numbers); console.log(good_numbers.toString()); //[ 1-7, 9-12, 14-59, 81-100 ] var random_good_number = good_numbers.index(Math.floor(Math.random() * good_numbers.length)); ``` # once Only call a function once. ## usage ```javascript var once = require('once') function load (file, cb) { cb = once(cb) loader.load('file') loader.once('load', cb) loader.once('error', cb) } ``` Or add to the Function.prototype in a responsible way: ```javascript // only has to be done once require('once').proto() function load (file, cb) { cb = cb.once() loader.load('file') loader.once('load', cb) loader.once('error', cb) } ``` Ironically, the prototype feature makes this module twice as complicated as necessary. To check whether you function has been called, use `fn.called`. Once the function is called for the first time the return value of the original function is saved in `fn.value` and subsequent calls will continue to return this value. ```javascript var once = require('once') function load (cb) { cb = once(cb) var stream = createStream() stream.once('data', cb) stream.once('end', function () { if (!cb.called) cb(new Error('not found')) }) } ``` ## `once.strict(func)` Throw an error if the function is called twice. Some functions are expected to be called only once. Using `once` for them would potentially hide logical errors. In the example below, the `greet` function has to call the callback only once: ```javascript function greet (name, cb) { // return is missing from the if statement // when no name is passed, the callback is called twice if (!name) cb('Hello anonymous') cb('Hello ' + name) } function log (msg) { console.log(msg) } // this will print 'Hello anonymous' but the logical error will be missed greet(null, once(msg)) // once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time greet(null, once.strict(msg)) ``` # URI.js URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc). It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications. URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated). ## API ### Parsing URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body"); //returns: //{ // scheme : "uri", // userinfo : "user:pass", // host : "example.com", // port : 123, // path : "/one/two.three", // query : "q1=a1&q2=a2", // fragment : "body" //} ### Serializing URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer" ### Resolving URI.resolve("uri://a/b/c/d?q", "../../g") === "uri://a/g" ### Normalizing URI.normalize("HTTP://ABC.com:80/%7Esmith/home.html") === "http://abc.com/~smith/home.html" ### Comparison URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d") === true ### IP Support //IPv4 normalization URI.normalize("//192.068.001.000") === "//192.68.1.0" //IPv6 normalization URI.normalize("//[2001:0:0DB8::0:0001]") === "//[2001:0:db8::1]" //IPv6 zone identifier support URI.parse("//[2001:db8::7%25en1]"); //returns: //{ // host : "2001:db8::7%en1" //} ### IRI Support //convert IRI to URI URI.serialize(URI.parse("http://examplé.org/rosé")) === "http://xn--exampl-gva.org/ros%C3%A9" //convert URI to IRI URI.serialize(URI.parse("http://xn--exampl-gva.org/ros%C3%A9"), {iri:true}) === "http://examplé.org/rosé" ### Options All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties: * `scheme` (string) Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior. * `reference` (string) If set to `"suffix"`, it indicates that the URI is in the suffix format, and the validator will use the option's `scheme` property to determine the URI's scheme. * `tolerant` (boolean, false) If set to `true`, the parser will relax URI resolving rules. * `absolutePath` (boolean, false) If set to `true`, the serializer will not resolve a relative `path` component. * `iri` (boolean, false) If set to `true`, the serializer will unescape non-ASCII characters as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). * `unicodeSupport` (boolean, false) If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). * `domainHost` (boolean, false) If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt). ## Scheme Extendable URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, URI.js has built in support for the following schemes: * http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\] * https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\] * ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] * wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] * mailto \[[RFC 6068](http://www.ietf.org/rfc/rfc6068.txt)\] * urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\] * urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\] ### HTTP/HTTPS Support URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true ### WS/WSS Support URI.parse("wss://example.com/foo?bar=baz"); //returns: //{ // scheme : "wss", // host: "example.com", // resourceName: "/foo?bar=baz", // secure: true, //} URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true ### Mailto Support URI.parse("mailto:alpha@example.com,bravo@example.com?subject=SUBSCRIBE&body=Sign%20me%20up!"); //returns: //{ // scheme : "mailto", // to : ["alpha@example.com", "bravo@example.com"], // subject : "SUBSCRIBE", // body : "Sign me up!" //} URI.serialize({ scheme : "mailto", to : ["alpha@example.com"], subject : "REMOVE", body : "Please remove me", headers : { cc : "charlie@example.com" } }) === "mailto:alpha@example.com?cc=charlie@example.com&subject=REMOVE&body=Please%20remove%20me" ### URN Support URI.parse("urn:example:foo"); //returns: //{ // scheme : "urn", // nid : "example", // nss : "foo", //} #### URN UUID Support URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); //returns: //{ // scheme : "urn", // nid : "uuid", // uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", //} ## Usage To load in a browser, use the following tag: <script type="text/javascript" src="uri-js/dist/es5/uri.all.min.js"></script> To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line: npm install uri-js # OR yarn add uri-js Then, in your code, load it using: const URI = require("uri-js"); If you are writing your code in ES6+ (ESNEXT) or TypeScript, you would load it using: import * as URI from "uri-js"; Or you can load just what you need using named exports: import { parse, serialize, resolve, resolveComponents, normalize, equal, removeDotSegments, pctEncChar, pctDecChars, escapeComponent, unescapeComponent } from "uri-js"; ## Breaking changes ### Breaking changes from 3.x URN parsing has been completely changed to better align with the specification. Scheme is now always `urn`, but has two new properties: `nid` which contains the Namspace Identifier, and `nss` which contains the Namespace Specific String. The `nss` property will be removed by higher order scheme handlers, such as the UUID URN scheme handler. The UUID of a URN can now be found in the `uuid` property. ### Breaking changes from 2.x URI validation has been removed as it was slow, exposed a vulnerabilty, and was generally not useful. ### Breaking changes from 1.x The `errors` array on parsed components is now an `error` string. functional-red-black-tree ========================= A [fully persistent](http://en.wikipedia.org/wiki/Persistent_data_structure) [red-black tree](http://en.wikipedia.org/wiki/Red%E2%80%93black_tree) written 100% in JavaScript. Works both in node.js and in the browser via [browserify](http://browserify.org/). Functional (or fully presistent) data structures allow for non-destructive updates. So if you insert an element into the tree, it returns a new tree with the inserted element rather than destructively updating the existing tree in place. Doing this requires using extra memory, and if one were naive it could cost as much as reallocating the entire tree. Instead, this data structure saves some memory by recycling references to previously allocated subtrees. This requires using only O(log(n)) additional memory per update instead of a full O(n) copy. Some advantages of this is that it is possible to apply insertions and removals to the tree while still iterating over previous versions of the tree. Functional and persistent data structures can also be useful in many geometric algorithms like point location within triangulations or ray queries, and can be used to analyze the history of executing various algorithms. This added power though comes at a cost, since it is generally a bit slower to use a functional data structure than an imperative version. However, if your application needs this behavior then you may consider using this module. # Install npm install functional-red-black-tree # Example Here is an example of some basic usage: ```javascript //Load the library var createTree = require("functional-red-black-tree") //Create a tree var t1 = createTree() //Insert some items into the tree var t2 = t1.insert(1, "foo") var t3 = t2.insert(2, "bar") //Remove something var t4 = t3.remove(1) ``` # API ```javascript var createTree = require("functional-red-black-tree") ``` ## Overview - [Tree methods](#tree-methods) - [`var tree = createTree([compare])`](#var-tree-=-createtreecompare) - [`tree.keys`](#treekeys) - [`tree.values`](#treevalues) - [`tree.length`](#treelength) - [`tree.get(key)`](#treegetkey) - [`tree.insert(key, value)`](#treeinsertkey-value) - [`tree.remove(key)`](#treeremovekey) - [`tree.find(key)`](#treefindkey) - [`tree.ge(key)`](#treegekey) - [`tree.gt(key)`](#treegtkey) - [`tree.lt(key)`](#treeltkey) - [`tree.le(key)`](#treelekey) - [`tree.at(position)`](#treeatposition) - [`tree.begin`](#treebegin) - [`tree.end`](#treeend) - [`tree.forEach(visitor(key,value)[, lo[, hi]])`](#treeforEachvisitorkeyvalue-lo-hi) - [`tree.root`](#treeroot) - [Node properties](#node-properties) - [`node.key`](#nodekey) - [`node.value`](#nodevalue) - [`node.left`](#nodeleft) - [`node.right`](#noderight) - [Iterator methods](#iterator-methods) - [`iter.key`](#iterkey) - [`iter.value`](#itervalue) - [`iter.node`](#iternode) - [`iter.tree`](#itertree) - [`iter.index`](#iterindex) - [`iter.valid`](#itervalid) - [`iter.clone()`](#iterclone) - [`iter.remove()`](#iterremove) - [`iter.update(value)`](#iterupdatevalue) - [`iter.next()`](#iternext) - [`iter.prev()`](#iterprev) - [`iter.hasNext`](#iterhasnext) - [`iter.hasPrev`](#iterhasprev) ## Tree methods ### `var tree = createTree([compare])` Creates an empty functional tree * `compare` is an optional comparison function, same semantics as array.sort() **Returns** An empty tree ordered by `compare` ### `tree.keys` A sorted array of all the keys in the tree ### `tree.values` An array array of all the values in the tree ### `tree.length` The number of items in the tree ### `tree.get(key)` Retrieves the value associated to the given key * `key` is the key of the item to look up **Returns** The value of the first node associated to `key` ### `tree.insert(key, value)` Creates a new tree with the new pair inserted. * `key` is the key of the item to insert * `value` is the value of the item to insert **Returns** A new tree with `key` and `value` inserted ### `tree.remove(key)` Removes the first item with `key` in the tree * `key` is the key of the item to remove **Returns** A new tree with the given item removed if it exists ### `tree.find(key)` Returns an iterator pointing to the first item in the tree with `key`, otherwise `null`. ### `tree.ge(key)` Find the first item in the tree whose key is `>= key` * `key` is the key to search for **Returns** An iterator at the given element. ### `tree.gt(key)` Finds the first item in the tree whose key is `> key` * `key` is the key to search for **Returns** An iterator at the given element ### `tree.lt(key)` Finds the last item in the tree whose key is `< key` * `key` is the key to search for **Returns** An iterator at the given element ### `tree.le(key)` Finds the last item in the tree whose key is `<= key` * `key` is the key to search for **Returns** An iterator at the given element ### `tree.at(position)` Finds an iterator starting at the given element * `position` is the index at which the iterator gets created **Returns** An iterator starting at position ### `tree.begin` An iterator pointing to the first element in the tree ### `tree.end` An iterator pointing to the last element in the tree ### `tree.forEach(visitor(key,value)[, lo[, hi]])` Walks a visitor function over the nodes of the tree in order. * `visitor(key,value)` is a callback that gets executed on each node. If a truthy value is returned from the visitor, then iteration is stopped. * `lo` is an optional start of the range to visit (inclusive) * `hi` is an optional end of the range to visit (non-inclusive) **Returns** The last value returned by the callback ### `tree.root` Returns the root node of the tree ## Node properties Each node of the tree has the following properties: ### `node.key` The key associated to the node ### `node.value` The value associated to the node ### `node.left` The left subtree of the node ### `node.right` The right subtree of the node ## Iterator methods ### `iter.key` The key of the item referenced by the iterator ### `iter.value` The value of the item referenced by the iterator ### `iter.node` The value of the node at the iterator's current position. `null` is iterator is node valid. ### `iter.tree` The tree associated to the iterator ### `iter.index` Returns the position of this iterator in the sequence. ### `iter.valid` Checks if the iterator is valid ### `iter.clone()` Makes a copy of the iterator ### `iter.remove()` Removes the item at the position of the iterator **Returns** A new binary search tree with `iter`'s item removed ### `iter.update(value)` Updates the value of the node in the tree at this iterator **Returns** A new binary search tree with the corresponding node updated ### `iter.next()` Advances the iterator to the next position ### `iter.prev()` Moves the iterator backward one element ### `iter.hasNext` If true, then the iterator is not at the end of the sequence ### `iter.hasPrev` If true, then the iterator is not at the beginning of the sequence # Credits (c) 2013 Mikola Lysenko. MIT License <p align="center"> <a href="https://assemblyscript.org" target="_blank" rel="noopener"><img width="100" src="https://avatars1.githubusercontent.com/u/28916798?s=200&v=4" alt="AssemblyScript logo"></a> </p> <p align="center"> <a href="https://github.com/AssemblyScript/assemblyscript/actions?query=workflow%3ATest"><img src="https://img.shields.io/github/workflow/status/AssemblyScript/assemblyscript/Test/master?label=test&logo=github" alt="Test status" /></a> <a href="https://github.com/AssemblyScript/assemblyscript/actions?query=workflow%3APublish"><img src="https://img.shields.io/github/workflow/status/AssemblyScript/assemblyscript/Publish/master?label=publish&logo=github" alt="Publish status" /></a> <a href="https://www.npmjs.com/package/assemblyscript"><img src="https://img.shields.io/npm/v/assemblyscript.svg?label=compiler&color=007acc&logo=npm" alt="npm compiler version" /></a> <a href="https://www.npmjs.com/package/@assemblyscript/loader"><img src="https://img.shields.io/npm/v/@assemblyscript/loader.svg?label=loader&color=007acc&logo=npm" alt="npm loader version" /></a> <a href="https://discord.gg/assemblyscript"><img src="https://img.shields.io/discord/721472913886281818.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2" alt="Discord online" /></a> </p> <p align="justify"><strong>AssemblyScript</strong> compiles a strict variant of <a href="http://www.typescriptlang.org">TypeScript</a> (basically JavaScript with types) to <a href="http://webassembly.org">WebAssembly</a> using <a href="https://github.com/WebAssembly/binaryen">Binaryen</a>. It generates lean and mean WebAssembly modules while being just an <code>npm install</code> away.</p> <h3 align="center"> <a href="https://assemblyscript.org">About</a> &nbsp;·&nbsp; <a href="https://assemblyscript.org/introduction.html">Introduction</a> &nbsp;·&nbsp; <a href="https://assemblyscript.org/quick-start.html">Quick&nbsp;start</a> &nbsp;·&nbsp; <a href="https://assemblyscript.org/examples.html">Examples</a> &nbsp;·&nbsp; <a href="https://assemblyscript.org/development.html">Development&nbsp;instructions</a> </h3> <br> <h2 align="center">Contributors</h2> <p align="center"> <a href="https://assemblyscript.org/#contributors"><img src="https://assemblyscript.org/contributors.svg" alt="Contributor logos" width="720" /></a> </p> <h2 align="center">Thanks to our sponsors!</h2> <p align="justify">Most of the core team members and most contributors do this open source work in their free time. If you use AssemblyScript for a serious task or plan to do so, and you'd like us to invest more time on it, <a href="https://opencollective.com/assemblyscript/donate" target="_blank" rel="noopener">please donate</a> to our <a href="https://opencollective.com/assemblyscript" target="_blank" rel="noopener">OpenCollective</a>. By sponsoring this project, your logo will show up below. Thank you so much for your support!</p> <p align="center"> <a href="https://assemblyscript.org/#sponsors"><img src="https://assemblyscript.org/sponsors.svg" alt="Sponsor logos" width="720" /></a> </p> # universal-url [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url] > WHATWG [`URL`](https://developer.mozilla.org/en/docs/Web/API/URL) for Node & Browser. * For Node.js versions `>= 8`, the native implementation will be used. * For Node.js versions `< 8`, a [shim](https://npmjs.com/whatwg-url) will be used. * For web browsers without a native implementation, the same shim will be used. ## Installation [Node.js](http://nodejs.org/) `>= 6` is required. To install, type this at the command line: ```shell npm install universal-url ``` ## Usage ```js const {URL, URLSearchParams} = require('universal-url'); const url = new URL('http://domain/'); const params = new URLSearchParams('?param=value'); ``` Global shim: ```js require('universal-url').shim(); const url = new URL('http://domain/'); const params = new URLSearchParams('?param=value'); ``` ## Browserify/etc The bundled file size of this library can be large for a web browser. If this is a problem, try using [universal-url-lite](https://npmjs.com/universal-url-lite) in your build as an alias for this module. [npm-image]: https://img.shields.io/npm/v/universal-url.svg [npm-url]: https://npmjs.org/package/universal-url [travis-image]: https://img.shields.io/travis/stevenvachon/universal-url.svg [travis-url]: https://travis-ci.org/stevenvachon/universal-url [greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/universal-url.svg [greenkeeper-url]: https://greenkeeper.io/ # base-x [![NPM Package](https://img.shields.io/npm/v/base-x.svg?style=flat-square)](https://www.npmjs.org/package/base-x) [![Build Status](https://img.shields.io/travis/cryptocoinjs/base-x.svg?branch=master&style=flat-square)](https://travis-ci.org/cryptocoinjs/base-x) [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) Fast base encoding / decoding of any given alphabet using bitcoin style leading zero compression. **WARNING:** This module is **NOT RFC3548** compliant, it cannot be used for base16 (hex), base32, or base64 encoding in a standards compliant manner. ## Example Base58 ``` javascript var BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' var bs58 = require('base-x')(BASE58) var decoded = bs58.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr') console.log(decoded) // => <Buffer 80 ed db dc 11 68 f1 da ea db d3 e4 4c 1e 3f 8f 5a 28 4c 20 29 f7 8a d2 6a f9 85 83 a4 99 de 5b 19> console.log(bs58.encode(decoded)) // => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr ``` ### Alphabets See below for a list of commonly recognized alphabets, and their respective base. Base | Alphabet ------------- | ------------- 2 | `01` 8 | `01234567` 11 | `0123456789a` 16 | `0123456789abcdef` 32 | `0123456789ABCDEFGHJKMNPQRSTVWXYZ` 32 | `ybndrfg8ejkmcpqxot1uwisza345h769` (z-base-32) 36 | `0123456789abcdefghijklmnopqrstuvwxyz` 58 | `123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz` 62 | `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` 64 | `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/` 67 | `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~` ## How it works It encodes octet arrays by doing long divisions on all significant digits in the array, creating a representation of that number in the new base. Then for every leading zero in the input (not significant as a number) it will encode as a single leader character. This is the first in the alphabet and will decode as 8 bits. The other characters depend upon the base. For example, a base58 alphabet packs roughly 5.858 bits per character. This means the encoded string 000f (using a base16, 0-f alphabet) will actually decode to 4 bytes unlike a canonical hex encoding which uniformly packs 4 bits into each character. While unusual, this does mean that no padding is required and it works for bases like 43. ## LICENSE [MIT](LICENSE) A direct derivation of the base58 implementation from [`bitcoin/bitcoin`](https://github.com/bitcoin/bitcoin/blob/f1e2f2a85962c1664e4e55471061af0eaa798d40/src/base58.cpp), generalized for variable length alphabets. # axios [![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) [![build status](https://img.shields.io/travis/axios/axios/master.svg?style=flat-square)](https://travis-ci.org/axios/axios) [![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) [![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) [![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) [![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) [![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) Promise based HTTP client for the browser and node.js ## Features - Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser - Make [http](http://nodejs.org/api/http.html) requests from node.js - Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API - Intercept request and response - Transform request and response data - Cancel requests - Automatic transforms for JSON data - Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) ## Browser Support ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | --- | --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | [![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) ## Installing Using npm: ```bash $ npm install axios ``` Using bower: ```bash $ bower install axios ``` Using yarn: ```bash $ yarn add axios ``` Using cdn: ```html <script src="https://unpkg.com/axios/dist/axios.min.js"></script> ``` ## Example ### note: CommonJS usage In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: ```js const axios = require('axios').default; // axios.<method> will now provide autocomplete and parameter typings ``` Performing a `GET` request ```js const axios = require('axios'); // Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { // handle success console.log(response); }) .catch(function (error) { // handle error console.log(error); }) .finally(function () { // always executed }); // Optionally the request above could also be done as axios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }) .finally(function () { // always executed }); // Want to use async/await? Add the `async` keyword to your outer function/method. async function getUser() { try { const response = await axios.get('/user?ID=12345'); console.log(response); } catch (error) { console.error(error); } } ``` > **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet > Explorer and older browsers, so use with caution. Performing a `POST` request ```js axios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); ``` Performing multiple concurrent requests ```js function getUserAccount() { return axios.get('/user/12345'); } function getUserPermissions() { return axios.get('/user/12345/permissions'); } axios.all([getUserAccount(), getUserPermissions()]) .then(axios.spread(function (acct, perms) { // Both requests are now complete })); ``` ## axios API Requests can be made by passing the relevant config to `axios`. ##### axios(config) ```js // Send a POST request axios({ method: 'post', url: '/user/12345', data: { firstName: 'Fred', lastName: 'Flintstone' } }); ``` ```js // GET request for remote image axios({ method: 'get', url: 'http://bit.ly/2mTM3nY', responseType: 'stream' }) .then(function (response) { response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) }); ``` ##### axios(url[, config]) ```js // Send a GET request (default method) axios('/user/12345'); ``` ### Request method aliases For convenience aliases have been provided for all supported request methods. ##### axios.request(config) ##### axios.get(url[, config]) ##### axios.delete(url[, config]) ##### axios.head(url[, config]) ##### axios.options(url[, config]) ##### axios.post(url[, data[, config]]) ##### axios.put(url[, data[, config]]) ##### axios.patch(url[, data[, config]]) ###### NOTE When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. ### Concurrency Helper functions for dealing with concurrent requests. ##### axios.all(iterable) ##### axios.spread(callback) ### Creating an instance You can create a new instance of axios with a custom config. ##### axios.create([config]) ```js const instance = axios.create({ baseURL: 'https://some-domain.com/api/', timeout: 1000, headers: {'X-Custom-Header': 'foobar'} }); ``` ### Instance methods The available instance methods are listed below. The specified config will be merged with the instance config. ##### axios#request(config) ##### axios#get(url[, config]) ##### axios#delete(url[, config]) ##### axios#head(url[, config]) ##### axios#options(url[, config]) ##### axios#post(url[, data[, config]]) ##### axios#put(url[, data[, config]]) ##### axios#patch(url[, data[, config]]) ##### axios#getUri([config]) ## Request Config These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. ```js { // `url` is the server URL that will be used for the request url: '/user', // `method` is the request method to be used when making the request method: 'get', // default // `baseURL` will be prepended to `url` unless `url` is absolute. // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs // to methods of that instance. baseURL: 'https://some-domain.com/api/', // `transformRequest` allows changes to the request data before it is sent to the server // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, // FormData or Stream // You may modify the headers object. transformRequest: [function (data, headers) { // Do whatever you want to transform the data return data; }], // `transformResponse` allows changes to the response data to be made before // it is passed to then/catch transformResponse: [function (data) { // Do whatever you want to transform the data return data; }], // `headers` are custom headers to be sent headers: {'X-Requested-With': 'XMLHttpRequest'}, // `params` are the URL parameters to be sent with the request // Must be a plain object or a URLSearchParams object params: { ID: 12345 }, // `paramsSerializer` is an optional function in charge of serializing `params` // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) paramsSerializer: function (params) { return Qs.stringify(params, {arrayFormat: 'brackets'}) }, // `data` is the data to be sent as the request body // Only applicable for request methods 'PUT', 'POST', and 'PATCH' // When no `transformRequest` is set, must be of one of the following types: // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams // - Browser only: FormData, File, Blob // - Node only: Stream, Buffer data: { firstName: 'Fred' }, // syntax alternative to send data into the body // method post // only the value is sent, not the key data: 'Country=Brasil&City=Belo Horizonte', // `timeout` specifies the number of milliseconds before the request times out. // If the request takes longer than `timeout`, the request will be aborted. timeout: 1000, // default is `0` (no timeout) // `withCredentials` indicates whether or not cross-site Access-Control requests // should be made using credentials withCredentials: false, // default // `adapter` allows custom handling of requests which makes testing easier. // Return a promise and supply a valid response (see lib/adapters/README.md). adapter: function (config) { /* ... */ }, // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. // This will set an `Authorization` header, overwriting any existing // `Authorization` custom headers you have set using `headers`. // Please note that only HTTP Basic auth is configurable through this parameter. // For Bearer tokens and such, use `Authorization` custom headers instead. auth: { username: 'janedoe', password: 's00pers3cret' }, // `responseType` indicates the type of data that the server will respond with // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' // browser only: 'blob' responseType: 'json', // default // `responseEncoding` indicates encoding to use for decoding responses // Note: Ignored for `responseType` of 'stream' or client-side requests responseEncoding: 'utf8', // default // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token xsrfCookieName: 'XSRF-TOKEN', // default // `xsrfHeaderName` is the name of the http header that carries the xsrf token value xsrfHeaderName: 'X-XSRF-TOKEN', // default // `onUploadProgress` allows handling of progress events for uploads onUploadProgress: function (progressEvent) { // Do whatever you want with the native progress event }, // `onDownloadProgress` allows handling of progress events for downloads onDownloadProgress: function (progressEvent) { // Do whatever you want with the native progress event }, // `maxContentLength` defines the max size of the http response content in bytes allowed maxContentLength: 2000, // `validateStatus` defines whether to resolve or reject the promise for a given // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` // or `undefined`), the promise will be resolved; otherwise, the promise will be // rejected. validateStatus: function (status) { return status >= 200 && status < 300; // default }, // `maxRedirects` defines the maximum number of redirects to follow in node.js. // If set to 0, no redirects will be followed. maxRedirects: 5, // default // `socketPath` defines a UNIX Socket to be used in node.js. // e.g. '/var/run/docker.sock' to send requests to the docker daemon. // Only either `socketPath` or `proxy` can be specified. // If both are specified, `socketPath` is used. socketPath: null, // default // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http // and https requests, respectively, in node.js. This allows options to be added like // `keepAlive` that are not enabled by default. httpAgent: new http.Agent({ keepAlive: true }), httpsAgent: new https.Agent({ keepAlive: true }), // 'proxy' defines the hostname and port of the proxy server. // You can also define your proxy using the conventional `http_proxy` and // `https_proxy` environment variables. If you are using environment variables // for your proxy configuration, you can also define a `no_proxy` environment // variable as a comma-separated list of domains that should not be proxied. // Use `false` to disable proxies, ignoring environment variables. // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and // supplies credentials. // This will set an `Proxy-Authorization` header, overwriting any existing // `Proxy-Authorization` custom headers you have set using `headers`. proxy: { host: '127.0.0.1', port: 9000, auth: { username: 'mikeymike', password: 'rapunz3l' } }, // `cancelToken` specifies a cancel token that can be used to cancel the request // (see Cancellation section below for details) cancelToken: new CancelToken(function (cancel) { }) } ``` ## Response Schema The response for a request contains the following information. ```js { // `data` is the response that was provided by the server data: {}, // `status` is the HTTP status code from the server response status: 200, // `statusText` is the HTTP status message from the server response statusText: 'OK', // `headers` the headers that the server responded with // All header names are lower cased headers: {}, // `config` is the config that was provided to `axios` for the request config: {}, // `request` is the request that generated this response // It is the last ClientRequest instance in node.js (in redirects) // and an XMLHttpRequest instance in the browser request: {} } ``` When using `then`, you will receive the response as follows: ```js axios.get('/user/12345') .then(function (response) { console.log(response.data); console.log(response.status); console.log(response.statusText); console.log(response.headers); console.log(response.config); }); ``` When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. ## Config Defaults You can specify config defaults that will be applied to every request. ### Global axios defaults ```js axios.defaults.baseURL = 'https://api.example.com'; axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; ``` ### Custom instance defaults ```js // Set config defaults when creating the instance const instance = axios.create({ baseURL: 'https://api.example.com' }); // Alter defaults after instance has been created instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; ``` ### Config order of precedence Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. ```js // Create an instance using the config defaults provided by the library // At this point the timeout config value is `0` as is the default for the library const instance = axios.create(); // Override timeout default for the library // Now all requests using this instance will wait 2.5 seconds before timing out instance.defaults.timeout = 2500; // Override timeout for this request as it's known to take a long time instance.get('/longRequest', { timeout: 5000 }); ``` ## Interceptors You can intercept requests or responses before they are handled by `then` or `catch`. ```js // Add a request interceptor axios.interceptors.request.use(function (config) { // Do something before request is sent return config; }, function (error) { // Do something with request error return Promise.reject(error); }); // Add a response interceptor axios.interceptors.response.use(function (response) { // Any status code that lie within the range of 2xx cause this function to trigger // Do something with response data return response; }, function (error) { // Any status codes that falls outside the range of 2xx cause this function to trigger // Do something with response error return Promise.reject(error); }); ``` If you need to remove an interceptor later you can. ```js const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); axios.interceptors.request.eject(myInterceptor); ``` You can add interceptors to a custom instance of axios. ```js const instance = axios.create(); instance.interceptors.request.use(function () {/*...*/}); ``` ## Handling Errors ```js axios.get('/user/12345') .catch(function (error) { if (error.response) { // The request was made and the server responded with a status code // that falls out of the range of 2xx console.log(error.response.data); console.log(error.response.status); console.log(error.response.headers); } else if (error.request) { // The request was made but no response was received // `error.request` is an instance of XMLHttpRequest in the browser and an instance of // http.ClientRequest in node.js console.log(error.request); } else { // Something happened in setting up the request that triggered an Error console.log('Error', error.message); } console.log(error.config); }); ``` Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. ```js axios.get('/user/12345', { validateStatus: function (status) { return status < 500; // Reject only if the status code is greater than or equal to 500 } }) ``` Using `toJSON` you get an object with more information about the HTTP error. ```js axios.get('/user/12345') .catch(function (error) { console.log(error.toJSON()); }); ``` ## Cancellation You can cancel a request using a *cancel token*. > The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). You can create a cancel token using the `CancelToken.source` factory as shown below: ```js const CancelToken = axios.CancelToken; const source = CancelToken.source(); axios.get('/user/12345', { cancelToken: source.token }).catch(function (thrown) { if (axios.isCancel(thrown)) { console.log('Request canceled', thrown.message); } else { // handle error } }); axios.post('/user/12345', { name: 'new name' }, { cancelToken: source.token }) // cancel the request (the message parameter is optional) source.cancel('Operation canceled by the user.'); ``` You can also create a cancel token by passing an executor function to the `CancelToken` constructor: ```js const CancelToken = axios.CancelToken; let cancel; axios.get('/user/12345', { cancelToken: new CancelToken(function executor(c) { // An executor function receives a cancel function as a parameter cancel = c; }) }); // cancel the request cancel(); ``` > Note: you can cancel several requests with the same cancel token. ## Using application/x-www-form-urlencoded format By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. ### Browser In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: ```js const params = new URLSearchParams(); params.append('param1', 'value1'); params.append('param2', 'value2'); axios.post('/foo', params); ``` > Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: ```js const qs = require('qs'); axios.post('/foo', qs.stringify({ 'bar': 123 })); ``` Or in another way (ES6), ```js import qs from 'qs'; const data = { 'bar': 123 }; const options = { method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded' }, data: qs.stringify(data), url, }; axios(options); ``` ### Node.js In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: ```js const querystring = require('querystring'); axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); ``` You can also use the [`qs`](https://github.com/ljharb/qs) library. ###### NOTE The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). ## Semver Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. ## Promises axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). ## TypeScript axios includes [TypeScript](http://typescriptlang.org) definitions. ```typescript import axios from 'axios'; axios.get('/user?ID=12345'); ``` ## Resources * [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) * [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) * [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) * [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) * [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) ## Credits axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. ## License [MIT](LICENSE) # sprintf.js **sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*. Its prototype is simple: string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: * An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string. * An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. * An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*. * An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result. * An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. * An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. * A type specifier that can be any of: * `%` — yields a literal `%` character * `b` — yields an integer as a binary number * `c` — yields an integer as the character with that ASCII value * `d` or `i` — yields an integer as a signed decimal number * `e` — yields a float using scientific notation * `u` — yields an integer as an unsigned decimal number * `f` — yields a float as is; see notes on precision above * `g` — yields a float as is; see notes on precision above * `o` — yields an integer as an octal number * `s` — yields a string as is * `x` — yields an integer as a hexadecimal number (lower-case) * `X` — yields an integer as a hexadecimal number (upper-case) * `j` — yields a JavaScript object or array as a JSON encoded string ## JavaScript `vsprintf` `vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments: vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) ## Argument swapping You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to: sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") And, of course, you can repeat the placeholders without having to increase the number of arguments. ## Named arguments Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key: var user = { name: "Dolly" } sprintf("Hello %(name)s", user) // Hello Dolly Keywords in replacement fields can be optionally followed by any number of keywords or indexes: var users = [ {name: "Dolly"}, {name: "Molly"}, {name: "Polly"} ] sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly Note: mixing positional and named placeholders is not (yet) supported ## Computed values You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly. sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890 sprintf("Current date and time: %s", function() { return new Date().toString() }) # AngularJS You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`. # Installation ## Via Bower bower install sprintf ## Or as a node.js module npm install sprintf-js ### Usage var sprintf = require("sprintf-js").sprintf, vsprintf = require("sprintf-js").vsprintf sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) # License **sprintf.js** is licensed under the terms of the 3-clause BSD license. # require-main-filename [![Build Status](https://travis-ci.org/yargs/require-main-filename.png)](https://travis-ci.org/yargs/require-main-filename) [![Coverage Status](https://coveralls.io/repos/yargs/require-main-filename/badge.svg?branch=master)](https://coveralls.io/r/yargs/require-main-filename?branch=master) [![NPM version](https://img.shields.io/npm/v/require-main-filename.svg)](https://www.npmjs.com/package/require-main-filename) `require.main.filename` is great for figuring out the entry point for the current application. This can be combined with a module like [pkg-conf](https://www.npmjs.com/package/pkg-conf) to, _as if by magic_, load top-level configuration. Unfortunately, `require.main.filename` sometimes fails when an application is executed with an alternative process manager, e.g., [iisnode](https://github.com/tjanczuk/iisnode). `require-main-filename` is a shim that addresses this problem. ## Usage ```js var main = require('require-main-filename')() // use main as an alternative to require.main.filename. ``` ## License ISC # axios // core The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: - Dispatching requests - Managing interceptors - Handling config # ts-mixer [version-badge]: https://badgen.net/npm/v/ts-mixer [version-link]: https://npmjs.com/package/ts-mixer [build-badge]: https://img.shields.io/github/workflow/status/tannerntannern/ts-mixer/ts-mixer%20CI [build-link]: https://github.com/tannerntannern/ts-mixer/actions [ts-versions]: https://badgen.net/badge/icon/3.8,3.9,4.0,4.1,4.2?icon=typescript&label&list=| [node-versions]: https://badgen.net/badge/node/10%2C12%2C14/blue/?list=| [![npm version][version-badge]][version-link] [![github actions][build-badge]][build-link] [![TS Versions][ts-versions]][build-link] [![Node.js Versions][node-versions]][build-link] [![Minified Size](https://badgen.net/bundlephobia/min/ts-mixer)](https://bundlephobia.com/result?p=ts-mixer) [![Conventional Commits](https://badgen.net/badge/conventional%20commits/1.0.0/yellow)](https://conventionalcommits.org) ## Overview `ts-mixer` brings mixins to TypeScript. "Mixins" to `ts-mixer` are just classes, so you already know how to write them, and you can probably mix classes from your favorite library without trouble. The mixin problem is more nuanced than it appears. I've seen countless code snippets that work for certain situations, but fail in others. `ts-mixer` tries to take the best from all these solutions while accounting for the situations you might not have considered. [Quick start guide](#quick-start) ### Features * mixes plain classes * mixes classes that extend other classes * mixes classes that were mixed with `ts-mixer` * supports static properties * supports protected/private properties (the popular function-that-returns-a-class solution does not) * mixes abstract classes (with caveats [[1](#caveats)]) * mixes generic classes (with caveats [[2](#caveats)]) * supports class, method, and property decorators (with caveats [[3, 6](#caveats)]) * mostly supports the complexity presented by constructor functions (with caveats [[4](#caveats)]) * comes with an `instanceof`-like replacement (with caveats [[5, 6](#caveats)]) * [multiple mixing strategies](#settings) (ES6 proxies vs hard copy) ### Caveats 1. Mixing abstract classes requires a bit of a hack that may break in future versions of TypeScript. See [mixing abstract classes](#mixing-abstract-classes) below. 2. Mixing generic classes requires a more cumbersome notation, but it's still possible. See [mixing generic classes](#mixing-generic-classes) below. 3. Using decorators in mixed classes also requires a more cumbersome notation. See [mixing with decorators](#mixing-with-decorators) below. 4. ES6 made it impossible to use `.apply(...)` on class constructors (or any means of calling them without `new`), which makes it impossible for `ts-mixer` to pass the proper `this` to your constructors. This may or may not be an issue for your code, but there are options to work around it. See [dealing with constructors](#dealing-with-constructors) below. 5. `ts-mixer` does not support `instanceof` for mixins, but it does offer a replacement. See the [hasMixin function](#hasmixin) for more details. 6. Certain features (specifically, `@decorator` and `hasMixin`) make use of ES6 `Map`s, which means you must either use ES6+ or polyfill `Map` to use them. If you don't need these features, you should be fine without. ## Quick Start ### Installation ``` $ npm install ts-mixer ``` or if you prefer [Yarn](https://yarnpkg.com): ``` $ yarn add ts-mixer ``` ### Basic Example ```typescript import { Mixin } from 'ts-mixer'; class Foo { protected makeFoo() { return 'foo'; } } class Bar { protected makeBar() { return 'bar'; } } class FooBar extends Mixin(Foo, Bar) { public makeFooBar() { return this.makeFoo() + this.makeBar(); } } const fooBar = new FooBar(); console.log(fooBar.makeFooBar()); // "foobar" ``` ## Special Cases ### Mixing Abstract Classes Abstract classes, by definition, cannot be constructed, which means they cannot take on the type, `new(...args) => any`, and by extension, are incompatible with `ts-mixer`. BUT, you can "trick" TypeScript into giving you all the benefits of an abstract class without making it technically abstract. The trick is just some strategic `// @ts-ignore`'s: ```typescript import { Mixin } from 'ts-mixer'; // note that Foo is not marked as an abstract class class Foo { // @ts-ignore: "Abstract methods can only appear within an abstract class" public abstract makeFoo(): string; } class Bar { public makeBar() { return 'bar'; } } class FooBar extends Mixin(Foo, Bar) { // we still get all the benefits of abstract classes here, because TypeScript // will still complain if this method isn't implemented public makeFoo() { return 'foo'; } } ``` Do note that while this does work quite well, it is a bit of a hack and I can't promise that it will continue to work in future TypeScript versions. ### Mixing Generic Classes Frustratingly, it is _impossible_ for generic parameters to be referenced in base class expressions. No matter what, you will eventually run into `Base class expressions cannot reference class type parameters.` The way to get around this is to leverage [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html), and a slightly different mixing function from ts-mixer: `mix`. It works exactly like `Mixin`, except it's a decorator, which means it doesn't affect the type information of the class being decorated. See it in action below: ```typescript import { mix } from 'ts-mixer'; class Foo<T> { public fooMethod(input: T): T { return input; } } class Bar<T> { public barMethod(input: T): T { return input; } } interface FooBar<T1, T2> extends Foo<T1>, Bar<T2> { } @mix(Foo, Bar) class FooBar<T1, T2> { public fooBarMethod(input1: T1, input2: T2) { return [this.fooMethod(input1), this.barMethod(input2)]; } } ``` Key takeaways from this example: * `interface FooBar<T1, T2> extends Foo<T1>, Bar<T2> { }` makes sure `FooBar` has the typing we want, thanks to declaration merging * `@mix(Foo, Bar)` wires things up "on the JavaScript side", since the interface declaration has nothing to do with runtime behavior. * The reason we have to use the `mix` decorator is that the typing produced by `Mixin(Foo, Bar)` would conflict with the typing of the interface. `mix` has no effect "on the TypeScript side," thus avoiding type conflicts. ### Mixing with Decorators Popular libraries such as [class-validator](https://github.com/typestack/class-validator) and [TypeORM](https://github.com/typeorm/typeorm) use decorators to add functionality. Unfortunately, `ts-mixer` has no way of knowing what these libraries do with the decorators behind the scenes. So if you want these decorators to be "inherited" with classes you plan to mix, you first have to wrap them with a special `decorate` function exported by `ts-mixer`. Here's an example using `class-validator`: ```typescript import { IsBoolean, IsIn, validate } from 'class-validator'; import { Mixin, decorate } from 'ts-mixer'; class Disposable { @decorate(IsBoolean()) // instead of @IsBoolean() isDisposed: boolean = false; } class Statusable { @decorate(IsIn(['red', 'green'])) // instead of @IsIn(['red', 'green']) status: string = 'green'; } class ExtendedObject extends Mixin(Disposable, Statusable) {} const extendedObject = new ExtendedObject(); extendedObject.status = 'blue'; validate(extendedObject).then(errors => { console.log(errors); }); ``` ### Dealing with Constructors As mentioned in the [caveats section](#caveats), ES6 disallowed calling constructor functions without `new`. This means that the only way for `ts-mixer` to mix instance properties is to instantiate each base class separately, then copy the instance properties into a common object. The consequence of this is that constructors mixed by `ts-mixer` will _not_ receive the proper `this`. **This very well may not be an issue for you!** It only means that your constructors need to be "mostly pure" in terms of how they handle `this`. Specifically, your constructors cannot produce [side effects](https://en.wikipedia.org/wiki/Side_effect_%28computer_science%29) involving `this`, _other than adding properties to `this`_ (the most common side effect in JavaScript constructors). If you simply cannot eliminate `this` side effects from your constructor, there is a workaround available: `ts-mixer` will automatically forward constructor parameters to a predesignated init function (`settings.initFunction`) if it's present on the class. Unlike constructors, functions can be called with an arbitrary `this`, so this predesignated init function _will_ have the proper `this`. Here's a basic example: ```typescript import { Mixin, settings } from 'ts-mixer'; settings.initFunction = 'init'; class Person { public static allPeople: Set<Person> = new Set(); protected init() { Person.allPeople.add(this); } } type PartyAffiliation = 'democrat' | 'republican'; class PoliticalParticipant { public static democrats: Set<PoliticalParticipant> = new Set(); public static republicans: Set<PoliticalParticipant> = new Set(); public party: PartyAffiliation; // note that these same args will also be passed to init function public constructor(party: PartyAffiliation) { this.party = party; } protected init(party: PartyAffiliation) { if (party === 'democrat') PoliticalParticipant.democrats.add(this); else PoliticalParticipant.republicans.add(this); } } class Voter extends Mixin(Person, PoliticalParticipant) {} const v1 = new Voter('democrat'); const v2 = new Voter('democrat'); const v3 = new Voter('republican'); const v4 = new Voter('republican'); ``` Note the above `.add(this)` statements. These would not work as expected if they were placed in the constructor instead, since `this` is not the same between the constructor and `init`, as explained above. ## Other Features ### hasMixin As mentioned above, `ts-mixer` does not support `instanceof` for mixins. While it is possible to implement [custom `instanceof` behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance), this library does not do so because it would require modifying the source classes, which is deliberately avoided. You can fill this missing functionality with `hasMixin(instance, mixinClass)` instead. See the below example: ```typescript import { Mixin, hasMixin } from 'ts-mixer'; class Foo {} class Bar {} class FooBar extends Mixin(Foo, Bar) {} const instance = new FooBar(); // doesn't work with instanceof... console.log(instance instanceof FooBar) // true console.log(instance instanceof Foo) // false console.log(instance instanceof Bar) // false // but everything works nicely with hasMixin! console.log(hasMixin(instance, FooBar)) // true console.log(hasMixin(instance, Foo)) // true console.log(hasMixin(instance, Bar)) // true ``` `hasMixin(instance, mixinClass)` will work anywhere that `instance instanceof mixinClass` works. Additionally, like `instanceof`, you get the same [type narrowing benefits](https://www.typescriptlang.org/docs/handbook/advanced-types.html#instanceof-type-guards): ```typescript if (hasMixin(instance, Foo)) { // inferred type of instance is "Foo" } if (hasMixin(instance, Bar)) { // inferred type of instance of "Bar" } ``` ## Settings ts-mixer has multiple strategies for mixing classes which can be configured by modifying `settings` from ts-mixer. For example: ```typescript import { settings, Mixin } from 'ts-mixer'; settings.prototypeStrategy = 'proxy'; // then use `Mixin` as normal... ``` ### `settings.prototypeStrategy` * Determines how ts-mixer will mix class prototypes together * Possible values: - `'copy'` (default) - Copies all methods from the classes being mixed into a new prototype object. (This will include all methods up the prototype chains as well.) This is the default for ES5 compatibility, but it has the downside of stale references. For example, if you mix `Foo` and `Bar` to make `FooBar`, then redefine a method on `Foo`, `FooBar` will not have the latest methods from `Foo`. If this is not a concern for you, `'copy'` is the best value for this setting. - `'proxy'` - Uses an ES6 Proxy to "soft mix" prototypes. Unlike `'copy'`, updates to the base classes _will_ be reflected in the mixed class, which may be desirable. The downside is that method access is not as performant, nor is it ES5 compatible. ### `settings.staticsStrategy` * Determines how static properties are inherited * Possible values: - `'copy'` (default) - Simply copies all properties (minus `prototype`) from the base classes/constructor functions onto the mixed class. Like `settings.prototypeStrategy = 'copy'`, this strategy also suffers from stale references, but shouldn't be a concern if you don't redefine static methods after mixing. - `'proxy'` - Similar to `settings.prototypeStrategy`, proxy's static method access to base classes. Has the same benefits/downsides. ### `settings.initFunction` * If set, `ts-mixer` will automatically call the function with this name upon construction * Possible values: - `null` (default) - disables the behavior - a string - function name to call upon construction * Read more about why you would want this in [dealing with constructors](#dealing-with-constructors) ### `settings.decoratorInheritance` * Determines how decorators are inherited from classes passed to `Mixin(...)` * Possible values: - `'deep'` (default) - Deeply inherits decorators from all given classes and their ancestors - `'direct'` - Only inherits decorators defined directly on the given classes - `'none'` - Skips decorator inheritance # Author Tanner Nielsen <tannerntannern@gmail.com> * Website - [tannernielsen.com](http://tannernielsen.com) * Github - [tannerntannern](https://github.com/tannerntannern) # lodash.truncate v4.4.2 The [lodash](https://lodash.com/) method `_.truncate` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.truncate ``` In Node.js: ```js var truncate = require('lodash.truncate'); ``` See the [documentation](https://lodash.com/docs#truncate) or [package source](https://github.com/lodash/lodash/blob/4.4.2-npm-packages/lodash.truncate) for more details. # Glob Match files using the patterns the shell uses, like stars and stuff. [![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) This is a glob implementation in JavaScript. It uses the `minimatch` library to do its matching. ![a fun cartoon logo made of glob characters](logo/glob.png) ## Usage Install with npm ``` npm i glob ``` ```javascript var glob = require("glob") // options is optional glob("**/*.js", options, function (er, files) { // files is an array of filenames. // If the `nonull` option is set, and nothing // was found, then files is ["**/*.js"] // er is an error object or null. }) ``` ## Glob Primer "Globs" are the patterns you type when you do stuff like `ls *.js` on the command line, or put `build/*` in a `.gitignore` file. Before parsing the path part patterns, braced sections are expanded into a set. Braced sections start with `{` and end with `}`, with any number of comma-delimited sections within. Braced sections may contain slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. The following characters have special magic meaning when used in a path portion: * `*` Matches 0 or more characters in a single path portion * `?` Matches 1 character * `[...]` Matches a range of characters, similar to a RegExp range. If the first character of the range is `!` or `^` then it matches any character not in the range. * `!(pattern|pattern|pattern)` Matches anything that does not match any of the patterns provided. * `?(pattern|pattern|pattern)` Matches zero or one occurrence of the patterns provided. * `+(pattern|pattern|pattern)` Matches one or more occurrences of the patterns provided. * `*(a|b|c)` Matches zero or more occurrences of the patterns provided * `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns provided * `**` If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches. It does not crawl symlinked directories. ### Dots If a file or directory path portion has a `.` as the first character, then it will not match any glob pattern unless that pattern's corresponding path part also has a `.` as its first character. For example, the pattern `a/.*/c` would match the file at `a/.b/c`. However the pattern `a/*/c` would not, because `*` does not start with a dot character. You can make glob treat dots as normal characters by setting `dot:true` in the options. ### Basename Matching If you set `matchBase:true` in the options, and the pattern has no slashes in it, then it will seek for any file anywhere in the tree with a matching basename. For example, `*.js` would match `test/simple/basic.js`. ### Empty Sets If no matching files are found, then an empty array is returned. This differs from the shell, where the pattern itself is returned. For example: $ echo a*s*d*f a*s*d*f To get the bash-style behavior, set the `nonull:true` in the options. ### See Also: * `man sh` * `man bash` (Search for "Pattern Matching") * `man 3 fnmatch` * `man 5 gitignore` * [minimatch documentation](https://github.com/isaacs/minimatch) ## glob.hasMagic(pattern, [options]) Returns `true` if there are any special characters in the pattern, and `false` otherwise. Note that the options affect the results. If `noext:true` is set in the options object, then `+(a|b)` will not be considered a magic pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` then that is considered magical, unless `nobrace:true` is set in the options. ## glob(pattern, [options], cb) * `pattern` `{String}` Pattern to be matched * `options` `{Object}` * `cb` `{Function}` * `err` `{Error | null}` * `matches` `{Array<String>}` filenames found matching the pattern Perform an asynchronous glob search. ## glob.sync(pattern, [options]) * `pattern` `{String}` Pattern to be matched * `options` `{Object}` * return: `{Array<String>}` filenames found matching the pattern Perform a synchronous glob search. ## Class: glob.Glob Create a Glob object by instantiating the `glob.Glob` class. ```javascript var Glob = require("glob").Glob var mg = new Glob(pattern, options, cb) ``` It's an EventEmitter, and starts walking the filesystem to find matches immediately. ### new glob.Glob(pattern, [options], [cb]) * `pattern` `{String}` pattern to search for * `options` `{Object}` * `cb` `{Function}` Called when an error occurs, or matches are found * `err` `{Error | null}` * `matches` `{Array<String>}` filenames found matching the pattern Note that if the `sync` flag is set in the options, then matches will be immediately available on the `g.found` member. ### Properties * `minimatch` The minimatch object that the glob uses. * `options` The options object passed in. * `aborted` Boolean which is set to true when calling `abort()`. There is no way at this time to continue a glob search after aborting, but you can re-use the statCache to avoid having to duplicate syscalls. * `cache` Convenience object. Each field has the following possible values: * `false` - Path does not exist * `true` - Path exists * `'FILE'` - Path exists, and is not a directory * `'DIR'` - Path exists, and is a directory * `[file, entries, ...]` - Path exists, is a directory, and the array value is the results of `fs.readdir` * `statCache` Cache of `fs.stat` results, to prevent statting the same path multiple times. * `symlinks` A record of which paths are symbolic links, which is relevant in resolving `**` patterns. * `realpathCache` An optional object which is passed to `fs.realpath` to minimize unnecessary syscalls. It is stored on the instantiated Glob object, and may be re-used. ### Events * `end` When the matching is finished, this is emitted with all the matches found. If the `nonull` option is set, and no match was found, then the `matches` list contains the original pattern. The matches are sorted, unless the `nosort` flag is set. * `match` Every time a match is found, this is emitted with the specific thing that matched. It is not deduplicated or resolved to a realpath. * `error` Emitted when an unexpected error is encountered, or whenever any fs error occurs if `options.strict` is set. * `abort` When `abort()` is called, this event is raised. ### Methods * `pause` Temporarily stop the search * `resume` Resume the search * `abort` Stop the search forever ### Options All the options that can be passed to Minimatch can also be passed to Glob to change pattern matching behavior. Also, some have been added, or have glob-specific ramifications. All options are false by default, unless otherwise noted. All options are added to the Glob object, as well. If you are running many `glob` operations, you can pass a Glob object as the `options` argument to a subsequent operation to shortcut some `stat` and `readdir` calls. At the very least, you may pass in shared `symlinks`, `statCache`, `realpathCache`, and `cache` options, so that parallel glob operations will be sped up by sharing information about the filesystem. * `cwd` The current working directory in which to search. Defaults to `process.cwd()`. * `root` The place where patterns starting with `/` will be mounted onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix systems, and `C:\` or some such on Windows.) * `dot` Include `.dot` files in normal matches and `globstar` matches. Note that an explicit dot in a portion of the pattern will always match dot files. * `nomount` By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid filesystem path is returned. Set this flag to disable that behavior. * `mark` Add a `/` character to directory matches. Note that this requires additional stat calls. * `nosort` Don't sort the results. * `stat` Set to true to stat *all* results. This reduces performance somewhat, and is completely unnecessary, unless `readdir` is presumed to be an untrustworthy indicator of file existence. * `silent` When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. Set the `silent` option to true to suppress these warnings. * `strict` When an unusual error is encountered when attempting to read a directory, the process will just continue on in search of other matches. Set the `strict` option to raise an error in these cases. * `cache` See `cache` property above. Pass in a previously generated cache object to save some fs calls. * `statCache` A cache of results of filesystem information, to prevent unnecessary stat calls. While it should not normally be necessary to set this, you may pass the statCache from one glob() call to the options object of another, if you know that the filesystem will not change between calls. (See "Race Conditions" below.) * `symlinks` A cache of known symbolic links. You may pass in a previously generated `symlinks` object to save `lstat` calls when resolving `**` matches. * `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. * `nounique` In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set. By default, this implementation prevents duplicates in the result set. Set this flag to disable that behavior. * `nonull` Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3). * `debug` Set to enable debug logging in minimatch and glob. * `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. * `noglobstar` Do not match `**` against multiple filenames. (Ie, treat it as a normal `*` instead.) * `noext` Do not match `+(a|b)` "extglob" patterns. * `nocase` Perform a case-insensitive match. Note: on case-insensitive filesystems, non-magic patterns will match by default, since `stat` and `readdir` will not raise errors. * `matchBase` Perform a basename-only match if the pattern does not contain any slash characters. That is, `*.js` would be treated as equivalent to `**/*.js`, matching all js files in all directories. * `nodir` Do not match directories, only files. (Note: to match *only* directories, simply put a `/` at the end of the pattern.) * `ignore` Add a pattern or an array of glob patterns to exclude matches. Note: `ignore` patterns are *always* in `dot:true` mode, regardless of any other settings. * `follow` Follow symlinked directories when expanding `**` patterns. Note that this can result in a lot of duplicate references in the presence of cyclic links. * `realpath` Set to true to call `fs.realpath` on all of the results. In the case of a symlink that cannot be resolved, the full absolute path to the matched entry is returned (though it will usually be a broken symlink) * `absolute` Set to true to always receive absolute paths for matched files. Unlike `realpath`, this also affects the values returned in the `match` event. * `fs` File-system object with Node's `fs` API. By default, the built-in `fs` module will be used. Set to a volume provided by a library like `memfs` to avoid using the "real" file-system. ## Comparisons to other fnmatch/glob implementations While strict compliance with the existing standards is a worthwhile goal, some discrepancies exist between node-glob and other implementations, and are intentional. The double-star character `**` is supported by default, unless the `noglobstar` flag is set. This is supported in the manner of bsdglob and bash 4.3, where `**` only has special significance if it is the only thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but `a/**b` will not. Note that symlinked directories are not crawled as part of a `**`, though their contents may match against subsequent portions of the pattern. This prevents infinite loops and duplicates and the like. If an escaped pattern has no matches, and the `nonull` flag is set, then glob returns the pattern as-provided, rather than interpreting the character escapes. For example, `glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than `"*a?"`. This is akin to setting the `nullglob` option in bash, except that it does not resolve escaped pattern characters. If brace expansion is not disabled, then it is performed before any other interpretation of the glob pattern. Thus, a pattern like `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are checked for validity. Since those two are valid, matching proceeds. ### Comments and Negation Previously, this module let you mark a pattern as a "comment" if it started with a `#` character, or a "negated" pattern if it started with a `!` character. These options were deprecated in version 5, and removed in version 6. To specify things that should not match, use the `ignore` option. ## Windows **Please only use forward-slashes in glob expressions.** Though windows uses either `/` or `\` as its path separator, only `/` characters are used by this glob implementation. You must use forward-slashes **only** in glob expressions. Back-slashes will always be interpreted as escape characters, not path separators. Results from absolute patterns such as `/foo/*` are mounted onto the root setting using `path.join`. On windows, this will by default result in `/foo/*` matching `C:\foo\bar.txt`. ## Race Conditions Glob searching, by its very nature, is susceptible to race conditions, since it relies on directory walking and such. As a result, it is possible that a file that exists when glob looks for it may have been deleted or modified by the time it returns the result. As part of its internal implementation, this program caches all stat and readdir calls that it makes, in order to cut down on system overhead. However, this also makes it even more susceptible to races, especially if the cache or statCache objects are reused between glob calls. Users are thus advised not to use a glob result as a guarantee of filesystem state in the face of rapid changes. For the vast majority of operations, this is never a problem. ## Glob Logo Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). ## Contributing Any change to behavior (including bugfixes) must come with a test. Patches that fail tests or reduce performance will be rejected. ``` # to run tests npm test # to re-generate test fixtures npm run test-regen # to benchmark against bash/zsh npm run bench # to profile javascript npm run prof ``` ![](oh-my-glob.gif) # fast-json-stable-stringify Deterministic `JSON.stringify()` - a faster version of [@substack](https://github.com/substack)'s json-stable-strigify without [jsonify](https://github.com/substack/jsonify). You can also pass in a custom comparison function. [![Build Status](https://travis-ci.org/epoberezkin/fast-json-stable-stringify.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-json-stable-stringify) [![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-json-stable-stringify/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-json-stable-stringify?branch=master) # example ``` js var stringify = require('fast-json-stable-stringify'); var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; console.log(stringify(obj)); ``` output: ``` {"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} ``` # methods ``` js var stringify = require('fast-json-stable-stringify') ``` ## var str = stringify(obj, opts) Return a deterministic stringified string `str` from the object `obj`. ## options ### cmp If `opts` is given, you can supply an `opts.cmp` to have a custom comparison function for object keys. Your function `opts.cmp` is called with these parameters: ``` js opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) ``` For example, to sort on the object key names in reverse order you could write: ``` js var stringify = require('fast-json-stable-stringify'); var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; var s = stringify(obj, function (a, b) { return a.key < b.key ? 1 : -1; }); console.log(s); ``` which results in the output string: ``` {"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} ``` Or if you wanted to sort on the object values in reverse order, you could write: ``` var stringify = require('fast-json-stable-stringify'); var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; var s = stringify(obj, function (a, b) { return a.value < b.value ? 1 : -1; }); console.log(s); ``` which outputs: ``` {"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} ``` ### cycles Pass `true` in `opts.cycles` to stringify circular property as `__cycle__` - the result will not be a valid JSON string in this case. TypeError will be thrown in case of circular object without this option. # install With [npm](https://npmjs.org) do: ``` npm install fast-json-stable-stringify ``` # benchmark To run benchmark (requires Node.js 6+): ``` node benchmark ``` Results: ``` fast-json-stable-stringify x 17,189 ops/sec ±1.43% (83 runs sampled) json-stable-stringify x 13,634 ops/sec ±1.39% (85 runs sampled) fast-stable-stringify x 20,212 ops/sec ±1.20% (84 runs sampled) faster-stable-stringify x 15,549 ops/sec ±1.12% (84 runs sampled) The fastest is fast-stable-stringify ``` ## Enterprise support fast-json-stable-stringify package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-json-stable-stringify?utm_source=npm-fast-json-stable-stringify&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. ## Security contact To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. # license [MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE) # axios // adapters The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. ## Example ```js var settle = require('./../core/settle'); module.exports = function myAdapter(config) { // At this point: // - config has been merged with defaults // - request transformers have already run // - request interceptors have already run // Make the request using config provided // Upon response settle the Promise return new Promise(function(resolve, reject) { var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(resolve, reject, response); // From here: // - response transformers will run // - response interceptors will run }); } ``` # line-column [![Build Status](https://travis-ci.org/io-monad/line-column.svg?branch=master)](https://travis-ci.org/io-monad/line-column) [![Coverage Status](https://coveralls.io/repos/github/io-monad/line-column/badge.svg?branch=master)](https://coveralls.io/github/io-monad/line-column?branch=master) [![npm version](https://badge.fury.io/js/line-column.svg)](https://badge.fury.io/js/line-column) Node module to convert efficiently index to/from line-column in a string. ## Install npm install line-column ## Usage ### lineColumn(str, options = {}) Returns a `LineColumnFinder` instance for given string `str`. #### Options | Key | Description | Default | | ------- | ----------- | ------- | | `origin` | The origin value of line number and column number | `1` | ### lineColumn(str, index) This is just a shorthand for `lineColumn(str).fromIndex(index)`. ### LineColumnFinder#fromIndex(index) Find line and column from index in the string. Parameters: - `index` - `number` Index in the string. (0-origin) Returns: - `{ line: x, col: y }` Found line number and column number. - `null` if the given index is out of range. ### LineColumnFinder#toIndex(line, column) Find index from line and column in the string. Parameters: - `line` - `number` Line number in the string. - `column` - `number` Column number in the string. or - `{ line: x, col: y }` - `Object` line and column numbers in the string.<br>A key name `column` can be used instead of `col`. or - `[ line, col ]` - `Array` line and column numbers in the string. Returns: - `number` Found index in the string. - `-1` if the given line or column is out of range. ## Example ```js var lineColumn = require("line-column"); var testString = [ "ABCDEFG\n", // line:0, index:0 "HIJKLMNOPQRSTU\n", // line:1, index:8 "VWXYZ\n", // line:2, index:23 "日本語の文字\n", // line:3, index:29 "English words" // line:4, index:36 ].join(""); // length:49 lineColumn(testString).fromIndex(3) // { line: 1, col: 4 } lineColumn(testString).fromIndex(33) // { line: 4, col: 5 } lineColumn(testString).toIndex(1, 4) // 3 lineColumn(testString).toIndex(4, 5) // 33 // Shorthand of .fromIndex (compatible with find-line-column) lineColumn(testString, 33) // { line:4, col: 5 } // Object or Array is also acceptable lineColumn(testString).toIndex({ line: 4, col: 5 }) // 33 lineColumn(testString).toIndex({ line: 4, column: 5 }) // 33 lineColumn(testString).toIndex([4, 5]) // 33 // You can cache it for the same string. It is so efficient. (See benchmark) var finder = lineColumn(testString); finder.fromIndex(33) // { line: 4, column: 5 } finder.toIndex(4, 5) // 33 // For 0-origin line and column numbers var oneOrigin = lineColumn(testString, { origin: 0 }); oneOrigin.fromIndex(33) // { line: 3, column: 4 } oneOrigin.toIndex(3, 4) // 33 ``` ## Testing npm test ## Benchmark The popular package [find-line-column](https://www.npmjs.com/package/find-line-column) provides the same "index to line-column" feature. Here is some benchmarking on `line-column` vs `find-line-column`. You can run this benchmark by `npm run benchmark`. See [benchmark/](benchmark/) for the source code. ``` long text + line-column (not cached) x 72,989 ops/sec ±0.83% (89 runs sampled) long text + line-column (cached) x 13,074,242 ops/sec ±0.32% (89 runs sampled) long text + find-line-column x 33,887 ops/sec ±0.54% (84 runs sampled) short text + line-column (not cached) x 1,636,766 ops/sec ±0.77% (82 runs sampled) short text + line-column (cached) x 21,699,686 ops/sec ±1.04% (82 runs sampled) short text + find-line-column x 382,145 ops/sec ±1.04% (85 runs sampled) ``` As you might have noticed, even not cached version of `line-column` is 2x - 4x faster than `find-line-column`, and cached version of `line-column` is remarkable 50x - 380x faster. ## Contributing 1. Fork it! 2. Create your feature branch: `git checkout -b my-new-feature` 3. Commit your changes: `git commit -am 'Add some feature'` 4. Push to the branch: `git push origin my-new-feature` 5. Submit a pull request :D ## License MIT (See LICENSE) # AssemblyScript Rtrace A tiny utility to sanitize the AssemblyScript runtime. Records allocations and frees performed by the runtime and emits an error if something is off. Also checks for leaks. Instructions ------------ Compile your module that uses the full or half runtime with `-use ASC_RTRACE=1 --explicitStart` and include an instance of this module as the import named `rtrace`. ```js const rtrace = new Rtrace({ onerror(err, info) { // handle error }, oninfo(msg) { // print message, optional }, getMemory() { // obtain the module's memory, // e.g. with --explicitStart: return instance.exports.memory; } }); const { module, instance } = await WebAssembly.instantiate(..., rtrace.install({ ...imports... }) ); instance.exports._start(); ... if (rtrace.active) { let leakCount = rtr.check(); if (leakCount) { // handle error } } ``` Note that references in globals which are not cleared before collection is performed appear as leaks, including their inner members. A TypedArray would leak itself and its backing ArrayBuffer in this case for example. This is perfectly normal and clearing all globals avoids this. binaryen.js =========== **binaryen.js** is a port of [Binaryen](https://github.com/WebAssembly/binaryen) to the Web, allowing you to generate [WebAssembly](https://webassembly.org) using a JavaScript API. <a href="https://github.com/AssemblyScript/binaryen.js/actions?query=workflow%3ABuild"><img src="https://img.shields.io/github/workflow/status/AssemblyScript/binaryen.js/Build/master?label=build&logo=github" alt="Build status" /></a> <a href="https://www.npmjs.com/package/binaryen"><img src="https://img.shields.io/npm/v/binaryen.svg?label=latest&color=007acc&logo=npm" alt="npm version" /></a> <a href="https://www.npmjs.com/package/binaryen"><img src="https://img.shields.io/npm/v/binaryen/nightly.svg?label=nightly&color=007acc&logo=npm" alt="npm nightly version" /></a> Usage ----- ``` $> npm install binaryen ``` ```js var binaryen = require("binaryen"); // Create a module with a single function var myModule = new binaryen.Module(); myModule.addFunction("add", binaryen.createType([ binaryen.i32, binaryen.i32 ]), binaryen.i32, [ binaryen.i32 ], myModule.block(null, [ myModule.local.set(2, myModule.i32.add( myModule.local.get(0, binaryen.i32), myModule.local.get(1, binaryen.i32) ) ), myModule.return( myModule.local.get(2, binaryen.i32) ) ]) ); myModule.addFunctionExport("add", "add"); // Optimize the module using default passes and levels myModule.optimize(); // Validate the module if (!myModule.validate()) throw new Error("validation error"); // Generate text format and binary var textData = myModule.emitText(); var wasmData = myModule.emitBinary(); // Example usage with the WebAssembly API var compiled = new WebAssembly.Module(wasmData); var instance = new WebAssembly.Instance(compiled, {}); console.log(instance.exports.add(41, 1)); ``` The buildbot also publishes nightly versions once a day if there have been changes. The latest nightly can be installed through ``` $> npm install binaryen@nightly ``` or you can use one of the [previous versions](https://github.com/AssemblyScript/binaryen.js/tags) instead if necessary. ### Usage with a CDN * From GitHub via [jsDelivr](https://www.jsdelivr.com):<br /> `https://cdn.jsdelivr.net/gh/AssemblyScript/binaryen.js@VERSION/index.js` * From npm via [jsDelivr](https://www.jsdelivr.com):<br /> `https://cdn.jsdelivr.net/npm/binaryen@VERSION/index.js` * From npm via [unpkg](https://unpkg.com):<br /> `https://unpkg.com/binaryen@VERSION/index.js` Replace `VERSION` with a [specific version](https://github.com/AssemblyScript/binaryen.js/releases) or omit it (not recommended in production) to use master/latest. API --- **Please note** that the Binaryen API is evolving fast and that definitions and documentation provided by the package tend to get out of sync despite our best efforts. It's a bot after all. If you rely on binaryen.js and spot an issue, please consider sending a PR our way by updating [index.d.ts](./index.d.ts) and [README.md](./README.md) to reflect the [current API](https://github.com/WebAssembly/binaryen/blob/master/src/js/binaryen.js-post.js). <!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> ### Contents - [Types](#types) - [Module construction](#module-construction) - [Module manipulation](#module-manipulation) - [Module validation](#module-validation) - [Module optimization](#module-optimization) - [Module creation](#module-creation) - [Expression construction](#expression-construction) - [Control flow](#control-flow) - [Variable accesses](#variable-accesses) - [Integer operations](#integer-operations) - [Floating point operations](#floating-point-operations) - [Datatype conversions](#datatype-conversions) - [Function calls](#function-calls) - [Linear memory accesses](#linear-memory-accesses) - [Host operations](#host-operations) - [Vector operations 🦄](#vector-operations-) - [Atomic memory accesses 🦄](#atomic-memory-accesses-) - [Atomic read-modify-write operations 🦄](#atomic-read-modify-write-operations-) - [Atomic wait and notify operations 🦄](#atomic-wait-and-notify-operations-) - [Sign extension operations 🦄](#sign-extension-operations-) - [Multi-value operations 🦄](#multi-value-operations-) - [Exception handling operations 🦄](#exception-handling-operations-) - [Reference types operations 🦄](#reference-types-operations-) - [Expression manipulation](#expression-manipulation) - [Relooper](#relooper) - [Source maps](#source-maps) - [Debugging](#debugging) <!-- END doctoc generated TOC please keep comment here to allow auto update --> [Future features](http://webassembly.org/docs/future-features/) 🦄 might not be supported by all runtimes. ### Types * **none**: `Type`<br /> The none type, e.g., `void`. * **i32**: `Type`<br /> 32-bit integer type. * **i64**: `Type`<br /> 64-bit integer type. * **f32**: `Type`<br /> 32-bit float type. * **f64**: `Type`<br /> 64-bit float (double) type. * **v128**: `Type`<br /> 128-bit vector type. 🦄 * **funcref**: `Type`<br /> A function reference. 🦄 * **anyref**: `Type`<br /> Any host reference. 🦄 * **nullref**: `Type`<br /> A null reference. 🦄 * **exnref**: `Type`<br /> An exception reference. 🦄 * **unreachable**: `Type`<br /> Special type indicating unreachable code when obtaining information about an expression. * **auto**: `Type`<br /> Special type used in **Module#block** exclusively. Lets the API figure out a block's result type automatically. * **createType**(types: `Type[]`): `Type`<br /> Creates a multi-value type from an array of types. * **expandType**(type: `Type`): `Type[]`<br /> Expands a multi-value type to an array of types. ### Module construction * new **Module**()<br /> Constructs a new module. * **parseText**(text: `string`): `Module`<br /> Creates a module from Binaryen's s-expression text format (not official stack-style text format). * **readBinary**(data: `Uint8Array`): `Module`<br /> Creates a module from binary data. ### Module manipulation * Module#**addFunction**(name: `string`, params: `Type`, results: `Type`, vars: `Type[]`, body: `ExpressionRef`): `FunctionRef`<br /> Adds a function. `vars` indicate additional locals, in the given order. * Module#**getFunction**(name: `string`): `FunctionRef`<br /> Gets a function, by name, * Module#**removeFunction**(name: `string`): `void`<br /> Removes a function, by name. * Module#**getNumFunctions**(): `number`<br /> Gets the number of functions within the module. * Module#**getFunctionByIndex**(index: `number`): `FunctionRef`<br /> Gets the function at the specified index. * Module#**addFunctionImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, params: `Type`, results: `Type`): `void`<br /> Adds a function import. * Module#**addTableImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`): `void`<br /> Adds a table import. There's just one table for now, using name `"0"`. * Module#**addMemoryImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`): `void`<br /> Adds a memory import. There's just one memory for now, using name `"0"`. * Module#**addGlobalImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, globalType: `Type`): `void`<br /> Adds a global variable import. Imported globals must be immutable. * Module#**addFunctionExport**(internalName: `string`, externalName: `string`): `ExportRef`<br /> Adds a function export. * Module#**addTableExport**(internalName: `string`, externalName: `string`): `ExportRef`<br /> Adds a table export. There's just one table for now, using name `"0"`. * Module#**addMemoryExport**(internalName: `string`, externalName: `string`): `ExportRef`<br /> Adds a memory export. There's just one memory for now, using name `"0"`. * Module#**addGlobalExport**(internalName: `string`, externalName: `string`): `ExportRef`<br /> Adds a global variable export. Exported globals must be immutable. * Module#**getNumExports**(): `number`<br /> Gets the number of exports witin the module. * Module#**getExportByIndex**(index: `number`): `ExportRef`<br /> Gets the export at the specified index. * Module#**removeExport**(externalName: `string`): `void`<br /> Removes an export, by external name. * Module#**addGlobal**(name: `string`, type: `Type`, mutable: `number`, value: `ExpressionRef`): `GlobalRef`<br /> Adds a global instance variable. * Module#**getGlobal**(name: `string`): `GlobalRef`<br /> Gets a global, by name, * Module#**removeGlobal**(name: `string`): `void`<br /> Removes a global, by name. * Module#**setFunctionTable**(initial: `number`, maximum: `number`, funcs: `string[]`, offset?: `ExpressionRef`): `void`<br /> Sets the contents of the function table. There's just one table for now, using name `"0"`. * Module#**getFunctionTable**(): `{ imported: boolean, segments: TableElement[] }`<br /> Gets the contents of the function table. * TableElement#**offset**: `ExpressionRef` * TableElement#**names**: `string[]` * Module#**setMemory**(initial: `number`, maximum: `number`, exportName: `string | null`, segments: `MemorySegment[]`, flags?: `number[]`, shared?: `boolean`): `void`<br /> Sets the memory. There's just one memory for now, using name `"0"`. Providing `exportName` also creates a memory export. * MemorySegment#**offset**: `ExpressionRef` * MemorySegment#**data**: `Uint8Array` * MemorySegment#**passive**: `boolean` * Module#**getNumMemorySegments**(): `number`<br /> Gets the number of memory segments within the module. * Module#**getMemorySegmentInfoByIndex**(index: `number`): `MemorySegmentInfo`<br /> Gets information about the memory segment at the specified index. * MemorySegmentInfo#**offset**: `number` * MemorySegmentInfo#**data**: `Uint8Array` * MemorySegmentInfo#**passive**: `boolean` * Module#**setStart**(start: `FunctionRef`): `void`<br /> Sets the start function. * Module#**getFeatures**(): `Features`<br /> Gets the WebAssembly features enabled for this module. Note that the return value may be a bitmask indicating multiple features. Possible feature flags are: * Features.**MVP**: `Features` * Features.**Atomics**: `Features` * Features.**BulkMemory**: `Features` * Features.**MutableGlobals**: `Features` * Features.**NontrappingFPToInt**: `Features` * Features.**SignExt**: `Features` * Features.**SIMD128**: `Features` * Features.**ExceptionHandling**: `Features` * Features.**TailCall**: `Features` * Features.**ReferenceTypes**: `Features` * Features.**Multivalue**: `Features` * Features.**All**: `Features` * Module#**setFeatures**(features: `Features`): `void`<br /> Sets the WebAssembly features enabled for this module. * Module#**addCustomSection**(name: `string`, contents: `Uint8Array`): `void`<br /> Adds a custom section to the binary. * Module#**autoDrop**(): `void`<br /> Enables automatic insertion of `drop` operations where needed. Lets you not worry about dropping when creating your code. * **getFunctionInfo**(ftype: `FunctionRef`: `FunctionInfo`<br /> Obtains information about a function. * FunctionInfo#**name**: `string` * FunctionInfo#**module**: `string | null` (if imported) * FunctionInfo#**base**: `string | null` (if imported) * FunctionInfo#**params**: `Type` * FunctionInfo#**results**: `Type` * FunctionInfo#**vars**: `Type` * FunctionInfo#**body**: `ExpressionRef` * **getGlobalInfo**(global: `GlobalRef`): `GlobalInfo`<br /> Obtains information about a global. * GlobalInfo#**name**: `string` * GlobalInfo#**module**: `string | null` (if imported) * GlobalInfo#**base**: `string | null` (if imported) * GlobalInfo#**type**: `Type` * GlobalInfo#**mutable**: `boolean` * GlobalInfo#**init**: `ExpressionRef` * **getExportInfo**(export_: `ExportRef`): `ExportInfo`<br /> Obtains information about an export. * ExportInfo#**kind**: `ExternalKind` * ExportInfo#**name**: `string` * ExportInfo#**value**: `string` Possible `ExternalKind` values are: * **ExternalFunction**: `ExternalKind` * **ExternalTable**: `ExternalKind` * **ExternalMemory**: `ExternalKind` * **ExternalGlobal**: `ExternalKind` * **ExternalEvent**: `ExternalKind` * **getEventInfo**(event: `EventRef`): `EventInfo`<br /> Obtains information about an event. * EventInfo#**name**: `string` * EventInfo#**module**: `string | null` (if imported) * EventInfo#**base**: `string | null` (if imported) * EventInfo#**attribute**: `number` * EventInfo#**params**: `Type` * EventInfo#**results**: `Type` * **getSideEffects**(expr: `ExpressionRef`, features: `FeatureFlags`): `SideEffects`<br /> Gets the side effects of the specified expression. * SideEffects.**None**: `SideEffects` * SideEffects.**Branches**: `SideEffects` * SideEffects.**Calls**: `SideEffects` * SideEffects.**ReadsLocal**: `SideEffects` * SideEffects.**WritesLocal**: `SideEffects` * SideEffects.**ReadsGlobal**: `SideEffects` * SideEffects.**WritesGlobal**: `SideEffects` * SideEffects.**ReadsMemory**: `SideEffects` * SideEffects.**WritesMemory**: `SideEffects` * SideEffects.**ImplicitTrap**: `SideEffects` * SideEffects.**IsAtomic**: `SideEffects` * SideEffects.**Throws**: `SideEffects` * SideEffects.**Any**: `SideEffects` ### Module validation * Module#**validate**(): `boolean`<br /> Validates the module. Returns `true` if valid, otherwise prints validation errors and returns `false`. ### Module optimization * Module#**optimize**(): `void`<br /> Optimizes the module using the default optimization passes. * Module#**optimizeFunction**(func: `FunctionRef | string`): `void`<br /> Optimizes a single function using the default optimization passes. * Module#**runPasses**(passes: `string[]`): `void`<br /> Runs the specified passes on the module. * Module#**runPassesOnFunction**(func: `FunctionRef | string`, passes: `string[]`): `void`<br /> Runs the specified passes on a single function. * **getOptimizeLevel**(): `number`<br /> Gets the currently set optimize level. `0`, `1`, `2` correspond to `-O0`, `-O1`, `-O2` (default), etc. * **setOptimizeLevel**(level: `number`): `void`<br /> Sets the optimization level to use. `0`, `1`, `2` correspond to `-O0`, `-O1`, `-O2` (default), etc. * **getShrinkLevel**(): `number`<br /> Gets the currently set shrink level. `0`, `1`, `2` correspond to `-O0`, `-Os` (default), `-Oz`. * **setShrinkLevel**(level: `number`): `void`<br /> Sets the shrink level to use. `0`, `1`, `2` correspond to `-O0`, `-Os` (default), `-Oz`. * **getDebugInfo**(): `boolean`<br /> Gets whether generating debug information is currently enabled or not. * **setDebugInfo**(on: `boolean`): `void`<br /> Enables or disables debug information in emitted binaries. * **getLowMemoryUnused**(): `boolean`<br /> Gets whether the low 1K of memory can be considered unused when optimizing. * **setLowMemoryUnused**(on: `boolean`): `void`<br /> Enables or disables whether the low 1K of memory can be considered unused when optimizing. * **getPassArgument**(key: `string`): `string | null`<br /> Gets the value of the specified arbitrary pass argument. * **setPassArgument**(key: `string`, value: `string | null`): `void`<br /> Sets the value of the specified arbitrary pass argument. Removes the respective argument if `value` is `null`. * **clearPassArguments**(): `void`<br /> Clears all arbitrary pass arguments. * **getAlwaysInlineMaxSize**(): `number`<br /> Gets the function size at which we always inline. * **setAlwaysInlineMaxSize**(size: `number`): `void`<br /> Sets the function size at which we always inline. * **getFlexibleInlineMaxSize**(): `number`<br /> Gets the function size which we inline when functions are lightweight. * **setFlexibleInlineMaxSize**(size: `number`): `void`<br /> Sets the function size which we inline when functions are lightweight. * **getOneCallerInlineMaxSize**(): `number`<br /> Gets the function size which we inline when there is only one caller. * **setOneCallerInlineMaxSize**(size: `number`): `void`<br /> Sets the function size which we inline when there is only one caller. ### Module creation * Module#**emitBinary**(): `Uint8Array`<br /> Returns the module in binary format. * Module#**emitBinary**(sourceMapUrl: `string | null`): `BinaryWithSourceMap`<br /> Returns the module in binary format with its source map. If `sourceMapUrl` is `null`, source map generation is skipped. * BinaryWithSourceMap#**binary**: `Uint8Array` * BinaryWithSourceMap#**sourceMap**: `string | null` * Module#**emitText**(): `string`<br /> Returns the module in Binaryen's s-expression text format (not official stack-style text format). * Module#**emitAsmjs**(): `string`<br /> Returns the [asm.js](http://asmjs.org/) representation of the module. * Module#**dispose**(): `void`<br /> Releases the resources held by the module once it isn't needed anymore. ### Expression construction #### [Control flow](http://webassembly.org/docs/semantics/#control-constructs-and-instructions) * Module#**block**(label: `string | null`, children: `ExpressionRef[]`, resultType?: `Type`): `ExpressionRef`<br /> Creates a block. `resultType` defaults to `none`. * Module#**if**(condition: `ExpressionRef`, ifTrue: `ExpressionRef`, ifFalse?: `ExpressionRef`): `ExpressionRef`<br /> Creates an if or if/else combination. * Module#**loop**(label: `string | null`, body: `ExpressionRef`): `ExpressionRef`<br /> Creates a loop. * Module#**br**(label: `string`, condition?: `ExpressionRef`, value?: `ExpressionRef`): `ExpressionRef`<br /> Creates a branch (br) to a label. * Module#**switch**(labels: `string[]`, defaultLabel: `string`, condition: `ExpressionRef`, value?: `ExpressionRef`): `ExpressionRef`<br /> Creates a switch (br_table). * Module#**nop**(): `ExpressionRef`<br /> Creates a no-operation (nop) instruction. * Module#**return**(value?: `ExpressionRef`): `ExpressionRef` Creates a return. * Module#**unreachable**(): `ExpressionRef`<br /> Creates an [unreachable](http://webassembly.org/docs/semantics/#unreachable) instruction that will always trap. * Module#**drop**(value: `ExpressionRef`): `ExpressionRef`<br /> Creates a [drop](http://webassembly.org/docs/semantics/#type-parametric-operators) of a value. * Module#**select**(condition: `ExpressionRef`, ifTrue: `ExpressionRef`, ifFalse: `ExpressionRef`, type?: `Type`): `ExpressionRef`<br /> Creates a [select](http://webassembly.org/docs/semantics/#type-parametric-operators) of one of two values. #### [Variable accesses](http://webassembly.org/docs/semantics/#local-variables) * Module#**local.get**(index: `number`, type: `Type`): `ExpressionRef`<br /> Creates a local.get for the local at the specified index. Note that we must specify the type here as we may not have created the local being accessed yet. * Module#**local.set**(index: `number`, value: `ExpressionRef`): `ExpressionRef`<br /> Creates a local.set for the local at the specified index. * Module#**local.tee**(index: `number`, value: `ExpressionRef`, type: `Type`): `ExpressionRef`<br /> Creates a local.tee for the local at the specified index. A tee differs from a set in that the value remains on the stack. Note that we must specify the type here as we may not have created the local being accessed yet. * Module#**global.get**(name: `string`, type: `Type`): `ExpressionRef`<br /> Creates a global.get for the global with the specified name. Note that we must specify the type here as we may not have created the global being accessed yet. * Module#**global.set**(name: `string`, value: `ExpressionRef`): `ExpressionRef`<br /> Creates a global.set for the global with the specified name. #### [Integer operations](http://webassembly.org/docs/semantics/#32-bit-integer-operators) * Module#i32.**const**(value: `number`): `ExpressionRef` * Module#i32.**clz**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**ctz**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**popcnt**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**eqz**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**div_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**div_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**rem_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**rem_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**shl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**shr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**shr_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**rotl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**rotr**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**le_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` > * Module#i64.**const**(low: `number`, high: `number`): `ExpressionRef` * Module#i64.**clz**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**ctz**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**popcnt**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**eqz**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**div_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**div_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**rem_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**rem_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**shl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**shr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**shr_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**rotl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**rotr**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**le_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` #### [Floating point operations](http://webassembly.org/docs/semantics/#floating-point-operators) * Module#f32.**const**(value: `number`): `ExpressionRef` * Module#f32.**const_bits**(value: `number`): `ExpressionRef` * Module#f32.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**abs**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**ceil**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**floor**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**trunc**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**nearest**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**sqrt**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**copysign**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` > * Module#f64.**const**(value: `number`): `ExpressionRef` * Module#f64.**const_bits**(value: `number`): `ExpressionRef` * Module#f64.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**abs**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**ceil**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**floor**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**trunc**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**nearest**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**sqrt**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**copysign**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` #### [Datatype conversions](http://webassembly.org/docs/semantics/#datatype-conversions-truncations-reinterpretations-promotions-and-demotions) * Module#i32.**trunc_s.f32**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**trunc_s.f64**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**trunc_u.f32**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**trunc_u.f64**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**reinterpret**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**wrap**(value: `ExpressionRef`): `ExpressionRef` > * Module#i64.**trunc_s.f32**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**trunc_s.f64**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**trunc_u.f32**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**trunc_u.f64**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**reinterpret**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**extend_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**extend_u**(value: `ExpressionRef`): `ExpressionRef` > * Module#f32.**reinterpret**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**convert_s.i32**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**convert_s.i64**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**convert_u.i32**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**convert_u.i64**(value: `ExpressionRef`): `ExpressionRef` * Module#f32.**demote**(value: `ExpressionRef`): `ExpressionRef` > * Module#f64.**reinterpret**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**convert_s.i32**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**convert_s.i64**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**convert_u.i32**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**convert_u.i64**(value: `ExpressionRef`): `ExpressionRef` * Module#f64.**promote**(value: `ExpressionRef`): `ExpressionRef` #### [Function calls](http://webassembly.org/docs/semantics/#calls) * Module#**call**(name: `string`, operands: `ExpressionRef[]`, returnType: `Type`): `ExpressionRef` Creates a call to a function. Note that we must specify the return type here as we may not have created the function being called yet. * Module#**return_call**(name: `string`, operands: `ExpressionRef[]`, returnType: `Type`): `ExpressionRef`<br /> Like **call**, but creates a tail-call. 🦄 * Module#**call_indirect**(target: `ExpressionRef`, operands: `ExpressionRef[]`, params: `Type`, results: `Type`): `ExpressionRef`<br /> Similar to **call**, but calls indirectly, i.e., via a function pointer, so an expression replaces the name as the called value. * Module#**return_call_indirect**(target: `ExpressionRef`, operands: `ExpressionRef[]`, params: `Type`, results: `Type`): `ExpressionRef`<br /> Like **call_indirect**, but creates a tail-call. 🦄 #### [Linear memory accesses](http://webassembly.org/docs/semantics/#linear-memory-accesses) * Module#i32.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**load8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**load8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**load16_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**load16_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**store8**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br /> * Module#i32.**store16**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br /> > * Module#i64.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load16_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load16_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load32_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**load32_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**store8**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**store16**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**store32**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` > * Module#f32.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#f32.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` > * Module#f64.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#f64.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` #### [Host operations](http://webassembly.org/docs/semantics/#resizing) * Module#**memory.size**(): `ExpressionRef` * Module#**memory.grow**(value: `number`): `ExpressionRef` #### [Vector operations](https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md) 🦄 * Module#v128.**const**(bytes: `Uint8Array`): `ExpressionRef` * Module#v128.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#v128.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#v128.**not**(value: `ExpressionRef`): `ExpressionRef` * Module#v128.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v128.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v128.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v128.**andnot**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v128.**bitselect**(left: `ExpressionRef`, right: `ExpressionRef`, cond: `ExpressionRef`): `ExpressionRef` > * Module#i8x16.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i8x16.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i8x16.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**any_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**all_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**add_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**add_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**sub_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**sub_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**avgr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**narrow_i16x8_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i8x16.**narrow_i16x8_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` > * Module#i16x8.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i16x8.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i16x8.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**any_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**all_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**add_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**add_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**sub_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**sub_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**avgr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**narrow_i32x4_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**narrow_i32x4_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**widen_low_i8x16_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**widen_high_i8x16_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**widen_low_i8x16_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**widen_high_i8x16_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**load8x8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i16x8.**load8x8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#i32x4.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i32x4.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i32x4.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**any_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**all_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**dot_i16x8_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**trunc_sat_f32x4_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**trunc_sat_f32x4_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**widen_low_i16x8_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**widen_high_i16x8_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**widen_low_i16x8_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**widen_high_i16x8_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**load16x4_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i32x4.**load16x4_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#i64x2.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i64x2.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#i64x2.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**any_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**all_true**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**trunc_sat_f64x2_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**trunc_sat_f64x2_u**(value: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**load32x2_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64x2.**load32x2_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#f32x4.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**extract_lane**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#f32x4.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**abs**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**sqrt**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**qfma**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**qfms**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**convert_i32x4_s**(value: `ExpressionRef`): `ExpressionRef` * Module#f32x4.**convert_i32x4_u**(value: `ExpressionRef`): `ExpressionRef` > * Module#f64x2.**splat**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**extract_lane**(vec: `ExpressionRef`, index: `number`): `ExpressionRef` * Module#f64x2.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**abs**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**neg**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**sqrt**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**qfma**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**qfms**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**convert_i64x2_s**(value: `ExpressionRef`): `ExpressionRef` * Module#f64x2.**convert_i64x2_u**(value: `ExpressionRef`): `ExpressionRef` > * Module#v8x16.**shuffle**(left: `ExpressionRef`, right: `ExpressionRef`, mask: `Uint8Array`): `ExpressionRef` * Module#v8x16.**swizzle**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef` * Module#v8x16.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#v16x8.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#v32x4.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` > * Module#v64x2.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef` #### [Atomic memory accesses](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#atomic-memory-accesses) 🦄 * Module#i32.**atomic.load**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.load8_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.load16_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.store**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.store8**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.store16**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` > * Module#i64.**atomic.load**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.load8_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.load16_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.load32_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.store**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.store8**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.store16**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.store32**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` #### [Atomic read-modify-write operations](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#read-modify-write) 🦄 * Module#i32.**atomic.rmw.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw8_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i32.**atomic.rmw16_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` > * Module#i64.**atomic.rmw.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw8_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw16_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.rmw32_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef` #### [Atomic wait and notify operations](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-notify-operators) 🦄 * Module#i32.**atomic.wait**(ptr: `ExpressionRef`, expected: `ExpressionRef`, timeout: `ExpressionRef`): `ExpressionRef` * Module#i64.**atomic.wait**(ptr: `ExpressionRef`, expected: `ExpressionRef`, timeout: `ExpressionRef`): `ExpressionRef` * Module#**atomic.notify**(ptr: `ExpressionRef`, notifyCount: `ExpressionRef`): `ExpressionRef` * Module#**atomic.fence**(): `ExpressionRef` #### [Sign extension operations](https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md) 🦄 * Module#i32.**extend8_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**extend16_s**(value: `ExpressionRef`): `ExpressionRef` > * Module#i64.**extend8_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**extend16_s**(value: `ExpressionRef`): `ExpressionRef` * Module#i64.**extend32_s**(value: `ExpressionRef`): `ExpressionRef` #### [Multi-value operations](https://github.com/WebAssembly/multi-value/blob/master/proposals/multi-value/Overview.md) 🦄 Note that these are pseudo instructions enabling Binaryen to reason about multiple values on the stack. * Module#**push**(value: `ExpressionRef`): `ExpressionRef` * Module#i32.**pop**(): `ExpressionRef` * Module#i64.**pop**(): `ExpressionRef` * Module#f32.**pop**(): `ExpressionRef` * Module#f64.**pop**(): `ExpressionRef` * Module#v128.**pop**(): `ExpressionRef` * Module#funcref.**pop**(): `ExpressionRef` * Module#anyref.**pop**(): `ExpressionRef` * Module#nullref.**pop**(): `ExpressionRef` * Module#exnref.**pop**(): `ExpressionRef` * Module#tuple.**make**(elements: `ExpressionRef[]`): `ExpressionRef` * Module#tuple.**extract**(tuple: `ExpressionRef`, index: `number`): `ExpressionRef` #### [Exception handling operations](https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md) 🦄 * Module#**try**(body: `ExpressionRef`, catchBody: `ExpressionRef`): `ExpressionRef` * Module#**throw**(event: `string`, operands: `ExpressionRef[]`): `ExpressionRef` * Module#**rethrow**(exnref: `ExpressionRef`): `ExpressionRef` * Module#**br_on_exn**(label: `string`, event: `string`, exnref: `ExpressionRef`): `ExpressionRef` > * Module#**addEvent**(name: `string`, attribute: `number`, params: `Type`, results: `Type`): `Event` * Module#**getEvent**(name: `string`): `Event` * Module#**removeEvent**(name: `stirng`): `void` * Module#**addEventImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, attribute: `number`, params: `Type`, results: `Type`): `void` * Module#**addEventExport**(internalName: `string`, externalName: `string`): `ExportRef` #### [Reference types operations](https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md) 🦄 * Module#ref.**null**(): `ExpressionRef` * Module#ref.**is_null**(value: `ExpressionRef`): `ExpressionRef` * Module#ref.**func**(name: `string`): `ExpressionRef` ### Expression manipulation * **getExpressionId**(expr: `ExpressionRef`): `ExpressionId`<br /> Gets the id (kind) of the specified expression. Possible values are: * **InvalidId**: `ExpressionId` * **BlockId**: `ExpressionId` * **IfId**: `ExpressionId` * **LoopId**: `ExpressionId` * **BreakId**: `ExpressionId` * **SwitchId**: `ExpressionId` * **CallId**: `ExpressionId` * **CallIndirectId**: `ExpressionId` * **LocalGetId**: `ExpressionId` * **LocalSetId**: `ExpressionId` * **GlobalGetId**: `ExpressionId` * **GlobalSetId**: `ExpressionId` * **LoadId**: `ExpressionId` * **StoreId**: `ExpressionId` * **ConstId**: `ExpressionId` * **UnaryId**: `ExpressionId` * **BinaryId**: `ExpressionId` * **SelectId**: `ExpressionId` * **DropId**: `ExpressionId` * **ReturnId**: `ExpressionId` * **HostId**: `ExpressionId` * **NopId**: `ExpressionId` * **UnreachableId**: `ExpressionId` * **AtomicCmpxchgId**: `ExpressionId` * **AtomicRMWId**: `ExpressionId` * **AtomicWaitId**: `ExpressionId` * **AtomicNotifyId**: `ExpressionId` * **AtomicFenceId**: `ExpressionId` * **SIMDExtractId**: `ExpressionId` * **SIMDReplaceId**: `ExpressionId` * **SIMDShuffleId**: `ExpressionId` * **SIMDTernaryId**: `ExpressionId` * **SIMDShiftId**: `ExpressionId` * **SIMDLoadId**: `ExpressionId` * **MemoryInitId**: `ExpressionId` * **DataDropId**: `ExpressionId` * **MemoryCopyId**: `ExpressionId` * **MemoryFillId**: `ExpressionId` * **RefNullId**: `ExpressionId` * **RefIsNullId**: `ExpressionId` * **RefFuncId**: `ExpressionId` * **TryId**: `ExpressionId` * **ThrowId**: `ExpressionId` * **RethrowId**: `ExpressionId` * **BrOnExnId**: `ExpressionId` * **PushId**: `ExpressionId` * **PopId**: `ExpressionId` * **getExpressionType**(expr: `ExpressionRef`): `Type`<br /> Gets the type of the specified expression. * **getExpressionInfo**(expr: `ExpressionRef`): `ExpressionInfo`<br /> Obtains information about an expression, always including: * Info#**id**: `ExpressionId` * Info#**type**: `Type` Additional properties depend on the expression's `id` and are usually equivalent to the respective parameters when creating such an expression: * BlockInfo#**name**: `string` * BlockInfo#**children**: `ExpressionRef[]` > * IfInfo#**condition**: `ExpressionRef` * IfInfo#**ifTrue**: `ExpressionRef` * IfInfo#**ifFalse**: `ExpressionRef | null` > * LoopInfo#**name**: `string` * LoopInfo#**body**: `ExpressionRef` > * BreakInfo#**name**: `string` * BreakInfo#**condition**: `ExpressionRef | null` * BreakInfo#**value**: `ExpressionRef | null` > * SwitchInfo#**names**: `string[]` * SwitchInfo#**defaultName**: `string | null` * SwitchInfo#**condition**: `ExpressionRef` * SwitchInfo#**value**: `ExpressionRef | null` > * CallInfo#**target**: `string` * CallInfo#**operands**: `ExpressionRef[]` > * CallImportInfo#**target**: `string` * CallImportInfo#**operands**: `ExpressionRef[]` > * CallIndirectInfo#**target**: `ExpressionRef` * CallIndirectInfo#**operands**: `ExpressionRef[]` > * LocalGetInfo#**index**: `number` > * LocalSetInfo#**isTee**: `boolean` * LocalSetInfo#**index**: `number` * LocalSetInfo#**value**: `ExpressionRef` > * GlobalGetInfo#**name**: `string` > * GlobalSetInfo#**name**: `string` * GlobalSetInfo#**value**: `ExpressionRef` > * LoadInfo#**isAtomic**: `boolean` * LoadInfo#**isSigned**: `boolean` * LoadInfo#**offset**: `number` * LoadInfo#**bytes**: `number` * LoadInfo#**align**: `number` * LoadInfo#**ptr**: `ExpressionRef` > * StoreInfo#**isAtomic**: `boolean` * StoreInfo#**offset**: `number` * StoreInfo#**bytes**: `number` * StoreInfo#**align**: `number` * StoreInfo#**ptr**: `ExpressionRef` * StoreInfo#**value**: `ExpressionRef` > * ConstInfo#**value**: `number | { low: number, high: number }` > * UnaryInfo#**op**: `number` * UnaryInfo#**value**: `ExpressionRef` > * BinaryInfo#**op**: `number` * BinaryInfo#**left**: `ExpressionRef` * BinaryInfo#**right**: `ExpressionRef` > * SelectInfo#**ifTrue**: `ExpressionRef` * SelectInfo#**ifFalse**: `ExpressionRef` * SelectInfo#**condition**: `ExpressionRef` > * DropInfo#**value**: `ExpressionRef` > * ReturnInfo#**value**: `ExpressionRef | null` > * NopInfo > * UnreachableInfo > * HostInfo#**op**: `number` * HostInfo#**nameOperand**: `string | null` * HostInfo#**operands**: `ExpressionRef[]` > * AtomicRMWInfo#**op**: `number` * AtomicRMWInfo#**bytes**: `number` * AtomicRMWInfo#**offset**: `number` * AtomicRMWInfo#**ptr**: `ExpressionRef` * AtomicRMWInfo#**value**: `ExpressionRef` > * AtomicCmpxchgInfo#**bytes**: `number` * AtomicCmpxchgInfo#**offset**: `number` * AtomicCmpxchgInfo#**ptr**: `ExpressionRef` * AtomicCmpxchgInfo#**expected**: `ExpressionRef` * AtomicCmpxchgInfo#**replacement**: `ExpressionRef` > * AtomicWaitInfo#**ptr**: `ExpressionRef` * AtomicWaitInfo#**expected**: `ExpressionRef` * AtomicWaitInfo#**timeout**: `ExpressionRef` * AtomicWaitInfo#**expectedType**: `Type` > * AtomicNotifyInfo#**ptr**: `ExpressionRef` * AtomicNotifyInfo#**notifyCount**: `ExpressionRef` > * AtomicFenceInfo > * SIMDExtractInfo#**op**: `Op` * SIMDExtractInfo#**vec**: `ExpressionRef` * SIMDExtractInfo#**index**: `ExpressionRef` > * SIMDReplaceInfo#**op**: `Op` * SIMDReplaceInfo#**vec**: `ExpressionRef` * SIMDReplaceInfo#**index**: `ExpressionRef` * SIMDReplaceInfo#**value**: `ExpressionRef` > * SIMDShuffleInfo#**left**: `ExpressionRef` * SIMDShuffleInfo#**right**: `ExpressionRef` * SIMDShuffleInfo#**mask**: `Uint8Array` > * SIMDTernaryInfo#**op**: `Op` * SIMDTernaryInfo#**a**: `ExpressionRef` * SIMDTernaryInfo#**b**: `ExpressionRef` * SIMDTernaryInfo#**c**: `ExpressionRef` > * SIMDShiftInfo#**op**: `Op` * SIMDShiftInfo#**vec**: `ExpressionRef` * SIMDShiftInfo#**shift**: `ExpressionRef` > * SIMDLoadInfo#**op**: `Op` * SIMDLoadInfo#**offset**: `number` * SIMDLoadInfo#**align**: `number` * SIMDLoadInfo#**ptr**: `ExpressionRef` > * MemoryInitInfo#**segment**: `number` * MemoryInitInfo#**dest**: `ExpressionRef` * MemoryInitInfo#**offset**: `ExpressionRef` * MemoryInitInfo#**size**: `ExpressionRef` > * MemoryDropInfo#**segment**: `number` > * MemoryCopyInfo#**dest**: `ExpressionRef` * MemoryCopyInfo#**source**: `ExpressionRef` * MemoryCopyInfo#**size**: `ExpressionRef` > * MemoryFillInfo#**dest**: `ExpressionRef` * MemoryFillInfo#**value**: `ExpressionRef` * MemoryFillInfo#**size**: `ExpressionRef` > * TryInfo#**body**: `ExpressionRef` * TryInfo#**catchBody**: `ExpressionRef` > * RefNullInfo > * RefIsNullInfo#**value**: `ExpressionRef` > * RefFuncInfo#**func**: `string` > * ThrowInfo#**event**: `string` * ThrowInfo#**operands**: `ExpressionRef[]` > * RethrowInfo#**exnref**: `ExpressionRef` > * BrOnExnInfo#**name**: `string` * BrOnExnInfo#**event**: `string` * BrOnExnInfo#**exnref**: `ExpressionRef` > * PopInfo > * PushInfo#**value**: `ExpressionRef` * **emitText**(expression: `ExpressionRef`): `string`<br /> Emits the expression in Binaryen's s-expression text format (not official stack-style text format). * **copyExpression**(expression: `ExpressionRef`): `ExpressionRef`<br /> Creates a deep copy of an expression. ### Relooper * new **Relooper**()<br /> Constructs a relooper instance. This lets you provide an arbitrary CFG, and the relooper will structure it for WebAssembly. * Relooper#**addBlock**(code: `ExpressionRef`): `RelooperBlockRef`<br /> Adds a new block to the CFG, containing the provided code as its body. * Relooper#**addBranch**(from: `RelooperBlockRef`, to: `RelooperBlockRef`, condition: `ExpressionRef`, code: `ExpressionRef`): `void`<br /> Adds a branch from a block to another block, with a condition (or nothing, if this is the default branch to take from the origin - each block must have one such branch), and optional code to execute on the branch (useful for phis). * Relooper#**addBlockWithSwitch**(code: `ExpressionRef`, condition: `ExpressionRef`): `RelooperBlockRef`<br /> Adds a new block, which ends with a switch/br_table, with provided code and condition (that determines where we go in the switch). * Relooper#**addBranchForSwitch**(from: `RelooperBlockRef`, to: `RelooperBlockRef`, indexes: `number[]`, code: `ExpressionRef`): `void`<br /> Adds a branch from a block ending in a switch, to another block, using an array of indexes that determine where to go, and optional code to execute on the branch. * Relooper#**renderAndDispose**(entry: `RelooperBlockRef`, labelHelper: `number`, module: `Module`): `ExpressionRef`<br /> Renders and cleans up the Relooper instance. Call this after you have created all the blocks and branches, giving it the entry block (where control flow begins), a label helper variable (an index of a local we can use, necessary for irreducible control flow), and the module. This returns an expression - normal WebAssembly code - that you can use normally anywhere. ### Source maps * Module#**addDebugInfoFileName**(filename: `string`): `number`<br /> Adds a debug info file name to the module and returns its index. * Module#**getDebugInfoFileName**(index: `number`): `string | null` <br /> Gets the name of the debug info file at the specified index. * Module#**setDebugLocation**(func: `FunctionRef`, expr: `ExpressionRef`, fileIndex: `number`, lineNumber: `number`, columnNumber: `number`): `void`<br /> Sets the debug location of the specified `ExpressionRef` within the specified `FunctionRef`. ### Debugging * Module#**interpret**(): `void`<br /> Runs the module in the interpreter, calling the start function. # Acorn A tiny, fast JavaScript parser written in JavaScript. ## Community Acorn is open source software released under an [MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE). You are welcome to [report bugs](https://github.com/acornjs/acorn/issues) or create pull requests on [github](https://github.com/acornjs/acorn). For questions and discussion, please use the [Tern discussion forum](https://discuss.ternjs.net). ## Installation The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): ```sh npm install acorn ``` Alternately, you can download the source and build acorn yourself: ```sh git clone https://github.com/acornjs/acorn.git cd acorn npm install ``` ## Interface **parse**`(input, options)` is the main interface to the library. The `input` parameter is a string, `options` can be undefined or an object setting some of the options listed below. The return value will be an abstract syntax tree object as specified by the [ESTree spec](https://github.com/estree/estree). ```javascript let acorn = require("acorn"); console.log(acorn.parse("1 + 1")); ``` When encountering a syntax error, the parser will raise a `SyntaxError` object with a meaningful message. The error object will have a `pos` property that indicates the string offset at which the error occurred, and a `loc` object that contains a `{line, column}` object referring to that same position. Options can be provided by passing a second argument, which should be an object containing any of these fields: - **ecmaVersion**: Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019) or 11 (2020, partial support). This influences support for strict mode, the set of reserved words, and support for new syntax features. Default is 10. **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being implemented by Acorn. Other proposed new features can be implemented through plugins. - **sourceType**: Indicate the mode the code should be parsed in. Can be either `"script"` or `"module"`. This influences global strict mode and parsing of `import` and `export` declarations. **NOTE**: If set to `"module"`, then static `import` / `export` syntax will be valid, even if `ecmaVersion` is less than 6. - **onInsertedSemicolon**: If given a callback, that callback will be called whenever a missing semicolon is inserted by the parser. The callback will be given the character offset of the point where the semicolon is inserted as argument, and if `locations` is on, also a `{line, column}` object representing this position. - **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing commas. - **allowReserved**: If `false`, using a reserved word will generate an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher versions. When given the value `"never"`, reserved words and keywords can also not be used as property names (as in Internet Explorer's old parser). - **allowReturnOutsideFunction**: By default, a return statement at the top level raises an error. Set this to `true` to accept such code. - **allowImportExportEverywhere**: By default, `import` and `export` declarations can only appear at a program's top level. Setting this option to `true` allows them anywhere where a statement is allowed. - **allowAwaitOutsideFunction**: By default, `await` expressions can only appear inside `async` functions. Setting this option to `true` allows to have top-level `await` expressions. They are still not allowed in non-`async` functions, though. - **allowHashBang**: When this is enabled (off by default), if the code starts with the characters `#!` (as in a shellscript), the first line will be treated as a comment. - **locations**: When `true`, each node has a `loc` object attached with `start` and `end` subobjects, each of which contains the one-based line and zero-based column numbers in `{line, column}` form. Default is `false`. - **onToken**: If a function is passed for this option, each found token will be passed in same format as tokens returned from `tokenizer().getToken()`. If array is passed, each found token is pushed to it. Note that you are not allowed to call the parser from the callback—that will corrupt its internal state. - **onComment**: If a function is passed for this option, whenever a comment is encountered the function will be called with the following parameters: - `block`: `true` if the comment is a block comment, false if it is a line comment. - `text`: The content of the comment. - `start`: Character offset of the start of the comment. - `end`: Character offset of the end of the comment. When the `locations` options is on, the `{line, column}` locations of the comment’s start and end are passed as two additional parameters. If array is passed for this option, each found comment is pushed to it as object in Esprima format: ```javascript { "type": "Line" | "Block", "value": "comment text", "start": Number, "end": Number, // If `locations` option is on: "loc": { "start": {line: Number, column: Number} "end": {line: Number, column: Number} }, // If `ranges` option is on: "range": [Number, Number] } ``` Note that you are not allowed to call the parser from the callback—that will corrupt its internal state. - **ranges**: Nodes have their start and end characters offsets recorded in `start` and `end` properties (directly on the node, rather than the `loc` object, which holds line/column data. To also add a [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678) `range` property holding a `[start, end]` array with the same numbers, set the `ranges` option to `true`. - **program**: It is possible to parse multiple files into a single AST by passing the tree produced by parsing the first file as the `program` option in subsequent parses. This will add the toplevel forms of the parsed file to the "Program" (top) node of an existing parse tree. - **sourceFile**: When the `locations` option is `true`, you can pass this option to add a `source` attribute in every node’s `loc` object. Note that the contents of this option are not examined or processed in any way; you are free to use whatever format you choose. - **directSourceFile**: Like `sourceFile`, but a `sourceFile` property will be added (regardless of the `location` option) directly to the nodes, rather than the `loc` object. - **preserveParens**: If this option is `true`, parenthesized expressions are represented by (non-standard) `ParenthesizedExpression` nodes that have a single `expression` property containing the expression inside parentheses. **parseExpressionAt**`(input, offset, options)` will parse a single expression in a string, and return its AST. It will not complain if there is more of the string left after the expression. **tokenizer**`(input, options)` returns an object with a `getToken` method that can be called repeatedly to get the next token, a `{start, end, type, value}` object (with added `loc` property when the `locations` option is enabled and `range` property when the `ranges` option is enabled). When the token's type is `tokTypes.eof`, you should stop calling the method, since it will keep returning that same token forever. In ES6 environment, returned result can be used as any other protocol-compliant iterable: ```javascript for (let token of acorn.tokenizer(str)) { // iterate over the tokens } // transform code to array of tokens: var tokens = [...acorn.tokenizer(str)]; ``` **tokTypes** holds an object mapping names to the token type objects that end up in the `type` properties of tokens. **getLineInfo**`(input, offset)` can be used to get a `{line, column}` object for a given program string and offset. ### The `Parser` class Instances of the **`Parser`** class contain all the state and logic that drives a parse. It has static methods `parse`, `parseExpressionAt`, and `tokenizer` that match the top-level functions by the same name. When extending the parser with plugins, you need to call these methods on the extended version of the class. To extend a parser with plugins, you can use its static `extend` method. ```javascript var acorn = require("acorn"); var jsx = require("acorn-jsx"); var JSXParser = acorn.Parser.extend(jsx()); JSXParser.parse("foo(<bar/>)"); ``` The `extend` method takes any number of plugin values, and returns a new `Parser` class that includes the extra parser logic provided by the plugins. ## Command line interface The `bin/acorn` utility can be used to parse a file from the command line. It accepts as arguments its input file and the following options: - `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version to parse. Default is version 9. - `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. - `--locations`: Attaches a "loc" object to each node with "start" and "end" subobjects, each of which contains the one-based line and zero-based column numbers in `{line, column}` form. - `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment. - `--compact`: No whitespace is used in the AST output. - `--silent`: Do not output the AST, just return the exit status. - `--help`: Print the usage information and quit. The utility spits out the syntax tree as JSON data. ## Existing plugins - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) Plugins for ECMAScript proposals: - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: - [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields) - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n # flatted [![Downloads](https://img.shields.io/npm/dm/flatted.svg)](https://www.npmjs.com/package/flatted) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/flatted/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/flatted?branch=main) [![Build Status](https://travis-ci.com/WebReflection/flatted.svg?branch=main)](https://travis-ci.com/WebReflection/flatted) [![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC) ![WebReflection status](https://offline.report/status/webreflection.svg) ![snow flake](./flatted.jpg) <sup>**Social Media Photo by [Matt Seymour](https://unsplash.com/@mattseymour) on [Unsplash](https://unsplash.com/)**</sup> ## Announcement 📣 There is a standard approach to recursion and more data-types than what JSON allows, and it's part of the [Structured Clone polyfill](https://github.com/ungap/structured-clone/#readme). Beside acting as a polyfill, its `@ungap/structured-clone/json` export provides both `stringify` and `parse`, and it's been tested for being faster than *flatted*, but its produced output is also smaller than *flatted* in general. The *@ungap/structured-clone* module is, in short, a drop in replacement for *flatted*, but it's not compatible with *flatted* specialized syntax. However, if recursion, as well as more data-types, are what you are after, or interesting for your projects/use cases, consider switching to this new module whenever you can 👍 - - - A super light (0.5K) and fast circular JSON parser, directly from the creator of [CircularJSON](https://github.com/WebReflection/circular-json/#circularjson). Now available also for **[PHP](./php/flatted.php)**. ```js npm i flatted ``` Usable via [CDN](https://unpkg.com/flatted) or as regular module. ```js // ESM import {parse, stringify, toJSON, fromJSON} from 'flatted'; // CJS const {parse, stringify, toJSON, fromJSON} = require('flatted'); const a = [{}]; a[0].a = a; a.push(a); stringify(a); // [["1","0"],{"a":"0"}] ``` ## toJSON and fromJSON If you'd like to implicitly survive JSON serialization, these two helpers helps: ```js import {toJSON, fromJSON} from 'flatted'; class RecursiveMap extends Map { static fromJSON(any) { return new this(fromJSON(any)); } toJSON() { return toJSON([...this.entries()]); } } const recursive = new RecursiveMap; const same = {}; same.same = same; recursive.set('same', same); const asString = JSON.stringify(recursive); const asMap = RecursiveMap.fromJSON(JSON.parse(asString)); asMap.get('same') === asMap.get('same').same; // true ``` ## Flatted VS JSON As it is for every other specialized format capable of serializing and deserializing circular data, you should never `JSON.parse(Flatted.stringify(data))`, and you should never `Flatted.parse(JSON.stringify(data))`. The only way this could work is to `Flatted.parse(Flatted.stringify(data))`, as it is also for _CircularJSON_ or any other, otherwise there's no granted data integrity. Also please note this project serializes and deserializes only data compatible with JSON, so that sockets, or anything else with internal classes different from those allowed by JSON standard, won't be serialized and unserialized as expected. ### New in V1: Exact same JSON API * Added a [reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Syntax) parameter to `.parse(string, reviver)` and revive your own objects. * Added a [replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Syntax) and a `space` parameter to `.stringify(object, replacer, space)` for feature parity with JSON signature. ### Compatibility All ECMAScript engines compatible with `Map`, `Set`, `Object.keys`, and `Array.prototype.reduce` will work, even if polyfilled. ### How does it work ? While stringifying, all Objects, including Arrays, and strings, are flattened out and replaced as unique index. `*` Once parsed, all indexes will be replaced through the flattened collection. <sup><sub>`*` represented as string to avoid conflicts with numbers</sub></sup> ```js // logic example var a = [{one: 1}, {two: '2'}]; a[0].a = a; // a is the main object, will be at index '0' // {one: 1} is the second object, index '1' // {two: '2'} the third, in '2', and it has a string // which will be found at index '3' Flatted.stringify(a); // [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"] // a[one,two] {one: 1, a} {two: '2'} '2' ``` # assemblyscript-regex A regex engine for AssemblyScript. [AssemblyScript](https://www.assemblyscript.org/) is a new language, based on TypeScript, that runs on WebAssembly. AssemblyScript has a lightweight standard library, but lacks support for Regular Expression. The project fills that gap! This project exposes an API that mirrors the JavaScript [RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) class: ```javascript const regex = new RegExp("fo*", "g"); const str = "table football, foul"; let match: Match | null = regex.exec(str); while (match != null) { // first iteration // match.index = 6 // match.matches[0] = "foo" // second iteration // match.index = 16 // match.matches[0] = "fo" match = regex.exec(str); } ``` ## Project status The initial focus of this implementation has been feature support and functionality over performance. It currently supports a sufficient number of regex features to be considered useful, including most character classes, common assertions, groups, alternations, capturing groups and quantifiers. The next phase of development will focussed on more extensive testing and performance. The project currently has reasonable unit test coverage, focussed on positive and negative test cases on a per-feature basis. It also includes a more exhaustive test suite with test cases borrowed from another regex library. ### Feature support Based on the classfication within the [MDN cheatsheet](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet) **Character sets** - [x] . - [x] \d - [x] \D - [x] \w - [x] \W - [x] \s - [x] \S - [x] \t - [x] \r - [x] \n - [x] \v - [x] \f - [ ] [\b] - [ ] \0 - [ ] \cX - [x] \xhh - [x] \uhhhh - [ ] \u{hhhh} or \u{hhhhh} - [x] \ **Assertions** - [x] ^ - [x] $ - [ ] \b - [ ] \B **Other assertions** - [ ] x(?=y) Lookahead assertion - [ ] x(?!y) Negative lookahead assertion - [ ] (?<=y)x Lookbehind assertion - [ ] (?<!y)x Negative lookbehind assertion **Groups and ranges** - [x] x|y - [x] [xyz][a-c] - [x] [^xyz][^a-c] - [x] (x) capturing group - [ ] \n back reference - [ ] (?<Name>x) named capturing group - [x] (?:x) Non-capturing group **Quantifiers** - [x] x\* - [x] x+ - [x] x? - [x] x{n} - [x] x{n,} - [x] x{n,m} - [ ] x\*? / x+? / ... **RegExp** - [x] global - [ ] sticky - [x] case insensitive - [x] multiline - [x] dotAll - [ ] unicode ### Development This project is open source, MIT licenced and your contributions are very much welcomed. To get started, check out the repository and install dependencies: ``` $ npm install ``` A few general points about the tools and processes this project uses: - This project uses prettier for code formatting and eslint to provide additional syntactic checks. These are both run on `npm test` and as part of the CI build. - The unit tests are executed using [as-pect](https://github.com/jtenner/as-pect) - a native AssemblyScript test runner - The specification tests are within the `spec` folder. The `npm run test:generate` target transforms these tests into as-pect tests which execute as part of the standard build / test cycle - In order to support improved debugging you can execute this library as TypeScript (rather than WebAssembly), via the `npm run tsrun` target. # which Like the unix `which` utility. Finds the first instance of a specified executable in the PATH environment variable. Does not cache the results, so `hash -r` is not needed when the PATH changes. ## USAGE ```javascript var which = require('which') // async usage which('node', function (er, resolvedPath) { // er is returned if no "node" is found on the PATH // if it is found, then the absolute path to the exec is returned }) // or promise which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... }) // sync usage // throws if not found var resolved = which.sync('node') // if nothrow option is used, returns null if not found resolved = which.sync('node', {nothrow: true}) // Pass options to override the PATH and PATHEXT environment vars. which('node', { path: someOtherPath }, function (er, resolved) { if (er) throw er console.log('found at %j', resolved) }) ``` ## CLI USAGE Same as the BSD `which(1)` binary. ``` usage: which [-as] program ... ``` ## OPTIONS You may pass an options object as the second argument. - `path`: Use instead of the `PATH` environment variable. - `pathExt`: Use instead of the `PATHEXT` environment variable. - `all`: Return all matches, instead of just the first one. Note that this means the function returns an array of strings instead of a single string. <p align="center"> <img width="250" src="https://raw.githubusercontent.com/yargs/yargs/master/yargs-logo.png"> </p> <h1 align="center"> Yargs </h1> <p align="center"> <b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b> </p> <br> ![ci](https://github.com/yargs/yargs/workflows/ci/badge.svg) [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] [![Coverage][coverage-image]][coverage-url] [![Conventional Commits][conventional-commits-image]][conventional-commits-url] [![Slack][slack-image]][slack-url] ## Description Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It gives you: * commands and (grouped) options (`my-program.js serve --port=5000`). * a dynamically generated help menu based on your arguments: ``` mocha [spec..] Run tests with Mocha Commands mocha inspect [spec..] Run tests with Mocha [default] mocha init <path> create a client-side Mocha setup at <path> Rules & Behavior --allow-uncaught Allow uncaught errors to propagate [boolean] --async-only, -A Require all tests to use a callback (async) or return a Promise [boolean] ``` * bash-completion shortcuts for commands and options. * and [tons more](/docs/api.md). ## Installation Stable version: ```bash npm i yargs ``` Bleeding edge version with the most recent features: ```bash npm i yargs@next ``` ## Usage ### Simple Example ```javascript #!/usr/bin/env node const yargs = require('yargs/yargs') const { hideBin } = require('yargs/helpers') const argv = yargs(hideBin(process.argv)).argv if (argv.ships > 3 && argv.distance < 53.5) { console.log('Plunder more riffiwobbles!') } else { console.log('Retreat from the xupptumblers!') } ``` ```bash $ ./plunder.js --ships=4 --distance=22 Plunder more riffiwobbles! $ ./plunder.js --ships 12 --distance 98.7 Retreat from the xupptumblers! ``` ### Complex Example ```javascript #!/usr/bin/env node const yargs = require('yargs/yargs') const { hideBin } = require('yargs/helpers') yargs(hideBin(process.argv)) .command('serve [port]', 'start the server', (yargs) => { yargs .positional('port', { describe: 'port to bind on', default: 5000 }) }, (argv) => { if (argv.verbose) console.info(`start server on :${argv.port}`) serve(argv.port) }) .option('verbose', { alias: 'v', type: 'boolean', description: 'Run with verbose logging' }) .argv ``` Run the example above with `--help` to see the help for the application. ## Supported Platforms ### TypeScript yargs has type definitions at [@types/yargs][type-definitions]. ``` npm i @types/yargs --save-dev ``` See usage examples in [docs](/docs/typescript.md). ### Deno As of `v16`, `yargs` supports [Deno](https://github.com/denoland/deno): ```typescript import yargs from 'https://deno.land/x/yargs/deno.ts' import { Arguments } from 'https://deno.land/x/yargs/deno-types.ts' yargs(Deno.args) .command('download <files...>', 'download a list of files', (yargs: any) => { return yargs.positional('files', { describe: 'a list of files to do something with' }) }, (argv: Arguments) => { console.info(argv) }) .strictCommands() .demandCommand(1) .argv ``` ### ESM As of `v16`,`yargs` supports ESM imports: ```js import yargs from 'yargs' import { hideBin } from 'yargs/helpers' yargs(hideBin(process.argv)) .command('curl <url>', 'fetch the contents of the URL', () => {}, (argv) => { console.info(argv) }) .demandCommand(1) .argv ``` ### Usage in Browser See examples of using yargs in the browser in [docs](/docs/browser.md). ## Community Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). ## Documentation ### Table of Contents * [Yargs' API](/docs/api.md) * [Examples](/docs/examples.md) * [Parsing Tricks](/docs/tricks.md) * [Stop the Parser](/docs/tricks.md#stop) * [Negating Boolean Arguments](/docs/tricks.md#negate) * [Numbers](/docs/tricks.md#numbers) * [Arrays](/docs/tricks.md#arrays) * [Objects](/docs/tricks.md#objects) * [Quotes](/docs/tricks.md#quotes) * [Advanced Topics](/docs/advanced.md) * [Composing Your App Using Commands](/docs/advanced.md#commands) * [Building Configurable CLI Apps](/docs/advanced.md#configuration) * [Customizing Yargs' Parser](/docs/advanced.md#customizing) * [Bundling yargs](/docs/bundling.md) * [Contributing](/contributing.md) ## Supported Node.js Versions Libraries in this ecosystem make a best effort to track [Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). [npm-url]: https://www.npmjs.com/package/yargs [npm-image]: https://img.shields.io/npm/v/yargs.svg [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: http://standardjs.com/ [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg [conventional-commits-url]: https://conventionalcommits.org/ [slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg [slack-url]: http://devtoolscommunity.herokuapp.com [type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs [coverage-image]: https://img.shields.io/nycrc/yargs/yargs [coverage-url]: https://github.com/yargs/yargs/blob/master/.nycrc [Build]: http://img.shields.io/travis/litejs/natural-compare-lite.png [Coverage]: http://img.shields.io/coveralls/litejs/natural-compare-lite.png [1]: https://travis-ci.org/litejs/natural-compare-lite [2]: https://coveralls.io/r/litejs/natural-compare-lite [npm package]: https://npmjs.org/package/natural-compare-lite [GitHub repo]: https://github.com/litejs/natural-compare-lite @version 1.4.0 @date 2015-10-26 @stability 3 - Stable Natural Compare &ndash; [![Build][]][1] [![Coverage][]][2] =============== Compare strings containing a mix of letters and numbers in the way a human being would in sort order. This is described as a "natural ordering". ```text Standard sorting: Natural order sorting: img1.png img1.png img10.png img2.png img12.png img10.png img2.png img12.png ``` String.naturalCompare returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order. Use it with builtin sort() function. ### Installation - In browser ```html <script src=min.natural-compare.js></script> ``` - In node.js: `npm install natural-compare-lite` ```javascript require("natural-compare-lite") ``` ### Usage ```javascript // Simple case sensitive example var a = ["z1.doc", "z10.doc", "z17.doc", "z2.doc", "z23.doc", "z3.doc"]; a.sort(String.naturalCompare); // ["z1.doc", "z2.doc", "z3.doc", "z10.doc", "z17.doc", "z23.doc"] // Use wrapper function for case insensitivity a.sort(function(a, b){ return String.naturalCompare(a.toLowerCase(), b.toLowerCase()); }) // In most cases we want to sort an array of objects var a = [ {"street":"350 5th Ave", "room":"A-1021"} , {"street":"350 5th Ave", "room":"A-21046-b"} ]; // sort by street, then by room a.sort(function(a, b){ return String.naturalCompare(a.street, b.street) || String.naturalCompare(a.room, b.room); }) // When text transformation is needed (eg toLowerCase()), // it is best for performance to keep // transformed key in that object. // There are no need to do text transformation // on each comparision when sorting. var a = [ {"make":"Audi", "model":"A6"} , {"make":"Kia", "model":"Rio"} ]; // sort by make, then by model a.map(function(car){ car.sort_key = (car.make + " " + car.model).toLowerCase(); }) a.sort(function(a, b){ return String.naturalCompare(a.sort_key, b.sort_key); }) ``` - Works well with dates in ISO format eg "Rev 2012-07-26.doc". ### Custom alphabet It is possible to configure a custom alphabet to achieve a desired order. ```javascript // Estonian alphabet String.alphabet = "ABDEFGHIJKLMNOPRSŠZŽTUVÕÄÖÜXYabdefghijklmnoprsšzžtuvõäöüxy" ["t", "z", "x", "õ"].sort(String.naturalCompare) // ["z", "t", "õ", "x"] // Russian alphabet String.alphabet = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя" ["Ё", "А", "Б"].sort(String.naturalCompare) // ["А", "Б", "Ё"] ``` External links -------------- - [GitHub repo][https://github.com/litejs/natural-compare-lite] - [jsperf test](http://jsperf.com/natural-sort-2/12) Licence ------- Copyright (c) 2012-2015 Lauri Rooden &lt;lauri@rooden.ee&gt; [The MIT License](http://lauri.rooden.ee/mit-license.txt) # y18n [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) The bare-bones internationalization library used by yargs. Inspired by [i18n](https://www.npmjs.com/package/i18n). ## Examples _simple string translation:_ ```js const __ = require('y18n')().__; console.log(__('my awesome string %s', 'foo')); ``` output: `my awesome string foo` _using tagged template literals_ ```js const __ = require('y18n')().__; const str = 'foo'; console.log(__`my awesome string ${str}`); ``` output: `my awesome string foo` _pluralization support:_ ```js const __n = require('y18n')().__n; console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')); ``` output: `2 fishes foo` ## Deno Example As of `v5` `y18n` supports [Deno](https://github.com/denoland/deno): ```typescript import y18n from "https://deno.land/x/y18n/deno.ts"; const __ = y18n({ locale: 'pirate', directory: './test/locales' }).__ console.info(__`Hi, ${'Ben'} ${'Coe'}!`) ``` You will need to run with `--allow-read` to load alternative locales. ## JSON Language Files The JSON language files should be stored in a `./locales` folder. File names correspond to locales, e.g., `en.json`, `pirate.json`. When strings are observed for the first time they will be added to the JSON file corresponding to the current locale. ## Methods ### require('y18n')(config) Create an instance of y18n with the config provided, options include: * `directory`: the locale directory, default `./locales`. * `updateFiles`: should newly observed strings be updated in file, default `true`. * `locale`: what locale should be used. * `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) be allowed if a file matching the locale does not exist (e.g. `en_US.json`), default `true`. ### y18n.\_\_(str, arg, arg, arg) Print a localized string, `%s` will be replaced with `arg`s. This function can also be used as a tag for a template literal. You can use it like this: <code>__&#96;hello ${'world'}&#96;</code>. This will be equivalent to `__('hello %s', 'world')`. ### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) Print a localized string with appropriate pluralization. If `%d` is provided in the string, the `count` will replace this placeholder. ### y18n.setLocale(str) Set the current locale being used. ### y18n.getLocale() What locale is currently being used? ### y18n.updateLocale(obj) Update the current locale with the key value pairs in `obj`. ## Supported Node.js Versions Libraries in this ecosystem make a best effort to track [Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). ## License ISC [npm-url]: https://npmjs.org/package/y18n [npm-image]: https://img.shields.io/npm/v/y18n.svg [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: https://github.com/feross/standard <table><thead> <tr> <th>Linux</th> <th>OS X</th> <th>Windows</th> <th>Coverage</th> <th>Downloads</th> </tr> </thead><tbody><tr> <td colspan="2" align="center"> <a href="https://travis-ci.org/kaelzhang/node-ignore"> <img src="https://travis-ci.org/kaelzhang/node-ignore.svg?branch=master" alt="Build Status" /></a> </td> <td align="center"> <a href="https://ci.appveyor.com/project/kaelzhang/node-ignore"> <img src="https://ci.appveyor.com/api/projects/status/github/kaelzhang/node-ignore?branch=master&svg=true" alt="Windows Build Status" /></a> </td> <td align="center"> <a href="https://codecov.io/gh/kaelzhang/node-ignore"> <img src="https://codecov.io/gh/kaelzhang/node-ignore/branch/master/graph/badge.svg" alt="Coverage Status" /></a> </td> <td align="center"> <a href="https://www.npmjs.org/package/ignore"> <img src="http://img.shields.io/npm/dm/ignore.svg" alt="npm module downloads per month" /></a> </td> </tr></tbody></table> # ignore `ignore` is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore). Pay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module. ##### Tested on - Linux + Node: `0.8` - `7.x` - Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. Actually, `ignore` does not rely on any versions of node specially. Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md). ## Table Of Main Contents - [Usage](#usage) - [`Pathname` Conventions](#pathname-conventions) - [Guide for 2.x -> 3.x](#upgrade-2x---3x) - [Guide for 3.x -> 4.x](#upgrade-3x---4x) - See Also: - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. ## Usage ```js import ignore from 'ignore' const ig = ignore().add(['.abc/*', '!.abc/d/']) ``` ### Filter the given paths ```js const paths = [ '.abc/a.js', // filtered out '.abc/d/e.js' // included ] ig.filter(paths) // ['.abc/d/e.js'] ig.ignores('.abc/a.js') // true ``` ### As the filter function ```js paths.filter(ig.createFilter()); // ['.abc/d/e.js'] ``` ### Win32 paths will be handled ```js ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) // if the code above runs on windows, the result will be // ['.abc\\d\\e.js'] ``` ## Why another ignore? - `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. - `ignore` only contains utility methods to filter paths according to the specified ignore rules, so - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. - `ignore` don't cares about sub-modules of git projects. - Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. - '`**/foo`' should match '`foo`' anywhere. - Prevent re-including a file if a parent directory of that file is excluded. - Handle trailing whitespaces: - `'a '`(one space) should not match `'a '`(two spaces). - `'a \ '` matches `'a '` - All test cases are verified with the result of `git check-ignore`. # Methods ## .add(pattern: string | Ignore): this ## .add(patterns: Array<string | Ignore>): this - **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance - **patterns** `Array<String | Ignore>` Array of ignore patterns. Adds a rule or several rules to the current manager. Returns `this` Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. ```js ignore().add('#abc').ignores('#abc') // false ignore().add('\#abc').ignores('#abc') // true ``` `pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: ```js ignore() .add(fs.readFileSync(filenameOfGitignore).toString()) .filter(filenames) ``` `pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. ## <strike>.addIgnoreFile(path)</strike> REMOVED in `3.x` for now. To upgrade `ignore@2.x` up to `3.x`, use ```js import fs from 'fs' if (fs.existsSync(filename)) { ignore().add(fs.readFileSync(filename).toString()) } ``` instead. ## .filter(paths: Array<Pathname>): Array<Pathname> ```ts type Pathname = string ``` Filters the given array of pathnames, and returns the filtered array. - **paths** `Array.<Pathname>` The array of `pathname`s to be filtered. ### `Pathname` Conventions: #### 1. `Pathname` should be a `path.relative()`d pathname `Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory. ```js // WRONG ig.ignores('./abc') // WRONG, for it will never happen. // If the gitignore rule locates at the root directory, // `'/abc'` should be changed to `'abc'`. // ``` // path.relative('/', '/abc') -> 'abc' // ``` ig.ignores('/abc') // Right ig.ignores('abc') // Right ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' ``` In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules. Suppose the dir structure is: ``` /path/to/your/repo |-- a | |-- a.js | |-- .b | |-- .c |-- .DS_store ``` Then the `paths` might be like this: ```js [ 'a/a.js' '.b', '.c/.DS_store' ] ``` Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: ```js import glob from 'glob' glob('**', { // Adds a / character to directory matches. mark: true }, (err, files) => { if (err) { return console.error(err) } let filtered = ignore().add(patterns).filter(files) console.log(filtered) }) ``` #### 2. filenames and dirnames `node-ignore` does NO `fs.stat` during path matching, so for the example below: ```js ig.add('config/') // `ig` does NOT know if 'config' is a normal file, directory or something ig.ignores('config') // And it returns `false` ig.ignores('config/') // returns `true` ``` Specially for people who develop some library based on `node-ignore`, it is important to understand that. ## .ignores(pathname: Pathname): boolean > new in 3.2.0 Returns `Boolean` whether `pathname` should be ignored. ```js ig.ignores('.abc/a.js') // true ``` ## .createFilter() Creates a filter function which could filter an array of paths with `Array.prototype.filter`. Returns `function(path)` the filter function. ## `options.ignorecase` since 4.0.0 Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (default value), otherwise case sensitive. ```js const ig = ignore({ ignorecase: false }) ig.add('*.png') ig.ignores('*.PNG') // false ``` **** # Upgrade Guide ## Upgrade 2.x -> 3.x - All `options` of 2.x are unnecessary and removed, so just remove them. - `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. - `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. ## Upgrade 3.x -> 4.x Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6: ```js var ignore = require('ignore/legacy') ``` **** # Collaborators - [@whitecolor](https://github.com/whitecolor) *Alex* - [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé* - [@azproduction](https://github.com/azproduction) *Mikhail Davydov* - [@TrySound](https://github.com/TrySound) *Bogdan Chadkin* - [@JanMattner](https://github.com/JanMattner) *Jan Mattner* - [@ntwb](https://github.com/ntwb) *Stephen Edgar* - [@kasperisager](https://github.com/kasperisager) *Kasper Isager* - [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders* <a name="table"></a> # Table > Produces a string that represents array data in a text table. [![Github action status](https://github.com/gajus/table/actions/workflows/main.yml/badge.svg)](https://github.com/gajus/table/actions) [![Coveralls](https://img.shields.io/coveralls/gajus/table.svg?style=flat-square)](https://coveralls.io/github/gajus/table) [![NPM version](http://img.shields.io/npm/v/table.svg?style=flat-square)](https://www.npmjs.org/package/table) [![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical) [![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas) * [Table](#table) * [Features](#table-features) * [Install](#table-install) * [Usage](#table-usage) * [API](#table-api) * [table](#table-api-table-1) * [createStream](#table-api-createstream) * [getBorderCharacters](#table-api-getbordercharacters) ![Demo of table displaying a list of missions to the Moon.](./.README/demo.png) <a name="table-features"></a> ## Features * Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters. * Works with strings containing [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). * Configurable border characters. * Configurable content alignment per column. * Configurable content padding per column. * Configurable column width. * Text wrapping. <a name="table-install"></a> ## Install ```bash npm install table ``` [![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/gajus) [![Become a Patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/gajus) <a name="table-usage"></a> ## Usage ```js import { table } from 'table'; // Using commonjs? // const { table } = require('table'); const data = [ ['0A', '0B', '0C'], ['1A', '1B', '1C'], ['2A', '2B', '2C'] ]; console.log(table(data)); ``` ``` ╔════╤════╤════╗ ║ 0A │ 0B │ 0C ║ ╟────┼────┼────╢ ║ 1A │ 1B │ 1C ║ ╟────┼────┼────╢ ║ 2A │ 2B │ 2C ║ ╚════╧════╧════╝ ``` <a name="table-api"></a> ## API <a name="table-api-table-1"></a> ### table Returns the string in the table format **Parameters:** - **_data_:** The data to display - Type: `any[][]` - Required: `true` - **_config_:** Table configuration - Type: `object` - Required: `false` <a name="table-api-table-1-config-border"></a> ##### config.border Type: `{ [type: string]: string }`\ Default: `honeywell` [template](#getbordercharacters) Custom borders. The keys are any of: - `topLeft`, `topRight`, `topBody`,`topJoin` - `bottomLeft`, `bottomRight`, `bottomBody`, `bottomJoin` - `joinLeft`, `joinRight`, `joinBody`, `joinJoin` - `bodyLeft`, `bodyRight`, `bodyJoin` - `headerJoin` ```js const data = [ ['0A', '0B', '0C'], ['1A', '1B', '1C'], ['2A', '2B', '2C'] ]; const config = { border: { topBody: `─`, topJoin: `┬`, topLeft: `┌`, topRight: `┐`, bottomBody: `─`, bottomJoin: `┴`, bottomLeft: `└`, bottomRight: `┘`, bodyLeft: `│`, bodyRight: `│`, bodyJoin: `│`, joinBody: `─`, joinLeft: `├`, joinRight: `┤`, joinJoin: `┼` } }; console.log(table(data, config)); ``` ``` ┌────┬────┬────┐ │ 0A │ 0B │ 0C │ ├────┼────┼────┤ │ 1A │ 1B │ 1C │ ├────┼────┼────┤ │ 2A │ 2B │ 2C │ └────┴────┴────┘ ``` <a name="table-api-table-1-config-drawverticalline"></a> ##### config.drawVerticalLine Type: `(lineIndex: number, columnCount: number) => boolean`\ Default: `() => true` It is used to tell whether to draw a vertical line. This callback is called for each vertical border of the table. If the table has `n` columns, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively. ```js const data = [ ['0A', '0B', '0C'], ['1A', '1B', '1C'], ['2A', '2B', '2C'], ['3A', '3B', '3C'], ['4A', '4B', '4C'] ]; const config = { drawVerticalLine: (lineIndex, columnCount) => { return lineIndex === 0 || lineIndex === columnCount; } }; console.log(table(data, config)); ``` ``` ╔════════════╗ ║ 0A 0B 0C ║ ╟────────────╢ ║ 1A 1B 1C ║ ╟────────────╢ ║ 2A 2B 2C ║ ╟────────────╢ ║ 3A 3B 3C ║ ╟────────────╢ ║ 4A 4B 4C ║ ╚════════════╝ ``` <a name="table-api-table-1-config-drawhorizontalline"></a> ##### config.drawHorizontalLine Type: `(lineIndex: number, rowCount: number) => boolean`\ Default: `() => true` It is used to tell whether to draw a horizontal line. This callback is called for each horizontal border of the table. If the table has `n` rows, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively. If the table has `n` rows and contains the header, then the range will be `[0, n+1]` inclusively. ```js const data = [ ['0A', '0B', '0C'], ['1A', '1B', '1C'], ['2A', '2B', '2C'], ['3A', '3B', '3C'], ['4A', '4B', '4C'] ]; const config = { drawHorizontalLine: (lineIndex, rowCount) => { return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount - 1 || lineIndex === rowCount; } }; console.log(table(data, config)); ``` ``` ╔════╤════╤════╗ ║ 0A │ 0B │ 0C ║ ╟────┼────┼────╢ ║ 1A │ 1B │ 1C ║ ║ 2A │ 2B │ 2C ║ ║ 3A │ 3B │ 3C ║ ╟────┼────┼────╢ ║ 4A │ 4B │ 4C ║ ╚════╧════╧════╝ ``` <a name="table-api-table-1-config-singleline"></a> ##### config.singleLine Type: `boolean`\ Default: `false` If `true`, horizontal lines inside the table are not drawn. This option also overrides the `config.drawHorizontalLine` if specified. ```js const data = [ ['-rw-r--r--', '1', 'pandorym', 'staff', '1529', 'May 23 11:25', 'LICENSE'], ['-rw-r--r--', '1', 'pandorym', 'staff', '16327', 'May 23 11:58', 'README.md'], ['drwxr-xr-x', '76', 'pandorym', 'staff', '2432', 'May 23 12:02', 'dist'], ['drwxr-xr-x', '634', 'pandorym', 'staff', '20288', 'May 23 11:54', 'node_modules'], ['-rw-r--r--', '1,', 'pandorym', 'staff', '525688', 'May 23 11:52', 'package-lock.json'], ['-rw-r--r--@', '1', 'pandorym', 'staff', '2440', 'May 23 11:25', 'package.json'], ['drwxr-xr-x', '27', 'pandorym', 'staff', '864', 'May 23 11:25', 'src'], ['drwxr-xr-x', '20', 'pandorym', 'staff', '640', 'May 23 11:25', 'test'], ]; const config = { singleLine: true }; console.log(table(data, config)); ``` ``` ╔═════════════╤═════╤══════════╤═══════╤════════╤══════════════╤═══════════════════╗ ║ -rw-r--r-- │ 1 │ pandorym │ staff │ 1529 │ May 23 11:25 │ LICENSE ║ ║ -rw-r--r-- │ 1 │ pandorym │ staff │ 16327 │ May 23 11:58 │ README.md ║ ║ drwxr-xr-x │ 76 │ pandorym │ staff │ 2432 │ May 23 12:02 │ dist ║ ║ drwxr-xr-x │ 634 │ pandorym │ staff │ 20288 │ May 23 11:54 │ node_modules ║ ║ -rw-r--r-- │ 1, │ pandorym │ staff │ 525688 │ May 23 11:52 │ package-lock.json ║ ║ -rw-r--r--@ │ 1 │ pandorym │ staff │ 2440 │ May 23 11:25 │ package.json ║ ║ drwxr-xr-x │ 27 │ pandorym │ staff │ 864 │ May 23 11:25 │ src ║ ║ drwxr-xr-x │ 20 │ pandorym │ staff │ 640 │ May 23 11:25 │ test ║ ╚═════════════╧═════╧══════════╧═══════╧════════╧══════════════╧═══════════════════╝ ``` <a name="table-api-table-1-config-columns"></a> ##### config.columns Type: `Column[] | { [columnIndex: number]: Column }` Column specific configurations. <a name="table-api-table-1-config-columns-config-columns-width"></a> ###### config.columns[*].width Type: `number`\ Default: the maximum cell widths of the column Column width (excluding the paddings). ```js const data = [ ['0A', '0B', '0C'], ['1A', '1B', '1C'], ['2A', '2B', '2C'] ]; const config = { columns: { 1: { width: 10 } } }; console.log(table(data, config)); ``` ``` ╔════╤════════════╤════╗ ║ 0A │ 0B │ 0C ║ ╟────┼────────────┼────╢ ║ 1A │ 1B │ 1C ║ ╟────┼────────────┼────╢ ║ 2A │ 2B │ 2C ║ ╚════╧════════════╧════╝ ``` <a name="table-api-table-1-config-columns-config-columns-alignment"></a> ###### config.columns[*].alignment Type: `'center' | 'justify' | 'left' | 'right'`\ Default: `'left'` Cell content horizontal alignment ```js const data = [ ['0A', '0B', '0C', '0D 0E 0F'], ['1A', '1B', '1C', '1D 1E 1F'], ['2A', '2B', '2C', '2D 2E 2F'], ]; const config = { columnDefault: { width: 10, }, columns: [ { alignment: 'left' }, { alignment: 'center' }, { alignment: 'right' }, { alignment: 'justify' } ], }; console.log(table(data, config)); ``` ``` ╔════════════╤════════════╤════════════╤════════════╗ ║ 0A │ 0B │ 0C │ 0D 0E 0F ║ ╟────────────┼────────────┼────────────┼────────────╢ ║ 1A │ 1B │ 1C │ 1D 1E 1F ║ ╟────────────┼────────────┼────────────┼────────────╢ ║ 2A │ 2B │ 2C │ 2D 2E 2F ║ ╚════════════╧════════════╧════════════╧════════════╝ ``` <a name="table-api-table-1-config-columns-config-columns-verticalalignment"></a> ###### config.columns[*].verticalAlignment Type: `'top' | 'middle' | 'bottom'`\ Default: `'top'` Cell content vertical alignment ```js const data = [ ['A', 'B', 'C', 'DEF'], ]; const config = { columnDefault: { width: 1, }, columns: [ { verticalAlignment: 'top' }, { verticalAlignment: 'middle' }, { verticalAlignment: 'bottom' }, ], }; console.log(table(data, config)); ``` ``` ╔═══╤═══╤═══╤═══╗ ║ A │ │ │ D ║ ║ │ B │ │ E ║ ║ │ │ C │ F ║ ╚═══╧═══╧═══╧═══╝ ``` <a name="table-api-table-1-config-columns-config-columns-paddingleft"></a> ###### config.columns[*].paddingLeft Type: `number`\ Default: `1` The number of whitespaces used to pad the content on the left. <a name="table-api-table-1-config-columns-config-columns-paddingright"></a> ###### config.columns[*].paddingRight Type: `number`\ Default: `1` The number of whitespaces used to pad the content on the right. The `paddingLeft` and `paddingRight` options do not count on the column width. So the column has `width = 5`, `paddingLeft = 2` and `paddingRight = 2` will have the total width is `9`. ```js const data = [ ['0A', 'AABBCC', '0C'], ['1A', '1B', '1C'], ['2A', '2B', '2C'] ]; const config = { columns: [ { paddingLeft: 3 }, { width: 2, paddingRight: 3 } ] }; console.log(table(data, config)); ``` ``` ╔══════╤══════╤════╗ ║ 0A │ AA │ 0C ║ ║ │ BB │ ║ ║ │ CC │ ║ ╟──────┼──────┼────╢ ║ 1A │ 1B │ 1C ║ ╟──────┼──────┼────╢ ║ 2A │ 2B │ 2C ║ ╚══════╧══════╧════╝ ``` <a name="table-api-table-1-config-columns-config-columns-truncate"></a> ###### config.columns[*].truncate Type: `number`\ Default: `Infinity` The number of characters is which the content will be truncated. To handle a content that overflows the container width, `table` package implements [text wrapping](#config.columns[*].wrapWord). However, sometimes you may want to truncate content that is too long to be displayed in the table. ```js const data = [ ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] ]; const config = { columns: [ { width: 20, truncate: 100 } ] }; console.log(table(data, config)); ``` ``` ╔══════════════════════╗ ║ Lorem ipsum dolor si ║ ║ t amet, consectetur ║ ║ adipiscing elit. Pha ║ ║ sellus pulvinar nibh ║ ║ sed mauris convall… ║ ╚══════════════════════╝ ``` <a name="table-api-table-1-config-columns-config-columns-wrapword"></a> ###### config.columns[*].wrapWord Type: `boolean`\ Default: `false` The `table` package implements auto text wrapping, i.e., text that has the width greater than the container width will be separated into multiple lines at the nearest space or one of the special characters: `\|/_.,;-`. When `wrapWord` is `false`: ```js const data = [ ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] ]; const config = { columns: [ { width: 20 } ] }; console.log(table(data, config)); ``` ``` ╔══════════════════════╗ ║ Lorem ipsum dolor si ║ ║ t amet, consectetur ║ ║ adipiscing elit. Pha ║ ║ sellus pulvinar nibh ║ ║ sed mauris convallis ║ ║ dapibus. Nunc venena ║ ║ tis tempus nulla sit ║ ║ amet viverra. ║ ╚══════════════════════╝ ``` When `wrapWord` is `true`: ``` ╔══════════════════════╗ ║ Lorem ipsum dolor ║ ║ sit amet, ║ ║ consectetur ║ ║ adipiscing elit. ║ ║ Phasellus pulvinar ║ ║ nibh sed mauris ║ ║ convallis dapibus. ║ ║ Nunc venenatis ║ ║ tempus nulla sit ║ ║ amet viverra. ║ ╚══════════════════════╝ ``` <a name="table-api-table-1-config-columndefault"></a> ##### config.columnDefault Type: `Column`\ Default: `{}` The default configuration for all columns. Column-specific settings will overwrite the default values. <a name="table-api-table-1-config-header"></a> ##### config.header Type: `object` Header configuration. *Deprecated in favor of the new spanning cells API.* The header configuration inherits the most of the column's, except: - `content` **{string}**: the header content. - `width:` calculate based on the content width automatically. - `alignment:` `center` be default. - `verticalAlignment:` is not supported. - `config.border.topJoin` will be `config.border.topBody` for prettier. ```js const data = [ ['0A', '0B', '0C'], ['1A', '1B', '1C'], ['2A', '2B', '2C'], ]; const config = { columnDefault: { width: 10, }, header: { alignment: 'center', content: 'THE HEADER\nThis is the table about something', }, } console.log(table(data, config)); ``` ``` ╔══════════════════════════════════════╗ ║ THE HEADER ║ ║ This is the table about something ║ ╟────────────┬────────────┬────────────╢ ║ 0A │ 0B │ 0C ║ ╟────────────┼────────────┼────────────╢ ║ 1A │ 1B │ 1C ║ ╟────────────┼────────────┼────────────╢ ║ 2A │ 2B │ 2C ║ ╚════════════╧════════════╧════════════╝ ``` <a name="table-api-table-1-config-spanningcells"></a> ##### config.spanningCells Type: `SpanningCellConfig[]` Spanning cells configuration. The configuration should be straightforward: just specify an array of minimal cell configurations including the position of top-left cell and the number of columns and/or rows will be expanded from it. The content of overlap cells will be ignored to make the `data` shape be consistent. By default, the configuration of column that the top-left cell belongs to will be applied to the whole spanning cell, except: * The `width` will be summed up of all spanning columns. * The `paddingRight` will be received from the right-most column intentionally. Advances customized column-like styles can be configurable to each spanning cell to overwrite the default behavior. ```js const data = [ ['Test Coverage Report', '', '', '', '', ''], ['Module', 'Component', 'Test Cases', 'Failures', 'Durations', 'Success Rate'], ['Services', 'User', '50', '30', '3m 7s', '60.0%'], ['', 'Payment', '100', '80', '7m 15s', '80.0%'], ['Subtotal', '', '150', '110', '10m 22s', '73.3%'], ['Controllers', 'User', '24', '18', '1m 30s', '75.0%'], ['', 'Payment', '30', '24', '50s', '80.0%'], ['Subtotal', '', '54', '42', '2m 20s', '77.8%'], ['Total', '', '204', '152', '12m 42s', '74.5%'], ]; const config = { columns: [ { alignment: 'center', width: 12 }, { alignment: 'center', width: 10 }, { alignment: 'right' }, { alignment: 'right' }, { alignment: 'right' }, { alignment: 'right' } ], spanningCells: [ { col: 0, row: 0, colSpan: 6 }, { col: 0, row: 2, rowSpan: 2, verticalAlignment: 'middle'}, { col: 0, row: 4, colSpan: 2, alignment: 'right'}, { col: 0, row: 5, rowSpan: 2, verticalAlignment: 'middle'}, { col: 0, row: 7, colSpan: 2, alignment: 'right' }, { col: 0, row: 8, colSpan: 2, alignment: 'right' } ], }; console.log(table(data, config)); ``` ``` ╔══════════════════════════════════════════════════════════════════════════════╗ ║ Test Coverage Report ║ ╟──────────────┬────────────┬────────────┬──────────┬───────────┬──────────────╢ ║ Module │ Component │ Test Cases │ Failures │ Durations │ Success Rate ║ ╟──────────────┼────────────┼────────────┼──────────┼───────────┼──────────────╢ ║ │ User │ 50 │ 30 │ 3m 7s │ 60.0% ║ ║ Services ├────────────┼────────────┼──────────┼───────────┼──────────────╢ ║ │ Payment │ 100 │ 80 │ 7m 15s │ 80.0% ║ ╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢ ║ Subtotal │ 150 │ 110 │ 10m 22s │ 73.3% ║ ╟──────────────┬────────────┼────────────┼──────────┼───────────┼──────────────╢ ║ │ User │ 24 │ 18 │ 1m 30s │ 75.0% ║ ║ Controllers ├────────────┼────────────┼──────────┼───────────┼──────────────╢ ║ │ Payment │ 30 │ 24 │ 50s │ 80.0% ║ ╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢ ║ Subtotal │ 54 │ 42 │ 2m 20s │ 77.8% ║ ╟───────────────────────────┼────────────┼──────────┼───────────┼──────────────╢ ║ Total │ 204 │ 152 │ 12m 42s │ 74.5% ║ ╚═══════════════════════════╧════════════╧══════════╧═══════════╧══════════════╝ ``` <a name="table-api-createstream"></a> ### createStream `table` package exports `createStream` function used to draw a table and append rows. **Parameter:** - _**config:**_ the same as `table`'s, except `config.columnDefault.width` and `config.columnCount` must be provided. ```js import { createStream } from 'table'; const config = { columnDefault: { width: 50 }, columnCount: 1 }; const stream = createStream(config); setInterval(() => { stream.write([new Date()]); }, 500); ``` ![Streaming current date.](./.README/api/stream/streaming.gif) `table` package uses ANSI escape codes to overwrite the output of the last line when a new row is printed. The underlying implementation is explained in this [Stack Overflow answer](http://stackoverflow.com/a/32938658/368691). Streaming supports all of the configuration properties and functionality of a static table (such as auto text wrapping, alignment and padding), e.g. ```js import { createStream } from 'table'; import _ from 'lodash'; const config = { columnDefault: { width: 50 }, columnCount: 3, columns: [ { width: 10, alignment: 'right' }, { alignment: 'center' }, { width: 10 } ] }; const stream = createStream(config); let i = 0; setInterval(() => { let random; random = _.sample('abcdefghijklmnopqrstuvwxyz', _.random(1, 30)).join(''); stream.write([i++, new Date(), random]); }, 500); ``` ![Streaming random data.](./.README/api/stream/streaming-random.gif) <a name="table-api-getbordercharacters"></a> ### getBorderCharacters **Parameter:** - **_template_** - Type: `'honeywell' | 'norc' | 'ramac' | 'void'` - Required: `true` You can load one of the predefined border templates using `getBorderCharacters` function. ```js import { table, getBorderCharacters } from 'table'; const data = [ ['0A', '0B', '0C'], ['1A', '1B', '1C'], ['2A', '2B', '2C'] ]; const config = { border: getBorderCharacters(`name of the template`) }; console.log(table(data, config)); ``` ``` # honeywell ╔════╤════╤════╗ ║ 0A │ 0B │ 0C ║ ╟────┼────┼────╢ ║ 1A │ 1B │ 1C ║ ╟────┼────┼────╢ ║ 2A │ 2B │ 2C ║ ╚════╧════╧════╝ # norc ┌────┬────┬────┐ │ 0A │ 0B │ 0C │ ├────┼────┼────┤ │ 1A │ 1B │ 1C │ ├────┼────┼────┤ │ 2A │ 2B │ 2C │ └────┴────┴────┘ # ramac (ASCII; for use in terminals that do not support Unicode characters) +----+----+----+ | 0A | 0B | 0C | |----|----|----| | 1A | 1B | 1C | |----|----|----| | 2A | 2B | 2C | +----+----+----+ # void (no borders; see "borderless table" section of the documentation) 0A 0B 0C 1A 1B 1C 2A 2B 2C ``` Raise [an issue](https://github.com/gajus/table/issues) if you'd like to contribute a new border template. <a name="table-api-getbordercharacters-borderless-table"></a> #### Borderless Table Simply using `void` border character template creates a table with a lot of unnecessary spacing. To create a more pleasant to the eye table, reset the padding and remove the joining rows, e.g. ```js const output = table(data, { border: getBorderCharacters('void'), columnDefault: { paddingLeft: 0, paddingRight: 1 }, drawHorizontalLine: () => false } ); console.log(output); ``` ``` 0A 0B 0C 1A 1B 1C 2A 2B 2C ``` # Web IDL Type Conversions on JavaScript Values This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [Web IDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types). The goal is that you should be able to write code like ```js "use strict"; const conversions = require("webidl-conversions"); function doStuff(x, y) { x = conversions["boolean"](x); y = conversions["unsigned long"](y); // actual algorithm code here } ``` and your function `doStuff` will behave the same as a Web IDL operation declared as ```webidl void doStuff(boolean x, unsigned long y); ``` ## API This package's main module's default export is an object with a variety of methods, each corresponding to a different Web IDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the Web IDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the Web IDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float). Each method also accepts a second, optional, parameter for miscellaneous options. For conversion methods that throw errors, a string option `{ context }` may be provided to provide more information in the error message. (For example, `conversions["float"](NaN, { context: "Argument 1 of Interface's operation" })` will throw an error with message `"Argument 1 of Interface's operation is not a finite floating-point value."`) Specific conversions may also accept other options, the details of which can be found below. ## Conversions implemented Conversions for all of the basic types from the Web IDL specification are implemented: - [`any`](https://heycam.github.io/webidl/#es-any) - [`void`](https://heycam.github.io/webidl/#es-void) - [`boolean`](https://heycam.github.io/webidl/#es-boolean) - [Integer types](https://heycam.github.io/webidl/#es-integer-types), which can additionally be provided the boolean options `{ clamp, enforceRange }` as a second parameter - [`float`](https://heycam.github.io/webidl/#es-float), [`unrestricted float`](https://heycam.github.io/webidl/#es-unrestricted-float) - [`double`](https://heycam.github.io/webidl/#es-double), [`unrestricted double`](https://heycam.github.io/webidl/#es-unrestricted-double) - [`DOMString`](https://heycam.github.io/webidl/#es-DOMString), which can additionally be provided the boolean option `{ treatNullAsEmptyString }` as a second parameter - [`ByteString`](https://heycam.github.io/webidl/#es-ByteString), [`USVString`](https://heycam.github.io/webidl/#es-USVString) - [`object`](https://heycam.github.io/webidl/#es-object) - [`Error`](https://heycam.github.io/webidl/#es-Error) - [Buffer source types](https://heycam.github.io/webidl/#es-buffer-source-types) Additionally, for convenience, the following derived type definitions are implemented: - [`ArrayBufferView`](https://heycam.github.io/webidl/#ArrayBufferView) - [`BufferSource`](https://heycam.github.io/webidl/#BufferSource) - [`DOMTimeStamp`](https://heycam.github.io/webidl/#DOMTimeStamp) - [`Function`](https://heycam.github.io/webidl/#Function) - [`VoidFunction`](https://heycam.github.io/webidl/#VoidFunction) (although it will not censor the return type) Derived types, such as nullable types, promise types, sequences, records, etc. are not handled by this library. You may wish to investigate the [webidl2js](https://github.com/jsdom/webidl2js) project. ### A note on the `long long` types The `long long` and `unsigned long long` Web IDL types can hold values that cannot be stored in JavaScript numbers, so the conversion is imperfect. For example, converting the JavaScript number `18446744073709552000` to a Web IDL `long long` is supposed to produce the Web IDL value `-18446744073709551232`. Since we are representing our Web IDL values in JavaScript, we can't represent `-18446744073709551232`, so we instead the best we could do is `-18446744073709552000` as the output. This library actually doesn't even get that far. Producing those results would require doing accurate modular arithmetic on 64-bit intermediate values, but JavaScript does not make this easy. We could pull in a big-integer library as a dependency, but in lieu of that, we for now have decided to just produce inaccurate results if you pass in numbers that are not strictly between `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER`. ## Background What's actually going on here, conceptually, is pretty weird. Let's try to explain. Web IDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on Web IDL values, i.e. instances of Web IDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a Web IDL value of [Web IDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules. Separately from its type system, Web IDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given Web IDL operation, how does that get converted into a Web IDL value? For example, a JavaScript `true` passed in the position of a Web IDL `boolean` argument becomes a Web IDL `true`. But, a JavaScript `true` passed in the position of a [Web IDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a Web IDL `1`. And so on. Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the Web IDL algorithms, they don't actually use Web IDL values, since those aren't "real" outside of specs. Instead, implementations apply the Web IDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`. The upside of all this is that implementations can abstract all the conversion logic away, letting Web IDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of Web IDL, in a nutshell. And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given Web IDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ Web IDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ Web IDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a Web IDL `1` in an unsigned long context, which then becomes a JavaScript `1`. ## Don't use this Seriously, why would you ever use this? You really shouldn't. Web IDL is … strange, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from Web IDL. In general, your JavaScript should not be trying to become more like Web IDL; if anything, we should fix Web IDL to make it more like JavaScript. The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in Web IDL. Its main consumer is the [jsdom](https://github.com/tmpvar/jsdom) project. # binary-install Install .tar.gz binary applications via npm ## Usage This library provides a single class `Binary` that takes a download url and some optional arguments. You **must** provide either `name` or `installDirectory` when creating your `Binary`. | option | decription | | ---------------- | --------------------------------------------- | | name | The name of your binary | | installDirectory | A path to the directory to install the binary | If an `installDirectory` is not provided, the binary will be installed at your OS specific config directory. On MacOS it defaults to `~/Library/Preferences/${name}-nodejs` After your `Binary` has been created, you can run `.install()` to install the binary, and `.run()` to run it. ### Example This is meant to be used as a library - create your `Binary` with your desired options, then call `.install()` in the `postinstall` of your `package.json`, `.run()` in the `bin` section of your `package.json`, and `.uninstall()` in the `preuninstall` section of your `package.json`. See [this example project](/example) to see how to create an npm package that installs and runs a binary using the Github releases API. # safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] [travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg [travis-url]: https://travis-ci.org/feross/safe-buffer [npm-image]: https://img.shields.io/npm/v/safe-buffer.svg [npm-url]: https://npmjs.org/package/safe-buffer [downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg [downloads-url]: https://npmjs.org/package/safe-buffer [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg [standard-url]: https://standardjs.com #### Safer Node.js Buffer API **Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, `Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** **Uses the built-in implementation when available.** ## install ``` npm install safe-buffer ``` ## usage The goal of this package is to provide a safe replacement for the node.js `Buffer`. It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to the top of your node.js modules: ```js var Buffer = require('safe-buffer').Buffer // Existing buffer code will continue to work without issues: new Buffer('hey', 'utf8') new Buffer([1, 2, 3], 'utf8') new Buffer(obj) new Buffer(16) // create an uninitialized buffer (potentially unsafe) // But you can use these new explicit APIs to make clear what you want: Buffer.from('hey', 'utf8') // convert from many types to a Buffer Buffer.alloc(16) // create a zero-filled buffer (safe) Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) ``` ## api ### Class Method: Buffer.from(array) <!-- YAML added: v3.0.0 --> * `array` {Array} Allocates a new `Buffer` using an `array` of octets. ```js const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); // creates a new Buffer containing ASCII bytes // ['b','u','f','f','e','r'] ``` A `TypeError` will be thrown if `array` is not an `Array`. ### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) <!-- YAML added: v5.10.0 --> * `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or a `new ArrayBuffer()` * `byteOffset` {Number} Default: `0` * `length` {Number} Default: `arrayBuffer.length - byteOffset` When passed a reference to the `.buffer` property of a `TypedArray` instance, the newly created `Buffer` will share the same allocated memory as the TypedArray. ```js const arr = new Uint16Array(2); arr[0] = 5000; arr[1] = 4000; const buf = Buffer.from(arr.buffer); // shares the memory with arr; console.log(buf); // Prints: <Buffer 88 13 a0 0f> // changing the TypedArray changes the Buffer also arr[1] = 6000; console.log(buf); // Prints: <Buffer 88 13 70 17> ``` The optional `byteOffset` and `length` arguments specify a memory range within the `arrayBuffer` that will be shared by the `Buffer`. ```js const ab = new ArrayBuffer(10); const buf = Buffer.from(ab, 0, 2); console.log(buf.length); // Prints: 2 ``` A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. ### Class Method: Buffer.from(buffer) <!-- YAML added: v3.0.0 --> * `buffer` {Buffer} Copies the passed `buffer` data onto a new `Buffer` instance. ```js const buf1 = Buffer.from('buffer'); const buf2 = Buffer.from(buf1); buf1[0] = 0x61; console.log(buf1.toString()); // 'auffer' console.log(buf2.toString()); // 'buffer' (copy is not changed) ``` A `TypeError` will be thrown if `buffer` is not a `Buffer`. ### Class Method: Buffer.from(str[, encoding]) <!-- YAML added: v5.10.0 --> * `str` {String} String to encode. * `encoding` {String} Encoding to use, Default: `'utf8'` Creates a new `Buffer` containing the given JavaScript string `str`. If provided, the `encoding` parameter identifies the character encoding. If not provided, `encoding` defaults to `'utf8'`. ```js const buf1 = Buffer.from('this is a tést'); console.log(buf1.toString()); // prints: this is a tést console.log(buf1.toString('ascii')); // prints: this is a tC)st const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); console.log(buf2.toString()); // prints: this is a tést ``` A `TypeError` will be thrown if `str` is not a string. ### Class Method: Buffer.alloc(size[, fill[, encoding]]) <!-- YAML added: v5.10.0 --> * `size` {Number} * `fill` {Value} Default: `undefined` * `encoding` {String} Default: `utf8` Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the `Buffer` will be *zero-filled*. ```js const buf = Buffer.alloc(5); console.log(buf); // <Buffer 00 00 00 00 00> ``` The `size` must be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will be created if a `size` less than or equal to 0 is specified. If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. See [`buf.fill()`][] for more information. ```js const buf = Buffer.alloc(5, 'a'); console.log(buf); // <Buffer 61 61 61 61 61> ``` If both `fill` and `encoding` are specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill, encoding)`. For example: ```js const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); console.log(buf); // <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64> ``` Calling `Buffer.alloc(size)` can be significantly slower than the alternative `Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance contents will *never contain sensitive data*. A `TypeError` will be thrown if `size` is not a number. ### Class Method: Buffer.allocUnsafe(size) <!-- YAML added: v5.10.0 --> * `size` {Number} Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will be created if a `size` less than or equal to 0 is specified. The underlying memory for `Buffer` instances created in this way is *not initialized*. The contents of the newly created `Buffer` are unknown and *may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such `Buffer` instances to zeroes. ```js const buf = Buffer.allocUnsafe(5); console.log(buf); // <Buffer 78 e0 82 02 01> // (octets will be different, every time) buf.fill(0); console.log(buf); // <Buffer 00 00 00 00 00> ``` A `TypeError` will be thrown if `size` is not a number. Note that the `Buffer` module pre-allocates an internal `Buffer` instance of size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated `new Buffer(size)` constructor) only when `size` is less than or equal to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default value of `Buffer.poolSize` is `8192` but can be modified. Use of this pre-allocated internal memory pool is a key difference between calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The difference is subtle but can be important when an application requires the additional performance that `Buffer.allocUnsafe(size)` provides. ### Class Method: Buffer.allocUnsafeSlow(size) <!-- YAML added: v5.10.0 --> * `size` {Number} Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The `size` must be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will be created if a `size` less than or equal to 0 is specified. The underlying memory for `Buffer` instances created in this way is *not initialized*. The contents of the newly created `Buffer` are unknown and *may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such `Buffer` instances to zeroes. When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, allocations under 4KB are, by default, sliced from a single pre-allocated `Buffer`. This allows applications to avoid the garbage collection overhead of creating many individually allocated Buffers. This approach improves both performance and memory usage by eliminating the need to track and cleanup as many `Persistent` objects. However, in the case where a developer may need to retain a small chunk of memory from a pool for an indeterminate amount of time, it may be appropriate to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then copy out the relevant bits. ```js // need to keep around a few small chunks of memory const store = []; socket.on('readable', () => { const data = socket.read(); // allocate for retained data const sb = Buffer.allocUnsafeSlow(10); // copy the data into the new allocation data.copy(sb, 0, 0, 10); store.push(sb); }); ``` Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* a developer has observed undue memory retention in their applications. A `TypeError` will be thrown if `size` is not a number. ### All the Rest The rest of the `Buffer` API is exactly the same as in node.js. [See the docs](https://nodejs.org/api/buffer.html). ## Related links - [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) - [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) ## Why is `Buffer` unsafe? Today, the node.js `Buffer` constructor is overloaded to handle many different argument types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), `ArrayBuffer`, and also `Number`. The API is optimized for convenience: you can throw any type at it, and it will try to do what you want. Because the Buffer constructor is so powerful, you often see code like this: ```js // Convert UTF-8 strings to hex function toHex (str) { return new Buffer(str).toString('hex') } ``` ***But what happens if `toHex` is called with a `Number` argument?*** ### Remote Memory Disclosure If an attacker can make your program call the `Buffer` constructor with a `Number` argument, then they can make it allocate uninitialized memory from the node.js process. This could potentially disclose TLS private keys, user data, or database passwords. When the `Buffer` constructor is passed a `Number` argument, it returns an **UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like this, you **MUST** overwrite the contents before returning it to the user. From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): > `new Buffer(size)` > > - `size` Number > > The underlying memory for `Buffer` instances created in this way is not initialized. > **The contents of a newly created `Buffer` are unknown and could contain sensitive > data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. (Emphasis our own.) Whenever the programmer intended to create an uninitialized `Buffer` you often see code like this: ```js var buf = new Buffer(16) // Immediately overwrite the uninitialized buffer with data from another buffer for (var i = 0; i < buf.length; i++) { buf[i] = otherBuf[i] } ``` ### Would this ever be a problem in real code? Yes. It's surprisingly common to forget to check the type of your variables in a dynamically-typed language like JavaScript. Usually the consequences of assuming the wrong type is that your program crashes with an uncaught exception. But the failure mode for forgetting to check the type of arguments to the `Buffer` constructor is more catastrophic. Here's an example of a vulnerable service that takes a JSON payload and converts it to hex: ```js // Take a JSON payload {str: "some string"} and convert it to hex var server = http.createServer(function (req, res) { var data = '' req.setEncoding('utf8') req.on('data', function (chunk) { data += chunk }) req.on('end', function () { var body = JSON.parse(data) res.end(new Buffer(body.str).toString('hex')) }) }) server.listen(8080) ``` In this example, an http client just has to send: ```json { "str": 1000 } ``` and it will get back 1,000 bytes of uninitialized memory from the server. This is a very serious bug. It's similar in severity to the [the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process memory by remote attackers. ### Which real-world packages were vulnerable? #### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) [Mathias Buus](https://github.com/mafintosh) and I ([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get them to reveal 20 bytes at a time of uninitialized memory from the node.js process. Here's [the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) that fixed it. We released a new fixed version, created a [Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all vulnerable versions on npm so users will get a warning to upgrade to a newer version. #### [`ws`](https://www.npmjs.com/package/ws) That got us wondering if there were other vulnerable packages. Sure enough, within a short period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the most popular WebSocket implementation in node.js. If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as expected, then uninitialized server memory would be disclosed to the remote peer. These were the vulnerable methods: ```js socket.send(number) socket.ping(number) socket.pong(number) ``` Here's a vulnerable socket server with some echo functionality: ```js server.on('connection', function (socket) { socket.on('message', function (message) { message = JSON.parse(message) if (message.type === 'echo') { socket.send(message.data) // send back the user's message } }) }) ``` `socket.send(number)` called on the server, will disclose server memory. Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue was fixed, with a more detailed explanation. Props to [Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the [Node Security Project disclosure](https://nodesecurity.io/advisories/67). ### What's the solution? It's important that node.js offers a fast way to get memory otherwise performance-critical applications would needlessly get a lot slower. But we need a better way to *signal our intent* as programmers. **When we want uninitialized memory, we should request it explicitly.** Sensitive functionality should not be packed into a developer-friendly API that loosely accepts many different types. This type of API encourages the lazy practice of passing variables in without checking the type very carefully. #### A new API: `Buffer.allocUnsafe(number)` The functionality of creating buffers with uninitialized memory should be part of another API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that frequently gets user input of all sorts of different types passed into it. ```js var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! // Immediately overwrite the uninitialized buffer with data from another buffer for (var i = 0; i < buf.length; i++) { buf[i] = otherBuf[i] } ``` ### How do we fix node.js core? We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as `semver-major`) which defends against one case: ```js var str = 16 new Buffer(str, 'utf8') ``` In this situation, it's implied that the programmer intended the first argument to be a string, since they passed an encoding as a second argument. Today, node.js will allocate uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not what the programmer intended. But this is only a partial solution, since if the programmer does `new Buffer(variable)` (without an `encoding` parameter) there's no way to know what they intended. If `variable` is sometimes a number, then uninitialized memory will sometimes be returned. ### What's the real long-term fix? We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when we need uninitialized memory. But that would break 1000s of packages. ~~We believe the best solution is to:~~ ~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ ~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ #### Update We now support adding three new APIs: - `Buffer.from(value)` - convert from any type to a buffer - `Buffer.alloc(size)` - create a zero-filled buffer - `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size This solves the core problem that affected `ws` and `bittorrent-dht` which is `Buffer(variable)` getting tricked into taking a number argument. This way, existing code continues working and the impact on the npm ecosystem will be minimal. Over time, npm maintainers can migrate performance-critical code to use `Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. ### Conclusion We think there's a serious design issue with the `Buffer` API as it exists today. It promotes insecure software by putting high-risk functionality into a convenient API with friendly "developer ergonomics". This wasn't merely a theoretical exercise because we found the issue in some of the most popular npm packages. Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of `buffer`. ```js var Buffer = require('safe-buffer').Buffer ``` Eventually, we hope that node.js core can switch to this new, safer behavior. We believe the impact on the ecosystem would be minimal since it's not a breaking change. Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while older, insecure packages would magically become safe from this attack vector. ## links - [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) - [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) - [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) ## credit The original issues in `bittorrent-dht` ([disclosure](https://nodesecurity.io/advisories/68)) and `ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by [Mathias Buus](https://github.com/mafintosh) and [Feross Aboukhadijeh](http://feross.org/). Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues and for his work running the [Node Security Project](https://nodesecurity.io/). Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and auditing the code. ## license MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) [![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) [![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) [![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) [![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) **Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) parser written in ECMAScript (also popularly known as [JavaScript](https://en.wikipedia.org/wiki/JavaScript)). Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), with the help of [many contributors](https://github.com/jquery/esprima/contributors). ### Features - Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) - Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) - Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) - Optional tracking of syntax node location (index-based and line-column) - [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) ### API Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. A simple example on Node.js REPL: ```javascript > var esprima = require('esprima'); > var program = 'const answer = 42'; > esprima.tokenize(program); [ { type: 'Keyword', value: 'const' }, { type: 'Identifier', value: 'answer' }, { type: 'Punctuator', value: '=' }, { type: 'Numeric', value: '42' } ] > esprima.parseScript(program); { type: 'Program', body: [ { type: 'VariableDeclaration', declarations: [Object], kind: 'const' } ], sourceType: 'script' } ``` For more information, please read the [complete documentation](http://esprima.org/doc). # eslint-visitor-keys [![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) [![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) [![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) [![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) Constants and utilities about visitor keys to traverse AST. ## 💿 Installation Use [npm] to install. ```bash $ npm install eslint-visitor-keys ``` ### Requirements - [Node.js] 4.0.0 or later. ## 📖 Usage ```js const evk = require("eslint-visitor-keys") ``` ### evk.KEYS > type: `{ [type: string]: string[] | undefined }` Visitor keys. This keys are frozen. This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. For example: ``` console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] ``` ### evk.getKeys(node) > type: `(node: object) => string[]` Get the visitor keys of a given AST node. This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. This will be used to traverse unknown nodes. For example: ``` const node = { type: "AssignmentExpression", left: { type: "Identifier", name: "foo" }, right: { type: "Literal", value: 0 } } console.log(evk.getKeys(node)) // → ["type", "left", "right"] ``` ### evk.unionWith(additionalKeys) > type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` Make the union set with `evk.KEYS` and the given keys. - The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. - It removes duplicated keys as keeping the first one. For example: ``` console.log(evk.unionWith({ MethodDefinition: ["decorators"] })) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } ``` ## 📰 Change log See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). ## 🍻 Contributing Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). ### Development commands - `npm test` runs tests and measures code coverage. - `npm run lint` checks source codes with ESLint. - `npm run coverage` opens the code coverage report of the previous test with your default browser. - `npm run release` publishes this package to [npm] registory. [npm]: https://www.npmjs.com/ [Node.js]: https://nodejs.org/en/ [ESTree]: https://github.com/estree/estree # ShellJS - Unix shell commands for Node.js [![Travis](https://img.shields.io/travis/shelljs/shelljs/master.svg?style=flat-square&label=unix)](https://travis-ci.org/shelljs/shelljs) [![AppVeyor](https://img.shields.io/appveyor/ci/shelljs/shelljs/master.svg?style=flat-square&label=windows)](https://ci.appveyor.com/project/shelljs/shelljs/branch/master) [![Codecov](https://img.shields.io/codecov/c/github/shelljs/shelljs/master.svg?style=flat-square&label=coverage)](https://codecov.io/gh/shelljs/shelljs) [![npm version](https://img.shields.io/npm/v/shelljs.svg?style=flat-square)](https://www.npmjs.com/package/shelljs) [![npm downloads](https://img.shields.io/npm/dm/shelljs.svg?style=flat-square)](https://www.npmjs.com/package/shelljs) ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts! ShellJS is proudly tested on every node release since `v4`! The project is [unit-tested](http://travis-ci.org/shelljs/shelljs) and battle-tested in projects like: + [Firebug](http://getfirebug.com/) - Firefox's infamous debugger + [JSHint](http://jshint.com) & [ESLint](http://eslint.org/) - popular JavaScript linters + [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers + [Yeoman](http://yeoman.io/) - Web application stack and development tool + [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation + And [many more](https://npmjs.org/browse/depended/shelljs). If you have feedback, suggestions, or need help, feel free to post in our [issue tracker](https://github.com/shelljs/shelljs/issues). Think ShellJS is cool? Check out some related projects in our [Wiki page](https://github.com/shelljs/shelljs/wiki)! Upgrading from an older version? Check out our [breaking changes](https://github.com/shelljs/shelljs/wiki/Breaking-Changes) page to see what changes to watch out for while upgrading. ## Command line use If you just want cross platform UNIX commands, checkout our new project [shelljs/shx](https://github.com/shelljs/shx), a utility to expose `shelljs` to the command line. For example: ``` $ shx mkdir -p foo $ shx touch foo/bar.txt $ shx rm -rf foo ``` ## Plugin API ShellJS now supports third-party plugins! You can learn more about using plugins and writing your own ShellJS commands in [the wiki](https://github.com/shelljs/shelljs/wiki/Using-ShellJS-Plugins). ## A quick note about the docs For documentation on all the latest features, check out our [README](https://github.com/shelljs/shelljs). To read docs that are consistent with the latest release, check out [the npm page](https://www.npmjs.com/package/shelljs) or [shelljs.org](http://documentup.com/shelljs/shelljs). ## Installing Via npm: ```bash $ npm install [-g] shelljs ``` ## Examples ```javascript var shell = require('shelljs'); if (!shell.which('git')) { shell.echo('Sorry, this script requires git'); shell.exit(1); } // Copy files to release dir shell.rm('-rf', 'out/Release'); shell.cp('-R', 'stuff/', 'out/Release'); // Replace macros in each .js file shell.cd('lib'); shell.ls('*.js').forEach(function (file) { shell.sed('-i', 'BUILD_VERSION', 'v0.1.2', file); shell.sed('-i', /^.*REMOVE_THIS_LINE.*$/, '', file); shell.sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, shell.cat('macro.js'), file); }); shell.cd('..'); // Run external tool synchronously if (shell.exec('git commit -am "Auto-commit"').code !== 0) { shell.echo('Error: Git commit failed'); shell.exit(1); } ``` ## Exclude options If you need to pass a parameter that looks like an option, you can do so like: ```js shell.grep('--', '-v', 'path/to/file'); // Search for "-v", no grep options shell.cp('-R', '-dir', 'outdir'); // If already using an option, you're done ``` ## Global vs. Local We no longer recommend using a global-import for ShellJS (i.e. `require('shelljs/global')`). While still supported for convenience, this pollutes the global namespace, and should therefore only be used with caution. Instead, we recommend a local import (standard for npm packages): ```javascript var shell = require('shelljs'); shell.echo('hello world'); ``` <!-- DO NOT MODIFY BEYOND THIS POINT - IT'S AUTOMATICALLY GENERATED --> ## Command reference All commands run synchronously, unless otherwise stated. All commands accept standard bash globbing characters (`*`, `?`, etc.), compatible with the [node `glob` module](https://github.com/isaacs/node-glob). For less-commonly used commands and features, please check out our [wiki page](https://github.com/shelljs/shelljs/wiki). ### cat([options,] file [, file ...]) ### cat([options,] file_array) Available options: + `-n`: number all output lines Examples: ```javascript var str = cat('file*.txt'); var str = cat('file1', 'file2'); var str = cat(['file1', 'file2']); // same as above ``` Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). ### cd([dir]) Changes to directory `dir` for the duration of the script. Changes to home directory if no argument is supplied. ### chmod([options,] octal_mode || octal_string, file) ### chmod([options,] symbolic_mode, file) Available options: + `-v`: output a diagnostic for every file processed + `-c`: like verbose, but report only when a change is made + `-R`: change files and directories recursively Examples: ```javascript chmod(755, '/Users/brandon'); chmod('755', '/Users/brandon'); // same as above chmod('u+x', '/Users/brandon'); chmod('-R', 'a-w', '/Users/brandon'); ``` Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions: + In symbolic modes, `a-r` and `-r` are identical. No consideration is given to the `umask`. + There is no "quiet" option, since default behavior is to run silent. ### cp([options,] source [, source ...], dest) ### cp([options,] source_array, dest) Available options: + `-f`: force (default behavior) + `-n`: no-clobber + `-u`: only copy if `source` is newer than `dest` + `-r`, `-R`: recursive + `-L`: follow symlinks + `-P`: don't follow symlinks Examples: ```javascript cp('file1', 'dir1'); cp('-R', 'path/to/dir/', '~/newCopy/'); cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above ``` Copies files. ### pushd([options,] [dir | '-N' | '+N']) Available options: + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. + `-q`: Supresses output to the console. Arguments: + `dir`: Sets the current working directory to the top of the stack, then executes the equivalent of `cd dir`. + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. Examples: ```javascript // process.cwd() === '/usr' pushd('/etc'); // Returns /etc /usr pushd('+1'); // Returns /usr /etc ``` Save the current directory on the top of the directory stack and then `cd` to `dir`. With no arguments, `pushd` exchanges the top two directories. Returns an array of paths in the stack. ### popd([options,] ['-N' | '+N']) Available options: + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated. + `-q`: Supresses output to the console. Arguments: + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. Examples: ```javascript echo(process.cwd()); // '/usr' pushd('/etc'); // '/etc /usr' echo(process.cwd()); // '/etc' popd(); // '/usr' echo(process.cwd()); // '/usr' ``` When no arguments are given, `popd` removes the top directory from the stack and performs a `cd` to the new top directory. The elements are numbered from 0, starting at the first directory listed with dirs (i.e., `popd` is equivalent to `popd +0`). Returns an array of paths in the stack. ### dirs([options | '+N' | '-N']) Available options: + `-c`: Clears the directory stack by deleting all of the elements. + `-q`: Supresses output to the console. Arguments: + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if `+N` or `-N` was specified. See also: `pushd`, `popd` ### echo([options,] string [, string ...]) Available options: + `-e`: interpret backslash escapes (default) + `-n`: remove trailing newline from output Examples: ```javascript echo('hello world'); var str = echo('hello world'); echo('-n', 'no newline at end'); ``` Prints `string` to stdout, and returns string with additional utility methods like `.to()`. ### exec(command [, options] [, callback]) Available options: + `async`: Asynchronous execution. If a callback is provided, it will be set to `true`, regardless of the passed value (default: `false`). + `silent`: Do not echo program output to console (default: `false`). + `encoding`: Character encoding to use. Affects the values returned to stdout and stderr, and what is written to stdout and stderr when not in silent mode (default: `'utf8'`). + and any option available to Node.js's [`child_process.exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) Examples: ```javascript var version = exec('node --version', {silent:true}).stdout; var child = exec('some_long_running_process', {async:true}); child.stdout.on('data', function(data) { /* ... do something with data ... */ }); exec('some_long_running_process', function(code, stdout, stderr) { console.log('Exit code:', code); console.log('Program output:', stdout); console.log('Program stderr:', stderr); }); ``` Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous mode, this returns a `ShellString` (compatible with ShellJS v0.6.x, which returns an object of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process object, and the `callback` receives the arguments `(code, stdout, stderr)`. Not seeing the behavior you want? `exec()` runs everything through `sh` by default (or `cmd.exe` on Windows), which differs from `bash`. If you need bash-specific behavior, try out the `{shell: 'path/to/bash'}` option. ### find(path [, path ...]) ### find(path_array) Examples: ```javascript find('src', 'lib'); find(['src', 'lib']); // same as above find('.').filter(function(file) { return file.match(/\.js$/); }); ``` Returns array of all files (however deep) in the given paths. The main difference from `ls('-R', path)` is that the resulting file names include the base directories (e.g., `lib/resources/file1` instead of just `file1`). ### grep([options,] regex_filter, file [, file ...]) ### grep([options,] regex_filter, file_array) Available options: + `-v`: Invert `regex_filter` (only print non-matching lines). + `-l`: Print only filenames of matching files. + `-i`: Ignore case. Examples: ```javascript grep('-v', 'GLOBAL_VARIABLE', '*.js'); grep('GLOBAL_VARIABLE', '*.js'); ``` Reads input string from given files and returns a string containing all lines of the file that match the given `regex_filter`. ### head([{'-n': \<num\>},] file [, file ...]) ### head([{'-n': \<num\>},] file_array) Available options: + `-n <num>`: Show the first `<num>` lines of the files Examples: ```javascript var str = head({'-n': 1}, 'file*.txt'); var str = head('file1', 'file2'); var str = head(['file1', 'file2']); // same as above ``` Read the start of a file. ### ln([options,] source, dest) Available options: + `-s`: symlink + `-f`: force Examples: ```javascript ln('file', 'newlink'); ln('-sf', 'file', 'existing'); ``` Links `source` to `dest`. Use `-f` to force the link, should `dest` already exist. ### ls([options,] [path, ...]) ### ls([options,] path_array) Available options: + `-R`: recursive + `-A`: all files (include files beginning with `.`, except for `.` and `..`) + `-L`: follow symlinks + `-d`: list directories themselves, not their contents + `-l`: list objects representing each file, each with fields containing `ls -l` output fields. See [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) for more info Examples: ```javascript ls('projs/*.js'); ls('-R', '/users/me', '/tmp'); ls('-R', ['/users/me', '/tmp']); // same as above ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} ``` Returns array of files in the given `path`, or files in the current directory if no `path` is provided. ### mkdir([options,] dir [, dir ...]) ### mkdir([options,] dir_array) Available options: + `-p`: full path (and create intermediate directories, if necessary) Examples: ```javascript mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above ``` Creates directories. ### mv([options ,] source [, source ...], dest') ### mv([options ,] source_array, dest') Available options: + `-f`: force (default behavior) + `-n`: no-clobber Examples: ```javascript mv('-n', 'file', 'dir/'); mv('file1', 'file2', 'dir/'); mv(['file1', 'file2'], 'dir/'); // same as above ``` Moves `source` file(s) to `dest`. ### pwd() Returns the current directory. ### rm([options,] file [, file ...]) ### rm([options,] file_array) Available options: + `-f`: force + `-r, -R`: recursive Examples: ```javascript rm('-rf', '/tmp/*'); rm('some_file.txt', 'another_file.txt'); rm(['some_file.txt', 'another_file.txt']); // same as above ``` Removes files. ### sed([options,] search_regex, replacement, file [, file ...]) ### sed([options,] search_regex, replacement, file_array) Available options: + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_ Examples: ```javascript sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); ``` Reads an input string from `file`s, and performs a JavaScript `replace()` on the input using the given `search_regex` and `replacement` string or function. Returns the new string after replacement. Note: Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified using the `$n` syntax: ```javascript sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt'); ``` ### set(options) Available options: + `+/-e`: exit upon error (`config.fatal`) + `+/-v`: verbose: show all commands (`config.verbose`) + `+/-f`: disable filename expansion (globbing) Examples: ```javascript set('-e'); // exit upon first error set('+e'); // this undoes a "set('-e')" ``` Sets global configuration variables. ### sort([options,] file [, file ...]) ### sort([options,] file_array) Available options: + `-r`: Reverse the results + `-n`: Compare according to numerical value Examples: ```javascript sort('foo.txt', 'bar.txt'); sort('-r', 'foo.txt'); ``` Return the contents of the `file`s, sorted line-by-line. Sorting multiple files mixes their content (just as unix `sort` does). ### tail([{'-n': \<num\>},] file [, file ...]) ### tail([{'-n': \<num\>},] file_array) Available options: + `-n <num>`: Show the last `<num>` lines of `file`s Examples: ```javascript var str = tail({'-n': 1}, 'file*.txt'); var str = tail('file1', 'file2'); var str = tail(['file1', 'file2']); // same as above ``` Read the end of a `file`. ### tempdir() Examples: ```javascript var tmp = tempdir(); // "/tmp" for most *nix platforms ``` Searches and returns string containing a writeable, platform-dependent temporary directory. Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). ### test(expression) Available expression primaries: + `'-b', 'path'`: true if path is a block device + `'-c', 'path'`: true if path is a character device + `'-d', 'path'`: true if path is a directory + `'-e', 'path'`: true if path exists + `'-f', 'path'`: true if path is a regular file + `'-L', 'path'`: true if path is a symbolic link + `'-p', 'path'`: true if path is a pipe (FIFO) + `'-S', 'path'`: true if path is a socket Examples: ```javascript if (test('-d', path)) { /* do something with dir */ }; if (!test('-f', path)) continue; // skip if it's a regular file ``` Evaluates `expression` using the available primaries and returns corresponding value. ### ShellString.prototype.to(file) Examples: ```javascript cat('input.txt').to('output.txt'); ``` Analogous to the redirection operator `>` in Unix, but works with `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix redirections, `to()` will overwrite any existing file!_ ### ShellString.prototype.toEnd(file) Examples: ```javascript cat('input.txt').toEnd('output.txt'); ``` Analogous to the redirect-and-append operator `>>` in Unix, but works with `ShellStrings` (such as those returned by `cat`, `grep`, etc.). ### touch([options,] file [, file ...]) ### touch([options,] file_array) Available options: + `-a`: Change only the access time + `-c`: Do not create any files + `-m`: Change only the modification time + `-d DATE`: Parse `DATE` and use it instead of current time + `-r FILE`: Use `FILE`'s times instead of current time Examples: ```javascript touch('source.js'); touch('-c', '/path/to/some/dir/source.js'); touch({ '-r': FILE }, '/path/to/some/dir/source.js'); ``` Update the access and modification times of each `FILE` to the current time. A `FILE` argument that does not exist is created empty, unless `-c` is supplied. This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch). ### uniq([options,] [input, [output]]) Available options: + `-i`: Ignore case while comparing + `-c`: Prefix lines by the number of occurrences + `-d`: Only print duplicate lines, one for each group of identical lines Examples: ```javascript uniq('foo.txt'); uniq('-i', 'foo.txt'); uniq('-cd', 'foo.txt', 'bar.txt'); ``` Filter adjacent matching lines from `input`. ### which(command) Examples: ```javascript var nodeExec = which('node'); ``` Searches for `command` in the system's `PATH`. On Windows, this uses the `PATHEXT` variable to append the extension if it's not already executable. Returns string containing the absolute path to `command`. ### exit(code) Exits the current process with the given exit `code`. ### error() Tests if error occurred in the last command. Returns a truthy value if an error returned, or a falsy value otherwise. **Note**: do not rely on the return value to be an error message. If you need the last error message, use the `.stderr` attribute from the last command's return value instead. ### ShellString(str) Examples: ```javascript var foo = ShellString('hello world'); ``` Turns a regular string into a string-like object similar to what each command returns. This has special methods, like `.to()` and `.toEnd()`. ### env['VAR_NAME'] Object containing environment variables (both getter and setter). Shortcut to `process.env`. ### Pipes Examples: ```javascript grep('foo', 'file1.txt', 'file2.txt').sed(/o/g, 'a').to('output.txt'); echo('files with o\'s in the name:\n' + ls().grep('o')); cat('test.js').exec('node'); // pipe to exec() call ``` Commands can send their output to another command in a pipe-like fashion. `sed`, `grep`, `cat`, `exec`, `to`, and `toEnd` can appear on the right-hand side of a pipe. Pipes can be chained. ## Configuration ### config.silent Example: ```javascript var sh = require('shelljs'); var silentState = sh.config.silent; // save old silent state sh.config.silent = true; /* ... */ sh.config.silent = silentState; // restore old silent state ``` Suppresses all command output if `true`, except for `echo()` calls. Default is `false`. ### config.fatal Example: ```javascript require('shelljs/global'); config.fatal = true; // or set('-e'); cp('this_file_does_not_exist', '/dev/null'); // throws Error here /* more commands... */ ``` If `true`, the script will throw a Javascript error when any shell.js command encounters an error. Default is `false`. This is analogous to Bash's `set -e`. ### config.verbose Example: ```javascript config.verbose = true; // or set('-v'); cd('dir/'); rm('-rf', 'foo.txt', 'bar.txt'); exec('echo hello'); ``` Will print each command as follows: ``` cd dir/ rm -rf foo.txt bar.txt exec echo hello ``` ### config.globOptions Example: ```javascript config.globOptions = {nodir: true}; ``` Use this value for calls to `glob.sync()` instead of the default options. ### config.reset() Example: ```javascript var shell = require('shelljs'); // Make changes to shell.config, and do stuff... /* ... */ shell.config.reset(); // reset to original state // Do more stuff, but with original settings /* ... */ ``` Reset `shell.config` to the defaults: ```javascript { fatal: false, globOptions: {}, maxdepth: 255, noglob: false, silent: false, verbose: false, } ``` ## Team | [![Nate Fischer](https://avatars.githubusercontent.com/u/5801521?s=130)](https://github.com/nfischer) | [![Brandon Freitag](https://avatars1.githubusercontent.com/u/5988055?v=3&s=130)](http://github.com/freitagbr) | |:---:|:---:| | [Nate Fischer](https://github.com/nfischer) | [Brandon Freitag](http://github.com/freitagbr) | # eslint-visitor-keys [![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) [![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) [![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) [![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) Constants and utilities about visitor keys to traverse AST. ## 💿 Installation Use [npm] to install. ```bash $ npm install eslint-visitor-keys ``` ### Requirements - [Node.js] 4.0.0 or later. ## 📖 Usage ```js const evk = require("eslint-visitor-keys") ``` ### evk.KEYS > type: `{ [type: string]: string[] | undefined }` Visitor keys. This keys are frozen. This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. For example: ``` console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] ``` ### evk.getKeys(node) > type: `(node: object) => string[]` Get the visitor keys of a given AST node. This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. This will be used to traverse unknown nodes. For example: ``` const node = { type: "AssignmentExpression", left: { type: "Identifier", name: "foo" }, right: { type: "Literal", value: 0 } } console.log(evk.getKeys(node)) // → ["type", "left", "right"] ``` ### evk.unionWith(additionalKeys) > type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` Make the union set with `evk.KEYS` and the given keys. - The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. - It removes duplicated keys as keeping the first one. For example: ``` console.log(evk.unionWith({ MethodDefinition: ["decorators"] })) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } ``` ## 📰 Change log See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). ## 🍻 Contributing Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). ### Development commands - `npm test` runs tests and measures code coverage. - `npm run lint` checks source codes with ESLint. - `npm run coverage` opens the code coverage report of the previous test with your default browser. - `npm run release` publishes this package to [npm] registory. [npm]: https://www.npmjs.com/ [Node.js]: https://nodejs.org/en/ [ESTree]: https://github.com/estree/estree # y18n [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) The bare-bones internationalization library used by yargs. Inspired by [i18n](https://www.npmjs.com/package/i18n). ## Examples _simple string translation:_ ```js var __ = require('y18n').__ console.log(__('my awesome string %s', 'foo')) ``` output: `my awesome string foo` _using tagged template literals_ ```js var __ = require('y18n').__ var str = 'foo' console.log(__`my awesome string ${str}`) ``` output: `my awesome string foo` _pluralization support:_ ```js var __n = require('y18n').__n console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')) ``` output: `2 fishes foo` ## JSON Language Files The JSON language files should be stored in a `./locales` folder. File names correspond to locales, e.g., `en.json`, `pirate.json`. When strings are observed for the first time they will be added to the JSON file corresponding to the current locale. ## Methods ### require('y18n')(config) Create an instance of y18n with the config provided, options include: * `directory`: the locale directory, default `./locales`. * `updateFiles`: should newly observed strings be updated in file, default `true`. * `locale`: what locale should be used. * `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) be allowed if a file matching the locale does not exist (e.g. `en_US.json`), default `true`. ### y18n.\_\_(str, arg, arg, arg) Print a localized string, `%s` will be replaced with `arg`s. This function can also be used as a tag for a template literal. You can use it like this: <code>__&#96;hello ${'world'}&#96;</code>. This will be equivalent to `__('hello %s', 'world')`. ### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) Print a localized string with appropriate pluralization. If `%d` is provided in the string, the `count` will replace this placeholder. ### y18n.setLocale(str) Set the current locale being used. ### y18n.getLocale() What locale is currently being used? ### y18n.updateLocale(obj) Update the current locale with the key value pairs in `obj`. ## License ISC [travis-url]: https://travis-ci.org/yargs/y18n [travis-image]: https://img.shields.io/travis/yargs/y18n.svg [coveralls-url]: https://coveralls.io/github/yargs/y18n [coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg [npm-url]: https://npmjs.org/package/y18n [npm-image]: https://img.shields.io/npm/v/y18n.svg [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: https://github.com/feross/standard # node-supports-preserve-symlinks-flag <sup>[![Version Badge][npm-version-svg]][package-url]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] Determine if the current node version supports the `--preserve-symlinks` flag. ## Example ```js var supportsPreserveSymlinks = require('node-supports-preserve-symlinks-flag'); var assert = require('assert'); assert.equal(supportsPreserveSymlinks, null); // in a browser assert.equal(supportsPreserveSymlinks, false); // in node < v6.2 assert.equal(supportsPreserveSymlinks, true); // in node v6.2+ ``` ## Tests Simply clone the repo, `npm install`, and run `npm test` [package-url]: https://npmjs.org/package/node-supports-preserve-symlinks-flag [npm-version-svg]: https://versionbadg.es/inspect-js/node-supports-preserve-symlinks-flag.svg [deps-svg]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag.svg [deps-url]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag [dev-deps-svg]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag/dev-status.svg [dev-deps-url]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag#info=devDependencies [npm-badge-png]: https://nodei.co/npm/node-supports-preserve-symlinks-flag.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/node-supports-preserve-symlinks-flag.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/node-supports-preserve-symlinks-flag.svg [downloads-url]: https://npm-stat.com/charts.html?package=node-supports-preserve-symlinks-flag [codecov-image]: https://codecov.io/gh/inspect-js/node-supports-preserve-symlinks-flag/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/node-supports-preserve-symlinks-flag/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/node-supports-preserve-symlinks-flag [actions-url]: https://github.com/inspect-js/node-supports-preserve-symlinks-flag/actions # emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) _emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. ## Installation Via [npm](https://www.npmjs.com/): ```bash npm install emoji-regex ``` In [Node.js](https://nodejs.org/): ```js const emojiRegex = require('emoji-regex'); // Note: because the regular expression has the global flag set, this module // exports a function that returns the regex rather than exporting the regular // expression itself, to make it impossible to (accidentally) mutate the // original regular expression. const text = ` \u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) \u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji \u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) \u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier `; const regex = emojiRegex(); let match; while (match = regex.exec(text)) { const emoji = match[0]; console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); } ``` Console output: ``` Matched sequence ⌚ — code points: 1 Matched sequence ⌚ — code points: 1 Matched sequence ↔️ — code points: 2 Matched sequence ↔️ — code points: 2 Matched sequence 👩 — code points: 1 Matched sequence 👩 — code points: 1 Matched sequence 👩🏿 — code points: 2 Matched sequence 👩🏿 — code points: 2 ``` To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: ```js const emojiRegex = require('emoji-regex/text.js'); ``` Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: ```js const emojiRegex = require('emoji-regex/es2015/index.js'); const emojiRegexText = require('emoji-regex/es2015/text.js'); ``` ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License _emoji-regex_ is available under the [MIT](https://mths.be/mit) license. ## assemblyscript-temporal An implementation of temporal within AssemblyScript, with an initial focus on non-timezone-aware classes and functionality. ### Why? AssemblyScript has minimal `Date` support, however, the JS Date API itself is terrible and people tend not to use it that often. As a result libraries like moment / luxon have become staple replacements. However, there is now a [relatively mature TC39 proposal](https://github.com/tc39/proposal-temporal) that adds greatly improved date support to JS. The goal of this project is to implement Temporal for AssemblyScript. ### Usage This library currently supports the following types: #### `PlainDateTime` A `PlainDateTime` represents a calendar date and wall-clock time that does not carry time zone information, e.g. December 7th, 1995 at 3:00 PM (in the Gregorian calendar). For detailed documentation see the [TC39 Temporal proposal website](https://tc39.es/proposal-temporal/docs/plaindatetime.html), this implementation follows the specification as closely as possible. You can create a `PlainDateTime` from individual components, a string or an object literal: ```javascript datetime = new PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789); datetime.year; // 2019; datetime.month; // 11; // ... datetime.nanosecond; // 789; datetime = PlainDateTime.from("1976-11-18T12:34:56"); datetime.toString(); // "1976-11-18T12:34:56" datetime = PlainDateTime.from({ year: 1966, month: 3, day: 3 }); datetime.toString(); // "1966-03-03T00:00:00" ``` There are various ways you can manipulate a date: ```javascript // use 'with' to copy a date but with various property values overriden datetime = new PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789); datetime.with({ year: 2019 }).toString(); // "2019-11-18T15:23:30.123456789" // use 'add' or 'substract' to add / subtract a duration datetime = PlainDateTime.from("2020-01-12T15:00"); datetime.add({ months: 1 }).toString(); // "2020-02-12T15:00:00"); // add / subtract support Duration objects or object literals datetime.add(new Duration(1)).toString(); // "2021-01-12T15:00:00"); ``` You can compare dates and check for equality ```javascript dt1 = PlainDateTime.from("1976-11-18"); dt2 = PlainDateTime.from("2019-10-29"); PlainDateTime.compare(dt1, dt1); // 0 PlainDateTime.compare(dt1, dt2); // -1 dt1.equals(dt1); // true ``` Currently `PlainDateTime` only supports the ISO 8601 (Gregorian) calendar. #### `PlainDate` A `PlainDate` object represents a calendar date that is not associated with a particular time or time zone, e.g. August 24th, 2006. For detailed documentation see the [TC39 Temporal proposal website](https://tc39.es/proposal-temporal/docs/plaindate.html), this implementation follows the specification as closely as possible. The `PlainDate` API is almost identical to `PlainDateTime`, so see above for API usage examples. #### `PlainTime` A `PlainTime` object represents a wall-clock time that is not associated with a particular date or time zone, e.g. 7:39 PM. For detailed documentation see the [TC39 Temporal proposal website](https://tc39.es/proposal-temporal/docs/plaintime.html), this implementation follows the specification as closely as possible. The `PlainTime` API is almost identical to `PlainDateTime`, so see above for API usage examples. #### `PlainMonthDay` A date without a year component. This is useful to express things like "Bastille Day is on the 14th of July". For detailed documentation see the [TC39 Temporal proposal website](https://tc39.es/proposal-temporal/docs/plainmonthday.html) , this implementation follows the specification as closely as possible. ```javascript const monthDay = PlainMonthDay.from({ month: 7, day: 14 }); // => 07-14 const date = monthDay.toPlainDate({ year: 2030 }); // => 2030-07-14 date.dayOfWeek; // => 7 ``` The `PlainMonthDay` API is almost identical to `PlainDateTime`, so see above for more API usage examples. #### `PlainYearMonth` A date without a day component. This is useful to express things like "the October 2020 meeting". For detailed documentation see the [TC39 Temporal proposal website](https://tc39.es/proposal-temporal/docs/plainyearmonth.html) , this implementation follows the specification as closely as possible. The `PlainYearMonth` API is almost identical to `PlainDateTime`, so see above for API usage examples. #### `now` The `now` object has several methods which give information about the current time and date. ```javascript dateTime = now.plainDateTimeISO(); dateTime.toString(); // 2021-04-01T12:05:47.357 ``` ## Contributing This project is open source, MIT licensed and your contributions are very much welcomed. There is a [brief document that outlines implementation progress and priorities](./development.md). <p align="center"> <a href="http://gulpjs.com"> <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png"> </a> </p> # interpret [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] A dictionary of file extensions and associated module loaders. ## What is it This is used by [Liftoff](http://github.com/tkellen/node-liftoff) to automatically require dependencies for configuration files, and by [rechoir](http://github.com/tkellen/node-rechoir) for registering module loaders. ## API ### extensions Map file types to modules which provide a [require.extensions] loader. ```js { '.babel.js': [ { module: '@babel/register', register: function(hook) { // register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353 // which only captures the final extension (.babel.js -> .js) hook({ extensions: '.js' }); }, }, { module: 'babel-register', register: function(hook) { hook({ extensions: '.js' }); }, }, { module: 'babel-core/register', register: function(hook) { hook({ extensions: '.js' }); }, }, { module: 'babel/register', register: function(hook) { hook({ extensions: '.js' }); }, }, ], '.babel.ts': [ { module: '@babel/register', register: function(hook) { hook({ extensions: '.ts' }); }, }, ], '.buble.js': 'buble/register', '.cirru': 'cirru-script/lib/register', '.cjsx': 'node-cjsx/register', '.co': 'coco', '.coffee': ['coffeescript/register', 'coffee-script/register', 'coffeescript', 'coffee-script'], '.coffee.md': ['coffeescript/register', 'coffee-script/register', 'coffeescript', 'coffee-script'], '.csv': 'require-csv', '.eg': 'earlgrey/register', '.esm.js': { module: 'esm', register: function(hook) { // register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353 // which only captures the final extension (.babel.js -> .js) var esmLoader = hook(module); require.extensions['.js'] = esmLoader('module')._extensions['.js']; }, }, '.iced': ['iced-coffee-script/register', 'iced-coffee-script'], '.iced.md': 'iced-coffee-script/register', '.ini': 'require-ini', '.js': null, '.json': null, '.json5': 'json5/lib/require', '.jsx': [ { module: '@babel/register', register: function(hook) { hook({ extensions: '.jsx' }); }, }, { module: 'babel-register', register: function(hook) { hook({ extensions: '.jsx' }); }, }, { module: 'babel-core/register', register: function(hook) { hook({ extensions: '.jsx' }); }, }, { module: 'babel/register', register: function(hook) { hook({ extensions: '.jsx' }); }, }, { module: 'node-jsx', register: function(hook) { hook.install({ extension: '.jsx', harmony: true }); }, }, ], '.litcoffee': ['coffeescript/register', 'coffee-script/register', 'coffeescript', 'coffee-script'], '.liticed': 'iced-coffee-script/register', '.ls': ['livescript', 'LiveScript'], '.mjs': '/absolute/path/to/interpret/mjs-stub.js', '.node': null, '.toml': { module: 'toml-require', register: function(hook) { hook.install(); }, }, '.ts': [ 'ts-node/register', 'typescript-node/register', 'typescript-register', 'typescript-require', 'sucrase/register/ts', { module: '@babel/register', register: function(hook) { hook({ extensions: '.ts' }); }, }, ], '.tsx': [ 'ts-node/register', 'typescript-node/register', 'sucrase/register', { module: '@babel/register', register: function(hook) { hook({ extensions: '.tsx' }); }, }, ], '.wisp': 'wisp/engine/node', '.xml': 'require-xml', '.yaml': 'require-yaml', '.yml': 'require-yaml', } ``` ### jsVariants Same as above, but only include the extensions which are javascript variants. ## How to use it Consumers should use the exported `extensions` or `jsVariants` object to determine which module should be loaded for a given extension. If a matching extension is found, consumers should do the following: 1. If the value is null, do nothing. 2. If the value is a string, try to require it. 3. If the value is an object, try to require the `module` property. If successful, the `register` property (a function) should be called with the module passed as the first argument. 4. If the value is an array, iterate over it, attempting step #2 or #3 until one of the attempts does not throw. [require.extensions]: http://nodejs.org/api/globals.html#globals_require_extensions [downloads-image]: http://img.shields.io/npm/dm/interpret.svg [npm-url]: https://www.npmjs.com/package/interpret [npm-image]: http://img.shields.io/npm/v/interpret.svg [travis-url]: https://travis-ci.org/gulpjs/interpret [travis-image]: http://img.shields.io/travis/gulpjs/interpret.svg?label=travis-ci [appveyor-url]: https://ci.appveyor.com/project/gulpjs/interpret [appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/interpret.svg?label=appveyor [coveralls-url]: https://coveralls.io/r/gulpjs/interpret [coveralls-image]: http://img.shields.io/coveralls/gulpjs/interpret/master.svg [gitter-url]: https://gitter.im/gulpjs/gulp [gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg # regexpp [![npm version](https://img.shields.io/npm/v/regexpp.svg)](https://www.npmjs.com/package/regexpp) [![Downloads/month](https://img.shields.io/npm/dm/regexpp.svg)](http://www.npmtrends.com/regexpp) [![Build Status](https://github.com/mysticatea/regexpp/workflows/CI/badge.svg)](https://github.com/mysticatea/regexpp/actions) [![codecov](https://codecov.io/gh/mysticatea/regexpp/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/regexpp) [![Dependency Status](https://david-dm.org/mysticatea/regexpp.svg)](https://david-dm.org/mysticatea/regexpp) A regular expression parser for ECMAScript. ## 💿 Installation ```bash $ npm install regexpp ``` - require Node.js 8 or newer. ## 📖 Usage ```ts import { AST, RegExpParser, RegExpValidator, RegExpVisitor, parseRegExpLiteral, validateRegExpLiteral, visitRegExpAST } from "regexpp" ``` ### parseRegExpLiteral(source, options?) Parse a given regular expression literal then make AST object. This is equivalent to `new RegExpParser(options).parseLiteral(source)`. - **Parameters:** - `source` (`string | RegExp`) The source code to parse. - `options?` ([`RegExpParser.Options`]) The options to parse. - **Return:** - The AST of the regular expression. ### validateRegExpLiteral(source, options?) Validate a given regular expression literal. This is equivalent to `new RegExpValidator(options).validateLiteral(source)`. - **Parameters:** - `source` (`string`) The source code to validate. - `options?` ([`RegExpValidator.Options`]) The options to validate. ### visitRegExpAST(ast, handlers) Visit each node of a given AST. This is equivalent to `new RegExpVisitor(handlers).visit(ast)`. - **Parameters:** - `ast` ([`AST.Node`]) The AST to visit. - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. ### RegExpParser #### new RegExpParser(options?) - **Parameters:** - `options?` ([`RegExpParser.Options`]) The options to parse. #### parser.parseLiteral(source, start?, end?) Parse a regular expression literal. - **Parameters:** - `source` (`string`) The source code to parse. E.g. `"/abc/g"`. - `start?` (`number`) The start index in the source code. Default is `0`. - `end?` (`number`) The end index in the source code. Default is `source.length`. - **Return:** - The AST of the regular expression. #### parser.parsePattern(source, start?, end?, uFlag?) Parse a regular expression pattern. - **Parameters:** - `source` (`string`) The source code to parse. E.g. `"abc"`. - `start?` (`number`) The start index in the source code. Default is `0`. - `end?` (`number`) The end index in the source code. Default is `source.length`. - `uFlag?` (`boolean`) The flag to enable Unicode mode. - **Return:** - The AST of the regular expression pattern. #### parser.parseFlags(source, start?, end?) Parse a regular expression flags. - **Parameters:** - `source` (`string`) The source code to parse. E.g. `"gim"`. - `start?` (`number`) The start index in the source code. Default is `0`. - `end?` (`number`) The end index in the source code. Default is `source.length`. - **Return:** - The AST of the regular expression flags. ### RegExpValidator #### new RegExpValidator(options) - **Parameters:** - `options` ([`RegExpValidator.Options`]) The options to validate. #### validator.validateLiteral(source, start, end) Validate a regular expression literal. - **Parameters:** - `source` (`string`) The source code to validate. - `start?` (`number`) The start index in the source code. Default is `0`. - `end?` (`number`) The end index in the source code. Default is `source.length`. #### validator.validatePattern(source, start, end, uFlag) Validate a regular expression pattern. - **Parameters:** - `source` (`string`) The source code to validate. - `start?` (`number`) The start index in the source code. Default is `0`. - `end?` (`number`) The end index in the source code. Default is `source.length`. - `uFlag?` (`boolean`) The flag to enable Unicode mode. #### validator.validateFlags(source, start, end) Validate a regular expression flags. - **Parameters:** - `source` (`string`) The source code to validate. - `start?` (`number`) The start index in the source code. Default is `0`. - `end?` (`number`) The end index in the source code. Default is `source.length`. ### RegExpVisitor #### new RegExpVisitor(handlers) - **Parameters:** - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. #### visitor.visit(ast) Validate a regular expression literal. - **Parameters:** - `ast` ([`AST.Node`]) The AST to visit. ## 📰 Changelog - [GitHub Releases](https://github.com/mysticatea/regexpp/releases) ## 🍻 Contributing Welcome contributing! Please use GitHub's Issues/PRs. ### Development Tools - `npm test` runs tests and measures coverage. - `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`. - `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`. - `npm run lint` runs ESLint. - `npm run update:test` updates test fixtures. - `npm run update:ids` updates `src/unicode/ids.ts`. - `npm run watch` runs tests with `--watch` option. [`AST.Node`]: src/ast.ts#L4 [`RegExpParser.Options`]: src/parser.ts#L539 [`RegExpValidator.Options`]: src/validator.ts#L127 [`RegExpVisitor.Handlers`]: src/visitor.ts#L204 # jsdiff [![Build Status](https://secure.travis-ci.org/kpdecker/jsdiff.svg)](http://travis-ci.org/kpdecker/jsdiff) [![Sauce Test Status](https://saucelabs.com/buildstatus/jsdiff)](https://saucelabs.com/u/jsdiff) A javascript text differencing implementation. Based on the algorithm proposed in ["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927). ## Installation ```bash npm install diff --save ``` ## API * `Diff.diffChars(oldStr, newStr[, options])` - diffs two blocks of text, comparing character by character. Returns a list of change objects (See below). Options * `ignoreCase`: `true` to ignore casing difference. Defaults to `false`. * `Diff.diffWords(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, ignoring whitespace. Returns a list of change objects (See below). Options * `ignoreCase`: Same as in `diffChars`. * `Diff.diffWordsWithSpace(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, treating whitespace as significant. Returns a list of change objects (See below). * `Diff.diffLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line. Options * `ignoreWhitespace`: `true` to ignore leading and trailing whitespace. This is the same as `diffTrimmedLines` * `newlineIsToken`: `true` to treat newline characters as separate tokens. This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human friendly form of `diffLines` and `diffLines` is better suited for patches and other computer friendly output. Returns a list of change objects (See below). * `Diff.diffTrimmedLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace. Returns a list of change objects (See below). * `Diff.diffSentences(oldStr, newStr[, options])` - diffs two blocks of text, comparing sentence by sentence. Returns a list of change objects (See below). * `Diff.diffCss(oldStr, newStr[, options])` - diffs two blocks of text, comparing CSS tokens. Returns a list of change objects (See below). * `Diff.diffJson(oldObj, newObj[, options])` - diffs two JSON objects, comparing the fields defined on each. The order of fields, etc does not matter in this comparison. Returns a list of change objects (See below). * `Diff.diffArrays(oldArr, newArr[, options])` - diffs two arrays, comparing each item for strict equality (===). Options * `comparator`: `function(left, right)` for custom equality checks Returns a list of change objects (See below). * `Diff.createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch. Parameters: * `oldFileName` : String to be output in the filename section of the patch for the removals * `newFileName` : String to be output in the filename section of the patch for the additions * `oldStr` : Original string value * `newStr` : New string value * `oldHeader` : Additional information to include in the old file header * `newHeader` : Additional information to include in the new file header * `options` : An object with options. Currently, only `context` is supported and describes how many lines of context should be included. * `Diff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch. Just like Diff.createTwoFilesPatch, but with oldFileName being equal to newFileName. * `Diff.structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)` - returns an object with an array of hunk objects. This method is similar to createTwoFilesPatch, but returns a data structure suitable for further processing. Parameters are the same as createTwoFilesPatch. The data structure returned may look like this: ```js { oldFileName: 'oldfile', newFileName: 'newfile', oldHeader: 'header1', newHeader: 'header2', hunks: [{ oldStart: 1, oldLines: 3, newStart: 1, newLines: 3, lines: [' line2', ' line3', '-line4', '+line5', '\\ No newline at end of file'], }] } ``` * `Diff.applyPatch(source, patch[, options])` - applies a unified diff patch. Return a string containing new version of provided data. `patch` may be a string diff or the output from the `parsePatch` or `structuredPatch` methods. The optional `options` object may have the following keys: - `fuzzFactor`: Number of lines that are allowed to differ before rejecting a patch. Defaults to 0. - `compareLine(lineNumber, line, operation, patchContent)`: Callback used to compare to given lines to determine if they should be considered equal when patching. Defaults to strict equality but may be overridden to provide fuzzier comparison. Should return false if the lines should be rejected. * `Diff.applyPatches(patch, options)` - applies one or more patches. This method will iterate over the contents of the patch and apply to data provided through callbacks. The general flow for each patch index is: - `options.loadFile(index, callback)` is called. The caller should then load the contents of the file and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution. - `options.patched(index, content, callback)` is called once the patch has been applied. `content` will be the return value from `applyPatch`. When it's ready, the caller should call `callback(err)` callback. Passing an `err` will terminate further patch execution. Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made. * `Diff.parsePatch(diffStr)` - Parses a patch into structured data Return a JSON object representation of the a patch, suitable for use with the `applyPatch` method. This parses to the same structure returned by `Diff.structuredPatch`. * `convertChangesToXML(changes)` - converts a list of changes to a serialized XML format All methods above which accept the optional `callback` method will run in sync mode when that parameter is omitted and in async mode when supplied. This allows for larger diffs without blocking the event loop. This may be passed either directly as the final parameter or as the `callback` field in the `options` object. ### Change Objects Many of the methods above return change objects. These objects consist of the following fields: * `value`: Text content * `added`: True if the value was inserted into the new string * `removed`: True if the value was removed from the old string Note that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner. ## Examples Basic example in Node ```js require('colors'); const Diff = require('diff'); const one = 'beep boop'; const other = 'beep boob blah'; const diff = Diff.diffChars(one, other); diff.forEach((part) => { // green for additions, red for deletions // grey for common parts const color = part.added ? 'green' : part.removed ? 'red' : 'grey'; process.stderr.write(part.value[color]); }); console.log(); ``` Running the above program should yield <img src="images/node_example.png" alt="Node Example"> Basic example in a web page ```html <pre id="display"></pre> <script src="diff.js"></script> <script> const one = 'beep boop', other = 'beep boob blah', color = ''; let span = null; const diff = Diff.diffChars(one, other), display = document.getElementById('display'), fragment = document.createDocumentFragment(); diff.forEach((part) => { // green for additions, red for deletions // grey for common parts const color = part.added ? 'green' : part.removed ? 'red' : 'grey'; span = document.createElement('span'); span.style.color = color; span.appendChild(document .createTextNode(part.value)); fragment.appendChild(span); }); display.appendChild(fragment); </script> ``` Open the above .html file in a browser and you should see <img src="images/web_example.png" alt="Node Example"> **[Full online demo](http://kpdecker.github.com/jsdiff)** ## Compatibility [![Sauce Test Status](https://saucelabs.com/browser-matrix/jsdiff.svg)](https://saucelabs.com/u/jsdiff) jsdiff supports all ES3 environments with some known issues on IE8 and below. Under these browsers some diff algorithms such as word diff and others may fail due to lack of support for capturing groups in the `split` operation. ## License See [LICENSE](https://github.com/kpdecker/jsdiff/blob/master/LICENSE). # lodash.clonedeep v4.5.0 The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.clonedeep ``` In Node.js: ```js var cloneDeep = require('lodash.clonedeep'); ``` See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details. # json-schema-traverse Traverse JSON Schema passing each schema object to callback [![build](https://github.com/epoberezkin/json-schema-traverse/workflows/build/badge.svg)](https://github.com/epoberezkin/json-schema-traverse/actions?query=workflow%3Abuild) [![npm](https://img.shields.io/npm/v/json-schema-traverse)](https://www.npmjs.com/package/json-schema-traverse) [![coverage](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) ## Install ``` npm install json-schema-traverse ``` ## Usage ```javascript const traverse = require('json-schema-traverse'); const schema = { properties: { foo: {type: 'string'}, bar: {type: 'integer'} } }; traverse(schema, {cb}); // cb is called 3 times with: // 1. root schema // 2. {type: 'string'} // 3. {type: 'integer'} // Or: traverse(schema, {cb: {pre, post}}); // pre is called 3 times with: // 1. root schema // 2. {type: 'string'} // 3. {type: 'integer'} // // post is called 3 times with: // 1. {type: 'string'} // 2. {type: 'integer'} // 3. root schema ``` Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. Callback is passed these parameters: - _schema_: the current schema object - _JSON pointer_: from the root schema to the current schema object - _root schema_: the schema passed to `traverse` object - _parent JSON pointer_: from the root schema to the parent schema object (see below) - _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) - _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema - _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` ## Traverse objects in all unknown keywords ```javascript const traverse = require('json-schema-traverse'); const schema = { mySchema: { minimum: 1, maximum: 2 } }; traverse(schema, {allKeys: true, cb}); // cb is called 2 times with: // 1. root schema // 2. mySchema ``` Without option `allKeys: true` callback will be called only with root schema. ## Enterprise support json-schema-traverse package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-json-schema-traverse?utm_source=npm-json-schema-traverse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. ## Security contact To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. ## License [MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) # isexe Minimal module to check if a file is executable, and a normal file. Uses `fs.stat` and tests against the `PATHEXT` environment variable on Windows. ## USAGE ```javascript var isexe = require('isexe') isexe('some-file-name', function (err, isExe) { if (err) { console.error('probably file does not exist or something', err) } else if (isExe) { console.error('this thing can be run') } else { console.error('cannot be run') } }) // same thing but synchronous, throws errors var isExe = isexe.sync('some-file-name') // treat errors as just "not executable" isexe('maybe-missing-file', { ignoreErrors: true }, callback) var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) ``` ## API ### `isexe(path, [options], [callback])` Check if the path is executable. If no callback provided, and a global `Promise` object is available, then a Promise will be returned. Will raise whatever errors may be raised by `fs.stat`, unless `options.ignoreErrors` is set to true. ### `isexe.sync(path, [options])` Same as `isexe` but returns the value and throws any errors raised. ### Options * `ignoreErrors` Treat all errors as "no, this is not executable", but don't raise them. * `uid` Number to use as the user id * `gid` Number to use as the group id * `pathExt` List of path extensions to use instead of `PATHEXT` environment variable on Windows. ### Esrecurse [![Build Status](https://travis-ci.org/estools/esrecurse.svg?branch=master)](https://travis-ci.org/estools/esrecurse) Esrecurse ([esrecurse](https://github.com/estools/esrecurse)) is [ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm) recursive traversing functionality. ### Example Usage The following code will output all variables declared at the root of a file. ```javascript esrecurse.visit(ast, { XXXStatement: function (node) { this.visit(node.left); // do something... this.visit(node.right); } }); ``` We can use `Visitor` instance. ```javascript var visitor = new esrecurse.Visitor({ XXXStatement: function (node) { this.visit(node.left); // do something... this.visit(node.right); } }); visitor.visit(ast); ``` We can inherit `Visitor` instance easily. ```javascript class Derived extends esrecurse.Visitor { constructor() { super(null); } XXXStatement(node) { } } ``` ```javascript function DerivedVisitor() { esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); } util.inherits(DerivedVisitor, esrecurse.Visitor); DerivedVisitor.prototype.XXXStatement = function (node) { this.visit(node.left); // do something... this.visit(node.right); }; ``` And you can invoke default visiting operation inside custom visit operation. ```javascript function DerivedVisitor() { esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); } util.inherits(DerivedVisitor, esrecurse.Visitor); DerivedVisitor.prototype.XXXStatement = function (node) { // do something... this.visitChildren(node); }; ``` The `childVisitorKeys` option does customize the behaviour of `this.visitChildren(node)`. We can use user-defined node types. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; esrecurse.visit( ast, { Literal: function (node) { // do something... } }, { // Extending the existing traversing rules. childVisitorKeys: { // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] TestExpression: ['argument'] } } ); ``` We can use the `fallback` option as well. If the `fallback` option is `"iteration"`, `esrecurse` would visit all enumerable properties of unknown nodes. Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). ```javascript esrecurse.visit( ast, { Literal: function (node) { // do something... } }, { fallback: 'iteration' } ); ``` If the `fallback` option is a function, `esrecurse` calls this function to determine the enumerable properties of unknown nodes. Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). ```javascript esrecurse.visit( ast, { Literal: function (node) { // do something... } }, { fallback: function (node) { return Object.keys(node).filter(function(key) { return key !== 'argument' }); } } ); ``` ### License Copyright (C) 2014 [Yusuke Suzuki](https://github.com/Constellation) (twitter: [@Constellation](https://twitter.com/Constellation)) and other contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # cross-spawn [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] [npm-url]:https://npmjs.org/package/cross-spawn [downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg [npm-image]:https://img.shields.io/npm/v/cross-spawn.svg [travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn [travis-image]:https://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg [appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn [appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg [codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn [codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg [david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn [david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg [david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev [david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg A cross platform solution to node's spawn and spawnSync. ## Installation Node.js version 8 and up: `$ npm install cross-spawn` Node.js version 7 and under: `$ npm install cross-spawn@6` ## Why Node has issues when using spawn on Windows: - It ignores [PATHEXT](https://github.com/joyent/node/issues/2318) - It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix)) - Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367) - Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`) - Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149) - No `options.shell` support on node `<v4.8` All these issues are handled correctly by `cross-spawn`. There are some known modules, such as [win-spawn](https://github.com/ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments. ## Usage Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) or [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), so it's a drop in replacement. ```js const spawn = require('cross-spawn'); // Spawn NPM asynchronously const child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' }); // Spawn NPM synchronously const result = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' }); ``` ## Caveats ### Using `options.shell` as an alternative to `cross-spawn` Starting from node `v4.8`, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves the [PATHEXT](https://github.com/joyent/node/issues/2318) issue but: - It's not supported in node `<v4.8` - You must manually escape the command and arguments which is very error prone, specially when passing user input - There are a lot of other unresolved issues from the [Why](#why) section that you must take into account If you are using the `shell` option to spawn a command in a cross platform way, consider using `cross-spawn` instead. You have been warned. ### `options.shell` support While `cross-spawn` adds support for `options.shell` in node `<v4.8`, all of its enhancements are disabled. This mimics the Node.js behavior. More specifically, the command and its arguments will not be automatically escaped nor shebang support will be offered. This is by design because if you are using `options.shell` you are probably targeting a specific platform anyway and you don't want things to get into your way. ### Shebangs support While `cross-spawn` handles shebangs on Windows, its support is limited. More specifically, it just supports `#!/usr/bin/env <program>` where `<program>` must not contain any arguments. If you would like to have the shebang support improved, feel free to contribute via a pull-request. Remember to always test your code on Windows! ## Tests `$ npm test` `$ npm test -- --watch` during development ## License Released under the [MIT License](https://www.opensource.org/licenses/mit-license.php). # fast-levenshtein - Levenshtein algorithm in Javascript [![Build Status](https://secure.travis-ci.org/hiddentao/fast-levenshtein.png)](http://travis-ci.org/hiddentao/fast-levenshtein) [![NPM module](https://badge.fury.io/js/fast-levenshtein.png)](https://badge.fury.io/js/fast-levenshtein) [![NPM downloads](https://img.shields.io/npm/dm/fast-levenshtein.svg?maxAge=2592000)](https://www.npmjs.com/package/fast-levenshtein) [![Follow on Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/hiddentao) An efficient Javascript implementation of the [Levenshtein algorithm](http://en.wikipedia.org/wiki/Levenshtein_distance) with locale-specific collator support. ## Features * Works in node.js and in the browser. * Better performance than other implementations by not needing to store the whole matrix ([more info](http://www.codeproject.com/Articles/13525/Fast-memory-efficient-Levenshtein-algorithm)). * Locale-sensitive string comparisions if needed. * Comprehensive test suite and performance benchmark. * Small: <1 KB minified and gzipped ## Installation ### node.js Install using [npm](http://npmjs.org/): ```bash $ npm install fast-levenshtein ``` ### Browser Using bower: ```bash $ bower install fast-levenshtein ``` If you are not using any module loader system then the API will then be accessible via the `window.Levenshtein` object. ## Examples **Default usage** ```javascript var levenshtein = require('fast-levenshtein'); var distance = levenshtein.get('back', 'book'); // 2 var distance = levenshtein.get('我愛你', '我叫你'); // 1 ``` **Locale-sensitive string comparisons** It supports using [Intl.Collator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator) for locale-sensitive string comparisons: ```javascript var levenshtein = require('fast-levenshtein'); levenshtein.get('mikailovitch', 'Mikhaïlovitch', { useCollator: true}); // 1 ``` ## Building and Testing To build the code and run the tests: ```bash $ npm install -g grunt-cli $ npm install $ npm run build ``` ## Performance _Thanks to [Titus Wormer](https://github.com/wooorm) for [encouraging me](https://github.com/hiddentao/fast-levenshtein/issues/1) to do this._ Benchmarked against other node.js levenshtein distance modules (on Macbook Air 2012, Core i7, 8GB RAM): ```bash Running suite Implementation comparison [benchmark/speed.js]... >> levenshtein-edit-distance x 234 ops/sec ±3.02% (73 runs sampled) >> levenshtein-component x 422 ops/sec ±4.38% (83 runs sampled) >> levenshtein-deltas x 283 ops/sec ±3.83% (78 runs sampled) >> natural x 255 ops/sec ±0.76% (88 runs sampled) >> levenshtein x 180 ops/sec ±3.55% (86 runs sampled) >> fast-levenshtein x 1,792 ops/sec ±2.72% (95 runs sampled) Benchmark done. Fastest test is fast-levenshtein at 4.2x faster than levenshtein-component ``` You can run this benchmark yourself by doing: ```bash $ npm install $ npm run build $ npm run benchmark ``` ## Contributing If you wish to submit a pull request please update and/or create new tests for any changes you make and ensure the grunt build passes. See [CONTRIBUTING.md](https://github.com/hiddentao/fast-levenshtein/blob/master/CONTRIBUTING.md) for details. ## License MIT - see [LICENSE.md](https://github.com/hiddentao/fast-levenshtein/blob/master/LICENSE.md) blockvote ================== This [React] app was initialized with [create-near-app] Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install dependencies: `yarn install` 3. Run the local development server: `yarn dev` (see `package.json` for a full list of `scripts` you can run with `yarn`) Now you'll have a local development environment backed by the NEAR TestNet! Go ahead and play with the app and the code. As you make code changes, the app will automatically reload. Exploring The Code ================== 1. The "backend" code lives in the `/contract` folder. See the README there for more info. 2. The frontend code lives in the `/src` folder. `/src/index.html` is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and the smart contract. See `contract/README` for info about how it's tested. The frontend code gets tested with [jest]. You can run both of these at once with `yarn run test`. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally: yarn install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `blockvote.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `blockvote.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account blockvote.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'blockvote.YOUR-NAME.testnet' Step 3: deploy! --------------- One command: yarn deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contract to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [React]: https://reactjs.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages # randexp.js randexp will generate a random string that matches a given RegExp Javascript object. [![Build Status](https://secure.travis-ci.org/fent/randexp.js.svg)](http://travis-ci.org/fent/randexp.js) [![Dependency Status](https://david-dm.org/fent/randexp.js.svg)](https://david-dm.org/fent/randexp.js) [![codecov](https://codecov.io/gh/fent/randexp.js/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/randexp.js) # Usage ```js var RandExp = require('randexp'); // supports grouping and piping new RandExp(/hello+ (world|to you)/).gen(); // => hellooooooooooooooooooo world // sets and ranges and references new RandExp(/<([a-z]\w{0,20})>foo<\1>/).gen(); // => <m5xhdg>foo<m5xhdg> // wildcard new RandExp(/random stuff: .+/).gen(); // => random stuff: l3m;Hf9XYbI [YPaxV>U*4-_F!WXQh9>;rH3i l!8.zoh?[utt1OWFQrE ^~8zEQm]~tK // ignore case new RandExp(/xxx xtreme dragon warrior xxx/i).gen(); // => xxx xtReME dRAGON warRiOR xXX // dynamic regexp shortcut new RandExp('(sun|mon|tue|wednes|thurs|fri|satur)day', 'i'); // is the same as new RandExp(new RegExp('(sun|mon|tue|wednes|thurs|fri|satur)day', 'i')); ``` If you're only going to use `gen()` once with a regexp and want slightly shorter syntax for it ```js var randexp = require('randexp').randexp; randexp(/[1-6]/); // 4 randexp('great|good( job)?|excellent'); // great ``` If you miss the old syntax ```js require('randexp').sugar(); /yes|no|maybe|i don't know/.gen(); // maybe ``` # Motivation Regular expressions are used in every language, every programmer is familiar with them. Regex can be used to easily express complex strings. What better way to generate a random string than with a language you can use to express the string you want? Thanks to [String-Random](http://search.cpan.org/~steve/String-Random-0.22/lib/String/Random.pm) for giving me the idea to make this in the first place and [randexp](https://github.com/benburkert/randexp) for the sweet `.gen()` syntax. # Default Range The default generated character range includes printable ASCII. In order to add or remove characters, a `defaultRange` attribute is exposed. you can `subtract(from, to)` and `add(from, to)` ```js var randexp = new RandExp(/random stuff: .+/); randexp.defaultRange.subtract(32, 126); randexp.defaultRange.add(0, 65535); randexp.gen(); // => random stuff: 湐箻ໜ䫴␩⶛㳸長���邓蕲뤀쑡篷皇硬剈궦佔칗븛뀃匫鴔事좍ﯣ⭼ꝏ䭍詳蒂䥂뽭 ``` # Custom PRNG The default randomness is provided by `Math.random()`. If you need to use a seedable or cryptographic PRNG, you can override `RandExp.prototype.randInt` or `randexp.randInt` (where `randexp` is an instance of `RandExp`). `randInt(from, to)` accepts an inclusive range and returns a randomly selected number within that range. # Infinite Repetitionals Repetitional tokens such as `*`, `+`, and `{3,}` have an infinite max range. In this case, randexp looks at its min and adds 100 to it to get a useable max value. If you want to use another int other than 100 you can change the `max` property in `RandExp.prototype` or the RandExp instance. ```js var randexp = new RandExp(/no{1,}/); randexp.max = 1000000; ``` With `RandExp.sugar()` ```js var regexp = /(hi)*/; regexp.max = 1000000; ``` # Bad Regular Expressions There are some regular expressions which can never match any string. * Ones with badly placed positionals such as `/a^/` and `/$c/m`. Randexp will ignore positional tokens. * Back references to non-existing groups like `/(a)\1\2/`. Randexp will ignore those references, returning an empty string for them. If the group exists only after the reference is used such as in `/\1 (hey)/`, it will too be ignored. * Custom negated character sets with two sets inside that cancel each other out. Example: `/[^\w\W]/`. If you give this to randexp, it will return an empty string for this set since it can't match anything. # Projects based on randexp.js ## JSON-Schema Faker Use generators to populate JSON Schema samples. See: [jsf on github](https://github.com/json-schema-faker/json-schema-faker/) and [jsf demo page](http://json-schema-faker.js.org/). # Install ### Node.js npm install randexp ### Browser Download the [minified version](https://github.com/fent/randexp.js/releases) from the latest release. # Tests Tests are written with [mocha](https://mochajs.org) ```bash npm test ``` # License MIT # json-schema-traverse Traverse JSON Schema passing each schema object to callback [![Build Status](https://travis-ci.org/epoberezkin/json-schema-traverse.svg?branch=master)](https://travis-ci.org/epoberezkin/json-schema-traverse) [![npm version](https://badge.fury.io/js/json-schema-traverse.svg)](https://www.npmjs.com/package/json-schema-traverse) [![Coverage Status](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) ## Install ``` npm install json-schema-traverse ``` ## Usage ```javascript const traverse = require('json-schema-traverse'); const schema = { properties: { foo: {type: 'string'}, bar: {type: 'integer'} } }; traverse(schema, {cb}); // cb is called 3 times with: // 1. root schema // 2. {type: 'string'} // 3. {type: 'integer'} // Or: traverse(schema, {cb: {pre, post}}); // pre is called 3 times with: // 1. root schema // 2. {type: 'string'} // 3. {type: 'integer'} // // post is called 3 times with: // 1. {type: 'string'} // 2. {type: 'integer'} // 3. root schema ``` Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. Callback is passed these parameters: - _schema_: the current schema object - _JSON pointer_: from the root schema to the current schema object - _root schema_: the schema passed to `traverse` object - _parent JSON pointer_: from the root schema to the parent schema object (see below) - _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) - _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema - _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` ## Traverse objects in all unknown keywords ```javascript const traverse = require('json-schema-traverse'); const schema = { mySchema: { minimum: 1, maximum: 2 } }; traverse(schema, {allKeys: true, cb}); // cb is called 2 times with: // 1. root schema // 2. mySchema ``` Without option `allKeys: true` callback will be called only with root schema. ## License [MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) # <img src="./logo.png" alt="bn.js" width="160" height="160" /> > BigNum in pure javascript [![Build Status](https://secure.travis-ci.org/indutny/bn.js.png)](http://travis-ci.org/indutny/bn.js) ## Install `npm install --save bn.js` ## Usage ```js const BN = require('bn.js'); var a = new BN('dead', 16); var b = new BN('101010', 2); var res = a.add(b); console.log(res.toString(10)); // 57047 ``` **Note**: decimals are not supported in this library. ## Notation ### Prefixes There are several prefixes to instructions that affect the way the work. Here is the list of them in the order of appearance in the function name: * `i` - perform operation in-place, storing the result in the host object (on which the method was invoked). Might be used to avoid number allocation costs * `u` - unsigned, ignore the sign of operands when performing operation, or always return positive value. Second case applies to reduction operations like `mod()`. In such cases if the result will be negative - modulo will be added to the result to make it positive ### Postfixes * `n` - the argument of the function must be a plain JavaScript Number. Decimals are not supported. * `rn` - both argument and return value of the function are plain JavaScript Numbers. Decimals are not supported. ### Examples * `a.iadd(b)` - perform addition on `a` and `b`, storing the result in `a` * `a.umod(b)` - reduce `a` modulo `b`, returning positive value * `a.iushln(13)` - shift bits of `a` left by 13 ## Instructions Prefixes/postfixes are put in parens at the of the line. `endian` - could be either `le` (little-endian) or `be` (big-endian). ### Utilities * `a.clone()` - clone number * `a.toString(base, length)` - convert to base-string and pad with zeroes * `a.toNumber()` - convert to Javascript Number (limited to 53 bits) * `a.toJSON()` - convert to JSON compatible hex string (alias of `toString(16)`) * `a.toArray(endian, length)` - convert to byte `Array`, and optionally zero pad to length, throwing if already exceeding * `a.toArrayLike(type, endian, length)` - convert to an instance of `type`, which must behave like an `Array` * `a.toBuffer(endian, length)` - convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: `a.toArrayLike(Buffer, endian, length)` * `a.bitLength()` - get number of bits occupied * `a.zeroBits()` - return number of less-significant consequent zero bits (example: `1010000` has 4 zero bits) * `a.byteLength()` - return number of bytes occupied * `a.isNeg()` - true if the number is negative * `a.isEven()` - no comments * `a.isOdd()` - no comments * `a.isZero()` - no comments * `a.cmp(b)` - compare numbers and return `-1` (a `<` b), `0` (a `==` b), or `1` (a `>` b) depending on the comparison result (`ucmp`, `cmpn`) * `a.lt(b)` - `a` less than `b` (`n`) * `a.lte(b)` - `a` less than or equals `b` (`n`) * `a.gt(b)` - `a` greater than `b` (`n`) * `a.gte(b)` - `a` greater than or equals `b` (`n`) * `a.eq(b)` - `a` equals `b` (`n`) * `a.toTwos(width)` - convert to two's complement representation, where `width` is bit width * `a.fromTwos(width)` - convert from two's complement representation, where `width` is the bit width * `BN.isBN(object)` - returns true if the supplied `object` is a BN.js instance * `BN.max(a, b)` - return `a` if `a` bigger than `b` * `BN.min(a, b)` - return `a` if `a` less than `b` ### Arithmetics * `a.neg()` - negate sign (`i`) * `a.abs()` - absolute value (`i`) * `a.add(b)` - addition (`i`, `n`, `in`) * `a.sub(b)` - subtraction (`i`, `n`, `in`) * `a.mul(b)` - multiply (`i`, `n`, `in`) * `a.sqr()` - square (`i`) * `a.pow(b)` - raise `a` to the power of `b` * `a.div(b)` - divide (`divn`, `idivn`) * `a.mod(b)` - reduct (`u`, `n`) (but no `umodn`) * `a.divmod(b)` - quotient and modulus obtained by dividing * `a.divRound(b)` - rounded division ### Bit operations * `a.or(b)` - or (`i`, `u`, `iu`) * `a.and(b)` - and (`i`, `u`, `iu`, `andln`) (NOTE: `andln` is going to be replaced with `andn` in future) * `a.xor(b)` - xor (`i`, `u`, `iu`) * `a.setn(b, value)` - set specified bit to `value` * `a.shln(b)` - shift left (`i`, `u`, `iu`) * `a.shrn(b)` - shift right (`i`, `u`, `iu`) * `a.testn(b)` - test if specified bit is set * `a.maskn(b)` - clear bits with indexes higher or equal to `b` (`i`) * `a.bincn(b)` - add `1 << b` to the number * `a.notn(w)` - not (for the width specified by `w`) (`i`) ### Reduction * `a.gcd(b)` - GCD * `a.egcd(b)` - Extended GCD results (`{ a: ..., b: ..., gcd: ... }`) * `a.invm(b)` - inverse `a` modulo `b` ## Fast reduction When doing lots of reductions using the same modulo, it might be beneficial to use some tricks: like [Montgomery multiplication][0], or using special algorithm for [Mersenne Prime][1]. ### Reduction context To enable this tricks one should create a reduction context: ```js var red = BN.red(num); ``` where `num` is just a BN instance. Or: ```js var red = BN.red(primeName); ``` Where `primeName` is either of these [Mersenne Primes][1]: * `'k256'` * `'p224'` * `'p192'` * `'p25519'` Or: ```js var red = BN.mont(num); ``` To reduce numbers with [Montgomery trick][0]. `.mont()` is generally faster than `.red(num)`, but slower than `BN.red(primeName)`. ### Converting numbers Before performing anything in reduction context - numbers should be converted to it. Usually, this means that one should: * Convert inputs to reducted ones * Operate on them in reduction context * Convert outputs back from the reduction context Here is how one may convert numbers to `red`: ```js var redA = a.toRed(red); ``` Where `red` is a reduction context created using instructions above Here is how to convert them back: ```js var a = redA.fromRed(); ``` ### Red instructions Most of the instructions from the very start of this readme have their counterparts in red context: * `a.redAdd(b)`, `a.redIAdd(b)` * `a.redSub(b)`, `a.redISub(b)` * `a.redShl(num)` * `a.redMul(b)`, `a.redIMul(b)` * `a.redSqr()`, `a.redISqr()` * `a.redSqrt()` - square root modulo reduction context's prime * `a.redInvm()` - modular inverse of the number * `a.redNeg()` * `a.redPow(b)` - modular exponentiation ### Number Size Optimized for elliptic curves that work with 256-bit numbers. There is no limitation on the size of the numbers. ## LICENSE This software is licensed under the MIT License. [0]: https://en.wikipedia.org/wiki/Montgomery_modular_multiplication [1]: https://en.wikipedia.org/wiki/Mersenne_prime [![NPM registry](https://img.shields.io/npm/v/as-bignum.svg?style=for-the-badge)](https://www.npmjs.com/package/as-bignum)[![Build Status](https://img.shields.io/travis/com/MaxGraey/as-bignum/master?style=for-the-badge)](https://travis-ci.com/MaxGraey/as-bignum)[![NPM license](https://img.shields.io/badge/license-Apache%202.0-ba68c8.svg?style=for-the-badge)](LICENSE.md) ## WebAssembly fixed length big numbers written on [AssemblyScript](https://github.com/AssemblyScript/assemblyscript) ### Status: Work in progress Provide wide numeric types such as `u128`, `u256`, `i128`, `i256` and fixed points and also its arithmetic operations. Namespace `safe` contain equivalents with overflow/underflow traps. All kind of types pretty useful for economical and cryptographic usages and provide deterministic behavior. ### Install > yarn add as-bignum or > npm i as-bignum ### Usage via AssemblyScript ```ts import { u128 } from "as-bignum"; declare function logF64(value: f64): void; declare function logU128(hi: u64, lo: u64): void; var a = u128.One; var b = u128.from(-32); // same as u128.from<i32>(-32) var c = new u128(0x1, -0xF); var d = u128.from(0x0123456789ABCDEF); // same as u128.from<i64>(0x0123456789ABCDEF) var e = u128.from('0x0123456789ABCDEF01234567'); var f = u128.fromString('11100010101100101', 2); // same as u128.from('0b11100010101100101') var r = d / c + (b << 5) + e; logF64(r.as<f64>()); logU128(r.hi, r.lo); ``` ### Usage via JavaScript/Typescript ```ts TODO ``` ### List of types - [x] [`u128`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/u128.ts) unsigned type (tested) - [ ] [`u256`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/u256.ts) unsigned type (very basic) - [ ] `i128` signed type - [ ] `i256` signed type --- - [x] [`safe.u128`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/safe/u128.ts) unsigned type (tested) - [ ] `safe.u256` unsigned type - [ ] `safe.i128` signed type - [ ] `safe.i256` signed type --- - [ ] [`fp128<Q>`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/fixed/fp128.ts) generic fixed point signed type٭ (very basic for now) - [ ] `fp256<Q>` generic fixed point signed type٭ --- - [ ] `safe.fp128<Q>` generic fixed point signed type٭ - [ ] `safe.fp256<Q>` generic fixed point signed type٭ ٭ _typename_ `Q` _is a type representing count of fractional bits_ # flat-cache > A stupidly simple key/value storage using files to persist the data [![NPM Version](http://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache) [![Build Status](https://api.travis-ci.org/royriojas/flat-cache.svg?branch=master)](https://travis-ci.org/royriojas/flat-cache) ## install ```bash npm i --save flat-cache ``` ## Usage ```js var flatCache = require('flat-cache') // loads the cache, if one does not exists for the given // Id a new one will be prepared to be created var cache = flatCache.load('cacheId'); // sets a key on the cache cache.setKey('key', { foo: 'var' }); // get a key from the cache cache.getKey('key') // { foo: 'var' } // fetch the entire persisted object cache.all() // { 'key': { foo: 'var' } } // remove a key cache.removeKey('key'); // removes a key from the cache // save it to disk cache.save(); // very important, if you don't save no changes will be persisted. // cache.save( true /* noPrune */) // can be used to prevent the removal of non visited keys // loads the cache from a given directory, if one does // not exists for the given Id a new one will be prepared to be created var cache = flatCache.load('cacheId', path.resolve('./path/to/folder')); // The following methods are useful to clear the cache // delete a given cache flatCache.clearCacheById('cacheId') // removes the cacheId document if one exists. // delete all cache flatCache.clearAll(); // remove the cache directory ``` ## Motivation for this module I needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make a script that will beutify files with `esformatter` only execute on the files that were changed since the last run. To make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value` storage was needed and Bam! this module was born. ## Important notes - If no directory is especified when the `load` method is called, a folder named `.cache` will be created inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you might want to ignore the default `.cache` folder, or specify a custom directory. - The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references - All the changes to the cache state are done to memory - I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module intentionally dumb and simple - Non visited keys are removed when `cache.save()` is called. If this is not desired, you can pass `true` to the save call like: `cache.save( true /* noPrune */ )`. ## License MIT ## Changelog [changelog](./changelog.md) # cliui [![Build Status](https://travis-ci.org/yargs/cliui.svg)](https://travis-ci.org/yargs/cliui) [![Coverage Status](https://coveralls.io/repos/yargs/cliui/badge.svg?branch=)](https://coveralls.io/r/yargs/cliui?branch=) [![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) easily create complex multi-column command-line-interfaces. ## Example ```js var ui = require('cliui')() ui.div('Usage: $0 [command] [options]') ui.div({ text: 'Options:', padding: [2, 0, 2, 0] }) ui.div( { text: "-f, --file", width: 20, padding: [0, 4, 0, 4] }, { text: "the file to load." + chalk.green("(if this description is long it wraps).") , width: 20 }, { text: chalk.red("[required]"), align: 'right' } ) console.log(ui.toString()) ``` <img width="500" src="screenshot.png"> ## Layout DSL cliui exposes a simple layout DSL: If you create a single `ui.div`, passing a string rather than an object: * `\n`: characters will be interpreted as new rows. * `\t`: characters will be interpreted as new columns. * `\s`: characters will be interpreted as padding. **as an example...** ```js var ui = require('./')({ width: 60 }) ui.div( 'Usage: node ./bin/foo.js\n' + ' <regex>\t provide a regex\n' + ' <glob>\t provide a glob\t [required]' ) console.log(ui.toString()) ``` **will output:** ```shell Usage: node ./bin/foo.js <regex> provide a regex <glob> provide a glob [required] ``` ## Methods ```js cliui = require('cliui') ``` ### cliui({width: integer}) Specify the maximum width of the UI being generated. If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`. ### cliui({wrap: boolean}) Enable or disable the wrapping of text in a column. ### cliui.div(column, column, column) Create a row with any number of columns, a column can either be a string, or an object with the following options: * **text:** some text to place in the column. * **width:** the width of a column. * **align:** alignment, `right` or `center`. * **padding:** `[top, right, bottom, left]`. * **border:** should a border be placed around the div? ### cliui.span(column, column, column) Similar to `div`, except the next row will be appended without a new line being created. ### cliui.resetOutput() Resets the UI elements of the current cliui instance, maintaining the values set for `width` and `wrap`. # eslint-utils [![npm version](https://img.shields.io/npm/v/eslint-utils.svg)](https://www.npmjs.com/package/eslint-utils) [![Downloads/month](https://img.shields.io/npm/dm/eslint-utils.svg)](http://www.npmtrends.com/eslint-utils) [![Build Status](https://github.com/mysticatea/eslint-utils/workflows/CI/badge.svg)](https://github.com/mysticatea/eslint-utils/actions) [![Coverage Status](https://codecov.io/gh/mysticatea/eslint-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-utils) [![Dependency Status](https://david-dm.org/mysticatea/eslint-utils.svg)](https://david-dm.org/mysticatea/eslint-utils) ## 🏁 Goal This package provides utility functions and classes for make ESLint custom rules. For examples: - [getStaticValue](https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue) evaluates static value on AST. - [ReferenceTracker](https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. ## 📖 Usage See [documentation](https://eslint-utils.mysticatea.dev/). ## 📰 Changelog See [releases](https://github.com/mysticatea/eslint-utils/releases). ## ❤️ Contributing Welcome contributing! Please use GitHub's Issues/PRs. ### Development Tools - `npm test` runs tests and measures coverage. - `npm run clean` removes the coverage result of `npm test` command. - `npm run coverage` shows the coverage result of the last `npm test` command. - `npm run lint` runs ESLint. - `npm run watch` runs tests on each file change. bs58 ==== [![build status](https://travis-ci.org/cryptocoinjs/bs58.svg)](https://travis-ci.org/cryptocoinjs/bs58) JavaScript component to compute base 58 encoding. This encoding is typically used for crypto currencies such as Bitcoin. **Note:** If you're looking for **base 58 check** encoding, see: [https://github.com/bitcoinjs/bs58check](https://github.com/bitcoinjs/bs58check), which depends upon this library. Install ------- npm i --save bs58 API --- ### encode(input) `input` must be a [Buffer](https://nodejs.org/api/buffer.html) or an `Array`. It returns a `string`. **example**: ```js const bs58 = require('bs58') const bytes = Buffer.from('003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187', 'hex') const address = bs58.encode(bytes) console.log(address) // => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS ``` ### decode(input) `input` must be a base 58 encoded string. Returns a [Buffer](https://nodejs.org/api/buffer.html). **example**: ```js const bs58 = require('bs58') const address = '16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS' const bytes = bs58.decode(address) console.log(out.toString('hex')) // => 003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187 ``` Hack / Test ----------- Uses JavaScript standard style. Read more: [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) Credits ------- - [Mike Hearn](https://github.com/mikehearn) for original Java implementation - [Stefan Thomas](https://github.com/justmoon) for porting to JavaScript - [Stephan Pair](https://github.com/gasteve) for buffer improvements - [Daniel Cousens](https://github.com/dcousens) for cleanup and merging improvements from bitcoinjs-lib - [Jared Deckard](https://github.com/deckar01) for killing `bigi` as a dependency License ------- MIT # minizlib A fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding. This module was created to serve the needs of [node-tar](http://npm.im/tar) and [minipass-fetch](http://npm.im/minipass-fetch). Brotli is supported in versions of node with a Brotli binding. ## How does this differ from the streams in `require('zlib')`? First, there are no convenience methods to compress or decompress a buffer. If you want those, use the built-in `zlib` module. This is only streams. That being said, Minipass streams to make it fairly easy to use as one-liners: `new zlib.Deflate().end(data).read()` will return the deflate compressed result. This module compresses and decompresses the data as fast as you feed it in. It is synchronous, and runs on the main process thread. Zlib and Brotli operations can be high CPU, but they're very fast, and doing it this way means much less bookkeeping and artificial deferral. Node's built in zlib streams are built on top of `stream.Transform`. They do the maximally safe thing with respect to consistent asynchrony, buffering, and backpressure. See [Minipass](http://npm.im/minipass) for more on the differences between Node.js core streams and Minipass streams, and the convenience methods provided by that class. ## Classes - Deflate - Inflate - Gzip - Gunzip - DeflateRaw - InflateRaw - Unzip - BrotliCompress (Node v10 and higher) - BrotliDecompress (Node v10 and higher) ## USAGE ```js const zlib = require('minizlib') const input = sourceOfCompressedData() const decode = new zlib.BrotliDecompress() const output = whereToWriteTheDecodedData() input.pipe(decode).pipe(output) ``` ## REPRODUCIBLE BUILDS To create reproducible gzip compressed files across different operating systems, set `portable: true` in the options. This causes minizlib to set the `OS` indicator in byte 9 of the extended gzip header to `0xFF` for 'unknown'. <h1 align="center">Enquirer</h1> <p align="center"> <a href="https://npmjs.org/package/enquirer"> <img src="https://img.shields.io/npm/v/enquirer.svg" alt="version"> </a> <a href="https://travis-ci.org/enquirer/enquirer"> <img src="https://img.shields.io/travis/enquirer/enquirer.svg" alt="travis"> </a> <a href="https://npmjs.org/package/enquirer"> <img src="https://img.shields.io/npm/dm/enquirer.svg" alt="downloads"> </a> </p> <br> <br> <p align="center"> <b>Stylish CLI prompts that are user-friendly, intuitive and easy to create.</b><br> <sub>>_ Prompts should be more like conversations than inquisitions▌</sub> </p> <br> <p align="center"> <sub>(Example shows Enquirer's <a href="#survey-prompt">Survey Prompt</a>)</a></sub> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/survey-prompt.gif" alt="Enquirer Survey Prompt" width="750"><br> <sub>The terminal in all examples is <a href="https://hyper.is/">Hyper</a>, theme is <a href="https://github.com/jonschlinkert/hyper-monokai-extended">hyper-monokai-extended</a>.</sub><br><br> <a href="#built-in-prompts"><strong>See more prompt examples</strong></a> </p> <br> <br> Created by [jonschlinkert](https://github.com/jonschlinkert) and [doowb](https://github.com/doowb), Enquirer is fast, easy to use, and lightweight enough for small projects, while also being powerful and customizable enough for the most advanced use cases. * **Fast** - [Loads in ~4ms](#-performance) (that's about _3-4 times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps_) * **Lightweight** - Only one dependency, the excellent [ansi-colors](https://github.com/doowb/ansi-colors) by [Brian Woodward](https://github.com/doowb). * **Easy to implement** - Uses promises and async/await and sensible defaults to make prompts easy to create and implement. * **Easy to use** - Thrill your users with a better experience! Navigating around input and choices is a breeze. You can even create [quizzes](examples/fun/countdown.js), or [record](examples/fun/record.js) and [playback](examples/fun/play.js) key bindings to aid with tutorials and videos. * **Intuitive** - Keypress combos are available to simplify usage. * **Flexible** - All prompts can be used standalone or chained together. * **Stylish** - Easily override semantic styles and symbols for any part of the prompt. * **Extensible** - Easily create and use custom prompts by extending Enquirer's built-in [prompts](#-prompts). * **Pluggable** - Add advanced features to Enquirer using plugins. * **Validation** - Optionally validate user input with any prompt. * **Well tested** - All prompts are well-tested, and tests are easy to create without having to use brittle, hacky solutions to spy on prompts or "inject" values. * **Examples** - There are numerous [examples](examples) available to help you get started. If you like Enquirer, please consider starring or tweeting about this project to show your support. Thanks! <br> <p align="center"> <b>>_ Ready to start making prompts your users will love? ▌</b><br> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/heartbeat.gif" alt="Enquirer Select Prompt with heartbeat example" width="750"> </p> <br> <br> ## ❯ Getting started Get started with Enquirer, the most powerful and easy-to-use Node.js library for creating interactive CLI prompts. * [Install](#-install) * [Usage](#-usage) * [Enquirer](#-enquirer) * [Prompts](#-prompts) - [Built-in Prompts](#-prompts) - [Custom Prompts](#-custom-prompts) * [Key Bindings](#-key-bindings) * [Options](#-options) * [Release History](#-release-history) * [Performance](#-performance) * [About](#-about) <br> ## ❯ Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install enquirer --save ``` Install with [yarn](https://yarnpkg.com/en/): ```sh $ yarn add enquirer ``` <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/npm-install.gif" alt="Install Enquirer with NPM" width="750"> </p> _(Requires Node.js 8.6 or higher. Please let us know if you need support for an earlier version by creating an [issue](../../issues/new).)_ <br> ## ❯ Usage ### Single prompt The easiest way to get started with enquirer is to pass a [question object](#prompt-options) to the `prompt` method. ```js const { prompt } = require('enquirer'); const response = await prompt({ type: 'input', name: 'username', message: 'What is your username?' }); console.log(response); // { username: 'jonschlinkert' } ``` _(Examples with `await` need to be run inside an `async` function)_ ### Multiple prompts Pass an array of ["question" objects](#prompt-options) to run a series of prompts. ```js const response = await prompt([ { type: 'input', name: 'name', message: 'What is your name?' }, { type: 'input', name: 'username', message: 'What is your username?' } ]); console.log(response); // { name: 'Edward Chan', username: 'edwardmchan' } ``` ### Different ways to run enquirer #### 1. By importing the specific `built-in prompt` ```js const { Confirm } = require('enquirer'); const prompt = new Confirm({ name: 'question', message: 'Did you like enquirer?' }); prompt.run() .then(answer => console.log('Answer:', answer)); ``` #### 2. By passing the options to `prompt` ```js const { prompt } = require('enquirer'); prompt({ type: 'confirm', name: 'question', message: 'Did you like enquirer?' }) .then(answer => console.log('Answer:', answer)); ``` **Jump to**: [Getting Started](#-getting-started) · [Prompts](#-prompts) · [Options](#-options) · [Key Bindings](#-key-bindings) <br> ## ❯ Enquirer **Enquirer is a prompt runner** Add Enquirer to your JavaScript project with following line of code. ```js const Enquirer = require('enquirer'); ``` The main export of this library is the `Enquirer` class, which has methods and features designed to simplify running prompts. ```js const { prompt } = require('enquirer'); const question = [ { type: 'input', name: 'username', message: 'What is your username?' }, { type: 'password', name: 'password', message: 'What is your password?' } ]; let answers = await prompt(question); console.log(answers); ``` **Prompts control how values are rendered and returned** Each individual prompt is a class with special features and functionality for rendering the types of values you want to show users in the terminal, and subsequently returning the types of values you need to use in your application. **How can I customize prompts?** Below in this guide you will find information about creating [custom prompts](#-custom-prompts). For now, we'll focus on how to customize an existing prompt. All of the individual [prompt classes](#built-in-prompts) in this library are exposed as static properties on Enquirer. This allows them to be used directly without using `enquirer.prompt()`. Use this approach if you need to modify a prompt instance, or listen for events on the prompt. **Example** ```js const { Input } = require('enquirer'); const prompt = new Input({ name: 'username', message: 'What is your username?' }); prompt.run() .then(answer => console.log('Username:', answer)) .catch(console.error); ``` ### [Enquirer](index.js#L20) Create an instance of `Enquirer`. **Params** * `options` **{Object}**: (optional) Options to use with all prompts. * `answers` **{Object}**: (optional) Answers object to initialize with. **Example** ```js const Enquirer = require('enquirer'); const enquirer = new Enquirer(); ``` ### [register()](index.js#L42) Register a custom prompt type. **Params** * `type` **{String}** * `fn` **{Function|Prompt}**: `Prompt` class, or a function that returns a `Prompt` class. * `returns` **{Object}**: Returns the Enquirer instance **Example** ```js const Enquirer = require('enquirer'); const enquirer = new Enquirer(); enquirer.register('customType', require('./custom-prompt')); ``` ### [prompt()](index.js#L78) Prompt function that takes a "question" object or array of question objects, and returns an object with responses from the user. **Params** * `questions` **{Array|Object}**: Options objects for one or more prompts to run. * `returns` **{Promise}**: Promise that returns an "answers" object with the user's responses. **Example** ```js const Enquirer = require('enquirer'); const enquirer = new Enquirer(); const response = await enquirer.prompt({ type: 'input', name: 'username', message: 'What is your username?' }); console.log(response); ``` ### [use()](index.js#L160) Use an enquirer plugin. **Params** * `plugin` **{Function}**: Plugin function that takes an instance of Enquirer. * `returns` **{Object}**: Returns the Enquirer instance. **Example** ```js const Enquirer = require('enquirer'); const enquirer = new Enquirer(); const plugin = enquirer => { // do stuff to enquire instance }; enquirer.use(plugin); ``` ### [Enquirer#prompt](index.js#L210) Prompt function that takes a "question" object or array of question objects, and returns an object with responses from the user. **Params** * `questions` **{Array|Object}**: Options objects for one or more prompts to run. * `returns` **{Promise}**: Promise that returns an "answers" object with the user's responses. **Example** ```js const { prompt } = require('enquirer'); const response = await prompt({ type: 'input', name: 'username', message: 'What is your username?' }); console.log(response); ``` <br> ## ❯ Prompts This section is about Enquirer's prompts: what they look like, how they work, how to run them, available options, and how to customize the prompts or create your own prompt concept. **Getting started with Enquirer's prompts** * [Prompt](#prompt) - The base `Prompt` class used by other prompts - [Prompt Options](#prompt-options) * [Built-in prompts](#built-in-prompts) * [Prompt Types](#prompt-types) - The base `Prompt` class used by other prompts * [Custom prompts](#%E2%9D%AF-custom-prompts) - Enquirer 2.0 introduced the concept of prompt "types", with the goal of making custom prompts easier than ever to create and use. ### Prompt The base `Prompt` class is used to create all other prompts. ```js const { Prompt } = require('enquirer'); class MyCustomPrompt extends Prompt {} ``` See the documentation for [creating custom prompts](#-custom-prompts) to learn more about how this works. #### Prompt Options Each prompt takes an options object (aka "question" object), that implements the following interface: ```js { // required type: string | function, name: string | function, message: string | function | async function, // optional skip: boolean | function | async function, initial: string | function | async function, format: function | async function, result: function | async function, validate: function | async function, } ``` Each property of the options object is described below: | **Property** | **Required?** | **Type** | **Description** | | ------------ | ------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | yes | `string\|function` | Enquirer uses this value to determine the type of prompt to run, but it's optional when prompts are run directly. | | `name` | yes | `string\|function` | Used as the key for the answer on the returned values (answers) object. | | `message` | yes | `string\|function` | The message to display when the prompt is rendered in the terminal. | | `skip` | no | `boolean\|function` | If `true` it will not ask that prompt. | | `initial` | no | `string\|function` | The default value to return if the user does not supply a value. | | `format` | no | `function` | Function to format user input in the terminal. | | `result` | no | `function` | Function to format the final submitted value before it's returned. | | `validate` | no | `function` | Function to validate the submitted value before it's returned. This function may return a boolean or a string. If a string is returned it will be used as the validation error message. | **Example usage** ```js const { prompt } = require('enquirer'); const question = { type: 'input', name: 'username', message: 'What is your username?' }; prompt(question) .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` <br> ### Built-in prompts * [AutoComplete Prompt](#autocomplete-prompt) * [BasicAuth Prompt](#basicauth-prompt) * [Confirm Prompt](#confirm-prompt) * [Form Prompt](#form-prompt) * [Input Prompt](#input-prompt) * [Invisible Prompt](#invisible-prompt) * [List Prompt](#list-prompt) * [MultiSelect Prompt](#multiselect-prompt) * [Numeral Prompt](#numeral-prompt) * [Password Prompt](#password-prompt) * [Quiz Prompt](#quiz-prompt) * [Survey Prompt](#survey-prompt) * [Scale Prompt](#scale-prompt) * [Select Prompt](#select-prompt) * [Sort Prompt](#sort-prompt) * [Snippet Prompt](#snippet-prompt) * [Toggle Prompt](#toggle-prompt) ### AutoComplete Prompt Prompt that auto-completes as the user types, and returns the selected value as a string. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/autocomplete-prompt.gif" alt="Enquirer AutoComplete Prompt" width="750"> </p> **Example Usage** ```js const { AutoComplete } = require('enquirer'); const prompt = new AutoComplete({ name: 'flavor', message: 'Pick your favorite flavor', limit: 10, initial: 2, choices: [ 'Almond', 'Apple', 'Banana', 'Blackberry', 'Blueberry', 'Cherry', 'Chocolate', 'Cinnamon', 'Coconut', 'Cranberry', 'Grape', 'Nougat', 'Orange', 'Pear', 'Pineapple', 'Raspberry', 'Strawberry', 'Vanilla', 'Watermelon', 'Wintergreen' ] }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` **AutoComplete Options** | Option | Type | Default | Description | | ----------- | ---------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | `highlight` | `function` | `dim` version of primary style | The color to use when "highlighting" characters in the list that match user input. | | `multiple` | `boolean` | `false` | Allow multiple choices to be selected. | | `suggest` | `function` | Greedy match, returns true if choice message contains input string. | Function that filters choices. Takes user input and a choices array, and returns a list of matching choices. | | `initial` | `number` | 0 | Preselected item in the list of choices. | | `footer` | `function` | None | Function that displays [footer text](https://github.com/enquirer/enquirer/blob/6c2819518a1e2ed284242a99a685655fbaabfa28/examples/autocomplete/option-footer.js#L10) | **Related prompts** * [Select](#select-prompt) * [MultiSelect](#multiselect-prompt) * [Survey](#survey-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### BasicAuth Prompt Prompt that asks for username and password to authenticate the user. The default implementation of `authenticate` function in `BasicAuth` prompt is to compare the username and password with the values supplied while running the prompt. The implementer is expected to override the `authenticate` function with a custom logic such as making an API request to a server to authenticate the username and password entered and expect a token back. <p align="center"> <img src="https://user-images.githubusercontent.com/13731210/61570485-7ffd9c00-aaaa-11e9-857a-d47dc7008284.gif" alt="Enquirer BasicAuth Prompt" width="750"> </p> **Example Usage** ```js const { BasicAuth } = require('enquirer'); const prompt = new BasicAuth({ name: 'password', message: 'Please enter your password', username: 'rajat-sr', password: '123', showPassword: true }); prompt .run() .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Confirm Prompt Prompt that returns `true` or `false`. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/confirm-prompt.gif" alt="Enquirer Confirm Prompt" width="750"> </p> **Example Usage** ```js const { Confirm } = require('enquirer'); const prompt = new Confirm({ name: 'question', message: 'Want to answer?' }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` **Related prompts** * [Input](#input-prompt) * [Numeral](#numeral-prompt) * [Password](#password-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Form Prompt Prompt that allows the user to enter and submit multiple values on a single terminal screen. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/form-prompt.gif" alt="Enquirer Form Prompt" width="750"> </p> **Example Usage** ```js const { Form } = require('enquirer'); const prompt = new Form({ name: 'user', message: 'Please provide the following information:', choices: [ { name: 'firstname', message: 'First Name', initial: 'Jon' }, { name: 'lastname', message: 'Last Name', initial: 'Schlinkert' }, { name: 'username', message: 'GitHub username', initial: 'jonschlinkert' } ] }); prompt.run() .then(value => console.log('Answer:', value)) .catch(console.error); ``` **Related prompts** * [Input](#input-prompt) * [Survey](#survey-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Input Prompt Prompt that takes user input and returns a string. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/input-prompt.gif" alt="Enquirer Input Prompt" width="750"> </p> **Example Usage** ```js const { Input } = require('enquirer'); const prompt = new Input({ message: 'What is your username?', initial: 'jonschlinkert' }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.log); ``` You can use [data-store](https://github.com/jonschlinkert/data-store) to store [input history](https://github.com/enquirer/enquirer/blob/master/examples/input/option-history.js) that the user can cycle through (see [source](https://github.com/enquirer/enquirer/blob/8407dc3579123df5e6e20215078e33bb605b0c37/lib/prompts/input.js)). **Related prompts** * [Confirm](#confirm-prompt) * [Numeral](#numeral-prompt) * [Password](#password-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Invisible Prompt Prompt that takes user input, hides it from the terminal, and returns a string. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/invisible-prompt.gif" alt="Enquirer Invisible Prompt" width="750"> </p> **Example Usage** ```js const { Invisible } = require('enquirer'); const prompt = new Invisible({ name: 'secret', message: 'What is your secret?' }); prompt.run() .then(answer => console.log('Answer:', { secret: answer })) .catch(console.error); ``` **Related prompts** * [Password](#password-prompt) * [Input](#input-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### List Prompt Prompt that returns a list of values, created by splitting the user input. The default split character is `,` with optional trailing whitespace. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/list-prompt.gif" alt="Enquirer List Prompt" width="750"> </p> **Example Usage** ```js const { List } = require('enquirer'); const prompt = new List({ name: 'keywords', message: 'Type comma-separated keywords' }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` **Related prompts** * [Sort](#sort-prompt) * [Select](#select-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### MultiSelect Prompt Prompt that allows the user to select multiple items from a list of options. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/multiselect-prompt.gif" alt="Enquirer MultiSelect Prompt" width="750"> </p> **Example Usage** ```js const { MultiSelect } = require('enquirer'); const prompt = new MultiSelect({ name: 'value', message: 'Pick your favorite colors', limit: 7, choices: [ { name: 'aqua', value: '#00ffff' }, { name: 'black', value: '#000000' }, { name: 'blue', value: '#0000ff' }, { name: 'fuchsia', value: '#ff00ff' }, { name: 'gray', value: '#808080' }, { name: 'green', value: '#008000' }, { name: 'lime', value: '#00ff00' }, { name: 'maroon', value: '#800000' }, { name: 'navy', value: '#000080' }, { name: 'olive', value: '#808000' }, { name: 'purple', value: '#800080' }, { name: 'red', value: '#ff0000' }, { name: 'silver', value: '#c0c0c0' }, { name: 'teal', value: '#008080' }, { name: 'white', value: '#ffffff' }, { name: 'yellow', value: '#ffff00' } ] }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); // Answer: ['aqua', 'blue', 'fuchsia'] ``` **Example key-value pairs** Optionally, pass a `result` function and use the `.map` method to return an object of key-value pairs of the selected names and values: [example](./examples/multiselect/option-result.js) ```js const { MultiSelect } = require('enquirer'); const prompt = new MultiSelect({ name: 'value', message: 'Pick your favorite colors', limit: 7, choices: [ { name: 'aqua', value: '#00ffff' }, { name: 'black', value: '#000000' }, { name: 'blue', value: '#0000ff' }, { name: 'fuchsia', value: '#ff00ff' }, { name: 'gray', value: '#808080' }, { name: 'green', value: '#008000' }, { name: 'lime', value: '#00ff00' }, { name: 'maroon', value: '#800000' }, { name: 'navy', value: '#000080' }, { name: 'olive', value: '#808000' }, { name: 'purple', value: '#800080' }, { name: 'red', value: '#ff0000' }, { name: 'silver', value: '#c0c0c0' }, { name: 'teal', value: '#008080' }, { name: 'white', value: '#ffffff' }, { name: 'yellow', value: '#ffff00' } ], result(names) { return this.map(names); } }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); // Answer: { aqua: '#00ffff', blue: '#0000ff', fuchsia: '#ff00ff' } ``` **Related prompts** * [AutoComplete](#autocomplete-prompt) * [Select](#select-prompt) * [Survey](#survey-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Numeral Prompt Prompt that takes a number as input. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/numeral-prompt.gif" alt="Enquirer Numeral Prompt" width="750"> </p> **Example Usage** ```js const { NumberPrompt } = require('enquirer'); const prompt = new NumberPrompt({ name: 'number', message: 'Please enter a number' }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` **Related prompts** * [Input](#input-prompt) * [Confirm](#confirm-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Password Prompt Prompt that takes user input and masks it in the terminal. Also see the [invisible prompt](#invisible-prompt) <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/password-prompt.gif" alt="Enquirer Password Prompt" width="750"> </p> **Example Usage** ```js const { Password } = require('enquirer'); const prompt = new Password({ name: 'password', message: 'What is your password?' }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` **Related prompts** * [Input](#input-prompt) * [Invisible](#invisible-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Quiz Prompt Prompt that allows the user to play multiple-choice quiz questions. <p align="center"> <img src="https://user-images.githubusercontent.com/13731210/61567561-891d4780-aa6f-11e9-9b09-3d504abd24ed.gif" alt="Enquirer Quiz Prompt" width="750"> </p> **Example Usage** ```js const { Quiz } = require('enquirer'); const prompt = new Quiz({ name: 'countries', message: 'How many countries are there in the world?', choices: ['165', '175', '185', '195', '205'], correctChoice: 3 }); prompt .run() .then(answer => { if (answer.correct) { console.log('Correct!'); } else { console.log(`Wrong! Correct answer is ${answer.correctAnswer}`); } }) .catch(console.error); ``` **Quiz Options** | Option | Type | Required | Description | | ----------- | ---------- | ---------- | ------------------------------------------------------------------------------------------------------------ | | `choices` | `array` | Yes | The list of possible answers to the quiz question. | | `correctChoice`| `number` | Yes | Index of the correct choice from the `choices` array. | **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Survey Prompt Prompt that allows the user to provide feedback for a list of questions. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/survey-prompt.gif" alt="Enquirer Survey Prompt" width="750"> </p> **Example Usage** ```js const { Survey } = require('enquirer'); const prompt = new Survey({ name: 'experience', message: 'Please rate your experience', scale: [ { name: '1', message: 'Strongly Disagree' }, { name: '2', message: 'Disagree' }, { name: '3', message: 'Neutral' }, { name: '4', message: 'Agree' }, { name: '5', message: 'Strongly Agree' } ], margin: [0, 0, 2, 1], choices: [ { name: 'interface', message: 'The website has a friendly interface.' }, { name: 'navigation', message: 'The website is easy to navigate.' }, { name: 'images', message: 'The website usually has good images.' }, { name: 'upload', message: 'The website makes it easy to upload images.' }, { name: 'colors', message: 'The website has a pleasing color palette.' } ] }); prompt.run() .then(value => console.log('ANSWERS:', value)) .catch(console.error); ``` **Related prompts** * [Scale](#scale-prompt) * [Snippet](#snippet-prompt) * [Select](#select-prompt) *** ### Scale Prompt A more compact version of the [Survey prompt](#survey-prompt), the Scale prompt allows the user to quickly provide feedback using a [Likert Scale](https://en.wikipedia.org/wiki/Likert_scale). <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/scale-prompt.gif" alt="Enquirer Scale Prompt" width="750"> </p> **Example Usage** ```js const { Scale } = require('enquirer'); const prompt = new Scale({ name: 'experience', message: 'Please rate your experience', scale: [ { name: '1', message: 'Strongly Disagree' }, { name: '2', message: 'Disagree' }, { name: '3', message: 'Neutral' }, { name: '4', message: 'Agree' }, { name: '5', message: 'Strongly Agree' } ], margin: [0, 0, 2, 1], choices: [ { name: 'interface', message: 'The website has a friendly interface.', initial: 2 }, { name: 'navigation', message: 'The website is easy to navigate.', initial: 2 }, { name: 'images', message: 'The website usually has good images.', initial: 2 }, { name: 'upload', message: 'The website makes it easy to upload images.', initial: 2 }, { name: 'colors', message: 'The website has a pleasing color palette.', initial: 2 } ] }); prompt.run() .then(value => console.log('ANSWERS:', value)) .catch(console.error); ``` **Related prompts** * [AutoComplete](#autocomplete-prompt) * [Select](#select-prompt) * [Survey](#survey-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Select Prompt Prompt that allows the user to select from a list of options. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/select-prompt.gif" alt="Enquirer Select Prompt" width="750"> </p> **Example Usage** ```js const { Select } = require('enquirer'); const prompt = new Select({ name: 'color', message: 'Pick a flavor', choices: ['apple', 'grape', 'watermelon', 'cherry', 'orange'] }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` **Related prompts** * [AutoComplete](#autocomplete-prompt) * [MultiSelect](#multiselect-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Sort Prompt Prompt that allows the user to sort items in a list. **Example** In this [example](https://github.com/enquirer/enquirer/raw/master/examples/sort/prompt.js), custom styling is applied to the returned values to make it easier to see what's happening. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/sort-prompt.gif" alt="Enquirer Sort Prompt" width="750"> </p> **Example Usage** ```js const colors = require('ansi-colors'); const { Sort } = require('enquirer'); const prompt = new Sort({ name: 'colors', message: 'Sort the colors in order of preference', hint: 'Top is best, bottom is worst', numbered: true, choices: ['red', 'white', 'green', 'cyan', 'yellow'].map(n => ({ name: n, message: colors[n](n) })) }); prompt.run() .then(function(answer = []) { console.log(answer); console.log('Your preferred order of colors is:'); console.log(answer.map(key => colors[key](key)).join('\n')); }) .catch(console.error); ``` **Related prompts** * [List](#list-prompt) * [Select](#select-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Snippet Prompt Prompt that allows the user to replace placeholders in a snippet of code or text. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/snippet-prompt.gif" alt="Prompts" width="750"> </p> **Example Usage** ```js const semver = require('semver'); const { Snippet } = require('enquirer'); const prompt = new Snippet({ name: 'username', message: 'Fill out the fields in package.json', required: true, fields: [ { name: 'author_name', message: 'Author Name' }, { name: 'version', validate(value, state, item, index) { if (item && item.name === 'version' && !semver.valid(value)) { return prompt.styles.danger('version should be a valid semver value'); } return true; } } ], template: `{ "name": "\${name}", "description": "\${description}", "version": "\${version}", "homepage": "https://github.com/\${username}/\${name}", "author": "\${author_name} (https://github.com/\${username})", "repository": "\${username}/\${name}", "license": "\${license:ISC}" } ` }); prompt.run() .then(answer => console.log('Answer:', answer.result)) .catch(console.error); ``` **Related prompts** * [Survey](#survey-prompt) * [AutoComplete](#autocomplete-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Toggle Prompt Prompt that allows the user to toggle between two values then returns `true` or `false`. <p align="center"> <img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/toggle-prompt.gif" alt="Enquirer Toggle Prompt" width="750"> </p> **Example Usage** ```js const { Toggle } = require('enquirer'); const prompt = new Toggle({ message: 'Want to answer?', enabled: 'Yep', disabled: 'Nope' }); prompt.run() .then(answer => console.log('Answer:', answer)) .catch(console.error); ``` **Related prompts** * [Confirm](#confirm-prompt) * [Input](#input-prompt) * [Sort](#sort-prompt) **↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) *** ### Prompt Types There are 5 (soon to be 6!) type classes: * [ArrayPrompt](#arrayprompt) - [Options](#options) - [Properties](#properties) - [Methods](#methods) - [Choices](#choices) - [Defining choices](#defining-choices) - [Choice properties](#choice-properties) - [Related prompts](#related-prompts) * [AuthPrompt](#authprompt) * [BooleanPrompt](#booleanprompt) * DatePrompt (Coming Soon!) * [NumberPrompt](#numberprompt) * [StringPrompt](#stringprompt) Each type is a low-level class that may be used as a starting point for creating higher level prompts. Continue reading to learn how. ### ArrayPrompt The `ArrayPrompt` class is used for creating prompts that display a list of choices in the terminal. For example, Enquirer uses this class as the basis for the [Select](#select) and [Survey](#survey) prompts. #### Options In addition to the [options](#options) available to all prompts, Array prompts also support the following options. | **Option** | **Required?** | **Type** | **Description** | | ----------- | ------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------- | | `autofocus` | `no` | `string\|number` | The index or name of the choice that should have focus when the prompt loads. Only one choice may have focus at a time. | | | `stdin` | `no` | `stream` | The input stream to use for emitting keypress events. Defaults to `process.stdin`. | | `stdout` | `no` | `stream` | The output stream to use for writing the prompt to the terminal. Defaults to `process.stdout`. | | | #### Properties Array prompts have the following instance properties and getters. | **Property name** | **Type** | **Description** | | ----------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `choices` | `array` | Array of choices that have been normalized from choices passed on the prompt options. | | `cursor` | `number` | Position of the cursor relative to the _user input (string)_. | | `enabled` | `array` | Returns an array of enabled choices. | | `focused` | `array` | Returns the currently selected choice in the visible list of choices. This is similar to the concept of focus in HTML and CSS. Focused choices are always visible (on-screen). When a list of choices is longer than the list of visible choices, and an off-screen choice is _focused_, the list will scroll to the focused choice and re-render. | | `focused` | Gets the currently selected choice. Equivalent to `prompt.choices[prompt.index]`. | | `index` | `number` | Position of the pointer in the _visible list (array) of choices_. | | `limit` | `number` | The number of choices to display on-screen. | | `selected` | `array` | Either a list of enabled choices (when `options.multiple` is true) or the currently focused choice. | | `visible` | `string` | | #### Methods | **Method** | **Description** | | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `pointer()` | Returns the visual symbol to use to identify the choice that currently has focus. The `❯` symbol is often used for this. The pointer is not always visible, as with the `autocomplete` prompt. | | `indicator()` | Returns the visual symbol that indicates whether or not a choice is checked/enabled. | | `focus()` | Sets focus on a choice, if it can be focused. | #### Choices Array prompts support the `choices` option, which is the array of choices users will be able to select from when rendered in the terminal. **Type**: `string|object` **Example** ```js const { prompt } = require('enquirer'); const questions = [{ type: 'select', name: 'color', message: 'Favorite color?', initial: 1, choices: [ { name: 'red', message: 'Red', value: '#ff0000' }, //<= choice object { name: 'green', message: 'Green', value: '#00ff00' }, //<= choice object { name: 'blue', message: 'Blue', value: '#0000ff' } //<= choice object ] }]; let answers = await prompt(questions); console.log('Answer:', answers.color); ``` #### Defining choices Whether defined as a string or object, choices are normalized to the following interface: ```js { name: string; message: string | undefined; value: string | undefined; hint: string | undefined; disabled: boolean | string | undefined; } ``` **Example** ```js const question = { name: 'fruit', message: 'Favorite fruit?', choices: ['Apple', 'Orange', 'Raspberry'] }; ``` Normalizes to the following when the prompt is run: ```js const question = { name: 'fruit', message: 'Favorite fruit?', choices: [ { name: 'Apple', message: 'Apple', value: 'Apple' }, { name: 'Orange', message: 'Orange', value: 'Orange' }, { name: 'Raspberry', message: 'Raspberry', value: 'Raspberry' } ] }; ``` #### Choice properties The following properties are supported on `choice` objects. | **Option** | **Type** | **Description** | | ----------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | `string` | The unique key to identify a choice | | `message` | `string` | The message to display in the terminal. `name` is used when this is undefined. | | `value` | `string` | Value to associate with the choice. Useful for creating key-value pairs from user choices. `name` is used when this is undefined. | | `choices` | `array` | Array of "child" choices. | | `hint` | `string` | Help message to display next to a choice. | | `role` | `string` | Determines how the choice will be displayed. Currently the only role supported is `separator`. Additional roles may be added in the future (like `heading`, etc). Please create a [feature request] | | `enabled` | `boolean` | Enabled a choice by default. This is only supported when `options.multiple` is true or on prompts that support multiple choices, like [MultiSelect](#-multiselect). | | `disabled` | `boolean\|string` | Disable a choice so that it cannot be selected. This value may either be `true`, `false`, or a message to display. | | `indicator` | `string\|function` | Custom indicator to render for a choice (like a check or radio button). | #### Related prompts * [AutoComplete](#autocomplete-prompt) * [Form](#form-prompt) * [MultiSelect](#multiselect-prompt) * [Select](#select-prompt) * [Survey](#survey-prompt) *** ### AuthPrompt The `AuthPrompt` is used to create prompts to log in user using any authentication method. For example, Enquirer uses this class as the basis for the [BasicAuth Prompt](#basicauth-prompt). You can also find prompt examples in `examples/auth/` folder that utilizes `AuthPrompt` to create OAuth based authentication prompt or a prompt that authenticates using time-based OTP, among others. `AuthPrompt` has a factory function that creates an instance of `AuthPrompt` class and it expects an `authenticate` function, as an argument, which overrides the `authenticate` function of the `AuthPrompt` class. #### Methods | **Method** | **Description** | | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `authenticate()` | Contain all the authentication logic. This function should be overridden to implement custom authentication logic. The default `authenticate` function throws an error if no other function is provided. | #### Choices Auth prompt supports the `choices` option, which is the similar to the choices used in [Form Prompt](#form-prompt). **Example** ```js const { AuthPrompt } = require('enquirer'); function authenticate(value, state) { if (value.username === this.options.username && value.password === this.options.password) { return true; } return false; } const CustomAuthPrompt = AuthPrompt.create(authenticate); const prompt = new CustomAuthPrompt({ name: 'password', message: 'Please enter your password', username: 'rajat-sr', password: '1234567', choices: [ { name: 'username', message: 'username' }, { name: 'password', message: 'password' } ] }); prompt .run() .then(answer => console.log('Authenticated?', answer)) .catch(console.error); ``` #### Related prompts * [BasicAuth Prompt](#basicauth-prompt) *** ### BooleanPrompt The `BooleanPrompt` class is used for creating prompts that display and return a boolean value. ```js const { BooleanPrompt } = require('enquirer'); const prompt = new BooleanPrompt({ header: '========================', message: 'Do you love enquirer?', footer: '========================', }); prompt.run() .then(answer => console.log('Selected:', answer)) .catch(console.error); ``` **Returns**: `boolean` *** ### NumberPrompt The `NumberPrompt` class is used for creating prompts that display and return a numerical value. ```js const { NumberPrompt } = require('enquirer'); const prompt = new NumberPrompt({ header: '************************', message: 'Input the Numbers:', footer: '************************', }); prompt.run() .then(answer => console.log('Numbers are:', answer)) .catch(console.error); ``` **Returns**: `string|number` (number, or number formatted as a string) *** ### StringPrompt The `StringPrompt` class is used for creating prompts that display and return a string value. ```js const { StringPrompt } = require('enquirer'); const prompt = new StringPrompt({ header: '************************', message: 'Input the String:', footer: '************************' }); prompt.run() .then(answer => console.log('String is:', answer)) .catch(console.error); ``` **Returns**: `string` <br> ## ❯ Custom prompts With Enquirer 2.0, custom prompts are easier than ever to create and use. **How do I create a custom prompt?** Custom prompts are created by extending either: * Enquirer's `Prompt` class * one of the built-in [prompts](#-prompts), or * low-level [types](#-types). <!-- Example: HaiKarate Custom Prompt --> ```js const { Prompt } = require('enquirer'); class HaiKarate extends Prompt { constructor(options = {}) { super(options); this.value = options.initial || 0; this.cursorHide(); } up() { this.value++; this.render(); } down() { this.value--; this.render(); } render() { this.clear(); // clear previously rendered prompt from the terminal this.write(`${this.state.message}: ${this.value}`); } } // Use the prompt by creating an instance of your custom prompt class. const prompt = new HaiKarate({ message: 'How many sprays do you want?', initial: 10 }); prompt.run() .then(answer => console.log('Sprays:', answer)) .catch(console.error); ``` If you want to be able to specify your prompt by `type` so that it may be used alongside other prompts, you will need to first create an instance of `Enquirer`. ```js const Enquirer = require('enquirer'); const enquirer = new Enquirer(); ``` Then use the `.register()` method to add your custom prompt. ```js enquirer.register('haikarate', HaiKarate); ``` Now you can do the following when defining "questions". ```js let spritzer = require('cologne-drone'); let answers = await enquirer.prompt([ { type: 'haikarate', name: 'cologne', message: 'How many sprays do you need?', initial: 10, async onSubmit(name, value) { await spritzer.activate(value); //<= activate drone return value; } } ]); ``` <br> ## ❯ Key Bindings ### All prompts These key combinations may be used with all prompts. | **command** | **description** | | -------------------------------- | -------------------------------------- | | <kbd>ctrl</kbd> + <kbd>c</kbd> | Cancel the prompt. | | <kbd>ctrl</kbd> + <kbd>g</kbd> | Reset the prompt to its initial state. | <br> ### Move cursor These combinations may be used on prompts that support user input (eg. [input prompt](#input-prompt), [password prompt](#password-prompt), and [invisible prompt](#invisible-prompt)). | **command** | **description** | | ------------------------------ | ---------------------------------------- | | <kbd>left</kbd> | Move the cursor back one character. | | <kbd>right</kbd> | Move the cursor forward one character. | | <kbd>ctrl</kbd> + <kbd>a</kbd> | Move cursor to the start of the line | | <kbd>ctrl</kbd> + <kbd>e</kbd> | Move cursor to the end of the line | | <kbd>ctrl</kbd> + <kbd>b</kbd> | Move cursor back one character | | <kbd>ctrl</kbd> + <kbd>f</kbd> | Move cursor forward one character | | <kbd>ctrl</kbd> + <kbd>x</kbd> | Toggle between first and cursor position | <br> ### Edit Input These key combinations may be used on prompts that support user input (eg. [input prompt](#input-prompt), [password prompt](#password-prompt), and [invisible prompt](#invisible-prompt)). | **command** | **description** | | ------------------------------ | ---------------------------------------- | | <kbd>ctrl</kbd> + <kbd>a</kbd> | Move cursor to the start of the line | | <kbd>ctrl</kbd> + <kbd>e</kbd> | Move cursor to the end of the line | | <kbd>ctrl</kbd> + <kbd>b</kbd> | Move cursor back one character | | <kbd>ctrl</kbd> + <kbd>f</kbd> | Move cursor forward one character | | <kbd>ctrl</kbd> + <kbd>x</kbd> | Toggle between first and cursor position | <br> | **command (Mac)** | **command (Windows)** | **description** | | ----------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | <kbd>delete</kbd> | <kbd>backspace</kbd> | Delete one character to the left. | | <kbd>fn</kbd> + <kbd>delete</kbd> | <kbd>delete</kbd> | Delete one character to the right. | | <kbd>option</kbd> + <kbd>up</kbd> | <kbd>alt</kbd> + <kbd>up</kbd> | Scroll to the previous item in history ([Input prompt](#input-prompt) only, when [history is enabled](examples/input/option-history.js)). | | <kbd>option</kbd> + <kbd>down</kbd> | <kbd>alt</kbd> + <kbd>down</kbd> | Scroll to the next item in history ([Input prompt](#input-prompt) only, when [history is enabled](examples/input/option-history.js)). | ### Select choices These key combinations may be used on prompts that support _multiple_ choices, such as the [multiselect prompt](#multiselect-prompt), or the [select prompt](#select-prompt) when the `multiple` options is true. | **command** | **description** | | ----------------- | -------------------------------------------------------------------------------------------------------------------- | | <kbd>space</kbd> | Toggle the currently selected choice when `options.multiple` is true. | | <kbd>number</kbd> | Move the pointer to the choice at the given index. Also toggles the selected choice when `options.multiple` is true. | | <kbd>a</kbd> | Toggle all choices to be enabled or disabled. | | <kbd>i</kbd> | Invert the current selection of choices. | | <kbd>g</kbd> | Toggle the current choice group. | <br> ### Hide/show choices | **command** | **description** | | ------------------------------- | ---------------------------------------------- | | <kbd>fn</kbd> + <kbd>up</kbd> | Decrease the number of visible choices by one. | | <kbd>fn</kbd> + <kbd>down</kbd> | Increase the number of visible choices by one. | <br> ### Move/lock Pointer | **command** | **description** | | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | <kbd>number</kbd> | Move the pointer to the choice at the given index. Also toggles the selected choice when `options.multiple` is true. | | <kbd>up</kbd> | Move the pointer up. | | <kbd>down</kbd> | Move the pointer down. | | <kbd>ctrl</kbd> + <kbd>a</kbd> | Move the pointer to the first _visible_ choice. | | <kbd>ctrl</kbd> + <kbd>e</kbd> | Move the pointer to the last _visible_ choice. | | <kbd>shift</kbd> + <kbd>up</kbd> | Scroll up one choice without changing pointer position (locks the pointer while scrolling). | | <kbd>shift</kbd> + <kbd>down</kbd> | Scroll down one choice without changing pointer position (locks the pointer while scrolling). | <br> | **command (Mac)** | **command (Windows)** | **description** | | -------------------------------- | --------------------- | ---------------------------------------------------------- | | <kbd>fn</kbd> + <kbd>left</kbd> | <kbd>home</kbd> | Move the pointer to the first choice in the choices array. | | <kbd>fn</kbd> + <kbd>right</kbd> | <kbd>end</kbd> | Move the pointer to the last choice in the choices array. | <br> ## ❯ Release History Please see [CHANGELOG.md](CHANGELOG.md). ## ❯ Performance ### System specs MacBook Pro, Intel Core i7, 2.5 GHz, 16 GB. ### Load time Time it takes for the module to load the first time (average of 3 runs): ``` enquirer: 4.013ms inquirer: 286.717ms ``` <br> ## ❯ About <details> <summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). ### Todo We're currently working on documentation for the following items. Please star and watch the repository for updates! * [ ] Customizing symbols * [ ] Customizing styles (palette) * [ ] Customizing rendered input * [ ] Customizing returned values * [ ] Customizing key bindings * [ ] Question validation * [ ] Choice validation * [ ] Skipping questions * [ ] Async choices * [ ] Async timers: loaders, spinners and other animations * [ ] Links to examples </details> <details> <summary><strong>Running Tests</strong></summary> Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` ```sh $ yarn && yarn test ``` </details> <details> <summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` </details> #### Contributors | **Commits** | **Contributor** | | --- | --- | | 283 | [jonschlinkert](https://github.com/jonschlinkert) | | 82 | [doowb](https://github.com/doowb) | | 32 | [rajat-sr](https://github.com/rajat-sr) | | 20 | [318097](https://github.com/318097) | | 15 | [g-plane](https://github.com/g-plane) | | 12 | [pixelass](https://github.com/pixelass) | | 5 | [adityavyas611](https://github.com/adityavyas611) | | 5 | [satotake](https://github.com/satotake) | | 3 | [tunnckoCore](https://github.com/tunnckoCore) | | 3 | [Ovyerus](https://github.com/Ovyerus) | | 3 | [sw-yx](https://github.com/sw-yx) | | 2 | [DanielRuf](https://github.com/DanielRuf) | | 2 | [GabeL7r](https://github.com/GabeL7r) | | 1 | [AlCalzone](https://github.com/AlCalzone) | | 1 | [hipstersmoothie](https://github.com/hipstersmoothie) | | 1 | [danieldelcore](https://github.com/danieldelcore) | | 1 | [ImgBotApp](https://github.com/ImgBotApp) | | 1 | [jsonkao](https://github.com/jsonkao) | | 1 | [knpwrs](https://github.com/knpwrs) | | 1 | [yeskunall](https://github.com/yeskunall) | | 1 | [mischah](https://github.com/mischah) | | 1 | [renarsvilnis](https://github.com/renarsvilnis) | | 1 | [sbugert](https://github.com/sbugert) | | 1 | [stephencweiss](https://github.com/stephencweiss) | | 1 | [skellock](https://github.com/skellock) | | 1 | [whxaxes](https://github.com/whxaxes) | #### Author **Jon Schlinkert** * [GitHub Profile](https://github.com/jonschlinkert) * [Twitter Profile](https://twitter.com/jonschlinkert) * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) #### Credit Thanks to [derhuerst](https://github.com/derhuerst), creator of prompt libraries such as [prompt-skeleton](https://github.com/derhuerst/prompt-skeleton), which influenced some of the concepts we used in our prompts. #### License Copyright © 2018-present, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). argparse ======== [![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) [![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) CLI arguments parser for node.js. Javascript port of python's [argparse](http://docs.python.org/dev/library/argparse.html) module (original version 3.2). That's a full port, except some very rare options, recorded in issue tracker. **NB. Difference with original.** - Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). - Use `defaultValue` instead of `default`. - Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE` (aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and `SUPPRESS`. Example ======= test.js file: ```javascript #!/usr/bin/env node 'use strict'; var ArgumentParser = require('../lib/argparse').ArgumentParser; var parser = new ArgumentParser({ version: '0.0.1', addHelp:true, description: 'Argparse example' }); parser.addArgument( [ '-f', '--foo' ], { help: 'foo bar' } ); parser.addArgument( [ '-b', '--bar' ], { help: 'bar foo' } ); parser.addArgument( '--baz', { help: 'baz bar' } ); var args = parser.parseArgs(); console.dir(args); ``` Display help: ``` $ ./test.js -h usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] Argparse example Optional arguments: -h, --help Show this help message and exit. -v, --version Show program's version number and exit. -f FOO, --foo FOO foo bar -b BAR, --bar BAR bar foo --baz BAZ baz bar ``` Parse arguments: ``` $ ./test.js -f=3 --bar=4 --baz 5 { foo: '3', bar: '4', baz: '5' } ``` More [examples](https://github.com/nodeca/argparse/tree/master/examples). ArgumentParser objects ====================== ``` new ArgumentParser({parameters hash}); ``` Creates a new ArgumentParser object. **Supported params:** - ```description``` - Text to display before the argument help. - ```epilog``` - Text to display after the argument help. - ```addHelp``` - Add a -h/–help option to the parser. (default: true) - ```argumentDefault``` - Set the global default value for arguments. (default: null) - ```parents``` - A list of ArgumentParser objects whose arguments should also be included. - ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) - ```formatterClass``` - A class for customizing the help output. - ```prog``` - The name of the program (default: `path.basename(process.argv[1])`) - ```usage``` - The string describing the program usage (default: generated) - ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. **Not supported yet** - ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read. Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects) addArgument() method ==================== ``` ArgumentParser.addArgument(name or flag or [name] or [flags...], {options}) ``` Defines how a single command-line argument should be parsed. - ```name or flag or [name] or [flags...]``` - Either a positional name (e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array of a single positional name (e.g., `['foo']`), or an array of options (e.g., `['-f', '--foo']`). Options: - ```action``` - The basic type of action to be taken when this argument is encountered at the command line. - ```nargs```- The number of command-line arguments that should be consumed. - ```constant``` - A constant value required by some action and nargs selections. - ```defaultValue``` - The value produced if the argument is absent from the command line. - ```type``` - The type to which the command-line argument should be converted. - ```choices``` - A container of the allowable values for the argument. - ```required``` - Whether or not the command-line option may be omitted (optionals only). - ```help``` - A brief description of what the argument does. - ```metavar``` - A name for the argument in usage messages. - ```dest``` - The name of the attribute to be added to the object returned by parseArgs(). Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method) Action (some details) ================ ArgumentParser objects associate command-line arguments with actions. These actions can do just about anything with the command-line arguments associated with them, though most actions simply add an attribute to the object returned by parseArgs(). The action keyword argument specifies how the command-line arguments should be handled. The supported actions are: - ```store``` - Just stores the argument’s value. This is the default action. - ```storeConst``` - Stores value, specified by the const keyword argument. (Note that the const keyword argument defaults to the rather unhelpful None.) The 'storeConst' action is most commonly used with optional arguments, that specify some sort of flag. - ```storeTrue``` and ```storeFalse``` - Stores values True and False respectively. These are special cases of 'storeConst'. - ```append``` - Stores a list, and appends each argument value to the list. This is useful to allow an option to be specified multiple times. - ```appendConst``` - Stores a list, and appends value, specified by the const keyword argument to the list. (Note, that the const keyword argument defaults is None.) The 'appendConst' action is typically used when multiple arguments need to store constants to the same list. - ```count``` - Counts the number of times a keyword argument occurs. For example, used for increasing verbosity levels. - ```help``` - Prints a complete help message for all the options in the current parser and then exits. By default a help action is automatically added to the parser. See ArgumentParser for details of how the output is created. - ```version``` - Prints version information and exit. Expects a `version=` keyword argument in the addArgument() call. Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action) Sub-commands ============ ArgumentParser.addSubparsers() Many programs split their functionality into a number of sub-commands, for example, the svn program can invoke sub-commands like `svn checkout`, `svn update`, and `svn commit`. Splitting up functionality this way can be a particularly good idea when a program performs several different functions which require different kinds of command-line arguments. `ArgumentParser` supports creation of such sub-commands with `addSubparsers()` method. The `addSubparsers()` method is normally called with no arguments and returns an special action object. This object has a single method `addParser()`, which takes a command name and any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object that can be modified as usual. Example: sub_commands.js ```javascript #!/usr/bin/env node 'use strict'; var ArgumentParser = require('../lib/argparse').ArgumentParser; var parser = new ArgumentParser({ version: '0.0.1', addHelp:true, description: 'Argparse examples: sub-commands', }); var subparsers = parser.addSubparsers({ title:'subcommands', dest:"subcommand_name" }); var bar = subparsers.addParser('c1', {addHelp:true}); bar.addArgument( [ '-f', '--foo' ], { action: 'store', help: 'foo3 bar3' } ); var bar = subparsers.addParser( 'c2', {aliases:['co'], addHelp:true} ); bar.addArgument( [ '-b', '--bar' ], { action: 'store', type: 'int', help: 'foo3 bar3' } ); var args = parser.parseArgs(); console.dir(args); ``` Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands) Contributors ============ - [Eugene Shkuropat](https://github.com/shkuropat) - [Paul Jacobson](https://github.com/hpaulj) [others](https://github.com/nodeca/argparse/graphs/contributors) License ======= Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin). Released under the MIT license. See [LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details. Browser-friendly inheritance fully compatible with standard node.js [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). This package exports standard `inherits` from node.js `util` module in node environment, but also provides alternative browser-friendly implementation through [browser field](https://gist.github.com/shtylman/4339901). Alternative implementation is a literal copy of standard one located in standalone module to avoid requiring of `util`. It also has a shim for old browsers with no `Object.create` support. While keeping you sure you are using standard `inherits` implementation in node.js environment, it allows bundlers such as [browserify](https://github.com/substack/node-browserify) to not include full `util` package to your client code if all you need is just `inherits` function. It worth, because browser shim for `util` package is large and `inherits` is often the single function you need from it. It's recommended to use this package instead of `require('util').inherits` for any code that has chances to be used not only in node.js but in browser too. ## usage ```js var inherits = require('inherits'); // then use exactly as the standard one ``` ## note on version ~1.0 Version ~1.0 had completely different motivation and is not compatible neither with 2.0 nor with standard node.js `inherits`. If you are using version ~1.0 and planning to switch to ~2.0, be careful: * new version uses `super_` instead of `super` for referencing superclass * new version overwrites current prototype while old one preserves any existing fields on it [![build status](https://app.travis-ci.com/dankogai/js-base64.svg)](https://app.travis-ci.com/github/dankogai/js-base64) # base64.js Yet another [Base64] transcoder. [Base64]: http://en.wikipedia.org/wiki/Base64 ## Install ```shell $ npm install --save js-base64 ``` ## Usage ### In Browser Locally… ```html <script src="base64.js"></script> ``` … or Directly from CDN. In which case you don't even need to install. ```html <script src="https://cdn.jsdelivr.net/npm/js-base64@3.7.2/base64.min.js"></script> ``` This good old way loads `Base64` in the global context (`window`). Though `Base64.noConflict()` is made available, you should consider using ES6 Module to avoid tainting `window`. ### As an ES6 Module locally… ```javascript import { Base64 } from 'js-base64'; ``` ```javascript // or if you prefer no Base64 namespace import { encode, decode } from 'js-base64'; ``` or even remotely. ```html <script type="module"> // note jsdelivr.net does not automatically minify .mjs import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.2/base64.mjs'; </script> ``` ```html <script type="module"> // or if you prefer no Base64 namespace import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.2/base64.mjs'; </script> ``` ### node.js (commonjs) ```javascript const {Base64} = require('js-base64'); ``` Unlike the case above, the global context is no longer modified. You can also use [esm] to `import` instead of `require`. [esm]: https://github.com/standard-things/esm ```javascript require=require('esm')(module); import {Base64} from 'js-base64'; ``` ## SYNOPSIS ```javascript let latin = 'dankogai'; let utf8 = '小飼弾' let u8s = new Uint8Array([100,97,110,107,111,103,97,105]); Base64.encode(latin); // ZGFua29nYWk= Base64.encode(latin, true)); // ZGFua29nYWk skips padding Base64.encodeURI(latin)); // ZGFua29nYWk Base64.btoa(latin); // ZGFua29nYWk= Base64.btoa(utf8); // raises exception Base64.fromUint8Array(u8s); // ZGFua29nYWk= Base64.fromUint8Array(u8s, true); // ZGFua29nYW which is URI safe Base64.encode(utf8); // 5bCP6aO85by+ Base64.encode(utf8, true) // 5bCP6aO85by- Base64.encodeURI(utf8); // 5bCP6aO85by- ``` ```javascript Base64.decode( 'ZGFua29nYWk=');// dankogai Base64.decode( 'ZGFua29nYWk'); // dankogai Base64.atob( 'ZGFua29nYWk=');// dankogai Base64.atob( '5bCP6aO85by+');// '小飼弾' which is nonsense Base64.toUint8Array('ZGFua29nYWk=');// u8s above Base64.decode( '5bCP6aO85by+');// 小飼弾 // note .decodeURI() is unnecessary since it accepts both flavors Base64.decode( '5bCP6aO85by-');// 小飼弾 ``` ```javascript Base64.isValid(0); // false: 0 is not string Base64.isValid(''); // true: a valid Base64-encoded empty byte Base64.isValid('ZA=='); // true: a valid Base64-encoded 'd' Base64.isValid('Z A='); // true: whitespaces are okay Base64.isValid('ZA'); // true: padding ='s can be omitted Base64.isValid('++'); // true: can be non URL-safe Base64.isValid('--'); // true: or URL-safe Base64.isValid('+-'); // false: can't mix both ``` ### Built-in Extensions By default `Base64` leaves built-in prototypes untouched. But you can extend them as below. ```javascript // you have to explicitly extend String.prototype Base64.extendString(); // once extended, you can do the following 'dankogai'.toBase64(); // ZGFua29nYWk= '小飼弾'.toBase64(); // 5bCP6aO85by+ '小飼弾'.toBase64(true); // 5bCP6aO85by- '小飼弾'.toBase64URI(); // 5bCP6aO85by- ab alias of .toBase64(true) '小飼弾'.toBase64URL(); // 5bCP6aO85by- an alias of .toBase64URI() 'ZGFua29nYWk='.fromBase64(); // dankogai '5bCP6aO85by+'.fromBase64(); // 小飼弾 '5bCP6aO85by-'.fromBase64(); // 小飼弾 '5bCP6aO85by-'.toUint8Array();// u8s above ``` ```javascript // you have to explicitly extend Uint8Array.prototype Base64.extendUint8Array(); // once extended, you can do the following u8s.toBase64(); // 'ZGFua29nYWk=' u8s.toBase64URI(); // 'ZGFua29nYWk' u8s.toBase64URL(); // 'ZGFua29nYWk' an alias of .toBase64URI() ``` ```javascript // extend all at once Base64.extendBuiltins() ``` ## `.decode()` vs `.atob` (and `.encode()` vs `btoa()`) Suppose you have: ``` var pngBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="; ``` Which is a Base64-encoded 1x1 transparent PNG, **DO NOT USE** `Base64.decode(pngBase64)`.  Use `Base64.atob(pngBase64)` instead.  `Base64.decode()` decodes to UTF-8 string while `Base64.atob()` decodes to bytes, which is compatible to browser built-in `atob()` (Which is absent in node.js).  The same rule applies to the opposite direction. Or even better, `Base64.toUint8Array(pngBase64)`. ### If you really, really need an ES5 version You can transpiles to an ES5 that runs on IEs before 11. Do the following in your shell. ```shell $ make base64.es5.js ``` ## Brief History * Since version 3.3 it is written in TypeScript. Now `base64.mjs` is compiled from `base64.ts` then `base64.js` is generated from `base64.mjs`. * Since version 3.7 `base64.js` is ES5-compatible again (hence IE11-compabile). * Since 3.0 `js-base64` switch to ES2015 module so it is no longer compatible with legacy browsers like IE (see above) These files are compiled dot templates from dot folder. Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder. Like `chown -R`. Takes the same arguments as `fs.chown()` JS-YAML - YAML 1.2 parser / writer for JavaScript ================================================= [![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml) [![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml) __[Online Demo](http://nodeca.github.com/js-yaml/)__ This is an implementation of [YAML](http://yaml.org/), a human-friendly data serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. Installation ------------ ### YAML module for node.js ``` npm install js-yaml ``` ### CLI executable If you want to inspect your YAML files from CLI, install js-yaml globally: ``` npm install -g js-yaml ``` #### Usage ``` usage: js-yaml [-h] [-v] [-c] [-t] file Positional arguments: file File with YAML document(s) Optional arguments: -h, --help Show this help message and exit. -v, --version Show program's version number and exit. -c, --compact Display errors in compact mode -t, --trace Show stack trace on error ``` ### Bundled YAML library for browsers ``` html <!-- esprima required only for !!js/function --> <script src="esprima.js"></script> <script src="js-yaml.min.js"></script> <script type="text/javascript"> var doc = jsyaml.load('greeting: hello\nname: world'); </script> ``` Browser support was done mostly for the online demo. If you find any errors - feel free to send pull requests with fixes. Also note, that IE and other old browsers needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. Notes: 1. We have no resources to support browserified version. Don't expect it to be well tested. Don't expect fast fixes if something goes wrong there. 2. `!!js/function` in browser bundle will not work by default. If you really need it - load `esprima` parser first (via amd or directly). 3. `!!bin` in browser will return `Array`, because browsers do not support node.js `Buffer` and adding Buffer shims is completely useless on practice. API --- Here we cover the most 'useful' methods. If you need advanced details (creating your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and [examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more info. ``` javascript const yaml = require('js-yaml'); const fs = require('fs'); // Get document, or throw exception on error try { const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); console.log(doc); } catch (e) { console.log(e); } ``` ### safeLoad (string [ , options ]) **Recommended loading way.** Parses `string` as single YAML document. Returns either a plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does not support regexps, functions and undefined. This method is safe for untrusted data. options: - `filename` _(default: null)_ - string to be used as a file path in error/warning messages. - `onWarning` _(default: null)_ - function to call on warning messages. Loader will call this function with an instance of `YAMLException` for each warning. - `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 - `JSON_SCHEMA` - all JSON-supported types: http://www.yaml.org/spec/1.2/spec.html#id2803231 - `CORE_SCHEMA` - same as `JSON_SCHEMA`: http://www.yaml.org/spec/1.2/spec.html#id2804923 - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones (`!!js/undefined`, `!!js/regexp` and `!!js/function`): http://yaml.org/type/ - `DEFAULT_FULL_SCHEMA` - all supported YAML types. - `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. NOTE: This function **does not** understand multi-document sources, it throws exception on those. NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. So, the JSON schema is not as strictly defined in the YAML specification. It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. The core schema also has no such restrictions. It allows binary notation for integers. ### load (string [ , options ]) **Use with care with untrusted sources**. The same as `safeLoad()` but uses `DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: `!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you must additionally validate object structure to avoid injections: ``` javascript const untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"'; // I'm just converting that string, what could possibly go wrong? require('js-yaml').load(untrusted_code) + '' ``` ### safeLoadAll (string [, iterator] [, options ]) Same as `safeLoad()`, but understands multi-document sources. Applies `iterator` to each document if specified, or returns array of documents. ``` javascript const yaml = require('js-yaml'); yaml.safeLoadAll(data, function (doc) { console.log(doc); }); ``` ### loadAll (string [, iterator] [ , options ]) Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. ### safeDump (object [ , options ]) Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will throw an exception if you try to dump regexps or functions. However, you can disable exceptions by setting the `skipInvalid` option to `true`. options: - `indent` _(default: 2)_ - indentation width to use (in spaces). - `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements - `skipInvalid` _(default: false)_ - do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. - `flowLevel` (default: -1) - specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere - `styles` - "tag" => "style" map. Each tag may have own set of styles. - `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. - `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a function, use the function to sort the keys. - `lineWidth` _(default: `80`)_ - set max line width. - `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references - `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 - `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. The following table show availlable styles (e.g. "canonical", "binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml output is shown on the right side after `=>` (default setting) or `->`: ``` none !!null "canonical" -> "~" "lowercase" => "null" "uppercase" -> "NULL" "camelcase" -> "Null" !!int "binary" -> "0b1", "0b101010", "0b1110001111010" "octal" -> "01", "052", "016172" "decimal" => "1", "42", "7290" "hexadecimal" -> "0x1", "0x2A", "0x1C7A" !!bool "lowercase" => "true", "false" "uppercase" -> "TRUE", "FALSE" "camelcase" -> "True", "False" !!float "lowercase" => ".nan", '.inf' "uppercase" -> ".NAN", '.INF' "camelcase" -> ".NaN", '.Inf' ``` Example: ``` javascript safeDump (object, { 'styles': { '!!null': 'canonical' // dump null as ~ }, 'sortKeys': true // sort object keys }); ``` ### dump (object [ , options ]) Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). Supported YAML types -------------------- The list of standard YAML tags and corresponding JavaScipt types. See also [YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and [YAML types repository](http://yaml.org/type/). ``` !!null '' # null !!bool 'yes' # bool !!int '3...' # number !!float '3.14...' # number !!binary '...base64...' # buffer !!timestamp 'YYYY-...' # date !!omap [ ... ] # array of key-value pairs !!pairs [ ... ] # array or array pairs !!set { ... } # array of objects with given keys and null values !!str '...' # string !!seq [ ... ] # array !!map { ... } # object ``` **JavaScript-specific tags** ``` !!js/regexp /pattern/gim # RegExp !!js/undefined '' # Undefined !!js/function 'function () {...}' # Function ``` Caveats ------- Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects or arrays as keys, and stringifies (by calling `toString()` method) them at the moment of adding them. ``` yaml --- ? [ foo, bar ] : - baz ? { foo: bar } : - baz - baz ``` ``` javascript { "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } ``` Also, reading of properties on implicit block mapping keys is not supported yet. So, the following YAML document cannot be loaded. ``` yaml &anchor foo: foo: bar *anchor: duplicate key baz: bat *anchor: duplicate key ``` js-yaml for enterprise ---------------------- Available as part of the Tidelift Subscription The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) ### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) Estraverse ([estraverse](http://github.com/estools/estraverse)) is [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) traversal functions from [esmangle project](http://github.com/estools/esmangle). ### Documentation You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). ### Example Usage The following code will output all variables declared at the root of a file. ```javascript estraverse.traverse(ast, { enter: function (node, parent) { if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') return estraverse.VisitorOption.Skip; }, leave: function (node, parent) { if (node.type == 'VariableDeclarator') console.log(node.id.name); } }); ``` We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. ```javascript estraverse.traverse(ast, { enter: function (node) { this.break(); } }); ``` And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. ```javascript result = estraverse.replace(tree, { enter: function (node) { // Replace it with replaced. if (node.type === 'Literal') return replaced; } }); ``` By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Extending the existing traversing rules. keys: { // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] TestExpression: ['argument'] } }); ``` By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Iterating the child **nodes** of unknown nodes. fallback: 'iteration' }); ``` When `visitor.fallback` is a function, we can determine which keys to visit on each node. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Skip the `argument` property of each node fallback: function(node) { return Object.keys(node).filter(function(key) { return key !== 'argument'; }); } }); ``` ### License Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # set-blocking [![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking) [![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking) [![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) set blocking `stdio` and `stderr` ensuring that terminal output does not truncate. ```js const setBlocking = require('set-blocking') setBlocking(true) console.log(someLargeStringToOutput) ``` ## Historical Context/Word of Warning This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on newer versions of Node.js (`0.12+`), truncating terminal output. You should be mindful of the side-effects caused by using `set-blocking`: * if your module sets blocking to `true`, it will effect other modules consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call `setBlocking(true)` once we already know we are about to call `process.exit(code)`. * this patch will not apply to subprocesses spawned with `isTTY = true`, this is the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). ## License ISC # ansi-colors [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/ansi-colors.svg?style=flat)](https://www.npmjs.com/package/ansi-colors) [![NPM monthly downloads](https://img.shields.io/npm/dm/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![NPM total downloads](https://img.shields.io/npm/dt/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![Linux Build Status](https://img.shields.io/travis/doowb/ansi-colors.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/ansi-colors) > Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs). Please consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save ansi-colors ``` ![image](https://user-images.githubusercontent.com/383994/39635445-8a98a3a6-4f8b-11e8-89c1-068c45d4fff8.png) ## Why use this? ansi-colors is _the fastest Node.js library for terminal styling_. A more performant drop-in replacement for chalk, with no dependencies. * _Blazing fast_ - Fastest terminal styling library in node.js, 10-20x faster than chalk! * _Drop-in replacement_ for [chalk](https://github.com/chalk/chalk). * _No dependencies_ (Chalk has 7 dependencies in its tree!) * _Safe_ - Does not modify the `String.prototype` like [colors](https://github.com/Marak/colors.js). * Supports [nested colors](#nested-colors), **and does not have the [nested styling bug](#nested-styling-bug) that is present in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur)**. * Supports [chained colors](#chained-colors). * [Toggle color support](#toggle-color-support) on or off. ## Usage ```js const c = require('ansi-colors'); console.log(c.red('This is a red string!')); console.log(c.green('This is a red string!')); console.log(c.cyan('This is a cyan string!')); console.log(c.yellow('This is a yellow string!')); ``` ![image](https://user-images.githubusercontent.com/383994/39653848-a38e67da-4fc0-11e8-89ae-98c65ebe9dcf.png) ## Chained colors ```js console.log(c.bold.red('this is a bold red message')); console.log(c.bold.yellow.italic('this is a bold yellow italicized message')); console.log(c.green.bold.underline('this is a bold green underlined message')); ``` ![image](https://user-images.githubusercontent.com/383994/39635780-7617246a-4f8c-11e8-89e9-05216cc54e38.png) ## Nested colors ```js console.log(c.yellow(`foo ${c.red.bold('red')} bar ${c.cyan('cyan')} baz`)); ``` ![image](https://user-images.githubusercontent.com/383994/39635817-8ed93d44-4f8c-11e8-8afd-8c3ea35f5fbe.png) ### Nested styling bug `ansi-colors` does not have the nested styling bug found in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur). ```js const { bold, red } = require('ansi-styles'); console.log(bold(`foo ${red.dim('bar')} baz`)); const colorette = require('colorette'); console.log(colorette.bold(`foo ${colorette.red(colorette.dim('bar'))} baz`)); const kleur = require('kleur'); console.log(kleur.bold(`foo ${kleur.red.dim('bar')} baz`)); const chalk = require('chalk'); console.log(chalk.bold(`foo ${chalk.red.dim('bar')} baz`)); ``` **Results in the following** (sans icons and labels) ![image](https://user-images.githubusercontent.com/383994/47280326-d2ee0580-d5a3-11e8-9611-ea6010f0a253.png) ## Toggle color support Easily enable/disable colors. ```js const c = require('ansi-colors'); // disable colors manually c.enabled = false; // or use a library to automatically detect support c.enabled = require('color-support').hasBasic; console.log(c.red('I will only be colored red if the terminal supports colors')); ``` ## Strip ANSI codes Use the `.unstyle` method to strip ANSI codes from a string. ```js console.log(c.unstyle(c.blue.bold('foo bar baz'))); //=> 'foo bar baz' ``` ## Available styles **Note** that bright and bright-background colors are not always supported. | Colors | Background Colors | Bright Colors | Bright Background Colors | | ------- | ----------------- | ------------- | ------------------------ | | black | bgBlack | blackBright | bgBlackBright | | red | bgRed | redBright | bgRedBright | | green | bgGreen | greenBright | bgGreenBright | | yellow | bgYellow | yellowBright | bgYellowBright | | blue | bgBlue | blueBright | bgBlueBright | | magenta | bgMagenta | magentaBright | bgMagentaBright | | cyan | bgCyan | cyanBright | bgCyanBright | | white | bgWhite | whiteBright | bgWhiteBright | | gray | | | | | grey | | | | _(`gray` is the U.S. spelling, `grey` is more commonly used in the Canada and U.K.)_ ### Style modifiers * dim * **bold** * hidden * _italic_ * underline * inverse * ~~strikethrough~~ * reset ## Aliases Create custom aliases for styles. ```js const colors = require('ansi-colors'); colors.alias('primary', colors.yellow); colors.alias('secondary', colors.bold); console.log(colors.primary.secondary('Foo')); ``` ## Themes A theme is an object of custom aliases. ```js const colors = require('ansi-colors'); colors.theme({ danger: colors.red, dark: colors.dim.gray, disabled: colors.gray, em: colors.italic, heading: colors.bold.underline, info: colors.cyan, muted: colors.dim, primary: colors.blue, strong: colors.bold, success: colors.green, underline: colors.underline, warning: colors.yellow }); // Now, we can use our custom styles alongside the built-in styles! console.log(colors.danger.strong.em('Error!')); console.log(colors.warning('Heads up!')); console.log(colors.info('Did you know...')); console.log(colors.success.bold('It worked!')); ``` ## Performance **Libraries tested** * ansi-colors v3.0.4 * chalk v2.4.1 ### Mac > MacBook Pro, Intel Core i7, 2.3 GHz, 16 GB. **Load time** Time it takes to load the first time `require()` is called: * ansi-colors - `1.915ms` * chalk - `12.437ms` **Benchmarks** ``` # All Colors ansi-colors x 173,851 ops/sec ±0.42% (91 runs sampled) chalk x 9,944 ops/sec ±2.53% (81 runs sampled))) # Chained colors ansi-colors x 20,791 ops/sec ±0.60% (88 runs sampled) chalk x 2,111 ops/sec ±2.34% (83 runs sampled) # Nested colors ansi-colors x 59,304 ops/sec ±0.98% (92 runs sampled) chalk x 4,590 ops/sec ±2.08% (82 runs sampled) ``` ### Windows > Windows 10, Intel Core i7-7700k CPU @ 4.2 GHz, 32 GB **Load time** Time it takes to load the first time `require()` is called: * ansi-colors - `1.494ms` * chalk - `11.523ms` **Benchmarks** ``` # All Colors ansi-colors x 193,088 ops/sec ±0.51% (95 runs sampled)) chalk x 9,612 ops/sec ±3.31% (77 runs sampled))) # Chained colors ansi-colors x 26,093 ops/sec ±1.13% (94 runs sampled) chalk x 2,267 ops/sec ±2.88% (80 runs sampled)) # Nested colors ansi-colors x 67,747 ops/sec ±0.49% (93 runs sampled) chalk x 4,446 ops/sec ±3.01% (82 runs sampled)) ``` ## About <details> <summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). </details> <details> <summary><strong>Running Tests</strong></summary> Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` </details> <details> <summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` </details> ### Related projects You might also be interested in these projects: * [ansi-wrap](https://www.npmjs.com/package/ansi-wrap): Create ansi colors by passing the open and close codes. | [homepage](https://github.com/jonschlinkert/ansi-wrap "Create ansi colors by passing the open and close codes.") * [strip-color](https://www.npmjs.com/package/strip-color): Strip ANSI color codes from a string. No dependencies. | [homepage](https://github.com/jonschlinkert/strip-color "Strip ANSI color codes from a string. No dependencies.") ### Contributors | **Commits** | **Contributor** | | --- | --- | | 48 | [jonschlinkert](https://github.com/jonschlinkert) | | 42 | [doowb](https://github.com/doowb) | | 6 | [lukeed](https://github.com/lukeed) | | 2 | [Silic0nS0ldier](https://github.com/Silic0nS0ldier) | | 1 | [dwieeb](https://github.com/dwieeb) | | 1 | [jorgebucaran](https://github.com/jorgebucaran) | | 1 | [madhavarshney](https://github.com/madhavarshney) | | 1 | [chapterjason](https://github.com/chapterjason) | ### Author **Brian Woodward** * [GitHub Profile](https://github.com/doowb) * [Twitter Profile](https://twitter.com/doowb) * [LinkedIn Profile](https://linkedin.com/in/woodwardbrian) ### License Copyright © 2019, [Brian Woodward](https://github.com/doowb). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 01, 2019._ Shims used when bundling asc for browser usage. # whatwg-url whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/tmpvar/jsdom). ## Specification conformance whatwg-url is currently up to date with the URL spec up to commit [7ae1c69](https://github.com/whatwg/url/commit/7ae1c691c96f0d82fafa24c33aa1e8df9ffbf2bc). For `file:` URLs, whose [origin is left unspecified](https://url.spec.whatwg.org/#concept-url-origin), whatwg-url chooses to use a new opaque origin (which serializes to `"null"`). ## API ### The `URL` and `URLSearchParams` classes The main API is provided by the [`URL`](https://url.spec.whatwg.org/#url-class) and [`URLSearchParams`](https://url.spec.whatwg.org/#interface-urlsearchparams) exports, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use these. ### Low-level URL Standard API The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They mostly operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type. - [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL, encodingOverride })` - [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, encodingOverride, url, stateOverride })` - [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)` - [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)` - [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)` - [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin): `serializeURLOrigin(urlRecord)` - [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)` - [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)` - [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)` - [Percent decode](https://url.spec.whatwg.org/#percent-decode): `percentDecode(buffer)` The `stateOverride` parameter is one of the following strings: - [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state) - [`"scheme"`](https://url.spec.whatwg.org/#scheme-state) - [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state) - [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state) - [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state) - [`"relative"`](https://url.spec.whatwg.org/#relative-state) - [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state) - [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state) - [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state) - [`"authority"`](https://url.spec.whatwg.org/#authority-state) - [`"host"`](https://url.spec.whatwg.org/#host-state) - [`"hostname"`](https://url.spec.whatwg.org/#hostname-state) - [`"port"`](https://url.spec.whatwg.org/#port-state) - [`"file"`](https://url.spec.whatwg.org/#file-state) - [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state) - [`"file host"`](https://url.spec.whatwg.org/#file-host-state) - [`"path start"`](https://url.spec.whatwg.org/#path-start-state) - [`"path"`](https://url.spec.whatwg.org/#path-state) - [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state) - [`"query"`](https://url.spec.whatwg.org/#query-state) - [`"fragment"`](https://url.spec.whatwg.org/#fragment-state) The URL record type has the following API: - [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme) - [`username`](https://url.spec.whatwg.org/#concept-url-username) - [`password`](https://url.spec.whatwg.org/#concept-url-password) - [`host`](https://url.spec.whatwg.org/#concept-url-host) - [`port`](https://url.spec.whatwg.org/#concept-url-port) - [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array) - [`query`](https://url.spec.whatwg.org/#concept-url-query) - [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment) - [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean) These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state. The return value of "failure" in the spec is represented by `null`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ `null`. ## Development instructions First, install [Node.js](https://nodejs.org/). Then, fetch the dependencies of whatwg-url, by running from this directory: npm install To run tests: npm test To generate a coverage report: npm run coverage To build and run the live viewer: npm run build npm run build-live-viewer Serve the contents of the `live-viewer` directory using any web server. ## Supporting whatwg-url The jsdom project (including whatwg-url) is a community-driven project maintained by a team of [volunteers](https://github.com/orgs/jsdom/people). You could support us by: - [Getting professional support for whatwg-url](https://tidelift.com/subscription/pkg/npm-whatwg-url?utm_source=npm-whatwg-url&utm_medium=referral&utm_campaign=readme) as part of a Tidelift subscription. Tidelift helps making open source sustainable for us while giving teams assurances for maintenance, licensing, and security. - Contributing directly to the project. ### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) Estraverse ([estraverse](http://github.com/estools/estraverse)) is [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) traversal functions from [esmangle project](http://github.com/estools/esmangle). ### Documentation You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). ### Example Usage The following code will output all variables declared at the root of a file. ```javascript estraverse.traverse(ast, { enter: function (node, parent) { if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') return estraverse.VisitorOption.Skip; }, leave: function (node, parent) { if (node.type == 'VariableDeclarator') console.log(node.id.name); } }); ``` We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. ```javascript estraverse.traverse(ast, { enter: function (node) { this.break(); } }); ``` And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. ```javascript result = estraverse.replace(tree, { enter: function (node) { // Replace it with replaced. if (node.type === 'Literal') return replaced; } }); ``` By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Extending the existing traversing rules. keys: { // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] TestExpression: ['argument'] } }); ``` By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Iterating the child **nodes** of unknown nodes. fallback: 'iteration' }); ``` When `visitor.fallback` is a function, we can determine which keys to visit on each node. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Skip the `argument` property of each node fallback: function(node) { return Object.keys(node).filter(function(key) { return key !== 'argument'; }); } }); ``` ### License Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # yallist Yet Another Linked List There are many doubly-linked list implementations like it, but this one is mine. For when an array would be too big, and a Map can't be iterated in reverse order. [![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) ## basic usage ```javascript var yallist = require('yallist') var myList = yallist.create([1, 2, 3]) myList.push('foo') myList.unshift('bar') // of course pop() and shift() are there, too console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] myList.forEach(function (k) { // walk the list head to tail }) myList.forEachReverse(function (k, index, list) { // walk the list tail to head }) var myDoubledList = myList.map(function (k) { return k + k }) // now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] // mapReverse is also a thing var myDoubledListReverse = myList.mapReverse(function (k) { return k + k }) // ['foofoo', 6, 4, 2, 'barbar'] var reduced = myList.reduce(function (set, entry) { set += entry return set }, 'start') console.log(reduced) // 'startfoo123bar' ``` ## api The whole API is considered "public". Functions with the same name as an Array method work more or less the same way. There's reverse versions of most things because that's the point. ### Yallist Default export, the class that holds and manages a list. Call it with either a forEach-able (like an array) or a set of arguments, to initialize the list. The Array-ish methods all act like you'd expect. No magic length, though, so if you change that it won't automatically prune or add empty spots. ### Yallist.create(..) Alias for Yallist function. Some people like factories. #### yallist.head The first node in the list #### yallist.tail The last node in the list #### yallist.length The number of nodes in the list. (Change this at your peril. It is not magic like Array length.) #### yallist.toArray() Convert the list to an array. #### yallist.forEach(fn, [thisp]) Call a function on each item in the list. #### yallist.forEachReverse(fn, [thisp]) Call a function on each item in the list, in reverse order. #### yallist.get(n) Get the data at position `n` in the list. If you use this a lot, probably better off just using an Array. #### yallist.getReverse(n) Get the data at position `n`, counting from the tail. #### yallist.map(fn, thisp) Create a new Yallist with the result of calling the function on each item. #### yallist.mapReverse(fn, thisp) Same as `map`, but in reverse. #### yallist.pop() Get the data from the list tail, and remove the tail from the list. #### yallist.push(item, ...) Insert one or more items to the tail of the list. #### yallist.reduce(fn, initialValue) Like Array.reduce. #### yallist.reduceReverse Like Array.reduce, but in reverse. #### yallist.reverse Reverse the list in place. #### yallist.shift() Get the data from the list head, and remove the head from the list. #### yallist.slice([from], [to]) Just like Array.slice, but returns a new Yallist. #### yallist.sliceReverse([from], [to]) Just like yallist.slice, but the result is returned in reverse. #### yallist.toArray() Create an array representation of the list. #### yallist.toArrayReverse() Create a reversed array representation of the list. #### yallist.unshift(item, ...) Insert one or more items to the head of the list. #### yallist.unshiftNode(node) Move a Node object to the front of the list. (That is, pull it out of wherever it lives, and make it the new head.) If the node belongs to a different list, then that list will remove it first. #### yallist.pushNode(node) Move a Node object to the end of the list. (That is, pull it out of wherever it lives, and make it the new tail.) If the node belongs to a list already, then that list will remove it first. #### yallist.removeNode(node) Remove a node from the list, preserving referential integrity of head and tail and other nodes. Will throw an error if you try to have a list remove a node that doesn't belong to it. ### Yallist.Node The class that holds the data and is actually the list. Call with `var n = new Node(value, previousNode, nextNode)` Note that if you do direct operations on Nodes themselves, it's very easy to get into weird states where the list is broken. Be careful :) #### node.next The next node in the list. #### node.prev The previous node in the list. #### node.value The data the node contains. #### node.list The list to which this node belongs. (Null if it does not belong to any list.) iMurmurHash.js ============== An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. Installation ------------ To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. ```html <script type="text/javascript" src="/scripts/imurmurhash.min.js"></script> <script> // Your code here, access iMurmurHash using the global object MurmurHash3 </script> ``` --- To use iMurmurHash in Node.js, install the module using NPM: ```bash npm install imurmurhash ``` Then simply include it in your scripts: ```javascript MurmurHash3 = require('imurmurhash'); ``` Quick Example ------------- ```javascript // Create the initial hash var hashState = MurmurHash3('string'); // Incrementally add text hashState.hash('more strings'); hashState.hash('even more strings'); // All calls can be chained if desired hashState.hash('and').hash('some').hash('more'); // Get a result hashState.result(); // returns 0xe4ccfe6b ``` Functions --------- ### MurmurHash3 ([string], [seed]) Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: ```javascript // Use the cached object, calling the function again will return the same // object (but reset, so the current state would be lost) hashState = MurmurHash3(); ... // Create a new object that can be safely used however you wish. Calling the // function again will simply return a new state object, and no state loss // will occur, at the cost of creating more objects. hashState = new MurmurHash3(); ``` Both methods can be mixed however you like if you have different use cases. --- ### MurmurHash3.prototype.hash (string) Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. --- ### MurmurHash3.prototype.result () Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. ```javascript // Do the whole string at once MurmurHash3('this is a test string').result(); // 0x70529328 // Do part of the string, get a result, then the other part var m = MurmurHash3('this is a'); m.result(); // 0xbfc4f834 m.hash(' test string').result(); // 0x70529328 (same as above) ``` --- ### MurmurHash3.prototype.reset ([seed]) Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. --- License (MIT) ------------- Copyright (c) 2013 Gary Court, Jens Taylor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. assemblyscript-json # assemblyscript-json ## Table of contents ### Namespaces - [JSON](modules/json.md) ### Classes - [DecoderState](classes/decoderstate.md) - [JSONDecoder](classes/jsondecoder.md) - [JSONEncoder](classes/jsonencoder.md) - [JSONHandler](classes/jsonhandler.md) - [ThrowingJSONHandler](classes/throwingjsonhandler.md) The AssemblyScript Runtime ========================== The runtime provides the functionality necessary to dynamically allocate and deallocate memory of objects, arrays and buffers, as well as collect garbage that is no longer used. The current implementation is either a Two-Color Mark & Sweep (TCMS) garbage collector that must be called manually when the execution stack is unwound or an Incremental Tri-Color Mark & Sweep (ITCMS) garbage collector that is fully automated with a shadow stack, implemented on top of a Two-Level Segregate Fit (TLSF) memory manager. It's not designed to be the fastest of its kind, but intentionally focuses on simplicity and ease of integration until we can replace it with the real deal, i.e. Wasm GC. Interface --------- ### Garbage collector / `--exportRuntime` * **__new**(size: `usize`, id: `u32` = 0): `usize`<br /> Dynamically allocates a GC object of at least the specified size and returns its address. Alignment is guaranteed to be 16 bytes to fit up to v128 values naturally. GC-allocated objects cannot be used with `__realloc` and `__free`. * **__pin**(ptr: `usize`): `usize`<br /> Pins the object pointed to by `ptr` externally so it and its directly reachable members and indirectly reachable objects do not become garbage collected. * **__unpin**(ptr: `usize`): `void`<br /> Unpins the object pointed to by `ptr` externally so it can become garbage collected. * **__collect**(): `void`<br /> Performs a full garbage collection. ### Internals * **__alloc**(size: `usize`): `usize`<br /> Dynamically allocates a chunk of memory of at least the specified size and returns its address. Alignment is guaranteed to be 16 bytes to fit up to v128 values naturally. * **__realloc**(ptr: `usize`, size: `usize`): `usize`<br /> Dynamically changes the size of a chunk of memory, possibly moving it to a new address. * **__free**(ptr: `usize`): `void`<br /> Frees a dynamically allocated chunk of memory by its address. * **__renew**(ptr: `usize`, size: `usize`): `usize`<br /> Like `__realloc`, but for `__new`ed GC objects. * **__link**(parentPtr: `usize`, childPtr: `usize`, expectMultiple: `bool`): `void`<br /> Introduces a link from a parent object to a child object, i.e. upon `parent.field = child`. * **__visit**(ptr: `usize`, cookie: `u32`): `void`<br /> Concrete visitor implementation called during traversal. Cookie can be used to indicate one of multiple operations. * **__visit_globals**(cookie: `u32`): `void`<br /> Calls `__visit` on each global that is of a managed type. * **__visit_members**(ptr: `usize`, cookie: `u32`): `void`<br /> Calls `__visit` on each member of the object pointed to by `ptr`. * **__typeinfo**(id: `u32`): `RTTIFlags`<br /> Obtains the runtime type information for objects with the specified runtime id. Runtime type information is a set of flags indicating whether a type is managed, an array or similar, and what the relevant alignments when creating an instance externally are etc. * **__instanceof**(ptr: `usize`, classId: `u32`): `bool`<br /> Tests if the object pointed to by `ptr` is an instance of the specified class id. ITCMS / `--runtime incremental` ----- The Incremental Tri-Color Mark & Sweep garbage collector maintains a separate shadow stack of managed values in the background to achieve full automation. Maintaining another stack introduces some overhead compared to the simpler Two-Color Mark & Sweep garbage collector, but makes it independent of whether the execution stack is unwound or not when it is invoked, so the garbage collector can run interleaved with the program. There are several constants one can experiment with to tweak ITCMS's automation: * `--use ASC_GC_GRANULARITY=1024`<br /> How often to interrupt. The default of 1024 means "interrupt each 1024 bytes allocated". * `--use ASC_GC_STEPFACTOR=200`<br /> How long to interrupt. The default of 200% means "run at double the speed of allocations". * `--use ASC_GC_IDLEFACTOR=200`<br /> How long to idle. The default of 200% means "wait for memory to double before kicking in again". * `--use ASC_GC_MARKCOST=1`<br /> How costly it is to mark one object. Budget per interrupt is `GRANULARITY * STEPFACTOR / 100`. * `--use ASC_GC_SWEEPCOST=10`<br /> How costly it is to sweep one object. Budget per interrupt is `GRANULARITY * STEPFACTOR / 100`. TCMS / `--runtime minimal` ---- If automation and low pause times aren't strictly necessary, using the Two-Color Mark & Sweep garbage collector instead by invoking collection manually at appropriate times when the execution stack is unwound may be more performant as it simpler and has less overhead. The execution stack is typically unwound when invoking the collector externally, at a place that is not indirectly called from Wasm. STUB / `--runtime stub` ---- The stub is a maximally minimal runtime substitute, consisting of a simple and fast bump allocator with no means of freeing up memory again, except when freeing the respective most recently allocated object on top of the bump. Useful where memory is not a concern, and/or where it is sufficient to destroy the whole module including any potential garbage after execution. See also: [Garbage collection](https://www.assemblyscript.org/garbage-collection.html) # lodash.sortby v4.7.0 The [lodash](https://lodash.com/) method `_.sortBy` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.sortby ``` In Node.js: ```js var sortBy = require('lodash.sortby'); ``` See the [documentation](https://lodash.com/docs#sortBy) or [package source](https://github.com/lodash/lodash/blob/4.7.0-npm-packages/lodash.sortby) for more details. # Acorn-JSX [![Build Status](https://travis-ci.org/acornjs/acorn-jsx.svg?branch=master)](https://travis-ci.org/acornjs/acorn-jsx) [![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx) This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools. ## Transpiler Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood. ## Usage Requiring this module provides you with an Acorn plugin that you can use like this: ```javascript var acorn = require("acorn"); var jsx = require("acorn-jsx"); acorn.Parser.extend(jsx()).parse("my(<jsx/>, 'code');"); ``` Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in `<namespace:Object.Property />`, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option: ```javascript acorn.Parser.extend(jsx({ allowNamespacedObjects: true })) ``` Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely: ```javascript acorn.Parser.extend(jsx({ allowNamespaces: false })) ``` Note that by default `allowNamespaces` is enabled for spec compliancy. ## License This plugin is issued under the [MIT license](./LICENSE). # word-wrap [![NPM version](https://img.shields.io/npm/v/word-wrap.svg?style=flat)](https://www.npmjs.com/package/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/word-wrap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/word-wrap) > Wrap words to a specified length. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save word-wrap ``` ## Usage ```js var wrap = require('word-wrap'); wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'); ``` Results in: ``` Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ``` ## Options ![image](https://cloud.githubusercontent.com/assets/383994/6543728/7a381c08-c4f6-11e4-8b7d-b6ba197569c9.png) ### options.width Type: `Number` Default: `50` The width of the text before wrapping to a new line. **Example:** ```js wrap(str, {width: 60}); ``` ### options.indent Type: `String` Default: `` (two spaces) The string to use at the beginning of each line. **Example:** ```js wrap(str, {indent: ' '}); ``` ### options.newline Type: `String` Default: `\n` The string to use at the end of each line. **Example:** ```js wrap(str, {newline: '\n\n'}); ``` ### options.escape Type: `function` Default: `function(str){return str;}` An escape function to run on each line after splitting them. **Example:** ```js var xmlescape = require('xml-escape'); wrap(str, { escape: function(string){ return xmlescape(string); } }); ``` ### options.trim Type: `Boolean` Default: `false` Trim trailing whitespace from the returned string. This option is included since `.trim()` would also strip the leading indentation from the first line. **Example:** ```js wrap(str, {trim: true}); ``` ### options.cut Type: `Boolean` Default: `false` Break a word between any two letters when the word is longer than the specified width. **Example:** ```js wrap(str, {cut: true}); ``` ## About ### Related projects * [common-words](https://www.npmjs.com/package/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words) | [homepage](https://github.com/jonschlinkert/common-words "Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.") * [shuffle-words](https://www.npmjs.com/package/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words) | [homepage](https://github.com/jonschlinkert/shuffle-words "Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.") * [unique-words](https://www.npmjs.com/package/unique-words): Return the unique words in a string or array. | [homepage](https://github.com/jonschlinkert/unique-words "Return the unique words in a string or array.") * [wordcount](https://www.npmjs.com/package/wordcount): Count the words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/jonschlinkert/wordcount "Count the words in a string. Support for english, CJK and Cyrillic.") ### Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). ### Contributors | **Commits** | **Contributor** | | --- | --- | | 43 | [jonschlinkert](https://github.com/jonschlinkert) | | 2 | [lordvlad](https://github.com/lordvlad) | | 2 | [hildjj](https://github.com/hildjj) | | 1 | [danilosampaio](https://github.com/danilosampaio) | | 1 | [2fd](https://github.com/2fd) | | 1 | [toddself](https://github.com/toddself) | | 1 | [wolfgang42](https://github.com/wolfgang42) | | 1 | [zachhale](https://github.com/zachhale) | ### Building docs _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` ### Running tests Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` ### Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](https://twitter.com/jonschlinkert) ### License Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._ # has > Object.prototype.hasOwnProperty.call shortcut ## Installation ```sh npm install --save has ``` ## Usage ```js var has = require('has'); has({}, 'hasOwnProperty'); // false has(Object.prototype, 'hasOwnProperty'); // true ``` # Regular Expression Tokenizer Tokenizes strings that represent a regular expressions. [![Build Status](https://secure.travis-ci.org/fent/ret.js.svg)](http://travis-ci.org/fent/ret.js) [![Dependency Status](https://david-dm.org/fent/ret.js.svg)](https://david-dm.org/fent/ret.js) [![codecov](https://codecov.io/gh/fent/ret.js/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/ret.js) # Usage ```js var ret = require('ret'); var tokens = ret(/foo|bar/.source); ``` `tokens` will contain the following object ```js { "type": ret.types.ROOT "options": [ [ { "type": ret.types.CHAR, "value", 102 }, { "type": ret.types.CHAR, "value", 111 }, { "type": ret.types.CHAR, "value", 111 } ], [ { "type": ret.types.CHAR, "value", 98 }, { "type": ret.types.CHAR, "value", 97 }, { "type": ret.types.CHAR, "value", 114 } ] ] } ``` # Token Types `ret.types` is a collection of the various token types exported by ret. ### ROOT Only used in the root of the regexp. This is needed due to the posibility of the root containing a pipe `|` character. In that case, the token will have an `options` key that will be an array of arrays of tokens. If not, it will contain a `stack` key that is an array of tokens. ```js { "type": ret.types.ROOT, "stack": [token1, token2...], } ``` ```js { "type": ret.types.ROOT, "options" [ [token1, token2...], [othertoken1, othertoken2...] ... ], } ``` ### GROUP Groups contain tokens that are inside of a parenthesis. If the group begins with `?` followed by another character, it's a special type of group. A ':' tells the group not to be remembered when `exec` is used. '=' means the previous token matches only if followed by this group, and '!' means the previous token matches only if NOT followed. Like root, it can contain an `options` key instead of `stack` if there is a pipe. ```js { "type": ret.types.GROUP, "remember" true, "followedBy": false, "notFollowedBy": false, "stack": [token1, token2...], } ``` ```js { "type": ret.types.GROUP, "remember" true, "followedBy": false, "notFollowedBy": false, "options" [ [token1, token2...], [othertoken1, othertoken2...] ... ], } ``` ### POSITION `\b`, `\B`, `^`, and `$` specify positions in the regexp. ```js { "type": ret.types.POSITION, "value": "^", } ``` ### SET Contains a key `set` specifying what tokens are allowed and a key `not` specifying if the set should be negated. A set can contain other sets, ranges, and characters. ```js { "type": ret.types.SET, "set": [token1, token2...], "not": false, } ``` ### RANGE Used in set tokens to specify a character range. `from` and `to` are character codes. ```js { "type": ret.types.RANGE, "from": 97, "to": 122, } ``` ### REPETITION ```js { "type": ret.types.REPETITION, "min": 0, "max": Infinity, "value": token, } ``` ### REFERENCE References a group token. `value` is 1-9. ```js { "type": ret.types.REFERENCE, "value": 1, } ``` ### CHAR Represents a single character token. `value` is the character code. This might seem a bit cluttering instead of concatenating characters together. But since repetition tokens only repeat the last token and not the last clause like the pipe, it's simpler to do it this way. ```js { "type": ret.types.CHAR, "value": 123, } ``` ## Errors ret.js will throw errors if given a string with an invalid regular expression. All possible errors are * Invalid group. When a group with an immediate `?` character is followed by an invalid character. It can only be followed by `!`, `=`, or `:`. Example: `/(?_abc)/` * Nothing to repeat. Thrown when a repetitional token is used as the first token in the current clause, as in right in the beginning of the regexp or group, or right after a pipe. Example: `/foo|?bar/`, `/{1,3}foo|bar/`, `/foo(+bar)/` * Unmatched ). A group was not opened, but was closed. Example: `/hello)2u/` * Unterminated group. A group was not closed. Example: `/(1(23)4/` * Unterminated character class. A custom character set was not closed. Example: `/[abc/` # Install npm install ret # Tests Tests are written with [vows](http://vowsjs.org/) ```bash npm test ``` # License MIT Standard library ================ Standard library components for use with `tsc` (portable) and `asc` (assembly). Base configurations (.json) and definition files (.d.ts) are relevant to `tsc` only and not used by `asc`. # is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) > Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save is-glob ``` You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). ## Usage ```js var isGlob = require('is-glob'); ``` ### Default behavior **True** Patterns that have glob characters or regex patterns will return `true`: ```js isGlob('!foo.js'); isGlob('*.js'); isGlob('**/abc.js'); isGlob('abc/*.js'); isGlob('abc/(aaa|bbb).js'); isGlob('abc/[a-z].js'); isGlob('abc/{a,b}.js'); //=> true ``` Extglobs ```js isGlob('abc/@(a).js'); isGlob('abc/!(a).js'); isGlob('abc/+(a).js'); isGlob('abc/*(a).js'); isGlob('abc/?(a).js'); //=> true ``` **False** Escaped globs or extglobs return `false`: ```js isGlob('abc/\\@(a).js'); isGlob('abc/\\!(a).js'); isGlob('abc/\\+(a).js'); isGlob('abc/\\*(a).js'); isGlob('abc/\\?(a).js'); isGlob('\\!foo.js'); isGlob('\\*.js'); isGlob('\\*\\*/abc.js'); isGlob('abc/\\*.js'); isGlob('abc/\\(aaa|bbb).js'); isGlob('abc/\\[a-z].js'); isGlob('abc/\\{a,b}.js'); //=> false ``` Patterns that do not have glob patterns return `false`: ```js isGlob('abc.js'); isGlob('abc/def/ghi.js'); isGlob('foo.js'); isGlob('abc/@.js'); isGlob('abc/+.js'); isGlob('abc/?.js'); isGlob(); isGlob(null); //=> false ``` Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): ```js isGlob(['**/*.js']); isGlob(['foo.js']); //=> false ``` ### Option strict When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. **True** Patterns that have glob characters or regex patterns will return `true`: ```js isGlob('!foo.js', {strict: false}); isGlob('*.js', {strict: false}); isGlob('**/abc.js', {strict: false}); isGlob('abc/*.js', {strict: false}); isGlob('abc/(aaa|bbb).js', {strict: false}); isGlob('abc/[a-z].js', {strict: false}); isGlob('abc/{a,b}.js', {strict: false}); //=> true ``` Extglobs ```js isGlob('abc/@(a).js', {strict: false}); isGlob('abc/!(a).js', {strict: false}); isGlob('abc/+(a).js', {strict: false}); isGlob('abc/*(a).js', {strict: false}); isGlob('abc/?(a).js', {strict: false}); //=> true ``` **False** Escaped globs or extglobs return `false`: ```js isGlob('\\!foo.js', {strict: false}); isGlob('\\*.js', {strict: false}); isGlob('\\*\\*/abc.js', {strict: false}); isGlob('abc/\\*.js', {strict: false}); isGlob('abc/\\(aaa|bbb).js', {strict: false}); isGlob('abc/\\[a-z].js', {strict: false}); isGlob('abc/\\{a,b}.js', {strict: false}); //=> false ``` ## About <details> <summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). </details> <details> <summary><strong>Running Tests</strong></summary> Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` </details> <details> <summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` </details> ### Related projects You might also be interested in these projects: * [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") * [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") * [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") * [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") ### Contributors | **Commits** | **Contributor** | | --- | --- | | 47 | [jonschlinkert](https://github.com/jonschlinkert) | | 5 | [doowb](https://github.com/doowb) | | 1 | [phated](https://github.com/phated) | | 1 | [danhper](https://github.com/danhper) | | 1 | [paulmillr](https://github.com/paulmillr) | ### Author **Jon Schlinkert** * [GitHub Profile](https://github.com/jonschlinkert) * [Twitter Profile](https://twitter.com/jonschlinkert) * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) ### License Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ # fs.realpath A backwards-compatible fs.realpath for Node v6 and above In Node v6, the JavaScript implementation of fs.realpath was replaced with a faster (but less resilient) native implementation. That raises new and platform-specific errors and cannot handle long or excessively symlink-looping paths. This module handles those cases by detecting the new errors and falling back to the JavaScript implementation. On versions of Node prior to v6, it has no effect. ## USAGE ```js var rp = require('fs.realpath') // async version rp.realpath(someLongAndLoopingPath, function (er, real) { // the ELOOP was handled, but it was a bit slower }) // sync version var real = rp.realpathSync(someLongAndLoopingPath) // monkeypatch at your own risk! // This replaces the fs.realpath/fs.realpathSync builtins rp.monkeypatch() // un-do the monkeypatching rp.unmonkeypatch() ``` # AssemblyScript Loader A convenient loader for [AssemblyScript](https://assemblyscript.org) modules. Demangles module exports to a friendly object structure compatible with TypeScript definitions and provides useful utility to read/write data from/to memory. [Documentation](https://assemblyscript.org/loader.html) [![npm version](https://img.shields.io/npm/v/eslint.svg)](https://www.npmjs.com/package/eslint) [![Downloads](https://img.shields.io/npm/dm/eslint.svg)](https://www.npmjs.com/package/eslint) [![Build Status](https://github.com/eslint/eslint/workflows/CI/badge.svg)](https://github.com/eslint/eslint/actions) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_shield) <br /> [![Open Collective Backers](https://img.shields.io/opencollective/backers/eslint)](https://opencollective.com/eslint) [![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/eslint)](https://opencollective.com/eslint) [![Follow us on Twitter](https://img.shields.io/twitter/follow/geteslint?label=Follow&style=social)](https://twitter.com/intent/user?screen_name=geteslint) # ESLint [Website](https://eslint.org) | [Configuring](https://eslint.org/docs/user-guide/configuring) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/developer-guide/contributing) | [Reporting Bugs](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) | [Code of Conduct](https://eslint.org/conduct) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint) | [Chat Room](https://eslint.org/chat) ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions: * ESLint uses [Espree](https://github.com/eslint/espree) for JavaScript parsing. * ESLint uses an AST to evaluate patterns in code. * ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime. ## Table of Contents 1. [Installation and Usage](#installation-and-usage) 2. [Configuration](#configuration) 3. [Code of Conduct](#code-of-conduct) 4. [Filing Issues](#filing-issues) 5. [Frequently Asked Questions](#faq) 6. [Releases](#releases) 7. [Security Policy](#security-policy) 8. [Semantic Versioning Policy](#semantic-versioning-policy) 9. [Stylistic Rule Updates](#stylistic-rule-updates) 10. [License](#license) 11. [Team](#team) 12. [Sponsors](#sponsors) 13. [Technology Sponsors](#technology-sponsors) ## <a name="installation-and-usage"></a>Installation and Usage Prerequisites: [Node.js](https://nodejs.org/) (`^10.12.0`, or `>=12.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.) You can install ESLint using npm: ``` $ npm install eslint --save-dev ``` You should then set up a configuration file: ``` $ ./node_modules/.bin/eslint --init ``` After that, you can run ESLint on any file or directory like this: ``` $ ./node_modules/.bin/eslint yourfile.js ``` ## <a name="configuration"></a>Configuration After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this: ```json { "rules": { "semi": ["error", "always"], "quotes": ["error", "double"] } } ``` The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values: * `"off"` or `0` - turn the rule off * `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code) * `"error"` or `2` - turn the rule on as an error (exit code will be 1) The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/user-guide/configuring)). ## <a name="code-of-conduct"></a>Code of Conduct ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct). ## <a name="filing-issues"></a>Filing Issues Before filing an issue, please be sure to read the guidelines for what you're reporting: * [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) * [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules) * [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes) * [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes) ## <a name="faq"></a>Frequently Asked Questions ### I'm using JSCS, should I migrate to ESLint? Yes. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life) and is no longer supported. We have prepared a [migration guide](https://eslint.org/docs/user-guide/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration. We are now at or near 100% compatibility with JSCS. If you try ESLint and believe we are not yet compatible with a JSCS rule/configuration, please create an issue (mentioning that it is a JSCS compatibility issue) and we will evaluate it as per our normal process. ### Does Prettier replace ESLint? No, ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use ESLint for everything, or you can combine both using Prettier to format your code and ESLint to catch possible errors. ### Why can't ESLint find my plugins? * Make sure your plugins (and ESLint) are both in your project's `package.json` as devDependencies (or dependencies, if your project uses ESLint at runtime). * Make sure you have run `npm install` and all your dependencies are installed. * Make sure your plugins' peerDependencies have been installed as well. You can use `npm view eslint-plugin-myplugin peerDependencies` to see what peer dependencies `eslint-plugin-myplugin` has. ### Does ESLint support JSX? Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/user-guide/configuring)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics. ### What ECMAScript versions does ESLint support? ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, and 2020. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring). ### What about experimental features? ESLint's parser only officially supports the latest final ECMAScript standard. We will make changes to core rules in order to avoid crashes on stage 3 ECMAScript syntax proposals (as long as they are implemented using the correct experimental ESTree syntax). We may make changes to core rules to better work with language extensions (such as JSX, Flow, and TypeScript) on a case-by-case basis. In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use the [babel-eslint](https://github.com/babel/babel-eslint) parser and [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) to use any option available in Babel. Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature. ### Where to ask for help? Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://eslint.org/chat). ### Why doesn't ESLint lock dependency versions? Lock files like `package-lock.json` are helpful for deployed applications. They ensure that dependencies are consistent between environments and across deployments. Packages like `eslint` that get published to the npm registry do not include lock files. `npm install eslint` as a user will respect version constraints in ESLint's `package.json`. ESLint and its dependencies will be included in the user's lock file if one exists, but ESLint's own lock file would not be used. We intentionally don't lock dependency versions so that we have the latest compatible dependency versions in development and CI that our users get when installing ESLint in a project. The Twilio blog has a [deeper dive](https://www.twilio.com/blog/lockfiles-nodejs) to learn more. ## <a name="releases"></a>Releases We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release. ## <a name="security-policy"></a>Security Policy ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). ## <a name="semantic-versioning-policy"></a>Semantic Versioning Policy ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint: * Patch release (intended to not break your lint build) * A bug fix in a rule that results in ESLint reporting fewer linting errors. * A bug fix to the CLI or core (including formatters). * Improvements to documentation. * Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage. * Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone). * Minor release (might break your lint build) * A bug fix in a rule that results in ESLint reporting more linting errors. * A new rule is created. * A new option to an existing rule that does not result in ESLint reporting more linting errors by default. * A new addition to an existing rule to support a newly-added language feature (within the last 12 months) that will result in ESLint reporting more linting errors by default. * An existing rule is deprecated. * A new CLI capability is created. * New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.). * A new formatter is created. * `eslint:recommended` is updated and will result in strictly fewer linting errors (e.g., rule removals). * Major release (likely to break your lint build) * `eslint:recommended` is updated and may result in new linting errors (e.g., rule additions, most rule option updates). * A new option to an existing rule that results in ESLint reporting more linting errors by default. * An existing formatter is removed. * Part of the public API is removed or changed in an incompatible way. The public API includes: * Rule schemas * Configuration schema * Command-line options * Node.js API * Rule, formatter, parser, plugin APIs According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds. ## <a name="stylistic-rule-updates"></a>Stylistic Rule Updates Stylistic rules are frozen according to [our policy](https://eslint.org/blog/2020/05/changes-to-rules-policies) on how we evaluate new rules and rule changes. This means: * **Bug fixes**: We will still fix bugs in stylistic rules. * **New ECMAScript features**: We will also make sure stylistic rules are compatible with new ECMAScript features. * **New options**: We will **not** add any new options to stylistic rules unless an option is the only way to fix a bug or support a newly-added ECMAScript feature. ## <a name="license"></a>License [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_large) ## <a name="team"></a>Team These folks keep the project moving and are resources for help. <!-- NOTE: This section is autogenerated. Do not manually edit.--> <!--teamstart--> ### Technical Steering Committee (TSC) The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained. <table><tbody><tr><td align="center" valign="top" width="11%"> <a href="https://github.com/nzakas"> <img src="https://github.com/nzakas.png?s=75" width="75" height="75"><br /> Nicholas C. Zakas </a> </td><td align="center" valign="top" width="11%"> <a href="https://github.com/btmills"> <img src="https://github.com/btmills.png?s=75" width="75" height="75"><br /> Brandon Mills </a> </td><td align="center" valign="top" width="11%"> <a href="https://github.com/mdjermanovic"> <img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br /> Milos Djermanovic </a> </td></tr></tbody></table> ### Reviewers The people who review and implement new features. <table><tbody><tr><td align="center" valign="top" width="11%"> <a href="https://github.com/mysticatea"> <img src="https://github.com/mysticatea.png?s=75" width="75" height="75"><br /> Toru Nagashima </a> </td><td align="center" valign="top" width="11%"> <a href="https://github.com/aladdin-add"> <img src="https://github.com/aladdin-add.png?s=75" width="75" height="75"><br /> 薛定谔的猫 </a> </td></tr></tbody></table> ### Committers The people who review and fix bugs and help triage issues. <table><tbody><tr><td align="center" valign="top" width="11%"> <a href="https://github.com/brettz9"> <img src="https://github.com/brettz9.png?s=75" width="75" height="75"><br /> Brett Zamir </a> </td><td align="center" valign="top" width="11%"> <a href="https://github.com/bmish"> <img src="https://github.com/bmish.png?s=75" width="75" height="75"><br /> Bryan Mishkin </a> </td><td align="center" valign="top" width="11%"> <a href="https://github.com/g-plane"> <img src="https://github.com/g-plane.png?s=75" width="75" height="75"><br /> Pig Fang </a> </td><td align="center" valign="top" width="11%"> <a href="https://github.com/anikethsaha"> <img src="https://github.com/anikethsaha.png?s=75" width="75" height="75"><br /> Anix </a> </td><td align="center" valign="top" width="11%"> <a href="https://github.com/yeonjuan"> <img src="https://github.com/yeonjuan.png?s=75" width="75" height="75"><br /> YeonJuan </a> </td><td align="center" valign="top" width="11%"> <a href="https://github.com/snitin315"> <img src="https://github.com/snitin315.png?s=75" width="75" height="75"><br /> Nitin Kumar </a> </td></tr></tbody></table> <!--teamend--> ## <a name="sponsors"></a>Sponsors The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website. <!-- NOTE: This section is autogenerated. Do not manually edit.--> <!--sponsorsstart--> <h3>Platinum Sponsors</h3> <p><a href="https://automattic.com"><img src="https://images.opencollective.com/photomatt/d0ef3e1/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3> <p><a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="96"></a> <a href="https://google.com/chrome"><img src="https://images.opencollective.com/chrome/dc55bd4/logo.png" alt="Chrome's Web Framework & Tools Performance Fund" height="96"></a> <a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://coinbase.com"><img src="https://avatars.githubusercontent.com/u/1885080?v=4" alt="Coinbase" height="96"></a> <a href="https://substack.com/"><img src="https://avatars.githubusercontent.com/u/53023767?v=4" alt="Substack" height="96"></a></p><h3>Silver Sponsors</h3> <p><a href="https://retool.com/"><img src="https://images.opencollective.com/retool/98ea68e/logo.png" alt="Retool" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a></p><h3>Bronze Sponsors</h3> <p><a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="null"><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://www.practiceignition.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Practice Ignition" height="32"></a></p> <!--sponsorsend--> ## <a name="technology-sponsors"></a>Technology Sponsors * Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com) * Hosting for ([eslint.org](https://eslint.org)) is sponsored by [Netlify](https://www.netlify.com) * Password management is sponsored by [1Password](https://www.1password.com) # file-entry-cache > Super simple cache for file metadata, useful for process that work o a given series of files > and that only need to repeat the job on the changed ones since the previous run of the process — Edit [![NPM Version](http://img.shields.io/npm/v/file-entry-cache.svg?style=flat)](https://npmjs.org/package/file-entry-cache) [![Build Status](http://img.shields.io/travis/royriojas/file-entry-cache.svg?style=flat)](https://travis-ci.org/royriojas/file-entry-cache) ## install ```bash npm i --save file-entry-cache ``` ## Usage The module exposes two functions `create` and `createFromFile`. ## `create(cacheName, [directory, useCheckSum])` - **cacheName**: the name of the cache to be created - **directory**: Optional the directory to load the cache from - **usecheckSum**: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file. ## `createFromFile(pathToCache, [useCheckSum])` - **pathToCache**: the path to the cache file (this combines the cache name and directory) - **useCheckSum**: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file. ```js // loads the cache, if one does not exists for the given // Id a new one will be prepared to be created var fileEntryCache = require('file-entry-cache'); var cache = fileEntryCache.create('testCache'); var files = expand('../fixtures/*.txt'); // the first time this method is called, will return all the files var oFiles = cache.getUpdatedFiles(files); // this will persist this to disk checking each file stats and // updating the meta attributes `size` and `mtime`. // custom fields could also be added to the meta object and will be persisted // in order to retrieve them later cache.reconcile(); // use this if you want the non visited file entries to be kept in the cache // for more than one execution // // cache.reconcile( true /* noPrune */) // on a second run var cache2 = fileEntryCache.create('testCache'); // will return now only the files that were modified or none // if no files were modified previous to the execution of this function var oFiles = cache.getUpdatedFiles(files); // if you want to prevent a file from being considered non modified // something useful if a file failed some sort of validation // you can then remove the entry from the cache doing cache.removeEntry('path/to/file'); // path to file should be the same path of the file received on `getUpdatedFiles` // that will effectively make the file to appear again as modified until the validation is passed. In that // case you should not remove it from the cache // if you need all the files, so you can determine what to do with the changed ones // you can call var oFiles = cache.normalizeEntries(files); // oFiles will be an array of objects like the following entry = { key: 'some/name/file', the path to the file changed: true, // if the file was changed since previous run meta: { size: 3242, // the size of the file mtime: 231231231, // the modification time of the file data: {} // some extra field stored for this file (useful to save the result of a transformation on the file } } ``` ## Motivation for this module I needed a super simple and dumb **in-memory cache** with optional disk persistence (write-back cache) in order to make a script that will beautify files with `esformatter` to execute only on the files that were changed since the last run. In doing so the process of beautifying files was reduced from several seconds to a small fraction of a second. This module uses [flat-cache](https://www.npmjs.com/package/flat-cache) a super simple `key/value` cache storage with optional file persistance. The main idea is to read the files when the task begins, apply the transforms required, and if the process succeed, then store the new state of the files. The next time this module request for `getChangedFiles` will return only the files that were modified. Making the process to end faster. This module could also be used by processes that modify the files applying a transform, in that case the result of the transform could be stored in the `meta` field, of the entries. Anything added to the meta field will be persisted. Those processes won't need to call `getChangedFiles` they will instead call `normalizeEntries` that will return the entries with a `changed` field that can be used to determine if the file was changed or not. If it was not changed the transformed stored data could be used instead of actually applying the transformation, saving time in case of only a few files changed. In the worst case scenario all the files will be processed. In the best case scenario only a few of them will be processed. ## Important notes - The values set on the meta attribute of the entries should be `stringify-able` ones if possible, flat-cache uses `circular-json` to try to persist circular structures, but this should be considered experimental. The best results are always obtained with non circular values - All the changes to the cache state are done to memory first and only persisted after reconcile. ## License MIT # prelude.ls [![Build Status](https://travis-ci.org/gkz/prelude-ls.png?branch=master)](https://travis-ci.org/gkz/prelude-ls) is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, <a href="http://livescript.net">LiveScript</a>. See **[the prelude.ls site](http://preludels.com)** for examples, a reference, and more. You can install via npm `npm install prelude-ls` ### Development `make test` to test `make build` to build `lib` from `src` `make build-browser` to build browser versions # minimatch A minimal matching utility. [![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. It works by converting glob expressions into JavaScript `RegExp` objects. ## Usage ```javascript var minimatch = require("minimatch") minimatch("bar.foo", "*.foo") // true! minimatch("bar.foo", "*.bar") // false! minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! ``` ## Features Supports these glob features: * Brace Expansion * Extended glob matching * "Globstar" `**` matching See: * `man sh` * `man bash` * `man 3 fnmatch` * `man 5 gitignore` ## Minimatch Class Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch var mm = new Minimatch(pattern, options) ``` ### Properties * `pattern` The original pattern the minimatch object represents. * `options` The options supplied to the constructor. * `set` A 2-dimensional array of regexp or string expressions. Each row in the array corresponds to a brace-expanded pattern. Each item in the row corresponds to a single path-part. For example, the pattern `{a,b/c}/d` would expand to a set of patterns like: [ [ a, d ] , [ b, c, d ] ] If a portion of the pattern doesn't have any "magic" in it (that is, it's something like `"foo"` rather than `fo*o?`), then it will be left as a string rather than converted to a regular expression. * `regexp` Created by the `makeRe` method. A single regular expression expressing the entire pattern. This is useful in cases where you wish to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. * `negate` True if the pattern is negated. * `comment` True if the pattern is a comment. * `empty` True if the pattern is `""`. ### Methods * `makeRe` Generate the `regexp` member if necessary, and return it. Will return `false` if the pattern is invalid. * `match(fname)` Return true if the filename matches the pattern, or false otherwise. * `matchOne(fileArray, patternArray, partial)` Take a `/`-split filename, and match it against a single row in the `regExpSet`. This method is mainly for internal use, but is exposed so that it can be used by a glob-walker that needs to avoid excessive filesystem calls. All other methods are internal, and will be called as necessary. ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. ```javascript var isJS = minimatch(file, "*.js", { matchBase: true }) ``` ### minimatch.filter(pattern, options) Returns a function that tests its supplied argument, suitable for use with `Array.filter`. Example: ```javascript var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) ``` ### minimatch.match(list, pattern, options) Match against the list of files, in the style of fnmatch or glob. If nothing is matched, and options.nonull is set, then return a list containing the pattern itself. ```javascript var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) ``` ### minimatch.makeRe(pattern, options) Make a regular expression object from the pattern. ## Options All options are `false` by default. ### debug Dump a ton of stuff to stderr. ### nobrace Do not expand `{a,b}` and `{1..3}` brace sets. ### noglobstar Disable `**` matching against multiple folder names. ### dot Allow patterns to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot. Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` is set. ### noext Disable "extglob" style patterns like `+(a|b)`. ### nocase Perform a case-insensitive match. ### nonull When a match is not found by `minimatch.match`, return a list containing the pattern itself if this option is set. When not set, an empty list is returned if there are no matches. ### matchBase If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. ### nocomment Suppress the behavior of treating `#` at the start of a pattern as a comment. ### nonegate Suppress the behavior of treating a leading `!` character as negation. ### flipNegate Returns from negate expressions the same as if they were not negated. (Ie, true on a hit, false on a miss.) ### partial Compare a partial path to a pattern. As long as the parts of the path that are present are not contradicted by the pattern, it will be treated as a match. This is useful in applications where you're walking through a folder structure, and don't yet have the full path, but want to ensure that you do not walk down paths that can never be a match. For example, ```js minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a ``` ### allowWindowsEscape Windows path separator `\` is by default converted to `/`, which prohibits the usage of `\` as a escape character. This flag skips that behavior and allows using the escape character. ## Comparisons to other fnmatch/glob implementations While strict compliance with the existing standards is a worthwhile goal, some discrepancies exist between minimatch and other implementations, and are intentional. If the pattern starts with a `!` character, then it is negated. Set the `nonegate` flag to suppress this behavior, and treat leading `!` characters normally. This is perhaps relevant if you wish to start the pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` characters at the start of a pattern will negate the pattern multiple times. If a pattern starts with `#`, then it is treated as a comment, and will not match anything. Use `\#` to match a literal `#` at the start of a line, or set the `nocomment` flag to suppress this behavior. The double-star character `**` is supported by default, unless the `noglobstar` flag is set. This is supported in the manner of bsdglob and bash 4.1, where `**` only has special significance if it is the only thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but `a/**b` will not. If an escaped pattern has no matches, and the `nonull` flag is set, then minimatch.match returns the pattern as-provided, rather than interpreting the character escapes. For example, `minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than `"*a?"`. This is akin to setting the `nullglob` option in bash, except that it does not resolve escaped pattern characters. If brace expansion is not disabled, then it is performed before any other interpretation of the glob pattern. Thus, a pattern like `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are checked for validity. Since those two are valid, matching proceeds. # node-tar [![Build Status](https://travis-ci.org/npm/node-tar.svg?branch=master)](https://travis-ci.org/npm/node-tar) [Fast](./benchmarks) and full-featured Tar for Node.js The API is designed to mimic the behavior of `tar(1)` on unix systems. If you are familiar with how tar works, most of this will hopefully be straightforward for you. If not, then hopefully this module can teach you useful unix skills that may come in handy someday :) ## Background A "tar file" or "tarball" is an archive of file system entries (directories, files, links, etc.) The name comes from "tape archive". If you run `man tar` on almost any Unix command line, you'll learn quite a bit about what it can do, and its history. Tar has 5 main top-level commands: * `c` Create an archive * `r` Replace entries within an archive * `u` Update entries within an archive (ie, replace if they're newer) * `t` List out the contents of an archive * `x` Extract an archive to disk The other flags and options modify how this top level function works. ## High-Level API These 5 functions are the high-level API. All of them have a single-character name (for unix nerds familiar with `tar(1)`) as well as a long name (for everyone else). All the high-level functions take the following arguments, all three of which are optional and may be omitted. 1. `options` - An optional object specifying various options 2. `paths` - An array of paths to add or extract 3. `callback` - Called when the command is completed, if async. (If sync or no file specified, providing a callback throws a `TypeError`.) If the command is sync (ie, if `options.sync=true`), then the callback is not allowed, since the action will be completed immediately. If a `file` argument is specified, and the command is async, then a `Promise` is returned. In this case, if async, a callback may be provided which is called when the command is completed. If a `file` option is not specified, then a stream is returned. For `create`, this is a readable stream of the generated archive. For `list` and `extract` this is a writable stream that an archive should be written into. If a file is not specified, then a callback is not allowed, because you're already getting a stream to work with. `replace` and `update` only work on existing archives, and so require a `file` argument. Sync commands without a file argument return a stream that acts on its input immediately in the same tick. For readable streams, this means that all of the data is immediately available by calling `stream.read()`. For writable streams, it will be acted upon as soon as it is provided, but this can be at any time. ### Warnings and Errors Tar emits warnings and errors for recoverable and unrecoverable situations, respectively. In many cases, a warning only affects a single entry in an archive, or is simply informing you that it's modifying an entry to comply with the settings provided. Unrecoverable warnings will always raise an error (ie, emit `'error'` on streaming actions, throw for non-streaming sync actions, reject the returned Promise for non-streaming async operations, or call a provided callback with an `Error` as the first argument). Recoverable errors will raise an error only if `strict: true` is set in the options. Respond to (recoverable) warnings by listening to the `warn` event. Handlers receive 3 arguments: - `code` String. One of the error codes below. This may not match `data.code`, which preserves the original error code from fs and zlib. - `message` String. More details about the error. - `data` Metadata about the error. An `Error` object for errors raised by fs and zlib. All fields are attached to errors raisd by tar. Typically contains the following fields, as relevant: - `tarCode` The tar error code. - `code` Either the tar error code, or the error code set by the underlying system. - `file` The archive file being read or written. - `cwd` Working directory for creation and extraction operations. - `entry` The entry object (if it could be created) for `TAR_ENTRY_INFO`, `TAR_ENTRY_INVALID`, and `TAR_ENTRY_ERROR` warnings. - `header` The header object (if it could be created, and the entry could not be created) for `TAR_ENTRY_INFO` and `TAR_ENTRY_INVALID` warnings. - `recoverable` Boolean. If `false`, then the warning will emit an `error`, even in non-strict mode. #### Error Codes * `TAR_ENTRY_INFO` An informative error indicating that an entry is being modified, but otherwise processed normally. For example, removing `/` or `C:\` from absolute paths if `preservePaths` is not set. * `TAR_ENTRY_INVALID` An indication that a given entry is not a valid tar archive entry, and will be skipped. This occurs when: - a checksum fails, - a `linkpath` is missing for a link type, or - a `linkpath` is provided for a non-link type. If every entry in a parsed archive raises an `TAR_ENTRY_INVALID` error, then the archive is presumed to be unrecoverably broken, and `TAR_BAD_ARCHIVE` will be raised. * `TAR_ENTRY_ERROR` The entry appears to be a valid tar archive entry, but encountered an error which prevented it from being unpacked. This occurs when: - an unrecoverable fs error happens during unpacking, - an entry has `..` in the path and `preservePaths` is not set, or - an entry is extracting through a symbolic link, when `preservePaths` is not set. * `TAR_ENTRY_UNSUPPORTED` An indication that a given entry is a valid archive entry, but of a type that is unsupported, and so will be skipped in archive creation or extracting. * `TAR_ABORT` When parsing gzipped-encoded archives, the parser will abort the parse process raise a warning for any zlib errors encountered. Aborts are considered unrecoverable for both parsing and unpacking. * `TAR_BAD_ARCHIVE` The archive file is totally hosed. This can happen for a number of reasons, and always occurs at the end of a parse or extract: - An entry body was truncated before seeing the full number of bytes. - The archive contained only invalid entries, indicating that it is likely not an archive, or at least, not an archive this library can parse. `TAR_BAD_ARCHIVE` is considered informative for parse operations, but unrecoverable for extraction. Note that, if encountered at the end of an extraction, tar WILL still have extracted as much it could from the archive, so there may be some garbage files to clean up. Errors that occur deeper in the system (ie, either the filesystem or zlib) will have their error codes left intact, and a `tarCode` matching one of the above will be added to the warning metadata or the raised error object. Errors generated by tar will have one of the above codes set as the `error.code` field as well, but since errors originating in zlib or fs will have their original codes, it's better to read `error.tarCode` if you wish to see how tar is handling the issue. ### Examples The API mimics the `tar(1)` command line functionality, with aliases for more human-readable option and function names. The goal is that if you know how to use `tar(1)` in Unix, then you know how to use `require('tar')` in JavaScript. To replicate `tar czf my-tarball.tgz files and folders`, you'd do: ```js tar.c( { gzip: <true|gzip options>, file: 'my-tarball.tgz' }, ['some', 'files', 'and', 'folders'] ).then(_ => { .. tarball has been created .. }) ``` To replicate `tar cz files and folders > my-tarball.tgz`, you'd do: ```js tar.c( // or tar.create { gzip: <true|gzip options> }, ['some', 'files', 'and', 'folders'] ).pipe(fs.createWriteStream('my-tarball.tgz')) ``` To replicate `tar xf my-tarball.tgz` you'd do: ```js tar.x( // or tar.extract( { file: 'my-tarball.tgz' } ).then(_=> { .. tarball has been dumped in cwd .. }) ``` To replicate `cat my-tarball.tgz | tar x -C some-dir --strip=1`: ```js fs.createReadStream('my-tarball.tgz').pipe( tar.x({ strip: 1, C: 'some-dir' // alias for cwd:'some-dir', also ok }) ) ``` To replicate `tar tf my-tarball.tgz`, do this: ```js tar.t({ file: 'my-tarball.tgz', onentry: entry => { .. do whatever with it .. } }) ``` To replicate `cat my-tarball.tgz | tar t` do: ```js fs.createReadStream('my-tarball.tgz') .pipe(tar.t()) .on('entry', entry => { .. do whatever with it .. }) ``` To do anything synchronous, add `sync: true` to the options. Note that sync functions don't take a callback and don't return a promise. When the function returns, it's already done. Sync methods without a file argument return a sync stream, which flushes immediately. But, of course, it still won't be done until you `.end()` it. To filter entries, add `filter: <function>` to the options. Tar-creating methods call the filter with `filter(path, stat)`. Tar-reading methods (including extraction) call the filter with `filter(path, entry)`. The filter is called in the `this`-context of the `Pack` or `Unpack` stream object. The arguments list to `tar t` and `tar x` specify a list of filenames to extract or list, so they're equivalent to a filter that tests if the file is in the list. For those who _aren't_ fans of tar's single-character command names: ``` tar.c === tar.create tar.r === tar.replace (appends to archive, file is required) tar.u === tar.update (appends if newer, file is required) tar.x === tar.extract tar.t === tar.list ``` Keep reading for all the command descriptions and options, as well as the low-level API that they are built on. ### tar.c(options, fileList, callback) [alias: tar.create] Create a tarball archive. The `fileList` is an array of paths to add to the tarball. Adding a directory also adds its children recursively. An entry in `fileList` that starts with an `@` symbol is a tar archive whose entries will be added. To add a file that starts with `@`, prepend it with `./`. The following options are supported: - `file` Write the tarball archive to the specified filename. If this is specified, then the callback will be fired when the file has been written, and a promise will be returned that resolves when the file is written. If a filename is not specified, then a Readable Stream will be returned which will emit the file data. [Alias: `f`] - `sync` Act synchronously. If this is set, then any provided file will be fully written after the call to `tar.c`. If this is set, and a file is not provided, then the resulting stream will already have the data ready to `read` or `emit('data')` as soon as you request it. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `strict` Treat warnings as crash-worthy errors. Default false. - `cwd` The current working directory for creating the archive. Defaults to `process.cwd()`. [Alias: `C`] - `prefix` A path portion to prefix onto the entries in the archive. - `gzip` Set to any truthy value to create a gzipped archive, or an object with settings for `zlib.Gzip()` [Alias: `z`] - `filter` A function that gets called with `(path, stat)` for each entry being added. Return `true` to add the entry to the archive, or `false` to omit it. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. [Alias: `P`] - `mode` The mode to set on the created file archive - `noDirRecurse` Do not recursively archive the contents of directories. [Alias: `n`] - `follow` Set to true to pack the targets of symbolic links. Without this option, symbolic links are archived as such. [Alias: `L`, `h`] - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. [Alias: `m`, `no-mtime`] - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. The following options are mostly internal, but can be modified in some advanced use cases, such as re-using caches between runs. - `linkCache` A Map object containing the device and inode value for any file whose nlink is > 1, to identify hard links. - `statCache` A Map object that caches calls `lstat`. - `readdirCache` A Map object that caches calls to `readdir`. - `jobs` A number specifying how many concurrent jobs to run. Defaults to 4. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. ### tar.x(options, fileList, callback) [alias: tar.extract] Extract a tarball archive. The `fileList` is an array of paths to extract from the tarball. If no paths are provided, then all the entries are extracted. If the archive is gzipped, then tar will detect this and unzip it. Note that all directories that are created will be forced to be writable, readable, and listable by their owner, to avoid cases where a directory prevents extraction of child entries by virtue of its mode. Most extraction errors will cause a `warn` event to be emitted. If the `cwd` is missing, or not a directory, then the extraction will fail completely. The following options are supported: - `cwd` Extract files relative to the specified directory. Defaults to `process.cwd()`. If provided, this must exist and must be a directory. [Alias: `C`] - `file` The archive file to extract. If not specified, then a Writable stream is returned where the archive data should be written. [Alias: `f`] - `sync` Create files and directories synchronously. - `strict` Treat warnings as crash-worthy errors. Default false. - `filter` A function that gets called with `(path, entry)` for each entry being unpacked. Return `true` to unpack the entry from the archive, or `false` to skip it. - `newer` Set to true to keep the existing file on disk if it's newer than the file in the archive. [Alias: `keep-newer`, `keep-newer-files`] - `keep` Do not overwrite existing files. In particular, if a file appears more than once in an archive, later copies will not overwrite earlier copies. [Alias: `k`, `keep-existing`] - `preservePaths` Allow absolute paths, paths containing `..`, and extracting through symbolic links. By default, `/` is stripped from absolute paths, `..` paths are not extracted, and any file whose location would be modified by a symbolic link is not extracted. [Alias: `P`] - `unlink` Unlink files before creating them. Without this option, tar overwrites existing files, which preserves existing hardlinks. With this option, existing hardlinks will be broken, as will any symlink that would affect the location of an extracted file. [Alias: `U`] - `strip` Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after applying the filter, but before security checks. [Alias: `strip-components`, `stripComponents`] - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `preserveOwner` If true, tar will set the `uid` and `gid` of extracted entries to the `uid` and `gid` fields in the archive. This defaults to true when run as root, and false otherwise. If false, then files and directories will be set with the owner and group of the user running the process. This is similar to `-p` in `tar(1)`, but ACLs and other system-specific data is never unpacked in this implementation, and modes are set by default already. [Alias: `p`] - `uid` Set to a number to force ownership of all extracted files and folders, and all implicitly created directories, to be owned by the specified user id, regardless of the `uid` field in the archive. Cannot be used along with `preserveOwner`. Requires also setting a `gid` option. - `gid` Set to a number to force ownership of all extracted files and folders, and all implicitly created directories, to be owned by the specified group id, regardless of the `gid` field in the archive. Cannot be used along with `preserveOwner`. Requires also setting a `uid` option. - `noMtime` Set to true to omit writing `mtime` value for extracted entries. [Alias: `m`, `no-mtime`] - `transform` Provide a function that takes an `entry` object, and returns a stream, or any falsey value. If a stream is provided, then that stream's data will be written instead of the contents of the archive entry. If a falsey value is provided, then the entry is written to disk as normal. (To exclude items from extraction, use the `filter` option described above.) - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. The following options are mostly internal, but can be modified in some advanced use cases, such as re-using caches between runs. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `umask` Filter the modes of entries like `process.umask()`. - `dmode` Default mode for directories - `fmode` Default mode for files - `dirCache` A Map object of which directories exist. - `maxMetaEntrySize` The maximum size of meta entries that is supported. Defaults to 1 MB. Note that using an asynchronous stream type with the `transform` option will cause undefined behavior in sync extractions. [MiniPass](http://npm.im/minipass)-based streams are designed for this use case. ### tar.t(options, fileList, callback) [alias: tar.list] List the contents of a tarball archive. The `fileList` is an array of paths to list from the tarball. If no paths are provided, then all the entries are listed. If the archive is gzipped, then tar will detect this and unzip it. Returns an event emitter that emits `entry` events with `tar.ReadEntry` objects. However, they don't emit `'data'` or `'end'` events. (If you want to get actual readable entries, use the `tar.Parse` class instead.) The following options are supported: - `cwd` Extract files relative to the specified directory. Defaults to `process.cwd()`. [Alias: `C`] - `file` The archive file to list. If not specified, then a Writable stream is returned where the archive data should be written. [Alias: `f`] - `sync` Read the specified file synchronously. (This has no effect when a file option isn't specified, because entries are emitted as fast as they are parsed from the stream anyway.) - `strict` Treat warnings as crash-worthy errors. Default false. - `filter` A function that gets called with `(path, entry)` for each entry being listed. Return `true` to emit the entry from the archive, or `false` to skip it. - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. This is important for when both `file` and `sync` are set, because it will be called synchronously. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `noResume` By default, `entry` streams are resumed immediately after the call to `onentry`. Set `noResume: true` to suppress this behavior. Note that by opting into this, the stream will never complete until the entry data is consumed. ### tar.u(options, fileList, callback) [alias: tar.update] Add files to an archive if they are newer than the entry already in the tarball archive. The `fileList` is an array of paths to add to the tarball. Adding a directory also adds its children recursively. An entry in `fileList` that starts with an `@` symbol is a tar archive whose entries will be added. To add a file that starts with `@`, prepend it with `./`. The following options are supported: - `file` Required. Write the tarball archive to the specified filename. [Alias: `f`] - `sync` Act synchronously. If this is set, then any provided file will be fully written after the call to `tar.c`. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `strict` Treat warnings as crash-worthy errors. Default false. - `cwd` The current working directory for adding entries to the archive. Defaults to `process.cwd()`. [Alias: `C`] - `prefix` A path portion to prefix onto the entries in the archive. - `gzip` Set to any truthy value to create a gzipped archive, or an object with settings for `zlib.Gzip()` [Alias: `z`] - `filter` A function that gets called with `(path, stat)` for each entry being added. Return `true` to add the entry to the archive, or `false` to omit it. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. [Alias: `P`] - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `noDirRecurse` Do not recursively archive the contents of directories. [Alias: `n`] - `follow` Set to true to pack the targets of symbolic links. Without this option, symbolic links are archived as such. [Alias: `L`, `h`] - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. [Alias: `m`, `no-mtime`] - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. ### tar.r(options, fileList, callback) [alias: tar.replace] Add files to an existing archive. Because later entries override earlier entries, this effectively replaces any existing entries. The `fileList` is an array of paths to add to the tarball. Adding a directory also adds its children recursively. An entry in `fileList` that starts with an `@` symbol is a tar archive whose entries will be added. To add a file that starts with `@`, prepend it with `./`. The following options are supported: - `file` Required. Write the tarball archive to the specified filename. [Alias: `f`] - `sync` Act synchronously. If this is set, then any provided file will be fully written after the call to `tar.c`. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `strict` Treat warnings as crash-worthy errors. Default false. - `cwd` The current working directory for adding entries to the archive. Defaults to `process.cwd()`. [Alias: `C`] - `prefix` A path portion to prefix onto the entries in the archive. - `gzip` Set to any truthy value to create a gzipped archive, or an object with settings for `zlib.Gzip()` [Alias: `z`] - `filter` A function that gets called with `(path, stat)` for each entry being added. Return `true` to add the entry to the archive, or `false` to omit it. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. [Alias: `P`] - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `noDirRecurse` Do not recursively archive the contents of directories. [Alias: `n`] - `follow` Set to true to pack the targets of symbolic links. Without this option, symbolic links are archived as such. [Alias: `L`, `h`] - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. [Alias: `m`, `no-mtime`] - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. ## Low-Level API ### class tar.Pack A readable tar stream. Has all the standard readable stream interface stuff. `'data'` and `'end'` events, `read()` method, `pause()` and `resume()`, etc. #### constructor(options) The following options are supported: - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `strict` Treat warnings as crash-worthy errors. Default false. - `cwd` The current working directory for creating the archive. Defaults to `process.cwd()`. - `prefix` A path portion to prefix onto the entries in the archive. - `gzip` Set to any truthy value to create a gzipped archive, or an object with settings for `zlib.Gzip()` - `filter` A function that gets called with `(path, stat)` for each entry being added. Return `true` to add the entry to the archive, or `false` to omit it. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. - `linkCache` A Map object containing the device and inode value for any file whose nlink is > 1, to identify hard links. - `statCache` A Map object that caches calls `lstat`. - `readdirCache` A Map object that caches calls to `readdir`. - `jobs` A number specifying how many concurrent jobs to run. Defaults to 4. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 16 MB. - `noDirRecurse` Do not recursively archive the contents of directories. - `follow` Set to true to pack the targets of symbolic links. Without this option, symbolic links are archived as such. - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. #### add(path) Adds an entry to the archive. Returns the Pack stream. #### write(path) Adds an entry to the archive. Returns true if flushed. #### end() Finishes the archive. ### class tar.Pack.Sync Synchronous version of `tar.Pack`. ### class tar.Unpack A writable stream that unpacks a tar archive onto the file system. All the normal writable stream stuff is supported. `write()` and `end()` methods, `'drain'` events, etc. Note that all directories that are created will be forced to be writable, readable, and listable by their owner, to avoid cases where a directory prevents extraction of child entries by virtue of its mode. `'close'` is emitted when it's done writing stuff to the file system. Most unpack errors will cause a `warn` event to be emitted. If the `cwd` is missing, or not a directory, then an error will be emitted. #### constructor(options) - `cwd` Extract files relative to the specified directory. Defaults to `process.cwd()`. If provided, this must exist and must be a directory. - `filter` A function that gets called with `(path, entry)` for each entry being unpacked. Return `true` to unpack the entry from the archive, or `false` to skip it. - `newer` Set to true to keep the existing file on disk if it's newer than the file in the archive. - `keep` Do not overwrite existing files. In particular, if a file appears more than once in an archive, later copies will not overwrite earlier copies. - `preservePaths` Allow absolute paths, paths containing `..`, and extracting through symbolic links. By default, `/` is stripped from absolute paths, `..` paths are not extracted, and any file whose location would be modified by a symbolic link is not extracted. - `unlink` Unlink files before creating them. Without this option, tar overwrites existing files, which preserves existing hardlinks. With this option, existing hardlinks will be broken, as will any symlink that would affect the location of an extracted file. - `strip` Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after applying the filter, but before security checks. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `umask` Filter the modes of entries like `process.umask()`. - `dmode` Default mode for directories - `fmode` Default mode for files - `dirCache` A Map object of which directories exist. - `maxMetaEntrySize` The maximum size of meta entries that is supported. Defaults to 1 MB. - `preserveOwner` If true, tar will set the `uid` and `gid` of extracted entries to the `uid` and `gid` fields in the archive. This defaults to true when run as root, and false otherwise. If false, then files and directories will be set with the owner and group of the user running the process. This is similar to `-p` in `tar(1)`, but ACLs and other system-specific data is never unpacked in this implementation, and modes are set by default already. - `win32` True if on a windows platform. Causes behavior where filenames containing `<|>?` chars are converted to windows-compatible values while being unpacked. - `uid` Set to a number to force ownership of all extracted files and folders, and all implicitly created directories, to be owned by the specified user id, regardless of the `uid` field in the archive. Cannot be used along with `preserveOwner`. Requires also setting a `gid` option. - `gid` Set to a number to force ownership of all extracted files and folders, and all implicitly created directories, to be owned by the specified group id, regardless of the `gid` field in the archive. Cannot be used along with `preserveOwner`. Requires also setting a `uid` option. - `noMtime` Set to true to omit writing `mtime` value for extracted entries. - `transform` Provide a function that takes an `entry` object, and returns a stream, or any falsey value. If a stream is provided, then that stream's data will be written instead of the contents of the archive entry. If a falsey value is provided, then the entry is written to disk as normal. (To exclude items from extraction, use the `filter` option described above.) - `strict` Treat warnings as crash-worthy errors. Default false. - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") ### class tar.Unpack.Sync Synchronous version of `tar.Unpack`. Note that using an asynchronous stream type with the `transform` option will cause undefined behavior in sync unpack streams. [MiniPass](http://npm.im/minipass)-based streams are designed for this use case. ### class tar.Parse A writable stream that parses a tar archive stream. All the standard writable stream stuff is supported. If the archive is gzipped, then tar will detect this and unzip it. Emits `'entry'` events with `tar.ReadEntry` objects, which are themselves readable streams that you can pipe wherever. Each `entry` will not emit until the one before it is flushed through, so make sure to either consume the data (with `on('data', ...)` or `.pipe(...)`) or throw it away with `.resume()` to keep the stream flowing. #### constructor(options) Returns an event emitter that emits `entry` events with `tar.ReadEntry` objects. The following options are supported: - `strict` Treat warnings as crash-worthy errors. Default false. - `filter` A function that gets called with `(path, entry)` for each entry being listed. Return `true` to emit the entry from the archive, or `false` to skip it. - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") #### abort(error) Stop all parsing activities. This is called when there are zlib errors. It also emits an unrecoverable warning with the error provided. ### class tar.ReadEntry extends [MiniPass](http://npm.im/minipass) A representation of an entry that is being read out of a tar archive. It has the following fields: - `extended` The extended metadata object provided to the constructor. - `globalExtended` The global extended metadata object provided to the constructor. - `remain` The number of bytes remaining to be written into the stream. - `blockRemain` The number of 512-byte blocks remaining to be written into the stream. - `ignore` Whether this entry should be ignored. - `meta` True if this represents metadata about the next entry, false if it represents a filesystem object. - All the fields from the header, extended header, and global extended header are added to the ReadEntry object. So it has `path`, `type`, `size, `mode`, and so on. #### constructor(header, extended, globalExtended) Create a new ReadEntry object with the specified header, extended header, and global extended header values. ### class tar.WriteEntry extends [MiniPass](http://npm.im/minipass) A representation of an entry that is being written from the file system into a tar archive. Emits data for the Header, and for the Pax Extended Header if one is required, as well as any body data. Creating a WriteEntry for a directory does not also create WriteEntry objects for all of the directory contents. It has the following fields: - `path` The path field that will be written to the archive. By default, this is also the path from the cwd to the file system object. - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `myuid` If supported, the uid of the user running the current process. - `myuser` The `env.USER` string if set, or `''`. Set as the entry `uname` field if the file's `uid` matches `this.myuid`. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 1 MB. - `linkCache` A Map object containing the device and inode value for any file whose nlink is > 1, to identify hard links. - `statCache` A Map object that caches calls `lstat`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. - `cwd` The current working directory for creating the archive. Defaults to `process.cwd()`. - `absolute` The absolute path to the entry on the filesystem. By default, this is `path.resolve(this.cwd, this.path)`, but it can be overridden explicitly. - `strict` Treat warnings as crash-worthy errors. Default false. - `win32` True if on a windows platform. Causes behavior where paths replace `\` with `/` and filenames containing the windows-compatible forms of `<|>?:` characters are converted to actual `<|>?:` characters in the archive. - `noPax` Suppress pax extended headers. Note that this means that long paths and linkpaths will be truncated, and large or negative numeric values may be interpreted incorrectly. - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. #### constructor(path, options) `path` is the path of the entry as it is written in the archive. The following options are supported: - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `maxReadSize` The maximum buffer size for `fs.read()` operations. Defaults to 1 MB. - `linkCache` A Map object containing the device and inode value for any file whose nlink is > 1, to identify hard links. - `statCache` A Map object that caches calls `lstat`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. - `cwd` The current working directory for creating the archive. Defaults to `process.cwd()`. - `absolute` The absolute path to the entry on the filesystem. By default, this is `path.resolve(this.cwd, this.path)`, but it can be overridden explicitly. - `strict` Treat warnings as crash-worthy errors. Default false. - `win32` True if on a windows platform. Causes behavior where paths replace `\` with `/`. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. - `umask` Set to restrict the modes on the entries in the archive, somewhat like how umask works on file creation. Defaults to `process.umask()` on unix systems, or `0o22` on Windows. #### warn(message, data) If strict, emit an error with the provided message. Othewise, emit a `'warn'` event with the provided message and data. ### class tar.WriteEntry.Sync Synchronous version of tar.WriteEntry ### class tar.WriteEntry.Tar A version of tar.WriteEntry that gets its data from a tar.ReadEntry instead of from the filesystem. #### constructor(readEntry, options) `readEntry` is the entry being read out of another archive. The following options are supported: - `portable` Omit metadata that is system-specific: `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note that `mtime` is still included, because this is necessary for other time-based operations. Additionally, `mode` is set to a "reasonable default" for most unix systems, based on a `umask` value of `0o22`. - `preservePaths` Allow absolute paths. By default, `/` is stripped from absolute paths. - `strict` Treat warnings as crash-worthy errors. Default false. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. ### class tar.Header A class for reading and writing header blocks. It has the following fields: - `nullBlock` True if decoding a block which is entirely composed of `0x00` null bytes. (Useful because tar files are terminated by at least 2 null blocks.) - `cksumValid` True if the checksum in the header is valid, false otherwise. - `needPax` True if the values, as encoded, will require a Pax extended header. - `path` The path of the entry. - `mode` The 4 lowest-order octal digits of the file mode. That is, read/write/execute permissions for world, group, and owner, and the setuid, setgid, and sticky bits. - `uid` Numeric user id of the file owner - `gid` Numeric group id of the file owner - `size` Size of the file in bytes - `mtime` Modified time of the file - `cksum` The checksum of the header. This is generated by adding all the bytes of the header block, treating the checksum field itself as all ascii space characters (that is, `0x20`). - `type` The human-readable name of the type of entry this represents, or the alphanumeric key if unknown. - `typeKey` The alphanumeric key for the type of entry this header represents. - `linkpath` The target of Link and SymbolicLink entries. - `uname` Human-readable user name of the file owner - `gname` Human-readable group name of the file owner - `devmaj` The major portion of the device number. Always `0` for files, directories, and links. - `devmin` The minor portion of the device number. Always `0` for files, directories, and links. - `atime` File access time. - `ctime` File change time. #### constructor(data, [offset=0]) `data` is optional. It is either a Buffer that should be interpreted as a tar Header starting at the specified offset and continuing for 512 bytes, or a data object of keys and values to set on the header object, and eventually encode as a tar Header. #### decode(block, offset) Decode the provided buffer starting at the specified offset. Buffer length must be greater than 512 bytes. #### set(data) Set the fields in the data object. #### encode(buffer, offset) Encode the header fields into the buffer at the specified offset. Returns `this.needPax` to indicate whether a Pax Extended Header is required to properly encode the specified data. ### class tar.Pax An object representing a set of key-value pairs in an Pax extended header entry. It has the following fields. Where the same name is used, they have the same semantics as the tar.Header field of the same name. - `global` True if this represents a global extended header, or false if it is for a single entry. - `atime` - `charset` - `comment` - `ctime` - `gid` - `gname` - `linkpath` - `mtime` - `path` - `size` - `uid` - `uname` - `dev` - `ino` - `nlink` #### constructor(object, global) Set the fields set in the object. `global` is a boolean that defaults to false. #### encode() Return a Buffer containing the header and body for the Pax extended header entry, or `null` if there is nothing to encode. #### encodeBody() Return a string representing the body of the pax extended header entry. #### encodeField(fieldName) Return a string representing the key/value encoding for the specified fieldName, or `''` if the field is unset. ### tar.Pax.parse(string, extended, global) Return a new Pax object created by parsing the contents of the string provided. If the `extended` object is set, then also add the fields from that object. (This is necessary because multiple metadata entries can occur in sequence.) ### tar.types A translation table for the `type` field in tar headers. #### tar.types.name.get(code) Get the human-readable name for a given alphanumeric code. #### tar.types.code.get(name) Get the alphanumeric code for a given human-readable name. A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. [![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) ```js var colors = require('color-name'); colors.red //[255,0,0] ``` <a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a> [![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree) [![Build Status](https://travis-ci.org/eslint/espree.svg?branch=master)](https://travis-ci.org/eslint/espree) [![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE) # Espree Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of [Acorn](https://github.com/ternjs/acorn), which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima. ## Usage Install: ``` npm i espree ``` And in your Node.js code: ```javascript const espree = require("espree"); const ast = espree.parse(code); ``` ## API ### `parse()` `parse` parses the given code and returns a abstract syntax tree (AST). It takes two parameters. - `code` [string]() - the code which needs to be parsed. - `options (Optional)` [Object]() - read more about this [here](#options). ```javascript const espree = require("espree"); const ast = espree.parse(code, options); ``` **Example :** ```js const ast = espree.parse('let foo = "bar"', { ecmaVersion: 6 }); console.log(ast); ``` <details><summary>Output</summary> <p> ``` Node { type: 'Program', start: 0, end: 15, body: [ Node { type: 'VariableDeclaration', start: 0, end: 15, declarations: [Array], kind: 'let' } ], sourceType: 'script' } ``` </p> </details> ### `tokenize()` `tokenize` returns the tokens of a given code. It takes two parameters. - `code` [string]() - the code which needs to be parsed. - `options (Optional)` [Object]() - read more about this [here](#options). Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array **Example :** ```js const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 }); console.log(tokens); ``` <details><summary>Output</summary> <p> ``` Token { type: 'Keyword', value: 'let', start: 0, end: 3 }, Token { type: 'Identifier', value: 'foo', start: 4, end: 7 }, Token { type: 'Punctuator', value: '=', start: 8, end: 9 }, Token { type: 'String', value: '"bar"', start: 10, end: 15 } ``` </p> </details> ### `version` Returns the current `espree` version ### `VisitorKeys` Returns all visitor keys for traversing the AST from [eslint-visitor-keys](https://github.com/eslint/eslint-visitor-keys) ### `latestEcmaVersion` Returns the latest ECMAScript supported by `espree` ### `supportedEcmaVersions` Returns an array of all supported ECMAScript versions ## Options ```js const options = { // attach range information to each node range: false, // attach line/column location information to each node loc: false, // create a top-level comments array containing all comments comment: false, // create a top-level tokens array containing all tokens tokens: false, // Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming. ecmaVersion: 5, // specify which type of script you're parsing ("script" or "module") sourceType: "script", // specify additional language features ecmaFeatures: { // enable JSX parsing jsx: false, // enable return in global scope globalReturn: false, // enable implied strict mode (if ecmaVersion >= 5) impliedStrict: false } } ``` ## Esprima Compatibility Going Forward The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the [ESTree](https://github.com/estree/estree) API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same. Espree may also deviate from Esprima in the interface it exposes. ## Contributing Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/espree/issues). Espree is licensed under a permissive BSD 2-clause license. ## Security Policy We work hard to ensure that Espree is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). ## Build Commands * `npm test` - run all linting and tests * `npm run lint` - run all linting * `npm run browserify` - creates a version of Espree that is usable in a browser ## Differences from Espree 2.x * The `tokenize()` method does not use `ecmaFeatures`. Any string will be tokenized completely based on ECMAScript 6 semantics. * Trailing whitespace no longer is counted as part of a node. * `let` and `const` declarations are no longer parsed by default. You must opt-in by using an `ecmaVersion` newer than `5` or setting `sourceType` to `module`. * The `esparse` and `esvalidate` binary scripts have been removed. * There is no `tolerant` option. We will investigate adding this back in the future. ## Known Incompatibilities In an effort to help those wanting to transition from other parsers to Espree, the following is a list of noteworthy incompatibilities with other parsers. These are known differences that we do not intend to change. ### Esprima 1.2.2 * Esprima counts trailing whitespace as part of each AST node while Espree does not. In Espree, the end of a node is where the last token occurs. * Espree does not parse `let` and `const` declarations by default. * Error messages returned for parsing errors are different. * There are two addition properties on every node and token: `start` and `end`. These represent the same data as `range` and are used internally by Acorn. ### Esprima 2.x * Esprima 2.x uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2. ## Frequently Asked Questions ### Why another parser [ESLint](http://eslint.org) had been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development increased dramatically and Esprima had fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that caused our users frustration. We decided the only way for us to move forward was to create our own parser, bringing us inline with JSHint and JSLint, and allowing us to keep implementing new features as we need them. We chose to fork Esprima instead of starting from scratch in order to move as quickly as possible with a compatible API. With Espree 2.0.0, we are no longer a fork of Esprima but rather a translation layer between Acorn and Esprima syntax. This allows us to put work back into a community-supported parser (Acorn) that is continuing to grow and evolve while maintaining an Esprima-compatible parser for those utilities still built on Esprima. ### Have you tried working with Esprima? Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima and will continue to do so. However, there are some different philosophies around how the projects work that need to be worked through. The initial goal was to have Espree track Esprima and eventually merge the two back together, but we ultimately decided that building on top of Acorn was a better choice due to Acorn's plugin support. ### Why don't you just use Acorn? Acorn is a great JavaScript parser that produces an AST that is compatible with Esprima. Unfortunately, ESLint relies on more than just the AST to do its job. It relies on Esprima's tokens and comment attachment features to get a complete picture of the source code. We investigated switching to Acorn, but the inconsistencies between Esprima and Acorn created too much work for a project like ESLint. We are building on top of Acorn, however, so that we can contribute back and help make Acorn even better. ### What ECMAScript features do you support? Espree supports all ECMAScript 2020 features and partially supports ECMAScript 2021 features. Because ECMAScript 2021 is still under development, we are implementing features as they are finalized. Currently, Espree supports: * [Logical Assignment Operators](https://github.com/tc39/proposal-logical-assignment) * [Numeric Separators](https://github.com/tc39/proposal-numeric-separator) See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized. ### How do you determine which experimental features to support? In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features. # Visitor utilities for AssemblyScript Compiler transformers ## Example ### List Fields The transformer: ```ts import { ClassDeclaration, FieldDeclaration, MethodDeclaration, } from "../../as"; import { ClassDecorator, registerDecorator } from "../decorator"; import { toString } from "../utils"; class ListMembers extends ClassDecorator { visitFieldDeclaration(node: FieldDeclaration): void { if (!node.name) console.log(toString(node) + "\n"); const name = toString(node.name); const _type = toString(node.type!); this.stdout.write(name + ": " + _type + "\n"); } visitMethodDeclaration(node: MethodDeclaration): void { const name = toString(node.name); if (name == "constructor") { return; } const sig = toString(node.signature); this.stdout.write(name + ": " + sig + "\n"); } visitClassDeclaration(node: ClassDeclaration): void { this.visit(node.members); } get name(): string { return "list"; } } export = registerDecorator(new ListMembers()); ``` assembly/foo.ts: ```ts @list class Foo { a: u8; b: bool; i: i32; } ``` And then compile with `--transform` flag: ``` asc assembly/foo.ts --transform ./dist/examples/list --noEmit ``` Which prints the following to the console: ``` a: u8 b: bool i: i32 ``` # brace-expansion [Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) [![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) [![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) [![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) ## Example ```js var expand = require('brace-expansion'); expand('file-{a,b,c}.jpg') // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] expand('-v{,,}') // => ['-v', '-v', '-v'] expand('file{0..2}.jpg') // => ['file0.jpg', 'file1.jpg', 'file2.jpg'] expand('file-{a..c}.jpg') // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] expand('file{2..0}.jpg') // => ['file2.jpg', 'file1.jpg', 'file0.jpg'] expand('file{0..4..2}.jpg') // => ['file0.jpg', 'file2.jpg', 'file4.jpg'] expand('file-{a..e..2}.jpg') // => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] expand('file{00..10..5}.jpg') // => ['file00.jpg', 'file05.jpg', 'file10.jpg'] expand('{{A..C},{a..c}}') // => ['A', 'B', 'C', 'a', 'b', 'c'] expand('ppp{,config,oe{,conf}}') // => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] ``` ## API ```js var expand = require('brace-expansion'); ``` ### var expanded = expand(str) Return an array of all possible and valid expansions of `str`. If none are found, `[str]` is returned. Valid expansions are: ```js /^(.*,)+(.+)?$/ // {a,b,...} ``` A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. ```js /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ // {x..y[..incr]} ``` A numeric sequence from `x` to `y` inclusive, with optional increment. If `x` or `y` start with a leading `0`, all the numbers will be padded to have equal length. Negative numbers and backwards iteration work too. ```js /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ // {x..y[..incr]} ``` An alphabetic sequence from `x` to `y` inclusive, with optional increment. `x` and `y` must be exactly one character, and if given, `incr` must be a number. For compatibility reasons, the string `${` is not eligible for brace expansion. ## Installation With [npm](https://npmjs.org) do: ```bash npm install brace-expansion ``` ## Contributors - [Julian Gruber](https://github.com/juliangruber) - [Isaac Z. Schlueter](https://github.com/isaacs) ## Sponsors This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! ## License (MIT) Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # hasurl [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] > Determine whether Node.js' native [WHATWG `URL`](https://nodejs.org/api/url.html#url_the_whatwg_url_api) implementation is available. ## Installation [Node.js](http://nodejs.org/) `>= 4` is required. To install, type this at the command line: ```shell npm install hasurl ``` ## Usage ```js const hasURL = require('hasurl'); if (hasURL()) { // supported } else { // fallback } ``` [npm-image]: https://img.shields.io/npm/v/hasurl.svg [npm-url]: https://npmjs.org/package/hasurl [travis-image]: https://img.shields.io/travis/stevenvachon/hasurl.svg [travis-url]: https://travis-ci.org/stevenvachon/hasurl # v8-compile-cache [![Build Status](https://travis-ci.org/zertosh/v8-compile-cache.svg?branch=master)](https://travis-ci.org/zertosh/v8-compile-cache) `v8-compile-cache` attaches a `require` hook to use [V8's code cache](https://v8project.blogspot.com/2015/07/code-caching.html) to speed up instantiation time. The "code cache" is the work of parsing and compiling done by V8. The ability to tap into V8 to produce/consume this cache was introduced in [Node v5.7.0](https://nodejs.org/en/blog/release/v5.7.0/). ## Usage 1. Add the dependency: ```sh $ npm install --save v8-compile-cache ``` 2. Then, in your entry module add: ```js require('v8-compile-cache'); ``` **Requiring `v8-compile-cache` in Node <5.7.0 is a noop – but you need at least Node 4.0.0 to support the ES2015 syntax used by `v8-compile-cache`.** ## Options Set the environment variable `DISABLE_V8_COMPILE_CACHE=1` to disable the cache. Cache directory is defined by environment variable `V8_COMPILE_CACHE_CACHE_DIR` or defaults to `<os.tmpdir()>/v8-compile-cache-<V8_VERSION>`. ## Internals Cache files are suffixed `.BLOB` and `.MAP` corresponding to the entry module that required `v8-compile-cache`. The cache is _entry module specific_ because it is faster to load the entire code cache into memory at once, than it is to read it from disk on a file-by-file basis. ## Benchmarks See https://github.com/zertosh/v8-compile-cache/tree/master/bench. **Load Times:** | Module | Without Cache | With Cache | | ---------------- | -------------:| ----------:| | `babel-core` | `218ms` | `185ms` | | `yarn` | `153ms` | `113ms` | | `yarn` (bundled) | `228ms` | `105ms` | _^ Includes the overhead of loading the cache itself._ ## Acknowledgements * `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache: - https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js - https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js * `mkdirpSync` is based on: - https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98 <p align="center"> <img width="250" src="/yargs-logo.png"> </p> <h1 align="center"> Yargs </h1> <p align="center"> <b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b> </p> <br> [![Build Status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] [![Coverage][coverage-image]][coverage-url] [![Conventional Commits][conventional-commits-image]][conventional-commits-url] [![Slack][slack-image]][slack-url] ## Description : Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It gives you: * commands and (grouped) options (`my-program.js serve --port=5000`). * a dynamically generated help menu based on your arguments. > <img width="400" src="/screen.png"> * bash-completion shortcuts for commands and options. * and [tons more](/docs/api.md). ## Installation Stable version: ```bash npm i yargs ``` Bleeding edge version with the most recent features: ```bash npm i yargs@next ``` ## Usage : ### Simple Example ```javascript #!/usr/bin/env node const {argv} = require('yargs') if (argv.ships > 3 && argv.distance < 53.5) { console.log('Plunder more riffiwobbles!') } else { console.log('Retreat from the xupptumblers!') } ``` ```bash $ ./plunder.js --ships=4 --distance=22 Plunder more riffiwobbles! $ ./plunder.js --ships 12 --distance 98.7 Retreat from the xupptumblers! ``` ### Complex Example ```javascript #!/usr/bin/env node require('yargs') // eslint-disable-line .command('serve [port]', 'start the server', (yargs) => { yargs .positional('port', { describe: 'port to bind on', default: 5000 }) }, (argv) => { if (argv.verbose) console.info(`start server on :${argv.port}`) serve(argv.port) }) .option('verbose', { alias: 'v', type: 'boolean', description: 'Run with verbose logging' }) .argv ``` Run the example above with `--help` to see the help for the application. ## TypeScript yargs has type definitions at [@types/yargs][type-definitions]. ``` npm i @types/yargs --save-dev ``` See usage examples in [docs](/docs/typescript.md). ## Webpack See usage examples of yargs with webpack in [docs](/docs/webpack.md). ## Community : Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). ## Documentation : ### Table of Contents * [Yargs' API](/docs/api.md) * [Examples](/docs/examples.md) * [Parsing Tricks](/docs/tricks.md) * [Stop the Parser](/docs/tricks.md#stop) * [Negating Boolean Arguments](/docs/tricks.md#negate) * [Numbers](/docs/tricks.md#numbers) * [Arrays](/docs/tricks.md#arrays) * [Objects](/docs/tricks.md#objects) * [Quotes](/docs/tricks.md#quotes) * [Advanced Topics](/docs/advanced.md) * [Composing Your App Using Commands](/docs/advanced.md#commands) * [Building Configurable CLI Apps](/docs/advanced.md#configuration) * [Customizing Yargs' Parser](/docs/advanced.md#customizing) * [Contributing](/contributing.md) [travis-url]: https://travis-ci.org/yargs/yargs [travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg [npm-url]: https://www.npmjs.com/package/yargs [npm-image]: https://img.shields.io/npm/v/yargs.svg [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: http://standardjs.com/ [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg [conventional-commits-url]: https://conventionalcommits.org/ [slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg [slack-url]: http://devtoolscommunity.herokuapp.com [type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs [coverage-image]: https://img.shields.io/nycrc/yargs/yargs [coverage-url]: https://github.com/yargs/yargs/blob/master/.nycrc ESQuery is a library for querying the AST output by Esprima for patterns of syntax using a CSS style selector system. Check out the demo: [demo](https://estools.github.io/esquery/) The following selectors are supported: * AST node type: `ForStatement` * [wildcard](http://dev.w3.org/csswg/selectors4/#universal-selector): `*` * [attribute existence](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr]` * [attribute value](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr="foo"]` or `[attr=123]` * attribute regex: `[attr=/foo.*/]` or (with flags) `[attr=/foo.*/is]` * attribute conditions: `[attr!="foo"]`, `[attr>2]`, `[attr<3]`, `[attr>=2]`, or `[attr<=3]` * nested attribute: `[attr.level2="foo"]` * field: `FunctionDeclaration > Identifier.id` * [First](http://dev.w3.org/csswg/selectors4/#the-first-child-pseudo) or [last](http://dev.w3.org/csswg/selectors4/#the-last-child-pseudo) child: `:first-child` or `:last-child` * [nth-child](http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo) (no ax+b support): `:nth-child(2)` * [nth-last-child](http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo) (no ax+b support): `:nth-last-child(1)` * [descendant](http://dev.w3.org/csswg/selectors4/#descendant-combinators): `ancestor descendant` * [child](http://dev.w3.org/csswg/selectors4/#child-combinators): `parent > child` * [following sibling](http://dev.w3.org/csswg/selectors4/#general-sibling-combinators): `node ~ sibling` * [adjacent sibling](http://dev.w3.org/csswg/selectors4/#adjacent-sibling-combinators): `node + adjacent` * [negation](http://dev.w3.org/csswg/selectors4/#negation-pseudo): `:not(ForStatement)` * [has](https://drafts.csswg.org/selectors-4/#has-pseudo): `:has(ForStatement)` * [matches-any](http://dev.w3.org/csswg/selectors4/#matches): `:matches([attr] > :first-child, :last-child)` * [subject indicator](http://dev.w3.org/csswg/selectors4/#subject): `!IfStatement > [name="foo"]` * class of AST node: `:statement`, `:expression`, `:declaration`, `:function`, or `:pattern` [![Build Status](https://travis-ci.org/estools/esquery.png?branch=master)](https://travis-ci.org/estools/esquery) # tr46.js > An implementation of the [Unicode TR46 specification](http://unicode.org/reports/tr46/). ## Installation [Node.js](http://nodejs.org) `>= 6` is required. To install, type this at the command line: ```shell npm install tr46 ``` ## API ### `toASCII(domainName[, options])` Converts a string of Unicode symbols to a case-folded Punycode string of ASCII symbols. Available options: * [`checkBidi`](#checkBidi) * [`checkHyphens`](#checkHyphens) * [`checkJoiners`](#checkJoiners) * [`processingOption`](#processingOption) * [`useSTD3ASCIIRules`](#useSTD3ASCIIRules) * [`verifyDNSLength`](#verifyDNSLength) ### `toUnicode(domainName[, options])` Converts a case-folded Punycode string of ASCII symbols to a string of Unicode symbols. Available options: * [`checkBidi`](#checkBidi) * [`checkHyphens`](#checkHyphens) * [`checkJoiners`](#checkJoiners) * [`useSTD3ASCIIRules`](#useSTD3ASCIIRules) ## Options ### `checkBidi` Type: `Boolean` Default value: `false` When set to `true`, any bi-directional text within the input will be checked for validation. ### `checkHyphens` Type: `Boolean` Default value: `false` When set to `true`, the positions of any hyphen characters within the input will be checked for validation. ### `checkJoiners` Type: `Boolean` Default value: `false` When set to `true`, any word joiner characters within the input will be checked for validation. ### `processingOption` Type: `String` Default value: `"nontransitional"` When set to `"transitional"`, symbols within the input will be validated according to the older IDNA2003 protocol. When set to `"nontransitional"`, the current IDNA2008 protocol will be used. ### `useSTD3ASCIIRules` Type: `Boolean` Default value: `false` When set to `true`, input will be validated according to [STD3 Rules](http://unicode.org/reports/tr46/#STD3_Rules). ### `verifyDNSLength` Type: `Boolean` Default value: `false` When set to `true`, the length of each DNS label within the input will be checked for validation. # Near Bindings Generator Transforms the Assembyscript AST to serialize exported functions and add `encode` and `decode` functions for generating and parsing JSON strings. ## Using via CLI After installling, `npm install nearprotocol/near-bindgen-as`, it can be added to the cli arguments of the assemblyscript compiler you must add the following: ```bash asc <file> --transform near-bindgen-as ... ``` This module also adds a binary `near-asc` which adds the default arguments required to build near contracts as well as the transformer. ```bash near-asc <input file> <output file> ``` ## Using a script to compile Another way is to add a file such as `asconfig.js` such as: ```js const compile = require("near-bindgen-as/compiler").compile; compile("assembly/index.ts", // input file "out/index.wasm", // output file [ // "-O1", // Optional arguments "--debug", "--measure" ], // Prints out the final cli arguments passed to compiler. {verbose: true} ); ``` It can then be built with `node asconfig.js`. There is an example of this in the test directory. # lru cache A cache object that deletes the least-recently-used items. [![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) ## Installation: ```javascript npm install lru-cache --save ``` ## Usage: ```javascript var LRU = require("lru-cache") , options = { max: 500 , length: function (n, key) { return n * 2 + key.length } , dispose: function (key, n) { n.close() } , maxAge: 1000 * 60 * 60 } , cache = new LRU(options) , otherCache = new LRU(50) // sets just the max size cache.set("key", "value") cache.get("key") // "value" // non-string keys ARE fully supported // but note that it must be THE SAME object, not // just a JSON-equivalent object. var someObject = { a: 1 } cache.set(someObject, 'a value') // Object keys are not toString()-ed cache.set('[object Object]', 'a different value') assert.equal(cache.get(someObject), 'a value') // A similar object with same keys/values won't work, // because it's a different object identity assert.equal(cache.get({ a: 1 }), undefined) cache.reset() // empty the cache ``` If you put more stuff in it, then items will fall out. If you try to put an oversized thing in it, then it'll fall out right away. ## Options * `max` The maximum size of the cache, checked by applying the length function to all values in the cache. Not setting this is kind of silly, since that's the whole purpose of this lib, but it defaults to `Infinity`. Setting it to a non-number or negative number will throw a `TypeError`. Setting it to 0 makes it be `Infinity`. * `maxAge` Maximum age in ms. Items are not pro-actively pruned out as they age, but if you try to get an item that is too old, it'll drop it and return undefined instead of giving it to you. Setting this to a negative value will make everything seem old! Setting it to a non-number will throw a `TypeError`. * `length` Function that is used to calculate the length of stored items. If you're storing strings or buffers, then you probably want to do something like `function(n, key){return n.length}`. The default is `function(){return 1}`, which is fine if you want to store `max` like-sized things. The item is passed as the first argument, and the key is passed as the second argumnet. * `dispose` Function that is called on items when they are dropped from the cache. This can be handy if you want to close file descriptors or do other cleanup tasks when items are no longer accessible. Called with `key, value`. It's called *before* actually removing the item from the internal cache, so if you want to immediately put it back in, you'll have to do that in a `nextTick` or `setTimeout` callback or it won't do anything. * `stale` By default, if you set a `maxAge`, it'll only actually pull stale items out of the cache when you `get(key)`. (That is, it's not pre-emptively doing a `setTimeout` or anything.) If you set `stale:true`, it'll return the stale value before deleting it. If you don't set this, then it'll return `undefined` when you try to get a stale entry, as if it had already been deleted. * `noDisposeOnSet` By default, if you set a `dispose()` method, then it'll be called whenever a `set()` operation overwrites an existing key. If you set this option, `dispose()` will only be called when a key falls out of the cache, not when it is overwritten. * `updateAgeOnGet` When using time-expiring entries with `maxAge`, setting this to `true` will make each item's effective time update to the current time whenever it is retrieved from cache, causing it to not expire. (It can still fall out of cache based on recency of use, of course.) ## API * `set(key, value, maxAge)` * `get(key) => value` Both of these will update the "recently used"-ness of the key. They do what you think. `maxAge` is optional and overrides the cache `maxAge` option if provided. If the key is not found, `get()` will return `undefined`. The key and val can be any value. * `peek(key)` Returns the key value (or `undefined` if not found) without updating the "recently used"-ness of the key. (If you find yourself using this a lot, you *might* be using the wrong sort of data structure, but there are some use cases where it's handy.) * `del(key)` Deletes a key out of the cache. * `reset()` Clear the cache entirely, throwing away all values. * `has(key)` Check if a key is in the cache, without updating the recent-ness or deleting it for being stale. * `forEach(function(value,key,cache), [thisp])` Just like `Array.prototype.forEach`. Iterates over all the keys in the cache, in order of recent-ness. (Ie, more recently used items are iterated over first.) * `rforEach(function(value,key,cache), [thisp])` The same as `cache.forEach(...)` but items are iterated over in reverse order. (ie, less recently used items are iterated over first.) * `keys()` Return an array of the keys in the cache. * `values()` Return an array of the values in the cache. * `length` Return total length of objects in cache taking into account `length` options function. * `itemCount` Return total quantity of objects currently in cache. Note, that `stale` (see options) items are returned as part of this item count. * `dump()` Return an array of the cache entries ready for serialization and usage with 'destinationCache.load(arr)`. * `load(cacheEntriesArray)` Loads another cache entries array, obtained with `sourceCache.dump()`, into the cache. The destination cache is reset before loading new entries * `prune()` Manually iterates over the entire cache proactively pruning old entries # near-sdk-core This package contain a convenient interface for interacting with NEAR's host runtime. To see the functions that are provided by the host node see [`env.ts`](./assembly/env/env.ts). Compiler frontend for node.js ============================= Usage ----- For an up to date list of available command line options, see: ``` $> asc --help ``` API --- The API accepts the same options as the CLI but also lets you override stdout and stderr and/or provide a callback. Example: ```js const asc = require("assemblyscript/cli/asc"); asc.ready.then(() => { asc.main([ "myModule.ts", "--binaryFile", "myModule.wasm", "--optimize", "--sourceMap", "--measure" ], { stdout: process.stdout, stderr: process.stderr }, function(err) { if (err) throw err; ... }); }); ``` Available command line options can also be obtained programmatically: ```js const options = require("assemblyscript/cli/asc.json"); ... ``` You can also compile a source string directly, for example in a browser environment: ```js const asc = require("assemblyscript/cli/asc"); asc.ready.then(() => { const { binary, text, stdout, stderr } = asc.compileString(`...`, { optimize: 2 }); }); ... ``` # function-bind <!-- [![build status][travis-svg]][travis-url] [![NPM version][npm-badge-svg]][npm-url] [![Coverage Status][5]][6] [![gemnasium Dependency Status][7]][8] [![Dependency status][deps-svg]][deps-url] [![Dev Dependency status][dev-deps-svg]][dev-deps-url] --> <!-- [![browser support][11]][12] --> Implementation of function.prototype.bind ## Example I mainly do this for unit tests I run on phantomjs. PhantomJS does not have Function.prototype.bind :( ```js Function.prototype.bind = require("function-bind") ``` ## Installation `npm install function-bind` ## Contributors - Raynos ## MIT Licenced [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg [travis-url]: https://travis-ci.org/Raynos/function-bind [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg [npm-url]: https://npmjs.org/package/function-bind [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png [6]: https://coveralls.io/r/Raynos/function-bind [7]: https://gemnasium.com/Raynos/function-bind.png [8]: https://gemnasium.com/Raynos/function-bind [deps-svg]: https://david-dm.org/Raynos/function-bind.svg [deps-url]: https://david-dm.org/Raynos/function-bind [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies [11]: https://ci.testling.com/Raynos/function-bind.png [12]: https://ci.testling.com/Raynos/function-bind # [nearley](http://nearley.js.org) ↗️ [![JS.ORG](https://img.shields.io/badge/js.org-nearley-ffb400.svg?style=flat-square)](http://js.org) [![npm version](https://badge.fury.io/js/nearley.svg)](https://badge.fury.io/js/nearley) nearley is a simple, fast and powerful parsing toolkit. It consists of: 1. [A powerful, modular DSL for describing languages](https://nearley.js.org/docs/grammar) 2. [An efficient, lightweight Earley parser](https://nearley.js.org/docs/parser) 3. [Loads of tools, editor plug-ins, and other goodies!](https://nearley.js.org/docs/tooling) nearley is a **streaming** parser with support for catching **errors** gracefully and providing _all_ parsings for **ambiguous** grammars. It is compatible with a variety of **lexers** (we recommend [moo](http://github.com/tjvr/moo)). It comes with tools for creating **tests**, **railroad diagrams** and **fuzzers** from your grammars, and has support for a variety of editors and platforms. It works in both node and the browser. Unlike most other parser generators, nearley can handle *any* grammar you can define in BNF (and more!). In particular, while most existing JS parsers such as PEGjs and Jison choke on certain grammars (e.g. [left recursive ones](http://en.wikipedia.org/wiki/Left_recursion)), nearley handles them easily and efficiently by using the [Earley parsing algorithm](https://en.wikipedia.org/wiki/Earley_parser). nearley is used by a wide variety of projects: - [artificial intelligence](https://github.com/ChalmersGU-AI-course/shrdlite-course-project) and - [computational linguistics](https://wiki.eecs.yorku.ca/course_archive/2014-15/W/6339/useful_handouts) classes at universities; - [file format parsers](https://github.com/raymond-h/node-dmi); - [data-driven markup languages](https://github.com/idyll-lang/idyll-compiler); - [compilers for real-world programming languages](https://github.com/sizigi/lp5562); - and nearley itself! The nearley compiler is bootstrapped. nearley is an npm [staff pick](https://www.npmjs.com/package/npm-collection-staff-picks). ## Documentation Please visit our website https://nearley.js.org to get started! You will find a tutorial, detailed reference documents, and links to several real-world examples to get inspired. ## Contributing Please read [this document](.github/CONTRIBUTING.md) *before* working on nearley. If you are interested in contributing but unsure where to start, take a look at the issues labeled "up for grabs" on the issue tracker, or message a maintainer (@kach or @tjvr on Github). nearley is MIT licensed. A big thanks to Nathan Dinsmore for teaching me how to Earley, Aria Stewart for helping structure nearley into a mature module, and Robin Windels for bootstrapping the grammar. Additionally, Jacob Edelman wrote an experimental JavaScript parser with nearley and contributed ideas for EBNF support. Joshua T. Corbin refactored the compiler to be much, much prettier. Bojidar Marinov implemented postprocessors-in-other-languages. Shachar Itzhaky fixed a subtle bug with nullables. ## Citing nearley If you are citing nearley in academic work, please use the following BibTeX entry. ```bibtex @misc{nearley, author = "Kartik Chandra and Tim Radvan", title = "{nearley}: a parsing toolkit for {JavaScript}", year = {2014}, doi = {10.5281/zenodo.3897993}, url = {https://github.com/kach/nearley} } ``` <img align="right" alt="Ajv logo" width="160" src="https://ajv.js.org/images/ajv_logo.png"> # Ajv: Another JSON Schema Validator The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07. [![Build Status](https://travis-ci.org/ajv-validator/ajv.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv) [![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) [![npm (beta)](https://img.shields.io/npm/v/ajv/beta)](https://www.npmjs.com/package/ajv/v/7.0.0-beta.0) [![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) [![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) [![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) [![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) ## Ajv v7 beta is released [Ajv version 7.0.0-beta.0](https://github.com/ajv-validator/ajv/tree/v7-beta) is released with these changes: - to reduce the mistakes in JSON schemas and unexpected validation results, [strict mode](./docs/strict-mode.md) is added - it prohibits ignored or ambiguous JSON Schema elements. - to make code injection from untrusted schemas impossible, [code generation](./docs/codegen.md) is fully re-written to be safe. - to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas. - schemas are compiled to ES6 code (ES5 code generation is supported with an option). - to improve reliability and maintainability the code is migrated to TypeScript. **Please note**: - the support for JSON-Schema draft-04 is removed - if you have schemas using "id" attributes you have to replace them with "\$id" (or continue using version 6 that will be supported until 02/28/2021). - all formats are separated to ajv-formats package - they have to be explicitely added if you use them. See [release notes](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) for the details. To install the new version: ```bash npm install ajv@beta ``` See [Getting started with v7](https://github.com/ajv-validator/ajv/tree/v7-beta#usage) for code example. ## Mozilla MOSS grant and OpenJS Foundation [<img src="https://www.poberezkin.com/images/mozilla.png" width="240" height="68">](https://www.mozilla.org/en-US/moss/) &nbsp;&nbsp;&nbsp; [<img src="https://www.poberezkin.com/images/openjs.png" width="220" height="68">](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition](https://tools.ietf.org/html/draft-ucarion-json-type-definition-04). Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. ## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. Please sponsor Ajv via: - [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) - [Ajv Open Collective️](https://opencollective.com/ajv) Thank you. #### Open Collective sponsors <a href="https://opencollective.com/ajv"><img src="https://opencollective.com/ajv/individuals.svg?width=890"></a> <a href="https://opencollective.com/ajv/organization/0/website"><img src="https://opencollective.com/ajv/organization/0/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/1/website"><img src="https://opencollective.com/ajv/organization/1/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/2/website"><img src="https://opencollective.com/ajv/organization/2/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/3/website"><img src="https://opencollective.com/ajv/organization/3/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/4/website"><img src="https://opencollective.com/ajv/organization/4/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/5/website"><img src="https://opencollective.com/ajv/organization/5/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/6/website"><img src="https://opencollective.com/ajv/organization/6/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/7/website"><img src="https://opencollective.com/ajv/organization/7/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/8/website"><img src="https://opencollective.com/ajv/organization/8/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/9/website"><img src="https://opencollective.com/ajv/organization/9/avatar.svg"></a> ## Using version 6 [JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published. [Ajv version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes). __Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance: ```javascript ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); ``` To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId: ```javascript var ajv = new Ajv({schemaId: 'id'}); // If you want to use both draft-04 and draft-06/07 schemas: // var ajv = new Ajv({schemaId: 'auto'}); ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); ``` ## Contents - [Performance](#performance) - [Features](#features) - [Getting started](#getting-started) - [Frequently Asked Questions](https://github.com/ajv-validator/ajv/blob/master/FAQ.md) - [Using in browser](#using-in-browser) - [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) - [Command line interface](#command-line-interface) - Validation - [Keywords](#validation-keywords) - [Annotation keywords](#annotation-keywords) - [Formats](#formats) - [Combining schemas with $ref](#ref) - [$data reference](#data-reference) - NEW: [$merge and $patch keywords](#merge-and-patch-keywords) - [Defining custom keywords](#defining-custom-keywords) - [Asynchronous schema compilation](#asynchronous-schema-compilation) - [Asynchronous validation](#asynchronous-validation) - [Security considerations](#security-considerations) - [Security contact](#security-contact) - [Untrusted schemas](#untrusted-schemas) - [Circular references in objects](#circular-references-in-javascript-objects) - [Trusted schemas](#security-risks-of-trusted-schemas) - [ReDoS attack](#redos-attack) - Modifying data during validation - [Filtering data](#filtering-data) - [Assigning defaults](#assigning-defaults) - [Coercing data types](#coercing-data-types) - API - [Methods](#api) - [Options](#options) - [Validation errors](#validation-errors) - [Plugins](#plugins) - [Related packages](#related-packages) - [Some packages using Ajv](#some-packages-using-ajv) - [Tests, Contributing, Changes history](#tests) - [Support, Code of conduct, License](#open-source-software-support) ## Performance Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: - [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place - [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster - [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) - [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): [![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) ## Features - Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards: - all validation keywords (see [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md)) - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) - support of circular references between schemas - correct string lengths for strings with unicode pairs (can be turned off) - [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off) - [validates schemas against meta-schema](#api-validateschema) - supports [browsers](#using-in-browser) and Node.js 0.10-14.x - [asynchronous loading](#asynchronous-schema-compilation) of referenced schemas during compilation - "All errors" validation mode with [option allErrors](#options) - [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages - i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package - [filtering data](#filtering-data) from additional properties - [assigning defaults](#assigning-defaults) to missing properties and items - [coercing data](#coercing-data-types) to the types specified in `type` keywords - [custom keywords](#defining-custom-keywords) - draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` - draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). - keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - [$data reference](#data-reference) to use values from the validated data as values for the schema keywords - [asynchronous validation](#asynchronous-validation) of custom formats and keywords ## Install ``` npm install ajv ``` ## <a name="usage"></a>Getting started Try it in the Node.js REPL: https://tonicdev.com/npm/ajv The fastest validation call: ```javascript // Node.js require: var Ajv = require('ajv'); // or ESM/TypeScript import import Ajv from 'ajv'; var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} var validate = ajv.compile(schema); var valid = validate(data); if (!valid) console.log(validate.errors); ``` or with less code ```javascript // ... var valid = ajv.validate(schema, data); if (!valid) console.log(ajv.errors); // ... ``` or ```javascript // ... var valid = ajv.addSchema(schema, 'mySchema') .validate('mySchema', data); if (!valid) console.log(ajv.errorsText()); // ... ``` See [API](#api) and [Options](#options) for more details. Ajv compiles schemas to functions and caches them in all cases (using schema serialized with [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) or a custom function as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). __Please note__: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors) __Note for TypeScript users__: `ajv` provides its own TypeScript declarations out of the box, so you don't need to install the deprecated `@types/ajv` module. ## Using in browser You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle. If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)). Then you need to load Ajv in the browser: ```html <script src="ajv.min.js"></script> ``` This bundle can be used with different module systems; it creates global `Ajv` if no module system is found. The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). Ajv is tested with these browsers: [![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) __Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)). ### Ajv and Content Security Policies (CSP) If you're using Ajv to compile a schema (the typical use) in a browser document that is loaded with a Content Security Policy (CSP), that policy will require a `script-src` directive that includes the value `'unsafe-eval'`. :warning: NOTE, however, that `unsafe-eval` is NOT recommended in a secure CSP[[1]](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval), as it has the potential to open the document to cross-site scripting (XSS) attacks. In order to make use of Ajv without easing your CSP, you can [pre-compile a schema using the CLI](https://github.com/ajv-validator/ajv-cli#compile-schemas). This will transpile the schema JSON into a JavaScript file that exports a `validate` function that works simlarly to a schema compiled at runtime. Note that pre-compilation of schemas is performed using [ajv-pack](https://github.com/ajv-validator/ajv-pack) and there are [some limitations to the schema features it can compile](https://github.com/ajv-validator/ajv-pack#limitations). A successfully pre-compiled schema is equivalent to the same schema compiled at runtime. ## Command line interface CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports: - compiling JSON Schemas to test their validity - BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/ajv-validator/ajv-pack)) - migrate schemas to draft-07 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate)) - validating data file(s) against JSON Schema - testing expected validity of data against JSON Schema - referenced schemas - custom meta-schemas - files in JSON, JSON5, YAML, and JavaScript format - all Ajv options - reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format ## Validation keywords Ajv supports all validation keywords from draft-07 of JSON Schema standard: - [type](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#type) - [for numbers](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf - [for strings](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format - [for arrays](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#contains) - [for objects](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#propertynames) - [for all types](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#const) - [compound keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf, [if/then/else](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#ifthenelse) With [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON Schema standard: - [patternRequired](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match. - [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc. See [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md) for more details. ## Annotation keywords JSON Schema specification defines several annotation keywords that describe schema itself but do not perform any validation. - `title` and `description`: information about the data represented by that schema - `$comment` (NEW in draft-07): information for developers. With option `$comment` Ajv logs or passes the comment string to the user-supplied function. See [Options](#options). - `default`: a default value of the data instance, see [Assigning defaults](#assigning-defaults). - `examples` (NEW in draft-06): an array of data instances. Ajv does not check the validity of these instances against the schema. - `readOnly` and `writeOnly` (NEW in draft-07): marks data-instance as read-only or write-only in relation to the source of the data (database, api, etc.). - `contentEncoding`: [RFC 2045](https://tools.ietf.org/html/rfc2045#section-6.1 ), e.g., "base64". - `contentMediaType`: [RFC 2046](https://tools.ietf.org/html/rfc2046), e.g., "image/png". __Please note__: Ajv does not implement validation of the keywords `examples`, `contentEncoding` and `contentMediaType` but it reserves them. If you want to create a plugin that implements some of them, it should remove these keywords from the instance. ## Formats Ajv implements formats defined by JSON Schema specification and several other formats. It is recommended NOT to use "format" keyword implementations with untrusted data, as they use potentially unsafe regular expressions - see [ReDoS attack](#redos-attack). __Please note__: if you need to use "format" keyword to validate untrusted data, you MUST assess their suitability and safety for your validation scenarios. The following formats are implemented for string validation with "format" keyword: - _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). - _time_: time with optional time-zone. - _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). - _uri_: full URI. - _uri-reference_: URI reference, including full and relative URIs. - _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570) - _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url). - _email_: email address. - _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). - _ipv4_: IP address v4. - _ipv6_: IP address v6. - _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor. - _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122). - _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). - _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). __Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here. There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, and `email`. See [Options](#options) for details. You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details. You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js). ## <a name="ref"></a>Combining schemas with $ref You can structure your validation logic across multiple schema files and have schemas reference each other using `$ref` keyword. Example: ```javascript var schema = { "$id": "http://example.com/schemas/schema.json", "type": "object", "properties": { "foo": { "$ref": "defs.json#/definitions/int" }, "bar": { "$ref": "defs.json#/definitions/str" } } }; var defsSchema = { "$id": "http://example.com/schemas/defs.json", "definitions": { "int": { "type": "integer" }, "str": { "type": "string" } } }; ``` Now to compile your schema you can either pass all schemas to Ajv instance: ```javascript var ajv = new Ajv({schemas: [schema, defsSchema]}); var validate = ajv.getSchema('http://example.com/schemas/schema.json'); ``` or use `addSchema` method: ```javascript var ajv = new Ajv; var validate = ajv.addSchema(defsSchema) .compile(schema); ``` See [Options](#options) and [addSchema](#api) method. __Please note__: - `$ref` is resolved as the uri-reference using schema $id as the base URI (see the example). - References can be recursive (and mutually recursive) to implement the schemas for different data structures (such as linked lists, trees, graphs, etc.). - You don't have to host your schema files at the URIs that you use as schema $id. These URIs are only used to identify the schemas, and according to JSON Schema specification validators should not expect to be able to download the schemas from these URIs. - The actual location of the schema file in the file system is not used. - You can pass the identifier of the schema as the second parameter of `addSchema` method or as a property name in `schemas` option. This identifier can be used instead of (or in addition to) schema $id. - You cannot have the same $id (or the schema identifier) used for more than one schema - the exception will be thrown. - You can implement dynamic resolution of the referenced schemas using `compileAsync` method. In this way you can store schemas in any system (files, web, database, etc.) and reference them without explicitly adding to Ajv instance. See [Asynchronous schema compilation](#asynchronous-schema-compilation). ## $data reference With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema-org/json-schema-spec/issues/51) for more information about how it works. `$data` reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema). Examples. This schema requires that the value in property `smaller` is less or equal than the value in the property larger: ```javascript var ajv = new Ajv({$data: true}); var schema = { "properties": { "smaller": { "type": "number", "maximum": { "$data": "1/larger" } }, "larger": { "type": "number" } } }; var validData = { smaller: 5, larger: 7 }; ajv.validate(schema, validData); // true ``` This schema requires that the properties have the same format as their field names: ```javascript var schema = { "additionalProperties": { "type": "string", "format": { "$data": "0#" } } }; var validData = { 'date-time': '1963-06-19T08:30:06.283185Z', email: 'joe.bloggs@example.com' } ``` `$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `const` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails. ## $merge and $patch keywords With the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON Schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). To add keywords `$merge` and `$patch` to Ajv instance use this code: ```javascript require('ajv-merge-patch')(ajv); ``` Examples. Using `$merge`: ```json { "$merge": { "source": { "type": "object", "properties": { "p": { "type": "string" } }, "additionalProperties": false }, "with": { "properties": { "q": { "type": "number" } } } } } ``` Using `$patch`: ```json { "$patch": { "source": { "type": "object", "properties": { "p": { "type": "string" } }, "additionalProperties": false }, "with": [ { "op": "add", "path": "/properties/q", "value": { "type": "number" } } ] } } ``` The schemas above are equivalent to this schema: ```json { "type": "object", "properties": { "p": { "type": "string" }, "q": { "type": "number" } }, "additionalProperties": false } ``` The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. See the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) for more information. ## Defining custom keywords The advantages of using custom keywords are: - allow creating validation scenarios that cannot be expressed using JSON Schema - simplify your schemas - help bringing a bigger part of the validation logic to your schemas - make your schemas more expressive, less verbose and closer to your application domain - implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). The concerns you have to be aware of when extending JSON Schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. Ajv allows defining keywords with: - validation function - compilation function - macro function - inline compilation function that should return code (as string) that will be inlined in the currently compiled schema. Example. `range` and `exclusiveRange` keywords using compiled schema: ```javascript ajv.addKeyword('range', { type: 'number', compile: function (sch, parentSchema) { var min = sch[0]; var max = sch[1]; return parentSchema.exclusiveRange === true ? function (data) { return data > min && data < max; } : function (data) { return data >= min && data <= max; } } }); var schema = { "range": [2, 4], "exclusiveRange": true }; var validate = ajv.compile(schema); console.log(validate(2.01)); // true console.log(validate(3.99)); // true console.log(validate(2)); // false console.log(validate(4)); // false ``` Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. See [Defining custom keywords](https://github.com/ajv-validator/ajv/blob/master/CUSTOM.md) for more details. ## Asynchronous schema compilation During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` [method](#api-compileAsync) and `loadSchema` [option](#options). Example: ```javascript var ajv = new Ajv({ loadSchema: loadSchema }); ajv.compileAsync(schema).then(function (validate) { var valid = validate(data); // ... }); function loadSchema(uri) { return request.json(uri).then(function (res) { if (res.statusCode >= 400) throw new Error('Loading error: ' + res.statusCode); return res.body; }); } ``` __Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work. ## Asynchronous validation Example in Node.js REPL: https://tonicdev.com/esp/ajv-asynchronous-validation You can define custom formats and keywords that perform validation asynchronously by accessing database or some other service. You should add `async: true` in the keyword or format definition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)). If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation. __Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). Ajv compiles asynchronous schemas to [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent). Async functions are supported in Node.js 7+ and all modern browsers. You can also supply any other transpiler as a function via `processCode` option. See [Options](#options). The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas. Validation result will be a promise that resolves with validated data or rejects with an exception `Ajv.ValidationError` that contains the array of validation errors in `errors` property. Example: ```javascript var ajv = new Ajv; // require('ajv-async')(ajv); ajv.addKeyword('idExists', { async: true, type: 'number', validate: checkIdExists }); function checkIdExists(schema, data) { return knex(schema.table) .select('id') .where('id', data) .then(function (rows) { return !!rows.length; // true if record is found }); } var schema = { "$async": true, "properties": { "userId": { "type": "integer", "idExists": { "table": "users" } }, "postId": { "type": "integer", "idExists": { "table": "posts" } } } }; var validate = ajv.compile(schema); validate({ userId: 1, postId: 19 }) .then(function (data) { console.log('Data is valid', data); // { userId: 1, postId: 19 } }) .catch(function (err) { if (!(err instanceof Ajv.ValidationError)) throw err; // data is invalid console.log('Validation errors:', err.errors); }); ``` ### Using transpilers with asynchronous validation functions. [ajv-async](https://github.com/ajv-validator/ajv-async) uses [nodent](https://github.com/MatAtBread/nodent) to transpile async functions. To use another transpiler you should separately install it (or load its bundle in the browser). #### Using nodent ```javascript var ajv = new Ajv; require('ajv-async')(ajv); // in the browser if you want to load ajv-async bundle separately you can: // window.ajvAsync(ajv); var validate = ajv.compile(schema); // transpiled es7 async function validate(data).then(successFunc).catch(errorFunc); ``` #### Using other transpilers ```javascript var ajv = new Ajv({ processCode: transpileFunc }); var validate = ajv.compile(schema); // transpiled es7 async function validate(data).then(successFunc).catch(errorFunc); ``` See [Options](#options). ## Security considerations JSON Schema, if properly used, can replace data sanitisation. It doesn't replace other API security considerations. It also introduces additional security aspects to consider. ##### Security contact To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. ##### Untrusted schemas Ajv treats JSON schemas as trusted as your application code. This security model is based on the most common use case, when the schemas are static and bundled together with the application. If your schemas are received from untrusted sources (or generated from untrusted data) there are several scenarios you need to prevent: - compiling schemas can cause stack overflow (if they are too deep) - compiling schemas can be slow (e.g. [#557](https://github.com/ajv-validator/ajv/issues/557)) - validating certain data can be slow It is difficult to predict all the scenarios, but at the very least it may help to limit the size of untrusted schemas (e.g. limit JSON string length) and also the maximum schema object depth (that can be high for relatively small JSON strings). You also may want to mitigate slow regular expressions in `pattern` and `patternProperties` keywords. Regardless the measures you take, using untrusted schemas increases security risks. ##### Circular references in JavaScript objects Ajv does not support schemas and validated data that have circular references in objects. See [issue #802](https://github.com/ajv-validator/ajv/issues/802). An attempt to compile such schemas or validate such data would cause stack overflow (or will not complete in case of asynchronous validation). Depending on the parser you use, untrusted data can lead to circular references. ##### Security risks of trusted schemas Some keywords in JSON Schemas can lead to very slow validation for certain data. These keywords include (but may be not limited to): - `pattern` and `format` for large strings - in some cases using `maxLength` can help mitigate it, but certain regular expressions can lead to exponential validation time even with relatively short strings (see [ReDoS attack](#redos-attack)). - `patternProperties` for large property names - use `propertyNames` to mitigate, but some regular expressions can have exponential evaluation time as well. - `uniqueItems` for large non-scalar arrays - use `maxItems` to mitigate __Please note__: The suggestions above to prevent slow validation would only work if you do NOT use `allErrors: true` in production code (using it would continue validation after validation errors). You can validate your JSON schemas against [this meta-schema](https://github.com/ajv-validator/ajv/blob/master/lib/refs/json-schema-secure.json) to check that these recommendations are followed: ```javascript const isSchemaSecure = ajv.compile(require('ajv/lib/refs/json-schema-secure.json')); const schema1 = {format: 'email'}; isSchemaSecure(schema1); // false const schema2 = {format: 'email', maxLength: MAX_LENGTH}; isSchemaSecure(schema2); // true ``` __Please note__: following all these recommendation is not a guarantee that validation of untrusted data is safe - it can still lead to some undesirable results. ##### Content Security Policies (CSP) See [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) ## ReDoS attack Certain regular expressions can lead to the exponential evaluation time even with relatively short strings. Please assess the regular expressions you use in the schemas on their vulnerability to this attack - see [safe-regex](https://github.com/substack/safe-regex), for example. __Please note__: some formats that Ajv implements use [regular expressions](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js) that can be vulnerable to ReDoS attack, so if you use Ajv to validate data from untrusted sources __it is strongly recommended__ to consider the following: - making assessment of "format" implementations in Ajv. - using `format: 'fast'` option that simplifies some of the regular expressions (although it does not guarantee that they are safe). - replacing format implementations provided by Ajv with your own implementations of "format" keyword that either uses different regular expressions or another approach to format validation. Please see [addFormat](#api-addformat) method. - disabling format validation by ignoring "format" keyword with option `format: false` Whatever mitigation you choose, please assume all formats provided by Ajv as potentially unsafe and make your own assessment of their suitability for your validation scenarios. ## Filtering data With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation. This option modifies original data. Example: ```javascript var ajv = new Ajv({ removeAdditional: true }); var schema = { "additionalProperties": false, "properties": { "foo": { "type": "number" }, "bar": { "additionalProperties": { "type": "number" }, "properties": { "baz": { "type": "string" } } } } } var data = { "foo": 0, "additional1": 1, // will be removed; `additionalProperties` == false "bar": { "baz": "abc", "additional2": 2 // will NOT be removed; `additionalProperties` != false }, } var validate = ajv.compile(schema); console.log(validate(data)); // true console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 } ``` If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed. If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed). __Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example: ```json { "type": "object", "oneOf": [ { "properties": { "foo": { "type": "string" } }, "required": [ "foo" ], "additionalProperties": false }, { "properties": { "bar": { "type": "integer" } }, "required": [ "bar" ], "additionalProperties": false } ] } ``` The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties. With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). While this behaviour is unexpected (issues [#129](https://github.com/ajv-validator/ajv/issues/129), [#134](https://github.com/ajv-validator/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: ```json { "type": "object", "properties": { "foo": { "type": "string" }, "bar": { "type": "integer" } }, "additionalProperties": false, "oneOf": [ { "required": [ "foo" ] }, { "required": [ "bar" ] } ] } ``` The schema above is also more efficient - it will compile into a faster function. ## Assigning defaults With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults. This option modifies original data. __Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema. Example 1 (`default` in `properties`): ```javascript var ajv = new Ajv({ useDefaults: true }); var schema = { "type": "object", "properties": { "foo": { "type": "number" }, "bar": { "type": "string", "default": "baz" } }, "required": [ "foo", "bar" ] }; var data = { "foo": 1 }; var validate = ajv.compile(schema); console.log(validate(data)); // true console.log(data); // { "foo": 1, "bar": "baz" } ``` Example 2 (`default` in `items`): ```javascript var schema = { "type": "array", "items": [ { "type": "number" }, { "type": "string", "default": "foo" } ] } var data = [ 1 ]; var validate = ajv.compile(schema); console.log(validate(data)); // true console.log(data); // [ 1, "foo" ] ``` `default` keywords in other cases are ignored: - not in `properties` or `items` subschemas - in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/ajv-validator/ajv/issues/42)) - in `if` subschema of `switch` keyword - in schemas generated by custom macro keywords The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning). ## Coercing data types When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards. This option modifies original data. __Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value. Example 1: ```javascript var ajv = new Ajv({ coerceTypes: true }); var schema = { "type": "object", "properties": { "foo": { "type": "number" }, "bar": { "type": "boolean" } }, "required": [ "foo", "bar" ] }; var data = { "foo": "1", "bar": "false" }; var validate = ajv.compile(schema); console.log(validate(data)); // true console.log(data); // { "foo": 1, "bar": false } ``` Example 2 (array coercions): ```javascript var ajv = new Ajv({ coerceTypes: 'array' }); var schema = { "properties": { "foo": { "type": "array", "items": { "type": "number" } }, "bar": { "type": "boolean" } } }; var data = { "foo": "1", "bar": ["false"] }; var validate = ajv.compile(schema); console.log(validate(data)); // true console.log(data); // { "foo": [1], "bar": false } ``` The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). See [Coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md) for details. ## API ##### new Ajv(Object options) -&gt; Object Create Ajv instance. ##### .compile(Object schema) -&gt; Function&lt;Object data&gt; Generate validating function and cache the compiled schema for future use. Validating function returns a boolean value. This function has properties `errors` and `schema`. Errors encountered during the last validation are assigned to `errors` property (it is assigned `null` if there was no errors). `schema` property contains the reference to the original schema. The schema passed to this method will be validated against meta-schema unless `validateSchema` option is false. If schema is invalid, an error will be thrown. See [options](#options). ##### <a name="api-compileAsync"></a>.compileAsync(Object schema [, Boolean meta] [, Function callback]) -&gt; Promise Asynchronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. This function returns a Promise that resolves to a validation function. An optional callback passed to `compileAsync` will be called with 2 parameters: error (or null) and validating function. The returned promise will reject (and the callback will be called with an error) when: - missing schema can't be loaded (`loadSchema` returns a Promise that rejects). - a schema containing a missing reference is loaded, but the reference cannot be resolved. - schema (or some loaded/referenced schema) is invalid. The function compiles schema and loads the first missing schema (or meta-schema) until all missing schemas are loaded. You can asynchronously compile meta-schema by passing `true` as the second parameter. See example in [Asynchronous compilation](#asynchronous-schema-compilation). ##### .validate(Object schema|String key|String ref, data) -&gt; Boolean Validate data using passed schema (it will be compiled and cached). Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference. Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors). __Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later. If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation). ##### .addSchema(Array&lt;Object&gt;|Object schema [, String key]) -&gt; Ajv Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole. Array of schemas can be passed (schemas should have ids), the second parameter will be ignored. Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key. Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data. Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time. By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option. __Please note__: Ajv uses the [method chaining syntax](https://en.wikipedia.org/wiki/Method_chaining) for all methods with the prefix `add*` and `remove*`. This allows you to do nice things like the following. ```javascript var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri); ``` ##### .addMetaSchema(Array&lt;Object&gt;|Object schema [, String key]) -&gt; Ajv Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). There is no need to explicitly add draft-07 meta schema (http://json-schema.org/draft-07/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. ##### <a name="api-validateschema"></a>.validateSchema(Object schema) -&gt; Boolean Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON Schema standard. By default this method is called automatically when the schema is added, so you rarely need to use it directly. If schema doesn't have `$schema` property, it is validated against draft 6 meta-schema (option `meta` should not be false). If schema has `$schema` property, then the schema with this id (that should be previously added) is used to validate passed schema. Errors will be available at `ajv.errors`. ##### .getSchema(String key) -&gt; Function&lt;Object data&gt; Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). The returned validating function has `schema` property with the reference to the original schema. ##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) -&gt; Ajv Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. Schema can be removed using: - key passed to `addSchema` - it's full reference (id) - RegExp that should match schema id or key (meta-schemas won't be removed) - actual schema object that will be stable-stringified to remove schema from cache If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared. ##### <a name="api-addformat"></a>.addFormat(String name, String|RegExp|Function|Object format) -&gt; Ajv Add custom format to validate strings or numbers. It can also be used to replace pre-defined formats for Ajv instance. Strings are converted to RegExp. Function should return validation result as `true` or `false`. If object is passed it should have properties `validate`, `compare` and `async`: - _validate_: a string, RegExp or a function as described above. - _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. - _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. - _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/ajv-validator/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass. Custom formats can be also added via `formats` option. ##### <a name="api-addkeyword"></a>.addKeyword(String keyword, Object definition) -&gt; Ajv Add custom validation keyword to Ajv instance. Keyword should be different from all standard JSON Schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. Example Keywords: - `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. - `"example"`: valid, but not recommended as it could collide with future versions of JSON Schema etc. - `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword Keyword definition is an object with the following properties: - _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types. - _validate_: validating function - _compile_: compiling function - _macro_: macro function - _inline_: compiling function that returns code (as string) - _schema_: an optional `false` value used with "validate" keyword to not pass schema - _metaSchema_: an optional meta-schema for keyword schema - _dependencies_: an optional list of properties that must be present in the parent schema - it will be checked during schema compilation - _modifying_: `true` MUST be passed if keyword modifies data - _statements_: `true` can be passed in case inline keyword generates statements (as opposed to expression) - _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. - _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). - _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. - _errors_: an optional boolean or string `"full"` indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. _compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. __Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed. See [Defining custom keywords](#defining-custom-keywords) for more details. ##### .getKeyword(String keyword) -&gt; Object|Boolean Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown. ##### .removeKeyword(String keyword) -&gt; Ajv Removes custom or pre-defined keyword so you can redefine them. While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results. __Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again. ##### .errorsText([Array&lt;Object&gt; errors [, Object options]]) -&gt; String Returns the text with all errors in a String. Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default). ## Options Defaults: ```javascript { // validation and reporting options: $data: false, allErrors: false, verbose: false, $comment: false, // NEW in Ajv version 6.0 jsonPointers: false, uniqueItems: true, unicode: true, nullable: false, format: 'fast', formats: {}, unknownFormats: true, schemas: {}, logger: undefined, // referenced schema options: schemaId: '$id', missingRefs: true, extendRefs: 'ignore', // recommended 'fail' loadSchema: undefined, // function(uri: string): Promise {} // options to modify validated data: removeAdditional: false, useDefaults: false, coerceTypes: false, // strict mode options strictDefaults: false, strictKeywords: false, strictNumbers: false, // asynchronous validation options: transpile: undefined, // requires ajv-async package // advanced options: meta: true, validateSchema: true, addUsedSchema: true, inlineRefs: true, passContext: false, loopRequired: Infinity, ownProperties: false, multipleOfPrecision: false, errorDataPath: 'object', // deprecated messages: true, sourceCode: false, processCode: undefined, // function (str: string, schema: object): string {} cache: new Cache, serialize: undefined } ``` ##### Validation and reporting options - _$data_: support [$data references](#data-reference). Draft 6 meta-schema that is added by default will be extended to allow them. If you want to use another meta-schema you need to use $dataMetaSchema method to add support for $data reference. See [API](#api). - _allErrors_: check all rules collecting all errors. Default is to return after the first error. - _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). - _$comment_ (NEW in Ajv version 6.0): log or pass the value of `$comment` keyword to a function. Option values: - `false` (default): ignore $comment keyword. - `true`: log the keyword value to console. - function: pass the keyword value, its schema path and root schema to the specified function - _jsonPointers_: set `dataPath` property of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. - _uniqueItems_: validate `uniqueItems` keyword (true by default). - _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. - _nullable_: support keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). - _format_: formats validation mode. Option values: - `"fast"` (default) - simplified and fast validation (see [Formats](#formats) for details of which formats are available and affected by this option). - `"full"` - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. - `false` - ignore all format keywords. - _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. - _keywords_: an object with custom keywords. Keys and values will be passed to `addKeyword` method. - _unknownFormats_: handling of unknown formats. Option values: - `true` (default) - if an unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [$data reference](#data-reference) and it is unknown the validation will fail. - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail. - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON Schema specification. - _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object. - _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](#error-logging). Option values: - custom logger - it should have methods `log`, `warn` and `error`. If any of these methods is missing an exception will be thrown. - `false` - logging is disabled. ##### Referenced schema options - _schemaId_: this option defines which keywords are used as schema URI. Option value: - `"$id"` (default) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06/07), ignore `id` keyword (if it is present a warning will be logged). - `"id"` - only use `id` keyword as schema URI (as specified in JSON Schema draft-04), ignore `$id` keyword (if it is present a warning will be logged). - `"auto"` - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation. - _missingRefs_: handling of missing referenced schemas. Option values: - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). - `"ignore"` - to log error during compilation and always pass validation. - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked. - _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values: - `"ignore"` (default) - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation. - `"fail"` (recommended) - if other validation keywords are used together with `$ref` the exception will be thrown when the schema is compiled. This option is recommended to make sure schema has no keywords that are ignored, which can be confusing. - `true` - validate all keywords in the schemas with `$ref` (the default behaviour in versions before 5.0.0). - _loadSchema_: asynchronous function that will be used to load remote schemas when `compileAsync` [method](#api-compileAsync) is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept remote schema uri as a parameter and return a Promise that resolves to a schema. See example in [Asynchronous compilation](#asynchronous-schema-compilation). ##### Options to modify validated data - _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values: - `false` (default) - not to remove additional properties - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). - _useDefaults_: replace missing or undefined properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: - `false` (default) - do not use defaults - `true` - insert defaults by value (object literal is used). - `"empty"` - in addition to missing or undefined, use defaults for properties and items that are equal to `null` or `""` (an empty string). - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. - _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md). Option values: - `false` (default) - no type coercion. - `true` - coerce scalar data types. - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). ##### Strict mode options - _strictDefaults_: report ignored `default` keywords in schemas. Option values: - `false` (default) - ignored defaults are not reported - `true` - if an ignored default is present, throw an error - `"log"` - if an ignored default is present, log warning - _strictKeywords_: report unknown keywords in schemas. Option values: - `false` (default) - unknown keywords are not reported - `true` - if an unknown keyword is present, throw an error - `"log"` - if an unknown keyword is present, log warning - _strictNumbers_: validate numbers strictly, failing validation for NaN and Infinity. Option values: - `false` (default) - NaN or Infinity will pass validation for numeric types - `true` - NaN or Infinity will not pass validation for numeric types ##### Asynchronous validation options - _transpile_: Requires [ajv-async](https://github.com/ajv-validator/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: - `undefined` (default) - transpile with [nodent](https://github.com/MatAtBread/nodent) if async functions are not supported. - `true` - always transpile with nodent. - `false` - do not transpile; if async functions are not supported an exception will be thrown. ##### Advanced options - _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. - _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can be http://json-schema.org/draft-07/schema or absent (draft-07 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: - `true` (default) - if the validation fails, throw the exception. - `"log"` - if the validation fails, log error. - `false` - skip schema validation. - _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `$id` (or `id`) property that doesn't start with "#". If `$id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `$id` uniqueness check when these methods are used. This option does not affect `addSchema` method. - _inlineRefs_: Affects compilation of referenced schemas. Option values: - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions. - `false` - to not inline referenced schemas (they will be compiled as separate functions). - integer number - to limit the maximum number of keywords of the schema that will be inlined. - _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. - _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. - _ownProperties_: by default Ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. - _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/ajv-validator/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). - _errorDataPath_ (deprecated): set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. - _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n)). - _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). - _processCode_: an optional function to process generated code before it is passed to Function constructor. It can be used to either beautify (the validating function is generated without line-breaks) or to transpile code. Starting from version 5.0.0 this option replaced options: - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass a function calling `require('js-beautify').js_beautify` as `processCode: code => js_beautify(code)`. - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/ajv-validator/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information. - _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. - _serialize_: an optional function to serialize schema to cache key. Pass `false` to use schema itself as a key (e.g., if WeakMap used as a cache). By default [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used. ## Validation errors In case of validation failure, Ajv assigns the array of errors to `errors` property of validation function (or to `errors` property of Ajv instance when `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation), the returned promise is rejected with exception `Ajv.ValidationError` that has `errors` property. ### Error objects Each error is an object with the following properties: - _keyword_: validation keyword. - _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). - _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. - _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package). See below for parameters set by all keywords. - _message_: the standard error message (can be excluded with option `messages` set to false). - _schema_: the schema of the keyword (added with `verbose` option). - _parentSchema_: the schema containing the keyword (added with `verbose` option) - _data_: the data validated by the keyword (added with `verbose` option). __Please note__: `propertyNames` keyword schema validation errors have an additional property `propertyName`, `dataPath` points to the object. After schema validation for each property name, if it is invalid an additional error is added with the property `keyword` equal to `"propertyNames"`. ### Error parameters Properties of `params` object in errors depend on the keyword that failed validation. - `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword). - `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false). - `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords). - `dependencies` - properties: - `property` (dependent property), - `missingProperty` (required missing dependency - only the first one is reported currently) - `deps` (required dependencies, comma separated list as a string), - `depsCount` (the number of required dependencies). - `format` - property `format` (the schema of the keyword). - `maximum`, `minimum` - properties: - `limit` (number, the schema of the keyword), - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`), - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=") - `multipleOf` - property `multipleOf` (the schema of the keyword) - `pattern` - property `pattern` (the schema of the keyword) - `required` - property `missingProperty` (required property that is missing). - `propertyNames` - property `propertyName` (an invalid property name). - `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property). - `type` - property `type` (required type(s), a string, can be a comma-separated list) - `uniqueItems` - properties `i` and `j` (indices of duplicate items). - `const` - property `allowedValue` pointing to the value (the schema of the keyword). - `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). - `$ref` - property `ref` with the referenced schema URI. - `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes). - custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). ### Error logging Using the `logger` option when initiallizing Ajv will allow you to define custom logging. Here you can build upon the exisiting logging. The use of other logging packages is supported as long as the package or its associated wrapper exposes the required methods. If any of the required methods are missing an exception will be thrown. - **Required Methods**: `log`, `warn`, `error` ```javascript var otherLogger = new OtherLogger(); var ajv = new Ajv({ logger: { log: console.log.bind(console), warn: function warn() { otherLogger.logWarn.apply(otherLogger, arguments); }, error: function error() { otherLogger.logError.apply(otherLogger, arguments); console.error.apply(console, arguments); } } }); ``` ## Plugins Ajv can be extended with plugins that add custom keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: - it exports a function - this function accepts ajv instance as the first parameter and returns the same instance to allow chaining - this function can accept an optional configuration as the second parameter If you have published a useful plugin please submit a PR to add it to the next section. ## Related packages - [ajv-async](https://github.com/ajv-validator/ajv-async) - plugin to configure async validation mode - [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats - [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface - [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for custom error messages - [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages - [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas - [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.) - [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch - [ajv-pack](https://github.com/ajv-validator/ajv-pack) - produces a compact module exporting validation functions - [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't already included in ajv (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`). ## Some packages using Ajv - [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser - [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services - [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition - [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator - [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org - [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com - [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js - [table](https://github.com/gajus/table) - formats data into a string table - [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser - [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content - [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation - [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation - [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages - [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema - [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests - [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema - [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file - [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app - [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter - [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages - [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX ## Tests ``` npm install git submodule update --init npm test ``` ## Contributing All validation functions are generated using doT templates in [dot](https://github.com/ajv-validator/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. `npm run build` - compiles templates to [dotjs](https://github.com/ajv-validator/ajv/tree/master/lib/dotjs) folder. `npm run watch` - automatically compiles templates when files in dot folder change Please see [Contributing guidelines](https://github.com/ajv-validator/ajv/blob/master/CONTRIBUTING.md) ## Changes history See https://github.com/ajv-validator/ajv/releases __Please note__: [Changes in version 7.0.0-beta](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) [Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). ## Code of conduct Please review and follow the [Code of conduct](https://github.com/ajv-validator/ajv/blob/master/CODE_OF_CONDUCT.md). Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. ## Open-source software support Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. ## License [MIT](https://github.com/ajv-validator/ajv/blob/master/LICENSE) # fs-minipass Filesystem streams based on [minipass](http://npm.im/minipass). 4 classes are exported: - ReadStream - ReadStreamSync - WriteStream - WriteStreamSync When using `ReadStreamSync`, all of the data is made available immediately upon consuming the stream. Nothing is buffered in memory when the stream is constructed. If the stream is piped to a writer, then it will synchronously `read()` and emit data into the writer as fast as the writer can consume it. (That is, it will respect backpressure.) If you call `stream.read()` then it will read the entire file and return the contents. When using `WriteStreamSync`, every write is flushed to the file synchronously. If your writes all come in a single tick, then it'll write it all out in a single tick. It's as synchronous as you are. The async versions work much like their node builtin counterparts, with the exception of introducing significantly less Stream machinery overhead. ## USAGE It's just streams, you pipe them or read() them or write() to them. ```js const fsm = require('fs-minipass') const readStream = new fsm.ReadStream('file.txt') const writeStream = new fsm.WriteStream('output.txt') writeStream.write('some file header or whatever\n') readStream.pipe(writeStream) ``` ## ReadStream(path, options) Path string is required, but somewhat irrelevant if an open file descriptor is passed in as an option. Options: - `fd` Pass in a numeric file descriptor, if the file is already open. - `readSize` The size of reads to do, defaults to 16MB - `size` The size of the file, if known. Prevents zero-byte read() call at the end. - `autoClose` Set to `false` to prevent the file descriptor from being closed when the file is done being read. ## WriteStream(path, options) Path string is required, but somewhat irrelevant if an open file descriptor is passed in as an option. Options: - `fd` Pass in a numeric file descriptor, if the file is already open. - `mode` The mode to create the file with. Defaults to `0o666`. - `start` The position in the file to start reading. If not specified, then the file will start writing at position zero, and be truncated by default. - `autoClose` Set to `false` to prevent the file descriptor from being closed when the stream is ended. - `flags` Flags to use when opening the file. Irrelevant if `fd` is passed in, since file won't be opened in that case. Defaults to `'a'` if a `pos` is specified, or `'w'` otherwise. # is-core-module <sup>[![Version Badge][2]][1]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][5]][6] [![dev dependency status][7]][8] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][11]][1] Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version. ## Example ```js var isCore = require('is-core-module'); var assert = require('assert'); assert(isCore('fs')); assert(!isCore('butts')); ``` ## Tests Clone the repo, `npm install`, and run `npm test` [1]: https://npmjs.org/package/is-core-module [2]: https://versionbadg.es/inspect-js/is-core-module.svg [5]: https://david-dm.org/inspect-js/is-core-module.svg [6]: https://david-dm.org/inspect-js/is-core-module [7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg [8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies [11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/is-core-module.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg [downloads-url]: https://npm-stat.com/charts.html?package=is-core-module [codecov-image]: https://codecov.io/gh/inspect-js/is-core-module/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/is-core-module/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-core-module [actions-url]: https://github.com/inspect-js/is-core-module/actions # fast-deep-equal The fastest deep equal with ES6 Map, Set and Typed arrays support. [![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal) [![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal) [![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master) ## Install ```bash npm install fast-deep-equal ``` ## Features - ES5 compatible - works in node.js (8+) and browsers (IE9+) - checks equality of Date and RegExp objects by value. ES6 equal (`require('fast-deep-equal/es6')`) also supports: - Maps - Sets - Typed arrays ## Usage ```javascript var equal = require('fast-deep-equal'); console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true ``` To support ES6 Maps, Sets and Typed arrays equality use: ```javascript var equal = require('fast-deep-equal/es6'); console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true ``` To use with React (avoiding the traversal of React elements' _owner property that contains circular references and is not needed when comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)): ```javascript var equal = require('fast-deep-equal/react'); var equal = require('fast-deep-equal/es6/react'); ``` ## Performance benchmark Node.js v12.6.0: ``` fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled) fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled) fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled) nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled) shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled) underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled) lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled) deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled) deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled) ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled) util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled) assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled) The fastest is fast-deep-equal ``` To run benchmark (requires node.js 6+): ```bash npm run benchmark ``` __Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application. ## Enterprise support fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. ## Security contact To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. ## License [MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE) long.js ======= A Long class for representing a 64 bit two's-complement integer value derived from the [Closure Library](https://github.com/google/closure-library) for stand-alone use and extended with unsigned support. [![Build Status](https://travis-ci.org/dcodeIO/long.js.svg)](https://travis-ci.org/dcodeIO/long.js) Background ---------- As of [ECMA-262 5th Edition](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5), "all the positive and negative integers whose magnitude is no greater than 2<sup>53</sup> are representable in the Number type", which is "representing the doubleprecision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic". The [maximum safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) in JavaScript is 2<sup>53</sup>-1. Example: 2<sup>64</sup>-1 is 1844674407370955**1615** but in JavaScript it evaluates to 1844674407370955**2000**. Furthermore, bitwise operators in JavaScript "deal only with integers in the range −2<sup>31</sup> through 2<sup>31</sup>−1, inclusive, or in the range 0 through 2<sup>32</sup>−1, inclusive. These operators accept any value of the Number type but first convert each such value to one of 2<sup>32</sup> integer values." In some use cases, however, it is required to be able to reliably work with and perform bitwise operations on the full 64 bits. This is where long.js comes into play. Usage ----- The class is compatible with CommonJS and AMD loaders and is exposed globally as `Long` if neither is available. ```javascript var Long = require("long"); var longVal = new Long(0xFFFFFFFF, 0x7FFFFFFF); console.log(longVal.toString()); ... ``` API --- ### Constructor * new **Long**(low: `number`, high: `number`, unsigned?: `boolean`)<br /> Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. See the from* functions below for more convenient ways of constructing Longs. ### Fields * Long#**low**: `number`<br /> The low 32 bits as a signed value. * Long#**high**: `number`<br /> The high 32 bits as a signed value. * Long#**unsigned**: `boolean`<br /> Whether unsigned or not. ### Constants * Long.**ZERO**: `Long`<br /> Signed zero. * Long.**ONE**: `Long`<br /> Signed one. * Long.**NEG_ONE**: `Long`<br /> Signed negative one. * Long.**UZERO**: `Long`<br /> Unsigned zero. * Long.**UONE**: `Long`<br /> Unsigned one. * Long.**MAX_VALUE**: `Long`<br /> Maximum signed value. * Long.**MIN_VALUE**: `Long`<br /> Minimum signed value. * Long.**MAX_UNSIGNED_VALUE**: `Long`<br /> Maximum unsigned value. ### Utility * Long.**isLong**(obj: `*`): `boolean`<br /> Tests if the specified object is a Long. * Long.**fromBits**(lowBits: `number`, highBits: `number`, unsigned?: `boolean`): `Long`<br /> Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. * Long.**fromBytes**(bytes: `number[]`, unsigned?: `boolean`, le?: `boolean`): `Long`<br /> Creates a Long from its byte representation. * Long.**fromBytesLE**(bytes: `number[]`, unsigned?: `boolean`): `Long`<br /> Creates a Long from its little endian byte representation. * Long.**fromBytesBE**(bytes: `number[]`, unsigned?: `boolean`): `Long`<br /> Creates a Long from its big endian byte representation. * Long.**fromInt**(value: `number`, unsigned?: `boolean`): `Long`<br /> Returns a Long representing the given 32 bit integer value. * Long.**fromNumber**(value: `number`, unsigned?: `boolean`): `Long`<br /> Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. * Long.**fromString**(str: `string`, unsigned?: `boolean`, radix?: `number`)<br /> Long.**fromString**(str: `string`, radix: `number`)<br /> Returns a Long representation of the given string, written using the specified radix. * Long.**fromValue**(val: `*`, unsigned?: `boolean`): `Long`<br /> Converts the specified value to a Long using the appropriate from* function for its type. ### Methods * Long#**add**(addend: `Long | number | string`): `Long`<br /> Returns the sum of this and the specified Long. * Long#**and**(other: `Long | number | string`): `Long`<br /> Returns the bitwise AND of this Long and the specified. * Long#**compare**/**comp**(other: `Long | number | string`): `number`<br /> Compares this Long's value with the specified's. Returns `0` if they are the same, `1` if the this is greater and `-1` if the given one is greater. * Long#**divide**/**div**(divisor: `Long | number | string`): `Long`<br /> Returns this Long divided by the specified. * Long#**equals**/**eq**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value equals the specified's. * Long#**getHighBits**(): `number`<br /> Gets the high 32 bits as a signed integer. * Long#**getHighBitsUnsigned**(): `number`<br /> Gets the high 32 bits as an unsigned integer. * Long#**getLowBits**(): `number`<br /> Gets the low 32 bits as a signed integer. * Long#**getLowBitsUnsigned**(): `number`<br /> Gets the low 32 bits as an unsigned integer. * Long#**getNumBitsAbs**(): `number`<br /> Gets the number of bits needed to represent the absolute value of this Long. * Long#**greaterThan**/**gt**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value is greater than the specified's. * Long#**greaterThanOrEqual**/**gte**/**ge**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value is greater than or equal the specified's. * Long#**isEven**(): `boolean`<br /> Tests if this Long's value is even. * Long#**isNegative**(): `boolean`<br /> Tests if this Long's value is negative. * Long#**isOdd**(): `boolean`<br /> Tests if this Long's value is odd. * Long#**isPositive**(): `boolean`<br /> Tests if this Long's value is positive. * Long#**isZero**/**eqz**(): `boolean`<br /> Tests if this Long's value equals zero. * Long#**lessThan**/**lt**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value is less than the specified's. * Long#**lessThanOrEqual**/**lte**/**le**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value is less than or equal the specified's. * Long#**modulo**/**mod**/**rem**(divisor: `Long | number | string`): `Long`<br /> Returns this Long modulo the specified. * Long#**multiply**/**mul**(multiplier: `Long | number | string`): `Long`<br /> Returns the product of this and the specified Long. * Long#**negate**/**neg**(): `Long`<br /> Negates this Long's value. * Long#**not**(): `Long`<br /> Returns the bitwise NOT of this Long. * Long#**notEquals**/**neq**/**ne**(other: `Long | number | string`): `boolean`<br /> Tests if this Long's value differs from the specified's. * Long#**or**(other: `Long | number | string`): `Long`<br /> Returns the bitwise OR of this Long and the specified. * Long#**shiftLeft**/**shl**(numBits: `Long | number | string`): `Long`<br /> Returns this Long with bits shifted to the left by the given amount. * Long#**shiftRight**/**shr**(numBits: `Long | number | string`): `Long`<br /> Returns this Long with bits arithmetically shifted to the right by the given amount. * Long#**shiftRightUnsigned**/**shru**/**shr_u**(numBits: `Long | number | string`): `Long`<br /> Returns this Long with bits logically shifted to the right by the given amount. * Long#**subtract**/**sub**(subtrahend: `Long | number | string`): `Long`<br /> Returns the difference of this and the specified Long. * Long#**toBytes**(le?: `boolean`): `number[]`<br /> Converts this Long to its byte representation. * Long#**toBytesLE**(): `number[]`<br /> Converts this Long to its little endian byte representation. * Long#**toBytesBE**(): `number[]`<br /> Converts this Long to its big endian byte representation. * Long#**toInt**(): `number`<br /> Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. * Long#**toNumber**(): `number`<br /> Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). * Long#**toSigned**(): `Long`<br /> Converts this Long to signed. * Long#**toString**(radix?: `number`): `string`<br /> Converts the Long to a string written in the specified radix. * Long#**toUnsigned**(): `Long`<br /> Converts this Long to unsigned. * Long#**xor**(other: `Long | number | string`): `Long`<br /> Returns the bitwise XOR of this Long and the given one. Building -------- To build an UMD bundle to `dist/long.js`, run: ``` $> npm install $> npm run build ``` Running the [tests](./tests): ``` $> npm test ``` ## Timezone support In order to provide support for timezones, without relying on the JavaScript host or any other time-zone aware environment, this library makes use of teh IANA Timezone Database directly: https://www.iana.org/time-zones The database files are parsed by the scripts in this folder, which emit AssemblyScript code which is used to process the various rules at runtime. ### esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils) esutils ([esutils](http://github.com/estools/esutils)) is utility box for ECMAScript language tools. ### API ### ast #### ast.isExpression(node) Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section [11](https://es5.github.io/#x11). #### ast.isStatement(node) Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section [12](https://es5.github.io/#x12). #### ast.isIterationStatement(node) Returns true if `node` is an IterationStatement as defined in ECMA262 edition 5.1 section [12.6](https://es5.github.io/#x12.6). #### ast.isSourceElement(node) Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1 section [14](https://es5.github.io/#x14). #### ast.trailingStatement(node) Returns `Statement?` if `node` has trailing `Statement`. ```js if (cond) consequent; ``` When taking this `IfStatement`, returns `consequent;` statement. #### ast.isProblematicIfStatement(node) Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code. ```js { type: 'IfStatement', consequent: { type: 'WithStatement', body: { type: 'IfStatement', consequent: {type: 'EmptyStatement'} } }, alternate: {type: 'EmptyStatement'} } ``` The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`. ### code #### code.isDecimalDigit(code) Return true if provided code is decimal digit. #### code.isHexDigit(code) Return true if provided code is hexadecimal digit. #### code.isOctalDigit(code) Return true if provided code is octal digit. #### code.isWhiteSpace(code) Return true if provided code is white space. White space characters are formally defined in ECMA262. #### code.isLineTerminator(code) Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262. #### code.isIdentifierStart(code) Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262. #### code.isIdentifierPart(code) Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262. ### keyword #### keyword.isKeywordES5(id, strict) Returns `true` if provided identifier string is a Keyword or Future Reserved Word in ECMA262 edition 5.1. They are formally defined in ECMA262 sections [7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2), respectively. If the `strict` flag is truthy, this function additionally checks whether `id` is a Keyword or Future Reserved Word under strict mode. #### keyword.isKeywordES6(id, strict) Returns `true` if provided identifier string is a Keyword or Future Reserved Word in ECMA262 edition 6. They are formally defined in ECMA262 sections [11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and [11.6.2.2](http://ecma-international.org/ecma-262/6.0/#sec-future-reserved-words), respectively. If the `strict` flag is truthy, this function additionally checks whether `id` is a Keyword or Future Reserved Word under strict mode. #### keyword.isReservedWordES5(id, strict) Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1. They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1). If the `strict` flag is truthy, this function additionally checks whether `id` is a Reserved Word under strict mode. #### keyword.isReservedWordES6(id, strict) Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words). If the `strict` flag is truthy, this function additionally checks whether `id` is a Reserved Word under strict mode. #### keyword.isRestrictedWord(id) Returns `true` if provided identifier string is one of `eval` or `arguments`. They are restricted in strict mode code throughout ECMA262 edition 5.1 and in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors). #### keyword.isIdentifierNameES5(id) Return true if provided identifier string is an IdentifierName as specified in ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). #### keyword.isIdentifierNameES6(id) Return true if provided identifier string is an IdentifierName as specified in ECMA262 edition 6 section [11.6](http://ecma-international.org/ecma-262/6.0/#sec-names-and-keywords). #### keyword.isIdentifierES5(id, strict) Return true if provided identifier string is an Identifier as specified in ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict` flag is truthy, this function additionally checks whether `id` is an Identifier under strict mode. #### keyword.isIdentifierES6(id, strict) Return true if provided identifier string is an Identifier as specified in ECMA262 edition 6 section [12.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers). If the `strict` flag is truthy, this function additionally checks whether `id` is an Identifier under strict mode. ### License Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation) (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) Estraverse ([estraverse](http://github.com/estools/estraverse)) is [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) traversal functions from [esmangle project](http://github.com/estools/esmangle). ### Documentation You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). ### Example Usage The following code will output all variables declared at the root of a file. ```javascript estraverse.traverse(ast, { enter: function (node, parent) { if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') return estraverse.VisitorOption.Skip; }, leave: function (node, parent) { if (node.type == 'VariableDeclarator') console.log(node.id.name); } }); ``` We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. ```javascript estraverse.traverse(ast, { enter: function (node) { this.break(); } }); ``` And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. ```javascript result = estraverse.replace(tree, { enter: function (node) { // Replace it with replaced. if (node.type === 'Literal') return replaced; } }); ``` By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Extending the existing traversing rules. keys: { // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] TestExpression: ['argument'] } }); ``` By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Iterating the child **nodes** of unknown nodes. fallback: 'iteration' }); ``` When `visitor.fallback` is a function, we can determine which keys to visit on each node. ```javascript // This tree contains a user-defined `TestExpression` node. var tree = { type: 'TestExpression', // This 'argument' is the property containing the other **node**. argument: { type: 'Literal', value: 20 }, // This 'extended' is the property not containing the other **node**. extended: true }; estraverse.traverse(tree, { enter: function (node) { }, // Skip the `argument` property of each node fallback: function(node) { return Object.keys(node).filter(function(key) { return key !== 'argument'; }); } }); ``` ### License Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat)](https://travis-ci.org/jonschlinkert/isobject) Returns true if the value is an object and not an array or null. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install isobject --save ``` Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install isobject ``` Install with [bower](http://bower.io/) ```sh $ bower install isobject ``` ## Usage ```js var isObject = require('isobject'); ``` **True** All of the following return `true`: ```js isObject({}); isObject(Object.create({})); isObject(Object.create(Object.prototype)); isObject(Object.create(null)); isObject({}); isObject(new Foo); isObject(/foo/); ``` **False** All of the following return `false`: ```js isObject(); isObject(function () {}); isObject(1); isObject([]); isObject(undefined); isObject(null); ``` ## Related projects You might also be interested in these projects: [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep) * [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow) * [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object) * [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/isobject/issues/new). ## Building docs Generate readme and API documentation with [verb](https://github.com/verbose/verb): ```sh $ npm install verb && npm run docs ``` Or, if [verb](https://github.com/verbose/verb) is installed globally: ```sh $ verb ``` ## Running tests Install dev dependencies: ```sh $ npm install -d && npm test ``` ## Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT license](https://github.com/jonschlinkert/isobject/blob/master/LICENSE). *** _This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 25, 2016._ # levn [![Build Status](https://travis-ci.org/gkz/levn.png)](https://travis-ci.org/gkz/levn) <a name="levn" /> __Light ECMAScript (JavaScript) Value Notation__ Levn is a library which allows you to parse a string into a JavaScript value based on an expected type. It is meant for short amounts of human entered data (eg. config files, command line arguments). Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.4.1. __How is this different than JSON?__ levn is meant to be written by humans only, is (due to the previous point) much more concise, can be validated against supplied types, has regex and date literals, and can easily be extended with custom types. On the other hand, it is probably slower and thus less efficient at transporting large amounts of data, which is fine since this is not its purpose. npm install levn For updates on levn, [follow me on twitter](https://twitter.com/gkzahariev). ## Quick Examples ```js var parse = require('levn').parse; parse('Number', '2'); // 2 parse('String', '2'); // '2' parse('String', 'levn'); // 'levn' parse('String', 'a b'); // 'a b' parse('Boolean', 'true'); // true parse('Date', '#2011-11-11#'); // (Date object) parse('Date', '2011-11-11'); // (Date object) parse('RegExp', '/[a-z]/gi'); // /[a-z]/gi parse('RegExp', 're'); // /re/ parse('Int', '2'); // 2 parse('Number | String', 'str'); // 'str' parse('Number | String', '2'); // 2 parse('[Number]', '[1,2,3]'); // [1,2,3] parse('(String, Boolean)', '(hi, false)'); // ['hi', false] parse('{a: String, b: Number}', '{a: str, b: 2}'); // {a: 'str', b: 2} // at the top level, you can ommit surrounding delimiters parse('[Number]', '1,2,3'); // [1,2,3] parse('(String, Boolean)', 'hi, false'); // ['hi', false] parse('{a: String, b: Number}', 'a: str, b: 2'); // {a: 'str', b: 2} // wildcard - auto choose type parse('*', '[hi,(null,[42]),{k: true}]'); // ['hi', [null, [42]], {k: true}] ``` ## Usage `require('levn');` returns an object that exposes three properties. `VERSION` is the current version of the library as a string. `parse` and `parsedTypeParse` are functions. ```js // parse(type, input, options); parse('[Number]', '1,2,3'); // [1, 2, 3] // parsedTypeParse(parsedType, input, options); var parsedType = require('type-check').parseType('[Number]'); parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] ``` ### parse(type, input, options) `parse` casts the string `input` into a JavaScript value according to the specified `type` in the [type format](https://github.com/gkz/type-check#type-format) (and taking account the optional `options`) and returns the resulting JavaScript value. ##### arguments * type - `String` - the type written in the [type format](https://github.com/gkz/type-check#type-format) which to check against * input - `String` - the value written in the [levn format](#levn-format) * options - `Maybe Object` - an optional parameter specifying additional [options](#options) ##### returns `*` - the resulting JavaScript value ##### example ```js parse('[Number]', '1,2,3'); // [1, 2, 3] ``` ### parsedTypeParse(parsedType, input, options) `parsedTypeParse` casts the string `input` into a JavaScript value according to the specified `type` which has already been parsed (and taking account the optional `options`) and returns the resulting JavaScript value. You can parse a type using the [type-check](https://github.com/gkz/type-check) library's `parseType` function. ##### arguments * type - `Object` - the type in the parsed type format which to check against * input - `String` - the value written in the [levn format](#levn-format) * options - `Maybe Object` - an optional parameter specifying additional [options](#options) ##### returns `*` - the resulting JavaScript value ##### example ```js var parsedType = require('type-check').parseType('[Number]'); parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] ``` ## Levn Format Levn can use the type information you provide to choose the appropriate value to produce from the input. For the same input, it will choose a different output value depending on the type provided. For example, `parse('Number', '2')` will produce the number `2`, but `parse('String', '2')` will produce the string `"2"`. If you do not provide type information, and simply use `*`, levn will parse the input according the unambiguous "explicit" mode, which we will now detail - you can also set the `explicit` option to true manually in the [options](#options). * `"string"`, `'string'` are parsed as a String, eg. `"a msg"` is `"a msg"` * `#date#` is parsed as a Date, eg. `#2011-11-11#` is `new Date('2011-11-11')` * `/regexp/flags` is parsed as a RegExp, eg. `/re/gi` is `/re/gi` * `undefined`, `null`, `NaN`, `true`, and `false` are all their JavaScript equivalents * `[element1, element2, etc]` is an Array, and the casting procedure is recursively applied to each element. Eg. `[1,2,3]` is `[1,2,3]`. * `(element1, element2, etc)` is an tuple, and the casting procedure is recursively applied to each element. Eg. `(1, a)` is `(1, a)` (is `[1, 'a']`). * `{key1: val1, key2: val2, ...}` is an Object, and the casting procedure is recursively applied to each property. Eg. `{a: 1, b: 2}` is `{a: 1, b: 2}`. * Any test which does not fall under the above, and which does not contain special characters (`[``]``(``)``{``}``:``,`) is a string, eg. `$12- blah` is `"$12- blah"`. If you do provide type information, you can make your input more concise as the program already has some information about what it expects. Please see the [type format](https://github.com/gkz/type-check#type-format) section of [type-check](https://github.com/gkz/type-check) for more information about how to specify types. There are some rules about what levn can do with the information: * If a String is expected, and only a String, all characters of the input (including any special ones) will become part of the output. Eg. `[({})]` is `"[({})]"`, and `"hi"` is `'"hi"'`. * If a Date is expected, the surrounding `#` can be omitted from date literals. Eg. `2011-11-11` is `new Date('2011-11-11')`. * If a RegExp is expected, no flags need to be specified, and the regex is not using any of the special characters,the opening and closing `/` can be omitted - this will have the affect of setting the source of the regex to the input. Eg. `regex` is `/regex/`. * If an Array is expected, and it is the root node (at the top level), the opening `[` and closing `]` can be omitted. Eg. `1,2,3` is `[1,2,3]`. * If a tuple is expected, and it is the root node (at the top level), the opening `(` and closing `)` can be omitted. Eg. `1, a` is `(1, a)` (is `[1, 'a']`). * If an Object is expected, and it is the root node (at the top level), the opening `{` and closing `}` can be omitted. Eg `a: 1, b: 2` is `{a: 1, b: 2}`. If you list multiple types (eg. `Number | String`), it will first attempt to cast to the first type and then validate - if the validation fails it will move on to the next type and so forth, left to right. You must be careful as some types will succeed with any input, such as String. Thus put String at the end of your list. In non-explicit mode, Date and RegExp will succeed with a large variety of input - also be careful with these and list them near the end if not last in your list. Whitespace between special characters and elements is inconsequential. ## Options Options is an object. It is an optional parameter to the `parse` and `parsedTypeParse` functions. ### Explicit A `Boolean`. By default it is `false`. __Example:__ ```js parse('RegExp', 're', {explicit: false}); // /re/ parse('RegExp', 're', {explicit: true}); // Error: ... does not type check... parse('RegExp | String', 're', {explicit: true}); // 're' ``` `explicit` sets whether to be in explicit mode or not. Using `*` automatically activates explicit mode. For more information, read the [levn format](#levn-format) section. ### customTypes An `Object`. Empty `{}` by default. __Example:__ ```js var options = { customTypes: { Even: { typeOf: 'Number', validate: function (x) { return x % 2 === 0; }, cast: function (x) { return {type: 'Just', value: parseInt(x)}; } } } } parse('Even', '2', options); // 2 parse('Even', '3', options); // Error: Value: "3" does not type check... ``` __Another Example:__ ```js function Person(name, age){ this.name = name; this.age = age; } var options = { customTypes: { Person: { typeOf: 'Object', validate: function (x) { x instanceof Person; }, cast: function (value, options, typesCast) { var name, age; if ({}.toString.call(value).slice(8, -1) !== 'Object') { return {type: 'Nothing'}; } name = typesCast(value.name, [{type: 'String'}], options); age = typesCast(value.age, [{type: 'Numger'}], options); return {type: 'Just', value: new Person(name, age)}; } } } parse('Person', '{name: Laura, age: 25}', options); // Person {name: 'Laura', age: 25} ``` `customTypes` is an object whose keys are the name of the types, and whose values are an object with three properties, `typeOf`, `validate`, and `cast`. For more information about `typeOf` and `validate`, please see the [custom types](https://github.com/gkz/type-check#custom-types) section of type-check. `cast` is a function which receives three arguments, the value under question, options, and the typesCast function. In `cast`, attempt to cast the value into the specified type. If you are successful, return an object in the format `{type: 'Just', value: CAST-VALUE}`, if you know it won't work, return `{type: 'Nothing'}`. You can use the `typesCast` function to cast any child values. Remember to pass `options` to it. In your function you can also check for `options.explicit` and act accordingly. ## Technical About `levn` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [type-check](https://github.com/gkz/type-check) to both parse types and validate values. It also uses the [prelude.ls](http://preludels.com/) library. Railroad-diagram Generator ========================== This is a small js library for generating railroad diagrams (like what [JSON.org](http://json.org) uses) using SVG. Railroad diagrams are a way of visually representing a grammar in a form that is more readable than using regular expressions or BNF. I think (though I haven't given it a lot of thought yet) that if it's easy to write a context-free grammar for the language, the corresponding railroad diagram will be easy as well. There are several railroad-diagram generators out there, but none of them had the visual appeal I wanted. [Here's an example of how they look!](http://www.xanthir.com/etc/railroad-diagrams/example.html) And [here's an online generator for you to play with and get SVG code from!](http://www.xanthir.com/etc/railroad-diagrams/generator.html) The library now exists in a Python port as well! See the information further down. Details ------- To use the library, just include the js and css files, and then call the Diagram() function. Its arguments are the components of the diagram (Diagram is a special form of Sequence). An alternative to Diagram() is ComplexDiagram() which is used to describe a complex type diagram. Components are either leaves or containers. The leaves: * Terminal(text) or a bare string - represents literal text * NonTerminal(text) - represents an instruction or another production * Comment(text) - a comment * Skip() - an empty line The containers: * Sequence(children) - like simple concatenation in a regex * Choice(index, children) - like | in a regex. The index argument specifies which child is the "normal" choice and should go in the middle * Optional(child, skip) - like ? in a regex. A shorthand for `Choice(1, [Skip(), child])`. If the optional `skip` parameter has the value `"skip"`, it instead puts the Skip() in the straight-line path, for when the "normal" behavior is to omit the item. * OneOrMore(child, repeat) - like + in a regex. The 'repeat' argument is optional, and specifies something that must go between the repetitions. * ZeroOrMore(child, repeat, skip) - like * in a regex. A shorthand for `Optional(OneOrMore(child, repeat))`. The optional `skip` parameter is identical to Optional(). For convenience, each component can be called with or without `new`. If called without `new`, the container components become n-ary; that is, you can say either `new Sequence([A, B])` or just `Sequence(A,B)`. After constructing a Diagram, call `.format(...padding)` on it, specifying 0-4 padding values (just like CSS) for some additional "breathing space" around the diagram (the paddings default to 20px). The result can either be `.toString()`'d for the markup, or `.toSVG()`'d for an `<svg>` element, which can then be immediately inserted to the document. As a convenience, Diagram also has an `.addTo(element)` method, which immediately converts it to SVG and appends it to the referenced element with default paddings. `element` defaults to `document.body`. Options ------- There are a few options you can tweak, at the bottom of the file. Just tweak either until the diagram looks like what you want. You can also change the CSS file - feel free to tweak to your heart's content. Note, though, that if you change the text sizes in the CSS, you'll have to go adjust the metrics for the leaf nodes as well. * VERTICAL_SEPARATION - sets the minimum amount of vertical separation between two items. Note that the stroke width isn't counted when computing the separation; this shouldn't be relevant unless you have a very small separation or very large stroke width. * ARC_RADIUS - the radius of the arcs used in the branching containers like Choice. This has a relatively large effect on the size of non-trivial diagrams. Both tight and loose values look good, depending on what you're going for. * DIAGRAM_CLASS - the class set on the root `<svg>` element of each diagram, for use in the CSS stylesheet. * STROKE_ODD_PIXEL_LENGTH - the default stylesheet uses odd pixel lengths for 'stroke'. Due to rasterization artifacts, they look best when the item has been translated half a pixel in both directions. If you change the styling to use a stroke with even pixel lengths, you'll want to set this variable to `false`. * INTERNAL_ALIGNMENT - when some branches of a container are narrower than others, this determines how they're aligned in the extra space. Defaults to "center", but can be set to "left" or "right". Caveats ------- At this early stage, the generator is feature-complete and works as intended, but still has several TODOs: * The font-sizes are hard-coded right now, and the font handling in general is very dumb - I'm just guessing at some metrics that are probably "good enough" rather than measuring things properly. Python Port ----------- In addition to the canonical JS version, the library now exists as a Python library as well. Using it is basically identical. The config variables are globals in the file, and so may be adjusted either manually or via tweaking from inside your program. The main difference from the JS port is how you extract the string from the Diagram. You'll find a `writeSvg(writerFunc)` method on `Diagram`, which takes a callback of one argument and passes it the string form of the diagram. For example, it can be used like `Diagram(...).writeSvg(sys.stdout.write)` to write to stdout. **Note**: the callback will be called multiple times as it builds up the string, not just once with the whole thing. If you need it all at once, consider something like a `StringIO` as an easy way to collect it into a single string. License ------- This document and all associated files in the github project are licensed under [CC0](http://creativecommons.org/publicdomain/zero/1.0/) ![](http://i.creativecommons.org/p/zero/1.0/80x15.png). This means you can reuse, remix, or otherwise appropriate this project for your own use **without restriction**. (The actual legal meaning can be found at the above link.) Don't ask me for permission to use any part of this project, **just use it**. I would appreciate attribution, but that is not required by the license. # axios // helpers The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: - Browser polyfills - Managing cookies - Parsing HTTP headers # rechoir [![Build Status](https://secure.travis-ci.org/tkellen/js-rechoir.png)](http://travis-ci.org/tkellen/js-rechoir) > Require any supported file as a node module. [![NPM](https://nodei.co/npm/rechoir.png)](https://nodei.co/npm/rechoir/) ## What is it? This module, in conjunction with [interpret]-like objects can register any file type the npm ecosystem has a module loader for. This library is a dependency of [Liftoff]. ## API ### prepare(config, filepath, requireFrom) Look for a module loader associated with the provided file and attempt require it. If necessary, run any setup required to inject it into [require.extensions](http://nodejs.org/api/globals.html#globals_require_extensions). `config` An [interpret]-like configuration object. `filepath` A file whose type you'd like to register a module loader for. `requireFrom` An optional path to start searching for the module required to load the requested file. Defaults to the directory of `filepath`. If calling this method is successful (aka: it doesn't throw), you can now require files of the type you requested natively. An error with a `failures` property will be thrown if the module loader(s) configured for a given extension cannot be registered. If a loader is already registered, this will simply return `true`. **Note:** While rechoir will automatically load and register transpilers like `coffee-script`, you must provide a local installation. The transpilers are **not** bundled with this module. #### Usage ```js const config = require('interpret').extensions; const rechoir = require('rechoir'); rechoir.prepare(config, './test/fixtures/test.coffee'); rechoir.prepare(config, './test/fixtures/test.csv'); rechoir.prepare(config, './test/fixtures/test.toml'); console.log(require('./test/fixtures/test.coffee')); console.log(require('./test/fixtures/test.csv')); console.log(require('./test/fixtures/test.toml')); ``` [interpret]: http://github.com/tkellen/js-interpret [Liftoff]: http://github.com/tkellen/js-liftoff <img align="right" alt="Ajv logo" width="160" src="https://ajv.js.org/img/ajv.svg"> &nbsp; # Ajv JSON schema validator The fastest JSON validator for Node.js and browser. Supports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https://ajv.js.org/json-schema.html#draft-04) requires ajv-draft-04 package) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/). [![build](https://github.com/ajv-validator/ajv/workflows/build/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild) [![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) [![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) [![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) [![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-%2307b4b9)](https://simplex.chat/contact#/?v=1&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2Fap4lMFzfXF8Hzmh-Vz0WNxp_1jKiOa-h%23MCowBQYDK2VuAyEAcdefddRvDfI8iAuBpztm_J3qFucj8MDZoVs_2EcMTzU%3D) [![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) [![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) ## Ajv sponsors [<img src="https://ajv.js.org/img/mozilla.svg" width="45%" alt="Mozilla">](https://www.mozilla.org)<img src="https://ajv.js.org/img/gap.svg" width="9%">[<img src="https://ajv.js.org/img/reserved.svg" width="45%">](https://opencollective.com/ajv) [<img src="https://ajv.js.org/img/microsoft.png" width="31%" alt="Microsoft">](https://opensource.microsoft.com)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="31%">](https://opencollective.com/ajv)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="31%">](https://opencollective.com/ajv) [<img src="https://ajv.js.org/img/retool.svg" width="22.5%" alt="Retool">](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/tidelift.svg" width="22.5%" alt="Tidelift">](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/simplex.svg" width="22.5%" alt="SimpleX">](https://github.com/simplex-chat/simplex-chat)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="22.5%">](https://opencollective.com/ajv) ## Contributing More than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation. Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](https://ajv.js.org/components.html). ## Documentation All documentation is available on the [Ajv website](https://ajv.js.org). Some useful site links: - [Getting started](https://ajv.js.org/guide/getting-started.html) - [JSON Schema vs JSON Type Definition](https://ajv.js.org/guide/schema-language.html) - [API reference](https://ajv.js.org/api.html) - [Strict mode](https://ajv.js.org/strict-mode.html) - [Standalone validation code](https://ajv.js.org/standalone.html) - [Security considerations](https://ajv.js.org/security.html) - [Command line interface](https://ajv.js.org/packages/ajv-cli.html) - [Frequently Asked Questions](https://ajv.js.org/faq.html) ## <a name="sponsors"></a>Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. Please sponsor Ajv via: - [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) - [Ajv Open Collective️](https://opencollective.com/ajv) Thank you. #### Open Collective sponsors <a href="https://opencollective.com/ajv"><img src="https://opencollective.com/ajv/individuals.svg?width=890"></a> <a href="https://opencollective.com/ajv/organization/0/website"><img src="https://opencollective.com/ajv/organization/0/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/1/website"><img src="https://opencollective.com/ajv/organization/1/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/2/website"><img src="https://opencollective.com/ajv/organization/2/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/3/website"><img src="https://opencollective.com/ajv/organization/3/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/4/website"><img src="https://opencollective.com/ajv/organization/4/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/5/website"><img src="https://opencollective.com/ajv/organization/5/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/6/website"><img src="https://opencollective.com/ajv/organization/6/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/7/website"><img src="https://opencollective.com/ajv/organization/7/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/8/website"><img src="https://opencollective.com/ajv/organization/8/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/9/website"><img src="https://opencollective.com/ajv/organization/9/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/10/website"><img src="https://opencollective.com/ajv/organization/10/avatar.svg"></a> <a href="https://opencollective.com/ajv/organization/11/website"><img src="https://opencollective.com/ajv/organization/11/avatar.svg"></a> ## Performance Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: - [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place - [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster - [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) - [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): [![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus&#x2F;schemasafe|is-my-json-valid|djv|@cfworker&#x2F;json-schema|jsonschema&chd=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) ## Features - Ajv implements JSON Schema [draft-06/07/2019-09/2020-12](http://json-schema.org/) standards (draft-04 is supported in v6): - all validation keywords (see [JSON Schema validation keywords](https://ajv.js.org/json-schema.html)) - [OpenAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) extensions: - NEW: keyword [discriminator](https://ajv.js.org/json-schema.html#discriminator). - keyword [nullable](https://ajv.js.org/json-schema.html#nullable). - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available) - support of recursive references between schemas - correct string lengths for strings with unicode pairs - JSON Schema [formats](https://ajv.js.org/guide/formats.html) (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin). - [validates schemas against meta-schema](https://ajv.js.org/api.html#api-validateschema) - NEW: supports [JSON Type Definition](https://datatracker.ietf.org/doc/rfc8927/): - all keywords (see [JSON Type Definition schema forms](https://ajv.js.org/json-type-definition.html)) - meta-schema for JTD schemas - "union" keyword and user-defined keywords (can be used inside "metadata" member of the schema) - supports [browsers](https://ajv.js.org/guide/environments.html#browsers) and Node.js 10.x - current - [asynchronous loading](https://ajv.js.org/guide/managing-schemas.html#asynchronous-schema-loading) of referenced schemas during compilation - "All errors" validation mode with [option allErrors](https://ajv.js.org/options.html#allerrors) - [error messages with parameters](https://ajv.js.org/api.html#validation-errors) describing error reasons to allow error message generation - i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package - [removing-additional-properties](https://ajv.js.org/guide/modifying-data.html#removing-additional-properties) - [assigning defaults](https://ajv.js.org/guide/modifying-data.html#assigning-defaults) to missing properties and items - [coercing data](https://ajv.js.org/guide/modifying-data.html#coercing-data-types) to the types specified in `type` keywords - [user-defined keywords](https://ajv.js.org/guide/user-keywords.html) - additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - [\$data reference](https://ajv.js.org/guide/combining-schemas.html#data-reference) to use values from the validated data as values for the schema keywords - [asynchronous validation](https://ajv.js.org/guide/async-validation.html) of user-defined formats and keywords ## Install To install version 8: ``` npm install ajv ``` ## <a name="usage"></a>Getting started Try it in the Node.js REPL: https://runkit.com/npm/ajv In JavaScript: ```javascript // or ESM/TypeScript import import Ajv from "ajv" // Node.js require: const Ajv = require("ajv") const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} const schema = { type: "object", properties: { foo: {type: "integer"}, bar: {type: "string"} }, required: ["foo"], additionalProperties: false, } const data = { foo: 1, bar: "abc" } const validate = ajv.compile(schema) const valid = validate(data) if (!valid) console.log(validate.errors) ``` Learn how to use Ajv and see more examples in the [Guide: getting started](https://ajv.js.org/guide/getting-started.html) ## Changes history See [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases) **Please note**: [Changes in version 8.0.0](https://github.com/ajv-validator/ajv/releases/tag/v8.0.0) [Version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) [Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). ## Code of conduct Please review and follow the [Code of conduct](./CODE_OF_CONDUCT.md). Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. ## Security contact To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. ## Open-source software support Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. ## License [MIT](./LICENSE) ![](cow.png) Moo! ==== Moo is a highly-optimised tokenizer/lexer generator. Use it to tokenize your strings, before parsing 'em with a parser like [nearley](https://github.com/hardmath123/nearley) or whatever else you're into. * [Fast](#is-it-fast) * [Convenient](#usage) * uses [Regular Expressions](#on-regular-expressions) * tracks [Line Numbers](#line-numbers) * handles [Keywords](#keywords) * supports [States](#states) * custom [Errors](#errors) * is even [Iterable](#iteration) * has no dependencies * 4KB minified + gzipped * Moo! Is it fast? ----------- Yup! Flying-cows-and-singed-steak fast. Moo is the fastest JS tokenizer around. It's **~2–10x** faster than most other tokenizers; it's a **couple orders of magnitude** faster than some of the slower ones. Define your tokens **using regular expressions**. Moo will compile 'em down to a **single RegExp for performance**. It uses the new ES6 **sticky flag** where possible to make things faster; otherwise it falls back to an almost-as-efficient workaround. (For more than you ever wanted to know about this, read [adventures in the land of substrings and RegExps](http://mrale.ph/blog/2016/11/23/making-less-dart-faster.html).) You _might_ be able to go faster still by writing your lexer by hand rather than using RegExps, but that's icky. Oh, and it [avoids parsing RegExps by itself](https://hackernoon.com/the-madness-of-parsing-real-world-javascript-regexps-d9ee336df983#.2l8qu3l76). Because that would be horrible. Usage ----- First, you need to do the needful: `$ npm install moo`, or whatever will ship this code to your computer. Alternatively, grab the `moo.js` file by itself and slap it into your web page via a `<script>` tag; moo is completely standalone. Then you can start roasting your very own lexer/tokenizer: ```js const moo = require('moo') let lexer = moo.compile({ WS: /[ \t]+/, comment: /\/\/.*?$/, number: /0|[1-9][0-9]*/, string: /"(?:\\["\\]|[^\n"\\])*"/, lparen: '(', rparen: ')', keyword: ['while', 'if', 'else', 'moo', 'cows'], NL: { match: /\n/, lineBreaks: true }, }) ``` And now throw some text at it: ```js lexer.reset('while (10) cows\nmoo') lexer.next() // -> { type: 'keyword', value: 'while' } lexer.next() // -> { type: 'WS', value: ' ' } lexer.next() // -> { type: 'lparen', value: '(' } lexer.next() // -> { type: 'number', value: '10' } // ... ``` When you reach the end of Moo's internal buffer, next() will return `undefined`. You can always `reset()` it and feed it more data when that happens. On Regular Expressions ---------------------- RegExps are nifty for making tokenizers, but they can be a bit of a pain. Here are some things to be aware of: * You often want to use **non-greedy quantifiers**: e.g. `*?` instead of `*`. Otherwise your tokens will be longer than you expect: ```js let lexer = moo.compile({ string: /".*"/, // greedy quantifier * // ... }) lexer.reset('"foo" "bar"') lexer.next() // -> { type: 'string', value: 'foo" "bar' } ``` Better: ```js let lexer = moo.compile({ string: /".*?"/, // non-greedy quantifier *? // ... }) lexer.reset('"foo" "bar"') lexer.next() // -> { type: 'string', value: 'foo' } lexer.next() // -> { type: 'space', value: ' ' } lexer.next() // -> { type: 'string', value: 'bar' } ``` * The **order of your rules** matters. Earlier ones will take precedence. ```js moo.compile({ identifier: /[a-z0-9]+/, number: /[0-9]+/, }).reset('42').next() // -> { type: 'identifier', value: '42' } moo.compile({ number: /[0-9]+/, identifier: /[a-z0-9]+/, }).reset('42').next() // -> { type: 'number', value: '42' } ``` * Moo uses **multiline RegExps**. This has a few quirks: for example, the **dot `/./` doesn't include newlines**. Use `[^]` instead if you want to match newlines too. * Since an excluding character ranges like `/[^ ]/` (which matches anything but a space) _will_ include newlines, you have to be careful not to include them by accident! In particular, the whitespace metacharacter `\s` includes newlines. Line Numbers ------------ Moo tracks detailed information about the input for you. It will track line numbers, as long as you **apply the `lineBreaks: true` option to any rules which might contain newlines**. Moo will try to warn you if you forget to do this. Note that this is `false` by default, for performance reasons: counting the number of lines in a matched token has a small cost. For optimal performance, only match newlines inside a dedicated token: ```js newline: {match: '\n', lineBreaks: true}, ``` ### Token Info ### Token objects (returned from `next()`) have the following attributes: * **`type`**: the name of the group, as passed to compile. * **`text`**: the string that was matched. * **`value`**: the string that was matched, transformed by your `value` function (if any). * **`offset`**: the number of bytes from the start of the buffer where the match starts. * **`lineBreaks`**: the number of line breaks found in the match. (Always zero if this rule has `lineBreaks: false`.) * **`line`**: the line number of the beginning of the match, starting from 1. * **`col`**: the column where the match begins, starting from 1. ### Value vs. Text ### The `value` is the same as the `text`, unless you provide a [value transform](#transform). ```js const moo = require('moo') const lexer = moo.compile({ ws: /[ \t]+/, string: {match: /"(?:\\["\\]|[^\n"\\])*"/, value: s => s.slice(1, -1)}, }) lexer.reset('"test"') lexer.next() /* { value: 'test', text: '"test"', ... } */ ``` ### Reset ### Calling `reset()` on your lexer will empty its internal buffer, and set the line, column, and offset counts back to their initial value. If you don't want this, you can `save()` the state, and later pass it as the second argument to `reset()` to explicitly control the internal state of the lexer. ```js    lexer.reset('some line\n') let info = lexer.save() // -> { line: 10 } lexer.next() // -> { line: 10 } lexer.next() // -> { line: 11 } // ... lexer.reset('a different line\n', info) lexer.next() // -> { line: 10 } ``` Keywords -------- Moo makes it convenient to define literals. ```js moo.compile({ lparen: '(', rparen: ')', keyword: ['while', 'if', 'else', 'moo', 'cows'], }) ``` It'll automatically compile them into regular expressions, escaping them where necessary. **Keywords** should be written using the `keywords` transform. ```js moo.compile({ IDEN: {match: /[a-zA-Z]+/, type: moo.keywords({ KW: ['while', 'if', 'else', 'moo', 'cows'], })}, SPACE: {match: /\s+/, lineBreaks: true}, }) ``` ### Why? ### You need to do this to ensure the **longest match** principle applies, even in edge cases. Imagine trying to parse the input `className` with the following rules: ```js keyword: ['class'], identifier: /[a-zA-Z]+/, ``` You'll get _two_ tokens — `['class', 'Name']` -- which is _not_ what you want! If you swap the order of the rules, you'll fix this example; but now you'll lex `class` wrong (as an `identifier`). The keywords helper checks matches against the list of keywords; if any of them match, it uses the type `'keyword'` instead of `'identifier'` (for this example). ### Keyword Types ### Keywords can also have **individual types**. ```js let lexer = moo.compile({ name: {match: /[a-zA-Z]+/, type: moo.keywords({ 'kw-class': 'class', 'kw-def': 'def', 'kw-if': 'if', })}, // ... }) lexer.reset('def foo') lexer.next() // -> { type: 'kw-def', value: 'def' } lexer.next() // space lexer.next() // -> { type: 'name', value: 'foo' } ``` You can use [itt](https://github.com/nathan/itt)'s iterator adapters to make constructing keyword objects easier: ```js itt(['class', 'def', 'if']) .map(k => ['kw-' + k, k]) .toObject() ``` States ------ Moo allows you to define multiple lexer **states**. Each state defines its own separate set of token rules. Your lexer will start off in the first state given to `moo.states({})`. Rules can be annotated with `next`, `push`, and `pop`, to change the current state after that token is matched. A "stack" of past states is kept, which is used by `push` and `pop`. * **`next: 'bar'`** moves to the state named `bar`. (The stack is not changed.) * **`push: 'bar'`** moves to the state named `bar`, and pushes the old state onto the stack. * **`pop: 1`** removes one state from the top of the stack, and moves to that state. (Only `1` is supported.) Only rules from the current state can be matched. You need to copy your rule into all the states you want it to be matched in. For example, to tokenize JS-style string interpolation such as `a${{c: d}}e`, you might use: ```js let lexer = moo.states({ main: { strstart: {match: '`', push: 'lit'}, ident: /\w+/, lbrace: {match: '{', push: 'main'}, rbrace: {match: '}', pop: true}, colon: ':', space: {match: /\s+/, lineBreaks: true}, }, lit: { interp: {match: '${', push: 'main'}, escape: /\\./, strend: {match: '`', pop: true}, const: {match: /(?:[^$`]|\$(?!\{))+/, lineBreaks: true}, }, }) // <= `a${{c: d}}e` // => strstart const interp lbrace ident colon space ident rbrace rbrace const strend ``` The `rbrace` rule is annotated with `pop`, so it moves from the `main` state into either `lit` or `main`, depending on the stack. Errors ------ If none of your rules match, Moo will throw an Error; since it doesn't know what else to do. If you prefer, you can have moo return an error token instead of throwing an exception. The error token will contain the whole of the rest of the buffer. ```js moo.compile({ // ... myError: moo.error, }) moo.reset('invalid') moo.next() // -> { type: 'myError', value: 'invalid', text: 'invalid', offset: 0, lineBreaks: 0, line: 1, col: 1 } moo.next() // -> undefined ``` You can have a token type that both matches tokens _and_ contains error values. ```js moo.compile({ // ... myError: {match: /[\$?`]/, error: true}, }) ``` ### Formatting errors ### If you want to throw an error from your parser, you might find `formatError` helpful. Call it with the offending token: ```js throw new Error(lexer.formatError(token, "invalid syntax")) ``` It returns a string with a pretty error message. ``` Error: invalid syntax at line 2 col 15: totally valid `syntax` ^ ``` Iteration --------- Iterators: we got 'em. ```js for (let here of lexer) { // here = { type: 'number', value: '123', ... } } ``` Create an array of tokens. ```js let tokens = Array.from(lexer); ``` Use [itt](https://github.com/nathan/itt)'s iteration tools with Moo. ```js for (let [here, next] = itt(lexer).lookahead()) { // pass a number if you need more tokens // enjoy! } ``` Transform --------- Moo doesn't allow capturing groups, but you can supply a transform function, `value()`, which will be called on the value before storing it in the Token object. ```js moo.compile({ STRING: [ {match: /"""[^]*?"""/, lineBreaks: true, value: x => x.slice(3, -3)}, {match: /"(?:\\["\\rn]|[^"\\])*?"/, lineBreaks: true, value: x => x.slice(1, -1)}, {match: /'(?:\\['\\rn]|[^'\\])*?'/, lineBreaks: true, value: x => x.slice(1, -1)}, ], // ... }) ``` Contributing ------------ Do check the [FAQ](https://github.com/tjvr/moo/issues?q=label%3Aquestion). Before submitting an issue, [remember...](https://github.com/tjvr/moo/blob/master/.github/CONTRIBUTING.md) # yargs-parser ![ci](https://github.com/yargs/yargs-parser/workflows/ci/badge.svg) [![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) ![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/yargs-parser) The mighty option parser used by [yargs](https://github.com/yargs/yargs). visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. <img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/main/yargs-logo.png"> ## Example ```sh npm i yargs-parser --save ``` ```js const argv = require('yargs-parser')(process.argv.slice(2)) console.log(argv) ``` ```console $ node example.js --foo=33 --bar hello { _: [], foo: 33, bar: 'hello' } ``` _or parse a string!_ ```js const argv = require('yargs-parser')('--foo=99 --bar=33') console.log(argv) ``` ```console { _: [], foo: 99, bar: 33 } ``` Convert an array of mixed types before passing to `yargs-parser`: ```js const parse = require('yargs-parser') parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings ``` ## Deno Example As of `v19` `yargs-parser` supports [Deno](https://github.com/denoland/deno): ```typescript import parser from "https://deno.land/x/yargs_parser/deno.ts"; const argv = parser('--foo=99 --bar=9987930', { string: ['bar'] }) console.log(argv) ``` ## ESM Example As of `v19` `yargs-parser` supports ESM (_both in Node.js and in the browser_): **Node.js:** ```js import parser from 'yargs-parser' const argv = parser('--foo=99 --bar=9987930', { string: ['bar'] }) console.log(argv) ``` **Browsers:** ```html <!doctype html> <body> <script type="module"> import parser from "https://unpkg.com/yargs-parser@19.0.0/browser.js"; const argv = parser('--foo=99 --bar=9987930', { string: ['bar'] }) console.log(argv) </script> </body> ``` ## API ### parser(args, opts={}) Parses command line arguments returning a simple mapping of keys and values. **expects:** * `args`: a string or array of strings representing the options to parse. * `opts`: provide a set of hints indicating how `args` should be parsed: * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.<br> Indicate that keys should be parsed as an array and coerced to booleans / numbers:<br> `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided (or throws an error). For arrays the function is called only once for the entire array:<br> `{coerce: {foo: function (arg) {return modifiedArg}}}`. * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:<br> `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. * `opts.normalize`: `path.normalize()` will be applied to values set to this key. * `opts.number`: keys should be treated as numbers. * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). **returns:** * `obj`: an object representing the parsed value of `args` * `key/value`: key value pairs for each argument and their aliases. * `_`: an array representing the positional arguments. * [optional] `--`: an array with arguments after the end-of-options flag `--`. ### require('yargs-parser').detailed(args, opts={}) Parses a command line string, returning detailed information required by the yargs engine. **expects:** * `args`: a string or array of strings representing options to parse. * `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. **returns:** * `argv`: an object representing the parsed value of `args` * `key/value`: key value pairs for each argument and their aliases. * `_`: an array representing the positional arguments. * [optional] `--`: an array with arguments after the end-of-options flag `--`. * `error`: populated with an error object if an exception occurred during parsing. * `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. * `newAliases`: any new aliases added via camel-case expansion: * `boolean`: `{ fooBar: true }` * `defaulted`: any new argument created by `opts.default`, no aliases included. * `boolean`: `{ foo: true }` * `configuration`: given by default settings and `opts.configuration`. <a name="configuration"></a> ### Configuration The yargs-parser applies several automated transformations on the keys provided in `args`. These features can be turned on and off using the `configuration` field of `opts`. ```js var parsed = parser(['--no-dice'], { configuration: { 'boolean-negation': false } }) ``` ### short option groups * default: `true`. * key: `short-option-groups`. Should a group of short-options be treated as boolean flags? ```console $ node example.js -abc { _: [], a: true, b: true, c: true } ``` _if disabled:_ ```console $ node example.js -abc { _: [], abc: true } ``` ### camel-case expansion * default: `true`. * key: `camel-case-expansion`. Should hyphenated arguments be expanded into camel-case aliases? ```console $ node example.js --foo-bar { _: [], 'foo-bar': true, fooBar: true } ``` _if disabled:_ ```console $ node example.js --foo-bar { _: [], 'foo-bar': true } ``` ### dot-notation * default: `true` * key: `dot-notation` Should keys that contain `.` be treated as objects? ```console $ node example.js --foo.bar { _: [], foo: { bar: true } } ``` _if disabled:_ ```console $ node example.js --foo.bar { _: [], "foo.bar": true } ``` ### parse numbers * default: `true` * key: `parse-numbers` Should keys that look like numbers be treated as such? ```console $ node example.js --foo=99.3 { _: [], foo: 99.3 } ``` _if disabled:_ ```console $ node example.js --foo=99.3 { _: [], foo: "99.3" } ``` ### parse positional numbers * default: `true` * key: `parse-positional-numbers` Should positional keys that look like numbers be treated as such. ```console $ node example.js 99.3 { _: [99.3] } ``` _if disabled:_ ```console $ node example.js 99.3 { _: ['99.3'] } ``` ### boolean negation * default: `true` * key: `boolean-negation` Should variables prefixed with `--no` be treated as negations? ```console $ node example.js --no-foo { _: [], foo: false } ``` _if disabled:_ ```console $ node example.js --no-foo { _: [], "no-foo": true } ``` ### combine arrays * default: `false` * key: `combine-arrays` Should arrays be combined when provided by both command line arguments and a configuration file. ### duplicate arguments array * default: `true` * key: `duplicate-arguments-array` Should arguments be coerced into an array when duplicated: ```console $ node example.js -x 1 -x 2 { _: [], x: [1, 2] } ``` _if disabled:_ ```console $ node example.js -x 1 -x 2 { _: [], x: 2 } ``` ### flatten duplicate arrays * default: `true` * key: `flatten-duplicate-arrays` Should array arguments be coerced into a single array when duplicated: ```console $ node example.js -x 1 2 -x 3 4 { _: [], x: [1, 2, 3, 4] } ``` _if disabled:_ ```console $ node example.js -x 1 2 -x 3 4 { _: [], x: [[1, 2], [3, 4]] } ``` ### greedy arrays * default: `true` * key: `greedy-arrays` Should arrays consume more than one positional argument following their flag. ```console $ node example --arr 1 2 { _: [], arr: [1, 2] } ``` _if disabled:_ ```console $ node example --arr 1 2 { _: [2], arr: [1] } ``` **Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** ### nargs eats options * default: `false` * key: `nargs-eats-options` Should nargs consume dash options as well as positional arguments. ### negation prefix * default: `no-` * key: `negation-prefix` The prefix to use for negated boolean variables. ```console $ node example.js --no-foo { _: [], foo: false } ``` _if set to `quux`:_ ```console $ node example.js --quuxfoo { _: [], foo: false } ``` ### populate -- * default: `false`. * key: `populate--` Should unparsed flags be stored in `--` or `_`. _If disabled:_ ```console $ node example.js a -b -- x y { _: [ 'a', 'x', 'y' ], b: true } ``` _If enabled:_ ```console $ node example.js a -b -- x y { _: [ 'a' ], '--': [ 'x', 'y' ], b: true } ``` ### set placeholder key * default: `false`. * key: `set-placeholder-key`. Should a placeholder be added for keys not set via the corresponding CLI argument? _If disabled:_ ```console $ node example.js -a 1 -c 2 { _: [], a: 1, c: 2 } ``` _If enabled:_ ```console $ node example.js -a 1 -c 2 { _: [], a: 1, b: undefined, c: 2 } ``` ### halt at non-option * default: `false`. * key: `halt-at-non-option`. Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. _If disabled:_ ```console $ node example.js -a run b -x y { _: [ 'b' ], a: 'run', x: 'y' } ``` _If enabled:_ ```console $ node example.js -a run b -x y { _: [ 'b', '-x', 'y' ], a: 'run' } ``` ### strip aliased * default: `false` * key: `strip-aliased` Should aliases be removed before returning results? _If disabled:_ ```console $ node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } ``` _If enabled:_ ```console $ node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1 } ``` ### strip dashed * default: `false` * key: `strip-dashed` Should dashed keys be removed before returning results? This option has no effect if `camel-case-expansion` is disabled. _If disabled:_ ```console $ node example.js --test-field 1 { _: [], 'test-field': 1, testField: 1 } ``` _If enabled:_ ```console $ node example.js --test-field 1 { _: [], testField: 1 } ``` ### unknown options as args * default: `false` * key: `unknown-options-as-args` Should unknown options be treated like regular arguments? An unknown option is one that is not configured in `opts`. _If disabled_ ```console $ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 { _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } ``` _If enabled_ ```console $ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 { _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } ``` ## Supported Node.js Versions Libraries in this ecosystem make a best effort to track [Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). ## Special Thanks The yargs project evolves from optimist and minimist. It owes its existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ ## License ISC # minipass A _very_ minimal implementation of a [PassThrough stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) [It's very fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) for objects, strings, and buffers. Supports `pipe()`ing (including multi-`pipe()` and backpressure transmission), buffering data until either a `data` event handler or `pipe()` is added (so you don't lose the first chunk), and most other cases where PassThrough is a good idea. There is a `read()` method, but it's much more efficient to consume data from this stream via `'data'` events or by calling `pipe()` into some other stream. Calling `read()` requires the buffer to be flattened in some cases, which requires copying memory. There is also no `unpipe()` method. Once you start piping, there is no stopping it! If you set `objectMode: true` in the options, then whatever is written will be emitted. Otherwise, it'll do a minimal amount of Buffer copying to ensure proper Streams semantics when `read(n)` is called. `objectMode` can also be set by doing `stream.objectMode = true`, or by writing any non-string/non-buffer data. `objectMode` cannot be set to false once it is set. This is not a `through` or `through2` stream. It doesn't transform the data, it just passes it right through. If you want to transform the data, extend the class, and override the `write()` method. Once you're done transforming the data however you want, call `super.write()` with the transform output. For some examples of streams that extend Minipass in various ways, check out: - [minizlib](http://npm.im/minizlib) - [fs-minipass](http://npm.im/fs-minipass) - [tar](http://npm.im/tar) - [minipass-collect](http://npm.im/minipass-collect) - [minipass-flush](http://npm.im/minipass-flush) - [minipass-pipeline](http://npm.im/minipass-pipeline) - [tap](http://npm.im/tap) - [tap-parser](http://npm.im/tap-parser) - [treport](http://npm.im/treport) - [minipass-fetch](http://npm.im/minipass-fetch) - [pacote](http://npm.im/pacote) - [make-fetch-happen](http://npm.im/make-fetch-happen) - [cacache](http://npm.im/cacache) - [ssri](http://npm.im/ssri) - [npm-registry-fetch](http://npm.im/npm-registry-fetch) - [minipass-json-stream](http://npm.im/minipass-json-stream) - [minipass-sized](http://npm.im/minipass-sized) ## Differences from Node.js Streams There are several things that make Minipass streams different from (and in some ways superior to) Node.js core streams. Please read these caveats if you are familiar with node-core streams and intend to use Minipass streams in your programs. ### Timing Minipass streams are designed to support synchronous use-cases. Thus, data is emitted as soon as it is available, always. It is buffered until read, but no longer. Another way to look at it is that Minipass streams are exactly as synchronous as the logic that writes into them. This can be surprising if your code relies on `PassThrough.write()` always providing data on the next tick rather than the current one, or being able to call `resume()` and not have the entire buffer disappear immediately. However, without this synchronicity guarantee, there would be no way for Minipass to achieve the speeds it does, or support the synchronous use cases that it does. Simply put, waiting takes time. This non-deferring approach makes Minipass streams much easier to reason about, especially in the context of Promises and other flow-control mechanisms. ### No High/Low Water Marks Node.js core streams will optimistically fill up a buffer, returning `true` on all writes until the limit is hit, even if the data has nowhere to go. Then, they will not attempt to draw more data in until the buffer size dips below a minimum value. Minipass streams are much simpler. The `write()` method will return `true` if the data has somewhere to go (which is to say, given the timing guarantees, that the data is already there by the time `write()` returns). If the data has nowhere to go, then `write()` returns false, and the data sits in a buffer, to be drained out immediately as soon as anyone consumes it. ### Hazards of Buffering (or: Why Minipass Is So Fast) Since data written to a Minipass stream is immediately written all the way through the pipeline, and `write()` always returns true/false based on whether the data was fully flushed, backpressure is communicated immediately to the upstream caller. This minimizes buffering. Consider this case: ```js const {PassThrough} = require('stream') const p1 = new PassThrough({ highWaterMark: 1024 }) const p2 = new PassThrough({ highWaterMark: 1024 }) const p3 = new PassThrough({ highWaterMark: 1024 }) const p4 = new PassThrough({ highWaterMark: 1024 }) p1.pipe(p2).pipe(p3).pipe(p4) p4.on('data', () => console.log('made it through')) // this returns false and buffers, then writes to p2 on next tick (1) // p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) // p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) // p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' // on next tick (4) // p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and // 'drain' on next tick (5) // p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) // p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next // tick (7) p1.write(Buffer.alloc(2048)) // returns false ``` Along the way, the data was buffered and deferred at each stage, and multiple event deferrals happened, for an unblocked pipeline where it was perfectly safe to write all the way through! Furthermore, setting a `highWaterMark` of `1024` might lead someone reading the code to think an advisory maximum of 1KiB is being set for the pipeline. However, the actual advisory buffering level is the _sum_ of `highWaterMark` values, since each one has its own bucket. Consider the Minipass case: ```js const m1 = new Minipass() const m2 = new Minipass() const m3 = new Minipass() const m4 = new Minipass() m1.pipe(m2).pipe(m3).pipe(m4) m4.on('data', () => console.log('made it through')) // m1 is flowing, so it writes the data to m2 immediately // m2 is flowing, so it writes the data to m3 immediately // m3 is flowing, so it writes the data to m4 immediately // m4 is flowing, so it fires the 'data' event immediately, returns true // m4's write returned true, so m3 is still flowing, returns true // m3's write returned true, so m2 is still flowing, returns true // m2's write returned true, so m1 is still flowing, returns true // No event deferrals or buffering along the way! m1.write(Buffer.alloc(2048)) // returns true ``` It is extremely unlikely that you _don't_ want to buffer any data written, or _ever_ buffer data that can be flushed all the way through. Neither node-core streams nor Minipass ever fail to buffer written data, but node-core streams do a lot of unnecessary buffering and pausing. As always, the faster implementation is the one that does less stuff and waits less time to do it. ### Immediately emit `end` for empty streams (when not paused) If a stream is not paused, and `end()` is called before writing any data into it, then it will emit `end` immediately. If you have logic that occurs on the `end` event which you don't want to potentially happen immediately (for example, closing file descriptors, moving on to the next entry in an archive parse stream, etc.) then be sure to call `stream.pause()` on creation, and then `stream.resume()` once you are ready to respond to the `end` event. ### Emit `end` When Asked One hazard of immediately emitting `'end'` is that you may not yet have had a chance to add a listener. In order to avoid this hazard, Minipass streams safely re-emit the `'end'` event if a new listener is added after `'end'` has been emitted. Ie, if you do `stream.on('end', someFunction)`, and the stream has already emitted `end`, then it will call the handler right away. (You can think of this somewhat like attaching a new `.then(fn)` to a previously-resolved Promise.) To prevent calling handlers multiple times who would not expect multiple ends to occur, all listeners are removed from the `'end'` event whenever it is emitted. ### Impact of "immediate flow" on Tee-streams A "tee stream" is a stream piping to multiple destinations: ```js const tee = new Minipass() t.pipe(dest1) t.pipe(dest2) t.write('foo') // goes to both destinations ``` Since Minipass streams _immediately_ process any pending data through the pipeline when a new pipe destination is added, this can have surprising effects, especially when a stream comes in from some other function and may or may not have data in its buffer. ```js // WARNING! WILL LOSE DATA! const src = new Minipass() src.write('foo') src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone src.pipe(dest2) // gets nothing! ``` The solution is to create a dedicated tee-stream junction that pipes to both locations, and then pipe to _that_ instead. ```js // Safe example: tee to both places const src = new Minipass() src.write('foo') const tee = new Minipass() tee.pipe(dest1) tee.pipe(dest2) src.pipe(tee) // tee gets 'foo', pipes to both locations ``` The same caveat applies to `on('data')` event listeners. The first one added will _immediately_ receive all of the data, leaving nothing for the second: ```js // WARNING! WILL LOSE DATA! const src = new Minipass() src.write('foo') src.on('data', handler1) // receives 'foo' right away src.on('data', handler2) // nothing to see here! ``` Using a dedicated tee-stream can be used in this case as well: ```js // Safe example: tee to both data handlers const src = new Minipass() src.write('foo') const tee = new Minipass() tee.on('data', handler1) tee.on('data', handler2) src.pipe(tee) ``` ## USAGE It's a stream! Use it like a stream and it'll most likely do what you want. ```js const Minipass = require('minipass') const mp = new Minipass(options) // optional: { encoding, objectMode } mp.write('foo') mp.pipe(someOtherStream) mp.end('bar') ``` ### OPTIONS * `encoding` How would you like the data coming _out_ of the stream to be encoded? Accepts any values that can be passed to `Buffer.toString()`. * `objectMode` Emit data exactly as it comes in. This will be flipped on by default if you write() something other than a string or Buffer at any point. Setting `objectMode: true` will prevent setting any encoding value. ### API Implements the user-facing portions of Node.js's `Readable` and `Writable` streams. ### Methods * `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the base Minipass class, the same data will come out.) Returns `false` if the stream will buffer the next write, or true if it's still in "flowing" mode. * `end([chunk, [encoding]], [callback])` - Signal that you have no more data to write. This will queue an `end` event to be fired when all the data has been consumed. * `setEncoding(encoding)` - Set the encoding for data coming of the stream. This can only be done once. * `pause()` - No more data for a while, please. This also prevents `end` from being emitted for empty streams until the stream is resumed. * `resume()` - Resume the stream. If there's data in the buffer, it is all discarded. Any buffered events are immediately emitted. * `pipe(dest)` - Send all output to the stream provided. There is no way to unpipe. When data is emitted, it is immediately written to any and all pipe destinations. * `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. Some events are given special treatment, however. (See below under "events".) * `promise()` - Returns a Promise that resolves when the stream emits `end`, or rejects if the stream emits `error`. * `collect()` - Return a Promise that resolves on `end` with an array containing each chunk of data that was emitted, or rejects if the stream emits `error`. Note that this consumes the stream data. * `concat()` - Same as `collect()`, but concatenates the data into a single Buffer object. Will reject the returned promise if the stream is in objectMode, or if it goes into objectMode by the end of the data. * `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not provided, then consume all of it. If `n` bytes are not available, then it returns null. **Note** consuming streams in this way is less efficient, and can lead to unnecessary Buffer copying. * `destroy([er])` - Destroy the stream. If an error is provided, then an `'error'` event is emitted. If the stream has a `close()` method, and has not emitted a `'close'` event yet, then `stream.close()` will be called. Any Promises returned by `.promise()`, `.collect()` or `.concat()` will be rejected. After being destroyed, writing to the stream will emit an error. No more data will be emitted if the stream is destroyed, even if it was previously buffered. ### Properties * `bufferLength` Read-only. Total number of bytes buffered, or in the case of objectMode, the total number of objects. * `encoding` The encoding that has been set. (Setting this is equivalent to calling `setEncoding(enc)` and has the same prohibition against setting multiple times.) * `flowing` Read-only. Boolean indicating whether a chunk written to the stream will be immediately emitted. * `emittedEnd` Read-only. Boolean indicating whether the end-ish events (ie, `end`, `prefinish`, `finish`) have been emitted. Note that listening on any end-ish event will immediateyl re-emit it if it has already been emitted. * `writable` Whether the stream is writable. Default `true`. Set to `false` when `end()` * `readable` Whether the stream is readable. Default `true`. * `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written to the stream that have not yet been emitted. (It's probably a bad idea to mess with this.) * `pipes` A [yallist](http://npm.im/yallist) linked list of streams that this stream is piping into. (It's probably a bad idea to mess with this.) * `destroyed` A getter that indicates whether the stream was destroyed. * `paused` True if the stream has been explicitly paused, otherwise false. * `objectMode` Indicates whether the stream is in `objectMode`. Once set to `true`, it cannot be set to `false`. ### Events * `data` Emitted when there's data to read. Argument is the data to read. This is never emitted while not flowing. If a listener is attached, that will resume the stream. * `end` Emitted when there's no more data to read. This will be emitted immediately for empty streams when `end()` is called. If a listener is attached, and `end` was already emitted, then it will be emitted again. All listeners are removed when `end` is emitted. * `prefinish` An end-ish event that follows the same logic as `end` and is emitted in the same conditions where `end` is emitted. Emitted after `'end'`. * `finish` An end-ish event that follows the same logic as `end` and is emitted in the same conditions where `end` is emitted. Emitted after `'prefinish'`. * `close` An indication that an underlying resource has been released. Minipass does not emit this event, but will defer it until after `end` has been emitted, since it throws off some stream libraries otherwise. * `drain` Emitted when the internal buffer empties, and it is again suitable to `write()` into the stream. * `readable` Emitted when data is buffered and ready to be read by a consumer. * `resume` Emitted when stream changes state from buffering to flowing mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event listener is added.) ### Static Methods * `Minipass.isStream(stream)` Returns `true` if the argument is a stream, and false otherwise. To be considered a stream, the object must be either an instance of Minipass, or an EventEmitter that has either a `pipe()` method, or both `write()` and `end()` methods. (Pretty much any stream in node-land will return `true` for this.) ## EXAMPLES Here are some examples of things you can do with Minipass streams. ### simple "are you done yet" promise ```js mp.promise().then(() => { // stream is finished }, er => { // stream emitted an error }) ``` ### collecting ```js mp.collect().then(all => { // all is an array of all the data emitted // encoding is supported in this case, so // so the result will be a collection of strings if // an encoding is specified, or buffers/objects if not. // // In an async function, you may do // const data = await stream.collect() }) ``` ### collecting into a single blob This is a bit slower because it concatenates the data into one chunk for you, but if you're going to do it yourself anyway, it's convenient this way: ```js mp.concat().then(onebigchunk => { // onebigchunk is a string if the stream // had an encoding set, or a buffer otherwise. }) ``` ### iteration You can iterate over streams synchronously or asynchronously in platforms that support it. Synchronous iteration will end when the currently available data is consumed, even if the `end` event has not been reached. In string and buffer mode, the data is concatenated, so unless multiple writes are occurring in the same tick as the `read()`, sync iteration loops will generally only have a single iteration. To consume chunks in this way exactly as they have been written, with no flattening, create the stream with the `{ objectMode: true }` option. ```js const mp = new Minipass({ objectMode: true }) mp.write('a') mp.write('b') for (let letter of mp) { console.log(letter) // a, b } mp.write('c') mp.write('d') for (let letter of mp) { console.log(letter) // c, d } mp.write('e') mp.end() for (let letter of mp) { console.log(letter) // e } for (let letter of mp) { console.log(letter) // nothing } ``` Asynchronous iteration will continue until the end event is reached, consuming all of the data. ```js const mp = new Minipass({ encoding: 'utf8' }) // some source of some data let i = 5 const inter = setInterval(() => { if (i-- > 0) mp.write(Buffer.from('foo\n', 'utf8')) else { mp.end() clearInterval(inter) } }, 100) // consume the data with asynchronous iteration async function consume () { for await (let chunk of mp) { console.log(chunk) } return 'ok' } consume().then(res => console.log(res)) // logs `foo\n` 5 times, and then `ok` ``` ### subclass that `console.log()`s everything written into it ```js class Logger extends Minipass { write (chunk, encoding, callback) { console.log('WRITE', chunk, encoding) return super.write(chunk, encoding, callback) } end (chunk, encoding, callback) { console.log('END', chunk, encoding) return super.end(chunk, encoding, callback) } } someSource.pipe(new Logger()).pipe(someDest) ``` ### same thing, but using an inline anonymous class ```js // js classes are fun someSource .pipe(new (class extends Minipass { emit (ev, ...data) { // let's also log events, because debugging some weird thing console.log('EMIT', ev) return super.emit(ev, ...data) } write (chunk, encoding, callback) { console.log('WRITE', chunk, encoding) return super.write(chunk, encoding, callback) } end (chunk, encoding, callback) { console.log('END', chunk, encoding) return super.end(chunk, encoding, callback) } })) .pipe(someDest) ``` ### subclass that defers 'end' for some reason ```js class SlowEnd extends Minipass { emit (ev, ...args) { if (ev === 'end') { console.log('going to end, hold on a sec') setTimeout(() => { console.log('ok, ready to end now') super.emit('end', ...args) }, 100) } else { return super.emit(ev, ...args) } } } ``` ### transform that creates newline-delimited JSON ```js class NDJSONEncode extends Minipass { write (obj, cb) { try { // JSON.stringify can throw, emit an error on that return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) } catch (er) { this.emit('error', er) } } end (obj, cb) { if (typeof obj === 'function') { cb = obj obj = undefined } if (obj !== undefined) { this.write(obj) } return super.end(cb) } } ``` ### transform that parses newline-delimited JSON ```js class NDJSONDecode extends Minipass { constructor (options) { // always be in object mode, as far as Minipass is concerned super({ objectMode: true }) this._jsonBuffer = '' } write (chunk, encoding, cb) { if (typeof chunk === 'string' && typeof encoding === 'string' && encoding !== 'utf8') { chunk = Buffer.from(chunk, encoding).toString() } else if (Buffer.isBuffer(chunk)) chunk = chunk.toString() } if (typeof encoding === 'function') { cb = encoding } const jsonData = (this._jsonBuffer + chunk).split('\n') this._jsonBuffer = jsonData.pop() for (let i = 0; i < jsonData.length; i++) { try { // JSON.parse can throw, emit an error on that super.write(JSON.parse(jsonData[i])) } catch (er) { this.emit('error', er) continue } } if (cb) cb() } } ``` # balanced-match Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well! [![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) [![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) [![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) ## Example Get the first matching pair of braces: ```js var balanced = require('balanced-match'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); ``` The matches are: ```bash $ node example.js { start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } { start: 3, end: 9, pre: 'pre', body: 'first', post: 'between{second}post' } { start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } ``` ## API ### var m = balanced(a, b, str) For the first non-nested matching pair of `a` and `b` in `str`, return an object with those keys: * **start** the index of the first match of `a` * **end** the index of the matching `b` * **pre** the preamble, `a` and `b` not included * **body** the match, `a` and `b` not included * **post** the postscript, `a` and `b` not included If there's no match, `undefined` will be returned. If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) For the first non-nested matching pair of `a` and `b` in `str`, return an array with indexes: `[ <a index>, <b index> ]`. If there's no match, `undefined` will be returned. If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation With [npm](https://npmjs.org) do: ```bash npm install balanced-match ``` ## Security contact information To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. ## License (MIT) Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # debug [![Build Status](https://travis-ci.org/debug-js/debug.svg?branch=master)](https://travis-ci.org/debug-js/debug) [![Coverage Status](https://coveralls.io/repos/github/debug-js/debug/badge.svg?branch=master)](https://coveralls.io/github/debug-js/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) <img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers. ## Installation ```bash $ npm install debug ``` ## Usage `debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. Example [_app.js_](./examples/node/app.js): ```js var debug = require('debug')('http') , http = require('http') , name = 'My App'; // fake app debug('booting %o', name); http.createServer(function(req, res){ debug(req.method + ' ' + req.url); res.end('hello\n'); }).listen(3000, function(){ debug('listening'); }); // fake worker of some kind require('./worker'); ``` Example [_worker.js_](./examples/node/worker.js): ```js var a = require('debug')('worker:a') , b = require('debug')('worker:b'); function work() { a('doing lots of uninteresting work'); setTimeout(work, Math.random() * 1000); } work(); function workb() { b('doing some work'); setTimeout(workb, Math.random() * 2000); } workb(); ``` The `DEBUG` environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: <img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png"> <img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png"> <img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png"> #### Windows command prompt notes ##### CMD On Windows the environment variable is set using the `set` command. ```cmd set DEBUG=*,-not_this ``` Example: ```cmd set DEBUG=* & node app.js ``` ##### PowerShell (VS Code default) PowerShell uses different syntax to set environment variables. ```cmd $env:DEBUG = "*,-not_this" ``` Example: ```cmd $env:DEBUG='app';node app.js ``` Then, run the program to be debugged as usual. npm script example: ```js "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", ``` ## Namespace Colors Every debug instance has a color generated for it based on its namespace name. This helps when visually parsing the debug output to identify which debug instance a debug line belongs to. #### Node.js In Node.js, colors are enabled when stderr is a TTY. You also _should_ install the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, otherwise debug will only use a small handful of basic colors. <img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png"> #### Web Browser Colors are also enabled on "Web Inspectors" that understand the `%c` formatting option. These are WebKit web inspectors, Firefox ([since version 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) and the Firebug plugin for Firefox (any version). <img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png"> ## Millisecond diff When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. <img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: <img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png"> ## Conventions If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. ## Wildcards The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". ## Environment Variables When running through Node.js, you can set a few environment variables that will change the behavior of the debug logging: | Name | Purpose | |-----------|-------------------------------------------------| | `DEBUG` | Enables/disables specific debugging namespaces. | | `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | | `DEBUG_COLORS`| Whether or not to use colors in the debug output. | | `DEBUG_DEPTH` | Object inspection depth. | | `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | __Note:__ The environment variables beginning with `DEBUG_` end up being converted into an Options object that gets used with `%o`/`%O` formatters. See the Node.js documentation for [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) for the complete list. ## Formatters Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: | Formatter | Representation | |-----------|----------------| | `%O` | Pretty-print an Object on multiple lines. | | `%o` | Pretty-print an Object all on a single line. | | `%s` | String. | | `%d` | Number (both integer and float). | | `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | | `%%` | Single percent sign ('%'). This does not consume an argument. | ### Custom formatters You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: ```js const createDebug = require('debug') createDebug.formatters.h = (v) => { return v.toString('hex') } // …elsewhere const debug = createDebug('foo') debug('this is hex: %h', new Buffer('hello world')) // foo this is hex: 68656c6c6f20776f726c6421 +0ms ``` ## Browser Support You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), if you don't want to build it yourself. Debug's enable state is currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. You can enable this using `localStorage.debug`: ```js localStorage.debug = 'worker:*' ``` And then refresh the page. ```js a = debug('worker:a'); b = debug('worker:b'); setInterval(function(){ a('doing some work'); }, 1000); setInterval(function(){ b('doing some work'); }, 1200); ``` In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. <img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png"> ## Output streams By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: Example [_stdout.js_](./examples/node/stdout.js): ```js var debug = require('debug'); var error = debug('app:error'); // by default stderr is used error('goes to stderr!'); var log = debug('app:log'); // set this namespace to log via console.log log.log = console.log.bind(console); // don't forget to bind to console! log('goes to stdout'); error('still goes to stderr!'); // set all output to go via console.info // overrides all per-namespace log settings debug.log = console.info.bind(console); error('now goes to stdout via console.info'); log('still goes to stdout, but via console.info now'); ``` ## Extend You can simply extend debugger ```js const log = require('debug')('auth'); //creates new debug instance with extended namespace const logSign = log.extend('sign'); const logLogin = log.extend('login'); log('hello'); // auth hello logSign('hello'); //auth:sign hello logLogin('hello'); //auth:login hello ``` ## Set dynamically You can also enable debug dynamically by calling the `enable()` method : ```js let debug = require('debug'); console.log(1, debug.enabled('test')); debug.enable('test'); console.log(2, debug.enabled('test')); debug.disable(); console.log(3, debug.enabled('test')); ``` print : ``` 1 false 2 true 3 false ``` Usage : `enable(namespaces)` `namespaces` can include modes separated by a colon and wildcards. Note that calling `enable()` completely overrides previously set DEBUG variable : ``` $ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' => false ``` `disable()` Will disable all namespaces. The functions returns the namespaces currently enabled (and skipped). This can be useful if you want to disable debugging temporarily without knowing what was enabled to begin with. For example: ```js let debug = require('debug'); debug.enable('foo:*,-foo:bar'); let namespaces = debug.disable(); debug.enable(namespaces); ``` Note: There is no guarantee that the string will be identical to the initial enable string, but semantically they will be identical. ## Checking whether a debug target is enabled After you've created a debug instance, you can determine whether or not it is enabled by checking the `enabled` property: ```javascript const debug = require('debug')('http'); if (debug.enabled) { // do stuff... } ``` You can also manually toggle this property to force the debug instance to be enabled or disabled. ## Usage in child processes Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. For example: ```javascript worker = fork(WORKER_WRAP_PATH, [workerPath], { stdio: [ /* stdin: */ 0, /* stdout: */ 'pipe', /* stderr: */ 'pipe', 'ipc', ], env: Object.assign({}, process.env, { DEBUG_COLORS: 1 // without this settings, colors won't be shown }), }); worker.stderr.pipe(process.stderr, { end: false }); ``` ## Authors - TJ Holowaychuk - Nathan Rajlich - Andrew Rhyne - Josh Junon ## Backers Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] <a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a> <a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a> ## Sponsors Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] <a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a> <a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a> ## License (The MIT License) Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt; Copyright (c) 2018-2021 Josh Junon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Optionator <a name="optionator" /> Optionator is a JavaScript/Node.js option parsing and help generation library used by [eslint](http://eslint.org), [Grasp](http://graspjs.com), [LiveScript](http://livescript.net), [esmangle](https://github.com/estools/esmangle), [escodegen](https://github.com/estools/escodegen), and [many more](https://www.npmjs.com/browse/depended/optionator). For an online demo, check out the [Grasp online demo](http://www.graspjs.com/#demo). [About](#about) &middot; [Usage](#usage) &middot; [Settings Format](#settings-format) &middot; [Argument Format](#argument-format) ## Why? The problem with other option parsers, such as `yargs` or `minimist`, is they just accept all input, valid or not. With Optionator, if you mistype an option, it will give you an error (with a suggestion for what you meant). If you give the wrong type of argument for an option, it will give you an error rather than supplying the wrong input to your application. $ cmd --halp Invalid option '--halp' - perhaps you meant '--help'? $ cmd --count str Invalid value for option 'count' - expected type Int, received value: str. Other helpful features include reformatting the help text based on the size of the console, so that it fits even if the console is narrow, and accepting not just an array (eg. process.argv), but a string or object as well, making things like testing much easier. ## About Optionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types. MIT license. Version 0.9.1 npm install optionator For updates on Optionator, [follow me on twitter](https://twitter.com/gkzahariev). Optionator is a Node.js module, but can be used in the browser as well if packed with webpack/browserify. ## Usage `require('optionator');` returns a function. It has one property, `VERSION`, the current version of the library as a string. This function is called with an object specifying your options and other information, see the [settings format section](#settings-format). This in turn returns an object with three properties, `parse`, `parseArgv`, `generateHelp`, and `generateHelpForOption`, which are all functions. ```js var optionator = require('optionator')({ prepend: 'Usage: cmd [options]', append: 'Version 1.0.0', options: [{ option: 'help', alias: 'h', type: 'Boolean', description: 'displays help' }, { option: 'count', alias: 'c', type: 'Int', description: 'number of things', example: 'cmd --count 2' }] }); var options = optionator.parseArgv(process.argv); if (options.help) { console.log(optionator.generateHelp()); } ... ``` ### parse(input, parseOptions) `parse` processes the `input` according to your settings, and returns an object with the results. ##### arguments * input - `[String] | Object | String` - the input you wish to parse * parseOptions - `{slice: Int}` - all options optional - `slice` specifies how much to slice away from the beginning if the input is an array or string - by default `0` for string, `2` for array (works with `process.argv`) ##### returns `Object` - the parsed options, each key is a camelCase version of the option name (specified in dash-case), and each value is the processed value for that option. Positional values are in an array under the `_` key. ##### example ```js parse(['node', 't.js', '--count', '2', 'positional']); // {count: 2, _: ['positional']} parse('--count 2 positional'); // {count: 2, _: ['positional']} parse({count: 2, _:['positional']}); // {count: 2, _: ['positional']} ``` ### parseArgv(input) `parseArgv` works exactly like `parse`, but only for array input and it slices off the first two elements. ##### arguments * input - `[String]` - the input you wish to parse ##### returns See "returns" section in "parse" ##### example ```js parseArgv(process.argv); ``` ### generateHelp(helpOptions) `generateHelp` produces help text based on your settings. ##### arguments * helpOptions - `{showHidden: Boolean, interpolate: Object}` - all options optional - `showHidden` specifies whether to show options with `hidden: true` specified, by default it is `false` - `interpolate` specify data to be interpolated in `prepend` and `append` text, `{{key}}` is the format - eg. `generateHelp({interpolate:{version: '0.4.2'}})`, will change this `append` text: `Version {{version}}` to `Version 0.4.2` ##### returns `String` - the generated help text ##### example ```js generateHelp(); /* "Usage: cmd [options] positional -h, --help displays help -c, --count Int number of things Version 1.0.0 "*/ ``` ### generateHelpForOption(optionName) `generateHelpForOption` produces expanded help text for the specified with `optionName` option. If an `example` was specified for the option, it will be displayed, and if a `longDescription` was specified, it will display that instead of the `description`. ##### arguments * optionName - `String` - the name of the option to display ##### returns `String` - the generated help text for the option ##### example ```js generateHelpForOption('count'); /* "-c, --count Int description: number of things example: cmd --count 2 "*/ ``` ## Settings Format When your `require('optionator')`, you get a function that takes in a settings object. This object has the type: { prepend: String, append: String, options: [{heading: String} | { option: String, alias: [String] | String, type: String, enum: [String], default: String, restPositional: Boolean, required: Boolean, overrideRequired: Boolean, dependsOn: [String] | String, concatRepeatedArrays: Boolean | (Boolean, Object), mergeRepeatedObjects: Boolean, description: String, longDescription: String, example: [String] | String }], helpStyle: { aliasSeparator: String, typeSeparator: String, descriptionSeparator: String, initialIndent: Int, secondaryIndent: Int, maxPadFactor: Number }, mutuallyExclusive: [[String | [String]]], concatRepeatedArrays: Boolean | (Boolean, Object), // deprecated, set in defaults object mergeRepeatedObjects: Boolean, // deprecated, set in defaults object positionalAnywhere: Boolean, typeAliases: Object, defaults: Object } All of the properties are optional (the `Maybe` has been excluded for brevities sake), except for having either `heading: String` or `option: String` in each object in the `options` array. ### Top Level Properties * `prepend` is an optional string to be placed before the options in the help text * `append` is an optional string to be placed after the options in the help text * `options` is a required array specifying your options and headings, the options and headings will be displayed in the order specified * `helpStyle` is an optional object which enables you to change the default appearance of some aspects of the help text * `mutuallyExclusive` is an optional array of arrays of either strings or arrays of strings. The top level array is a list of rules, each rule is a list of elements - each element can be either a string (the name of an option), or a list of strings (a group of option names) - there will be an error if more than one element is present * `concatRepeatedArrays` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property * `mergeRepeatedObjects` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property * `positionalAnywhere` is an optional boolean (defaults to `true`) - when `true` it allows positional arguments anywhere, when `false`, all arguments after the first positional one are taken to be positional as well, even if they look like a flag. For example, with `positionalAnywhere: false`, the arguments `--flag --boom 12 --crack` would have two positional arguments: `12` and `--crack` * `typeAliases` is an optional object, it allows you to set aliases for types, eg. `{Path: 'String'}` would allow you to use the type `Path` as an alias for the type `String` * `defaults` is an optional object following the option properties format, which specifies default values for all options. A default will be overridden if manually set. For example, you can do `default: { type: "String" }` to set the default type of all options to `String`, and then override that default in an individual option by setting the `type` property #### Heading Properties * `heading` a required string, the name of the heading #### Option Properties * `option` the required name of the option - use dash-case, without the leading dashes * `alias` is an optional string or array of strings which specify any aliases for the option * `type` is a required string in the [type check](https://github.com/gkz/type-check) [format](https://github.com/gkz/type-check#type-format), this will be used to cast the inputted value and validate it * `enum` is an optional array of strings, each string will be parsed by [levn](https://github.com/gkz/levn) - the argument value must be one of the resulting values - each potential value must validate against the specified `type` * `default` is a optional string, which will be parsed by [levn](https://github.com/gkz/levn) and used as the default value if none is set - the value must validate against the specified `type` * `restPositional` is an optional boolean - if set to `true`, everything after the option will be taken to be a positional argument, even if it looks like a named argument * `required` is an optional boolean - if set to `true`, the option parsing will fail if the option is not defined * `overrideRequired` is a optional boolean - if set to `true` and the option is used, and there is another option which is required but not set, it will override the need for the required option and there will be no error - this is useful if you have required options and want to use `--help` or `--version` flags * `concatRepeatedArrays` is an optional boolean or tuple with boolean and options object (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']` You can supply an options object by giving the following value: `[true, options]`. The one currently supported option is `oneValuePerFlag`, this only allows one array value per flag. This is useful if your potential values contain a comma. * `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}` * `dependsOn` is an optional string or array of strings - if simply a string (the name of another option), it will make sure that that other option is set, if an array of strings, depending on whether `'and'` or `'or'` is first, it will either check whether all (`['and', 'option-a', 'option-b']`), or at least one (`['or', 'option-a', 'option-b']`) other options are set * `description` is an optional string, which will be displayed next to the option in the help text * `longDescription` is an optional string, it will be displayed instead of the `description` when `generateHelpForOption` is used * `example` is an optional string or array of strings with example(s) for the option - these will be displayed when `generateHelpForOption` is used #### Help Style Properties * `aliasSeparator` is an optional string, separates multiple names from each other - default: ' ,' * `typeSeparator` is an optional string, separates the type from the names - default: ' ' * `descriptionSeparator` is an optional string , separates the description from the padded name and type - default: ' ' * `initialIndent` is an optional int - the amount of indent for options - default: 2 * `secondaryIndent` is an optional int - the amount of indent if wrapped fully (in addition to the initial indent) - default: 4 * `maxPadFactor` is an optional number - affects the default level of padding for the names/type, it is multiplied by the average of the length of the names/type - default: 1.5 ## Argument Format At the highest level there are two types of arguments: named, and positional. Name arguments of any length are prefixed with `--` (eg. `--go`), and those of one character may be prefixed with either `--` or `-` (eg. `-g`). There are two types of named arguments: boolean flags (eg. `--problemo`, `-p`) which take no value and result in a `true` if they are present, the falsey `undefined` if they are not present, or `false` if present and explicitly prefixed with `no` (eg. `--no-problemo`). Named arguments with values (eg. `--tseries 800`, `-t 800`) are the other type. If the option has a type `Boolean` it will automatically be made into a boolean flag. Any other type results in a named argument that takes a value. For more information about how to properly set types to get the value you want, take a look at the [type check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) pages. You can group single character arguments that use a single `-`, however all except the last must be boolean flags (which take no value). The last may be a boolean flag, or an argument which takes a value - eg. `-ba 2` is equivalent to `-b -a 2`. Positional arguments are all those values which do not fall under the above - they can be anywhere, not just at the end. For example, in `cmd -b one -a 2 two` where `b` is a boolean flag, and `a` has the type `Number`, there are two positional arguments, `one` and `two`. Everything after an `--` is positional, even if it looks like a named argument. You may optionally use `=` to separate option names from values, for example: `--count=2`. If you specify the option `NUM`, then any argument using a single `-` followed by a number will be valid and will set the value of `NUM`. Eg. `-2` will be parsed into `NUM: 2`. If duplicate named arguments are present, the last one will be taken. ## Technical About `optionator` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [levn](https://github.com/gkz/levn) to cast arguments to their specified type, and uses [type-check](https://github.com/gkz/type-check) to validate values. It also uses the [prelude.ls](http://preludels.com/) library. # type-check [![Build Status](https://travis-ci.org/gkz/type-check.png?branch=master)](https://travis-ci.org/gkz/type-check) <a name="type-check" /> `type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.4.0. Check out the [demo](http://gkz.github.io/type-check/). For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev). npm install type-check ## Quick Examples ```js // Basic types: var typeCheck = require('type-check').typeCheck; typeCheck('Number', 1); // true typeCheck('Number', 'str'); // false typeCheck('Error', new Error); // true typeCheck('Undefined', undefined); // true // Comment typeCheck('count::Number', 1); // true // One type OR another type: typeCheck('Number | String', 2); // true typeCheck('Number | String', 'str'); // true // Wildcard, matches all types: typeCheck('*', 2) // true // Array, all elements of a single type: typeCheck('[Number]', [1, 2, 3]); // true typeCheck('[Number]', [1, 'str', 3]); // false // Tuples, or fixed length arrays with elements of different types: typeCheck('(String, Number)', ['str', 2]); // true typeCheck('(String, Number)', ['str']); // false typeCheck('(String, Number)', ['str', 2, 5]); // false // Object properties: typeCheck('{x: Number, y: Boolean}', {x: 2, y: false}); // true typeCheck('{x: Number, y: Boolean}', {x: 2}); // false typeCheck('{x: Number, y: Maybe Boolean}', {x: 2}); // true typeCheck('{x: Number, y: Boolean}', {x: 2, y: false, z: 3}); // false typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3}); // true // A particular type AND object properties: typeCheck('RegExp{source: String, ...}', /re/i); // true typeCheck('RegExp{source: String, ...}', {source: 're'}); // false // Custom types: var opt = {customTypes: {Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}}; typeCheck('Even', 2, opt); // true // Nested: var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}' typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true ``` Check out the [type syntax format](#syntax) and [guide](#guide). ## Usage `require('type-check');` returns an object that exposes four properties. `VERSION` is the current version of the library as a string. `typeCheck`, `parseType`, and `parsedTypeCheck` are functions. ```js // typeCheck(type, input, options); typeCheck('Number', 2); // true // parseType(type); var parsedType = parseType('Number'); // object // parsedTypeCheck(parsedType, input, options); parsedTypeCheck(parsedType, 2); // true ``` ### typeCheck(type, input, options) `typeCheck` checks a JavaScript value `input` against `type` written in the [type format](#type-format) (and taking account the optional `options`) and returns whether the `input` matches the `type`. ##### arguments * type - `String` - the type written in the [type format](#type-format) which to check against * input - `*` - any JavaScript value, which is to be checked against the type * options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) ##### returns `Boolean` - whether the input matches the type ##### example ```js typeCheck('Number', 2); // true ``` ### parseType(type) `parseType` parses string `type` written in the [type format](#type-format) into an object representing the parsed type. ##### arguments * type - `String` - the type written in the [type format](#type-format) which to parse ##### returns `Object` - an object in the parsed type format representing the parsed type ##### example ```js parseType('Number'); // [{type: 'Number'}] ``` ### parsedTypeCheck(parsedType, input, options) `parsedTypeCheck` checks a JavaScript value `input` against parsed `type` in the parsed type format (and taking account the optional `options`) and returns whether the `input` matches the `type`. Use this in conjunction with `parseType` if you are going to use a type more than once. ##### arguments * type - `Object` - the type in the parsed type format which to check against * input - `*` - any JavaScript value, which is to be checked against the type * options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) ##### returns `Boolean` - whether the input matches the type ##### example ```js parsedTypeCheck([{type: 'Number'}], 2); // true var parsedType = parseType('String'); parsedTypeCheck(parsedType, 'str'); // true ``` <a name="type-format" /> ## Type Format ### Syntax White space is ignored. The root node is a __Types__. * __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String` * __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*` * __Types__ = optionally a comment (an `Identifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String` * __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]` * __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}` * __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean` * __Tuple__ = a `(`, followed by one or more `Types` separated by a comma `,` (trailing comma `,` is permitted), followed by a `)` - eg `(Date)`, `(Number, Date)` * __Array__ = a `[` followed by exactly one `Types` followed by a `]` - eg. `[Boolean]`, `[Boolean | Null]` ### Guide `type-check` uses `Object.toString` to find out the basic type of a value. Specifically, ```js {}.toString.call(VALUE).slice(8, -1) {}.toString.call(true).slice(8, -1) // 'Boolean' ``` A basic type, eg. `Number`, uses this check. This is much more versatile than using `typeof` - for example, with `document`, `typeof` produces `'object'` which isn't that useful, and our technique produces `'HTMLDocument'`. You may check for multiple types by separating types with a `|`. The checker proceeds from left to right, and passes if the value is any of the types - eg. `String | Boolean` first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false. Adding a `Maybe` in front of a list of multiple types is the same as also checking for `Null` and `Undefined` - eg. `Maybe String` is equivalent to `Undefined | Null | String`. You may add a comment to remind you of what the type is for by following an identifier with a `::` before a type (or multiple types). The comment is simply thrown out. The wildcard `*` matches all types. There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'. If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of `Object` and the properties pass - this allows for duck typing - eg. `{x: Boolean}`. To check if the properties pass, and the value is of a certain type, you can specify the type - eg. `Error{message: String}`. If you want to make a field optional, you can simply use `Maybe` - eg. `{x: Boolean, y: Maybe String}` will still pass if `y` is undefined (or null). If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator `...` - eg. `{x: Boolean, ...}` will match an object with an `x` property that is a boolean, and with zero or more other properties. For an array, you must specify one or more types (separated by `|`) - it will pass for something of any length as long as each element passes the types provided - eg. `[Number]`, `[Number | String]`. A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. `(String, Number)`. An array and tuple structure check that the value is of type `Array` by default, but if another type is specified, they will check for that instead - eg. `Int32Array[Number]`. You can use the wildcard `*` to search for any type at all. Check out the [type precedence](https://github.com/zaboco/type-precedence) library for type-check. ## Options Options is an object. It is an optional parameter to the `typeCheck` and `parsedTypeCheck` functions. The only current option is `customTypes`. <a name="custom-types" /> ### Custom Types __Example:__ ```js var options = { customTypes: { Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; } } } }; typeCheck('Even', 2, options); // true typeCheck('Even', 3, options); // false ``` `customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function. The `typeOf` property is the type the value should be (optional - if not set only `validate` will be used), and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking. ## Technical About `type-check` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It also uses the [prelude.ls](http://preludels.com/) library.
oleksiivinogradov_motoDEXweb
.idea vcs.xml workspace.xml Build motoDEXweb.loader.js README.md TemplateData UnityLoaderCompatibilityCheck.js UnityProgress.js style.css game-web3wallet index.html motoDEXserver.2b18246e.js styles.9fb99aa0.css index.html js google-analytics.js network.js web3 borsh.bundle.js index.js lib web3modal.js nearAPI.js
# Unity ^2020.1.0 Web3GL Template ## Methods in Browser ![](https://user-images.githubusercontent.com/19412160/149653806-b2c4ca54-1986-4481-bd61-721dbd8a7967.png) Dispay login modal: ```javascript window.web3gl.connect(); ``` Get Network: ```javascript window.web3gl.networkId; ``` Get Connected Address: ```javascript window.web3gl.connectAccount; ``` To Send Transaction: ```javascript const to = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; const value = "12300000000000000"; const gasLimit = "21000"; // gas limit const gasPrice = "33333333333"; window.web3gl.sendTransaction(to, value, gasLimit, gasPrice); ``` To Interact with Contract: ```javascript const method = "increment"; const abi = `[ { "inputs": [], "name": "increment", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "x", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" } ]`; const contract = "0xB6B8bB1e16A6F73f7078108538979336B9B7341C"; const args = "[]"; const value = "0"; const gasLimit = "222222"; // gas limit const gasPrice = "333333333333"; window.web3gl.sendContract(method, abi, contract, args, value, gasLimit, gasPrice); ``` ## Enable Torus In `web3/index.js` Uncomment ```javascript document.body.appendChild(Object.assign(document.createElement("script"), { type: "text/javascript", src: "https://unpkg.com/@toruslabs/torus-embed" })); ``` ```javascript const providerOptions = { torus: { package: Torus, } }; ``` ## Enable WalletConnect In `web3/index.js` Uncomment ```javascript document.body.appendChild(Object.assign(document.createElement("script"), { type: "text/javascript", src: "https://unpkg.com/@walletconnect/web3-provider@1.2.1/dist/umd/index.min.js" })); ``` ```javascript const providerOptions = { walletconnect: { package: window.WalletConnectProvider.default, options: { infuraId: "00000000000000000000000000000000", }, } }; ``` Replace `infuraId: "00000000000000000000000000000000"` ![](https://user-images.githubusercontent.com/19412160/149654154-3a9a5066-1c8b-42cd-90f9-204014b56154.png)
huykgit98_social-media-app
.vscode launch.json README.md contract build.sh build builder.c code.h contract.js methods.h deploy.sh neardev dev-account.env package-lock.json package.json src contract.ts model.ts tsconfig.json frontend .cypress cypress.config.js e2e guest-book.cy.ts tsconfig.json App.js index.html index.js near-interface.js near-wallet.js package.json start.sh integration-tests package-lock.json package.json src main.ava.ts package-lock.json package.json
# A social media app using nearjs & reactjs
iOchando_DAOPaymentOfPayroll
.gitpod.yml README.md contract README.md as-pect.config.js asconfig.json assembly __tests__ as-pect.d.ts main.spec.ts as_types.d.ts index.ts models Empleado.ts Solicitud.ts tsconfig.json utils.ts compile.js package-lock.json package.json package.json
# DAO Payment of Payroll: Payment of Payroll es un contrato inteligente, el cual permite realizar los diferentes pagos a la nómina de desarrolladores, mediante el wallet de near. Este smart contract permite: - Crear un empleado utilizando el metodo crearEmpleado. - Eliminar un empleado de la nomina con el metodo eliminarEmpleado. - Crear una solicitud de pago con el metodo crearSolicitud. - Eliminar una solicitud de pago con el metodo eliminarSolicitud. - Realizar el pago de una solicitud con el metodo RealizarPago. <img width="760" alt="Proceso" src="https://user-images.githubusercontent.com/96194326/151623400-e0bac701-7147-45b0-b243-26b29b0d274b.png"> # Instalación : Para la instalación local de este projecto: ## Pre - requisitos - Asegúrese de haber instalado Node.js ≥ 12 (recomendamos usar nvm). - Asegúrese de haber instalado yarn: npm install -g yarn. - Instalar dependencias: yarn install. - Crear un test near account NEAR test account. - Instalar el NEAR CLI globally: near-cli es una interfaz de linea de comando (CLI) para interacturar con NEAR blockchain. # Configurar NEAR CLI: Configura tu near-cli para autorizar tu cuenta de prueba creada recientemente: ```html near login ``` # Clonar el repositorio :palms_up_together: ```html https://github.com/iOchando/DAOPaymentOfPayroll.git ``` ```html cd DAOPaymentOfPayroll ``` # Build del proyecto y despliegue en development mode.:rocket: Instalar las dependencias necesarias con npm. ```html npm install ``` Hacer el build y deployment en development mode. ```html yarn deploy:dev ``` # Comandos : ## Comando para crear un Empleado: ```html near call CONTRACT_ACCOUNT_ID crearEmpleado "{ \"nombre\": \"string\", \"nearid\": \"string\", \"sueldo\": number }" --account-id YOUR_ACCOUNT_ID ``` ## Comando para ver la nomina con todos los empleados registrados: ```html near view CONTRACT_ACCOUNT_ID verNomina ``` ## Comando para eliminar un empleado de la nomina: ```html near call CONTRACT_ACCOUNT_ID eliminarEmpleado "{\"id\": number}" --account-id YOUR_ACCOUNT_ID ``` ## Comando para crear una Solicitud: ```html near call CONTRACT_ACCOUNT_ID crearSolicitud "{ \"titulo\": \"string\", \"descripcion\": \"string\"}" --account-id YOUR_ACCOUNT_ID ``` ## Comando para conseguir la lista de Solicitudes: ```html near call near view CONTRACT_ACCOUNT_ID listarSolicitudes ``` ## Comando para eliminar una solicitud: ```html near call CONTRACT_ACCOUNT_ID eliminarSolicitud "{\"id\": number}" --account-id YOUR_ACCOUNT_ID ``` ## Comando para realizar el pago de una solicitud ```html near call CONTRACT_ACCOUNT_ID RealizarPago "{ \"id\": number}" --account-id YOUR_ACCOUNT_ID ``` # :framed_picture: Pantallas: ![Confirmacion de Pago](https://user-images.githubusercontent.com/96194326/151618887-88a40b0a-9873-4575-8b25-e2221aeadb2f.jpeg) -Confirmacion de pago ![Muestra de pago 1](https://user-images.githubusercontent.com/96194326/151618895-9b03742e-2307-4540-b697-dd9b77c611a1.jpeg) -Pago trabajador 1 ![Muestra de Pago 2](https://user-images.githubusercontent.com/96194326/151618910-1e058f40-4d7e-4a86-93ca-fe5276e56b05.jpeg) -Pago trabajador 2 # Gracias por visitar nuestro proyecto. :clap: banana Smart Contract ================== A [smart contract] written in [AssemblyScript] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install [Node.js] ≥ 12 Exploring The Code ================== 1. The main smart contract code lives in `assembly/index.ts`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard AssemblyScript tests using [as-pect]. [smart contract]: https://docs.near.org/docs/develop/contracts/overview [AssemblyScript]: https://www.assemblyscript.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [as-pect]: https://www.npmjs.com/package/@as-pect/cli
htafolla_diversifying-staking-pool
.vscode launch.json tasks.json Cargo.toml LICENSE.md README.md build.sh deploy-guildnet.sh deploy-testnet.sh divpool Cargo.toml src distribute.rs gas.rs getters.rs internal.rs lib.rs multi_fun_token.rs owner.rs types.rs utils.rs tests simulation.rs test_utils.rs tests.md docs _config.yml beta-test.md index.md technical-notes.md To BUY SKASH is equivalent to STAKE To SELL SKASH is equivalent to UNSTAKE without the waiting period restart-testnet.sh rewards-register-contract Cargo.toml src internal.rs lib.rs sdg.sh test-get-epoch-contract Cargo.toml src lib.rs test-staking-pool Cargo.toml src internal.rs lib.rs test_utils.rs test.sh
# Diversifying Staking Pool ## Overview What is Div-Pool and other non-Technical Documentation [CLICK HERE](https://narwallets.github.io/diversifying-staking-pool/) ## Technical Documentation [Technical Notes](https://narwallets.github.io/diversifying-staking-pool/technical-notes) ### Repositories This is the Smart Contract repository. The Web App UI is at https://github.com/Narwallets/dapp-diversifying-staking-pool.git ### Change Log #### `0.1.0` - Initial version based on core-contracts/lockup and core-contracts/staking-pool - Deposit, withdraw - Distributed stake/unstake - NEAR/SKASH liquidity pool, Add/Remove liquidity - G-SKASH Minting wtih rewards ### TO DO & Help needed #### Smart Contract - [x] Deposit/withdraw - [x] Buy Skash/Stake - [x] Sell SKASH/immediate unstake - [x] Classic unstake-wait-finish-unstake - [x] User trip-meter, measure rewards - [x] distribute staking/unstaking - [x] retrieve unstaked and ready - [x] NEAR/SKASH Liquidity Pool, Add/Remove liquidity - [x] clearing mechanism on stake to restore liquidity in the NSLP - [ ] act as a NEP-xxx MULTI-FUN-TOK (multi-token contract). Implement for NEAR, SKASH and G-SKASH - [ ] Dividends-pool SKASH/G-SKASH - [ ] Staking-loans to whitelisted validators - [ ] Emergency Staking (from the nslp) to whitelisted validators #### Test - [ ] Unit Tests - [x] Simulation tests - [ ] Full code coverage #### Staking pool list - [x] List selected staking pools, getting weight, staked & unstaked - [x] add a staking pool, set weight #### Governing - [x] Mint and distribute G-SKASH with rewards - [ ] Phase II - Governing DAO #### Infrastructure - [ ] External chron to call distribute() - [ ] compute remainig epoch time - [ ] withelist pools before adding them - [ ] auto-unstake SKASH in the NSLP (when the clearing mechanism is not enough) #### Expansions - [ ] USDN: Create a collateral-based stablecoin similar to Compound's DAI, using NEAR & SKASH as collateral
keypom_fydp-frontend
.github workflows ci-cd.yml README.md index.html package.json public vite.svg src App.css assets react.svg data db.json vite.config.js
# React + Vite This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. Currently, two official plugins are available: - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh useful commands: npm run dev <!-- no longer needed: json-server -w ./data/db.json --> basic setup using this tutorial: https://www.youtube.com/watch?v=yO8XWvi0Hms&list=PL4cUxeGkcC9hcnIeryurNMMcGBHp7AYlP&index=4
noemk2_minify_near
Cargo.toml README.md build.sh minify.sh src lib.rs
Hola mundo en near con Rust ================== Introducción a holamundo en near (Rust) ================== un holamundo en near protocol, este contrato te perminte: 1. print "Hello world" 2. print "Hello " + $USER 👨‍💻 Instalación en local =========== Para correr este proyecto en local debes seguir los siguientes pasos: Paso 1: Pre - Requisitos ------------------------------ 1. Asegúrese de tener todos los [prequisitos para compilar en rust] (Install Rustup , Add wasm target to your toolchain) 3. Crear un test near account [NEAR test account] 4. Instalar el NEAR CLI globally: [near-cli] es una interfaz de linea de comando (CLI) para interacturar con NEAR blockchain yarn install --global near-cli Step 2: Configura tu NEAR CLI ------------------------------- Configura tu near-cli para autorizar su cuenta de prueba creada recientemente: near login Step 3: Clonar Repositorio ------------------------------- Este comando nos permite clonar el repositorio de nuestro proyecto ```bash git clone https://github.com/noemk2/holamundo_rs.git ``` Una vez que hayas descargado el repositorio, asegurate de ejecutar los comandos dentro del repositorio descargado. Puedes hacerlo con ```bash cd holamundo_rs/ ``` Step 4: Realiza el BUILD para implementación de desarrollo de contrato inteligente ------------------------------------------------------------------------------------ Instalar dependencias ```bash cargo check ``` Cree el código de contrato inteligente e implemente el servidor de desarrollo local: ```bash sh build.sh ``` Cree la variable local $CONTRACT_NAME (permite guardar tu contrato temporal en una variable facil de recordar) ```bash source ./neardev/dev-account.env ``` ¡Felicitaciones, ahora tendrá un entorno de desarrollo local ejecutándose en NEAR TestNet! ✏️ Comando view : request estatico ----------------------------------------------- Permite imprimir "Hello world" Para Linux: ```bash near view $CONTRACT_NAME hello_world --account-id <username>.testnet ``` ✏️ Comando call : request dinamico -------------------------------------------- Permite imprimir "Hello " + <username> .testnet Para Linux : ```bash near call $CONTRACT_NAME hello --account-id <username>.testnet ``` 🤖 Test ================== Las pruebas son parte del desarrollo, luego, para ejecutar las pruebas en el contrato inteligente , debe ejecutar el siguiente comando: ```bash cargo test -- --nocapture ``` This directory contains tools for the contract size minification. Requirements: * cargo install wasm-snip wasm-gc * apt install binaryen wabt WARNING: minification could be rather aggressive, so you must test the contract after minificaion. Standalone NEAR runtime (https://github.com/nearprotocol/nearcore/tree/master/runtime/near-vm-runner) could be helpful here. Current approach to minification is the following: * snip (i.e. just replace with unreachable instruction) few known fat functions from the standard library (such as float formatting and panic related) * run wasm-gc to eliminate all functions reachable from the snipped functions * strip unneeded sections, such as names * run Binaryen wasm-opt, which cleans up the rest ============================================== [create-near-app]: https://github.com/near/create-near-app [prequisitos para compilar en rust]: https://github.com/near/near-sdk-rs#pre-requisites [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [NEAR test account]: https://docs.near.org/docs/develop/basics/create-account#creating-a-testnet-account
near-examples_counter-js
.devcontainer devcontainer.json .github workflows tests-rs.yml tests-ts.yml README.md contract-rs Cargo.toml README.md rust-toolchain.toml src lib.rs tests sandbox.rs contract-ts README.md package.json sandbox-ts main.ava.ts src contract.ts tsconfig.json frontend assets global.css index.html index.js near-wallet.js package.json
# Counter Examples This repository contains examples for a simple counter in both Rust and JavaScript, and an examples of a frontend interacting with a Counter smart contract. ## Repositories - [Counter TS Examples](contract-ts) - [Counter RS Example](contract-rs) - [Counter Frontend Example](frontend) # Count on NEAR Contract Example The smart contract exposes methods to interact with a counter stored in the NEAR network. ## How to Build Locally? Install [`cargo-near`](https://github.com/near/cargo-near) and run: ```bash cargo near build ``` ## How to Test Locally? ```bash cargo test ``` ## How to Deploy? Deployment is automated with GitHub Actions CI/CD pipeline. To deploy manually, install [`cargo-near`](https://github.com/near/cargo-near) and run: ```bash cargo near deploy <account-id> ``` ## How to Interact? _In this example we will be using [NEAR CLI](https://github.com/near/near-cli) to intract with the NEAR blockchain and the smart contract_ _If you want full control over of your interactions we recommend using the [near-cli-rs](https://near.cli.rs)._ ### Get the Counter `get_num` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the counter value near view <contract-account-id> get_num ``` ### Modify the Counter `increment`, `decrement` and `reset` change the contract's state, for which they are `call` methods. `Call` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set increment the counter near call <contract-account-id> increment --accountId --accountId <your-account> ``` ## Useful Links - [cargo-near](https://github.com/near/cargo-near) - NEAR smart contract development toolkit for Rust - [near CLI-rs](https://near.cli.rs) - Iteract with NEAR blockchain from command line - [NEAR Rust SDK Documentation](https://docs.near.org/sdk/rust/introduction) - [NEAR Documentation](https://docs.near.org) - [NEAR StackOverflow](https://stackoverflow.com/questions/tagged/nearprotocol) - [NEAR Discord](https://near.chat) - [NEAR Telegram Developers Community Group](https://t.me/neardev) - NEAR DevHub: [Telegram](https://t.me/neardevhub), [Twitter](https://twitter.com/neardevhub) # Count on NEAR Contract The smart contract exposes methods to interact with a counter stored in the NEAR network. ```ts val: number = 0; @view // Public read-only method: Returns the counter value. get_num(): number { return this.val } @call // Public method: Increment the counter. increment() { this.val += 1; near.log(`Increased number to ${this.val}`) } @call // Public method: Decrement the counter. decrement() { this.val -= 1; near.log(`Decreased number to ${this.val}`) } @call // Public method - Reset to zero. reset() { this.val = 0; near.log(`Reset counter to zero`) } ``` <br /> # Quickstart 1. Make sure you have installed [node.js](https://nodejs.org/en/download/package-manager/) >= 16. 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash npm run deploy ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Get the Counter `get_num` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the counter value near view <dev-account> get_num ``` <br /> ## 3. Modify the Counter `increment`, `decrement` and `reset` change the contract's state, for which they are `call` methods. `Call` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set increment the counter near call <dev-account> increment --accountId <dev-account> ``` **Tip:** If you would like to call `increment` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`.
HinojosaAcevedoJ_web3-clubDeEventos
README.md as-pect.config.js asconfig.json package-lock.json package.json src as_types.d.ts contrato __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts tsconfig.json utils.ts
# Club de eventos Este es un proyecto desarrollado en assemblyscript para la certificación de NCD de near protocol Hispano ## Contenido Este repositorio contiene un contrato inteligente con los siguientes métodos: ### Escritura: * `setCiudad` * `setMiembro` * `setEvento` * `setAsistente` ### Lectura: * `getCiudades` * `getCiudad` * `getMiembro` * `getMiembros` * `getEvento` * `getEventos` * `getAsistentes` * `getAsistente` ## Uso ### Compilando y desplegando Lo primero que debemos hacer es instalar las dependencias necesarias para que el proyecto funcione. ```sh npm install ``` ó ```sh yarn install ``` Una vez hecho esto, podemos compilar el código. ```sh npm run build ``` ó ```sh yarn build ``` El contrato compilado en WebAssembly se guarda en la carpeta `build/debug/`. Ahora solo es necesario desplegarlo en una cuenta de desarrollo. ```sh near dev-deploy build/debug/contrato.wasm ``` ### Usando variables de entorno Una vez compilado y desplegado tu proyecto, vamos a requerir identificar la cuenta neardev. Esta la puedes encontrar en el archivo `AssemblyScript/neardev/neardev`. Podemos almacenar este contrato en una variable de entorno ejecutando lo siguiente en la consola, y sustituyendo por tu cuenta de desarrollo: ```sh export CONTRATO=dev-0000000000000-000000000 ``` Haciendo esto, podemos comprobar que la variable `CONTRATO` tiene almacenada nuestra cuenta dev. ```sh echo $CONTRATO ``` ### Métodos El primer metodo es crear una ciudad, en este caso no requiere ningún near la creación de esta. Nos pedirá un ID y nombre de esta. ```sh near call $CONTRATO setCiudad '{"id":1,"nombre":"NombreCiudad"}' --accountId tucuenta.testnet ``` El segundo metodo es crear un evento el cual no nos pedirá nears para realizar la creación de este y nos pedirá un id, nombre, ubicación, fecha, hora, descripción y si se encuentra activo o no. ```sh near call $CONTRATO setEvento '{"id":1,"nombre":"Evento de bienvenida", "ubicacion":"Santiago-Chile","fecha":"2 de julio 2022","hora":"20:00hrs","descripcion":"evento de bienvenida a nuevos miembros","activo":true}' --accountId tucuenta.testnet ``` El tercer metodo es crear un miembro, en este caso nos pedirá 2 nears para poder ser miembros de este club y ser mayores de edad. ```sh near call $CONTRATO setMiembro '{"nombre":"Jorge","edad":"25","tipoMiembro":"Administrador","ciudadMiembro":"Santiago-Chile"}' --accountId tucuenta.testnet --amount 2 ``` Y nuestro último metodo setter es para crear asistentes a eventos el cual nos pedirá 20 nears para poder asistir. ```sh near call $CONTRATO setAsistente '{"nombre":"Jorge","nombreEvento":"Evento de bienvenida", "ciudadEvento":"Santiago-Chile"}' --accountId tucuenta.testnet --amount 20 ``` Claramente para cada uno de estos metodos necesitamos por lo menos tener 1 registrado. El primero de ellos es `getCiudades`, el cual regresará todas las ciudades registradas. ```sh near view $CONTRATO getCiudades ``` Luego esta el `getCiudad` el cual nos pedirá un id y regresará la ciudad si se encuentra. ```sh near view $CONTRATO getCiudad '{"id":"1"}' ``` Para listar los eventos inscritos `getEventos`, el cual nos regresará todos los eventos inscritos que esten activos e inactivos ```sh near view $CONTRATO getEventos ``` Para encontrar un solo evento `getEvento`, el cual nos pedirá un id y regresará si este se encuentra. ```sh near view $CONTRATO getEvento '{"id":"1"}' ``` El metodo `getMiembros` para listar todos los miembros inscritos en el club. ```sh near view $CONTRATO getMiembros ``` Para buscar un miembro en particular `getMiembro` nos pedirá su cuenta de near y veremos si se encuentra en el club. ```sh near view $CONTRATO getMiembro '{"cuenta":"cuenta.testnet"}' ``` Para mostrar la lista de todos los asistentes a todos los eventos `getAsistentes` ```sh near view $CONTRATO getAsistentes ``` Para buscar si una persona asistirá `getAsistente`, nos pedirá su cuenta de near y nos mostrará si actualmente asistirá o asistió a algún evento. ```sh near view $CONTRATO getAsistente '{"cuenta":"cuenta.testnet"}' ``` Y nuestro último metodo es para pasar un evento de activo a inactivo, en caso de realizar su cancelación o que ya se ha realizado. Este comando actualizará automaticamente el estado del evento, una vez ejecutado. ```sh near call $CONTRATO setEventoEstado '{"id":"1"}' --accountId cuenta.testnet ```
nguoimanhme_NEAR-Account-Utilities-2
README.md config.js package.json
# NEAR Utilities A collection of utilities to help with NEAR account management, development and troubleshooting ## Setup - Clone this repo - Run `yarn` ## Collecting Keys Find all TestNet accounts and copy them to `~/.near-credentials` _This is for Linux and macOS systems only_ - Run `yarn collect-keys` ## Accounts Report Generate a report of accounts available on the NEAR network by scanning `~/.near-credentials` for all files ending in .json - Run `yarn accounts` _Expected Output_ ![Accounts Report](/assets/accounts-report-output.png) ## Account Keys Report Generate a report of account keys on the NEAR network by scanning `~/.near-credentials` for all files ending in .json - Run `yarn keys` _Expected Output_ **Testnet** ![Accounts Report Testnet](/assets/keys-report-output-testnet.png) **Localnet** ![Accounts Report Localnet](/assets/keys-report-output-localnet.png) ## Storage Report Generate a report of decoded state stored on an account - Run `yarn storage <account>` _Expected Output_ ![Storage Report](/assets/storage-report-output.png) _Alternate Expected Output_ ![Storage Report with no output](/assets/storage-report-no-output.png)
MediumThor_components
.eslintrc.js .prettierrc.js CODE_OF_CONDUCT.md README.md index.d.ts lib cjs apollo block.d.ts client.d.ts minichef.d.ts tokenDayDatas.d.ts components Box Box.d.ts box.stories.d.ts index.d.ts Bridge BridgeCard bridgeCard.stories.d.ts index.d.ts styles.d.ts BridgeInputsWidget bridgeInputsWidget.stories.d.ts index.d.ts styles.d.ts types.d.ts BridgeRoute bridgeRouteWidget.stories.d.ts index.d.ts styles.d.ts types.d.ts BridgeTransfer bridgeTransfer.stories.d.ts index.d.ts styles.d.ts types.d.ts bridge.stories.d.ts index.d.ts styles.d.ts Button Button.d.ts button.stories.d.ts index.d.ts styles.d.ts types.d.ts Checkbox Checkbox.d.ts checkbox.stories.d.ts index.d.ts styles.d.ts types.d.ts CheckboxGroup CheckboxGroup.d.ts checkoxgroup.stories.d.ts index.d.ts styles.d.ts types.d.ts CircleLoader index.d.ts styles.d.ts CoinDescription index.d.ts Collapsed index.d.ts styles.d.ts types.d.ts CurrencyInput CurrencyInput.d.ts currencyInput.stories.d.ts index.d.ts styles.d.ts types.d.ts CurrencyLogo currencyLogo.stories.d.ts index.d.ts styles.d.ts DoubleCurrencyLogo DoubleCurrencyLogo.d.ts doubleLogo.stories.d.ts index.d.ts styles.d.ts Drawer drawer.stories.d.ts index.d.ts styled.d.ts DropdownMenu dropdownMenu.stories.d.ts index.d.ts Icons AvaxLogo.d.ts CflrLogo.d.ts LoaderIcon.d.ts Loading.d.ts LogoIcon.d.ts index.d.ts Loader Loader.d.ts index.d.ts loader.stories.d.ts Logo index.d.ts Modal index.d.ts MyPortfolio MyPortfolio.d.ts PortfolioRow.d.ts index.d.ts myportfolio.stories.d.ts styleds.d.ts NetworkSelection NetworkSelection.d.ts index.d.ts networkSelection.stories.d.ts styled.d.ts types.d.ts NewsWidget NewsWidget.d.ts index.d.ts newsWidget.stories.d.ts styleds.d.ts types.d.ts NumberOptions NumberOptions.d.ts index.d.ts number.stories.d.ts styled.d.ts types.d.ts Pagination index.d.ts pagination.stories.d.ts styleds.d.ts Pools AddLiquidity ConfirmPoolDrawer index.d.ts styled.d.ts PoolPriceBar index.d.ts styled.d.ts index.d.ts styleds.d.ts AddLiquidityDrawer index.d.ts AddLiquidityModal SearchToken.d.ts createPair.stories.d.ts index.d.ts styleds.d.ts ClaimDrawer index.d.ts ClaimReward claimReward.stories.d.ts index.d.ts styleds.d.ts DetailModal DetailView index.d.ts styleds.d.ts Details index.d.ts styled.d.ts EarnedDetail earnedDetail.stories.d.ts index.d.ts styleds.d.ts Header index.d.ts styled.d.ts StatDetail index.d.ts styleds.d.ts index.d.ts poolDetail.stories.d.ts EarnWidget EarnOption index.d.ts styled.d.ts index.d.ts styled.d.ts FarmDrawer index.d.ts PangoChef ClaimReward claimReward.stories.d.ts index.d.ts styleds.d.ts Compound compound.stories.d.ts index.d.ts styleds.d.ts EarnDetail index.d.ts styleds.d.ts Stake ConfirmDrawer.d.ts index.d.ts styleds.d.ts PoolCard PoolCardV1.d.ts PoolCardV2.d.ts PoolCardV3.d.ts PoolCardView.d.ts PoolCardViewV3.d.ts poolCard.stories.d.ts styleds.d.ts PoolImportModal PoolImport index.d.ts styleds.d.ts PositionCard index.d.ts styleds.d.ts index.d.ts poolImport.stories.d.ts styleds.d.ts PoolList PoolCardListView.d.ts PoolListV1.d.ts PoolListV2.d.ts PoolListV3.d.ts styleds.d.ts PoolV1.d.ts PoolV2.d.ts PoolV3.d.ts Remove index.d.ts styleds.d.ts RemoveDrawer index.d.ts RemoveFarm index.d.ts styleds.d.ts RemoveLiquidity index.d.ts styleds.d.ts RemoveLiquidityDrawer index.d.ts RewardTokens index.d.ts Stake SelectPoolDrawer PoolRow.d.ts index.d.ts styled.d.ts index.d.ts styleds.d.ts Wallet WalletCard index.d.ts styleds.d.ts walletCard.stories.d.ts index.d.ts styleds.d.ts index.d.ts mock.d.ts Portfolio Portfolio.d.ts ToggleBalanceButton.d.ts index.d.ts portfolio.stories.d.ts styleds.d.ts RadioButton RadioButton.d.ts index.d.ts radio.stories.d.ts styles.d.ts types.d.ts RadioButtonGroup RadioButtonGroup.d.ts index.d.ts radiogroup.stories.d.ts styles.d.ts types.d.ts SarManageWidget AddStake index.d.ts styleds.d.ts Claim index.d.ts styleds.d.ts Compound RewardsInfo.d.ts index.d.ts styleds.d.ts ConfirmDrawer index.d.ts styled.d.ts Title.d.ts Unstake index.d.ts styleds.d.ts index.d.ts sarManageWidget.stories.d.ts styleds.d.ts types.d.ts SarNFTPortfolio Portfolio.d.ts index.d.ts sarportfolio.stories.d.ts styleds.d.ts SarStakeWidget index.d.ts sarStake.stories.d.ts styleds.d.ts SearchModal filtering.d.ts sorting.d.ts ShowMore ShowMore.d.ts index.d.ts styled.d.ts SlippageInput index.d.ts slippageInput.stories.d.ts styled.d.ts Stat Stat.d.ts index.d.ts stat.stories.d.ts styled.d.ts Steps Step.d.ts Steps.d.ts index.d.ts steps.stories.d.ts styles.d.ts types.d.ts SwapWidget ConfirmLimitOrderDrawer FiateValue index.d.ts index.d.ts styled.d.ts ConfirmSwapDrawer index.d.ts styled.d.ts LimitOrder index.d.ts styled.d.ts LimitOrderDetailInfo index.d.ts styled.d.ts MarketOrder index.d.ts styled.d.ts RetryDrawer index.d.ts styled.d.ts SearchModal filtering.d.ts sorting.d.ts SelectTokenDrawer CurrencyRow.d.ts index.d.ts styled.d.ts Settings WarningModal.d.ts index.d.ts styled.d.ts SwapDetailInfo index.d.ts styled.d.ts SwapRoute index.d.ts styled.d.ts TokenListDrawer TokenListRow.d.ts index.d.ts styled.d.ts TokenListOrigin index.d.ts TokenWarningModal index.d.ts styled.d.ts TradeOption index.d.ts styled.d.ts Warning index.d.ts styled.d.ts confirmPriceImpactWithoutFee.d.ts index.d.ts styled.d.ts swapWidget.stories.d.ts Switch Switch.d.ts index.d.ts switch.stories.d.ts types.d.ts Tabs Tab index.d.ts TabList index.d.ts TabPanel index.d.ts Tabs.d.ts index.d.ts styles.d.ts tabs.stories.d.ts Text Text.d.ts index.d.ts text.stories.d.ts TextInput TextInput.d.ts index.d.ts styles.d.ts textInput.stories.d.ts types.d.ts ToggleButtons ToggleButtons.d.ts index.d.ts styles.d.ts togglebuttons.stories.d.ts types.d.ts Tooltip index.d.ts tooltip.stories.d.ts TransactionCompleted index.d.ts styled.d.ts transactionCompleted.stories.d.ts WalletModal Option index.d.ts styles.d.ts PendingView index.d.ts styles.d.ts index.d.ts styles.d.ts types.d.ts walletModal.stories.d.ts WatchList CoinChart.d.ts CurrencyPopover CurrencyRow.d.ts index.d.ts styled.d.ts WatchList.d.ts WatchlistRow.d.ts index.d.ts styleds.d.ts watchList.stories.d.ts index.d.ts connectors BitKeepConnector index.d.ts DefiConnector declarations.d.ts index.d.ts types.d.ts NearConnector index.d.ts NetworkConnector.d.ts WalletProviders CommonEVMProvider.d.ts NearProvider.d.ts index.d.ts index.d.ts constants abis arcanumPair.d.ts erc20.d.ts rewarderViaMultiplier.d.ts staking-rewards.d.ts index.d.ts lists.d.ts multicall index.d.ts tokens.d.ts data Allowances.d.ts Reserves.d.ts TotalSupply.d.ts multiChainsHooks.d.ts hooks Tokens.d.ts Trades.d.ts index.d.ts multiChainsHooks.d.ts useApproveCallback.d.ts useContract.d.ts useCurrencyPrice.d.ts useDebounce.d.ts useENS.d.ts useFetchListCallback.d.ts useGetTransactionSignature.d.ts useInterval.d.ts useIsWindowVisible.d.ts useOnClickOutside.d.ts useParsedQueryString.d.ts usePrevious.d.ts useSwapCallback.d.ts useToggle.d.ts useToggledVersion.d.ts useTraceUpdate.d.ts useTransactionDeadline.d.ts useUSDCPrice.d.ts useWrapCallback.d.ts i18n.d.ts index.d.ts state index.d.ts papplication actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts pburn actions.d.ts hooks.d.ts reducer.d.ts pglobal actions.d.ts plists actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts pmint actions.d.ts hooks.d.ts reducer.d.ts pmulticall actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts pnews hooks.d.ts ppangoChef hooks.d.ts types.d.ts pportfolio hooks.d.ts psarstake hooks.d.ts pstake actions.d.ts hooks.d.ts multiChainsHooks.d.ts reducer.d.ts types.d.ts pswap actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts ptoken actions.d.ts hooks.d.ts reducer.d.ts ptransactions actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts puser actions.d.ts hooks.d.ts reducer.d.ts pwallet hooks.d.ts multiChainsHooks.d.ts pwatchlists actions.d.ts hooks.d.ts reducer.d.ts theme components.d.ts index.d.ts styled.d.ts utils cache.d.ts charts.d.ts chunkArray.d.ts computeFiatValuePriceImpact.d.ts contenthashToUri.d.ts getLibrary.d.ts getTokenList.d.ts getTokenLogoURL.d.ts index.d.ts isZero.d.ts listVersionLabel.d.ts maxAmountSpend.d.ts near.d.ts parseENSAddress.d.ts prices.d.ts query.d.ts retry.d.ts toChildrenArray.d.ts uriToHttp.d.ts wrappedCurrency.d.ts esm apollo block.d.ts client.d.ts minichef.d.ts tokenDayDatas.d.ts components Box Box.d.ts box.stories.d.ts index.d.ts Bridge BridgeCard bridgeCard.stories.d.ts index.d.ts styles.d.ts BridgeInputsWidget bridgeInputsWidget.stories.d.ts index.d.ts styles.d.ts types.d.ts BridgeRoute bridgeRouteWidget.stories.d.ts index.d.ts styles.d.ts types.d.ts BridgeTransfer bridgeTransfer.stories.d.ts index.d.ts styles.d.ts types.d.ts bridge.stories.d.ts index.d.ts styles.d.ts Button Button.d.ts button.stories.d.ts index.d.ts styles.d.ts types.d.ts Checkbox Checkbox.d.ts checkbox.stories.d.ts index.d.ts styles.d.ts types.d.ts CheckboxGroup CheckboxGroup.d.ts checkoxgroup.stories.d.ts index.d.ts styles.d.ts types.d.ts CircleLoader index.d.ts styles.d.ts CoinDescription index.d.ts Collapsed index.d.ts styles.d.ts types.d.ts CurrencyInput CurrencyInput.d.ts currencyInput.stories.d.ts index.d.ts styles.d.ts types.d.ts CurrencyLogo currencyLogo.stories.d.ts index.d.ts styles.d.ts DoubleCurrencyLogo DoubleCurrencyLogo.d.ts doubleLogo.stories.d.ts index.d.ts styles.d.ts Drawer drawer.stories.d.ts index.d.ts styled.d.ts DropdownMenu dropdownMenu.stories.d.ts index.d.ts Icons AvaxLogo.d.ts CflrLogo.d.ts LoaderIcon.d.ts Loading.d.ts LogoIcon.d.ts index.d.ts Loader Loader.d.ts index.d.ts loader.stories.d.ts Logo index.d.ts Modal index.d.ts MyPortfolio MyPortfolio.d.ts PortfolioRow.d.ts index.d.ts myportfolio.stories.d.ts styleds.d.ts NetworkSelection NetworkSelection.d.ts index.d.ts networkSelection.stories.d.ts styled.d.ts types.d.ts NewsWidget NewsWidget.d.ts index.d.ts newsWidget.stories.d.ts styleds.d.ts types.d.ts NumberOptions NumberOptions.d.ts index.d.ts number.stories.d.ts styled.d.ts types.d.ts Pagination index.d.ts pagination.stories.d.ts styleds.d.ts Pools AddLiquidity ConfirmPoolDrawer index.d.ts styled.d.ts PoolPriceBar index.d.ts styled.d.ts index.d.ts styleds.d.ts AddLiquidityDrawer index.d.ts AddLiquidityModal SearchToken.d.ts createPair.stories.d.ts index.d.ts styleds.d.ts ClaimDrawer index.d.ts ClaimReward claimReward.stories.d.ts index.d.ts styleds.d.ts DetailModal DetailView index.d.ts styleds.d.ts Details index.d.ts styled.d.ts EarnedDetail earnedDetail.stories.d.ts index.d.ts styleds.d.ts Header index.d.ts styled.d.ts StatDetail index.d.ts styleds.d.ts index.d.ts poolDetail.stories.d.ts EarnWidget EarnOption index.d.ts styled.d.ts index.d.ts styled.d.ts FarmDrawer index.d.ts PangoChef ClaimReward claimReward.stories.d.ts index.d.ts styleds.d.ts Compound compound.stories.d.ts index.d.ts styleds.d.ts EarnDetail index.d.ts styleds.d.ts Stake ConfirmDrawer.d.ts index.d.ts styleds.d.ts PoolCard PoolCardV1.d.ts PoolCardV2.d.ts PoolCardV3.d.ts PoolCardView.d.ts PoolCardViewV3.d.ts poolCard.stories.d.ts styleds.d.ts PoolImportModal PoolImport index.d.ts styleds.d.ts PositionCard index.d.ts styleds.d.ts index.d.ts poolImport.stories.d.ts styleds.d.ts PoolList PoolCardListView.d.ts PoolListV1.d.ts PoolListV2.d.ts PoolListV3.d.ts styleds.d.ts PoolV1.d.ts PoolV2.d.ts PoolV3.d.ts Remove index.d.ts styleds.d.ts RemoveDrawer index.d.ts RemoveFarm index.d.ts styleds.d.ts RemoveLiquidity index.d.ts styleds.d.ts RemoveLiquidityDrawer index.d.ts RewardTokens index.d.ts Stake SelectPoolDrawer PoolRow.d.ts index.d.ts styled.d.ts index.d.ts styleds.d.ts Wallet WalletCard index.d.ts styleds.d.ts walletCard.stories.d.ts index.d.ts styleds.d.ts index.d.ts mock.d.ts Portfolio Portfolio.d.ts ToggleBalanceButton.d.ts index.d.ts portfolio.stories.d.ts styleds.d.ts RadioButton RadioButton.d.ts index.d.ts radio.stories.d.ts styles.d.ts types.d.ts RadioButtonGroup RadioButtonGroup.d.ts index.d.ts radiogroup.stories.d.ts styles.d.ts types.d.ts SarManageWidget AddStake index.d.ts styleds.d.ts Claim index.d.ts styleds.d.ts Compound RewardsInfo.d.ts index.d.ts styleds.d.ts ConfirmDrawer index.d.ts styled.d.ts Title.d.ts Unstake index.d.ts styleds.d.ts index.d.ts sarManageWidget.stories.d.ts styleds.d.ts types.d.ts SarNFTPortfolio Portfolio.d.ts index.d.ts sarportfolio.stories.d.ts styleds.d.ts SarStakeWidget index.d.ts sarStake.stories.d.ts styleds.d.ts SearchModal filtering.d.ts sorting.d.ts ShowMore ShowMore.d.ts index.d.ts styled.d.ts SlippageInput index.d.ts slippageInput.stories.d.ts styled.d.ts Stat Stat.d.ts index.d.ts stat.stories.d.ts styled.d.ts Steps Step.d.ts Steps.d.ts index.d.ts steps.stories.d.ts styles.d.ts types.d.ts SwapWidget ConfirmLimitOrderDrawer FiateValue index.d.ts index.d.ts styled.d.ts ConfirmSwapDrawer index.d.ts styled.d.ts LimitOrder index.d.ts styled.d.ts LimitOrderDetailInfo index.d.ts styled.d.ts MarketOrder index.d.ts styled.d.ts RetryDrawer index.d.ts styled.d.ts SearchModal filtering.d.ts sorting.d.ts SelectTokenDrawer CurrencyRow.d.ts index.d.ts styled.d.ts Settings WarningModal.d.ts index.d.ts styled.d.ts SwapDetailInfo index.d.ts styled.d.ts SwapRoute index.d.ts styled.d.ts TokenListDrawer TokenListRow.d.ts index.d.ts styled.d.ts TokenListOrigin index.d.ts TokenWarningModal index.d.ts styled.d.ts TradeOption index.d.ts styled.d.ts Warning index.d.ts styled.d.ts confirmPriceImpactWithoutFee.d.ts index.d.ts styled.d.ts swapWidget.stories.d.ts Switch Switch.d.ts index.d.ts switch.stories.d.ts types.d.ts Tabs Tab index.d.ts TabList index.d.ts TabPanel index.d.ts Tabs.d.ts index.d.ts styles.d.ts tabs.stories.d.ts Text Text.d.ts index.d.ts text.stories.d.ts TextInput TextInput.d.ts index.d.ts styles.d.ts textInput.stories.d.ts types.d.ts ToggleButtons ToggleButtons.d.ts index.d.ts styles.d.ts togglebuttons.stories.d.ts types.d.ts Tooltip index.d.ts tooltip.stories.d.ts TransactionCompleted index.d.ts styled.d.ts transactionCompleted.stories.d.ts WalletModal Option index.d.ts styles.d.ts PendingView index.d.ts styles.d.ts index.d.ts styles.d.ts types.d.ts walletModal.stories.d.ts WatchList CoinChart.d.ts CurrencyPopover CurrencyRow.d.ts index.d.ts styled.d.ts WatchList.d.ts WatchlistRow.d.ts index.d.ts styleds.d.ts watchList.stories.d.ts index.d.ts connectors BitKeepConnector index.d.ts DefiConnector declarations.d.ts index.d.ts types.d.ts NearConnector index.d.ts NetworkConnector.d.ts WalletProviders CommonEVMProvider.d.ts NearProvider.d.ts index.d.ts index.d.ts constants abis arcanumPair.d.ts erc20.d.ts rewarderViaMultiplier.d.ts staking-rewards.d.ts index.d.ts lists.d.ts multicall index.d.ts tokens.d.ts data Allowances.d.ts Reserves.d.ts TotalSupply.d.ts multiChainsHooks.d.ts hooks Tokens.d.ts Trades.d.ts index.d.ts multiChainsHooks.d.ts useApproveCallback.d.ts useContract.d.ts useCurrencyPrice.d.ts useDebounce.d.ts useENS.d.ts useFetchListCallback.d.ts useGetTransactionSignature.d.ts useInterval.d.ts useIsWindowVisible.d.ts useOnClickOutside.d.ts useParsedQueryString.d.ts usePrevious.d.ts useSwapCallback.d.ts useToggle.d.ts useToggledVersion.d.ts useTraceUpdate.d.ts useTransactionDeadline.d.ts useUSDCPrice.d.ts useWrapCallback.d.ts i18n.d.ts index.d.ts state index.d.ts papplication actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts pburn actions.d.ts hooks.d.ts reducer.d.ts pglobal actions.d.ts plists actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts pmint actions.d.ts hooks.d.ts reducer.d.ts pmulticall actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts pnews hooks.d.ts ppangoChef hooks.d.ts types.d.ts pportfolio hooks.d.ts psarstake hooks.d.ts pstake actions.d.ts hooks.d.ts multiChainsHooks.d.ts reducer.d.ts types.d.ts pswap actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts ptoken actions.d.ts hooks.d.ts reducer.d.ts ptransactions actions.d.ts hooks.d.ts reducer.d.ts updater.d.ts puser actions.d.ts hooks.d.ts reducer.d.ts pwallet hooks.d.ts multiChainsHooks.d.ts pwatchlists actions.d.ts hooks.d.ts reducer.d.ts theme components.d.ts index.d.ts styled.d.ts utils cache.d.ts charts.d.ts chunkArray.d.ts computeFiatValuePriceImpact.d.ts contenthashToUri.d.ts getLibrary.d.ts getTokenList.d.ts getTokenLogoURL.d.ts index.d.ts isZero.d.ts listVersionLabel.d.ts maxAmountSpend.d.ts near.d.ts parseENSAddress.d.ts prices.d.ts query.d.ts retry.d.ts toChildrenArray.d.ts uriToHttp.d.ts wrappedCurrency.d.ts package.json rollup.config.js src .storybook main.js preview-head.html preview.js apollo block.js client.js minichef.js tokenDayDatas.js assets images analytics.svg arrow-right.svg bitkeep.svg circleTick.svg coinbaseWalletIcon.svg near.svg rabby.svg talisman.svg walletConnectIcon.svg components Box index.ts Button index.ts CurrencyInput index.ts DoubleCurrencyLogo index.ts Drawer styled.ts Icons index.ts Loader index.ts MyPortfolio index.ts NetworkSelection index.ts styled.ts NewsWidget index.ts NumberOptions styled.ts Pools AddLiquidity ConfirmPoolDrawer styled.ts DetailModal Details styled.ts Stake SelectPoolDrawer styled.ts mock.ts SarManageWidget ConfirmDrawer styled.ts types.ts SearchModal filtering.ts sorting.ts ShowMore index.ts styled.ts Steps index.ts SwapWidget ConfirmLimitOrderDrawer styled.ts ConfirmSwapDrawer styled.ts RetryDrawer styled.ts SearchModal filtering.ts sorting.ts SelectTokenDrawer styled.ts Settings styled.ts SwapRoute styled.ts TokenListDrawer styled.ts confirmPriceImpactWithoutFee.ts Switch index.ts Text index.ts TextInput index.ts TransactionCompleted styled.ts WatchList CurrencyPopover styled.ts index.ts connectors BitKeepConnector index.ts DefiConnector declarations.ts index.ts types.ts NearConnector index.ts NetworkConnector.ts WalletProviders CommonEVMProvider.ts NearProvider.ts index.ts fortmatic.d.ts index.ts constants abis arcanumPair.ts erc20.json erc20.ts erc20_bytes32.json pangochef.json rewarder-via-multiplier.json rewarderViaMultiplier.ts sar.json staking-rewards.ts weth.json index.ts lists.ts multicall abi.json index.ts tokens.ts data Allowances.ts Reserves.ts TotalSupply.ts multiChainsHooks.ts hooks Tokens.ts Trades.ts multiChainsHooks.ts useApproveCallback.ts useContract.ts useCurrencyPrice.ts useDebounce.ts useENS.ts useFetchListCallback.ts useGetTransactionSignature.ts useInterval.ts useIsWindowVisible.ts useParsedQueryString.ts usePrevious.ts useSwapCallback.ts useToggle.ts useToggledVersion.ts useTraceUpdate.ts useTransactionDeadline.ts useUSDCPrice.ts useWrapCallback.ts i18n.ts locales de.json en.json es.json fr.json pt-br.json tr.json vn.json zh.json react-app-env.d.ts state index.ts papplication actions.ts hooks.ts reducer.ts pburn actions.ts hooks.ts reducer.ts pglobal actions.ts plists actions.ts hooks.ts reducer.ts updater.ts pmint actions.ts hooks.ts reducer.ts pmulticall actions.ts hooks.ts reducer.ts pnews hooks.ts ppangoChef hooks.ts types.ts pportfolio hooks.ts psarstake hooks.ts pstake actions.ts hooks.ts multiChainsHooks.ts reducer.ts types.ts pswap actions.ts hooks.ts reducer.ts updater.ts ptoken actions.ts hooks.ts reducer.ts ptransactions actions.ts reducer.ts puser actions.ts reducer.ts pwallet hooks.ts multiChainsHooks.ts pwatchlists actions.ts hooks.ts reducer.ts theme styled.ts utils cache.ts charts.ts chunkArray.ts contenthashToUri.ts getLibrary.ts getTokenList.ts getTokenLogoURL.ts index.ts isZero.ts listVersionLabel.ts maxAmountSpend.ts near.ts parseENSAddress.ts prices.ts query.ts retry.ts toChildrenArray.ts uriToHttp.ts wrappedCurrency.ts tsconfig.json
# components Ui Kit for Arcanum ## Getting started For getting started please follow this [guide](src/stories/introduction.stories.mdx)
esaminu_test-rs-boilerplate-7
.eslintrc.yml .github ISSUE_TEMPLATE 01_BUG_REPORT.md 02_FEATURE_REQUEST.md 03_CODEBASE_IMPROVEMENT.md 04_SUPPORT_QUESTION.md config.yml PULL_REQUEST_TEMPLATE.md labels.yml workflows codeql.yml deploy-to-console.yml labels.yml lock.yml pr-labels.yml stale.yml .gitpod.yml README.md contract Cargo.toml README.md build.sh deploy.sh src lib.rs docs CODE_OF_CONDUCT.md CONTRIBUTING.md SECURITY.md frontend App.js assets global.css logo-black.svg logo-white.svg index.html index.js near-interface.js near-wallet.js package.json start.sh ui-components.js integration-tests Cargo.toml src tests.rs package.json
<h1 align="center"> <a href="https://github.com/near/boilerplate-template-rs"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_light.png"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> <img alt="" src="https://raw.githubusercontent.com/near/boilerplate-template-rs/main/docs/images/pagoda_logo_dark.png"> </picture> </a> </h1> <div align="center"> Rust Boilerplate Template <br /> <br /> <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=bug&template=01_BUG_REPORT.md&title=bug%3A+">Report a Bug</a> · <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=enhancement&template=02_FEATURE_REQUEST.md&title=feat%3A+">Request a Feature</a> . <a href="https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+">Ask a Question</a> </div> <div align="center"> <br /> [![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) [![code with love by near](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-near-ff1414.svg?style=flat-square)](https://github.com/near) </div> <details open="open"> <summary>Table of Contents</summary> - [About](#about) - [Built With](#built-with) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Installation](#installation) - [Usage](#usage) - [Roadmap](#roadmap) - [Support](#support) - [Project assistance](#project-assistance) - [Contributing](#contributing) - [Authors & contributors](#authors--contributors) - [Security](#security) </details> --- ## About This project is created for easy-to-start as a React + Rust skeleton template in the Pagoda Gallery. It was initialized with [create-near-app]. Clone it and start to build your own gallery project! ### Built With [create-near-app], [amazing-github-template](https://github.com/dec0dOS/amazing-github-template) Getting Started ================== ### Prerequisites Make sure you have a [current version of Node.js](https://nodejs.org/en/about/releases/) installed – we are targeting versions `16+`. Read about other [prerequisites](https://docs.near.org/develop/prerequisites) in our docs. ### Installation Install all dependencies: npm install Build your contract: npm run build Deploy your contract to TestNet with a temporary dev account: npm run deploy Usage ===== Test your contract: npm test Start your frontend: npm start Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages ## Roadmap See the [open issues](https://github.com/near/boilerplate-template-rs/issues) for a list of proposed features (and known issues). - [Top Feature Requests](https://github.com/near/boilerplate-template-rs/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Top Bugs](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction) - [Newest Bugs](https://github.com/near/boilerplate-template-rs/issues?q=is%3Aopen+is%3Aissue+label%3Abug) ## Support Reach out to the maintainer: - [GitHub issues](https://github.com/near/boilerplate-template-rs/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+) ## Project assistance If you want to say **thank you** or/and support active development of Rust Boilerplate Template: - Add a [GitHub Star](https://github.com/near/boilerplate-template-rs) to the project. - Tweet about the Rust Boilerplate Template. - Write interesting articles about the project on [Dev.to](https://dev.to/), [Medium](https://medium.com/) or your personal blog. Together, we can make Rust Boilerplate Template **better**! ## Contributing First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**. Please read [our contribution guidelines](docs/CONTRIBUTING.md), and thank you for being involved! ## Authors & contributors The original setup of this repository is by [Dmitriy Sheleg](https://github.com/shelegdmitriy). For a full list of all authors and contributors, see [the contributors page](https://github.com/near/boilerplate-template-rs/contributors). ## Security Rust Boilerplate Template follows good practices of security, but 100% security cannot be assured. Rust Boilerplate Template is provided **"as is"** without any **warranty**. Use at your own risk. _For more information and to report security issues, please refer to our [security documentation](docs/SECURITY.md)._ # Hello NEAR Contract The smart contract exposes two methods to enable storing and retrieving a greeting in the NEAR network. ```rust const DEFAULT_GREETING: &str = "Hello"; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] pub struct Contract { greeting: String, } impl Default for Contract { fn default() -> Self { Self{greeting: DEFAULT_GREETING.to_string()} } } #[near_bindgen] impl Contract { // Public: Returns the stored greeting, defaulting to 'Hello' pub fn get_greeting(&self) -> String { return self.greeting.clone(); } // Public: Takes a greeting, such as 'howdy', and records it pub fn set_greeting(&mut self, greeting: String) { // Record a log permanently to the blockchain! log!("Saving greeting {}", greeting); self.greeting = greeting; } } ``` <br /> # Quickstart 1. Make sure you have installed [rust](https://rust.org/). 2. Install the [`NEAR CLI`](https://github.com/near/near-cli#setup) <br /> ## 1. Build and Deploy the Contract You can automatically compile and deploy the contract in the NEAR testnet by running: ```bash ./deploy.sh ``` Once finished, check the `neardev/dev-account` file to find the address in which the contract was deployed: ```bash cat ./neardev/dev-account # e.g. dev-1659899566943-21539992274727 ``` <br /> ## 2. Retrieve the Greeting `get_greeting` is a read-only method (aka `view` method). `View` methods can be called for **free** by anyone, even people **without a NEAR account**! ```bash # Use near-cli to get the greeting near view <dev-account> get_greeting ``` <br /> ## 3. Store a New Greeting `set_greeting` changes the contract's state, for which it is a `change` method. `Change` methods can only be invoked using a NEAR account, since the account needs to pay GAS for the transaction. ```bash # Use near-cli to set a new greeting near call <dev-account> set_greeting '{"message":"howdy"}' --accountId <dev-account> ``` **Tip:** If you would like to call `set_greeting` using your own account, first login into NEAR using: ```bash # Use near-cli to login your NEAR account near login ``` and then use the logged account to sign the transaction: `--accountId <your-account>`.
gfirik_crossword-near-react
README.md package.json public index.html manifest.json robots.txt src App.css App.js hardcoded-data.js index.css index.js near config.js utils.js
# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in your browser. The page will reload when you make changes.\ You may also see any lint errors in the console. ### `npm test` Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `npm run build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ### `npm run eject` **Note: this is a one-way operation. Once you `eject`, you can't go back!** If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/). ### Code Splitting This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) ### Analyzing the Bundle Size This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) ### Making a Progressive Web App This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) ### Advanced Configuration This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) ### Deployment This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) ### `npm run build` fails to minify This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Ife2002_Near-Postr
Postr .cache 00 5060d7b3583af17691f8002c4bb8b6.json bc13bf3b4406370c93694ed02c6e50.json ec1e09e0490aead955d11702b9265e.json 01 2425d528a1bc4040c49c2f9f154a2d.json bd4d54111d527ca58a4bc02d013205.json 03 b180bfa291cc7a02cb29c172cc00c5.json 04 630ce055fa1b3eea57204854801c28.json 05 16faa8df6ed6a37a7913fda8d092c9.json 08 08bafcb8e0e8fca5a0899eb2780758.json 09 d99faacc0bfc296ed6d73e8d978551.json 0a 20956762e2e029951f4c839abf3b75.json 0b 36aa6c0a66716dfe8e68d11f9a6aff.json 0c 541bccce400b18042bd34e0672389f.json 0d 0b6bc3ef9b9a420d468c4792918001.json 12 6197b3ab40aa17c2da19015f7ab7b0.json 13 a3599e9f301b580df7f7dde575eaa4.json 14 32bd7c20db13163c74e96fcb985236.json 15 b0659e6364dc1111233838ec8033b6.json e0e4126e0ff8357f0c4a5080d7e6c0.json 16 e17da1c4a1c181c2aad45093f6bad3.json ff90541b0ac9a91923307251ae3c01.json 17 5bc7cf52d43c2436f9196e1659ff82.json 18 7efe1a9b39b7c1e42682157cfe5174.json bc04781a04c4f12b783cd337ecc39d.json ffdfec57454c0be1579bc9057d7976.json 19 ae19ede80f3633d6d0c6d430ab3c13.json 1a 6642a660fd4f59b58fe3925bc099aa.json 1c aa63effd120e1abcc8a3ba67410b3c.json 22 411031614dacef724af4863e92f6f0.json e3dd7911dde7ff6e9f481f13b7e00e.json 23 7e3ae3dfeceddce0e058170099e4d7.json d0e1b0b81c9960b291c87b8848c886.json 24 0099e7649692e27bb682847a9eaac2.json 279f116d18e5dd836a34382675ec2e.json 26 901380d9b0147c8cd6213392520830.json 28 8da183823b602a280533e0457b166f.json 98486712a6916bf6d5dbffdd18b9fb.json 9e35bb9696070c1d10a932dd22c91b.json 2c 0bf5a76930e12802647554a8d53dd4.json 4797cc010020fcd07183c7798f9314.json 97266a396b5f76575afd8640985027.json c0168ec3e9ca32383b2d418745e4e7.json 2d 35d3c25823128aa5d726837f7aa8bd.json f5cea8317e7381fba916368fce6fe8.json 2e d05b4c7da0a6078c29a276f3dfd5d9.json 2f 1d0e2a75c92429e207084b6b9cfe58.json 44007476660a1a7631db102ca64739.json 31 84480c22272e2674a17edb9543731f.json 32 848b5150ef6d9db6487068a199208f.json 33 a68ec98d0da0aaedaa1bb741045d48.json 34 1553589018149a66857a510449dff3.json 36 14a86e78913242ceaa535e52188ae1.json 7aabf2380e391283aeacd9f0a894ad.json 37 e70890d4e86ed43e052a38c17278f3.json 38 1e3d461f62fe4f7f264f82250ae6ef.json 39 26e4956965ce14b7705365057de8a4.json 866e962f8be8101669e55d1e0e9248.json 3a ee72972004c23027448e15f54e8742.json f5936b299b1f068ca574cf1ca3c4a8.json 3b 369b39606072b07ff846ab384b4867.json ade41fbaddf2c519bef79fbfd4fa41.json e2b5cb97839045e411401809fc05dc.json 3c a66a742d282652e639449e02872d75.json 3e 4605079dffee06d0c8b65ac40e09e1.json 3f 390813db07775a9ebb41a130330f5a.json 41 e34557996560ba9b2fb38b82b677b1.json 42 6d0448959d91b380c39963ade2c8ec.json 43 0f6ab76093263cbaad888a4ec6d83f.json 1c409dc18c6821da26dc74c0d20281.json 7c7244bda4ff02125679ce8fbfdeeb.json 826cc9d8ef9e08235b7a484dad2dba.json a18574b9b98e529a67ae60ca63f80d.json 45 00d680395f55553089a204522e92c5.json 37bf4eb61fbe50c0f3e2ba39a49083.json 44bcb54f0538b99900a34c10f18581.json 46 8dc9b7b4b602f33db4365b0b2157da.json 48 a3238ef89a423f4a8f11369b3ea2d4.json e1fabda3cd50fb80404a5fb236f437.json 4a 60525bb5e0844d344058e856782365.json 9ee8307831fe33e5e7502bc050decb.json 4b 994404874323cc3226abab60c88499.json 4d 1a96f5f9673f01d1b1cc2178258a68.json 4e fe317a36da3969d482e377ad2736c7.json 50 b799f5804c31bea3054445faf55407.json 51 d534155012d7f7e0a152bc738ac435.json 52 b26e99980479d987c25a2559fdec0a.json 53 280534173a8dd2cfd978528959aa85.json 55 1808d3e19fbadc5cf7c501ec9a3a52.json 8a38483d54fdba2f615128380f3604.json a881788dfcd6b9b41d3e245c24cdf1.json 56 0b10a050936c894a91cf38aae32f98.json 57 52eb255cfaa7fb383648c70ec0fd27.json 59 16a5b8a94772d5b648e1e072e4d5c3.json 5b 4ac6a795d7216a8ceae3e89df4f90b.json c0b167dabb8d6e9012633fe4dd4c5c.json 5c 258a98c1919a2ba5ee717796ce4a22.json 5e c23566a01b655477a24b058f9ec9b9.json 5f 2a81fe498b097722ac70d3b2a0f0ee.json 60 bfa50df6a09bc07e72670e3837ec1b.json d7131dc784f6e4b64f99a3792ce935.json f850f12b25e7dee54b234b15b5a446.json 63 81cd5e5cdee78636a673feaaf01f19.json 65 3c09c416ad332a45469f51ad763704.json d9081d7def23090e18e91bda88373f.json dd8fd9a82052911473ecd40d9dbc35.json 67 16490f5546e4ead2abaa008f130147.json 69 51591f3944cbdf61f0a14415ff6a38.json 6b d3f9141a25c82a4462a331df0dbbb2.json 6c d91f9e992b1b8dcd711fee3a6aa62d.json d9a4a66824f01eef537dc172bb0652.json 6d 932e8d8a0d085b9270e3d04581b955.json 6f b91854c44fd8b07583b994a0190973.json 70 10d724777a31c115330b05b1a2087d.json 128df7d65afc0db20e89e0d10343d0.json 97e73a8a7640ad07c301b95d2978dd.json 72 94ea925c51c569b63261eb34aadb21.json 73 e6b68d6ab7886873ca5ad1d5b7adb0.json 75 755b8d38c9f2a8ea763a09bc50b965.json 76 417fde90abb8a728a7523c866d6382.json 86557aec27dcf4df3f045343a85f78.json 77 eb6285def25c073c8fd9491802c653.json 79 5a545ed7ada4f2d69f91742b515f59.json 7a 4c0355d68996176e17dfef2703bd8a.json 7b f9630f25e38ac9a839a609b39044e8.json 7c 1e663e28477be025498c6e5cc2ae84.json 4e00331acbbcbe5d8328b9660829dd.json 7d 52bbaf031abb54dcb44d06b0cbf2b5.json 7f 2a0c35f60e04f45493609214590291.json 80 35364f5e5334da0b89ffd2d2aa5316.json fd4f50ac42a07dc1a0aa86e126a3c5.json 81 007384a8698cbb3cacd39ae1337f87.json 83 be6e92d4bb3d97fbbf1233bace0255.json cecaa9be041c26e4fd9000fa18975b.json 85 14145d10484377534369eb48bfab3f.json 86 db6a2b24b74395b1be6897c1813b9a.json 87 8b06a2ec9ecf7262c80ae2c54d6cb1.json 88 852dab7bd2556d5a706424b65c19bd.json acac4bdfa7b866ef586b29eb3cc830.json 89 2d28294924b7a2f39b783ff89d773b.json 8a 681628ebed2789e40938f7d4ed6b48.json 8b 55c9e1973b7bbf3242640de6ee9293.json 8c 3ee132c13b6f9749bdb4d580e9218a.json 8d c12ea697060fda0bcc90aaac0b09d4.json 8e 5cdf345e30e66a94ce4befd91360de.json 8f b7c2e7af7b75e484a03c424e349900.json 90 bc004d1bcc67b3d48b34681b9bbe81.json 91 deb95be722055760437db6c53b72bd.json 92 47e745fc5ea86967d6e0d37362ea69.json 538cdad98885bdd2cc17e83a25119c.json 93 f7c145ebe01d24148a724c95e8d975.json 94 859cd5088c62c2aa0175c7fea549ca.json 96 737f96c3431493739907169196ae5f.json 97 4b451f0c74f4d0d3f0db341b644e59.json 98 91bd5b962dc46890d2c00ce214b803.json c46edcb2471c6ef7fc1b3715cd412e.json d3a4673ebe4434aa2e63ab0e036c0e.json 99 3a7097129a8e731d4d6910a454596d.json 9a aec23b3816c6da2ccbf47a6d659098.json c49ba4a2364c0dc499f1bf810a00c4.json 9b 717f75824e9d79c81080296e3aa019.json 9c 232dd1a44d2d325fda713a20462784.json 9f269cefe77dc2fc484257f12128f2.json 9e 3e7eeedce59ce31328875bdfcb0f58.json 9f cf681971b09420b54aafdc5b434554.json a0 bd0df24659cd0a15c64053ee4a2ffa.json f7a4717d6a5d5d7046a1dc0497afbd.json a2 c3163c3192d06a7d2d632b269c2ce1.json a3 4fa0b3eb8d0f268269211f0d63f4cd.json a40a380a9175251dee7d49fd8faab1.json a4 5a2df40c67c5b2c79d404ad640b7a3.json a5 753da0dd27299cdf306bf8aeb2ad28.json 7b0b2effc6e8d861aed97e9b7813e5.json bcfdaefe9cfe25430f093456d326b2.json a6 0abe02ecdcecbd4ccb1ae8e9a9447b.json 295e59d37cb56ce770ea28dbffa91c.json a7 bdfcc935219f1ca9aa0d8c924730aa.json a8 8f0c8a5aa8f03379523b1059020e2d.json a9 5b98b23f309f9209e2042dcdb2706f.json 7f345ab30f8d07d9af4eb1d3a65d70.json 86a264bf209ba3fdb51bce779795d2.json ab7342d16c0128a2de442f86b6c687.json dbc6e63087b7ffd81e264e7c74e002.json aa 6dbee0bdf4e89bcc246cddfa9b9dcd.json ab 2152a9f98aa076303f93f32a4aa694.json 344e2a5516a065cce6fd5f2e26d4a8.json ac 737107e40fad479bea7ba3505f9e34.json d591acb88ddb12a8b697eb11471365.json ae 5f9934f894dda4e3f5fddc58187b06.json af 5d10df7f98ad00a24340d9ef01157e.json 8fbe4254fc16db6c1ac24d5a72c19b.json b0 03e975593833b13bd2640bd034dfd9.json b1 c48f9ecfef170f7a67074183dc7a05.json b2 ca3d19a79fe8953dd1db953e40bae2.json b3 029264d2317d361c624a1187dabee9.json b4 8023432ab4328e5ab355adab864ffc.json afea3292223b743ebfe24849067e8c.json b5 d69fb56bf559725669b3d64db4f524.json ee19d5cbd399852d37b62256bc7500.json b7 3afcec4dafbbc9c0977d266897e41d.json e3c543d055c2b5f67249472c7c5046.json b9 4bb98203517b96b847f6ac27fda872.json efd40164f49dbc35234381e27bced5.json bd 1d313e90d2f3003923d82bc4a5c00d.json 7f340c1195ccfaf886806d82c9227a.json 929924f12eff139b98d283039c802e.json be c72ae31c1b2e3f97ed683be884fb86.json bf 18297c284af84f9a030776ce0d1866.json c0 79e739a8f04d0852bc18f16f805ae9.json df0ffa360ee09e47c8304979b03d5f.json c1 6b1be3e5b664c6f03ded012ab07491.json d198da5db68212789411b7fc4716d4.json c2 b42e69dd94ac5b7e86ac8902315d28.json d5b822df025e14fea715a42d43ee95.json c4 18fa07a03b57ddca3daec4e6a96bd2.json cc16f3d460139d0abf7fff105c373d.json c5 ee36810ba54edd5695f2c722eacdf7.json c6 73977b939a87a1aae7a8dd844e43d5.json c7 44a8990c579df8866c678cf7281f6d.json c8 f31b539a45a1d3a223710d4ea30be9.json c9 7761f8dc540834a282fadd3b8a8903.json 85b9b8f83ff5bc00f9ca2e55f531a4.json cb 9d493c4b0e1a4e82616cebf534dd31.json e24607878ee977cb315a87b09d23cb.json ce a7ed952920b8d4a7cb94b93c6ff0e4.json cf 082870425f076745bdb6f7b423a805.json 543b41157e97fcd9bc132601e8e3f4.json d0 3c6e48a734d6f1110fd39d712f8e67.json d3 27c3f79c079fdf0294abdb94aa0895.json 5e0933bfba950b1913381b11c0cec2.json 60e756785c98b7676e762a978c2dae.json d4 6eb0649e385ea16a5346ff8fe244c6.json b3a7fa26c0331587aa6038053b175c.json d5 141704212fbc2a073d8242a93a34a7.json d9 8c98e2269d1f99e5356b0067f54e77.json da 4ed69a86ae3dd5bb3ae02b9fc4fb77.json db 69e4bfa3377f487b4f52e562cdcc74.json dc 70a81a8c5eb4a478ab4c7215b5e7ef.json dd 8d6b2ab329a2a037a549661087bc38.json e1 5c5407f2657928bafb147a1820a71d.json e3 c8a594011542fed30b411ad883f5ac.json e4 62dc3a31d82f04bdf5551fc975c208.json e6 d3946122aeabb521185dc18070ff47.json ea b6a1a4c13c46eb90f1df6306d431e3.json ec 2d29cd11176fe7a3ea32b0de8b7a04.json ed 57741166f3bb85d955da0bdb2bd62d.json ef a616f7fb9858ac6515351d255004ae.json b9859e923d36a5423fde6ed8c56701.json c0681f7c9d0abd62e0d053690ec940.json c83f53f9bb9e7f62a6916e65ac3f3d.json eca1aee1b6c249a5bf0ce1fcd26179.json f0 2ec7cddc6a062def4a4b9b2f2900b7.json f1 03bbdb183ce066d7d0f2ad8f00a8e1.json 2ede7b02afbe8f9a2e107199c789bd.json f2 69e2d093647df8fd3434f3febc4f45.json eb417fd01868f9dd4e320acdf45846.json f3 1827de58c710147726de3b3cece6c1.json d98585c78fa66add38eeafcc5a424f.json f4 18c426ef219c149bd9c3e3608909ef.json 6068bb5c14f93f2e133ce03cf42d40.json be53b4b2853bb92bac9a93524ebc15.json f5 57fd0f53458ef137f483dd128beb0a.json a09ce08bd29a6c0792d32e47eafdd0.json c32a111829af7616ecac6526131030.json f7 040fc9423a9d31ca6f9caa564f8abe.json 1c4a28c2450a3f6c12e1f0c4cfac98.json 6b7a68ed88fa32cf4fbd20390e0bc3.json 84718b2cab2888a3d9a0291709a4b0.json e0be449cce451b1050b03eee440dbd.json f8 09942a8525149d200b1d7823f81977.json b4cff345f214d7716ff50133b13a70.json f9 5db661bda81053126cee6e25d30ca0.json fb 0e3921a7b36084ee392101ad813e94.json 6e79c11cb2fbd9e306b04445ddf39a.json 7a21856ff0c2e6245d3b0e03699115.json fa8807c6b7996ce2cb1df4a13eccbf.json fd 5c750fec28b63d1304b16012e83522.json 750efeb45e48635da63a130064c1f7.json .gitpod.yml README.md as-pect.config.js asconfig.js assembly __tests__ as-pect.d.ts main.spec.ts as_types.d.ts main.ts model.ts tsconfig.json babel.config.js dist index.html logo-black.3916bf24.svg logo-black.eab7a939.svg logo-white.7fec831f.svg logo-white.c927fc35.svg src.b05bda48.css src.bb0a5435.js src.e31bb0bc.css neardev dev-account.env shared-test-staging test.near.json shared-test test.near.json package.json src __mocks__ fileMock.js assets logo-black.svg logo-white.svg components App.js Main.js Navbar.js NavbarItems.js Welcome.js config.js global.css index.html index.js jest.init.js main.test.js utils.js wallet login index.html Welcome to debugging React README.md
# Postr[Alpha] Postr is a Decentralized App for students and teachers to shear their ideas and problems in one place without any censorship. the main purpose is to amplify the voice of students on every platform. # Postr Postr is a Decentralized App for students and teachers to share their ideas and problems in one place without any censorship. the main purpose is to amplify the voice of students on every platform.
LNThanhNhan_near_test_homework
Cargo.toml README.md build.sh src lib.rs target .rustc_info.json debug .fingerprint Inflector-5962d0ee2f0ab2a7 lib-inflector.json autocfg-8497f8f13c575f1b lib-autocfg.json base64-67f16044398e34e1 lib-base64.json block-buffer-0b4d319be4fd2962 lib-block-buffer.json block-padding-e4abca64c0d91b47 lib-block-padding.json borsh-00c0ed6201939a87 lib-borsh.json borsh-derive-3fc3a9e7c607a542 lib-borsh-derive.json borsh-derive-internal-25accbd39140158d lib-borsh-derive-internal.json borsh-schema-derive-internal-24b0c13c2eba131e lib-borsh-schema-derive-internal.json bs58-399f011f0e3aa849 lib-bs58.json byte-tools-c51c648f507b25cd lib-byte-tools.json byteorder-2beca6e08cc77239 lib-byteorder.json byteorder-3740ff4234b846af build-script-build-script-build.json byteorder-b7b0cc13064f0dc3 run-build-script-build-script-build.json cfg-if-64f39b0abd2c6529 lib-cfg-if.json digest-38bf4e8a7fc886d9 lib-digest.json fake-simd-180d15f5e4411f76 lib-fake-simd.json generic-array-400dea204cfe0dad lib-generic_array.json hashbrown-18bd00266afc7208 lib-hashbrown.json hashbrown-265d3ea029cf55c4 lib-hashbrown.json hashbrown-52a061ed487f380b run-build-script-build-script-build.json hashbrown-b1de485b4fbc03a6 build-script-build-script-build.json indexmap-85bc38343e344a63 run-build-script-build-script-build.json indexmap-e44ad34abd9cb652 lib-indexmap.json indexmap-f7801d0c23db9c2a build-script-build-script-build.json indexmap-fd4c12c1f424f7e2 lib-indexmap.json itoa-7da10d159ad8a567 lib-itoa.json itoa-d2e42375298d63c1 lib-itoa.json keccak-edefca4dd1a778f2 lib-keccak.json memory_units-1041b786cb189d0a lib-memory_units.json near-rpc-error-core-bccc53effe4d5399 lib-near-rpc-error-core.json near-rpc-error-macro-0382de45de48c8ac lib-near-rpc-error-macro.json near-runtime-fees-cf40eb778152d99a lib-near-runtime-fees.json near-sdk-798b2acd1aa9845d lib-near-sdk.json near-sdk-core-8c5aee82210d698c lib-near-sdk-core.json near-sdk-macros-5aadf9a367b22af9 lib-near-sdk-macros.json near-vm-errors-de3235a99c4a9c86 lib-near-vm-errors.json near-vm-logic-f632977e21a6d216 lib-near-vm-logic.json num-bigint-55db921311687b86 lib-num-bigint.json num-bigint-5a44f00822eb38cf run-build-script-build-script-build.json num-bigint-961bc7653184a6ce build-script-build-script-build.json num-integer-19085818edebd809 build-script-build-script-build.json num-integer-3c9ca51676fcb1fd lib-num-integer.json num-integer-b58c9c82f5e9f6c1 run-build-script-build-script-build.json num-rational-199ea9b43c73b570 build-script-build-script-build.json num-rational-a541723d254c7b85 run-build-script-build-script-build.json num-rational-ee546b03b108ad35 lib-num-rational.json num-traits-28342ebb51b463cc lib-num-traits.json num-traits-9860ccb24332a115 run-build-script-build-script-build.json num-traits-d3e70082bad03f61 build-script-build-script-build.json opaque-debug-206b7deb517f6e91 lib-opaque-debug.json proc-macro2-4eebffd35d498327 build-script-build-script-build.json proc-macro2-4f4370fcfdd66f38 run-build-script-build-script-build.json proc-macro2-6803377a652c25f5 lib-proc-macro2.json quote-78e04c4f920efb8a lib-quote.json ryu-263f8359c1b40103 build-script-build-script-build.json ryu-583b699d5316d6e3 lib-ryu.json ryu-aaf7e3fd80f72099 run-build-script-build-script-build.json ryu-e36ebf7b8f681271 lib-ryu.json serde-1004a6d1c6488505 run-build-script-build-script-build.json serde-35e72e84189f42aa build-script-build-script-build.json serde-e69d8791d8afb117 lib-serde.json serde-f7f173fa4715c944 lib-serde.json serde_derive-46a87d4d5b7fa5f7 lib-serde_derive.json serde_derive-6493be4f58c1a46f build-script-build-script-build.json serde_derive-86ceb6d35f326762 run-build-script-build-script-build.json serde_json-0257b1ba46d868ec build-script-build-script-build.json serde_json-2088e7b4f7d66365 lib-serde_json.json serde_json-9027e2431019e57f lib-serde_json.json serde_json-e5c3b71660802b6a run-build-script-build-script-build.json sha2-f74e104d028f9a31 lib-sha2.json sha3-0e2557cc28df9400 lib-sha3.json syn-1032ae44511ea2fc run-build-script-build-script-build.json syn-9efd638a29f0577b build-script-build-script-build.json syn-aa88e1e1e93488ef lib-syn.json typenum-05896738d34c221a lib-typenum.json typenum-c1392aee3f3f2e5f build-script-build-script-main.json typenum-ce41400f83b7b12b run-build-script-build-script-main.json unicode-xid-6578d94d58508895 lib-unicode-xid.json voting-contract-11ca181bf7f1b2c6 lib-voting-contract.json voting-contract-53886388026d3195 test-lib-voting-contract.json wee_alloc-68001fea00d8ab15 run-build-script-build-script-build.json wee_alloc-d11e3498696ba6da build-script-build-script-build.json wee_alloc-fd7ea929ac62d875 lib-wee_alloc.json winapi-0f5b929ed7378fa7 build-script-build-script-build.json winapi-557f5ea795eee31b run-build-script-build-script-build.json winapi-f1e6a1848fe5cfce lib-winapi.json build typenum-ce41400f83b7b12b out consts.rs op.rs tests.rs wee_alloc-68001fea00d8ab15 out wee_alloc_static_array_backend_size_bytes.txt release .fingerprint Inflector-10c620bdb7f37e48 lib-inflector.json autocfg-7080f947399998ae lib-autocfg.json borsh-derive-0a5d856924a191de lib-borsh-derive.json borsh-derive-internal-d6a22c5787129a45 lib-borsh-derive-internal.json borsh-schema-derive-internal-859910d27dd9a643 lib-borsh-schema-derive-internal.json byteorder-14e5f1ea0fb1a2d4 build-script-build-script-build.json hashbrown-38a2a6be6937adf5 build-script-build-script-build.json hashbrown-81a1179f9c7b369d run-build-script-build-script-build.json hashbrown-ff769d03083fc40a lib-hashbrown.json indexmap-425c6e2fd1645eb6 build-script-build-script-build.json indexmap-60e9b9f6af5b7cd0 run-build-script-build-script-build.json indexmap-f0bcc5c6b7491d8e lib-indexmap.json itoa-5d28ba32dcf3b4f3 lib-itoa.json near-rpc-error-core-c5b182296f6c5c4a lib-near-rpc-error-core.json near-rpc-error-macro-35f6acd2cea2c4bd lib-near-rpc-error-macro.json near-sdk-core-a4e02b9f041c743d lib-near-sdk-core.json near-sdk-macros-d9554d8666a26e90 lib-near-sdk-macros.json num-bigint-e424643e6dd44fa8 build-script-build-script-build.json num-integer-b752574f1c2be71e build-script-build-script-build.json num-rational-b2432b08a18b83af build-script-build-script-build.json num-traits-752685a5f99b08cf build-script-build-script-build.json proc-macro2-4aad333dc2222210 lib-proc-macro2.json proc-macro2-987cfff632dde32f build-script-build-script-build.json proc-macro2-9ee5da6299a7cf21 run-build-script-build-script-build.json quote-bf3cf341035db049 lib-quote.json ryu-441bad9e1fe4cfb4 run-build-script-build-script-build.json ryu-890250eede54ca2c lib-ryu.json ryu-e3e6f610ee5a2777 build-script-build-script-build.json serde-38e28d44c1b97d1f lib-serde.json serde-914239b6a50593bd build-script-build-script-build.json serde-9d1f60de7f45430b run-build-script-build-script-build.json serde_derive-0234273d2583bf17 run-build-script-build-script-build.json serde_derive-24aaa4aa5a60c0a4 lib-serde_derive.json serde_derive-a91b2aa473b7d295 build-script-build-script-build.json serde_json-163f085c2c12cf21 build-script-build-script-build.json serde_json-56e827cf0c99f70e run-build-script-build-script-build.json serde_json-ac5143134aa245ee lib-serde_json.json syn-9a224200adc27e20 lib-syn.json syn-d04fe065c30d53ba run-build-script-build-script-build.json syn-e9901600e9825885 build-script-build-script-build.json typenum-60a0239abc3a3d46 build-script-build-script-main.json unicode-xid-f7fe8aa993a31441 lib-unicode-xid.json wee_alloc-630d18744a8e9cfb build-script-build-script-build.json wasm32-unknown-unknown release .fingerprint base64-788235ac1251cec3 lib-base64.json block-buffer-f79cf6c163e88ff8 lib-block-buffer.json block-padding-bbde911a30bdfe0e lib-block-padding.json borsh-31b59d9a386f7de5 lib-borsh.json bs58-64079e0dd2967893 lib-bs58.json byte-tools-5f0d1d3448fa4a67 lib-byte-tools.json byteorder-a8abd57f7ef1f2c8 run-build-script-build-script-build.json byteorder-cc4871ea04245711 lib-byteorder.json cfg-if-5b4bd3e7b42c0687 lib-cfg-if.json digest-3ec8747dbee8093b lib-digest.json fake-simd-a2025185ead2ba14 lib-fake-simd.json generic-array-e9e5d2a6139d981c lib-generic_array.json hashbrown-57eefee66778e69c run-build-script-build-script-build.json hashbrown-6bfa1777a5a182d7 lib-hashbrown.json indexmap-61b88010925e16b2 run-build-script-build-script-build.json indexmap-cd1a29dfbda8b8f3 lib-indexmap.json itoa-8a61f695d3030699 lib-itoa.json keccak-cbc3eaf65e084a46 lib-keccak.json memory_units-fa13bb4534fdc75b lib-memory_units.json near-runtime-fees-a6c437fd431b5f17 lib-near-runtime-fees.json near-sdk-d3fc2a1c9cfa688b lib-near-sdk.json near-vm-errors-806654d4d3cd74c2 lib-near-vm-errors.json near-vm-logic-2ade917375f63e4d lib-near-vm-logic.json num-bigint-21c8c953e31dca8f run-build-script-build-script-build.json num-bigint-31fe5299bfa5875b lib-num-bigint.json num-integer-915988ee5537c6ca run-build-script-build-script-build.json num-integer-f63dcd6073d1c2cd lib-num-integer.json num-rational-02ca2dd4767cd8c1 lib-num-rational.json num-rational-c7ebc3b99cedf5df run-build-script-build-script-build.json num-traits-370ba597ca27e8a7 run-build-script-build-script-build.json num-traits-bbe523d7417b479f lib-num-traits.json opaque-debug-c0fdcf147de7a62e lib-opaque-debug.json ryu-5de1ebaae0203d29 lib-ryu.json ryu-efa515b455141ac0 run-build-script-build-script-build.json serde-41b8d9447e66ef65 lib-serde.json serde-a347a682f10c2169 run-build-script-build-script-build.json serde_json-2e2a167476e863e7 run-build-script-build-script-build.json serde_json-eb737452f1114f38 lib-serde_json.json sha2-6cf7d767ae679b46 lib-sha2.json sha3-f8e41c4e39fbcfe1 lib-sha3.json typenum-bead40e283a89e59 lib-typenum.json typenum-e2c1c5bf3444419c run-build-script-build-script-main.json voting-contract-1e23923e425e6c66 lib-voting-contract.json wee_alloc-490bad06ff9cb9a9 run-build-script-build-script-build.json wee_alloc-b308785581cbcd39 lib-wee_alloc.json build typenum-e2c1c5bf3444419c out consts.rs op.rs tests.rs wee_alloc-490bad06ff9cb9a9 out wee_alloc_static_array_backend_size_bytes.txt
# Voting Contract The purpose of this contract is solely for validators to vote on whether to unlock token transfer. Validators can call `vote` to vote for yes with the amount of stake they wish to put on the vote. If there are more than 2/3 of the stake at any given moment voting for yes, the voting is done. After the voting is finished, no one can further modify the contract.
Learn-NEAR-Hispano_NCD4L1--NEARFT-Kollage
rustapp .gitpod.yml README.md contract Cargo.toml README.md compile.js src lib.rs target .rustc_info.json debug .fingerprint Inflector-6a6e6be8f2e47224 lib-inflector.json ahash-ad1947787f482a4b lib-ahash.json aho-corasick-1eca80d0b91aeacf lib-aho_corasick.json autocfg-96dd2aedadd5121b lib-autocfg.json base64-4b1840b6c495cb7f lib-base64.json block-buffer-1748750b1eb7f309 lib-block-buffer.json block-buffer-5552b24aa4734e78 lib-block-buffer.json block-padding-406fc0c11a7262a2 lib-block-padding.json borsh-763a74df864da9ce lib-borsh.json borsh-derive-a6ad4ed040307019 lib-borsh-derive.json borsh-derive-internal-d8a4f794a5fa61d6 lib-borsh-derive-internal.json borsh-schema-derive-internal-c95a78fe9a7ec8a9 lib-borsh-schema-derive-internal.json bs58-0af6f19192286882 lib-bs58.json byte-tools-2923127ed59fd8d4 lib-byte-tools.json byteorder-084224a033b44fe3 run-build-script-build-script-build.json byteorder-e3acde06b02dd4df lib-byteorder.json byteorder-f9b2a90349860b23 build-script-build-script-build.json cfg-if-994b5f3eb16a4892 lib-cfg-if.json cfg-if-9a8e0d101f07c9ee lib-cfg-if.json convert_case-643f017c26b42f96 lib-convert_case.json derive_more-0446ef4682bae368 lib-derive_more.json digest-a67329822f71a47f lib-digest.json digest-d140ce48356254dd lib-digest.json generic-array-338cc4eff4bf6c42 lib-generic_array.json generic-array-342c28b9440fbd66 run-build-script-build-script-build.json generic-array-50d51a0e85a21207 build-script-build-script-build.json generic-array-57b7e2cec47fb0c1 lib-generic_array.json greeter-8364c77c8bc734fd test-lib-greeter.json greeter-98ace302c5fafa12 lib-greeter.json hashbrown-33d47039f9013d40 build-script-build-script-build.json hashbrown-3f29a709de468f43 run-build-script-build-script-build.json hashbrown-a71f21dcb5f3670a lib-hashbrown.json hashbrown-ecff110d0ae5a18b lib-hashbrown.json hex-4d226c024a798d7f lib-hex.json indexmap-275c489695cb24f1 run-build-script-build-script-build.json indexmap-889bc186566c6294 build-script-build-script-build.json indexmap-f6d1b20b39106d7e lib-indexmap.json itoa-a8b3c6234552bbb7 lib-itoa.json keccak-c0db808c3b1cf76f lib-keccak.json lazy_static-2745487a1a96fbec lib-lazy_static.json libc-2dbfe7374425239e run-build-script-build-script-build.json libc-6aede46b03bb5c0e build-script-build-script-build.json libc-b4ccf2b2f033adbb lib-libc.json memchr-0c6543273c26b9f2 build-script-build-script-build.json memchr-0e179cbd3b9ec5c4 lib-memchr.json memchr-bec9142486aab596 run-build-script-build-script-build.json memory_units-203db71d4ec8271e lib-memory_units.json near-primitives-core-e46dd83331c9d9d4 lib-near-primitives-core.json near-rpc-error-core-b0a94484cb89895c lib-near-rpc-error-core.json near-rpc-error-macro-2b4060551f792f2d lib-near-rpc-error-macro.json near-runtime-utils-f318a46220c2a593 lib-near-runtime-utils.json near-sdk-519fcc124701244c lib-near-sdk.json near-sdk-core-f39350e06ea36dda lib-near-sdk-core.json near-sdk-macros-544a17e2481cf319 lib-near-sdk-macros.json near-vm-errors-3db2958bbf35ab5d lib-near-vm-errors.json near-vm-logic-89d10559ced6c7f3 lib-near-vm-logic.json num-bigint-512ce7914335f081 lib-num-bigint.json num-bigint-5e48cd9d86b944e8 build-script-build-script-build.json num-bigint-ca98a85f9e625dec run-build-script-build-script-build.json num-integer-90687213c14adb2a build-script-build-script-build.json num-integer-ab659c6be2488b0e run-build-script-build-script-build.json num-integer-ea15b394b7ba7e5b lib-num-integer.json num-rational-4c579bbc43a9dfb0 lib-num-rational.json num-rational-df1e97d2e5695a40 run-build-script-build-script-build.json num-rational-ebee919e2e45c7cf build-script-build-script-build.json num-traits-24b0dd4f03eba2da build-script-build-script-build.json num-traits-41cac175fbfd6cf5 run-build-script-build-script-build.json num-traits-6bdd864b52f72369 lib-num-traits.json opaque-debug-640d5e0952666f5a lib-opaque-debug.json opaque-debug-6dd26d5815ec3f2b lib-opaque-debug.json proc-macro-crate-911befa4cbf09b6f lib-proc-macro-crate.json proc-macro2-847ab9055051dfba lib-proc-macro2.json proc-macro2-e8a4506ad5dc3475 build-script-build-script-build.json proc-macro2-fd5319623d4c9eb4 run-build-script-build-script-build.json quote-14b02e73be881a36 lib-quote.json regex-49070ed36559e549 lib-regex.json regex-syntax-a149fee8bfacd740 lib-regex-syntax.json ryu-04d456a144e77de5 build-script-build-script-build.json ryu-4014dcc13dc56664 run-build-script-build-script-build.json ryu-f1feddd0e09bd4a0 lib-ryu.json serde-077e2bef61db785e run-build-script-build-script-build.json serde-c47e294cd5d4ac76 lib-serde.json serde-e2ba84e54ee0a0d9 build-script-build-script-build.json serde_derive-bff4c5befda3d4e5 lib-serde_derive.json serde_derive-ce59a763ca04db89 build-script-build-script-build.json serde_derive-f143e28fec7a1c44 run-build-script-build-script-build.json serde_json-29d0c455bb7e5975 run-build-script-build-script-build.json serde_json-f6f513611d41244d lib-serde_json.json serde_json-f7c02ef7e2afc73b build-script-build-script-build.json sha2-69c4a5c08841b546 lib-sha2.json sha3-0d8ed0a0d33bc87e lib-sha3.json syn-4ca55f1b85745f3d build-script-build-script-build.json syn-bbbcfe7a3b017cdc run-build-script-build-script-build.json syn-ecf4b02b17cbdc98 lib-syn.json toml-ec75f40cf25b47e4 lib-toml.json typenum-7886cb1aa6a03f87 build-script-build-script-main.json typenum-86805692e11ee4f9 run-build-script-build-script-main.json typenum-c0a872026433d7fd lib-typenum.json unicode-xid-887efbed6d15bcc1 lib-unicode-xid.json version_check-022cfc20129296c9 lib-version_check.json wee_alloc-df9bf11e33101411 build-script-build-script-build.json wee_alloc-dfbaf68cd9bf3912 lib-wee_alloc.json wee_alloc-e3f56c0ee4f1ca40 run-build-script-build-script-build.json build num-bigint-ca98a85f9e625dec out radix_bases.rs typenum-86805692e11ee4f9 out consts.rs op.rs tests.rs wee_alloc-e3f56c0ee4f1ca40 out wee_alloc_static_array_backend_size_bytes.txt release .fingerprint Inflector-ae751522a61e2bd6 lib-inflector.json autocfg-a5b89b6155376cf1 lib-autocfg.json borsh-derive-0b4dc4583b280fe1 lib-borsh-derive.json borsh-derive-internal-05e128601ec4005b lib-borsh-derive-internal.json borsh-schema-derive-internal-6f98c24645fb1045 lib-borsh-schema-derive-internal.json byteorder-bae12cfd60134b39 build-script-build-script-build.json convert_case-375763a9dc42910f lib-convert_case.json derive_more-6b8ebe6180539569 lib-derive_more.json generic-array-87f93250f6430187 build-script-build-script-build.json hashbrown-4c51abd1e039a745 build-script-build-script-build.json hashbrown-50ab4e3fae167bac lib-hashbrown.json hashbrown-b336e594424d0bbc run-build-script-build-script-build.json indexmap-0f98972424a83dfa lib-indexmap.json indexmap-634a9db4c37f6676 run-build-script-build-script-build.json indexmap-f9b3a4948e215390 build-script-build-script-build.json itoa-68412a7105a564a3 lib-itoa.json memchr-22623c1c7fdf3cea build-script-build-script-build.json near-rpc-error-core-ece96ed1f1c61bac lib-near-rpc-error-core.json near-rpc-error-macro-22a12f851caeb1ac lib-near-rpc-error-macro.json near-sdk-core-b2104b06c055459d lib-near-sdk-core.json near-sdk-macros-e2a54f98207c5cd7 lib-near-sdk-macros.json num-bigint-cbc4c5ffe31eb0f2 build-script-build-script-build.json num-integer-b3324c60cf4da635 build-script-build-script-build.json num-rational-9c85919d7b697553 build-script-build-script-build.json num-traits-834c7aed566e8fe5 build-script-build-script-build.json proc-macro-crate-bddb6ff7c1e8002c lib-proc-macro-crate.json proc-macro2-2c50ae8c70839c73 run-build-script-build-script-build.json proc-macro2-aa30e6bade277ce4 build-script-build-script-build.json proc-macro2-ee326954d4f0a246 lib-proc-macro2.json quote-e76e7809e8f46abd lib-quote.json ryu-001a03d17d7b3200 build-script-build-script-build.json ryu-dad828022bb88749 run-build-script-build-script-build.json ryu-ffb6308e1b0965ac lib-ryu.json serde-22cd1e75b1f0bf31 lib-serde.json serde-372fa5ddaf8eade7 run-build-script-build-script-build.json serde-e8aff582f3dccec7 build-script-build-script-build.json serde_derive-034f49e9aa4552d5 build-script-build-script-build.json serde_derive-dbdfcf5a60ed62a1 lib-serde_derive.json serde_derive-f52698141469341b run-build-script-build-script-build.json serde_json-91bc21ccc70bd2a7 run-build-script-build-script-build.json serde_json-94b1c5b3fa6caf70 lib-serde_json.json serde_json-c14d8aeec5937ae9 build-script-build-script-build.json syn-6332345149be7254 lib-syn.json syn-6b90d65012a7d4af build-script-build-script-build.json syn-b65a6b522b9a0166 run-build-script-build-script-build.json toml-b9854212e95990db lib-toml.json typenum-7e206d034cefa43a build-script-build-script-main.json unicode-xid-014e8813bfd060bd lib-unicode-xid.json version_check-36c2e27e1b325dab lib-version_check.json wee_alloc-2f448da5b8485469 build-script-build-script-build.json rls .rustc_info.json debug .fingerprint Inflector-6a6e6be8f2e47224 lib-inflector.json ahash-c65113579932ddba lib-ahash.json aho-corasick-c19e3c0be6d333aa lib-aho_corasick.json autocfg-96dd2aedadd5121b lib-autocfg.json base64-67e403d2604239c1 lib-base64.json block-buffer-468e72edb4d41eb5 lib-block-buffer.json block-buffer-595164e24b949f1d lib-block-buffer.json block-padding-38ca8c36ce576d25 lib-block-padding.json borsh-d3458c7223810a24 lib-borsh.json borsh-derive-a6ad4ed040307019 lib-borsh-derive.json borsh-derive-internal-d8a4f794a5fa61d6 lib-borsh-derive-internal.json borsh-schema-derive-internal-c95a78fe9a7ec8a9 lib-borsh-schema-derive-internal.json bs58-d5e7911d8ef4ae61 lib-bs58.json byte-tools-c56bdbf7134590f5 lib-byte-tools.json byteorder-084224a033b44fe3 run-build-script-build-script-build.json byteorder-7a75a35959110742 lib-byteorder.json byteorder-f9b2a90349860b23 build-script-build-script-build.json cfg-if-4e05ec3f4dc9252e lib-cfg-if.json cfg-if-cefbc7f244377251 lib-cfg-if.json convert_case-643f017c26b42f96 lib-convert_case.json derive_more-0446ef4682bae368 lib-derive_more.json digest-4e809a2bf494c970 lib-digest.json digest-831870107d7d6493 lib-digest.json generic-array-071fac92b2b06e7a lib-generic_array.json generic-array-342c28b9440fbd66 run-build-script-build-script-build.json generic-array-50d51a0e85a21207 build-script-build-script-build.json generic-array-5182b22f2ee0a37f lib-generic_array.json greeter-8c4a64f8e71ba5dd lib-greeter.json greeter-d801efe467ef8b5b test-lib-greeter.json hashbrown-2f459d92a36420b6 lib-hashbrown.json hashbrown-33d47039f9013d40 build-script-build-script-build.json hashbrown-3f29a709de468f43 run-build-script-build-script-build.json hashbrown-a71f21dcb5f3670a lib-hashbrown.json hashbrown-fe89b2c9026578ff lib-hashbrown.json hex-8fb7da550b197f93 lib-hex.json indexmap-275c489695cb24f1 run-build-script-build-script-build.json indexmap-86dfd031358a0b49 lib-indexmap.json indexmap-889bc186566c6294 build-script-build-script-build.json indexmap-f6d1b20b39106d7e lib-indexmap.json itoa-01b257baa6dd0e17 lib-itoa.json itoa-a8b3c6234552bbb7 lib-itoa.json keccak-181d75253b5091e0 lib-keccak.json lazy_static-890aa9dffdd68514 lib-lazy_static.json libc-2dbfe7374425239e run-build-script-build-script-build.json libc-6aede46b03bb5c0e build-script-build-script-build.json libc-9587c6814ed4d329 lib-libc.json memchr-0b6cda4302c127c7 lib-memchr.json memchr-0c6543273c26b9f2 build-script-build-script-build.json memchr-bec9142486aab596 run-build-script-build-script-build.json memory_units-4be657b763fdb15f lib-memory_units.json near-primitives-core-ea8b35211cf3cc3c lib-near-primitives-core.json near-rpc-error-core-b0a94484cb89895c lib-near-rpc-error-core.json near-rpc-error-macro-2b4060551f792f2d lib-near-rpc-error-macro.json near-runtime-utils-773697d9e5508136 lib-near-runtime-utils.json near-sdk-6f956e8d5055892c lib-near-sdk.json near-sdk-core-f39350e06ea36dda lib-near-sdk-core.json near-sdk-macros-544a17e2481cf319 lib-near-sdk-macros.json near-vm-errors-c58cfeb13da93e95 lib-near-vm-errors.json near-vm-logic-1e0fd81cafd0619a lib-near-vm-logic.json num-bigint-5e48cd9d86b944e8 build-script-build-script-build.json num-bigint-94e689e02570adec lib-num-bigint.json num-bigint-ca98a85f9e625dec run-build-script-build-script-build.json num-integer-90687213c14adb2a build-script-build-script-build.json num-integer-ab659c6be2488b0e run-build-script-build-script-build.json num-integer-cfadc9752dde0905 lib-num-integer.json num-rational-380b0709e8cc1324 lib-num-rational.json num-rational-df1e97d2e5695a40 run-build-script-build-script-build.json num-rational-ebee919e2e45c7cf build-script-build-script-build.json num-traits-24b0dd4f03eba2da build-script-build-script-build.json num-traits-41cac175fbfd6cf5 run-build-script-build-script-build.json num-traits-7ce9ece26c17b7e0 lib-num-traits.json opaque-debug-0af46d77ce95c2ca lib-opaque-debug.json opaque-debug-94789f67b9a2a927 lib-opaque-debug.json proc-macro-crate-911befa4cbf09b6f lib-proc-macro-crate.json proc-macro2-847ab9055051dfba lib-proc-macro2.json proc-macro2-e8a4506ad5dc3475 build-script-build-script-build.json proc-macro2-fd5319623d4c9eb4 run-build-script-build-script-build.json quote-14b02e73be881a36 lib-quote.json regex-22f0b2e880b304e1 lib-regex.json regex-syntax-d521ed01ebd881e7 lib-regex-syntax.json ryu-04d456a144e77de5 build-script-build-script-build.json ryu-4014dcc13dc56664 run-build-script-build-script-build.json ryu-d2820bdb97bb6271 lib-ryu.json ryu-f1feddd0e09bd4a0 lib-ryu.json serde-077e2bef61db785e run-build-script-build-script-build.json serde-c47e294cd5d4ac76 lib-serde.json serde-d919ee8bf8092ab5 lib-serde.json serde-e2ba84e54ee0a0d9 build-script-build-script-build.json serde_derive-bff4c5befda3d4e5 lib-serde_derive.json serde_derive-ce59a763ca04db89 build-script-build-script-build.json serde_derive-f143e28fec7a1c44 run-build-script-build-script-build.json serde_json-29d0c455bb7e5975 run-build-script-build-script-build.json serde_json-4ba851a8eb219d60 lib-serde_json.json serde_json-f6f513611d41244d lib-serde_json.json serde_json-f7c02ef7e2afc73b build-script-build-script-build.json sha2-1926a42b011cf419 lib-sha2.json sha3-b60f3a12816ccc98 lib-sha3.json syn-4ca55f1b85745f3d build-script-build-script-build.json syn-bbbcfe7a3b017cdc run-build-script-build-script-build.json syn-ecf4b02b17cbdc98 lib-syn.json toml-ec75f40cf25b47e4 lib-toml.json typenum-2bececffc70791c0 lib-typenum.json typenum-7886cb1aa6a03f87 build-script-build-script-main.json typenum-86805692e11ee4f9 run-build-script-build-script-main.json unicode-xid-887efbed6d15bcc1 lib-unicode-xid.json version_check-022cfc20129296c9 lib-version_check.json wee_alloc-4bbe59d3dfbc898e lib-wee_alloc.json wee_alloc-df9bf11e33101411 build-script-build-script-build.json wee_alloc-e3f56c0ee4f1ca40 run-build-script-build-script-build.json build byteorder-f9b2a90349860b23 save-analysis build_script_build-f9b2a90349860b23.json generic-array-50d51a0e85a21207 save-analysis build_script_build-50d51a0e85a21207.json hashbrown-33d47039f9013d40 save-analysis build_script_build-33d47039f9013d40.json indexmap-889bc186566c6294 save-analysis build_script_build-889bc186566c6294.json libc-6aede46b03bb5c0e save-analysis build_script_build-6aede46b03bb5c0e.json memchr-0c6543273c26b9f2 save-analysis build_script_build-0c6543273c26b9f2.json num-bigint-5e48cd9d86b944e8 save-analysis build_script_build-5e48cd9d86b944e8.json num-bigint-ca98a85f9e625dec out radix_bases.rs num-integer-90687213c14adb2a save-analysis build_script_build-90687213c14adb2a.json num-rational-ebee919e2e45c7cf save-analysis build_script_build-ebee919e2e45c7cf.json num-traits-24b0dd4f03eba2da save-analysis build_script_build-24b0dd4f03eba2da.json proc-macro2-e8a4506ad5dc3475 save-analysis build_script_build-e8a4506ad5dc3475.json ryu-04d456a144e77de5 save-analysis build_script_build-04d456a144e77de5.json serde-e2ba84e54ee0a0d9 save-analysis build_script_build-e2ba84e54ee0a0d9.json serde_derive-ce59a763ca04db89 save-analysis build_script_build-ce59a763ca04db89.json serde_json-f7c02ef7e2afc73b save-analysis build_script_build-f7c02ef7e2afc73b.json syn-4ca55f1b85745f3d save-analysis build_script_build-4ca55f1b85745f3d.json typenum-7886cb1aa6a03f87 save-analysis build_script_main-7886cb1aa6a03f87.json typenum-86805692e11ee4f9 out consts.rs op.rs tests.rs wee_alloc-df9bf11e33101411 save-analysis build_script_build-df9bf11e33101411.json wee_alloc-e3f56c0ee4f1ca40 out wee_alloc_static_array_backend_size_bytes.txt deps save-analysis greeter-d801efe467ef8b5b.json libahash-c65113579932ddba.json libaho_corasick-c19e3c0be6d333aa.json libautocfg-96dd2aedadd5121b.json libbase64-67e403d2604239c1.json libblock_buffer-595164e24b949f1d.json libblock_padding-38ca8c36ce576d25.json libborsh-d3458c7223810a24.json libbs58-d5e7911d8ef4ae61.json libbyte_tools-c56bdbf7134590f5.json libbyteorder-7a75a35959110742.json libderive_more-0446ef4682bae368.json libdigest-831870107d7d6493.json libgeneric_array-071fac92b2b06e7a.json libgeneric_array-5182b22f2ee0a37f.json libgreeter-8c4a64f8e71ba5dd.json libhashbrown-a71f21dcb5f3670a.json libhashbrown-fe89b2c9026578ff.json libhex-8fb7da550b197f93.json libindexmap-86dfd031358a0b49.json libindexmap-f6d1b20b39106d7e.json libinflector-6a6e6be8f2e47224.json libitoa-01b257baa6dd0e17.json libkeccak-181d75253b5091e0.json liblazy_static-890aa9dffdd68514.json libmemchr-0b6cda4302c127c7.json libmemory_units-4be657b763fdb15f.json libnear_primitives_core-ea8b35211cf3cc3c.json libnear_rpc_error_core-b0a94484cb89895c.json libnear_rpc_error_macro-2b4060551f792f2d.json libnear_runtime_utils-773697d9e5508136.json libnear_sdk-6f956e8d5055892c.json libnear_vm_errors-c58cfeb13da93e95.json libnear_vm_logic-1e0fd81cafd0619a.json libnum_bigint-94e689e02570adec.json libnum_integer-cfadc9752dde0905.json libnum_rational-380b0709e8cc1324.json libnum_traits-7ce9ece26c17b7e0.json libopaque_debug-94789f67b9a2a927.json libproc_macro2-847ab9055051dfba.json libproc_macro_crate-911befa4cbf09b6f.json libquote-14b02e73be881a36.json libregex-22f0b2e880b304e1.json libryu-d2820bdb97bb6271.json libsha2-1926a42b011cf419.json libsha3-b60f3a12816ccc98.json libtoml-ec75f40cf25b47e4.json libunicode_xid-887efbed6d15bcc1.json libversion_check-022cfc20129296c9.json libwee_alloc-4bbe59d3dfbc898e.json wasm32-unknown-unknown debug .fingerprint ahash-36f6d322f098535b lib-ahash.json aho-corasick-da7fc128791f0ec3 lib-aho_corasick.json base64-5ac272b1496c646b lib-base64.json block-buffer-7d4aef731cbd2396 lib-block-buffer.json block-buffer-8e9c7479a1be1b1e lib-block-buffer.json block-padding-aa7c529f8af2e5a6 lib-block-padding.json borsh-ae4561628474b93e lib-borsh.json bs58-c7191d1e69403df3 lib-bs58.json byte-tools-a530213b88737954 lib-byte-tools.json byteorder-34638276eefeac52 run-build-script-build-script-build.json byteorder-8c7c0bed032192a4 lib-byteorder.json cfg-if-093e3a304fbeee80 lib-cfg-if.json cfg-if-ddcc501d36539a7d lib-cfg-if.json digest-2826b2d4315f75b8 lib-digest.json digest-4369f152e807dfa2 lib-digest.json generic-array-3ad71f8d98f35f57 lib-generic_array.json generic-array-7e7abfbaf2bb4c7b run-build-script-build-script-build.json generic-array-89c6771f9ba28e95 lib-generic_array.json greeter-98ace302c5fafa12 lib-greeter.json hashbrown-2efe09c84dc99d95 lib-hashbrown.json hashbrown-b1ca0d914b151a5e run-build-script-build-script-build.json hashbrown-f61e5e2e29589ed0 lib-hashbrown.json hex-a3995a4015e12e17 lib-hex.json indexmap-7ea5ab0302ea24ce run-build-script-build-script-build.json indexmap-f2931cbe88bd6c3d lib-indexmap.json itoa-55b4595ce2f6c935 lib-itoa.json keccak-402f2dc0524b1baf lib-keccak.json lazy_static-227610d9e7a4e617 lib-lazy_static.json memchr-c3d144706e68630a lib-memchr.json memchr-f7e6908540e6189f run-build-script-build-script-build.json memory_units-d437884462c79f27 lib-memory_units.json near-primitives-core-d47722d1ea785f07 lib-near-primitives-core.json near-runtime-utils-9e6066b5112f0471 lib-near-runtime-utils.json near-sdk-30982f2706dad5b5 lib-near-sdk.json near-vm-errors-005cd38ed79ed53a lib-near-vm-errors.json near-vm-logic-3e6f7028d1b52773 lib-near-vm-logic.json num-bigint-6ff65999dd050bde run-build-script-build-script-build.json num-bigint-7796107b418318f2 lib-num-bigint.json num-integer-d0070335787f03a8 lib-num-integer.json num-integer-f9b2617c1ad7e798 run-build-script-build-script-build.json num-rational-0f824d806675b3dd lib-num-rational.json num-rational-bf2d4969948e9aac run-build-script-build-script-build.json num-traits-b278b44e3c3f3715 run-build-script-build-script-build.json num-traits-d044bcb7e0dac17e lib-num-traits.json opaque-debug-44fe7dbce851033f lib-opaque-debug.json opaque-debug-c01c687bbc3990b6 lib-opaque-debug.json regex-9a205744ecc85327 lib-regex.json regex-syntax-f5d364605d2cc3d6 lib-regex-syntax.json ryu-8292be71d8ee8fd9 run-build-script-build-script-build.json ryu-d83a93d860d19d7c lib-ryu.json serde-20f4df0515bc0135 run-build-script-build-script-build.json serde-daaa81ced3d32d2e lib-serde.json serde_json-3fb3d8acf0d834e6 lib-serde_json.json serde_json-9f0ca5c09c338751 run-build-script-build-script-build.json sha2-a281774ea117145c lib-sha2.json sha3-b1d1b16835cbe583 lib-sha3.json typenum-0e1479a82003551d lib-typenum.json typenum-4ce34ae0326da2e4 run-build-script-build-script-main.json wee_alloc-22a71655db4012ff run-build-script-build-script-build.json wee_alloc-edcd4b810ddb7866 lib-wee_alloc.json build num-bigint-6ff65999dd050bde out radix_bases.rs typenum-4ce34ae0326da2e4 out consts.rs op.rs tests.rs wee_alloc-22a71655db4012ff out wee_alloc_static_array_backend_size_bytes.txt release .fingerprint ahash-9815fd3e5ad9c0db lib-ahash.json aho-corasick-e231725921ff8d39 lib-aho_corasick.json base64-88b854bb245f68bf lib-base64.json block-buffer-327570fa19916ed2 lib-block-buffer.json block-buffer-a87f8f69d0dafa1c lib-block-buffer.json block-padding-4df0a9e90b44f674 lib-block-padding.json borsh-eb7adb751326e8cb lib-borsh.json bs58-6761804058feea3b lib-bs58.json byte-tools-6ea7efea0be19255 lib-byte-tools.json byteorder-8802cad7090a6750 lib-byteorder.json byteorder-e1150ed492a7219e run-build-script-build-script-build.json cfg-if-3111d64b38443e1d lib-cfg-if.json cfg-if-ad2ad9ef97563e0f lib-cfg-if.json digest-7b739f14f0801e4a lib-digest.json digest-d34d30d3718ec089 lib-digest.json generic-array-3c0c79e3d2ee327f run-build-script-build-script-build.json generic-array-977e9f383872e9c7 lib-generic_array.json generic-array-be7b2c97378ba3d0 lib-generic_array.json greeter-98ace302c5fafa12 lib-greeter.json hashbrown-4719fa403a556a5f lib-hashbrown.json hashbrown-d06703d97376cb27 lib-hashbrown.json hashbrown-eb84aebf7a28caf2 run-build-script-build-script-build.json hex-339fc36b944873c3 lib-hex.json indexmap-24b2b50094e6523e run-build-script-build-script-build.json indexmap-80f2c9236225327f lib-indexmap.json itoa-c3e9d443b1eded2b lib-itoa.json keccak-4f688ec87aa91196 lib-keccak.json lazy_static-50634c5392d18e1e lib-lazy_static.json memchr-0653052669daf703 lib-memchr.json memchr-d9650bd4433a7062 run-build-script-build-script-build.json memory_units-9ddfbfb67fd92001 lib-memory_units.json near-primitives-core-de02c4785ea37712 lib-near-primitives-core.json near-runtime-utils-615485309b667160 lib-near-runtime-utils.json near-sdk-bf5d3446a6283455 lib-near-sdk.json near-vm-errors-7fdfefa4107f75af lib-near-vm-errors.json near-vm-logic-edb8eb76208a7a27 lib-near-vm-logic.json num-bigint-986b9bce5895fc0e lib-num-bigint.json num-bigint-d5d6e430f1e72892 run-build-script-build-script-build.json num-integer-5e7533c6e5e3633a run-build-script-build-script-build.json num-integer-d50abc9f0096cca3 lib-num-integer.json num-rational-50edc84538b1f2a8 lib-num-rational.json num-rational-ab2a3493bcfd0428 run-build-script-build-script-build.json num-traits-11c874ae5c29a0ff run-build-script-build-script-build.json num-traits-363ef6a59a9fdca1 lib-num-traits.json opaque-debug-41bbec2ab6165ebe lib-opaque-debug.json opaque-debug-94da08fb42656c90 lib-opaque-debug.json regex-a434a8359f1cba06 lib-regex.json regex-syntax-5978b9e3b8bd8f1e lib-regex-syntax.json ryu-5780623ddf511c46 lib-ryu.json ryu-d3a54f218429623e run-build-script-build-script-build.json serde-09e3ec8493771720 run-build-script-build-script-build.json serde-b222ff20c4da7a32 lib-serde.json serde_json-496615ce184dcd62 run-build-script-build-script-build.json serde_json-a1fb5aa3fe2faba3 lib-serde_json.json sha2-4aca2ffc26ec2dd3 lib-sha2.json sha3-468f7f2de9820409 lib-sha3.json typenum-040f738e5f1a3f4d run-build-script-build-script-main.json typenum-eb7c0bc6ecd83ae5 lib-typenum.json wee_alloc-2d4b3869a1d22f80 lib-wee_alloc.json wee_alloc-581cde267b7616d5 run-build-script-build-script-build.json build num-bigint-d5d6e430f1e72892 out radix_bases.rs typenum-040f738e5f1a3f4d out consts.rs op.rs tests.rs wee_alloc-581cde267b7616d5 out wee_alloc_static_array_backend_size_bytes.txt jquery.justified.css jquery.justified.js jquery.justified.min.js package.json src config.js global.css index.html index.js main.test.js thekolla.html utils.js wallet login index.html | |","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1038,"byte_end":1133,"line_start":22,"line_end":22,"column_start":1,"column_end":96}},{"value":" | `encode` | Returns a new `String` | Always |","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1134,"byte_end":1229,"line_start":23,"line_end":23,"column_start":1,"column_end":96}},{"value":" | `encode_config` | Returns a new `String` | Always |","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1230,"byte_end":1325,"line_start":24,"line_end":24,"column_start":1,"column_end":96}},{"value":" | `encode_config_buf` | Appends to provided `String` | Only if `String` needs to grow |","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1326,"byte_end":1421,"line_start":25,"line_end":25,"column_start":1,"column_end":96}},{"value":" | `encode_config_slice` | Writes to provided `&[u8]` | Never |","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1422,"byte_end":1517,"line_start":26,"line_end":26,"column_start":1,"column_end":96}},{"value":" ","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1518,"byte_end":1521,"line_start":27,"line_end":27,"column_start":1,"column_end":4}},{"value":" All of the encoding functions that take a `Config` will pad as per the config.","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1522,"byte_end":1604,"line_start":28,"line_end":28,"column_start":1,"column_end":83}},{"value":" ","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1605,"byte_end":1608,"line_start":29,"line_end":29,"column_start":1,"column_end":4}},{"value":" # Decoding","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1609,"byte_end":1623,"line_start":30,"line_end":30,"column_start":1,"column_end":15}},{"value":" ","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1624,"byte_end":1627,"line_start":31,"line_end":31,"column_start":1,"column_end":4}},{"value":" Just as for encoding, there are different decoding functions available.","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1628,"byte_end":1703,"line_start":32,"line_end":32,"column_start":1,"column_end":76}},{"value":" ","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1704,"byte_end":1707,"line_start":33,"line_end":33,"column_start":1,"column_end":4}},{"value":" | Function | Output | Allocates |","span":{"file_name":" Users tomas .cargo registry src github.com-1ecc6299db9ec823 base64-0.13.0 src lib.rs","byte_start":1708,"byte_end":1804,"line_start":34,"line_end":34,"column_start":1,"column_end":97}},{"value":" |
NEAR FT Kollage ================== The kolla is a dapp working under near smart contracts. For 0.5 NEAR you can upload an NFT image stored in nft.storage to The kolla. For the moment, the NEARS are transfered to our testnet account. However we are looking forward to write a contract which guarantees a charity end for the assets. Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install rust: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` 3. Install dependencies: `yarn install` 4. Run the local development server: `yarn dev` It is optional to install the NEAR CLI because the contract is already connected to the frontend. However, in case you want to install it: `yarn install --global near-cli` Understanding the files =========== There are two principal directories: 1. **"contract"**: It is where the contract (aka the backend) code is located. 2. **"src"**: It is where the frontend code (html, css, js) is located. This project was initialized in the beggining with create-near-app. rustapp Smart Contract ================== A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard Rust tests using [cargo] with a `--nocapture` flag so that you can see any debug info you print to the console. [smart contract]: https://docs.near.org/docs/develop/contracts/overview [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://github.com/near/near-sdk-rs#pre-requisites [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html
larunglbay_mynote
README.md contract Cargo.toml README.md build.sh compile.js src lib.rs package.json src app.js assets logo-black.svg logo-white.svg config.js global.css index.html index.js main.test.js style.css utils.js wallet login index.html
mynote Smart Contract ================== A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard Rust tests using [cargo] with a `--nocapture` flag so that you can see any debug info you print to the console. [smart contract]: https://docs.near.org/docs/develop/contracts/overview [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://github.com/near/near-sdk-rs#pre-requisites [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html # mynote ================== This app was initialized with [create-near-app] use to demo note app using NEAR smartcontract Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install dependencies: `yarn install` 3. Run the local development server: `yarn dev` (see `package.json` for a full list of `scripts` you can run with `yarn`) Now you'll have a local development environment backed by the NEAR TestNet! Go ahead and play with the app and the code. As you make code changes, the app will automatically reload. Exploring The Code ================== 1. The "backend" code lives in the `/contract` folder. See the README there for more info. 2. The frontend code lives in the `/src` folder. `/src/index.html` is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and the smart contract. See `contract/README` for info about how it's tested. The frontend code gets tested with [jest]. You can run both of these at once with `yarn run test`. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally: yarn install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `mynote.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `mynote.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account mynote.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'mynote.YOUR-NAME.testnet' Step 3: deploy! --------------- One command: yarn deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contract to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages
ipavlov93_near-chat-app
Cargo.toml README.md compile.js contracts README.md chat Cargo.toml README.md src contract.rs lib.rs message.rs testing.rs package Cargo.toml README.md src accounts_whitelist.rs lib.rs pagination.rs router Cargo.toml README.md src account.rs contract.rs lib.rs owner.rs testing.rs package.json src .eslintrc.json .prettierrc.json README.md index.html package.json postcss.config.js src baseTypes user.ts components ChatArea MessagesArea Bubble index.ts index.ts SendArea index.ts index.ts NavBar ChatsList Item index.ts index.ts index.ts contexts userContext.ts index.css near connect.ts store Account.ts vite-env.d.ts tailwind.config.js tsconfig.json tsconfig.node.json vite.config.ts
Contracts ================== [Smart contracts] are written in [Rust]. Directory contains `chat-space` smart contract crates. [Rust]: https://www.rust-lang.org/ [Smart contracts]: https://docs.near.org/docs/develop/contracts/overview Router Smart Contract ================== A [smart contract] is written in [Rust]. It implements accounts cache that's stored in blockchain. In context of chats contracts it'll store their account ids. Only owner can execute `call` contract methods. This version of contract support add and delete chat methods. Preferably, next release should implement factory contract for chats using callbacks and cross-contract calls. [Rust]: https://www.rust-lang.org/ [smart contract]: https://docs.near.org/docs/develop/contracts/overview Package ================== Crate contains methods that can be used by contracts. Chat Smart Contract ================== A [smart contract] is written in [Rust]. It implements immutable chat that's stored in blockchain. The [smart contract] provided here enable users to chat. Common chat very similar to Slack `general` channel where members can send messages, and it guarantees that it will never be changed. Contract can be used like text channel and chat at the same time. Any NEAR account can be added to whitelist during contract initialization. Only whitelisted users can execute `call` contract methods. This version of contract doesn't support update and delete `call` for whitelist and messages. And the main thing is app powered by the NEAR protocol, so identity tools are built in. ### Key benefits 1. dApp is easy to use 2. messages are immutable 3. chat looks like text channel for anyone (chat is visible through blockchain) [Rust]: https://www.rust-lang.org/ [smart contract]: https://docs.near.org/docs/develop/contracts/overview # Near Chat Application Example chat front-end application. Uses NEAR [contract](../contract/) as a back-end. So, it provides an ability for near account to send message to selected chat contact and getting messages for any user. ## Deployment To start server locally: ```shell yarn dev ``` To build app for production: ```shell yarn build ``` ## Possible NEAR platform improvements 1. No out-of-the box event notifications through WebSockets. With such a feature added this app could dynamically update UI with new messages. ## Near Chat Application This is [NCD] demo project. No production use intended. ### Diagram ![img.png](img.png) [Excalidraw](https://excalidraw.com/) used to draw diagram. ## Concepts Chat implementation based on NEAR protocol. It's text chat for whitelisted NEAR accounts and public text channel for the whole world. These power concepts make dApp oriented for any community or organization. ### Who This Is For - Developers new to the NEAR Protocol looking for a learning sandbox - Developers looking for inspiration ## File Structure This contract is designed to be self-contained and so may be extracted into your own projects and used as a starting point. If you do decide to use this code, please pay close attention to all top level files including: - Rust artifacts - `Cargo.toml`: Rust project dependencies and configuration - `Cargo.lock`: version-locked list of Rust project dependencies ## Build Contracts You will need [Rust] with `wasm32-unknown-unknown` [target] installed. Build contracts using script `compile.js` ``` node compile.js ``` or using [cargo] ``` cargo build --target wasm32-unknown-unknown --release ``` ## Tests Run smart contract with [cargo] ``` cargo test ``` ## Run locally Start up front-end (see [readme](./src/)) [Rust]: https://www.rust-lang.org/ [target]: https://github.com/near/near-sdk-rs#pre-requisites [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html [NCD]: https://www.near.university/courses/near-certified-developer [smart contract]: https://docs.near.org/docs/develop/contracts/overview
NEAR-Portuguese-Community_contador
README.md as-pect.config.js asconfig.json assembly __tests__ as-pect.d.ts main.spec.ts main.ts tsconfig.json docs exemplo_asconfig.md.md exemplo_aspectconfigjs.md exemplo_aspectdts.md exemplo_tsconfig.md indexhtml.md package-lock.json package.json src index.html main.js
# Workflow pra criar um Dapp NEAR simples em AssemblyScript # Estrutura do Projeto 1. root - nome-do-app 1. **assembly** backend pasta do smart contract Backend, que vai usar a sdk da near near-sdk-as para construir o smart contract. 1. **main.ts** Aqui ficam definidas as funções do *smart contract*. 2. **model.ts** Aqui ficam as estruturas que são salvas na blockchain 3. **tsconfig.json** Configuração do typescript. [Exemplo tsconfig.json](docs/exemplo_tsconfig.md) 4. **__tests__** Pastas em que ficarão definidos os testes 1. **as-pect.d.ts** Arquivo de configuração [Exemplo de as-pect.d.ts](docs/exemplo_aspectdts.md) 2. **main.spec.ts** Especificação dos testes para a **main.ts** 2. **src** - front end Front-end, vários dos exemplos foram feitos usando react, é bom ser em algo baseado em js por ter a api que comunica direto com a near pra js, a near-api-js. 3. **asconfig.json** - configuração do assembly Pra configurar a compilação do AssemblyScript para um arquivo .wasm que pode ser dado deploy na blockchain [Exemplo de asconfig.json](docs/exemplo_asconfig.md) 4. **as-pect.config.js** - configuração do asp [Exemplo de as-pect.config.js](docs/exemplo_aspectconfigjs.md) ### Versões Utilizadas - Node 14.17.0 ### Repositório do Projeto: [https://github.com/NEAR-Portuguese-Community/contador/](https://github.com/NEAR-Portuguese-Community/contador/) # Instalar as API's - Começar criando o projeto com npm: ```bash npm init -y ``` - Para fazer a conexão com o javascript (usado mais para o front). ```bash npm install npm install --save near-api-js@0.42.0 ``` - Biblioteca para AssemblyScript (para escrever o contrato). ```bash npm install --save near-sdk-as ``` - Jest para os testes. ```tsx yarn add jest jest-environment-node ``` # Escrever o Contrato Agora basta escrever o contrato.... É bom ter em mente nesse momento as principais funcionalidades que o contrato deve ter, o que ele vai fazer, quais informações deve guardar e com isso já podemos é possível partir para implementação. Há mais abordagens possíveis para se criar o contrato, mas a que usaremos aqui é a de que funções exportadas no código são a interface para a comunicação com ele. Então como mostrado anteriormente nosso código principal fica no arquivo `/assembly/main.ts` . E a partir de agora o resto do tutorial será criando um exemplo de dApp e tentando mostrar o pensamento ao construí-lo. Um dos exemplos clássicos nesse ponto é o "contador", então vou descrever brevemente o que nosso dApp deve fazer: > O contador é um dApp em que há um número inteiro, que pode ser incrementado ou decrementado pelos usuários. Então: - **Quais dados precisamos guardar?** Só precisamos guardar um inteiro, que vai ser o valor atual do contador. - **Quais métodos devem existir para interagir com esses dados?** Um método para incrementar, outro para decrementar, e outro para pegar esse número. Tendo isso em mente, é hora de codar. ## Codando o Contrato Vamos começar mexendo no arquivo **main.ts**, e importando a biblioteca que instalamos: ```jsx import { storage } from "near-sdk-as"; ``` Aqui vamos usar esse objeto "storage", que podemos interpretar como o banco de dados do nosso contrato, um BD que é basicamente uma estrutura de dados do tipo map em que a chave é uma string e o valor é o dado que queremos salvar nessa chave. O dado a ser salvo será um inteiro de 32 bits do *typescript* o *i32*, então podemos escrever a função que incrementará esse contador como segue: ```tsx export function increment(): i32 { const newVal = storage.getPrimitive<i32>("counter", 0) + 1; storage.set<i32>("counter", newVal); return newVal; } ``` Então como vemos acima, a primeira coisa que essa função faz é buscar no *storage* um valor primitivo do tipo *i32* na chave "*counter"* e incrementa-lo em 1, se essa chave ainda não existe ele a cria com o valor default de 0, por isso do 0 como segundo parâmetro. Após isso o novo valor é setado para a chave "*counter*" usando o *set.* Esse valor é então retornado, um i32 (por isso do i32 dps dos parenteses), esse valor será útil para quando lidarmos com a interface ou quando formos chamar esse contrato. Já temos a função de incremento, a função de decremento é análoga só que subtraindo 1 do valor armazenado: ```tsx export function decrement(): i32 { const newVal = storage.getPrimitive<i32>("counter", 0) -decrement 1; storage.set<i32>("counter", newVal); return newVal; } ``` Agora uma função para que possamos buscar o valor desse contador, tenho certeza que com base nos anteriores você já sabe como fazer isso, mas por garantia tá aqui: ```tsx export function getCounter(): i32 { return storage.getPrimitive<i32>("counter", 0); } ``` Com esse código pronto, podemos compila-lo, para um arquivo .wasm, que será o executável interpretado pela blockchain NEAR. É possível fazer isso usando: ```bash npx asb ``` Acho que com isso já podemos começar a interagir com o contrato, para isso, nesse momento usarei uma interface de linha de comando da near, a near-cli. Para instala-la no linux, basta usar o comando: ```bash npm install -g near-cli ``` Após a ferramenta instalada, é necessário fazer login com sua conta da testnet, se ainda não criou é só acessar aqui: [https://wallet.testnet.near.org/create](https://wallet.testnet.near.org/create), se já criou roda esse comando no terminal: ```bash near login ``` Vá para seu navegador e siga as instruções, assim você pode usar a interface de linha de comando da near para interagir com a blockchain usando sua conta da near. Beleza nesse ponto já podemos dar deploy do nosso contrato na *testnet*. O jeito mais fácil de fazer isso é usando o comando abaixo: ```bash near dev-deploy ./out/main.wasm ``` Isso fará deploy do contrato para uma conta de desenvolvedor gerada pelo comando, na saída ele dará o nome dessa conta que será algo do tipo: dev-XXXXXXXXXXXXX-YYYYYYY, esse comando também gera uma pasta com nome "neardev", que contém as informações da conta de desenvolvedor gerada. Esse é também o endereço que usaremos para fazer chamadas ao contrato. Pronto, temos nosso contrato rodando na testnet NEAR, mas pra termos um gostinho disso vamos interagir com ele usando na *cli* o comando abaixo: ```bash near call dev-SEU-CONTRATO getCounter '' ``` A saída esperada é algo do tipo: ```bash Scheduling a call: dev-SEU-CONTRATO.getCounter() Transaction Id 4JBVATfwb1NGzIDDASUATRANSACAOiuVogQXBY3VUkAaT To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/4JBVATfwb1NGzIDDASUATRANSACAOiuVogQXBY3VUkAaT 0 ``` Em que podemos ver que o número retornado foi zero. Exemplo de como chamar essa função para os outros métodos: ```bash near call dev-SEU-CONTRATO increment '' ``` ```bash near call dev-SEU-CONTRATO decrement '' ``` Perfeito, temos nosso contrato funcionando e rodando na testnet. Mas legal isso foi um exemplo, e aqui quero mostrar também o workflow para construir coisas mais genéricas, por isso a próxima seção é sobre algumas estruturas de dados que são usadas para guardar dados na blockchain. ### Estruturas de Dados Há várias estruturas de dados, já implementadas na sdk de typescript, e elas funcionam assim como seus nomes dizem que elas funcionam, então por exemplo o PersistentVector é iterável, tem acesso aleatório, preserva a ordem de inserção e todos atributos de um vector já vistas em outros contextos, pra saber mais da uma olhada na [documentação](https://docs.near.org/docs/concepts/data-storage). E essas estruturas de dados são: - PersistentVector - PersistentSet - PersistentMap - PersistentUnorderedMap - PersistentDeque - AVLTree É possível também guardar seus dados em classes criadas por você, assim como se cria uma classe em typescript normalmente, porém anotando-a com *@nearBindgen* que é uma anotação que facilita a serialização por parte da blockchain. Mas não vale se aprofundar muito mais nessa parte aqui. Bora tentar fazer um front end pra interagir com esse contador usando a api da near para js. # Testes Ninguém liga pros testes..... Brincadeira bora fazer uns testes pra garantir que ta tudo funcionando, e aproveitar pra aprender como os testes funcionam para contratos inteligentes da NEAR, testes são especialmente necessários nesse ambiente de blockchains. Iremos utilizar asp para descrever os testes, há vários arquivos para a configuração dos testes, então tenha todos eles prontos conforme mostrado no começo desse tutorial. Nosso diretório principal agora se torna o */assembly/__tests__* e o arquivo que vamos usar é o *main.spec.ts*. Começaremos importando as funções que vamos testar: ```jsx import { getCounter, increment, decrement } from "../main"; ``` Já vou colocar um exemplo de descrição dos testes, lendo esse código você pode entender a sintaxe dos testes e a partir disso pode até adicionar uns testes para brincar e aprender melhor. ```tsx import { getCounter, increment, decrement } from "../main"; describe('Counter', () => { it('get counter', () => { expect(getCounter()).toBe(0, 'counter should be zero before any increment or decrement'); }); it('increment counter', () => { increment(); expect(getCounter()).toBe(1, 'counter must be one after one increment'); }); it('decrement counter', () => { increment(); decrement(); expect(getCounter()).toBe(0, 'should be zero after one increment and one decrement'); }); }); ``` Para rodar os testes é só chamar o aps usando o yarn. ```bash yarn asp ``` Se na saída só teve certinhos verdes parece que deu tudo certo, e os testes estão funcionando. # Front-End Não farei nada de mais rebuscado nessa parte, será somente uma tela com html básico e bootstrap, que vai interagir com nosso contrato. Muito do que existe com front-end é feito em react ou bibliotecas como essa, mas vamos de simplicidade. Até agora estávamos mexendo na pasta *assembly,* vamos passar para a pasta *src* pois é onde ficará o front-end do nosso dApp. Podemos começar focando em fazer uma interface reutilizável para fazer as chamadas do contrato, e a conexão com a NEAR wallet e seta-las como atributos da página. ### Dependências do Front-End e Template HTML ```jsx yarn add parcel-bundler regenerator-runtime ``` - `parcel-bundler` será o bundler que usaremos para rodar o frontend de forma mais fácil - `regenerator-runtime` é uma dependência necessária a API js da NEAR Aproveite para criar o arquivo html que será o nosso templete da interface, com os imports do bootstrap e do arquivo js que criaremos na sequência: [index.html](docs/indexhtml.md) ### Configuração e Conexão Mo arquivo `main.js` ficará o código js da aplicação frontend, e seu inicio, com os imports e inicializações necessárias fica assim: ```jsx import "regenerator-runtime/runtime"; import * as nearAPI from "near-api-js" const contract_name = "<nome-do-seu-contrato>" let nearConfig = getConfig(contract_name) window.nearConfig = nearConfig ``` Em seguida teremos uma função que retorna as configurações necessárias para iniciar a conexão, com as informações do id da rede, no nosso caso a `testnet`; URL do nó que usaremos para acessar o RPC; nome do contrato e as URLs da wallet e do helper: ```jsx function getConfig(contract_name) { return { networkId: 'testnet', nodeUrl: 'https://rpc.testnet.near.org', contractName: contract_name, walletUrl: 'https://wallet.testnet.near.org', helperUrl: 'https://helper.testnet.near.org' } } ``` Nesse momento faremos uma função para fazer a conexão com a interface RPC do nó da rede, faremos a requisição da conta do usuário e criaremos a interface com o contrato que acabamos de criar. A função ficará assim: ```jsx // Se conecta a NEAR e provê os objetos `near`, `walletAccount` e `contract` no escopo `window` async function connect() { // Inicia a conecxão com o nó NEAR window.near = await nearAPI.connect(Object.assign(nearConfig, { deps: {keyStore: new nearAPI.keyStores.BrowserLocalStorageKeyStore() }})) // Requer acesso a login usando a wallet window.walletAccount = new nearAPI.WalletConnection(window.near) // Inicializa a interface com o contrato usando o nome do contrato e as configurações window.contract = await near.loadContract(nearConfig.contractName, { viewMethods: ['getCounter'], changeMethods: ['increment', 'decrement'], sender: window.walletAccount.getAccountId() }) } ``` Pronto, dessa forma, se ocorrer tudo bem já teremos a conexão feita. Mas só acreditar em mim não tem graça, é muito mais legal ver isso funcionando. Podemos fazer isso assim: coloque essa linha no final da função acima: ```jsx console.log(await window.contract.getCounter()) ``` E então faça uma chamada da função `connect()` no final do arquivo `main.js` : ```jsx window.nearInitPromise = connect() .then() .catch(console.error) ``` Para executar o código use o comando `yarn parcel src/index.html` , acesse `[localhost:1234](http://localhost:1234)` e veja o console. Se deu tudo certo é pra ter um `0`, ou algum número, por lá. Note que no momento que iniciamos a interface com o contrato, o objeto window.contract contém os métodos criados por nós quando o escrevemos, assim podem ser feitas as chamadas das suas funções a partir do js. E assim está pronto, a conexão está feita. ## Interações com o Contrato Essa seção terá bastante coisa que se derivou da escolha de não usar um framework ou biblioteca js que facilite a renderização e responsividade do front. Portanto muita coisa pode mudar dependendo dessa escolha, o importante é entender como ocorrem as chamadas para o contrato e como essa interação pode ser feita. ### Login e Logout usando a Wallet Para fazer as operações no nosso dApp o usuário deve estar logado com sua wallet, e ele pode querer dar logout também. Essas duas operações serão feitas por essas duas funções abaixo: ```jsx // Fazer o login usando sua wallet NEAR da testnet, e essa função é adicionada ao botão sign-in document.querySelector('.sign-in .btn').addEventListener('click', () => { walletAccount.requestSignIn(nearConfig.contractName, 'NEAR Counter Example'); }); // Fazer logout com sua wallet NEAR e colocando essa função no botão sign-out document.querySelector('.sign-out .btn').addEventListener('click', () => { walletAccount.signOut(); window.location.replace(window.location.origin + window.location.pathname); }); ``` Na próxima seção você poderá testar essa etapa, pois é nela que faremos a lógica de mostrar ou não algumas partes dependendo do usuário estar logado ou não. ### Display do Contador e update da UI Queremos ver coisas funcionando, vamos mostrar nosso contador na tela e juntar isso a condição de login do usuário, a função que fará isso é a seguinte: ```jsx function updateUI() { if (!window.walletAccount.getAccountId()) { // Somente mostra o requerimento de login Array.from(document.querySelectorAll('.sign-in')).map(it => it.style = 'diplay: block;') } else { // Mostra somente os items que são permitidos quando o usuário está logado Array.from(document.querySelectorAll('.after-sign-in')).map(it => it.style = 'display: block;') console.log(window.walletAccount.getAccountId()) // Chamada do contrato e atualização do contador contract.getCounter().then(count => { document.querySelector('#show').innerText = count == undefined ? 'calculando...' : count; }) } } ``` Note que as partes mais estranhas dela são alterações nos items da interface, para que eles sejam mostrados ou não dependendo se usuário está logado ou não. Essa função também será chamada quando o usuário quiser incrementar ou decrementar o contador, ela faz o update de toda a UI. Então também é necessário chamar essa função de dentro da main, faça a seguinte alteração linha no final do arquivo `main.js` : ```jsx window.nearInitPromise = connect() .then(updateUI) // chamada da função updateUI .catch(console.error) ``` Execute e veja se tudo está funcionando na interface até aqui. ### Incremento e Decremento Quase lá, temos que fazer as funções que incrementam e decrementam e colocá-las como evento de seus respectivos botões. Você já deve ter entendido como são feitas as chamadas de função do contrato, então nada de muito novo por aqui. Chamamos a função e atualizamos a UI: ```jsx // Função que incrementa o contador, e a coloca no botão de mais document.querySelector('#plus').addEventListener('click', () => { document.querySelector('#show').innerText = 'calculando...' contract.increment().then(updateUI) }) // Função que decrementa o contador, e a coloca no botão de menos document.querySelector('#minus').addEventListener('click', () => { document.querySelector('#show').innerText = 'calculando...' contract.decrement().then(updateUI) }) ``` E vai pra interface ver se tudo certo por lá, o contador demora um pouco para carregar pois as chamadas com a interface não são tão rápidas, mas é bom lembrar que estamos guardando dados e fazendo chamadas diretamente numa blockchain. # Conclusão Você pode observar todas as chamadas feitas também no explorer da NEAR, para isso basta acessar a seguinte URL e colocar o nome do contrato que foi gerado para você no momento do deploy: [explorer.testnet.near.org/accounts/](https://explorer.testnet.near.org/accounts/)<nome-do-seu-contato> Se esse foi seu primeiro contrato inteligente escrito provavelmente você está até surpreso de quão fácil foi construí-lo, e é assim que deve ser. Para uma adoção maior da tecnologia é necessário que a experiência do programador seja amigável, e esse é um dos focos do protocolo NEAR, tanto que poder fazer isso em typescript é uma mão na roda. Se você já tinha escrito outro contrato inteligente em outros protocolos seria legal ter um feedback de como foi sua experiência, e quais diferenças encontrou. Se você achou interessante esse desenvolvimento e quer continuar pesquisando sobre, uma indicação que dou é ir atrás de mais exemplos e tentar lê-los, executá-los, reescreve-los, etc; aqui tem vários exemplos, inclusive um de contador que foi usado como base desse tutorial: [github.com/near-examples/](https://github.com/near-examples/)
NEAR-Analytics_BOS_WIDGETS
0-relay.hot.tg index commit_raw.json 00711.near Onboarding.ComponentCard commit_raw.json PagodaConsole commit_raw.json testing-01 commit_raw.json testing-OnboardingFork commit_raw.json 010daf405ec05a32672a5e7d454953c1f812447f94e97658154ab1b21b0d3f74 010daf405ec05a32672a5e7d454953c1f812447f94e97658154ab1b21b0d3f74_a945443f-dffa-4318-bbee-eb397155f812 commit_raw.json i like it commit_raw.json like commit_raw.json 01cc90dd78d115c3dc8191ad30060ed1d22969c8aef417580a751d8ef158e13d Onboarding.Starter-fork commit_raw.json RegisterFormAUJ commit_raw.json 022af1caad690511f2164a3356c44d35fdf61db7d3de2c719ad7071915e6fad0 Composition commit_raw.json GreeterToday commit_raw.json GreeterToday2 commit_raw.json GreeterYourName commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json collegium.bos.wk2.Web3ConnectWidget commit_raw.json daehun commit_raw.json nairiepeu commit_raw.json nairiepeu2 commit_raw.json 02f1a57368e5707a8cfb2744f72f416943d2fe2a4431ed382ba41f477f8fdec1 Untitled-0 commit_raw.json apestate.asset-item commit_raw.json apestate.asset-list commit_raw.json apestate.token-data commit_raw.json main commit_raw.json 08c9f5243a76ce3478dfeaaa2cc9808d806db59548a186036e996937548d581c Hello_World commit_raw.json ProfilePage-fork commit_raw.json 09fa04ec32715292a064d7d7c84b4399bcedf63c7f7af92589aa72178ce06ceb chart commit_raw.json 0_o.starpause.near ProfilePage commit_raw.json 0a7c0f9fe7916b5603c7def29e50ae0571df5d750969bffebef1147b585977fd bonnie-core-polygon-test commit_raw.json 0abcfb7b41666d7cea2d2689a83aab884debc12d7b071a718f5feab914a89066 StakeWithProphet commit_raw.json 0b2fa8cfb7913a09b2abad19e347aa1de028906d968fcc7bed8f7a76127a8d25 GHBounty-draft commit_raw.json bounty-creator commit_raw.json 0b96e52a3ca58ff6664e4ba060b7eb3fc93ea3e7486cdbb047a7b99a382a2761 1inch-fork commit_raw.json ContractTest commit_raw.json Untitled-0 commit_raw.json 0bd944ef86dc1a5fb74bada3dfaf0602ab1ea569701fc41e1aebfa7cd7bf3596 greeter commit_raw.json 0e7a82d0ef92b5559ef04df11f5de68ac4c4479319da5a72b3e2799c4717a422 Flipside-API-Getter commit_raw.json Flipside-API commit_raw.json Flipside-BarChart-Example commit_raw.json Flipside-BarChart-V2 commit_raw.json Flipside-BarChart commit_raw.json NEAR-Segment-DEXSWAP commit_raw.json NEAR-Segmentation-Tool-For-MDAO commit_raw.json Near.Social.Stats commit_raw.json QuickChart.io commit_raw.json 0e93c3eb30af45ea88b53981406fb77224b58dc559ae0afe63943f79ad0fbc0e myFirstComponent commit_raw.json 0xdonie.near dlab-greeting commit_raw.json 0xevans.near weatherApp commit_raw.json 0xfafa.near ArrowIcon commit_raw.json Avalanche.Swap.ArrowIcon commit_raw.json Avalanche.Swap.CloseIcon commit_raw.json Avalanche.Swap.CurrencyBalance commit_raw.json Avalanche.Swap.CurrencyInput commit_raw.json Avalanche.Swap.CurrencyRow commit_raw.json Avalanche.Swap.CurrencySelect commit_raw.json Avalanche.Swap.ExchangeIcon commit_raw.json Avalanche.Swap.QuoterV3 commit_raw.json Avalanche.Swap.Swap commit_raw.json Avalanche.Swap.SwapButton commit_raw.json Avalanche.Swap.SwapV2 commit_raw.json CloseIcon commit_raw.json 0xgh.near Untitled-0 commit_raw.json evmTest commit_raw.json liquityComponentBorrow commit_raw.json liquityComponentManage commit_raw.json liquityComponentPayoff commit_raw.json liquityExample commit_raw.json liquityExampleRightColumn commit_raw.json liquityManage commit_raw.json liquityWidget commit_raw.json mainTestForMainnet commit_raw.json near-2 commit_raw.json near-3 commit_raw.json openTroveTestForMainnet commit_raw.json test commit_raw.json troveManageTestForMainnet commit_raw.json trovePayoffTestForMainnet commit_raw.json 0xprometheus.near ArtSubmission commit_raw.json AuroraMinter commit_raw.json Eldorado commit_raw.json Eth-Explore commit_raw.json Eth-SingleNFT commit_raw.json GainsNetwork commit_raw.json GenaDrop.MultiChainMinter commit_raw.json GenaDrop.MultiListing.Index commit_raw.json GenaDrop.MultiListing.Input commit_raw.json GenaDropMultiListing commit_raw.json GenaDropmultichainminter commit_raw.json Genadrop-Ai-Minter commit_raw.json ListingInput commit_raw.json MagicBuild-widget-form-1697587735777 commit_raw.json NftListingInput commit_raw.json NftMinter commit_raw.json StakeW commit_raw.json cdao-contests commit_raw.json contest-detail commit_raw.json display commit_raw.json save commit_raw.json social-verifi commit_raw.json toast commit_raw.json verifi commit_raw.json widget commit_raw.json 0xtradertrou.near hamster-pocket commit_raw.json 0xvato.near starkard commit_raw.json starknet-data commit_raw.json 10a92fbea3a2bd37beb3c7a00203ddbb865a038c5e4b5c3fa11c457108d13df3 BOSModular commit_raw.json 1234qwer.near bugey-demo commit_raw.json 129648e3bdf6ee40b9d841feb0ee9c133719abb8c37e2cc3b159794c12031902 Onboarding.Starter-fork commit_raw.json 1386e29ec7f4c7f33a83b268feadc5307d2136b197de0f2823cbb729c23549ef Top-Trending-Slider commit_raw.json mix-chart commit_raw.json pie-chart commit_raw.json sbt-area commit_raw.json sbt-info commit_raw.json sbt-search commit_raw.json stack-chart commit_raw.json table_pagination commit_raw.json 14ea88d51603eb512dae55d259b805b74b58c6ade02df799706c3e12ab26c14a Composition commit_raw.json Greeter commit_raw.json GreeterYourName commit_raw.json GreetingYourName commit_raw.json RollTheDice commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json collegium.bos.wk3.MyPosts commit_raw.json gen_art commit_raw.json my_info commit_raw.json my_post commit_raw.json my_widget commit_raw.json 170774203d2ff00a180dcb7e0a1198f8454458f048d7aeb463664a3e6f57d24c Untitled-1 commit_raw.json XAVA-Testnet-Staking commit_raw.json 177240d7728484e7a3878fdcd8557e89fd87a4350f45d5de9f7ab0dc0e2400c8 Hello commit_raw.json includes.common commit_raw.json valocracy.components.chat commit_raw.json 1ac69a418ce3daeb90a9072866ca27cda948391e644a0f2e52da7f50271e8515 New-Draft-0 commit_raw.json 1b2ef6af3be6978215984c66fa8680bb2f5c4bf99d8a507f46a720512e88eb8a BITKUBXBOSHACKATHON2023 commit_raw.json 1ba559fa69bd98e4d44fdc38a35932deeb46d3a3637885d7a56c8f27a9f9d751 Composition commit_raw.json 1thedarkmoon.near Onboarding.Starter commit_raw.json StakeHERE commit_raw.json 20107a8ed21b4b96ea7d65c436a6fef587a6ba74e137e04de978ac0cb221a350 Everything commit_raw.json Homepage commit_raw.json 2062687e80cee067a33c35cb7de1e27b67f40078272d1ef6a79a321795b27d7d Buoi5.ThucHanh.BTtracnghiem commit_raw.json Buoi5.ThucHanh.libs commit_raw.json 2506.near Test-01 commit_raw.json 27fe67b045fd51210271e15c0386c13c149ebcb5b58d11cf9bc4b7f15361f3f3 ForkThis commit_raw.json widgetimage commit_raw.json 284e2cb86c842ffba728fb4a8e80ad8123d4c3545a1178c534894c07eaeacdd2 HelloWorld commit_raw.json 28949b27f388d4f13653f416f8bd4244c9fad5fd3875c0891f6a531d965d5d6b HelloWorld commit_raw.json LNC commit_raw.json 28a944ad13408d15f15a04bb61e2b126a156472064c27df0da6f0cfe5ef29a14 Created_posts commit_raw.json 2943b4cbde45f5d116486b8e22c541d2a85e26fac3b398dd6eb1d6b0219b509a ForkThis commit_raw.json 29af2b62025717288065bd5d21badc8246a753fc51bfb59507bfbe65dcfa7a10 ForkThis commit_raw.json 2a41aa578c1b22793cefc232be387b13a84693921898f4f4dfd03d12c12ad149 ipt-giveaway-list commit_raw.json ipt-giveaway commit_raw.json ipt-layout commit_raw.json 2b37d6181e8f5757c38b5fc7454e11ae1a3eee4cc1ca69c26fb1678dd30fddd6 AfroShareTemplate commit_raw.json Afromentors commit_raw.json Mentor_Widget_1 commit_raw.json Mentor_Widget_2 commit_raw.json Mentor_Widget_3 commit_raw.json RentNFT commit_raw.json TokenGate commit_raw.json 2d39e097bb22c59e0e12448c9015f9c60b6e07d9885d3f921f5455961b0f1f22 N commit_raw.json 2df3d3e9464e7f8295017c657ece8fec865be4f14b3378163fbe891facbe2f96 ForkThis commit_raw.json 2e804698cc8c0705f2f6507a52a4d89439ce0e3911d866052d7fa87c28db6b9d Hello-World commit_raw.json 2fa.near HelloEthWorld commit_raw.json 30610a3602406690f84d001ec0f8bb575a3f133a59ce7ee4db2f5b0e90d3a404 CoinCapBitcoin commit_raw.json 32c298759f37a070bce4eaa0602c0e961682f2ec5c0a17d86d3b8dc2120be286 Dashboard-Near-FS-Data commit_raw.json FS-bar-chart commit_raw.json FS-pie-chart commit_raw.json 3307673d88765b90233e4b0c709e077c777541b42bad580e3ed2c11552382271 HelloAccountIdHeader commit_raw.json 3513937518421a6650d50b4e3e522ac55fe569d1bd2f4be374edd3416509bf38 Everything.Create.Document commit_raw.json Everything.Create.Post commit_raw.json Everything.Create.near-near commit_raw.json Everything.Summary.Document commit_raw.json Everything.Summary.Post commit_raw.json Everything.Summary.near-near commit_raw.json Everything.View.Document commit_raw.json Everything.View.Post commit_raw.json Everything.View.near-near commit_raw.json kashyabs-murali-everything-fork commit_raw.json 352e049bdf43c27e9ff26f6bf3e94772f9e4067445fc11f4351b12ad3bdaae4b ConfirmaTuAsistencia commit_raw.json DatosEvento commit_raw.json DatosEvento2 commit_raw.json 35e3f7be109c2eb05164b3fe483f6e34873745217426ef65c8d51e3b613220e3 Article02 commit_raw.json Article03 commit_raw.json Articles commit_raw.json Community commit_raw.json News commit_raw.json Quizzes commit_raw.json Support commit_raw.json article01 commit_raw.json blockchainCourse commit_raw.json courses commit_raw.json cryptoCourse commit_raw.json intro commit_raw.json smartcontractsCourse commit_raw.json 367d9632b19f4a71038e845d24388f4976f6317e5cca7a66d8c3167fbae3c5ee Composition commit_raw.json GreeterToday commit_raw.json 36b5ad9e831c63814fcf68a8b34abe5510fb414e7b83645aac6bb185b930f7fb Composition commit_raw.json Greeter commit_raw.json GreeterToday commit_raw.json 38f93b56ac78a5ce761ffd5ba4da963903f8dc81e5d0c587463787cc04365b23 RejuvenateAI commit_raw.json Untitled-0 commit_raw.json 3c0b9f03eec241d9ca34f260477bbe4a28ab0f96735aa182a85dec66e61d95d9 Balance.Create.Mint.Near commit_raw.json F3CreateWallet commit_raw.json F3Demo commit_raw.json IframeEmbed commit_raw.json TestNear commit_raw.json 3edd9a30f726eca4bffaa9996fce3d290a475e71b8aa64819d0ea5387472136b form commit_raw.json 3f165cfc842dd839a00c78d2e7470857ae98e640dc303f0070b3b3d606bd9e4b cleaning commit_raw.json moonbase-auth commit_raw.json 411a6689bda8aba25d5bcfd1fd9890641e1271436bd0baa4ae59ea28b136a467 Paras-Marketplace-Activity commit_raw.json Paras-Marketplace-Dashboard commit_raw.json test1 commit_raw.json 41ce8ab706cc1551724e6ba3d0112812fd181e5da0ccb1365890ed17e0b46b3a DEXL.NEAR commit_raw.json 45bb3ec2deec9eee6b3e694236754b5d8036ac87cafc291162b1084b4fc89db7 Homepage commit_raw.json 473a2e112775ed3d8c754f75c4cea5a0924b18b53577780f573352299e275aec Untitled-0 commit_raw.json 477e6b299254293632a3d172f5bd15f34d328f00af5c2a6c599c8c0383504742 button commit_raw.json 49179ab55941680957b3447ff1d6e9096c22f6cc87ec45c8f373f400bc3ba29c ProfilePage.Sidebar commit_raw.json 49230cfd4ae1a200ab1f32367e7c22d49879a67d3f46198c9afd19ce2df49f78 Omagotji-CharactorRenderer commit_raw.json 4ac12ee4ebd5536d7b130a9c5f8eebb1136145312c9e523289bf346268aeebfd Common.error commit_raw.json Common.footer commit_raw.json Common.menu commit_raw.json Customer.token commit_raw.json Customer.view commit_raw.json Integration.renew commit_raw.json Integration.subscribe commit_raw.json Main.create commit_raw.json Main.manage commit_raw.json Main.view commit_raw.json Merchant.create commit_raw.json Merchant.info commit_raw.json Merchant.view commit_raw.json 4b4e3ee0e5efa8a881ee1c69530f998790f87d1db125346fe0445a850fe197a0 Draft-0 commit_raw.json 4bea3a3e3c8c7e10999b92afe0bbc7cd859b8aafa2048262462731fe88fe0f7b Near.AI commit_raw.json ProfilePage commit_raw.json 4c02ae1a6800eac1bdc83570c3fd4fcddb19dee58563d2187c580d5cc1b1705e MyProfile commit_raw.json 514901813a913f6ff8cf9618f561439debae1743abf0abca73394e8dea42d695 BuyBox commit_raw.json ConnectWalletBox commit_raw.json FomoFinanceLanding commit_raw.json FomoFinanceLandingContainer commit_raw.json HelloWorld commit_raw.json SellBox commit_raw.json SwapBox commit_raw.json TestComponent commit_raw.json TestCss commit_raw.json 519efc51fd5774b16b26ba76795222487e7f00cff0d0d77649100d5cc806b9ad anchor.people commit_raw.json nyc.dao commit_raw.json 52de7c6588be311f9ddf2e1030b1f67b8fa60680830453f9eece579fad7f93d9 weekly-trending-words commit_raw.json 54af61256e5b14bb398aa022024c87efb9ce7b532bfd26a264babc71a07a2742 ZomLandElectionVoters commit_raw.json 5565c44dcf9af4dfc9bb851de9186f0b62b82b8ccf404d8d4e5c57b35d5d62e9 Top_100_Accounts_by_Number_of_Received_Likes commit_raw.json 55f67be11dcced14aa2bbdde9beb0c108527c014adb3dcdc0e1038da09137630 QRcodeToString commit_raw.json 564b0ddff751ce6afa46a2309a62f8814df0561560d6608ccffa359fe0d104f3 ipt-giveaway1 commit_raw.json 569952b3b260c6ab92097fa42a09bf03e8416543b047031f77b0fdb20e4651aa ArbBOS commit_raw.json Lendle.Card.CardsTable commit_raw.json NewCampaign commit_raw.json PendingList commit_raw.json Recommender.Account.AccountProfileViewSwitch commit_raw.json Square commit_raw.json abi2form-example commit_raw.json 575cf7387355b578cfb7c7f6022be2250ffedd18a33d4c896f27c6190fcbaef4 Draft-0 commit_raw.json GoerliEthWrapper commit_raw.json 57842917f42b7c59125fa393e046d07a88f7e239c817395ebaebcd82e823cc97 Test commit_raw.json most-accounts-followed commit_raw.json 57e64c31ea4bb722ee6d74da519d031d21fec467215db48a380ffb07fc1a9306 NEAT commit_raw.json 58423e7fe4bbc6956ea637d23cbeedee8ec23873fcd93bafb69086af625563e9 Composition.jsx commit_raw.json GreeterToday commit_raw.json GreetingToday commit_raw.json GreetingYourName commit_raw.json NearbyMe commit_raw.json Untitled-0 commit_raw.json 5842af77c5d5647d86a6d42e4b7dcbf3d00be0311b321ab60a31ef0fab8e097c Untitled-0 commit_raw.json pick-em-leaderboard commit_raw.json pick-em-select commit_raw.json 585ecc66a2926b3cce3c2bda2f6d78aef769afc50e954146bb1319b6dd705171 Flipsidecrypto.xyz commit_raw.json 5a20dee8f8448d6c7e809bcb81f1f83a8676b91a02cf62bfb7d9be4542111db0 ForkThis commit_raw.json 5a741191eb41832be23ebdfed44df34683ac71c15ec0e371e9a1a7d800bc601e Draft-01 commit_raw.json 5ba8abf163fbde2fe254be18d27fc28dc800deddb697c7e7bdcaa0aeaa59e03b nft-marketplace commit_raw.json 5bb77e3fc5e3ba01175b3fcb153b6b5c35e0450e46d7aa98d78649f2e8e1340c TopAccountbytheirpostComments commit_raw.json 5d71550a10bb07de12bc19f74c7ff6fa00b7ec40f85aa3af6403acea778b5ef9 Draft-0 commit_raw.json 5e5657a757bb41d7cf7e3513124b02eea8d256649cff6f02311f4dfe5bab19ea Draft-1 commit_raw.json minsta commit_raw.json nft-marketplace commit_raw.json 5er.near Untitled-0 commit_raw.json veri-secure-creds-integration commit_raw.json 60071c5169a942d4c3378bcf8606557b88a82ec920253c325db4233104082e29 all_user_challenges.jsx commit_raw.json all_user_challenges commit_raw.json welcome_page.jsx commit_raw.json welcome_page commit_raw.json 6131245a0c886f96bd516d3f4adc5b61a7dcb683f10e2a6eedb7dbf3c246f7a7 Piedra-Papel-Tijera commit_raw.json Untitled-0 commit_raw.json 622e6c569e04f12fa7d2665309f4dd421e4f7fb9bc593ce01cfcdb052f2f1cc1 ForkThis commit_raw.json 63cf5a1d81ae3b1bcba60219a17664aba8622a2ec984fe0e1230b23fd75e79d1 hwfa commit_raw.json 64f927ec826b6015a9afefcd65cf1d4ed862b5e73f52ec6cae2ccbacfa3bb82d MyPage commit_raw.json ProfilePage commit_raw.json SocialPage commit_raw.json 652a8c3d2171a43404b88aa01678f4d59693492fe8852d801f1504efd4dc7214 TP_Intro commit_raw.json 659f08890482b5a2270c0096ab85a8dd1d1e8f0fb656b4fa44e72049a81e0f43 Untitled-0 commit_raw.json billbos-ads-card commit_raw.json billbos-ads commit_raw.json billbos-board commit_raw.json billbos-campaigns commit_raw.json billbos-create-ads commit_raw.json billbos-dashboard commit_raw.json billbos-main commit_raw.json billbos-reward-card commit_raw.json billbos-reward commit_raw.json billbos-stake-modal commit_raw.json 65d42b9e18e7c53a29c64b1bb544e55ddb49459de92138ab8251e288d304fd73 Draft-0 commit_raw.json 65db4376004a6b44beaf2ca18702c4b7426b89adf06d4c43b20a9c68bd627174 Draft-0 commit_raw.json 65e4dd0067a5bc5396495b2258f276a75beb17dead50262d422d52a28dd90b4c Onboarding.Starter-fork commit_raw.json 6602d9907fadff2a4b9cb2fbd83f89bcfb010814478cf9adef376db1d6cad532 IncomeTech commit_raw.json 66dd07a1daf16ddda8a439a8bb9835ccb5137ef4d6cc2eb2bab63ee330cbda4e ForkThis commit_raw.json 680ab4617718fa176646c7d61a9e8faa7aa150da702b74f9b96ec6b90b2b0435 NftCollectionThumbsForTest commit_raw.json 6adbe3aca46fef824ed95c24b625c18fd7c6d978ff713ea11a22cd5b028940f2 GreeterGaenchanaa commit_raw.json KoreanHackman commit_raw.json KoreanHackmanGame commit_raw.json KoreanHangman commit_raw.json KoreanHangmanGame commit_raw.json ScoreBoard commit_raw.json abc commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json collegium.bos.wk3.SocialWidget commit_raw.json slide commit_raw.json 6c16998ab27216f2123f2c87254b6790c71b16bf09603831da7a31e5433ede77 MainPage.Post.Page commit_raw.json ProfilePage commit_raw.json 71c711a2bf7681813abd3cb5406a46a568d49f4de33a0feba1c2d7f50afed5a4 Everything-fork commit_raw.json Everything.Create.Document commit_raw.json Everything.Summary.Document commit_raw.json Everything.View.Document commit_raw.json Everything.View.Idea commit_raw.json 720288545047ae42c47ce521b155241fb760359af60496c46cb74c4358c5870a H5Header commit_raw.json Header commit_raw.json Home commit_raw.json InputRate commit_raw.json Leverage commit_raw.json Limit commit_raw.json Market commit_raw.json Onboarding.Starter-fork commit_raw.json PriceFidld commit_raw.json PriceField commit_raw.json SizeFidld commit_raw.json SizeField commit_raw.json SummaryCard commit_raw.json input commit_raw.json 73c80467ec9079b50c30cabeb62e18b4b8e34fdb6da064c21462a3b8e7a54df5 nft-marketplace commit_raw.json 7409875583e851636d02a7108a064ed67a93359ec67f0fb1f7c83bc6d7ed9e26 asdaaf commit_raw.json 7418d5cb7d7657e526b8bccf28750939105828d0f5b34a7254bd107477d84a2c First_widget_test commit_raw.json I-am-human-cta commit_raw.json InfoProgressWidget commit_raw.json Onboarding.Starter-fork commit_raw.json ProgressBarWidget commit_raw.json ProgressMeterBarWidget commit_raw.json ProgressTableAdminPanel commit_raw.json ProgressTableDoc commit_raw.json ProgressTableRender commit_raw.json ProgressWidgetTable-V2 commit_raw.json ProgressWidgetTable-V3 commit_raw.json ProgressWidgetTable commit_raw.json SingleTestItem commit_raw.json TestComponent commit_raw.json Untitled-0 commit_raw.json 762c0fd3084967125faffacb99198da165cb75212ae23106bcc23ee3810b929f test commit_raw.json 7649ed19fe15dead3bb479bbbf3acd3a2b337eead0999673d20b9935e4d60d8e CoinDNFT commit_raw.json Composition commit_raw.json DashBoardDNFT commit_raw.json GreeterToday commit_raw.json GreetingYourName commit_raw.json Headers commit_raw.json NearComponentDNFT commit_raw.json NearSocialDNFT commit_raw.json NearSocialHeartDNFT commit_raw.json NftCollection commit_raw.json Onboarding.Starter-fork commit_raw.json Profile commit_raw.json TSocialPosts commit_raw.json TprofileComponent commit_raw.json WeatherDNFT commit_raw.json YouJun.collegium.bos.wk3.SocialWidget commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaYouJun commit_raw.json collegium.bos.wk3.SocialWidget commit_raw.json dNFTMinting commit_raw.json 7714d4c7fee098f763e79289fcd0984d48e63e1778a9aab568ff713fdbe49761 Buy-ZLP commit_raw.json Untitled-0 commit_raw.json Untitled-1 commit_raw.json qqq commit_raw.json 777c043850460c64a3c5e18062defef938e51486cd02f67d1c7749ff3bdbff4e Swap-ethxsushi-usdt-near commit_raw.json 77b8464a6283e39404b38a05d5ccb864b0f7a5d6732514a83f8e993938def1ff Composition commit_raw.json Greeter commit_raw.json GreeterToday commit_raw.json GreeterYourName commit_raw.json MyAccount commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json collegium.bos.wk2.Web3ConnectWidget commit_raw.json 789bd4bb9032f4d6714f83124babdf3b8deec32e4200d7ec410a988b8c298e8e Draft-0 commit_raw.json 7c3da6c2278476407aec86c3b4ed09faecf530410d4e1758e3808a6ab3a96b5b ref-market-supply-adjust commit_raw.json 7c55764f47d2a5f5f22632fa5338055a07d5a5bb2a851a2e9c8f9ef7fd309968 Lido commit_raw.json educnear commit_raw.json 7fb71a85c00216db5eac6afa2c379981234a159a83a61cee7c4b3ebc83deac76 Navbar commit_raw.json 81423b2d389fbf3f73ba45e3b62dcc1fdd37cea2d0d383806fdc687822fdb8a6 BOS-greeter commit_raw.json NearIndiaStaker commit_raw.json NearUkraineStakeWidget commit_raw.json New-Draft-0 commit_raw.json Untitled-0 commit_raw.json Verify-account-for-IAH commit_raw.json 8178c066f8626d2f92c90802026f5fb0910e92da792d30458dd0f6049921e23e unkmav commit_raw.json 819c44a1bdd666dce2119a6e92f9d7643136e02fc577e6cd0542bb38f6172b4a HumanAlert commit_raw.json Mapbox commit_raw.json Modal commit_raw.json ProfilePage-fork commit_raw.json ProfilePage commit_raw.json humans.nearverselabs.com commit_raw.json nyc.dao-fork commit_raw.json nyc.dao commit_raw.json queens.dao commit_raw.json 8285d53ac9bffacc1b5a18336608bc33f43c1b94ae9e5f4940da27f9efc12ca1 MD.DALIM commit_raw.json 82a29365f4df813b1e2d78392f5cc242b05247834ad5669d7876ed84433c2019 Composition commit_raw.json Greeter commit_raw.json GreeterYourName commit_raw.json sina commit_raw.json 8345e6972edb36c6b5c3e34b81eb515501258f52b95b8ad01720209cd619c652 Lendle.Card.AssetsToBorrow commit_raw.json Lendle.Card.AssetsToSupply commit_raw.json Lendle.Card.CardContainer commit_raw.json Lendle.Card.CardDataWrapper commit_raw.json Lendle.Card.CardEmpty commit_raw.json Lendle.Card.CardsBody commit_raw.json Lendle.Card.CardsView commit_raw.json Lendle.Card.Divider commit_raw.json Lendle.Card.Markets commit_raw.json Lendle.Card.TokenWrapper commit_raw.json Lendle.Card.YourBorrows commit_raw.json Lendle.Card.YourSupplies commit_raw.json Lendle.Data commit_raw.json Lendle.GasEstimation commit_raw.json Lendle.Header commit_raw.json Lendle.HeroData commit_raw.json Lendle.Modal.AlertModal commit_raw.json Lendle.Modal.BaseModal commit_raw.json Lendle.Modal.BorrowModal commit_raw.json Lendle.Modal.FlexBetween commit_raw.json Lendle.Modal.RepayModal commit_raw.json Lendle.Modal.RoundedCard commit_raw.json Lendle.Modal.WithdrawModal commit_raw.json Lendle.NetworkSwitcher commit_raw.json Lendle.PrimaryButton commit_raw.json Lendle.TabSwitcher commit_raw.json Lendle commit_raw.json Utils.Date commit_raw.json Utils.Import commit_raw.json Utils.Number commit_raw.json End of functions definition 8bc4d1c27b6e5a4c53e666470542ed74c3c842a48264970088b30ac54c10db16 Composition commit_raw.json Composition_Another_Widget commit_raw.json Composition_Another_Widget_MK commit_raw.json Greeter commit_raw.json GreeterMK commit_raw.json GreeterToday commit_raw.json 8e20af69ace22b11769e1cc3418481c31717d7318c397fcd6edec943e64b7f8f Untitled-0 commit_raw.json 8f3c76260ddf0e5aab3fc129d166ffca70b4c5aa8a1eb623237da781ffe9a944 Untitled-23 commit_raw.json Untitled-2e-fork commit_raw.json 906ff613b4b97171836e8fb7c7bcd971ee1082a0355d24c70c6b12b5b96a6ea5 Untitled-0 commit_raw.json Zkalpha-landing-page commit_raw.json 90f47dc5ea90ab839ef41a5479d5274d4030e381a94facb43c3f6a6259c7e411 Untitled-1 commit_raw.json 93068afd39801c0c63a2861d84ee5789d40d5b9d5df54666a50ea0e19718a5fe Onboarding.Starter-fork commit_raw.json tester.testers-fork commit_raw.json 9596bbe46cd7ad606eab1ea7ddb1e4cffaadc7f1d6de271f1229090e3dd218a7 Onboarding.Starter-fork commit_raw.json 9a049abcb001bfc16c50d5a98deca6c6e1ba7f593fc2e3c2566ecaa6b1b04c33 AfroShareTemplate commit_raw.json Eden-AfroShareTemplate commit_raw.json Eden-RentNFT commit_raw.json RentNFT commit_raw.json 9a534017c22b9ae7bcc7ede8e31f141125c80632df461e443470ebc901f61127 PayDal commit_raw.json Untitled-1 commit_raw.json 9a5d7ea3d9b18ae89ea1637aa74fb89c984cfdc42181656f287aca0ac5840ebc HelloWorld commit_raw.json 9b7608a72e12b79fde9f276a7e7480203d2f30b3e59552de21553ff9393e1139 BITKUB_glorious_purpose commit_raw.json 9c461db4ac11b66ed1167ff969042ac278eaf2d571712585424be00171a63884 NFT-Collection-Data commit_raw.json NFT-Collection-Holder-Snapshot commit_raw.json Wallet-Viewer-Indexer-xyz commit_raw.json 9cd1de03b997d127d36618b8cbd07006e286f325e5896bdc06f357fb301f4771 Test commit_raw.json 9d54af9449f5ba8024d2af760b07013e09ee1a4cab8486b6aaf133f83c2f6c6a ForkThis commit_raw.json 9f8d4bf85f6c2169fccce1deb44c95a010f6b9e682f9887d8b56546c0d5312fe App commit_raw.json FetchTest commit_raw.json MainSPPage commit_raw.json MintScore commit_raw.json PartnerLogos commit_raw.json ScorerPage commit_raw.json TestComponent commit_raw.json a0baeab25cc3ee0252667d9b85343959a94281b1b580f2edd7ca0b5c9abb16cb BitKub commit_raw.json a113e5d3eed5abe1237d60828d144ee221254b0ea84a10ec729a0f7adb03da2f PietroComponent1 commit_raw.json SocialMarkdown commit_raw.json Untitled-1 commit_raw.json a13x.near ChatBos commit_raw.json Draft-1 commit_raw.json TransferUSDCNearToronto commit_raw.json ethglobal-nyc-rewardify-claim commit_raw.json ethglobal-nyc-rewardify-drop commit_raw.json owned-nfts--list commit_raw.json owned-nfts--set-profile-pic commit_raw.json a43dafc5a941e0f880ca76fb9447d85016d0c13df4124818ebbc0f73ec540391 bosStudy0RegenMeaning commit_raw.json a470182f2d6d4be241694b7e18433f709f69a793dc1acaad2e4014dd54fbf004 BitkubxBOSHackathon2023-TEAMSLP commit_raw.json Draft-1 commit_raw.json a4c67c8ebe2d159486d2f2547337d86f16c0b8009ad7730807b230ff8d2dfd5d Onboarding.Starter commit_raw.json a533000789133b09ef7a8e744db4a1d2c9322febf94dc01a83980bd7cad51ba5 MagicBuild-widget-form-1698414838202 commit_raw.json a72e8bf55ae6bf237f68ac96c1a4842a7c5b8ed423855b8a9103254a8f9e9546 NEAT commit_raw.json a74cc212ff9e344b80638b1eb0cad8add0d4744d9f07134f10b3ace5e22882e3 CreateProject commit_raw.json Draft-0 commit_raw.json a8ccfcb5eaad20b706c1f0d6153c759e8467d51add9d7d75af9ad5a2d86081cd hamster-pocket commit_raw.json a9233148d5670a4896d89f5d0bb4838ecf20d9a9b05d067f6e9a9265ca23bb08 2.1_DefineVar_CreateFunc commit_raw.json 2.2_BOSWriteCompatibleJSX commit_raw.json API_Social commit_raw.json HelloVBI commit_raw.json HelloWorld commit_raw.json LuyThua commit_raw.json Thanhdt commit_raw.json Untitled-0 commit_raw.json xNhan2 commit_raw.json a92d2106fd31a2d52501953961b1639745434ee343fb6303e4d0195b501b75ad AnotherTest commit_raw.json Demo commit_raw.json DemoWidget commit_raw.json Draft-3 commit_raw.json DraftCheck commit_raw.json NEW commit_raw.json NEwoNe commit_raw.json NewOne commit_raw.json New_test commit_raw.json ProofOfHeight commit_raw.json ReviewFollowerHeights commit_raw.json SetHeightForm commit_raw.json TestCh commit_raw.json TestWidgetDraft commit_raw.json Testing commit_raw.json TestingComponent commit_raw.json TestingDraft commit_raw.json TestingMetadata commit_raw.json TosCheck commit_raw.json TosContent commit_raw.json Untitled-1 commit_raw.json Untitled-4 commit_raw.json something commit_raw.json a_liutiev.near Buttons.ActionButton commit_raw.json Buttons.NavigationButton commit_raw.json Cart.CartModalItem commit_raw.json ETHDenver2023 commit_raw.json ETHWaterloo commit_raw.json Index commit_raw.json InfoSegment commit_raw.json Inputs.AccountId commit_raw.json Inputs.Checkbox commit_raw.json Inputs.Distribution commit_raw.json Inputs.Integration commit_raw.json Inputs.MultiSelect commit_raw.json Inputs.Number commit_raw.json Inputs.Phase commit_raw.json Inputs.ProductType commit_raw.json Inputs.Select commit_raw.json Inputs.Text commit_raw.json Inputs.TextArea commit_raw.json Inputs.Verticals commit_raw.json Lido commit_raw.json Project.About commit_raw.json Project.AboutItem commit_raw.json Project.Actions commit_raw.json Project.Card commit_raw.json Project.Carousel commit_raw.json Project.Create commit_raw.json Project.Detail commit_raw.json Project.DonationsInfo commit_raw.json Project.FollowButton commit_raw.json Project.FollowStats commit_raw.json Project.FollowsYouBadge commit_raw.json Project.Linktree commit_raw.json Project.ListSection commit_raw.json Project.NavOptions commit_raw.json Project.Share commit_raw.json Project.Tags commit_raw.json Project.Team commit_raw.json Untitled-1 commit_raw.json addLiquidityCard commit_raw.json button_general commit_raw.json button_web3connect commit_raw.json display_messages commit_raw.json encodexnear23-uniswap commit_raw.json input_submit commit_raw.json liquidityFooter commit_raw.json potlock.footer.main commit_raw.json potlock.home.builtWith commit_raw.json potlock.home.main1 commit_raw.json potlock.home.stats.link commit_raw.json potlock.home.stats commit_raw.json potlock.navbar.main commit_raw.json potlock.project.funding.main commit_raw.json potlock.project.profile commit_raw.json potlock.project.sidebar.donateButton commit_raw.json potlock.project.sidebar.main commit_raw.json potlock.projects.all commit_raw.json potlock.projects.featured commit_raw.json potlock.projects.listPage commit_raw.json potlock.projects.projectCard commit_raw.json test commit_raw.json troupe-crew-whiting-1709397227467-0 commit_raw.json aaaliahmad.near CoinPrice-fork-fork commit_raw.json CoinPrice-fork commit_raw.json CoinPrice commit_raw.json Linktree commit_raw.json LinktreePersonalizationworking commit_raw.json MysteryBox-fork commit_raw.json Notepad commit_raw.json aaron.near Award-Collections-Minter commit_raw.json Award-Minter commit_raw.json Button-DarkGrey commit_raw.json Button-LightGrey commit_raw.json Hello commit_raw.json HeroBox commit_raw.json ImageGenerator commit_raw.json Minter commit_raw.json OptionBox commit_raw.json ProfilePage commit_raw.json SignIn-Button commit_raw.json StatBlock commit_raw.json Toast commit_raw.json VitalPointAI.DIG.Button commit_raw.json VitalPointAI.Notifications.Notification commit_raw.json VitalPointAI.Notifications.NotificationButton commit_raw.json VitalPointAI.Notifications.Notifications commit_raw.json VitalPointAI.Notifications.NotificationsList commit_raw.json VitalPointAI.Notifications.Settings commit_raw.json aave-v3.near AAVE.Card.AssetsToBorrow commit_raw.json AAVE.Card.AssetsToSupply commit_raw.json AAVE.Card.CardContainer commit_raw.json AAVE.Card.CardDataWrapper commit_raw.json AAVE.Card.CardEmpty commit_raw.json AAVE.Card.CardsBody commit_raw.json AAVE.Card.CardsTable commit_raw.json AAVE.Card.CardsView commit_raw.json AAVE.Card.Divider commit_raw.json AAVE.Card.TokenWrapper commit_raw.json AAVE.Card.YourBorrows commit_raw.json AAVE.Card.YourSupplies commit_raw.json AAVE.Data commit_raw.json AAVE.GasEstimation commit_raw.json AAVE.Header commit_raw.json AAVE.HeroData commit_raw.json AAVE.Modal.AlertModal commit_raw.json AAVE.Modal.BaseModal commit_raw.json AAVE.Modal.BorrowModal commit_raw.json AAVE.Modal.FlexBetween commit_raw.json AAVE.Modal.RepayModal commit_raw.json AAVE.Modal.RoundedCard commit_raw.json AAVE.Modal.SupplyModal commit_raw.json AAVE.Modal.WithdrawModal commit_raw.json AAVE.NetworkSwitcher commit_raw.json AAVE.PrimaryButton commit_raw.json AAVE.TabSwitcher commit_raw.json AAVE commit_raw.json Utils.Date commit_raw.json Utils.Import commit_raw.json Utils.Number commit_raw.json aayehsa.near tic-tac-toe commit_raw.json aayush1204.near Everything.Create.Test commit_raw.json Everything.Summary.Test commit_raw.json Everything.View.Test commit_raw.json Everything commit_raw.json abdullahi3000.near Compose commit_raw.json DAO.Funds.Balance commit_raw.json DAO.Funds.index commit_raw.json Data.Balances commit_raw.json Feed commit_raw.json MainPage.N.Post.Page commit_raw.json MainPage.N.Post commit_raw.json MusicPlayer-Harmonic commit_raw.json NDCDocs_AllArticlesList commit_raw.json ProfilePage commit_raw.json WikiOnSocialDB_MainNavigation commit_raw.json app commit_raw.json artist.feed commit_raw.json components.Button commit_raw.json components.Navbar commit_raw.json components.Post commit_raw.json components.Tag commit_raw.json components.buttons.Connect commit_raw.json components.buttons.UserDropdown commit_raw.json components.post.Header commit_raw.json components commit_raw.json config.app commit_raw.json config.feed commit_raw.json config.music commit_raw.json create.artist commit_raw.json create commit_raw.json docs commit_raw.json every.array.build commit_raw.json harmonic.artists.network commit_raw.json harmonic.docs commit_raw.json harmonic.docs_AllArticlesList commit_raw.json harmonic.join.us commit_raw.json harmonic.music.player commit_raw.json harmonic.music commit_raw.json harmonic.pitch commit_raw.json harmonic.song.uploader commit_raw.json harmonicHomPage commit_raw.json home.Footer commit_raw.json home.Governance commit_raw.json home.Home commit_raw.json home.Purposes commit_raw.json home.goals commit_raw.json home.hero commit_raw.json home commit_raw.json page.feed commit_raw.json page.home commit_raw.json page.music commit_raw.json template.AppLayout commit_raw.json template.SidebarLayout commit_raw.json abhishekanirudhan.near BDS_Page commit_raw.json ComponentSearch.Item commit_raw.json NEAR-ATLAS-BDS-MonthlyActiveAcounts commit_raw.json NEAR.ATLAS.BDS_NFT_DETAILED_PROJECT_DASHBOARD commit_raw.json NEAR.ATLAS.BDS_NFT_PROJECTS commit_raw.json NEAR.ATLAS.EconomyPage commit_raw.json NEAR.ATLAS.HUB.TABLE.TOP.DAPPS commit_raw.json NEAR.ATLAS.REACT.BDS.TABLE.TOP.DAPPS commit_raw.json NEAR.ATLAS.TABLE.VHUB.BOS commit_raw.json NEAR.ATLAS.TOTAL_STAKED commit_raw.json NEAR.ATLAS.TOTAL_SUPPLY commit_raw.json NEAR.ATLAS.VHUB.MonthlyActiveAcounts commit_raw.json NEAR.ATLAS.VHUB_DETAILED_PROJECT_DASHBOARD commit_raw.json NEAR.ATLAS.VHUB_Page commit_raw.json NEART.ATLAS.BDS_DETAILED_PROJECT_DASHBOARD commit_raw.json abnakore.near AdminHome.jsx-fork commit_raw.json AdminHome.jsx commit_raw.json AdminHome commit_raw.json App.jsx commit_raw.json Aside.jsx commit_raw.json Aside commit_raw.json Candidates.jsx commit_raw.json CreateVote commit_raw.json Input.jsx commit_raw.json ManageCandidates.jsx commit_raw.json ManageCandidates commit_raw.json ManageParties.jsx commit_raw.json ManageParties commit_raw.json Register.jsx commit_raw.json Result.jsx commit_raw.json SignIn.jsx commit_raw.json TNEAudioCard commit_raw.json TNEDiscover commit_raw.json TNESearchBar commit_raw.json TNESideBar commit_raw.json TNESongCard commit_raw.json Table.jsx commit_raw.json Table commit_raw.json VoteCard commit_raw.json VoteChain commit_raw.json Wrapper.jsx commit_raw.json Wrapper commit_raw.json index.html commit_raw.json main.jsx commit_raw.json style.css commit_raw.json abstractrabbit.near nft-marketplace commit_raw.json abubakarimam.near BlockchainComponent commit_raw.json Footer commit_raw.json Header commit_raw.json Hero commit_raw.json Home commit_raw.json HowITWorkSection commit_raw.json IntroSection commit_raw.json ac.mintbase.near storage_details commit_raw.json storage_management commit_raw.json academy.near edu.answer.edit commit_raw.json edu.answer.feed commit_raw.json edu.answer commit_raw.json edu.feed commit_raw.json edu.posts commit_raw.json edu.question.details commit_raw.json edu.question.page commit_raw.json edu.question.preview commit_raw.json edu.question commit_raw.json edu commit_raw.json acc18661b4aba1b56551eb779084bac24c01f8f94d12837f8fd7c65514d30de3 Hi commit_raw.json achildhoodhero.near Mailchail_Icon_Profile commit_raw.json NEARWEEK-DAO-Submission-fork commit_raw.json bosweek.menu.content commit_raw.json bosweek.page.content commit_raw.json chat-gpt.bos commit_raw.json eth.apps.near commit_raw.json everything.near commit_raw.json evm.components.near commit_raw.json genadrop.explore.near commit_raw.json genadrop.mint.bos commit_raw.json genadrop.multilisting.near commit_raw.json hero.certified-apps.bos commit_raw.json lido.stake.bos commit_raw.json mailchain.profile.near commit_raw.json near.devhub.bos commit_raw.json near.generation.bos commit_raw.json nearweek-newsletter commit_raw.json nearweek.editorial.bos commit_raw.json nearweek.medium.bos commit_raw.json sharddog.bos commit_raw.json stader.stake.bos commit_raw.json swap.near commit_raw.json trisolaris.swap.near commit_raw.json weather.near commit_raw.json acvzii.tg 4514transfer commit_raw.json Storage_Freeing commit_raw.json hot commit_raw.json ad8383b55371a8f32ca19cfc47da0677dc2b556e6e074eba964c8797bc9ff47a CitiBikeScenic commit_raw.json Heyyy commit_raw.json boroughs.form commit_raw.json boroughs.index commit_raw.json boroughs.inspect commit_raw.json boroughs.map commit_raw.json adcf7a2b7aa3838071e432721b12eee5f2412e27fcfeed56ade28b0710912d95 Lido_Stake commit_raw.json erc20-sender commit_raw.json adminalpha.near AI.Agent.AgentBuilder commit_raw.json AI.Agent.AgentCard commit_raw.json AI.Agent.AgentChat commit_raw.json AI.Agent.AgentCustomizer commit_raw.json AI.Agent.AgentDetails commit_raw.json AI.Agent.AgentEntityConfig commit_raw.json AI.Agent.AgentSummary commit_raw.json AI.Agent.LangChain commit_raw.json AI.Dashboard commit_raw.json AI.HeaderText commit_raw.json AI.Nexus commit_raw.json AI.Overview commit_raw.json AI.Placeholder commit_raw.json AI.Schema.Agent commit_raw.json AI.Schema.AlignmentDataset commit_raw.json AI.Schema.ModelName commit_raw.json AI.Schema.Nexus commit_raw.json AccountAutocomplete commit_raw.json AccountProfile commit_raw.json AccountProfileCard commit_raw.json AccountProfileInline commit_raw.json AccountProfileOverlay commit_raw.json ActivityPage commit_raw.json CommentButton commit_raw.json Comments.Comment commit_raw.json Comments.Compose commit_raw.json Comments.Feed commit_raw.json ComponentCard commit_raw.json ComponentCollection commit_raw.json ComponentDetailsPage commit_raw.json ComponentProfile commit_raw.json ComponentSearch commit_raw.json ComponentSummary commit_raw.json ComponentsPage commit_raw.json CopyUrlButton commit_raw.json DIG.Button commit_raw.json DIG.Theme commit_raw.json DS.Button commit_raw.json DS.Theme commit_raw.json EventsIframeTest commit_raw.json ExploreWidgets commit_raw.json FastAuth commit_raw.json FeaturedComponents commit_raw.json Feed.Post commit_raw.json Feed commit_raw.json FollowButton commit_raw.json FollowersList commit_raw.json FollowingList commit_raw.json GlobalSearch commit_raw.json GlobalSearchPage commit_raw.json HomePage commit_raw.json ImageEditorTabs commit_raw.json IndexFeed commit_raw.json LatestComponents commit_raw.json LatestFollowActivity commit_raw.json LatestNews commit_raw.json LatestPeople commit_raw.json LikeButton commit_raw.json MetadataEditor commit_raw.json ModalTest commit_raw.json Moderate commit_raw.json NFTCollection commit_raw.json NearOrg.HomePage commit_raw.json NearOrg.LearningLinks commit_raw.json NearOrg.LearningLinksSection commit_raw.json NearOrg.UsePage commit_raw.json Notification commit_raw.json NotificationButton commit_raw.json NotificationsPage commit_raw.json PeoplePage commit_raw.json PokeButton commit_raw.json PostPage commit_raw.json Posts.Compose commit_raw.json Posts.Feed commit_raw.json Posts.Post commit_raw.json Posts commit_raw.json ProfileEditor commit_raw.json ProfilePage.Sidebar commit_raw.json ProfilePage commit_raw.json ProfileSearch commit_raw.json RootIconLinks commit_raw.json SocialMarkdown commit_raw.json Tags commit_raw.json Test commit_raw.json Theme commit_raw.json TosCheck commit_raw.json TosContent commit_raw.json adminalpha.near.AccountAutocomplete commit_raw.json adminalpha.near.AccountProfile commit_raw.json adminalpha.near.AccountProfileCard commit_raw.json adminalpha.near.AccountProfileInline commit_raw.json adminalpha.near.AccountProfileOverlay commit_raw.json adminalpha.near.ActivityPage commit_raw.json adminalpha.near.CommentButton commit_raw.json adminalpha.near.Comments.Comment commit_raw.json adminalpha.near.Comments.Compose commit_raw.json adminalpha.near.Comments.Feed commit_raw.json adminalpha.near.ComponentCard commit_raw.json adminalpha.near.ComponentCollection commit_raw.json adminalpha.near.ComponentDetailsPage commit_raw.json adminalpha.near.ComponentProfile commit_raw.json adminalpha.near.ComponentSearch commit_raw.json adminalpha.near.ComponentSummary commit_raw.json adminalpha.near.ComponentsPage commit_raw.json adminalpha.near.CopyUrlButton commit_raw.json adminalpha.near.ExploreWidgets commit_raw.json adminalpha.near.FastAuth commit_raw.json adminalpha.near.FeaturedComponents commit_raw.json adminalpha.near.Feed.Post commit_raw.json adminalpha.near.Feed commit_raw.json adminalpha.near.FollowButton commit_raw.json adminalpha.near.FollowersList commit_raw.json adminalpha.near.FollowingList commit_raw.json adminalpha.near.GlobalSearch commit_raw.json adminalpha.near.GlobalSearchPage commit_raw.json adminalpha.near.HomePage commit_raw.json adminalpha.near.IndexFeed commit_raw.json adminalpha.near.LatestComponents commit_raw.json adminalpha.near.LatestFollowActivity commit_raw.json adminalpha.near.LatestNews commit_raw.json adminalpha.near.LatestPeople commit_raw.json adminalpha.near.LikeButton commit_raw.json adminalpha.near.ModalTest commit_raw.json adminalpha.near.Moderate commit_raw.json adminalpha.near.NFTCollection commit_raw.json adminalpha.near.Notification commit_raw.json adminalpha.near.NotificationButton commit_raw.json adminalpha.near.NotificationsPage commit_raw.json adminalpha.near.PeoplePage commit_raw.json adminalpha.near.PokeButton commit_raw.json adminalpha.near.PostPage commit_raw.json adminalpha.near.Posts.Compose commit_raw.json adminalpha.near.Posts.Feed commit_raw.json adminalpha.near.Posts.Post commit_raw.json adminalpha.near.Posts commit_raw.json adminalpha.near.ProfilePage.Sidebar commit_raw.json adminalpha.near.ProfilePage commit_raw.json adminalpha.near.ProfileSearch commit_raw.json adminalpha.near.RootIconLinks commit_raw.json adminalpha.near.SocialMarkdown commit_raw.json adminalpha.near.Tags commit_raw.json adminalpha.near.TosCheck commit_raw.json adminalpha.near.TosContent commit_raw.json adnansiddiqui.near 00-basicForm-IntegrityVault commit_raw.json Uniswap commit_raw.json mft_transfer commit_raw.json premium-users commit_raw.json ae03d71382e8621650adfb5706ca430676d9756893b08c1efeae37c92024ef1a SlippageTolerance commit_raw.json ref-adjust-button commit_raw.json ref-burrow-healthFactor commit_raw.json ref-icons commit_raw.json ref-input-box commit_raw.json ref-lending commit_raw.json ref-market-burrow-assets commit_raw.json ref-market-burrow-burrow commit_raw.json ref-market-burrow-repay commit_raw.json ref-market-supply-adjust commit_raw.json ref-market-supply-assets commit_raw.json ref-market-supply-supply-near commit_raw.json ref-market-supply-supply commit_raw.json ref-market-supply-withdraw commit_raw.json ref-operation-button commit_raw.json ref-stable-swap-algorithm commit_raw.json ref-swap-getEstimate commit_raw.json ref_account-signin commit_raw.json ref_burrow-data commit_raw.json selectToken commit_raw.json ss-your-burrow commit_raw.json ss-your-supply commit_raw.json ae40cb52839f896de8ec2313e5d7ef5f3b05b9ebc474329fa3456eec32126055 AnotherWidget commit_raw.json BlockToDate commit_raw.json CommentButton commit_raw.json Comments.Feed commit_raw.json ComponentDetailsPage.Discussion.Compose commit_raw.json ComponentDetailsPage.Discussion.Feed commit_raw.json ComponentDetailsPage.Discussion commit_raw.json ComponentDetailsPage commit_raw.json ComponentDetaulsPage.Discussion commit_raw.json DevSuport.Main commit_raw.json DevSupport.Answer.Button.Valid commit_raw.json DevSupport.Answer.Edit commit_raw.json DevSupport.Answer.Feed commit_raw.json DevSupport.Answer.ManualIndexFeed commit_raw.json DevSupport.Answer commit_raw.json DevSupport.Compose commit_raw.json DevSupport.Feed commit_raw.json DevSupport.Flag commit_raw.json DevSupport.Question.Button.Answers commit_raw.json DevSupport.Question.Button.Delete commit_raw.json DevSupport.Question.Button.Flag commit_raw.json DevSupport.Question.Button.Upvote commit_raw.json DevSupport.Question.Edit commit_raw.json DevSupport.Question.LabelsDisplay commit_raw.json DevSupport.Question.ManualIndexFeed commit_raw.json DevSupport.Question.Page commit_raw.json DevSupport.Question.Preview commit_raw.json DevSupport.Question commit_raw.json DevSupport.Upvote commit_raw.json DiscussionContainer commit_raw.json ExampleForDorian commit_raw.json Greetings commit_raw.json HelloNear commit_raw.json Images commit_raw.json Learning.Main commit_raw.json Learning.Menu commit_raw.json LikeButton commit_raw.json MyWidget commit_raw.json NestedDiscussion.Preview commit_raw.json NestedDiscussion.SinglePageView commit_raw.json NestedDiscussions.Compose commit_raw.json NestedDiscussions.Feed commit_raw.json NestedDiscussions.LikeButton commit_raw.json NestedDiscussions.Preview.CommentButton commit_raw.json NestedDiscussions.Preview.LikeButton commit_raw.json NestedDiscussions.Preview commit_raw.json NestedDiscussions.SinglePageView commit_raw.json NestedDiscussions commit_raw.json Notification commit_raw.json NotificationsPage commit_raw.json PleaseLogin commit_raw.json QuestionEditor commit_raw.json SimplyTest commit_raw.json Viewer commit_raw.json aerok.near Draft commit_raw.json Onboarding.Starter-fork commit_raw.json Onboarding.Starter commit_raw.json Starter.Test commit_raw.json afb6360941198112f78d9803f35c31933ce15cbbc53a8ea2e79dc31393355c41 ComponentDetailsPage-fork commit_raw.json agar3s.near BuggyAdventure commit_raw.json agiguild.near Agent.AgentBuilder commit_raw.json Agent.AgentCard commit_raw.json Agent.AgentChat commit_raw.json Agent.AgentDetails commit_raw.json Agent.AgentEntityConfig commit_raw.json Agent.AgentHeader commit_raw.json Agent.AgentSummary commit_raw.json Dashboard commit_raw.json HeaderText commit_raw.json Nexus commit_raw.json Overview commit_raw.json Placeholder commit_raw.json Schema.Agent commit_raw.json Schema.AlignmentDataset commit_raw.json Schema.Generic commit_raw.json Schema.ModelName commit_raw.json Schema.Nexus commit_raw.json agruzdev.near CompTree.View.ComponentCard commit_raw.json CompTree commit_raw.json agwaze.near CPlanet.Button.ArrowButton commit_raw.json CPlanet.DAO.Card commit_raw.json CPlanet.DAO.Explore commit_raw.json CPlanet.DAO.Members.Card commit_raw.json CPlanet.DAO.Members.Index commit_raw.json CPlanet.DAO.Members.MembersGroup commit_raw.json CPlanet.DAO.Members.SideCard commit_raw.json CPlanet.DAO.ProfileNFTs commit_raw.json CPlanet.DAO.Proposal.Card commit_raw.json CPlanet.DAO.SingleDAO commit_raw.json CPlanet.DAO.index commit_raw.json CPlanet.Explore.ChainsDropdown commit_raw.json CPlanet.Explore.DAONFTs commit_raw.json CPlanet.Explore.FilterDropdown commit_raw.json CPlanet.Explore.NFTInfo commit_raw.json CPlanet.Explore.SingleNFT commit_raw.json CPlanet.Explore.index commit_raw.json CPlanet.FeaturedNFT.index commit_raw.json CPlanet.Footer.index commit_raw.json CPlanet.Footer commit_raw.json CPlanet.Home.NFTs commit_raw.json CPlanet.Home.Partners commit_raw.json CPlanet.Home.Quest commit_raw.json CPlanet.Home.index commit_raw.json CPlanet.NFTCard.FeaturedNFT commit_raw.json CPlanet.NFTCard.index commit_raw.json CPlanet.Navbar.index commit_raw.json CPlanet.Navbar commit_raw.json CPlanet.index commit_raw.json CreativeDAO.Discussions commit_raw.json CreativeDAO.EasyPoll commit_raw.json CreativeDAO.Footer commit_raw.json CreativeDAO.Navbar commit_raw.json CreativeDAO.index commit_raw.json Eth-Explore commit_raw.json Eth-SingleNFT commit_raw.json GenaDrop.ChainsDropdown commit_raw.json GenaDrop.Community commit_raw.json GenaDrop.Create commit_raw.json GenaDrop.EVMExplore commit_raw.json GenaDrop.EVMSingleNFT commit_raw.json GenaDrop.Explore commit_raw.json GenaDrop.Feed commit_raw.json GenaDrop.ListingMarketPrice commit_raw.json GenaDrop.Minter commit_raw.json GenaDrop.NFTDetails commit_raw.json GenaDrop.NFTListing commit_raw.json GenaDrop.NavBar commit_raw.json GenaDrop.NearLogo commit_raw.json GenaDrop.Profile.Main commit_raw.json GenaDrop.Profile.MyNFTS commit_raw.json GenaDrop.SuccessModal commit_raw.json GenaDrop.index commit_raw.json Test.ExpensiveFunction commit_raw.json Test.useState commit_raw.json Test.useTimeout commit_raw.json Untitled-1 commit_raw.json WebFusion.About commit_raw.json WebFusion.Custom.Button commit_raw.json WebFusion.Event.index commit_raw.json WebFusion.Footer commit_raw.json WebFusion.Home.EventDetails commit_raw.json WebFusion.Home.EventPage commit_raw.json WebFusion.Home.EventPrice commit_raw.json WebFusion.Home.Sponsors commit_raw.json WebFusion.Home.index commit_raw.json WebFusion.Navbar.Side commit_raw.json WebFusion.Navbar.Top commit_raw.json WebFusion.Team.index commit_raw.json WebFusion.index commit_raw.json genadrop-nft-details commit_raw.json nft-selector commit_raw.json test-submit commit_raw.json ahmadbug.near Budegtoverview commit_raw.json Budget commit_raw.json ExpenseForm commit_raw.json ExpensesTracker commit_raw.json List commit_raw.json ahmedmobark.near Test commit_raw.json aidan7.near FollowButton commit_raw.json HelloAccountIdHeader commit_raw.json QRCodeWidget commit_raw.json aiml.near Form commit_raw.json Quotes commit_raw.json Todolist commit_raw.json Untitled-0 commit_raw.json ajluc.near Affordable_Map commit_raw.json Map.Mapbox commit_raw.json data commit_raw.json ajuric.near Untitled-0 commit_raw.json akanksha299608.near ForkThis commit_raw.json akinola_62.near ProfilePage commit_raw.json akinyemisaheedwale5.near columnOne commit_raw.json componentOne commit_raw.json fullApp commit_raw.json greetings commit_raw.json sectionOne commit_raw.json akshatg6.near AccountAbstraction commit_raw.json Document commit_raw.json Everything.Create.Document commit_raw.json Everything.Summary.Document commit_raw.json Everything.View.Document commit_raw.json ForkThis commit_raw.json Greeter commit_raw.json al_ameen.near Onboarding.ComponentCollection commit_raw.json alantests.near BookStore commit_raw.json Burrito-Virtual-Pet-Mint-2 commit_raw.json GNS-Staking commit_raw.json ToDoList commit_raw.json alejandro.near DonateNEARtoAVB commit_raw.json aleksandarv.near Untitled-0 commit_raw.json alekspopovic.near Untitled-0 commit_raw.json alem-lib.near Index commit_raw.json createDebounce commit_raw.json alenm.near Untitled-0 commit_raw.json alexanderdurbin.near everything commit_raw.json alexsaddler.near everything commit_raw.json alexseo.near ForkThis commit_raw.json alezanaab.near Lido-Testnet commit_raw.json alice.bo.near Ideas commit_raw.json allowances.near Index commit_raw.json almondjelly.near hearts commit_raw.json almore.near createalex commit_raw.json aloin.near FollowButton commit_raw.json ProfileSocial commit_raw.json test commit_raw.json alotaco.near SushiSwap commit_raw.json cantoswap-component commit_raw.json alphadino.near ActivityPage commit_raw.json MyComponent commit_raw.json alphaflexhub.near CollectionSelector commit_raw.json EasyPoll commit_raw.json ProfilePage commit_raw.json alsakhaev.near AnotherButton commit_raw.json AnotherText commit_raw.json DappletWidget commit_raw.json ExampleButton commit_raw.json HelloWorld commit_raw.json HelloWorldText commit_raw.json Homepage commit_raw.json MainPage.N.Post.Header commit_raw.json ProfilePage commit_raw.json RedButton commit_raw.json TestContainer commit_raw.json TestContainer2 commit_raw.json TestRecursivePage commit_raw.json TheRedButton commit_raw.json Untitled-0 commit_raw.json Untitled-1 commit_raw.json Untitled-2 commit_raw.json WebSite1 commit_raw.json WebSite2 commit_raw.json alyssakim.near Everything.Create.Document commit_raw.json Everything.Summary.Document commit_raw.json Everything.View.Document commit_raw.json ForkThis commit_raw.json amandaalexbr.near ImportCSSFromIPFS commit_raw.json Livepeer.Player commit_raw.json VexAboutUs commit_raw.json VexButtonRed commit_raw.json VexButtonWhite commit_raw.json VexButtonWhiteTransparent commit_raw.json VexH1 commit_raw.json VexHero commit_raw.json VexHomepage commit_raw.json VexNavbar commit_raw.json VexSubTitle commit_raw.json VexSubtitle commit_raw.json VexTitle commit_raw.json VexVideo commit_raw.json amarachiugwu.near yellow commit_raw.json ame9986.near Draft-0 commit_raw.json TercerProyecto commit_raw.json TravelBlog commit_raw.json home commit_raw.json amestrov.near NEARBalkansHUB commit_raw.json Pathfinder commit_raw.json Untitled-0 commit_raw.json amirsaran.near cookies commit_raw.json amy246.near Test-BY-amy246 commit_raw.json Testcreate commit_raw.json Untitled-0 commit_raw.json Untitled-1 commit_raw.json ananastya.near Onboarding.Starter-fork commit_raw.json andersonr.near ProfileLinksPage commit_raw.json Teste1 commit_raw.json Untitled-0 commit_raw.json andreapn1709.near nearandrea commit_raw.json andrejkasapinov.near Untitled-0 commit_raw.json andres20.near MiPrimerDespliegue commit_raw.json andresdom.near Draft-0 commit_raw.json NearP2P commit_raw.json andricmilos.near Untitled-0 commit_raw.json andyh.near Applications commit_raw.json ApplicationsAsync commit_raw.json BWE.NewlineBug commit_raw.json BWE.StringRender commit_raw.json BearEnhance commit_raw.json BearFacts commit_raw.json CallbackRender commit_raw.json CallbackRenderChild commit_raw.json CallbackRenderWidget commit_raw.json Circle commit_raw.json Common.Compose commit_raw.json Component.InlineBlock commit_raw.json ComponentAsync.InlineBlock commit_raw.json ComponentITestChild commit_raw.json ComponentIdTestChild commit_raw.json ComponentIdTestLeaf commit_raw.json ComponentIdTestParent commit_raw.json ComponentIdTestRoot commit_raw.json ComponentSearch.Item commit_raw.json ComponentSearch commit_raw.json ComponentSearchAsync.Item commit_raw.json ComponentSearchAsync commit_raw.json Export.Child commit_raw.json Export commit_raw.json FilteredIndexFeed commit_raw.json FollowFeed commit_raw.json FollowFeedWrapper commit_raw.json FollowStats commit_raw.json FollowsYouBadge commit_raw.json Hooks commit_raw.json HooksDemo commit_raw.json HooksRoot commit_raw.json Image commit_raw.json ImportTest.Child commit_raw.json ImportTest commit_raw.json Index commit_raw.json IndexFeed.Items commit_raw.json IndexFeed commit_raw.json InfiniteScroll commit_raw.json ItemFeed commit_raw.json LandingPage commit_raw.json LastProfilesImages commit_raw.json LikeButton.Faces commit_raw.json LikeButton commit_raw.json MainPage.Comment.Compose commit_raw.json MainPage.Comment.Feed commit_raw.json MainPage.Comment commit_raw.json MainPage.Common.FlagContent commit_raw.json MainPage.Common.HideAccount commit_raw.json MainPage.Compose commit_raw.json MainPage.FeaturedApps commit_raw.json MainPage.Feed.Beta commit_raw.json MainPage.Post.Content commit_raw.json MainPage.Post.Header commit_raw.json MainPage.Post.ShareButton commit_raw.json MainPage.Post commit_raw.json MainPage commit_raw.json MainPageSandboxed commit_raw.json MainPageTest commit_raw.json MainPageWrapper commit_raw.json ManualIndexFeed commit_raw.json Markdown commit_raw.json MarkedReact commit_raw.json MergedIndexFeed commit_raw.json NPM.react-button commit_raw.json NPM.react-infinite-scroll-component commit_raw.json NPMRoot commit_raw.json NestedProps.Child commit_raw.json NestedProps.Parent commit_raw.json NestedProps commit_raw.json NftImage commit_raw.json OwaChild commit_raw.json OwaRoot commit_raw.json People commit_raw.json PokeFeed commit_raw.json Posts.Markdown commit_raw.json Profile.OverlayTrigger commit_raw.json Profile.Popover commit_raw.json Profile.ShortInlineBlock commit_raw.json ProfileImage commit_raw.json ProfileLine commit_raw.json ProfileOnboarding commit_raw.json ProfileSearch commit_raw.json QueryApi.App commit_raw.json RenderStateUpdate commit_raw.json RenderTest commit_raw.json RenderTestChild commit_raw.json RenderTestGrandchild commit_raw.json RenderTestRoot commit_raw.json RepostButton commit_raw.json ShapeSet.Trusted commit_raw.json ShapeSet commit_raw.json Simple commit_raw.json SocialMarkdown commit_raw.json SocialTest commit_raw.json Square commit_raw.json StateDemo.TrustAuthor commit_raw.json StateDemo.Trusted commit_raw.json StateDemo commit_raw.json StateDemoParent.Trusted commit_raw.json StateDemoParent commit_raw.json StateDemoRoot.Trusted commit_raw.json StateDemoRoot commit_raw.json StateDemoRoot2 commit_raw.json StateRootParent commit_raw.json StateTest commit_raw.json StateTestParent commit_raw.json StateTestRoot commit_raw.json StyledComponents commit_raw.json Test.ShapeSet commit_raw.json Test.StateDemo commit_raw.json Test.StateDemoParent commit_raw.json Test.StateDemoRoot commit_raw.json TestGroup commit_raw.json TestWrapper commit_raw.json TimeAgo commit_raw.json TopLevelCallback commit_raw.json Triangle commit_raw.json TrustDemo commit_raw.json TrustDemoChild commit_raw.json TrustDemoGrandChild commit_raw.json TrustDemoGreatGrandChild commit_raw.json TrustDemoParent commit_raw.json TrustDemoRoot commit_raw.json TrustedState commit_raw.json TrustedStateChild commit_raw.json TrustedStateRoot commit_raw.json UseRef commit_raw.json Welcome.FollowFeed commit_raw.json WidgetIcons commit_raw.json WidgetIconsAsync commit_raw.json WidgetImage commit_raw.json WidgetImageAsync commit_raw.json export.child commit_raw.json export commit_raw.json mui commit_raw.json anhtn512.near Calendar commit_raw.json Easy-NW-Payout-Proposal commit_raw.json Test commit_raw.json Testgithubpage commit_raw.json anhtn512-calendar commit_raw.json animaljjh.near Resume-form commit_raw.json Untitled-1 commit_raw.json ankit2866.near NearPad commit_raw.json Todolist commit_raw.json newcalender commit_raw.json anupam9873.near Onboarding.Starter-fork-fork-fork-fork-fork commit_raw.json Onboarding.Starter-fork-fork-fork-fork commit_raw.json Onboarding.Starter-fork commit_raw.json Untitled-1 commit_raw.json apps.near ConnectButton commit_raw.json FollowButton commit_raw.json Index commit_raw.json Spindle commit_raw.json config.docs commit_raw.json config.feed commit_raw.json config.project commit_raw.json demo commit_raw.json directory commit_raw.json docs commit_raw.json faces commit_raw.json feed.config commit_raw.json feed commit_raw.json navbar commit_raw.json page.footer commit_raw.json page.header commit_raw.json page commit_raw.json project.config commit_raw.json project.layout commit_raw.json project commit_raw.json root commit_raw.json station commit_raw.json template.main commit_raw.json template.sidebar commit_raw.json thing.context commit_raw.json arizas.near Ariz_NEAR_Portfolio_Report commit_raw.json Ariz_Portfolio commit_raw.json armandoumerez.near Onboarding.Starter-fork commit_raw.json armsveshack.near Motema commit_raw.json MotemaWRLD commit_raw.json MotemaWRLDNear commit_raw.json OCTOoNFTs commit_raw.json ScrollMessenger commit_raw.json Untitled-0 commit_raw.json as2.near LikeButton commit_raw.json asiyaasha.near coinSelector commit_raw.json astraplusplus.ndctools.near Actions.index commit_raw.json Bounties.Card commit_raw.json Bounties.List commit_raw.json Bounties.index commit_raw.json Common.Components.Compose commit_raw.json Common.Components.Feed commit_raw.json Common.Components.Post commit_raw.json Common.Layout.CardModal commit_raw.json Common.Layout.Countdown commit_raw.json Common.Layout.Header commit_raw.json Common.Modals.Comments commit_raw.json Common.Modals.FiltersModal commit_raw.json Common.Modals.ProposalArguments commit_raw.json Common.Modals.Share commit_raw.json Common.Modals.ViewDropDown commit_raw.json Common.Modals.Voters commit_raw.json Common.logo commit_raw.json CommunityVoice commit_raw.json Congress.Members commit_raw.json Congress.Proposals commit_raw.json Congress.index commit_raw.json CreateDAO.Footer commit_raw.json CreateDAO.Step1 commit_raw.json CreateDAO.Step2 commit_raw.json CreateDAO.Step3 commit_raw.json CreateDAO.Step4 commit_raw.json CreateDAO.Step5 commit_raw.json CreateDAO.Step6 commit_raw.json CreateDAO.Step7 commit_raw.json CreateDAO.form commit_raw.json CreateDAO.index commit_raw.json DAO.Bounties.Card commit_raw.json DAO.Bounties.List commit_raw.json DAO.Bounties.index commit_raw.json DAO.Bounties commit_raw.json DAO.Discussion commit_raw.json DAO.Feed commit_raw.json DAO.Followers.FollowersList commit_raw.json DAO.Followers.index commit_raw.json DAO.Followers commit_raw.json DAO.Funds.Balance commit_raw.json DAO.Funds.Outgoing commit_raw.json DAO.Funds.TransactionLine commit_raw.json DAO.Funds.Transactions commit_raw.json DAO.Funds.index commit_raw.json DAO.Layout.Header commit_raw.json DAO.Layout.Sidebar commit_raw.json DAO.Layout.Tabs commit_raw.json DAO.Members.FilterModal commit_raw.json DAO.Members.GroupModal commit_raw.json DAO.Members.MembersGroup commit_raw.json DAO.Members.index commit_raw.json DAO.Policy commit_raw.json DAO.Projects commit_raw.json DAO.Proposal.Common.AccountAutoComplete commit_raw.json DAO.Proposal.Common.CongressHouseDropdown commit_raw.json DAO.Proposal.Common.NotificationRolesSelector commit_raw.json DAO.Proposal.Common.ProposalQueue commit_raw.json DAO.Proposal.Common.VetoButton commit_raw.json DAO.Proposal.Create.AddMemberToRole commit_raw.json DAO.Proposal.Create.ApproveBudget commit_raw.json DAO.Proposal.Create.Dismiss commit_raw.json DAO.Proposal.Create.Dissolve commit_raw.json DAO.Proposal.Create.FunctionCall commit_raw.json DAO.Proposal.Create.FundingRequest commit_raw.json DAO.Proposal.Create.RemoveMemberFromRole commit_raw.json DAO.Proposal.Create.Text commit_raw.json DAO.Proposal.Create.Transfer commit_raw.json DAO.Proposal.Create.UpdateBonds commit_raw.json DAO.Proposal.Create.UpdateVoteDuration commit_raw.json DAO.Proposal.Create.Veto commit_raw.json DAO.Proposal.Create commit_raw.json DAO.Proposals.Card.Arguments commit_raw.json DAO.Proposals.Card.MultiVote commit_raw.json DAO.Proposals.Card.Vote commit_raw.json DAO.Proposals.Card.index commit_raw.json DAO.Proposals.Card.skeleton commit_raw.json DAO.Proposals.Card.ui commit_raw.json DAO.Proposals.Card.ui_old commit_raw.json DAO.Proposals.CardsList commit_raw.json DAO.Proposals.Congress.index commit_raw.json DAO.Proposals.FilterModal commit_raw.json DAO.Proposals.MultiVote commit_raw.json DAO.Proposals.MultiVoteSubmit commit_raw.json DAO.Proposals.ProposalsBlockchain commit_raw.json DAO.Proposals.ProposalsPikespeak commit_raw.json DAO.Proposals.Table.Row commit_raw.json DAO.Proposals.Table.index commit_raw.json DAO.Proposals.Table commit_raw.json DAO.Proposals.index commit_raw.json DAO.Settings.BondsSettings commit_raw.json DAO.Settings.ConfigSettings commit_raw.json DAO.Settings.PolicySettings commit_raw.json DAO.Settings.index commit_raw.json DAO.index commit_raw.json DAO commit_raw.json DAOs.Card commit_raw.json DAOs.index commit_raw.json DAOs.list commit_raw.json Feed.index commit_raw.json Layout.Modal commit_raw.json MyProposals.Tabs commit_raw.json MyProposals.index commit_raw.json ProposalsFeed.FilterModal commit_raw.json ProposalsFeed.index commit_raw.json VotingHistory.index commit_raw.json home commit_raw.json index commit_raw.json check user permissions\n const proposalKinds = {\n ChangeConfig: \"config\",\n ChangePolicy: \"policy\",\n AddMemberToRole: \"add_member_to_role\",\n RemoveMemberFromRole: \"remove_member_from_role\",\n FunctionCall: isCongressDaoID ? \"FunctionCall\" : \"call\",\n UpgradeSelf: \"upgrade_self\",\n UpgradeRemote: \"upgrade_remote\",\n Transfer: \"transfer\",\n SetStakingContract: \"set_vote_token\",\n AddBounty: \"add_bounty\",\n BountyDone: \"bounty_done\",\n Vote: \"vote\",\n FactoryInfoUpdate: \"factory_info_update\",\n ChangePolicyAddOrUpdateRole: \"policy_add_or_update_role\",\n ChangePolicyRemoveRole: \"policy_remove_role\",\n ChangePolicyUpdateDefaultVotePolicy: \"policy_update_default_vote_policy\",\n ChangePolicyUpdateParameters: \"policy_update_parameters\",\n Text: \"Text\",\n FundingRequest: \"FundingRequest\",\n RecurrentFundingRequest: \"RecurrentFundingRequest\",\n DismissAndBan: \"DismissAndBan\"\n };\n\n const actions = {\n AddProposal: \"AddProposal\",\n VoteApprove: \"VoteApprove\",\n VoteReject: \"VoteReject\",\n VoteRemove: \"VoteRemove\",\n VoteAbstain: \"VoteAbstain\"\n };\n\n -- Get all the roles from the DAO policy\n roles = roles === null ? [] : roles?.roles ?? roles;\n\n -- Filter the user roles\n const userRoles = [];\n if (Array.isArray(roles)) {\n for (const role of roles) {\n if (role.kind === \"Everyone\") {\n userRoles.push(role);\n continue;\n }\n if (!role.kind.Group) continue;\n if (accountId && role.kind.Group && role.kind.Group.includes(accountId)) {\n userRoles.push(role);\n }\n }\n }\n\n if (isCongressDaoID) {\n userRoles = [\n {\n name: \"all\",\n kind: \"Everyone\",\n permissions: roles?.permissions,\n vote_policy: {}\n }\n ];\n }\n\n if (isVotingBodyDao) {\n userRoles = [\n {\n name: \"all\",\n kind: \"Everyone\",\n permissions: {},\n vote_policy: {}\n }\n ];\n }\n\n const isAllowedTo = (kind, action) => {\n -- Check if the user is allowed to perform the action\n let allowed = false;\n userRoles\n .filter(({ permissions }) => {\n if (isCongressDaoID) {\n const allowedRole =\n permissions.includes(`${kind.toString()}`) &&\n roles?.members?.includes(accountId);\n allowed = allowed || allowedRole;\n return allowedRole;\n } else {\n const allowedRole =\n permissions.includes(`${kind.toString()}:${action.toString()}`) ||\n permissions.includes(`${kind.toString()}:*`) ||\n permissions.includes(`*:${action.toString()}`) ||\n permissions.includes(\"*:*\");\n allowed = allowed || allowedRole;\n return allowedRole;\n }\n })\n .map((role) => role.name);\n return allowed;\n };\n\n const kindName =\n typeof my_proposal.kind === \"string\"\n ? my_proposal.kind\n : isCongressDaoID || isVotingBodyDao\n ? Object.keys(my_proposal.kind)[0]\n : typeof my_proposal.kind.typeEnum === \"string\"\n ? my_proposal.kind.typeEnum\n : Object.keys(my_proposal.kind)[0];\n\n const isAllowedToVote = isVotingBodyDao\n ? [isHuman, isHuman, isHuman, isHuman]\n : [\n isAllowedTo(proposalKinds[kindName], actions.VoteApprove),\n isAllowedTo(proposalKinds[kindName], actions.VoteReject),\n isCongressDaoID\n ? isAllowedTo(proposalKinds[kindName], actions.VoteAbstain)\n : isAllowedTo(proposalKinds[kindName], actions.VoteRemove)\n ];\n\n let totalVotesNeeded = 0;\n\n if (policy?.roles) {\n policy.roles.forEach((role) => {\n Determine if the role is eligible for the given proposalType\n const isRoleAllowedToVote =\n role.permissions.includes(`${proposalKinds[kindName]}:VoteApprove`) ||\n role.permissions.includes(`${proposalKinds[kindName]}:VoteReject`) ||\n role.permissions.includes(`${proposalKinds[kindName]}:*`) ||\n role.permissions.includes(`*:VoteApprove`) ||\n role.permissions.includes(`*:VoteReject`) ||\n role.permissions.includes(\"*:*\");\n\n if (isRoleAllowedToVote) {\n const threshold = (role.vote_policy &&\n role.vote_policy[proposalKinds[kindName]]?.threshold) ||\n policy[\"default_vote_policy\"]?.threshold || [0, 0];\n const eligibleVoters = role.kind.Group ? role.kind.Group.length : 0;\n\n Apply the threshold\n if (eligibleVoters === 0) {\n return;\n }\n const votesNeeded =\n Math.floor((threshold[0] threshold[1]) * eligibleVoters) + 1;\n\n totalVotesNeeded += votesNeeded;\n }\n });\n }\n my_proposal.typeName = kindName.replace( ([A-Z]) g, \" $1\").trim(); Add spaces between camelCase\n if (isCongressDaoID) {\n totalVotesNeeded = daoConfig?.threshold;\n }\n\n if (isVotingBodyDao) {\n const votesConfig = Near.view(daoId, \"get_proposal_consent\", {\n id: proposal.id\n });\n if (votesConfig === null) {\n return;\n }\n totalVotesNeeded = votesConfig.quorum;\n }\n\n let totalVotes = {\n yes: 0,\n no: 0,\n spam: 0,\n abstain: 0,\n total: 0\n };\n\n Object.values(my_proposal.votes).forEach((vote) => {\n if (vote === \"Approve\") {\n totalVotes.yes++;\n } else if (vote === \"Reject\") {\n totalVotes.no++;\n } else if (vote === \"Remove\") {\n totalVotes.spam++;\n }\n });\n\n if (isVotingBodyDao) {\n totalVotes.yes = my_proposal?.approve ?? 0;\n totalVotes.no = my_proposal?.reject ?? 0;\n totalVotes.abstain = my_proposal?.abstain ?? 0;\n totalVotes.spam = my_proposal?.spam ?? 0;\n }\n\n if (isCongressDaoID) {\n for (const { vote } of Object.values(my_proposal.votes)) {\n if (vote === \"Approve\") {\n totalVotes.yes++;\n } else if (vote === \"Reject\") {\n totalVotes.no++;\n } else if (vote === \"Abstain\") {\n totalVotes.abstain++;\n } else if (vote === \"Spam\") {\n totalVotes.spam++;\n }\n }\n }\n totalVotes.total =\n totalVotes.yes + totalVotes.no + totalVotes.spam + totalVotes.abstain;\n\n if (my_proposal.status === \"PreVote\") {\n totalVotes.total = my_proposal?.support ?? 0;\n }\n\n my_proposal.totalVotesNeeded = totalVotesNeeded;\n my_proposal.totalVotes = totalVotes;\n check user permissions\nconst proposalKinds = {\n ChangeConfig: \"config\",\n ChangePolicy: \"policy\",\n AddMemberToRole: \"add_member_to_role\",\n RemoveMemberFromRole: \"remove_member_from_role\",\n FunctionCall: isCongressDaoID ? \"FunctionCall\" : \"call\",\n UpgradeSelf: \"upgrade_self\",\n UpgradeRemote: \"upgrade_remote\",\n Transfer: \"transfer\",\n SetStakingContract: \"set_vote_token\",\n AddBounty: \"add_bounty\",\n BountyDone: \"bounty_done\",\n Vote: \"vote\",\n FactoryInfoUpdate: \"factory_info_update\",\n ChangePolicyAddOrUpdateRole: \"policy_add_or_update_role\",\n ChangePolicyRemoveRole: \"policy_remove_role\",\n ChangePolicyUpdateDefaultVotePolicy: \"policy_update_default_vote_policy\",\n ChangePolicyUpdateParameters: \"policy_update_parameters\",\n Text: \"Text\",\n FundingRequest: \"FundingRequest\",\n RecurrentFundingRequest: \"RecurrentFundingRequest\",\n DismissAndBan: \"DismissAndBan\"\n};\n\nconst actions = {\n AddProposal: \"AddProposal\",\n VoteApprove: \"VoteApprove\",\n VoteReject: \"VoteReject\",\n VoteRemove: \"VoteRemove\",\n VoteAbstain: \"VoteAbstain\"\n};\n\nconst kindName =\n typeof proposal.kind === \"string\"\n ? proposal.kind\n : isCongressDaoID || isVotingBodyDao\n ? Object.keys(proposal.kind)?.[0]\n : typeof proposal.kind.typeEnum === \"string\"\n ? proposal.kind.typeEnum\n : Object.keys(proposal.kind)[0];\n\nconst isAllowedToVote = isVotingBodyDao\n ? [isHuman, isHuman, isHuman, isHuman]\n : [\n isAllowedTo(proposalKinds[kindName], actions.VoteApprove),\n isAllowedTo(proposalKinds[kindName], actions.VoteReject),\n isCongressDaoID\n ? isAllowedTo(proposalKinds[kindName], actions.VoteAbstain)\n : isAllowedTo(proposalKinds[kindName], actions.VoteRemove)\n ];\n\n astro.sking.near Common.Layout.Header commit_raw.json CreateDAO.Footer commit_raw.json CreateDAO.Step1 commit_raw.json CreateDAO.Step2 commit_raw.json CreateDAO.Step3 commit_raw.json CreateDAO.Step4 commit_raw.json CreateDAO.Step5 commit_raw.json CreateDAO.Step6 commit_raw.json CreateDAO.form commit_raw.json CreateDAO.index commit_raw.json DAO.Bounties commit_raw.json DAO.Followers commit_raw.json DAO.Funds.Balance commit_raw.json DAO.Funds.TransactionLine commit_raw.json DAO.Funds.Transactions commit_raw.json DAO.Layout.Sidebar commit_raw.json DAO.Members.index commit_raw.json DAO.Policy commit_raw.json DAO.Projects commit_raw.json DAO.Proposals.Card.Arguments commit_raw.json DAO.Proposals.Card.MultiVote commit_raw.json DAO.Proposals.Card.Vote commit_raw.json DAO.Proposals.Card.skeleton commit_raw.json DAO.Proposals.FilterModal commit_raw.json DAO.Proposals.MultiVoteSubmit commit_raw.json DAO.Proposals.ProposalsBlockchain commit_raw.json DAO.Proposals.ProposalsPikespeak commit_raw.json DAO.Proposals.index commit_raw.json DAO commit_raw.json DAOs.Card commit_raw.json DAOs.list commit_raw.json index commit_raw.json test commit_raw.json asusar.near Untitled-1 commit_raw.json atopala.near Untitled-0 commit_raw.json auroraafrica.near ProfilePage commit_raw.json aurorabrazilguild.near AddImage commit_raw.json auroraisneartr.near Onboarding.Starter-fork commit_raw.json auroratroy.near Burrito-Virtual-Pet-Mint commit_raw.json austinballard.near ActivityPage commit_raw.json Appa commit_raw.json FeaturedComponents-fork commit_raw.json FeaturedComponents commit_raw.json nyc.dao commit_raw.json autoctopus.near autoctopus commit_raw.json charge commit_raw.json home commit_raw.json introduce commit_raw.json poap commit_raw.json avicado.near ProfilePage commit_raw.json awz.near charge commit_raw.json home commit_raw.json ayelen.near Element.Badge commit_raw.json Element.User commit_raw.json Feedback.Spinner commit_raw.json Input.Button commit_raw.json Input.Checkbox commit_raw.json Input.Select commit_raw.json MarkdownEditorIframe commit_raw.json NDC.AddComment commit_raw.json NDC.AllArticlesSortByAuthors commit_raw.json NDC.ArticleView commit_raw.json NDC.ArticlesByAuthorCard commit_raw.json NDC.CommentView commit_raw.json NDC.Forum.Create commit_raw.json NDC.GeneralCard commit_raw.json NDC.KanbanBoard commit_raw.json NDC.NavBar commit_raw.json NDC.Reactions commit_raw.json NDC.StyledComponents commit_raw.json NDC.UpVoteButton commit_raw.json Profile.OverlayTrigger commit_raw.json Profile.ShortInlineBlock commit_raw.json ProfileImage commit_raw.json SayALot commit_raw.json SayALot_Reactions commit_raw.json SocialMarkdown commit_raw.json TagsEditor commit_raw.json WikiOnSocialDB_TooltipProfiles commit_raw.json fasterTextInput commit_raw.json home commit_raw.json lib.SBT commit_raw.json lib.article commit_raw.json lib.comment commit_raw.json lib.emojis commit_raw.json lib.notifications commit_raw.json lib.upVotes commit_raw.json azbang.near CallbackEditor commit_raw.json Draft-0 commit_raw.json ExportAccount commit_raw.json FeedbackBots commit_raw.json StakeHERE commit_raw.json StakingHERE commit_raw.json dots-spinner commit_raw.json peer2peer commit_raw.json peer2peerMakeOrder commit_raw.json plaid commit_raw.json xmtp-chat commit_raw.json b0539b70923d75b028f9e5cdf23866ab55f310d250fbd20300d269b59108ca4b Proyecto_BOS_NEAR commit_raw.json b2a8daec3435817f71670e1f458b072172b6b8b849a1e3b864aab51a7cbdf331 Danger commit_raw.json b59272555453acfd3b07e16dc7c76d290bdbd75042094d13f24e96697980b9ec Linktree.Main commit_raw.json b5cde248566e85579ef9559e477daab4826c04f1eb123b297541ab6b47c228b1 ETHDam2024_reviews_list commit_raw.json b5e1b528365c393715dbcf234d1113416d19222490f56f516435b43a4b47467d CoinPrice commit_raw.json Linktree commit_raw.json Notepad commit_raw.json b6550059825f83e32cb20aae4c224b3a0fd43bd5b7c493baaafaa44d48a9265a Composition commit_raw.json b6c8e923c6ab16f7668eff9726af8b5f94815bf08af1e030918523f62a14f873 Untitled-0 commit_raw.json b7b8561d310401e446850409af506d3515e58a29a6d4f24e10b8de61a1e6b17f BOSSignatureVerification commit_raw.json Draft-12 commit_raw.json NFTMarketplace commit_raw.json NFTSignatureMarketplace commit_raw.json Onboarding.Starter commit_raw.json Web3ConnectMatamask commit_raw.json b8308b11a3ebba599efff37a42d179fdb1ad3796e8fcf15b704a8915188c712e Draft-0 commit_raw.json Onboarding.Starter commit_raw.json dsfas commit_raw.json b8c69d8568eb8468a3c929087705a2f0571045a1777da8b2665328185aea2127 Greeter commit_raw.json b8d819a51d9e3ee098974e72209133c4d7fc6ff118bc947b15c7408871594ff5 WINLIN commit_raw.json baam25.near BluntFeed commit_raw.json MagicBuild-liberty.mintbase1.near commit_raw.json Onboarding.Starter commit_raw.json PrayerTimes commit_raw.json ProfileCheck commit_raw.json explore commit_raw.json linktree commit_raw.json list commit_raw.json owned.nfts commit_raw.json pagination commit_raw.json store commit_raw.json storeActivities commit_raw.json year.of.the.chef commit_raw.json bab2bfba2612c9db2d5b3ca21ff1fe76a308a8c4d4a9e755a61bd0af7bc5032d Register commit_raw.json bac-inc.near BAC.DAO.main commit_raw.json backpack.near Homepage commit_raw.json ProfileOnboarding commit_raw.json Welcome commit_raw.json badlieben.near WeAreDevsStatusBoard commit_raw.json balaianu.near CoretoDRSRSSgetAccountScores commit_raw.json CoretoDRS_DEMO commit_raw.json CoretoDRS_RSS_getAccountScores commit_raw.json PriceStats commit_raw.json TEST-1 commit_raw.json Untitled-0 commit_raw.json banequantox.near Untitled-1 commit_raw.json banyanq2.near ComponentMetadata commit_raw.json DevTracker commit_raw.json dashboard commit_raw.json banyanq3.near AccountProfileCard commit_raw.json OKRTracker.main commit_raw.json Tracker.QualityRank commit_raw.json baotoan09061998.near Untitled-0 commit_raw.json barbj.near Untitled-0 commit_raw.json bashorun.near MagicBuild-widget-form-1697719303416 commit_raw.json MagicBuild-widget-form-1697721548566 commit_raw.json MagicBuild-widget-form-1697759916271 commit_raw.json bastion-pysr.near test commit_raw.json bastioncommunity.near Bastion commit_raw.json bb1c5166fc7b8cbcc22d487126abec08080ad03a9e6e0bdbfe4a400a82e602bd zksync commit_raw.json bb5257df8451d24580305de53c2269985b86fc017eb7fd5a8ae7bc92854ccd2e HelloWorld commit_raw.json bb554539caf3750e73aa0da5b720e3663692b3b92b4c3f5a77b413e9cd509d46 ForkThis commit_raw.json bd5a965873f6046fb0f020ec0a1fa86ca7842ba49a2fcac03316dcc7d76cd8f9 SweatcoinClaimer commit_raw.json Untitled-0 commit_raw.json be65c0abfeaa835ef53a5575b848eb2e7373e4ebad9c2721966c303cb25d93be Distribution commit_raw.json GreeterYourName commit_raw.json TONStaking commit_raw.json beachsunandrockandroll.near ProdigyPianoDiary commit_raw.json accordion commit_raw.json accordionIframe commit_raw.json addComposer commit_raw.json addRecord commit_raw.json addSheet commit_raw.json alert commit_raw.json alertDialog commit_raw.json alertIframe commit_raw.json aspectRatio commit_raw.json avatar commit_raw.json badge commit_raw.json badgeIframe commit_raw.json button commit_raw.json buttonIframe commit_raw.json buttonv2 commit_raw.json card commit_raw.json checkbox commit_raw.json cnIframe commit_raw.json collapsible commit_raw.json composerList commit_raw.json contextMenu commit_raw.json dialog commit_raw.json dropdownMenu commit_raw.json header commit_raw.json hoverCard commit_raw.json input commit_raw.json label commit_raw.json menubar commit_raw.json myAlertDialog commit_raw.json myAvatar commit_raw.json myCard commit_raw.json navigationMenu commit_raw.json popoverContent commit_raw.json preflight commit_raw.json registerUser commit_raw.json select commit_raw.json sheet commit_raw.json sheetIframe commit_raw.json toast commit_raw.json toastIframe commit_raw.json toggle commit_raw.json toggleGroup commit_raw.json toggleIframe commit_raw.json toogle commit_raw.json toogleIframe commit_raw.json useToast commit_raw.json userSheets commit_raw.json utils commit_raw.json beanlabs-dev.near Chart commit_raw.json beerlp101.near Onboarding.Starter-fork commit_raw.json benipsen.near nft-selector commit_raw.json benreilly.near CreatePostForm commit_raw.json DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json Ideas commit_raw.json Post commit_raw.json gigs-board.components.boards.KanbanBoard commit_raw.json gigs-board.components.community.FeaturedCommunity commit_raw.json gigs-board.components.layout.Banner commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.layout.SearchByAuthor commit_raw.json gigs-board.components.layout.SearchByLabel commit_raw.json gigs-board.components.posts.List commit_raw.json gigs-board.components.posts.Post commit_raw.json gigs-board.components.posts.Search commit_raw.json gigs-board.components.teams.LabelsPermissions commit_raw.json gigs-board.components.teams.TeamInfo commit_raw.json gigs-board.pages.Boards commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.community.Events commit_raw.json gigs-board.pages.community.Sponsorship commit_raw.json benzdc.near ImwithCreativesConstellation commit_raw.json Untitled-0 commit_raw.json betteryou.near all_user_challenges commit_raw.json friendslist commit_raw.json language_challenge commit_raw.json language_signup commit_raw.json plaque_v2 commit_raw.json wakeup_challenge commit_raw.json wakeup_signup commit_raw.json welcome_page commit_raw.json bewd.near WeAreDevsStatusBoard commit_raw.json bfea4f62beafe99116228a106698b9fd5b8c9464b063f1ba214d41c25f88b4ff NFT.Minter.main commit_raw.json bhatidon.near review_box commit_raw.json bikashbahl.near AddMemberToRole commit_raw.json billblystone.near everything commit_raw.json binarybandit.near Image commit_raw.json Onboarding.Starter commit_raw.json Untitled-0 commit_raw.json binbash.near ExpensesTracker commit_raw.json Gut commit_raw.json New-Draft-0 commit_raw.json Nxt commit_raw.json bioice.near BitkubxBOS commit_raw.json Draft-0 commit_raw.json biolmoon.near LRFV2020 commit_raw.json home commit_raw.json birchmd.near Pyth-on-Near commit_raw.json tic-tac-toe commit_raw.json bitnando.near User-Message commit_raw.json bitspresso.near ExtensionSource commit_raw.json PrivyFi-Extension commit_raw.json bitware.near Mintmeacoffee.MintCoffeeModal commit_raw.json MintmeacoffeeButton commit_raw.json bitzua.near Everything.Create.Document commit_raw.json Everything.Summary.Document commit_raw.json Everything.View.Document commit_raw.json Everything commit_raw.json ForkThis commit_raw.json bjirken.near Greeter commit_raw.json blackdragonis.near Linktree commit_raw.json blastpast.near token-price commit_raw.json blaze.near AddBlogEntry commit_raw.json BlogEntry commit_raw.json BlogFeed commit_raw.json CheddarDrawBoard commit_raw.json CheddarMaze commit_raw.json CheddarMazeReact commit_raw.json CheddarMazeReactV1 commit_raw.json Follow commit_raw.json Homepage commit_raw.json PokeButton commit_raw.json ProfileOnboarding commit_raw.json QuickSocial commit_raw.json Welcome commit_raw.json answer_poll commit_raw.json showAllQuestions commit_raw.json blessed07.near post-content commit_raw.json blisspointsound.near everything commit_raw.json blockchain-success.near success_email commit_raw.json blocxerz1.near SUINETWORK commit_raw.json bluebiu.near 0vix.Lending commit_raw.json 0vix.LendingArrowIcon commit_raw.json 0vix.LendingBalance commit_raw.json 0vix.LendingBorrowMarketsTable commit_raw.json 0vix.LendingBorrowingTable commit_raw.json 0vix.LendingCheckedIcon commit_raw.json 0vix.LendingCollateralButton commit_raw.json 0vix.LendingConntect commit_raw.json 0vix.LendingDashPanel commit_raw.json 0vix.LendingData commit_raw.json 0vix.LendingDialog commit_raw.json 0vix.LendingDialogButton commit_raw.json 0vix.LendingInfoIcon commit_raw.json 0vix.LendingLoadingIcon commit_raw.json 0vix.LendingMessage commit_raw.json 0vix.LendingProgress commit_raw.json 0vix.LendingQuest commit_raw.json 0vix.LendingSpinner commit_raw.json 0vix.LendingSupplyMarketsTable commit_raw.json 0vix.LendingSupplyingTable commit_raw.json 0vix.LendingSwitcher commit_raw.json 0vix.LendingTable commit_raw.json 0vix.LendingTableButton commit_raw.json 0vix.LendingTotal commit_raw.json 0vix.LendingWarningIcon commit_raw.json AAVE-ETH commit_raw.json AAVE-V3 commit_raw.json AAVE.Card.AssetsToBorrow commit_raw.json AAVE.Card.AssetsToSupply commit_raw.json AAVE.Card.CardContainer commit_raw.json AAVE.Card.CardDataWrapper commit_raw.json AAVE.Card.CardEmpty commit_raw.json AAVE.Card.CardsBody commit_raw.json AAVE.Card.CardsTable commit_raw.json AAVE.Card.CardsView commit_raw.json AAVE.Card.Divider commit_raw.json AAVE.Card.Markets commit_raw.json AAVE.Card.PointsTable commit_raw.json AAVE.Card.RewardsTable commit_raw.json AAVE.Card.TokenWrapper commit_raw.json AAVE.Card.YourBorrows commit_raw.json AAVE.Card.YourSupplies commit_raw.json AAVE.Data.Seamless commit_raw.json AAVE.Data.Zerolend commit_raw.json AAVE.Data commit_raw.json AAVE.GasEstimation commit_raw.json AAVE.Header commit_raw.json AAVE.HeroData commit_raw.json AAVE.Modal.AlertModal commit_raw.json AAVE.Modal.BaseModal commit_raw.json AAVE.Modal.BorrowModal commit_raw.json AAVE.Modal.CollateralModal commit_raw.json AAVE.Modal.FlexBetween commit_raw.json AAVE.Modal.LoopModal commit_raw.json AAVE.Modal.ReloadModal commit_raw.json AAVE.Modal.RepayModal commit_raw.json AAVE.Modal.RoundedCard commit_raw.json AAVE.Modal.SupplyModal commit_raw.json AAVE.Modal.WithdrawModal commit_raw.json AAVE.NetworkSwitcher commit_raw.json AAVE.PrimaryButton commit_raw.json AAVE.TabSwitcher commit_raw.json All-in-one commit_raw.json AllChains.AllChainsPage commit_raw.json AllChains.AllChainsPageCard commit_raw.json Arbitrum.All-in-one commit_raw.json Arbitrum.Bridge commit_raw.json Arbitrum.DappCard commit_raw.json Arbitrum.Dapps commit_raw.json Arbitrum.Lending.CreamData commit_raw.json Arbitrum.Lending.GranaryData commit_raw.json Arbitrum.Lending.RadiantActionHandler commit_raw.json Arbitrum.Lending.RadiantClaimHandler commit_raw.json Arbitrum.Lending.RadiantData commit_raw.json Arbitrum.Lending.RadiantHandlerCollateral commit_raw.json Arbitrum.Lending commit_raw.json Arbitrum.Pendle.ArrowIcon commit_raw.json Arbitrum.Pendle.DashBoard.BoardPoolAction commit_raw.json Arbitrum.Pendle.DashBoard.BoardPoolAmount commit_raw.json Arbitrum.Pendle.DashBoard.BoardPyAction commit_raw.json Arbitrum.Pendle.DashBoard.BoardPyAmount commit_raw.json Arbitrum.Pendle.DashBoard.BoardSyAction commit_raw.json Arbitrum.Pendle.DashBoard.BoardSyAmount commit_raw.json Arbitrum.Pendle.DashBoard.PositionRow commit_raw.json Arbitrum.Pendle.DashBoard.UserDashBoard commit_raw.json Arbitrum.Pendle.DashBoard.claim-all commit_raw.json Arbitrum.Pendle.FormatExpiryDate commit_raw.json Arbitrum.Pendle.FormatExpiryDistanceDays commit_raw.json Arbitrum.Pendle.Message commit_raw.json Arbitrum.Pendle.TradeMarkets commit_raw.json Arbitrum.Pendle.TradeMintAction commit_raw.json Arbitrum.Pendle.TradeMintOutPut commit_raw.json Arbitrum.Pendle.TradeRedeemAction commit_raw.json Arbitrum.Pendle.TradeRedeemOutput commit_raw.json Arbitrum.Pendle.TradeSwap commit_raw.json Arbitrum.Pendle.TradeSwapAction commit_raw.json Arbitrum.Pendle.TradeSwapAmountOut commit_raw.json Arbitrum.Pendle.TradeSwapButton commit_raw.json Arbitrum.Pendle.TradeSwapCurrencyInput commit_raw.json Arbitrum.Pendle.TradeSwapResult commit_raw.json Arbitrum.Pendle.TradeSwapSwitcher commit_raw.json Arbitrum.Pendle.TradeSwapTabs commit_raw.json Arbitrum.Pendle.TradeSyIcon commit_raw.json Arbitrum.Pendle.getMarkets commit_raw.json Arbitrum.Swap.AmountOutV2 commit_raw.json Arbitrum.Swap.ApeAmountOut commit_raw.json Arbitrum.Swap.ArrowIcon commit_raw.json Arbitrum.Swap.CamelotAmountOut commit_raw.json Arbitrum.Swap.ChronosV1AmountOut commit_raw.json Arbitrum.Swap.CloseIcon commit_raw.json Arbitrum.Swap.ConnectButton commit_raw.json Arbitrum.Swap.CurrencyBalance commit_raw.json Arbitrum.Swap.CurrencyInput commit_raw.json Arbitrum.Swap.CurrencyRow commit_raw.json Arbitrum.Swap.CurrencySelect commit_raw.json Arbitrum.Swap.DappCard commit_raw.json Arbitrum.Swap.Dapps commit_raw.json Arbitrum.Swap.Dex commit_raw.json Arbitrum.Swap.ExchangeIcon commit_raw.json Arbitrum.Swap.HandlerV2 commit_raw.json Arbitrum.Swap.HandlerV3 commit_raw.json Arbitrum.Swap.QuoterSolidly commit_raw.json Arbitrum.Swap.QuoterV3 commit_raw.json Arbitrum.Swap.RamsesV2AmountOut commit_raw.json Arbitrum.Swap.SwapButton commit_raw.json Arbitrum.Swap.SwapConnector commit_raw.json Arbitrum.Swap.SwapV2 commit_raw.json Arbitrum.Swap.handlerSolidly commit_raw.json Avalanche.All-in-one commit_raw.json Avalanche.Bridge commit_raw.json Avalanche.Dapps commit_raw.json Avalanche.Lending.Asset commit_raw.json Avalanche.Lending.BenqiClaimHandler commit_raw.json Avalanche.Lending.BenqiData commit_raw.json Avalanche.Lending.BenqiHandlerCToken commit_raw.json Avalanche.Lending.BenqiHandlerCollateral commit_raw.json Avalanche.Lending.BorrowTable commit_raw.json Avalanche.Lending.Collection commit_raw.json Avalanche.Lending.Dapps commit_raw.json Avalanche.Lending.Data commit_raw.json Avalanche.Lending.DepositTable commit_raw.json Avalanche.Lending.Dialog commit_raw.json Avalanche.Lending.DialogButton commit_raw.json Avalanche.Lending.GranaryData commit_raw.json Avalanche.Lending.IronBankData commit_raw.json Avalanche.Lending.IronBankHandlerCToken commit_raw.json Avalanche.Lending.Market commit_raw.json Avalanche.Lending.Process commit_raw.json Avalanche.Lending.RewardsTable commit_raw.json Avalanche.Lending.Switch commit_raw.json Avalanche.Lending.TableButton commit_raw.json Avalanche.Lending.Tabs commit_raw.json Avalanche.Lending.Total commit_raw.json Avalanche.Lending.Yours commit_raw.json Avalanche.Lending.YoursTable commit_raw.json Avalanche.Lending commit_raw.json Avalanche.Swap.JoeTraderAmountOut commit_raw.json Avalanche.Swap.PangolinAmountOut commit_raw.json Avalanche.Swap commit_raw.json Base.All-in-one commit_raw.json Base.BaseArrowIcon commit_raw.json Base.BaseCloseIcon commit_raw.json Base.BaseConfigAbi commit_raw.json Base.BaseConnect commit_raw.json Base.BaseCurrencyBalance commit_raw.json Base.BaseCurrencyInput commit_raw.json Base.BaseCurrencyPrice commit_raw.json Base.BaseCurrencyRow commit_raw.json Base.BaseCurrencySelect commit_raw.json Base.BaseDappCard commit_raw.json Base.BaseDapps commit_raw.json Base.BaseDex commit_raw.json Base.BaseExchangeIcon commit_raw.json Base.BaseQuoterV3 commit_raw.json Base.BaseSwap commit_raw.json Base.BaseSwapButton commit_raw.json Base.BaseSwapV2 commit_raw.json Base.Bridge.AmountOut commit_raw.json Base.Bridge.Button commit_raw.json Base.Bridge.CheckedIcon commit_raw.json Base.Bridge.FormateTxDate commit_raw.json Base.Bridge.HandlerSwap commit_raw.json Base.Bridge.Index commit_raw.json Base.Bridge.Input commit_raw.json Base.Bridge.NetwrokDialog commit_raw.json Base.Bridge.Swap commit_raw.json Base.Bridge.SwapRightIcon commit_raw.json Base.Bridge.TokenList commit_raw.json Base.Bridge.TokenRow commit_raw.json Base.Bridge.Transaction commit_raw.json Base.Bridge.TransactionButton commit_raw.json Base.Bridge.Transactions commit_raw.json Base.Bridge.Value commit_raw.json Base.Bridge commit_raw.json Base.HandlerV3 commit_raw.json Base.Lending.GranaryData commit_raw.json Base.Lending.MoonwellData commit_raw.json Base.Lending.MoonwellHandlerClaim commit_raw.json Base.Lending.SonneData commit_raw.json Base.Lending commit_raw.json Base.RocketSwap commit_raw.json Base.Swap.HorizonDexAmountOut commit_raw.json Base.SwapBased commit_raw.json Base.Synthswap commit_raw.json Blast.BridgeAuthority.AmountOut commit_raw.json Blast.BridgeAuthority.HandlerClaim commit_raw.json Blast.BridgeAuthority.HandlerSwap commit_raw.json Blast.BridgeAuthority.Index commit_raw.json Blast.BridgeAuthority.Util commit_raw.json Blast.BridgeXY.AmountOut commit_raw.json Blast.BridgeXY.HandlerSwap commit_raw.json Blast.BridgeXY.Index commit_raw.json Blast.Swap commit_raw.json Bsc.All-in-one commit_raw.json Bsc.Bridge commit_raw.json Bsc.Dapps commit_raw.json Bsc.Lending.CreamData commit_raw.json Bsc.Lending.GranaryData commit_raw.json Bsc.Lending.RadiantData commit_raw.json Bsc.Lending.VenusData commit_raw.json Bsc.Lending commit_raw.json Bsc.Swap.Dex commit_raw.json Gnosis.All-in-one commit_raw.json Gnosis.Dapps commit_raw.json Gnosis.Lending.AgaveData commit_raw.json Gnosis.Lending commit_raw.json Gnosis.Swap.Dex commit_raw.json Lending.CardTabs commit_raw.json Lending.Chains commit_raw.json Lending.Cog.AdjustButton commit_raw.json Lending.Cog.Content commit_raw.json Lending.Cog.Earn commit_raw.json Lending.Cog.MarketButton commit_raw.json Lending.Cog.MarketCol commit_raw.json Lending.Cog.MarketExpand commit_raw.json Lending.Cog.MarketInput commit_raw.json Lending.Cog.MarketRow commit_raw.json Lending.Cog.Markets commit_raw.json Lending.Cog.PoolButton commit_raw.json Lending.Cog.PoolExpand commit_raw.json Lending.Cog.Pools commit_raw.json Lending.Cog.Yours commit_raw.json Lending.Cog commit_raw.json Lending.CompoundV3.Bridge.Asset commit_raw.json Lending.CompoundV3.Bridge.Button commit_raw.json Lending.CompoundV3.Bridge.Detail commit_raw.json Lending.CompoundV3.Bridge.Dialog commit_raw.json Lending.CompoundV3.Bridge.List commit_raw.json Lending.CompoundV3.Bridge.Range commit_raw.json Lending.CompoundV3.Bridge.TableHeader commit_raw.json Lending.CompoundV3.Bridge.TableRow commit_raw.json Lending.CompoundV3.Bridge.UsdPrice commit_raw.json Lending.CompoundV3.Bridge.Utilization commit_raw.json Lending.CompoundV3.CheckAllowance commit_raw.json Lending.CompoundV3.index commit_raw.json Lending.Content commit_raw.json Lending.Data.Benqi commit_raw.json Lending.Data.Cog commit_raw.json Lending.Data.CompoundV3 commit_raw.json Lending.Data.Cream commit_raw.json Lending.Data.Filda commit_raw.json Lending.Data.IronBank commit_raw.json Lending.Data.LayerBank commit_raw.json Lending.Data.Lendle commit_raw.json Lending.Data.Liqee commit_raw.json Lending.Data.Liquity commit_raw.json Lending.Data.LodestarV1 commit_raw.json Lending.Data.MendiFinance commit_raw.json Lending.Data.Moonwell commit_raw.json Lending.Data.Orbit commit_raw.json Lending.Data.Pac commit_raw.json Lending.Data.Radiant commit_raw.json Lending.Data.Reactorfusion commit_raw.json Lending.Data.ShoeBillV2 commit_raw.json Lending.Data.Sonne commit_raw.json Lending.Data.TenderFinance commit_raw.json Lending.Data.TraderJoe commit_raw.json Lending.Data.Valas commit_raw.json Lending.Data.Venus commit_raw.json Lending.Data.WePiggy commit_raw.json Lending.Dex commit_raw.json Lending.Handler.CompoundV3 commit_raw.json Lending.Handler.Cream commit_raw.json Lending.Handler.LayerBank commit_raw.json Lending.Handler.Liquity commit_raw.json Lending.Handler.Orbit commit_raw.json Lending.Handler.Radiant commit_raw.json Lending.Handler.ShoeBillV2 commit_raw.json Lending.Liquity.AdjustButton commit_raw.json Lending.Liquity.Content commit_raw.json Lending.Liquity.Index commit_raw.json Lending.Liquity.MarketButton commit_raw.json Lending.Liquity.MarketCol commit_raw.json Lending.Liquity.MarketExpand commit_raw.json Lending.Liquity.MarketInput commit_raw.json Lending.Liquity.MarketRow commit_raw.json Lending.Liquity.Markets commit_raw.json Lending.Liquity.PoolButton commit_raw.json Lending.Liquity.PoolExpand commit_raw.json Lending.Liquity.Pools commit_raw.json Lending.Liquity.Yours commit_raw.json Lending.LiquityAdjustButton commit_raw.json Lending.LiquityButton commit_raw.json Lending.LiquityContent commit_raw.json Lending.LiquityMarketButton commit_raw.json Lending.LiquityMarketCol commit_raw.json Lending.LiquityMarketExpand commit_raw.json Lending.LiquityMarketInput commit_raw.json Lending.LiquityMarketRow commit_raw.json Lending.LiquityMarkets commit_raw.json Lending.LiquityPoolButton commit_raw.json Lending.LiquityPoolExpand commit_raw.json Lending.LiquityPools commit_raw.json Lending.LiquityYours commit_raw.json Lending.MarketAmount commit_raw.json Lending.MarketApy commit_raw.json Lending.MarketAsset commit_raw.json Lending.MarketExpand commit_raw.json Lending.MarketHeader commit_raw.json Lending.MarketInput commit_raw.json Lending.MarketRow commit_raw.json Lending.Markets commit_raw.json Lending.Orbit.Content commit_raw.json Lending.Orbit.Data commit_raw.json Lending.Orbit.Dialog commit_raw.json Lending.Orbit.Handler commit_raw.json Lending.Orbit.Index commit_raw.json Lending.Orbit.MarketExpand commit_raw.json Lending.Orbit.MarketInput commit_raw.json Lending.Orbit.MarketRow commit_raw.json Lending.Orbit.Markets commit_raw.json Lending.Orbit.RewardClaim commit_raw.json Lending.Orbit.RewardsTable commit_raw.json Lending.Orbit.Yours commit_raw.json Lending.Pac.Markets commit_raw.json Lending.Pac commit_raw.json Lending.RewardClaim.Orbit commit_raw.json Lending.RewardClaim.TraderJoe commit_raw.json Lending.RewardClaim.Valas commit_raw.json Lending.RewardClaim.Venus commit_raw.json Lending.RewardClaim.WePiggy commit_raw.json Lending.RewardClaim.Zerolend commit_raw.json Lending.Spinner commit_raw.json Linea.All-in-one commit_raw.json Linea.Bridge commit_raw.json Linea.Dapps commit_raw.json Linea.Lending.LayerBankData commit_raw.json Linea.Lending.LayerBankHandlerCToken commit_raw.json Linea.Lending.LayerBankHandlerClaim commit_raw.json Linea.Lending.MendiData commit_raw.json Linea.Lending.MendiHandlerClaim commit_raw.json Linea.Lending commit_raw.json Linea.Liquidity.GAMMA.GAMMA commit_raw.json Linea.Liquidity.GAMMA.GAMMAConnector commit_raw.json Linea.Liquidity.GAMMA.gamma-table commit_raw.json Linea.Liquidity.GAMMA.gamma-vault commit_raw.json Linea.Liquidity.GAMMA commit_raw.json Linea.Swap.Dex commit_raw.json Linea.Swap.HandlerV3 commit_raw.json Linea.Swap.IziSwapAmountOut commit_raw.json Linea.Swap.QuoterSyncswap commit_raw.json Linea.Swap.QuoterV3 commit_raw.json Linea.Swap.SyncSwapAmountOut commit_raw.json Linea.Swap.handleSyncswap commit_raw.json Liquidity.ALL commit_raw.json Liquidity.ARRAKIS commit_raw.json Liquidity.ARRAKISFINANCE commit_raw.json Liquidity.BLASTOFF commit_raw.json Liquidity.Bridge.ARRAKIS.Detail commit_raw.json Liquidity.Bridge.ARRAKIS.List commit_raw.json Liquidity.Bridge.Detail commit_raw.json Liquidity.Bridge.Filter commit_raw.json Liquidity.Bridge.JUICE.Borrowers commit_raw.json Liquidity.Bridge.JUICE.Dialog commit_raw.json Liquidity.Bridge.JUICE.Positions commit_raw.json Liquidity.Bridge.JUICE.VaultDetail commit_raw.json Liquidity.Bridge.JUICE.Vaults commit_raw.json Liquidity.Bridge.List commit_raw.json Liquidity.Bridge.Loading commit_raw.json Liquidity.Bridge.Logo commit_raw.json Liquidity.Bridge.METAVAULT.Detail commit_raw.json Liquidity.Bridge.METAVAULT.List commit_raw.json Liquidity.Bridge.RANGEPROTOCOL.Detail commit_raw.json Liquidity.Bridge.RANGEPROTOCOL.List commit_raw.json Liquidity.Bridge.STEAKHUT.Detail commit_raw.json Liquidity.Bridge.STEAKHUT.List commit_raw.json Liquidity.Bridge.STEER.Detail commit_raw.json Liquidity.Bridge.STEER.List commit_raw.json Liquidity.Connector.ARRAKIS commit_raw.json Liquidity.Connector.BLASTOFF commit_raw.json Liquidity.Connector.GAMMA commit_raw.json Liquidity.Connector.JUICE commit_raw.json Liquidity.Connector.METAVAULT commit_raw.json Liquidity.Connector.RANGEPROTOCOL commit_raw.json Liquidity.Connector.STEAKHUT commit_raw.json Liquidity.Connector.STEER commit_raw.json Liquidity.Data.ARRAKIS commit_raw.json Liquidity.Data.ArrakisFinance commit_raw.json Liquidity.Data.Gamma commit_raw.json Liquidity.Data.JUICE commit_raw.json Liquidity.Data.METAVAULT commit_raw.json Liquidity.Data.RANGEPROTOCOL commit_raw.json Liquidity.Data.STEER commit_raw.json Liquidity.Data.Steakhut commit_raw.json Liquidity.GAMMA commit_raw.json Liquidity.Gamma.DialogButton commit_raw.json Liquidity.Handler.Styles commit_raw.json Liquidity.JUICE commit_raw.json Liquidity.METAVAULT commit_raw.json Liquidity.RANGEPROTOCOL commit_raw.json Liquidity.STEAKHUT commit_raw.json Liquidity.STEER commit_raw.json Liquidity.STEERPROTOCOL commit_raw.json Manta.Lending commit_raw.json Manta.Swap commit_raw.json Mantle.All-in-one commit_raw.json Mantle.CheckApprove commit_raw.json Mantle.GAMMA.gamma-mantle-table commit_raw.json Mantle.GAMMA.gamma-mantle-vault commit_raw.json Mantle.GAMMA commit_raw.json Mantle.Lending.LendleClaimHandler commit_raw.json Mantle.Lending.LendleData commit_raw.json Mantle.Lending commit_raw.json Mantle.MantleTemplate commit_raw.json Mantle.MantleTemplateCard commit_raw.json Mantle.Quoter commit_raw.json Mantle.Swap.AgniFinanceAmountOut commit_raw.json Mantle.Swap.Dex commit_raw.json Mantle.Swap commit_raw.json Mantle.SwapCaller commit_raw.json Mantle.TokenInput commit_raw.json Mantle.TokenItem commit_raw.json Mantle.TokenList commit_raw.json Mantle.getBalance commit_raw.json MetaPool.Alert commit_raw.json MetaPool.ConnectButton commit_raw.json MetaPool.Header commit_raw.json MetaPool.Stake commit_raw.json MetaPool.StakeEth commit_raw.json MetaPool.StakeEthButton commit_raw.json MetaPool.StakeEthDetails commit_raw.json MetaPool.StakeInput commit_raw.json MetaPool.StakeNear commit_raw.json MetaPool.StakeNearAccountInfo commit_raw.json MetaPool.StakeNearButton commit_raw.json MetaPool.StakeResult commit_raw.json MetaPool.Switcher commit_raw.json Metis.All-in-one commit_raw.json Metis.Bridge commit_raw.json Metis.Dapps commit_raw.json Metis.Swap.Dex commit_raw.json Metis.Swap.HandlerV2 commit_raw.json Metis.Swap.HandlerV3 commit_raw.json Metis.Swap.HummusExchangeAmountOut commit_raw.json Metis.Swap.NetSwapAmountOut commit_raw.json Metis.Swap.QuoterV3 commit_raw.json Optimism.All-in-one commit_raw.json Optimism.Bridge commit_raw.json Optimism.Dapps commit_raw.json Optimism.Dex commit_raw.json Optimism.Lending.GranaryClaimHandler commit_raw.json Optimism.Lending.GranaryData commit_raw.json Optimism.Lending.IronBankData commit_raw.json Optimism.Lending.SonneData commit_raw.json Optimism.Lending commit_raw.json Polygon.All-in-one commit_raw.json Polygon.Bridge commit_raw.json Polygon.Dapps commit_raw.json Polygon.Lending.0vixData commit_raw.json Polygon.Lending.CreamData commit_raw.json Polygon.Lending commit_raw.json Polygon.Swap.Dex commit_raw.json Polygon.Swap.QuoterV3 commit_raw.json PolygonZkevm.Swap.BalancerAmountOut commit_raw.json PolygonZkevm.Swap.Dex commit_raw.json PolygonZkevm.Swap.PancakeSwapAmountOut commit_raw.json PolygonZkevm.Swap.QuickSwapAmountOut commit_raw.json RainbowBridge.Bridge commit_raw.json RainbowBridge.Connect commit_raw.json RainbowBridge.HistoryTransfers commit_raw.json RainbowBridge.PendingTransfers commit_raw.json RainbowBridge.TokenItem commit_raw.json RainbowBridge.TransferItem commit_raw.json RainbowBridge.checkApprove commit_raw.json RainbowBridge.finalize commit_raw.json RainbowBridge.getBalanceOnToken commit_raw.json RainbowBridge.transfer commit_raw.json Scroll.Bridge.AmountOut commit_raw.json Scroll.Bridge.HandlerSwap commit_raw.json Scroll.Bridge.Index commit_raw.json Scroll.BridgeAuthority.AmountOut commit_raw.json Scroll.BridgeAuthority.HandlerClaim commit_raw.json Scroll.BridgeAuthority.HandlerSwap commit_raw.json Scroll.BridgeAuthority.Index commit_raw.json Scroll.BridgeStargate.AmountOut commit_raw.json Scroll.BridgeStargate.HandlerSwap commit_raw.json Scroll.BridgeStargate.Index commit_raw.json Scroll.BridgeXY.AmountOut commit_raw.json Scroll.BridgeXY.HandlerSwap commit_raw.json Scroll.BridgeXY.Index commit_raw.json Scroll.Lending commit_raw.json Scroll.Swap commit_raw.json Stake.Bridge.PENPAD.Dialog commit_raw.json Stake.Connector.PENPAD commit_raw.json Stake.PENPAD commit_raw.json Swap.ChainListDropDown commit_raw.json Swap.ChainWarnigBox commit_raw.json Swap.CloseIcon commit_raw.json Swap.Content commit_raw.json Swap.CurrencyInput commit_raw.json Swap.CurrencyRow commit_raw.json Swap.CurrencySelect commit_raw.json Swap.Data.AerodromeAmountOut commit_raw.json Swap.Data.AmbientAmountOut commit_raw.json Swap.Data.AmountOut commit_raw.json Swap.Data.ApertureSwapAmountOut commit_raw.json Swap.Data.DodoAmountOut commit_raw.json Swap.Data.ElkAmountOut commit_raw.json Swap.Data.HermesAmountOut commit_raw.json Swap.Data.Lynex commit_raw.json Swap.Data.MaiaV3 commit_raw.json Swap.Data.MerchantMoeAmountOut commit_raw.json Swap.Data.Mimswap commit_raw.json Swap.Data.MomoswapV2 commit_raw.json Swap.Data.MomoswapV3 commit_raw.json Swap.Data.Mute commit_raw.json Swap.Data.RingProtocol commit_raw.json Swap.Data.SolidLizardAmountOut commit_raw.json Swap.Data.ThrusterFinance commit_raw.json Swap.Data.UniswapV3 commit_raw.json Swap.Data.VelocoreV2AmountOut commit_raw.json Swap.Data.VelodromeV2AmountOut commit_raw.json Swap.Data.XYFinance commit_raw.json Swap.Data.Xfai commit_raw.json Swap.Dex commit_raw.json Swap.ExchangeIcon commit_raw.json Swap.Result commit_raw.json Swap.Routes commit_raw.json Swap.SlippageSetting commit_raw.json Utils.Date commit_raw.json Utils.FormatAmount commit_raw.json Utils.FormatNumber commit_raw.json Utils.Import commit_raw.json Utils.Number commit_raw.json Utils.Slider commit_raw.json ZKEVM-all-in-one commit_raw.json ZKEVM.AAVE.Card.AssetsToBorrow commit_raw.json ZKEVM.AAVE.Card.AssetsToSupply commit_raw.json ZKEVM.AAVE.Card.CardEmpty commit_raw.json ZKEVM.AAVE.Card.CardsTable commit_raw.json ZKEVM.AAVE.Card.CardsView commit_raw.json ZKEVM.AAVE.Card.TokenWrapper commit_raw.json ZKEVM.AAVE.Card.YourBorrows commit_raw.json ZKEVM.AAVE.Card.YourSupplies commit_raw.json ZKEVM.AAVE.HeroData commit_raw.json ZKEVM.AAVE.Loader commit_raw.json ZKEVM.AAVE.Modal.BaseModal commit_raw.json ZKEVM.AAVE.Modal.BorrowModal commit_raw.json ZKEVM.AAVE.Modal.RepayModal commit_raw.json ZKEVM.AAVE.Modal.RoundedCard commit_raw.json ZKEVM.AAVE.Modal.SupplyModal commit_raw.json ZKEVM.AAVE.Modal.WithdrawModal commit_raw.json ZKEVM.AAVE.ModalPrimaryButton commit_raw.json ZKEVM.AAVE.NetworkSwitcher commit_raw.json ZKEVM.AAVE.PrimaryButton commit_raw.json ZKEVM.AAVE.TabSwitcher commit_raw.json ZKEVM.AAVE commit_raw.json ZKEVM.ExecuteRecords commit_raw.json ZKEVM.GAMMA commit_raw.json ZKEVM.QuestionList commit_raw.json ZKEVM.Template commit_raw.json ZKEVM.gamma-zkevm-table commit_raw.json ZKEVM.gamma-zkevm-vault commit_raw.json ZKEVM.switch_quest_card commit_raw.json ZKEVMSwap.zkevm-bridge commit_raw.json ZKEVMSwap.zkevm-swap commit_raw.json op-stack-bridge commit_raw.json zkSync.All-in-one commit_raw.json zkSync.Bridge.AmountOut commit_raw.json zkSync.Bridge.HandlerSwap commit_raw.json zkSync.Bridge.Index commit_raw.json zkSync.Dapps commit_raw.json zkSync.Lending.ReactorfusionData commit_raw.json zkSync.Lending commit_raw.json zkSync.Swap.Dex commit_raw.json blueprints.near Components.Button commit_raw.json Components.Comment.Compose commit_raw.json Components.Comment.Feed commit_raw.json Components.Comment commit_raw.json Components.Common.Compose commit_raw.json Components.EditModal commit_raw.json Components.Hashtag commit_raw.json Components.OverlayFaces commit_raw.json Components.Pixel.Button commit_raw.json Components.Pixel.Hashtag commit_raw.json Components.Pixel.LinkTree commit_raw.json Components.Pixel.Tab.Widgets commit_raw.json Components.Pixel.Tabs commit_raw.json Components.Pixel commit_raw.json Components.Post.Header commit_raw.json Components.Post commit_raw.json Components.Profile.FollowStats commit_raw.json Components.Profile.LinkTree commit_raw.json Components.Profile.Tab.NFTs commit_raw.json Components.Profile.Tab.Photos commit_raw.json Components.Profile.Tab.Posts commit_raw.json Components.Profile.Tab.Videos commit_raw.json Components.Profile.Tab.Widgets commit_raw.json Components.Profile.Tabs commit_raw.json Components.WidgetMetadata commit_raw.json Components commit_raw.json Icons commit_raw.json Profile.Modern.Root commit_raw.json Profile.Modern commit_raw.json Profile.Pixel.Root commit_raw.json Profile.Pixel commit_raw.json Profile commit_raw.json StarredApplications commit_raw.json UserFeed commit_raw.json sdk.social commit_raw.json blueventurecommunity.near ProfilePage commit_raw.json bluntdao.near AddEveryoneScript commit_raw.json BluntDAO.Button.Join commit_raw.json BluntDAO.Holders.OGValidators commit_raw.json BluntDAO.addAllOGs commit_raw.json BluntDAO.member commit_raw.json BluntDAOsNFT commit_raw.json BluntFeed commit_raw.json DAO.Dashboard commit_raw.json Donate commit_raw.json MasterBluntCount commit_raw.json RequestASesh commit_raw.json RequestSesh commit_raw.json bmohd.near Homepage commit_raw.json bo.near BookSearchPane commit_raw.json BookTile commit_raw.json BooksFeed commit_raw.json BooksMy commit_raw.json DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json DevHubBlog commit_raw.json DevHubSearch commit_raw.json HelloAccountId commit_raw.json Ideas commit_raw.json IdeasList commit_raw.json LikeButton.Faces commit_raw.json LocalStateWidget commit_raw.json NotificationFeed commit_raw.json Post commit_raw.json TestPionearDemoBackend commit_raw.json app commit_raw.json core.lib.url commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Creator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.contribute commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.profile commit_raw.json gigs-board.components.atom.icon commit_raw.json gigs-board.components.atom.spinner commit_raw.json gigs-board.components.atom.tag commit_raw.json gigs-board.components.atom.toggle commit_raw.json gigs-board.components.boards.KanbanBoard commit_raw.json gigs-board.components.community.CommunityHeader commit_raw.json gigs-board.components.community.FeaturedCommunity commit_raw.json gigs-board.components.community.FeedHeader commit_raw.json gigs-board.components.community.Layout commit_raw.json gigs-board.components.layout.Banner commit_raw.json gigs-board.components.layout.CommunityHeader commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.FeaturedCommunity commit_raw.json gigs-board.components.layout.FeedHeader commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.layout.Page commit_raw.json gigs-board.components.layout.Search commit_raw.json gigs-board.components.layout.SearchByAuthor commit_raw.json gigs-board.components.layout.SearchByLabel commit_raw.json gigs-board.components.layout.app-header commit_raw.json gigs-board.components.molecule.breadcrumbs commit_raw.json gigs-board.components.molecule.button-switch commit_raw.json gigs-board.components.molecule.button commit_raw.json gigs-board.components.molecule.markdown-editor commit_raw.json gigs-board.components.molecule.markdown-viewer commit_raw.json gigs-board.components.molecule.profile-card commit_raw.json gigs-board.components.molecule.text-input commit_raw.json gigs-board.components.molecule.tile commit_raw.json gigs-board.components.organism.configurator commit_raw.json gigs-board.components.organism.editor commit_raw.json gigs-board.components.organism.form commit_raw.json gigs-board.components.posts.List commit_raw.json gigs-board.components.posts.Post commit_raw.json gigs-board.components.posts.PostEditor commit_raw.json gigs-board.components.posts.Search commit_raw.json gigs-board.components.teams.LabelsPermissions commit_raw.json gigs-board.components.teams.TeamInfo commit_raw.json gigs-board.components.template.app-layout commit_raw.json gigs-board.components.template.community-page commit_raw.json gigs-board.entity.community.branding-configurator commit_raw.json gigs-board.entity.community.configurator commit_raw.json gigs-board.entity.community.header commit_raw.json gigs-board.entity.community.layout commit_raw.json gigs-board.entity.community.sidebar commit_raw.json gigs-board.entity.community.spawner commit_raw.json gigs-board.entity.post.AuthorSearch commit_raw.json gigs-board.entity.post.Card commit_raw.json gigs-board.entity.post.CompactPost commit_raw.json gigs-board.entity.post.History commit_raw.json gigs-board.entity.post.List commit_raw.json gigs-board.entity.post.Lookup commit_raw.json gigs-board.entity.post.Post commit_raw.json gigs-board.entity.post.PostEditor commit_raw.json gigs-board.entity.post.Spawner commit_raw.json gigs-board.entity.post.TagSearch commit_raw.json gigs-board.entity.team-board.github-kanban commit_raw.json gigs-board.entity.team-board.github-ticket commit_raw.json gigs-board.entity.team-board.kanban commit_raw.json gigs-board.entity.team.LabelsPermissions commit_raw.json gigs-board.entity.team.TeamInfo commit_raw.json gigs-board.entity.workspace.github-ticket commit_raw.json gigs-board.entity.workspace.github-view commit_raw.json gigs-board.entity.workspace.kanban-view commit_raw.json gigs-board.entity.workspace.post-ticket commit_raw.json gigs-board.entity.workspace.view.github.configurator commit_raw.json gigs-board.entity.workspace.view.github.kanban_board commit_raw.json gigs-board.entity.workspace.view.github.kanban_ticket commit_raw.json gigs-board.entity.workspace.view.kanban.configurator commit_raw.json gigs-board.entity.workspace.view.kanban.post_board commit_raw.json gigs-board.entity.workspace.view.kanban.post_ticket commit_raw.json gigs-board.entity.workspace.view.layout commit_raw.json gigs-board.feature.community-editor.branding-section commit_raw.json gigs-board.feature.community-editor.frame commit_raw.json gigs-board.feature.community-editor.ui commit_raw.json gigs-board.feature.github-integration.kanban-board-editor commit_raw.json gigs-board.feature.post-search.by-author commit_raw.json gigs-board.feature.post-search.by-tag commit_raw.json gigs-board.feature.post-search.panel commit_raw.json gigs-board.feature.workspace.github-view-configurator commit_raw.json gigs-board.feature.workspace.kanban-view-configurator commit_raw.json gigs-board.pages.Boards commit_raw.json gigs-board.pages.Community commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Feed commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.communities commit_raw.json gigs-board.pages.community.Discussions commit_raw.json gigs-board.pages.community.Events commit_raw.json gigs-board.pages.community.Overview commit_raw.json gigs-board.pages.community.Sponsorship commit_raw.json gigs-board.pages.community.Telegram commit_raw.json gigs-board.pages.community.activity commit_raw.json gigs-board.pages.community.board commit_raw.json gigs-board.pages.community.configuration commit_raw.json gigs-board.pages.community.edit-info commit_raw.json gigs-board.pages.community.github commit_raw.json gigs-board.pages.community.new commit_raw.json gigs-board.pages.community.team commit_raw.json gigs-board.pages.community.teams commit_raw.json gigs-board.pages.community.telegram commit_raw.json gigs-board.pages.community.wiki commit_raw.json test commit_raw.json bohk.near Composition commit_raw.json CompositionAnotherWallet commit_raw.json Greeter commit_raw.json GreeterYourName commit_raw.json bonerz.near Profile.with.nftgallery commit_raw.json nft-marketplace commit_raw.json booch.near Untitled-0 commit_raw.json borisisnear.near AIcomponent commit_raw.json BOSWorkshop commit_raw.json ETHGNYC commit_raw.json EncodeWidget commit_raw.json HelloEthersJS commit_raw.json Untitled-0 commit_raw.json calculator commit_raw.json newcalculator commit_raw.json bos-dev.near Breakout commit_raw.json DOCS commit_raw.json Example.using.canvas.with.iframe commit_raw.json Example.using.chartJS commit_raw.json Example.using.p5 commit_raw.json Game.FlappyBOStest commit_raw.json ProfilePage commit_raw.json Send.NEAR commit_raw.json Tetris commit_raw.json bos-nft-builders.near HelloWorld.Test commit_raw.json PoweredBy.Mintbase commit_raw.json bos.bluntdao.near AddEveryoneScript commit_raw.json BluntDAO.Button.Join commit_raw.json BluntDAO.Holders.OGValidators commit_raw.json BluntDAO.addAllOGs commit_raw.json BluntDAO.member commit_raw.json BluntDAOsNFT commit_raw.json BluntFeed commit_raw.json DAO.Dashboard commit_raw.json Donate commit_raw.json MasterBluntCount commit_raw.json RequestASesh commit_raw.json RequestSesh commit_raw.json bos.dapplets.near ApplicationCard commit_raw.json Capybara commit_raw.json CapybaraAbsoluteBtn commit_raw.json Cat commit_raw.json ComponentSearch commit_raw.json ComponentSearchWidget commit_raw.json ComponentsSearch commit_raw.json ContextActionsGroup commit_raw.json DefaultLayoutManager commit_raw.json Dog commit_raw.json LayoutManager.Buttons.Apply commit_raw.json LayoutManager.Buttons.Edit commit_raw.json LayoutManager.Buttons.Plus commit_raw.json LayoutManager.Buttons.PlusDefault commit_raw.json LayoutManager.DeleteWidgetButton commit_raw.json LayoutManager.EarOpened commit_raw.json LayoutManager.LockedWidgetBadge commit_raw.json LayoutManager.SupportingSpan commit_raw.json LayoutManager.TriggerEar commit_raw.json LayoutManager.WidgetBadgeWrapper commit_raw.json LayoutManager.WidgetBageWrapper commit_raw.json ModalSelectedMutationEditor commit_raw.json N.DislikeButton commit_raw.json Onboarding.Arrow commit_raw.json Onboarding.Callout commit_raw.json Onboarding.Main commit_raw.json Onboarding.Question commit_raw.json Onboarding.QuestionIcon commit_raw.json Onboarding.SandboxOnboarding commit_raw.json OnboardingTest.Main commit_raw.json OnboardingTest.SandboxOnboarding commit_raw.json Paywall.Badge commit_raw.json Paywall.Content commit_raw.json Paywall.Form commit_raw.json Paywall.Main commit_raw.json PaywallUploadWidget commit_raw.json RedContainer commit_raw.json SearchCard commit_raw.json SocialDbEditor commit_raw.json Tipping.Main commit_raw.json Tipping.NearIcon commit_raw.json Tipping.TipIcon commit_raw.json VerticalLayoutManager commit_raw.json WebGuide.Body commit_raw.json WebGuide.Callout commit_raw.json WebGuide.Chapter commit_raw.json WebGuide.Footer commit_raw.json WebGuide.Header commit_raw.json WebGuide.InfoBox commit_raw.json WebGuide.Main commit_raw.json WebGuide.OverlayTrigger commit_raw.json bos.genadrop.near CPlanet.ChainsDropdown commit_raw.json CPlanet.DAO.Card commit_raw.json CPlanet.DAO.Explore commit_raw.json CPlanet.DAO.Index commit_raw.json CPlanet.DAO.Members.Card commit_raw.json CPlanet.DAO.Members.CouncilCard commit_raw.json CPlanet.DAO.Members.Index commit_raw.json CPlanet.DAO.Members.SideCard commit_raw.json CPlanet.DAO.ProfileNFTs commit_raw.json CPlanet.DAO.Proposal.Card commit_raw.json CPlanet.DropsFund.Admin.Index commit_raw.json CPlanet.DropsFund.Admin.Payout commit_raw.json CPlanet.DropsFund.Contest.Card commit_raw.json CPlanet.DropsFund.Contest.Content commit_raw.json CPlanet.DropsFund.Contest.Countdown commit_raw.json CPlanet.DropsFund.Contest.FilterOption commit_raw.json CPlanet.DropsFund.Contest.Index commit_raw.json CPlanet.DropsFund.Contest.Proposal commit_raw.json CPlanet.DropsFund.Contest.Rules commit_raw.json CPlanet.DropsFund.Contest.Single commit_raw.json CPlanet.DropsFund.Explore.Card commit_raw.json CPlanet.DropsFund.Explore.Index commit_raw.json CPlanet.DropsFund.Index commit_raw.json CPlanet.Footer.Index commit_raw.json CPlanet.Group.Index commit_raw.json CPlanet.Group.NotMemberCompose commit_raw.json CPlanet.Home.Home commit_raw.json CPlanet.Home.NFTs commit_raw.json CPlanet.Home.Partners commit_raw.json CPlanet.Home.Quest commit_raw.json CPlanet.Index commit_raw.json CPlanet.MainPage.Feed commit_raw.json CPlanet.MainPage.Social commit_raw.json CPlanet.NFTCard.FeaturedNFT commit_raw.json CPlanet.NFTCard.Index commit_raw.json CPlanet.NFTExplore.ChainsDropdown commit_raw.json CPlanet.NFTExplore.DAONFTs commit_raw.json CPlanet.NFTExplore.FilterDropdown commit_raw.json CPlanet.NFTExplore.Index commit_raw.json CPlanet.NFTExplore.NFTInfo commit_raw.json CPlanet.NFTExplore.SingleNFT commit_raw.json CPlanet.Navbar.Index commit_raw.json CPlanet.Profile.Editor commit_raw.json CPlanet.Profile.Large commit_raw.json CPlanet.ProfilePage.Index commit_raw.json CPlanet.ProfilePage.Tabs commit_raw.json DropFlow.ArtistPage.Index commit_raw.json DropFlow.ArtistPage.Preview.Index commit_raw.json DropFlow.ArtistPage.Preview.Tabs commit_raw.json DropFlow.ArtistPage.Tabs commit_raw.json DropFlow.ArtistPage.theme0 commit_raw.json DropFlow.ArtistPage.theme1 commit_raw.json DropFlow.ArtistPage.theme2 commit_raw.json DropFlow.ArtistPage commit_raw.json DropFlow.CollectionNFTs commit_raw.json DropFlow.CreatePage.Bet commit_raw.json DropFlow.CreatePage.Editor commit_raw.json DropFlow.CreatePage.Footer commit_raw.json DropFlow.CreatePage.Form commit_raw.json DropFlow.CreatePage.Index commit_raw.json DropFlow.CreatePage.N commit_raw.json DropFlow.CreatePage.New commit_raw.json DropFlow.CreatePage.Step1 commit_raw.json DropFlow.CreatePage.Step2 commit_raw.json DropFlow.CreatePage.Step3 commit_raw.json DropFlow.CreatePage.Step4 commit_raw.json DropFlow.CreatePage.Step5 commit_raw.json DropFlow.CreatePage.Step6 commit_raw.json DropFlow.LinkTree commit_raw.json DropFlow.MetadataEditor commit_raw.json GenaDrop.Ai-Minter commit_raw.json GenaDrop.Alert commit_raw.json GenaDrop.Create commit_raw.json GenaDrop.Explore commit_raw.json GenaDrop.Footer commit_raw.json GenaDrop.Home.Index commit_raw.json GenaDrop.Home.PartnerForm commit_raw.json GenaDrop.Home.PartnersCarousel commit_raw.json GenaDrop.MultiChainMinter commit_raw.json GenaDrop.MultiChainMinter2 commit_raw.json GenaDrop.MultiListing.Index commit_raw.json GenaDrop.MultiListing.Input commit_raw.json GenaDrop.NFT.AccountProfile commit_raw.json GenaDrop.NFT.Details commit_raw.json GenaDrop.NFT.Selector commit_raw.json GenaDrop.NFT.Swap.Modal commit_raw.json GenaDrop.NFT.Swap.NFT-Trade commit_raw.json GenaDrop.NFT.Swap.NFT-Transfer commit_raw.json GenaDrop.NFT.Swap.NewOffer commit_raw.json GenaDrop.NFT.Swap.Order commit_raw.json GenaDrop.NFT.Swap.nft-selector commit_raw.json GenaDrop.NFTSelector commit_raw.json GenaDrop.NearLogo commit_raw.json GenaDrop.Profile.Main commit_raw.json GenaDrop.Profile.MyNFTs commit_raw.json GenaDrop.SDK commit_raw.json GenaDrop.Social commit_raw.json GenaDrop.SuccessModal commit_raw.json Mintbase.App.Activity.Activity commit_raw.json Mintbase.App.Activity.Analytics commit_raw.json Mintbase.App.Activity.TopAffiliates commit_raw.json Mintbase.App.Activity.index commit_raw.json Mintbase.App.ContractProfilePage.Activity commit_raw.json Mintbase.App.ContractProfilePage.ContractNFTs commit_raw.json Mintbase.App.ContractProfilePage.Index commit_raw.json Mintbase.App.Explore.Index commit_raw.json Mintbase.App.Footer.Index commit_raw.json Mintbase.App.Hero.Index commit_raw.json Mintbase.App.Home.HomeContracts commit_raw.json Mintbase.App.Home.HomeCreators commit_raw.json Mintbase.App.Home.HomePurchase commit_raw.json Mintbase.App.Home.HomeSmartContract commit_raw.json Mintbase.App.Home.HomeTableActivity commit_raw.json Mintbase.App.Home.HomeTables commit_raw.json Mintbase.App.Home.HomeTopCollection commit_raw.json Mintbase.App.Home.Index commit_raw.json Mintbase.App.Home.LoggedInHome commit_raw.json Mintbase.App.Index commit_raw.json Mintbase.App.LaunchPad.Contracts commit_raw.json Mintbase.App.LaunchPad.Earned commit_raw.json Mintbase.App.LaunchPad.Index commit_raw.json Mintbase.App.LaunchPad.OffersToAccount commit_raw.json Mintbase.App.LaunchPad.OpenOffersByAccount commit_raw.json Mintbase.App.Layout commit_raw.json Mintbase.App.NFTDetails.Index commit_raw.json Mintbase.App.NFTDetails.NFTMore commit_raw.json Mintbase.App.NFTDetails.NFTShow commit_raw.json Mintbase.App.NFTDetails.NFTTable commit_raw.json Mintbase.App.Navbar.Index commit_raw.json Mintbase.App.Navbar.NavRoutes commit_raw.json Mintbase.App.Profile.Activity commit_raw.json Mintbase.App.Profile.ContractSettings.Ownership commit_raw.json Mintbase.App.Profile.Index commit_raw.json Mintbase.App.Router commit_raw.json Mintbase.App.Solutions.Enterprise commit_raw.json Mintbase.App.Solutions.Index commit_raw.json Mintbase.App.Solutions.TopAffiliates commit_raw.json Mintbase.App.Solutions.UseCases commit_raw.json Mintbase.App.Store.Card commit_raw.json Mintbase.App.Store.Cards commit_raw.json Mintbase.App.Store.CreateForm commit_raw.json Mintbase.App.Store.CreateStoreCard commit_raw.json Mintbase.App.Store.Mine commit_raw.json Mintbase.App.Store.NFTs commit_raw.json Mintbase.App.Store.OwnerDetails commit_raw.json Mintbase.App.Store.test commit_raw.json Mintbase.App.Tokens.Minted commit_raw.json Mintbase.App.Tokens.Owned commit_raw.json Mintbase.App.View commit_raw.json Mintbase.ListRowContent commit_raw.json Mintbase.MbAccordion commit_raw.json Mintbase.MbAction commit_raw.json Mintbase.MbActionText commit_raw.json Mintbase.MbArrowMenu commit_raw.json Mintbase.MbButton commit_raw.json Mintbase.MbCharCounter commit_raw.json Mintbase.MbCheckbox commit_raw.json Mintbase.MbChip commit_raw.json Mintbase.MbDropdownHoverMenu commit_raw.json Mintbase.MbDropdownMenu commit_raw.json Mintbase.MbExploreFeaturedCard commit_raw.json Mintbase.MbFeaturedCard commit_raw.json Mintbase.MbIcon commit_raw.json Mintbase.MbInfoCard commit_raw.json Mintbase.MbInput commit_raw.json Mintbase.MbInputField commit_raw.json Mintbase.MbLinkTree commit_raw.json Mintbase.MbLogo commit_raw.json Mintbase.MbMetaCard commit_raw.json Mintbase.MbModal commit_raw.json Mintbase.MbNetworkMenu commit_raw.json Mintbase.MbPill commit_raw.json Mintbase.MbRadioButton commit_raw.json Mintbase.MbRowList commit_raw.json Mintbase.MbRowSelectList commit_raw.json Mintbase.MbSwitch commit_raw.json Mintbase.MbTable commit_raw.json Mintbase.MbTabs commit_raw.json Mintbase.MbTag commit_raw.json Mintbase.MbTooltip commit_raw.json Mintbase.MintbaseUI commit_raw.json Mintbase.NFT.Burn commit_raw.json Mintbase.NFT.Card commit_raw.json Mintbase.NFT.Delist commit_raw.json Mintbase.NFT.Index commit_raw.json Mintbase.NFT.MBSellOption commit_raw.json Mintbase.NFT.TransferOption commit_raw.json Mintbase.NFT.modules commit_raw.json Mintbase.RadioButton commit_raw.json Mintbase.RowSelectList commit_raw.json Mintbase.SDK commit_raw.json Mintbase.Tab commit_raw.json Mintbase.TablePagination commit_raw.json Mintbase.Theme commit_raw.json Mintbase.UI-Kit commit_raw.json Mintbase.VideoPlayer commit_raw.json Mintbase.components commit_raw.json Mintbase.kit-schema commit_raw.json Mintbase.utils.deploy_store commit_raw.json Mintbase.utils.get_activity_by_contract commit_raw.json Mintbase.utils.get_combined_store_data commit_raw.json Mintbase.utils.get_offers_to_account commit_raw.json Mintbase.utils.get_open_offers_by_account commit_raw.json Mintbase.utils.get_store_nfts commit_raw.json Mintbase.utils.get_time_passed commit_raw.json Mintbase.utils.get_user_earnings commit_raw.json Mintbase.utils.get_user_stores commit_raw.json Mintbase.utils.sdk commit_raw.json bos.integrations.near verifi commit_raw.json bos.memesforgood.near CaseStudies commit_raw.json Tooltip commit_raw.json app commit_raw.json bos.proofofvibes.near DAOBounties commit_raw.json DAOBounty commit_raw.json DAOTabs commit_raw.json FollowersList commit_raw.json IsTasteMaker commit_raw.json Mapbox commit_raw.json NDCSBTHolders commit_raw.json NearImpactRequests commit_raw.json PostFeed commit_raw.json ProfilePage commit_raw.json Proposal commit_raw.json Proposals commit_raw.json RefiDaoMembers commit_raw.json SideBar commit_raw.json Social commit_raw.json SocialMarkdown commit_raw.json VibesFeedMain commit_raw.json VibesTasteMakersMain commit_raw.json check user permissions\nfunction toPolicyLabel(proposalKind) {\n const kindName =\n typeof proposalKind === \"string\"\n ? proposalKind\n : Object.keys(proposalKind)[0];\n switch (kindName) {\n case \"ChangeConfig\":\n return \"config\";\n case \"ChangePolicy\":\n return \"policy\";\n case \"AddMemberToRole\":\n return \"add_member_to_role\";\n case \"RemoveMemberFromRole\":\n return \"remove_member_from_role\";\n case \"FunctionCall\":\n return \"call\";\n case \"UpgradeSelf\":\n return \"upgrade_self\";\n case \"UpgradeRemote\":\n return \"upgrade_remote\";\n case \"Transfer\":\n return \"transfer\";\n case \"SetStakingContract\":\n return \"set_vote_token\";\n case \"AddBounty\":\n return \"add_bounty\";\n case \"BountyDone\":\n return \"bounty_done\";\n case \"Vote\":\n return \"vote\";\n case \"FactoryInfoUpdate\":\n return \"factory_info_update\";\n case \"ChangePolicyAddOrUpdateRole\":\n return \"policy_add_or_update_role\";\n case \"ChangePolicyRemoveRole\":\n return \"policy_remove_role\";\n case \"ChangePolicyUpdateDefaultVotePolicy\":\n return \"policy_update_default_vote_policy\";\n case \"ChangePolicyUpdateParameters\":\n return \"policy_update_parameters\";\n default:\n return \"\";\n }\n}\n\nlet roles = Near.view(daoId, \"get_policy\");\nroles = roles === null ? [] : roles.roles;\nconst userRoles = [];\nfor (const role of roles) {\n if (role.kind === \"Everyone\") {\n userRoles.push(role);\n continue;\n }\n if (!role.kind.Group) continue;\n if (\n context.accountId &&\n role.kind.Group &&\n role.kind.Group.includes(context.accountId)\n ) {\n userRoles.push(role);\n }\n}\n\nconst isAllowedTo = (action) => {\n let allowed = false;\n\n const allowedRoles = userRoles\n .filter(({ permissions }) => {\n const allowedRole =\n permissions.includes(\n `${toPolicyLabel(proposal.kind)}:${action.toString()}`\n ) ||\n permissions.includes(`${toPolicyLabel(proposal.kind)}:*`) ||\n permissions.includes(`*:${action.toString()}`) ||\n permissions.includes(\"*:*\");\n allowed = allowed || allowedRole;\n return allowedRole;\n })\n .map((role) => role.name);\n\n return [allowed, allowedRoles];\n};\n\nconst isAllowedToVoteYes = isAllowedTo(\"VoteApprove\")[0];\nconst isAllowedToVoteNo = isAllowedTo(\"VoteReject\")[0];\nconst isAllowedToVoteRemove = isAllowedTo(\"VoteRemove\")[0];\n\nconsole.log(isAllowedToVoteYes, isAllowedToVoteNo, isAllowedToVoteRemove);\n bos.questverse.near QuestsVerse.Notification.Item.Left commit_raw.json QuestsVerse.Notification.Item.Right commit_raw.json QuestsVerse.app commit_raw.json app commit_raw.json components.Header commit_raw.json components.Layout commit_raw.json components.createQuestSteps.Steps commit_raw.json components.createQuestSteps.step1 commit_raw.json components.createQuestSteps.step2 commit_raw.json components.createQuestSteps.step3 commit_raw.json components.createQuestSteps.step4 commit_raw.json components.createQuestSteps.step5 commit_raw.json components.createQuestSteps.stepFive commit_raw.json components.createQuestSteps.stepFour commit_raw.json components.createQuestSteps.stepOne commit_raw.json components.createQuestSteps.stepThree commit_raw.json components.createQuestSteps.stepTwo commit_raw.json components.quest.card commit_raw.json components.quest.claim commit_raw.json components.quest.create.footer commit_raw.json components.quest.create.form commit_raw.json components.quest.create.index commit_raw.json components.quest.create.step1 commit_raw.json components.quest.create.step2 commit_raw.json components.quest.create.step3 commit_raw.json components.quest.create.step4 commit_raw.json components.quest.create.step5 commit_raw.json components.quest.create.step6 commit_raw.json createQuest commit_raw.json data.data_indexers commit_raw.json data.data_step1 commit_raw.json data.data_step2 commit_raw.json data.data_step3 commit_raw.json data.data_stepOne commit_raw.json data.data_stepThree commit_raw.json data.data_stepTwo commit_raw.json data_stepOne commit_raw.json newQuestComponents.stepOne commit_raw.json newQuestComponents.stepThree commit_raw.json newQuestComponents.stepTwo commit_raw.json pages.Create commit_raw.json pages.CreateQuestFlow commit_raw.json pages.Dashboard commit_raw.json pages.Discover commit_raw.json pages.Quest commit_raw.json pages.QuestDetailsPage commit_raw.json quests-board.components.atom.icon commit_raw.json quests-board.components.atom.spinner commit_raw.json quests-board.components.atom.tag commit_raw.json quests-board.components.atom.toggle commit_raw.json quests-board.components.layout.Controls commit_raw.json quests-board.components.layout.LikeButton.Faces commit_raw.json quests-board.components.layout.Navbar commit_raw.json quests-board.components.molecule.Card commit_raw.json quests-board.components.molecule.DescriptionArea commit_raw.json quests-board.components.molecule.StatusIndicator commit_raw.json quests-board.components.molecule.Tags commit_raw.json quests-board.components.molecule.breadcrumbs commit_raw.json quests-board.components.molecule.button-switch commit_raw.json quests-board.components.molecule.button commit_raw.json quests-board.components.molecule.markdown-viewer commit_raw.json quests-board.components.molecule.profile-card commit_raw.json quests-board.components.molecule.text-input commit_raw.json quests-board.components.molecule.tile commit_raw.json quests-board.components.organism.app-header commit_raw.json quests-board.components.organism.configurator commit_raw.json quests-board.components.profile.Icon commit_raw.json quests-board.components.profile.NameAndAccount commit_raw.json quests-board.components.template.app-layout commit_raw.json quests-board.entity.quest.Card commit_raw.json quests-board.entity.quest.List commit_raw.json quests-board.entity.quest.Quest commit_raw.json quests-board.feature.quest-search.panel commit_raw.json quests-board.pages.Feed commit_raw.json bos.yearofchef.near Donations commit_raw.json explore commit_raw.json index commit_raw.json list commit_raw.json bos_check.near BlockDetails commit_raw.json BlockStream commit_raw.json Helper commit_raw.json TxDetails commit_raw.json TxStream commit_raw.json bosbuilders.near ForkButton commit_raw.json bosco.near Group commit_raw.json Onboarding.Starter-fork commit_raw.json ProjectEmergence commit_raw.json bosquests.near Untitled-0 commit_raw.json Untitled-1 commit_raw.json Untitled-2 commit_raw.json bossonormal1.near New-Draft-0 commit_raw.json bosspod.near Test-Hello commit_raw.json change.near-render commit_raw.json bostest.near WeAreDevsStatusBoard commit_raw.json box_factory.near MysteryBox.Components.BackgroundStars commit_raw.json MysteryBox.Manage.Components.DeleteButton commit_raw.json MysteryBox.Manage.Components.HomeButton commit_raw.json MysteryBox.Manage.Components.MenuButton commit_raw.json MysteryBox.Manage.Components.MenuHeader commit_raw.json MysteryBox.Manage.Components.NearPool commit_raw.json MysteryBox.Manage.Components.Notification commit_raw.json MysteryBox.Manage.Components.PrimaryLinkButton commit_raw.json MysteryBox.Manage.Components.PrimaryText commit_raw.json MysteryBox.Manage.Components.RarityButton commit_raw.json MysteryBox.Manage.Components.Socials commit_raw.json MysteryBox.Manage.Components.SubmitButton commit_raw.json MysteryBox.Manage.Components.Title commit_raw.json MysteryBox.Manage.Screens.AddNearReward commit_raw.json MysteryBox.Manage.Screens.AddNftReward commit_raw.json MysteryBox.Manage.Screens.DeployContract commit_raw.json MysteryBox.Manage.Screens.Home commit_raw.json MysteryBox.Manage.Screens.ListRewards commit_raw.json MysteryBox.Manage.Screens.ListUserBoxes commit_raw.json MysteryBox.Manage.Screens.MintBox commit_raw.json MysteryBox.Manage commit_raw.json MysteryBox.Screens.AuthenticationRequired commit_raw.json MysteryBox.Screens.Claim commit_raw.json MysteryBox.Screens.ClaimAnimation commit_raw.json MysteryBox.Screens.InvalidContract commit_raw.json MysteryBox.Screens.NoBoxesFound commit_raw.json MysteryBox.Screens.VerificationRequired commit_raw.json MysteryBox commit_raw.json Templates.Layout commit_raw.json Templates.Notification commit_raw.json core.lib.url commit_raw.json bozon.near CodeDiff commit_raw.json CreatePullRequest commit_raw.json Developer commit_raw.json MessagesList commit_raw.json PinWidgetStat commit_raw.json PrivateMailBox.Message commit_raw.json PrivateMailBox.Register commit_raw.json PrivateMailBox.UserList commit_raw.json PrivateMailBox.UserMessages commit_raw.json PrivateMailBox commit_raw.json PrivateMessage.Message commit_raw.json PrivateMessage.Register commit_raw.json PrivateMessage.UserList commit_raw.json PrivateMessage.UserMessages commit_raw.json PrivateMessage commit_raw.json PrivateMessages.Register commit_raw.json PrivateMessages.UserList commit_raw.json PrivateMessages.UserMessages commit_raw.json PrivateMessages commit_raw.json Sudoku.Board commit_raw.json Sudoku.Leaderboard commit_raw.json Sudoku.Timer commit_raw.json Sudoku commit_raw.json TimeAgo commit_raw.json Token commit_raw.json TokenAmount commit_raw.json Widget.Collaborators commit_raw.json Widget.CreatePullRequest commit_raw.json Widget.Developers commit_raw.json Widget.Main commit_raw.json Widget.PullRequests commit_raw.json Widget commit_raw.json WidgetHistory.CodeHistory commit_raw.json WidgetHistory.CodeHistoryCard commit_raw.json WidgetHistory.History commit_raw.json WidgetHistory.RenderCode commit_raw.json WidgetHistory.WidgetCode commit_raw.json WidgetHistory commit_raw.json uiw-ReactTextareaCodeEditor commit_raw.json bpolania.near HelloEthersJS commit_raw.json ITAWorkshopDec2023 commit_raw.json Untitled-0 commit_raw.json Untitled-1 commit_raw.json ethSamba-quick-BOS commit_raw.json brad123.near AdvancedProfileSearch commit_raw.json SearchPeople commit_raw.json brahvough.near SearchPopupFunctions-ui1 commit_raw.json branermusso.near New-Draft-0 commit_raw.json StorageFreeing commit_raw.json brex.near Untitled-2 commit_raw.json Untitled-3 commit_raw.json Untitled-4 commit_raw.json brrrb.near DAO.Main commit_raw.json brunob.near Untitled-0 commit_raw.json brytelitty.near ProfilePage commit_raw.json bucanero.near query-api-nft-feed commit_raw.json buildafricadev.near buildAfricaAboutUs commit_raw.json buildAfricaCrafted commit_raw.json buildAfricaHeader commit_raw.json buildAfricaHome commit_raw.json buildAfricaPartner commit_raw.json buildbox.near AbstractionHacks.Submit commit_raw.json AbstractionHacks.View commit_raw.json app commit_raw.json config commit_raw.json layout commit_raw.json page.browse commit_raw.json page.feed commit_raw.json page.home commit_raw.json page.submit commit_raw.json page.view commit_raw.json post.content commit_raw.json post.embed commit_raw.json post.feed commit_raw.json post.item commit_raw.json project.embed commit_raw.json utils.extractValidNearAddresses commit_raw.json utils.fetchProjects commit_raw.json utils.projects-sdk commit_raw.json utils.stringUtils commit_raw.json buildcommons.near Index commit_raw.json SocialGraph commit_raw.json config.app commit_raw.json config.feed commit_raw.json connect commit_raw.json graph.join commit_raw.json navigation.Navbar commit_raw.json page.cohorts commit_raw.json page.feed commit_raw.json page.home commit_raw.json page.main commit_raw.json page.projects commit_raw.json page.states commit_raw.json profile.builder commit_raw.json template.AppLayout commit_raw.json template.SidebarLayout commit_raw.json thing.context commit_raw.json buildhub.near Bookmarks commit_raw.json Comment.Comment commit_raw.json Comment.Compose commit_raw.json Comment.Feed commit_raw.json Compose commit_raw.json Feed commit_raw.json JoinButton commit_raw.json JoinSection commit_raw.json MetadataEditor commit_raw.json N.Common.AccountAutocomplete commit_raw.json N.Common.Compose commit_raw.json N.Compose commit_raw.json Notification.Item.Left commit_raw.json Notification.Item.Right commit_raw.json Notification.Item.buildhub commit_raw.json Notification.NotificationRolesSelector commit_raw.json OnboardingFlow commit_raw.json OrderedGraphFeed commit_raw.json Post.Header commit_raw.json Post commit_raw.json Profile commit_raw.json Proposals commit_raw.json Resources commit_raw.json Router commit_raw.json TrialAccountBanner commit_raw.json WidgetMetadata commit_raw.json WidgetMetadataEditor commit_raw.json app.view commit_raw.json app commit_raw.json aside commit_raw.json components.AccountAutocomplete commit_raw.json components.AsideWithMainContent commit_raw.json components.Avatar commit_raw.json components.Bullet commit_raw.json components.Button commit_raw.json components.ButtonLink commit_raw.json components.Checkbox commit_raw.json components.Hashtag commit_raw.json components.Header commit_raw.json components.ImageUploader commit_raw.json components.InputField commit_raw.json components.Library commit_raw.json components.MarkdownEditorIframe commit_raw.json components.Modal commit_raw.json components.Navbar commit_raw.json components.Pagination commit_raw.json components.Post commit_raw.json components.ProfileImages commit_raw.json components.ProgressState commit_raw.json components.ProposalCard commit_raw.json components.Step commit_raw.json components.Tag commit_raw.json components.Text.H1 commit_raw.json components.Text.H2 commit_raw.json components.Text.H3 commit_raw.json components.Text.H4 commit_raw.json components.Text.P commit_raw.json components.TextBox commit_raw.json components.TextEditor commit_raw.json components.ThemeProvider commit_raw.json components.TrialAccountBanner commit_raw.json components.UploadField commit_raw.json components.User commit_raw.json components.VerifiedHuman commit_raw.json components.banners.potlock commit_raw.json components.button.join-now commit_raw.json components.buttons.Connect commit_raw.json components.buttons.JoinNow commit_raw.json components.buttons.UserDropdown commit_raw.json components.login-now commit_raw.json components.modals.CreateEvent commit_raw.json components.modals.CreateProject commit_raw.json components.modals.CreateProposal commit_raw.json components.modals.DeletePost commit_raw.json components.modals.EditPost commit_raw.json components.modals.FilterEvents commit_raw.json components.modals.FilterProjects commit_raw.json components.modals.ProposalsFilters commit_raw.json components.modals.event.Filters commit_raw.json components.modals.event.Form commit_raw.json components.modals.projects.Filters commit_raw.json components.modals.propose.AddMember commit_raw.json components.modals.propose.FunctionCall commit_raw.json components.modals.propose.RemoveMember commit_raw.json components.modals.propose.Text commit_raw.json components.modals.propose.Transfer commit_raw.json components.navigation.header commit_raw.json components.post.BookmarkButton commit_raw.json components.post.Content commit_raw.json components.post.Embed commit_raw.json components.post.Header commit_raw.json components.post.post-header commit_raw.json components.post.post commit_raw.json components.profile.AccountFeed commit_raw.json components.profile.FollowStats commit_raw.json components.profile.ImageUploader commit_raw.json components.profile.LastWidgets commit_raw.json components.profile.Linktree commit_raw.json components.profile.ProfileEdit commit_raw.json components.profile.ProfileInfo commit_raw.json components.profile.ProfileLine commit_raw.json components.profile.ProfileTabs commit_raw.json components.profile.WidgetMetadata commit_raw.json components.project.Card commit_raw.json components.project.page.Activity commit_raw.json components.project.page.Code commit_raw.json components.project.page.Discussion commit_raw.json components.project.page.Overview commit_raw.json components.project.page.Roadmap commit_raw.json components.project.page.Task commit_raw.json components commit_raw.json config.app commit_raw.json config.feed commit_raw.json config.project-routes commit_raw.json config.projects commit_raw.json config.resources commit_raw.json config.routes commit_raw.json create-something commit_raw.json events.Calendar commit_raw.json events.ListView commit_raw.json events.MonthView commit_raw.json feed.Bookmarks commit_raw.json fetch.daos commit_raw.json home.AboutUs commit_raw.json home.Footer commit_raw.json home.Goals commit_raw.json home.Governance commit_raw.json home.Home commit_raw.json home.Purposes commit_raw.json home.cta commit_raw.json home.hero commit_raw.json home.join commit_raw.json home commit_raw.json inspect.WidgetDependencies commit_raw.json inspect.WidgetSource commit_raw.json lib.everything-sdk commit_raw.json lib.project-data commit_raw.json lib.url commit_raw.json login commit_raw.json logout commit_raw.json md-view commit_raw.json page.feed commit_raw.json page.home commit_raw.json page.inspect commit_raw.json page.library commit_raw.json page.profile commit_raw.json page.project commit_raw.json page.projects commit_raw.json page.resources commit_raw.json propose-widget commit_raw.json propose commit_raw.json resources-aside commit_raw.json section.cta commit_raw.json section.footer commit_raw.json section.goals commit_raw.json section.governance commit_raw.json section.hero commit_raw.json section.join commit_raw.json template.AppLayout commit_raw.json template.ProjectLayout commit_raw.json template.SidebarLayout commit_raw.json buildnyc.near SocialGraph commit_raw.json graph.create commit_raw.json table commit_raw.json burrito-pets.near Burrito-Pets-Interact commit_raw.json Burrito-Pets-Mint commit_raw.json bwe-demos.near HelloWorld commit_raw.json HellowWorld commit_raw.json LandingPage commit_raw.json NPM.Lodash commit_raw.json NPM.PhosphorIcons commit_raw.json NPM.React.Hooks.UseMemo commit_raw.json NPM.React.Hooks.UseRef commit_raw.json NPM.ReactSyntaxHighlighter commit_raw.json NPM.Tracker.ComponentEntry commit_raw.json NPM.Tracker commit_raw.json NPM.Zustand commit_raw.json Posts.Account commit_raw.json Posts.Feed commit_raw.json Posts.Markdown commit_raw.json Posts.Marked commit_raw.json Posts.Post commit_raw.json Posts.Sidebar commit_raw.json StateAndTrust.Root commit_raw.json StateAndTrust.SetParent commit_raw.json StateAndTrust.Shape.Circle commit_raw.json StateAndTrust.Shape.Square commit_raw.json StateAndTrust.Shape.Triangle commit_raw.json StateAndTrust.ShapeSet commit_raw.json StateAndTrust.TrustTree commit_raw.json WalletSelector.SignAndSendTransaction commit_raw.json WalletSelector.SignMessage commit_raw.json bwoodpacker.near BWoodpackerdigitalexplorer commit_raw.json byalbert.near Map.Inspect commit_raw.json Map.index commit_raw.json RatSightings commit_raw.json RatSightingsUpdated commit_raw.json boroughs.map commit_raw.json card commit_raw.json toast commit_raw.json voteButton commit_raw.json bylcnkaya.near bylcnkaya.near_54f3461f-7a43-4183-ba4b-9b84d8e8dba2 commit_raw.json c036f1a97e5b5161fc115c15b93cd1e23fbec5718c4ea3563c1e80d01bb79673 BTC-BOS commit_raw.json Composition commit_raw.json Greeter commit_raw.json GreeterToday commit_raw.json GreetingYourName commit_raw.json collegium.bos.wk2.EthereumContractWidget commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json collegium.bos.wk2.StateWidget commit_raw.json collegium.bos.wk2.Web3ConnectWidget commit_raw.json c0cf2883421bfa90fbedbdaa2ce8aa7b98b21aecb6693f6054e5696890a80a24 encodexnear23-uniswap commit_raw.json lp-uniswap commit_raw.json c144d59d325b72277d92f72707222bcf7b1cf91c5d66a54022a0686b45b9eb38 Reputation-Graph.draft-fork commit_raw.json c1e568f7060af01a3b47f29f5ab075e773aa41302714cb9bc6f539fff374a7ff Bounty-Post-Changes commit_raw.json Ideas commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.posts.List commit_raw.json hello_world-fork commit_raw.json teal-test-import commit_raw.json c4b45f8cc13ce81644365cd55d7c768daa098897bafd0445ba7f837d8ded616c Onboarding.Starter-fork commit_raw.json c5d50293c3a3ed146051462e6e02e469acda10b517bfffeb3d34652076f0cb7c AppHero commit_raw.json ArtheraInput commit_raw.json BlockgalaLanding commit_raw.json DataWidget commit_raw.json Hero commit_raw.json HomeWhatIsBOS commit_raw.json Hook commit_raw.json ImageWidget commit_raw.json Yaypeg commit_raw.json c5d8ae6a463b23253d799fd788cccb3497a49f9cc999b626248d459b85e42174 LockLP commit_raw.json c600cadf81115e7635094448ded43bc34703b47e86a1c1a3d1bec8b4cacc557a universal-serializer commit_raw.json c6930e0807d33bb25feca025d20d0f8c949efce27efe3c41eeac47ec5430e378 HelloWorld commit_raw.json c74edb82759f476010ce8363e6be15fcb3cfebf9be6320d6cdc3588f1a5b4c0e APRText commit_raw.json BalancerAPITokenTable commit_raw.json BalancerPool commit_raw.json BalancerPoolContainer commit_raw.json BalancerPoolTableRow commit_raw.json GetGetUserBalanceTest commit_raw.json GetUserBalanceTest commit_raw.json NetworkSwitcherWithInfoTest commit_raw.json StakeUnstakeButtonAndForm commit_raw.json StakeUnstakeForm commit_raw.json TriggeringTheModule commit_raw.json Untitled-0 commit_raw.json c75e19731d9b15c93bf87245517191bd75fb297632e2bb1d2b0f961a0a5482c4 Untitled-0 commit_raw.json c82e0030b03664f02cc5c0b3c53f2374236a8f7c2622812e6c08113a56edad62 ForkThis commit_raw.json c842b1a648114a20cfca00f01718ee4c6f46d772951d9f8f31dffc189da63b80 Composition commit_raw.json GreeterToday commit_raw.json GreeterYourName commit_raw.json LiquityOpenTroveSepoliaExample commit_raw.json Mission commit_raw.json chatbot commit_raw.json chatbot2 commit_raw.json chatbot3 commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json collegium.bos.wk3.Mission commit_raw.json collegium.bos.wk3.MyPosts commit_raw.json collegium.bos.wk3.SocialWidget commit_raw.json test commit_raw.json test2 commit_raw.json test3 commit_raw.json testBosChatbot commit_raw.json testlocalhost commit_raw.json c8901ac428e2825fa78255db83a01227adccb1a71b2464d52bf6c8727c4873af Near.bos.TracNghiem commit_raw.json c8d96e5217c9c00a69fec3bef4ba83914f903c1913737709ca25529a28705238 zkQuest commit_raw.json c9352ad03fb767bfa330daa644e5711bd496c93729645ea8ac9e5605dadf73bb StakeETH commit_raw.json calcamonia.near calcamonia.near_f91fcd8d-3665-4214-a3c0-ff827b21d678 commit_raw.json calcifer1001.near test2 commit_raw.json calebjacob.near AccountAutocomplete commit_raw.json AccountProfile commit_raw.json AccountProfileCard commit_raw.json AccountProfileInline commit_raw.json AccountProfileOverlay commit_raw.json Activity commit_raw.json ActivityPage.LatestApplications commit_raw.json ActivityPage commit_raw.json AppCard commit_raw.json AppDetailsPage commit_raw.json ApplicationCard commit_raw.json ApplicationDetails commit_raw.json ApplicationDetailsPage commit_raw.json Badges commit_raw.json CommentButton commit_raw.json Comments.Comment commit_raw.json Comments.Compose commit_raw.json Comments.Feed commit_raw.json ComponentCard commit_raw.json ComponentCollection commit_raw.json ComponentDetailsPage commit_raw.json ComponentProfile commit_raw.json ComponentSearch commit_raw.json ComponentSummary commit_raw.json ComponentTags commit_raw.json ComponentsPage commit_raw.json CopyUrlButton commit_raw.json Counter commit_raw.json CreatePost commit_raw.json CustomWidgetDisplay commit_raw.json DataAttributesTest1 commit_raw.json DataAttributesTest2 commit_raw.json DataComponentFragmentTest commit_raw.json DebouncedInput commit_raw.json DefaultHomepage commit_raw.json Draft-0-fork commit_raw.json Draft-0 commit_raw.json ExploreWidgets commit_raw.json FeaturedComponents commit_raw.json Feed.Post commit_raw.json Feed commit_raw.json FollowButton commit_raw.json FollowerHeightList commit_raw.json FollowersList commit_raw.json FollowingList commit_raw.json FooBarBaz commit_raw.json Foobar commit_raw.json GetInvolved commit_raw.json GlobalSearch commit_raw.json GlobalSearchPage commit_raw.json HelloWorld commit_raw.json HelloWorld100 commit_raw.json HelloWorld101 commit_raw.json HelloWorld102 commit_raw.json HelloWorld103 commit_raw.json HelloWorld123 commit_raw.json HelloWorld345 commit_raw.json HelloWorld789 commit_raw.json HomePage commit_raw.json Homepage commit_raw.json IframeResizerTest commit_raw.json ImageViewer360 commit_raw.json KeyLoggerTest commit_raw.json KeyLoggerTestChild commit_raw.json LatestActivity commit_raw.json LatestApplications commit_raw.json LatestApps commit_raw.json LatestComponents commit_raw.json LatestFollowActivity commit_raw.json LatestNews commit_raw.json LatestPeople commit_raw.json LikeButton commit_raw.json MarkdownDescriptionEditor commit_raw.json Message commit_raw.json NFTCollection commit_raw.json NestedSimple commit_raw.json Notification commit_raw.json NotificationButton commit_raw.json NotificationsPage commit_raw.json People commit_raw.json PeoplePage commit_raw.json PokeButton commit_raw.json PostFeed commit_raw.json PostPage commit_raw.json Posts.Compose commit_raw.json Posts.ComposeComment commit_raw.json Posts.Create commit_raw.json Posts.Feed commit_raw.json Posts.Post commit_raw.json Posts commit_raw.json ProfileEditor commit_raw.json ProfilePage.Sidebar commit_raw.json ProfilePage commit_raw.json ProfileSearch commit_raw.json ProfileTabs commit_raw.json RadixAccordionTest commit_raw.json RadixAlertDialogTest commit_raw.json RadixAlertDialogTest2 commit_raw.json RadixAlertDialogTest3 commit_raw.json RadixAspectRatioTest commit_raw.json RadixAvatarTest commit_raw.json RadixCheckboxTest commit_raw.json RadixCollapsibleTest commit_raw.json RadixContextMenuTest commit_raw.json RadixDialogTest commit_raw.json RadixDropdownMenuTest commit_raw.json RadixFunctionTest commit_raw.json RadixHoverCardTest commit_raw.json RadixLabelTest commit_raw.json RadixMenubarTest commit_raw.json RadixPopoverTest commit_raw.json RadixRadioGroupTest commit_raw.json RadixScrollAreaTest commit_raw.json RadixSelectTest commit_raw.json RadixSeparatorTest commit_raw.json RadixSliderTest commit_raw.json RadixSwitchTest commit_raw.json RadixTabsTest commit_raw.json RadixToastTest commit_raw.json RadixToggleGroupTest commit_raw.json RadixToggleTest commit_raw.json RadixToolbarTest commit_raw.json RadixTooltipTest commit_raw.json ReviewFollowerHeights commit_raw.json RootIconLinks commit_raw.json SetHeightForm commit_raw.json Simple commit_raw.json SocialHomepage commit_raw.json SocialMarkdown commit_raw.json TagTest commit_raw.json Tags commit_raw.json TestButton commit_raw.json TestButtonFunky commit_raw.json TestButtonSimple commit_raw.json Theme commit_raw.json Untitled-0 commit_raw.json UserHeightDisplay commit_raw.json VSC-EXT-1 commit_raw.json WidgetSrcTest commit_raw.json vsc-ext-1 commit_raw.json vsc-test-1 commit_raw.json waitList commit_raw.json calmxyz.near NEARWEEKNews commit_raw.json cameron_banyan.near HelloWorld commit_raw.json carina.akaia.near AkaiaGenesisDAO commit_raw.json ChangeNOW commit_raw.json DAO.Proposals commit_raw.json DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json Ideas commit_raw.json Post commit_raw.json Vibes.DAO.main commit_raw.json app commit_raw.json core.lib.url commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.page.about commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.contribute commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json gigs-board.components.atom.button commit_raw.json gigs-board.components.atom.icon commit_raw.json gigs-board.components.atom.spinner commit_raw.json gigs-board.components.atom.tag commit_raw.json gigs-board.components.atom.toggle commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.layout.Page commit_raw.json gigs-board.components.layout.app-header commit_raw.json gigs-board.components.molecule.breadcrumbs commit_raw.json gigs-board.components.molecule.button-switch commit_raw.json gigs-board.components.molecule.button commit_raw.json gigs-board.components.molecule.markdown-editor commit_raw.json gigs-board.components.molecule.markdown-viewer commit_raw.json gigs-board.components.molecule.profile-card commit_raw.json gigs-board.components.molecule.text-input commit_raw.json gigs-board.components.molecule.tile commit_raw.json gigs-board.components.organism.app-header commit_raw.json gigs-board.components.organism.configurator commit_raw.json gigs-board.components.organism.editor commit_raw.json gigs-board.components.template.app-layout commit_raw.json gigs-board.components.template.community-page commit_raw.json gigs-board.entity.community.branding-configurator commit_raw.json gigs-board.entity.community.card commit_raw.json gigs-board.entity.community.configurator commit_raw.json gigs-board.entity.community.header commit_raw.json gigs-board.entity.community.layout commit_raw.json gigs-board.entity.community.sidebar commit_raw.json gigs-board.entity.community.spawner commit_raw.json gigs-board.entity.post.CompactPost commit_raw.json gigs-board.entity.post.History commit_raw.json gigs-board.entity.post.List commit_raw.json gigs-board.entity.post.Post commit_raw.json gigs-board.entity.post.PostEditor commit_raw.json gigs-board.entity.project.card commit_raw.json gigs-board.entity.project.github-ticket commit_raw.json gigs-board.entity.project.github-view commit_raw.json gigs-board.entity.project.kanban-view commit_raw.json gigs-board.entity.project.layout commit_raw.json gigs-board.entity.project.post-ticket commit_raw.json gigs-board.entity.team-board.github-kanban commit_raw.json gigs-board.entity.team-board.github-ticket commit_raw.json gigs-board.entity.team-board.kanban commit_raw.json gigs-board.entity.team.LabelsPermissions commit_raw.json gigs-board.entity.team.TeamInfo commit_raw.json gigs-board.entity.workspace.card commit_raw.json gigs-board.entity.workspace.github-ticket commit_raw.json gigs-board.entity.workspace.github-view commit_raw.json gigs-board.entity.workspace.kanban-view commit_raw.json gigs-board.entity.workspace.layout commit_raw.json gigs-board.entity.workspace.post-ticket commit_raw.json gigs-board.entity.workspace.view.github.configurator commit_raw.json gigs-board.entity.workspace.view.github.kanban-board commit_raw.json gigs-board.entity.workspace.view.github.kanban-ticket commit_raw.json gigs-board.entity.workspace.view.github.kanban_board commit_raw.json gigs-board.entity.workspace.view.github.kanban_ticket commit_raw.json gigs-board.entity.workspace.view.kanban.configurator commit_raw.json gigs-board.entity.workspace.view.kanban.post-board commit_raw.json gigs-board.entity.workspace.view.kanban.post-ticket commit_raw.json gigs-board.entity.workspace.view.kanban.post_board commit_raw.json gigs-board.entity.workspace.view.kanban.post_ticket commit_raw.json gigs-board.entity.workspace.view.layout commit_raw.json gigs-board.feature.community-editor.branding-section commit_raw.json gigs-board.feature.community-editor.ui commit_raw.json gigs-board.feature.community.branding-configurator commit_raw.json gigs-board.feature.community.branding-editor commit_raw.json gigs-board.feature.community.configurator commit_raw.json gigs-board.feature.community.creator commit_raw.json gigs-board.feature.community.editor commit_raw.json gigs-board.feature.github-integration.kanban-board-editor commit_raw.json gigs-board.feature.post-search.by-tag commit_raw.json gigs-board.feature.project.configurator commit_raw.json gigs-board.feature.project.github-view-configurator commit_raw.json gigs-board.feature.project.view-configurator commit_raw.json gigs-board.feature.workspace.configurator commit_raw.json gigs-board.feature.workspace.github-view-configurator commit_raw.json gigs-board.feature.workspace.kanban-view-configurator commit_raw.json gigs-board.feature.workspace.view-configurator commit_raw.json gigs-board.pages.Boards commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Feed commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.admin commit_raw.json gigs-board.pages.communities commit_raw.json gigs-board.pages.community.activity commit_raw.json gigs-board.pages.community.board commit_raw.json gigs-board.pages.community.configuration commit_raw.json gigs-board.pages.community.configure commit_raw.json gigs-board.pages.community.edit-info commit_raw.json gigs-board.pages.community.github commit_raw.json gigs-board.pages.community.new commit_raw.json gigs-board.pages.community.projects commit_raw.json gigs-board.pages.community.sidebar commit_raw.json gigs-board.pages.community.sponsorship commit_raw.json gigs-board.pages.community.teams commit_raw.json gigs-board.pages.community.telegram commit_raw.json gigs-board.pages.community.wiki commit_raw.json gigs-board.pages.community.workspaces commit_raw.json gigs-board.pages.project commit_raw.json gigs-board.pages.workspace commit_raw.json carlosce.near login commit_raw.json carlosdg23.near ejemplo commit_raw.json carlton.near ProjectPage commit_raw.json carolinecrale456.near test commit_raw.json catwiner.near my-test commit_raw.json cavies.near DataProvider commit_raw.json Untitled-0 commit_raw.json deprecated-do-not-use commit_raw.json hamsterpocket-guide commit_raw.json hamsterpocket commit_raw.json cba6aef9646e15224a581a367d8e721ef6fca2afa384138a334b1a063d2334a9 Onboarding.Starter-fork commit_raw.json cc411bd6fe2452454bda180874ca97696c27a8769bf30afb94b1a296e738d8c6 BOSparaIngenieros commit_raw.json ce90f4869315210948fc16fb0440731ca7deb9604d3860dca81d2bafa6ffb74e Everything.Create.Document commit_raw.json Everything.Summary.Document commit_raw.json Everything.View.Document commit_raw.json Everything commit_raw.json ForkThis commit_raw.json cengizhantekin.near weatherApp commit_raw.json cerroavila.near Prueba commit_raw.json home commit_raw.json cesinha667.near MainPage.Common.HideAccount commit_raw.json ch1ch0gz.near MyfirstTest commit_raw.json NFT_Viewer commit_raw.json SafeAccountOverview commit_raw.json SafeCreateAndSignTx commit_raw.json SafeDeployWallet commit_raw.json SafeHeader commit_raw.json WrapUnwrapEth commit_raw.json accountOverview commit_raw.json confirmProposedTxs commit_raw.json createAndSignTx commit_raw.json deploySafe commit_raw.json test commit_raw.json chanbob.near Lido commit_raw.json Lidong commit_raw.json chanon.near 1inch commit_raw.json CCIP commit_raw.json ChainlinkPriceFeed commit_raw.json ChatGPT commit_raw.json Demo commit_raw.json test-hello-world commit_raw.json chaotictempest.near AccountProfileCard commit_raw.json BookSearchPane commit_raw.json BookTile commit_raw.json BooksFeed commit_raw.json ComponentCard commit_raw.json EncryptedImage commit_raw.json Facets commit_raw.json Insights commit_raw.json IpfsFilesEncryptedUpload commit_raw.json NEARBooksMain commit_raw.json NEARBooksTabs commit_raw.json Paginate commit_raw.json Search.Post commit_raw.json Search commit_raw.json SearchDocsCard commit_raw.json SearchPalette commit_raw.json SearchPill commit_raw.json SearchPost commit_raw.json SearchTrendingTerms commit_raw.json Test commit_raw.json Test2 commit_raw.json charfield.near Sudoku commit_raw.json charleslavon.near ActivityPage commit_raw.json ActivityPageMinusExplore commit_raw.json ComponentCollection commit_raw.json LinkTree commit_raw.json Onboarding.Placeholder commit_raw.json Onboarding.Starter commit_raw.json OnlyFriends commit_raw.json ProfilePage commit_raw.json cheddar.near CheddarDrawBoard commit_raw.json chefsale.near BlogEntry commit_raw.json BlogFeed commit_raw.json ProfilePage commit_raw.json ProfileSearch commit_raw.json chess-game.near ChessBoard commit_raw.json ChessGame commit_raw.json ChessGameAi commit_raw.json ChessGameButton commit_raw.json ChessGameChallenge commit_raw.json ChessGameHeader commit_raw.json ChessGameLoading commit_raw.json ChessGameLobby commit_raw.json ChessGameReplay commit_raw.json ChessGameTab.AI commit_raw.json ChessGameTab.Challenge commit_raw.json ChessGameTab.Default commit_raw.json ChessGameTab.Game commit_raw.json ChessGameTab.Overview commit_raw.json ChessGameTab.Replay commit_raw.json Common.Layout.Header commit_raw.json DiscordIcon commit_raw.json GithubIcon commit_raw.json MagicBuilder-widget-form-1697002408180 commit_raw.json Notification.Item.ChessGame commit_raw.json Notification.Item commit_raw.json ProfileIcon commit_raw.json TwitterIcon commit_raw.json chirality.near NounishKZG.Lobby commit_raw.json NounishKZG.Splash commit_raw.json NounishKZG commit_raw.json chloe.near ArrayTools commit_raw.json AvatarCreation commit_raw.json BAC-Inc commit_raw.json BlockHeightDisplay commit_raw.json CH commit_raw.json ChatV2.chloe commit_raw.json CompressionCommon commit_raw.json DAO.Layout.Sidebar.marmaj commit_raw.json DAO.Page.Editor commit_raw.json DAO.Page.Sidebar.marmaj commit_raw.json DAO.Page.Sidebar commit_raw.json DAO.Page.marma commit_raw.json DAO.Page.marmaj.old commit_raw.json DAO.Page.marmaj commit_raw.json DAO.Page commit_raw.json DAO.Social.NRC.all commit_raw.json DAO.Social.Post commit_raw.json DAO.Social commit_raw.json IAH-account-verifier.OG commit_raw.json IAH-account-verifier commit_raw.json Index commit_raw.json LZUTF8Decompressor commit_raw.json Leaderboard commit_raw.json MJG-PixelParty commit_raw.json MJG commit_raw.json Marma-J-Labs commit_raw.json MyPageEditor commit_raw.json NRC.DAO.main commit_raw.json OG.DAO.Page commit_raw.json ProfileEditor.MJG commit_raw.json ProfileEditor.NRC commit_raw.json ProfileEditor.marmaj commit_raw.json ProfileEditor commit_raw.json ProfilePage.marmaj commit_raw.json ProfilePage commit_raw.json ReFi.DAO.main.chloe-fork commit_raw.json SingleGroupMembers commit_raw.json Slides commit_raw.json UTF8Decoder commit_raw.json Upvote commit_raw.json Welcome commit_raw.json Wtf commit_raw.json blockheight commit_raw.json brokenlol commit_raw.json brokennnnlol commit_raw.json dao.create.post.mjg commit_raw.json dao.create.post.nrc commit_raw.json dao.create.post.og commit_raw.json dao.create.post commit_raw.json iframe-ppets commit_raw.json iframe commit_raw.json lotion commit_raw.json marmaj-dao commit_raw.json marmajforever commit_raw.json minsta commit_raw.json nft-marketplace commit_raw.json piglet-polygon commit_raw.json piglet commit_raw.json pixelparty commit_raw.json playground commit_raw.json post-to-dao commit_raw.json tpp commit_raw.json chomii.near Untitled-0 commit_raw.json chomtana-bos.near apestate.swap commit_raw.json No Open Positions chris-x.near AirStorage commit_raw.json Untitled-0 commit_raw.json WidgetComponent commit_raw.json signMessage commit_raw.json ciencia.near Common.Compose commit_raw.json Kudos commit_raw.json Profile commit_raw.json allVotingWidget commit_raw.json answer_poll-comment-container commit_raw.json answersHeader commit_raw.json displayQuestionHeader commit_raw.json minimalistQuestionGeneralInfo commit_raw.json minimalistQuestionHeader commit_raw.json newMiniMultipleChoiceInterface commit_raw.json newPollQuestionInterface commit_raw.json newTextAnswerInterface commit_raw.json newVotingInterface commit_raw.json pollQuestionMasterHandler commit_raw.json questionsByCreator commit_raw.json shareWidget commit_raw.json showQuestionsHandler commit_raw.json voteMultipleChoice commit_raw.json voteWithText commit_raw.json Humanity check * \r\n ** Check if is human. 1: Unknown, 2: Yes, 3: No, but can retry, 4: No * \r\nfunction userIsHuman(reQuery) {\r\n if (!reQuery) {\r\n if (state.HumanityStatus == undefined) return userIsHuman(true);\r\n else return state.HumanityStatus;\r\n }\r\n\r\n * for testing - _intent must be added to State.init({ ... });\r\n let url = \"\";\r\n console.log(\"Intent: \" + state._intent);\r\n switch (state._intent) {\r\n case 0:\r\n ROJO - REINTENTAR\r\n url = \"https: api.nearsocialwidgets.com status?id=test2\";\r\n break;\r\n case 1:\r\n EMPEZO y no termin\u00f3 el proceso\r\n url = \"https: api.nearsocialwidgets.com status?id=test22\";\r\n break;\r\n case 4:\r\n ROJO\r\n url = \"https: api.nearsocialwidgets.com status?id=test24\";\r\n break;\r\n case 2:\r\n NUNCA EMPEZO\r\n url = \"https: api.nearsocialwidgets.com status?id=test26\";\r\n break;\r\n case 3:\r\n VERDE\r\n url = \"https: api.nearsocialwidgets.com status?id=silkking.testnet\";\r\n break;\r\n }\r\n\r\n state._intent++;\r\n* \r\n const url =\r\n \"https: api.nearsocialwidgets.com status?id=\" + context.accountId;\r\n const response = fetch(url);\r\n\r\n if (response.status != 200) {\r\n alert(\"Can't connect to verification API. Please try again\");\r\n return;\r\n }\r\n const obj = response.body;\r\n console.log(obj);\r\n var result = 1;\r\n if (obj.body.code != 404) {\r\n if (obj.review.reviewResult.reviewAnswer == \"GREEN\") result = 2;\r\n else if (obj.review.reviewResult.reviewAnswer == \"RED\") {\r\n if (obj.review.reviewResult.reviewRejectType == \"FINAL\") result = 4;\r\n if (obj.review.reviewResult.reviewRejectType == \"RETRY\") result = 3;\r\n }\r\n }\r\n\r\n console.log(\"isHuman: \" + result);\r\n\r\n State.update({ HumanityStatus: result });\r\n\r\n return result;\r\n}\r\n\r\nconst proveYoureHumanButton = () => {\r\n return (\r\n <div>\r\n {state.HumanityStatus == 1 ? (\r\n <p style={{ textAlign: \"center\" }} className=\"alert alert-info\">\r\n Humanity not verified\r\n < p>\r\n ) : state.HumanityStatus == 2 ? (\r\n \"\"\r\n ) : state.HumanityStatus == 3 ? (\r\n <p style={{ textAlign: \"center\" }} className=\"alert alert-info\">\r\n Humanity check failed. Please try again\r\n < p>\r\n ) : (\r\n <p style={{ textAlign: \"center\" }} className=\"alert alert-danger\">\r\n Humanity check failed. You can't continue\r\n < p>\r\n )}\r\n {state.HumanityStatus < 4 ? (\r\n <>\r\n <div style={{ textAlign: \"center\" }}>\r\n <a\r\n href={\"https: nearsocialwidgets.com?id=\" + context.accountId}\r\n target=\"_blank\"\r\n onClick={() => showCheckHumanModal()}\r\n >\r\n <button>Click here to prove you are human< button>\r\n < a>\r\n < div>\r\n < >\r\n ) : (\r\n \"\"\r\n )}\r\n < div>\r\n );\r\n};\r\n\r\nconst showCheckHumanModal = () => {\r\n State.update({ HumanityModal: \"show\" });\r\n};\r\n\r\nconst closeCheckHumanModal = () => {\r\n State.update({ HumanityModal: \"hide\" });\r\n userIsHuman(true);\r\n};\r\n\r\nconst renderCheckHumanModal = () => {\r\n return state.HumanityModal == \"show\" ? (\r\n <>\r\n <div\r\n className=\"modal\"\r\n id=\"modal\"\r\n style={{\r\n display: \"block\",\r\n justifyContent: \"center\",\r\n alignItems: \"center\",\r\n backgroundColor: \"#7e7e7e70\",\r\n backdropFilter: \"blur(4px)\",\r\n }}\r\n tabindex=\"-1\"\r\n role=\"dialog\"\r\n >\r\n <div\r\n className=\"modal-dialog\"\r\n style={{ width: \"540px\", borderRadius: \"28px\" }}\r\n role=\"document\"\r\n >\r\n <div\r\n className=\"modal-content\"\r\n style={{ border: \"none\", borderRadius: \"28px\" }}\r\n >\r\n <div\r\n className=\"modal-header flex-row-reverse\"\r\n style={{ padding: \"0\", margin: \"0\", border: \"none\" }}\r\n >\r\n <button\r\n type=\"button\"\r\n className=\"close\"\r\n style={{\r\n border: \"none\",\r\n backgroundColor: \"transparent\",\r\n margin: \"0.5rem 0.5rem 0px 0px\",\r\n borderRadius: \"28px\",\r\n marginRight: \"0.3rem\",\r\n padding: \"0.3rem 0.7rem 0 0\",\r\n }}\r\n data-bs-dismiss=\"modal\"\r\n ariaLabel=\"Close\"\r\n onClick={() => closeCheckHumanModal()}\r\n >\r\n <i className=\"bi bi-x-lg\">< i>\r\n < button>\r\n < div>\r\n <div\r\n className=\"modal-body\"\r\n style={{\r\n width: \"90%\",\r\n borderRadius: \"1rem\",\r\n margin: \"0 auto\",\r\n padding: \"0\",\r\n }}\r\n >\r\n <h3\r\n style={{\r\n fontWeight: \"700\",\r\n fontSize: \"1.5rem\",\r\n letterSpacing: \"0.1px\",\r\n textAlign: \"center\",\r\n }}\r\n >\r\n Humanity check pending...\r\n < h3>\r\n <p\r\n style={{\r\n letterSpacing: \"-0.01\",\r\n color: \"#4B516A\",\r\n fontSize: \"1rem\",\r\n textAlign: \"center\",\r\n }}\r\n >\r\n Close this once you completed the humanity check process\r\n < p>\r\n <div\r\n style={{\r\n justifyContent: \"center\",\r\n alignItems: \"center\",\r\n textAlign: \"center\",\r\n }}\r\n >\r\n <button\r\n type=\"button\"\r\n data-bs-dismiss=\"modal\"\r\n ariaLabel=\"Close\"\r\n onClick={() => closeCheckHumanModal()}\r\n >\r\n Close\r\n < button>\r\n < div>\r\n < div>\r\n <div\r\n className=\"modal-footer\"\r\n style={{ border: \"none\", justifyContent: \"space-around\" }}\r\n >< div>\r\n < div>\r\n < div>\r\n < div>\r\n < >\r\n ) : (\r\n \"\"\r\n );\r\n};\r\n\r\n * ciocan.near Arbitrum.All-in-one commit_raw.json Burrow.Data commit_raw.json Draft-1 commit_raw.json account-signin commit_raw.json ape-stake commit_raw.json base-bridge-transactions-list commit_raw.json bos-showcase-content commit_raw.json bos-showcase-disclaimer commit_raw.json bos-showcase commit_raw.json bridge-ui-old commit_raw.json bridge-ui commit_raw.json burrow-borrow commit_raw.json burrow-data commit_raw.json burrow-deposit commit_raw.json burrow-list commit_raw.json burrow-portfolio commit_raw.json burrow-repay commit_raw.json burrow-rewards commit_raw.json burrow commit_raw.json hello-world commit_raw.json hello commit_raw.json op-bridge-demo commit_raw.json op-bridge-list-deposits commit_raw.json op-bridge-list-withdrawals commit_raw.json op-bridge-list commit_raw.json op-stack-bridge-ui commit_raw.json op-stack-list-deposits commit_raw.json op-stack-mantle-bridge commit_raw.json op-stack-module commit_raw.json optimism-bridge-transactions-list commit_raw.json toast commit_raw.json zk-bridge commit_raw.json zkevm-bridge-transactions commit_raw.json zkevm-bridge-ui commit_raw.json zkevm-bridge commit_raw.json zkevm commit_raw.json ciuz.near Bosense.Common.Card.PublisherCard commit_raw.json Bosense.Common.Card.StatCard commit_raw.json Bosense.Common.Layout.index commit_raw.json ImageUploader commit_raw.json Untitled-0 commit_raw.json cizi31.near Turkiye.Reward commit_raw.json classicoder.near NearHausaFoooter commit_raw.json coatyworld.near CoatyWorld commit_raw.json codedforum.near CDFM commit_raw.json coineasydao.near CoinEasy! commit_raw.json CoinEasy commit_raw.json GM commit_raw.json ProfilePage commit_raw.json Support CoinEasy! commit_raw.json coinstoday.near ComponentDetailsPage commit_raw.json cointesla10.near cointesla10.near_4ebf8721-b562-4cfc-ad7d-a3d223d56bd2 commit_raw.json coldy.near LNCLatestGuides commit_raw.json LNCProofOfLearn commit_raw.json LNCProofOfLearnBalance commit_raw.json LNCProofOfLearnsChecker commit_raw.json LNCRecomendedGuides commit_raw.json LinkTreeEditor commit_raw.json NEARWEEKNews commit_raw.json Profile commit_raw.json bugey-demo commit_raw.json nCaptcha commit_raw.json simple-profile commit_raw.json socials commit_raw.json comicbooks.near AddImage commit_raw.json commonterms.near app commit_raw.json components.Navbar commit_raw.json components commit_raw.json page.end commit_raw.json page.home commit_raw.json page.new commit_raw.json page.view commit_raw.json template.AppLayout commit_raw.json template.SidebarLayout commit_raw.json communityevent.near city commit_raw.json city_list commit_raw.json community_event commit_raw.json vote commit_raw.json vote_count commit_raw.json communityvoice.ndctools.near CommunityVoice.AddComment commit_raw.json CommunityVoice.AllArticlesList commit_raw.json CommunityVoice.ArticleView commit_raw.json CommunityVoice.Create commit_raw.json CommunityVoice.GeneralCard commit_raw.json CommunityVoice.Reactions commit_raw.json CommunityVoice.UpVoteButton commit_raw.json CommunityVoice commit_raw.json NDC.AddComment commit_raw.json NDC.AllArticlesSortByAuthors commit_raw.json NDC.ArticleHistory.Container commit_raw.json NDC.ArticleHistory.Handler commit_raw.json NDC.ArticleHistory.SecondContainer commit_raw.json NDC.ArticleView commit_raw.json NDC.ArticlesByAuthorCard commit_raw.json NDC.CommentView commit_raw.json NDC.CompactPost commit_raw.json NDC.Forum.AllArticlesList commit_raw.json NDC.Forum.Create commit_raw.json NDC.Forum commit_raw.json NDC.GeneralCard commit_raw.json NDC.NavBar commit_raw.json NDC.Reactions commit_raw.json NDC.UpVoteButton commit_raw.json Profile.ShortInlineBlock commit_raw.json Provider commit_raw.json TagsEditor commit_raw.json config.CommunityVoice commit_raw.json home commit_raw.json lib.Communities commit_raw.json lib.SBT commit_raw.json lib.article commit_raw.json lib.categories commit_raw.json lib.comment commit_raw.json lib.errorParser commit_raw.json lib.metadata commit_raw.json lib.normalization commit_raw.json lib.notifications commit_raw.json lib.reactions commit_raw.json lib.socialDbIndex commit_raw.json lib.socialIndex commit_raw.json lib.strings commit_raw.json lib.upVotes commit_raw.json pages.feed.comment commit_raw.json pages.feed.comments commit_raw.json pages.feed.index commit_raw.json pages.feed.post commit_raw.json Init\nconst isDev = true;\nconst { widget } = props;\n\n Main\nconst Post = {\n get: (author, blockHeight, dataKey) => {\n return JSON.parse(\n Social.get(\n `${author} ${dataKey ?? Config.postDataKey} main`,\n blockHeight,\n {\n subscribe: false,\n },\n ) ?? \"null\",\n );\n },\n getLikes: (author, blockHeight, dataKey) => {\n const likesArray = Social.index(\n Config.likeKey,\n {\n type: \"social\",\n blockHeight: blockHeight,\n path: `${author} ${dataKey ?? Config.postDataKey} main`,\n },\n {\n subscribe: false,\n },\n );\n if (likesArray === null) return null;\n const likesByUsers = {};\n (likesArray || []).forEach((like) => {\n if (like.value.type === \"like\") {\n likesByUsers[like.accountId] = like;\n } else if (like.value.type === \"unlike\") {\n delete likesByUsers[like.accountId];\n }\n });\n return likesByUsers;\n },\n getReactions: (author, blockHeight, dataKey) => {\n const reactionsArray = Social.index(\n Config.reactKey,\n {\n type: \"social\",\n blockHeight: blockHeight,\n path: `${author} ${dataKey ?? Config.postDataKey} main`,\n },\n {\n subscribe: false,\n },\n );\n if (reactionsArray === null) return null;\n const reactionsByUsers = {};\n (reactionsArray || []).forEach((reaction) => {\n if (reaction.value.type === \"null\") {\n delete reactionsByUsers[like.accountId];\n } else {\n reactionsByUsers[reaction.accountId] = reaction.value.type;\n }\n });\n return reactionsByUsers;\n },\n\n create: (post, onCommit, onCancel, onError) => {\n const error = Helpers.post.validate(post);\n if (error !== null) {\n return onError(error);\n }\n const commit = Helpers.post.prepare(post);\n Social.set(commit, { force: true, onCommit, onCancel });\n },\n like: (\n { postAuthor, postBlockHeight, dataKey },\n unlike,\n onCommit,\n onCancel,\n ) => {\n const postItem = {\n type: \"social\", TODO: IDK if this should be changed\n blockHeight: postBlockHeight,\n path: `${postAuthor} ${dataKey ?? Config.postDataKey} main`,\n };\n const commit = {\n index: {\n [Config.likeKey]: JSON.stringify({\n key: postItem,\n value: {\n type: unlike ? \"unlike\" : \"like\",\n },\n }),\n [Config.notifyKey]: JSON.stringify({\n key: postAuthor,\n value: {\n type: unlike ? \"unlike\" : \"like\",\n item: postItem,\n },\n }),\n },\n };\n Social.set(commit, { force: true, onCommit, onCancel });\n },\n react: (\n { postAuthor, postBlockHeight, dataKey },\n reaction,\n onCommit,\n onCancel,\n ) => {\n const postItem = {\n type: \"social\", TODO: IDK if this should be changed\n blockHeight: postBlockHeight,\n path: `${postAuthor} ${dataKey ?? Config.postDataKey} main`,\n };\n const commit = {\n index: {\n [Config.reactKey]: JSON.stringify({\n key: postItem,\n value: {\n type: reaction ? reaction : \"null\",\n },\n }),\n },\n };\n\n if (reaction) {\n commit.index[Config.notifyKey] = JSON.stringify({\n key: postAuthor,\n value: {\n type: reaction ? reaction : \"null\",\n item: postItem,\n },\n });\n }\n\n Social.set(commit, { force: true, onCommit, onCancel });\n },\n comment: (\n comment,\n postAuthor,\n postBlockHeight,\n onCommit,\n onCancel,\n onError,\n ) => {\n const error = Helpers.post.validate(comment);\n if (error !== null) {\n return onError(error);\n }\n const commit = Helpers.post.prepareComment(\n comment,\n postAuthor,\n postBlockHeight,\n );\n Social.set(commit, { force: true, onCommit, onCancel });\n },\n};\n\nconst Config = {\n postDataKey: isDev ? \"voice-dev\" : \"voice\",\n commentDataKey: isDev ? \"echo-dev\" : \"echo\",\n postTypes: [\"md\"],\n likeKey: \"like\",\n reactKey: \"react\",\n notifyKey: \"notify\",\n version: \"0\" + (isDev ? \".alpha\" : \"\"),\n SBTRegistry: \"registry.i-am-human.near\",\n};\n\n components-mailchain.near MailchainWidget commit_raw.json ProfileLarge commit_raw.json connectamey.near Applications commit_raw.json Chatbot.iFrame commit_raw.json Everything-fork commit_raw.json Everything.Create.Document commit_raw.json Everything.Create.Summary commit_raw.json Everything.Create.view commit_raw.json Everything.Summary.Document commit_raw.json Everything.Summary.Idea commit_raw.json Everything.Summary.Summary commit_raw.json Everything.Summary.view commit_raw.json Everything.View.Document commit_raw.json Everything.View.Summary commit_raw.json Everything.View.view commit_raw.json ForkThis-fork-fork commit_raw.json ForkThis commit_raw.json Greeter commit_raw.json New_Widget_Filter commit_raw.json WidgetIcons commit_raw.json constantinsundukov.tg ProfilePage commit_raw.json contesty.near NftVotingLeaderboard commit_raw.json context-ctx.near Smartdoc.AlertDialog commit_raw.json Smartdoc.ContextInfo commit_raw.json Smartdoc.Form commit_raw.json Smartdoc.MainGroupMenu commit_raw.json Smartdoc.MySchemas commit_raw.json Smartdoc.SchemasMenu commit_raw.json Smartdoc.app commit_raw.json contractwizard.near CodeGenerator commit_raw.json ContractWizardUI commit_raw.json contribut3.near ActiveIndicator commit_raw.json Admin.Applications commit_raw.json Admin.Backers commit_raw.json Admin.Claims commit_raw.json Admin.Completion commit_raw.json Admin.CompletionCard commit_raw.json Admin.Page commit_raw.json Admin.Vendors commit_raw.json AdminEntityAccountIdInput commit_raw.json AdminList commit_raw.json Application.AdminCard commit_raw.json Application.AdminList commit_raw.json Application.DetailPage commit_raw.json Application.Details commit_raw.json Application.List commit_raw.json Application.Page commit_raw.json Application.PartnerCard commit_raw.json Application.Sidebar commit_raw.json Badge commit_raw.json BadgeList commit_raw.json Banner.AwesomeNEAR commit_raw.json Buttons.CreateProfile commit_raw.json Buttons.Green commit_raw.json Buttons.Grey commit_raw.json Buttons.Onboard commit_raw.json Buttons.Red commit_raw.json Card commit_raw.json CardMenu commit_raw.json Claim.Card commit_raw.json Contribution.About commit_raw.json Contribution.ActionForm commit_raw.json Contribution.ActionSideWindow commit_raw.json Contribution.Activity commit_raw.json Contribution.AdminCard commit_raw.json Contribution.AdminList commit_raw.json Contribution.Card commit_raw.json Contribution.Details commit_raw.json Contribution.Feedback commit_raw.json Contribution.Line commit_raw.json Contribution.List commit_raw.json Contribution.Page commit_raw.json Contribution.ProjectList commit_raw.json Contribution.Sidebar commit_raw.json Contribution.VendorList commit_raw.json Contribution commit_raw.json ContributionDetail commit_raw.json ContributionForm commit_raw.json ContributionList commit_raw.json ContributionPage commit_raw.json ContributionRequest commit_raw.json ContributionRequestForm commit_raw.json ContributionRequestList commit_raw.json ContributionTypeInput commit_raw.json ContributionsPage commit_raw.json Contributor commit_raw.json ContributorForm commit_raw.json ContributorList commit_raw.json CotributorForm commit_raw.json CreateNewInput commit_raw.json CreatePage commit_raw.json CreateServiceRequest commit_raw.json CreateServiceRequest_Step1 commit_raw.json Credit.ApplyForm commit_raw.json Credit.ApplySideWindow commit_raw.json Dashboard commit_raw.json DateInput commit_raw.json DescriptionArea commit_raw.json DescriptionInput commit_raw.json Entity commit_raw.json EntityForm commit_raw.json EntityList commit_raw.json EntityOneLineProfile commit_raw.json EntityPage commit_raw.json EntityTypeInput commit_raw.json Events.Page commit_raw.json FAQ.Page commit_raw.json Filter commit_raw.json HZN.Ask commit_raw.json HZN.Benefits commit_raw.json HZN.Comprehensive commit_raw.json HZN.FAQ commit_raw.json HZN.Hero commit_raw.json HZN.Join commit_raw.json HZN.Journey commit_raw.json HZN.Logo commit_raw.json HZN.Page commit_raw.json HZN.Structure commit_raw.json HZN.Testamonial commit_raw.json HZN.What commit_raw.json HZN.Who commit_raw.json Header commit_raw.json Help.FeedbackButton commit_raw.json Help.Page commit_raw.json Home.HowSection commit_raw.json Home.ListSection commit_raw.json HomePage commit_raw.json IconList commit_raw.json Icons.Org commit_raw.json Inbox commit_raw.json Index commit_raw.json InfoSegment commit_raw.json Inputs.AccountId commit_raw.json Inputs.Admins commit_raw.json Inputs.Category commit_raw.json Inputs.Checkbox commit_raw.json Inputs.Date commit_raw.json Inputs.Distribution commit_raw.json Inputs.File commit_raw.json Inputs.Filters.Inner commit_raw.json Inputs.Filters commit_raw.json Inputs.Founder commit_raw.json Inputs.Founders commit_raw.json Inputs.Integration commit_raw.json Inputs.LabeledData commit_raw.json Inputs.MultiSelect commit_raw.json Inputs.Number commit_raw.json Inputs.Phase commit_raw.json Inputs.PrivateDataIframe commit_raw.json Inputs.PrivateText commit_raw.json Inputs.RadioGroup commit_raw.json Inputs.Select commit_raw.json Inputs.SetUpPermissions commit_raw.json Inputs.Social commit_raw.json Inputs.Team commit_raw.json Inputs.TeamMember commit_raw.json Inputs.Text commit_raw.json Inputs.TextArea commit_raw.json Inputs.Toggle commit_raw.json Inputs.Viewable.AccountId commit_raw.json Inputs.Viewable.Category commit_raw.json Inputs.Viewable.Date commit_raw.json Inputs.Viewable.Distribution commit_raw.json Inputs.Viewable.Integration commit_raw.json Inputs.Viewable.Links commit_raw.json Inputs.Viewable.Logo commit_raw.json Inputs.Viewable.MultiSelect commit_raw.json Inputs.Viewable.NameAndAccount commit_raw.json Inputs.Viewable.Number commit_raw.json Inputs.Viewable.OneLiner commit_raw.json Inputs.Viewable.Phase commit_raw.json Inputs.Viewable.PrivateText commit_raw.json Inputs.Viewable.ProductType commit_raw.json Inputs.Viewable.Select commit_raw.json Inputs.Viewable.Tags commit_raw.json Inputs.Viewable.Text commit_raw.json Inputs.Viewable.TextArea commit_raw.json Inputs.Viewable.Title commit_raw.json Inputs.Viewable.Toggle commit_raw.json Inputs.Viewable.Verticals commit_raw.json Inputs.Viewable commit_raw.json Investor.About commit_raw.json Investor.Card commit_raw.json Investor.Details commit_raw.json Investor.Form commit_raw.json Investor.HeaderDetails commit_raw.json Investor.List commit_raw.json Investor.ListPage commit_raw.json Investor.ListSection commit_raw.json Investor.Page commit_raw.json Investor.Progress commit_raw.json Investor.Sidebar commit_raw.json Invite commit_raw.json InviteForm commit_raw.json InviteList commit_raw.json Invites.AdminCard commit_raw.json Invites.AdminList commit_raw.json IpfsFilesUpload commit_raw.json Landing.About commit_raw.json Landing.Backers commit_raw.json Landing.Build commit_raw.json Landing.Connect commit_raw.json Landing.Contributors commit_raw.json Landing.Footer commit_raw.json Landing.Grow commit_raw.json Landing.Hero commit_raw.json Landing.Links commit_raw.json Landing.Nav commit_raw.json Landing.Partners commit_raw.json Landing.Support commit_raw.json Landing.Testamonial commit_raw.json Layout.Fetcher commit_raw.json Layout.ListPage commit_raw.json Layout.ListSection commit_raw.json Learn.Card commit_raw.json Learn.Page commit_raw.json List commit_raw.json Logo commit_raw.json Manage.Applications commit_raw.json Manage.Contracts commit_raw.json Manage.Projects commit_raw.json Manage.Requests commit_raw.json Manage commit_raw.json ManageEntities commit_raw.json Modal commit_raw.json ModeratorAccountIdInput commit_raw.json ModeratorEntityForm commit_raw.json ModeratorSetForm commit_raw.json Module commit_raw.json NameAndAccount commit_raw.json NameInput commit_raw.json NavbarControl commit_raw.json Need commit_raw.json NeedForm commit_raw.json NeedList commit_raw.json NeedPage commit_raw.json Notification.Feedback commit_raw.json Notification.Index commit_raw.json Notification.Project.Contract commit_raw.json Notification.Project.Invite commit_raw.json Notification.Project.Proposal commit_raw.json Notification.Vendor.Contract commit_raw.json Notification.Vendor.RequestProposal commit_raw.json Onboarding.Page commit_raw.json PageTitle commit_raw.json Partner.Card commit_raw.json Partner.List commit_raw.json PaymentSourceInput commit_raw.json PaymentTypeInput commit_raw.json Perks.Card commit_raw.json Perks.Categories commit_raw.json Perks.CategoriesInner commit_raw.json Perks.Page commit_raw.json Profile.Basic commit_raw.json Profile.BasicForm commit_raw.json Profile.Checklist commit_raw.json Profile.Contracts commit_raw.json Profile.Credits.Activity commit_raw.json Profile.Credits.How commit_raw.json Profile.Credits.Page commit_raw.json Profile.Credits.Rewards commit_raw.json Profile.Credits commit_raw.json Profile.Dashboard commit_raw.json Profile.DashboardCard commit_raw.json Profile.Files commit_raw.json Profile.Founders commit_raw.json Profile.Fund commit_raw.json Profile.FundForm commit_raw.json Profile.Growth commit_raw.json Profile.HowSection commit_raw.json Profile.Inbox commit_raw.json Profile.Page commit_raw.json Profile.Permissions commit_raw.json Profile.Requests commit_raw.json Profile.Settings commit_raw.json Profile.Tech commit_raw.json Profile.TechForm commit_raw.json Profile commit_raw.json ProfileCircle commit_raw.json ProfileLine commit_raw.json Project.About commit_raw.json Project.Achievements commit_raw.json Project.AdminCard commit_raw.json Project.AdminList commit_raw.json Project.Card commit_raw.json Project.ClaimForm commit_raw.json Project.ClaimSideWindow commit_raw.json Project.Details commit_raw.json Project.Documents commit_raw.json Project.Form commit_raw.json Project.HeaderDetails commit_raw.json Project.History commit_raw.json Project.Icon commit_raw.json Project.Layout commit_raw.json Project.Line commit_raw.json Project.List commit_raw.json Project.ListPage commit_raw.json Project.Page commit_raw.json Project.People commit_raw.json Project.Progress commit_raw.json Project.ProjectCard commit_raw.json Project.ProposalForm commit_raw.json Project.ProposeSideWindow commit_raw.json Project.Requests commit_raw.json Project.Sidebar commit_raw.json ProjectCard commit_raw.json Proposal.AdminCard commit_raw.json Proposal.AdminList commit_raw.json Proposal.Card commit_raw.json Proposal.Summary commit_raw.json ProposalsList commit_raw.json Request.About commit_raw.json Request.AdminCard commit_raw.json Request.AdminList commit_raw.json Request.Card commit_raw.json Request.CreateServiceRequest commit_raw.json Request.Details commit_raw.json Request.EditForm commit_raw.json Request.EditSideWindow commit_raw.json Request.Form commit_raw.json Request.HeaderDetails commit_raw.json Request.Line commit_raw.json Request.List commit_raw.json Request.ListPage commit_raw.json Request.ListSection commit_raw.json Request.Page commit_raw.json Request.ProposalList commit_raw.json Request.ProposeForm commit_raw.json Request.ProposeSideWindow commit_raw.json Request.Sidebar commit_raw.json SearchInput commit_raw.json SelectedLine commit_raw.json SideWindow commit_raw.json Sidebar commit_raw.json SocialLinks commit_raw.json Stats.Card commit_raw.json Stats.Link commit_raw.json TNCForm commit_raw.json TNCModal commit_raw.json TNCPage commit_raw.json TabSelector commit_raw.json Tags commit_raw.json Tooltip commit_raw.json ValidatedAccountIdInput commit_raw.json Vendor.About commit_raw.json Vendor.AdminCard commit_raw.json Vendor.AdminList commit_raw.json Vendor.Admins commit_raw.json Vendor.Card commit_raw.json Vendor.Contracts commit_raw.json Vendor.Details commit_raw.json Vendor.Form commit_raw.json Vendor.HeaderDetails commit_raw.json Vendor.History commit_raw.json Vendor.Icon commit_raw.json Vendor.InivteForm commit_raw.json Vendor.InviteForm commit_raw.json Vendor.InviteSideWindow commit_raw.json Vendor.Line commit_raw.json Vendor.List commit_raw.json Vendor.ListPage commit_raw.json Vendor.ListSection commit_raw.json Vendor.MessageInput commit_raw.json Vendor.Page commit_raw.json Vendor.Permission.Page commit_raw.json Vendor.Progress commit_raw.json Vendor.RequestForm commit_raw.json Vendor.RequestSideWindow commit_raw.json Vendor.Sidebar commit_raw.json coolmouse.near Draft-0 commit_raw.json KSTNAnvil.Index commit_raw.json KSTNAnvil.Navbar commit_raw.json KSTNAnvil.Proposals.Index commit_raw.json KSTNAnvil.Proposals.Keystone commit_raw.json KSTNAnvil.Signers.Index commit_raw.json KSTNAnvil.Tokens.Index commit_raw.json Keystone.Index commit_raw.json Keystone.Navbar commit_raw.json Keystone.Proposals.Index commit_raw.json Keystone.Proposals.Keystone commit_raw.json Keystone.Proposals.Token commit_raw.json Keystone.Signers.Index commit_raw.json Keystone.Tokens.Index commit_raw.json coriolanus.near Test commit_raw.json corwin-hot.near Draft-0 commit_raw.json corwin.near Test Component commit_raw.json cpassport.near Passport.FrequentFlyers.Main commit_raw.json Passport.History.Main commit_raw.json Passport.Home.Main commit_raw.json Passport.Leaderboard.Main commit_raw.json Passport.Main commit_raw.json Passport.NFTDetails.Main commit_raw.json cr7x.near Buttons.Blue commit_raw.json InfoSegment commit_raw.json Inputs.AccountId commit_raw.json Inputs.Checkbox commit_raw.json Inputs.MultiSelect commit_raw.json Inputs.Text commit_raw.json Navbar commit_raw.json Tester.Form commit_raw.json crowdtest commit_raw.json crans.near CransMinsta commit_raw.json Create.Post.BeatDAO commit_raw.json Create.Post.RisingDAO-fork commit_raw.json Create.Post.VF commit_raw.json Creatives.DAO.Page commit_raw.json DAO.Create.Post.INA commit_raw.json NotificationFeed commit_raw.json PriceOracle.NearPrices commit_raw.json dao.create.post.creatives commit_raw.json minsta commit_raw.json cre8.near Common.Page.Editor commit_raw.json Common.Page commit_raw.json Welcome.RHS.Editor commit_raw.json creamyyoghurt.near LibroDeVisitas commit_raw.json create.near ABC.Featured commit_raw.json ABC.Feed commit_raw.json ABC.Header commit_raw.json ABC.Join commit_raw.json ABC.Main commit_raw.json ABC.Members commit_raw.json ABC.Menu commit_raw.json ABC.Navbar commit_raw.json ABC.Page commit_raw.json ABC.Posts commit_raw.json ABC.Supporters commit_raw.json ABC.pages.Feed commit_raw.json ABC.pages.Post commit_raw.json ABC.pages.Projects commit_raw.json ABC.pages.Teams commit_raw.json ABC.pages.community.Events commit_raw.json ABC.pages.community.Guide commit_raw.json ABC.pages commit_raw.json ABC.widgets.community.Featured commit_raw.json ABC.widgets.community.Header commit_raw.json ABC.widgets.layout.Controls commit_raw.json ABC.widgets.layout.LikeButton.Faces commit_raw.json ABC.widgets.layout.Navbar commit_raw.json ABC.widgets.layout.Page commit_raw.json ABC.widgets.layout.Search commit_raw.json ABC.widgets.posts.List commit_raw.json ABC.widgets.posts.Post commit_raw.json ABC commit_raw.json Builders commit_raw.json Communities commit_raw.json Connect commit_raw.json ConnectionFeed commit_raw.json Custom.Page.Editor commit_raw.json DAO.Followers commit_raw.json DAO.Members commit_raw.json DAO.Proposals commit_raw.json Explore commit_raw.json Featured commit_raw.json Followers commit_raw.json Following commit_raw.json Friends commit_raw.json GitBos.diff commit_raw.json GitBos.explorer commit_raw.json GitBos.fork commit_raw.json GitBos.history commit_raw.json GitBos.update commit_raw.json GitBos commit_raw.json GitHub.API.Auth commit_raw.json GitHub.API.Example commit_raw.json Group commit_raw.json GroupEditor commit_raw.json GroupImage commit_raw.json GroupLine commit_raw.json GroupStats commit_raw.json GroupTabs commit_raw.json Hashtag.Feed commit_raw.json JoinButton commit_raw.json LatestPeople commit_raw.json LatestPosts commit_raw.json Links commit_raw.json MassConnect commit_raw.json MemberBadge commit_raw.json Members commit_raw.json MembershipBadge commit_raw.json MetadataEditor commit_raw.json NEARHubTree commit_raw.json Onboarding.GetInvolved commit_raw.json Onboarding.Notifications commit_raw.json Onboarding.RHS.Editor commit_raw.json Onboarding.RHS commit_raw.json Onboarding commit_raw.json Page.Compose commit_raw.json Page.Content.Editor commit_raw.json Page.Content commit_raw.json Page.Editor commit_raw.json Page.Feed commit_raw.json Page.Header commit_raw.json Page.LHS.Editor commit_raw.json Page.LHS commit_raw.json Page.Links commit_raw.json Page.Menu.Editor commit_raw.json Page.Post.Container commit_raw.json Page.Post.Content commit_raw.json Page.Post.Header commit_raw.json Page.Post commit_raw.json Page.RHS commit_raw.json Page commit_raw.json PageEditor commit_raw.json PageTabs commit_raw.json Pages commit_raw.json Posts.Compose commit_raw.json Posts.Feed commit_raw.json Posts commit_raw.json Project.InlineBlock commit_raw.json Project commit_raw.json ProjectCard commit_raw.json ProjectEditor commit_raw.json ProjectOnboarding commit_raw.json ProjectPage commit_raw.json Provider commit_raw.json SDKs.DAO.Main commit_raw.json TaggedProfiles commit_raw.json Untitled-0 commit_raw.json Welcome.RHS.Editor commit_raw.json app commit_raw.json blocks.container commit_raw.json blocks.content commit_raw.json blocks.sidebar commit_raw.json city.app commit_raw.json common.hashtags commit_raw.json count.hashtags commit_raw.json dao.entry commit_raw.json data.projects commit_raw.json dev.stats commit_raw.json editor.index commit_raw.json editor.ui commit_raw.json editor.uiFolders commit_raw.json editor.uiFoldersMenu commit_raw.json home commit_raw.json manager.index commit_raw.json manager.ui commit_raw.json p commit_raw.json potlock.donears commit_raw.json project.form commit_raw.json project.index commit_raw.json project.metadata commit_raw.json project.settings commit_raw.json project.template commit_raw.json project.ui commit_raw.json providers.project commit_raw.json repository.content commit_raw.json repository.file commit_raw.json repository.fork commit_raw.json repository.plugins commit_raw.json repository.source commit_raw.json repository.update commit_raw.json repository commit_raw.json templates.project.doc commit_raw.json templates.ui.navbar.default commit_raw.json templates.ui.navbar.left commit_raw.json templates.ui.navbar.nearui commit_raw.json ui.navbar commit_raw.json widget.stats commit_raw.json widgets commit_raw.json createit.near Layout commit_raw.json Layouts commit_raw.json editor.index commit_raw.json editor.ui commit_raw.json editor.uiFolders commit_raw.json editor.uiFoldersMenu commit_raw.json home commit_raw.json layouts.Container commit_raw.json layouts.SideBySide commit_raw.json layouts.Stacked commit_raw.json layouts.placeholder commit_raw.json layouts.test commit_raw.json manager.index commit_raw.json manager.ui commit_raw.json p commit_raw.json project.form commit_raw.json project.index commit_raw.json project.metadata commit_raw.json project.settings commit_raw.json project.template commit_raw.json project.ui commit_raw.json render commit_raw.json templates.project.doc commit_raw.json templates.ui.navbar.default commit_raw.json templates.ui.navbar.left commit_raw.json templates.ui.navbar.nearui commit_raw.json test commit_raw.json ui.navbar commit_raw.json creativesdao.near ImwithCreativesConstellation commit_raw.json cripteros.near EasyPoll commit_raw.json MyPageEditor commit_raw.json NearProtocolEspaol commit_raw.json NearProtocolenEspaol commit_raw.json ProfileEditor commit_raw.json ProfilePage commit_raw.json ProfilePageTEST commit_raw.json ProfileTEST commit_raw.json Wormhole3.Twitter commit_raw.json cristianvlz.near Colledge commit_raw.json ColledgeCertificate commit_raw.json cronus.near Homepage commit_raw.json QuickSocial commit_raw.json answer_poll commit_raw.json golosui_ili_proigraesh commit_raw.json crowdtestify.near Buttons.Blue commit_raw.json InfoSegment commit_raw.json Inputs.MultiSelect commit_raw.json Inputs.Number commit_raw.json Inputs.Select commit_raw.json Inputs.Skills commit_raw.json Inputs.Text commit_raw.json Inputs.TextArea commit_raw.json Task.Form commit_raw.json Tester.Form commit_raw.json cryptocredit.near cryptocredit.near_667f054f-3079-4903-a944-069c41b17540 commit_raw.json cryptogarik.near ClaimFT commit_raw.json FTBasicActions commit_raw.json FungibleTokenBalance commit_raw.json MainnetValidatorRow commit_raw.json MainnetValidatorStats commit_raw.json MainnetValidatorsList commit_raw.json MintNFT commit_raw.json NFTBasicActions commit_raw.json QueryNFT commit_raw.json RegistrationFT commit_raw.json TransferNFT commit_raw.json Welcome commit_raw.json genadropMinter commit_raw.json cryptogrid.near Untitled-0 commit_raw.json Untitled-1 commit_raw.json Untitled-2 commit_raw.json cryptomx.near bloquear commit_raw.json inicio commit_raw.json other commit_raw.json cryptoserp.tg New-Draft-0 commit_raw.json cuongdcdev.near BOSFeedback commit_raw.json Homepage commit_raw.json HomepagePlus commit_raw.json IframeEmbed commit_raw.json IframeEmbedExternal commit_raw.json MainPage.Comment.Feed commit_raw.json MainPage.ContentPlus commit_raw.json MainPage.Feed.BetaPlus commit_raw.json MainPage.Feed commit_raw.json MainPage.Post.Page commit_raw.json MainPage.PostPlus commit_raw.json ProfilePage commit_raw.json ProfileTabs commit_raw.json VBI-links commit_raw.json Welcome commit_raw.json WelcomePlus commit_raw.json about_me commit_raw.json linkdrop-viewer commit_raw.json linkdrop_plus commit_raw.json test2 commit_raw.json d0553b2e6971f765a1d222870fc0b6de734280b6dbf5540104d1d997593c6d90 Onboarding.Starter-fork commit_raw.json d086a0ea3dd4db2390146b0da523f2973b81f53a42a2c361231c4216a19c74bb Draft-0 commit_raw.json d2eb98e7b30f1c1b836c7290b973db4cb8896717b9fcacc98d57c8e36d2b1c47 CodeMarc commit_raw.json History commit_raw.json Insurance commit_raw.json InsurancePage2 commit_raw.json InsurancePage3 commit_raw.json InsurancePage4 commit_raw.json MintNFT commit_raw.json Page1 commit_raw.json Page2 commit_raw.json Page3 commit_raw.json Page4 commit_raw.json Page5 commit_raw.json PageInsurance commit_raw.json PageInsurance0 commit_raw.json Untitled-0 commit_raw.json button_general commit_raw.json d34e0322ce88449565cede063b16cfe9d5cd5723d652ac5ac7000b3b67e0dde7 connect.button commit_raw.json d364d02c8d70e600cce3a256776ad189b364ea768664fda2a85626eea4fa4448 TokenBalance commit_raw.json d379906a6274af7c56616ebc2157cc0d46256f7359f96bb36f482717a8af80f7 NDC.Elections.Candidates commit_raw.json NDC.Elections.Main commit_raw.json d46f94a8c5c545b43681c90edee1093fe2480484d708195bd465243a60e28002 NestedProps commit_raw.json d4vid221b.near example1 commit_raw.json d9e2feb204b515d6f8f50762fba457bcb860aadd24da2cfa21cac23b7aca7273 NearTodoApp commit_raw.json da12b5d41b9fc587752b529308f3d490c2dc5c79dfcae75825264e21c02ca384 Composition commit_raw.json GreeterKernel commit_raw.json dangquangvu.near EthereumLogin commit_raw.json GetBalanceETH commit_raw.json LoginWithCss commit_raw.json Tickets commit_raw.json Untitled-0 commit_raw.json UploadImageIPFS commit_raw.json danielledvorchak.near everything commit_raw.json daoashe.near AI-Afrofuturism commit_raw.json daoistanbul.near ComponentDetailsPage commit_raw.json daolondon.near ComponentDetailsPage commit_raw.json daotooling.near CreateDAO commit_raw.json dao-sdk commit_raw.json dapdapbos.near Bridge.AddressInput commit_raw.json Bridge.Alert commit_raw.json Bridge.ChainSelector commit_raw.json Bridge.CheckBox commit_raw.json Bridge.Confirm commit_raw.json Bridge.FeeMsg commit_raw.json Bridge.Index commit_raw.json Bridge.Lifi commit_raw.json Bridge.Select.CloseIcon commit_raw.json Bridge.Select.CurrencyInput commit_raw.json Bridge.Select.CurrencyRow commit_raw.json Bridge.Select.CurrencySelect commit_raw.json Bridge.Test commit_raw.json Bridge.Token commit_raw.json Bridge.Transaction commit_raw.json Bridge.Utils commit_raw.json BridgeEntry commit_raw.json DappEntry.ArbitrumSwap commit_raw.json DappEntry.BSCSwap commit_raw.json DappEntry.BaseSwap commit_raw.json DappEntry.GnosisSwap commit_raw.json DappEntry.LineaSwap commit_raw.json DappEntry.MantleSwap commit_raw.json DappEntry.MetisSwap commit_raw.json DappEntry.OptimismSwap commit_raw.json DappEntry.PolygonSwap commit_raw.json DappEntry.PolygonZkevmSwap commit_raw.json DappEntry.ZkSyncSwap commit_raw.json DappEntry.agniHandler commit_raw.json DappEntry.ammosHandler commit_raw.json DappEntry.iziSwapHandler commit_raw.json DappEntry.mantleHandler commit_raw.json DappEntry.mantleQuoter commit_raw.json DappSwapRouter commit_raw.json Lending.LiquityMarketRow commit_raw.json Linea.Uniswap.Swap.BridegeTips commit_raw.json Linea.Uniswap.Swap.CurrencyImportRow commit_raw.json Linea.Uniswap.Swap.CurrencyInput commit_raw.json Linea.Uniswap.Swap.CurrencyRow commit_raw.json Linea.Uniswap.Swap.CurrencySelect commit_raw.json Linea.Uniswap.Swap.Dex commit_raw.json Linea.Uniswap.Swap.FormatValue commit_raw.json Linea.Uniswap.Swap.HandlerV3 commit_raw.json Linea.Uniswap.Swap.ImportWarning commit_raw.json Linea.Uniswap.Swap.PriceImpactWarning commit_raw.json Linea.Uniswap.Swap.PriceImpactWarningButton commit_raw.json Linea.Uniswap.Swap.QuoterV3UniApi commit_raw.json Linea.Uniswap.Swap.Result commit_raw.json Linea.Uniswap.Swap.Routes commit_raw.json Linea.Uniswap.Swap.SlippageAmount commit_raw.json Linea.Uniswap.Swap.SlippageSetting commit_raw.json Linea.Uniswap.Swap.SwapButton commit_raw.json Linea.Uniswap.Swap.SwapConnector commit_raw.json Linea.Uniswap.Swap.SwapV2 commit_raw.json Linea.Uniswap.Swap.Token commit_raw.json Linea.Uniswap.Swap.TokenIcon commit_raw.json Linea.Uniswap.Swap.TokensPrice commit_raw.json Scroll.Uniswap.Swap.BridegeTips commit_raw.json Scroll.Uniswap.Swap.CurrencyImportRow commit_raw.json Scroll.Uniswap.Swap.CurrencyInput commit_raw.json Scroll.Uniswap.Swap.CurrencyRow commit_raw.json Scroll.Uniswap.Swap.CurrencySelect commit_raw.json Scroll.Uniswap.Swap.Dex commit_raw.json Scroll.Uniswap.Swap.HandlerV3 commit_raw.json Scroll.Uniswap.Swap.ImportWarning commit_raw.json Scroll.Uniswap.Swap.PriceImpactWarning commit_raw.json Scroll.Uniswap.Swap.PriceImpactWarningButton commit_raw.json Scroll.Uniswap.Swap.QuoterV3UniApi commit_raw.json Scroll.Uniswap.Swap.Result commit_raw.json Scroll.Uniswap.Swap.Routes commit_raw.json Scroll.Uniswap.Swap.SlippageAmount commit_raw.json Scroll.Uniswap.Swap.SlippageSetting commit_raw.json Scroll.Uniswap.Swap.SwapButton commit_raw.json Scroll.Uniswap.Swap.SwapConnector commit_raw.json Scroll.Uniswap.Swap.SwapV2 commit_raw.json Staking.Athena.Index commit_raw.json Staking.Athena.Pool commit_raw.json Staking.Athena.Stake commit_raw.json Staking.Athena.Unstake commit_raw.json Staking.Aura.AuraIndex commit_raw.json Staking.Aura.Button commit_raw.json Staking.Aura.Index commit_raw.json Staking.Aura.Pool commit_raw.json Staking.Aura.Spinner commit_raw.json Staking.Aura.Stake commit_raw.json Staking.Aura.Unstake commit_raw.json Staking.Hyperlock.Assets commit_raw.json Staking.Hyperlock.Handler commit_raw.json Staking.Hyperlock.Index commit_raw.json Staking.Hyperlock.Pool commit_raw.json Staking.Hyperlock.PoolData commit_raw.json Staking.Hyperlock.PoolIcons commit_raw.json Staking.Hyperlock.PoolTab commit_raw.json Staking.Hyperlock.TokenCard commit_raw.json Staking.Hyperlock.UserData commit_raw.json Swap.AmountOutV2 commit_raw.json Swap.ArrowIcon commit_raw.json Swap.ChainListDropDown commit_raw.json Swap.ChainWarnigBox commit_raw.json Swap.CloseIcon commit_raw.json Swap.ConnectButton commit_raw.json Swap.CurrencyBalance commit_raw.json Swap.CurrencyInput commit_raw.json Swap.CurrencyRow commit_raw.json Swap.CurrencySelect commit_raw.json Swap.ExchangeIcon commit_raw.json Swap.HandlerV2 commit_raw.json Swap.HandlerV3 commit_raw.json Swap.QuoterSolidly commit_raw.json Swap.QuoterV3 commit_raw.json Swap.SwapButton commit_raw.json Swap.SwapConnector commit_raw.json Swap.SwapV2 commit_raw.json Swap.handlerSolidly commit_raw.json Test commit_raw.json UI.Avatar commit_raw.json UI.AvatarGroup commit_raw.json UI.Button commit_raw.json UI.Select commit_raw.json UI.Spinner commit_raw.json Uniswap.Swap.AmountOutV2 commit_raw.json Uniswap.Swap.ArrowIcon commit_raw.json Uniswap.Swap.CloseIcon commit_raw.json Uniswap.Swap.ConnectButton commit_raw.json Uniswap.Swap.CurrencyBalance commit_raw.json Uniswap.Swap.CurrencyInput commit_raw.json Uniswap.Swap.CurrencyRow commit_raw.json Uniswap.Swap.CurrencySelect commit_raw.json Uniswap.Swap.Dex commit_raw.json Uniswap.Swap.ExchangeIcon commit_raw.json Uniswap.Swap.HandlerV2 commit_raw.json Uniswap.Swap.HandlerV3 commit_raw.json Uniswap.Swap.QuoterSolidly commit_raw.json Uniswap.Swap.QuoterV3 commit_raw.json Uniswap.Swap.QuoterV3UniApi commit_raw.json Uniswap.Swap.SwapButton commit_raw.json Uniswap.Swap.SwapConnector commit_raw.json Uniswap.Swap.SwapV2 commit_raw.json Uniswap.Swap.handlerSolidly commit_raw.json Utils.Allowance commit_raw.json Utils.CalcUSD commit_raw.json Utils.FormatAmount commit_raw.json Utils.FormatRawValue commit_raw.json Utils.FormatTime commit_raw.json Utils.GetTokenBalance commit_raw.json dapplets.near ... commit_raw.json Button commit_raw.json Cat commit_raw.json CatAction commit_raw.json ComponentsSearch commit_raw.json ContextAction commit_raw.json ContextActionsGroup commit_raw.json Dog commit_raw.json DogAction commit_raw.json Homepage commit_raw.json LayoutManager commit_raw.json LevelOne commit_raw.json LevelThree commit_raw.json LevelTwo commit_raw.json MainPage.N.Feed commit_raw.json MainPage.N.Post commit_raw.json Mutation-Overlay commit_raw.json N.DislikeButton commit_raw.json N commit_raw.json NestedButton commit_raw.json Override commit_raw.json PaywallBuyButton commit_raw.json PaywallNftMinter-Content commit_raw.json RedButton commit_raw.json StorageTest commit_raw.json Tipping commit_raw.json Web3Hackfest-Paywall-Button commit_raw.json Web3Hackfest-Paywall-Content commit_raw.json WriteButton commit_raw.json dapppunk.near Donation.Widget commit_raw.json Onboarding.Starter commit_raw.json Untitled-0 commit_raw.json altans-marketplace commit_raw.json bar commit_raw.json color_customizable_ipfs_uploader commit_raw.json customizable_button commit_raw.json devhub-altan commit_raw.json donate_button commit_raw.json donation.widget.fork commit_raw.json my_first_component commit_raw.json mymarketplace commit_raw.json notmarkmi commit_raw.json ref_burrow-deposit-fork commit_raw.json widget_v2 commit_raw.json darunrs.near Onboarding.Starter-fork commit_raw.json QuestCard commit_raw.json QuestListPage commit_raw.json QuestListSection commit_raw.json datablock.near nyc.dao commit_raw.json dataplatform.near NearQueryApi commit_raw.json QueryApi.App commit_raw.json QueryApi.Dashboard commit_raw.json QueryApi.Editor commit_raw.json QueryApi.Examples.Feed.Comment commit_raw.json QueryApi.Examples.Feed.LikeButton commit_raw.json QueryApi.Examples.Feed.Post commit_raw.json QueryApi.Examples.Feed.PostPage commit_raw.json QueryApi.Examples.Feed.Posts commit_raw.json QueryApi.Examples.Feed commit_raw.json QueryApi.Feed.ActivityPage commit_raw.json QueryApi.Feed commit_raw.json QueryApi.IndexerCard commit_raw.json QueryApi.IndexerExplorer commit_raw.json QueryApi.IndexerStatus commit_raw.json QueryApi.dev-App commit_raw.json QueryApi.dev.Feed commit_raw.json components.toggle commit_raw.json widgets.NearQueryApi commit_raw.json widgets.QueryApi.Dashboard commit_raw.json widgets.QueryApi.Editor commit_raw.json widgets.QueryApi.IndexerStatus commit_raw.json davidmo.near ImDeeeeead commit_raw.json MOTHER-COMPONENT commit_raw.json SayThanksToJames commit_raw.json davidweinstein.near MonthlyActiveAccounts commit_raw.json dawnkelly.near BadgeButton commit_raw.json Character-RPG-Basic commit_raw.json Character_RPG_Basic commit_raw.json DeformViralWaitList commit_raw.json Menu commit_raw.json MenuItem commit_raw.json background.create commit_raw.json build.builderInput commit_raw.json build.planTemplate commit_raw.json build.teamMembersAndRoles commit_raw.json deform.inline commit_raw.json game.propertyRadioInput commit_raw.json map commit_raw.json monster.create commit_raw.json monster.inline commit_raw.json player.create commit_raw.json player.inline commit_raw.json weapon.create commit_raw.json weapon.inline commit_raw.json dazo.near Draft-0 commit_raw.json db30db3dd6d9a0b66da535706e04d4f9fc7f5d0ff5cd3f5da99f6f0d267a593f CanaryRegistry commit_raw.json db371.near devs.rank commit_raw.json nyc.dao commit_raw.json dcjanio.near ComponentDashboard commit_raw.json HelloEthersJS commit_raw.json HelloEthersJStest commit_raw.json HelloEthersJStests commit_raw.json Untitled-0 commit_raw.json login-0 commit_raw.json dd1e4dc79092f25987af6d882fe6a33acca7d672245e13e99243c17745d08fa0 Dpost commit_raw.json Hpost commit_raw.json Verax commit_raw.json mintpage commit_raw.json navbar commit_raw.json post-test commit_raw.json dd3d804c5525cef938710295b8eeabaf9af837f5400e9e083b24f0a82f38fd10 feedback.form commit_raw.json ddbf1ec0b8cb032ee6756813b54545098b05ea07efbe0332af496caf1da8673d ForkThis commit_raw.json ddospos.near Untitled-0 commit_raw.json deanealexander1.near CH-Widget commit_raw.json ForgeCHWidget commit_raw.json MJG commit_raw.json deb842f744e51bcd99477b258dbdb275e7d345ce66a4333f123cdb4db1fc959d test commit_raw.json decentricity.near Onboarding.Starter-fork commit_raw.json Onboarding.Starter commit_raw.json Untitled-0 commit_raw.json myriad-social commit_raw.json myriad-town commit_raw.json post-to-dao commit_raw.json deedeeapp.near DeeDee commit_raw.json deepcrunch.near 2048-Coop-WithStyle commit_raw.json deepcryptodive.near Aave.Loader commit_raw.json Aave.NetworkSwitcher commit_raw.json Greeter commit_raw.json Hello.world commit_raw.json SPARK-local commit_raw.json SPARK.Card.AssetsToBorrow commit_raw.json SPARK.Card.AssetsToSupply commit_raw.json SPARK.Card.YourBorrows commit_raw.json SPARK.Card.YourSupplies commit_raw.json SPARK.Loader commit_raw.json SPARK.NetworkSwitcher commit_raw.json SPARK commit_raw.json ZKEVM.AAVE.Card.YourBorrows commit_raw.json denysk.near ActivityPage commit_raw.json NearStats commit_raw.json PriceStats commit_raw.json Welcome commit_raw.json derceo.near Untitled-0 commit_raw.json dercio.near Draft-0 commit_raw.json deri007.near NotificationFeed commit_raw.json dery.near zia commit_raw.json detextre4.near health-bar commit_raw.json poke-fight commit_raw.json pokemon-element-types commit_raw.json splash-screen commit_raw.json dev-queryapi.dataplatform.near NearQueryApi commit_raw.json QueryApi.App commit_raw.json QueryApi.Dashboard commit_raw.json QueryApi.Editor commit_raw.json QueryApi.Examples.Feed.ActivityPage commit_raw.json QueryApi.Examples.Feed.Comment commit_raw.json QueryApi.Examples.Feed.LikeButton commit_raw.json QueryApi.Examples.Feed.Post commit_raw.json QueryApi.Examples.Feed.PostPage commit_raw.json QueryApi.Examples.Feed.Posts commit_raw.json QueryApi.Examples.Feed commit_raw.json QueryApi.Feed.ActivityPage commit_raw.json QueryApi.Feed commit_raw.json QueryApi.IndexerCard commit_raw.json QueryApi.IndexerExplorer commit_raw.json QueryApi.IndexerStatus commit_raw.json QueryApi.dev-App commit_raw.json QueryApi.dev.Feed commit_raw.json components.toggle commit_raw.json dev-support.near AccountProfile commit_raw.json Commerce.Home commit_raw.json Commerce.Product.Preview commit_raw.json DevSuport.Main commit_raw.json DevSupport.Answer.Edit commit_raw.json DevSupport.Answer.Feed commit_raw.json DevSupport.Answer commit_raw.json DevSupport.Compose commit_raw.json DevSupport.Discussion.Title commit_raw.json DevSupport.Feed commit_raw.json DevSupport.Main commit_raw.json DevSupport.Question.Button.Answers commit_raw.json DevSupport.Question.Button.Upvote commit_raw.json DevSupport.Question.Edit commit_raw.json DevSupport.Question.Page commit_raw.json DevSupport.Question.Preview commit_raw.json DevSupport.Question.PreviewDetailed commit_raw.json Example commit_raw.json Greetings commit_raw.json Market.Main commit_raw.json MyWelcomingPage commit_raw.json NestedDiscussions.Compose commit_raw.json ProfileImage commit_raw.json Test commit_raw.json dev368.near hello commit_raw.json test_bos commit_raw.json tool-12key commit_raw.json devendra116.near Random_Jokes commit_raw.json share_thoughts commit_raw.json devgigsboard.bo.near AddIdea commit_raw.json DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json DevGov.Notifications.Item.Right commit_raw.json Ideas commit_raw.json IdeasList commit_raw.json Notification.Item commit_raw.json NotificationFeed commit_raw.json Post commit_raw.json PostEditor commit_raw.json devgovgigs.near AddIdea commit_raw.json Attestation commit_raw.json AttestationEditor commit_raw.json Comment commit_raw.json CommentEditor commit_raw.json CompactPost commit_raw.json DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json Idea commit_raw.json IdeaEditor commit_raw.json Ideas commit_raw.json IdeasList commit_raw.json KanbanBoard commit_raw.json KanbanBoardList commit_raw.json LabelsPermissions commit_raw.json Post commit_raw.json PostEditor commit_raw.json RenderingBugDemo commit_raw.json Sponsorship commit_raw.json SponsorshipEditor commit_raw.json Submission commit_raw.json SubmissionEditor commit_raw.json TeamInfo commit_raw.json TeamsList commit_raw.json app commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.url commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.connect commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Creator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.List commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Post commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.page.about commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.community.index commit_raw.json devhub.page.contribute commit_raw.json devhub.page.create commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json gigs-board.components.atom.button-switch commit_raw.json gigs-board.components.atom.button commit_raw.json gigs-board.components.atom.icon commit_raw.json gigs-board.components.atom.spinner commit_raw.json gigs-board.components.atom.tag commit_raw.json gigs-board.components.atom.toggle commit_raw.json gigs-board.components.boards.KanbanBoard commit_raw.json gigs-board.components.community.CommunityHeader commit_raw.json gigs-board.components.community.FeaturedCommunity commit_raw.json gigs-board.components.community.FeedHeader commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.layout.Page commit_raw.json gigs-board.components.layout.SearchByAuthor commit_raw.json gigs-board.components.layout.SearchByLabel commit_raw.json gigs-board.components.layout.app-header commit_raw.json gigs-board.components.molecule.breadcrumbs commit_raw.json gigs-board.components.molecule.button-switch commit_raw.json gigs-board.components.molecule.button commit_raw.json gigs-board.components.molecule.markdown-editor commit_raw.json gigs-board.components.molecule.markdown-viewer commit_raw.json gigs-board.components.molecule.profile-card commit_raw.json gigs-board.components.molecule.text-input commit_raw.json gigs-board.components.molecule.tile commit_raw.json gigs-board.components.organism.configurator commit_raw.json gigs-board.components.organism.editor commit_raw.json gigs-board.components.organism.form commit_raw.json gigs-board.components.posts.List commit_raw.json gigs-board.components.posts.Post commit_raw.json gigs-board.components.posts.PostEditor commit_raw.json gigs-board.components.posts.Search commit_raw.json gigs-board.components.teams.LabelsPermissions commit_raw.json gigs-board.components.teams.TeamInfo commit_raw.json gigs-board.components.template.app-layout commit_raw.json gigs-board.components.template.community-page commit_raw.json gigs-board.entity.community.branding-configurator commit_raw.json gigs-board.entity.community.configurator commit_raw.json gigs-board.entity.community.header commit_raw.json gigs-board.entity.community.layout commit_raw.json gigs-board.entity.community.sidebar commit_raw.json gigs-board.entity.community.spawner commit_raw.json gigs-board.entity.github-repo.board commit_raw.json gigs-board.entity.github-repo.ticket commit_raw.json gigs-board.entity.post.AuthorSearch commit_raw.json gigs-board.entity.post.Card commit_raw.json gigs-board.entity.post.CompactPost commit_raw.json gigs-board.entity.post.History commit_raw.json gigs-board.entity.post.List commit_raw.json gigs-board.entity.post.Lookup commit_raw.json gigs-board.entity.post.Post commit_raw.json gigs-board.entity.post.PostEditor commit_raw.json gigs-board.entity.post.Search commit_raw.json gigs-board.entity.post.Spawner commit_raw.json gigs-board.entity.post.TagSearch commit_raw.json gigs-board.entity.team-board.github-kanban commit_raw.json gigs-board.entity.team-board.github-ticket commit_raw.json gigs-board.entity.team-board.kanban commit_raw.json gigs-board.entity.team.LabelsPermissions commit_raw.json gigs-board.entity.team.TeamInfo commit_raw.json gigs-board.entity.workspace.github-ticket commit_raw.json gigs-board.entity.workspace.github-view commit_raw.json gigs-board.entity.workspace.kanban-view commit_raw.json gigs-board.entity.workspace.post-ticket commit_raw.json gigs-board.entity.workspace.view.github.configurator commit_raw.json gigs-board.entity.workspace.view.github.kanban_board commit_raw.json gigs-board.entity.workspace.view.github.kanban_ticket commit_raw.json gigs-board.entity.workspace.view.kanban.configurator commit_raw.json gigs-board.entity.workspace.view.kanban.post_board commit_raw.json gigs-board.entity.workspace.view.kanban.post_ticket commit_raw.json gigs-board.entity.workspace.view.layout commit_raw.json gigs-board.feature.community-editor.branding-section commit_raw.json gigs-board.feature.community-editor.frame commit_raw.json gigs-board.feature.community-editor.ui commit_raw.json gigs-board.feature.github-integration.kanban-board-editor commit_raw.json gigs-board.feature.integration.github.board-config-editor commit_raw.json gigs-board.feature.post-search.by-author commit_raw.json gigs-board.feature.post-search.by-tag commit_raw.json gigs-board.feature.post-search.panel commit_raw.json gigs-board.feature.workspace.github-view-configurator commit_raw.json gigs-board.feature.workspace.kanban-view-configurator commit_raw.json gigs-board.pages.Boards commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Feed commit_raw.json gigs-board.pages.Post commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.communities commit_raw.json gigs-board.pages.community.Events commit_raw.json gigs-board.pages.community.Sponsorship commit_raw.json gigs-board.pages.community.activity commit_raw.json gigs-board.pages.community.board commit_raw.json gigs-board.pages.community.configuration commit_raw.json gigs-board.pages.community.edit-info commit_raw.json gigs-board.pages.community.github commit_raw.json gigs-board.pages.community.new commit_raw.json gigs-board.pages.community.sidebar commit_raw.json gigs-board.pages.community.teams commit_raw.json gigs-board.pages.community.telegram commit_raw.json gigs-board.pages.community.wiki commit_raw.json devgovgigs.petersalomonsen.near DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json Ideas commit_raw.json Post commit_raw.json app commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.common commit_raw.json core.lib.data-request commit_raw.json core.lib.stringUtils commit_raw.json core.lib.struct commit_raw.json core.lib.url commit_raw.json core.lib.uuid commit_raw.json devhub.components.atom.Alert commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.feed.MergedIndexFeed commit_raw.json devhub.components.feed.SubscribedFeed commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.connect commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.layout.LikeButton.Faces commit_raw.json devhub.components.molecule.AccountAutocomplete commit_raw.json devhub.components.molecule.BadgeDetails commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.Checkbox commit_raw.json devhub.components.molecule.CommunityControl commit_raw.json devhub.components.molecule.Compose commit_raw.json devhub.components.molecule.DropDown commit_raw.json devhub.components.molecule.DropDownWithSearch commit_raw.json devhub.components.molecule.Input commit_raw.json devhub.components.molecule.ListEditor commit_raw.json devhub.components.molecule.MarkdownEditor commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.ProfileLine commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.SimpleMDE commit_raw.json devhub.components.molecule.Spinner commit_raw.json devhub.components.molecule.Switch commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Feed.NearQueryApi commit_raw.json devhub.components.organism.Feed commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Creator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.provider commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.github.Viewer commit_raw.json devhub.entity.addon.github.kanban_board commit_raw.json devhub.entity.addon.github.kanban_ticket commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.kanban.post_board commit_raw.json devhub.entity.addon.kanban.post_ticket commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.telegram.Viewer commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Activity commit_raw.json devhub.entity.community.Announcements commit_raw.json devhub.entity.community.Card commit_raw.json devhub.entity.community.Compose commit_raw.json devhub.entity.community.Discussions commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AccessControlConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.History commit_raw.json devhub.entity.post.List commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Post commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.entity.proposal.AccountInput commit_raw.json devhub.entity.proposal.CategoryDropdown commit_raw.json devhub.entity.proposal.CategoryTag commit_raw.json devhub.entity.proposal.CommentIcon commit_raw.json devhub.entity.proposal.Comments commit_raw.json devhub.entity.proposal.CommentsAndLogs commit_raw.json devhub.entity.proposal.ComposeComment commit_raw.json devhub.entity.proposal.ConfirmCancelModal commit_raw.json devhub.entity.proposal.ConfirmReviewModal commit_raw.json devhub.entity.proposal.Editor commit_raw.json devhub.entity.proposal.Feed commit_raw.json devhub.entity.proposal.History commit_raw.json devhub.entity.proposal.LikeButton commit_raw.json devhub.entity.proposal.LinkedProposalsDropdown commit_raw.json devhub.entity.proposal.LoginScreen commit_raw.json devhub.entity.proposal.Profile commit_raw.json devhub.entity.proposal.Proposal commit_raw.json devhub.entity.proposal.StatusTag commit_raw.json devhub.entity.proposal.VerificationStatus commit_raw.json devhub.entity.team.Configurator commit_raw.json devhub.entity.team.LabelPermissions commit_raw.json devhub.entity.team.LabelRow commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.feature.proposal-search.by-author commit_raw.json devhub.feature.proposal-search.by-category commit_raw.json devhub.feature.proposal-search.by-input commit_raw.json devhub.feature.proposal-search.by-sort commit_raw.json devhub.feature.proposal-search.by-stage commit_raw.json devhub.notification.Item commit_raw.json devhub.notification.LR commit_raw.json devhub.notification.Left commit_raw.json devhub.notification.Right commit_raw.json devhub.page.about commit_raw.json devhub.page.addon commit_raw.json devhub.page.admin.homepageTab commit_raw.json devhub.page.admin.index commit_raw.json devhub.page.admin.moderatorsTab commit_raw.json devhub.page.admin.restrictedLabelsTab commit_raw.json devhub.page.announcements commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.community.index commit_raw.json devhub.page.contribute commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json devhub.page.proposals commit_raw.json gigs-board.components.atom.button-switch commit_raw.json gigs-board.components.atom.button commit_raw.json gigs-board.components.atom.icon commit_raw.json gigs-board.components.atom.spinner commit_raw.json gigs-board.components.atom.tag commit_raw.json gigs-board.components.atom.toggle commit_raw.json gigs-board.components.boards.KanbanBoard commit_raw.json gigs-board.components.community.CommunityHeader commit_raw.json gigs-board.components.community.FeaturedCommunity commit_raw.json gigs-board.components.community.FeedHeader commit_raw.json gigs-board.components.community.Layout commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.layout.Page commit_raw.json gigs-board.components.layout.SearchByAuthor commit_raw.json gigs-board.components.layout.SearchByLabel commit_raw.json gigs-board.components.layout.app-header commit_raw.json gigs-board.components.molecule.breadcrumbs commit_raw.json gigs-board.components.molecule.button-switch commit_raw.json gigs-board.components.molecule.button commit_raw.json gigs-board.components.molecule.markdown-editor commit_raw.json gigs-board.components.molecule.markdown-viewer commit_raw.json gigs-board.components.molecule.profile-card commit_raw.json gigs-board.components.molecule.text-input commit_raw.json gigs-board.components.molecule.tile commit_raw.json gigs-board.components.organism.configurator commit_raw.json gigs-board.components.organism.editor commit_raw.json gigs-board.components.organism.form commit_raw.json gigs-board.components.posts.CompactPost commit_raw.json gigs-board.components.posts.List commit_raw.json gigs-board.components.posts.PostEditor commit_raw.json gigs-board.components.posts.Search commit_raw.json gigs-board.components.teams.LabelsPermissions commit_raw.json gigs-board.components.teams.TeamInfo commit_raw.json gigs-board.components.template.app-layout commit_raw.json gigs-board.components.template.community-page commit_raw.json gigs-board.entity.community.branding-configurator commit_raw.json gigs-board.entity.community.configurator commit_raw.json gigs-board.entity.community.header commit_raw.json gigs-board.entity.community.layout commit_raw.json gigs-board.entity.community.sidebar commit_raw.json gigs-board.entity.community.spawner commit_raw.json gigs-board.entity.github-repo.board commit_raw.json gigs-board.entity.github-repo.ticket commit_raw.json gigs-board.entity.post.CompactPost commit_raw.json gigs-board.entity.post.History commit_raw.json gigs-board.entity.post.List commit_raw.json gigs-board.entity.post.Post commit_raw.json gigs-board.entity.post.PostEditor commit_raw.json gigs-board.entity.post.Search commit_raw.json gigs-board.entity.team-board.github-kanban commit_raw.json gigs-board.entity.team-board.github-ticket commit_raw.json gigs-board.entity.team-board.kanban commit_raw.json gigs-board.entity.team.LabelsPermissions commit_raw.json gigs-board.entity.team.TeamInfo commit_raw.json gigs-board.entity.workspace.github-ticket commit_raw.json gigs-board.entity.workspace.github-view commit_raw.json gigs-board.entity.workspace.kanban-view commit_raw.json gigs-board.entity.workspace.post-ticket commit_raw.json gigs-board.entity.workspace.view.github.configurator commit_raw.json gigs-board.entity.workspace.view.github.kanban_board commit_raw.json gigs-board.entity.workspace.view.github.kanban_ticket commit_raw.json gigs-board.entity.workspace.view.kanban.configurator commit_raw.json gigs-board.entity.workspace.view.kanban.post_board commit_raw.json gigs-board.entity.workspace.view.kanban.post_ticket commit_raw.json gigs-board.entity.workspace.view.layout commit_raw.json gigs-board.feature.community-editor.branding-section commit_raw.json gigs-board.feature.community-editor.frame commit_raw.json gigs-board.feature.community-editor.ui commit_raw.json gigs-board.feature.github-integration.kanban-board-editor commit_raw.json gigs-board.feature.integration.github.board-config-editor commit_raw.json gigs-board.feature.post-search.by-author commit_raw.json gigs-board.feature.post-search.by-tag commit_raw.json gigs-board.feature.post-search.panel commit_raw.json gigs-board.feature.workspace.github-view-configurator commit_raw.json gigs-board.feature.workspace.kanban-view-configurator commit_raw.json gigs-board.pages.Boards commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Feed commit_raw.json gigs-board.pages.Post commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.communities commit_raw.json gigs-board.pages.community.Discussions commit_raw.json gigs-board.pages.community.Events commit_raw.json gigs-board.pages.community.Sponsorship commit_raw.json gigs-board.pages.community.Telegram commit_raw.json gigs-board.pages.community.activity commit_raw.json gigs-board.pages.community.board commit_raw.json gigs-board.pages.community.configuration commit_raw.json gigs-board.pages.community.edit-info commit_raw.json gigs-board.pages.community.github commit_raw.json gigs-board.pages.community.new commit_raw.json gigs-board.pages.community.teams commit_raw.json gigs-board.pages.community.wiki commit_raw.json devhub.efiz.near DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json Ideas commit_raw.json Post commit_raw.json SimpleMDE commit_raw.json app commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.url commit_raw.json core.lib.util commit_raw.json devhub.components.atom.Alert commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.connect commit_raw.json devhub.components.island.contribute commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.layout.LikeButton.Faces commit_raw.json devhub.components.molecule.AccountAutocomplete commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.Input commit_raw.json devhub.components.molecule.ListEditor commit_raw.json devhub.components.molecule.MarkdownEditor commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.SimpleMDE commit_raw.json devhub.components.molecule.Switch commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Creator commit_raw.json devhub.entity.addon.blog.Editor commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.provider commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.github.Viewer commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.telegram.Viewer commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Activity commit_raw.json devhub.entity.community.Card commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AccessControlConfigurator commit_raw.json devhub.entity.community.configuration.AddonConfigurator commit_raw.json devhub.entity.community.configuration.Addons commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.History commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Post commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.entity.team.Configurator commit_raw.json devhub.entity.team.LabelPermissions commit_raw.json devhub.entity.team.LabelRow commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.page.about commit_raw.json devhub.page.addon commit_raw.json devhub.page.admin.homepageTab commit_raw.json devhub.page.admin.index commit_raw.json devhub.page.admin.moderatorsTab commit_raw.json devhub.page.admin.restrictedLabelsTab commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.community.index commit_raw.json devhub.page.contribute commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json gigs-board.components.atom.button commit_raw.json gigs-board.components.atom.icon commit_raw.json gigs-board.components.atom.spinner commit_raw.json gigs-board.components.atom.tag commit_raw.json gigs-board.components.atom.toggle commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.layout.Page commit_raw.json gigs-board.components.layout.app-header commit_raw.json gigs-board.components.molecule.breadcrumbs commit_raw.json gigs-board.components.molecule.button-switch commit_raw.json gigs-board.components.molecule.button commit_raw.json gigs-board.components.molecule.markdown-editor commit_raw.json gigs-board.components.molecule.markdown-viewer commit_raw.json gigs-board.components.molecule.profile-card commit_raw.json gigs-board.components.molecule.text-input commit_raw.json gigs-board.components.molecule.tile commit_raw.json gigs-board.components.organism.configurator commit_raw.json gigs-board.components.organism.editor commit_raw.json gigs-board.components.template.app-layout commit_raw.json gigs-board.components.template.community-page commit_raw.json gigs-board.entity.community.branding-configurator commit_raw.json gigs-board.entity.community.configurator commit_raw.json gigs-board.entity.community.header commit_raw.json gigs-board.entity.community.layout commit_raw.json gigs-board.entity.community.sidebar commit_raw.json gigs-board.entity.community.spawner commit_raw.json gigs-board.entity.post.AuthorSearch commit_raw.json gigs-board.entity.post.Card commit_raw.json gigs-board.entity.post.CompactPost commit_raw.json gigs-board.entity.post.History commit_raw.json gigs-board.entity.post.List commit_raw.json gigs-board.entity.post.Lookup commit_raw.json gigs-board.entity.post.Post commit_raw.json gigs-board.entity.post.PostEditor commit_raw.json gigs-board.entity.post.Spawner commit_raw.json gigs-board.entity.post.TagSearch commit_raw.json gigs-board.entity.team-board.github-kanban commit_raw.json gigs-board.entity.team-board.github-ticket commit_raw.json gigs-board.entity.team-board.kanban commit_raw.json gigs-board.entity.team.LabelsPermissions commit_raw.json gigs-board.entity.team.TeamInfo commit_raw.json gigs-board.entity.workspace.github-ticket commit_raw.json gigs-board.entity.workspace.github-view commit_raw.json gigs-board.entity.workspace.kanban-view commit_raw.json gigs-board.entity.workspace.post-ticket commit_raw.json gigs-board.entity.workspace.view.github.configurator commit_raw.json gigs-board.entity.workspace.view.github.kanban_board commit_raw.json gigs-board.entity.workspace.view.github.kanban_ticket commit_raw.json gigs-board.entity.workspace.view.kanban.configurator commit_raw.json gigs-board.entity.workspace.view.kanban.post_board commit_raw.json gigs-board.entity.workspace.view.kanban.post_ticket commit_raw.json gigs-board.entity.workspace.view.layout commit_raw.json gigs-board.feature.community-editor.branding-section commit_raw.json gigs-board.feature.community-editor.ui commit_raw.json gigs-board.feature.github-integration.kanban-board-editor commit_raw.json gigs-board.feature.post-search.by-author commit_raw.json gigs-board.feature.post-search.by-tag commit_raw.json gigs-board.feature.post-search.panel commit_raw.json gigs-board.feature.workspace.github-view-configurator commit_raw.json gigs-board.feature.workspace.kanban-view-configurator commit_raw.json gigs-board.pages.Boards commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Feed commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.communities commit_raw.json gigs-board.pages.community.activity commit_raw.json gigs-board.pages.community.board commit_raw.json gigs-board.pages.community.configuration commit_raw.json gigs-board.pages.community.edit-info commit_raw.json gigs-board.pages.community.github commit_raw.json gigs-board.pages.community.new commit_raw.json gigs-board.pages.community.sidebar commit_raw.json gigs-board.pages.community.sponsorship commit_raw.json gigs-board.pages.community.teams commit_raw.json gigs-board.pages.community.telegram commit_raw.json gigs-board.pages.community.wiki commit_raw.json devhub.jass.near app commit_raw.json core.lib.url commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.page.about commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.contribute commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json devhub.near DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json app commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.autocomplete commit_raw.json core.lib.common commit_raw.json core.lib.data-request commit_raw.json core.lib.stringUtils commit_raw.json core.lib.struct commit_raw.json core.lib.url commit_raw.json core.lib.uuid commit_raw.json devhub.components.atom.Alert commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.feed.MergedIndexFeed commit_raw.json devhub.components.feed.SubscribedFeed commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.connect commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.layout.LikeButton.Faces commit_raw.json devhub.components.molecule.AccountAutocomplete commit_raw.json devhub.components.molecule.BadgeDetails commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.Checkbox commit_raw.json devhub.components.molecule.CommunityControl commit_raw.json devhub.components.molecule.Compose commit_raw.json devhub.components.molecule.DropDown commit_raw.json devhub.components.molecule.DropDownWithSearch commit_raw.json devhub.components.molecule.Input commit_raw.json devhub.components.molecule.ListEditor commit_raw.json devhub.components.molecule.MarkdownEditor commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.ProfileLine commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.SimpleMDE commit_raw.json devhub.components.molecule.Spinner commit_raw.json devhub.components.molecule.Switch commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Feed.NearQueryApi commit_raw.json devhub.components.organism.Feed commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.provider commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.github.Viewer commit_raw.json devhub.entity.addon.github.kanban_board commit_raw.json devhub.entity.addon.github.kanban_ticket commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.kanban.post_board commit_raw.json devhub.entity.addon.kanban.post_ticket commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.telegram.Viewer commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Activity commit_raw.json devhub.entity.community.Announcements commit_raw.json devhub.entity.community.Card commit_raw.json devhub.entity.community.Compose commit_raw.json devhub.entity.community.Discussions commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AccessControlConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.History commit_raw.json devhub.entity.post.List commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Post commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.entity.proposal.AccountInput commit_raw.json devhub.entity.proposal.CategoryDropdown commit_raw.json devhub.entity.proposal.CategoryTag commit_raw.json devhub.entity.proposal.CommentIcon commit_raw.json devhub.entity.proposal.Comments commit_raw.json devhub.entity.proposal.CommentsAndLogs commit_raw.json devhub.entity.proposal.ComposeComment commit_raw.json devhub.entity.proposal.ConfirmCancelModal commit_raw.json devhub.entity.proposal.ConfirmReviewModal commit_raw.json devhub.entity.proposal.Editor commit_raw.json devhub.entity.proposal.Feed commit_raw.json devhub.entity.proposal.History commit_raw.json devhub.entity.proposal.LikeButton commit_raw.json devhub.entity.proposal.LinkedProposalsDropdown commit_raw.json devhub.entity.proposal.LoginScreen commit_raw.json devhub.entity.proposal.Profile commit_raw.json devhub.entity.proposal.Proposal commit_raw.json devhub.entity.proposal.StatusTag commit_raw.json devhub.entity.proposal.VerificationStatus commit_raw.json devhub.entity.team.Configurator commit_raw.json devhub.entity.team.LabelPermissions commit_raw.json devhub.entity.team.LabelRow commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.feature.proposal-search.by-author commit_raw.json devhub.feature.proposal-search.by-category commit_raw.json devhub.feature.proposal-search.by-input commit_raw.json devhub.feature.proposal-search.by-sort commit_raw.json devhub.feature.proposal-search.by-stage commit_raw.json devhub.notification.Item commit_raw.json devhub.notification.LR commit_raw.json devhub.notification.Left commit_raw.json devhub.notification.Right commit_raw.json devhub.page.about commit_raw.json devhub.page.addon commit_raw.json devhub.page.admin.homepageTab commit_raw.json devhub.page.admin.index commit_raw.json devhub.page.admin.moderatorsTab commit_raw.json devhub.page.admin.restrictedLabelsTab commit_raw.json devhub.page.announcements commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.community.index commit_raw.json devhub.page.contribute commit_raw.json devhub.page.create commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json devhub.page.proposals commit_raw.json devj.near Toast commit_raw.json Wordle.Game.Countdown commit_raw.json Wordle.Game.Field commit_raw.json Wordle.Game.Keyboard commit_raw.json Wordle.Game.Menu commit_raw.json Wordle.Game commit_raw.json Wordle.Header commit_raw.json Wordle.Leaderboard commit_raw.json Wordle.Profile commit_raw.json Wordle commit_raw.json devs.near Common.AccountAutocomplete commit_raw.json Common.Compose commit_raw.json Community commit_raw.json Compose commit_raw.json ContextMenu commit_raw.json Editor commit_raw.json Feed.demo commit_raw.json Feed commit_raw.json GitBos.info commit_raw.json GitBos.kit.editor commit_raw.json GitBos.kit commit_raw.json GithubForkButton commit_raw.json Layout.demo commit_raw.json Layout commit_raw.json Library commit_raw.json MarkdownViewer commit_raw.json MetadataEditor commit_raw.json Modal commit_raw.json MonacoEditor commit_raw.json Notification.Item commit_raw.json PR.FilteredIndexFeed commit_raw.json PR.IndexFeed commit_raw.json PR.MergedIndexFeed commit_raw.json ProfileEditor commit_raw.json ProfileWidget commit_raw.json Router commit_raw.json SetFlagButton commit_raw.json Template commit_raw.json Thing commit_raw.json adapter.github commit_raw.json adapter.openai commit_raw.json adapter.sputnik-dao commit_raw.json app commit_raw.json bos.Hashtag.Feed commit_raw.json canvas.edit commit_raw.json canvas.view commit_raw.json code.edit commit_raw.json code.view commit_raw.json community.Banner commit_raw.json community.Featured commit_raw.json community.Groups commit_raw.json community.Hashtag.Feed commit_raw.json community.Header commit_raw.json community.Layout commit_raw.json community.Overview commit_raw.json community.Page commit_raw.json community.Rank commit_raw.json community.cta commit_raw.json component.card commit_raw.json components commit_raw.json create.posts commit_raw.json dao.connect commit_raw.json dbos commit_raw.json default commit_raw.json dev.Rank commit_raw.json dev.collab commit_raw.json dev.community commit_raw.json dev.config commit_raw.json dev.feed commit_raw.json dev.info commit_raw.json dev.main.config commit_raw.json dev.main commit_raw.json dev.menu commit_raw.json dev.posts commit_raw.json dev.profile commit_raw.json dev.rank commit_raw.json dev.search commit_raw.json dev.side.config commit_raw.json dev.side commit_raw.json dev.social commit_raw.json dev.tabs commit_raw.json devs.Rank commit_raw.json every.feed.view commit_raw.json every.group commit_raw.json everything.sdk commit_raw.json explore.posts commit_raw.json group.card commit_raw.json group.create commit_raw.json group.edit commit_raw.json group.image commit_raw.json group.index commit_raw.json group.info commit_raw.json group.inline commit_raw.json group.join commit_raw.json group.members commit_raw.json group.overlay.trigger commit_raw.json group.overlay commit_raw.json group.page commit_raw.json group.settings commit_raw.json group.stats commit_raw.json group commit_raw.json hyperfile.create commit_raw.json hyperfile commit_raw.json lib.stringUtils commit_raw.json lib.url commit_raw.json markdown.MarkdownEditorIframe commit_raw.json markdown.SimpleMDE commit_raw.json markdown.edit commit_raw.json markdown.view commit_raw.json modal.create commit_raw.json modal.post commit_raw.json post.feed commit_raw.json profile.page commit_raw.json provider commit_raw.json sidebar commit_raw.json update commit_raw.json view.posts commit_raw.json view commit_raw.json widget.App commit_raw.json widget.Common.AccountAutocomplete commit_raw.json widget.Common.Compose commit_raw.json widget.Community commit_raw.json widget.Compose commit_raw.json widget.ContextMenu commit_raw.json widget.Editor commit_raw.json widget.Feed.demo commit_raw.json widget.Feed commit_raw.json widget.GitBos.info commit_raw.json widget.GitBos.kit.editor commit_raw.json widget.GitBos.kit commit_raw.json widget.GithubForkButton commit_raw.json widget.Layout.demo commit_raw.json widget.Layout commit_raw.json widget.Library commit_raw.json widget.MetadataEditor commit_raw.json widget.Modal commit_raw.json widget.MonacoEditor commit_raw.json widget.Notification.Item commit_raw.json widget.PR.FilteredIndexFeed commit_raw.json widget.PR.IndexFeed commit_raw.json widget.PR.MergedIndexFeed commit_raw.json widget.ProfileEditor commit_raw.json widget.ProfileWidget commit_raw.json widget.Router commit_raw.json widget.SetFlagButton commit_raw.json widget.Template commit_raw.json widget.Thing commit_raw.json widget.adapter.github commit_raw.json widget.adapter.openai commit_raw.json widget.adapter.sputnik-dao commit_raw.json widget.card commit_raw.json widget.components commit_raw.json widget.dao.connect commit_raw.json widget.dbos commit_raw.json widget.default commit_raw.json widget.every.group commit_raw.json widget.everything.sdk commit_raw.json widget.explore.posts commit_raw.json widget.group.card commit_raw.json widget.group.create commit_raw.json widget.group.edit commit_raw.json widget.group.image commit_raw.json widget.group.index commit_raw.json widget.group.info commit_raw.json widget.group.inline commit_raw.json widget.group.join commit_raw.json widget.group.members commit_raw.json widget.group.overlay.trigger commit_raw.json widget.group.overlay commit_raw.json widget.group.page commit_raw.json widget.group.settings commit_raw.json widget.group.stats commit_raw.json widget.group commit_raw.json widget.lib.stringUtils commit_raw.json widget.lib.url commit_raw.json widget.markdown.view commit_raw.json widget.post.feed commit_raw.json widget.profile.page commit_raw.json widget.update commit_raw.json widgets.latest commit_raw.json devvv.near GenaDrop.MultiChainMinter commit_raw.json ProfilePage commit_raw.json ProfileTabs-fork commit_raw.json ProfileTabs commit_raw.json YourNFTs-fork commit_raw.json canny.comment.edit commit_raw.json df5989370ce26f2b6b25a5e6adbc6f184e00ea1007f4f2ffc161da859e61618d ProfilePage commit_raw.json Untitled-0 commit_raw.json dfi.near HelloAccountIdHeader commit_raw.json dgorton.near EmbedTest commit_raw.json sandbox-hello commit_raw.json diabloisnear.near WeAreDevsStatusBoard commit_raw.json dianab.near Mensajes commit_raw.json digi0617.near welcome to Near commit_raw.json digitalhouse.near ComponentDetailsPage commit_raw.json dima_sheleg.near DIG.Tabs commit_raw.json DevSuport.Main commit_raw.json DevSupport.Answer.Button.Valid commit_raw.json DevSupport.Answer.Edit commit_raw.json DevSupport.Answer.Feed commit_raw.json DevSupport.Answer commit_raw.json DevSupport.Compose commit_raw.json DevSupport.Discussion.Title commit_raw.json DevSupport.Feed commit_raw.json DevSupport.Main.Sidebar commit_raw.json DevSupport.Question.Button.Answers commit_raw.json DevSupport.Question.Button.Delete commit_raw.json DevSupport.Question.Button.Flag commit_raw.json DevSupport.Question.Button.Upvote commit_raw.json DevSupport.Question.Edit commit_raw.json DevSupport.Question.Page commit_raw.json DevSupport.Question.Preview commit_raw.json DevSupport.Question.PreviewDetailed commit_raw.json Ecosystem.Overview commit_raw.json NearOrg.Ecosystem.Community commit_raw.json NearOrg.Ecosystem.GetFunding commit_raw.json NearOrg.Ecosystem.GetFundingWrapper commit_raw.json NearOrg.Ecosystem.WorkAndEarn commit_raw.json Onboarding.ComponentCard commit_raw.json Onboarding.ComponentCollection commit_raw.json Onboarding.Starter-fork commit_raw.json Onboarding.Starter commit_raw.json Posts.Compose commit_raw.json StyledComponentButtonExample commit_raw.json Untitled-0 commit_raw.json Untitled-1 commit_raw.json dinesh55587.near Draft-0 commit_raw.json dinohodor.near Untitled-0 commit_raw.json discover.near Buttons.Green commit_raw.json ButtonsGreen commit_raw.json Components.Card commit_raw.json Components.DetailsPage commit_raw.json Components.Library commit_raw.json Components.Summary commit_raw.json Home.Builders commit_raw.json Home.Explore commit_raw.json Home.Hero commit_raw.json Home.Homepage commit_raw.json Home.HomepageSelector commit_raw.json Home.Index commit_raw.json Home.Projects commit_raw.json Home.Section commit_raw.json Home.SectionSwitcher commit_raw.json Home.UpcomingEvents commit_raw.json Home.WhatIsBOS commit_raw.json Home commit_raw.json HomeBuilders commit_raw.json HomeExplore commit_raw.json HomeHero commit_raw.json HomeProjects commit_raw.json HomeSection commit_raw.json HomeSectionSwitcher commit_raw.json HomeUpcomingEvents commit_raw.json Homepage commit_raw.json HomepageSelector commit_raw.json InfoSegment commit_raw.json Inputs.AccountId commit_raw.json Inputs.Distribution commit_raw.json Inputs.Integration commit_raw.json Inputs.MultiSelect commit_raw.json Inputs.Number commit_raw.json Inputs.Phase commit_raw.json Inputs.ProductType commit_raw.json Inputs.Select commit_raw.json Inputs.Text commit_raw.json Inputs.TextArea commit_raw.json Inputs.Verticals commit_raw.json InputsAccountId commit_raw.json InputsDistribution commit_raw.json InputsIntegration commit_raw.json InputsMultiSelect commit_raw.json InputsNumber commit_raw.json InputsPhase commit_raw.json InputsProductType commit_raw.json InputsSelect commit_raw.json InputsText commit_raw.json InputsTextArea commit_raw.json InputsVerticals commit_raw.json Project.Feed commit_raw.json Project.Form commit_raw.json Project.Index commit_raw.json Project.Module commit_raw.json Project.Page commit_raw.json Project.Provider commit_raw.json Project.ReviewBoard commit_raw.json Project.Settings commit_raw.json Project.SubmitButton commit_raw.json ProjectCard commit_raw.json ProjectFeed commit_raw.json ProjectForm commit_raw.json ProjectPage commit_raw.json ProjectReviewBoard commit_raw.json ProjectSettings commit_raw.json Search commit_raw.json test.test commit_raw.json djwine_official.near Boilerplate commit_raw.json HelloAccountID commit_raw.json HelloWorld commit_raw.json Leaderboard commit_raw.json ProfileTable commit_raw.json Table commit_raw.json dkralj.near Untitled-0 commit_raw.json dmitriy_sheleg.near AccountProfile commit_raw.json AccountProfileCard commit_raw.json DevSuport.Main commit_raw.json DevSupport.Answer.Button.Valid commit_raw.json DevSupport.Answer.Edit commit_raw.json DevSupport.Answer.Feed commit_raw.json DevSupport.Answer commit_raw.json DevSupport.Compose commit_raw.json DevSupport.Discussion.Title commit_raw.json DevSupport.Feed commit_raw.json DevSupport.Main.Sidebar commit_raw.json DevSupport.Question.Button.Answers commit_raw.json DevSupport.Question.Button.Delete commit_raw.json DevSupport.Question.Button.Flag commit_raw.json DevSupport.Question.Button.Upvote commit_raw.json DevSupport.Question.Edit commit_raw.json DevSupport.Question.Page commit_raw.json DevSupport.Question.Preview commit_raw.json DevSupport.Question.PreviewDetailed commit_raw.json Genie commit_raw.json GenieAnswerList commit_raw.json GenieAnswerView commit_raw.json GenieQuestionList commit_raw.json GenieQuestionView commit_raw.json ImageEditorTabsREVIEW commit_raw.json ImageEditorTabsTest commit_raw.json MetadataEditor-fork commit_raw.json MetadataEditor commit_raw.json MetadataEditorREVIEW commit_raw.json ProfileEditor commit_raw.json ProfileEditorREVIEW commit_raw.json ProfileEditorTest commit_raw.json SaveQuestion commit_raw.json SomeTestComponent commit_raw.json some-test-widget commit_raw.json do0k13.near DisplayCoins.Starter commit_raw.json Encode-do0k13-Widget commit_raw.json Untitled-0 commit_raw.json docs.bos-workspace.near PR.App commit_raw.json PR.Router commit_raw.json PR.Template commit_raw.json PR.adapter.github commit_raw.json components.Content commit_raw.json components.Header commit_raw.json components.Sidebar commit_raw.json document commit_raw.json edit commit_raw.json home commit_raw.json index commit_raw.json modal.create commit_raw.json settings commit_raw.json utils.adapter commit_raw.json utils.db commit_raw.json dokxo.near CommentCard commit_raw.json Compose.Affiliations commit_raw.json Compose.Platform commit_raw.json Compose.Profile commit_raw.json Compose.TagAndDeclaration commit_raw.json DannyMainScreen commit_raw.json FASTSBT commit_raw.json FASTSBT_Cabecera commit_raw.json FastSBT_Dropdown commit_raw.json FastSBT_Input commit_raw.json Lido commit_raw.json LoadingBar commit_raw.json NCD-nomination-compose-preview commit_raw.json NCD.Nomination.Compose.preview commit_raw.json NDC.Nomination.Candidate.Mobil commit_raw.json NDC.Nomination.Compose commit_raw.json NDC.Nomination.DeleteNomination commit_raw.json NDC.Nomination.Houses commit_raw.json Nomination_Candidate commit_raw.json Nomination_Name commit_raw.json ShareOptionsButton commit_raw.json TEstNominationCard commit_raw.json Untitled-0 commit_raw.json Untitled-1 commit_raw.json testProfile commit_raw.json donating.near DONATE-INSCRIBE commit_raw.json DonateDAO.dropdown commit_raw.json DonateDAO.main commit_raw.json DonateDAO.searchInput commit_raw.json DonateDAO.searchResult commit_raw.json donationhubv2.near donate commit_raw.json post commit_raw.json test commit_raw.json dorgon108.near 5Star commit_raw.json AccountProfile-Search-PostComponent commit_raw.json AccountProfile commit_raw.json AccountProfileCard commit_raw.json BugTest commit_raw.json CheckBox commit_raw.json ComponentCard-SearchAll commit_raw.json ComponentCard commit_raw.json DumbInput commit_raw.json FIlterComponent commit_raw.json FIlterPanel commit_raw.json Facets commit_raw.json FollowButton commit_raw.json FollowersList commit_raw.json Homepage commit_raw.json NearFunctionsTest commit_raw.json New-Widget-Rating-Form commit_raw.json NewWidgetForm commit_raw.json OverlayTest commit_raw.json Search commit_raw.json SearchPill commit_raw.json SearchPopup commit_raw.json SearchPopupFunctions commit_raw.json SearchPopupParent commit_raw.json SearchPost-SearchAll commit_raw.json SearchPost commit_raw.json SocialMarkdown commit_raw.json Star Rating Widget commit_raw.json Star-Rating-Static commit_raw.json Star-Rating-Widget commit_raw.json StyledComponentButtonExample commit_raw.json TestCollections commit_raw.json TestExport commit_raw.json ToolTipExample commit_raw.json TypeAheadExample commit_raw.json WidgetList commit_raw.json bugtest1 commit_raw.json dropdownAccountCard commit_raw.json props-test commit_raw.json testImport commit_raw.json doungh.near WeAreDevsStatusBoard commit_raw.json dropcast.near Alert commit_raw.json Select commit_raw.json account commit_raw.json airdrop commit_raw.json allowlist commit_raw.json components.Alert commit_raw.json dashboard commit_raw.json detail commit_raw.json discord commit_raw.json dropdown commit_raw.json import_bot commit_raw.json login commit_raw.json main commit_raw.json manager commit_raw.json project commit_raw.json register commit_raw.json sidebar commit_raw.json dund.near Storage_Freeing commit_raw.json zens commit_raw.json duocelot.near AddImage commit_raw.json AddImage_gpux commit_raw.json BRICK-ART commit_raw.json BRICK-DEFI commit_raw.json BRICK-DEGEN commit_raw.json BRICK-DEV commit_raw.json BRICK-GAME commit_raw.json BRICK-MKT commit_raw.json DIGIFI_LOGIN commit_raw.json GPTGrooves commit_raw.json Homepage_new commit_raw.json Image commit_raw.json ImageEditorTabs commit_raw.json Meme commit_raw.json Memes commit_raw.json NftImage commit_raw.json Profile commit_raw.json ProfileEditor commit_raw.json ProfileEditor_new commit_raw.json ProfilePage_new commit_raw.json Sky_Cross commit_raw.json TAGWALL commit_raw.json UsersMatcher commit_raw.json Voyager commit_raw.json Voyager_AI commit_raw.json Voyager_Generator commit_raw.json Weather commit_raw.json digifihackathon commit_raw.json error_001 commit_raw.json onboard commit_raw.json onboardHUB commit_raw.json s commit_raw.json smoke_test commit_raw.json teste commit_raw.json walletkeypom_sharddog commit_raw.json dydx4.near Index commit_raw.json dyne_k.near Greeting commit_raw.json dzhumanrm.near test-nearweek.com commit_raw.json test-nw.com commit_raw.json e0b0efdc641a50e91e54b55d669362bf93e02b6ed5024da0e305c6afd9ea03ed gdocs commit_raw.json e4bd61eb1b00901547fbecd75ce6ef047e0ae291dd6bfa9c1da52df25a49e5e9 Onboarding.Starter commit_raw.json e54aff1fd0decac010021f641f0e7947c159817aecf6d6ec83371d09df9e5672 ProfilePage commit_raw.json ThreadList commit_raw.json e5fb81d59683c942333b8f420ab667dcc33beeea5227c19350ca0c1c6b7439dd ApprendreDropDonacionCertBos commit_raw.json AprrendeDropCertBos commit_raw.json owaoct23 commit_raw.json e6334d18ab20c3ca9bfda37ae34458c44832ad3faced187912fb07f382b05aaf IEF commit_raw.json cochinita commit_raw.json createanattestation commit_raw.json created commit_raw.json galeriaconimg commit_raw.json polloconmole commit_raw.json seeattestation commit_raw.json seeattestation2 commit_raw.json subirreceta commit_raw.json e63ecd84d9f7bb67a2f72ae3f3956dafefc6e9965e39cdfdbce1538835b4629e Untitled-1-fork commit_raw.json Untitled-1 commit_raw.json e83a03613058827b81abbdf1c30badccf6b247160c46faeb18e3ec7629f98fb0 Articles commit_raw.json News commit_raw.json Quizzes commit_raw.json community commit_raw.json courses commit_raw.json support commit_raw.json e8794e6edab6fbd5467dd00ecdf030817330f61e295b91271e3e64d2d46747c8 AbrandContainer commit_raw.json DataCard commit_raw.json FormPage commit_raw.json ImageCard commit_raw.json NewsletterCard commit_raw.json PresentationCard commit_raw.json button_general commit_raw.json e9ffdac33b150951c850ae9a9f91274e327c4e7af6f10d4b0a699bd5eae6d99c atmosphere commit_raw.json atomosphere commit_raw.json eamondang.near Donate commit_raw.json SwitchButton commit_raw.json Tickets commit_raw.json earnestetim.near ProfileEditor commit_raw.json ProfilePage-IAH commit_raw.json post-fork commit_raw.json earthchange.near MagicBuild-earthchange.near commit_raw.json earthday.near ClimateClock commit_raw.json easypoll-v0.ndc-widgets.near Common.OpenSansFont commit_raw.json Common.Paginate commit_raw.json Common.Spinner commit_raw.json EasyPoll.CreatePoll.Header commit_raw.json EasyPoll.CreatePoll.QuestionType commit_raw.json EasyPoll.CreatePoll.Step1 commit_raw.json EasyPoll.CreatePoll.Step2 commit_raw.json EasyPoll.CreatePoll.Step2Question commit_raw.json EasyPoll.CreatePoll commit_raw.json EasyPoll.Data.GetAnswers commit_raw.json EasyPoll.Data.Table commit_raw.json EasyPoll.DeletePoll commit_raw.json EasyPoll.Inputs.Choices commit_raw.json EasyPoll.Inputs.DateTime commit_raw.json EasyPoll.Inputs.Footer commit_raw.json EasyPoll.Inputs.Image commit_raw.json EasyPoll.Inputs.OpinionScale commit_raw.json EasyPoll.Inputs.Options commit_raw.json EasyPoll.Inputs.PicturesOptions commit_raw.json EasyPoll.Inputs.Text commit_raw.json EasyPoll.Inputs.Toggle commit_raw.json EasyPoll.Inputs.YesNo commit_raw.json EasyPoll.MyPolls commit_raw.json EasyPoll.PollCard commit_raw.json EasyPoll.PollDetails commit_raw.json EasyPoll.PollMoreOptions commit_raw.json EasyPoll.PollTags commit_raw.json EasyPoll.Polls commit_raw.json EasyPoll.Sidebar commit_raw.json EasyPoll.UserLabel commit_raw.json EasyPoll.ViewPoll commit_raw.json EasyPoll.Vote commit_raw.json EasyPoll commit_raw.json easypoll.near EasyPoll commit_raw.json Profile commit_raw.json allVotingWidget commit_raw.json answer_poll-comment-container commit_raw.json answersHeader commit_raw.json displayQuestionHeader commit_raw.json minimalistQuestionGeneralInfo commit_raw.json minimalistQuestionHeader commit_raw.json newMiniMultipleChoiceInterface commit_raw.json newPollQuestionInterface commit_raw.json newTextAnswerInterface commit_raw.json newVotingInterface commit_raw.json pollQuestionMasterHandler commit_raw.json questionsByCreator commit_raw.json shareWidget commit_raw.json showQuestionsHandler commit_raw.json voteMultipleChoice commit_raw.json voteWithText commit_raw.json eb53ec39ee209676105891c095fcde81fde9671d3155e92da2486c2f6c080c9d Profile commit_raw.json ProfileDev commit_raw.json coinSelect commit_raw.json ebcf2af7ee0a89f3de0d5ca125069f64ee966b68a9b9eb5216751d6a8de89c01 Composition commit_raw.json Greeter commit_raw.json GreeterGoodOnion commit_raw.json GreeterToday commit_raw.json HelloNEAR commit_raw.json LiquityOpenTroveSepoliaExample commit_raw.json MyProfilePage commit_raw.json collegium.bos.wk3.MyPosts commit_raw.json collegium.bos.wk3.SocialWidget commit_raw.json ebcf2af7ee0a89f3de0d5ca125069f64ee966b68a9b9eb5216751d6a8de89c01.LiquityOpenTroveSepoliaExample commit_raw.json g00dOnion.LiquidityOpenTroveSepoliaExample commit_raw.json ecarrion.near Onboarding.Starter commit_raw.json ProfilePage-eddie commit_raw.json ProfilePage-fork-fork commit_raw.json core-fork commit_raw.json x13-Hacks commit_raw.json ece61a112fbb05b5ff96fd4d63cb259c4bae966477829666d46ddc4e5121d801 Chat commit_raw.json eclipseeer.near Heroes commit_raw.json ed-michel.near Draft-0 commit_raw.json eddb8bda911d902ebd50c62335b25e72ab0feb85fe76745f79821436d2d17812 ForkThis commit_raw.json edgeai.near Edge.Views.Home commit_raw.json edigal.near Greeting commit_raw.json edioo.near WeAreDevsStatusBoard commit_raw.json edmundbillings.near everything commit_raw.json educnear.near educnear commit_raw.json eduohe.near Analytics.FastAuthByDate commit_raw.json Analytics.Snoopy commit_raw.json NearConAppIndex commit_raw.json edwardkcyu.near AstroBountiesCommentEditor commit_raw.json AstroBountiesParticipantEditor commit_raw.json AstroFeedback commit_raw.json InfiniteScrollAstro commit_raw.json ListAstroBounties commit_raw.json efiz.near AbstractionHacks.Submit commit_raw.json App.Header commit_raw.json App.Video.browse commit_raw.json App.Video.card commit_raw.json App.Video.create commit_raw.json App.Video.view commit_raw.json App.index commit_raw.json Boxes commit_raw.json Buttons.Green commit_raw.json Calendar commit_raw.json Camera commit_raw.json Chat.create commit_raw.json Chat.index commit_raw.json Chat commit_raw.json CommitThing commit_raw.json Common.Camera commit_raw.json Common.Compose commit_raw.json Common.Dropdown commit_raw.json Common.Layout.Header commit_raw.json Community.Posts.Compose commit_raw.json Community.Posts commit_raw.json Create.Image commit_raw.json Create commit_raw.json DAO.Page commit_raw.json Dashboard commit_raw.json Default commit_raw.json DeploySomething commit_raw.json DonateNEARtoEfiz commit_raw.json Edge commit_raw.json Embed.Creator commit_raw.json EventCalendar commit_raw.json Every.Account commit_raw.json Every.Document.Create commit_raw.json Every.Document.View commit_raw.json Every.Feed.Create commit_raw.json Every.Feed.View commit_raw.json Every.Idea.Create commit_raw.json Every.Idea.View commit_raw.json Every.Image.Create commit_raw.json Every.Image.View commit_raw.json Every.Node commit_raw.json Every.Paragraph.Create commit_raw.json Every.Paragraph.View commit_raw.json Every.Post.Create commit_raw.json Every.Post.View commit_raw.json Every.Post commit_raw.json Every.Raw.Edit commit_raw.json Every.Raw.View commit_raw.json Every.Setting commit_raw.json Every.Settings commit_raw.json Every.Thing.Create commit_raw.json Every.Thing.Embed commit_raw.json Every.Thing.History commit_raw.json Every.Thing.View commit_raw.json Every.Thing commit_raw.json Every.Tree commit_raw.json Every.Type.Create commit_raw.json Everything.All.Things commit_raw.json Everything.Bob commit_raw.json Everything.Create.Article commit_raw.json Everything.Create.Artwork commit_raw.json Everything.Create.Category commit_raw.json Everything.Create.Event commit_raw.json Everything.Create.Image commit_raw.json Everything.Create.Item commit_raw.json Everything.Create.Organization commit_raw.json Everything.Create.Page commit_raw.json Everything.Create.Pants commit_raw.json Everything.Create.Photo commit_raw.json Everything.Create.Post commit_raw.json Everything.Create.Putter commit_raw.json Everything.Create.Service commit_raw.json Everything.Create.shirts commit_raw.json Everything.Node commit_raw.json Everything.Summary.Article commit_raw.json Everything.Summary.Artwork commit_raw.json Everything.Summary.Category commit_raw.json Everything.Summary.Event commit_raw.json Everything.Summary.Image commit_raw.json Everything.Summary.Item commit_raw.json Everything.Summary.Organization commit_raw.json Everything.Summary.Pants commit_raw.json Everything.Summary.Photo commit_raw.json Everything.Summary.Post commit_raw.json Everything.Summary.Putter commit_raw.json Everything.Summary.Service commit_raw.json Everything.Summary.shirts commit_raw.json Everything.Template commit_raw.json Everything.Tree commit_raw.json Everything.View.Article commit_raw.json Everything.View.Artwork commit_raw.json Everything.View.Category commit_raw.json Everything.View.Event commit_raw.json Everything.View.Idea commit_raw.json Everything.View.Item commit_raw.json Everything.View.Organization commit_raw.json Everything.View.Pants commit_raw.json Everything.View.Photo commit_raw.json Everything.View.Putter commit_raw.json Everything.View.Service commit_raw.json Everything.View.Thing commit_raw.json Everything.View.shirts commit_raw.json Everything commit_raw.json Explorer commit_raw.json Feed commit_raw.json Form.Input commit_raw.json Genadrop.NFTMint commit_raw.json Gigs.Board commit_raw.json Gigs.Template commit_raw.json GitBos commit_raw.json Grid commit_raw.json HiddenAccountManager commit_raw.json IndexFeed commit_raw.json Inputs.File commit_raw.json InteractiveQuestionaire commit_raw.json ItemFeed commit_raw.json Library.Overview commit_raw.json Library.index commit_raw.json Livepeer.Creator.demo commit_raw.json Livepeer.Creator commit_raw.json Livepeer.Player.demo commit_raw.json Livepeer.Player commit_raw.json MagicBuild-widget-form-1698248627839 commit_raw.json MainPage.Content commit_raw.json Map.Form commit_raw.json Map.Inspect commit_raw.json Map.Mapbox commit_raw.json Map.demo commit_raw.json Map.index commit_raw.json Mapbox commit_raw.json Me commit_raw.json MergedIndexFeed commit_raw.json Modal commit_raw.json Module.ContextMenu.demo commit_raw.json Module.ContextMenu commit_raw.json Module.DropdownMenu commit_raw.json Module.Feed commit_raw.json Module.SputnikDAO commit_raw.json Module.Thing commit_raw.json MonacoEditor commit_raw.json MusicPlayer-Harmonic.Track commit_raw.json MusicPlayer-Harmonic commit_raw.json N commit_raw.json NYC.Home commit_raw.json NYC.OpenData.Communities commit_raw.json NYC.Social commit_raw.json NearSocialBridgeCore commit_raw.json Node commit_raw.json PR.FilteredIndexFeed commit_raw.json PR.IndexFeed commit_raw.json PageBuilder commit_raw.json Place4Us commit_raw.json Plate commit_raw.json PollQuestion commit_raw.json Post.View commit_raw.json Posts-Domains-1 commit_raw.json Posts-Keys-1 commit_raw.json Posts.Compose-Domains-1 commit_raw.json Posts.Compose-Keys-1 commit_raw.json Posts.Compose commit_raw.json Posts.Feed-Domains-1 commit_raw.json Posts.Feed-Keys-1 commit_raw.json Posts.Feed.Item commit_raw.json Posts.Feed commit_raw.json Posts.Post-Keys-1 commit_raw.json Posts.Post commit_raw.json Posts commit_raw.json PropChecker.Sample commit_raw.json RatSightings commit_raw.json SBT.Badge commit_raw.json Sharddog.Function commit_raw.json Sharddog.Image commit_raw.json Sharddog.River commit_raw.json Sharddog.Template commit_raw.json Sharddog commit_raw.json ShoppingCartDemo.cart commit_raw.json ShoppingCartDemo.list commit_raw.json ShoppingCartDemo commit_raw.json SimpleMDE commit_raw.json SocialGraph commit_raw.json SocialMarkdown commit_raw.json StartHere commit_raw.json Storage.getGateway commit_raw.json Storage.setGateway commit_raw.json SwitchCase commit_raw.json TaggedWidgets commit_raw.json Test.View.Page commit_raw.json Test commit_raw.json Thing.Test commit_raw.json Thing.template commit_raw.json Thing commit_raw.json Things.index commit_raw.json Things.list commit_raw.json Things commit_raw.json Tree commit_raw.json UncachedMergedIndexFeed commit_raw.json UserLocation commit_raw.json Vibes.Feed.Post.Location commit_raw.json Vibes.tastemakerCode commit_raw.json Video commit_raw.json View commit_raw.json action.default commit_raw.json action commit_raw.json app.create commit_raw.json app commit_raw.json blogging.sample commit_raw.json browser-expr commit_raw.json browser commit_raw.json button.create commit_raw.json core commit_raw.json create commit_raw.json creator commit_raw.json dev.cta commit_raw.json dev.library commit_raw.json docs.card.v2 commit_raw.json docs.card commit_raw.json draw commit_raw.json evaporation commit_raw.json event.sample commit_raw.json every.app.action.button commit_raw.json every.app.header.mobile commit_raw.json every.app.homepage commit_raw.json every.app.left.menu commit_raw.json every.array.build commit_raw.json every.dao.card commit_raw.json every.dao.view commit_raw.json every.edge.create commit_raw.json every.edge.view commit_raw.json every.edge commit_raw.json every.event.view commit_raw.json every.event commit_raw.json every.feed.view commit_raw.json every.feed commit_raw.json every.hashtag.view commit_raw.json every.hashtag commit_raw.json every.library.view commit_raw.json every.list.view commit_raw.json every.markdown.create commit_raw.json every.markdown.view commit_raw.json every.md.create commit_raw.json every.module commit_raw.json every.placeholder.create commit_raw.json every.placeholder.view commit_raw.json every.post.v2 commit_raw.json every.post.view commit_raw.json every.post commit_raw.json every.project.view commit_raw.json every.sidepanel.default commit_raw.json every.sidepanel commit_raw.json every.tag commit_raw.json every.thing.advanced commit_raw.json every.thing.build commit_raw.json every.thing.create commit_raw.json every.thing.duplicate commit_raw.json every.thing.edit commit_raw.json every.thing.editor.provider commit_raw.json every.thing.editor commit_raw.json every.thing.filters commit_raw.json every.thing.raw commit_raw.json every.thing.view commit_raw.json every.thing commit_raw.json every.topic.create commit_raw.json every.topic.view commit_raw.json every.type.create commit_raw.json every.type.metadata commit_raw.json every.type commit_raw.json every.vibe.create commit_raw.json every.vibe.view commit_raw.json every.vibe commit_raw.json every commit_raw.json everything-docs commit_raw.json everything.sdk commit_raw.json everything commit_raw.json experiment.function commit_raw.json experiment.marquee commit_raw.json experimental.feed.layer1 commit_raw.json experimental.feed.layer2 commit_raw.json experimental.mapbox commit_raw.json expr.event.creator commit_raw.json fun.template commit_raw.json gigs-board.entity.community.header commit_raw.json index commit_raw.json issue.modules commit_raw.json jsinrust commit_raw.json library commit_raw.json marquee commit_raw.json mint commit_raw.json nft-marketplace commit_raw.json overview commit_raw.json page.submit commit_raw.json placeholder commit_raw.json post.feed commit_raw.json print commit_raw.json repository.content commit_raw.json sample.StyledComponentsStateUpdates commit_raw.json sample.ndc-layout commit_raw.json sample.personal commit_raw.json sample.proofofvibes commit_raw.json sample.track commit_raw.json star.button commit_raw.json team.builder commit_raw.json test.ceramic commit_raw.json test.markdown commit_raw.json test.template commit_raw.json test.test commit_raw.json test commit_raw.json thomagotchi-game1 commit_raw.json tldraw.hello commit_raw.json useStateImageUpload commit_raw.json v2.every.thing commit_raw.json view.page commit_raw.json view commit_raw.json voyager.content.index commit_raw.json voyager.header.index commit_raw.json voyager.index commit_raw.json voyager.item commit_raw.json voyager.provider commit_raw.json voyager.sidebar.index commit_raw.json welcome commit_raw.json ejj.near swap commit_raw.json AssetListItem commit_raw.json AssetListModal commit_raw.json TokenData commit_raw.json dex-data commit_raw.json dex commit_raw.json swap commit_raw.json election.ndctools.near NDC.Elections.Activities commit_raw.json NDC.Elections.BudgetPackage commit_raw.json NDC.Elections.CandidateItem commit_raw.json NDC.Elections.Candidates commit_raw.json NDC.Elections.CastVotes commit_raw.json NDC.Elections.Filter commit_raw.json NDC.Elections.Header commit_raw.json NDC.Elections.Houses commit_raw.json NDC.Elections.Main commit_raw.json NDC.Elections.Progress commit_raw.json NDC.Elections.Statistic commit_raw.json NDC.Elections.Voters commit_raw.json NDC.Nomination.Candidate.MobileView commit_raw.json NDC.Nomination.Page commit_raw.json NDC.Stepper commit_raw.json NDC.StyledComponents commit_raw.json elektromania.near elektromania.near_584ce0b1-9a0e-497a-b77e-55a661245c41 commit_raw.json elliotbraem.near Everything.Create.Furniture commit_raw.json Everything.Create.Item commit_raw.json Everything.Summary.Furniture commit_raw.json Everything.Summary.Item commit_raw.json Everything.View.Furniture commit_raw.json Everything.View.Item commit_raw.json Everything commit_raw.json elmatadorrr.near Untitled-0 commit_raw.json embeds.near Creator commit_raw.json Embed commit_raw.json EmbedPlugin commit_raw.json Feed commit_raw.json Marketplace commit_raw.json Plugin.Creator commit_raw.json Plugin.Index commit_raw.json Plugin.Marketplace commit_raw.json Plugin.Settings commit_raw.json Poll commit_raw.json Post.Content commit_raw.json Post.Editor commit_raw.json Post.Index commit_raw.json Settings commit_raw.json emekason1.near Friends commit_raw.json emmanuelsayre.near APPRENDEDROP commit_raw.json emojp.near Draft-0 commit_raw.json energihub.near EnergiHub-Web commit_raw.json equalkale.near Nft-Page commit_raw.json Untitled-0 commit_raw.json equalquiche.near second-test commit_raw.json erditkurteshi.near Homepage commit_raw.json New-component commit_raw.json erik.near AllWidgetsWithSearch commit_raw.json MyWidgets commit_raw.json SimpleStart commit_raw.json Welcome-deprecated commit_raw.json Welcome commit_raw.json Widgets commit_raw.json dTweeter commit_raw.json micropost commit_raw.json espen.near DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json app commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.url commit_raw.json devhub.components.atom.Alert commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.layout.LikeButton.Faces commit_raw.json devhub.components.molecule.AccountAutocomplete commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.Input commit_raw.json devhub.components.molecule.ListEditor commit_raw.json devhub.components.molecule.MarkdownEditor commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.SimpleMDE commit_raw.json devhub.components.molecule.Switch commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.provider commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Activity commit_raw.json devhub.entity.community.Card commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AccessControlConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.History commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.entity.team.Configurator commit_raw.json devhub.entity.team.LabelPermissions commit_raw.json devhub.entity.team.LabelRow commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.page.about commit_raw.json devhub.page.admin.homepageTab commit_raw.json devhub.page.admin.index commit_raw.json devhub.page.admin.moderatorsTab commit_raw.json devhub.page.admin.restrictedLabelsTab commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.contribute commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json gigs-board.components.atom.icon commit_raw.json gigs-board.components.atom.spinner commit_raw.json gigs-board.components.atom.tag commit_raw.json gigs-board.components.atom.toggle commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.molecule.breadcrumbs commit_raw.json gigs-board.components.molecule.button-switch commit_raw.json gigs-board.components.molecule.button commit_raw.json gigs-board.components.molecule.markdown-editor commit_raw.json gigs-board.components.molecule.markdown-viewer commit_raw.json gigs-board.components.molecule.profile-card commit_raw.json gigs-board.components.molecule.text-input commit_raw.json gigs-board.components.molecule.tile commit_raw.json gigs-board.components.organism.configurator commit_raw.json gigs-board.components.template.app-layout commit_raw.json gigs-board.entity.community.branding-configurator commit_raw.json gigs-board.entity.community.configurator commit_raw.json gigs-board.entity.community.header commit_raw.json gigs-board.entity.community.layout commit_raw.json gigs-board.entity.community.sidebar commit_raw.json gigs-board.entity.community.spawner commit_raw.json gigs-board.entity.post.CompactPost commit_raw.json gigs-board.entity.post.History commit_raw.json gigs-board.entity.post.Post commit_raw.json gigs-board.entity.post.PostEditor commit_raw.json gigs-board.entity.team.LabelsPermissions commit_raw.json gigs-board.entity.team.TeamInfo commit_raw.json gigs-board.entity.workspace.github-ticket commit_raw.json gigs-board.entity.workspace.github-view commit_raw.json gigs-board.entity.workspace.kanban-view commit_raw.json gigs-board.entity.workspace.post-ticket commit_raw.json gigs-board.feature.post-search.by-tag commit_raw.json gigs-board.feature.workspace.github-view-configurator commit_raw.json gigs-board.feature.workspace.kanban-view-configurator commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Feed commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.communities commit_raw.json gigs-board.pages.community.activity commit_raw.json gigs-board.pages.community.board commit_raw.json gigs-board.pages.community.configuration commit_raw.json gigs-board.pages.community.github commit_raw.json gigs-board.pages.community.teams commit_raw.json gigs-board.pages.community.telegram commit_raw.json gigs-board.pages.community.wiki commit_raw.json estherlourenco.near ProfilePage commit_raw.json ethden.near BosHomepage commit_raw.json TokenList commit_raw.json TokenWithBalance commit_raw.json ethpraguedemo.near Lido-fork commit_raw.json Plague commit_raw.json Progress-Pool-Grantees commit_raw.json Progress-Pool-Proposals-Discussion-Title commit_raw.json Progress-Pool-Proposals-Feed-Index commit_raw.json Progress-Pool-Proposals-Feed commit_raw.json Progress-Pool-Proposals-Question-Edit commit_raw.json Progress-Pool-Proposals-Sidebar commit_raw.json Progress-Pool-Proposals commit_raw.json Progress-Pool-Question-Button-Downvote commit_raw.json Progress-Pool-Question-Button-Upvote commit_raw.json Progress-Pool-Question-Preview commit_raw.json Progress-Pool-Voters commit_raw.json Progress-Pool commit_raw.json test commit_raw.json euclid.near AddMemberProposal commit_raw.json AllProjects commit_raw.json ProjectMetadata commit_raw.json ProjectSource commit_raw.json WidgetSource commit_raw.json act_proposal commit_raw.json genadropMinter commit_raw.json eugenewolf507.near CheckIcon commit_raw.json CloseIcon commit_raw.json Draft_CheckStructureCommentsIndex commit_raw.json Draft_Eugene2 commit_raw.json Draft_Eugene3 commit_raw.json Draft_FilterArticles commit_raw.json Draft_FunctionNotWidget commit_raw.json Draft_IFrame commit_raw.json Draft_MetadataEditor commit_raw.json Draft_SaveArticleInPostsWithIndex commit_raw.json Draft_SaveArticlesPerUser commit_raw.json Draft_UtilsFunctions commit_raw.json Gigs commit_raw.json Gigs_AllArticlesList.Card commit_raw.json Gigs_AllArticlesList.OneArticle commit_raw.json Gigs_AllArticlesList commit_raw.json Gigs_CreateArticle commit_raw.json Gigs_MainNavigation commit_raw.json Gigs_Tag commit_raw.json Jack2WikiTest commit_raw.json JackWikiTest commit_raw.json SayALot_AllArticlesList commit_raw.json ShareIcon commit_raw.json TestWiki_Authors commit_raw.json TestWiki_CreateArticle commit_raw.json TestWiki_Main commit_raw.json WikiOnSocialDB commit_raw.json WikiOnSocialDB_AllArticlesList commit_raw.json WikiOnSocialDB_ArticlesByAuthor commit_raw.json WikiOnSocialDB_ArticlesByTag commit_raw.json WikiOnSocialDB_ArticlesByUser commit_raw.json WikiOnSocialDB_Authors commit_raw.json WikiOnSocialDB_Comment.Compose commit_raw.json WikiOnSocialDB_Comment.Feed commit_raw.json WikiOnSocialDB_Comment commit_raw.json WikiOnSocialDB_CreateArticle commit_raw.json WikiOnSocialDB_History.ArticleHistory commit_raw.json WikiOnSocialDB_History.ArticleHistoryCard commit_raw.json WikiOnSocialDB_History.History commit_raw.json WikiOnSocialDB_History commit_raw.json WikiOnSocialDB_Like commit_raw.json WikiOnSocialDB_MainNavigation commit_raw.json WikiOnSocialDB_ManualIndexFeed commit_raw.json WikiOnSocialDB_OneArticle.Footer commit_raw.json WikiOnSocialDB_OneArticle commit_raw.json WikiOnSocialDB_TagList commit_raw.json WikiOnSocialDB_TooltipProfiles commit_raw.json | |\n| data | path to data files to supply the data that will be passed into templates. |\n| engine | engine to be used for processing templates. Handlebars is the default. |\n| ext | extension to be used for dest files. |\n\nRight aligned columns\n\n| Option | Description |\n| evaluator.near Curriculum.ComplexInput commit_raw.json Curriculum.ComplexInputAdvanced commit_raw.json Curriculum.GuestBook commit_raw.json Curriculum.GuestBookMD commit_raw.json Curriculum.HelloNear commit_raw.json Curriculum.HelloNearMD commit_raw.json Curriculum.XCC commit_raw.json Evaluate commit_raw.json Footer commit_raw.json Main commit_raw.json Menu commit_raw.json Modal commit_raw.json NCD.Lessons.Evaluation-1 commit_raw.json NCD.Lessons.GuestBook commit_raw.json NCD.Lessons.HelloNear commit_raw.json NCD.Main commit_raw.json NCD.Menu commit_raw.json NCD.Pages.Home commit_raw.json NCD.Pages.Prerequisites commit_raw.json NCD.Pages.Progress commit_raw.json NCD.Pages.Setup commit_raw.json Pages.About commit_raw.json Pages.FAQ commit_raw.json Pages.Prerequisites commit_raw.json Pages.Progress commit_raw.json app commit_raw.json evangel.near Draft-0 commit_raw.json ShareButton commit_raw.json ShareButtonUA commit_raw.json connect.button commit_raw.json connect commit_raw.json quiz.bos commit_raw.json quizTurkiye commit_raw.json quizUA commit_raw.json test1 commit_raw.json events-calendar.near EventsCalendar commit_raw.json EventsCalendarLatam commit_raw.json events-committee.near DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json app commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.common commit_raw.json core.lib.data-request commit_raw.json core.lib.stringUtils commit_raw.json core.lib.struct commit_raw.json core.lib.url commit_raw.json core.lib.uuid commit_raw.json devhub.components.atom.Alert commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.feed.MergedIndexFeed commit_raw.json devhub.components.feed.SubscribedFeed commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.connect commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.layout.LikeButton.Faces commit_raw.json devhub.components.molecule.AccountAutocomplete commit_raw.json devhub.components.molecule.BadgeDetails commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.Checkbox commit_raw.json devhub.components.molecule.CommunityControl commit_raw.json devhub.components.molecule.Compose commit_raw.json devhub.components.molecule.DropDown commit_raw.json devhub.components.molecule.DropDownWithSearch commit_raw.json devhub.components.molecule.Input commit_raw.json devhub.components.molecule.ListEditor commit_raw.json devhub.components.molecule.MarkdownEditor commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.ProfileLine commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.SimpleMDE commit_raw.json devhub.components.molecule.Spinner commit_raw.json devhub.components.molecule.Switch commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Feed.NearQueryApi commit_raw.json devhub.components.organism.Feed commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.provider commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.github.Viewer commit_raw.json devhub.entity.addon.github.kanban_board commit_raw.json devhub.entity.addon.github.kanban_ticket commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.kanban.post_board commit_raw.json devhub.entity.addon.kanban.post_ticket commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.telegram.Viewer commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Activity commit_raw.json devhub.entity.community.Announcements commit_raw.json devhub.entity.community.Card commit_raw.json devhub.entity.community.Compose commit_raw.json devhub.entity.community.Discussions commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AccessControlConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.History commit_raw.json devhub.entity.post.List commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Post commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.entity.proposal.AccountInput commit_raw.json devhub.entity.proposal.CategoryDropdown commit_raw.json devhub.entity.proposal.CategoryTag commit_raw.json devhub.entity.proposal.CommentIcon commit_raw.json devhub.entity.proposal.CommentsAndLogs commit_raw.json devhub.entity.proposal.ComposeComment commit_raw.json devhub.entity.proposal.ConfirmCancelModal commit_raw.json devhub.entity.proposal.ConfirmReviewModal commit_raw.json devhub.entity.proposal.Editor commit_raw.json devhub.entity.proposal.Feed commit_raw.json devhub.entity.proposal.History commit_raw.json devhub.entity.proposal.LikeButton commit_raw.json devhub.entity.proposal.LinkedProposalsDropdown commit_raw.json devhub.entity.proposal.LoginScreen commit_raw.json devhub.entity.proposal.MultiSelectLabelsDropdown commit_raw.json devhub.entity.proposal.Profile commit_raw.json devhub.entity.proposal.Proposal commit_raw.json devhub.entity.proposal.StatusTag commit_raw.json devhub.entity.proposal.VerificationStatus commit_raw.json devhub.entity.team.Configurator commit_raw.json devhub.entity.team.LabelPermissions commit_raw.json devhub.entity.team.LabelRow commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.feature.proposal-search.by-author commit_raw.json devhub.feature.proposal-search.by-category commit_raw.json devhub.feature.proposal-search.by-input commit_raw.json devhub.feature.proposal-search.by-sort commit_raw.json devhub.feature.proposal-search.by-stage commit_raw.json devhub.notification.Item commit_raw.json devhub.notification.LR commit_raw.json devhub.notification.Left commit_raw.json devhub.notification.Right commit_raw.json devhub.page.about commit_raw.json devhub.page.addon commit_raw.json devhub.page.admin.homepageTab commit_raw.json devhub.page.admin.index commit_raw.json devhub.page.admin.moderatorsTab commit_raw.json devhub.page.admin.restrictedLabelsTab commit_raw.json devhub.page.announcements commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.community.index commit_raw.json devhub.page.contribute commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json devhub.page.proposals commit_raw.json events.efiz.near app commit_raw.json components.Navbar commit_raw.json components commit_raw.json events.Calendar commit_raw.json events.Card commit_raw.json events.ListView commit_raw.json events.MonthView commit_raw.json page.button commit_raw.json page.home commit_raw.json page.launch commit_raw.json page.metadata commit_raw.json page.preview commit_raw.json page.router commit_raw.json page.styles commit_raw.json events_v1.near _ commit_raw.json app__.env commit_raw.json app__frame commit_raw.json app__layout_controller commit_raw.json app__layouts___dynamic commit_raw.json app__layouts__container commit_raw.json app__layouts__default commit_raw.json app__layouts__dropdown_item commit_raw.json app__layouts__modal commit_raw.json app__time_giver commit_raw.json events__.env commit_raw.json events___form commit_raw.json events___form__image_component commit_raw.json events__app commit_raw.json events__components__buttons__delete_event commit_raw.json events__components__dropdown_item commit_raw.json events__components__event_date commit_raw.json events__components__event_image_slider commit_raw.json events__delete_event commit_raw.json events__edit commit_raw.json events__index commit_raw.json events__index__list commit_raw.json events__index__list_container commit_raw.json events__index__list_item commit_raw.json events__layouts__container commit_raw.json events__layouts__default commit_raw.json events__layouts__dropdown_item commit_raw.json events__layouts__modal commit_raw.json events__my_events commit_raw.json events__new commit_raw.json events__not_found commit_raw.json events__show commit_raw.json events_app____form__image_component commit_raw.json events_app___form commit_raw.json events_app___form__image_component commit_raw.json events_app__app commit_raw.json events_app__components__dropdown_item commit_raw.json events_app__delete_event_button commit_raw.json events_app__edit commit_raw.json events_app__index commit_raw.json events_app__index__list commit_raw.json events_app__index__list_container commit_raw.json events_app__index__list_item commit_raw.json events_app__new commit_raw.json events_app__show commit_raw.json events_v1.near_13990276-c294-4d0a-8783-e01ee83530bc commit_raw.json events_v1.near_90ce60f4-18cf-4670-a479-d61a6ac8a915 commit_raw.json events_v2.near Test2 commit_raw.json app__frame commit_raw.json app__layout_controller commit_raw.json app__loading commit_raw.json components__event_date commit_raw.json components__event_image_slider commit_raw.json components__image commit_raw.json components__search-bar commit_raw.json components__search_bar commit_raw.json event_lists___form commit_raw.json event_lists__add_events commit_raw.json event_lists__app commit_raw.json event_lists__change_events commit_raw.json event_lists__edit commit_raw.json event_lists__index commit_raw.json event_lists__index__container commit_raw.json event_lists__index__list-big commit_raw.json event_lists__index__list commit_raw.json event_lists__index__list__big commit_raw.json event_lists__index__list__item commit_raw.json event_lists__index__list__item__big commit_raw.json event_lists__index__list__item__default commit_raw.json event_lists__index__list__item__with_events commit_raw.json event_lists__index__list__small commit_raw.json event_lists__index__list_container commit_raw.json event_lists__index__list_item commit_raw.json event_lists__new commit_raw.json event_lists__show commit_raw.json events__.env commit_raw.json events___form commit_raw.json events___form__image_component commit_raw.json events__app commit_raw.json events__components__buttons__delete_event commit_raw.json events__components__dropdown_item commit_raw.json events__components__event_date commit_raw.json events__components__event_image_slider commit_raw.json events__edit commit_raw.json events__index commit_raw.json events__index__list commit_raw.json events__index__list_container commit_raw.json events__index__list_item commit_raw.json events__layouts__container commit_raw.json events__layouts__default commit_raw.json events__layouts__modal commit_raw.json events__my_events commit_raw.json events__new commit_raw.json events__not_found commit_raw.json events__show commit_raw.json layouts__container commit_raw.json layouts__default commit_raw.json layouts__loading commit_raw.json layouts__modal commit_raw.json everettbu.near ActivityPage commit_raw.json FeaturedComponents commit_raw.json LandingPage commit_raw.json SocialPage commit_raw.json every.efiz.near create commit_raw.json every.near Create.Any commit_raw.json GrantPermissions commit_raw.json Settings commit_raw.json everycanvas.near Embed commit_raw.json GrantPermissions commit_raw.json History.CodeHistoryCard commit_raw.json History.RenderCode commit_raw.json History commit_raw.json ItemFeed commit_raw.json action commit_raw.json adapter.ipfs commit_raw.json adapter.local_storage commit_raw.json app commit_raw.json canvas.app commit_raw.json canvas.core commit_raw.json canvas.edit commit_raw.json canvas.post commit_raw.json canvas.view commit_raw.json code.edit commit_raw.json code.view commit_raw.json create.hyperfile commit_raw.json feed.index commit_raw.json hyperfile.create commit_raw.json hyperfile.load commit_raw.json index commit_raw.json load.hyperfile commit_raw.json magic commit_raw.json markdown.edit commit_raw.json markdown.view commit_raw.json modal commit_raw.json module.request commit_raw.json near-openai commit_raw.json other.core commit_raw.json other.edit commit_raw.json other.view commit_raw.json provider commit_raw.json request.merge commit_raw.json save commit_raw.json sharezone commit_raw.json sidebar commit_raw.json tldraw.Action commit_raw.json tldraw.ShareZone commit_raw.json tldraw.TopZone commit_raw.json topzone commit_raw.json evietwo.near Hello commit_raw.json Index commit_raw.json JuniorsDao commit_raw.json MedEase commit_raw.json PatientComponent commit_raw.json Untitled-0 commit_raw.json nearscript commit_raw.json evrything-docs.near Everything.Create.Document commit_raw.json Everything.Create.Test commit_raw.json Everything.Create.Test2 commit_raw.json Everything.Create.Type commit_raw.json Everything.Documentation commit_raw.json Everything.Summary.Document commit_raw.json Everything.Summary.Test commit_raw.json Everything.Summary.Test2 commit_raw.json Everything.View.Document commit_raw.json Everything.View.Test commit_raw.json Everything.View.Test2 commit_raw.json Everything commit_raw.json StartHere commit_raw.json evrything-docs.near widget Everything.Create.Test commit_raw.json Everything.Summary.Test commit_raw.json Everything.View.Test commit_raw.json evrything.near Bridge commit_raw.json Calendar commit_raw.json Community.Posts.Compose commit_raw.json Every commit_raw.json Everything.All.Things commit_raw.json Everything.Create.Editable commit_raw.json Everything.Create.Event commit_raw.json Everything.Create.Idea commit_raw.json Everything.Create.Image commit_raw.json Everything.Create.Note commit_raw.json Everything.Create.Page commit_raw.json Everything.Create.Test commit_raw.json Everything.Create.Thing commit_raw.json Everything.Create.Tool commit_raw.json Everything.Create.Type commit_raw.json Everything.Create.Video commit_raw.json Everything.CreatePage commit_raw.json Everything.Creators commit_raw.json Everything.Error commit_raw.json Everything.MainPage commit_raw.json Everything.Search commit_raw.json Everything.Summary.Event commit_raw.json Everything.Summary.Idea commit_raw.json Everything.Summary.Image commit_raw.json Everything.Summary.Note commit_raw.json Everything.Summary.Thing commit_raw.json Everything.Summary.Video commit_raw.json Everything.Template commit_raw.json Everything.Things commit_raw.json Everything.Type.Create commit_raw.json Everything.Type.Details commit_raw.json Everything.Type.Overview commit_raw.json Everything.View.Editable commit_raw.json Everything.View.Event commit_raw.json Everything.View.Idea commit_raw.json Everything.View.Image commit_raw.json Everything.View.Note commit_raw.json Everything.View.Test commit_raw.json Everything.View.Thing commit_raw.json Everything.View.Tool commit_raw.json Everything.View.Video commit_raw.json Everything.ViewAll.Events commit_raw.json Everything commit_raw.json FilteredIndexMasonry commit_raw.json H1 commit_raw.json IndexMasonry commit_raw.json PageBuilder commit_raw.json Register commit_raw.json everything.create.image commit_raw.json everything.template commit_raw.json everything commit_raw.json ewtd.near HelloEthersJS commit_raw.json NFT-Selector commit_raw.json test commit_raw.json f04800475b9a1e8207f234a1c2e3d65cb1e5c3257416f47c17173c33a98cba28 Untitled-0 commit_raw.json f1adcbb9027dc03c9a41829126bc871a98869c45c6506698dc4aa10481b7a87a Composition commit_raw.json Composition_Another_Widget commit_raw.json Greeter commit_raw.json GreeterToday commit_raw.json GreeterYourName commit_raw.json MyProfilePage commit_raw.json Payment commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json collegium.bos.wk2.Web3ConnectWidget commit_raw.json f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb AddMeme commit_raw.json Common.Compose commit_raw.json CommunityVoice.AddComment commit_raw.json CommunityVoice.AllArticlesList commit_raw.json CommunityVoice.ArticleBody commit_raw.json CommunityVoice.ArticleView commit_raw.json CommunityVoice.Conifg commit_raw.json CommunityVoice.Create commit_raw.json CommunityVoice.GeneralCard commit_raw.json CommunityVoice.Reactions commit_raw.json CommunityVoice.UpVoteButton commit_raw.json CommunityVoice.lib.article commit_raw.json CommunityVoice.lib.comment commit_raw.json CommunityVoice.lib.emojis commit_raw.json CommunityVoice.lib.upVotes commit_raw.json CommunityVoice commit_raw.json EasyPoll.AnswerCommentsContainer commit_raw.json EasyPoll.DisplayMultiVote commit_raw.json EasyPoll.DisplayMultiVote2 commit_raw.json EasyPoll.DisplayVote commit_raw.json EasyPoll.DisplayVote2 commit_raw.json EasyPoll.Percentage commit_raw.json EasyPoll.Questions commit_raw.json EasyPoll.Voting commit_raw.json EasyPoll.Voting2 commit_raw.json Element.Badge.demo commit_raw.json Element.Badge commit_raw.json FollowButton commit_raw.json IndexFeed commit_raw.json Input.Button.demo commit_raw.json Input.Button commit_raw.json Instance_time.styles commit_raw.json Instance_time commit_raw.json Instance_time_card commit_raw.json Instance_time_edit commit_raw.json Instance_time_review commit_raw.json Instance_time_schedule_card commit_raw.json Instance_time_setting commit_raw.json Instance_time_share commit_raw.json Kudos.Styles commit_raw.json Kudos commit_raw.json Lib.Use.Template commit_raw.json LibSecondTemplate commit_raw.json LibTemplate commit_raw.json MainPage.Post.Content commit_raw.json MainPage.Post.Header commit_raw.json MainPage.Post commit_raw.json MarkdownEditorIframe commit_raw.json MarkdownEditorIframeExample commit_raw.json NDC.AddComment commit_raw.json NDC.AllArticlesSortByAuthors commit_raw.json NDC.ArticleHistory.Container commit_raw.json NDC.ArticleHistory.Handler commit_raw.json NDC.ArticleHistory.SecondContainer commit_raw.json NDC.ArticleView commit_raw.json NDC.ArticlesByAuthorCard commit_raw.json NDC.CommentView commit_raw.json NDC.CompactPost commit_raw.json NDC.Create commit_raw.json NDC.Forum.AllArticlesList commit_raw.json NDC.Forum.Create commit_raw.json NDC.Forum commit_raw.json NDC.General.AddComment commit_raw.json NDC.General.ArticleView commit_raw.json NDC.GeneralCard commit_raw.json NDC.KanbanBoard commit_raw.json NDC.NavBar commit_raw.json NDC.Nomination.Candidate.Comment commit_raw.json NDC.Reactions commit_raw.json NDC.SayALot.AddComment commit_raw.json NDC.StyledComponents commit_raw.json NDC.UpVoteButton commit_raw.json NDC_Card-1 commit_raw.json NDC_GeneralCard commit_raw.json NDC_NavBar commit_raw.json PollQuestion commit_raw.json PopUpExample commit_raw.json Profile.OverlayTrigger commit_raw.json Profile.ShortInlineBlock commit_raw.json Profile commit_raw.json SayALot.AddComment commit_raw.json SayALot.AllArticlesList commit_raw.json SayALot.AllArticlesSortByAuthors commit_raw.json SayALot.ArticleView commit_raw.json SayALot.ArticlesByAuthorCard commit_raw.json SayALot.CommentView commit_raw.json SayALot.Config commit_raw.json SayALot.Create commit_raw.json SayALot.GeneralCard commit_raw.json SayALot.NavBar commit_raw.json SayALot.Reactions commit_raw.json SayALot.UpVoteButton commit_raw.json SayALot.lib.SBT commit_raw.json SayALot.lib.article commit_raw.json SayALot.lib.comment commit_raw.json SayALot.lib.emojis commit_raw.json SayALot.lib.upVotes commit_raw.json SayALot commit_raw.json SayALot_AllArticlesList commit_raw.json SayALot_ArticlesByAuthor commit_raw.json SayALot_ArticlesByTag commit_raw.json SayALot_Authors commit_raw.json SayALot_Comment.Compose commit_raw.json SayALot_Comment.Feed commit_raw.json SayALot_Comment commit_raw.json SayALot_CreateArticle commit_raw.json SayALot_FasterArticleEditInputs commit_raw.json SayALot_History.History commit_raw.json SayALot_MainNavigation commit_raw.json SayALot_ManualIndexFeed commit_raw.json SayALot_OneArticle commit_raw.json SayALot_Reactions commit_raw.json SayALot_TagList commit_raw.json ShowCurrentTime commit_raw.json TagsEditor commit_raw.json Test commit_raw.json Test2 commit_raw.json Test3 commit_raw.json Test4 commit_raw.json WikiOnSocialDB commit_raw.json WikiOnSocialDB_AllArticlesList commit_raw.json WikiOnSocialDB_ArticlesByAuthor commit_raw.json WikiOnSocialDB_Authors commit_raw.json WikiOnSocialDB_Comment.Compose commit_raw.json WikiOnSocialDB_Comment.Feed commit_raw.json WikiOnSocialDB_Comment commit_raw.json WikiOnSocialDB_CreateArticle commit_raw.json WikiOnSocialDB_History.ArticleHistory commit_raw.json WikiOnSocialDB_History.ArticleHistoryCard commit_raw.json WikiOnSocialDB_History.History commit_raw.json WikiOnSocialDB_Like commit_raw.json WikiOnSocialDB_MainNavigation commit_raw.json WikiOnSocialDB_ManualIndexFeed commit_raw.json WikiOnSocialDB_OneArticle.Footer commit_raw.json WikiOnSocialDB_OneArticle commit_raw.json allVotingWidget commit_raw.json answer_poll-comment-container commit_raw.json answer_poll commit_raw.json answersHeader commit_raw.json discardYesNoAnswerInterface commit_raw.json displayQuestionHeader commit_raw.json fasterTextInput commit_raw.json general_neardigitalcollective_card commit_raw.json general_neardigitalcollective_cards-container commit_raw.json general_neardigitalcollective_footer commit_raw.json general_neardigitalcollective_headers.options commit_raw.json general_neardigitalcollective_headers commit_raw.json general_neardigitalcollective_master-handler commit_raw.json general_neardigitalcollective_standard-abort-popup commit_raw.json gridSystem commit_raw.json home commit_raw.json kudoBox commit_raw.json lib.SBT commit_raw.json lib.article commit_raw.json lib.comment commit_raw.json lib.emojis commit_raw.json lib.notifications commit_raw.json lib.upVotes commit_raw.json minimalistQuestionGeneralInfo commit_raw.json minimalistQuestionHeader commit_raw.json newAnswerInterface commit_raw.json newMiniMultipleChoiceInterface commit_raw.json newPollQuestionInterface commit_raw.json newTextAnswerInterface commit_raw.json newVotingInterface commit_raw.json newYesNoAnswerInterface commit_raw.json pollQuestionMasterHandler commit_raw.json pollUtils commit_raw.json questionsByCreator commit_raw.json renderVotingPollModal commit_raw.json sayALot.NavBar commit_raw.json sayALot.generalHandler commit_raw.json shareWidget commit_raw.json showAllQuestions commit_raw.json showAnswersHandler commit_raw.json showCommentsButton commit_raw.json showQuestionsHandler commit_raw.json test.lib commit_raw.json test2 commit_raw.json timeAgo commit_raw.json voteMultipleChoice commit_raw.json voteWithText commit_raw.json \r\n \r\n*** \r\n \r\n \r\n## Typographic replacements \r\n \r\nEnable typographer option to see result. \r\n \r\n(c) (C) (r) (R) (tm) (TM) (p) (P) +- \r\n \r\ntest.. test... test..... test?..... test!.... \r\n \r\n!!!!!! ???? ,, -- | \r\n| data | path to data files to supply the data that will be passed into templates. | \r\n| engine | engine to be used for processing templates. Handlebars is the default. | \r\n| ext | extension to be used for dest files. | \r\n \r\nRight aligned columns \r\n \r\n| Option | Description | \r\n| f4b30bdb1a42599156c24a3ba22e788ef419f344e4db87a93f4e929aa203d947 InterPal commit_raw.json gdocs commit_raw.json f4be14916f3d8c39301e8432a246f69845f8428d6c29d88fc7b93d3cd7c408f5 HelloWorld commit_raw.json f54a9bc1772d359e09686dc19b32d291234bdbaa685cdd87ff1ef68d3c0dc74a Untitled-0 commit_raw.json friendtech commit_raw.json f605ac2944abbf6e2b83086366e09cd3ce1d2fdc6f0b246d64e819af9cf527c4 myfirsthelloworld commit_raw.json f9c8ea61fc52563789402a7b3e34e5b1aa6eda06f535a2c3afb7c725488c5a6c zkQuest commit_raw.json fajrializa.near ProfilePage commit_raw.json fam3hackathon.near F3CreateCollection commit_raw.json F3CreateWallet commit_raw.json F3Demo commit_raw.json F3MintNearNft commit_raw.json MintNearNft commit_raw.json Sample commit_raw.json faou.near WeAreDevsStatusBoard commit_raw.json fastswap.near Network1Dropdown commit_raw.json Untitled-0 commit_raw.json fastSwaps commit_raw.json fastSwapsHeadImage commit_raw.json fastui.near Comment.CommentP.Button.Button0001 commit_raw.json FastUI commit_raw.json Index commit_raw.json fastvault.near EncryptedImage commit_raw.json EncryptedIpfsUpload commit_raw.json EncryptedText commit_raw.json PasswordModal commit_raw.json Scenic.App commit_raw.json Scenic.Feed commit_raw.json Scenic.Post commit_raw.json files commit_raw.json module.crypto commit_raw.json voyager.content.index commit_raw.json voyager.header.index commit_raw.json voyager.index commit_raw.json voyager.item commit_raw.json voyager.provider commit_raw.json voyager.sidebar.index commit_raw.json FV START FV END faytey7.near Create commit_raw.json NearTaskie commit_raw.json fbc4bf47115cf34000cdeb2a4021ef3c7df40774f0cc40fd0dad245652cb2c72 Onboarding.Starter-fork commit_raw.json fblauer.near AddImage_gpux 21 commit_raw.json FB_CollectionSelector-fork commit_raw.json FB_nft-marketplace-fork commit_raw.json StakingPools commit_raw.json fc95ea314aa7d7098dc63e5a4afcb9042cb188b889b4979f335e1fa719930ed6 Instructions commit_raw.json Onboarding.Starter-fork commit_raw.json fcff4038fecb38b0e63ee9e865f363886415006ec9413ea70dbae598207f201c Map.Mapbox commit_raw.json Mapbox commit_raw.json NearBi.Mapbox commit_raw.json fchambi.near AceptarOrdenCompra commit_raw.json Confirmar commit_raw.json ToDoList commit_raw.json Untitled-0 commit_raw.json fdaomultixender.near MultiXender commit_raw.json MultiXender_FAQ commit_raw.json MultiXender_HomePage commit_raw.json MultiXender_main commit_raw.json ff3541d08eef144ff4c4485844c2e2a36f14773c387cb1085659044ce10cee1f BANNERTEXT commit_raw.json Untitled-0 commit_raw.json acordeon commit_raw.json landing commit_raw.json marquee commit_raw.json navbar commit_raw.json tabla commit_raw.json fg63.near Dkk3axf commit_raw.json fhiyyerh.near New-Draft-0 commit_raw.json fiatisabubble.near ImwithCreativesConstellation commit_raw.json Untitled-0 commit_raw.json fictionspawn.near CLOSE Protocol commit_raw.json CloseProtocol commit_raw.json finfoo.near hello_world commit_raw.json firpower.near WeAreDevsStatusBoard commit_raw.json flashui.near Accordion commit_raw.json AccordionItem commit_raw.json Box commit_raw.json Button commit_raw.json Card commit_raw.json CardBody commit_raw.json CardContent commit_raw.json CardFooter commit_raw.json CardHeader commit_raw.json CardImage commit_raw.json Container commit_raw.json Drawer commit_raw.json Kdb commit_raw.json List commit_raw.json ListItems commit_raw.json Loading commit_raw.json Modal commit_raw.json Stack commit_raw.json TabList commit_raw.json TabListItem commit_raw.json TabPanel commit_raw.json TabPanels commit_raw.json Table commit_raw.json TableData commit_raw.json TableHeader commit_raw.json TableRow commit_raw.json Tabs commit_raw.json Test commit_raw.json Typography commit_raw.json flatirons.near AI.Agent.CustomChat commit_raw.json AI.Agent.Documentation commit_raw.json AgentList commit_raw.json CustomFilteredHomePage commit_raw.json Feed.Post commit_raw.json FilteredFeed commit_raw.json FilteredIndexFeed commit_raw.json FilteredManualIndexFeed commit_raw.json MainPage.Comment.Feed commit_raw.json MainPage.Comment.Page commit_raw.json MainPage.Comment commit_raw.json MainPage.Content commit_raw.json MainPage.Feed commit_raw.json MainPage.Post.Header commit_raw.json MainPage.Post commit_raw.json ProfilePage commit_raw.json QueryApi.App commit_raw.json QueryApi.Dashboard commit_raw.json QueryApi.Editor commit_raw.json Status commit_raw.json Test-Query-Api commit_raw.json flexby9.tg Index commit_raw.json flmel.near GuestBook commit_raw.json Homepage commit_raw.json bos-component-ts-starter.components.pages.homepage commit_raw.json bos-component-ts-starter.components.subfolder.my-nested-component commit_raw.json includes.common commit_raw.json florijan.near Untitled-0 commit_raw.json flowchain.near MagicBuild-widget-form-1697216819070 commit_raw.json flowscience.near Badge.create commit_raw.json BadgeBuilder commit_raw.json CGD.Community commit_raw.json CGD.Factory commit_raw.json CGD.Page commit_raw.json CGD.SubDAOs commit_raw.json CannabisGenome.Page commit_raw.json EventForm commit_raw.json FeaturedComponents commit_raw.json GitHubSearchSelect commit_raw.json IpfsImageUpload commit_raw.json JSON-Schema.editor commit_raw.json Menu commit_raw.json MenuItem commit_raw.json MyFirstProject commit_raw.json NAS.view commit_raw.json NAS commit_raw.json ProfileEditor.Validate commit_raw.json RenderProperties commit_raw.json SchemaSelector commit_raw.json Untitled-0 commit_raw.json adapter.github commit_raw.json adapter.ipfs commit_raw.json attest commit_raw.json attestEAS commit_raw.json attestWithSchema commit_raw.json attestWithTypes commit_raw.json attester.resolver commit_raw.json cgd commit_raw.json communities.join commit_raw.json create.field commit_raw.json create.file commit_raw.json create.fileFormat commit_raw.json create.hypercert commit_raw.json create.impact commit_raw.json create.record commit_raw.json create commit_raw.json creator commit_raw.json dao-sdk commit_raw.json deletePath commit_raw.json eas.interface commit_raw.json eas commit_raw.json easAttestation.view commit_raw.json easRenderAttestation commit_raw.json easSchema commit_raw.json f.GetAttestation commit_raw.json f.getSchema commit_raw.json generateUID commit_raw.json getAttestation commit_raw.json getSchema commit_raw.json getUID commit_raw.json gm commit_raw.json hypercert.page commit_raw.json iframe commit_raw.json jsonSchemaEasSchema commit_raw.json links commit_raw.json progress.members commit_raw.json schema.editor commit_raw.json survey-embed commit_raw.json testnet-social-interface commit_raw.json verified.members commit_raw.json view commit_raw.json flyflyfly.near burrow-dust-repay commit_raw.json t commit_raw.json fofay-ac.near NavbarSupercall commit_raw.json SupercallAccount commit_raw.json SupercallBundler commit_raw.json forefront_tak.near Forefront.Discover commit_raw.json Forefront.Feed commit_raw.json Forefront.Footer commit_raw.json Forefront.Home.Slider commit_raw.json Forefront.Home commit_raw.json Forefront.Widget.BuildDAO commit_raw.json Forefront.Widget.Community.Form commit_raw.json Forefront.Widget.Community.Members commit_raw.json Forefront.Widget.Community commit_raw.json Forefront.Widget.NearSocial.Explorer.Node commit_raw.json Forefront.Widget.NearSocial.Explorer.Tree commit_raw.json Forefront.Widget.NearSocial.Explorer.View commit_raw.json Forefront.Widget.Network.Leaderboard commit_raw.json Forefront.Widget.Network commit_raw.json Forefront.Widget.Platform.Leaderboard commit_raw.json Forefront.Widget.Platform.Retention commit_raw.json Forefront.Widget.Platform.Tvl commit_raw.json Forefront.Widget.Platform commit_raw.json foreverknowledgeable.near dewiki commit_raw.json forfront_tak.near home-feed-ButtonLink commit_raw.json home-feed commit_raw.json forgash.near HelloWorld commit_raw.json most-accounts-followed commit_raw.json test-flipside-dashboard-embed commit_raw.json formula1.near Formula1 commit_raw.json Status commit_raw.json fradao.near AgentChat-fork commit_raw.json CosmoPOS.Dashboard commit_raw.json frado.near fra-DAO-Payout-Proposal-fork commit_raw.json fra-DAO-Payout-Proposal commit_raw.json fradao-component commit_raw.json fran-cali.near FImage commit_raw.json FNftImage commit_raw.json FProfileIcon commit_raw.json imgtest commit_raw.json freeuibos.near ProfilePage commit_raw.json freeupdate.near Widget-2 commit_raw.json freeuser.near TestLa commit_raw.json frichard2.near LiveRefFinanceSwaps commit_raw.json most-active-contracts commit_raw.json frichard4.near ExplorerSelector commit_raw.json azdefzef commit_raw.json bos-components.components.ExplorerSelector commit_raw.json frichard5.near ActiveAccounts commit_raw.json ActiveContracts commit_raw.json CommentButton commit_raw.json Comments.Comment commit_raw.json Comments.Compose commit_raw.json Comments.Feed commit_raw.json DailyTransactions commit_raw.json Dashboard commit_raw.json Draft-0 commit_raw.json NDC-Banner commit_raw.json NDC-Dashboard commit_raw.json NDC-Page commit_raw.json NDC-Tabs commit_raw.json NDC-add-proposal commit_raw.json NDC-alldaos.aggregated-balances commit_raw.json NDC-alldaos.overview commit_raw.json NDC-alldaos_overview commit_raw.json NDC-bounty-claim commit_raw.json NDC-bounty-done commit_raw.json NDC-bounty-list commit_raw.json NDC-checkbox-list commit_raw.json NDC-checkbox commit_raw.json NDC-comment-proposal commit_raw.json NDC-filter-menu commit_raw.json NDC-filter commit_raw.json NDC-input commit_raw.json NDC-members-voters commit_raw.json NDC-modal commit_raw.json NDC-policy commit_raw.json NDC-proposal-card commit_raw.json NDC-proposal-community-discussion commit_raw.json NDC-proposals-count-by-account commit_raw.json NDC-proposer-detail commit_raw.json NDC-search commit_raw.json NDC-select commit_raw.json NDC-transfers-by-account commit_raw.json NDC-transfers-overview commit_raw.json NDC-vote-history commit_raw.json NDC-vote-on-proposal commit_raw.json NDC.Nomination.Page commit_raw.json NewAccounts commit_raw.json Proposal commit_raw.json SputnikBOS.Banner commit_raw.json SputnikBOS.Home commit_raw.json SputnikBOS.Search commit_raw.json account_balance commit_raw.json contract_metrics commit_raw.json ft_transfers commit_raw.json generic_table commit_raw.json near_transfers commit_raw.json proposal-by-month commit_raw.json proposal-status-by-month commit_raw.json proposals-status commit_raw.json proposals commit_raw.json proposals_scroll commit_raw.json table_ft_formatter commit_raw.json todelete_1 commit_raw.json friendlymatteo.near github-bounties commit_raw.json frol.near AddIdea commit_raw.json AirStack-API-demo commit_raw.json Attestation commit_raw.json AttestationEditor commit_raw.json BosFormDemo commit_raw.json Comment commit_raw.json CommentEditor commit_raw.json CompactPost commit_raw.json Demo commit_raw.json DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json DevGovBadgeDetails commit_raw.json DevGovBadgeMintForm commit_raw.json DevGovBadgesList commit_raw.json DevGovBadgesProfileLine commit_raw.json DevGovBadgesProfileWidget commit_raw.json DevGovGigsPost commit_raw.json DevGovProfilePage commit_raw.json EChartsDemo commit_raw.json EmbedMyCode commit_raw.json EmojiSearch commit_raw.json HelloAccountIdHeader commit_raw.json HelloWorld commit_raw.json HelooWasm commit_raw.json Idea commit_raw.json IdeaEditor commit_raw.json Ideas commit_raw.json IdeasList commit_raw.json KanbanBoard commit_raw.json LOL.components.Auth commit_raw.json LOL.pages.Main commit_raw.json LOLcoinTiny commit_raw.json LOLcoinTinyWithModal commit_raw.json LOLmarketMint commit_raw.json LOLmarketTiny commit_raw.json NftImage commit_raw.json Post commit_raw.json ProfilePage commit_raw.json RenderingBugDemo commit_raw.json Sponsorship commit_raw.json SponsorshipEditor commit_raw.json Submission commit_raw.json SubmissionEditor commit_raw.json Tailwind-FloatUI-Demo-Form commit_raw.json Tailwind-FloatUI-Demo commit_raw.json TransferNEAR commit_raw.json Untitled-0 commit_raw.json bos-component-ts-starter.components.layout.main commit_raw.json bos-component-ts-starter.components.pages.homepage commit_raw.json bos-component-ts-starter.components.subfolder.my-nested-component commit_raw.json bos-component-ts-starter.includes.common commit_raw.json bos-component-ts-starter.modules.layout.main commit_raw.json bos-component-ts-starter.pages.homepage commit_raw.json bos-component-ts-starter.pages.page-a commit_raw.json bos-component-ts-starter.pages.page-b commit_raw.json devhub.hackbox commit_raw.json gigs-board.components.boards.KanbanBoard commit_raw.json gigs-board.components.community.FeaturedCommunity commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.layout.SearchByAuthor commit_raw.json gigs-board.components.layout.SearchByLabel commit_raw.json gigs-board.components.posts.List commit_raw.json gigs-board.components.posts.Post commit_raw.json gigs-board.components.posts.PostEditor commit_raw.json gigs-board.components.posts.Search commit_raw.json gigs-board.components.teams.LabelsPermissions commit_raw.json gigs-board.components.teams.TeamInfo commit_raw.json gigs-board.pages.Boards commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.community.Events commit_raw.json gigs-board.pages.community.Sponsorship commit_raw.json includes.common commit_raw.json qbit.pages.index commit_raw.json frolvlad-lol.near DevHubPluginsPOC commit_raw.json LOLcoinTiny commit_raw.json Untitled-0 commit_raw.json funding-ai.near Lonk.veax-swap commit_raw.json chat.home commit_raw.json chat.modal commit_raw.json chat.show commit_raw.json fundowakin.near HelloIndia commit_raw.json NearIndiaStaker commit_raw.json futurevisions.near Draft-1 commit_raw.json fyang1024.near Greetings commit_raw.json HelloEthersJS commit_raw.json gaddiihdez.near Onboarding.Starter commit_raw.json gagdiez.near A commit_raw.json B commit_raw.json Bye commit_raw.json C commit_raw.json Composer commit_raw.json Darija.Components.Table commit_raw.json Darija.Familia commit_raw.json Darija.FamiliaExtendida commit_raw.json Darija.FamiliaNucleo commit_raw.json Darija.Knowledge.Create commit_raw.json Darija.Knowledge.List commit_raw.json Darija.Lessons.Lesson commit_raw.json Darija.Lessons.Match commit_raw.json Darija.Lessons.Select commit_raw.json Darija.Lessons.Translate commit_raw.json Darija.Lessons.Utils commit_raw.json Darija.Menu commit_raw.json Darija.Nombre commit_raw.json Darija.Posesivos commit_raw.json Greeter commit_raw.json Greetings commit_raw.json Hello commit_raw.json HelloNear commit_raw.json Lesson.Select commit_raw.json LoveNear-fork commit_raw.json LoveNear commit_raw.json Main commit_raw.json Menu commit_raw.json NCD.Lessons.Evaluation-1 commit_raw.json NCD.Lessons.HelloNear commit_raw.json NCD.Main commit_raw.json NCD.Menu commit_raw.json NCD.Pages.Home commit_raw.json Override commit_raw.json Support.Discussion.Title commit_raw.json Support.Main commit_raw.json Test commit_raw.json remote-code commit_raw.json galoisfield.near FirstWidget commit_raw.json gamuch.near New-Draft-0 commit_raw.json garlicfaucet.near liquityCloseTrove commit_raw.json liquityManageTrove commit_raw.json liquityOpenTrove commit_raw.json liquityWidget commit_raw.json gator-fi.near CurrencyInput commit_raw.json gauraang.near Image commit_raw.json Untitled-0 commit_raw.json gayporn.near Test commit_raw.json geaouet.near NotificationFeed commit_raw.json geforcy.near DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json app commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.common commit_raw.json core.lib.data-request commit_raw.json core.lib.stringUtils commit_raw.json core.lib.struct commit_raw.json core.lib.url commit_raw.json core.lib.uuid commit_raw.json devhub.components.atom.Alert commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.feed.SubscribedFeed commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.connect commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.layout.LikeButton.Faces commit_raw.json devhub.components.molecule.AccountAutocomplete commit_raw.json devhub.components.molecule.BadgeDetails commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.CommunityControl commit_raw.json devhub.components.molecule.Compose commit_raw.json devhub.components.molecule.DropDown commit_raw.json devhub.components.molecule.DropDownWithSearch commit_raw.json devhub.components.molecule.Input commit_raw.json devhub.components.molecule.ListEditor commit_raw.json devhub.components.molecule.MarkdownEditor commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.ProfileLine commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.SimpleMDE commit_raw.json devhub.components.molecule.Spinner commit_raw.json devhub.components.molecule.Switch commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Feed.NearQueryApi commit_raw.json devhub.components.organism.Feed commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.provider commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.github.Viewer commit_raw.json devhub.entity.addon.github.kanban_board commit_raw.json devhub.entity.addon.github.kanban_ticket commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.kanban.post_board commit_raw.json devhub.entity.addon.kanban.post_ticket commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.telegram.Viewer commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Activity commit_raw.json devhub.entity.community.Announcements commit_raw.json devhub.entity.community.Card commit_raw.json devhub.entity.community.Compose commit_raw.json devhub.entity.community.Discussions commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AccessControlConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.History commit_raw.json devhub.entity.post.List commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Post commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.entity.proposal.AccountInput commit_raw.json devhub.entity.proposal.CategoryDropdown commit_raw.json devhub.entity.proposal.CategoryTag commit_raw.json devhub.entity.proposal.CommentIcon commit_raw.json devhub.entity.proposal.CommentsAndLogs commit_raw.json devhub.entity.proposal.ComposeComment commit_raw.json devhub.entity.proposal.ConfirmCancelModal commit_raw.json devhub.entity.proposal.ConfirmReviewModal commit_raw.json devhub.entity.proposal.Editor commit_raw.json devhub.entity.proposal.Feed commit_raw.json devhub.entity.proposal.History commit_raw.json devhub.entity.proposal.LikeButton commit_raw.json devhub.entity.proposal.LinkedProposalsDropdown commit_raw.json devhub.entity.proposal.LoginScreen commit_raw.json devhub.entity.proposal.Profile commit_raw.json devhub.entity.proposal.Proposal commit_raw.json devhub.entity.proposal.StatusTag commit_raw.json devhub.entity.proposal.VerificationStatus commit_raw.json devhub.entity.team.Configurator commit_raw.json devhub.entity.team.LabelPermissions commit_raw.json devhub.entity.team.LabelRow commit_raw.json devhub.entity.team.TeamInfo commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.feature.proposal-search.by-author commit_raw.json devhub.feature.proposal-search.by-category commit_raw.json devhub.feature.proposal-search.by-input commit_raw.json devhub.feature.proposal-search.by-sort commit_raw.json devhub.feature.proposal-search.by-stage commit_raw.json devhub.notification.Item commit_raw.json devhub.notification.LR commit_raw.json devhub.notification.Left commit_raw.json devhub.notification.Right commit_raw.json devhub.page.about commit_raw.json devhub.page.addon commit_raw.json devhub.page.admin.homepageTab commit_raw.json devhub.page.admin.index commit_raw.json devhub.page.admin.moderatorsTab commit_raw.json devhub.page.admin.restrictedLabelsTab commit_raw.json devhub.page.admin commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.community.index commit_raw.json devhub.page.contribute commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json devhub.page.proposals commit_raw.json gigs-board.components.atom.icon commit_raw.json gigs-board.components.atom.spinner commit_raw.json gigs-board.components.atom.tag commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.molecule.breadcrumbs commit_raw.json gigs-board.components.molecule.button-switch commit_raw.json gigs-board.components.molecule.markdown-editor commit_raw.json gigs-board.components.molecule.markdown-viewer commit_raw.json gigs-board.components.molecule.profile-card commit_raw.json gigs-board.components.molecule.text-input commit_raw.json gigs-board.components.molecule.tile commit_raw.json gigs-board.components.organism.configurator commit_raw.json gigs-board.components.organism.editor commit_raw.json gigs-board.components.template.app-layout commit_raw.json gigs-board.entity.community.branding-configurator commit_raw.json gigs-board.entity.community.configurator commit_raw.json gigs-board.entity.community.header commit_raw.json gigs-board.entity.community.layout commit_raw.json gigs-board.entity.community.sidebar commit_raw.json gigs-board.entity.community.spawner commit_raw.json gigs-board.entity.post.CompactPost commit_raw.json gigs-board.entity.post.History commit_raw.json gigs-board.entity.post.Post commit_raw.json gigs-board.entity.team.LabelsPermissions commit_raw.json gigs-board.entity.team.TeamInfo commit_raw.json gigs-board.entity.workspace.github-ticket commit_raw.json gigs-board.entity.workspace.github-view commit_raw.json gigs-board.entity.workspace.kanban-view commit_raw.json gigs-board.entity.workspace.post-ticket commit_raw.json gigs-board.feature.post-search.by-tag commit_raw.json gigs-board.feature.workspace.github-view-configurator commit_raw.json gigs-board.feature.workspace.kanban-view-configurator commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Feed commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.communities commit_raw.json gigs-board.pages.community.activity commit_raw.json gigs-board.pages.community.board commit_raw.json gigs-board.pages.community.configuration commit_raw.json gigs-board.pages.community.github commit_raw.json gigs-board.pages.community.telegram commit_raw.json gigs-board.pages.community.wiki commit_raw.json geisterwolf.near testComponent commit_raw.json genadrop.near CafeCartel.Feed.View commit_raw.json CafeCartel.Feed.ViewPostsOnly commit_raw.json CafeCartel.Feed commit_raw.json CafeCartel.Footer commit_raw.json CafeCartel.Header commit_raw.json CafeCartel.Index commit_raw.json CafeCartel.Post commit_raw.json Gallery.Multichain.Indexer commit_raw.json GenaDrop.App.Index commit_raw.json GenaDrop.DAO.NFTMint commit_raw.json GenaDrop.Home commit_raw.json GenaDrop.NFT.All commit_raw.json GenaDrop.NFT.Contract.holders commit_raw.json GenaDrop.NFT.Contract.newHolders commit_raw.json GenaDrop.NFT.NEAR.Minter commit_raw.json GenaDrop.Profile.Main commit_raw.json GenaDrop.RightSide commit_raw.json GenaDropMultilisting commit_raw.json Untitled-1 commit_raw.json XPNetwork commit_raw.json generalstrike.near StrikeCard commit_raw.json Untitled-1 commit_raw.json georgeswedie.near everything commit_raw.json giladev.near Onboarding.Starter commit_raw.json SmartdocForm commit_raw.json gilberth.near BigTime commit_raw.json giuliani.near Onboarding.Starter-fork commit_raw.json TestName commit_raw.json glifted.near Greeter commit_raw.json gmilescu.near CanvasParty-George commit_raw.json CanvasParty-receiver commit_raw.json PokeButton-test commit_raw.json golas.near A1 commit_raw.json A2 commit_raw.json A3 commit_raw.json A4 commit_raw.json C1 commit_raw.json C2 commit_raw.json ComponentCard-x commit_raw.json ComponentStarter commit_raw.json ContributionCounter commit_raw.json ContributionGraph commit_raw.json GenieQuestionListX commit_raw.json GenieQuestionListXX commit_raw.json GenieX commit_raw.json LoyaltyProgram commit_raw.json MMM-MetadataEditor commit_raw.json MMM-WidgetMetadataEditor commit_raw.json MetadataEditor-fork commit_raw.json Module-1 commit_raw.json Module-2 commit_raw.json Module-3 commit_raw.json Module-module-1 commit_raw.json N-Modal commit_raw.json N-Notification-2 commit_raw.json N-Notification commit_raw.json N-NotificationSettings commit_raw.json N-NotificationSettingsPush commit_raw.json N-Notifications commit_raw.json N-NotificationsList-2 commit_raw.json N-NotificationsList commit_raw.json N-NotificationsSettingsApplications commit_raw.json N-NotificationsSettingsHeader commit_raw.json N-NotificationsSettingsListItem commit_raw.json N-NotificationsSettingsPush commit_raw.json N-NotificationsSettingsTurnOn commit_raw.json N-NotoficationsSettingsPage commit_raw.json N-SettingsListItem commit_raw.json N_NotificationsBanner commit_raw.json Placeholder commit_raw.json Untitled-0 commit_raw.json WidgetMetadataEditor-fork commit_raw.json X1-fork commit_raw.json X1 commit_raw.json X2 commit_raw.json X3 commit_raw.json X4 commit_raw.json X5 commit_raw.json Z1 commit_raw.json aaa commit_raw.json asddsa commit_raw.json geniequestionlistxx commit_raw.json waitList commit_raw.json goldinn.near Badge commit_raw.json gordonjun.near AccountProfileCard commit_raw.json ChatWithUser commit_raw.json ComponentSearch.dao.members.only commit_raw.json PeopleSearch commit_raw.json PresidentProfileCard commit_raw.json WidgetIcons.dao.members.only commit_raw.json adventures.menu commit_raw.json bbclan.dao commit_raw.json bbclan.members commit_raw.json bbclanChatRoom commit_raw.json create.posts commit_raw.json dev.menu commit_raw.json dev.search.dao.members.only commit_raw.json explore.posts.dao.members.only commit_raw.json explore.posts commit_raw.json getFollowers commit_raw.json nyc.dao commit_raw.json nyc.people commit_raw.json view.posts commit_raw.json gottalovedmilo.near Draft-0 commit_raw.json gov.near AddBlogEntry commit_raw.json AllProjects commit_raw.json Apps commit_raw.json BlogEntry commit_raw.json BlogEntryFeed commit_raw.json Bounties commit_raw.json Builder commit_raw.json BuilderProfiles commit_raw.json Builders commit_raw.json CommentList commit_raw.json CommentView commit_raw.json Comments commit_raw.json CreateProject commit_raw.json FollowButton commit_raw.json FollowPage commit_raw.json FollowStats commit_raw.json FollowTabs commit_raw.json FollowersList commit_raw.json FollowingList commit_raw.json FollowsYouBadge commit_raw.json GenieQuestionView commit_raw.json Global commit_raw.json IdeasList commit_raw.json Image commit_raw.json ImageEditorTabs commit_raw.json ItemFeed commit_raw.json Join commit_raw.json JoinButton.LR commit_raw.json JoinButton commit_raw.json JoinDetails commit_raw.json JoinPage commit_raw.json JoinStats commit_raw.json KanbanBoardList commit_raw.json LastProfilesImages commit_raw.json LastWidgets commit_raw.json LinkTree commit_raw.json ListBounties commit_raw.json MembersList commit_raw.json Membership commit_raw.json MetadataEditor commit_raw.json NewMember commit_raw.json NftCollection commit_raw.json NftCollectionThumbs commit_raw.json NftImage commit_raw.json Notification.Item.Follow commit_raw.json People commit_raw.json PokeButton commit_raw.json Post commit_raw.json PostEditor commit_raw.json Profile commit_raw.json ProfileImage commit_raw.json ProfileTagsEditor commit_raw.json Project commit_raw.json ProjectCard commit_raw.json ProjectEditor commit_raw.json ProjectImage commit_raw.json ProjectPage commit_raw.json ProjectTabs commit_raw.json PublicTagEditor commit_raw.json PublicTags commit_raw.json SaveComment commit_raw.json SubscribersList commit_raw.json TagsEditor commit_raw.json Task commit_raw.json TaskEditor commit_raw.json Tasks commit_raw.json TimeAgo commit_raw.json WidgetMetadata commit_raw.json WidgetSource commit_raw.json YourNFTs commit_raw.json gr1963.near Everything.Create.Document commit_raw.json Everything.Summary.Document commit_raw.json Everything.View.Document commit_raw.json Everything commit_raw.json ForkThis commit_raw.json gr8h.near LensProfileCommentsView commit_raw.json LensProfileController commit_raw.json LensProfileCreate commit_raw.json LensProfileFollowersView commit_raw.json LensProfilePostsView commit_raw.json LensProfileSearch commit_raw.json LensProfileSearchView commit_raw.json LensSDK commit_raw.json granthul.near granthul.near_d43f4f65-af84-441b-a6ac-b8bf869dcfdb commit_raw.json greenghost.near CollectableMinter commit_raw.json HeaderWithLogo-green commit_raw.json NFT.Minter.main commit_raw.json Navbar commit_raw.json community.page commit_raw.json grgw.near grgw-widget-1 commit_raw.json griser.near LOLmarketMint commit_raw.json guessme.near ZKEVM.AAVE.Card.AssetsToBorrow commit_raw.json ZKEVM.AAVE.Card.AssetsToSupply commit_raw.json ZKEVM.AAVE.Card.CardEmpty commit_raw.json ZKEVM.AAVE.Card.CardsTable commit_raw.json ZKEVM.AAVE.Card.CardsView commit_raw.json ZKEVM.AAVE.Card.TokenWrapper commit_raw.json ZKEVM.AAVE.Card.YourBorrows commit_raw.json ZKEVM.AAVE.Card.YourSupplies commit_raw.json ZKEVM.AAVE.HeroData commit_raw.json ZKEVM.AAVE.Loader commit_raw.json ZKEVM.AAVE.Modal.BaseModal commit_raw.json ZKEVM.AAVE.Modal.BorrowModal commit_raw.json ZKEVM.AAVE.Modal.RepayModal commit_raw.json ZKEVM.AAVE.Modal.RoundedCard commit_raw.json ZKEVM.AAVE.Modal.SupplyModal commit_raw.json ZKEVM.AAVE.Modal.WithdrawModal commit_raw.json ZKEVM.AAVE.ModalPrimaryButton commit_raw.json ZKEVM.AAVE.NetworkSwitcher commit_raw.json ZKEVM.AAVE.PrimaryButton commit_raw.json ZKEVM.AAVE.TabSwitcher commit_raw.json ZKEVM.AAVE commit_raw.json ZKEVM.ExecuteRecords commit_raw.json ZKEVM.GAMMA commit_raw.json ZKEVM.QuestionList commit_raw.json ZKEVM.Template-card commit_raw.json ZKEVM.Template commit_raw.json ZKEVM.gamma-zkevm-table commit_raw.json ZKEVM.gamma-zkevm-vault commit_raw.json ZKEVM.switch_quest_card commit_raw.json ZKEVMSwap.quickswap-v3-getEstimate commit_raw.json ZKEVMSwap.swap-handler commit_raw.json ZKEVMSwap.swap-quoter commit_raw.json ZKEVMSwap.zkevm-asset-item commit_raw.json ZKEVMSwap.zkevm-asset-list commit_raw.json ZKEVMSwap.zkevm-bridge-token-list commit_raw.json ZKEVMSwap.zkevm-bridge-transactions commit_raw.json ZKEVMSwap.zkevm-bridge-ui commit_raw.json ZKEVMSwap.zkevm-bridge commit_raw.json ZKEVMSwap.zkevm-connect commit_raw.json ZKEVMSwap.zkevm-dexData commit_raw.json ZKEVMSwap.zkevm-swap-button commit_raw.json ZKEVMSwap.zkevm-swap commit_raw.json ZKEVMSwap.zkevm-token-data commit_raw.json ZKEVMWarmUp.add-to-quest-card commit_raw.json ZKEVMWarmUp.generage-uuid commit_raw.json ZKEVMWarmUp.hot-dapp-card commit_raw.json ZKEVMWarmUp.input-search commit_raw.json ZKEVMWarmUp.load-data commit_raw.json ZKEVMWarmUp.quest-card commit_raw.json ZKEVMWarmUp.quest-list commit_raw.json ZKEVMWarmUp.search-config commit_raw.json ZKEVMWarmUp.trend-card commit_raw.json ZKEVMWarmUp.trend-list commit_raw.json ZKEVMWarmUp.warm-up commit_raw.json guestbook.flmel.near App commit_raw.json Card commit_raw.json Modal commit_raw.json hhh commit_raw.json guille.near DAO.Page commit_raw.json mintbase-nft-contract-marketplace commit_raw.json hack.near ABC.Page.Builders commit_raw.json ABC.Page.Content commit_raw.json ABC.Page.Menu commit_raw.json ABC.Summary.Post commit_raw.json ABC commit_raw.json API commit_raw.json Academy commit_raw.json AddButton commit_raw.json AddMember commit_raw.json AddMemberToRole commit_raw.json Admins commit_raw.json AdvancedProfileSearch commit_raw.json Agreement commit_raw.json AgreementForm commit_raw.json AgreementModal commit_raw.json AgreementPage commit_raw.json AllStars commit_raw.json Applications commit_raw.json Apps commit_raw.json AttestButton commit_raw.json BOSWEEK commit_raw.json BufferZone commit_raw.json Build.Follow commit_raw.json BuilderBadge commit_raw.json BuilderHat commit_raw.json Builders commit_raw.json CRM.Telegram commit_raw.json CRM commit_raw.json CityEditor commit_raw.json Common.Component.Library.Navbar commit_raw.json Common.Component.Library commit_raw.json Common.DAO.Library.Navbar commit_raw.json Common.DAO.Library commit_raw.json Common.DAO commit_raw.json Common.Feed commit_raw.json Common.Group commit_raw.json Common.Page commit_raw.json CommonComponentsLibrary.Navbar commit_raw.json Commons commit_raw.json CommunityPost commit_raw.json ComponentSearch commit_raw.json Components commit_raw.json ComponentsPage commit_raw.json Connect commit_raw.json ConnectButton commit_raw.json Create.DAO commit_raw.json Create.Page commit_raw.json Create commit_raw.json CreateDAO commit_raw.json CreateGroup.Basics commit_raw.json CreateGroup.Footer commit_raw.json CreateGroup.Form commit_raw.json CreateGroup.Members commit_raw.json CreateGroup.Roles commit_raw.json CreateGroup.Step1 commit_raw.json CreateGroup.Step2 commit_raw.json CreateGroup.Step3 commit_raw.json CreateGroup.index commit_raw.json CreatePoll commit_raw.json CreateQuest.index commit_raw.json Custom.Page.Content commit_raw.json Custom.Page.Editor commit_raw.json Custom.Page.Menu commit_raw.json Customization commit_raw.json Cyborgs commit_raw.json DAO.AddMember commit_raw.json DAO.Bounty.Proposal commit_raw.json DAO.ChangePolicy commit_raw.json DAO.Factory commit_raw.json DAO.Feed.Editor commit_raw.json DAO.Feed commit_raw.json DAO.Follow commit_raw.json DAO.Groups commit_raw.json DAO.Join commit_raw.json DAO.JoinButton commit_raw.json DAO.Main.Editor commit_raw.json DAO.Main commit_raw.json DAO.Members commit_raw.json DAO.Menu commit_raw.json DAO.News commit_raw.json DAO.Page.Content commit_raw.json DAO.Page.Editor commit_raw.json DAO.Page.Feed commit_raw.json DAO.Page.Sidebar commit_raw.json DAO.Page commit_raw.json DAO.Post commit_raw.json DAO.Posts commit_raw.json DAO.Profile.Editor commit_raw.json DAO.Profile commit_raw.json DAO.ProfileLarge commit_raw.json DAO.Proposal.Card commit_raw.json DAO.Proposal commit_raw.json DAO.Proposals commit_raw.json DAO.RemoveMember commit_raw.json DAO.Reward.Claim commit_raw.json DAO.Reward.Proposal commit_raw.json DAO.Reward commit_raw.json DAO.Rewards commit_raw.json DAO.Social.Post commit_raw.json DAO.Social commit_raw.json DAO.Tabs commit_raw.json DAO.View commit_raw.json DAO commit_raw.json DAOs commit_raw.json DIG.Button commit_raw.json Data.Humans commit_raw.json Data commit_raw.json Dev commit_raw.json Docs commit_raw.json Every.DAO commit_raw.json Everything.Create.Page commit_raw.json Everything.Create.Post commit_raw.json Everything.Pages commit_raw.json Everything.Summary.Object commit_raw.json Everything.Summary.Page commit_raw.json Everything.Summary.Post.Content commit_raw.json Everything.Summary.Post commit_raw.json Everything.Template commit_raw.json Everything.Things commit_raw.json Everything.View.Page commit_raw.json Everything.View.Post.Header commit_raw.json Everything.View.Post commit_raw.json Everything.View.Posts commit_raw.json Everything commit_raw.json Explorer commit_raw.json Factory commit_raw.json Favorites commit_raw.json FilteredIndexFeed commit_raw.json FollowButton commit_raw.json Footer.preview commit_raw.json Footer commit_raw.json ForkButton.Faces commit_raw.json ForkButton commit_raw.json ForkThis commit_raw.json FunctionCall commit_raw.json FunctionCallProposal commit_raw.json Game.FlappyBOS commit_raw.json GetDAOPolicy commit_raw.json GetProposal commit_raw.json GetVerified commit_raw.json GitBos commit_raw.json GitcoinPassport commit_raw.json GitcoinProfile commit_raw.json Graph commit_raw.json Group.Search commit_raw.json Group commit_raw.json GroupCheck commit_raw.json GroupImage commit_raw.json GroupMembers commit_raw.json Groups commit_raw.json Guide.Header commit_raw.json Guide.Summary commit_raw.json Guide commit_raw.json Hashtag.Feed commit_raw.json Hashtag.Page commit_raw.json HumansOnNearMeter commit_raw.json IAH.Badge commit_raw.json IAH.Countdown commit_raw.json IAH.Profile.Sidebar commit_raw.json IAH.Profile commit_raw.json Image commit_raw.json Index commit_raw.json IndexFeed commit_raw.json Inputs.Checkbox commit_raw.json Join.Card commit_raw.json Join commit_raw.json LastProfilesImages commit_raw.json LatestProfiles commit_raw.json ListBuilder commit_raw.json Map.demo commit_raw.json Map.dwell commit_raw.json Map.lib commit_raw.json Map.library commit_raw.json Map.tutorial commit_raw.json Maps.library commit_raw.json MetadataEditor commit_raw.json MultiDAO commit_raw.json NDC.Groups.Header commit_raw.json NDC.Participate commit_raw.json NDC.StyledComponents commit_raw.json NDC.VerifyHuman commit_raw.json NDC.WG.About commit_raw.json NDC.WG.Card commit_raw.json NDC.WG.Compose.Affiliations commit_raw.json NDC.WG.Compose.Group commit_raw.json NDC.WG.Compose.Members commit_raw.json NDC.WG.Compose.Tags commit_raw.json NDC.WG.Compose commit_raw.json NDC.WG.Create commit_raw.json NDC.WG.Data commit_raw.json NDC.WG.Delete commit_raw.json NDC.WG.Header commit_raw.json NDC.WG.Page commit_raw.json NEARAPAC commit_raw.json NFT.Badge commit_raw.json NFTs commit_raw.json NW.Social commit_raw.json NYC.Reposts commit_raw.json Navbar.preview commit_raw.json Navbar commit_raw.json News.Compose commit_raw.json News.Feed.Beta commit_raw.json News.Feed commit_raw.json News.Post commit_raw.json News.Posts commit_raw.json News.Propose commit_raw.json Notification.Item.Request commit_raw.json Notification.Item commit_raw.json NotificationFeed commit_raw.json OldestProfiles commit_raw.json Onboard commit_raw.json Onboarding commit_raw.json OpenData.Menu commit_raw.json OpenData commit_raw.json Page.Builder commit_raw.json Page.Compose commit_raw.json Page.Editor commit_raw.json Page.Menu.Editor commit_raw.json Page.Settings commit_raw.json Page.Summary commit_raw.json Page.Tabs commit_raw.json Page.Template commit_raw.json Profile commit_raw.json ProfileEditor commit_raw.json ProfileImage commit_raw.json ProfileLarge commit_raw.json ProfileOnboarding commit_raw.json ProfilePage.Sidebar commit_raw.json ProfilePage commit_raw.json ProfileSearch commit_raw.json ProfileTabs commit_raw.json Project.Page.Editor commit_raw.json Project.Page commit_raw.json Project.ReviewBoard commit_raw.json PullRequest commit_raw.json RecentProfiles commit_raw.json RecentWidgets commit_raw.json RemoveMemberFromRole commit_raw.json SPACE.ID.API commit_raw.json ShareButton commit_raw.json Social.Page commit_raw.json SocialGraph.Lens commit_raw.json SocialGraph commit_raw.json SocialPosts commit_raw.json StarButton.Faces commit_raw.json StarButton commit_raw.json StartHere commit_raw.json Styled commit_raw.json SubmitProject commit_raw.json Support commit_raw.json TagsEditor commit_raw.json Test.Page commit_raw.json TipButton commit_raw.json TopPosts commit_raw.json TopWidgets commit_raw.json TotalHumans commit_raw.json Transfer commit_raw.json TransferButton commit_raw.json TransferProposal commit_raw.json Tutorial commit_raw.json UpvotedApps commit_raw.json UserRep commit_raw.json VoteButton commit_raw.json VouchButton commit_raw.json Welcome.GetInvolved commit_raw.json Welcome.RHS commit_raw.json WidgetBuilders commit_raw.json WidgetCard commit_raw.json YourPage.Editor commit_raw.json YourPage commit_raw.json abc.Page commit_raw.json abc.View.Page commit_raw.json accept commit_raw.json adapter.github commit_raw.json adapter.ipfs commit_raw.json africa.election commit_raw.json all.stars commit_raw.json any.image commit_raw.json app.create commit_raw.json app.example commit_raw.json app commit_raw.json approve commit_raw.json asia.election commit_raw.json attest commit_raw.json aurora.Page commit_raw.json australia.election commit_raw.json banyan.logo commit_raw.json blocklive commit_raw.json blocks.container commit_raw.json bos-landing-page commit_raw.json bos.Page commit_raw.json build commit_raw.json card commit_raw.json catalog commit_raw.json check.example commit_raw.json check.group commit_raw.json check commit_raw.json city.app commit_raw.json city.form commit_raw.json city.modal commit_raw.json cityscape commit_raw.json claim.badge commit_raw.json common.library commit_raw.json common commit_raw.json commons.add commit_raw.json commons.builders commit_raw.json commons.join commit_raw.json commons commit_raw.json communities.join commit_raw.json communities.page commit_raw.json communities.regional commit_raw.json communities commit_raw.json community.app commit_raw.json community.card commit_raw.json community.groups commit_raw.json community.join commit_raw.json community.onboarding commit_raw.json community.page commit_raw.json community.tabs commit_raw.json community commit_raw.json compare commit_raw.json config.feed commit_raw.json connect.badge commit_raw.json connect.button commit_raw.json connect.notification commit_raw.json connect.notifications commit_raw.json connect.page commit_raw.json connect.profile commit_raw.json connect.stats commit_raw.json connections commit_raw.json continent.join commit_raw.json contributors commit_raw.json countdown commit_raw.json create.group commit_raw.json create.hyperfile commit_raw.json create.library commit_raw.json create.page commit_raw.json create.posts commit_raw.json creatives.apps commit_raw.json creatives.dao commit_raw.json creatives.why commit_raw.json crossword.puzzle.create commit_raw.json crossword.puzzle commit_raw.json curator commit_raw.json dao.badge commit_raw.json dao.badges commit_raw.json dao.candidate commit_raw.json dao.candidates commit_raw.json dao.change.policy commit_raw.json dao.connect commit_raw.json dao.create.event commit_raw.json dao.create.post commit_raw.json dao.create commit_raw.json dao.cta commit_raw.json dao.election.header commit_raw.json dao.election commit_raw.json dao.follow.badge commit_raw.json dao.follow commit_raw.json dao.gigs commit_raw.json dao.groups commit_raw.json dao.home commit_raw.json dao.join commit_raw.json dao.main commit_raw.json dao.members commit_raw.json dao.new commit_raw.json dao.nominee commit_raw.json dao.page.settings commit_raw.json dao.page commit_raw.json dao.people commit_raw.json dao.profile.card commit_raw.json dao.proposal.comments commit_raw.json dao.proposal commit_raw.json dao.proposals commit_raw.json dao.registry commit_raw.json dao.subscribe commit_raw.json dao.verify commit_raw.json daoId.Main commit_raw.json data.Page commit_raw.json data.library commit_raw.json data.menu commit_raw.json data.projects commit_raw.json dbos commit_raw.json demo commit_raw.json dev.Activity commit_raw.json dev.Badge commit_raw.json dev.Content commit_raw.json dev.Guide.Editor commit_raw.json dev.Guide commit_raw.json dev.Guides commit_raw.json dev.Menu.Editor commit_raw.json dev.Menu commit_raw.json dev.Page.Editor commit_raw.json dev.Page.Guide commit_raw.json dev.Page.Header commit_raw.json dev.Page.Tabs commit_raw.json dev.Page commit_raw.json dev.Posts commit_raw.json dev.Start commit_raw.json dev.Summary commit_raw.json dev.View.Page commit_raw.json dev.Widget.Card commit_raw.json dev.Widget.Search.Item commit_raw.json dev.Widget.Search commit_raw.json dev.Widget.Vouch commit_raw.json dev.Widget commit_raw.json dev.Widgets commit_raw.json dev.badge commit_raw.json dev.groups commit_raw.json dev.info commit_raw.json dev.join commit_raw.json dev.library commit_raw.json dev.org commit_raw.json dev.profile.line commit_raw.json dev.profile commit_raw.json dev.proposal.comments commit_raw.json dev.proposal.vote commit_raw.json dev.proposal.voters commit_raw.json dev.proposal commit_raw.json dev.rank commit_raw.json dev.side.config commit_raw.json dev.side commit_raw.json dev.sidebar commit_raw.json dev.social commit_raw.json dev.tabs commit_raw.json dev.task.claim commit_raw.json dev.task.propose commit_raw.json dev.task commit_raw.json dev.tasks commit_raw.json dev commit_raw.json devhub.community commit_raw.json devhub.tags commit_raw.json devs.jutsu commit_raw.json devs commit_raw.json directory commit_raw.json docs.card commit_raw.json docs.cli commit_raw.json docs.vscode commit_raw.json docs commit_raw.json editor commit_raw.json edu.Page commit_raw.json edu.library commit_raw.json edu.navbar commit_raw.json edu.question commit_raw.json election.demo commit_raw.json erc20-sender commit_raw.json eth.social commit_raw.json europe.election commit_raw.json evaporation.button commit_raw.json event.card commit_raw.json event.create commit_raw.json event.editor commit_raw.json event.hackathon commit_raw.json event.page commit_raw.json event.tabs commit_raw.json event.view commit_raw.json events.Calendar commit_raw.json events.MonthView commit_raw.json events.app.create commit_raw.json events.app commit_raw.json events.attendance commit_raw.json events.cal commit_raw.json events.profile commit_raw.json events.view commit_raw.json events commit_raw.json every.canvas commit_raw.json every.context commit_raw.json every.dao commit_raw.json every.feed commit_raw.json every.group commit_raw.json every.one commit_raw.json every.tag commit_raw.json every.thing commit_raw.json every commit_raw.json everyone commit_raw.json evisceration.button commit_raw.json example.image commit_raw.json example commit_raw.json examples commit_raw.json explore.posts commit_raw.json faces commit_raw.json featured.posts commit_raw.json feed commit_raw.json fork.notification commit_raw.json fork commit_raw.json form.account commit_raw.json form.categories commit_raw.json form.language commit_raw.json form.number commit_raw.json form.phase commit_raw.json form.place commit_raw.json form.select.one commit_raw.json form.select.pageType commit_raw.json form.select.type commit_raw.json form.select commit_raw.json form.text.area commit_raw.json form.text commit_raw.json freelancers.page commit_raw.json friends commit_raw.json get.origin commit_raw.json gov.Badge commit_raw.json gov.badge commit_raw.json graph.follow commit_raw.json graph.list commit_raw.json graph.view commit_raw.json group.add commit_raw.json group.badge commit_raw.json group.card commit_raw.json group.community commit_raw.json group.contributors commit_raw.json group.create commit_raw.json group.creator commit_raw.json group.data commit_raw.json group.directory commit_raw.json group.edit commit_raw.json group.editor commit_raw.json group.image commit_raw.json group.index commit_raw.json group.info commit_raw.json group.inline commit_raw.json group.join commit_raw.json group.list commit_raw.json group.members commit_raw.json group.overlay.trigger commit_raw.json group.overlay commit_raw.json group.remove commit_raw.json group.requests commit_raw.json group.review commit_raw.json group.save commit_raw.json group.selector commit_raw.json group.settings commit_raw.json group.stats commit_raw.json group.tabs commit_raw.json group.view commit_raw.json group commit_raw.json groups commit_raw.json hack.library commit_raw.json hackathon.Page commit_raw.json hashtag.Main commit_raw.json interaction-tools.library commit_raw.json interest.accumulator commit_raw.json join.button commit_raw.json list.card commit_raw.json list.create commit_raw.json list.edit commit_raw.json list.explore commit_raw.json lists.explore commit_raw.json main.footer commit_raw.json map.explore commit_raw.json map.view commit_raw.json merge commit_raw.json meta.editor commit_raw.json meta.test commit_raw.json minsta commit_raw.json module.projects commit_raw.json multi.page commit_raw.json multi.social commit_raw.json n.style commit_raw.json nas commit_raw.json nb.join commit_raw.json near.Hashtag.Feed commit_raw.json near.builders commit_raw.json near.communities commit_raw.json near.denver commit_raw.json non-fungible.trees commit_raw.json north-america.election commit_raw.json notification.item commit_raw.json notification commit_raw.json nui.button commit_raw.json nui.checkbox commit_raw.json nyc.brooklyn commit_raw.json nyc.dao commit_raw.json nyc.manhattan commit_raw.json nyc.queens commit_raw.json nyc.statenisland commit_raw.json nyc.thebronx commit_raw.json overlay.trigger commit_raw.json owb commit_raw.json page.about commit_raw.json page.common commit_raw.json page.create commit_raw.json page.cta commit_raw.json page.docs commit_raw.json page.feed commit_raw.json page.form commit_raw.json page.home commit_raw.json page.index commit_raw.json page.navbar commit_raw.json page.sidebar commit_raw.json page commit_raw.json passport commit_raw.json post.greeting commit_raw.json pro.editor commit_raw.json pro.metadata commit_raw.json profile.builder commit_raw.json profile.dao commit_raw.json profile.human commit_raw.json profile.image commit_raw.json profile.inline commit_raw.json profile.linktree commit_raw.json profile.tg commit_raw.json profile.widget commit_raw.json progress.members commit_raw.json project.catalog commit_raw.json project.curation.edit commit_raw.json proposal commit_raw.json proposals commit_raw.json quest.card commit_raw.json quest.claim commit_raw.json quest.create.footer commit_raw.json quest.create.form commit_raw.json quest.create.step1 commit_raw.json quest.create.step2 commit_raw.json quest.create.step3 commit_raw.json quest.create.step4 commit_raw.json quest.create.step5 commit_raw.json quest.create.step6 commit_raw.json quest.create commit_raw.json quest commit_raw.json quests.about commit_raw.json quests.header commit_raw.json quests.index commit_raw.json quests.join commit_raw.json quests commit_raw.json quiz.bos commit_raw.json rbit.menu.links commit_raw.json rbit.menu.profiles commit_raw.json rbit.menu commit_raw.json rbit.profiles commit_raw.json rbit.social commit_raw.json react-bootstrap commit_raw.json recent.widgets commit_raw.json request.index commit_raw.json request commit_raw.json requests commit_raw.json review.modal commit_raw.json scholarship.card commit_raw.json scholarship.page commit_raw.json scholarships.menu commit_raw.json scholarships commit_raw.json send commit_raw.json some commit_raw.json south-america.election commit_raw.json src.footer commit_raw.json src.navbar commit_raw.json stakeholders commit_raw.json star.button commit_raw.json star.list commit_raw.json star.notification.item.LR commit_raw.json star.notification.item commit_raw.json star.notification commit_raw.json start commit_raw.json summary commit_raw.json survey.option commit_raw.json survey.part commit_raw.json survey commit_raw.json table commit_raw.json tag.create commit_raw.json tag.editor commit_raw.json tag.info commit_raw.json tag.remove commit_raw.json tags.editor commit_raw.json tags commit_raw.json template.inline commit_raw.json template.main commit_raw.json test.communities commit_raw.json thing.block commit_raw.json thing.card commit_raw.json thing.context commit_raw.json thing.image commit_raw.json thing.inline commit_raw.json thing.page commit_raw.json thing.row commit_raw.json thing commit_raw.json things commit_raw.json token.balance commit_raw.json top.widgets.forked commit_raw.json trust.button commit_raw.json trust.notification commit_raw.json trust.notifications commit_raw.json trust.page commit_raw.json trust.stats commit_raw.json trust.tabs commit_raw.json trust.web commit_raw.json trusted.badge commit_raw.json trusted.community commit_raw.json trusted.list commit_raw.json trusted.profile commit_raw.json trusting.list commit_raw.json update commit_raw.json valid commit_raw.json verified.holders commit_raw.json verified.humans commit_raw.json verified.members commit_raw.json view.posts commit_raw.json view commit_raw.json widget.card commit_raw.json widget.common commit_raw.json widget.compare commit_raw.json widget.inline commit_raw.json widget.profile commit_raw.json widget.search.item commit_raw.json widget.search commit_raw.json widget.source commit_raw.json widget.star commit_raw.json widgets.rank commit_raw.json widgets commit_raw.json words.build commit_raw.json xyz.View.Page commit_raw.json hackbox.near home commit_raw.json hackerhack.near Untitled-0 commit_raw.json hackerhouse.near CheckNFTSupply commit_raw.json EVMComponents commit_raw.json FeaturedComponents commit_raw.json IdeasList commit_raw.json JackingNameSkyWidget commit_raw.json NEAR SOCIAL BOUNTY BOARD commit_raw.json NFTWidgets commit_raw.json NearStakeFork commit_raw.json Profile.Contributions commit_raw.json ProgressBar commit_raw.json hackerhouse.near_e376ad82-01e5-4599-a3b8-867341410355 commit_raw.json hackoween.near app commit_raw.json blocks.container commit_raw.json blocks.content commit_raw.json data.projects commit_raw.json hangil.near Greeter commit_raw.json MyProfile commit_raw.json hannah17.near FungibleTokenBalance commit_raw.json PriceStats commit_raw.json Welcome commit_raw.json dao.create.post.ashe commit_raw.json dao.create.post.nrc commit_raw.json harmonic1.near Draft-1 commit_raw.json FontDemo commit_raw.json HellowWorld commit_raw.json MusicPlayer-Harmonic commit_raw.json MusicUpload commit_raw.json NFTMinter commit_raw.json NFTViewer commit_raw.json TosCheck commit_raw.json Typography.DMSans commit_raw.json artist-content-template commit_raw.json artist.card commit_raw.json artist.feed commit_raw.json artist.landing commit_raw.json artist commit_raw.json artist2 commit_raw.json artist3 commit_raw.json buildspace commit_raw.json create.artist commit_raw.json encryption-test commit_raw.json every.thing.view commit_raw.json harmonicHomPage commit_raw.json home commit_raw.json multiple-template commit_raw.json musicians commit_raw.json newsletter commit_raw.json onboarding-homepage commit_raw.json trialDropDeploy commit_raw.json harrydhillon.near AccountProfile commit_raw.json BountyManager.Layout.Tab commit_raw.json BountyManager.ManageAccount commit_raw.json BountyManager.Transfer commit_raw.json BountyManager.Unwrap commit_raw.json Component-Indexer commit_raw.json EasyPoll-IAH commit_raw.json EasyPoll-Mobile-Friendly commit_raw.json Easypoll-Abort-Poll-Creation-Modal commit_raw.json Easypoll-header-buttons commit_raw.json GotvBotTransactionTracking commit_raw.json GotvTransactionTracking commit_raw.json Header commit_raw.json Inputs.Text commit_raw.json Inputs.TextNumber commit_raw.json Keypom.CollectInfo.AddCustomFieldModal commit_raw.json Keypom.CollectInfo.Index commit_raw.json Keypom.CollectInfo commit_raw.json Keypom.Components.Imageupload commit_raw.json Keypom.Components.Input commit_raw.json Keypom.Components.Modal commit_raw.json Keypom.Components.Searchbar commit_raw.json Keypom.Components.Select commit_raw.json Keypom.Components.StepLabel commit_raw.json Keypom.Components.TicketLogo commit_raw.json Keypom.Components.Toggle commit_raw.json Keypom.EnterEventInfo commit_raw.json Keypom.EventInfo.Eventview commit_raw.json Keypom.EventInfo.Form commit_raw.json Keypom.Eventview commit_raw.json Keypom.Form commit_raw.json Keypom.Header commit_raw.json Keypom.Imageupload commit_raw.json Keypom.Input commit_raw.json Keypom.Landing.AllDrops.Index commit_raw.json Keypom.Landing.AllDrops.Table commit_raw.json Keypom.Landing.DropDetails.ExternalLinkSVG commit_raw.json Keypom.Landing.DropDetails.Index commit_raw.json Keypom.Landing.DropDetails.Table commit_raw.json Keypom.Landing.TicketDetails.Index commit_raw.json Keypom.Landing.TicketDetails.Preview commit_raw.json Keypom.Landing.TicketDetails.Table commit_raw.json Keypom.Loading commit_raw.json Keypom.Review.Index commit_raw.json Keypom.Review.TicketTable commit_raw.json Keypom.Review.index commit_raw.json Keypom.StepLabel commit_raw.json Keypom.TicketDropLayout commit_raw.json Keypom.TicketLogo commit_raw.json Keypom.Tickets.AddTicketModal commit_raw.json Keypom.Tickets.CloneSVG commit_raw.json Keypom.Tickets.DeleteSVG commit_raw.json Keypom.Tickets.EditSVG commit_raw.json Keypom.Tickets.EyeSVG commit_raw.json Keypom.Tickets.TicketPreview commit_raw.json Keypom.Tickets.index commit_raw.json Kudos-fork commit_raw.json ListOfComponentsOnJutsu commit_raw.json ListOfPeopleOnJutsu commit_raw.json MintBase.ActionText commit_raw.json MintBase.Chips commit_raw.json MintBase.Logo commit_raw.json MintBase.Pill commit_raw.json MintBase.Tooltip commit_raw.json MyComponent commit_raw.json NFT-Trade commit_raw.json NFT-Transfer commit_raw.json NFTSwap.ConfirmOffer commit_raw.json NFTSwap.Modal commit_raw.json NFTSwap.NFT-Trade commit_raw.json NFTSwap.NFT-Transfer commit_raw.json NFTSwap.NewOffer commit_raw.json NFTSwap.Order commit_raw.json NFTSwap.ViewOrder commit_raw.json New-Component commit_raw.json Profile.Header commit_raw.json ProfilePage.Contributions.Item commit_raw.json ProfilePage.Contributions commit_raw.json ProfilePage.Main commit_raw.json ProfilePage.PullRequestIcon commit_raw.json ProfilePage.UserInfo commit_raw.json ProfilePage.WidgetItem commit_raw.json QRcodReader commit_raw.json QRcodeReader commit_raw.json QRcodeReaderMobile commit_raw.json QrCodeReaderPC commit_raw.json SDK.donate commit_raw.json SearchPage.ComponentItem.TimeAgo commit_raw.json Ticket.Page commit_raw.json Yay commit_raw.json allVotingWidget-Input-Mobile-Friendly commit_raw.json allVotingWidget-JSX-Return-Mobile-Friendly commit_raw.json allVotingWidget-Mobile-Friendly-JSX-V2 commit_raw.json allVotingWidget-Mobile-Friendly-v2 commit_raw.json allVotingWidget-Mobile-Friendly commit_raw.json allVotingWidget-RenderMultiInput-Mobile-Friendly commit_raw.json allVotingWidget-Renderpercentage-Mobile-Friendly commit_raw.json awesome-component commit_raw.json data-to-qr-image commit_raw.json gigs-board.components.layout.Banner commit_raw.json gigs-board.components.layout.Page commit_raw.json gigs-board.pages.Feed commit_raw.json new-component commit_raw.json new-testing-comp commit_raw.json newVotingInterface-JSX-Mobile-Friendly commit_raw.json newVotingInterface-Mobile-Friendly commit_raw.json newVotingInterface-Polls-By-Creator-Mobile-Friendly commit_raw.json newcustom commit_raw.json nft-selector commit_raw.json questionsByCreator-Mobile-Friendly commit_raw.json showQuestionsHandler-Mobile-Friendly commit_raw.json test-component-1 commit_raw.json test-component commit_raw.json harshit.near sup commit_raw.json harucoinlove.near most-active-contracts commit_raw.json hausaman.near GasandPetrolPrices commit_raw.json hcho112.near test commit_raw.json hectoralexiz03.near Onboarding.Starter commit_raw.json hellonepbot.near Nepbot commit_raw.json herezkera.near zkEraBuyZLP commit_raw.json zkEraPositionOpening commit_raw.json hoangvietanh.near Add Blog commit_raw.json Donate commit_raw.json DonateToTheWiki commit_raw.json Hello everybody commit_raw.json Hello commit_raw.json Make the first topic commit_raw.json My NFTs commit_raw.json My displayed NFT commit_raw.json Testing first commit_raw.json Testing first onchain social network commit_raw.json Uniswap.Swap.Dex commit_raw.json Web 3 Investment threat commit_raw.json Web 3 investment opinion commit_raw.json Why I invested heavily on $Near commit_raw.json Why I invested heavily on $Near commit_raw.json YourNFTs commit_raw.json hooksdemo.near Test.State commit_raw.json Test.TaskTracker commit_raw.json Test.TimeOut commit_raw.json Test.TransformInput commit_raw.json app commit_raw.json hub.near NEARHub Tree commit_raw.json NEARHubTree commit_raw.json hub.near_86d130c6-d3f0-4ed7-9b85-35affbf48a8b commit_raw.json hub.near_e76d8618-8c17-4bc8-9d62-184eb55172b6 commit_raw.json hubbabubba.near FAQ-draft commit_raw.json huel.near WeAreDevsStatusBoard commit_raw.json humanman.near AIP.IpfsFileUpload commit_raw.json Agify commit_raw.json CardGallery commit_raw.json CardMenu commit_raw.json CryptoBootcamp commit_raw.json Draft-0 commit_raw.json FoundersResources commit_raw.json Learn.Card.Partner commit_raw.json Learn.List.Partner commit_raw.json Learn.List commit_raw.json NH.PDFdownload commit_raw.json NH.getting-started commit_raw.json SelectButton commit_raw.json SimpleCard commit_raw.json StyledComponentButtonExample commit_raw.json YouTubeVideo commit_raw.json wiki-web3-module-1.1 commit_raw.json wiki-web3-module-1.2 commit_raw.json wiki.near.org commit_raw.json wiki commit_raw.json wikiMarkdownFetcher commit_raw.json humans-of-near.near Alert commit_raw.json Header-fork commit_raw.json Header commit_raw.json Human-Filters-Modal commit_raw.json Human-Filters_Modal commit_raw.json Human-Information commit_raw.json Human-Profile-Modal commit_raw.json Human-sidebar commit_raw.json HumanAlert commit_raw.json Humans-of-NEAR commit_raw.json Humans-of-Near commit_raw.json Map-Iframe commit_raw.json Mapbox-fork commit_raw.json Mapbox commit_raw.json Modal commit_raw.json Select commit_raw.json Under-Construction commit_raw.json Untitled-0 commit_raw.json home commit_raw.json humans.nearverselabs.com-fork commit_raw.json humans.nearverselabs.com commit_raw.json humans commit_raw.json humans_of_near commit_raw.json humoungus_donkey.near GetDataFromChild commit_raw.json PassDataToParent commit_raw.json huunhanz.near HeroSwap commit_raw.json Lonk.Container commit_raw.json Lonk.Main commit_raw.json Lonk.buy commit_raw.json Lonk.hero commit_raw.json Lonk.index commit_raw.json Lonk.stake commit_raw.json Lonk.veax-swap commit_raw.json Lonk commit_raw.json buyLonk commit_raw.json headerSwap commit_raw.json ref-swap commit_raw.json ref-token-input commit_raw.json selectToken commit_raw.json hyperbuild.near app commit_raw.json config.app commit_raw.json greeting commit_raw.json navigation.Navbar commit_raw.json page.create commit_raw.json page.explore commit_raw.json page.home commit_raw.json template.AppLayout commit_raw.json template.SidebarLayout commit_raw.json hyperfiles.near CreateMetadata commit_raw.json IpfsMultiUploadPDF commit_raw.json MetadataEditor commit_raw.json adapter.github commit_raw.json adapter.ipfs commit_raw.json app commit_raw.json create commit_raw.json docs commit_raw.json explore commit_raw.json hyperfile.create commit_raw.json hyperfile.index commit_raw.json hyperfile.view commit_raw.json index-dev commit_raw.json index commit_raw.json merge commit_raw.json profile.social commit_raw.json profile commit_raw.json query.search commit_raw.json schema.array commit_raw.json schema.edit commit_raw.json schema.select commit_raw.json source.array commit_raw.json source.edit commit_raw.json type.select commit_raw.json view.history commit_raw.json view.tree commit_raw.json view commit_raw.json pie chart mix chart social graph nodes i1417730344.tg Index commit_raw.json Onboarding.Starter-fork commit_raw.json Search.FullPage.Facets commit_raw.json iam_prometheus.near genadropMinter commit_raw.json iamwho.near oxakldakldlkadlkfalkf commit_raw.json oxaoiriaowkldaklf commit_raw.json oxdalkdkdk commit_raw.json oxggjcwti9vbb0y commit_raw.json szlhyjoIhy commit_raw.json test123 commit_raw.json icebreak.near test commit_raw.json identity.near ConnectButton commit_raw.json faq commit_raw.json ndc.verify commit_raw.json verify.faq commit_raw.json verify.profile commit_raw.json verify commit_raw.json idknwhoru.near Composition commit_raw.json Composition_Another_Widget commit_raw.json DeFiGame-CEX commit_raw.json DeFiGame-DEX commit_raw.json DeFiGame-WallectConnect commit_raw.json DeFiGame-WalletConnect commit_raw.json Greeter commit_raw.json GreeterToday commit_raw.json GreeterWHORU commit_raw.json GreeterYourName commit_raw.json LidoStakeExample commit_raw.json Liquity commit_raw.json LiquityLand commit_raw.json NotificationFeed commit_raw.json PropsDrillingTestComponent commit_raw.json SWF.2023.grit.Donate commit_raw.json SWF.2023.grit.GNB commit_raw.json SWF.2023.grit.LeagueBanner commit_raw.json SWF.2023.grit.MainPage commit_raw.json SWF.2023.grit.MyPage commit_raw.json SWF.2023.grit.Player commit_raw.json SWF.2023.grit.PlayerList commit_raw.json SimpleProject commit_raw.json SocialAPITest commit_raw.json Untitled-0 commit_raw.json UseStateText commit_raw.json ZKEVMSWAPComposition commit_raw.json collegium-greeting commit_raw.json collegium.bos.wk2.EthereumContractWidget commit_raw.json collegium.bos.wk2.LiquityOpenTrove commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepolia commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json collegium.bos.wk2.StateWidget commit_raw.json collegium.bos.wk2.Web3ConnectWidget commit_raw.json collegium.bos.wk3.MyPosts commit_raw.json collegium.bos.wk3.MyProfilePage commit_raw.json collegium.bos.wk3.PostEditor commit_raw.json collegium.bos.wk3.SocialWidget commit_raw.json liquityComponentBorrow commit_raw.json liquityComponentPayoff commit_raw.json liquityOTSepolia commit_raw.json o2o13o7w124ztnv commit_raw.json quick_start.Container commit_raw.json quick_start.Greetings commit_raw.json idris22.near everything commit_raw.json igris.near DaisyUIWrapper commit_raw.json TailwindWrapper commit_raw.json TekunoOwned commit_raw.json WeAreDevsStatusBoard commit_raw.json igrubisic.near ChainAbstractionWorkshop commit_raw.json ihsotas.near pdf_document commit_raw.json ihyshan.near BAC.DAO.main commit_raw.json Carousel commit_raw.json Common.Layout.Header commit_raw.json DAO.Discussion commit_raw.json DAO.Join commit_raw.json DAO.Layout.Header commit_raw.json DAO.Layout.Sidebar commit_raw.json DAO.Layout.Tabs commit_raw.json DAO.Proposals.index commit_raw.json DAO.Social commit_raw.json DAO.Tabs commit_raw.json DAO.index commit_raw.json DAO.main.sidebar commit_raw.json DAO commit_raw.json DAOs.index commit_raw.json Feed.index commit_raw.json MJG-Widget-PPets commit_raw.json MJG-Widget-Test commit_raw.json MJG-Widget commit_raw.json NRC-DAO commit_raw.json NRC.DAO.main commit_raw.json ProfileEditor.NRC commit_raw.json ReFi.DAO.main commit_raw.json Research-Collective.DAO.main commit_raw.json Test commit_raw.json home commit_raw.json ihyshan.near-PixelPetsWidget commit_raw.json proposal-by-month commit_raw.json proposals-status commit_raw.json test commit_raw.json ijoh.near Calendar commit_raw.json GreeterToday commit_raw.json ilerik.near chat commit_raw.json meself commit_raw.json wot commit_raw.json ilyar.near NDCDocs commit_raw.json imagin.near ComponentProfile commit_raw.json NICEcards commit_raw.json imiroslav.near AwesomeNearFavorites commit_raw.json AwesomeNearIcons commit_raw.json AwesomeNearProjectCard commit_raw.json AwesomeNearProjectCardLite commit_raw.json LearningGreeting commit_raw.json indonesiaguild.near CRM commit_raw.json CalendMe commit_raw.json RCDashboard-WIP commit_raw.json infinity.near AddQuestion commit_raw.json CreateDrop commit_raw.json DAO.Post.Card commit_raw.json Groups commit_raw.json MainPage.Compose commit_raw.json Optical commit_raw.json ProPage.Post.Header commit_raw.json ProfilePage commit_raw.json ProjectPage.Compose commit_raw.json ProjectPage.Content commit_raw.json ProjectPage.Post commit_raw.json Question commit_raw.json Templates commit_raw.json VoteClicker commit_raw.json Welcome commit_raw.json infinitynft.near AMBER Metaverse commit_raw.json ailand commit_raw.json amber commit_raw.json inscribe.near NEAT.FormInput commit_raw.json NEAT.IndexTable commit_raw.json NEAT.Indexer commit_raw.json NEAT.Mint commit_raw.json NEAT.Pagination commit_raw.json NEAT.SearchInput commit_raw.json NEAT.Transfer commit_raw.json NEAT.Unwrap commit_raw.json NEAT.Wrap commit_raw.json NEAT.WrapUnwrap commit_raw.json NEAT commit_raw.json NRC-20.AssetSelect commit_raw.json NRC-20.Deploy commit_raw.json NRC-20.DescriptionProgress commit_raw.json NRC-20.IndexTable commit_raw.json NRC-20.Mint commit_raw.json NRC-20.MyInscriptions commit_raw.json NRC-20.MyInscriptionsTable commit_raw.json NRC-20.NRC-20 commit_raw.json NRC-20.Progress commit_raw.json NRC-20.RepeatInput commit_raw.json NRC-20.TokenDescription commit_raw.json NRC-20.TokenRegistration commit_raw.json NRC-20.TokensTable commit_raw.json NRC-20.Transfer commit_raw.json NRC-20.Unwrap commit_raw.json NRC-20.Wrap commit_raw.json NRC-20.WrapUnwrap commit_raw.json NRC-20 commit_raw.json lib.HeaderContainer commit_raw.json lib.Logo commit_raw.json lib.MainStyle commit_raw.json lib.Tab commit_raw.json lib.TableStyle commit_raw.json lib.constants commit_raw.json lib.data.GlobalData commit_raw.json lib.form.FormBody commit_raw.json lib.form.FormButton commit_raw.json lib.form.FormButtonGroup commit_raw.json lib.form.FormContainer commit_raw.json lib.form.FormFragment commit_raw.json lib.form.FormRowContainer commit_raw.json lib.form.FormRowTitle commit_raw.json lib.form.FormRowValue commit_raw.json lib.form.FormTitle commit_raw.json intersectionobserver.near BlogEntry commit_raw.json iqbalutomo.near paras-nft-free-mint commit_raw.json irfi.near CalendMe commit_raw.json HelloWorld commit_raw.json MassFollowingWithSelect10 commit_raw.json MassFollowingWithSelect50 commit_raw.json RCDashboard-WIP commit_raw.json WidgetBaru commit_raw.json irwing-dur.near forum commit_raw.json home commit_raw.json login commit_raw.json isaacwilliam.near Untitled-0 commit_raw.json isayahc.near Affordable_Map commit_raw.json Calendar commit_raw.json Map.demo commit_raw.json sample-open-data commit_raw.json itablockchainclub.near Draft-0 commit_raw.json itexpert120-contra.near Button.Create commit_raw.json Calendar.Create commit_raw.json Calendar commit_raw.json CalendarTest commit_raw.json ComponentsLibrary commit_raw.json CreateEvent commit_raw.json CustomEventCard commit_raw.json DefaultHomepage commit_raw.json DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json DiscoverBOSProjects commit_raw.json DrawEverythingSpline commit_raw.json EditEvent commit_raw.json Editor commit_raw.json EditorProvider commit_raw.json Event-test-Button commit_raw.json EventCalendar commit_raw.json EventCard commit_raw.json EventFeed commit_raw.json EventForm commit_raw.json EventItem commit_raw.json EventProposalButton commit_raw.json EventTest commit_raw.json EventView commit_raw.json Events commit_raw.json FilterForm commit_raw.json Gateway commit_raw.json GatewayDirectory commit_raw.json Homepage commit_raw.json HomepageSelector commit_raw.json Index commit_raw.json MobileCalendar commit_raw.json MonacoEditor commit_raw.json OpenFileModal commit_raw.json ProjectCard commit_raw.json ProposeProject commit_raw.json ReviewProjects commit_raw.json TestBOSHacks commit_raw.json TestDirectory commit_raw.json TestEditor commit_raw.json TestEventView commit_raw.json TestInput commit_raw.json TestLinks commit_raw.json UpcomingEvents commit_raw.json app commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.struct commit_raw.json core.lib.url commit_raw.json devhub.components.atom.Alert commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.connect commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.layout.LikeButton.Faces commit_raw.json devhub.components.molecule.AccountAutocomplete commit_raw.json devhub.components.molecule.BadgeDetails commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.CommunityControl commit_raw.json devhub.components.molecule.Input commit_raw.json devhub.components.molecule.ListEditor commit_raw.json devhub.components.molecule.MarkdownEditor commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.ProfileLine commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.SimpleMDE commit_raw.json devhub.components.molecule.Switch commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.provider commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Configurator commit_raw.json devhub.entity.addon.github.Viewer commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.telegram.Viewer commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Activity commit_raw.json devhub.entity.community.Card commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AccessControlConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.post.History commit_raw.json devhub.entity.post.List commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Post commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.entity.team.Configurator commit_raw.json devhub.entity.team.LabelPermissions commit_raw.json devhub.entity.team.LabelRow commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.page.about commit_raw.json devhub.page.addon commit_raw.json devhub.page.admin.homepageTab commit_raw.json devhub.page.admin.index commit_raw.json devhub.page.admin.moderatorsTab commit_raw.json devhub.page.admin.restrictedLabelsTab commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.community.index commit_raw.json devhub.page.contribute commit_raw.json devhub.page.create commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json its4d2.near mft_transfer commit_raw.json storage_management commit_raw.json tkn_minter commit_raw.json token_leaderboard commit_raw.json ivhorvat.near Untitled-0 commit_raw.json jackbliss.near ForkThis commit_raw.json jakmeier.near CanvasParty commit_raw.json CanvasPartyGame commit_raw.json GameBoyInput commit_raw.json HelloGame commit_raw.json KeyInput commit_raw.json MapView commit_raw.json TileGrid commit_raw.json james.near Academy commit_raw.json Badge.create commit_raw.json Badge commit_raw.json BadgeButton commit_raw.json BuilderHat.claim commit_raw.json BuilderHat.give commit_raw.json BuilderHat commit_raw.json CopyButton commit_raw.json FetchProfiles commit_raw.json FollowButton commit_raw.json FollowStats commit_raw.json FollowsYouBadge commit_raw.json ForkThis commit_raw.json Index commit_raw.json LatestWidgets commit_raw.json NDC.WG.Create commit_raw.json NFT.Gov commit_raw.json NFT.Social commit_raw.json Profile commit_raw.json ProfilePage commit_raw.json SDKs.Yup.API commit_raw.json TalentLayer.dashboard.mints commit_raw.json apps commit_raw.json ask commit_raw.json attester.resolver commit_raw.json com.library commit_raw.json com.navbar commit_raw.json com.posts commit_raw.json com.settings commit_raw.json communities.page commit_raw.json community.app commit_raw.json community.thing commit_raw.json community.thingy commit_raw.json community commit_raw.json components.profile.ProfileEdit commit_raw.json components.profile.ProfileInfo commit_raw.json components.profile.ProfileTabs commit_raw.json connect.button commit_raw.json connections commit_raw.json create.badge commit_raw.json create.library commit_raw.json create.page commit_raw.json dao.button commit_raw.json dao.connections commit_raw.json dao.profile.card commit_raw.json dao.profile commit_raw.json dbos commit_raw.json diff commit_raw.json discussion commit_raw.json docs.card commit_raw.json ecosystem commit_raw.json eth.Apps commit_raw.json explore.builders commit_raw.json explore.community commit_raw.json feed commit_raw.json fork commit_raw.json freelancer.profile commit_raw.json freelancers.page commit_raw.json history commit_raw.json inline commit_raw.json liberty commit_raw.json mutuals commit_raw.json nearcaster commit_raw.json optical.demo commit_raw.json overlay.trigger commit_raw.json player.create commit_raw.json player.inline commit_raw.json profile.block commit_raw.json profile.hover.modal commit_raw.json profile.hover commit_raw.json profile.image commit_raw.json profile.inline commit_raw.json profile.link commit_raw.json profile.page commit_raw.json profile.search commit_raw.json repository commit_raw.json request.collab commit_raw.json requests commit_raw.json search.input commit_raw.json search commit_raw.json social.near commit_raw.json source commit_raw.json styling commit_raw.json summary commit_raw.json update commit_raw.json verified.builders commit_raw.json verified.humans commit_raw.json jamieoliver.near test commit_raw.json jamonix.near Auth commit_raw.json InfoList commit_raw.json ZkClient commit_raw.json jarocho.near Proyecto1 commit_raw.json jass-build.near trialAccountWasm commit_raw.json trialDropDeploy commit_raw.json jass.near calendarembed commit_raw.json harmonicHomPage commit_raw.json helloWorld commit_raw.json home commit_raw.json newsletter commit_raw.json jaswinder.near FontDemo commit_raw.json MusicPlayer-Harmonic commit_raw.json gigs-board.pages.Feed commit_raw.json harmonicHomPage commit_raw.json home commit_raw.json index commit_raw.json nft-marketplace commit_raw.json jay100.near Big_B commit_raw.json CCT-Button commit_raw.json CH-Dashboard commit_raw.json CH-Widget commit_raw.json CTT-Button commit_raw.json CTT-Widget commit_raw.json CTTDashboard commit_raw.json CTTDescription commit_raw.json Carousel commit_raw.json MJG-Widget commit_raw.json MJG-fork commit_raw.json MJG commit_raw.json Mora_Merge commit_raw.json Phaser Test commit_raw.json PixelParty-Dashboard commit_raw.json PixelParty-Widget commit_raw.json PixelParty commit_raw.json PixelPets-Dashboard commit_raw.json PixelPets-Widget commit_raw.json PlayerDashboard commit_raw.json Testing-Component commit_raw.json big_b_testing commit_raw.json iframe-example commit_raw.json matter-js commit_raw.json onclick_test commit_raw.json p5jsGuide commit_raw.json p5js_game commit_raw.json post-to-dao commit_raw.json unityIframe commit_raw.json jaydendangvu.near Posts commit_raw.json jb53980.near Onboarding.Starter-fork commit_raw.json jcosta.near Colecoes NearBr commit_raw.json ColecoesNearBr commit_raw.json LinksNearBr commit_raw.json LinktreeNearBr commit_raw.json MeusNFTs commit_raw.json Projetos Brasileiros commit_raw.json Untitled-0 commit_raw.json WebSite commit_raw.json WebSiteNearBr commit_raw.json jeffgold.near LocalStateWidget commit_raw.json jeffsatori.near AddEvent commit_raw.json AddQuestion commit_raw.json Attendance Tracker commit_raw.json AttendanceTracker commit_raw.json CreateEvent commit_raw.json DoYouBUIDL commit_raw.json DoYouBUIDL? commit_raw.json Event Attendance Tool commit_raw.json EventCreator commit_raw.json EventRSVPTool commit_raw.json Events commit_raw.json EventsList commit_raw.json Jeff Contact Information commit_raw.json Jeff's Contact Information commit_raw.json ThoughtOfTheDay commit_raw.json Widget-3 commit_raw.json jehurdguez.near TestMensajes commit_raw.json jelenabalac.near Untitled-0 commit_raw.json jelep.near bestblockup commit_raw.json jgdev.near DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json Ideas commit_raw.json LocalStateWidget commit_raw.json Post commit_raw.json gigs-board.components.atom.button-switch commit_raw.json gigs-board.components.boards.KanbanBoard commit_raw.json gigs-board.components.community.CommunityHeader commit_raw.json gigs-board.components.community.FeaturedCommunity commit_raw.json gigs-board.components.community.FeedHeader commit_raw.json gigs-board.components.community.Layout commit_raw.json gigs-board.components.layout.Banner commit_raw.json gigs-board.components.layout.Controls commit_raw.json gigs-board.components.layout.LikeButton.Faces commit_raw.json gigs-board.components.layout.Navbar commit_raw.json gigs-board.components.layout.PlusPost commit_raw.json gigs-board.components.layout.ProfileHeader commit_raw.json gigs-board.components.layout.ProfileLine commit_raw.json gigs-board.components.layout.ProfileLineNew commit_raw.json gigs-board.components.layout.SearchByAuthor commit_raw.json gigs-board.components.layout.SearchByLabel commit_raw.json gigs-board.components.layout.Sidebar commit_raw.json gigs-board.components.posts.CompactPost commit_raw.json gigs-board.components.posts.DiscussionFeed commit_raw.json gigs-board.components.posts.List commit_raw.json gigs-board.components.posts.Post commit_raw.json gigs-board.components.posts.PostEditor commit_raw.json gigs-board.components.posts.ProfileHeader commit_raw.json gigs-board.components.posts.Search commit_raw.json gigs-board.components.teams.LabelsPermissions commit_raw.json gigs-board.components.teams.TeamInfo commit_raw.json gigs-board.entity.github-repo.board commit_raw.json gigs-board.entity.github-repo.ticket commit_raw.json gigs-board.feature.integration.github.board-config-editor commit_raw.json gigs-board.pages.Boards commit_raw.json gigs-board.pages.Create commit_raw.json gigs-board.pages.Feed commit_raw.json gigs-board.pages.Teams commit_raw.json gigs-board.pages.WrapperWidget commit_raw.json gigs-board.pages.community.Activity commit_raw.json gigs-board.pages.community.Discussions commit_raw.json gigs-board.pages.community.Events commit_raw.json gigs-board.pages.community.Overview commit_raw.json gigs-board.pages.community.Sidebar commit_raw.json gigs-board.pages.community.Sponsorship commit_raw.json gigs-board.pages.community.Teams commit_raw.json gigs-board.pages.community.Telegram commit_raw.json gigs-board.pages.community.github commit_raw.json gigs-board.pages.localstate commit_raw.json jgodwill.near AiImageGenerationLogicFetch commit_raw.json AllDAOs commit_raw.json BOSDirectory-1 commit_raw.json BOSDirectory-Dark commit_raw.json BOSDirectory-bright commit_raw.json BOSDirectory commit_raw.json CPlanet.ArtistPage.Sidebar commit_raw.json CPlanet.ArtistPage.index commit_raw.json CPlanet.ChainsDropdown commit_raw.json CPlanet.Common.Compose commit_raw.json CPlanet.EmbeddedNFT commit_raw.json CPlanet.FeaturedDAO.Card commit_raw.json CPlanet.FollowButton commit_raw.json CPlanet.MainPage.Common.Compose commit_raw.json CPlanet.MainPage.Compose commit_raw.json CPlanet.MainPage.Feed commit_raw.json CPlanet.MainPage.N.Post.Header commit_raw.json CPlanet.MainPage.N.Post.Left commit_raw.json CPlanet.MainPage.N.Post commit_raw.json CPlanet.MainPage.Post.Content commit_raw.json CPlanet.MainPage.Post.Header commit_raw.json CPlanet.MainPage.Post commit_raw.json CPlanet.MainPage.Social commit_raw.json CPlanet.N.Common.OverlayTrigger commit_raw.json CPlanet.NFTCard.index commit_raw.json CPlanet.Navbar.index commit_raw.json CPlanet.Post.Single commit_raw.json CPlanet.Profile.N.OverlayTrigger commit_raw.json CPlanet.Profile.Popover commit_raw.json CPlanet.ProfileEditor commit_raw.json CPlanet.ProfileImage commit_raw.json CPlanet.TopCreator.Card commit_raw.json Common.Compose commit_raw.json CustomSelectTag commit_raw.json DropFlow.SingleNFT commit_raw.json EasyPoll.CreatePoll commit_raw.json EasyPoll.MyPolls commit_raw.json EasyPoll.Polls commit_raw.json EasyPoll commit_raw.json GatewayDirectoryHero commit_raw.json GenaDrop-nft-selector commit_raw.json GenaDrop.Ai-Minter commit_raw.json GenaDrop.ChainsDropdown commit_raw.json GenaDrop.Create commit_raw.json GenaDrop.Explore commit_raw.json GenaDrop.Footer commit_raw.json GenaDrop.GenaDropSDK commit_raw.json GenaDrop.Home.PartnersCarousel commit_raw.json GenaDrop.Home commit_raw.json GenaDrop.ImageDropdown commit_raw.json GenaDrop.Minter commit_raw.json GenaDrop.MultiChainMinter commit_raw.json GenaDrop.MultiChainMinter2 commit_raw.json GenaDrop.MultiListing commit_raw.json GenaDrop.NFT.All commit_raw.json GenaDrop.NFTDetails commit_raw.json GenaDrop.NFTEmbedPreview commit_raw.json GenaDrop.NFTListingInput commit_raw.json GenaDrop.NFTSelector commit_raw.json GenaDrop.NearLogo commit_raw.json GenaDrop.Partner commit_raw.json GenaDrop.home commit_raw.json GenaDropHome commit_raw.json GenaDropMultiListing commit_raw.json GenaDropmultichainminter commit_raw.json Hashtag.Feed commit_raw.json ImageEditorTabs commit_raw.json JSONFormatter commit_raw.json LastProfiles commit_raw.json LinkTree commit_raw.json MainPage.Compose commit_raw.json MainPage.Content commit_raw.json MainPage.Feed.Beta commit_raw.json MainPage.N.Post.Left commit_raw.json MainPage.Post.Content commit_raw.json MainPage.Post.Header commit_raw.json MainPage.Post commit_raw.json Mintbase.NFTCard.index commit_raw.json Mintbase.NFTStores commit_raw.json Mintbase.Store.Deploy commit_raw.json Mintbase.StoreCard commit_raw.json Mintbase.StoreDeploy commit_raw.json Mintbase.StoreFront commit_raw.json MintbaseStoreDeploy commit_raw.json N.Group.NotMemberCompose commit_raw.json N.Group commit_raw.json N.SocialMarkdown commit_raw.json NFTListingInput commit_raw.json NftListingInput commit_raw.json PageFeedsEditor commit_raw.json People commit_raw.json Post.Single commit_raw.json Profile.ShortInlineBlock commit_raw.json ProfileLine commit_raw.json ProfilePage.Sidebar commit_raw.json PropsError commit_raw.json Untitled-0 commit_raw.json UploadImage commit_raw.json Vibes.Feed.Post.create commit_raw.json Vibes.Feed.View.main commit_raw.json Vibes.Feed.main commit_raw.json Welcome commit_raw.json cdao.home commit_raw.json gdocs commit_raw.json genadrop-nft-selector commit_raw.json genadrop-toast commit_raw.json genadropExplore commit_raw.json genadropMinter commit_raw.json genalert commit_raw.json mix-chart commit_raw.json ndc-info commit_raw.json nearprojectcard commit_raw.json nearprojects commit_raw.json repository commit_raw.json jiang_wei.near Hello commit_raw.json Untitled-0 commit_raw.json jiang_wei commit_raw.json jibolaojo.near AllBalance commit_raw.json AllTokens commit_raw.json Assets commit_raw.json Collectibles commit_raw.json NFBalanceWithHeader commit_raw.json NFHeader commit_raw.json NFLogo commit_raw.json NoNFLogo commit_raw.json WalletBalance commit_raw.json jiggyyjay.near Jason.html commit_raw.json jimmyez.near fork-ads-card commit_raw.json fork-stake-modal commit_raw.json vdo-billbos-main commit_raw.json jimything.near IAH-Gate commit_raw.json ProfilePage commit_raw.json Untitled-0 commit_raw.json jirapatwor.near Bastion commit_raw.json bastion-data commit_raw.json bastion-deposit commit_raw.json bastion commit_raw.json jlw.near DateWidget commit_raw.json EventPlanner commit_raw.json MyOwnedActivities commit_raw.json NDCDocs commit_raw.json ProfilePage commit_raw.json Widget-of-Interests commit_raw.json modify_editpoll commit_raw.json modify_main commit_raw.json modify_question commit_raw.json joannaorlova.near Demo commit_raw.json EventPlanner commit_raw.json Game.FlappyBOS commit_raw.json ProfilePage commit_raw.json ayooo commit_raw.json common commit_raw.json nyc.dao commit_raw.json statestuff commit_raw.json jobesau.near ImagenDeFondo commit_raw.json joehank.near profile commit_raw.json joelblenman21.near Greeter commit_raw.json ItemComponent commit_raw.json ItemGrid commit_raw.json LandingPageBody commit_raw.json LandingPageHeader commit_raw.json NavBar commit_raw.json PixelParty-Widget commit_raw.json ShoppingCartList commit_raw.json TheMarketPlan commit_raw.json account-login commit_raw.json iframe-ppets commit_raw.json iframe commit_raw.json potlock.projects.featured commit_raw.json johanga108.near AllProfilesWithTwitter commit_raw.json johanga108.near_c4f52773-fd48-4e40-bdb8-ff35451db56a commit_raw.json johnedvard.near StackOverflowFlair commit_raw.json johnpork.near Untitled-0 commit_raw.json joksnet.near DeTable commit_raw.json EthereumConnect commit_raw.json jorgen3.near ForkThis commit_raw.json jose34.near proyecto1 commit_raw.json joshuabray.near Draft-0 commit_raw.json Onboarding.Starter-fork commit_raw.json testComponent commit_raw.json josipkra.near Workshop-ChainAbstracion commit_raw.json jstubler.near ProfilePage commit_raw.json juaner.near ComponentSummary commit_raw.json Draft-0 commit_raw.json Draft-n-test commit_raw.json MetaPool.Alert commit_raw.json MetaPool.ConnectButton commit_raw.json MetaPool.Header commit_raw.json MetaPool.StakeInput commit_raw.json MetaPool.StakeNear commit_raw.json MetaPool.StakeNearAccountInfo commit_raw.json MetaPool.StakeNearButton commit_raw.json MetaPool.StakeResult commit_raw.json MetaPool.Switcher commit_raw.json NotificationFeed commit_raw.json Untitled-1 commit_raw.json WidgetMetadata commit_raw.json homePage-config commit_raw.json ref-adjust-button commit_raw.json ref-burrow-healthFactor commit_raw.json ref-common-api commit_raw.json ref-home commit_raw.json ref-icons commit_raw.json ref-input-box commit_raw.json ref-lending-header commit_raw.json ref-lending commit_raw.json ref-market-burrow-assets commit_raw.json ref-market-burrow-burrow commit_raw.json ref-market-burrow-repay commit_raw.json ref-market-supply-adjust commit_raw.json ref-market-supply-assets commit_raw.json ref-market-supply-supply-near commit_raw.json ref-market-supply-supply commit_raw.json ref-market-supply-withdraw commit_raw.json ref-operation-button commit_raw.json ref-withdraw-button commit_raw.json ref_Burrow commit_raw.json ref_account-signin commit_raw.json ref_burrow-borrow commit_raw.json ref_burrow-data-test commit_raw.json ref_burrow-data commit_raw.json ref_burrow-deposit commit_raw.json ref_burrow-list commit_raw.json ref_burrow-portfolio commit_raw.json ref_burrow-repay commit_raw.json ref_burrow-rewards commit_raw.json ref_burrow commit_raw.json ss-your-burrow commit_raw.json ss-your-supply commit_raw.json test-TosCheck commit_raw.json test-metadata commit_raw.json test commit_raw.json test1 commit_raw.json test2 commit_raw.json junho9341.near Untitled-0 commit_raw.json collegium.bos.wk2.LiquityOpenTroveSepoliaExample commit_raw.json o2o13o7w124ztnv commit_raw.json jutsuai.near Demos.Keypom.Drops commit_raw.json Demos.Keypom.ViewNumberOfDrops commit_raw.json MySwap commit_raw.json coven-staff-league-1709156739107-0 commit_raw.json testapp commit_raw.json kadikoy.near ComponentDetailsPage commit_raw.json kadirbiyikli.near hi commit_raw.json kaion.near Onboarding.Starter-fork commit_raw.json kalicanin.near Untitled-0 commit_raw.json kan_k.near Alert commit_raw.json Draft-0 commit_raw.json ImageUploader commit_raw.json LoginWeb3 commit_raw.json LoginWeb3TestNet commit_raw.json ProfileBanner commit_raw.json VideoCard commit_raw.json VideoList commit_raw.json VideoUpload commit_raw.json VideoUploadTestNet commit_raw.json try-api commit_raw.json kanoisbos.near Wormhole3.Twitter commit_raw.json kanupriya.near FDAO-Attendance commit_raw.json kasodon.near AddMeme commit_raw.json Homepage commit_raw.json Meme commit_raw.json MemeProfileImage commit_raw.json Memes commit_raw.json NftCollection commit_raw.json Profile commit_raw.json ProfileImage commit_raw.json ProfileImageDarkMode commit_raw.json ProfilePageDarkMode commit_raw.json Sky_Cross commit_raw.json Welcome commit_raw.json skytest commit_raw.json kassangto.near MiPrimeraPractica commit_raw.json kastet99.near 1B_users commit_raw.json kayleigh.near Linktree commit_raw.json jutsu commit_raw.json kazanderdad.near everything commit_raw.json kazandermum.near TestDocs commit_raw.json kenjon.near HelloKen commit_raw.json Ken-multi-chain commit_raw.json Nearpad-test commit_raw.json Onboarding.Starter-fork commit_raw.json Onboarding.Starter commit_raw.json StockPrice commit_raw.json TBD commit_raw.json bestimage commit_raw.json erc-send-ref-swap commit_raw.json ken-near-eth-sender commit_raw.json kenobi-test commit_raw.json kenrou-it.near MarkdownEditorIframe commit_raw.json NDC.Forum.AllArticlesList commit_raw.json NDC.General.ArticleView commit_raw.json NDC.GeneralCard commit_raw.json NDC.NavBar commit_raw.json NDC.Nomination.Candidate.Comment commit_raw.json NDC.SayALot.AddComment commit_raw.json NDC.UpVoteButton commit_raw.json SayALot.AllArticlesList commit_raw.json SayALot.ArticleView commit_raw.json SayALot.CommentView commit_raw.json SayALot.Create commit_raw.json SayALot.config commit_raw.json SayALot.lib.SBT commit_raw.json SayALot.lib.article commit_raw.json SayALot.lib.comment commit_raw.json SayALot.lib.emojis commit_raw.json SayALot commit_raw.json SayALot_Comment.Feed commit_raw.json SayALot_Reactions commit_raw.json TagsEditor commit_raw.json Test commit_raw.json Test2 commit_raw.json TestLib commit_raw.json fasterTextInput commit_raw.json lib.article commit_raw.json sayALot.generalHandler commit_raw.json kepka.near Draft-0 commit_raw.json ketchupmeow.near MagsGPTMint commit_raw.json Untitled-0 commit_raw.json kevin0.near BOSwallet commit_raw.json Index commit_raw.json LaserChess3D commit_raw.json NEAT commit_raw.json Onboarding.Starter-fork commit_raw.json Status-fork commit_raw.json Status commit_raw.json Swap.CurrencySelect commit_raw.json TicTacToe commit_raw.json VoteCard commit_raw.json app commit_raw.json nft-marketplace commit_raw.json social-avatar-editor commit_raw.json keyokey.near HelloAccountIdHeader commit_raw.json ProfileEditor commit_raw.json ProfilePage commit_raw.json keypom-is-fuckin-awesome.near Untitled-0 commit_raw.json keypom-marketplace.near Buttons.ActionButton commit_raw.json Buttons.NavigationButton commit_raw.json Cart.BreakdownSummary commit_raw.json Cart.CartModalItem commit_raw.json Cart.Checkout commit_raw.json Cart.CheckoutItem commit_raw.json Components.Header commit_raw.json Index commit_raw.json InfoSegment commit_raw.json Inputs.AccountId commit_raw.json Inputs.Checkbox commit_raw.json Inputs.Distribution commit_raw.json Inputs.Integration commit_raw.json Inputs.MultiSelect commit_raw.json Inputs.Number commit_raw.json Inputs.Phase commit_raw.json Inputs.ProductType commit_raw.json Inputs.Select commit_raw.json Inputs.Text commit_raw.json Inputs.TextArea commit_raw.json Inputs.Verticals commit_raw.json Nav commit_raw.json Project.About commit_raw.json Project.AboutItem commit_raw.json Project.Actions commit_raw.json Project.ActionsBuyNewSale commit_raw.json Project.BannerHeader commit_raw.json Project.Body commit_raw.json Project.Card commit_raw.json Project.CardDrop commit_raw.json Project.CardEvent commit_raw.json Project.Carousel commit_raw.json Project.Create commit_raw.json Project.CreateEvent commit_raw.json Project.CreateEventForm commit_raw.json Project.CreateForm commit_raw.json Project.Detail commit_raw.json Project.DonationsInfo commit_raw.json Project.FollowButton commit_raw.json Project.FollowStats commit_raw.json Project.FollowsYouBadge commit_raw.json Project.Linktree commit_raw.json Project.ListDrops commit_raw.json Project.ListEvent commit_raw.json Project.ListEvents commit_raw.json Project.ListEventsPage commit_raw.json Project.ListPage commit_raw.json Project.ListSection commit_raw.json Project.ListTicketsPage commit_raw.json Project.ListTicketsPage2 commit_raw.json Project.NavOptions commit_raw.json Project.Share commit_raw.json Project.Tags commit_raw.json Project.Team commit_raw.json keypom.footer.main commit_raw.json keypom.home.builtWith commit_raw.json keypom.home.main1 commit_raw.json keypom.home.stats.link commit_raw.json keypom.home.stats commit_raw.json keypom.navbar.main commit_raw.json keypom.project.funding.main commit_raw.json keypom.project.profile commit_raw.json keypom.project.sidebar.donateButton commit_raw.json keypom.project.sidebar.main commit_raw.json keypom.projects.all commit_raw.json keypom.projects.featured commit_raw.json keypom.projects.listPage commit_raw.json keypom.projects.projectCard commit_raw.json ' + eventById)\nconsole.log(eventById)\n\n\nif (!state.registeredEvents) {\n let drops = Near.view(keypomRegistryId, \"get_drops_for_funder\", { account_id: \"minqi.testnet\" })\n\n console.log(\"BREAK keypomtest7.near Untitled-0 commit_raw.json kimeria.near Linkito commit_raw.json kimes.near WeAreDevsStatusBoard commit_raw.json kingdeemo.near HelloWorld commit_raw.json NFT_gallery commit_raw.json ProfilePage-fork commit_raw.json Three.js_card commit_raw.json aptos_gallery commit_raw.json suiFrens_discovery commit_raw.json kingsley-sama.near Untitled-1 commit_raw.json ape_descripion commit_raw.json countdowntimer commit_raw.json landingpage commit_raw.json landingpagenft commit_raw.json kir733.near steve commit_raw.json kirrruuusha.near New-Draft-0 commit_raw.json kiskesis.near Keypom-Drop-Viewer-fork commit_raw.json my-socials commit_raw.json nft-marketplace commit_raw.json stake-weighted-checker commit_raw.json kizzx3.near IFrame commit_raw.json klaus.near AllLabels commit_raw.json Buy ticket and win commit_raw.json Buy-ticket-and-win commit_raw.json HelloAccountId commit_raw.json Pa commit_raw.json PayTo commit_raw.json klngrs.near AsyncBoilerplate commit_raw.json FloatUi commit_raw.json FloatUiWidget commit_raw.json FloatWidget commit_raw.json HelloWorld commit_raw.json LatestBlogPosts commit_raw.json PalaceCubeMap commit_raw.json ScratchPad commit_raw.json Tailwind commit_raw.json kn00t.near Hi commit_raw.json Soundbites commit_raw.json Soundbites commit_raw.json knaak.near helloworld commit_raw.json test commit_raw.json knwtechs.near Common.error commit_raw.json Common.footer commit_raw.json Common.menu commit_raw.json Customer.token commit_raw.json Customer.view commit_raw.json Integration.renew commit_raw.json Integration.subscribe commit_raw.json Main.create commit_raw.json Main.manage commit_raw.json Main.view commit_raw.json Merchant.create commit_raw.json Merchant.info commit_raw.json Merchant.view commit_raw.json koles.near ContentFeed commit_raw.json koniesjay.near WalletBridge commit_raw.json kresimirc.near Untitled-2 commit_raw.json ksavul.near Onboarding.Starter-fork commit_raw.json kudos.ndctools.near NDC.Kudos.AddComment commit_raw.json NDC.Kudos.AddKudo commit_raw.json NDC.Kudos.Card commit_raw.json NDC.Kudos.CommentCard commit_raw.json NDC.Kudos.Header commit_raw.json NDC.Kudos.Kudo.MintSbt commit_raw.json NDC.Kudos.Kudo.Page commit_raw.json NDC.Kudos.Main commit_raw.json NDC.Kudos.Navigation commit_raw.json NDC.Modal commit_raw.json NSC.Kudos.CongratsMintModal commit_raw.json kujtimprenku-neth.near fancy-component commit_raw.json kujtimprenku.near Draft-0 commit_raw.json HelloWorld1 commit_raw.json HelloWorld101 commit_raw.json Untitled-0 commit_raw.json special-component commit_raw.json specialcomponent commit_raw.json kumarkrsronit.near FamlinkUP commit_raw.json Famlinkup_aboutus commit_raw.json Famlinkup_homepage commit_raw.json LiveCryptoPrice commit_raw.json QuoteIt commit_raw.json StakeNearHub commit_raw.json Untitled-0-fork-fork commit_raw.json Untitled-2 commit_raw.json guide commit_raw.json kunggalot.near AirBOS commit_raw.json Draft-0 commit_raw.json Khaw-mun-kai-aroi-mak commit_raw.json kurodenjiro.near MagicBuild-123 commit_raw.json MagicBuild-Check commit_raw.json MagicBuild-chatme.near commit_raw.json MagicBuild-nft.genadrop.near commit_raw.json MagicBuild-widget-form-1698316711676 commit_raw.json MagicBuild-widget-form-1698318141318 commit_raw.json MagicBuild-widget-form-1698318385696 commit_raw.json MagicBuild-widget-form-1698318745771 commit_raw.json MagicBuild-widget-form-1698318821882 commit_raw.json MagicBuild-widget-form-1698319050850 commit_raw.json MagicBuild-widget-form-1698319730241 commit_raw.json MagicBuild-widget-form-1698319776738 commit_raw.json MagicBuild-widget-form-1698327361434 commit_raw.json MagicBuild-widget-form-1698327491170 commit_raw.json MagicBuild-widget-form-1698327944100 commit_raw.json MagicBuild-widget-form-1698328292339 commit_raw.json MagicBuild-widget-form-1698329390734 commit_raw.json MagicBuild-widget-form-1698329738298 commit_raw.json MagicBuild-widget-form-1698330876315 commit_raw.json MagicBuild-widget-form-1698330983773 commit_raw.json MagicBuild-widget-form-1698331791922 commit_raw.json MagicBuild-widget-form-1698333628746 commit_raw.json MagicBuild-widget-form-chatme.near commit_raw.json MagicBuild-widget-form-creator commit_raw.json MagicBuilder-widget-form-1697205479799 commit_raw.json Potlock.Home.SearchBar commit_raw.json abi2form-builder commit_raw.json abi2form-example commit_raw.json abi2form-export-widget-button commit_raw.json abi2form-home commit_raw.json abi2form-landingpage commit_raw.json abi2form-widget-endpoint-export commit_raw.json abi2form-widget-endpoint commit_raw.json abi2form-widget-export commit_raw.json abi2form-widget-form commit_raw.json abi2form-widget-preview commit_raw.json abi2form-widget commit_raw.json abi2form commit_raw.json app commit_raw.json builder commit_raw.json checklive commit_raw.json kurodenjiro.near_0146c402-e615-40a2-8dbd-cf1825d1f0cf commit_raw.json kurodenjiro.near_123cc2f5-4be3-4b7a-b376-1c5486e5f80c commit_raw.json kurodenjiro.near_73f146bb-829f-4a34-a91d-334084cba7a1 commit_raw.json kurodenjiro.near_74180cfe-fdd0-4cee-ad00-6245a7e00040 commit_raw.json kurodenjiro.near_7972b842-154b-4795-bbe4-82b8aae8e06b commit_raw.json kurodenjiro.near_980a740b-0a98-47a8-bec4-30b54670a558 commit_raw.json kurodenjiro.near_a9d4d32a-faaf-4838-91a5-5c0500edbe77 commit_raw.json kurodenjiro.near_b00a550a-5b20-46d6-bd0f-7b892ebc39e5 commit_raw.json kurodenjiro.near_e24d2d7e-1846-4f1f-91a3-457f3c720cbf commit_raw.json lonk-SlippageTolerance commit_raw.json lonk-buy commit_raw.json lonk-hero commit_raw.json lonk-index commit_raw.json lonk-ref-swap-getEstimate commit_raw.json mouse-hover commit_raw.json preview-button commit_raw.json preview commit_raw.json ref-swap commit_raw.json ref-token-input commit_raw.json save-client-button commit_raw.json telgram-auth commit_raw.json trending commit_raw.json trending1days commit_raw.json trending3days commit_raw.json trending7days commit_raw.json trendinghub commit_raw.json trendingpost commit_raw.json uibuilder commit_raw.json kwhyc.near votesforjordan commit_raw.json kzncva.near Livepeer.Player commit_raw.json lachlan.near Greeter commit_raw.json have-a-great-day commit_raw.json ladygaga.near Base64_Tool commit_raw.json CaseConverter commit_raw.json MongoDB_ObjectId_Generator commit_raw.json lapolvorin.near Prueba1 commit_raw.json leap-wallet.near LeapTelegrambot commit_raw.json TelegramNotificationsbot commit_raw.json leinss.near CalimochoMain commit_raw.json CalimochoOverview commit_raw.json Greeter commit_raw.json Homepage commit_raw.json LensProfileCommentsView commit_raw.json LensProfileController commit_raw.json LensProfileCreate commit_raw.json LensProfileFollowersView commit_raw.json LensProfilePostsView commit_raw.json LensProfileSearch commit_raw.json LensProfileSearchView commit_raw.json LensSDK commit_raw.json LidoChanged commit_raw.json NewQuorum commit_raw.json lekiet2509.near OneK commit_raw.json lendle.near Lendle.Card.AssetsToBorrow commit_raw.json Lendle.Card.AssetsToSupply commit_raw.json Lendle.Card.CardContainer commit_raw.json Lendle.Card.CardDataWrapper commit_raw.json Lendle.Card.CardEmpty commit_raw.json Lendle.Card.CardsBody commit_raw.json Lendle.Card.CardsView commit_raw.json Lendle.Card.Divider commit_raw.json Lendle.Card.Markets commit_raw.json Lendle.Card.TokenWrapper commit_raw.json Lendle.Card.YourBorrows commit_raw.json Lendle.Card.YourSupplies commit_raw.json Lendle.Data commit_raw.json Lendle.GasEstimation commit_raw.json Lendle.Header commit_raw.json Lendle.HeroData commit_raw.json Lendle.Modal.AlertModal commit_raw.json Lendle.Modal.BaseModal commit_raw.json Lendle.Modal.BorrowModal commit_raw.json Lendle.Modal.FlexBetween commit_raw.json Lendle.Modal.RepayModal commit_raw.json Lendle.Modal.RoundedCard commit_raw.json Lendle.Modal.SupplyModal commit_raw.json Lendle.Modal.WithdrawModal commit_raw.json Lendle.NetworkSwitcher commit_raw.json Lendle.PrimaryButton commit_raw.json Lendle.TabSwitcher commit_raw.json Lendle commit_raw.json Utils.Date commit_raw.json Utils.Import commit_raw.json Utils.Number commit_raw.json leolienne.near Onboarding.Starter-fork commit_raw.json leonj.near Untitled-0 commit_raw.json let45fc.near GameSetup commit_raw.json Gamedev commit_raw.json LaserChess3D commit_raw.json LaserChess3DOnline commit_raw.json MainMenu commit_raw.json Rules commit_raw.json SustainChain commit_raw.json Test commit_raw.json UsersMatcher commit_raw.json lewidenmann.near FollowerHeightList commit_raw.json HelloWorld commit_raw.json Profile commit_raw.json ProfileLarge commit_raw.json ProfilePage commit_raw.json Proof-of-Height commit_raw.json ReviewFollowerHeights commit_raw.json SetHeightForm commit_raw.json UserHeightDisplay commit_raw.json Widget-3 commit_raw.json cool commit_raw.json deer commit_raw.json libertydao.near Typography.DMSans commit_raw.json boroughs.Mapbox commit_raw.json boroughs.Modal commit_raw.json boroughs.form commit_raw.json boroughs.index commit_raw.json community commit_raw.json home commit_raw.json initiatives.card commit_raw.json initiatives.compose commit_raw.json initiatives.create commit_raw.json initiatives.index commit_raw.json initiatives.list commit_raw.json initiatives.page commit_raw.json initiatives.post commit_raw.json mapathon.home commit_raw.json projects.index commit_raw.json projects.new commit_raw.json projects.page commit_raw.json supporting.index commit_raw.json supporting.projects commit_raw.json supporting.proposal commit_raw.json supporting.resources commit_raw.json welcome.index commit_raw.json workshopping-support.index commit_raw.json lidoo.near Index commit_raw.json lightkid.near lightkid commit_raw.json likelyisland.near Omagotchi commit_raw.json linearhey.near LiNEAR commit_raw.json linearprotocol.near DAO.Main commit_raw.json DAO.Proposal commit_raw.json DAO.Proposals commit_raw.json LiNEAR.Account commit_raw.json LiNEAR.Data.Apy commit_raw.json LiNEAR.Data.Stake commit_raw.json LiNEAR.Data.Unstake commit_raw.json LiNEAR.Element.Button commit_raw.json LiNEAR.Element.Input commit_raw.json LiNEAR.Element.TitleAndDescription commit_raw.json LiNEAR.Element.Tooltip commit_raw.json LiNEAR.Layout.Navigation commit_raw.json LiNEAR.Layout.Tab commit_raw.json LiNEAR.Message.YouWillReceive commit_raw.json LiNEAR.Modal.ConfirmDelayedUnstake commit_raw.json LiNEAR.Modal.ConfirmInstantUnstake commit_raw.json LiNEAR.Modal.WithdrawNow commit_raw.json LiNEAR commit_raw.json Ref.ref-stable-swap-algorithm commit_raw.json Ref.ref-swap-getEstimate commit_raw.json linguists.near DAO.Proposal commit_raw.json lisofffa.near Button commit_raw.json ComponentsSearch commit_raw.json Mutation-Overlay commit_raw.json North-Panel commit_raw.json SearchCard commit_raw.json Untitled-0 commit_raw.json littlelace.near ComponentItem commit_raw.json ComponentScroll commit_raw.json ComponentSearch commit_raw.json ComponentSearchInput commit_raw.json DocsDtecteet commit_raw.json Dtecteet commit_raw.json NavbarDtect commit_raw.json Result commit_raw.json detecteet.navbar commit_raw.json dtecteet.index commit_raw.json lmaticnear.near Untitled-0 commit_raw.json lnovic.near Untitled-2 commit_raw.json Zagreb-Chain-Abstraction commit_raw.json logan_the_man.near WeAreDevsStatusBoard commit_raw.json logunov.near 100M_countdown commit_raw.json AllWidgets2 commit_raw.json FavoriteWidgets commit_raw.json FavouriteWidgets commit_raw.json FavouriteWidgets_debug commit_raw.json Notepad2 commit_raw.json SaveFile commit_raw.json Widget-0 commit_raw.json inodes commit_raw.json ndc-og-holders commit_raw.json scribbles-base commit_raw.json scribbles-fork-icons commit_raw.json scribbles-fork commit_raw.json lolson.near Onboarding.Starter-fork commit_raw.json Voters commit_raw.json longx30.near CreateCollection commit_raw.json CreateNearAccount commit_raw.json Demo01 commit_raw.json MintNearNft commit_raw.json TestIframe commit_raw.json lonkonbos.near app commit_raw.json page.buy-token commit_raw.json page.ethereum commit_raw.json page.evm commit_raw.json page.hero commit_raw.json page.ref-swap commit_raw.json page.ref-token-input commit_raw.json page.solana commit_raw.json page.stake commit_raw.json page.sui commit_raw.json page.veax-select-token commit_raw.json page.veax-swap commit_raw.json page.veax-token-input commit_raw.json loosequiche.near App commit_raw.json ExpenseTracker commit_raw.json FAQ commit_raw.json Home commit_raw.json NavBar commit_raw.json Nearindia commit_raw.json QuestionAnswer commit_raw.json lord1.near BuildDAO-component-growth commit_raw.json Community commit_raw.json Community_Form commit_raw.json Dropdown commit_raw.json Explorer-Balance-NFT commit_raw.json Explorer-Balance-USD commit_raw.json Explorer-Balance commit_raw.json Explorer-Social commit_raw.json Find_Transfers_by_Flipside commit_raw.json Flipside-Home-page commit_raw.json Form commit_raw.json Label_Form commit_raw.json Leaderboard-Community commit_raw.json Leaderboard-member commit_raw.json Leaderboard commit_raw.json NDC commit_raw.json NearSocial.Explorer commit_raw.json Pie-chart commit_raw.json Sharddog-Series commit_raw.json Sharddog-scan commit_raw.json SocialGraph commit_raw.json Text commit_raw.json activity-tracker-for-wallet commit_raw.json activity-tracker-for-wallets commit_raw.json api-flipside commit_raw.json bar-race commit_raw.json candidate-info-election commit_raw.json candidate-vote-info-election commit_raw.json column-stack-chart commit_raw.json component-area commit_raw.json component-chart1 commit_raw.json component-growth commit_raw.json component-tab commit_raw.json component-total commit_raw.json component commit_raw.json contract-area commit_raw.json contract-growth commit_raw.json contract-total commit_raw.json contract commit_raw.json dark-light commit_raw.json election-area commit_raw.json election-candidates commit_raw.json election-explorer commit_raw.json election-rate-chart commit_raw.json election-rate commit_raw.json election-scan commit_raw.json election commit_raw.json explorer-ndc commit_raw.json feedback_button commit_raw.json first-tab-explore-election commit_raw.json first-tab-explore commit_raw.json footer-version2 commit_raw.json footer commit_raw.json header-dynamic commit_raw.json home commit_raw.json im-human commit_raw.json mix-chart commit_raw.json mix-ndc commit_raw.json multiple-mix-chart commit_raw.json ndc-area commit_raw.json ndc-info commit_raw.json ndc-scan commit_raw.json nearwidgetProfile commit_raw.json pie-percentage commit_raw.json progress-bar commit_raw.json recent-widgets commit_raw.json sbt-area commit_raw.json sbt-info commit_raw.json sbt-search commit_raw.json search-sbt commit_raw.json second-tab-explore-election commit_raw.json second-tab-explore commit_raw.json select commit_raw.json sidebar commit_raw.json slider commit_raw.json tab-component-area commit_raw.json tab-contract-area commit_raw.json tab-election-area commit_raw.json tab-election-infos commit_raw.json tab-ndc-area commit_raw.json tab-ndc commit_raw.json tab-sbt commit_raw.json tabel-ndc commit_raw.json table-pagination commit_raw.json tabs commit_raw.json test commit_raw.json treemap-chart commit_raw.json trend-election commit_raw.json version-1 commit_raw.json wrapped-avax commit_raw.json wrapped-balance-collection commit_raw.json wrapped-balance-nft commit_raw.json wrapped-balance-usd commit_raw.json wrapped-balance commit_raw.json wrapped-base commit_raw.json wrapped-jupiter commit_raw.json wrapped-near commit_raw.json wrapped-nft-avax commit_raw.json wrapped-nft commit_raw.json wrapped-platform-avax commit_raw.json wrapped-platform-base commit_raw.json wrapped-platform commit_raw.json wrapped-sharddog commit_raw.json wrapped-shrddog_tekuno commit_raw.json wrapped-social commit_raw.json wrapped-staking commit_raw.json wrapped-swap-avax commit_raw.json wrapped-tekuno commit_raw.json wrapped-transaction-avax commit_raw.json wrapped-transaction-base commit_raw.json wrapped-transaction-jupiter commit_raw.json wrapped-transaction commit_raw.json wrapped-transfer commit_raw.json wrapped commit_raw.json louisdevzz.near ChatBubble commit_raw.json Lonk.App commit_raw.json Lonk.about commit_raw.json Lonk.buy commit_raw.json Lonk.etherum commit_raw.json Lonk.evm commit_raw.json Lonk.hero commit_raw.json Lonk.solana commit_raw.json Lonk.stake commit_raw.json Lonk.sui commit_raw.json Lonk.veax-swap commit_raw.json headerSwap commit_raw.json openai.App commit_raw.json openai.chat commit_raw.json openai.footer commit_raw.json openai.header commit_raw.json openai.main commit_raw.json openai.sidetab commit_raw.json ref-swap-button commit_raw.json ref-swap-getEstimate commit_raw.json ref-swap commit_raw.json ref-token-input-clone commit_raw.json ref-token-input commit_raw.json veax-token-input commit_raw.json lovrejerkovic.near Untitled-0 commit_raw.json lowpie.near Prueba1 commit_raw.json lq-boss.near LiEAR.Test commit_raw.json LiEARTest commit_raw.json LiNEAR.TabTest commit_raw.json LiNEARTest commit_raw.json NearX.StakeTest commit_raw.json XREF.StakeTest commit_raw.json XREFTest commit_raw.json ref-swap-buttonTest commit_raw.json ref-swapTest commit_raw.json ref-token-inputTest commit_raw.json stake-bannerIconTest commit_raw.json test commit_raw.json xBoxTest commit_raw.json lso0.near EncodeNearHorizonHackathon commit_raw.json luacan.near FlyingRhinoWeb3 commit_raw.json lucasdemoreno.near LidoLeo commit_raw.json luchito1.near Onboarding.Starter-fork commit_raw.json ludium.near GreeterToday commit_raw.json luixo.near ExplorerAccountComponent commit_raw.json ExplorerEmbeddedComponent commit_raw.json ExplorerIframeComponent commit_raw.json ExplorerTransactionComponent commit_raw.json ProfilePage commit_raw.json lukaj.near Untitled-0 commit_raw.json lundrengyr.near TestComponent commit_raw.json lynkable.near DAO.Page commit_raw.json Everything.Create.Person commit_raw.json Everything.Summary.Person commit_raw.json Everything.View.Person commit_raw.json Everything commit_raw.json Lynkable commit_raw.json macarli.near New-Draft-0 commit_raw.json machina.near Lido commit_raw.json magicbuild.near Potlock.Donation.For.Recipent.Near commit_raw.json add-block-button commit_raw.json app commit_raw.json block commit_raw.json builder commit_raw.json export-button commit_raw.json potlock.donate.recipent commit_raw.json potlock.donation.recipent commit_raw.json preview-button commit_raw.json preview commit_raw.json save-client-button commit_raw.json tailwind commit_raw.json ui-code commit_raw.json ui-column-custome commit_raw.json ui-column commit_raw.json ui-columns commit_raw.json ui-cover commit_raw.json ui-groups commit_raw.json ui-image commit_raw.json ui-main commit_raw.json ui-paragraph commit_raw.json ui-row commit_raw.json ui-spacer commit_raw.json ui-stack commit_raw.json ui-standard-example commit_raw.json ui-tailwind commit_raw.json ui commit_raw.json welcome commit_raw.json widget commit_raw.json maguila.near HelloNear commit_raw.json HelloWorld commit_raw.json maierr.near MentorHub_MyCopy commit_raw.json makeno.near Tnesociety.com commit_raw.json maktab.near Untitled-5 commit_raw.json malbec.near WebFusion.Navbar.Top-fork-fork commit_raw.json home commit_raw.json most-active-contracts-fork-fork commit_raw.json maloy.near Default commit_raw.json manolochampp.near TableImage commit_raw.json manzanal.near AbstractWrapper commit_raw.json Badge commit_raw.json BadgesBackOffice commit_raw.json Common.Badge commit_raw.json Common.Button commit_raw.json Common.ButtonRound commit_raw.json Common.CommentButton commit_raw.json Common.Inputs.Text commit_raw.json Common.Inputs.TextArea commit_raw.json Common.Modal.RedirectModal commit_raw.json CommonComponentsLibrary.Navbar commit_raw.json CommonComponentsLibrary commit_raw.json Contribution.Feedback commit_raw.json CosmoPOS.Dashboard commit_raw.json CosmoPOS.HeaderWithLogo commit_raw.json CredentialMint commit_raw.json DateProgress commit_raw.json EntityOneLineProfile commit_raw.json EthWrapper commit_raw.json GainStakingArbitrum.Info commit_raw.json GainStakingArbitrum.StakeForm commit_raw.json GainsStakingArbitrum commit_raw.json Governance.Balance commit_raw.json Governance.Comment.Compose commit_raw.json Governance.Comment.Feed commit_raw.json Governance.Comment.Index commit_raw.json Governance.Comment.ManualIndexFeed commit_raw.json Governance.Dashboard commit_raw.json Governance.Index commit_raw.json Governance.Metric.Card commit_raw.json Governance.Proposal.Create.Index commit_raw.json Governance.Proposal.Create.Text commit_raw.json Governance.Proposal.DiscussionCard commit_raw.json Governance.Proposal.Index commit_raw.json Governance.Proposal.Vote commit_raw.json Governance.Proposal.VoteCard commit_raw.json Governance.Proposal.VotesCard commit_raw.json Governance.Proposal.VotingPeriodCard commit_raw.json Governance.Proposal.VotingResultsCard commit_raw.json Governance.Proposals commit_raw.json Governance.ProposalsTable commit_raw.json Governance.TabSelector commit_raw.json HeaderWithLogo commit_raw.json Inputs.Viewable.Logo commit_raw.json Inputs.Viewable commit_raw.json IpfsFileUpload commit_raw.json IpfsFilesUpload commit_raw.json LiquidStake.Index commit_raw.json LiquidStake.Notification commit_raw.json LiquidStake.Selector commit_raw.json LiquidStake.StakeInput commit_raw.json LiquidStake.StakeResult commit_raw.json LiquidStake.Toggle commit_raw.json MetaPoolStake.Container commit_raw.json MetaStakingDashComponent commit_raw.json NearWrapper commit_raw.json NewContributionRequestForm commit_raw.json NewContributionRequestPage commit_raw.json PageTitle commit_raw.json PaymentSourceInput commit_raw.json PaymentTypeInput commit_raw.json PeopleExplorer commit_raw.json Proposal.Summary commit_raw.json SearchComponent commit_raw.json StakingTheme commit_raw.json Theme commit_raw.json ThemeMultipleFontFamily commit_raw.json TokenWrapper.v0.EthWrapper commit_raw.json TokenWrapper.v2.AbstractWrapper commit_raw.json TokenWrapper.v2.EthWrapper commit_raw.json TokenWrapper.v2.Index commit_raw.json TokenWrapper.v2.MaticWrapper commit_raw.json TokenWrapper.v2.NearWrapper commit_raw.json UserVotingDashComponent commit_raw.json ValidatorStakingVoteAction commit_raw.json ValidatorsCount commit_raw.json ValidatorsStakingVote commit_raw.json VoteForButton commit_raw.json VoteValidatorButton commit_raw.json bd-mate commit_raw.json marcelo.near 2048-test-log commit_raw.json Counter commit_raw.json Follow commit_raw.json LocalizedGreetings commit_raw.json N commit_raw.json Status commit_raw.json TestEth commit_raw.json TicTacToe commit_raw.json test commit_raw.json marco.near HelloNear commit_raw.json marindenic.near Untitled-0 commit_raw.json mariogavric.near Untitled-0 commit_raw.json marioklaic.near Untitled-0 commit_raw.json marior.near 10KIcon commit_raw.json ChessGame commit_raw.json LastProfilesImages commit_raw.json NDCElections commit_raw.json NDCElectionsCard commit_raw.json ShitzuMigrate commit_raw.json StorageFreeing commit_raw.json markeljan.near CodeDiff commit_raw.json ForkThis commit_raw.json GMX commit_raw.json GigsHistoryWidget commit_raw.json HistoryWidget commit_raw.json MarkdownDiff commit_raw.json PostWithHistory commit_raw.json PromotePost commit_raw.json SwapGuard commit_raw.json pyth-price-pusher commit_raw.json testdiffmark commit_raw.json testngig commit_raw.json testpostmark commit_raw.json testwidgetmark commit_raw.json marketing_in.near Draft1 commit_raw.json marketplacebos.near BOSGame.Quiz.Home commit_raw.json BOSGame.TicTacToe.Box commit_raw.json Button.Button0001 commit_raw.json Button.Button0002 commit_raw.json Button.Button0003 commit_raw.json Button.Button0004 commit_raw.json Button.Button0005 commit_raw.json Button.Button0006 commit_raw.json Button.Button0007 commit_raw.json Button.Button0008 commit_raw.json Button.Button0009 commit_raw.json Button.Button0010 commit_raw.json Button.Button0011 commit_raw.json Button.Button0012 commit_raw.json Button.Button0013 commit_raw.json Button.Button0014 commit_raw.json Button.Button0015 commit_raw.json Button.Button0016 commit_raw.json Button.Button0017 commit_raw.json Button.Button0018 commit_raw.json Button.Button0019 commit_raw.json Button.Button0020 commit_raw.json Button.Button0021 commit_raw.json Button.Button0022 commit_raw.json Button.Button0023 commit_raw.json Button.Button0024 commit_raw.json Button.Button0025 commit_raw.json Button.Button0026 commit_raw.json Button.Button0027 commit_raw.json Button.Button0028 commit_raw.json Button.ButtonEdit.Button0001 commit_raw.json Button.ButtonP.Button0001 commit_raw.json Button.ButtonP.Button0002 commit_raw.json Button.ButtonP.Button0003 commit_raw.json Button.ButtonP.Button0004 commit_raw.json Button.ButtonP.Button0005 commit_raw.json Button.ButtonP.Button0006 commit_raw.json Button.ButtonP.Button0007 commit_raw.json Button.ButtonP.Button0008 commit_raw.json Button.ButtonP.Button0009 commit_raw.json Button.ButtonP.Button0010 commit_raw.json Button.ButtonP.Button0011 commit_raw.json Button.ButtonP.Button0012 commit_raw.json Button.ButtonP.Button0013 commit_raw.json Button.ButtonP.Button0014 commit_raw.json Button.ButtonP.Button0015 commit_raw.json Button.ButtonP.Button0016 commit_raw.json Button.ButtonP.Button0017 commit_raw.json Button.ButtonP.Button0018 commit_raw.json Button.ButtonP.Button0019 commit_raw.json Button.ButtonP.Button0020 commit_raw.json Button.ButtonP.Button0021 commit_raw.json Button.ButtonP.Button0022 commit_raw.json Button.ButtonP.Button0023 commit_raw.json Button.ButtonP.Button0024 commit_raw.json Button.ButtonP.Button0025 commit_raw.json Button.ButtonP.Button0026 commit_raw.json Button.ButtonP.Button0027 commit_raw.json Button.ButtonP.Button0028 commit_raw.json CB.CBP.CB0001 commit_raw.json CB.CBP.CB0002 commit_raw.json CB.CBP.CB0003 commit_raw.json CB.CBP.CB0004 commit_raw.json CB.CBP.CB0005 commit_raw.json CB.CBP.CB0006 commit_raw.json CB.CheckBox0001 commit_raw.json CB.CheckBox0002 commit_raw.json CB.CheckBox0003 commit_raw.json CB.CheckBox0004 commit_raw.json CB.CheckBox0005 commit_raw.json CB.CheckBox0006 commit_raw.json Card.Card0001 commit_raw.json Card.Card0002 commit_raw.json Card.Card0003 commit_raw.json Card.Card0004 commit_raw.json Card.Card0005 commit_raw.json Card.Card0006 commit_raw.json Card.Card0007 commit_raw.json Card.CardP.Card0001 commit_raw.json Card.CardP.Card0002 commit_raw.json Card.CardP.Card0003 commit_raw.json Card.CardP.Card0004 commit_raw.json Card.CardP.Card0005 commit_raw.json Card.CardP.Card0006 commit_raw.json Card.CardP.Card0007 commit_raw.json CardMain.CardChart commit_raw.json CardMain.CardDetail commit_raw.json CardMain.CardEdit commit_raw.json CardMain.CardForm commit_raw.json CardMain.CardLarge commit_raw.json CardMain.CardMini commit_raw.json CardMain.CardPattern commit_raw.json CardMain.CardWidget commit_raw.json CardMain.Review commit_raw.json Chart.Chart0001 commit_raw.json Chart.Chart0002 commit_raw.json Chart.Chart0003 commit_raw.json Chart.Chart0004 commit_raw.json Chart.ChartP.Chart0001 commit_raw.json Chart.ChartP.Chart0002 commit_raw.json Chart.ChartP.Chart0003 commit_raw.json Chart.ChartP.Chart0004 commit_raw.json ChartBalance commit_raw.json Detail.Button0001 commit_raw.json Detail.Button0002 commit_raw.json Detail.Button0003 commit_raw.json Detail.Button0004 commit_raw.json Detail.Button0005 commit_raw.json Detail.Button0006 commit_raw.json Detail.Button0007 commit_raw.json Detail.Button0008 commit_raw.json Detail.Button0009 commit_raw.json Detail.Button0010 commit_raw.json Detail.Button0011 commit_raw.json Detail.Button0012 commit_raw.json Detail.Button0013 commit_raw.json Detail.Button0014 commit_raw.json Detail.Button0015 commit_raw.json Detail.Button0016 commit_raw.json Detail.Button0017 commit_raw.json Detail.Button0018 commit_raw.json Detail.Button0019 commit_raw.json Detail.Button0020 commit_raw.json Detail.Button0021 commit_raw.json Detail.Button0022 commit_raw.json Detail.Button0023 commit_raw.json Detail.Button0024 commit_raw.json Detail.Button0025 commit_raw.json Detail.Button0026 commit_raw.json Detail.Button0027 commit_raw.json Detail.Button0028 commit_raw.json FastUIHeader commit_raw.json Feedback.CardWidget.Devhub commit_raw.json Feedback.CardWidget.Fastui commit_raw.json Feedback.CardWidget.Magicbuild commit_raw.json Feedback.CardWidget.Metapool commit_raw.json Feedback.CardWidget.NearHorizon commit_raw.json Feedback.CardWidget.Potlock commit_raw.json Feedback.Widget.Devhub commit_raw.json Feedback.Widget.Fastui commit_raw.json Feedback.Widget.Index commit_raw.json Feedback.Widget.Magicbuild commit_raw.json Feedback.Widget.Metapool commit_raw.json Feedback.Widget.Nearafrica commit_raw.json Feedback.Widget.Nearhorizon commit_raw.json Feedback.Widget.Potlock commit_raw.json Feedback.Widget.Template commit_raw.json FontStyle.Font0001 commit_raw.json FontStyle.Font0002 commit_raw.json FontStyle.Font0003 commit_raw.json FontStyle.Font0004 commit_raw.json FontStyle.Font0005 commit_raw.json FontStyle.Font0006 commit_raw.json FontStyle.Font0007 commit_raw.json FontStyle.Font0008 commit_raw.json Form.Form0001 commit_raw.json Form.Form0002 commit_raw.json Form.Form0003 commit_raw.json Form.Form0004 commit_raw.json Form.FormP.Form0001 commit_raw.json Form.FormP.Form0002 commit_raw.json Form.FormP.Form0003 commit_raw.json Form.FormP.Form0004 commit_raw.json IPFSJsontest commit_raw.json Index commit_raw.json Input.Input0001 commit_raw.json Input.Input0002 commit_raw.json Input.Input0003 commit_raw.json Input.InputP.Input0001 commit_raw.json Input.InputP.Input0002 commit_raw.json Input.InputP.Input0003 commit_raw.json Loader.Loader0001 commit_raw.json Loader.Loader0002 commit_raw.json Loader.Loader0003 commit_raw.json Loader.Loader0004 commit_raw.json Loader.Loader0005 commit_raw.json Loader.Loader0006 commit_raw.json Loader.Loader0007 commit_raw.json Loader.Loader0008 commit_raw.json Loader.LoaderP.Loader0001 commit_raw.json Loader.LoaderP.Loader0002 commit_raw.json Loader.LoaderP.Loader0003 commit_raw.json Loader.LoaderP.Loader0004 commit_raw.json Loader.LoaderP.Loader0005 commit_raw.json Loader.LoaderP.Loader0006 commit_raw.json Loader.LoaderP.Loader0007 commit_raw.json Loader.LoaderP.Loader0008 commit_raw.json Page.ButtonPage1 commit_raw.json Page.CardPage1 commit_raw.json Page.ChartPage1 commit_raw.json Page.CheckBoxPage1 commit_raw.json Page.FontPage1 commit_raw.json Page.FormPage1 commit_raw.json Page.IPFS commit_raw.json Page.InputPage1 commit_raw.json Page.LoaderPage1 commit_raw.json Page.MyFavouritesPage commit_raw.json Page.PatternPage1 commit_raw.json Page.RadioButtonPage1 commit_raw.json Page.ToggleSwitchPage1 commit_raw.json Pattern.Pattern0001 commit_raw.json Pattern.Pattern0002 commit_raw.json Pattern.Pattern0003 commit_raw.json Pattern.Pattern0004 commit_raw.json Pattern.Pattern0005 commit_raw.json Pattern.Pattern0006 commit_raw.json Pattern.Pattern0007 commit_raw.json Pattern.PatternP.Pattern0001 commit_raw.json Pattern.PatternP.Pattern0002 commit_raw.json Pattern.PatternP.Pattern0003 commit_raw.json Pattern.PatternP.Pattern0004 commit_raw.json Pattern.PatternP.Pattern0005 commit_raw.json Pattern.PatternP.Pattern0006 commit_raw.json Pattern.PatternP.Pattern0007 commit_raw.json Radio.RadioButton0001 commit_raw.json Radio.RadioButton0002 commit_raw.json Radio.RadioP.Radio0001 commit_raw.json Radio.RadioP.Radio0002 commit_raw.json TS.TSP.TS0001 commit_raw.json TS.TSP.TS0002 commit_raw.json TS.TSP.TS0003 commit_raw.json TS.ToggleSwitch0001 commit_raw.json TS.ToggleSwitch0002 commit_raw.json TS.ToggleSwitch0003 commit_raw.json TrendingPost.ChartPost commit_raw.json TrendingPost.ChartValue1 commit_raw.json TrendingPost.ChartValue3 commit_raw.json TrendingPost.ChartValue7 commit_raw.json TrendingPost.ChartValueAll commit_raw.json TrendingPost.ChartValueP7 commit_raw.json TrendingPost.ChartValueProps commit_raw.json TrendingPost.GetpostP commit_raw.json TrendingPost.Header commit_raw.json TrendingPost.Index commit_raw.json TrendingPost.PostpostP commit_raw.json TrendingPost.TableTags commit_raw.json TrendingPost.TableValue commit_raw.json YourProfile commit_raw.json marko-jurisic.near Untitled-0 commit_raw.json test commit_raw.json marko.near Arsenal commit_raw.json markomatic.near Untitled-0 commit_raw.json markomazibrada.near Untitled-0 commit_raw.json markomilj.near Untitled-0 commit_raw.json markuso.near Onboarding.Starter commit_raw.json confirm-and-sign-proposed-tx commit_raw.json craft-propose-sign-safe-tx commit_raw.json marmajgaming.near MJG-Widget commit_raw.json MJG commit_raw.json martinvidmar.near Untitled-0 commit_raw.json masterclem.near dedeukwushryne-home commit_raw.json nftpuzzle commit_raw.json mateocip.near Untitled-0 commit_raw.json Untitled-1 commit_raw.json material-icons.near 10KIcon commit_raw.json 10KOutlinedIcon commit_raw.json 10KRoundedIcon commit_raw.json 10KSharpIcon commit_raw.json 10KTwoToneIcon commit_raw.json 10MpIcon commit_raw.json 10MpOutlinedIcon commit_raw.json 10MpRoundedIcon commit_raw.json 10MpSharpIcon commit_raw.json 10MpTwoToneIcon commit_raw.json 11MpIcon commit_raw.json 11MpOutlinedIcon commit_raw.json 11MpRoundedIcon commit_raw.json 11MpSharpIcon commit_raw.json 11MpTwoToneIcon commit_raw.json 12MpIcon commit_raw.json 12MpOutlinedIcon commit_raw.json 12MpRoundedIcon commit_raw.json 12MpSharpIcon commit_raw.json 12MpTwoToneIcon commit_raw.json 13MpIcon commit_raw.json 13MpOutlinedIcon commit_raw.json 13MpRoundedIcon commit_raw.json 13MpSharpIcon commit_raw.json 13MpTwoToneIcon commit_raw.json 14MpIcon commit_raw.json 14MpOutlinedIcon commit_raw.json 14MpRoundedIcon commit_raw.json 14MpSharpIcon commit_raw.json 14MpTwoToneIcon commit_raw.json 15MpIcon commit_raw.json 15MpOutlinedIcon commit_raw.json 15MpRoundedIcon commit_raw.json 15MpSharpIcon commit_raw.json 15MpTwoToneIcon commit_raw.json 16MpIcon commit_raw.json 16MpOutlinedIcon commit_raw.json 16MpRoundedIcon commit_raw.json 16MpSharpIcon commit_raw.json 16MpTwoToneIcon commit_raw.json 17MpIcon commit_raw.json 17MpOutlinedIcon commit_raw.json 17MpRoundedIcon commit_raw.json 17MpSharpIcon commit_raw.json 17MpTwoToneIcon commit_raw.json 18MpIcon commit_raw.json 18MpOutlinedIcon commit_raw.json 18MpRoundedIcon commit_raw.json 18MpSharpIcon commit_raw.json 18MpTwoToneIcon commit_raw.json 18UpRatingIcon commit_raw.json 18UpRatingOutlinedIcon commit_raw.json 18UpRatingRoundedIcon commit_raw.json 18UpRatingSharpIcon commit_raw.json 18UpRatingTwoToneIcon commit_raw.json 19MpIcon commit_raw.json 19MpOutlinedIcon commit_raw.json 19MpRoundedIcon commit_raw.json 19MpSharpIcon commit_raw.json 19MpTwoToneIcon commit_raw.json 1KIcon commit_raw.json 1KOutlinedIcon commit_raw.json 1KPlusIcon commit_raw.json 1KPlusOutlinedIcon commit_raw.json 1KPlusRoundedIcon commit_raw.json 1KPlusSharpIcon commit_raw.json 1KPlusTwoToneIcon commit_raw.json 1KRoundedIcon commit_raw.json 1KSharpIcon commit_raw.json 1KTwoToneIcon commit_raw.json 1XMobiledataIcon commit_raw.json 1XMobiledataOutlinedIcon commit_raw.json 1XMobiledataRoundedIcon commit_raw.json 1XMobiledataSharpIcon commit_raw.json 1XMobiledataTwoToneIcon commit_raw.json 20MpIcon commit_raw.json 20MpOutlinedIcon commit_raw.json 20MpRoundedIcon commit_raw.json 20MpSharpIcon commit_raw.json 20MpTwoToneIcon commit_raw.json 21MpIcon commit_raw.json 21MpOutlinedIcon commit_raw.json 21MpRoundedIcon commit_raw.json 21MpSharpIcon commit_raw.json 21MpTwoToneIcon commit_raw.json 22MpIcon commit_raw.json 22MpOutlinedIcon commit_raw.json 22MpRoundedIcon commit_raw.json 22MpSharpIcon commit_raw.json 22MpTwoToneIcon commit_raw.json 23MpIcon commit_raw.json 23MpOutlinedIcon commit_raw.json 23MpRoundedIcon commit_raw.json 23MpSharpIcon commit_raw.json 23MpTwoToneIcon commit_raw.json 24MpIcon commit_raw.json 24MpOutlinedIcon commit_raw.json 24MpRoundedIcon commit_raw.json 24MpSharpIcon commit_raw.json 24MpTwoToneIcon commit_raw.json 2KIcon commit_raw.json 2KOutlinedIcon commit_raw.json 2KPlusIcon commit_raw.json 2KPlusOutlinedIcon commit_raw.json 2KPlusRoundedIcon commit_raw.json 2KPlusSharpIcon commit_raw.json 2KPlusTwoToneIcon commit_raw.json 2KRoundedIcon commit_raw.json 2KSharpIcon commit_raw.json 2KTwoToneIcon commit_raw.json 2MpIcon commit_raw.json 2MpOutlinedIcon commit_raw.json 2MpRoundedIcon commit_raw.json 2MpSharpIcon commit_raw.json 2MpTwoToneIcon commit_raw.json 30FpsIcon commit_raw.json 30FpsOutlinedIcon commit_raw.json 30FpsRoundedIcon commit_raw.json 30FpsSelectIcon commit_raw.json 30FpsSelectOutlinedIcon commit_raw.json 30FpsSelectRoundedIcon commit_raw.json 30FpsSelectSharpIcon commit_raw.json 30FpsSelectTwoToneIcon commit_raw.json 30FpsSharpIcon commit_raw.json 30FpsTwoToneIcon commit_raw.json 360Icon commit_raw.json 360OutlinedIcon commit_raw.json 360RoundedIcon commit_raw.json 360SharpIcon commit_raw.json 360TwoToneIcon commit_raw.json 3DRotationIcon commit_raw.json 3DRotationOutlinedIcon commit_raw.json 3DRotationRoundedIcon commit_raw.json 3DRotationSharpIcon commit_raw.json 3DRotationTwoToneIcon commit_raw.json 3GMobiledataIcon commit_raw.json 3GMobiledataOutlinedIcon commit_raw.json 3GMobiledataRoundedIcon commit_raw.json 3GMobiledataSharpIcon commit_raw.json 3GMobiledataTwoToneIcon commit_raw.json 3KIcon commit_raw.json 3KOutlinedIcon commit_raw.json 3KPlusIcon commit_raw.json 3KPlusOutlinedIcon commit_raw.json 3KPlusRoundedIcon commit_raw.json 3KPlusSharpIcon commit_raw.json 3KPlusTwoToneIcon commit_raw.json 3KRoundedIcon commit_raw.json 3KSharpIcon commit_raw.json 3KTwoToneIcon commit_raw.json 3MpIcon commit_raw.json 3MpOutlinedIcon commit_raw.json 3MpRoundedIcon commit_raw.json 3MpSharpIcon commit_raw.json 3MpTwoToneIcon commit_raw.json 3PIcon commit_raw.json 3POutlinedIcon commit_raw.json 3PRoundedIcon commit_raw.json 3PSharpIcon commit_raw.json 3PTwoToneIcon commit_raw.json 4GMobiledataIcon commit_raw.json 4GMobiledataOutlinedIcon commit_raw.json 4GMobiledataRoundedIcon commit_raw.json 4GMobiledataSharpIcon commit_raw.json 4GMobiledataTwoToneIcon commit_raw.json 4GPlusMobiledataIcon commit_raw.json 4GPlusMobiledataOutlinedIcon commit_raw.json 4GPlusMobiledataRoundedIcon commit_raw.json 4GPlusMobiledataSharpIcon commit_raw.json 4GPlusMobiledataTwoToneIcon commit_raw.json 4KIcon commit_raw.json 4KOutlinedIcon commit_raw.json 4KPlusIcon commit_raw.json 4KPlusOutlinedIcon commit_raw.json 4KPlusRoundedIcon commit_raw.json 4KPlusSharpIcon commit_raw.json 4KPlusTwoToneIcon commit_raw.json 4KRoundedIcon commit_raw.json 4KSharpIcon commit_raw.json 4KTwoToneIcon commit_raw.json 4MpIcon commit_raw.json 4MpOutlinedIcon commit_raw.json 4MpRoundedIcon commit_raw.json 4MpSharpIcon commit_raw.json 4MpTwoToneIcon commit_raw.json 5GIcon commit_raw.json 5GOutlinedIcon commit_raw.json 5GRoundedIcon commit_raw.json 5GSharpIcon commit_raw.json 5GTwoToneIcon commit_raw.json 5KIcon commit_raw.json 5KOutlinedIcon commit_raw.json 5KPlusIcon commit_raw.json 5KPlusOutlinedIcon commit_raw.json 5KPlusRoundedIcon commit_raw.json 5KPlusSharpIcon commit_raw.json 5KPlusTwoToneIcon commit_raw.json 5KRoundedIcon commit_raw.json 5KSharpIcon commit_raw.json 5KTwoToneIcon commit_raw.json 5MpIcon commit_raw.json 5MpOutlinedIcon commit_raw.json 5MpRoundedIcon commit_raw.json 5MpSharpIcon commit_raw.json 5MpTwoToneIcon commit_raw.json 60FpsIcon commit_raw.json 60FpsOutlinedIcon commit_raw.json 60FpsRoundedIcon commit_raw.json 60FpsSelectIcon commit_raw.json 60FpsSelectOutlinedIcon commit_raw.json 60FpsSelectRoundedIcon commit_raw.json 60FpsSelectSharpIcon commit_raw.json 60FpsSelectTwoToneIcon commit_raw.json 60FpsSharpIcon commit_raw.json 60FpsTwoToneIcon commit_raw.json 6KIcon commit_raw.json 6KOutlinedIcon commit_raw.json 6KPlusIcon commit_raw.json 6KPlusOutlinedIcon commit_raw.json 6KPlusRoundedIcon commit_raw.json 6KPlusSharpIcon commit_raw.json 6KPlusTwoToneIcon commit_raw.json 6KRoundedIcon commit_raw.json 6KSharpIcon commit_raw.json 6KTwoToneIcon commit_raw.json 6MpIcon commit_raw.json 6MpOutlinedIcon commit_raw.json 6MpRoundedIcon commit_raw.json 6MpSharpIcon commit_raw.json 6MpTwoToneIcon commit_raw.json 7KIcon commit_raw.json 7KOutlinedIcon commit_raw.json 7KPlusIcon commit_raw.json 7KPlusOutlinedIcon commit_raw.json 7KPlusRoundedIcon commit_raw.json 7KPlusSharpIcon commit_raw.json 7KPlusTwoToneIcon commit_raw.json 7KRoundedIcon commit_raw.json 7KSharpIcon commit_raw.json 7KTwoToneIcon commit_raw.json 7MpIcon commit_raw.json 7MpOutlinedIcon commit_raw.json 7MpRoundedIcon commit_raw.json 7MpSharpIcon commit_raw.json 7MpTwoToneIcon commit_raw.json 8KIcon commit_raw.json 8KOutlinedIcon commit_raw.json 8KPlusIcon commit_raw.json 8KPlusOutlinedIcon commit_raw.json 8KPlusRoundedIcon commit_raw.json 8KPlusSharpIcon commit_raw.json 8KPlusTwoToneIcon commit_raw.json 8KRoundedIcon commit_raw.json 8KSharpIcon commit_raw.json 8KTwoToneIcon commit_raw.json 8MpIcon commit_raw.json 8MpOutlinedIcon commit_raw.json 8MpRoundedIcon commit_raw.json 8MpSharpIcon commit_raw.json 8MpTwoToneIcon commit_raw.json 9KIcon commit_raw.json 9KOutlinedIcon commit_raw.json 9KPlusIcon commit_raw.json 9KPlusOutlinedIcon commit_raw.json 9KPlusRoundedIcon commit_raw.json 9KPlusSharpIcon commit_raw.json 9KPlusTwoToneIcon commit_raw.json 9KRoundedIcon commit_raw.json 9KSharpIcon commit_raw.json 9KTwoToneIcon commit_raw.json 9MpIcon commit_raw.json 9MpOutlinedIcon commit_raw.json 9MpRoundedIcon commit_raw.json 9MpSharpIcon commit_raw.json 9MpTwoToneIcon commit_raw.json abcIcon commit_raw.json abcOutlinedIcon commit_raw.json abcRoundedIcon commit_raw.json abcSharpIcon commit_raw.json abcTwoToneIcon commit_raw.json matheus7.near Hackaton commit_raw.json HomeTest commit_raw.json mattb.near Edge.Components.FaqSection commit_raw.json Edge.Components.Footer commit_raw.json Edge.Components.Header commit_raw.json Edge.Components.HomeSection commit_raw.json Edge.Components.HostsSection commit_raw.json Edge.Components.MainTopicsSection commit_raw.json Edge.Components.Modal commit_raw.json Edge.Components.ProgramSection commit_raw.json Edge.Components.SpeakersSection commit_raw.json Edge.Components.SponsorsSection commit_raw.json Edge.Components.StorySection commit_raw.json Edge.Components.TicketsModal commit_raw.json Edge.Components.TicketsSection commit_raw.json Edge.Views.Home commit_raw.json Frensly.Commons.Buttons commit_raw.json Frensly.Components.Header commit_raw.json Frensly.Components.HowToJoin commit_raw.json Frensly.Components.RecentlyVerified commit_raw.json Frensly.Components.Toolbar commit_raw.json Frensly.Pages.Explore commit_raw.json Frensly.Pages.Frens commit_raw.json Frensly.Pages.Home commit_raw.json Frensly.Pages.Index commit_raw.json Frensly.Skeletons.Posts commit_raw.json Frensly.Skeletons.Toolbar commit_raw.json GenaDrop.GenaDropSDK commit_raw.json GenaDrop.MultiChainMinter commit_raw.json GenaDrop.MultiChainMinterStyles commit_raw.json Geoquete.Components.CreateQuest commit_raw.json Geoquete.Components.Footer commit_raw.json Geoquete.Components.Header commit_raw.json Geoquete.Components.Quest commit_raw.json Geoquete.Components.QuestList commit_raw.json Geoquete.Libs.GeoqueteSDK commit_raw.json Geoquete.Views.Home commit_raw.json Geoquete.Views.KeyVerification commit_raw.json Geoquete.Views.ReviewQuests commit_raw.json Lens.Profile.Post commit_raw.json LensProfile commit_raw.json LensSDK commit_raw.json LensSDKRequire commit_raw.json Linktree.Main commit_raw.json Linktree.Themes.Aqua commit_raw.json Linktree.Themes.Blossom commit_raw.json Linktree.Themes.Dark commit_raw.json Linktree.Themes.Default commit_raw.json Linktree.Themes.Eclectic commit_raw.json Linktree.Themes.Gold commit_raw.json Linktree.Themes.Neon commit_raw.json Linktree.Themes.Vibrant commit_raw.json Linktree.Themes.Vintage commit_raw.json Linktree.Utils.SDK commit_raw.json Manifest commit_raw.json Messenger.Components.Avatar commit_raw.json Messenger.Components.Sidebar commit_raw.json Messenger.Pages.Home commit_raw.json NDC.Components.Header commit_raw.json NDC.Components.ProgressMeterHumans commit_raw.json NDC.Utils.NDCLib commit_raw.json NDC.Views.Home commit_raw.json NDCDocs.Components.Article commit_raw.json NDCDocs.Components.ArticleContent commit_raw.json NDCDocs.Components.ArticlesList commit_raw.json NDCDocs.Components.AuthorsList commit_raw.json NDCDocs.Components.Controls commit_raw.json NDCDocs.Components.Header commit_raw.json NDCDocs.Components.SideBar commit_raw.json NDCDocs.Views.Home commit_raw.json NearBadger.Components.Modal commit_raw.json NearBadger.Components.Profile commit_raw.json NearBadger.Components.RecentlyVerified commit_raw.json NearBadger.Libs.Farcaster commit_raw.json NearBadger.Libs.Lens commit_raw.json NearBadger.Pages.Authentication commit_raw.json NearBadger.Pages.Main commit_raw.json NearBook.Components.App.Editor commit_raw.json NearBook.Components.Commons.Header commit_raw.json NearBook.Views.Home commit_raw.json NearBox.Components.DropNFTModal commit_raw.json NearBox.Components.Logo commit_raw.json NearBox.Components.MessageList commit_raw.json NearBox.Components.ReadMessage commit_raw.json NearBox.Components.Sidebar commit_raw.json NearBox.Components.Toast commit_raw.json NearBox.Components.WriteMessage commit_raw.json NearBox.Styles.DropNFTModal commit_raw.json NearBox.Views.App commit_raw.json NearBox.Views.Home commit_raw.json ParentWidgetUsingModule commit_raw.json Playground.Child commit_raw.json Playground.Require commit_raw.json Playground.SecondChild commit_raw.json Playground.Styles commit_raw.json Profile.SmallVerified commit_raw.json Rubik.Themes.Default commit_raw.json SDKs.Verifiers.Lens commit_raw.json SampleTranslations commit_raw.json SkipFramework.core commit_raw.json Test commit_raw.json TestCryptoJS commit_raw.json TestModule commit_raw.json TestVmAsyncRequire commit_raw.json TranslationsLib commit_raw.json mattlock.near ComponentSearch commit_raw.json Editor.ComponentSearch commit_raw.json EthBalance commit_raw.json EthSeoulDemo commit_raw.json Galxe-SpaceID commit_raw.json Keypom-Key-Data commit_raw.json SPACEID-BNB commit_raw.json StethBalance commit_raw.json blah commit_raw.json bos-landing-page commit_raw.json bridge-ui commit_raw.json canto-base-swap commit_raw.json canto-component-search commit_raw.json canto-landing-page commit_raw.json canto-swap-container commit_raw.json cantoswap-component commit_raw.json frax-bridge commit_raw.json gamma-zkevm-app commit_raw.json gamma-zkevm-table commit_raw.json mantle-lp commit_raw.json op-bridge-demo-sepolia commit_raw.json op-bridge-demo commit_raw.json op-bridge-functions commit_raw.json op-mantle-demo commit_raw.json svg-bg-not-working commit_raw.json toast commit_raw.json zk-bridge commit_raw.json zk-evm-lp commit_raw.json max_p.near Welcome commit_raw.json maxdev.near Genie commit_raw.json GenieAnswerList commit_raw.json GenieAnswerSubmit commit_raw.json GenieAnswerView commit_raw.json GenieAnswerVote commit_raw.json GenieQuestionAnswerView commit_raw.json GenieQuestionList commit_raw.json GenieQuestionView commit_raw.json GenieSaveQuestion commit_raw.json HelloWorld commit_raw.json ide-preview commit_raw.json maxhr.near Genie commit_raw.json mayankja1n.near ForkThis commit_raw.json mayurmc.near vistara commit_raw.json mbbevilacqua_caffepoesia.near PoesiaDivinamujer commit_raw.json mbodnar.near KK-1 commit_raw.json TurnOn commit_raw.json mcbyte.near Draft-0 commit_raw.json Minter_Rescatarte commit_raw.json Minter_testmals commit_raw.json MyM commit_raw.json mctery.near Air3LoadFiles commit_raw.json NearFillar commit_raw.json mdbal.near Untitled-0 commit_raw.json meerkatamaran.near NFT-Burn commit_raw.json nft-selector commit_raw.json megha19.near Actions.index commit_raw.json CheddarMazeReact commit_raw.json CheddarMazeReactV1 commit_raw.json Common.Layout.CardModal commit_raw.json Common.Layout.Countdown commit_raw.json Common.Layout.Header commit_raw.json Common.Modals.Comments commit_raw.json Common.Modals.FiltersModal commit_raw.json Common.Modals.ProposalArguments commit_raw.json Common.Modals.Share commit_raw.json Common.Modals.ViewDropDown commit_raw.json Common.Modals.Voters commit_raw.json Common.logo commit_raw.json CommunityVoice commit_raw.json Congress.index commit_raw.json ConnectBuildDao commit_raw.json CreateDAO.Footer commit_raw.json CreateDAO.Step1 commit_raw.json CreateDAO.Step2 commit_raw.json CreateDAO.Step3 commit_raw.json CreateDAO.Step4 commit_raw.json CreateDAO.Step5 commit_raw.json CreateDAO.Step6 commit_raw.json CreateDAO.form commit_raw.json CreateDAO.index commit_raw.json DAO.Bounties.Card commit_raw.json DAO.Bounties.List commit_raw.json DAO.Bounties.index commit_raw.json DAO.Bounties commit_raw.json DAO.Discussion commit_raw.json DAO.Followers.FollowersList commit_raw.json DAO.Followers.index commit_raw.json DAO.Followers commit_raw.json DAO.Funds.Balance commit_raw.json DAO.Funds.Outgoing commit_raw.json DAO.Funds.TransactionLine commit_raw.json DAO.Funds.Transactions commit_raw.json DAO.Funds.index commit_raw.json DAO.Layout.Header commit_raw.json DAO.Layout.Sidebar commit_raw.json DAO.Layout.Tabs commit_raw.json DAO.Members.MembersGroup commit_raw.json DAO.Members.index commit_raw.json DAO.Policy commit_raw.json DAO.Proposal.Common.CongressHouseDropdown commit_raw.json DAO.Proposal.Common.ProposalQueue commit_raw.json DAO.Proposal.Common.VetoButton commit_raw.json DAO.Proposal.Create.AddMemberToRole commit_raw.json DAO.Proposal.Create.ApproveBudget commit_raw.json DAO.Proposal.Create.Dismiss commit_raw.json DAO.Proposal.Create.Dissolve commit_raw.json DAO.Proposal.Create.FunctionCall commit_raw.json DAO.Proposal.Create.FundingRequest commit_raw.json DAO.Proposal.Create.RemoveMemberFromRole commit_raw.json DAO.Proposal.Create.Text commit_raw.json DAO.Proposal.Create.Transfer commit_raw.json DAO.Proposal.Create.UpdateBonds commit_raw.json DAO.Proposal.Create.UpdateVoteDuration commit_raw.json DAO.Proposal.Create.Veto commit_raw.json DAO.Proposal.Create commit_raw.json DAO.Proposals.Card.Vote commit_raw.json DAO.Proposals.Card.index commit_raw.json DAO.Proposals.Card.skeleton commit_raw.json DAO.Proposals.Card.ui commit_raw.json DAO.Proposals.Card.ui_old commit_raw.json DAO.Proposals.CardsList commit_raw.json DAO.Proposals.Congress.index commit_raw.json DAO.Proposals.FilterModal commit_raw.json DAO.Proposals.MultiVote commit_raw.json DAO.Proposals.ProposalsPikespeak commit_raw.json DAO.Proposals.Table.Row commit_raw.json DAO.Proposals.Table.index commit_raw.json DAO.Proposals.index commit_raw.json DAO.Settings.BondsSettings commit_raw.json DAO.Settings.ConfigSettings commit_raw.json DAO.Settings.PolicySettings commit_raw.json DAO.Settings.index commit_raw.json DAO.index commit_raw.json DAOs.Card commit_raw.json DAOs.index commit_raw.json DAOs.list commit_raw.json DeeDee commit_raw.json DevGov.Notification.Item.Left commit_raw.json DevGov.Notification.Item.Right commit_raw.json Feed.index commit_raw.json Join-CTA commit_raw.json Layout.Modal commit_raw.json MyProposals.index commit_raw.json OnboardingFlow commit_raw.json She-is-near-education commit_raw.json She-is-near-marketing commit_raw.json She-is-near-partnerships commit_raw.json She-is-near commit_raw.json Untitled-0 commit_raw.json VotingHistory.index commit_raw.json app commit_raw.json checkIsMemberOrPending commit_raw.json components.socialLinks commit_raw.json core.adapter.devhub-contract commit_raw.json core.lib.autocomplete commit_raw.json core.lib.checkIsMemberOrPending commit_raw.json core.lib.common commit_raw.json core.lib.data-request commit_raw.json core.lib.stringUtils commit_raw.json core.lib.struct commit_raw.json core.lib.time-utils commit_raw.json core.lib.timeUtils commit_raw.json core.lib.url commit_raw.json core.lib.uuid commit_raw.json daoDetailsPage commit_raw.json daoSDK commit_raw.json devhub.components.atom.Alert commit_raw.json devhub.components.atom.Icon commit_raw.json devhub.components.atom.NearIcon commit_raw.json devhub.components.atom.Tag commit_raw.json devhub.components.atom.Toggle commit_raw.json devhub.components.feed.MergedIndexFeed commit_raw.json devhub.components.feed.SubscribedFeed commit_raw.json devhub.components.island.banner commit_raw.json devhub.components.island.connect commit_raw.json devhub.components.island.explore commit_raw.json devhub.components.island.hero commit_raw.json devhub.components.island.home-section commit_raw.json devhub.components.island.participate commit_raw.json devhub.components.island.support commit_raw.json devhub.components.layout.LikeButton.Faces commit_raw.json devhub.components.molecule.AccountAutocomplete commit_raw.json devhub.components.molecule.BadgeDetails commit_raw.json devhub.components.molecule.BadgesList commit_raw.json devhub.components.molecule.Button commit_raw.json devhub.components.molecule.Checkbox commit_raw.json devhub.components.molecule.CommunityControl commit_raw.json devhub.components.molecule.Compose commit_raw.json devhub.components.molecule.DropDown commit_raw.json devhub.components.molecule.DropDownWithSearch commit_raw.json devhub.components.molecule.Input commit_raw.json devhub.components.molecule.InputWithIcon commit_raw.json devhub.components.molecule.ListEditor commit_raw.json devhub.components.molecule.MarkdownEditor commit_raw.json devhub.components.molecule.MarkdownViewer commit_raw.json devhub.components.molecule.NavbarDropdown commit_raw.json devhub.components.molecule.PostControls commit_raw.json devhub.components.molecule.ProfileCard commit_raw.json devhub.components.molecule.ProfileLine commit_raw.json devhub.components.molecule.Select commit_raw.json devhub.components.molecule.SimpleMDE commit_raw.json devhub.components.molecule.Spinner commit_raw.json devhub.components.molecule.Switch commit_raw.json devhub.components.molecule.Tile commit_raw.json devhub.components.organism.Configurator commit_raw.json devhub.components.organism.Feed.NearQueryApi commit_raw.json devhub.components.organism.Feed commit_raw.json devhub.components.organism.Navbar commit_raw.json devhub.components.organism.NewsLetter commit_raw.json devhub.components.templates.AppLayout commit_raw.json devhub.entity.addon.blog.Card commit_raw.json devhub.entity.addon.blog.Configurator commit_raw.json devhub.entity.addon.blog.Feed commit_raw.json devhub.entity.addon.blog.Page commit_raw.json devhub.entity.addon.blog.Viewer commit_raw.json devhub.entity.addon.blog.editor.content commit_raw.json devhub.entity.addon.blog.editor.form commit_raw.json devhub.entity.addon.blog.editor.index commit_raw.json devhub.entity.addon.blog.editor.layout commit_raw.json devhub.entity.addon.blog.editor.preview commit_raw.json devhub.entity.addon.blog.editor.provider commit_raw.json devhub.entity.addon.blog.editor.sidebar commit_raw.json devhub.entity.addon.github.Viewer commit_raw.json devhub.entity.addon.github.configurator commit_raw.json devhub.entity.addon.github.kanban_board commit_raw.json devhub.entity.addon.github.kanban_ticket commit_raw.json devhub.entity.addon.kanban.Configurator commit_raw.json devhub.entity.addon.kanban.Viewer commit_raw.json devhub.entity.addon.kanban.post_board commit_raw.json devhub.entity.addon.kanban.post_ticket commit_raw.json devhub.entity.addon.telegram.Configurator commit_raw.json devhub.entity.addon.telegram.Viewer commit_raw.json devhub.entity.addon.wiki.Configurator commit_raw.json devhub.entity.addon.wiki.Viewer commit_raw.json devhub.entity.community.Activity commit_raw.json devhub.entity.community.Announcements commit_raw.json devhub.entity.community.Card commit_raw.json devhub.entity.community.Compose commit_raw.json devhub.entity.community.Discussions commit_raw.json devhub.entity.community.Provider commit_raw.json devhub.entity.community.Sidebar commit_raw.json devhub.entity.community.Spawner commit_raw.json devhub.entity.community.Teams commit_raw.json devhub.entity.community.Tile commit_raw.json devhub.entity.community.configuration.AboutConfigurator commit_raw.json devhub.entity.community.configuration.AccessControlConfigurator commit_raw.json devhub.entity.community.configuration.AddonsConfigurator commit_raw.json devhub.entity.community.configuration.BrandingConfigurator commit_raw.json devhub.entity.community.configuration.ConfigurationSection commit_raw.json devhub.entity.community.configuration.InformationConfigurator commit_raw.json devhub.entity.layout commit_raw.json devhub.entity.post.History commit_raw.json devhub.entity.post.List commit_raw.json devhub.entity.post.Panel commit_raw.json devhub.entity.post.Post commit_raw.json devhub.entity.post.PostEditor commit_raw.json devhub.entity.post.Postv2 commit_raw.json devhub.entity.post.draft commit_raw.json devhub.entity.proposal.AccountInput commit_raw.json devhub.entity.proposal.CategoryDropdown commit_raw.json devhub.entity.proposal.CategoryTag commit_raw.json devhub.entity.proposal.CommentIcon commit_raw.json devhub.entity.proposal.Comments commit_raw.json devhub.entity.proposal.CommentsAndLogs commit_raw.json devhub.entity.proposal.ComposeComment commit_raw.json devhub.entity.proposal.ConfirmCancelModal commit_raw.json devhub.entity.proposal.ConfirmReviewModal commit_raw.json devhub.entity.proposal.Editor commit_raw.json devhub.entity.proposal.Feed commit_raw.json devhub.entity.proposal.History commit_raw.json devhub.entity.proposal.LikeButton commit_raw.json devhub.entity.proposal.LinkedProposalsDropdown commit_raw.json devhub.entity.proposal.LoginScreen commit_raw.json devhub.entity.proposal.Menu commit_raw.json devhub.entity.proposal.Profile commit_raw.json devhub.entity.proposal.Proposal commit_raw.json devhub.entity.proposal.StatusTag commit_raw.json devhub.entity.proposal.VerificationStatus commit_raw.json devhub.entity.team.Configurator commit_raw.json devhub.entity.team.LabelPermissions commit_raw.json devhub.entity.team.LabelRow commit_raw.json devhub.entity.trustee.approvals commit_raw.json devhub.entity.trustee.dashboard commit_raw.json devhub.entity.trustee.history commit_raw.json devhub.entity.trustee.login commit_raw.json devhub.entity.trustee.treasury commit_raw.json devhub.entity.trustees.approvals commit_raw.json devhub.entity.trustees.dashboard commit_raw.json devhub.entity.trustees.history commit_raw.json devhub.entity.trustees.index commit_raw.json devhub.entity.trustees.login commit_raw.json devhub.entity.trustees.treasury commit_raw.json devhub.feature.post-search.by-author commit_raw.json devhub.feature.post-search.by-tag commit_raw.json devhub.feature.post-search.panel commit_raw.json devhub.feature.proposal-search.by-author commit_raw.json devhub.feature.proposal-search.by-category commit_raw.json devhub.feature.proposal-search.by-input commit_raw.json devhub.feature.proposal-search.by-sort commit_raw.json devhub.feature.proposal-search.by-stage commit_raw.json devhub.notification.Item commit_raw.json devhub.notification.LR commit_raw.json devhub.notification.Left commit_raw.json devhub.notification.Right commit_raw.json devhub.page.about commit_raw.json devhub.page.addon commit_raw.json devhub.page.admin.homepageTab commit_raw.json devhub.page.admin.index commit_raw.json devhub.page.admin.moderatorsTab commit_raw.json devhub.page.admin.restrictedLabelsTab commit_raw.json devhub.page.announcements commit_raw.json devhub.page.blog commit_raw.json devhub.page.communities commit_raw.json devhub.page.community.configuration commit_raw.json devhub.page.community.index commit_raw.json devhub.page.contribute commit_raw.json devhub.page.dao-dashboard commit_raw.json devhub.page.daoDashboard commit_raw.json devhub.page.dashboard commit_raw.json devhub.page.devdaoDashboard commit_raw.json devhub.page.feed commit_raw.json devhub.page.home commit_raw.json devhub.page.post commit_raw.json devhub.page.profile commit_raw.json devhub.page.proposals commit_raw.json devhub.page.trustees.approvals commit_raw.json devhub.page.trustees.index commit_raw.json devhub.page.trustees.login commit_raw.json devhub.page.trustees commit_raw.json education commit_raw.json home commit_raw.json includes.common commit_raw.json index commit_raw.json marketing commit_raw.json multisigSDK commit_raw.json near-prpsls-bos.components.molecule.DropDown commit_raw.json near-prpsls-bos.components.molecule.MultiSelectCategoryDropdown commit_raw.json near-prpsls-bos.components.molecule.NavbarDropdown commit_raw.json near-prpsls-bos.components.molecule.ProposalSearchDropdown commit_raw.json near-prpsls-bos.components.molecule.RadioButton commit_raw.json near-prpsls-bos.components.organism.Navbar commit_raw.json near-prpsls-bos.components.pages.about commit_raw.json near-prpsls-bos.components.pages.admin commit_raw.json near-prpsls-bos.components.pages.app commit_raw.json near-prpsls-bos.components.proposals.Editor commit_raw.json near-prpsls-bos.components.proposals.Feed commit_raw.json near-prpsls-bos.components.proposals.Proposal commit_raw.json near-prpsls-bos.components.rfps.CommentsAndLogs commit_raw.json near-prpsls-bos.components.rfps.ConfirmCancelModal commit_raw.json near-prpsls-bos.components.rfps.Editor commit_raw.json near-prpsls-bos.components.rfps.Feed commit_raw.json near-prpsls-bos.components.rfps.Rfp commit_raw.json near-prpsls-bos.components.rfps.StageDropdown commit_raw.json near-prpsls-bos.components.rfps.StatusTag commit_raw.json near-prpsls-bos.components.rfps.TimelineConfigurator commit_raw.json near-prpsls-bos.components.template.AppLayout commit_raw.json neardevhub-trustees.components.moderator.Accounting commit_raw.json neardevhub-trustees.components.moderator.CreatePaymentRequest commit_raw.json neardevhub-trustees.components.moderator.CreateRecipient commit_raw.json neardevhub-trustees.components.moderator.Dashboard commit_raw.json neardevhub-trustees.components.moderator.ManageRecipients commit_raw.json neardevhub-trustees.components.moderator.Staking commit_raw.json neardevhub-trustees.components.molecule.DropDownWithSearch commit_raw.json neardevhub-trustees.components.molecule.Pagination commit_raw.json neardevhub-trustees.components.molecule.TokenAmount commit_raw.json neardevhub-trustees.components.organism.Footer commit_raw.json neardevhub-trustees.components.organism.Navbar commit_raw.json neardevhub-trustees.components.pages.app commit_raw.json neardevhub-trustees.components.trustee.Approvals commit_raw.json neardevhub-trustees.components.trustee.Dashboard commit_raw.json neardevhub-trustees.components.trustee.History commit_raw.json neardevhub-trustees.components.trustee.Login commit_raw.json neardevhub-trustees.components.trustee.Treasury commit_raw.json partnerships commit_raw.json styles commit_raw.json swap commit_raw.json check user permissions\n const proposalKinds = {\n ChangeConfig: \"config\",\n ChangePolicy: \"policy\",\n AddMemberToRole: \"add_member_to_role\",\n RemoveMemberFromRole: \"remove_member_from_role\",\n FunctionCall: isCongressDaoID ? \"FunctionCall\" : \"call\",\n UpgradeSelf: \"upgrade_self\",\n UpgradeRemote: \"upgrade_remote\",\n Transfer: \"transfer\",\n SetStakingContract: \"set_vote_token\",\n AddBounty: \"add_bounty\",\n BountyDone: \"bounty_done\",\n Vote: \"vote\",\n FactoryInfoUpdate: \"factory_info_update\",\n ChangePolicyAddOrUpdateRole: \"policy_add_or_update_role\",\n ChangePolicyRemoveRole: \"policy_remove_role\",\n ChangePolicyUpdateDefaultVotePolicy:\n \"policy_update_default_vote_policy\",\n ChangePolicyUpdateParameters: \"policy_update_parameters\",\n Text: \"Text\",\n FundingRequest: \"FundingRequest\",\n RecurrentFundingRequest: \"RecurrentFundingRequest\",\n DismissAndBan: \"DismissAndBan\"\n };\n\n const actions = {\n AddProposal: \"AddProposal\",\n VoteApprove: \"VoteApprove\",\n VoteReject: \"VoteReject\",\n VoteRemove: \"VoteRemove\",\n VoteAbstain: \"VoteAbstain\"\n };\n\n -- Get all the roles from the DAO policy\n roles = roles === null ? [] : roles?.roles ?? roles;\n\n -- Filter the user roles\n const userRoles = [];\n if (Array.isArray(roles)) {\n for (const role of roles) {\n if (role.kind === \"Everyone\") {\n userRoles.push(role);\n continue;\n }\n if (!role.kind.Group) continue;\n if (\n accountId &&\n role.kind.Group &&\n role.kind.Group.includes(accountId)\n ) {\n userRoles.push(role);\n }\n }\n }\n\n if (isCongressDaoID) {\n userRoles = [\n {\n name: \"all\",\n kind: \"Everyone\",\n permissions: roles?.permissions,\n vote_policy: {}\n }\n ];\n }\n\n if (isVotingBodyDao) {\n userRoles = [\n {\n name: \"all\",\n kind: \"Everyone\",\n permissions: {},\n vote_policy: {}\n }\n ];\n }\n\n const isAllowedTo = (kind, action) => {\n -- Check if the user is allowed to perform the action\n let allowed = false;\n userRoles\n .filter(({ permissions }) => {\n if (isCongressDaoID) {\n const allowedRole =\n permissions.includes(`${kind.toString()}`) &&\n roles?.members?.includes(accountId);\n allowed = allowed || allowedRole;\n return allowedRole;\n } else {\n const allowedRole =\n permissions.includes(\n `${kind.toString()}:${action.toString()}`\n ) ||\n permissions.includes(`${kind.toString()}:*`) ||\n permissions.includes(`*:${action.toString()}`) ||\n permissions.includes(\"*:*\");\n allowed = allowed || allowedRole;\n return allowedRole;\n }\n })\n .map((role) => role.name);\n return allowed;\n };\n\n const kindName =\n typeof my_proposal.kind === \"string\"\n ? my_proposal.kind\n : isCongressDaoID || isVotingBodyDao\n ? Object.keys(my_proposal.kind)[0]\n : typeof my_proposal.kind.typeEnum === \"string\"\n ? my_proposal.kind.typeEnum\n : Object.keys(my_proposal.kind)[0];\n\n const isAllowedToVote = isVotingBodyDao\n ? [isHuman, isHuman, isHuman, isHuman]\n : [\n isAllowedTo(proposalKinds[kindName], actions.VoteApprove),\n isAllowedTo(proposalKinds[kindName], actions.VoteReject),\n isCongressDaoID\n ? isAllowedTo(proposalKinds[kindName], actions.VoteAbstain)\n : isAllowedTo(proposalKinds[kindName], actions.VoteRemove)\n ];\n\n Votes required:\n TODO: Needs to be reviewed\n\n Fixes pikespeak API for single proposal\n Object.keys(my_proposal.vote_counts).forEach((k) => {\n if (typeof my_proposal.vote_counts[k] !== \"string\") return;\n my_proposal.vote_counts[k] = my_proposal.vote_counts[k]\n .match( .{1,2} g)\n .slice(0, 3)\n .map((a) => parseInt(a));\n });\n\n let totalVotesNeeded = 0;\n\n if (policy?.roles) {\n policy.roles.forEach((role) => {\n Determine if the role is eligible for the given proposalType\n const isRoleAllowedToVote =\n role.permissions.includes(\n `${proposalKinds[kindName]}:VoteApprove`\n ) ||\n role.permissions.includes(\n `${proposalKinds[kindName]}:VoteReject`\n ) ||\n role.permissions.includes(`${proposalKinds[kindName]}:*`) ||\n role.permissions.includes(`*:VoteApprove`) ||\n role.permissions.includes(`*:VoteReject`) ||\n role.permissions.includes(\"*:*\");\n\n if (isRoleAllowedToVote) {\n const threshold = (role.vote_policy &&\n role.vote_policy[proposalKinds[kindName]]?.threshold) ||\n policy[\"default_vote_policy\"]?.threshold || [0, 0];\n const eligibleVoters = role.kind.Group\n ? role.kind.Group.length\n : 0;\n\n Apply the threshold\n if (eligibleVoters === 0) {\n return;\n }\n const votesNeeded =\n Math.floor((threshold[0] threshold[1]) * eligibleVoters) +\n 1;\n\n totalVotesNeeded += votesNeeded;\n }\n });\n }\n my_proposal.typeName = kindName.replace( ([A-Z]) g, \" $1\").trim(); Add spaces between camelCase\n if (isCongressDaoID) {\n totalVotesNeeded = daoConfig?.threshold;\n }\n\n if (isVotingBodyDao) {\n if (my_proposal.typeName === \"Dissolve\") {\n totalVotesNeeded = daoConfig?.super_consent?.quorum;\n } else if (my_proposal.typeName === \"Pre Vote\") {\n totalVotesNeeded = daoConfig?.pre_vote_support;\n } else {\n totalVotesNeeded = daoConfig?.simple_consent?.quorum;\n }\n }\n\n let totalVotes = {\n yes: 0,\n no: 0,\n spam: 0,\n abstain: 0,\n total: 0\n };\n\n Object.keys(my_proposal.vote_counts).forEach((key) => {\n if (key === \"all\") return;\n totalVotes.yes += my_proposal.vote_counts[key][0];\n totalVotes.no += my_proposal.vote_counts[key][1];\n totalVotes.spam += my_proposal.vote_counts[key][2];\n });\n\n if (isVotingBodyDao) {\n totalVotes.yes = my_proposal?.approve ?? 0;\n totalVotes.no = my_proposal?.reject ?? 0;\n totalVotes.abstain = my_proposal?.abstain ?? 0;\n totalVotes.spam = my_proposal?.spam ?? 0;\n }\n\n if (isCongressDaoID) {\n for (const { vote } of Object.values(my_proposal.votes)) {\n if (vote === \"Approve\") {\n totalVotes.yes++;\n } else if (vote === \"Reject\") {\n totalVotes.no++;\n } else if (vote === \"Abstain\") {\n totalVotes.abstain++;\n } else if (vote === \"Spam\") {\n totalVotes.spam++;\n }\n }\n }\n totalVotes.total =\n totalVotes.yes + totalVotes.no + totalVotes.spam + totalVotes.abstain;\n\n if (my_proposal.status === \"PreVote\") {\n totalVotes.total = my_proposal?.support ?? 0;\n }\n\n my_proposal.totalVotesNeeded = totalVotesNeeded;\n my_proposal.totalVotes = totalVotes;\n check user permissions\nconst proposalKinds = {\n ChangeConfig: \"config\",\n ChangePolicy: \"policy\",\n AddMemberToRole: \"add_member_to_role\",\n RemoveMemberFromRole: \"remove_member_from_role\",\n FunctionCall: isCongressDaoID ? \"FunctionCall\" : \"call\",\n UpgradeSelf: \"upgrade_self\",\n UpgradeRemote: \"upgrade_remote\",\n Transfer: \"transfer\",\n SetStakingContract: \"set_vote_token\",\n AddBounty: \"add_bounty\",\n BountyDone: \"bounty_done\",\n Vote: \"vote\",\n FactoryInfoUpdate: \"factory_info_update\",\n ChangePolicyAddOrUpdateRole: \"policy_add_or_update_role\",\n ChangePolicyRemoveRole: \"policy_remove_role\",\n ChangePolicyUpdateDefaultVotePolicy: \"policy_update_default_vote_policy\",\n ChangePolicyUpdateParameters: \"policy_update_parameters\",\n Text: \"Text\",\n FundingRequest: \"FundingRequest\",\n RecurrentFundingRequest: \"RecurrentFundingRequest\",\n DismissAndBan: \"DismissAndBan\"\n};\n\nconst actions = {\n AddProposal: \"AddProposal\",\n VoteApprove: \"VoteApprove\",\n VoteReject: \"VoteReject\",\n VoteRemove: \"VoteRemove\",\n VoteAbstain: \"VoteAbstain\"\n};\n\nconst kindName =\n typeof proposal.kind === \"string\"\n ? proposal.kind\n : isCongressDaoID || isVotingBodyDao\n ? Object.keys(proposal.kind)?.[0]\n : typeof proposal.kind.typeEnum === \"string\"\n ? proposal.kind.typeEnum\n : Object.keys(proposal.kind)[0];\n\nconst isAllowedToVote = isVotingBodyDao\n ? [isHuman, isHuman, isHuman, isHuman]\n : [\n isAllowedTo(proposalKinds[kindName], actions.VoteApprove),\n isAllowedTo(proposalKinds[kindName], actions.VoteReject),\n isCongressDaoID\n ? isAllowedTo(proposalKinds[kindName], actions.VoteAbstain)\n : isAllowedTo(proposalKinds[kindName], actions.VoteRemove)\n ];\n\n memeat.near da-calculator commit_raw.json memegen.near Index commit_raw.json Memegen commit_raw.json memelol.near lol.App commit_raw.json lol.Components.Button commit_raw.json lol.Components.Confetti commit_raw.json lol.Components.Countdown commit_raw.json lol.Components.FAQ commit_raw.json lol.Components.Footer commit_raw.json lol.Components.Leaderboard commit_raw.json lol.Components.MintBox commit_raw.json lol.Components.Modal commit_raw.json lol.Components.MyStats commit_raw.json lol.Components.MyTradingStats commit_raw.json lol.Components.Navigation commit_raw.json lol.Components.Snow commit_raw.json lol.Components.Switch commit_raw.json lol.Config commit_raw.json lol.Layouts.App commit_raw.json lol.Pages.Home commit_raw.json lol.Pages.Mint commit_raw.json lol.Pages.Profile commit_raw.json lol.Pages.Puzzle commit_raw.json lol.Utils commit_raw.json memesforgood.near Index commit_raw.json app commit_raw.json memiko.near mem.App commit_raw.json mem.Components.Countdown commit_raw.json mem.Components.Footer commit_raw.json mem.Components.OpenPack commit_raw.json mem.Config commit_raw.json mem.Layouts.App commit_raw.json mem.Pages.Index commit_raw.json meold.near Draft-0 commit_raw.json Patron-Proposal commit_raw.json merdus.near chat commit_raw.json friend.tech-explorer commit_raw.json meta-pool-official.near Common.Button commit_raw.json Common.CommentButton commit_raw.json Common.Inputs.Text commit_raw.json Common.Inputs.TextArea commit_raw.json Common.Modal.RedirectModal commit_raw.json Draft-0 commit_raw.json Governance.Balance commit_raw.json Governance.Comment.Compose commit_raw.json Governance.Comment.Feed commit_raw.json Governance.Comment.Index commit_raw.json Governance.Comment.ManualIndexFeed commit_raw.json Governance.Dashboard commit_raw.json Governance.Index commit_raw.json Governance.Metric.Card commit_raw.json Governance.Proposal.Create.Index commit_raw.json Governance.Proposal.Create.Text commit_raw.json Governance.Proposal.DiscussionCard commit_raw.json Governance.Proposal.Index commit_raw.json Governance.Proposal.VoteCard commit_raw.json Governance.Proposal.VotesCard commit_raw.json Governance.Proposal.VotingPeriodCard commit_raw.json Governance.Proposal.VotingResultsCard commit_raw.json Governance.Proposals commit_raw.json Governance.ProposalsTable commit_raw.json Governance.TabSelector commit_raw.json Governance.Voters commit_raw.json Governance.Votes commit_raw.json ImprovementProposals.Dashboard commit_raw.json ImprovementProposals.Proposal.Create.Index commit_raw.json ImprovementProposals.Proposal.Create.Text commit_raw.json ImprovementProposals.Proposal.Index commit_raw.json ImprovementProposals.Proposals commit_raw.json ImprovementProposals.ProposalsTable commit_raw.json ImprovementProposals commit_raw.json MetaPoolStake.Common.Button commit_raw.json MetaPoolStake.Common.Input commit_raw.json MetaPoolStake.Common.Popup.Button commit_raw.json MetaPoolStake.Common.Popup.Index commit_raw.json MetaPoolStake.Common.Title commit_raw.json MetaPoolStake.Common.YouWillGet commit_raw.json MetaPoolStake.Container commit_raw.json MetaPoolStake.Logo commit_raw.json MetaPoolStake.Near.DelayUnstake commit_raw.json MetaPoolStake.Near.FastUnstake commit_raw.json MetaPoolStake.Near.Form commit_raw.json MetaPoolStake.Near.Stake commit_raw.json MetaPoolStake.Near.wNEAR commit_raw.json MetaPoolStake.Near commit_raw.json MetaPoolStake.wNear.FastUnstake commit_raw.json MetaPoolStake.wNear.Form commit_raw.json MetaPoolStake.wNear.Stake commit_raw.json MetaPoolStake.wNear commit_raw.json MetaPoolStake commit_raw.json MetaPoolStakeEth.Title commit_raw.json MetaPoolStakeEth commit_raw.json MetaStakingVote commit_raw.json metachill.near ValidatorStakingVoteAction commit_raw.json metaflow.near Button1 commit_raw.json Chat-met-Widget commit_raw.json Linear commit_raw.json Magic-Build--Test2 commit_raw.json MagicBuild-Test commit_raw.json MagicBuild-linear-protocol.near commit_raw.json MagicBuild-test commit_raw.json MagicBuild-widget-form-1697212442186 commit_raw.json MagicBuild-widget-form-1698904864087 commit_raw.json MagicBuilder-widget-form-1697100484633 commit_raw.json MagicBuilder-widget-form-1697102091908 commit_raw.json MagicBuilder-widget-form-1697162908214 commit_raw.json metameech.near MetaMeechMarketplace commit_raw.json nft-marketplace commit_raw.json meteor-vik.near abi2form-example commit_raw.json meximalist.near Linktree commit_raw.json MysteryBox commit_raw.json Notepad commit_raw.json mgamuch.tg New-Draft-0 commit_raw.json mhasheem.near Mhasheem commit_raw.json michael-pagoda.near Genie commit_raw.json PublishTest commit_raw.json PublishTest2 commit_raw.json michaelpeter.near Applications commit_raw.json Demo commit_raw.json Drafter commit_raw.json DummyImage commit_raw.json FollowActivity commit_raw.json FollowItem commit_raw.json Genie commit_raw.json GenieAnswerList commit_raw.json GenieAnswerSubmit commit_raw.json GenieAnswerView commit_raw.json GenieAnswerVote commit_raw.json GenieQuestionAnswerView commit_raw.json GenieQuestionList commit_raw.json GenieQuestionView commit_raw.json GenieSaveQuestion commit_raw.json GenieTip commit_raw.json HelloWorld commit_raw.json IndexFeed commit_raw.json IpfsGatewayViewer commit_raw.json LinkElemTest commit_raw.json LinkOuts commit_raw.json LinkTest commit_raw.json ModalTest commit_raw.json Moderate commit_raw.json NestParent commit_raw.json ParamTest commit_raw.json People commit_raw.json PokeActivity commit_raw.json PokeItem commit_raw.json Posts.Feed commit_raw.json PreactTest commit_raw.json PrivateStorageTest commit_raw.json PrivateStorageVersions commit_raw.json ProfileHeader commit_raw.json PropTaker commit_raw.json PureWidget commit_raw.json QuestionList commit_raw.json SandOne commit_raw.json Sandbox commit_raw.json SandpackWidget commit_raw.json SaveQuestion commit_raw.json SearchAndResults commit_raw.json TOS-Draft commit_raw.json TailwindTest commit_raw.json TestChildWidget commit_raw.json TestParentWidget commit_raw.json TosCheck commit_raw.json TosCheckDraft commit_raw.json TosContentDraft commit_raw.json ViewQuestion commit_raw.json michiga.near Everything.Create.Document commit_raw.json Everything.Summary.Document commit_raw.json Everything.View.Document commit_raw.json michsoftsterv2.near MetaTandaCreation commit_raw.json microchipgnu.near 3D.Cube commit_raw.json AI.Agent.AgentChat commit_raw.json AccountAvailability commit_raw.json Agent commit_raw.json CheckAccountsAvailable commit_raw.json DeployGateway commit_raw.json Experiments.KeyframesAnimation commit_raw.json Game.FlappyBOS commit_raw.json GrantPermissions commit_raw.json ImageEditorTabs commit_raw.json JustListedThis.Compose commit_raw.json ListFromCollection commit_raw.json Memo commit_raw.json MultipleAgents commit_raw.json NFT.Selector commit_raw.json NFT commit_raw.json NFT?contractId=hellovirtualworld.mintbase1.near&tokenId=1 commit_raw.json NearMail commit_raw.json PostShortcut commit_raw.json PoweredByMintbase commit_raw.json PriceOracle.NearPrices commit_raw.json TailwindTest commit_raw.json TemperatureAgents commit_raw.json Tools commit_raw.json TotalAccountsRegistered commit_raw.json Untitled-0 commit_raw.json WeatherAgents commit_raw.json WebXR-Demo-Vision-Pro commit_raw.json bookmark commit_raw.json camera commit_raw.json minsta commit_raw.json nft-marketplace commit_raw.json unsplash commit_raw.json midamado.near Untitled-0 commit_raw.json mikaosadim.near second-trial commit_raw.json mike-sz.near FetchNFTfrom commit_raw.json Inputs.Text commit_raw.json NftCollection commit_raw.json NftCollectionThumbs commit_raw.json NftImage commit_raw.json Untitled-0 commit_raw.json mike.near Index commit_raw.json MainPage.N.Compose commit_raw.json NearLogo2024White commit_raw.json ProgressBar commit_raw.json StakingPools commit_raw.json StakingUI.Debug commit_raw.json StakingUI.getValidators.Main commit_raw.json StakingUI.getValidators commit_raw.json StakingUI commit_raw.json bos-showcase-mike commit_raw.json jan24 commit_raw.json mikenoel.near Greet commit_raw.json Untitled-0 commit_raw.json mikeyc.near 5Star commit_raw.json mil_lesya.near Hello commit_raw.json UnrealEnginePlugin commit_raw.json milanhakaj.near Untitled-0 commit_raw.json milanjovanovic.near Untitled-0 commit_raw.json milenix.near Another commit_raw.json NewWidget commit_raw.json TestWidget commit_raw.json millefolium.near Profile commit_raw.json ProfilePage commit_raw.json millyrodriguez.near home commit_raw.json milosj.near Untitled-0 commit_raw.json minamoto.near MON_component commit_raw.json minimee.near WeAreDevsStatusBoard commit_raw.json minorityprogrammers.near Archives.Paris.Submission.odx commit_raw.json BOSHacks commit_raw.json BOSInfluencers commit_raw.json DAOComponents commit_raw.json ETH_connect commit_raw.json GatewayDirectoryHero commit_raw.json GenaDropMultiListing commit_raw.json IAH-Gate commit_raw.json Influencers.widgets commit_raw.json NEARBalance commit_raw.json NFTSelector commit_raw.json NFTWidgets commit_raw.json NFT_gallery commit_raw.json Paymaster.form commit_raw.json RainbowBridge commit_raw.json RainbowBridgeWNEAR commit_raw.json Untitled-0 commit_raw.json build.badgeAggregator commit_raw.json build.followersList commit_raw.json build.profilePreview commit_raw.json canny.comment.edit commit_raw.json canny.comment.feed commit_raw.json canny.comment.main commit_raw.json canny.comment.repliesButton commit_raw.json canny.features commit_raw.json canny.header commit_raw.json canny.main commit_raw.json canny.post.details commit_raw.json canny.post.labels commit_raw.json canny.post.page commit_raw.json canny.post.preview commit_raw.json canny.post commit_raw.json edu.question.preview commit_raw.json edu.question commit_raw.json genadropExplore commit_raw.json genadropMinter commit_raw.json isNEARAddress commit_raw.json mintbase.near minsta commit_raw.json near-apac-minsta commit_raw.json nft-marketplace commit_raw.json mintickt.near minsta commit_raw.json mintlu.near ComponentCard-IAH commit_raw.json ComponentCollection-IAH commit_raw.json Keypom-Drop-Viewer commit_raw.json Min.Test.DAOs.Profile.Editor commit_raw.json ProfilePage-IAH commit_raw.json ProfilePage.Sidebar-IAH commit_raw.json all-my-drops commit_raw.json drop-info commit_raw.json kp-ticket-about commit_raw.json kp-ticket-creator commit_raw.json kp-ticket-handler commit_raw.json kp-ticket-homepage commit_raw.json kp-ticket2 commit_raw.json kp-withdraw commit_raw.json view-number-of-keypom-drops commit_raw.json minz.near ActivitiesHomePageButton commit_raw.json AllActivities commit_raw.json CreateActivity commit_raw.json EventPlanner commit_raw.json JoinedActivities commit_raw.json JoinedEvents commit_raw.json MyActivities commit_raw.json OwnedActivities commit_raw.json ViewActivity commit_raw.json miraclx.near Attribution commit_raw.json Draft-0 commit_raw.json FontAwesome commit_raw.json NearSocialResearch commit_raw.json Scribbles commit_raw.json TabTest commit_raw.json Web6 commit_raw.json Web6LeaderBoard commit_raw.json WebSocketDemo commit_raw.json YouTubeVideo commit_raw.json miroslaw.near zkQuest commit_raw.json mishadv.near MailchainProfilePage commit_raw.json ProfilePage commit_raw.json mishatheking.near TicTacToe commit_raw.json tictactoe-game commit_raw.json mishih.near MyFirsWidget commit_raw.json ReputLanding commit_raw.json ReputeAbout commit_raw.json ReputeHeader commit_raw.json ReputeLanding commit_raw.json ReputeOffers commit_raw.json mynyc.dao commit_raw.json nyc.dao commit_raw.json mitchyugan.near EthereumWallet-NEARWallet commit_raw.json First-component commit_raw.json ImageUploader commit_raw.json LinkETHAccountsToNearAccount.ConnectWallet commit_raw.json LinkETHAccountsToNearAccount.ConnectedAccount commit_raw.json LinkETHAccountsToNearAccount.Home commit_raw.json LinkETHAccountsToNearAccount.LandingPage commit_raw.json LinkETHAccountsToNearAccount.Navbar commit_raw.json NftArtistPollWebApp commit_raw.json Untitled-0 commit_raw.json mklaic.near Untitled-0 commit_raw.json mm-near.near v00 commit_raw.json zkQuest commit_raw.json zkQuestDev commit_raw.json zkSyncExp commit_raw.json mob.near AccountAutocomplete commit_raw.json Actions.Action commit_raw.json Actions commit_raw.json ActionsInner commit_raw.json ActivityFeed commit_raw.json AddMeme commit_raw.json AllLabels commit_raw.json AllProfileCircles commit_raw.json AllProfiles commit_raw.json AllProfilesImages commit_raw.json AllProfilesWithNFT commit_raw.json AllProfilesWithTags commit_raw.json AllProfilesWithTwitter commit_raw.json AllWidgets commit_raw.json ApplicationCard commit_raw.json Applications commit_raw.json AppsTbd commit_raw.json AppsTbdHor commit_raw.json Arsenal commit_raw.json BerryDraw commit_raw.json BerryclubBoard commit_raw.json BerryclubFeed commit_raw.json BerryclubHistory commit_raw.json CheckedHelloAccountId commit_raw.json Checkmark commit_raw.json ClaimDoubledog commit_raw.json Cleanup commit_raw.json CommentButton commit_raw.json Common.Compose commit_raw.json Component.InlineBlock commit_raw.json ComponentSearch.Item commit_raw.json ComponentSearch commit_raw.json CopyButton commit_raw.json DAO.Main commit_raw.json DAO.Proposal commit_raw.json DAO.Proposals commit_raw.json DonateToTheWiki commit_raw.json Editor.ComponentSearch.Item commit_raw.json Editor.ComponentSearch commit_raw.json Everyone commit_raw.json Explorer commit_raw.json FilteredIndexFeed commit_raw.json Flagged.Feed commit_raw.json FollowButton commit_raw.json FollowFeed commit_raw.json FollowPage commit_raw.json FollowStats commit_raw.json FollowTabs commit_raw.json FollowersList commit_raw.json FollowingList commit_raw.json FollowsYouBadge commit_raw.json FontDemo commit_raw.json FunctionComponentDemo commit_raw.json Hashtag.Feed commit_raw.json Hashtag.N.Feed commit_raw.json HelloAccountId commit_raw.json HelloAccountIdHeader commit_raw.json HelloUsername commit_raw.json HelloWorld commit_raw.json Homepage commit_raw.json HomepageEditor commit_raw.json Icon.Fractal commit_raw.json Icon.Garden commit_raw.json Icon.Room commit_raw.json Icon.SpongeBob commit_raw.json Image.Feed commit_raw.json Image commit_raw.json ImageEditor commit_raw.json ImageEditorTabs commit_raw.json Index commit_raw.json IndexFeed commit_raw.json Insta.Compose commit_raw.json Insta.Feed commit_raw.json Insta.Main commit_raw.json Insta.Post.Page commit_raw.json Insta.Post commit_raw.json ItemFeed commit_raw.json ItemFeed2 commit_raw.json LastProfilesImages commit_raw.json LastWidgets commit_raw.json LastWidgetsByTag commit_raw.json LikeButton.Faces commit_raw.json LikeButton commit_raw.json LinkTree commit_raw.json LinkTreeEditor commit_raw.json MagicDemo commit_raw.json MainPage.Comment.Compose commit_raw.json MainPage.Comment.Feed commit_raw.json MainPage.Comment.Page commit_raw.json MainPage.Comment.Post commit_raw.json MainPage.Comment commit_raw.json MainPage.Common.BlockAccount commit_raw.json MainPage.Common.FlagContent commit_raw.json MainPage.Common.HideAccount commit_raw.json MainPage.Compose commit_raw.json MainPage.Content commit_raw.json MainPage.FeaturedApps commit_raw.json MainPage.Feed.Beta commit_raw.json MainPage.Feed commit_raw.json MainPage.N.Comment.Compose commit_raw.json MainPage.N.Comment.Feed commit_raw.json MainPage.N.Comment.Full commit_raw.json MainPage.N.Comment.Page commit_raw.json MainPage.N.Comment.Post commit_raw.json MainPage.N.Comment commit_raw.json MainPage.N.Common.Compose commit_raw.json MainPage.N.Compose commit_raw.json MainPage.N.Content commit_raw.json MainPage.N.Feed commit_raw.json MainPage.N.Post.Content.Image commit_raw.json MainPage.N.Post.Content commit_raw.json MainPage.N.Post.Embed commit_raw.json MainPage.N.Post.Header commit_raw.json MainPage.N.Post.Left commit_raw.json MainPage.N.Post.Page commit_raw.json MainPage.N.Post.ShareButton commit_raw.json MainPage.N.Post commit_raw.json MainPage.Post.Content commit_raw.json MainPage.Post.Header commit_raw.json MainPage.Post.Page commit_raw.json MainPage.Post.ShareButton commit_raw.json MainPage.Post commit_raw.json MainPage commit_raw.json MainnetStatus commit_raw.json ManualIndexFeed commit_raw.json MarkdownEditorDemo commit_raw.json MarkdownEditorIframe commit_raw.json MarkdownEditorIframeExample commit_raw.json Meme commit_raw.json Memes commit_raw.json MergedIndexFeed commit_raw.json MetadataEditor commit_raw.json Module.Magic commit_raw.json MooClicker commit_raw.json MyPage commit_raw.json MyPageEditor commit_raw.json N.CommentButton commit_raw.json N.Common.OverlayTrigger commit_raw.json N.Embed commit_raw.json N.GifSearch commit_raw.json N.Group.Header commit_raw.json N.Group.NotMemberCompose commit_raw.json N.Group commit_raw.json N.Homepage commit_raw.json N.Library commit_raw.json N.Lightbox commit_raw.json N.LikeButton commit_raw.json N.NftCollection commit_raw.json N.NotPremiumCompose commit_raw.json N.Overlay.Faces commit_raw.json N.ProfileLine commit_raw.json N.ProfileOnboarding commit_raw.json N.RepostButton commit_raw.json N.SocialMarkdown commit_raw.json N.StarButton commit_raw.json N.YourNFTs commit_raw.json N commit_raw.json NFT.Inner commit_raw.json NFT commit_raw.json Near.AI commit_raw.json Near.FM.Edit commit_raw.json Near.FM.Header commit_raw.json Near.FM.Remote.Missing commit_raw.json Near.FM.Remote.NonPremium commit_raw.json Near.FM.Remote commit_raw.json Near.FM commit_raw.json Neddit.Comment.Compose commit_raw.json Neddit.Comment.Feed commit_raw.json Neddit.Comment.Page commit_raw.json Neddit.Comment commit_raw.json Neddit.Common.Header commit_raw.json Neddit.Compose commit_raw.json Neddit.Post.Page commit_raw.json Neddit.Post commit_raw.json Neddit.Subneddit.Selector commit_raw.json Neddit commit_raw.json NftCollection commit_raw.json NftCollectionThumbs commit_raw.json NftImage commit_raw.json NftImage2 commit_raw.json NoLikesDemo commit_raw.json Notepad commit_raw.json Notification.Item.Comment commit_raw.json Notification.Item.DevGov commit_raw.json Notification.Item.Follow commit_raw.json Notification.Item.LR commit_raw.json Notification.Item.Like commit_raw.json Notification.Item.Mention commit_raw.json Notification.Item.Poke commit_raw.json Notification.Item.Repost commit_raw.json Notification.Item.Star commit_raw.json Notification.Item commit_raw.json NotificationButton commit_raw.json NotificationFeed commit_raw.json People commit_raw.json PokeButton commit_raw.json PokeFeed commit_raw.json Profile.Hover commit_raw.json Profile.InlineBlock commit_raw.json Profile.N.OverlayTrigger commit_raw.json Profile.OverlayTrigger commit_raw.json Profile.Popover commit_raw.json Profile.ShortInlineBlock commit_raw.json Profile commit_raw.json ProfileCircle commit_raw.json ProfileDocsExample commit_raw.json ProfileEditor commit_raw.json ProfileEditorBeta commit_raw.json ProfileImage commit_raw.json ProfileLarge commit_raw.json ProfileLine commit_raw.json ProfileOnboarding commit_raw.json ProfilePage commit_raw.json ProfilePageBeta commit_raw.json ProfilePageExample commit_raw.json ProfileSearch commit_raw.json ProfileTabs commit_raw.json PublicTagEditor commit_raw.json PublicTags commit_raw.json Range commit_raw.json RemoteCode commit_raw.json RepostButton commit_raw.json SocialMarkdown commit_raw.json SpyMailbox commit_raw.json SpyOnThem commit_raw.json SpySentbox commit_raw.json StarredApps commit_raw.json StorageGetDemo commit_raw.json TagsEditor commit_raw.json Test.Context.WidgetSrc commit_raw.json TimeAgo commit_raw.json TimeAgoMs commit_raw.json Token.utils commit_raw.json Tokens.AccountWithBalance commit_raw.json Tokens.Inner commit_raw.json Tokens.Token commit_raw.json Tokens.TokenWithBalance commit_raw.json Tokens.Top.Inner commit_raw.json Tokens.Top commit_raw.json Tokens commit_raw.json UseStateDemo commit_raw.json ValueDiff commit_raw.json VotersGraph commit_raw.json WebSocketEvents commit_raw.json Welcome.FollowFeed commit_raw.json Welcome.GetInvolved commit_raw.json Welcome.N commit_raw.json Welcome.Notifications commit_raw.json Welcome.PokeFeed commit_raw.json Welcome.Profile commit_raw.json Welcome.RHS.Editor.ComponentSearch.Item commit_raw.json Welcome.RHS.Editor.ComponentSearch commit_raw.json Welcome.RHS.Editor commit_raw.json Welcome.RHS commit_raw.json Welcome commit_raw.json Welcome2 commit_raw.json WidgetCodeDiff commit_raw.json WidgetDependencies commit_raw.json WidgetHistory commit_raw.json WidgetIcons commit_raw.json WidgetImage commit_raw.json WidgetMetadata commit_raw.json WidgetMetadataEditor commit_raw.json WidgetSource commit_raw.json Widgets commit_raw.json YourNFTs commit_raw.json YourWidgets commit_raw.json call1 commit_raw.json mob.near widget NftCollection commit_raw.json modia.near WeAreDevsStatusBoard commit_raw.json mohaa.near Home commit_raw.json create commit_raw.json home commit_raw.json mintNFT commit_raw.json profile commit_raw.json mohammadhs.near First commit_raw.json NearGithubActivities commit_raw.json NearGithubActivityActiveDevelopers commit_raw.json NearGithubActivityPullReqs commit_raw.json NearGithubActivityRepositories commit_raw.json NearGithubActivityTotalOverall commit_raw.json SingleNumbers commit_raw.json monkeydu.near Untitled-1 commit_raw.json WallOfFame commit_raw.json monkeymage.near LuckyGem commit_raw.json Test1 commit_raw.json monkeypatcher.near App.DevForm commit_raw.json App.DevFormComponent commit_raw.json App.DevFormView commit_raw.json App.DevResultGraph commit_raw.json App.DevResultPage commit_raw.json App.DevResultText commit_raw.json App.Footer commit_raw.json App.Header commit_raw.json App.Landing commit_raw.json App.Main commit_raw.json App.ProviderForm commit_raw.json App.ProviderFormView commit_raw.json App.ProviderResultPage commit_raw.json HelloWorld commit_raw.json RootContent commit_raw.json scc commit_raw.json monsterkiller.near Calendar commit_raw.json monsters-bos.near ProfileImage commit_raw.json header commit_raw.json index commit_raw.json inventory commit_raw.json openPack commit_raw.json purchase commit_raw.json test commit_raw.json mooob.near NumUniqueDevs commit_raw.json morgs.near AnalyticsConsumerRegistration commit_raw.json Untitled-0-fork-fork-fork-fork-fork-fork commit_raw.json Untitled-0-fork-fork-fork-fork-fork commit_raw.json Untitled-0-fork-fork-fork-fork commit_raw.json Untitled-0-fork-fork-fork commit_raw.json Untitled-0-fork-fork commit_raw.json Untitled-0-fork commit_raw.json Untitled-0 commit_raw.json Untitled-1-fork-fork-fork-fork-fork-fork-fork-fork-fork-fork-fork-fork commit_raw.json Untitled-1-fork-fork-fork-fork-fork-fork-fork-fork-fork-fork-fork commit_raw.json Untitled-1-fork-fork-fork-fork-fork-fork-fork-fork-fork-fork commit_raw.json Untitled-1-fork-fork-fork-fork-fork-fork-fork-fork-fork commit_raw.json Untitled-1-fork-fork-fork-fork-fork-fork-fork commit_raw.json Untitled-1-fork-fork-fork-fork-fork-fork commit_raw.json Untitled-1-fork-fork-fork-fork-fork commit_raw.json Untitled-1-fork-fork-fork-fork commit_raw.json Untitled-1-fork-fork-fork commit_raw.json Untitled-1-fork-fork commit_raw.json Untitled-1-fork commit_raw.json Untitled-1 commit_raw.json ViewContractAnalytics commit_raw.json morwal.near Untitled-0 commit_raw.json near-india commit_raw.json neari-india commit_raw.json motus_dao.near RegistroPSMS commit_raw.json motzart.near Onboarding.Starter commit_raw.json bn commit_raw.json mpetrov.near ChainAbstract commit_raw.json mphere.near BWE.NewlineBug commit_raw.json BWE.StringRender commit_raw.json DynamicImport commit_raw.json ExtremelyLongComponentName123456789 commit_raw.json LargeComponent commit_raw.json Test2 commit_raw.json mpmain.near BweTest commit_raw.json ComponentHistoryBWE commit_raw.json CostTest commit_raw.json CssTest commit_raw.json HelloWorld commit_raw.json npmchakra commit_raw.json npmrechart commit_raw.json npmsyntax commit_raw.json mpmain1.near LargeComponent commit_raw.json NotificationButton commit_raw.json Untitled-1 commit_raw.json mpmain2.near HelloWorld commit_raw.json VersionTest commit_raw.json VersionTestInner commit_raw.json mr72.near NFT-Aggregator commit_raw.json mr8ce_is.near bos-components.components.ExplorerSelector commit_raw.json mrthkm.near mrthkm.near_e035d508-d814-47e8-83e4-1c14120b3902 commit_raw.json msageer.near DAO.Page commit_raw.json MsageerDAO commit_raw.json mscic.near BlockchainWorkshop commit_raw.json mshakhboz.tg TRS commit_raw.json
Luan1981_Demo_Code_Smart_contract_Rust
Cargo.toml README.md src lib.rs
# Demo code smart contract in Rust
phuc16102001_near-airplane-baggage-checking
Cargo.toml README.md build.sh dev-deploy.sh src baggage.rs fee.rs flight_detail.rs lib.rs types.rs tests tests.rs
# Introduction - Airline baggage checking ## Overview This is a contract designed for the airline baggage checking. It allows the customers to deposit their money and let the airline to delivery their baggages. In the real situation, this may be a complicated process and risky. With smart contract, the process works faster and safer. ## Contract flow In this workflow, we have three different roles: - `Owner`: The one who create contract - `Airline`: The airline company - `Customer`: The user who want to deposit The contract has several steps: - The contract first initialized by the `owner` and set payment to `airline` - `Customer` registry their flight (with `flight_id`, `flight_class` and `distance`) - For each flight, they can check at most 3 baggages (with `baggage_size`) - The system print out the `baggage_id` after checking - Check for the `price` - Accept the `fee` and deposit money to contract - Baggages now are delivering - Finally, the `Customer` claim baggages and the contract will send the money to `airline` > Moreover, `Customer` can check many different attributes such as `flight_class`, their checked `baggages`, etc ## Rules - Only `owner` can `reset` the contract - `Customer` can only check their baggages when they were `registered` - There are three different `flight_classes`, each one has a different `fee` (in NEAR unit) strategy: - `First class`: 2*(total weight, except the heaviest one) - `Business class`: 2*(total weight) - `Economy class`: 2*(total weight + distance) - Each `Customer` in a `flight`, can only have `at most 3 baggages` - Only the `Airline` can call the `deliver_baggage` method - Every operations must follow the workflow (e.g. claim can only operate after delivering) # Folder structure - `baggage.rs`: The structure of a baggage - `fee.rs`: The fee strategy classes (using strategy design pattern) - `flight_detail.rs`: The structure of a flight detail (for each customer) - `types.rs`: Definition of data types - `lib.rs`: The main source code of my contract - `test.rs`: Unit test source # Unit test ```Bash $ cargo test ``` # Manual test ## Compile and build ```Bash $ ./build.sh ``` ## Dev deploy ```Bash $ ./dev-deploy.sh ``` ## Create variables ```Bash $ source 'neardev/dev-account.env' $ export OWNER='phuc16102001.testnet' $ export AIRLINE='phuc16102001.testnet' $ export CUSTOMER='thanhhoang4869.testnet' ``` ## Init contract ```Bash $ near call $CONTRACT_NAME init '{"payment_account":"'$AIRLINE'"}' --accountId $OWNER ``` ## Registry flight ```Bash $ near call $CONTRACT_NAME registry '{"flight_id":1, "flight_class":"First", "distance": 10}' --accountId $CUSTOMER ``` ## Baggage operations ### Add new baggage ```Bash $ near call $CONTRACT_NAME add_baggage '{"flight_id":1,"baggage_weight":4}' --accountId $CUSTOMER ``` ### Remove baggage ```Bash $ near call $CONTRACT_NAME remove_baggage '{"flight_id":1,"baggage_id":0}' --accountId $CUSTOMER ``` ### Remove all baggages ```Bash $ near call $CONTRACT_NAME remove_all_baggages '{"flight_id":1}' --accountId $CUSTOMER ``` ## Check status operations ### Check flight state ```Bash $ near call $CONTRACT_NAME check_state '{"flight_id":1}' --accountId $CUSTOMER ``` ### Check flight class ```Bash $ near call $CONTRACT_NAME check_class '{"flight_id":1}' --accountId $CUSTOMER ``` ### Check the number of current baggages ```Bash $ near call $CONTRACT_NAME check_number_baggages '{"flight_id":1}' --accountId $CUSTOMER ``` ### Check a baggage ```Bash $ near call $CONTRACT_NAME check_baggage '{"flight_id":1, "baggage_id":0}' --accountId $CUSTOMER ``` ### Check fee before depositing ```Bash $ near call $CONTRACT_NAME check_fee '{"flight_id":1}' --accountId $CUSTOMER ``` ## Process operations ### Deposit (accept) ```Bash $ near call $CONTRACT_NAME accept '{"flight_id":1}' --accountId $CUSTOMER --amount 10 ``` ### Delivering baggages ```Bash $ near call $CONTRACT_NAME deliver_baggage '{"flight_id":1, "customer_id": "'$CUSTOMER'"}' --accountId $AIRLINE ``` ### Claim baggages ```Bash $ near call $CONTRACT_NAME claim_baggages '{"flight_id":1}' --accountId $CUSTOMER ``` # Contribution This project was implemented by [phuc16102001](https://github.com/phuc16102001) You can reference from this, but **do not copy** These are the project which I have referenced from: - [Tin Writes Code](https://github.com/tinwritescode) - [Sample lottery](https://github.com/Learn-NEAR/NCD.L1.sample--lottery) - [Meme museum](https://github.com/Learn-NEAR/NCD.L1.sample--meme-museum) - [Cold chain delivery](https://github.com/Learn-NEAR/NCD.L1.sample--cold-chain-delivery)
mashharuki_NearDApp
README.md near-hotel-booking-dapp .gitpod.yml README.md contract Cargo.toml README.md neardev dev-account.env src lib.rs frontend App.js assets css global.css img logo-black.svg logo-white.svg js components AddRoom.js FormDate.js NavBar.js Room.js UploadButton.js near near-config.js utils.js pages GuestBookedList.js Home.js ManageBookings.js ManageRooms.js Search.js Upload.js ui-components.js dist index.bc0daea6.css index.dee82485.css index.html logo-black.4514ed42.svg logo-white.a7716062.svg index.html index.js package-lock.json package.json integration-tests Cargo.toml src tests.rs netlify.toml package-lock.json package.json
# NearDApp Nearと連動するDApp開発用のリポジトリです。 ## Near protocolとは Near protocolは、シャーディングと呼ばれる技術を採用してるPoSパブリックプロコトルでETHなどと同じレイヤー1と呼ばれるブロックチェーン。 また、Near protocolではETHと競合関係にありがならETHと互換性をもたせるために「Rainbowbridge」というサービスも提供してます。 これを利用することでNEAR⇔ETHの移動ができるようになり、ETHをメインに利用している人でも気軽にNEARネットワークを使用することが可能になりました。 ### BlockExplorer [テストネットへのデプロイ例](https://explorer.testnet.near.org/transactions/GKapRwXm8uUs3Lf1jMNf9cPURdnoEg5G2uiDkE1brzwx) ### Near CLIのインストールコマンド `npm i -g near-cli` `near` ### プロジェクトの雛形作成コマンド例 `npx create-near-app --frontend=react --contract=rust --tests rust near-hotel-booking-dapp` コマンドのオプションは必ず指定すること!!!! 下記のようなエラーが出てくる。 ```cmd Arguments error Run npx create-near-app without arguments, or use: npx create-near-app <projectName> --contract rust|js|assemblyscript --frontend react|vanilla|none --tests js|rust ``` うまく行けば、下記のような内容が出力される。 ```cmd ====================================================== 👋 Welcome to NEAR! Learn more: https://docs.near.org/ 🔧 Let's get your dApp ready. ====================================================== (NEAR collects anonymous information on the commands used. No personal information that could identify you is shared) Creating a new NEAR dApp ====================================================== ✅ Success! Created '/Users/harukikondo/git/NearDApp/near-hotel-booking-dap' with a smart contract in Rust and a frontend template in React.js. 🦀 If you are new to Rust please visit https://www.rust-lang.org Your next steps: - Navigate to your project: cd /Users/harukikondo/git/NearDApp/near-hotel-booking-dap - Install all dependencies npm run deps-install - Test your contract in NEAR SandBox: npm test - Deploy your contract to NEAR TestNet with a temporary dev account: npm run deploy - Start your frontend: npm start ``` ### テスト実行方法1 `npm test` ```cmd Passed ✅ gets default message Passed ✅ changes message ``` ### テスト実行方法2 `cd contract` `cargo test` うまく行けば下記の様に出力される。 ```cmd Blocking waiting for file lock on package cache Blocking waiting for file lock on build directory Compiling hotel_booking v1.0.0 (/Users/harukikondo/git/NearDApp/near-hotel-booking-dapp/contract) Finished test [unoptimized + debuginfo] target(s) in 1m 10s Running unittests src/lib.rs (target/debug/deps/hotel_booking-6485072b7a754368) running 5 tests test tests::no_available_room ... ok test tests::no_registered_room ... ok test tests::add_then_get_available_rooms ... ok test tests::add_then_get_registered_rooms ... ok test tests::book_room_then_change_status ... ok test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Doc-tests hotel_booking running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s ``` ### コントラクトをビルドする方法2 `cd contract` `cargo build --target wasm32-unknown-unknown --release` #### ビルドファイルが生成されているか確認する方法 `ls ./target/wasm32-unknown-unknown/release | grep hotel_booking.wasm` #### Near Walletへログインするコマンド `near login` #### サブアカウントを作成するコマンド `near create-account contract.dev-1660204085773-49134722844982 --masterAccount dev-1660204085773-49134722844982 --initialBalance 5` もしうまくアカウントが作成できていれば`~/.near-credentials/testnet`フォルダ配下にアカウント情報(jsonファイル形式)が出力されているはずです。 #### サブアカウントを作成するコマンド(例) `near create-account booking1.dev-1660204085773-49134722844982 --masterAccount dev-1660204085773-49134722844982 --initialBalance 5` `near create-account booking2.dev-1660204085773-49134722844982 --masterAccount dev-1660204085773-49134722844982 --initialBalance 5` #### サブアカウントを削除するコマンド `near delete contract.dev-1660204085773-49134722844982 dev-1660204085773-49134722844982` #### スマートコントラクトをデプロイするコマンド `near deploy --wasmFile target/wasm32-unknown-unknown/release/hotel_booking.wasm --accountId contract.dev-1660204085773-49134722844982` うまく行けば下記のような内容が出力される。 ```cmd Starting deployment. Account id: contract.dev-1660204085773-49134722844982, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file: target/wasm32-unknown-unknown/release/hotel_booking.wasm Transaction Id 5hr8mjNtk2gwiDp4qezbV3dksQgYk8WRXV5fCLQ1PSri To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/5hr8mjNtk2gwiDp4qezbV3dksQgYk8WRXV5fCLQ1PSri Done deploying to contract.dev-1660204085773-49134722844982 ``` #### スマートコントラクトのメソッドをコマンドで呼び出す方法(viewメソッド) `near view contract.dev-1660204085773-49134722844982 get_rooms_registered_by_owner '{"owner_id": "dev-1660204085773-49134722844982"}' --accountId dev-1660204085773-49134722844982` うまく行けば下記のように出力される。 ```cmd View call: contract.dev-1660204085773-49134722844982.get_rooms_registered_by_owner({"owner_id": "dev-1660204085773-49134722844982"}) [] ``` #### Room情報を追加するためのcallメソッドを呼び出すコマンドは次の通り `near call contract.dev-1660204085773-49134722844982 add_room_to_owner '{"name": "Sun Room", "image": "https://ibb.co/kgNm4jP", "beds": 1, "description": "This is Sun room.", "location": "Tokyo", "price": "1000000000000000000000000"}' --accountId dev-1660204085773-49134722844982` 成功していれば、viewメソッドを呼び出した時に次の内容が出力される。 ```cmd View call: contract.dev-1660204085773-49134722844982.get_rooms_registered_by_owner({"owner_id": "dev-1660204085773-49134722844982"}) [ { name: 'Sun Room', image: 'https://ibb.co/kgNm4jP', beds: 1, description: 'This is Sun room.', location: 'Tokyo', price: '1000000000000000000000000', status: 'Available' } ] ``` #### existsメソッドを呼び出すコマンド `near view contract.dev-1660204085773-49134722844982 exists '{"owner_id": "dev-1660204085773-49134722844982", "room_name": "Sun Room"}' --accountId dev-1660204085773-49134722844982` #### get_available_roomsメソッドを呼び出すコマンド `near call booking1.dev-1660204085773-49134722844982 get_available_rooms '{"room_id": "dev-1660204085773-49134722844982Sun Room", "check_in_date": "2222-01-01"}' --accountId dev-1660204085773-49134722844982` レスポンス例 ```json [ { room_id: 'dev-1660204085773-49134722844982Sun Room', owner_id: 'dev-1660204085773-49134722844982', name: 'Sun Room', image: 'https://ibb.co/kgNm4jP', beds: 1, description: 'This is Sun room.', location: 'Tokyo', price: '1000000000000000000000000' } ] ``` #### book_roomメソッドを呼び出すコマンド `near call booking1.dev-1660204085773-49134722844982 book_room '{"room_id": "dev-1660204085773-49134722844982Sun Room", "check_in_date": "2222-01-01"}' --depositYocto=1000000000000000000000000 --accountId booking2.dev-1660204085773-49134722844982` #### ownerが予約データを確認するためのコマンド `near view booking1.dev-1660204085773-49134722844982 get_booking_info_for_owner '{"owner_id":"dev-1660204085773-49134722844982"}'` レスポンス結果 ```json [ { room_id: 'dev-1660204085773-49134722844982Sun Room', name: 'Sun Room', check_in_date: '2222-01-01', guest_id: 'booking2.dev-1660204085773-49134722844982', status: 'Available' } ] ``` #### 宿泊者が自らの予約データを確認するコマンド `near view booking1.dev-1660204085773-49134722844982 get_booking_info_for_guest '{"guest_id": "booking2.dev-1660204085773-49134722844982"}'` レスポンス結果 ```json [ { owner_id: 'dev-1660204085773-49134722844982', name: 'Sun Room', check_in_date: '2222-01-01' } ] ``` #### チェックインを行うためのコマンド `near call booking1.dev-1660204085773-49134722844982 change_status_to_stay '{"room_id": "dev-1660204085773-49134722844982Sun Room", "check_in_date": "2222-01-01"}' --accountId dev-1660204085773-49134722844982` #### チェックアウトを行うためのコマンド `near call booking1.dev-1660204085773-49134722844982 change_status_to_available '{"room_id": "dev-1660204085773-49134722844982Sun Room", "check_in_date": "2222-01-01", "guest_id": "booking2.dev-1660204085773-49134722844982"}' --accountId dev-1660204085773-49134722844982` このコマンドを実行した後に予約データを取得するメソッドを打ち込んで[]が返ってきていれば成功!! ### テストネットへのデプロイ方法 `npm run deploy` ```cmd near-hotel-booking-dap@1.0.0 deploy > npm run build:contract && cd contract && near dev-deploy --wasmFile ./target/wasm32-unknown-unknown/release/hello_near.wasm > near-hotel-booking-dap@1.0.0 build:contract > cd contract && rustup target add wasm32-unknown-unknown && cargo build --all --target wasm32-unknown-unknown --release info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date Finished release [optimized] target(s) in 0.88s Please help us to collect data on near-cli usage to improve developer experience. We will never send private information. We collect which commands are run with attributes, your account ID, and your country Note that your account ID and all associated on-chain transactions are already being recorded on public blockchain. Would you like to opt in (y/n)? y Starting deployment. Account id: dev-1660204085773-49134722844982, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file: ./target/wasm32-unknown-unknown/release/hello_near.wasm Transaction Id GKapRwXm8uUs3Lf1jMNf9cPURdnoEg5G2uiDkE1brzwx To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/GKapRwXm8uUs3Lf1jMNf9cPURdnoEg5G2uiDkE1brzwx Done deploying to dev-1660204085773-49134722844982 ``` ### レッスン2時点でのデプロイ記録 ```cmd near-hotel-booking-dap@1.0.0 deploy > npm run build:contract && cd contract && near dev-deploy --wasmFile ./target/wasm32-unknown-unknown/release/hello_near.wasm > near-hotel-booking-dap@1.0.0 build:contract > cd contract && rustup target add wasm32-unknown-unknown && cargo build --all --target wasm32-unknown-unknown --release && cp ./target/wasm32-unknown-unknown/release/hotel_booking.wasm ../out/main.wasm info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date Finished release [optimized] target(s) in 1.22s Starting deployment. Account id: dev-1660204085773-49134722844982, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file: ./target/wasm32-unknown-unknown/release/hello_near.wasm Transaction Id DvxxTXK28ncnM4FUo4ZFvjvTYanijGTGEmcSoEQVma9B To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/DvxxTXK28ncnM4FUo4ZFvjvTYanijGTGEmcSoEQVma9B Done deploying to dev-1660204085773-49134722844982 ``` ### フロントエンド起動方法 `npm start` <img src="./assets/imgs/start.png"> ### Nrtlifyでデプロイする方法 1. `netlify login` 2. `netlify deploy --prod` CLI形式でいくつか質問されるので自分のプロジェクトにあう様に回答していく。 うまく行けば下記の様な内容が出力される。 ```cmd This folder isn't linked to a site yet ? What would you like to do? + Create & configure a new site ? Team: mashharuki Choose a unique site name (e.g. netlify-thinks-mashharuki-is-great.netlify.app) or leave it blank for a random name. You can update the site name later. ? Site name (optional): naer-hotel-booking-dapp Please provide a publish directory (e.g. "public" or "dist" or "."): /Users/harukikondo/git/NearDApp/near-hotel-booking-dapp ? Publish directory /Users/harukikondo/git/NearDApp/near-hotel-booking-dapp/frontend/dist Deploy path: /Users/harukikondo/git/NearDApp/near-hotel-booking-dapp/frontend/dist Configuration path: /Users/harukikondo/git/NearDApp/near-hotel-booking-dapp/netlify.toml Deploying to main site URL... ✔ Finished hashing ✔ CDN requesting 7 files ✔ Finished uploading 7 assets ✔ Deploy is live! Logs: https://app.netlify.com/sites/naer-hotel-booking-dapp/deploys/62f71bc5b952c7553dfddd1f Unique Deploy URL: https://62f71bc5b952c7553dfddd1f--naer-hotel-booking-dapp.netlify.app Website URL: https://naer-hotel-booking-dapp.netlify.app ``` うまく行けば、Webに公開されてローカルにデプロイした時と同じ様にアクセスすることができる!! <img src= "./assets/imgs/deploy.png"> ##### ============================================ ### 画面例 1. 予約管理画面 <img src="./assets/imgs/managebook.png"> 2. 予約管理画面(1件も予約がない状態) <img src="./assets/imgs/nobookingdata.png"> 3. 部屋の状況確認画面 <img src="./assets/imgs/manageroom.png"> 4. Connect Wallet画面 <img src="./assets/imgs/connectwallet.png"> ### 参考文献 1. [Create Near AppのNPMページ](https://www.npmjs.com/package/create-near-app?activeTab=readme) 2. [BlockExplorer](https://explorer.testnet.near.org/) 3. [Nearprotocolの開発者ドキュメント](https://docs.near.org/develop/quickstart-guide) 4. [Near SDK](https://docs.rs/near-sdk/latest/near_sdk/) 5. [【NEAR編】NEAR Walletの作成から購入方法。Rainbow bridgeでのブリッジ方法も徹底解説](https://koji-toku.com/near-wallet-bridge) 6. [BlockExplorer(mashharuki.testnet)](https://wallet.testnet.near.org/profile/mashharuki.testnet) 7. [NearWalletPortal](https://wallet.near.org/) 8. [NearUniversityJapan](https://near-university-japan.super.site/) 9. [booking1.dev-1660204085773-49134722844982 Contract](https://explorer.testnet.near.org/accounts/booking1.dev-1660204085773-49134722844982) 10. [ReactBootStrap](https://react-bootstrap.netlify.app/components/buttons/#rb-docs-content) 11. [Netlify](https://www.netlify.com/) 12. [near-hotel-booking-dapp](https://naer-hotel-booking-dapp.netlify.app) near-blank-project ================== This app was initialized with [create-near-app] Quick Start =========== If you haven't installed dependencies during setup: npm run deps-install Build and deploy your contract to TestNet with a temporary dev account: npm run deploy Test your contract: npm test If you have a frontend, run `npm start`. This will run a dev server. Exploring The Code ================== 1. The smart-contract code lives in the `/contract` folder. See the README there for more info. In blockchain apps the smart contract is the "backend" of your app. 2. The frontend code lives in the `/frontend` folder. `/frontend/index.html` is a great place to start exploring. Note that it loads in `/frontend/index.js`, this is your entrypoint to learn how the frontend connects to the NEAR blockchain. 3. Test your contract: `npm test`, this will run the tests in `integration-tests` directory. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run deploy`, your smart contract gets deployed to the live NEAR TestNet with a temporary dev account. When you're ready to make it permanent, here's how: Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-blank-project.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-blank-project.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-blank-project.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: deploy the contract --------------------------- Use the CLI to deploy the contract to TestNet with your account ID. Replace `PATH_TO_WASM_FILE` with the `wasm` that was generated in `contract` build directory. near deploy --accountId near-blank-project.YOUR-NAME.testnet --wasmFile PATH_TO_WASM_FILE Step 3: set contract name in your frontend code ----------------------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-blank-project.YOUR-NAME.testnet' Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/concepts/basics/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages Hello NEAR! ================================= A [smart contract] written in [Rust] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install Rust with [correct target] Exploring The Code ================== 1. The main smart contract code lives in `src/lib.rs`. 2. There are two functions to the smart contract: `get_greeting` and `set_greeting`. 3. Tests: You can run smart contract tests with the `cargo test`. [smart contract]: https://docs.near.org/develop/welcome [Rust]: https://www.rust-lang.org/ [create-near-app]: https://github.com/near/create-near-app [correct target]: https://docs.near.org/develop/prerequisites#rust-and-wasm [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html
NEAR-Hispano_home-delivery
.env README.md babel.config.js backend contract Cargo.toml src lib.rs django homedelivery backend __init__.py admin.py apps.py migrations 0001_initial.py 0002_auto_20220412_1924.py 0003_rename_usuario_deliver_perfil.py 0004_auto_20220426_1801.py __init__.py models.py serializers.py tests.py urls.py views.py homedelivery __init__.py asgi.py settings.py urls.py wsgi.py manage.py near-accounts.py requerimientos.txt ipfs service package-lock.json package.json server.js changelog.md package.json public index.html themes dark theme.css light theme.css src Routes.js assets icons cancel.svg cart.svg check.svg corazon-outline.svg corazon.svg delivery-outline.svg delivery.svg eliminar.svg inicio-outline.svg inicio.svg lupa.svg options.svg pencil.svg pizza-outline.svg pizza.svg restaurantes-outline.svg restaurantes.svg tienda-outline.svg tienda.svg logos logo.svg near.svg components Alerts i18n.js drawerChats i18n.js footer i18n.js forms components i18n.js miDelivery i18n.js miMenu i18n.js miPerfil i18n.js miTienda i18n.js googleMaps i18n.js header i18n.js navbar i18n.js config.js layouts error i18n.js layout i18n.js main.js pages Home i18n.js Tienda i18n.js pedido i18n.js restaurantes i18n.js plugins apexchart.js axios.js googleMaps.js i18n.js toastification.js vuetify.js services api.js store index.js vue.config.js
# Home Delivery
Learn-NEAR-Hispano_NCD1--poll
.gitpod.yml README.md babel.config.js contract README.md as-pect.config.js asconfig.json assembly __tests__ as-pect.d.ts main.spec.ts as_types.d.ts index.ts tsconfig.json compile.js package-lock.json package.json package-lock.json package.json src App.js __mocks__ fileMock.js assets logo-black.svg logo-white.svg config.js global.css index.html index.js jest.init.js main.test.js utils.js wallet login index.html
near-voting-system Smart Contract ================== A [smart contract] written in [AssemblyScript] for an app initialized with [create-near-app] Quick Start =========== Before you compile this code, you will need to install [Node.js] ≥ 12 Exploring The Code ================== 1. The main smart contract code lives in `assembly/index.ts`. You can compile it with the `./compile` script. 2. Tests: You can run smart contract tests with the `./test` script. This runs standard AssemblyScript tests using [as-pect]. [smart contract]: https://docs.near.org/docs/develop/contracts/overview [AssemblyScript]: https://www.assemblyscript.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [as-pect]: https://www.npmjs.com/package/@as-pect/cli near-poll-system ================== This [React] app was initialized with [create-near-app] Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you've installed [Node.js] ≥ 12 2. Install dependencies: `npm install` 3. Run the local development server: `npm run dev` (see `package.json` for a full list of `scripts` you can run with `npm`) Now you'll have a local development environment backed by the NEAR TestNet! Go ahead and play with the app and the code. As you make code changes, the app will automatically reload. Exploring The Code ================== 1. The "backend" code lives in the `/contract` folder. See the README there for more info. 2. The frontend code lives in the `/src` folder. `/src/index.html` is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and the smart contract. See `contract/README` for info about how it's tested. The frontend code gets tested with [jest]. You can run both of these at once with `npm run test`. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `npm run dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli (optional) ------------------------------------- [near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `npm install`, but for best ergonomics you may want to install it globally: npm install --global near-cli Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx` Ensure that it's installed with `near --version` (or `npx near --version`) Step 1: Create an account for the contract ------------------------------------------ Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `near-voting-system.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-voting-system.your-name.testnet`: 1. Authorize NEAR CLI, following the commands it gives you: near login 2. Create a subaccount (replace `YOUR-NAME` below with your actual account name): near create-account near-voting-system.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'near-voting-system.YOUR-NAME.testnet' Step 3: deploy! --------------- One command: npm run deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contract to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. Troubleshooting =============== On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details. [React]: https://reactjs.org/ [create-near-app]: https://github.com/near/create-near-app [Node.js]: https://nodejs.org/en/download/package-manager/ [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.testnet.near.org/ [near-cli]: https://github.com/near/near-cli [gh-pages]: https://github.com/tschaub/gh-pages
nearvndev_voting-contract-rs
Cargo.toml README.md build.bat build.sh src lib.rs test.sh
# Rust Smart Contract Template ## Getting started To get started with this template: 1. Click the "Use this template" button to create a new repo based on this template 2. Update line 2 of `Cargo.toml` with your project name 3. Update line 4 of `Cargo.toml` with your project author names 4. Set up the [prerequisites](https://github.com/near/near-sdk-rs#pre-requisites) 5. Begin writing your smart contract in `src/lib.rs` 6. Test the contract `cargo test -- --nocapture` 8. Build the contract `RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown --release` **Get more info at:** * [Rust Smart Contract Quick Start](https://docs.near.org/develop/prerequisites) * [Rust SDK Book](https://www.near-sdk.io/)
klimoza_hex-game
Cargo.toml README.md build.sh src bid.rs board.rs cell.rs external.rs game.rs game_with_data.rs internal.rs lib.rs roketo.rs utils.rs
The Game of Hex =============== Hex is a two player abstract strategy board game in which players attempt to connect opposite sides of a rhombus-shaped board made of hexagonal cells. Hex was invented by mathematician and poet Piet Hein in 1942 and later rediscovered and popularized by John Nash. ## Description This contract implements hex-game backed by storage on NEAR blockchain. Contract in `src/lib.rs` provides methods to create new game, make an allowed move in one of already existing games or view information about game by index. The project is divided into separate files, each file contains one of the structures, that is used to keep information about the game, and tests for this structure. ## Interacting with contract #### `create_game(first_player: AccountId, second_player: AccountId, field_size: usize) -> GameIndex` Creates new game with given parameters and returns index of created game. For example: ```console ➜ near call crossword.klimoza.testnet create_game '{"first_player": "crossword.klimoza.testnet", "second_player": "klimoza.testnet", "field_size": 2}' --accountId crossword.klimoza.testnet Scheduling a call: crossword.klimoza.testnet.create_game({"first_player": "crossword.klimoza.testnet", "second_player": "klimoza.testnet", "field_size": 2}) Doing account.functionCall() Receipt: 95QtZWq7chRA4MyftnkPE8Smoi7iQo9kWpeVfxFZGDEV Log [crossword.klimoza.testnet]: Created board: Log [crossword.klimoza.testnet]: . . Log [crossword.klimoza.testnet]: . . Transaction Id BHvhLbLWHhKbmnewLHzMv7XY2y5izssY9spWEdVm6wUE To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/BHvhLbLWHhKbmnewLHzMv7XY2y5izssY9spWEdVm6wUE 4 ``` #### `make_move(index: GameIndex, move_type: MoveType, cell: Option<Cell>) -> Game` Tries to make a move in the game at the given index and returns Game if move is correct(panics otherwise). Used structures: ```rust pub type GameIndex = u64; pub enum MoveType { PLACE, SWAP, } pub struct Cell { pub x: usize, pub y: usize, } ``` You can omit the `cell` parameter if `move_type` is `SWAP`(i.e. applying swap rule on the current move). For example: ```console ➜ near call crossword.klimoza.testnet make_move '{"index": 4, "move_type": "SWAP"}' --accountId klimoza.testnet Scheduling a call: crossword.klimoza.testnet.make_move({"index": 4, "move_type": "SWAP"}) Doing account.functionCall() Receipt: 9SntyX6t9j8jZCZMNb5wMn82k7YQKXoWH8tuYbaNZQs6 Log [crossword.klimoza.testnet]: Old board: Log [crossword.klimoza.testnet]: . R Log [crossword.klimoza.testnet]: . . Log [crossword.klimoza.testnet]: New board: Log [crossword.klimoza.testnet]: . . Log [crossword.klimoza.testnet]: B . Transaction Id FqsxYTzGaHYXvmxk3xYhBR3Mq4rveK5UvzkMNNerL6Th To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/FqsxYTzGaHYXvmxk3xYhBR3Mq4rveK5UvzkMNNerL6Th { first_player: 'crossword.klimoza.testnet', second_player: 'klimoza.testnet', turn: 2, board: { size: 2, field: 'IA==' }, current_block_height: 96244955, prev_block_height: 96244934, is_finished: false } ``` #### `get_game(index: GameIndex) -> Option<Game>` Returns the game at the given index(if there is one). For example: ```console ➜ near call crossword.klimoza.testnet get_game '{"index": 4}' --accountId crossword.klimoza.testnet Scheduling a call: crossword.klimoza.testnet.get_game({"index": 4}) Doing account.functionCall() Receipt: Fzjemr6ukV7mWNLNaJLrjxwU7uwnz2wgLfcNRNvLMyEH Log [crossword.klimoza.testnet]: Game board: Log [crossword.klimoza.testnet]: R B Log [crossword.klimoza.testnet]: B . Transaction Id DwpznqSWT8WqsirqFm64e8xHPEu1S3J52FpKsAR4okAQ To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/DwpznqSWT8WqsirqFm64e8xHPEu1S3J52FpKsAR4okAQ { first_player: 'crossword.klimoza.testnet', second_player: 'klimoza.testnet', turn: 4, board: { size: 2, field: 'KQ==' }, current_block_height: 96244985, prev_block_height: 96244971, is_finished: true } ``` ## Testing At the moment, the projects contains 33 tests, each of which lies in the file of the structure it is testing. You can run them all using following command: ```console cargo test ``` Alternatively, you can specify test group you want to run, for example: ```console cargo test cell_tests ``` ## Demonstration [![Video](https://img.youtube.com/vi/mwgUEafpeow/0.jpg)](https://youtu.be/mwgUEafpeow)
mothblue1111_Net-145-and-nep-148-contract
fungible_token_metadata.rs storage_manager.rs
noandrea_rl-contracts
README.md casper .travis.yml client main.go contract .cargo config.toml Cargo.toml src main.rs model.rs tests Cargo.toml src integration_tests.rs fantom README.md hardhat.config.js package-lock.json package.json test RevocationLists.test.js near contract Cargo.toml README.md build.sh src lib.rs models.rs utils.rs package-lock.json package.json
# A revocation lists contract ### Before you start Install rust, npx, and npm. ## How to deploy > Create contract account ```sh near create-account revocation-lists.metadid.testnet --masterAccount metadid.testnet ``` ``` Saving key to '$HOME/.near-credentials/testnet/revocation-lists.metadid.testnet.json' Account revocation-lists.metadid.testnet for network "testnet" was created. ``` > Build contract ```sh cd contract ``` ```sh make build RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown --release ``` ``` Compiling contract v0.1.0 (...) Finished release [optimized] target(s) in 2.12s ``` > Deploy ```sh ./near deploy --accountId revocation-lists.metadid.testnet --wasmFile target/wasm32-unknown-unknown/release/contract.wasm ``` ``` Starting deployment. Account id: revocation-lists.metadid.testnet, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file: target/wasm32-unknown-unknown/release/contract.wasm Transaction Id 6QaSDXgDBqzw55CP9m5FxkHFzDAgeYvUoHBy3x4eH5qV To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/6QaSDXgDBqzw55CP9m5FxkHFzDAgeYvUoHBy3x4eH5qV Done deploying to revocation-lists.metadid.testnet ``` > Init the contract ``` near call revocation-lists.metadid.testnet new '{"owner": "metadid.testnet"}' --accountId metadid.testnet ``` ``` Scheduling a call: revocation-lists.metadid.testnet.new({"owner": "metadid.testnet"}) Doing account.functionCall() Transaction Id DWrvvzt2u8gb3k6NGpyPqTuc3QvuCVr948UdNthX9Ktq To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/DWrvvzt2u8gb3k6NGpyPqTuc3QvuCVr948UdNthX9Ktq '' ``` > Init revocation lists ``` near call revocation-lists.metadid.testnet add_list '{"id": "metadid.testnet/rl/1"}' --accountId metadid.testnet ``` ``` Scheduling a call: revocation-lists.metadid.testnet.add_list({"id": "metadid.testnet/rl/1"}) Doing account.functionCall() Receipt: 4xPa5Nua7fbk3nH2rAuWgwPv1WM7ftDxg4edtyaYXE1F Log [revocation-lists.metadid.testnet]: Added a new revocation list Transaction Id AUS3nE3usr2k9nsCatxcvjGfqYwvuAdUCNBB6qhjhu91 To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/AUS3nE3usr2k9nsCatxcvjGfqYwvuAdUCNBB6qhjhu91 ``` > Revoke an item ``` ./near call revocation-lists.metadid.testnet revoke '{"id": "metadid.testnet/rl/1", "idx": 134}' --accountId metadid.testnet ``` ``` Scheduling a call: revocation-lists.metadid.testnet.revoke({"id": "metadid.testnet/rl/1", "idx": 134}) Doing account.functionCall() Receipt: AYpzRPyFXJme4BZdQBpgmUV4mmekPmQk5CSj16pZyqpU Log [revocation-lists.metadid.testnet]: credential updated Transaction Id 29UGZbFCeJ345QytqQztavV3BN91wJiqRSung2MSu8Sx To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/29UGZbFCeJ345QytqQztavV3BN91wJiqRSung2MSu8Sx ``` > check revocation ``` ./near call revocation-lists.metadid.testnet is_revoked '{"id": "metadid.testnet/rl/1", "idx": 134}' --accountId metadid.testnet ``` ``` Scheduling a call: revocation-lists.metadid.testnet.is_revoked({"id": "metadid.testnet/rl/1", "idx": 134}) Doing account.functionCall() Transaction Id HDKTX95hfznazekuR1d8KPUvEsh4QviaHuiuhDH2CzAp To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/HDKTX95hfznazekuR1d8KPUvEsh4QviaHuiuhDH2CzAp true ``` ## Notes - what about the init method, and what is the role of the owner - add logic to change the owner # Rust Smart Contracts for WebAssembly (WASM) This repository contains implementations for WebAssembly (WASM) smart contracts written in Rust for different blockchain platforms. The primary goal of this project is to compare the ergonomics and other aspects of developing smart contracts in Rust on different blockchain platforms. ## Supported Blockchains The following blockchain platforms are currently supported: - NEAR Protocol ## RevocationList2020 Specification All smart contracts in this repository implement the RevocationList2020 specification. The RevocationList2020 specification provides a way to revoke the credentials issued by a specific issuer. This can be useful in scenarios where an issuer needs to revoke a credential due to various reasons, such as a user's account being compromised or the credential being no longer valid. The RevocationList2020 specification provides a standard format for revocation lists and defines how these lists can be used to revoke credentials issued by an issuer. All smart contracts in this repository adhere to this specification, which ensures that the revocation process is interoperable across different blockchain platforms. By implementing the RevocationList2020 specification, these smart contracts provide an additional layer of security and flexibility, making them suitable for various use cases. ## Getting Started To get started with this project, you'll need to have Rust and the toolchains for the respective blockchain platforms installed on your machine. 1. Clone the repository: ```sh git clone https://github.com/noandrea/revocation-lists-2020-contracts.git ``` 2. Change into the project directory: ```sh Copy code cd revocation-lists-2020-contracts ``` 3. Change into the directory for the blockchain platform you want to work with: ```sh cd near ``` 4. Build the smart contract: ```sh make build ``` 4. Deploy the smart contract to the blockchain platform: For Solana, you can use `solana deploy`. For NEAR Protocol, you can use `near deploy`. ## Contract structure The contract has the following method signatures: - `register_list(string)` - register a new list using the input string for the list id - `get_encoded_lsit(string)` - retrieve the encoded revocation list identified by `string` - `is_revoked(string, int)` - return whenver a credential at index `int` has been revoked - `revoke(string, int)` - revoke a single credential - `reset(string, int)` - - `update(string, []int, []int)` - atomically update a revocation list - `replace_list(string, string)` - replace the list ## Contributing We welcome contributions from anyone. If you'd like to contribute to this project, please fork the repository and create a pull request. ## License This project is licensed under the MIT License - see the LICENSE file for details. # Ye ## References - https://oliverjumpertz.com/how-to-set-up-a-solidity-project-and-create-your-first-smart-contract/
mukuls9971_nearedu
README.md assemblyCode README.md as-pect.config.js asconfig.json package.json scripts 1.dev-deploy.sh 2.use-contract.sh 3.cleanup.sh README.md src as_types.d.ts simple __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts singleton __tests__ as-pect.d.ts index.unit.spec.ts asconfig.json assembly index.ts tsconfig.json utils.ts rust Cargo.toml build.sh counter Cargo.toml src lib.rs ft Cargo.toml src lib.rs rustfmt.toml test-contract-defi Cargo.toml src lib.rs tests sim main.rs no_macros.rs utils.rs with_macros.rs vue babel.config.js package.json postcss.config.js public index.html src composables near.js index.css main.js services near.js tailwind.config.js
# Directory structure Two directories: 1. AssemblyCode: Contains the assemblyCode contracts 2. Rust: Contains the contracts written in rust 3. Vue: Contains the frontend code Video Description NCD-1: https://www.loom.com/share/985a11930dc14150ae668ceeafc21df8 Video Description NCD-2: https://www.loom.com/share/d8484c027ba14597a9372818914a94a0 # AssemblyCode ### starter-kit 1. Started with the hello-world script as instructed by our instructor during our exploratory call. 2. Made all the required changes for redeployment of the script and tested the results. 3. In the final submitted code, I have commented all the changes so that you can verify the outcome. I have used the following code to test it out ``` cd assymblyCode export NEAR_ENV=testnet export CONTRACT=nearuni.testnet export BENEFICIARY=unifi.testnet ./scripts/1.dev-deploy.sh ./scripts/2.use-contract.sh ``` ### FT and NFT After this I explored the nomicon.io. It contains a good description around FT and NFT. And cross contract calls. ### Storage staking This was the concept which took a lot of my time. But eventually I understood how this interface along with FT is able to offload the rent to the account holder. # Rust I used rust because it is written multiple times within the documentation that for high value contracts, we should use only rust language. ### counter example I explored the counter example and tried the rust version of the most simplistic example ### FT Then I explored the FT example and tried running various simulation tests to get a feel of it. Have used following statements to test the system ``` cd rust ./build.sh cargo test cargo test simulate # to run only simulation tests export NEAR_ENV=testnet export Contract=nearuni.testnet near deploy --wasmFile res/unifi.wasm --accountId $Contract near call $Contract new '{"owner_id": "$Contract", "total_supply": "100000000000000", "metadata": { "spec": "ft-1.0.0", "name": "taifi", "symbol": "EXLT", "decimals": 8 }}' --accountId $Contract near view $Contract ft_metadata near view $Contract ft_balance_of '{"account_id": "'$Contract'"}' near call $Contract ft_transfer '{"receiver_id": "'$Contract'", "amount": "50000"}' --accountId $Contract --amount 0.000000000000000000000001 near view $Contract storage_balance_bounds near call $Contract storage_deposit '' --accountId $Contract --amount 0.00235 near create-account bob.$ID --masterAccount $ID --initialBalance 1 near call $ID storage_deposit '' --accountId bob.$ID --amount 0.00125 near view $ID ft_balance_of '{"account_id": "'bob.$ID'"}' near call $ID ft_transfer '{"receiver_id": "'bob.$ID'", "amount": "5"}' --accountId $ID --amount 0.000000000000000000000001 ``` # Vue - As explained, in the course I have tried to create an application using Vue as Frontend. - I have used the counter example as the backend with some modifications. - Have added the following functions: - add x - subtract x - multiply x - divide x - gettotal - getstorage - Code to test the contract ``` cd rust ./build.sh cargo test -v export NEAR_ENV=testnet export Contract=nearuni.testnet near deploy --wasmFile res/counter.wasm --accountId $Contract near call $Contract add '{"x":45}' --accountId $Contract near call $Contract subtract '{"x":20}' --accountId $Contract near call $Contract multiply '{"x":4}' --accountId $Contract near call $Contract divide '{"x":7}' --accountId $Contract near view $Contract get_total near view $Contract get_storage ``` After Deploying the contract: ``` // Install the repositories npm install // Compiles and hot-reloads for development npm run serve // Compiles and minifies for production npm run build // Lints and fixes files npm run lint ``` 1. After deploying, in the navigation bar , the four buttons for add, subtract, multiply and divide are visible. 2. We need to login first to access the change functions because they need transactions. 3. We can click on the buttons and check the console for the promise to get completed. 4. Have not added the loading flow but connection to application are complete. 5. Both view and change functions are working as expected. ### Next Steps: 1. Can add input block to accept the required value for maths operation 2. Can add the loading animation so that we know when the operation is completed. ## Setting up your terminal The scripts in this folder are designed to help you demonstrate the behavior of the contract(s) in this project. It uses the following setup: ```sh # set your terminal up to have 2 windows, A and B like this: ┌─────────────────────────────────┬─────────────────────────────────┐ │ │ │ │ │ │ │ A │ B │ │ │ │ │ │ │ └─────────────────────────────────┴─────────────────────────────────┘ ``` ### Terminal **A** *This window is used to compile, deploy and control the contract* - Environment ```sh export CONTRACT= # depends on deployment export OWNER= # any account you control # for example # export CONTRACT=dev-1615190770786-2702449 # export OWNER=sherif.testnet ``` - Commands _helper scripts_ ```sh 1.dev-deploy.sh # helper: build and deploy contracts 2.use-contract.sh # helper: call methods on ContractPromise 3.cleanup.sh # helper: delete build and deploy artifacts ``` ### Terminal **B** *This window is used to render the contract account storage* - Environment ```sh export CONTRACT= # depends on deployment # for example # export CONTRACT=dev-1615190770786-2702449 ``` - Commands ```sh # monitor contract storage using near-account-utils # https://github.com/near-examples/near-account-utils watch -d -n 1 yarn storage $CONTRACT ``` --- ## OS Support ### Linux - The `watch` command is supported natively on Linux - To learn more about any of these shell commands take a look at [explainshell.com](https://explainshell.com) ### MacOS - Consider `brew info visionmedia-watch` (or `brew install watch`) ### Windows - Consider this article: [What is the Windows analog of the Linux watch command?](https://superuser.com/questions/191063/what-is-the-windows-analog-of-the-linuo-watch-command#191068) <!-- near deploy --wasmFile build/debug/helloworld.wasm --accountId $ID --> # `near-sdk-as` Starter Kit This is a good project to use as a starting point for your AssemblyScript project. ## Samples This repository includes a complete project structure for AssemblyScript contracts targeting the NEAR platform. The example here is very basic. It's a simple contract demonstrating the following concepts: - a single contract - the difference between `view` vs. `change` methods - basic contract storage There are 2 AssemblyScript contracts in this project, each in their own folder: - **simple** in the `src/simple` folder - **singleton** in the `src/singleton` folder ### Simple We say that an AssemblyScript contract is written in the "simple style" when the `index.ts` file (the contract entry point) includes a series of exported functions. In this case, all exported functions become public contract methods. ```ts // return the string 'hello world' export function helloWorld(): string {} // read the given key from account (contract) storage export function read(key: string): string {} // write the given value at the given key to account (contract) storage export function write(key: string, value: string): string {} // private helper method used by read() and write() above private storageReport(): string {} ``` ### Singleton We say that an AssemblyScript contract is written in the "singleton style" when the `index.ts` file (the contract entry point) has a single exported class (the name of the class doesn't matter) that is decorated with `@nearBindgen`. In this case, all methods on the class become public contract methods unless marked `private`. Also, all instance variables are stored as a serialized instance of the class under a special storage key named `STATE`. AssemblyScript uses JSON for storage serialization (as opposed to Rust contracts which use a custom binary serialization format called borsh). ```ts @nearBindgen export class Contract { // return the string 'hello world' helloWorld(): string {} // read the given key from account (contract) storage read(key: string): string {} // write the given value at the given key to account (contract) storage @mutateState() write(key: string, value: string): string {} // private helper method used by read() and write() above private storageReport(): string {} } ``` ## Usage ### Getting started (see below for video recordings of each of the following steps) 1. clone this repo to a local folder 2. run `yarn` 3. run `./scripts/1.dev-deploy.sh` 3. run `./scripts/2.use-contract.sh` 4. run `./scripts/2.use-contract.sh` (yes, run it to see changes) 5. run `./scripts/3.cleanup.sh` ### Videos **`1.dev-deploy.sh`** This video shows the build and deployment of the contract. [![asciicast](https://asciinema.org/a/409575.svg)](https://asciinema.org/a/409575) **`2.use-contract.sh`** This video shows contract methods being called. You should run the script twice to see the effect it has on contract state. [![asciicast](https://asciinema.org/a/409577.svg)](https://asciinema.org/a/409577) **`3.cleanup.sh`** This video shows the cleanup script running. Make sure you add the `BENEFICIARY` environment variable. The script will remind you if you forget. ```sh export BENEFICIARY=<your-account-here> # this account receives contract account balance ``` [![asciicast](https://asciinema.org/a/409580.svg)](https://asciinema.org/a/409580) ### Other documentation - See `./scripts/README.md` for documentation about the scripts - Watch this video where Willem Wyndham walks us through refactoring a simple example of a NEAR smart contract written in AssemblyScript https://youtu.be/QP7aveSqRPo ``` There are 2 "styles" of implementing AssemblyScript NEAR contracts: - the contract interface can either be a collection of exported functions - or the contract interface can be the methods of a an exported class We call the second style "Singleton" because there is only one instance of the class which is serialized to the blockchain storage. Rust contracts written for NEAR do this by default with the contract struct. 0:00 noise (to cut) 0:10 Welcome 0:59 Create project starting with "npm init" 2:20 Customize the project for AssemblyScript development 9:25 Import the Counter example and get unit tests passing 18:30 Adapt the Counter example to a Singleton style contract 21:49 Refactoring unit tests to access the new methods 24:45 Review and summary ``` ## The file system ```sh ├── README.md # this file ├── as-pect.config.js # configuration for as-pect (AssemblyScript unit testing) ├── asconfig.json # configuration for AssemblyScript compiler (supports multiple contracts) ├── package.json # NodeJS project manifest ├── scripts │   ├── 1.dev-deploy.sh # helper: build and deploy contracts │   ├── 2.use-contract.sh # helper: call methods on ContractPromise │   ├── 3.cleanup.sh # helper: delete build and deploy artifacts │   └── README.md # documentation for helper scripts ├── src │   ├── as_types.d.ts # AssemblyScript headers for type hints │   ├── simple # Contract 1: "Simple example" │   │   ├── __tests__ │   │   │   ├── as-pect.d.ts # as-pect unit testing headers for type hints │   │   │   └── index.unit.spec.ts # unit tests for contract 1 │   │   ├── asconfig.json # configuration for AssemblyScript compiler (one per contract) │   │   └── assembly │   │   └── index.ts # contract code for contract 1 │   ├── singleton # Contract 2: "Singleton-style example" │   │   ├── __tests__ │   │   │   ├── as-pect.d.ts # as-pect unit testing headers for type hints │   │   │   └── index.unit.spec.ts # unit tests for contract 2 │   │   ├── asconfig.json # configuration for AssemblyScript compiler (one per contract) │   │   └── assembly │   │   └── index.ts # contract code for contract 2 │   ├── tsconfig.json # Typescript configuration │   └── utils.ts # common contract utility functions └── yarn.lock # project manifest version lock ``` You may clone this repo to get started OR create everything from scratch. Please note that, in order to create the AssemblyScript and tests folder structure, you may use the command `asp --init` which will create the following folders and files: ``` ./assembly/ ./assembly/tests/ ./assembly/tests/example.spec.ts ./assembly/tests/as-pect.d.ts ```
PrimeLabCore_Primelab-ETL
Kafka-Deb database_init create_database.sql create_schema.sql debezium_setup.sql debezium example_payloads action_receipt_actions.json transactions.json setup.txt migrations v1_0_2022_02_23_initial_schema down.sql up.sql v2_0_2022_02_28_staging down.sql up.sql v3_0_2022_03_02_etl down.sql up.sql Lambda_Functions lambda_function.py lambda_function_accounts.py lambda_function_actions_lookup.py NLPQ __init__.py crud.py database.py main.py models.py routers.py schemas.py README.md docs ETL_Diagram_for_Joey_(1).svg
# Primelab ETL and Explore API ## **Background**: We have developed a highly available system for both relational and graph analysis of blockchain data. We leverage the improved Primelab Near Indexer to create a Debezium based Kafka message queue for the most critical tables in the Postgres instance. Accounts, Transactions, Receipts, Action Receipt Actions. These tables are streamed in realtime to the pipeline where they are transformed, joined and stored once again in the Redshift Data Lake. <aside> 💡 **Alternatively** you may choose to also write these to and in any combination of DynamoDB, neo4jAura, postgres, Redshift. </aside> ![Basic Chart](https://raw.githubusercontent.com/NearPrime/Primelab-ETL/930f0fce2eb8b717547750502b9473ae6fde2cf0/docs/ETL_Diagram_for_Joey_(1).svg) Basic Chart ## Data Structure Primelabs contracts enrich transaction data with JSON arguments that facilitate easier analysis. Below we will outline some concepts to familiarize yourself with. ### ****NearApps Tags**** For the contracts methods, they are *always* used in the following format: - `nearapps_tags`: object - The tags' hash information. - `app_id`: string - App tag hash. - `action_id`: string - Action number hash. - `user_id`: string - User account_id tag hash. And their standalone json representation (example) is: ```json 1{ 2 "nearapps_tags": { 3 "app_id": "fbf4cd3", 4 "action_id": "4355a4", 5 "user_id": "03a07d" 6 } 7} ``` ### **Account Creation** method: create_account Parameters new_account_id: string - the account_id that is being created new_public_key: optional string - the new account owner public key, in base58 with an optional {header}: as prefix. Can be a Ed25519 or a Secp256k1 public key. On a missing prefix, ed25519: is assumed. This value may be generated by the user. If missing, defaults to the transaction signer's public key. Returns account_created: boolean - whether the account was successfully created. Sample { } ### File Contract method: `new` description: Initializes the contract. ### **Parameters** - `owner`: string - the account_id of who will own the contract ### **Returns** Has no returns. `transaction hash A96H8pRQs7t7Q7PwF6sRv8Wcw5gxaAgaZwdGNiKoi5dA` ``` 1{"args_json": {"owner_id": "dev-1649182007824-64888721472108"}, 2"args_base64": "eyJvd25lcl9pZCI6ImRldi0xNjQ5MTgyMDA3ODI0LTY0ODg4NzIxNDcyMTA4In0=", 3"deposit": "0", 4"gas": 30000000000000, 5"method_name": "new" 6} ``` Parameters new_account_id: string - the account_id that is being created new_public_key: optional string - the new account owner public key, in base58 with an optional {header}: as prefix. Can be a Ed25519 or a Secp256k1 public key. On a missing prefix, ed25519: is assumed. This value may be generated by the user. If missing, defaults to the transaction signer's public key. Returns account_created: boolean - whether the account was successfully created. Sample { } ### NFT ### **Series** A token has various characteristics, such as it's title (which must be unique on the nft contract). A series serves as a setting that decides, on a token creation/minting, what that token name will be. One way of understanding a series is by comparing them to directories: A newly created series is like an empty directory, and the tokens that are minted "under" that series are files that get's placed inside of that directory.For example, a directory named "D" may have two files inside of it, named "F1" and "F2". The complete path for those files would be `D/F1` and `D/F2`, and so it can be observed that the complete path is made both of the directory name and the file name.The series work in a simillar manner: Each series has a title and a number (which is an index that gets incremented for each series), and when a token gets minted under that series, the complete/final "title" of that token will be created from the informations of it's series. For example, a series named "S" that has two tokens created under it, the tokens will be named `S:0:0` and `S:0:1`, where they are, respectivey, the series name, the series index and the token index on the series (the first token that got created is `0`, and the second is `1`). Once a token has been minted under a series (which simply decided on the token title), that token will behave and function like any standard non-fungible token. Note that simply creating series won't create any tokens. The tokens still need to be explicitly minted. ### **Quantity of Minted Tokens** Each token that gets minted under a series has an index, which gets incremented for each token. In this way, each token under the same series can be differentiated from one another. Also related to the quantity of tokens under a series, the series have a setting that can limit how many tokens can be minted under them, and an error will be returned when trying to mint a token when the series is already at a maximum capacity. ### **Interface** methods: - `new` - `new_default_meta` - `get_owner` - `change_owner` - `nft_mint` - `nft_series_create` - `nft_series_mint` - `nft_series_supply` - `nft_series_get` - `nft_series_get_minted_tokens_vec` - `nft_series_set_mintable` - `nft_series_set_capacity` - `nft_transfer_logged` - `nft_transfer_call_logged` - `nft_token` - `nft_approve_logged` - `nft_revoke_logged` - `nft_revoke_all_logged` - `nft_is_approved` - `nft_total_supply` - `nft_tokens` - `nft_supply_for_owner` - `nft_tokens_for_owner` - `nft_metadata` ### **Initialization** method: `new`description: Initializes the NftSeries contract. ### **Parameters** - `owner_id`: string - the account_id of who will own the contract - `metadata`: object - the standard nft metadata - `spec`: stirng - eg. "nft-1.0.0" - `name`: string - eg. "Mosaics" - `symbol`: string - eg. "MOSAIC" - `icon`: optional string - data URL - `base_uri`: optional string - centralized gateway known to have reliable access to decentralized storage assets referenced by `reference` or `media` URLs - `reference`: optional string - URL to a JSON file with more info - `reference_hash`: optional string - base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included. - `nearapps_logger`: string - the account_id of which contract will log the `nearapps_tags`. ### **Json Example** ``` 1{ 2 "owner_id": "executor", 3 "metadata": { 4 "spec": "nft-1.0.0", 5 "name": "Mosaics", 6 "symbol": "MOSAIC", 7 "icon": null, 8 "base_uri": null, 9 "reference": null, 10 "reference_hash": null 11 }, 12 "nearapps_logger": "executor" 13} 14 ``` ### **Returns** Has no returns. ### **Initialization with a default Meta** method: `new_default_meta`description: Initializes the NftSeries contract, using a dummy nft contract metadata. ### **Parameters** - `owner_id`: string - the account_id of who will own the contract - `nearapps_logger`: string - the account_id of which contract will log the `nearapps_tags`. ### **Json Example** ``` 1{ 2 "owner_id": "executor", 3 "nearapps_logger": "executor" 4} 5 ``` ### **Returns** Has no returns. ### **Owners Management** methods: - `get_owner` - `change_owner` ### **Get Owner** method: `get_owner`description: Gets the contract's owner. ### **Parameters** Has no parameters. ### **Returns** - `owner`: string - the account_id of the owner. ### **Change Owner** method: `change_owner`description: Changes the contract's owner. ### **Parameters** `new_owner`: string - the account_id of the new owner. ### **Json Example** ``` 1{ 2 "new_owner": "new-executor" 3} 4 ``` ### **Returns** Has no returns. ### **NFT Minting** method: `nft_mint`description: Creates a new nft token. The `token_id` cannot contain the series delimiter character, which is `:`. ### **Parameters** - `token_id`: string - the name of the token. Cannot contain the series delimiter (`:`). - `token_owner_id`: string - the account_id of who will receive the token. - `token_metadata`: object - the standard nft token metadata. - `title`: optional string - the title of the token, eg. "Arch Nemesis: Mail Carrier" or "Parcel #5055". - `description`: optional string - free-form description. - `media`: optional string - URL to associated media, preferably to decentralized, content-addressed storage. - `media_hash`: optional stirng - Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included. - `copies`: optional string - number of copies of this set of metadata in existence when token was minted. - `issued_at`: optional string - ISO 8601 datetime when token was issued or minted. - `expires_at`: optional string - ISO 8601 datetime when token expires. - `starts_at`: optional string - ISO 8601 datetime when token starts being valid. -`updated_at`: optional string - ISO 8601 datetime when token was last updated. - `extra`: optional string - anything extra the NFT wants to store on-chain. Can be stringified JSON. - `reference`: optional string - URL to an off-chain JSON file with more info. - `reference_hash`: optional string - Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included. - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "token_id": "", 3 "token_owner_id": "", 4 "token_metadata": {}, 5 "nearapps_tags": { 6 "app_id": "some app tag", 7 "action_id": "1", 8 "user_id": "some-user-tag" 9 } 10} 11 ``` ### **Returns** - `token`: object - the standard nft token information. ### **Standard NFT Operations** methods: - `nft_transfer_logged` - `nft_transfer_call_logged` - `nft_token` - `nft_approve_logged` - `nft_revoke_logged` - `nft_revoke_all` - `nft_is_approved` - `nft_total_supply` - `nft_tokens` - `nft_supply_for_owner` - `nft_tokens_for_owner` - `nft_metadata` events: - `nft_mint` - `nft_transfer` - `nft_revoke` - `nft_revoke_all` ### **Transfer** method: `nft_transfer_logged`description: Simple transfer. Transfer a given `token_id` from current owner to `receiver_id`. ### **Parameters** - `token_id`: string - the token id to transfer. - `receiver_id`: string - the account to receive the token. - `approval_id`: optional number - expected approval ID. A number smaller than 2^53, and therefore representable as JSON. - `memo`: optional string - free-form information. - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "token_id": "some-token-id", 3 "receiver_id": "receiver-account", 4 "nearapps_tags": { 5 "app_id": "some app tag", 6 "action_id": "1", 7 "user_id": "some-user-tag" 8 } 9} 10 ``` ### **Returns** Has no return. ### **Transfer Call** method: `nft_transfer_call_logged`description: Transfer token and call a method on a receiver contract. A successful workflow will end in a success execution outcome to the callback on the NFT contract at the method `nft_resolve_transfer`. ### **Parameters** - `token_id`: string - the token id to transfer. - `receiver_id`: string - the account to receive the token. - `approval_id`: optional number - expected approval ID. A number smaller than 2^53, and therefore representable as JSON. - `memo`: optional string - free-form information. - `msg`: String - free-form information that can help the receiver to make a decision to accept or deny the token. - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "token_id": "some-token-id", 3 "receiver_id": "receiver-account", 4 "msg": "arbitrary", 5 "nearapps_tags": { 6 "app_id": "some app tag", 7 "action_id": "1", 8 "user_id": "some-user-tag" 9 } 10} 11 ``` ### **Returns** - `success`: bool - whether the transfer was successful or not. ### **Approval** method: `nft_approve_logged`description: Add an approved account for a specific token. ### **Parameters** - `token_id`: string - the token id to give allowance on - `account_id`: string - the account to allow token transfer - `msg`: optional string. - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "token_id": "some-token-id", 3 "account_id": "allowed-account", 4 "nearapps_tags": { 5 "app_id": "some app tag", 6 "action_id": "1", 7 "user_id": "some-user-tag" 8 } 9} 10 ``` ### **Returns** - `approval_id`: the id of the approval ### **Check Approval** method: `nft_is_approved`description: Check if a token is approved for transfer by a given account, optionally checking an approval_id ### **Parameters** - `token_id`: string - the token id to check allowance on - `approved_account_id`: string. - `approval_id`: optional number. ### **Json Example** ``` 1{ 2 "token_id": "some-token-id", 3 "approved_account_id": "approved-account", 4} 5 ``` ### **Returns** - `is_approved`: boolean - whether it is approved. ### **Revoke** method: `nft_revoke_logged`description: Revoke an approved account for a specific token. ### **Parameters** - `token_id`: string - the token id to revoke allowance on - `account_id`: string - the account to disallow token transfer - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "token_id": "some-token-id", 3 "account_id": "account-to-be-disallowed", 4 "nearapps_tags": { 5 "app_id": "some app tag", 6 "action_id": "1", 7 "user_id": "some-user-tag" 8 } 9} 10 ``` ### **Returns** Has no returns. ### **Revoke All** method: `nft_revoke_all_logged`description: Revoke all approved accounts for a specific token. ### **Parameters** - `token_id`: string - the token id to revoke allowance on - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "token_id": "some-token-id", 3 "nearapps_tags": { 4 "app_id": "some app tag", 5 "action_id": "1", 6 "user_id": "some-user-tag" 7 } 8} 9 ``` ### **Returns** Has no return. ### **NFT Series Operations** methods: - `nft_series_create` - `nft_series_supply` - `nft_series_mint` - `nft_series_get` - `nft_series_get_minted_tokens_vec` - `nft_series_set_mintable` - `nft_series_set_capacity` events: - `nft_series_create` - `nft_series_mint` - `nft_series_set_capacity` - `nft_series_set_mintable` ### **NFT Series Creation** method: `nft_series_create`description: Creates a new NFT series. ### **Parameters** - `name`: string - the name of the token series - `capacity`: string - the maximum number of the of tokens that can be minted - `creator`: string - the account_id of the creator, used for informing - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "name": "my-token-series", 3 "capacity": "5", 4 "creator": "some-user", 5 "nearapps_tags": { 6 "app_id": "some app tag", 7 "action_id": "1", 8 "user_id": "some-user-tag" 9 } 10} 11 ``` ### **Returns** - `series_id`: string - a number representing the id of the created series. ### **NFT Series Supply** method: `nft_series_supply`description: Shows how many series were created. ### **Parameters** Has no parameters. ### **Returns** - `series_quantity`: string - a number representing the number of created series. ### **NFT Series Token Minting** method: `nft_series_mint`description: Creates a new nft token from a created token series. ### **Parameters** - `series_id`: string - the series id number - `token_owner_id`: string - the account_id of who will receive the token. - `token_metadata`: optional object - the standard nft token metadata. - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "series_id": "1", 3 "token_owner_id": "receiver-account", 4 "nearapps_tags": { 5 "app_id": "some app tag", 6 "action_id": "1", 7 "user_id": "some-user-tag" 8 } 9} 10 ``` ### **Returns** - `token`: object - the standard nft token information. ### **NFT Series Query** method: `nft_series_get`description: Gets information on a series. ### **Parameters** - `series_id`: string - the series id number ### **Json Example** ``` 1{ 2 "series_id": "1" 3} 4 ``` ### **Returns** - `series`: object - nft series information. - `id`: string - the series id number, - `name`: string - `creator`: string - the account_id of the creator - `len`: string - the number of minted tokens - `capacity`: string - the number of how many tokens can be minted - `is_mintable`: boolean - whether the series can be minted ### **NFT Series Token List** method: `nft_series_get_minted_tokens_vec`description: Get minted tokens from a series. ### **Parameters** - `series_id`: string - the series id number - `from_index`: optional string - the number of how many tokens to skip. - `limit`: optional number - 16-bits number to limit how many tokens to show. ### **Json Example** ``` 1{ 2 "series_id": "1" 3} 4 ``` ### **Returns** - `token_ids`: `string[]` - a list containing the token_id number that were minted under the series. ### **NFT Series Set Mintable** method: `nft_series_set_mintable`description: Sets whether a series is mintable or not. ### **Parameters** - `series_id`: string - the series id number. - `is_mintable`: boolean - choose whether it will be mintable or not. - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "series_id": "1", 3 "is_mintable": true, 4 "nearapps_tags": { 5 "app_id": "some app tag", 6 "action_id": "1", 7 "user_id": "some-user-tag" 8 } 9} 10 ``` ### **Returns** Has no returns. ### **NFT Series Set Capacity** method: `nft_series_set_capacity`description: Sets the token capacity (the token max length) of a series. ### **Parameters** - `series_id`: string - the series id number. - `capacity`: string - choose the number of what the capacity will be. - `nearapps_tags`: object - the tags information. - `app_id`: string - app tag. - `action_id`: string - action number. - `user_id`: string - user account_id tag. ### **Json Example** ``` 1{ 2 "series_id": "1", 3 "capacity": "5", 4 "nearapps_tags": { 5 "app_id": "some app tag", 6 "action_id": "1", 7 "user_id": "some-user-tag" 8 } 9} 10 ``` ### **Returns** Has no returns. ### Analytics Contract Methods: - `new` - `assert_owner` - `owner` - `transfer_ownership` - `log_event` ## Initialization method: `new` description: Initializes the contract. ### **Parameters** - `owner`: string - the account_id of who will own the contract ### **Returns** Has no returns. `transaction hash 8jeTxGou3CpwJM61xkaJwkkG4NXPD49o6gWJHvQzMiVu` ``` 1{"args_json": {"owner_id": "dev-1649184729575-75393162970503"}, 2"args_base64": "eyJvd25lcl9pZCI6ImRldi0xNjQ5MTg0NzI5NTc1LTc1MzkzMTYyOTcwNTAzIn0=", 3"deposit": "0", 4"gas": 30000000000000, 5"method_name": "new" 6} 7 ``` ### **Owner Management** Owner method: `owner` description: Get the contract's owner. ### **Parameters** Has no parameters. ### **Returns** account_id: string - The owner's account_id. `transaction hash 3bxxPYpXaZScvNc6yEcs3FQoo55mfjjRcbASgFhzt56f` ``` 1{"args_json": {}, 2"args_base_64": "e30=", 3"deposit": "0", 4"gas": 30000000000000, 5"method_name": "owner" 6} 7 ``` Returned value: `'dev-1649184729575-75393162970503'` Transfer Ownership method: `transfer_ownership` description: Changes the contract's owner. ### **Parameters** - `owner`: string - the account_id of the next owner who will own the contract ### **Returns** Has no returns. `transaction hash HNHY32GVh1fFzdJ5cNpzgG9P617tEQhUmzpeupaaD8vz` ``` 1{"args_json": {"owner":"dev-1649182007824-64888721472108"}, 2"args_base64": "eyJvd25lciI6ImRldi0xNjQ5MTgyMDA3ODI0LTY0ODg4NzIxNDcyMTA4In0=", 3"deposit": "0", 4"gas": 30000000000000, 5"method_name": "transfer_ownership" 6} 7 ``` ## File Event Logger Log Event method: `log_event` description: Logs event of file operation. ### **Parameters** - `time`: number - time of the operation - `operation`: string - name of the operation - `hash`: string - hash of the operation - `receiver_wallet_id`: string|null - wallet id of file receiver `transaction hash AwtZLLQvvfzk4vpENNHi7A6msinsbGPPPU67Vvie2mTn` ``` 1{"args_json": {"time":4042022,"operation":"transaction completed","transaction_hash":"HNHY32GVh1fFzdJ5cNpzgG9P617tEQhUmzpeupaaD8vz"}, 2"args_base64": "eyJ0aW1lIjo0MDQyMDIyLCJvcGVyYXRpb24iOiJ0cmFuc2FjdGlvbiBjb21wbGV0ZWQiLCJ0cmFuc2FjdGlvbl9oYXNoIjoiSE5IWTMyR1ZoMWZGemRKNWNOcHpnRzlQNjE3dEVRaFVtenBldXBhYUQ4dnoifQ==", 3"deposit": "0", 4"gas": 30000000000000, 5"method_name": "log_event" 6} 7 ``` Logs: ``` 1"logs": [ 2"EVENT_JSON:{"time":4042022,"operation":"transaction completed","transaction_hash":"HNHY32GVh1fFzdJ5cNpzgG9P617tEQhUmzpeupaaD8vz"}" 3], ``` # Components - Indexer Instance and Postgres DB - Amazon MSK - Debeizum - AWS Lambda - Python 3.9 Primelab Custom Python Layer for ETL - Redshift (or choose your own Database) - Docker Container for explorer API # Test Drive The ETL pipeline encompasses several desperate components, each requiring a bit of setup and tinkering to get humming properly. We will start with setting up the Debezium Connector. If you haven’t already, you must setup a indexer instance to install the debezium plug-in into. ### Debezium and Kafka on Postgres In order to stream data from Postgres as a source to a target data store, we use open source tooling in the form of Debezium and Apache Kafka (Kafka). Debezium is a distributed [Change Data Capture](https://en.wikipedia.org/wiki/Change_data_capture) (CDC) tool built on top of Kafka to stream row-level database changes into event streams. Kafka is a distributed event store and stream-processing platform. ### Postgres Setup In order for Debezium to work it needs to use logical decoding with the write-ahead log.  The following parameters need to be set. - wal_level = logical - max_wal_senders = 1 - max_replication_slots = 1 If using AWS you should also set rds.logical_replication = 1. The database also must permit replication with the host that runs the Postgres connector.  For more details see [here](https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-host-replication-permissions). Note that if you are using a postgres cluster, debezium must communicate with the writer / leader node. ### Debezium Connector Setup Debezium provides excellent [documentation](https://debezium.io/documentation/reference/stable/connectors/postgresql.html) on how to setup the Postgres (and many other database flavors) connector.  It is recommended to read the documentation before implementation. ### tl;dr: 1. Create a debezium role in the source database and grant replication privileges. 2. Create a replication group role and grant the debezium user and current table owner access. Assign tables you are interested in capturing to this owner. 3. Create debezium heartbeat and signal tables. 4. Create a publication for the tables you are interested in capturing. ### Details: 1. Debezium needs access to the database in order to capture the data changes. It also needs replication privileges in order to add tables to the publication which publishes the changes. 2. The debezium user needs to be an owner of the tables it is operating on. As we want to assign least privileges (in a dev environment you can assign superuser), we transfer the tables we are interested in capturing to a shared ownership role between the current table owner and the debezium role. This ensures that there is no effect on current database practices whilst allowing debezium the access it needs. 3. A debezium heartbeat table is a simple table which debezium updates periodically to stop connector failure / Postgres replication slots getting clogged up. The issue is documented [here](https://debezium.io/documentation/reference/1.0/connectors/postgresql.html#wal-disk-space) and [here](https://issues.redhat.com/browse/DBZ-1815). It is recommended to add the heartbeat table and in our use case we faced the issues described without it.The [signal table](https://debezium.io/documentation/reference/stable/configuration/signalling.html#debezium-signaling-logging) is used to send messages to Debezium for events such as adding messages to the log or taking ad hoc snapshots. 4. The publication is used by Postgres to ### Kafka Connector Setup Debezium sits on top of [kafka connect](https://kafka.apache.org/documentation.html#connect), and there are multiple options for how this is setup, such as using a VM, [Docker](https://hub.docker.com/u/debezium), [Kubernetes](https://debezium.io/documentation/reference/stable/operations/openshift.html) or a managed Kafka service like [AWS MSK](https://aws.amazon.com/msk/).  See the [deployment documentation](https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-deployment) for more details. First you need to create a kafka cluster.  This is a collection of one or more kafka brokers (or servers) that allows kafka to function in a distributed manner.  It is recommended to have more than one broker to allow for data replication.  Brokers can also fail over time or need to be restarted, so with a single broker you can end up in situations where you can’t write to a topic as the broker has failed. Brokers are managed by [Apache ZooKeeper](https://zookeeper.apache.org/). In order to deploy the Debezium Postgres Connector, you need the following: 1. Debezium postgres connector jar files. 2. Debezium connector properties file. 3. Kafka worker config file. 4. Kafka cluster properties file. The debezium connector properties file contains all of the information relating to the tables you are capturing, the format you want the data in and the database connection information.  There are many options which can be added here and it’s best to consult the documentation for your particular use case. The cluster configuration contains information such as how many partitions you wish to use, the maximum size of individual messages and the number of replicas and replication factor you want to use. The replication factor is the number of times you want to replicate the data in the cluster. For example, if you have a replication factor of 3, then for every message written to the cluster, it will be written 3 times. This is useful for data redundancy in case of broker failure. The worker configuration contains information such as the number of workers you want to use, the number of tasks per worker and the connector class name. The connector class name is the name of the connector you are using, in this case it is the debezium postgres connector. ### Testing Once you have the connector deployed, you can test it by writing to the database and checking that the changes are replicated to the kafka cluster. ### AWS Lambda Setup ### Prerequisites In order to follow this guide, you will need the following: - An AWS account - A text editor - Python 3.6 or later ### Setting up the Lambda Function 1. Log in to the AWS Management Console and navigate to the Lambda service. 2. Click on "Create Function", you will need 4 functions. So maybe pick a schema like primelab-transactions, primelab-accounts etc. 3. Select "Author from scratch". 4. Enter a name for the function and select "Python 3.9" as the runtime. 5. Create a role scoped with access to the MSK Cluster and your receiving data-lake. 6. Click on "Create Function". ### Customizing the Lambda Function 1. In the "Function code" section, select "Edit code inline". 2. Paste the code from the Github Repo, copy one lambda handler to each function you created above. 3. Click on "Save" and Deploy. ### Creating the Dependency Layer In Lambda it is not possible to install python “pip” dependencies within the UI, if you are feeling lazy you can use the layer published here (arn:aws:lambda:us-east-1:165372248390:layer:pandas:3). 1. Start a Cloud9 Linux instance in AWS. Go to the AWS Services and search for Cloud9. Click ‘Create Environment’. Name your environment and click next step. Keep the environment default settings and click next step. Click ‘Create Environment’ and you’re ready to go. 2. Creating your Pandas Lambda layer. Type the following code line by line into the terminal at the bottom to create a Pandas Lambda layer. The pip install pandas command can be replaced with a package of your choosing. You can also install more than 1 package*. ```bash mkdir folder cd folder virtualenv v-env source ./v-env/bin/activate pip install pandas pip install requests deactivate ``` Then type the following code line by line to create your layer ```bash mkdir python cd python cp -r ../v-env/lib64/python3.7/site-packages/* . cd .. zip -r panda_layer.zip python aws lambda publish-layer-version --layer-name pandas --zip-file fileb://panda_layer.zip --compatible-runtimes python3.7 ``` ### Deploying After populating each function with the appropriate code click deploy and move on to adding a trigger. Add the “MSK” trigger and configure to your preference, setting a low threshold for transaction's may be prudent while testing. You should begin seeing transactions populate transformed in their new schema in your destination database. ### Schema ```sql ------------------------------------------------- -- Tables ------------------------------------------------- create table primelab.etl_audits ( etl_audit_id integer generated always as identity ,record_count integer ,audit_timestamp timestamp default current_timestamp ); ------------------------------------------------- -- Constraint ------------------------------------------------- alter table primelab.etl_audits add constraint etl_audits_pkey primary key (etl_audit_id); ------------------------------------------------- -- Views ------------------------------------------------- create or replace view public.finalised_transactions as select ara.receipt_id ,ara.args ,ara.wallet_id ,ara.slice_id ,t.transaction_hash ,t.included_in_block_hash ,t.block_timestamp ,t.status from public.stg_transactions t join public.stg_action_receipt_actions ara on t.converted_into_receipt_id = ara.receipt_id; ------------------------------------------------- -- Procedures ------------------------------------------------- create or replace procedure primelab.move_matched_rows() as $$ begin -- Create a temporary table so we get a consistent view of the transactions at this point create temporary table txn_rec_tmp ( receipt_id text ,args jsonb ,wallet_id text ,slice_id text ,transaction_hash text ,included_in_block_hash numeric(20,0) ,block_timestamp timestamp ,status text ) on commit drop; insert into txn_rec_tmp (receipt_id, args, wallet_id, slice_id ,transaction_hash, included_in_block_hash, block_timestamp, status) select receipt_id, args, wallet_id, slice_id ,transaction_hash, included_in_block_hash, to_timestamp(block_timestamp/ 1000000000), status from public.finalised_transactions; -- Create receipts insert into primelab.receipts(receipt_id, block_hash, status, created_at) select receipt_id, included_in_block_hash, status, block_timestamp from txn_rec_tmp on conflict (receipt_id) do nothing; -- Create wallets insert into primelab.wallets(wallet_id, persona_id, created_at) select wallet_id, 1, block_timestamp /* TO DO - change persona to be dynamic once we have personas */ from txn_rec_tmp where wallet_id is not null on conflict (wallet_id) do nothing; -- Create transactions /*TO DO - Add stack_name*/ with txn_ins as ( insert into primelab.transactions(transaction_id, receipt_id, slice_name ,wallet_id, tags_json, created_at, status) select transaction_hash, receipt_id, slice_id, wallet_id, args, block_timestamp, status from txn_rec_tmp on conflict (transaction_id) do nothing returning transaction_hash ) -- Write to audit table insert into primelab.etl_audit (record_count) select count(*) from txn_ins; -- Now delete these from the staging tables -- Commented out for now -- delete from public.stg_transactions as t -- using txn_rec_tmp as trt -- where t.transaction_hash = trt.transaction_hash; -- delete from public.stg_action_receipt_actions as ara -- using txn_rec_tmp as trt -- where ara.receipt_id = trt.receipt_id; end; $$ language plpgsql; ``` ## Natural Language API ## Problem statement Oftentimes, the business depends on the analytics team for any kind of ad-hoc analysis to get meaningful insights from the data or answers from them. But this kind of deviates both the teams. It builds a dependency of the business on the data analyst to write the necessary codes to get the answers to their questions, which takes time. It also affects the data analysts for their long-term work if too many ad-hoc questions start coming in. What if there was a way that would enable the business to directly ask the questions to the data itself and somehow, automagically get the answers from it? ## Solution - An Artificial Intelligence powered app that understands English ### **How the app works** We have created an AI-powered app (With the help of the GPT3 engine) where the users can ask any questions about the data in simple English. Now a powerful AI agent will run in the backend which will parse this English question, understand its meaning, generate python codes, and run them in the backend to get the correct answer for the question. ### **How the AI agent works** GPT-3 is a language model based on the transformer architecture, pre-trained in a generative, unsupervised manner that shows decent performance in zero/one/few-shot multitask settings. It works by predicting the next token given a sequence of tokens and can do so for NLP tasks it hasn’t been trained on. After seeing just a few examples, it reached state-of-the-art levels in some benchmarks such as machine translation, Q&A, and also content generation. We used this powerful pretrained model and use its embedding to parse user questions, generate their corresponding embeddings and then translate it into the vector space for writing the corresponding python codes that answer the original question. ### Running the code 1. Clone the repository here [NLPQ](https://github.com/NearPrime/Primelab-ETL/tree/main/NLPQ) 2. run `pip install -r requirements.txt` 3. From outside the fastapiapp_v2 folder, run uvicorn fastapiapp_v2.main:app --reload --workers 1 --host 0.0.0.0 --port 8001 4. Go to [http://localhost:8001/docs](http://localhost:8001/docs) 5. Here you will see two things you can try out...one is get transactions where you can skip rows and select how many rows you wanna see and the second one is given a transaction_hash, it will return the whole row to you ## App demo ### **a) Direct Answers** The following 2 min video shows this app in action. We took a sample of NEAR data and tested the app with it. All the user needs to do is ask their questions in simple English and then they get the answer from the data in real-time as the AI agent writes the codes by itself. Some examples of questions might be a) How many transactions happened in total? b) How many unique users are there? c) Who are the top 5 users who did the highest number of transactions in March 2022? etc… [Near Protocol Query Assistant.mkv](https://github.com/NearPrime/Primelab-ETL/blob/main/docs/NEAR_AI_assistant_for_business.mkv?raw=true) ### **b) Visualization** We are also adding a separate section to this app where the AI can also generate visualization from the data. Currently, this is in the beta stage and we need to feed it more training examples. But here are some initial results. ### **1. Plot the daily time series of new users** ![Daily time Series](https://github.com/NearPrime/Primelab-ETL/blob/main/docs/image-20220406-070456.png?raw=true) ****2. Plot the daily time series of returning users**** ![Daily returning users](https://github.com/NearPrime/Primelab-ETL/blob/main/docs/image-20220406-071327.png) ****3. Plot the top 5 signer_account_id who did the highest numbers of transactions**** ![Top 5 Signer](https://github.com/NearPrime/Primelab-ETL/blob/main/docs/image-20220406-070643.png) ****4. Plot the histogram of receipt_conversion_gas_burnt**** ![Histogram](https://github.com/NearPrime/Primelab-ETL/blob/main/docs/image-20220406-071202.png) ## Useful Links [Debezium Postgres Documentation](https://debezium.io/documentation/reference/stable/connectors/postgresql.html) [Debezium Zulip Message Board](https://debezium.zulipchat.com/#all_messages) [Kafka Connect Documentation](https://kafka.apache.org/documentation/#configuration) [AWS Example Walkthrough](https://garrett-jester.medium.com/build-a-real-time-backend-infrastructure-with-aws-msk-rds-ec2-and-debezium-1900c3ee5e67)[AWS MSK Coinbase Article](https://blog.coinbase.com/how-we-scaled-data-streaming-at-coinbase-using-aws-msk-4595f171266c) ## Party Time ## Release Roadmap
marlonbarrios_near-guest_book
.eslintrc.yml .github dependabot.yml workflows deploy.yml tests.yml .gitpod.yml .travis.yml README-Gitpod.md README.md as-pect.config.js asconfig.json assembly __tests__ as-pect.d.ts guestbook.spec.ts as_types.d.ts main.ts model.ts tsconfig.json babel.config.js neardev shared-test-staging test.near.json shared-test test.near.json package.json src App.js config.js index.html index.js tests integration App-integration.test.js ui App-ui.test.js
Guest Book ========== [![Build Status](https://travis-ci.com/near-examples/guest-book.svg?branch=master)](https://travis-ci.com/near-examples/guest-book) [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/near-examples/guest-book) <!-- MAGIC COMMENT: DO NOT DELETE! Everything above this line is hidden on NEAR Examples page --> Sign in with [NEAR] and add a message to the guest book! A starter app built with an [AssemblyScript] backend and a [React] frontend. Quick Start =========== To run this project locally: 1. Prerequisites: Make sure you have Node.js ≥ 12 installed (https://nodejs.org), then use it to install [yarn]: `npm install --global yarn` (or just `npm i -g yarn`) 2. Run the local development server: `yarn && yarn dev` (see `package.json` for a full list of `scripts` you can run with `yarn`) Now you'll have a local development environment backed by the NEAR TestNet! Running `yarn dev` will tell you the URL you can visit in your browser to see the app. Exploring The Code ================== 1. The backend code lives in the `/assembly` folder. This code gets deployed to the NEAR blockchain when you run `yarn deploy:contract`. This sort of code-that-runs-on-a-blockchain is called a "smart contract" – [learn more about NEAR smart contracts][smart contract docs]. 2. The frontend code lives in the `/src` folder. [/src/index.html](/src/index.html) is a great place to start exploring. Note that it loads in `/src/index.js`, where you can learn how the frontend connects to the NEAR blockchain. 3. Tests: there are different kinds of tests for the frontend and backend. The backend code gets tested with the [asp] command for running the backend AssemblyScript tests, and [jest] for running frontend tests. You can run both of these at once with `yarn test`. Both contract and client-side code will auto-reload as you change source files. Deploy ====== Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contracts get deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how. Step 0: Install near-cli -------------------------- You need near-cli installed globally. Here's how: npm install --global near-cli This will give you the `near` [CLI] tool. Ensure that it's installed with: near --version Step 1: Create an account for the contract ------------------------------------------ Visit [NEAR Wallet] and make a new account. You'll be deploying these smart contracts to this new account. Now authorize NEAR CLI for this new account, and follow the instructions it gives you: near login Step 2: set contract name in code --------------------------------- Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'your-account-here!' Step 3: change remote URL if you cloned this repo ------------------------- Unless you forked this repository you will need to change the remote URL to a repo that you have commit access to. This will allow auto deployment to GitHub Pages from the command line. 1) go to GitHub and create a new repository for this project 2) open your terminal and in the root of this project enter the following: $ `git remote set-url origin https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git` Step 4: deploy! --------------- One command: yarn deploy As you can see in `package.json`, this does two things: 1. builds & deploys smart contracts to NEAR TestNet 2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere. [NEAR]: https://near.org/ [yarn]: https://yarnpkg.com/ [AssemblyScript]: https://www.assemblyscript.org/introduction.html [React]: https://reactjs.org [smart contract docs]: https://docs.near.org/docs/develop/contracts/overview [asp]: https://www.npmjs.com/package/@as-pect/cli [jest]: https://jestjs.io/ [NEAR accounts]: https://docs.near.org/docs/concepts/account [NEAR Wallet]: https://wallet.near.org [near-cli]: https://github.com/near/near-cli [CLI]: https://www.w3schools.com/whatis/whatis_cli.asp [create-near-app]: https://github.com/near/create-near-app [gh-pages]: https://github.com/tschaub/gh-pages
lk2684753_sd-cloud
.eslintrc.js .umirc.ts .vscode launch.json LICENSE.md README.md contract Cargo.toml build.sh neardev dev-account.env src account.rs did.rs file.rs lib.rs view.rs target .rustc_info.json release .fingerprint Inflector-5afbffc1f381f40a lib-inflector.json borsh-derive-37f3684d5cb01175 lib-borsh-derive.json borsh-derive-45b950d6a7b500cf lib-borsh-derive.json borsh-derive-internal-329a136cb26311dd lib-borsh-derive-internal.json borsh-derive-internal-406e23a6328a4192 lib-borsh-derive-internal.json borsh-schema-derive-internal-7a37565d078e5842 lib-borsh-schema-derive-internal.json borsh-schema-derive-internal-fd7bce32aed98510 lib-borsh-schema-derive-internal.json near-sdk-macros-efe35bf3b3cda61d lib-near-sdk-macros.json proc-macro-crate-6b46bb38bbb1c722 lib-proc-macro-crate.json proc-macro2-3f3e5a4732316711 run-build-script-build-script-build.json proc-macro2-55bfb3e4f228a961 build-script-build-script-build.json proc-macro2-7a77192ef9a734fd lib-proc-macro2.json quote-f6213aecc1b2bb0d lib-quote.json ryu-803539c7b561c7c2 build-script-build-script-build.json serde-207b3833f8c327b7 build-script-build-script-build.json serde-4db6fd88a36cb728 build-script-build-script-build.json serde-b1b52f426434b0c1 run-build-script-build-script-build.json serde-b251edf264d6b47e lib-serde.json serde_derive-4ad457bdb875e6a9 build-script-build-script-build.json serde_derive-b6a9f242a150de35 run-build-script-build-script-build.json serde_derive-c578d5a542f567ac lib-serde_derive.json serde_json-96390a8406576983 build-script-build-script-build.json syn-b38151015e4608a2 build-script-build-script-build.json syn-c72827fdc4fcee09 lib-syn.json syn-e0177b2227736eae run-build-script-build-script-build.json toml-90c281f2b03cabf1 lib-toml.json unicode-xid-04bf0a324076e980 lib-unicode-xid.json wee_alloc-313ada6273a678f7 build-script-build-script-build.json wasm32-unknown-unknown release .fingerprint ahash-a666a18ce4bdc94b lib-ahash.json base58-815f39f1e450abe0 lib-base58.json base64-1ed1d53a0bb4ede3 lib-base64.json borsh-4808e1c74238ac5a lib-borsh.json borsh-7e11bdfd5cefdcc5 lib-borsh.json bs58-fb56fd8419b90e44 lib-bs58.json cfg-if-965cb580b6e327c6 lib-cfg-if.json file_store-fc1e326629ca9d02 lib-file_store.json hashbrown-5fad88fbb676dcdb lib-hashbrown.json itoa-68e9e0218e255b21 lib-itoa.json memory_units-10d989eac0bc614d lib-memory_units.json near-sdk-74e0a41bcc33f068 lib-near-sdk.json near-sys-67a5d6f960707cbb lib-near-sys.json ryu-77f7b43ca0fef011 lib-ryu.json ryu-fab1af5791b319cf run-build-script-build-script-build.json serde-503a705e7ff3f259 run-build-script-build-script-build.json serde-50cd1b5fd02f3a29 lib-serde.json serde_json-35973d41b2116194 run-build-script-build-script-build.json serde_json-99aca39bb0d85217 lib-serde_json.json wee_alloc-03630b35ebe68bb6 lib-wee_alloc.json wee_alloc-3004284b32418a0d run-build-script-build-script-build.json build wee_alloc-3004284b32418a0d out wee_alloc_static_array_backend_size_bytes.txt docs Concepts.md Creating a NEAR Account.md package.json public start index.html js TweenMax.min.js demo.js lib draco draco_wasm_wrapper.js src app.ts assets font latinExt.css components HomeCarouselItem SettingItem NewNodeForm index.css global.ts locales en-US.ts en-US home.ts login.ts zh-CN.ts zh-CN home.ts login.ts models fileModelInfo.ts globalTop.ts pages demo model.ts menu model.ts node components worldMap StaticMap.svg utils cluster config.ts fileImport.ts findeAddr.ts common.ts contract index.ts copyText.ts files recentlyFiles.ts sylEncryption.ts uploadFiles.ts filter index.ts g2 china.js data-set.min.js near config.ts helper-api.ts index.ts tmp_fetch_send_json.ts readFile.js string.ts uploadDist index.js ipfs.js upload.js tsconfig.json typings.d.ts web index copy.css index.css index.html index.js
<p align="center" style = {text-align:center}> <img src="https://bafybeidfio3womq6nci2pkptilegjwehmgfz5kbjussd6toovjdo63vb7u.ipfs.dweb.link/logo.png" /> <br/><br/> <b>New web3 storage cloud dapp developed by based on NEAR and Filecoin Ecology</b> <br/><br/> </p> ## 📖 Introduction Based on the `NEAR` public chain, combined with the distributed storage technology `IPFS` and `Filecoin`, you can store your files in the [SDCloud](https://sdcloud.on.fleek.co/). - [Creating a NEAR account](https://github.com/lk2684753/sd-cloud/blob/main/docs/Creating%20a%20NEAR%20Account.md) - [Storage concept](https://github.com/lk2684753/sd-cloud/blob/main/docs/Concepts.md) - [Features](https://github.com/lk2684753/sd-cloud#-features) - [How to use](https://github.com/lk2684753/sd-cloud#-how-to-use) - [Content-persistence](https://github.com/lk2684753/sd-cloud#%EF%B8%8F-content-persistence) - [Video tutorials](https://youtu.be/qeJCufNAhI0) - [Data-policy](https://github.com/lk2684753/sd-cloud#%EF%B8%8F-data-policy) - [Discord channel for support](https://discord.gg/vB5Y4ZR2st) - [Telegram channel for support](https://t.me/+WF6U4DMqkPkxODU1) ## 🚀 Features - You can start storing your files in minutes. - Filecoin offers persistent, decentralized storage - guaranteeing the integrity of the underlying data through a robust economic model while also providing cryptographic proofs for verifiability. - IPFS offers content addressing. - Write smart contracts in Rust on NEAR, you only pay a small fee for NEAR as file storage. - Support multiple file type preview function. - The NEAR contract records the order information stored in the file, such as viewing the file storage time, file hash value, storage user, file storage life cycle, storage order amount, status, data encapsulation and other information. - Applications where users store encrypted data on Filecoin can only be decrypted by the user using the NEAR private key, thus maintaining ownership of their data. ## ⚔️ Content persistence Broadly speaking, much of today's web operates using what is known as location addressing. Location addressing retrieves online information from specific locations on the web ─ i.e. from behind URLs. However, this approach has some critical problems. Location addressing is centralized, meaning that whoever controls that location controls the content. The controller can change the content, completely replace it, or just take it away. This means location-based addresses are vulnerable to attacks, exploitation, and loss. One part of an approach to decentralizing this legacy way of operating the web entails implementing a new kind of addressing: content addressing. Content addressing is the technique of issuing each piece of data a content identifier (CID), which is a token derived directly from the file's contents using an algorithm that will always generate the same key for the same content. Using content addressing, files can be queried and retrieved based on what they are, not where they are — one major ingredient in enabling the web to break free from centralized content control. However, content addressing is only part of the solution. SDCloud uses CIDs generated by IPFS, the InterPlanetary File System, to enable content addressing for all data stored in its network — however, just because a file has a CID doesn't mean that the file is guaranteed to be around forever. In a well-operating decentralized system, participants all need to agree to be good actors and provide reliable storage capacity. For this,SDCloud uses the Filecoin network. The Filecoin network and its namesake token FIL (or ⨎ for short) were created to incentivize storage providers on the network to agree to storage deals. These deals specify that a certain amount of storage capacity will be provided over an agreed period of time, ensuring the second part of the solution: content persistence. ## 🛠 How to use Store files in SDCloud in just a few steps! ### 💨LOGIN WITH NEAR ACCOUNT Your SDCloud page will be claimed with your NEAR ID (example.near). ![workbench](https://user-images.githubusercontent.com/42611777/153567395-f9a2813d-1056-4eb8-800f-ad0298ba8fc2.png) ### 💨CHOOSE TO STORE YOUR FILES Based on the NEAR public chain, combined with the distributed storage technology IPFS and Filecoin, every step of your file operations will be recorded on the NEAR chain! ![文件无状态](https://user-images.githubusercontent.com/42611777/150929099-fad5f456-1ae8-4ff6-ae59-274e8a389703.png) ### 💨LOGIN WITH NEAR ACCOUNT You can view each file information, we support preview, share and other functions. ![文件无状态备份](https://user-images.githubusercontent.com/42611777/150929138-06f8e7f1-2d08-496e-9422-7191558560bc.png) ## 🚀Value ecosystems NEAR is a decentralized application platform built to bridge the users of today's Internet to the blockchain-based web of the future. NEAR is a PoS Layer 1 blockchain platform, built with UX and DevX in mind. NEAR's novel sharding mechanism, Nightshade, parallelizes computation on chain and automatically increases capacity when needed, resulting in theoretically infinite scalability. Filecoin is a decentralized peer-to-peer storage network, allowing anyone to store and validate large-scale data as part of a global, 8-exabyte (and growing) network. Under the hood, all Filecoin nodes use the InterPlanetary File System (IPFS), a content-addressed protocol for storing and sharing data. SDCloud can change that; Let more developers and enthusiasts pay attention to NEAR ecology and participate in it to jointly build the ecological prosperity of the community. On the Filecoin ecosystem, we've been following community dynamics, participating in the XMINER program, and making suggestions on community Slack. We will try to build our new Web3 application using tools and services such as Web3. storage, Filcosin-Near Bridge, etc. We have our own storage miner node, and we need more real data to be stored in our node; It's not just us, of course. I'm sure there are a lot of storage miners out there who would like to have more real data to replace the zero data and fulfill Filecoin's vision. During the development process, we actively communicate with the NEAR&Filecoin community members, feedback the NEAR&Filecoin community members provide development SDK problems encountered; We believe that community members will be happy to receive our feedback; We believe that in the future the NEAR&Filecoin community will become ecologically diverse due to the continuous efforts of developers like us. ## ⚙️ Data policy You control your data! SDCloud doesn't keep your personal data; You can delete personal data from your account at any time. SDCloud has no advertising and does not sell your data; Your data is securely stored on the NEAR &IPFS&FILECOIN network. ## 📄 License Source code in `SDCloud` is available under the [Apache-2.0 License](/LICENSE). ## 🔋 JetBrains OS licenses `sdcloud` had been being developed under the **free JetBrains Open Source license(s)** granted by JetBrains s.r.o., hence I would like to express my thanks here. <a href="https://www.jetbrains.com/?from=ants" target="_blank"><img src="https://raw.githubusercontent.com/panjf2000/illustrations/master/jetbrains/jetbrains-variant-4.png" width="250" align="middle"/></a> ## ☕️ Buy me a coffee > ETH: 0xDfB60De06De984cD63Aa333e97Cd701B503dc456 > > FIL:f1ogknwo766wvyqfv4kkdine2xava4g6dmb2b7oca > > NEAR:lk2684753.near ## ⛱ Support ![编组 20](https://user-images.githubusercontent.com/42611777/150927672-2957f71a-adcd-4a5d-95d0-fa8231bd61fe.png) ## 📄[Advice feedback](https://surveytools1.fundingthecommonshub.io/surveys/pln-nps-survey?organization=SDcloud)
nearprotocol_nomicon
README.md book.toml build.sh docs BlockchainLayer BlockchainLayer.html Transactions.html BlockchainLayerVsRuntimeLayer.html FontAwesome css font-awesome.css fonts fontawesome-webfont.svg GenesisConfig ExtCostsConfig.html GenesisConfig.html RuntimeConfig.html RuntimeFeeConfig.html RuntimeFeeConfig AccessKeyCreationConfig.html ActionCreationConfig.html DataReceiptCreationConfig.html Fee.html Fraction.html StorageUsageConfig.html VMConfig.html Primitives Account.html Primitives.html Runtime Actions.html Components BindingsSpec BindingsSpec.html ContextAPI.html EconomicsAPI.html MathAPI.html MiscellaneousAPI.html PromisesAPI.html RegistersAPI.html TrieAPI.html Components.html RuntimeCrate.html FunctionCall.html Receipts.html Runtime.html Scenarios CrossContractCall.html FinancialTransaction.html Scenarios.html Transactions.html ayu-highlight.css book.js clipboard.min.js css chrome.css general.css print.css variables.css elasticlunr.min.js highlight.css highlight.js images receipt_flow_diagram.svg runtime_architecture.svg index.html mark.min.js print.html searcher.js searchindex.js searchindex.json tomorrow-night.css src BlockchainLayer BlockchainLayer.md Transactions.md BlockchainLayerVsRuntimeLayer.md CoreDataTypes.md DataTypes.md GenesisConfig ExtCostsConfig.md GenesisConfig.md RuntimeConfig.md RuntimeFeeConfig.md RuntimeFeeConfig AccessKeyCreationConfig.md ActionCreationConfig.md DataReceiptCreationConfig.md Fee.md Fraction.md StorageUsageConfig.md VMConfig.md Primitives AccessKey.md Account.md Primitives.md Transaction.md README.md Runtime AccountStorage.md Actions.md Components BindingsSpec BindingsSpec.md ContextAPI.md EconomicsAPI.md MathAPI.md MiscellaneousAPI.md PromisesAPI.md RegistersAPI.md TrieAPI.md Components.md RuntimeCrate.md FunctionCall.md Receipts.md Runtime.md Scenarios CrossContractCall.md FinancialTransaction.md Scenarios.md Transactions.md SUMMARY.md images receipt_flow_diagram.svg runtime_architecture.svg
# Nearnomicon http://nomicon.io/ Implementation details of the NearProtocol client. ## Installation ```sh cargo install mdbook ``` ## Modifying the content MdBook can automatically rebuild the content when it detects the changes. Run the following from the root to rebuild automatically: ```sh mdbook watch ``` To force rebuild run: ```sh mdbook build ``` To serve the mdbook while editing it, run: ```sh mdbook serve ``` ## Adding new chapters Adding new chapters requires updating `src/SUMMARY.md` file. ## Latex See [mdBook and MathJax](https://rust-lang-nursery.github.io/mdBook/format/mathjax.html) for using Latex. # The Nearnomicon Nearnomicon contains the following information about the components of the NearProtocol client, with the goal to help with the collaboration: - High-level overview of the components and how they interact, including APIs; - Data-structures; - Things that are not yet implemented or replaced with temporary solutions; - Assumptions that each component makes.
NEAR-Edu_nearandfar
.vscode settings.json README.md lerna.json package.json src .vuepress clientAppEnhance.js config.ts configs index.ts navbar en.ts index.ts sidebar en.ts index.ts public images logos near_icon.svg activities README.md scavenger-hunt-standard.md computer README.md index.md internet README.md near README.md web2 README.md web3 README.md
# NEAR and FAR from _any_ Coding An introductory course to NEAR for non-programmers ## This is the project folder for the course website - built with [VuePress 2](//v2.vuepress.vuejs.org/) - used the [VuePress Mix Theme](//vuepress-theme-mix.vercel.app/) ### To run this site locally: - Clone this repo - Open your terminal cd to the root folder of this project and run `yarn` - `yarn dev` - spins up a dev server at `localhost:8080` - `yarn clean` - cleans the directory using the configs from `lerna.json` - `yarn build` - builds the static site in the `public` directory --- next: '/web2/' --- <!-- <ClientOnly> <SheildDetect/> </ClientOnly> --> # 2. You and the Internet --- ## Introduction <div class="asset-container" style="position:relative;top:-25px;"> <img :src="$withBase('/images/course/int_sl_intro.png')" alt="neighborhood and network" class="slide"> </div> ### The Internet is a Network (of networks) of Computers :satellite: #### Think of your neighborhood. How is it organized? <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_net.png')" alt="neighborhood" class="slide"> </div> - houses connect to each other through shared **interfaces** - electrical grids - sewage - waste management - each house has its own address - clusters of houses comprise neighborhoods - apartment buildings can be considered neighborhoods with each floor being a cluster of condos, have one main entrance, and maybe a front desk, to handle traffic in / out of the building - neighborhoods help cities manage how resources are distributed - some neighborhoods are very densely populated :house_buildings::house_buildings::house_buildings: - some neighborhoods are spread out :house::desert::desert::house: ## _Interfaces_ of the Internet <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_ip.png')" alt="network diagram" class="slide"> </div> #### the internet is organized in a similar way to your neighborhood - networks generally have one Network Access Point (NAP) to handle traffic in / out of the network - networks facilitate traffic (data) across the internet - some networks are densely populated :computer: :computer: :computer: - some are sparsely populated:computer: :desert: :desert: :computer: ### peripheral interfaces - clusters ( or **modules**) of computers, called **nodes**, comprise networks - these network computers are not designed to be used like your personal computer - they are referred to as **nodes** to help clarify the distinction ### software interfaces - computers connect to each other through their network **interfaces** - ethernet 2.0 - IEEE 802.11 - VPC / VPN - each computer has an address ::: tip mailboxes When you mail a letter, you must properly address it, add correct postage, and any other rules or protocols set up by your region's mail delivery system or it will be returned. Networking **nodes** and **modules** isn't all that different (I mean, it is! But you get the idea ) ::: ---- #### Neighborhood health relies on people getting along, usually through some set of rules every neighbor agrees to follow - some neighborhoods have HOAs - some neighborhoods have community boards - some employ neighborhood watch shifts - some have regular block parties <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_net-health.png')" alt="neighborhood and network" class="slide"> </div> --- <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_net-diag-simple.png')" alt="neighborhood and network" class="flex-multi-row"> <img :src="$withBase('/images/course/int_sl_net-diag-mid.png')" alt="neighborhood and network" class="flex-multi-row"> <img :src="$withBase('/images/course/int_sl_net-diag-big.png')" alt="neighborhood and network" class="flex-multi-row"> </div> <small style="margin: 0 0 0 25%;">three diagrams demonstrating progressively complex network systems</small> ---- #### _Network_ health relies on good node-to-node communication, and good module-to-module communication - each network has at least one Network Access Point (**NAP**) - _i.e. a front desk_ - outsiders must talk to the front desk of your apartment building in order to talk to you - these connections need to agree on basic rules called **protocols** that every **node** and **module** (cluster of nodes) must follow - network protocols ensure that a connection between any two **nodes** will be available, reliable, and consistent 24 / 7 #### The set of rules that comprise how the internet works are called Internet Protocols (IP) - Each node connected to the internet must have its own **IP address** so other nodes can find it. --- ## _Data_ and the internet <div class="asset-container"> <img :src="$withBase('/images/course/int_data-st.jpg')" alt="Twin Datas from Star Trek"> </div> #### Internet data is about connectivity - **data** travels through the internet from one node to another until it reaches it's destination IP address. - think of it as the difference between a letter and the entire postal system - what is the "data" of a letter? - journal entry? :heavy_check_mark: - to / from addresses? :heavy_check_mark: - stamp? :heavy_check_mark: - what is the "data" of a postal system? - routes? :heavy_check_mark: - zipcodes? :heavy_check_mark: - letter / package volume? :heavy_check_mark: #### data is handled in two basic ways on the internet <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_data.png')" alt="neighborhood and network" class="slide"> </div> ### **data in motion** :runner: - data is broken down into packets - data reassembles when it reaches its destination ### **data at rest** :sleeping: - some data is cached at NAPs - _your building's front desk "caches" info for all tenants_ - i.e. _"Notice to all tenants: there will be..."_ - service outages :skull_and_crossbones: - nodes go offline - routers fail - congestion :traffic_light: - data packets are cached in the nearest node - networks spin back up, and data packets resume travel - errors often occur when systems shutdown mid-execution ---- ## _Time_ and the internet :clock11: <div class="asset-container"> <img :src="$withBase('/images/course/int_time_sync-diag.png')" alt="network time diagram" style="max-width: 40%;"> <img :src="$withBase('/images/course/int_sl_net-sync-time.png')" alt="network time sync diagram"> </div> - Network Time Protocols (NTP) help networks sync time - one node is cast as the **layer 1** source of truth - other nodes that sync with this node become **layer 2** nodes - other nodes that sync to layer 2 nodes become **layer 3** nodes, etc. - accuracy to 1ms - that's a long time for modern networks - if I have $100 and a super fast connection, I can wire you $100, my friend Bob $100, and my other friend Alice $100 - all before my bank realizes what happened. - Your internet relies on whatever the network _thinks_ is the correct time. - it assumes the time given it by the network is trustworthy #### We need to adjust and re-adjust how our computers measure time - Y2K - Date formatted as YY instead of YYYY - '97...'98...'99...:fearful: - Y2038 - Unix time - counting the seconds since 1970 - Imagine if a system could only count to 2,147,483,648 seconds - and resets to zero each second after that... - we don't need to imagine it - just wait until 2038 --- ## Your Relationship with the Internet <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_the-web.png')" alt="the 90s web" class="slide"> </div> ---- ### _Identity_ <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_comic.png')" alt="early internet comic" class="slide"> </div> - Your IP Address is your identity - I may not know _who_ you are, but I know _where_ you're calling from ---- ### _Ownership_ #### Who owns the internet? Not you! <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_own.png')" alt="internet ownership" class="slide"> </div> - you don't own your apartment building or the roads and sidewalks that make it accessible - businesses built their own networks and eventually agreed to connect those networks - network owners can take a node or entire network offline - your computer's access to the internet is entirely governed by centralized networks - You are at their mercy - You pay for a service, not a right - you have no say in how internet protocols are decided ---- ## _Structure_ of the internet :classical_building: <div class="asset-container"> <img :src="$withBase('/images/course/int_sl_struct.png')" alt="neighborhood and network" class="slide"> </div> - The Internet is **distributed** - It doesn't go down when one node or network goes offline - _your_ internet going down isn't the same as _the_ internet going down - The Internet _used_ to be **decentralized** - One computer connected to another computer, and so on - The Internet quickly became **centralized** - each network has one access point (NAP) - one door to open or close - one point of failure for the entire network - network owners in control - access decided by a small group of people - vast distributed systems with numerous access points still controlled by a a handful of decision makers --- ## Quiz <div class="asset-container"> <ClientOnly> <Quiz2 :nextChapter="$frontmatter['next']"/> </ClientOnly> </div> # Exploring Contracts No matter what you end up doing in web3, you will eventually need to understand what’s going on in a smart contract since it connects us to the blockchain. Just remember, source code is just a set of instructions. It’s written by humans, and should be readable by humans. ## :mag_right: Scavenger Hunt We all know what a scavenger hunts are. They task us with finding certain things in unfamiliar territory. It’s a great way to explore unfamiliar spaces, and that’s exactly what we will be doing today. This exercise is about getting familiar reading code. There is no writing code, but by the end, you will be able to make sense and reason about what is going on a simple AssemblyScript contract. Just pretend you’re strolling through a museum looking at art. Some art you might understand, and some might seem very puzzling. That’s all you’re doing here. You’re just strolling through a page of code, and seeing what you think of it. Ok, You ready? Just take 15-20 seconds max to glance through it. Seriously, it’s fine. It’s just instructions written by a human, so it needs to be readable by humans too! Ok here it comes... ## Contract ```tsx import { context, logging, storage, PersistentDeque } from "near-sdk-as"; /** * showYouKnow is a * - "view" function (ie. does not alter state) * - that takes no parameters * - and returns nothing * * - it has the side effect of appending to the log */ export function showYouKnow(): void { logging.log("showYouKnow() was called"); } /** * sayHello is a * - "view" function (ie. does not alter state) * - that takes no parameters * - and returns a string * * - it has the side effect of appending to the log */ export function sayHello(): string { logging.log("sayHello() was called"); return "Hello!"; } /** * sayMyName is a * - "call" function (although it does NOT alter state, it DOES read from context) * - that takes no parameters * - and returns a string * * - it has the side effect of appending to the log */ export function sayMyName(): string { logging.log("sayMyName() was called"); return "Hello, " + context.sender + "!"; } /** * saveMyName is a * - "call" function (ie. alters state) * - that takes no parameters * - saves the sender account name to contract state * - and returns nothing * * - it has the side effect of appending to the log */ export function saveMyName(): void { logging.log("saveMyName() was called"); storage.setString("sender", context.sender); } /** * saveMyMessage is a * - "call" function (ie. alters state) * - that takes one parameters * - saves the sender account name and message to contract state * - and returns nothing * * - it has the side effect of appending to the log */ export function saveMyMessage(message: string): bool { logging.log("saveMyMessage() was called"); assert(message.length > 0, "Message can not be blank."); const messages = new PersistentDeque<string>("messages"); messages.pushFront(context.sender + " says " + message); return true; } /** * getAllMessages is a * - "view" function (ie. does not alter state) * - that takes no parameters * - reads all recorded messages from contract state (this can become expensive!) * - and returns an array of messages if any are found, otherwise empty array * * - it has the side effect of appending to the log */ export function getAllMessages(): Array<string> { logging.log("getAllMessages() was called"); const messages = new PersistentDeque<string>("messages"); let results = new Array<string>(); while (!messages.isEmpty) { results.push(messages.popBack()); } return results; } ``` In that 20 seconds what do you *think* might be going on? It’s totally fine if you have no idea, and got caught up in the pretty colors (syntax highlighting); that’s supposed to happen. This is an AssemblyScript code. Contracts built for NEAR can also be written in Rust. Now that you have a sense of what a contract looks like, let’s start the hunt: ## **First Step: Identifying** *Note, some of these may only take you **a few seconds** to complete so don't overthink things. This activity is about exposure to smart contracts written using AssemblyScript for the NEAR platform.* Find examples of the following (*HINT*: read ****the comments 😉 ): - [ ] a contract method that takes no parameters - [ ] a contract method that takes one parameter - [ ] a contract method that returns something - [ ] a contract method that does *not* return something - [ ] a contract method that is considered a “view” call - [ ] a contract method that is considered a “call” function Without know much of anything about this contract, you found 4 types of methods(functions), and 2 types of contract-specific methods. Congratulations! You know read your first AssemblyScript contract 🥳 ## **Second Step: Reasoning** *Let’s drill a little deeper, and try to figure out what this contract actually does. You may already have an idea from the previous step, since the developer who wrote this contract comments their code* 🙏 1. From just reading the code(ie method names, comments, parameters, return values, etc.) what do you think a good name for this contract should be? 1. Look at the very first line of the code that starts with `import` 1. What would you guess each resource that’s imported from `near-sdk-as` does? 2. Spend about 10 seconds on each resource, and see where it appears in the code. Look at how each one is used, and try to reason what each one might be doing in just a few words: - [ ] context - [ ] logging - [ ] storage - [ ] PersistentDeque 2. Finally, what general questions do you have about this contract? Is it doing everything you think it should be doing? Based on the name you gave it, what else do you think it should do? You did it! You’ve both read and reasoned about a smart contract! I mean, there’s a ton more to learn about contracts, but this is a solid first step. --- next: '/web3/' --- <!-- <ClientOnly> <SheildDetect/> </ClientOnly> --> # 3. You and Web2.0 <div class="asset-container"> <img :src="$withBase('/images/course/web2_sl_intro.png')" alt="web 2 intro" class="slide"> </div> ---- ## Introduction <div class="asset-container"> <img :src="$withBase('/images/course/web2_sl_web2.png')" alt="web1 vs web2" class="slide"> </div> - neighborhood layout vs block parties - infrastructure vs information - highway vs rush hour (and billboards and bus rides...) - _network_ **interfaces** vs _web_ **interfaces** ::: tip what about web 1?? - Web1.0 worked like a giant encyclopedia - it can be considered a content delivery network (CDN) - content was simply delivered to your computer - _generally_ you couldn't update the information served to you. - Web2.0 extended how the web was used by allowing users to "interact" more with the web - think of the book "Tarzan" vs the book "Choose your own adventure: Tarzan" (or "MadLibs: Tarzan") ::: ---- ### The web is the information users access on the internet - it's the mail that is delivered to houses in your neighborhood #### Web _interfaces_ = applications and browsers - application interfaces interpret each other's instructions - Application Programming Interface (**API**) - APIs are each application's **interpreter** when other applications talk to them ---- #### The Web is servers and clients - servers and clients are computers - servers are the _back_ end of the web - clients are the _front_ end of the web - clients make requests to servers - servers listen and respond to requests from clients - servers talk to other servers on behalf of clients ::: tip How do servers "listen"? Servers use **ports** to listen for events. Ports are like your mailbox. Your mailbox isn't your address, but it's where you send and receive mail. Ports are like a server's mailbox. ::: <div class="asset-container"> <img :src="$withBase('/images/course/web2_sl_servers-everywhere.png')" alt="web 2 intro" class="slide"> </div> - your keyboard sends requests to the input server running on your computer that listens and responds to every key you press - your dog's smart collar is a server - servers just need a port so they can listen and respond to requests - web servers are servers that use web protocols like "http" ::: tip why are appliances becoming "smart" now? - more and more consumer goods now have tiny servers in them ##### for example: - alexa listens to me say "turn off lights" - her microphone receives my sound vibrations - it transduces my command to bytecode her api can understand - alexa converts the bytecode of my request to a signal that my smart bulb's API can hear. - my smart bulb's server has been listening for any requests to its API all day - my smart bulb receives the request and routes it to a function that executes the turning off of the bulb - this networking of objects with tiny servers in our homes is called the Internet of Things (**IoT**) ::: ---- ### The web is _organized_ and _designed_ for user experience (U/X) <div class="asset-container"> <img :src="$withBase('/images/course/web2_sl_evolve.png')" alt="web 1 to web2 evolution" class="slide"> </div> - WordPress used to be the convention for web design - each page was a pre-designed template - limited control of layout - all pages looked / behaved the same <!-- - **modular** design breaks the page into the tiniest, customizable components or web resources --> <div class="asset-container"> <img :src="$withBase('/images/course/web2_sl_mod.png')" alt="web 2 modularity" class="slide"> </div> - it allows flexibility in deployment, arrangement, and customization - a web app is composed of different scripts, libraries, smaller apps, etc., but can be deployed as a single entity, and therefore follows this idea of modularity - granular control - web pages grow / shrink responsively to screen size and device type --- ### Data and the web <div class="asset-container"> <img :src="$withBase('/images/course/web2_data-st.jpg')" alt="Data from Star Trek" class="slide"> </div> ---- #### **Data** is broken down and passes back and forth between your computer and multiple servers <div class="asset-container"> <img :src="$withBase('/images/course/web2_data-flow.gif')" alt="web2 data flow"> </div> ::: tip web data as postcards if I want to send you a postcard, but I have so much to tell you that I have to write it out across 10 postcards, I might number each postcard in case they don't all get delivered at the same time, so you can reconstruct them in the right order once they all arrive ::: - **data in motion** :runner: - data broken into smaller web packets that travel between client and server(s) - if a packet says it's number 4 in a list of packets, and your computer hasn't seen number 3 yet then your data waits until the other packets arrive before it gets reassembled - **data at rest** :sleeping: - local storage - data stored in your browser with no expiration - session storage - data cached in your browser until you close the browser window ---- ### _time_ and the web :clock1: <div class="asset-container"> <img :src="$withBase('/images/course/web2_time-diag.png')" alt="web2 time diagrams"> </div> - "trusting" what a server somewhere in the world tells us is the correct time - UCT solution - time based on the Sun and Earth's rotation - needs mass adoption - impractical that noon UCT would mean noon all around the world - faster connections make syncing time more and more difficult - bad things can and do happen on the web in a blink of an eye --- ## Your Relationship with the Web <div class="asset-container"> <img :src="$withBase('/images/course/web2_relate.jpg')" alt="people with smart phones"> </div> ### _Identity_ :selfie: <div class="asset-container" style="position:relative;"> <img :src="$withBase('/images/course/web2_map-1.jpg')" alt="google maps" style="position:absolute; left:1%;width: 35%; transform: rotate(-15deg);border:1px solid blue;"> <img :src="$withBase('/images/course/web2_sl_comic.png')" alt="comic about the modern web" class="slide"> <img :src="$withBase('/images/course/web2_map-2.jpg')" alt="google maps" style="position:absolute;right:1%;width: 35%; transform: rotate(15deg);border:1px solid blue;"> </div> - you are your _activity_ on the web - your browser history - requests coming from your IP address - your activity in and accross other web apps (shared data) - your email is your _main_ source of identity - it relies on a web mail protocol to function - you can use it to log into numerous web apps - password _plus_ information from another device (2FA) required for identity verification - access to your identity is at the mercy of internet service providers and app owners - Twitter can lock you out of your account - your ISP can shut your internet access at any point - new internet plan? no problem - except now your router is no longer compatable, and you'll need to upgrade that before you service is restored :shrug: ---- ### _Ownership_ :key: <div class="asset-container"> <img :src="$withBase('/images/course/web2_sl_own.png')" alt="Facebook owns your data" class="slide"> </div> #### you don't own your data - your data (activity history) is being sold constantly - you don't make a dime from it - cloud admins can delete any data you store on it - your accounts can be taken offline with just a few strokes - Instagram can use any pics you posted any way they want - it only takes a handful of people to completely block your access to any digital assets you "own" ---- ### _Structure_ of the web :classical_building: <div class="asset-container"> <img :src="$withBase('/images/course/web2_sl_struct.png')" alt="Bezos controls web2" class="slide"> </div> - The modern web is distributed in a _centralized_ way - _distributed_ networks managed by handful of tech companies - very few points of failure can bring entire regions offline - The modern web is _very_ centralized - 4 big box stores to shop at - monopolies mean that fewer and fewer people hold the keys to the kingdom --- ## Quiz <div class="asset-container"> <ClientOnly> <Quiz3 :nextChapter="$frontmatter['next']"/> </ClientOnly> </div> <!-- <ClientOnly> <SheildDetect/> </ClientOnly> --> # 5. You and NEAR Protocol :fireworks: ## Introduction <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_intro.png')" alt="NEAR intro" class="slide"> </div> #### Web3 is a network of blockchain networks, and NEAR is one of them - not all blockchains are alike - **NEAR** is a Layer 1 (L1) blockchain - layer 2(L2) blockchains use architecture of existing blockchains - Polygon is built on top of Ethereum, which is a layer 1 blockchain - NEAR is built from the ground up - NEAR has its own chain with its own rules and architecture - Instead of **PoW** to create trust, NEAR uses Proof of Stake(**PoS**) - **PoS** is humans validating transactions, and staking a large amount of money that they will be honest about it - validators can earn historical returns on their staking - it's cheaper to tell the truth than to lie - validators get "kicked" off the network if they don't follow certain rules - PoS is CARBON NEUTRAL :earth_americas: :heart: <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_mission.png')" alt="NEAR mission" class="slide"> </div> ## Interfaces on NEAR are similar to other Web3 networks <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_layers.png')" alt="NEAR layer model" class="slide"> </div> #### **protocol layer** - base layer - L1 blockchain - blockchain architecture - nodes split into mini processors (sharding) to improve network availability - PoS validation - localnet (aka devnet) for dApp development - testnet for testing dApps - mainnet for launching dApps <div class="asset-container"> <img :src="$withBase('/images/course/near_env.png')" alt="NEAR environments" class="slide"> </div> #### **infrastructure layer** - nodes are virtual computers you can download locally - when you download a node locally, you can refer to it as a client node since it will be interacting with the network in a similar way that your computer does. - indexer nodes - nodes anyone can run locally to listen to network updates - querying all blocks in the chain can be cumbersome - Indexer makes it easier to search the blockchain - Google indexes web pages so they are easier to find - block nodes - contain copy of the blockchain to increase network availability - archival nodes - contain copy of the _entire_ blockchain from its genesis - validator nodes - nodes used by validators to review transactions - [Wallet](https://wallet.near.org) - account management <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_wallet.png')" alt="NEAR wallet" class="slide"> </div> - [Explorer](https://explorer.near.org/) - transaction history of any account <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_exp.png')" alt="NEAR explorer" class="slide"> </div> - [JSON RPC](https://docs.near.org/docs/api/rpc) (Response-Procedure-Call) - API for interacting with the blockchain <div class="asset-container"> <img :src="$withBase('/images/course/near_rpc-diag.png')" alt="NEAR explorer" class="slide"> </div> #### **use case layer** - DeFi - [ref.finance](https://ref.finance) - Gaming - [berry.club](https://berryclub.io/) - Bussiness Development - DAO - [Sputnik](httos://sputnik.fund) #### **access points layer** - top layer - Wallet - Explorer - JSON RPC - NEAR's infrastructure of **modules** can be broken down and reconfigured for new use cases - create new primitives like message protocols - [Machina](https://medium.com/nearprotocol/introducing-machina-the-worlds-first-proof-of-stake-storage-solution-built-on-near-fed2ed23dbfb) is a PoS decentralized storage solution built on NEAR - dApps can use any number of primitives for their use cases - how would you create AirBnB on NEAR? <div class="asset-container"> <img :src="$withBase('/images/course/near_eco.jpeg')" alt="NEAR ecosystem" class="slide"> </div> --- ## **_Data_** and NEAR <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_data-st.png')" alt="NEAR ecosystem" class="slide"> </div> ---- <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_data-states.png')" alt="NEAR ecosystem" class="slide"> </div> ### **data in motion** :runner: - data travels accross many different protocols within the network - data fetched from centralized and /or decentralized database - transaction data retrieved from JSON RPC and broken down into http packets that are returned to client - data about chain state propagated to entire network like gossip ### **data at rest** :sleeping: - immutable data stored on chain - data stored in browser local storage - access keys - data stored on local machine - access keys - data temporalily stored in memory while dApp is running - access keys - data stored on _decentralized_ databases - IPFS - Machina ---- ## **_Time_** on NEAR :clock12: <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_time-diag.png')" alt="NEAR block height" class="slide"> </div> - current block height is accessible to anyone with a computer and an internet connection - new blocks are added every second - some blocks contain zero transactions - transactions _you_ make are queued using **nonces** (tally of transactions a given _key_ on _your_ account has made) - tx with nonce#4 isn't added to the chain until nonce#3 has been added ---- ## Your Relationship with NEAR <div class="asset-container"> <img :src="$withBase('/images/course/near_basics-diag.png')" alt="NEAR ecosystem" class="slide"> </div> ---- ### **_Identity_** :selfie: <div class="asset-container"> <img :src="$withBase('/images/course/near_sl_id.png')" alt="NEAR Transaction diagram" class="slide"> </div> - your mainnet account (_yourname_.near) allows you to interface with any other account - subaccounts you create (_myname_.yourname.near) can build your reputation - you are paid in $NEAR for your engagement in the network - earn to play - earn to learn - contracts have accounts as well - accounts can have zero or one contract deployed to them - your account associated with your NEAR wallet does not have a contract deployed on it ---- ### **_Ownership_** :key: <div class="asset-container"> <img :src="$withBase('/images/course/near_tokens.jpg')" alt="NEAR token usecases" class="slide"> </div> #### **you have complete control of your account** - your wallet works like a keychain - you can create keys for your account - key pairs - private and public, actually - private key is stored on your machine - public key is used to sign transactions - when you sign a transaction the transaction verifies that your hidden private key and your public key are indeed a valid key pair - you can authorize dApps to add permissioned keys to your account - like when you give a valet a special "valet key" to park your car - the valet key has just enough functionality to get the task done - dApps basically do the same thing - they give you a **functional access** key - you can only call certain functions on the dApp's contract with it - you don't have **full access** - **full access** keys allow you complete control over an account - you can de-authorize a dApp on your account - this is like signing in with google - google confirms you are authorizing the app on your google account - you can set special permissions like allowing google to read and edit your calendar - you can de-authorize any web apps associated with you google account too - web3 is very similar - you can delete all keys from your account, and render it inaccessible by anyone (including you!) forever #### **you are your own security** :lock_with_ink_pen: - no one can remove assets from your wallet without your permission - if someone gets your private key, however, they have full access to your account - your funds are at the whim of whoever has your private key - :warning: **!!!NEVER SHARE YOUR PRIVATE KEYS!!!** :warning: - there are no middlemen in Web3 - no one at NEAR has the ability to "reset your password" - be vigilant! - store your seed phrase outside of any devices connected to the internet - rotate your keys periodically ::: warning **Beware of phishing scams!** Quite often scammers will try to trick you into revealing your password with fake wallet sites. Always check the url of the web page you are on. ::: #### **transactions are irreversible** - if you send / receive funds **no one can reverse the transaction** - your transaction history is available to anyone at anytime - hyper-transparency - no privacy on the blockchain - do not store anything you aren't ready to share with the rest of the world - NEAR has standards the NFT contracts must follow to be considered current and credible - if an NFT contract lists you as the owner of a digital asset, your ownership is indisputable. ---- ## _Structure_ of NEAR :classical_building: #### NEAR is _decentralized_ - NEAR is community based - NEAR doesn't own any nodes on its network #### NEAR is part of Web3, and therefore relies on Web2, which is very much centralized <div class="asset-container"> <img :src="$withBase('/images/course/near_splash.jpg')" alt="NEAR ecosystem" class="slide"> </div> --- ## Quiz <div class="asset-container"> <ClientOnly> <Quiz5/> </ClientOnly> </div> --- ## Epilogue #### **What questions to ask?** - remember, although we are building something new, the ideas have been around for a long time. - at it's core, the web is just requests and responses between clients and servers; if that relationship isn't clear when reviewing a dApp then your questions should investigate that - Hopefully, the analogy of your house and neighborhoods being like computers and networks will help you make sense of distributed systems - When you hear "node", you now know that could mean several different things: - some sort of computer, right? - probably a computer in a network - did you know "node" could also refer to a programming language called NodeJs? - many contracts are built in a "node environment". When you hear "environment" it's usually a clue that they are talking about NodeJs. --- ## What Next? - [Smart Contract Scavenger Hunt](/activities/) - [Check out NEAR University](https://near.university) - [Learn to build on NEAR!](https://near.academy/) - [Take a NEAR Certification course](https://airtable.com/shrr8CbYRDHflkgI9?prefill_schedule=rec36OOvSYh1Roh8n) - [Learn the Fundamentals of Computer Science](https://www.youtube.com/playlist?list=PLhQjrBD2T383f9scHRNYJkior2VvYjpSL) --- next: '/internet/' --- <!-- <ClientOnly> <SheildDetect/> </ClientOnly> --> ![](/images/course/computer_thumbs-up.gif) # 1. You and Your Computer ## Introduction ### Think of your computer as your house <div class="asset-container"> <img :src="$withBase('/images/course/house.png')" alt="home" class="course-asset"> </div> #### How would you describe your house to a computer? - It's broken down into smaller rooms maybe? - what is a room? - a component of your house? :heavy_check_mark: - Each room connects via one or more doorways. - You can add rooms to your house. - You can upgrade and / or merge existing rooms. - You can "optimize" the layout so it warms and cools more efficiently or creates feng shui. - If it burns down, you can rebuild it based on blueprints, and you can replace most of the items in it. Unfortunately, some things may not be replaceable. ### Your Computer is a Machine #### How do you think your computer is organized? - you might think of words like "hard drive", and "motherboard" - your setup might involve 1-2 external monitors, a bluetooth mouse, and wireless keyboard - you might mention whether your computer is a Mac or Windows or Linux #### Now think about how you use everything you mentioned. - your description of using your mouse is probably different than that of using your keyboard - you may mention why you chose to buy a Mac as opposed to a Windows computer ## _Interfaces_ of your computer #### When we talk about how each part of a computer is organized, we are talking about its various _interfaces_ <div class="asset-container"> <img :src="$withBase('/images/course/pc_sl_kitchen.png')" alt="kitchen" class="slide"> </div> - let's return to the analogy of your house - your kitchen is made up of a collection of interfaces - your stove has an interface - your fridge has an interface - even your faucet has an interface - you can interface with your kitchen's circuitry through your breaker panel ::: tip interfaces Another way to think about interfacing is human-to-human communication - we have interfaces of our own to communicate with each other without the need of any technology. They include: - our faces - our 5 senses - our expressions ::: <div class="asset-container"> <img :src="$withBase('/images/course/pc_sl_interfaces.png')" alt="diagram of interfaces" class="slide"> </div> Your computer is organized through two types of **interfaces** ### _peripheral_ interfaces :desktop_computer: - hard drive - keyboard - mouse - screen ---- ### _software_ interfaces :blue_book: - interface drivers - programs or sets of programs - set of instructions that tell a piece of hardware how to function - operating system - software that enables other software to communicate with hardware - applications - programs designed for an end user - scripts - set of instructions for another program to use ---- #### All of these interfaces "play" together to extend how your computer is used. - hardware parts can be put together and taken apart again - you can add new software and delete other software - you can easily add multiple monitors, switch out keyboards, add a camera, etc. - you can even run a _virtual machine_(**vm**), which is essentially a computer running inside your computer. In fact your computer has numerous VMs running at any given time. #### this ability to break components down, and mix and match them is called _modularity_ :building_construction: - the rooms in your house can be considered **modules**; same with your TV (a module), and your entertainment system as a whole (also a module). --- ## _Data_ and your Computer <div class="asset-container"> <img :src="$withBase('/images/course/pc_data-st.gif')" alt="Data from Star Trek" class="course-asset"> </div> #### What comes to mind when you hear "data"? - information? :heavy_check_mark: - stuff that is stored on hard drives? :heavy_check_mark: - electrical signals? :heavy_check_mark: How does information pass through your computer, and how is it stored for later use? It may seem trivial, but when we talk about technology, we soon start to look at what data is doing when it's **in motion** and **at rest** - when we press a key on our keyboard, a signal travels to our computer's brain and registers the key we pressed. It's always listening for something to interface with it. - when we save a file, our computer's operating system gets instructions to store the contents of the file along with information about the file on our hard drive. <div class="asset-container"> <img :src="$withBase('/images/course/pc_sl_data.png')" alt="diagram of states of data" class="slide"> </div> ### **data in motion** :runner: - from keyboard to machine - from mouse to machine - from monitor to your eyes - from speakers to your ears ### **data at rest** :sleeping: - database - structure of how data is stored - hard drive - physical addresses where data is stored as 1s and 0s. ::: tip your home's data - back to the house analogy. What is the "data" of your house? - electricity and water systems? - water moving through your pipes when faucet is _on_ vs water stored in your pipes when faucet is _off_ - pictures on the wall? - food in the fridge? - what about how your house is used - wear and tear? - in a way _you_ are your house's data since it's whole purpose is to handle _you_ in motion and _you_ at rest when you're using it ::: ## _Time_ and your Computer <div class="asset-container"> <img :src="$withBase('/images/course/pc_time.gif')" alt="dancing clocks"> </div> - it may feel strange to talk about time. Isn't it self-evident? - not as evident as you might think - our computers don't have to rely on time the same way we do - time is extremely important in web3, and we will soon learn that our idea of time is essentially thrown out the window when it comes to blockchain. - You can set time to whatever you want on your machine, but when two machines with different times talk to each other, we need to agree on what time to use. - this is just like when you make travel plans - you need to double check timezones of flight and train times, for instance. - What if _your_ computer is set 6 hours ahead of _my_ computer? - How do our computers do things at the "same" time? <div class="asset-container"> <img :src="$withBase('/images/course/pc_sl_time.png')" alt="cpu clock" class="slide"> </div> --- ## Your Relationship with Your Computer <div class="asset-container" style="position: relative; height:500px; top:-.5%;"> <img :src="$withBase('/images/course/pc_vint.gif')" alt="vintage pc" style="position: absolute; left:50%;margin-right:-50%;top:50%;transform:translate(-50%,-50%);"> <img :src="$withBase('/images/course/pc_pc.gif')" alt="pc" style="width:35%;position: absolute; left:0;margin-right:-50%;top:30%;transform:rotate(-15deg);"> <img :src="$withBase('/images/course/hacker.gif')" alt="hacker" style="width:35%;position: absolute; right:0;top:30%;transform:rotate(25deg);"> <img :src="$withBase('/images/course/canunot.gif')" alt="annoyed girl meme" style="width:25%;position: absolute; left:40%;top:60%;"> </div> --- ### _Identity_ <div class="asset-container"> <img :src="$withBase('/images/course/pc_id.gif')" alt="scooby doo unmasking"> </div> - Your _User Profile_ is your **identity** on your computer - _Guest Profile_ can't change your password. - but if I have your password, I have your identity as far as your computer is concerned. <div class="asset-container" style="position:relative; height: 500px;"> <img :src="$withBase('/images/course/pc_sl_id.png')" alt="pc login page" class="slide"> <img :src="$withBase('/images/course/spidey.gif')" alt="spidermen" class="animate-flicker" style="position:absolute; top: 55%; left: 50%;transform:translate(-50%,-50%);"> </div> ---- ### _Ownership_ <div class="asset-container"> <img :src="$withBase('/images/course/pc_ownership.jpeg')" alt="angry pc user"> </div> #### What does it mean to "own" your computer? - just like your house. You can remodel it, tear it down - anything you want, because it's yours, right? - you can add / remove the programs you want - you can add / delete files, media and other **digital assets** - you can replace your mouse, your hard drive, and your monitor - you can even toss your computer in a pond (make sure to remove it though. We don’t want to pollute any ponds). ---- ## _Structure_ of your Computer :classical_building: #### What happens if you do throw your computer in a pond? - Is the data on it gone forever, because it was all **centralized** on your computer and your computer alone? <div class="asset-container"> <img :src="$withBase('/images/course/pc_vint-2.jpeg')" alt="vintage pc"> </div> - Or is all or much of the data **distributed** accross one or more _other_ machines, and you only lost a portion of your data? <div class="asset-container"> <img :src="$withBase('/images/course/pc_dist-1.jpeg')" alt="vintage pc distribution room"> </div> - Or, even better, is the data not only distributed accross multiple machines, but **decentralized** so that each machine has a copy of _all_ your data? :crossed_fingers: <div class="asset-container"> <img :src="$withBase('/images/course/pc_dist.jpeg')" alt="multiple vintage pc"> </div> --- ## Quiz <div class="asset-container"> <ClientOnly> <Quiz1 :nextChapter="$frontmatter['next']"/> </ClientOnly> </div> --- next: '/near/' --- <!-- <ClientOnly> <SheildDetect/> </ClientOnly> --> # 4. You and Web3.0 <div class="asset-container"> <img :src="$withBase('/images/course/web3_crypto-hist.png')" alt="history of crypto"> </div> ## Introduction <div class="asset-container"> <img :src="$withBase('/images/course/web3_sl_intro.png')" alt="web 3 intro" class="slide"> </div> --- ### Web3 is the _decentralized_ or "open" web :open_hands: - network interfaces follow new rules - no one node is in charge - no single NAP - _no front desk_ - no one can "turn it off" - it's accessible to all - it's owned and operated by the people using it - there are no middlemen - no brokers between you and the stock market - no bank fees for managing your money - no HR between you and payroll #### A network of computers across the globe act as one computer sharing a single state <div class="asset-container p-rel"> <img :src="$withBase('/images/course/web3_sl_org.png')" alt="web 3 organization" class="slide"> <img :src="$withBase('/images/course/web3_walle.gif')" alt="wall-e gif" style="position:absolute; top: 20%; left: .2%; max-width:50%;"> </div> ::: tip what's "state" in the neighborhood analogy? Before the internet, when a new house was built in your neighborhood, all the phone books needed to be updated to reflect the new addition. So, a new phone book was sent out to all the neighbors with the address, etc. of the new house. ::: - change state of one, you change state of all - we are Borg :robot: - when one node registers a change in the network (state) it gossips about it to the other nodes - gossip spreads about the change in state to the entire network #### Web3 _interfaces_ are accessed using Web3 accounts <div class="asset-container"> <img :src="$withBase('/images/course/web3_sl_el5.png')" alt="web 3 intro" class="slide"> </div> - "log in with your email" becomes "log in with your Web3 wallet" - connections to Web3 architecture occur through http connections and **smart contracts** <div class="asset-container"> <img :src="$withBase('/images/course/web3_sl_interfaces.png')" alt="smart contracts" class="slide"> </div> --- ### Organization of Web3 <div class="asset-container"> <img :src="$withBase('/images/course/web3_sl_smrt-ct.png')" alt="smart contracts" class="slide"> </div> - they are a set of instructions (like any other program) for updating state/data/transaction history - the updates that nodes gossip about are triggered by methods in these contracts - contract methods allow Web3 accounts to either _view_ state/data/transaction history or _change_ state/data/transaction history - contracts that take a lot of time to run can congest the network - transaction fees (GAS) help prevent this - they incentivize developers to optimize their code so it execute faster, and consumes fewer resources (cheaper!:money_with_wings:) ---- ### Interconnected layers of Web3 <div class="asset-container"> <img :src="$withBase('/images/course/web3_layers.png')" alt="web 3 layer model"> </div> - these layers behave like **modules** and can be broken apart and reconfigured to create new use cases #### protocol layer - base layer - blockchain architecture - changes to data are stored as transaction receipts on a digital ledger - ledger is copied and distributed to all nodes in the network #### infrastructure layer - interoperable building blocks - modules connect together for specific tasks - storage - naming service - **smart contracts** serve as the _back_ end of Web3 infrastructure - contracts manage state - they are like interpreters - web3 accounts "sign" transactions the same way one might sign a lease agreement or credit card receipt #### use case layer - where it all comes together - DeFi, Gaming #### access points - top layer - users sign into their account(s) and send / receive crypto-currency ---- ### Web3 needs Web2... for now <div class="asset-container p-rel"> <img :src="$withBase('/images/course/web3_web2.jpeg')" alt="handshake meme"> <p style="position:absolute;bottom:5%;left:35%;font-weight:bold;color:#fff;">Web2</p> <p style="position:absolute;bottom:5%;right:35%;font-weight:bold;color:#fff;">Web3</p> </div> - Web3 infrastructure is different than web2, but still new and generally limited, so it can't operate without web2 yet - you still need the centralized web to access the decentralized web - it's not immediately apparent when you are using a Web3 app (dApp) --- ### Let's finally talk about the "blockchain" <div class="asset-container"> <img :src="$withBase('/images/course/web3_sl_blockchain.png')" alt="Blockchain" class="slide"> </div> #### The blockchain is.. - transaction history the blockchain is like a stack of milk crates with each crate containing piles of various transaction receipts. The stack of crates gets higher with every new batch of receipts. ::: tip If the Phone Book behaved like a blockchain Imagine if instead of receiving a new phone book every time a new neighbor moves in / out, you (and everyone you know) receives a single page from the phone book with just the updated information. ::: --- ## _Data_ and Web3 <div class="asset-container"> <img :src="$withBase('/images/course/web3_data-st.jpeg')" alt="Data from Star Trek"> </div> --- ### **Data in motion** <div class="asset-container p-rel"> <img :src="$withBase('/images/course/web3_sl_data-in-motion.png')" alt="Web3 data in motion" class="slide"> <img :src="$withBase('/images/course/web3_gossip.gif')" alt="Gossip protocol" style="position:absolute; right: 0;top: 10%;"> </div> ### **Data at rest** <div class="asset-container p-rel"> <img :src="$withBase('/images/course/web3_sl_data-at-rest.png')" alt="Web3 data at rest" class="slide"> <img :src="$withBase('/images/course/web3_data-at-rest.png')" alt="web3 data diagram" style="position:absolute; left: 0;top: 30%;"> </div> #### Once **data** is added to the blockchain it is **immutable** - it can't be changed. --- ## _Time_ and Web3 :clock1030: <div class="asset-container"> <img :src="$withBase('/images/course/web3_sl_time.png')" alt="consensus diagram" class="slide"> </div> #### The blockchain is... - a clock :exploding_head: ### Time is measured in _block height_ - each block added to the chain increases its height - some blockchains add a new block at a constant rate even if the block is empty of updates to transaction history - this allows for planning - _"let's meet at 3pm"_ becomes _"let's meet when the block height reaches 89489830340"_ <div class="asset-container"> <img :src="$withBase('/images/course/web3_sl_time-2.png')" alt="consensus diagram" class="slide"> </div> - community board meetings exist for the purpose of finding consensus community-related initiatives. Community-based blockchain networks are no different, and people don't always agree - sometimes two nodes with different block heights claim to have the most current (highest) chain - ( generally ) longest chain wins - sometimes nodes do not agree with the consensus and continue with _their_ version of the blockchain - if other nodes join them, then a fork is created - two versions now exist - Ethereum vs Ethereum _classic_ - sometimes infrastructure updates require a fork - if a node with the old version of the chain exists, the old infrastructure is still accessible - you can keep your old phone books, and use them, but they will become more and more unreliable - you can keep your computer from 1997, but it won't be able to "dial into" today's internet like it did when Austin Powers was in theaters. #### trustless proofs provide integrity of the blockchain so you can trust the time it gives <div class="asset-container"> <img :src="$withBase('/images/course/web3_pow-pos.jpeg')" alt="types of consensus protocols" class="slide"> </div> - proof that a transaction is valid can be achieved through cryptography - if anything changes in one block, all subsequent blocks are _immediately_ invalidated - we see this in time travel movies - change the past, you change the future - _mining_ or Proof of Work (**PoW**) is how BitCoin and Ethereum create trust in their networks - PoW has become very energy-intensive as the blockchains that rely on it continue to grow - other proof concepts are being employed in new and existing blockchain networks to address these and related issues --- ## Your Relationship with Web3 <p style="font-size:2vw"> <strong>time</strong>: enabled by a chain of discrete “data moments”</p> <p style="font-size:2vw"> <strong>identity</strong>: enabled by public/private key cryptography</p> <p style="font-size:2vw"> <strong>money</strong>: time + value</p> <p style="font-size:2vw"> <strong>ownership</strong>: identity + money</p> <p style="font-size:2vw"> <strong>provenance</strong>: identity + money + time</p> ### _Identity_ :selfie: <div class="asset-container"> <img :src="$withBase('/images/course/web3_id.png')" alt="types of identification protocols" class="slide"> </div> - your web3 account is your identity - no Oauth - your offline identity is yours to reveal or keep hidden as you see fit - the account(s) you use to explore the space build reputation - reputation / street cred helps build trust in the platform - active engagement in the community is core to a successful, community-run web ---- ### _Ownership_ :key: <div class="asset-container"> <img :src="$withBase('/images/course/web3_own.png')" alt="diagram of ownership in web3" class="slide"> </div> - _you_ own your data, and _you_ own the network - no. seriously! - everything is flipped on its head - you earn money from simply engaging the network - ad companies pay _you_ to see their ads rather than google - networks have their own economies based on their specific token or **crypto-currency** - Bitcoin, ether, doge, $NEAR - if it's not Bitcoin, then it's an altcoin - tokens in your wallet are yours to do as you wish - if your country freezes bank accounts, your crypto is still safe and accessible - digital assets are yours - whatever digital assets are associated with your account are yours for as long as you desire - there is no repo man - you are your own security ---- ## _Structure_ of Web3 :classical_building: <div class="asset-container"> <img :src="$withBase('/images/course/web3_struct.png')" alt="centralized vs decentralized internet" class="slide"> </div> - Web3 is _decentralized_ - there is no single point of entry or failure - if one node goes offline, the data is preserved on all the other nodes - no _one_ controls the network - everyone controls the network - the wealth that is generated by the network is distributed among the people using it - Web3 relies on Web2 to exist - Web3's infrastructure is decentralized - Web3's access layer relies on Web2 servers - contracts compile to webassembly so they can run in Web2 browsers --- ## Quiz <div class="asset-container"> <ClientOnly> <Quiz4 :nextChapter="$frontmatter['next']"/> </ClientOnly> </div>