UNPKG

@unito/integration-api

Version:

The Unito Integration API

93 lines (90 loc) 2.44 kB
'use strict'; /** * A FieldValueType determines the type of an item's value. * The type represents a unique scalar value such as a string or an integer. * For more complex types, use an Item instead. */ const FieldValueTypes = { BLOB: 'blob', BOOLEAN: 'boolean', DATE: 'date', DATE_RANGE: 'dateRange', DATETIME: 'datetime', DATETIME_RANGE: 'datetimeRange', DURATION: 'duration', EMAIL: 'email', RICH_TEXT_HTML: 'html', INTEGER: 'integer', RICH_TEXT_MARKDOWN: 'markdown', NUMBER: 'number', OBJECT: 'object', REFERENCE: 'reference', STRING: 'string', URL: 'url', }; /** * A Semantic gives meaning to an Item or a Field in the Unito platform. * An object with a specified semantic is expected to hold a certain type of value that can later be used * by the consumers of the spec to better understand what that value means. */ const Semantics = { CREATED_AT: 'createdAt', DESCRIPTION: 'description', DISPLAY_NAME: 'displayName', PROVIDER_URL: 'providerUrl', UPDATED_AT: 'updatedAt', USER: 'user', PARENT: 'parent', }; /** * A Relation Semantic gives meaning to a Relation in the Unito platform. A relation with a * specified semantic is expected to hold a certain type of item that can later be used by * the consumers of the spec for specific usage. */ const RelationSemantics = { COMMENTS: 'comments', SUBTASKS: 'subtasks', USERS: 'users', ATTACHMENTS: 'attachments', }; /** * An OperatorType represents an operator used in a filter. */ const OperatorTypes = { EQUAL: '=', NOT_EQUAL: '!=', GREATER_THAN: '>', GREATER_THAN_OR_EQUAL: '>=', LESSER_THAN: '<', LESSER_THAN_OR_EQUAL: '<=', INCLUDE: '*=', EXCLUDE: '!*=', START_WITH: '^=', END_WITH: '$=', IS_NULL: '!!', IS_NOT_NULL: '!', }; /** * HTTP code returned by the integration */ const StatusCodes = { OK: 200, CREATED: 201, ACCEPTED: 202, NO_CONTENT: 204, BAD_REQUEST: 400, UNAUTHORIZED: 401, FORBIDDEN: 403, NOT_FOUND: 404, NOT_ACCEPTABLE: 406, REQUEST_TIMEOUT: 408, UNPROCESSABLE_CONTENT: 422, LOCKED: 423, TOO_MANY_REQUESTS: 429, INTERNAL_SERVER_ERROR: 500, }; exports.FieldValueTypes = FieldValueTypes; exports.OperatorTypes = OperatorTypes; exports.RelationSemantics = RelationSemantics; exports.Semantics = Semantics; exports.StatusCodes = StatusCodes;