Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nevermined-io/cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.2
Choose a base ref
...
head repository: nevermined-io/cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 13,064 additions and 14,133 deletions.
  1. +2 −0 .eslintignore
  2. +16 −69 .eslintrc
  3. +0 −44 .github/workflows/build.yml
  4. +41 −0 .github/workflows/push-to-docs.yml
  5. +60 −0 .github/workflows/release-github.yml
  6. +3 −3 .github/workflows/release-npm.yml
  7. +43 −0 .github/workflows/testing-nigthly.yml
  8. +60 −0 .github/workflows/testing.yml
  9. +5 −2 .gitignore
  10. +0 −5 .prettierrc
  11. +379 −0 CHANGELOG.md
  12. +1 −1 LICENSE
  13. +22 −31 README.md
  14. +2 −0 docs/.keep
  15. +91 −0 docs/advanced_configuration.md
  16. +1,289 −0 docs/cli_commands.md
  17. +116 −0 docs/environments.md
  18. +95 −0 docs/getting-started.md
  19. +19 −0 docs/index.mdx
  20. +226 −0 docs/using-cli.md
  21. +38 −23 package.json
  22. +3 −0 prettier.config.js
  23. +2,305 −0 resources/commands.json
  24. +75 −0 resources/commands_template.eta
  25. +34 −0 resources/environments_template.eta
  26. +259 −0 resources/networks.json
  27. +23 −5 scripts/wait-nevermined.sh
  28. +51 −0 scripts/wait-subgraphs.sh
  29. +0 −1,309 src/abis/ERC721.json
  30. +0 −507 src/abis/ERC721URIStorage.json
  31. +209 −1,066 src/cli.ts
  32. +45 −0 src/commands/accounts/export.ts
  33. +64 −39 src/commands/accounts/fund.ts
  34. +86 −51 src/commands/accounts/list.ts
  35. +31 −13 src/commands/accounts/new.ts
  36. +132 −0 src/commands/agreements/abortAgreement.ts
  37. +37 −32 src/commands/agreements/listAgreements.ts
  38. +39 −39 src/commands/agreements/showAgreement.ts
  39. +76 −0 src/commands/app/balancePlan.ts
  40. +133 −0 src/commands/app/createApiKey.ts
  41. +107 −0 src/commands/app/createPlan.ts
  42. +49 −0 src/commands/app/downloadFiles.ts
  43. +44 −0 src/commands/app/getAccessToken.ts
  44. +77 −0 src/commands/app/listApiKeys.ts
  45. +74 −0 src/commands/app/orderPlan.ts
  46. +132 −0 src/commands/app/registerAgent.ts
  47. +80 −0 src/commands/app/registerFiles.ts
  48. +55 −0 src/commands/app/revokeApiKey.ts
  49. +119 −0 src/commands/app/showAsset.ts
  50. +22 −18 src/commands/assets/downloadAsset.ts
  51. +40 −46 src/commands/assets/getAsset.ts
  52. +44 −0 src/commands/assets/getAssetProviders.ts
  53. +38 −0 src/commands/assets/grantAssetProvider.ts
  54. +22 −28 src/commands/assets/orderAsset.ts
  55. +55 −0 src/commands/assets/queryAsset.ts
  56. +171 −64 src/commands/assets/registerAsset.ts
  57. +106 −12 src/commands/assets/resolveDID.ts
  58. +43 −0 src/commands/assets/retireDID.ts
  59. +38 −0 src/commands/assets/revokeAssetProvider.ts
  60. +34 −9 src/commands/assets/searchAsset.ts
  61. +37 −6 src/commands/index.ts
  62. +66 −0 src/commands/network/networkGetConfig.ts
  63. +50 −15 src/commands/network/networkList.ts
  64. +104 −0 src/commands/network/networkSetConfig.ts
  65. +66 −41 src/commands/network/networkStatus.ts
  66. +126 −0 src/commands/nfts/accessNft.ts
  67. +43 −0 src/commands/nfts/balanceNft.ts
  68. +30 −70 src/commands/nfts/burnNft.ts
  69. +138 −0 src/commands/nfts/claimNft.ts
  70. +95 −0 src/commands/nfts/cloneNft.ts
  71. +164 −59 src/commands/nfts/createNft.ts
  72. +125 −49 src/commands/nfts/deployNft.ts
  73. +41 −13 src/commands/nfts/downloadNft.ts
  74. +47 −0 src/commands/nfts/getJWT.ts
  75. +66 −0 src/commands/nfts/holdNft.ts
  76. +58 −67 src/commands/nfts/mintNft.ts
  77. +72 −0 src/commands/nfts/mintSubscriptionNft.ts
  78. +30 −29 src/commands/nfts/orderNft.ts
  79. +94 −83 src/commands/nfts/showNft.ts
  80. +0 −90 src/commands/nfts/transferNft.ts
  81. +15 −10 src/commands/provenance/provenanceHistory.ts
  82. +21 −10 src/commands/provenance/provenanceInspect.ts
  83. +26 −21 src/commands/provenance/registerProvenance.ts
  84. +40 −0 src/commands/utils/cleanArtifacts.ts
  85. +31 −0 src/commands/utils/decodeDID.ts
  86. +0 −29 src/commands/utils/decrypt.ts
  87. +97 −0 src/commands/utils/downloadArtifacts.ts
  88. +32 −0 src/commands/utils/encodeDID.ts
  89. +44 −39 src/commands/utils/getNftMetadata.ts
  90. +26 −19 src/commands/utils/publishNftMetadata.ts
  91. +45 −13 src/commands/utils/upload.ts
  92. +64 −0 src/generateDoc.ts
  93. +1 −1 src/index.ts
  94. +51 −0 src/models/CLICommandsDefinition.ts
  95. +27 −0 src/models/ConfigDefinition.ts
  96. +5 −0 src/models/ExecutionOutput.ts
  97. +15 −0 src/permissionless.d.ts
  98. +0 −25 src/utils/CustomToken.ts
  99. +55 −4 src/utils/IpfsHelper.ts
  100. +194 −172 src/utils/config.ts
  101. +3 −3 src/utils/enums.ts
  102. +353 −176 src/utils/utils.ts
  103. +44 −0 test/config.ts
  104. +149 −0 test/external/Services.test.ts
  105. +69 −15 test/helpers/Config.ts
  106. +24 −0 test/helpers/ExecCommand.ts
  107. +99 −8 test/helpers/StdoutParser.ts
  108. +150 −0 test/helpers/ddo-metadata-generator.ts
  109. +0 −53 test/integration-tests/Accounts.test.ts
  110. +0 −66 test/integration-tests/AssetsEncrypt.test.ts
  111. +0 −112 test/integration-tests/NFTs1155.test.ts
  112. +0 −26 test/integration-tests/Status.test.ts
  113. +69 −0 test/integration/AbortAgreements.test.ts
  114. +69 −0 test/integration/Accounts.test.ts
  115. +20 −14 test/{integration-tests → integration}/Agreements.test.ts
  116. +85 −23 test/{integration-tests → integration}/Assets.test.ts
  117. +151 −0 test/integration/NFTs1155.test.ts
  118. +95 −0 test/integration/NFTs1155_noGateway.test.ts
  119. +54 −28 test/{integration-tests → integration}/NFTs721.test.ts
  120. +163 −0 test/integration/NFTs721Subscription.test.ts
  121. +174 −0 test/integration/NvmApp.test.ts
  122. +26 −14 test/{integration-tests → integration}/Provenance.test.ts
  123. +22 −0 test/integration/Status.test.ts
  124. +32 −9 test/{integration-tests → integration}/Utils.test.ts
  125. +0 −1 test/resources/example-1.json
  126. +34 −0 test/resources/metadata-dataset.json
  127. +24 −0 test/resources/metadata-subscription.json
  128. +43 −0 test/resources/metadata-webservice.json
  129. +1,273 −0 test/resources/nfts/NFT721SubscriptionUpgradeable.json
  130. +0 −1,309 test/resources/nfts/TestERC721.json
  131. +103 −0 test/testing_gnosis.md
  132. +35 −67 tsconfig.json
  133. +0 −7,928 yarn.lock
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
85 changes: 16 additions & 69 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,72 +1,19 @@
{
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"extends": [
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": false
},
"project": "tsconfig.json",
"tsconfigRootDir": "."
},
"plugins": [
"@typescript-eslint",
"prettier"
],
"rules": {
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/member-delimiter-style": [
"warn",
{
"multiline": {
"delimiter": "none",
"requireLast": true
}
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-object-literal-type-assertion": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-useless-constructor": "warn",
"no-dupe-class-members": [
"warn"
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-restricted-properties": [
2,
{
"object": "describe",
"property": "only"
},
{
"object": "it",
"property": "only"
}
"extends": [
"nevermined"
],
"no-useless-constructor": [
"off"
],
"prefer-destructuring": [
"warn"
],
"prettier/prettier": "warn"
"rules": {
"@next/next/no-html-link-for-pages": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}]
},
"ignorePatterns": []
}
}
44 changes: 0 additions & 44 deletions .github/workflows/build.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/push-to-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Push documentation to docs repo

