diff --git a/app/models/Greeting.model.js b/app/models/Greeting.model.js index dd427bb..4dd8897 100644 --- a/app/models/Greeting.model.js +++ b/app/models/Greeting.model.js @@ -6,7 +6,9 @@ * globally using the model() function. */ const Greeting = { - name: String, + schema: { + name: String, + }, } module.exports = Greeting \ No newline at end of file diff --git a/app/models/Role.model.js b/app/models/Role.model.js index 667c022..15e6617 100644 --- a/app/models/Role.model.js +++ b/app/models/Role.model.js @@ -5,10 +5,11 @@ /** * This model stores the role data from Flitter-auth. * - * @type {Object} */ module.exports = exports = { - name: String, - permissions: [String], - data: String, -} + schema: { + name: String, + permissions: [String], + data: String, + }, +} \ No newline at end of file diff --git a/app/models/User.model.js b/app/models/User.model.js index e1fd70a..c61179b 100644 --- a/app/models/User.model.js +++ b/app/models/User.model.js @@ -8,13 +8,14 @@ * stored instead of cleartext. The data field is for JSON data that * holds various non-DB essential pieces of information about users. * - * @type {Object} */ module.exports = exports = { - username: String, - password: String, - data: String, - uuid: String, - role: String, - permissions: [String], -} + schema: { + username: String, + password: String, + data: String, + uuid: String, + role: String, + permissions: [String], + }, +} \ No newline at end of file diff --git a/app/models/upload/File.model.js b/app/models/upload/File.model.js index b00ebe2..7ae5137 100644 --- a/app/models/upload/File.model.js +++ b/app/models/upload/File.model.js @@ -4,10 +4,12 @@ * Put some description here! */ const File = { - original_name: String, - new_name: String, - mime: String, - type: String, + schema: { + original_name: String, + new_name: String, + mime: String, + type: String, + }, } module.exports = exports = File \ No newline at end of file diff --git a/app/models/v1/Invite.model.js b/app/models/v1/Invite.model.js index 43f8d06..7fd1f25 100644 --- a/app/models/v1/Invite.model.js +++ b/app/models/v1/Invite.model.js @@ -4,11 +4,16 @@ * Put some description here! */ const Invite = { - project_id: String, - by_user_id: String, - api_type: String, - created_on: Date, - used: { type: Boolean, default: false } + schema: { + project_id: String, + by_user_id: String, + api_type: String, + created_on: Date, + used: { + type: Boolean, + default: false + } + }, } module.exports = exports = Invite \ No newline at end of file diff --git a/app/models/v1/Out.model.js b/app/models/v1/Out.model.js index 3d00709..050fe5d 100644 --- a/app/models/v1/Out.model.js +++ b/app/models/v1/Out.model.js @@ -4,10 +4,15 @@ * Put some description here! */ const Out = { - project_id: String, - created: { type: Date, default: Date.now }, - brief: String, - data: String, + schema: { + project_id: String, + created: { + type: Date, + default: Date.now + }, + brief: String, + data: String, + }, } module.exports = exports = Out \ No newline at end of file diff --git a/app/models/v1/Project.model.js b/app/models/v1/Project.model.js index 2a1458b..0ba0658 100644 --- a/app/models/v1/Project.model.js +++ b/app/models/v1/Project.model.js @@ -5,13 +5,21 @@ */ const uuid = require('uuid/v4') const Project = { - name: String, - user_id: String, - archived: { type: Boolean, default: false }, - data: String, - shared_user_ids: [String], - edit_user_ids: [String], - uuid: { type: String, default: uuid } + schema: { + name: String, + user_id: String, + archived: { + type: Boolean, + default: false + }, + data: String, + shared_user_ids: [String], + edit_user_ids: [String], + uuid: { + type: String, + default: uuid + } + }, } module.exports = exports = Project \ No newline at end of file diff --git a/app/models/v1/Snippet.model.js b/app/models/v1/Snippet.model.js index 54ee8a5..b6df5b0 100644 --- a/app/models/v1/Snippet.model.js +++ b/app/models/v1/Snippet.model.js @@ -5,16 +5,24 @@ */ const uuid = require('uuid/v4') const Snippet = { - name: String, - user_id: String, - archived: { type: Boolean, default: false }, - data: String, - shared_user_ids: [String], - edit_user_ids: [String], - uuid: { type: String, default: uuid }, - public_share: String, - mode: String, - project_id: String, + schema: { + name: String, + user_id: String, + archived: { + type: Boolean, + default: false + }, + data: String, + shared_user_ids: [String], + edit_user_ids: [String], + uuid: { + type: String, + default: uuid + }, + public_share: String, + mode: String, + project_id: String, + }, } -module.exports = exports = Snippet +module.exports = exports = Snippet \ No newline at end of file diff --git a/flaps.json b/flaps.json index 645aa0c..8d60213 100644 --- a/flaps.json +++ b/flaps.json @@ -18,5 +18,10 @@ "id": 1560988609, "name": "move_database_unit_before_express_unit", "migratedOn": "2019-06-21T00:31:38.019Z" + }, + { + "id": 1565741502, + "name": "convert_to_new_model_schema_definitions", + "migratedOn": "2019-08-15T14:58:30.109Z" } ] diff --git a/package.json b/package.json index aa5b81c..48cd0f6 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,11 @@ "dependencies": { "flitter-auth": "^0.4.0", "flitter-cli": "^0.10.0", - "flitter-flap": "^0.3.0", + "flitter-flap": "^0.3.1", "flitter-forms": "^0.7.2", "flitter-upload": "^0.7.6", "js-beautify": "^1.10.2", - "libflitter": "^0.27.4", + "libflitter": "^0.28.0", "stringify-object": "^3.3.0" } } diff --git a/yarn.lock b/yarn.lock index 1bd149c..0454da7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -869,12 +869,13 @@ flitter-cli@^0.10.0: mkdirp "^0.5.1" nesh "^1.7.0" -flitter-flap@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/flitter-flap/-/flitter-flap-0.3.0.tgz#04db1cf5181dd874acab66b064dc783294ccf69d" - integrity sha512-v7mwgQR6cvz/LPV9ZHNVVIGFKU7wjwjw+OcTuwIKz8q1W7HWf9Vicy7ucXnRLOvMpOUb3GIWOaCqxBQfHBz/mg== +flitter-flap@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/flitter-flap/-/flitter-flap-0.3.1.tgz#12dca0f43a6bfefd89b9e461b1eb1f1e7db18cd9" + integrity sha512-I22gvdK3cKCnQZGVXwtbgtWTkCakhZGs46K5g+UcoKYurHhjo+9+rqsPGZbYzIcFIhwPJTyv3Ve5aZprDz22WQ== dependencies: del "^4.1.0" + js-beautify "^1.10.2" node-migration "^1.0.1" touch "^3.1.0" @@ -1273,10 +1274,10 @@ leven@^1.0.2: resolved "https://registry.yarnpkg.com/leven/-/leven-1.0.2.tgz#9144b6eebca5f1d0680169f1a6770dcea60b75c3" integrity sha1-kUS27ryl8dBoAWnxpncNzqYLdcM= -libflitter@^0.27.4: - version "0.27.4" - resolved "https://registry.yarnpkg.com/libflitter/-/libflitter-0.27.4.tgz#858a49c0be7424b47eab36295cd1c001a3b32b61" - integrity sha512-/62fjAJCu/7dh1xQMdpNhV4LofAGGKB615dXTnWGvUBXWSYwtlwZuEWzcooEO4SdyT+ooeyTpVxy8XauFGX8pA== +libflitter@^0.28.0: + version "0.28.0" + resolved "https://registry.yarnpkg.com/libflitter/-/libflitter-0.28.0.tgz#c132dfb74e3a3e6148e924ce5ab9fc6094a6625c" + integrity sha512-s7m0odIm96QcuycJ4GUyu4Ub6zooCtXnIRjXccAgkKMMkz1I84qT0+DO6tRiSBPlnxA9lXpDjrAzyY0Z5OpQmw== dependencies: busboy-body-parser "^0.3.2" connect-mongodb-session "^2.2.0"