# api.getscribeware.com

> This project contains various APIs used by the ScribeWare client.

Latest version **1.0.0** (published 2019-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install api.getscribeware.com
pnpm add api.getscribeware.com
yarn add api.getscribeware.com
bun add api.getscribeware.com
```

## 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.0 |
| Published | 2019-12-09 |
| First published | 2019-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 31 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 (+27 in 4 direct dependencies) |
| Install scripts | no |
| Maintainers | zeevl |

## Links

- npm: https://www.npmjs.com/package/api.getscribeware.com
- npm.io page: https://npm.io/package/api.getscribeware.com

## Dependencies (31)

- [qs](https://npm.io/package/qs.md) ^6.5.2
- [nano](https://npm.io/package/nano.md) ^7.0.0
- [uuid](https://npm.io/package/uuid.md) ^3.2.1
- [axios](https://npm.io/package/axios.md) ^0.18.0
- [debug](https://npm.io/package/debug.md) ^3.1.0
- [raven](https://npm.io/package/raven.md) ^2.5.0
- [tslib](https://npm.io/package/tslib.md) ^1.10.0
- [config](https://npm.io/package/config.md) ^1.26.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.5
- [moment](https://npm.io/package/moment.md) ^2.20.1
- [stripe](https://npm.io/package/stripe.md) ^5.8.0
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.19
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.544.0
- [numeral](https://npm.io/package/numeral.md) ^2.0.6
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.0
- [truncate](https://npm.io/package/truncate.md) ^2.0.1
- [serializr](https://npm.io/package/serializr.md) ^1.3.0
- [streakapi](https://npm.io/package/streakapi.md) ^1.2.0
- [sendwithus](https://npm.io/package/sendwithus.md) ^4.2.0
- [humanparser](https://npm.io/package/humanparser.md) ^1.10.0
- [cloudconvert](https://npm.io/package/cloudconvert.md) ^1.1.2
- [randomstring](https://npm.io/package/randomstring.md) ^1.1.5
- [semver-parser](https://npm.io/package/semver-parser.md) ^2.0.3
- [firebase-admin](https://npm.io/package/firebase-admin.md) ^8.8.0
- [supports-color](https://npm.io/package/supports-color.md) ^5.4.0
- [email-addresses](https://npm.io/package/email-addresses.md) ^3.0.3
- [compare-versions](https://npm.io/package/compare-versions.md) ^3.4.0
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.9
- [computed-async-mobx](https://npm.io/package/computed-async-mobx.md) ^4.1.0
- [serverless-sentry-lib](https://npm.io/package/serverless-sentry-lib.md) ^1.0.0
- [serverless-plugin-existing-s3](https://npm.io/package/serverless-plugin-existing-s3.md) ^2.0.3

## Recent versions

- 1.0.0 (latest) — 2019-12-09

## README

# ScribeWare Server API

This project contains various APIs used by the ScribeWare client.

This is a [serverless](http://serverless.com) managed project.

## Stripe Metadata

Various attributes are stored using the `metadata` attributes on stripe:

#### Stripe.customer

- `parentStripeId`: Specifies the stripe id responsible for billing for this account.

#### Stripe.plan

- `isAddon`: items that are "addons" to other plans, such as server storage. There should only be one plan that is _not_ an addon for a given user's subscription
- `isTrial`: This is a trial plan
- `isUnlimited`: This plan includes unlimited reports

##### Stripe.plan (to be deprecated after existing customers switch to metered plans)

- `reports`: # of reports included per billing cycle
- `extraReportCost`: cost (in cents) of each published report beyond the number specified in `reports`

## Testing

Currently (2/13/18) jest can't load stripe. Might be a configuration issue with webpack? Not sure.

A local API server can be run without deploying to AWS. Simply do:

```
npm start
```

Then run scribeware via

```
API_SERVER=http://localhost:3000/ gulp
```

You can also hit APIs directly using `curl`. Some useful examples:

```
curl -H "Content-Type: application/json" -H "Authorization: e4ed6693-fbb9-4800-85f1-f6e908c90131" -H "X-Client-Version: xyz" -X POST -d '{"creditsUsedSinceLastUpdate":1}' http://localhost:3000/v1/user/status

curl -H "Content-Type: application/json" -H "Authorization: 7596b2d2-a67c-4d83-92a7-aaee8c2ce99d" -X POST http://localhost:3000/v1/client/create-dbs

```

using https://httpie.org/

(Remember, emailId must be unique!)

```
http POST https://dev-api.getscribeware.com/v1/emails/send Authorization:test-client-id \
  emailType='publish' \
  sender='Joe Tester' \
  from='tester <test@stevelamb.io>' \
  to='Lake Steve <steve@lakere.com>; Steve lamb<steve@stevelamb.io>' \
  bcc='bcc@test.com' \
  subject='test subject' \
  body='test body' \
  reportId='rep:123'

```

## couchdb

Hosted on EC2 as data.getscribeware.com with haproxy frontend

to update cloudwatch config:

```
sudo vim /opt/aws/amazon-cloudwatch-agent/bin/config.json
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:vim /opt/aws/amazon-cloudwatch-agent/bin/config.json
```

or

```
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c ssm:AmazonCloudWatch-linux
```

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