on:
workflow_dispatch:
push:
tags:
- v*

jobs:
build-and-push-to-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '18'
- name: Install dependencies
run: |
yarn install --ignore-engines
yarn run generate-doc
- name: Install envsubst
run: |
sudo apt update
sudo apt install -y gettext
- name: Download push-to-docs script template
run: |
curl -o push-to-docs.sh.template https://raw.githubusercontent.com/nevermined-io/reusable-workflows/main/scripts/push-to-docs.sh
- name: Replace env vars in push-to-docs script
env:
BRANCH_TO_CLONE: main
REPO_TO_PUSH: docs
PATH_TO_COPY: docs/
PATH_TO_PUSH: docs/cli
REPOSITORY_NAME: ${{ github.repository }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: |
export REPOSITORY_NAME=$(echo $REPOSITORY_NAME | awk -F '/' '{print $2}')
envsubst < push-to-docs.sh.template > push-to-docs.sh
env > env.file
chmod +x push-to-docs.sh
./push-to-docs.sh
60 changes: 60 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: GitHub Release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
name: "Tagged Release"
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.API_TOKEN_GITHUB }}

# Build process
- uses: actions/setup-node@v3
with:
node-version: '18'

- name: Set version to env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Update CHANGELOG.md
id: changelog
run: |
npm install auto-changelog
npx auto-changelog
- name: Detect branch to commit changelog
id: branch-changelog
run: |
tagged_branches=$(git --no-pager branch -a --contains tags/${{ env.RELEASE_VERSION }} --no-column)
echo "$tagged_branches"
if echo "$tagged_branches" | grep -E '^[[:space:]]*main$' > /dev/null; then
commit_branch=main
elif echo "$tagged_branches" | grep -E '^[[:space:]]*master$' > /dev/null; then
commit_branch=master
elif echo "$tagged_branches" | grep -E '^[[:space:]]*develop$' > /dev/null; then
commit_branch=develop
else
commit_branch=$(echo "$tagged_branches" | tail -n1)
commit_branch=${commit_branch//[[:blank:]]/}
fi
commit_branch="${commit_branch//remotes\/origin\//}"
echo "COMMIT_BRANCH=${commit_branch}" >> $GITHUB_ENV
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated CHANGELOG.md update
commit_options: "--no-verify --signoff"
file_pattern: CHANGELOG.md
branch: ${{ env.COMMIT_BRANCH }}

- name: Publish Github Release
uses: softprops/action-gh-release@v1
6 changes: 3 additions & 3 deletions .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.x'
node-version: '18'
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- run: yarn build
43 changes: 43 additions & 0 deletions .github/workflows/testing-nigthly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tests Nightly

on:
schedule:
- cron: '30 3 * * *'


jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: |
yarn install --ignore-engines
- name: Lint
run: |
yarn lint
- name: Run e2e tests
env:
LOCAL_CONF_DIR: "/tmp/.nevermined"
SEED_WORDS: ${{ secrets.MNEMONIC_TESTING_MUMBAI }}
TOKEN_ADDRESS: "0x001B3B4d0F3714Ca98ba10F6042DaEbF0B1B7b6F"
WEB3_PROVIDER_URL: https://polygon-mumbai.infura.io/v3/${{ secrets.INFURA_TOKEN }}
NETWORK: "mumbai"
IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }}
IPFS_PROJECT_SECRET: ${{ secrets.IPFS_PROJECT_SECRET }}
run: |
sleep 10
yarn build
yarn test test/integration/NFTs1155.test.ts
- name: Upload logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: nevermined-tools-output
path: tools/nevermined_tools.txt
60 changes: 60 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Testing

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Reclaim some disk space
run: docker system prune --all --volumes -f
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: |
yarn
- name: Run linters
run: yarn lint

