# warehouse.ai-status-models

> models for warehouse.ai-status-api

Latest version **2.0.3** (published 2020-03-23) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install warehouse.ai-status-models
pnpm add warehouse.ai-status-models
yarn add warehouse.ai-status-models
bun add warehouse.ai-status-models
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2020-03-23 |
| First published | 2018-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 32.8 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | GoDaddy.com Operating Company, LLC |
| Maintainers | cfellin, indexzero, jcrugzz, msluther, swaagie, ywaaang |
| Keywords | warehouse.ai-status-api, dynastar, dynamo, warehouse.ai |

## Links

- npm: https://www.npmjs.com/package/warehouse.ai-status-models
- Repository: https://github.com/warehouseai/warehouse.ai-status-models
- Homepage: https://github.com/warehouseai/warehouse.ai-status-models#readme
- Issues: https://github.com/warehouseai/warehouse.ai-status-models/issues
- npm.io page: https://npm.io/package/warehouse.ai-status-models

## Dependencies (3)

- [joi](https://npm.io/package/joi.md) ^14.3.1
- [dynastar](https://npm.io/package/dynastar.md) ^1.2.0
- [tinythen](https://npm.io/package/tinythen.md) ^1.0.1

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 2.0.3 (latest) — 2020-03-23
- 2.0.2 — 2019-11-12
- 2.0.1 — 2019-11-10
- 2.0.0 — 2019-11-05
- 1.2.0 — 2018-06-29
- 1.1.1 — 2018-06-29
- 1.1.0 — 2018-06-27
- 1.0.0 — 2018-06-25

## README

# warehouse.ai-status-models

[![Version npm](https://img.shields.io/npm/v/warehouse.ai-status-models.svg?style=flat-square)](https://www.npmjs.com/package/warehouse.ai-status-models)
[![License](https://img.shields.io/npm/l/warehouse.ai-status-models.svg?style=flat-square)](https://github.com/warehouseai/warehouse.ai-status-models/blob/master/LICENSE)
[![npm Downloads](https://img.shields.io/npm/dm/warehouse.ai-status-models.svg?style=flat-square)](https://npmcharts.com/compare/warehouse.ai-status-models?minimal=true)
[![Build Status](https://travis-ci.org/warehouseai/warehouse.ai-status-models.svg?branch=master)](https://travis-ci.org/warehouseai/warehouse.ai-status-models)
[![Dependencies](https://img.shields.io/david/warehouseai/warehouse.ai-status-models.svg?style=flat-square)](https://github.com/warehouseai/warehouse.ai-status-models/blob/master/package.json)

[Datastar][dynastar] models for the [Warehouse.ai-status-api].

## Install

```bash
npm install warehouse.ai-status-models --save
```

## Usage

```
const dynamoClient = new AWS.DynamoDB({ /* connection config */ });
const dynamodb = require('dynamodb');
dynamodb.dynamoDriver(dynamoClient);
const models = require('warehouse.ai-status-models')(dynamodb);

// from dynastar.define we get...
const Status = models.Status;

Status.findOne({ ... }).then(res => { ... }).catch(err => { ... });
```

## API

All schemas for the API documentation are written using
[Joi][joi] notation.

### Schemas

### Status (`Status`)

Generic status information

Column             | Type             | Summary
------------------ | ---------------- | ------------
pkg (pk)           | string           | Name of a package
env (pk)           | string           | What environment is this build made for (dev, test, etc.)
version (pk)       | string           | What version of a package does this status represent
previousVersion    | string           | The previous version number
total              | number           | Total progress as percentage
error              | boolean          | Did the build error
createdAt          | timestamp        | Time of creation
updatedAt          | timestamp        | Time of last update
complete           | boolean          | Did the build complete

### StatusHead (`StatusHead`)

Generic status information but just for he  latest version for a given
`pkg` and `env`. Refer to the table above for details. The properties
`error` and `complete` do not exist on this table.

### StatusEvent (`StatusEvent`)

A detailed event for the various stages of a build process containing `message`
and optional `details` properties as well as `locale` and whether it is and
error or not.

Column             | Type             | Summary
------------------ | ---------------- | ------------
pkg (pk)           | string           | Name of a package
env (pk)           | string           | What environment is this build made for (dev, test, etc.)
version (pk)       | string           | What version of a package does this status represent
locale             | string           | Build locale
error              | boolean          | Is the status event an error
message            | string           | Status message
details            | string           | Message details
createdAt          | timestamp        | Time of creation
eventId            | string (timeUUID)| Unique id sortable by time

### StatusCounter (`StatusCounter`)

A simple distributed counter model that is incremented when a `locale` build
has completed in order to compute progress based on total amount of `locales`.

Column             | Type             | Summary
------------------ | ---------------- | ------------
pkg (pk)           | string           | Name of a package
env (pk)           | string           | What environment is this build made for (dev, test, etc.)
version (pk)       | string           | What version of a package does this status represent
count              | counter          | Incrementable counter

## Test

Before running tests, spin up an instance of localstack by running

```sh
npm run localstack
```

Then run:

```sh
npm test
```

[dynastar]: https://github.com/godaddy/dynastar
[Warehouse.ai-status-api]: https://github.com/godaddy/warehouse.ai-status-api
[joi]: https://github.com/hapijs/joi

---
_Source: https://npm.io/package/warehouse.ai-status-models · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
