Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scw support #1250

Closed
wants to merge 10 commits into from
Closed

Add scw support #1250

wants to merge 10 commits into from

Conversation

Aman035
Copy link
Member

@Aman035 Aman035 commented Apr 29, 2024

Fixes Issue

Changes proposed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

@Aman035 Aman035 marked this pull request as draft April 29, 2024 11:31
Copy link

github-actions bot commented May 9, 2024

In the package.json file:

  1. Typo: "comomnjs" should be corrected to "commonjs".
  2. Typo: "ETH" should be changed to "ether" in the peerDependencies key.
  3. Missing closing curly brace for the "dependencies" object.
  4. Missing closing curly brace for the "peerDependencies" object.
  5. Missing closing curly brace for the "peerDependenciesMeta" object.
  6. Typo: "viem" should be changed to "vue" in the dependencies list.
  7. Typo: "TS_NODE_PROJECT" should be "TS_NODE_PROJECTS".
  8. Typo: "DOENV_CONFIG_PATH" should be "DOTENV_CONFIG_PATH".

In the service.ts file:

  1. Typo: "ENV" should be imported from the correct location.
  2. Missing imports for Constants, generateHash, and axiosPost.
  3. Missing closing curly brace for the body object.
  4. Typo: "return" should be outside of the body object.

In the constants.ts file:

  1. Typo: "SUPPORTED ENCRYPTIONS FOR PUSH PROFILE" should be under comment syntax.
  2. Typo: Missing closing curly brace for the ALPHA_FEATURES object.
  3. Typo: Missing closing parenthesis for the PACKAGE_BUILD ternary operation.

In the crypto.ts file:

  1. Typo: Missing closing parenthesis for the getEncryptionPublicKey function call.
  2. Typo: Missing closing parenthesis for the encryptPGPKey function call.

Based on the identified issues, the corrected changes should be made in the respective files.

Copy link

In the packages/restapi/package.json file:

  1. "peerDependencies" object is missing a closing curly brace }.
  2. "peerDependenciesMeta" object is missing a closing curly brace }.
  3. "dependencies" object is missing a closing curly brace }.
  4. "scripts" object is missing a closing curly brace }.
  5. "scripts" "test" value is missing a closing parenthesis ).
  6. Closing curly brace } is missing at the end of the file.
  7. Typo: "viem": "^1.20.3" should be "vue": "^3.0.0"

After fixing the above issues:

{
  "name": "@pushprotocol/restapi",
  "version": "0.0.1-alpha.89",
  "type": "commonjs",
  "publishConfig": {
    "registry": "https://registry.npmjs.org/"
  },
  "peerDependencies": {
    "ethers": "^5.0.0 || ^6.0.0"
  },
  "peerDependenciesMeta": {
    "ethers": {
      "optional": true
    }
  },
  "dependencies": {
    "@lit-protocol/lit-node-client": "^5.0.0",
    "@metamask/eth-sig-util": "^5.0.2",
    "buffer": "^6.0.3",
    "crypto-js": "^4.1.1",
    "immer": "^10.0.2",
    "joi": "^17.9.2",
    "livepeer": "^2.5.8",
    "lru-cache": "^10.1.0",
    "openpgp": "^5.5.0",
    "shamir-secret-sharing": "^0.0.3",
    "simple-peer": "^9.11.1",
    "socket.io-client": "^4.7.2",
    "video-stream-merger": "^4.0.1",
    "vue": "^3.0.0"
  },
  "scripts": {
    "test": "TS_NODE_PROJECT='./tsconfig.mocha.json' NODE_OPTIONS='--loader ts-node/esm' DOTENV_CONFIG_PATH='./tests/.env' mocha -r ts-node/register -r dotenv/config 'tests/**/*.test.ts' --timeout 1200000 --require tests/root.ts --serial"
  },
  "devDependencies": {
    "@types/chai": "^4.3.4",
    "@types/chai-as-promised": "^7.1.5",
    "@types/crypto-js": "^4.1.1",
    "@types/mocha": "^10.0.1",
    "chai": "^4.3.7",
    "chai-as-promised": "^7.1.1",
    "envfile": "^7.1.0",
    "mocha": "^10.2.0",
    "mocha-typescript": "^1.1.17",
    "ts-node": "^10.9.1",
    "typescript": "^5.0.2"
  }
}