- uses: nevermined-io/nvm-tools-actions@v0.15.0
with:
token: ${{ secrets.API_TOKEN_GITHUB }}
opengsn: 'true'
estuary: 'true'
contracts-version: 'v3.5.7'
node-version: 'latest'
- name: Check artifacts and circuits
run: |
nvm-tools copy-artifacts /tmp/.nevermined/artifacts
ls -l /tmp/.nevermined/artifacts/ready
nvm-tools copy-circuits /tmp/.nevermined/circuits
ls -l /tmp/.nevermined/circuits/keytransfer.wasm
- name: Build
run: |
yarn build
yarn start --help
- name: Run integration tests
env:
SEED_WORDS: ${{ secrets.TEST_MNEMONIC }}
INFURA_TOKEN: ${{ secrets.INFURA_TOKEN }}
IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }}
IPFS_PROJECT_SECRET: ${{ secrets.IPFS_PROJECT_SECRET }}
LOCAL_CONF_DIR: '/tmp/.nevermined'
TOKEN_ADDRESS: '0x0000000000000000000000000000000000000000'
WEB3_PROVIDER_URL: 'http://contracts.nevermined.localnet'
NETWORK: 'geth-localnet'

run: |
yarn test:integration
- name: Upload logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: nevermined-tools-output
path: tools/nevermined_tools.txt
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/node_modules/
yarn-error.log
/dist/
.env
.env_*
.env*
*.tgz
coverage
.vscode
package-lock.json
yarn.lock
artifacts/
.idea
.yalc*
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

Loading