2.0.3 • Published 4 years ago

warehouse.ai-status-models v2.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

warehouse.ai-status-models

Version npm License npm Downloads Build Status Dependencies

Datastar models for the Warehouse.ai-status-api.

Install

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 notation.

Schemas

Status (Status)

Generic status information

ColumnTypeSummary
pkg (pk)stringName of a package
env (pk)stringWhat environment is this build made for (dev, test, etc.)
version (pk)stringWhat version of a package does this status represent
previousVersionstringThe previous version number
totalnumberTotal progress as percentage
errorbooleanDid the build error
createdAttimestampTime of creation
updatedAttimestampTime of last update
completebooleanDid 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.

ColumnTypeSummary
pkg (pk)stringName of a package
env (pk)stringWhat environment is this build made for (dev, test, etc.)
version (pk)stringWhat version of a package does this status represent
localestringBuild locale
errorbooleanIs the status event an error
messagestringStatus message
detailsstringMessage details
createdAttimestampTime of creation
eventIdstring (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.

ColumnTypeSummary
pkg (pk)stringName of a package
env (pk)stringWhat environment is this build made for (dev, test, etc.)
version (pk)stringWhat version of a package does this status represent
countcounterIncrementable counter

Test

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

npm run localstack

Then run:

npm test
2.0.3

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago