diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml new file mode 100644 index 00000000..acfeb104 --- /dev/null +++ b/.github/workflows/bump-version.yml @@ -0,0 +1,71 @@ +name: Bump version +on: + workflow_dispatch: + inputs: + arguments: + description: 'standard-release arguments' + required: false + default: '' + +jobs: + bump-version: + name: Bump version + runs-on: ubuntu-latest + steps: + - name: Ensure develop branch + if: github.ref != 'refs/heads/develop' + run: |- + echo "Not running on develop - exit" + exit 1 + + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: ⚙️ Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + cache: 'npm' + + - name: 🧰 Install + run: npm ci + + - name: ⬆️ Bump package version + run: |- + git config --global user.email "release@lukso.network" + git config --global user.name "Release Bot" + npm run release -- ${{ github.event.inputs.arguments }} + + - name: 📝 Set Version + run: |- + APP_VERSION="v$(node -pe "require('./package.json').version")" + echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3 + with: + branch: bump/${{ env.APP_VERSION }} + base: develop + delete-branch: true + title: ':arrow_up: Bump to ${{ env.APP_VERSION }}' + body: | + Bump to version: ${{ env.APP_VERSION }} + labels: | + automated pr + + - name: Checkout to PR branch + uses: actions/checkout@v2 + with: + ref: bump/${{ env.APP_VERSION }} + + # We purposely not push the tag + # The tag will be added when develop is merged into main + - run: git push + + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/lint-test-build.yml b/.github/workflows/lint-test-build.yml index 34e89065..585c2266 100644 --- a/.github/workflows/lint-test-build.yml +++ b/.github/workflows/lint-test-build.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 7eec4b31..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Publish NPM Package - -on: - release: - types: [published] - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Use Node.js v16 - uses: actions/setup-node@v2 - with: - node-version: '16.x' - registry-url: 'https://registry.npmjs.org' - scope: '@erc725' - cache: 'npm' - - - name: Install - run: npm ci - - - name: Test - run: npm test - - - name: Build - run: npm run build - - - name: Publish to NPM - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ec422daf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,102 @@ +# If it detects a version bump on main, it will trigger a release. +# If the workflow is started manually, it will skip the bump detection and attempt to publish. +name: Release and publish + +on: + workflow_dispatch: + push: + branches: + - 'main' + +jobs: + release: + name: 📦 Create GitHub release and publish to NPM + runs-on: ubuntu-latest + steps: + - name: Ensure main branch + if: github.ref != 'refs/heads/main' + run: |- + echo "Not running on main - exit" + exit 1 + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: 🔍 Check if version changed + uses: EndBug/version-check@v1 + if: github.event_name == 'push' + id: check + + - name: 🔄 Check if should release + run: echo "SHOULD_RELEASE=${{ steps.check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' }}" >> $GITHUB_ENV + + - name: ⚙️ Setup Node.js v16 + uses: actions/setup-node@v2 + if: env.SHOULD_RELEASE == 'true' + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + scope: '@erc725' + cache: 'npm' + + - name: 📝 Set Version + if: env.SHOULD_RELEASE == 'true' + run: |- + APP_VERSION="v$(node -pe "require('./package.json').version")" + echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV + + - name: 🧰 Install + if: env.SHOULD_RELEASE == 'true' + run: npm ci + + - name: 🎯 Test + if: env.SHOULD_RELEASE == 'true' + run: npm test + + - name: 🛠 Build + if: env.SHOULD_RELEASE == 'true' + run: npm run build + + # We assume this will be always triggered by a merge from develop + # Therefore we tag the previous commit (the merge commit won't be on develop) + - name: 🏷 Create and push Git Tag + if: env.SHOULD_RELEASE == 'true' + run: |- + git config --global user.email "release@lukso.network" + git config --global user.name "LUKSO Bot" + git tag -a ${{ env.APP_VERSION }} HEAD~ -m "Release Version ${{ env.APP_VERSION }} [CI]" + git push --set-upstream origin tag ${{ env.APP_VERSION }} + + # Create GitHub Release + - name: 📝 Extract release notes from CHANGELOG + if: env.SHOULD_RELEASE == 'true' + id: extract-release-notes + uses: ffurrer2/extract-release-notes@v1 + with: + release_notes_file: RELEASENOTES.md + + - uses: jwalton/gh-find-current-pr@v1 + if: env.SHOULD_RELEASE == 'true' + id: findPR + with: + state: closed + + - name: Add PR body to Release Notes + if: env.SHOULD_RELEASE == 'true' + run: |- + echo ${{ steps.findPR.outputs.body }}|cat - RELEASENOTES.md > /tmp/out && mv /tmp/out RELEASENOTES.md + + - name: 🚀 Create GitHub release + uses: ncipollo/release-action@v1 + if: env.SHOULD_RELEASE == 'true' + with: + bodyFile: 'RELEASENOTES.md' + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ env.APP_VERSION }} + + - name: 📦 Publish to NPM + if: env.SHOULD_RELEASE == 'true' + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 82a6ad9c..dd96501b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,10 +5,10 @@ This project uses Conventional Commits to generate release notes and to determine versioning. Commit messages should adhere to this standard and be of the form: ```bash -$ git commit -m "feat: Add new feature x" -$ git commit -m "fix: Fix bug in feature x" -$ git commit -m "docs: Add documentation for feature x" -$ git commit -m "test: Add test suite for feature x" +git commit -m "feat: Add new feature x" +git commit -m "fix: Fix bug in feature x" +git commit -m "docs: Add documentation for feature x" +git commit -m "test: Add test suite for feature x" ``` Further details on `conventional commits` can be found here: https://www.conventionalcommits.org/en/v1.0.0/ @@ -16,7 +16,7 @@ Further details on `conventional commits` can be found here: https://www.convent ## Building ```shell script -$ npm run build +npm run build ``` This will build the library into `/build` @@ -24,7 +24,7 @@ This will build the library into `/build` ## Testing ```shell script -$ npm test +npm test ``` Will build and then publish the package to npm. diff --git a/RELEASE.md b/RELEASE.md index 41c34073..80b33a00 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,25 +1,36 @@ # Release Process -Releases are published to NPM when a [GitHub release](https://github.com/ERC725Alliance/erc725.js/releases/new) is created. +Releases are published to NPM when `develop` is merged into `main` AND when the merged code contains a version bump in the `package.json`. ## Create and publish a new release: -1. Checkout to a new release branch. -2. Bump version with [standard-version](https://github.com/conventional-changelog/standard-version): +### Bump version + +You can manually trigger the [Bump version](https://github.com/ERC725Alliance/erc725.js/actions/workflows/bump-version.yml) workflow from the `develop` branch. + +To bump locally: + +1. Checkout to a new release branch from `develop`. +2. Bump version with [standard-version](https://github.com/conventional-changelog/standard-version). To create pre-release or specific versions, see below. ```bash npm run release ``` -3. Then push the changes to origin, **with tags** and open a PR. +3. Push the changes to origin, **WITH TAGS**. ```bash git push --follow-tags origin ``` -4. Merge the PR to main. -5. Create a new [GitHub release](https://github.com/ERC725Alliance/erc725.js/releases/new) with the tag you just created. -6. The CI will build and publish to npm. +4. Open a PR from your release branch to `develop` and merge it. + +### Release + +- Merge `develop` into `main` through a PR. +- The CI will create a GitHub release and publish to NPM. + +If it fails, you can manually trigger the workflow from the [Actions](https://github.com/ERC725Alliance/erc725.js/actions/workflows/release.yml) tab. ## Specific Version Increases diff --git a/docs/classes/ERC725.md b/docs/classes/ERC725.md new file mode 100644 index 00000000..474c21a5 --- /dev/null +++ b/docs/classes/ERC725.md @@ -0,0 +1,397 @@ +# ERC725 + +:::warning +This package is currently in early stages of development, use only for testing or experimentation purposes. +::: + +## decodeData + +▸ **decodeData**(`data`): `Object` + +In case you are reading the key-value store from an ERC725 smart-contract key-value store +without `@erc725/erc725.js` you can use `decodeData` to do the decoding for you. + +:::tip +It is more convenient to use [`fetchData`](ERC725.md#fetchdata). +It does the `decoding` and `fetching` of external references for you automatically. +::: + +### Parameters + +| Name | Type | Description | +| :----- | :------- | :------------------------------------- | +| `data` | `Object` | An object with one or many properties. | + +### Returns + +`Object` + +Returns decoded data as defined and expected in the schema: + +### Example + +```javascript title="Decode one key" +const decodedDataOneKey = myERC725.decodeData({ + LSP3Profile: + '0x6f357c6a820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361696670733a2f2f516d597231564a4c776572673670456f73636468564775676f3339706136727963455a4c6a7452504466573834554178', +}); +/** +{ + LSP3Profile: { + hashFunction: 'keccak256(utf8)', + hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361', + url: 'ifps://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx', + }, +} +*/ +``` + +```javascript title="Decode multiple keys" +const decodedDataManyKeys = myERC725.decodeData({ + LSP3Profile: + '0x6f357c6a820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361696670733a2f2f516d597231564a4c776572673670456f73636468564775676f3339706136727963455a4c6a7452504466573834554178', + 'LSP3IssuedAssets[]': [ + { + key: '0x3a47ab5bd3a594c3a8995f8fa58d0876c96819ca4516bd76100c92462f2f9dc0', + value: + '0x0000000000000000000000000000000000000000000000000000000000000002', + }, + { + key: '0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000000', + value: '0xd94353d9b005b3c0a9da169b768a31c57844e490', + }, + { + key: '0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000001', + value: '0xdaea594e385fc724449e3118b2db7e86dfba1826', + }, + ], +}); +/** +{ + LSP3Profile: { + hashFunction: 'keccak256(utf8)', + hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361', + url: 'ifps://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx', + }, + LSP1UniversalReceiverDelegate: '0x1183790f29BE3cDfD0A102862fEA1a4a30b3AdAb', +} +*/ +``` + +--- + +## encodeData + +▸ **encodeData**(`data`): `Object` + +To be able to store your data on the blockchain, you need to encode it according to your `ERC725JSONSchema`. + +### Parameters + +| Name | Type | Description | +| :----- | :------- | :----------------------------------------------------------------------------------- | +| `data` | `Object` | An object with one or many properties, containing the data that needs to be encoded. | + +### Returns + +`Object` + +An object with the same keys as the object that was passed in as a parameter containing the encoded data, ready to be stored on the blockchain. + +### Example + +```javascript title="Encoding object with one key" +const encodedDataOneKey = myERC725.encodeData({ + LSP3Profile: { + json: profileJson, // check instantiation.js to see the actual JSON + url: 'ifps://QmQTqheBLZFnQUxu5RDs8tA9JtkxfZqMBcmGd9sukXxwRm', + }, +}); +/** +{ + LSP3Profile: { + value: '0x6f357c6a2404a2866f05e53e141eb61382a045e53c2fc54831daca9d9e1e039a11f739e1696670733a2f2f516d5154716865424c5a466e5155787535524473387441394a746b78665a714d42636d47643973756b587877526d', + key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5' + } +} +``` + +```javascript title="Encoding object with one key" +const encodedDataOneKeyV2 = myERC725.encodeData({ + LSP3Profile: { + hashFunction: 'keccak256(utf8)', + hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361', + url: 'ifps://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx', + }, +}); +/** +{ + LSP3Profile: { + value: + '0x6f357c6a820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361696670733a2f2f516d597231564a4c776572673670456f73636468564775676f3339706136727963455a4c6a7452504466573834554178', + key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5', + }, +} +*/ +``` + +```javascript title="Encoding object with one key" +const encodedDataManyKeys = myERC725.encodeData({ + LSP3Profile: { + hashFunction: 'keccak256(utf8)', + hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361', + url: 'ifps://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx', + }, + 'LSP3IssuedAssets[]': [ + '0xD94353D9B005B3c0A9Da169b768a31C57844e490', + '0xDaea594E385Fc724449E3118B2Db7E86dFBa1826', + ], + LSP1UniversalReceiverDelegate: '0x1183790f29BE3cDfD0A102862fEA1a4a30b3AdAb', +}); +/** +{ + LSP3Profile: { + value: + '0x6f357c6a820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361696670733a2f2f516d597231564a4c776572673670456f73636468564775676f3339706136727963455a4c6a7452504466573834554178', + key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5', + }, + 'LSP3IssuedAssets[]': { + value: [[Object], [Object], [Object]], + key: '0x3a47ab5bd3a594c3a8995f8fa58d0876c96819ca4516bd76100c92462f2f9dc0', + }, + LSP1UniversalReceiverDelegate: { + value: '0x1183790f29be3cdfd0a102862fea1a4a30b3adab', + key: '0x0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b47', + }, +} +*/ +``` + +:::tip +When encoding JSON it is possible to pass in the JSON object and the URL where it is available publicly. +The JSON will be hashed with `keccak256`. +::: + +--- + +## fetchData + +▸ **fetchData**(`keyOrKeys?`): `Promise`<`Object`\> + +Since [`getData`](ERC725.md#getdata) exclusively returns data that is stored on the blockchain, `fetchData` comes in handy. +Additionally to the data from the blockchain, `fetchData` also returns data from IPFS or HTTP(s) endpoints +stored as [`JSONURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#jsonurl) or [`ASSETURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#asseturl). + +:::info +To ensure **data authenticity** `fetchData` compares the `hash` of the fetched JSON with the `hash` stored on the blockchain. +::: + +### Parameters + +| Name | Type | Description | +| :----------- | :--------------------- | :------------------------------------------------------------------------------------------------------- | +| `keyOrKeys?` | `string` \| `string`[] | The name (or the encoded name as the schema ‘key’) of the schema element in the class instance’s schema. | + +### Returns + +`Promise`<`Object`\> + +Returns the fetched and decoded value depending `valueContent` for the schema element, otherwise works like [`getData()`](#getdata). + +### Example + +```javascript title="All keys from schema" +const dataAllKeys = await myERC725.fetchData(); +/** +{ + 'SupportedStandards:LSP3UniversalProfile': '0xabe425d6', + LSP3Profile: { + LSP3Profile: { + name: 'patrick-mcdowell', + links: [Array], + description: "Beautiful clothing that doesn't cost the Earth. A sustainable designer based in London Patrick works with brand partners to refocus on systemic change centred around creative education. ", + profileImage: [Array], + backgroundImage: [Array], + tags: [Array] + } + }, + LSP1UniversalReceiverDelegate: '0x50A02EF693fF6961A7F9178d1e53CC8BbE1DaD68', + 'LSP3IssuedAssets[]': [ + '0xc444009d38d3046bb0cF81Fa2Cd295ce46A67C78', + '0x4fEbC3491230571F6e1829E46602e3b110215A2E', + '0xB92a8DdA288638491AEE5C2a003D4CAbfa47aE3F', + '0x1e52e7F1707dcda57dD33F003B2311652A465acA', + '0x0BDA71aA980D37Ea56E8a3784E4c309101DAf3E4', + '0xfDB4D9C299438B9839e9d04E34B9609C5b56600D', + '0x081D3F0bff8ae2339cb65113822eEc1510704d5c', + '0x55C98c6944B7497FaAf4db0386a1aD1E6efF526E', + '0x90D1a1D68fa23AEEE991220703f1a1C3782e0b35', + '0xdB5AB19792d9fB61c1Dff57810Fb7C6f839Af8ED' + ] +} +*/ +``` + +```javascript title="One key" +const dataOneKey = await myERC725.fetchData('LSP3Profile'); +/** +{ + LSP3Profile: { + LSP3Profile: { + name: 'patrick-mcdowell', + links: [Array], + description: "Beautiful clothing that doesn't cost the Earth. A sustainable designer based in London Patrick works with brand partners to refocus on systemic change centred around creative education. ", + profileImage: [Array], + backgroundImage: [Array], + tags: [Array] + } + } +} +*/ +``` + +```javascript title="Many keys" +const dataManyKeys = await myERC725.fetchData([ + 'LSP3Profile', + 'LSP1UniversalReceiverDelegate', +]); +/** +{ + LSP3Profile: { + LSP3Profile: { + name: 'patrick-mcdowell', + links: [Array], + description: "Beautiful clothing that doesn't cost the Earth. A sustainable designer based in London Patrick works with brand partners to refocus on systemic change centred around creative education. ", + profileImage: [Array], + backgroundImage: [Array], + tags: [Array] + } + }, + LSP1UniversalReceiverDelegate: '0x50A02EF693fF6961A7F9178d1e53CC8BbE1DaD68' +} +*/ +``` + +--- + +## getData + +▸ **getData**(`keyOrKeys?`): `Promise`<`Object`\> + +Gets **decoded data** for one, many or all keys of the specified `ERC725` smart-contract. +When omitting the `keyOrKeys` parameter, it will get all the keys (as per `ERC725JSONSchema` definition). + +:::caution +Data returned by this function does not contain external data of [`JSONURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#jsonurl) +or [`ASSETURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#asseturl) schema elements. + +If you would like to receive everything in one go, you can use [`fetchData`](ERC725.md#fetchdata) for that. +::: + +### Parameters + +| Name | Type | +| :----------- | :--------------------- | +| `keyOrKeys?` | `string` \| `string`[] | + +### Returns + +`Promise`<`Object`\> + +An object with schema element key names as properties, with corresponding **decoded** data as values. + +### Example + +```javascript title="All keys from schema" +const dataAllKeys = await myERC725.getData(); +/** +{ + 'SupportedStandards:LSP3UniversalProfile': '0xabe425d6', + LSP3Profile: { + hashFunction: 'keccak256(utf8)', + hash: '0xd96ff7776660095f661d16010c4349aa7478a9129ce0670f771596a6ff2d864a', + url: 'ipfs://QmbTmcbp8ZW23vkQrqkasMFqNg2z1iP4e3BCUMz9PKDsSV' + }, + LSP1UniversalReceiverDelegate: '0x50A02EF693fF6961A7F9178d1e53CC8BbE1DaD68', + 'LSP3IssuedAssets[]': [ + '0xc444009d38d3046bb0cF81Fa2Cd295ce46A67C78', + '0x4fEbC3491230571F6e1829E46602e3b110215A2E', + '0xB92a8DdA288638491AEE5C2a003D4CAbfa47aE3F', + '0x1e52e7F1707dcda57dD33F003B2311652A465acA', + '0x0BDA71aA980D37Ea56E8a3784E4c309101DAf3E4', + '0xfDB4D9C299438B9839e9d04E34B9609C5b56600D', + '0x081D3F0bff8ae2339cb65113822eEc1510704d5c', + '0x55C98c6944B7497FaAf4db0386a1aD1E6efF526E', + '0x90D1a1D68fa23AEEE991220703f1a1C3782e0b35', + '0xdB5AB19792d9fB61c1Dff57810Fb7C6f839Af8ED' + ] +} +*/ +``` + +```javascript title="One key" +const dataOneKey = await myERC725.getData('LSP3Profile'); +/* +{ + LSP3Profile: { + hashFunction: 'keccak256(utf8)', + hash: '0xd96ff7776660095f661d16010c4349aa7478a9129ce0670f771596a6ff2d864a', + url: 'ipfs://QmbTmcbp8ZW23vkQrqkasMFqNg2z1iP4e3BCUMz9PKDsSV' + } +} +*/ +``` + +```javascript title="Many keys" +const dataManyKeys = await myERC725.getData([ + 'LSP3Profile', + 'LSP1UniversalReceiverDelegate', +]); +/** +{ + LSP3Profile: { + hashFunction: 'keccak256(utf8)', + hash: '0xd96ff7776660095f661d16010c4349aa7478a9129ce0670f771596a6ff2d864a', + url: 'ipfs://QmbTmcbp8ZW23vkQrqkasMFqNg2z1iP4e3BCUMz9PKDsSV' + }, + LSP1UniversalReceiverDelegate: '0x50A02EF693fF6961A7F9178d1e53CC8BbE1DaD68' +} +*/ +``` + +--- + +## getOwner + +:::warning +This method is not yet supported when using the `graph` provider type. +::: + +▸ **getOwner**(`_address?`): `Promise`<`any`\> + +An added utility method which simply returns the owner of the contract. +Not directly related to ERC725 specifications. + +### Parameters + +| Name | Type | +| :---------- | :------- | +| `_address?` | `string` | + +### Returns + +`Promise`<`any`\> + +The address of the contract owner as stored in the contract. + +### Example + +```javascript +// If no _address is set, it will return the owner of the contract used to initialise the ERC725() class. +await myERC725.getOwner(); +// '0x94933413384997F9402cc07a650e8A34d60F437A' + +// You can also get the owner of a specific contract by setting the _address paramater +await myERC725.getOwner('0x3000783905Cc7170cCCe49a4112Deda952DDBe24'); +// '0x7f1b797b2Ba023Da2482654b50724e92EB5a7091' +``` diff --git a/docs/classes/_category_.yml b/docs/classes/_category_.yml new file mode 100644 index 00000000..641c7b80 --- /dev/null +++ b/docs/classes/_category_.yml @@ -0,0 +1,2 @@ +label: 'Classes' +collapsed: true diff --git a/docs/getting-started.md b/docs/getting-started.md index b2faa5b0..41e3d886 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -65,14 +65,17 @@ await erc725.getOwner(); // > '0x28D25E70819140daF65b724158D00c373D1a18ee' await erc725.getData('SupportedStandards:LSP3UniversalProfile'); -/* > +/** { 'SupportedStandards:LSP3UniversalProfile': '0xabe425d6' } */ -await erc725.getData(['LSP3Profile', 'SupportedStandards:LSP3UniversalProfile']); -/* > +await erc725.getData([ + 'LSP3Profile', + 'SupportedStandards:LSP3UniversalProfile', +]); +/** { LSP3Profile: { url: 'ipfs://QmXybv2LdJWscy1C6yRKUjvnaj6aqKktZX4g4xmz2nyYj2', @@ -84,7 +87,7 @@ await erc725.getData(['LSP3Profile', 'SupportedStandards:LSP3UniversalProfile']) */ await erc725.fetchData('LSP3Profile'); // downloads and verifies the linked JSON -/* > +/** { LSP3Profile: { LSP3Profile: { @@ -117,9 +120,9 @@ import ERC725 from 'erc725.js'; After the instance has been created is is still possible to change settings through the options property. ```javascript - myERC725.options.schema = '' // change schema - myERC725.options.address '
' // change address - myERC725.options.config.ipfsGateway = '' // used for fetchData(), default: 'https://cloudflare-ipfs.com/ipfs/' +myERC725.options.schema = '' // change schema +myERC725.options.address '
' // change address +myERC725.options.config.ipfsGateway = '' // used for fetchData(), default: 'https://cloudflare-ipfs.com/ipfs/' - // NOTE: ERC725.provider can not be changed +// NOTE: ERC725.provider can not be changed ``` diff --git a/docs/providers.md b/docs/providers.md index e1f969f7..36075945 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -21,7 +21,7 @@ const web3provider = new Web3( ); ``` -## Ethereum (Metamask) +## Ethereum (MetaMask) This is the provider available at `window.ethereum` injected into a compatible web browser from the [Metamask plugin](https://metamask.io/). diff --git a/docs/technical-reference/README.md b/docs/technical-reference/README.md deleted file mode 100644 index 8ac9681c..00000000 --- a/docs/technical-reference/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# @erc725/erc725.js - v0.8.0 - -## Enumerations - -- [ProviderTypes](enums/ProviderTypes.md) - -## Classes - -- [ERC725](classes/ERC725.md) - -## Interfaces - -- [ERC725Config](interfaces/ERC725Config.md) -- [ERC725JSONSchema](interfaces/ERC725JSONSchema.md) -- [KeyValuePair](interfaces/KeyValuePair.md) - -## References - -### default - -Renames and exports: [ERC725](classes/ERC725.md) - -## Type aliases - -### ERC725JSONSchemaKeyType - -Ƭ **ERC725JSONSchemaKeyType**: ``"Singleton"`` \| ``"Mapping"`` \| ``"Array"`` \| ``"Bytes20Mapping"`` \| ``"Bytes20MappingWithGrouping"`` - -#### Defined in - -[types/ERC725JSONSchema.ts:3](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/ERC725JSONSchema.ts#L3) - -___ - -### ERC725JSONSchemaValueContent - -Ƭ **ERC725JSONSchemaValueContent**: ``"Number"`` \| ``"String"`` \| ``"Address"`` \| ``"Keccak256"`` \| ``"AssetURL"`` \| ``"JSONURL"`` \| ``"URL"`` \| ``"Markdown"`` - -#### Defined in - -[types/ERC725JSONSchema.ts:10](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/ERC725JSONSchema.ts#L10) - -___ - -### ERC725JSONSchemaValueType - -Ƭ **ERC725JSONSchemaValueType**: ``"string"`` \| ``"address"`` \| ``"uint256"`` \| ``"bytes32"`` \| ``"bytes"`` \| ``"bytes4"`` \| ``"string[]"`` \| ``"address[]"`` \| ``"uint256[]"`` \| ``"bytes32[]"`` \| ``"bytes4[]"`` \| ``"bytes[]"`` - -#### Defined in - -[types/ERC725JSONSchema.ts:20](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/ERC725JSONSchema.ts#L20) - -## Functions - -### encodeData - -▸ **encodeData**<`Schema`, `T`\>(`data`, `schema`): { [K in T]: Schema[T]["encodeData"]["returnValues"]} - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Schema` | extends `GenericSchema` | -| `T` | extends `string` \| `number` \| `symbol` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | { [K in T]: Schema[T]["encodeData"]["inputTypes"]} | an object of key-value pairs | -| `schema` | [`ERC725JSONSchema`](interfaces/ERC725JSONSchema.md)[] | an array of schema definitions as per $[ERC725JSONSchema](interfaces/ERC725JSONSchema.md) | - -#### Returns - -{ [K in T]: Schema[T]["encodeData"]["returnValues"]} - -#### Defined in - -[lib/utils.ts:481](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/lib/utils.ts#L481) - -___ - -### flattenEncodedData - -▸ **flattenEncodedData**(`encodedData`): [`KeyValuePair`](interfaces/KeyValuePair.md)[] - -Transform the object containing the encoded data into an array ordered by keys, -for easier handling when writing the data to the blockchain. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `encodedData` | `Object` | - -#### Returns - -[`KeyValuePair`](interfaces/KeyValuePair.md)[] - -KeyValuePair[] An array of key-value objects - -#### Defined in - -[lib/utils.ts:553](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/lib/utils.ts#L553) diff --git a/docs/technical-reference/classes/ERC725.md b/docs/technical-reference/classes/ERC725.md deleted file mode 100644 index 34aa2976..00000000 --- a/docs/technical-reference/classes/ERC725.md +++ /dev/null @@ -1,263 +0,0 @@ -# Class: ERC725 - -:::warning -This package is currently in early stages of development,
use only for testing or experimentation purposes.
-::: - -## Type parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `Schema` | extends `GenericSchema` | **Work in progress, nothing to see here**. | - -## Constructors - -### constructor - -• **new ERC725**<`Schema`\>(`schema`, `address?`, `provider?`, `config?`) - -Creates an instance of ERC725. - -```js reference title="Instantiation" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/instantiation.js#L1-L50 -``` - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Schema` | extends `GenericSchema` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `schema` | [`ERC725JSONSchema`](../interfaces/ERC725JSONSchema.md)[] | More information available here: [LSP-2-ERC725YJSONSchema](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md) | -| `address?` | `any` | Address of the ERC725 contract you want to interact with | -| `provider?` | `any` | | -| `config?` | [`ERC725Config`](../interfaces/ERC725Config.md) | Configuration object. | - -#### Defined in - -[index.ts:86](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/index.ts#L86) - -## Properties - -### options - -• **options**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `address?` | `string` | -| `config` | [`ERC725Config`](../interfaces/ERC725Config.md) | -| `provider?` | `any` | -| `schema` | [`ERC725JSONSchema`](../interfaces/ERC725JSONSchema.md)[] | - -#### Defined in - -[index.ts:66](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/index.ts#L66) - -## Methods - -### decodeData - -▸ **decodeData**(`data`): `Object` - -In case you are reading the key-value store from an ERC725 smart-contract key-value store -without `@erc725/erc725.js` you can use `decodeData` to do the decoding for you. - -:::tip -It is more convenient to use [`fetchData`](ERC725.md#fetchdata). -It does the `decoding` and `fetching` of external references for you automatically. -::: - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | `Object` | An object with one or many properties. | - -#### Returns - -`Object` - -Returns decoded data as defined and expected in the schema: - -```javascript reference title="Decode one key" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/decodeData.js#L7-L19 -``` - -```javascript reference title="Decode multiple keys" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/decodeData.js#L21-L49 -``` - -#### Defined in - -[index.ts:315](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/index.ts#L315) - -___ - -### encodeData - -▸ **encodeData**(`data`): `Object` - -To be able to store your data on the blockchain, you need to encode it according to your [ERC725JSONSchema](../interfaces/ERC725JSONSchema.md). - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | `Object` | An object with one or many properties, containing the data that needs to be encoded. | - -#### Returns - -`Object` - -An object with the same keys as the object that was passed in as a parameter containing the encoded data, ready to be stored on the blockchain. - -```javascript reference title="Encoding object with one key" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/encodeData.js#L7-L19 -``` - -```javascript reference title="Encoding object with one key" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/encodeData.js#L22-L37 -``` - -```javascript reference title="Encoding object with one key" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/encodeData.js#L39-L67 -``` - -:::tip -When encoding JSON it is possible to pass in the JSON object and the URL where it is available publicly. -The JSON will be hashed with `keccak256`. -::: - -#### Defined in - -[index.ts:288](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/index.ts#L288) - -___ - -### fetchData - -▸ **fetchData**(`keyOrKeys?`): `Promise`<`Object`\> - -Since [`getData`](ERC725.md#getdata) exclusively returns data that is stored on the blockchain, `fetchData` comes in handy. -Additionally to the data from the blockchain, `fetchData` also returns data from IPFS or HTTP(s) endpoints -stored as [`JSONURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#jsonurl) or [`ASSETURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#asseturl). - -:::info -To ensure **data authenticity** `fetchData` compares the `hash` of the fetched JSON with the `hash` stored on the blockchain. -::: - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `keyOrKeys?` | `string` \| `string`[] | The name (or the encoded name as the schema ‘key’) of the schema element in the class instance’s schema. | - -#### Returns - -`Promise`<`Object`\> - -Returns the fetched and decoded value depending ‘valueContent’ for the schema element, otherwise works like getData - -```javascript title="getData - all keys from schema" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/fetchData.js#L7-L35 -``` - -```javascript reference title="getData - one key " -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/fetchData.js#L37-L51 -``` - -```javascript reference title="getData - many keys" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/fetchData.js#L53-L71 -``` - -#### Defined in - -[index.ts:203](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/index.ts#L203) - -___ - -### getData - -▸ **getData**(`keyOrKeys?`): `Promise`<`Object`\> - -Gets **decoded data** for one, many or all keys of the specified `ERC725` smart-contract. -When omitting the `keyOrKeys` parameter, it will get all the keys (as per [ERC725JSONSchema](../interfaces/ERC725JSONSchema.md) definition). - -:::caution -Data returned by this function does not contain external data of [`JSONURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#jsonurl) -or [`ASSETURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#asseturl) schema elements. - -If you would like to receive everything in one go, you can use [`fetchData`](ERC725.md#fetchdata) for that. -::: - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `keyOrKeys?` | `string` \| `string`[] | - -#### Returns - -`Promise`<`Object`\> - -An object with schema element key names as properties, with corresponding **decoded** data as values. - -```javascript reference title="getData - all keys from schema" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/getData.js#L7-L30 -``` - -```javascript reference title="getData - one key " -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/getData.js#L32-L41 -``` - -```javascript reference title="getData - many keys" -https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/getData.js#L43-L56 -``` - -#### Defined in - -[index.ts:161](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/index.ts#L161) - -___ - -### getOwner - -▸ **getOwner**(`_address?`): `Promise`<`any`\> - -An added utility method which simply returns the owner of the contract. -Not directly related to ERC725 specifications. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `_address?` | `string` | - -#### Returns - -`Promise`<`any`\> - -The address of the contract owner as stored in the contract. - -:::warning - This method is not yet supported when using the `graph` provider type. -::: - -```javascript title="Example" -await myERC725.getOwner(); -// '0x94933413384997F9402cc07a650e8A34d60F437A' - -await myERC725.getOwner("0x3000783905Cc7170cCCe49a4112Deda952DDBe24"); -// '0x7f1b797b2Ba023Da2482654b50724e92EB5a7091' -``` - -#### Defined in - -[index.ts:343](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/index.ts#L343) diff --git a/docs/technical-reference/enums/ProviderTypes.md b/docs/technical-reference/enums/ProviderTypes.md deleted file mode 100644 index a0af078a..00000000 --- a/docs/technical-reference/enums/ProviderTypes.md +++ /dev/null @@ -1,31 +0,0 @@ -# Enumeration: ProviderTypes - -## Enumeration members - -### ETHEREUM - -• **ETHEREUM** = `"ETHEREUM"` - -#### Defined in - -[types/provider.ts:2](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/provider.ts#L2) - -___ - -### GRAPH\_QL - -• **GRAPH\_QL** = `"GRAPH_QL"` - -#### Defined in - -[types/provider.ts:4](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/provider.ts#L4) - -___ - -### WEB3 - -• **WEB3** = `"WEB3"` - -#### Defined in - -[types/provider.ts:3](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/provider.ts#L3) diff --git a/docs/technical-reference/interfaces/ERC725Config.md b/docs/technical-reference/interfaces/ERC725Config.md deleted file mode 100644 index f7dfb4b8..00000000 --- a/docs/technical-reference/interfaces/ERC725Config.md +++ /dev/null @@ -1,19 +0,0 @@ -# Interface: ERC725Config - -## Properties - -### ipfsGateway - -• **ipfsGateway**: `string` - -```js title=Example -const config = { - ipfsGateway: 'https://ipfs.lukso.network/ipfs/' -}; -``` -Make sure to use the following format: `/ipfs/`.
-Another example: `https://cloudflare-ipfs.com/ipfs/` - -#### Defined in - -[types/Config.ts:11](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/Config.ts#L11) diff --git a/docs/technical-reference/interfaces/ERC725JSONSchema.md b/docs/technical-reference/interfaces/ERC725JSONSchema.md deleted file mode 100644 index 8b470637..00000000 --- a/docs/technical-reference/interfaces/ERC725JSONSchema.md +++ /dev/null @@ -1,64 +0,0 @@ -# Interface: ERC725JSONSchema - -```javascript title=Example - { - name: "LSP3Profile", - key: "0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5", - keyType: "Singleton", - valueContent: "JSONURL", - valueType: "bytes", - }, -``` -:::info -Detailed information available on [LSP-2-ERC725YJSONSchema](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md) -::: - -## Properties - -### key - -• **key**: `string` - -#### Defined in - -[types/ERC725JSONSchema.ts:50](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/ERC725JSONSchema.ts#L50) - -___ - -### keyType - -• **keyType**: [`ERC725JSONSchemaKeyType`](../README.md#erc725jsonschemakeytype) - -#### Defined in - -[types/ERC725JSONSchema.ts:51](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/ERC725JSONSchema.ts#L51) - -___ - -### name - -• **name**: `string` - -#### Defined in - -[types/ERC725JSONSchema.ts:49](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/ERC725JSONSchema.ts#L49) - -___ - -### valueContent - -• **valueContent**: `string` - -#### Defined in - -[types/ERC725JSONSchema.ts:52](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/ERC725JSONSchema.ts#L52) - -___ - -### valueType - -• **valueType**: [`ERC725JSONSchemaValueType`](../README.md#erc725jsonschemavaluetype) - -#### Defined in - -[types/ERC725JSONSchema.ts:53](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/ERC725JSONSchema.ts#L53) diff --git a/docs/technical-reference/interfaces/KeyValuePair.md b/docs/technical-reference/interfaces/KeyValuePair.md deleted file mode 100644 index cb0f2d13..00000000 --- a/docs/technical-reference/interfaces/KeyValuePair.md +++ /dev/null @@ -1,21 +0,0 @@ -# Interface: KeyValuePair - -## Properties - -### key - -• **key**: `string` - -#### Defined in - -[types/encodeData/JSONURL.ts:4](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/encodeData/JSONURL.ts#L4) - -___ - -### value - -• **value**: `any` - -#### Defined in - -[types/encodeData/JSONURL.ts:5](https://github.com/ERC725Alliance/erc725.js/blob/6794bc5/src/types/encodeData/JSONURL.ts#L5) diff --git a/package-lock.json b/package-lock.json index 133600e1..a16ffc80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.8.0", "license": "Apache-2.0", "dependencies": { + "gh-pages": "^3.2.3", "web3-eth-abi": "^1.5.2", "web3-utils": "^1.5.2" }, @@ -36,7 +37,6 @@ "ts-mock-imports": "^1.3.7", "ts-node": "^10.0.0", "typedoc": "^0.21.5", - "typedoc-plugin-markdown": "^3.10.4", "typescript": "^4.3.2", "web3": "1.5.2", "web3-core": "^1.5.2" @@ -1951,6 +1951,14 @@ "node": ">=8" } }, + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/array.prototype.flat": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", @@ -2211,6 +2219,14 @@ "node": ">=8" } }, + "node_modules/async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dependencies": { + "lodash": "^4.17.14" + } + }, "node_modules/async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -2256,8 +2272,7 @@ "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "node_modules/base-x": { "version": "3.0.8", @@ -2357,7 +2372,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2927,11 +2941,15 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "node_modules/compare-func": { "version": "2.0.0", @@ -2946,8 +2964,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "node_modules/concat-stream": { "version": "2.0.0", @@ -3820,6 +3837,11 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/email-addresses": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", + "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==" + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -3970,7 +3992,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -4949,6 +4970,30 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/filename-reserved-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", + "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=", + "engines": { + "node": ">=4" + } + }, + "node_modules/filenamify": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", + "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", + "dependencies": { + "filename-reserved-regex": "^2.0.0", + "strip-outer": "^1.0.1", + "trim-repeated": "^1.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -4983,7 +5028,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", - "dev": true, "dependencies": { "commondir": "^1.0.1", "make-dir": "^3.0.2", @@ -5000,7 +5044,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -5013,7 +5056,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -5025,7 +5067,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "dependencies": { "p-try": "^2.0.0" }, @@ -5040,7 +5081,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -5052,7 +5092,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, "dependencies": { "find-up": "^4.0.0" }, @@ -5219,8 +5258,7 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "node_modules/fsevents": { "version": "2.3.2", @@ -5562,6 +5600,74 @@ "assert-plus": "^1.0.0" } }, + "node_modules/gh-pages": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.2.3.tgz", + "integrity": "sha512-jA1PbapQ1jqzacECfjUaO9gV8uBgU6XNMV0oXLtfCX3haGLe5Atq8BxlrADhbD6/UdG9j6tZLWAkAybndOXTJg==", + "dependencies": { + "async": "^2.6.1", + "commander": "^2.18.0", + "email-addresses": "^3.0.1", + "filenamify": "^4.3.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "^8.1.0", + "globby": "^6.1.0" + }, + "bin": { + "gh-pages": "bin/gh-pages.js", + "gh-pages-clean": "bin/gh-pages-clean.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/gh-pages/node_modules/array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dependencies": { + "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gh-pages/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/gh-pages/node_modules/globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dependencies": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gh-pages/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/git-raw-commits": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz", @@ -5641,7 +5747,6 @@ "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5741,8 +5846,7 @@ "node_modules/graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, "node_modules/graphql": { "version": "15.5.0", @@ -6141,7 +6245,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -6837,7 +6940,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -6972,8 +7074,7 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash.clonedeep": { "version": "4.5.0", @@ -7058,7 +7159,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, "dependencies": { "semver": "^6.0.0" }, @@ -7073,7 +7173,6 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -7457,7 +7556,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -8715,7 +8813,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, "engines": { "node": ">=6" } @@ -8791,7 +8888,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -8800,7 +8896,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -8890,6 +8985,25 @@ "node": ">=4" } }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", @@ -10460,6 +10574,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-outer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", + "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", + "dependencies": { + "escape-string-regexp": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -10857,6 +10982,17 @@ "node": ">=0.10.0" } }, + "node_modules/trim-repeated": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", + "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", + "dependencies": { + "escape-string-regexp": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ts-mock-imports": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/ts-mock-imports/-/ts-mock-imports-1.3.7.tgz", @@ -11079,18 +11215,6 @@ "node": ">= 8" } }, - "node_modules/typedoc-plugin-markdown": { - "version": "3.10.4", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.10.4.tgz", - "integrity": "sha512-if9w7S9fXLg73AYi/EoRSEhTOZlg3I8mIP8YEmvzSE33VrNXC9/hA0nVcLEwFVJeQY7ay6z67I6kW0KIv7LjeA==", - "dev": true, - "dependencies": { - "handlebars": "^4.7.7" - }, - "peerDependencies": { - "typedoc": ">=0.21.2" - } - }, "node_modules/typedoc/node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -11174,7 +11298,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -13468,6 +13591,11 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, "array.prototype.flat": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", @@ -13669,6 +13797,14 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -13705,8 +13841,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base-x": { "version": "3.0.8", @@ -13783,7 +13918,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -14241,11 +14375,15 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "compare-func": { "version": "2.0.0", @@ -14260,8 +14398,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "2.0.0", @@ -14967,6 +15104,11 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "email-addresses": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", + "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==" + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -15095,8 +15237,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { "version": "7.28.0", @@ -15862,6 +16003,21 @@ "flat-cache": "^3.0.4" } }, + "filename-reserved-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", + "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=" + }, + "filenamify": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", + "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", + "requires": { + "filename-reserved-regex": "^2.0.0", + "strip-outer": "^1.0.1", + "trim-repeated": "^1.0.0" + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -15890,7 +16046,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", - "dev": true, "requires": { "commondir": "^1.0.1", "make-dir": "^3.0.2", @@ -15901,7 +16056,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "requires": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -15911,7 +16065,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "requires": { "p-locate": "^4.1.0" } @@ -15920,7 +16073,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "requires": { "p-try": "^2.0.0" } @@ -15929,7 +16081,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "requires": { "p-limit": "^2.2.0" } @@ -15938,7 +16089,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, "requires": { "find-up": "^4.0.0" } @@ -16060,8 +16210,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.3.2", @@ -16321,6 +16470,57 @@ "assert-plus": "^1.0.0" } }, + "gh-pages": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.2.3.tgz", + "integrity": "sha512-jA1PbapQ1jqzacECfjUaO9gV8uBgU6XNMV0oXLtfCX3haGLe5Atq8BxlrADhbD6/UdG9j6tZLWAkAybndOXTJg==", + "requires": { + "async": "^2.6.1", + "commander": "^2.18.0", + "email-addresses": "^3.0.1", + "filenamify": "^4.3.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "^8.1.0", + "globby": "^6.1.0" + }, + "dependencies": { + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "^1.0.1" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, "git-raw-commits": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz", @@ -16383,7 +16583,6 @@ "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -16461,8 +16660,7 @@ "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, "graphql": { "version": "15.5.0", @@ -16744,7 +16942,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -17261,7 +17458,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -17365,8 +17561,7 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash.clonedeep": { "version": "4.5.0", @@ -17439,7 +17634,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, "requires": { "semver": "^6.0.0" }, @@ -17447,8 +17641,7 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" } } }, @@ -17735,7 +17928,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -18719,8 +18911,7 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "package-hash": { "version": "4.0.0", @@ -18780,14 +18971,12 @@ "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "3.1.1", @@ -18850,6 +19039,19 @@ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, "pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", @@ -20037,6 +20239,14 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "strip-outer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", + "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", + "requires": { + "escape-string-regexp": "^1.0.2" + } + }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -20344,6 +20554,14 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, + "trim-repeated": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", + "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", + "requires": { + "escape-string-regexp": "^1.0.2" + } + }, "ts-mock-imports": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/ts-mock-imports/-/ts-mock-imports-1.3.7.tgz", @@ -20520,15 +20738,6 @@ "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==", "dev": true }, - "typedoc-plugin-markdown": { - "version": "3.10.4", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.10.4.tgz", - "integrity": "sha512-if9w7S9fXLg73AYi/EoRSEhTOZlg3I8mIP8YEmvzSE33VrNXC9/hA0nVcLEwFVJeQY7ay6z67I6kW0KIv7LjeA==", - "dev": true, - "requires": { - "handlebars": "^4.7.7" - } - }, "typescript": { "version": "4.3.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", @@ -20571,8 +20780,7 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, "unpipe": { "version": "1.0.0", diff --git a/package.json b/package.json index 3b1c08a9..009ac08e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' nyc --reporter=text --reporter=lcov mocha", "lint": "eslint . --ext .ts", "release": "standard-version -a", - "docs:generate": "typedoc --options typedoc.json" + "docs:generate:markdown": "typedoc --options typedoc.json", + "docs:generate:html": "typedoc --options typedoc.html.json", + "docs:publish": "gh-pages -m \"[ci skip] Updates\" -d docs/html/technical-reference" }, "repository": { "type": "git", @@ -64,12 +66,12 @@ "ts-mock-imports": "^1.3.7", "ts-node": "^10.0.0", "typedoc": "^0.21.5", - "typedoc-plugin-markdown": "^3.10.4", "typescript": "^4.3.2", "web3": "1.5.2", "web3-core": "^1.5.2" }, "dependencies": { + "gh-pages": "^3.2.3", "web3-eth-abi": "^1.5.2", "web3-utils": "^1.5.2" }, diff --git a/src/index.ts b/src/index.ts index 223eb9ae..2bd3b1b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -55,11 +55,9 @@ export { export { ERC725Config, KeyValuePair, ProviderTypes } from './types'; export { flattenEncodedData, encodeData } from './lib/utils'; /** - * :::warning * This package is currently in early stages of development,
use only for testing or experimentation purposes.
- * ::: * - * @typeParam Schema **Work in progress, nothing to see here**. + * @typeParam Schema * */ export class ERC725 { @@ -72,11 +70,6 @@ export class ERC725 { /** * Creates an instance of ERC725. - * - * ```js reference title="Instantiation" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/instantiation.js#L1-L50 - * ``` - * * @param {ERC725JSONSchema[]} schema More information available here: [LSP-2-ERC725YJSONSchema](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md) * @param {string} address Address of the ERC725 contract you want to interact with * @param {any} provider @@ -137,26 +130,12 @@ export class ERC725 { * Gets **decoded data** for one, many or all keys of the specified `ERC725` smart-contract. * When omitting the `keyOrKeys` parameter, it will get all the keys (as per {@link ERC725JSONSchema | ERC725JSONSchema} definition). * - * :::caution * Data returned by this function does not contain external data of [`JSONURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#jsonurl) * or [`ASSETURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#asseturl) schema elements. * * If you would like to receive everything in one go, you can use {@link ERC725.fetchData | `fetchData`} for that. - * ::: * * @returns An object with schema element key names as properties, with corresponding **decoded** data as values. - * - * ```javascript reference title="getData - all keys from schema" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/getData.js#L7-L30 - * ``` - * - * ```javascript reference title="getData - one key " - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/getData.js#L32-L41 - * ``` - * - * ```javascript reference title="getData - many keys" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/getData.js#L43-L56 - * ``` */ async getData( keyOrKeys?: string | string[], @@ -180,25 +159,11 @@ export class ERC725 { * Additionally to the data from the blockchain, `fetchData` also returns data from IPFS or HTTP(s) endpoints * stored as [`JSONURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#jsonurl) or [`ASSETURL`](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#asseturl). * - * :::info * To ensure **data authenticity** `fetchData` compares the `hash` of the fetched JSON with the `hash` stored on the blockchain. - * ::: * * @param {string} keyOrKeys The name (or the encoded name as the schema ‘key’) of the schema element in the class instance’s schema. * @param {ERC725JSONSchema} customSchema An optional custom schema element to use for decoding the returned value. Overrides attached schema of the class instance on this call only. * @returns Returns the fetched and decoded value depending ‘valueContent’ for the schema element, otherwise works like getData - * - * ```javascript title="getData - all keys from schema" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/fetchData.js#L7-L35 - * ``` - * - * ```javascript reference title="getData - one key " - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/fetchData.js#L37-L51 - * ``` - * - * ```javascript reference title="getData - many keys" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/fetchData.js#L53-L71 - * ``` */ async fetchData( keyOrKeys?: string | string[], @@ -268,22 +233,8 @@ export class ERC725 { * @param {{ [key: string]: any }} data An object with one or many properties, containing the data that needs to be encoded. * @returns An object with the same keys as the object that was passed in as a parameter containing the encoded data, ready to be stored on the blockchain. * - * ```javascript reference title="Encoding object with one key" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/encodeData.js#L7-L19 - * ``` - * - * ```javascript reference title="Encoding object with one key" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/encodeData.js#L22-L37 - * ``` - * - * ```javascript reference title="Encoding object with one key" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/encodeData.js#L39-L67 - * ``` - * - * :::tip * When encoding JSON it is possible to pass in the JSON object and the URL where it is available publicly. * The JSON will be hashed with `keccak256`. - * ::: */ encodeData(data: { [key: string]: any }): { [key: string]: any }; encodeData(data: { @@ -296,21 +247,11 @@ export class ERC725 { * In case you are reading the key-value store from an ERC725 smart-contract key-value store * without `@erc725/erc725.js` you can use `decodeData` to do the decoding for you. * - * :::tip * It is more convenient to use {@link ERC725.fetchData | `fetchData`}. * It does the `decoding` and `fetching` of external references for you automatically. - * ::: * * @param {{ [key: string]: any }} data An object with one or many properties. * @returns Returns decoded data as defined and expected in the schema: - * - * ```javascript reference title="Decode one key" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/decodeData.js#L7-L19 - * ``` - * - * ```javascript reference title="Decode multiple keys" - * https://github.com/ERC725Alliance/erc725.js/tree/main/examples/src/decodeData.js#L21-L49 - * ``` */ decodeData(data: { [key: string]: any }): { [key: string]: any }; decodeData(data: { @@ -328,9 +269,7 @@ export class ERC725 { * @param {string} [address] * @returns The address of the contract owner as stored in the contract. * - * :::warning * This method is not yet supported when using the `graph` provider type. - * ::: * * ```javascript title="Example" * await myERC725.getOwner(); diff --git a/src/types/ERC725JSONSchema.ts b/src/types/ERC725JSONSchema.ts index d64e55c4..4e49d13d 100644 --- a/src/types/ERC725JSONSchema.ts +++ b/src/types/ERC725JSONSchema.ts @@ -41,9 +41,7 @@ export type ERC725JSONSchemaValueType = * valueType: "bytes", * }, * ``` - * :::info * Detailed information available on [LSP-2-ERC725YJSONSchema](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md) - * ::: */ export interface ERC725JSONSchema { name: string; // Describes the name of the key, SHOULD compromise of the Standards name + sub type. e.g: LSP2Name diff --git a/src/types/encodeData/JSONURL.ts b/src/types/encodeData/JSONURL.ts index 285ff902..74e3818e 100644 --- a/src/types/encodeData/JSONURL.ts +++ b/src/types/encodeData/JSONURL.ts @@ -1,5 +1,8 @@ import { SUPPORTED_HASH_FUNCTIONS } from '../../lib/constants'; +/** + * @internal + */ export interface KeyValuePair { key: string; value: any; diff --git a/typedoc.html.json b/typedoc.html.json deleted file mode 100644 index 15d0ba59..00000000 --- a/typedoc.html.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "entryPoints": ["./src/index.ts"], - "out": "docs/html/technical-reference", - "includeVersion": true, - "plugin": [], - "excludePrivate": true, - "readme": "none", - "exclude": ["**/*+(.spec|.e2e).ts"] -} diff --git a/typedoc.json b/typedoc.json index d3631ba3..bd21c57b 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,10 +1,9 @@ { "entryPoints": ["./src/index.ts"], - "out": "docs/technical-reference", + "out": "docs/html", "includeVersion": true, - "readme": "none", + "plugin": [], "excludePrivate": true, - "hideInPageTOC": true, - "hideBreadcrumbs": true, + "readme": "none", "exclude": ["**/*+(.spec|.e2e).ts"] }