# tc-sub-cli

> A CLI tool that will be used by Topcoder members to submit their solutions on challenges.

Latest version **1.0.2** (published 2019-07-17) · 0 weekly downloads

## Install

```sh
npm install tc-sub-cli
pnpm add tc-sub-cli
yarn add tc-sub-cli
bun add tc-sub-cli
```

Provides the command `tc-submission-cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-07-17 |
| First published | 2019-07-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | aaron2071 |

## Links

- npm: https://www.npmjs.com/package/tc-sub-cli
- npm.io page: https://npm.io/package/tc-sub-cli

## Dependencies (9)

- [joi](https://npm.io/package/joi.md) ^14.0.0
- [config](https://npm.io/package/config.md) ^3.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [adm-zip](https://npm.io/package/adm-zip.md) ^0.4.11
- [winston](https://npm.io/package/winston.md) ^3.2.1
- [progress](https://npm.io/package/progress.md) ^2.0.3
- [fast-glob](https://npm.io/package/fast-glob.md) ^2.2.6
- [superagent](https://npm.io/package/superagent.md) ^5.0.5
- [get-parameter-names](https://npm.io/package/get-parameter-names.md) ^0.3.0

## Recent versions

- 1.0.2 (latest) — 2019-07-17
- 1.0.1 — 2019-07-14
- 1.0.0 — 2019-07-14

## README

tc-submission-cli
===

# Dependencies
- nodejs https://nodejs.org/en/ (v10)
- npm https://www.npmjs.com/ (v6)

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

| 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     | LDAP                                       | 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:

``` 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
  ],
  "userId": "8547899",
  "username": "TonyJ",
  "password": "appirio123"
}
```

# test

## Prepare
- Install dependencies `npm install`

## Unit test
To run unit tests alone

```bash
npm run test
```

To run unit tests with coverage report

```bash
npm run test:cov
```

---
_Source: https://npm.io/package/tc-sub-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
