Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
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: topcoder-archive/topcoder-platform-topcoder-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.1
Choose a base ref
...
head repository: topcoder-archive/topcoder-platform-topcoder-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jul 23, 2019

  1. Copy the full SHA
    16e8d95 View commit details
  2. adding some shields

    cwdcwd authored Jul 23, 2019
    Copy the full SHA
    bc74b38 View commit details
  3. moar shields

    cwdcwd authored Jul 23, 2019
    Copy the full SHA
    7503811 View commit details
  4. v bump for pub

    cwdcwd authored Jul 23, 2019
    Copy the full SHA
    31d11f2 View commit details

Commits on Aug 1, 2019

  1. Copy the full SHA
    bfb2b49 View commit details
  2. Copy the full SHA
    d753f52 View commit details
  3. Bump npm version

    ThomasKranitsas committed Aug 1, 2019
    Copy the full SHA
    2ffc76e View commit details
  4. Merge pull request #10 from topcoder-platform/develop

    Update README and move development instructions on separate doc
    ThomasKranitsas authored Aug 1, 2019
    Copy the full SHA
    f8fa327 View commit details

Commits on Aug 12, 2019

  1. Copy the full SHA
    aec83e9 View commit details
  2. Merge pull request #11 from sharathkumaranbu/Issue_4

    Help option and lint fixes
    ThomasKranitsas authored Aug 12, 2019
    Copy the full SHA
    914d579 View commit details

Commits on Aug 16, 2019

  1. Copy the full SHA
    7e6b257 View commit details
  2. sync with develop

    ThomasKranitsas committed Aug 16, 2019
    Copy the full SHA
    42f1813 View commit details
  3. Fix tests

    ThomasKranitsas committed Aug 16, 2019
    Copy the full SHA
    11ff818 View commit details
  4. Merge pull request #13 from topcoder-platform/use-api-wrapper

    Update module to use the submission API wrapper
    ThomasKranitsas authored Aug 16, 2019
    Copy the full SHA
    f8f2054 View commit details

Commits on Aug 17, 2019

  1. Copy the full SHA
    a6299a4 View commit details

Commits on Aug 18, 2019

  1. Review fixes

    sharathkumaranbu committed Aug 18, 2019
    Copy the full SHA
    01025c6 View commit details
  2. Merge pull request #14 from sharathkumaranbu/Issue_12

    Override RC file with CLI params
    ThomasKranitsas authored Aug 18, 2019
    Copy the full SHA
    00a8532 View commit details
  3. Fix tests

    ThomasKranitsas committed Aug 18, 2019
    Copy the full SHA
    0826493 View commit details
  4. Fix tests

    ThomasKranitsas committed Aug 18, 2019
    Copy the full SHA
    5f7d975 View commit details

Commits on Oct 2, 2019

  1. Code from 30103383

    ThomasKranitsas committed Oct 2, 2019
    Copy the full SHA
    b3a26be View commit details

Commits on Nov 28, 2019

  1. Copy the full SHA
    1296972 View commit details
  2. Copy the full SHA
    4f96a43 View commit details

Commits on Dec 5, 2019

  1. Copy the full SHA
    c1a95e6 View commit details

Commits on Dec 6, 2019

  1. Stream downloads instead of saving to a buffer (#23)

    Support streaming downloads and fixing vulnerabilities
    dhruvit-r authored and sharathkumaranbu committed Dec 6, 2019
    Copy the full SHA
    316521d View commit details

Commits on Dec 16, 2019

  1. Add robust unit tests (#25)

    Robust unit tests
    imcaizheng authored and sharathkumaranbu committed Dec 16, 2019
    Copy the full SHA
    d524a84 View commit details
  2. Copy the full SHA
    a83b388 View commit details
  3. Improving tests

    imcaizheng authored and sharathkumaranbu committed Dec 16, 2019
    Copy the full SHA
    7b72ec2 View commit details
  4. Copy the full SHA
    06b4b3a View commit details
  5. Merge pull request #27 from topcoder-platform/develop

    Keeping master up to date
    cwdcwd authored Dec 16, 2019
    Copy the full SHA
    2b3bf1f View commit details

Commits on Jan 3, 2020

  1. Copy the full SHA
    fd0394d View commit details
Showing with 3,212 additions and 3,922 deletions.
  1. +1 −1 .circleci/config.yml
  2. +0 −1 .eslintrc.yaml
  3. +144 −2 .gitignore
  4. +9 −64 README.md
  5. +0 −15 bin/cli.js
  6. +219 −0 bin/topcoder-cli.js
  7. +0 −13 config/default.js
  8. +21 −0 config/dev.js
  9. +20 −0 config/prod.js
  10. +13 −2 constants.js
  11. +58 −0 docs/Development.md
  12. +17 −0 docs/index.md
  13. +0 −3,327 package-lock.json
  14. +36 −8 package.json
  15. +42 −0 src/commands/config.js
  16. +13 −0 src/commands/fetchArtifacts.js
  17. +13 −0 src/commands/fetchSubmissions.js
  18. +53 −0 src/commands/pay.js
  19. +13 −0 src/commands/submit.js
  20. +97 −188 src/common/helper.js
  21. +18 −16 src/common/logger.js
  22. +13 −0 src/config.js
  23. +85 −0 src/services/configService.js
  24. +136 −0 src/services/fetchArtifactsService.js
  25. +185 −0 src/services/fetchSubmissionService.js
  26. +129 −26 src/services/uploadSubmissionService.js
  27. +80 −0 test/cli.test.js
  28. +634 −0 test/common/submissions.json
  29. +36 −25 test/common/testData.js
  30. +177 −5 test/common/testHelper.js
  31. +0 −1 test/common/test_codebases/rc_file_with_invalid_json_syntax/.topcoderrc
  32. +0 −30 test/common/test_codebases/rc_file_with_invalid_json_syntax/package.json
  33. +0 −8 test/common/test_codebases/with_rc_file/.topcoderrc
  34. +0 −30 test/common/test_codebases/with_rc_file/package.json
  35. +0 −3 test/common/test_codebases/with_rc_file/src/app.js
  36. +0 −30 test/common/test_codebases/without_rc_file/package.json
  37. BIN test/common/test_zip_file.zip
  38. +110 −0 test/config.command.test.js
  39. +198 −0 test/fetchArtifacts.command.test.js
  40. +228 −0 test/fetchSubmissions.command.test.js
  41. +72 −0 test/pay.command.test.js
  42. +152 −47 test/prepare.js
  43. +190 −0 test/submit.command.test.js
  44. +0 −80 test/unit.test.js
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ version: 2
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.9.1
- image: circleci/node:10.16.2

jobs:
test:
1 change: 0 additions & 1 deletion .eslintrc.yaml

This file was deleted.

146 changes: 144 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,145 @@
.nyc_output
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig

# Created by https://www.gitignore.io/api/visualstudiocode,node,macos
# Edit at https://www.gitignore.io/?templates=visualstudiocode,node,macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
/node_modules
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# react / gatsby
public/

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

# End of https://www.gitignore.io/api/visualstudiocode,node,macos

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

.topcoderrc

# package-lock.json vary while installing on different operating system
package-lock.json
73 changes: 9 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,19 @@
topcoder-cli
# Topcoder CLI
===

# Dependencies
- nodejs https://nodejs.org/en/ (v10)
- npm https://www.npmjs.com/ (v6)
#### Build Status:
[![CircleCI](https://circleci.com/gh/topcoder-platform/topcoder-cli/tree/master.svg?style=svg)](https://circleci.com/gh/topcoder-platform/topcoder-cli/tree/master) ![npm (tag)](https://img.shields.io/npm/v/@topcoder/topcoder-cli/latest.svg?style=plastic) ![GitHub issues](https://img.shields.io/github/issues/topcoder-platform/topcoder-cli.svg?style=plastic)

# Configuration
Configuration for the application is at `config/default.js`.
The following parameters can be set in config files or in env variables:
## Installation

| Property | Environment varible | Default value | Description |
| --- | --- | --- | --- |
| LOG_LEVEL | LOG_LEVEL | info | control log level |
| SUBMISSION_API_URL | TEST_SUBMISSION_API_URL | https://api.topcoder.com/v5/submissions | the TC submission API URL |
| TC_AUTHN_URL | TC_AUTHN_URL | https://topcoder.auth0.com/oauth/ro | API that is used to fetch JWT token v2 |
| TC_AUTHZ_URL | TC_AUTHZ_URL | https://api.topcoder.com/v3/authorizations | API that is used to fetch JWT token v3 |
| TC_CLIENT_ID | TC_CLIENT_ID | 6ZwZEUo2ZK4c50aLPpgupeg5v2Ffxp9P | TC client ID |
| TC_CLIENT_V2CONNECTION | CLIENT_V2CONNECTION | TC-User-Database | TC client connection protocol |

# Publish the package to npm
- Create a npm account on https://www.npmjs.com/signup if you don't have one.
- Use the account to sign in via cli: `npm login`
- In the root directory of the project, run `npm publish --access=public` to publish the package to npm registry.

## Notes
- In rare cases the module name would have been used by others. You may need to change the value of the `name` field in `package.json`
to a unique one.
- When you make changes to your code and want to update the package you'll need to update the version of the package.
After that, run `npm publish` again to republish the package.
- If you want to remove the package from npm registry anyway, run `npm unpublish --force` under the root directory of the project.

# Installation

- After you published the package to npm registry you can then install the package via npm-cli:
- Install the package via npm cli

``` node
npm install -g <your package name here>
```

# Usage

First, install the package, and then run `tc-submission-cli` command on the root directory of your project with `.topcoderrc` file.
It'll then automatically zip all files under the root directory recursively(except the .topcoderrc file itself) and finally upload the zip file to the TC challenge as a submission.

An example `.topcoderrc` file should conform to at least the following structure.

``` jsonr
{
"challengeIds": [
"30095545" // at least one item here
],
"username": "TonyJ",
"password": "appirio123"
}
npm i -g @topcoder/topcoder-cli
```

# test
## Usage

## Prepare
- Install dependencies `npm install`
* To understand the commands supported by Topcoder CLI, after installing the package run `topcoder --help` which would list out all supported commands.

## Unit test
To run unit tests alone

```bash
npm run test
```

To run unit tests with coverage report

```bash
npm run test:cov
```
* If you need to understand the options available with each command, run `topcoder [ command ] --help`. E.g. Executing the command `topcoder submit --help` will display the help content related to making topcoder submission using CLI
15 changes: 0 additions & 15 deletions bin/cli.js

This file was deleted.

Loading