From 97246c471e84334f5df221a3c15410f1c4d53d38 Mon Sep 17 00:00:00 2001 From: Alexander Sadovsky Date: Fri, 7 Sep 2018 21:47:43 +0200 Subject: [PATCH] removed descriptions and examples from models --- api/models/Asset.ts | 18 ++++++------------ api/models/Job.ts | 26 ++++++-------------------- api/models/Task.ts | 35 +++++++---------------------------- api/models/Webhook.ts | 16 +++------------- 4 files changed, 22 insertions(+), 73 deletions(-) diff --git a/api/models/Asset.ts b/api/models/Asset.ts index 3dd418c..7725c60 100644 --- a/api/models/Asset.ts +++ b/api/models/Asset.ts @@ -12,33 +12,27 @@ module.exports = { type: 'integer', autoIncrement: true, unique: true, - primaryKey: true, - description: '(auto-generated)' + primaryKey: true }, fileDescriptor: { - type: 'string', - description: 'unique name of the file. (auto-generated)' + type: 'string' }, fileOriginalName: { - type: 'string', - description: 'original name of the file as uploaded. (auto-filled)' + type: 'string' }, isReference: { - type: 'boolean', - description: 'if is set to true, then the Asset is not suppossed to be actionable.' + type: 'boolean' }, sourceLanguage: { - type: 'string', - description: 'language code of the source' + type: 'string' }, encoding: { - type: 'string', - description: 'encoding code' + type: 'string' }, jobId: { diff --git a/api/models/Job.ts b/api/models/Job.ts index 8113b7f..e28f885 100644 --- a/api/models/Job.ts +++ b/api/models/Job.ts @@ -12,13 +12,11 @@ module.exports = { type: 'integer', autoIncrement: true, unique: true, - primaryKey: true, - description: '(auto-generated)' + primaryKey: true }, name: { - type: 'string', - description: 'name of a Job' + type: 'string' }, description: { @@ -26,20 +24,16 @@ module.exports = { }, dueAt: { - type: 'datetime', - description: 'a date-time with a deadline' + type: 'datetime' }, closedAt: { - type: 'datetime', - description: 'a date-time when the Job was closed' + type: 'datetime' }, submitter: { type: 'string', - description: '"server name / id" of the user who did submit the Job', - required: true, - example: 'symfonie.com/43920149320' + required: true }, assets: { @@ -48,18 +42,10 @@ module.exports = { }, externalId: { - type: 'string', - description: 'external project id, as is defined on the external system' + type: 'string' } }, - // custom validation functions - types: { - // This is a workaround for having description in the attributes. - // Otherwise there would be an error. - description: () => true, - example: () => true - } }; diff --git a/api/models/Task.ts b/api/models/Task.ts index 3f7e792..4a52cd3 100644 --- a/api/models/Task.ts +++ b/api/models/Task.ts @@ -12,8 +12,7 @@ export = { type: 'integer', autoIncrement: true, unique: true, - primaryKey: true, - description: '(auto-generated)' + primaryKey: true }, type: { @@ -23,39 +22,25 @@ export = { }, targetLanguage: { - type: 'string', - description: 'language code of the target' + type: 'string' }, progress: { type: 'string', enum: ['pending', 'in progress', 'paused', 'canceled', 'finished'], - defaultsTo: 'pending', - description: `pending - the Task has been created, and it's pending to be reviewed and assigned to someone. - -in progress - the Task has been assigned to someone and is being worked on. - -paused - the Task went from in progress, to paused, because something is blocking the Task, or the assignee has other priorities. - -canceled - someone did cancel this Task. - -finished - the work on this Task is done and deliverableLocation is filled with a path to deliverable.` + defaultsTo: 'pending' }, assignedTo: { - type: 'string', - description: '"server name / id" of the user who it is assigned to', - example: 'symfonie.com/43920149320' + type: 'string' }, fileDescriptor: { - type: 'string', - description: 'unique name of the file. (auto-generated)' + type: 'string' }, fileOriginalName: { - type: 'string', - description: 'original name of the file as uploaded. (auto-filled)' + type: 'string' }, jobId: { @@ -66,13 +51,7 @@ finished - the work on this Task is done and deliverableLocation is filled with assetId: { model: 'asset' } - }, - - // custom validation functions - types: { - // This is a workaround for having description in the attributes. - // Otherwise there would be an error. - description: () => true } + }; diff --git a/api/models/Webhook.ts b/api/models/Webhook.ts index d95b584..25b9fc2 100644 --- a/api/models/Webhook.ts +++ b/api/models/Webhook.ts @@ -12,13 +12,11 @@ module.exports = { type: 'integer', autoIncrement: true, unique: true, - primaryKey: true, - description: '(auto-generated)' + primaryKey: true }, name: { - type: 'string', - description: 'name of the Webhook' + type: 'string' }, description: { @@ -27,7 +25,6 @@ module.exports = { url: { type: 'string', - description: 'url which the server will make a request to when an event occurs', required: true }, @@ -44,16 +41,9 @@ module.exports = { 'assetUpdated', 'assetDeleted' ], - description: 'type of event - if this event occurs, then the "url" will be requested by the TAPICC server', required: true } - }, - - // custom validation functions - types: { - // This is a workaround for having description in the attributes. - // Otherwise there would be an error. - description: () => true } + };