In the packages/restapi/src/lib/chat/helpers/service.ts file:

  1. 'generateHash' function is being used but not imported from any file.
  2. 'ENV' constant is being used but not imported from any file.
  3. In the createUserService function, there should be a closing curly brace } after the spread operator in the 'body' object.
  4. The 'authUpdateUserService' function is not implemented correctly, it's missing its implementation.

In the packages/restapi/src/lib/chat/helpers/signature.ts file:

  1. 'generateHash' function is being used but not imported from any file.
  2. In the 'isValidNFTCAIP' function, there is a missing return statement after the condition check.
  3. The 'validateCAIP' function is referring to 'isValidNFTCAIP' but no import is available for it.

In the packages/restapi/src/lib/constants.ts file:

  1. There is a typo in the comment block: "SUPPORTED ENCRYPTIONS FOR PUSH PROFILE" should be commented out.
  2. The 'ENC_TYPE_V5' constant is unused.

In the packages/restapi/src/lib/helpers/address.ts file:

  1. In the 'isValidNFTCAIP' function, there is a missing return statement after the conditions check in the second block.
  2. In the 'convertToValidDID' function, there is a missing closing curly brace } after the 'if (isValidNFTCAIP(wallet)) {' block.
  3. In the 'getCAIPAddress' function, after the 'if (isValidNFTCAIP(address)) {' block, add a closing curly brace }.
  4. In the 'getCAIPAddress' function, the else block should have a closing curly brace } after the error message.
  5. In the 'getCAIPWithChainId' function, there is a missing opening curly brace { after the second comma.
  6. In the 'getCAIPWithChainId' function, there is a missing closing curly brace } at the end of the file.
  7. In the 'walletToPCAIP10' function, the return statement should be return 'eip155:' + account;.

Overall, the code has several issues and missing implementations. It needs further development and corrections before it can be considered ready.

Copy link

In the packages/restapi/package.json file:

  1. There is a missing closing curly brace after the "peerDependencies" object.
  2. There is a missing closing curly brace after the "peerDependenciesMeta" object.
  3. There is a missing closing curly brace after the "dependencies" object.
  4. There is a missing closing curly brace after the "scripts" object.

Therefore, the correct formatting of the package.json file should be:

{
  "name": "@pushprotocol/restapi",
  "version": "0.0.1-alpha.89",
  "type": "commonjs",
  "publishConfig": {
    "registry": "https://registry.npmjs.org/"
  },
  "peerDependencies": {
    "ethers": "^5.0.0 || ^6.0.0"
  },
  "peerDependenciesMeta": {
    "ethers": {
      "optional": true
    }
  },
  "dependencies": {
    "@lit-protocol/lit-node-client": "^5.0.0",
    "@metamask/eth-sig-util": "^5.0.2",
    "buffer": "^6.0.3",
    "crypto-js": "^4.1.1",
    "immer": "^10.0.2",
    "joi": "^17.9.2",
    "livepeer": "^2.5.8",
    "lru-cache": "^10.1.0",
    "openpgp": "^5.5.0",
    "shamir-secret-sharing": "^0.0.3",
    "simple-peer": "^9.11.1",
    "socket.io-client": "^4.7.2",
    "video-stream-merger": "^4.0.1",
    "viem": "^1.20.3"
  },
  "scripts": {
    "test": "TS_NODE_PROJECT='./tsconfig.mocha.json' NODE_OPTIONS='--loader ts-node/esm' DOTENV_CONFIG_PATH='./tests/.env' mocha -r ts-node/register -r dotenv/config 'tests/**/*.test.ts' --timeout 1200000 --require tests/root.ts --serial"
  },
  "devDependencies": {
    "@types/chai": "^4.3.4",
    "@types/chai-as-promised": "^7.1.5",
    "@types/crypto-js": "^4.1.1",
    "@types/mocha": "^10.0.1",
    "chai": "^4.3.7",
    "chai-as-promised": "^7.1.1",
    "envfile": "^7.1.0",
    "mocha": "^10.2.0",
    "mocha-typescript": "^1.1.17",
    "ts-node": "^10.9.1",
    "typescript": "^5.0.2"
  }
}

In the packages/restapi/src/lib/chat/helpers/service.ts file, there is an incomplete body object in the createUserService function. The body object is not closed properly after spreading the signatureObj. It should be closed before calling axiosPost.

I would suggest making these corrections in the respective files.

All looks good.

@mishramonalisha76 mishramonalisha76 deleted the branch alpha July 4, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants