From dd487553e7f19a2e245c06fd67956243c724b321 Mon Sep 17 00:00:00 2001 From: Rumiantsev Oleksii Date: Thu, 18 Apr 2019 11:30:12 +0300 Subject: [PATCH] Add linter config for schemas --- .eslintignore | 2 ++ .prettierignore | 6 ++-- .prettierrc | 10 +++++++ package.json | 4 +-- schemas/.eslintrc.yml | 23 +++++++++++++++ schemas/system/Action.category | 2 +- schemas/system/Application.category | 2 +- schemas/system/Catalog.category | 2 +- schemas/system/Category.category | 4 +-- schemas/system/Config.category | 4 +-- schemas/system/Cursor.category | 4 +-- schemas/system/File.category | 6 ++-- schemas/system/Identifier.category | 4 +-- schemas/system/Language.category | 4 +-- schemas/system/Localization.category | 4 +-- schemas/system/Locking.category | 25 +++++++++------- schemas/system/Log.category | 2 +- schemas/system/Permission.category | 5 ++-- schemas/system/Replication.category | 4 +-- schemas/system/Role.category | 2 +- schemas/system/Schema.category | 4 +-- schemas/system/Server.category | 4 +-- schemas/system/ServerNode.category | 4 +-- schemas/system/Session.category | 4 +-- schemas/system/Subsystem.category | 2 +- schemas/system/SystemUser.SignIn.form | 4 +-- schemas/system/SystemUser.SignUp.form | 6 ++-- schemas/system/SystemUser.category | 10 +++---- schemas/system/gs.domains | 29 ++++++++++++++----- schemas/system/system.domains | 20 +++++++++---- test/fixtures/.eslintrc.yml | 27 +++++++++++++++++ test/fixtures/application/App.application | 2 +- .../ddl-unit/CategoryWithMany.category | 6 ++-- .../ddl-unit/CategoryWithMaster.category | 6 ++-- .../ddl-unit/GlobalCategory1.category | 4 +-- .../ddl-unit/GlobalCategory2.category | 4 +-- .../ddl-unit/GlobalCategory3.category | 4 +-- .../ddl-unit/GlobalCategoryWithMany.category | 4 +-- test/fixtures/ddl-unit/History.category | 4 +-- test/fixtures/ddl-unit/Identifier.category | 8 +++-- .../fixtures/ddl-unit/LocalCategory1.category | 8 +++-- .../fixtures/ddl-unit/LocalCategory2.category | 8 +++-- .../fixtures/ddl-unit/LocalCategory3.category | 6 ++-- test/fixtures/ddl-unit/MemoryTable.category | 4 +-- test/fixtures/ddl-unit/Schema!.category | 8 +++-- test/fixtures/ddl-unit/Table.category | 8 +++-- test/fixtures/ddl-unit/ddl-unit-test.domains | 6 ++-- .../detail-with-hierarchy/Catalog.category | 4 +-- .../detail-with-hierarchy/Detail.category | 4 +-- .../detail-with-hierarchy/Included.category | 4 +-- .../detail-with-hierarchy/Master.category | 4 +-- .../detail-with-hierarchy/Subsystem.category | 4 +-- .../detail-with-hierarchy/custom.domains | 4 +-- .../custom.domains | 4 +-- .../not-supported-decorator/Config.category | 8 +++-- .../not-supported-decorator/Test.category | 2 +- .../not-supported-decorator/custom.domains | 4 +-- .../fixtures/pg-test-schemas/Address.category | 2 +- .../fixtures/pg-test-schemas/Company.category | 2 +- .../pg-test-schemas/LocalCategory.category | 2 +- test/fixtures/pg-test-schemas/Person.category | 2 +- .../pg-test-schemas/TestMemory.category | 2 +- test/fixtures/pg-test-schemas/Work.category | 2 +- test/fixtures/pg-test-schemas/Writer.category | 2 +- .../provider-execute/Category.Action.action | 2 +- .../provider-execute/Category.category | 2 +- .../provider-execute/PublicAction.action | 2 +- test/fixtures/provider-execute/gs.domains | 4 +-- .../fixtures/resources/Category.Action.action | 2 +- .../resources/Category.AnotherAction.action | 2 +- test/fixtures/resources/Category.Form.form | 2 +- test/fixtures/resources/Category.category | 4 +-- test/fixtures/resources/PublicAction.action | 2 +- test/fixtures/resources/gs.domains | 4 +-- .../unsupported-domain-class/Test.category | 4 +-- .../unsupported-domain-class/custom.domains | 8 ++--- test/fixtures/validate/Country.category | 4 +-- test/fixtures/validate/FullName.category | 4 +-- test/fixtures/validate/Person.category | 4 +-- test/fixtures/validate/Public.action | 2 +- test/fixtures/validate/custom.domains | 4 +-- 81 files changed, 270 insertions(+), 165 deletions(-) create mode 100644 .eslintignore create mode 100644 schemas/.eslintrc.yml create mode 100644 test/fixtures/.eslintrc.yml diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..1eae0cf6 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +dist/ +node_modules/ diff --git a/.prettierignore b/.prettierignore index 2b4969f9..c410ba43 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,4 @@ -data -dist +* +!/lib/ +!/schemas/ +!/test/ diff --git a/.prettierrc b/.prettierrc index 4fbd8444..1712d34b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,6 +5,16 @@ { "files": [".babelrc", ".prettierrc", ".metadocrc"], "options": { "parser": "json" } + }, + { + "files": [ + "*.action", + "*.category", + "*.domains", + "*.form", + "*.application" + ], + "options": { "parser": "babel" } } ] } diff --git a/package.json b/package.json index bd05c354..85a85124 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,8 @@ ], "scripts": { "test": "npm run lint && metatests test/", - "lint": "eslint . --ignore-path .gitignore && prettier -c \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"", - "fmt": "prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"", + "lint": "eslint . && prettier -c \"**/*\"", + "fmt": "eslint --fix . && prettier --write \"**/*\"", "doc": "metadoc", "build": "babel gs.js -d dist && babel lib -d dist/lib", "prepublish": "npm run -s build" diff --git a/schemas/.eslintrc.yml b/schemas/.eslintrc.yml new file mode 100644 index 00000000..4694a1ec --- /dev/null +++ b/schemas/.eslintrc.yml @@ -0,0 +1,23 @@ +globals: + api: false + gs: false + Action: false + Many: false + Master: false + Validate: false + Unique: false + Index: false + System: false + Global: false + Registry: false + Local: false + Dictionary: false + Log: false + Enum: false + Flags: false + Catalog: false + Subsystem: false + Form: false +rules: + strict: off + new-cap: off diff --git a/schemas/system/Action.category b/schemas/system/Action.category index 16ef40e1..d043ff2f 100644 --- a/schemas/system/Action.category +++ b/schemas/system/Action.category @@ -7,4 +7,4 @@ System({ CheckPublic: Validate(record => !record.Category !== !record.Public), NaturalKey: Unique('Category', 'Name'), -}) +}); diff --git a/schemas/system/Application.category b/schemas/system/Application.category index 1d5146b6..ac49cc0a 100644 --- a/schemas/system/Application.category +++ b/schemas/system/Application.category @@ -1,4 +1,4 @@ System({ Name: { domain: 'Nomen', lookup: true, required: true, unique: true }, Categories: Many('Category'), -}) +}); diff --git a/schemas/system/Catalog.category b/schemas/system/Catalog.category index b795ec47..7f2b84ec 100644 --- a/schemas/system/Catalog.category +++ b/schemas/system/Catalog.category @@ -2,4 +2,4 @@ System({ Caption: { domain: 'Nomen', lookup: true, required: true, index: true }, Category: { category: 'Category', required: true }, Parent: { category: 'Catalog' }, -}) +}); diff --git a/schemas/system/Category.category b/schemas/system/Category.category index 4b3e9318..bb7f8ef0 100644 --- a/schemas/system/Category.category +++ b/schemas/system/Category.category @@ -3,5 +3,5 @@ System({ Realm: { domain: 'CategoryRealm', required: true }, Family: { domain: 'CategoryFamily', required: true }, Version: { domain: 'Version', default: 0, required: true }, - Master: { category: 'Category' } -}) + Master: { category: 'Category' }, +}); diff --git a/schemas/system/Config.category b/schemas/system/Config.category index fbcf5d36..bf1b80c2 100644 --- a/schemas/system/Config.category +++ b/schemas/system/Config.category @@ -1,4 +1,4 @@ System({ Name: { domain: 'Nomen', lookup: true, required: true, unique: true }, - Config: { domain: 'JSON', required: true } -}) + Config: { domain: 'JSON', required: true }, +}); diff --git a/schemas/system/Cursor.category b/schemas/system/Cursor.category index be09db11..f7ca300c 100644 --- a/schemas/system/Cursor.category +++ b/schemas/system/Cursor.category @@ -3,5 +3,5 @@ Local({ Created: { domain: 'DateTime', required: true }, Query: { domain: 'JSON', required: true }, Version: { domain: 'Version', default: 0, required: true }, - Subscribers: Many('Session') -}) + Subscribers: Many('Session'), +}); diff --git a/schemas/system/File.category b/schemas/system/File.category index 913bd596..e3cc6edf 100644 --- a/schemas/system/File.category +++ b/schemas/system/File.category @@ -10,6 +10,6 @@ Registry({ CompressedSize: { domain: 'DataSize', required: true }, CompressRatio: { domain: 'Ratio', - expression: record => record.CompressedSize / record.OriginalSize - } -}) + expression: record => record.CompressedSize / record.OriginalSize, + }, +}); diff --git a/schemas/system/Identifier.category b/schemas/system/Identifier.category index cba66903..70626ed3 100644 --- a/schemas/system/Identifier.category +++ b/schemas/system/Identifier.category @@ -14,5 +14,5 @@ Registry({ } else { return !record.Category; } - }) -}) + }), +}); diff --git a/schemas/system/Language.category b/schemas/system/Language.category index 6c236e86..e5aa3839 100644 --- a/schemas/system/Language.category +++ b/schemas/system/Language.category @@ -1,4 +1,4 @@ Dictionary({ Name: { domain: 'Nomen', lookup: true, required: true, unique: true }, - Locale: { domain: 'Nomen', required: true, unique: true } -}) + Locale: { domain: 'Nomen', required: true, unique: true }, +}); diff --git a/schemas/system/Localization.category b/schemas/system/Localization.category index 92cbd6b3..83a96c66 100644 --- a/schemas/system/Localization.category +++ b/schemas/system/Localization.category @@ -3,5 +3,5 @@ System({ Language: { category: 'Language', required: true, index: true }, Text: { domain: 'Text' }, - NaturalKey: Unique('ResourceKey', 'Language') -}) + NaturalKey: Unique('ResourceKey', 'Language'), +}); diff --git a/schemas/system/Locking.category b/schemas/system/Locking.category index 25d1b9c0..a9681d13 100644 --- a/schemas/system/Locking.category +++ b/schemas/system/Locking.category @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-undef, handle-callback-err */ Local({ Identifier: { category: 'Identifier', required: true, index: true }, Session: { category: 'Session', required: true, index: true }, @@ -9,14 +10,17 @@ Local({ Lock: Action(({ Identifier }, callback) => { const now = new Date(); - gs.create({ - Identifier, - Session: client.sessionId, - SystemUser: client.systemUserId, - Request: now - }, (err, data) => { - // to be implemented - }); + gs.create( + { + Identifier, + Session: client.sessionId, + SystemUser: client.systemUserId, + Request: now, + }, + (err, data) => { + // to be implemented + } + ); }), Unlock: Action(({ Identifier }, callback) => { @@ -25,7 +29,7 @@ Local({ Session: client.sessionId, SystemUser: client.systemUserId, Start: gs.notNull, - Expire: gs.Null + Expire: gs.Null, }).fetch((err, data) => { // to be implemented }); @@ -34,5 +38,4 @@ Local({ CheckLock: Action(({ Identifier }, callback) => { // to be implemented }), - -}) +}); diff --git a/schemas/system/Log.category b/schemas/system/Log.category index ef3cc1e6..a0436d4f 100644 --- a/schemas/system/Log.category +++ b/schemas/system/Log.category @@ -14,4 +14,4 @@ Log({ Query: { domain: 'JSON' }, Patch: { domain: 'JSON' }, Response: { domain: 'JSON' }, -}) +}); diff --git a/schemas/system/Permission.category b/schemas/system/Permission.category index 85f65eef..2ea7d4eb 100644 --- a/schemas/system/Permission.category +++ b/schemas/system/Permission.category @@ -8,5 +8,6 @@ System({ NaturalKey: Index('Role', 'Category'), - CheckBound: Validate(record => true) -}) + /* eslint-disable no-unused-vars */ + CheckBound: Validate(record => true), +}); diff --git a/schemas/system/Replication.category b/schemas/system/Replication.category index 2448b4c1..bcbe3750 100644 --- a/schemas/system/Replication.category +++ b/schemas/system/Replication.category @@ -3,5 +3,5 @@ System({ Destination: { category: 'Subsystem', required: true }, Category: { category: 'Category', required: true }, - NaturalKey: Unique('Source', 'Destination', 'Category') -}) + NaturalKey: Unique('Source', 'Destination', 'Category'), +}); diff --git a/schemas/system/Role.category b/schemas/system/Role.category index a01fc0d6..22086c0d 100644 --- a/schemas/system/Role.category +++ b/schemas/system/Role.category @@ -3,4 +3,4 @@ System({ Blocked: { domain: 'Logical', required: true, default: false }, Subsystem: Subsystem(), Applications: Many('Application'), -}) +}); diff --git a/schemas/system/Schema.category b/schemas/system/Schema.category index be51814d..dc874f0a 100644 --- a/schemas/system/Schema.category +++ b/schemas/system/Schema.category @@ -3,5 +3,5 @@ System({ Version: { domain: 'Version', required: true, index: true }, Schema: { domain: 'Source', required: true }, - NaturalKey: Unique('Category', 'Version') -}) + NaturalKey: Unique('Category', 'Version'), +}); diff --git a/schemas/system/Server.category b/schemas/system/Server.category index fa8bc1c8..98c876c5 100644 --- a/schemas/system/Server.category +++ b/schemas/system/Server.category @@ -2,5 +2,5 @@ System({ Name: { domain: 'Nomen', display: true, required: true, unique: true }, Suffix: { domain: 'Id', required: true, unique: true }, IP: { domain: 'IP', required: true, unique: true }, - ServerType: { domain: 'ServerType', required: true, default: 'Server' } -}) + ServerType: { domain: 'ServerType', required: true, default: 'Server' }, +}); diff --git a/schemas/system/ServerNode.category b/schemas/system/ServerNode.category index 347478f6..7f86cc60 100644 --- a/schemas/system/ServerNode.category +++ b/schemas/system/ServerNode.category @@ -8,5 +8,5 @@ Local({ UniqueSequence: Unique('Server', 'Instance'), UniqueProcess: Unique('Server', 'Process'), - UniquePort: Unique('Server', 'Port') -}) + UniquePort: Unique('Server', 'Port'), +}); diff --git a/schemas/system/Session.category b/schemas/system/Session.category index a9908f83..17c1adc4 100644 --- a/schemas/system/Session.category +++ b/schemas/system/Session.category @@ -3,5 +3,5 @@ System({ SystemUser: { category: 'SystemUser', required: true, index: true }, Start: { domain: 'DateTime', required: true }, LastActivity: { domain: 'DateTime', required: true }, - LastIP: { domain: 'IP', required: true } -}) + LastIP: { domain: 'IP', required: true }, +}); diff --git a/schemas/system/Subsystem.category b/schemas/system/Subsystem.category index 3f6afbec..8bc5f655 100644 --- a/schemas/system/Subsystem.category +++ b/schemas/system/Subsystem.category @@ -3,4 +3,4 @@ System({ Code: { domain: 'Id', required: true, unique: true }, SystemType: { domain: 'SystemType', required: true, default: 'Autonomous' }, Parent: { category: 'Subsystem' }, -}) +}); diff --git a/schemas/system/SystemUser.SignIn.form b/schemas/system/SystemUser.SignIn.form index 45291aca..a8767ad9 100644 --- a/schemas/system/SystemUser.SignIn.form +++ b/schemas/system/SystemUser.SignIn.form @@ -1,4 +1,4 @@ Form({ Login: { domain: 'Login', required: true }, - Password: { domain: 'Password', required: true } -}) + Password: { domain: 'Password', required: true }, +}); diff --git a/schemas/system/SystemUser.SignUp.form b/schemas/system/SystemUser.SignUp.form index 37466429..289e0fdd 100644 --- a/schemas/system/SystemUser.SignUp.form +++ b/schemas/system/SystemUser.SignUp.form @@ -7,9 +7,9 @@ Form({ Check: Validate(record => { return ( - login.length > 5 && + record.Login.length > 5 && record.Password.length > 7 && record.Password === record.PasswordConfirm ); - }) -}) + }), +}); diff --git a/schemas/system/SystemUser.category b/schemas/system/SystemUser.category index d94b6636..8410df1a 100644 --- a/schemas/system/SystemUser.category +++ b/schemas/system/SystemUser.category @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-undef */ System({ Login: { domain: 'Login', @@ -9,7 +10,7 @@ System({ validate: login => { // TODO: implement OWASP recomendations return login.length > 5; - } + }, }, Password: { domain: 'PasswordHash', @@ -19,7 +20,7 @@ System({ // TODO: implement OWASP recomendations // See https://www.owasp.org/index.php/Authentication_Cheat_Sheet return Auth.passwordStrength(password); - } + }, }, Subsystem: Subsystem(), Roles: Many('Role'), @@ -43,6 +44,5 @@ System({ SignUp: Action((data, callback) => { // TODO: implement user registration - }) - -}) + }), +}); diff --git a/schemas/system/gs.domains b/schemas/system/gs.domains index 34874d92..f5a3fe5e 100644 --- a/schemas/system/gs.domains +++ b/schemas/system/gs.domains @@ -1,4 +1,4 @@ -{ +({ Id: { type: 'object', class: 'Uint64', @@ -9,7 +9,7 @@ ); } return new api.common.Uint64(x); - } + }, }, Lambda: { type: 'function' }, Logical: { type: 'boolean', control: 'CheckBox' }, @@ -67,12 +67,27 @@ CountryNumeric: { type: 'string', length: 3, comment: 'ISO 3166-1 numeric' }, Year: { type: 'number', length: 4 }, Month: Enum( - 'January', 'February', 'March', 'April', 'May', 'June', - 'July', 'August', 'September', 'October', 'November', 'December' + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' ), Day: Enum( - 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', - 'Saturday', 'Sunday' + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + 'Sunday' ), Seconds: { type: 'number', unit: 'Second' }, Minutes: { type: 'number', unit: 'Minute', base: 'Second', mul: 60 }, @@ -115,4 +130,4 @@ Volume: { type: 'number', unit: 'Litre', symbol: 'l' }, Speed: { type: 'number', unit: 'Metres per second', symbol: 'm/s' }, Ratio: { type: 'number' }, -} +}); diff --git a/schemas/system/system.domains b/schemas/system/system.domains index b77f3215..8921667a 100644 --- a/schemas/system/system.domains +++ b/schemas/system/system.domains @@ -1,11 +1,21 @@ -{ +({ IdStatus: Enum('Prealloc', 'Init', 'Actual', 'Historical'), HistoryStatus: Enum('Future', 'Actual', 'Historical'), StorageKind: Enum('Master', 'Cache', 'Backup', 'Replica'), CategoryRealm: Enum('Global', 'System', 'Local'), CategoryFamily: Enum( - 'Registry', 'Dictionary', 'System', 'Log', 'Local', 'Table', 'History', - 'View', 'Projection', 'Memory', 'Form', 'Arguments' + 'Registry', + 'Dictionary', + 'System', + 'Log', + 'Local', + 'Table', + 'History', + 'View', + 'Projection', + 'Memory', + 'Form', + 'Arguments' ), UserAccess: Enum('Read', 'Insert', 'Update', 'Delete', 'Audit'), AccessFlags: Flags.of('UserAccess'), @@ -28,5 +38,5 @@ SystemType: Enum('Global', 'Autonomous', 'Standalone'), ServerType: Enum('Root', 'Server', 'Backup', 'Reserve'), NodeType: Enum('Master', 'Worker', 'Task'), - NodeStatus: Enum('Init', 'Active', 'Pause', 'Restart', 'Hang') -} + NodeStatus: Enum('Init', 'Active', 'Pause', 'Restart', 'Hang'), +}); diff --git a/test/fixtures/.eslintrc.yml b/test/fixtures/.eslintrc.yml new file mode 100644 index 00000000..a71d85d6 --- /dev/null +++ b/test/fixtures/.eslintrc.yml @@ -0,0 +1,27 @@ +globals: + api: false + Action: false + Many: false + Master: false + Validate: false + Unique: false + Index: false + System: false + Global: false + Registry: false + Local: false + Dictionary: false + Log: false + Enum: false + Flags: false + Catalog: false + Subsystem: false + Form: false + Include: false + History: false + Memory: false + Application: false + Group: false +rules: + strict: off + new-cap: off diff --git a/test/fixtures/application/App.application b/test/fixtures/application/App.application index 1793fcb7..101f0209 100644 --- a/test/fixtures/application/App.application +++ b/test/fixtures/application/App.application @@ -1,4 +1,4 @@ Application({ Categories: [], Menu: [Group('GroupName', ['Category', '-'])], -}) +}); diff --git a/test/fixtures/ddl-unit/CategoryWithMany.category b/test/fixtures/ddl-unit/CategoryWithMany.category index b4ec95ac..216df00a 100644 --- a/test/fixtures/ddl-unit/CategoryWithMany.category +++ b/test/fixtures/ddl-unit/CategoryWithMany.category @@ -1,3 +1,3 @@ -{ - field: Many('LocalCategory1') -} +({ + field: Many('LocalCategory1'), +}); diff --git a/test/fixtures/ddl-unit/CategoryWithMaster.category b/test/fixtures/ddl-unit/CategoryWithMaster.category index d673f12b..c3b6b89c 100644 --- a/test/fixtures/ddl-unit/CategoryWithMaster.category +++ b/test/fixtures/ddl-unit/CategoryWithMaster.category @@ -1,3 +1,3 @@ -{ - field: Master('GlobalCategory1') -} +({ + field: Master('GlobalCategory1'), +}); diff --git a/test/fixtures/ddl-unit/GlobalCategory1.category b/test/fixtures/ddl-unit/GlobalCategory1.category index b399f9c1..70a6caef 100644 --- a/test/fixtures/ddl-unit/GlobalCategory1.category +++ b/test/fixtures/ddl-unit/GlobalCategory1.category @@ -1,3 +1,3 @@ Registry({ - field: { domain: 'Nomen' } -}) + field: { domain: 'Nomen' }, +}); diff --git a/test/fixtures/ddl-unit/GlobalCategory2.category b/test/fixtures/ddl-unit/GlobalCategory2.category index 33f01628..76c0aff4 100644 --- a/test/fixtures/ddl-unit/GlobalCategory2.category +++ b/test/fixtures/ddl-unit/GlobalCategory2.category @@ -1,3 +1,3 @@ Registry({ - field: { category: 'GlobalCategory1' } -}) + field: { category: 'GlobalCategory1' }, +}); diff --git a/test/fixtures/ddl-unit/GlobalCategory3.category b/test/fixtures/ddl-unit/GlobalCategory3.category index 633a0df7..643b823e 100644 --- a/test/fixtures/ddl-unit/GlobalCategory3.category +++ b/test/fixtures/ddl-unit/GlobalCategory3.category @@ -1,3 +1,3 @@ Registry({ - field: Many('GlobalCategory1') -}) + field: Many('GlobalCategory1'), +}); diff --git a/test/fixtures/ddl-unit/GlobalCategoryWithMany.category b/test/fixtures/ddl-unit/GlobalCategoryWithMany.category index 633a0df7..643b823e 100644 --- a/test/fixtures/ddl-unit/GlobalCategoryWithMany.category +++ b/test/fixtures/ddl-unit/GlobalCategoryWithMany.category @@ -1,3 +1,3 @@ Registry({ - field: Many('GlobalCategory1') -}) + field: Many('GlobalCategory1'), +}); diff --git a/test/fixtures/ddl-unit/History.category b/test/fixtures/ddl-unit/History.category index 2b0c84b4..9fcbd70b 100644 --- a/test/fixtures/ddl-unit/History.category +++ b/test/fixtures/ddl-unit/History.category @@ -1,3 +1,3 @@ History({ - field: { domain: 'Nomen' } -}) + field: { domain: 'Nomen' }, +}); diff --git a/test/fixtures/ddl-unit/Identifier.category b/test/fixtures/ddl-unit/Identifier.category index aed52f8b..233bc033 100644 --- a/test/fixtures/ddl-unit/Identifier.category +++ b/test/fixtures/ddl-unit/Identifier.category @@ -1,3 +1,5 @@ -{ - field: { domain: 'Nomen' } -} +({ + field: { + domain: 'Nomen', + }, +}); diff --git a/test/fixtures/ddl-unit/LocalCategory1.category b/test/fixtures/ddl-unit/LocalCategory1.category index aed52f8b..233bc033 100644 --- a/test/fixtures/ddl-unit/LocalCategory1.category +++ b/test/fixtures/ddl-unit/LocalCategory1.category @@ -1,3 +1,5 @@ -{ - field: { domain: 'Nomen' } -} +({ + field: { + domain: 'Nomen', + }, +}); diff --git a/test/fixtures/ddl-unit/LocalCategory2.category b/test/fixtures/ddl-unit/LocalCategory2.category index 954a15eb..7dcfc467 100644 --- a/test/fixtures/ddl-unit/LocalCategory2.category +++ b/test/fixtures/ddl-unit/LocalCategory2.category @@ -1,3 +1,5 @@ -{ - field: { category: 'LocalCategory1' } -} +({ + field: { + category: 'LocalCategory1', + }, +}); diff --git a/test/fixtures/ddl-unit/LocalCategory3.category b/test/fixtures/ddl-unit/LocalCategory3.category index d7197de1..7f8412e7 100644 --- a/test/fixtures/ddl-unit/LocalCategory3.category +++ b/test/fixtures/ddl-unit/LocalCategory3.category @@ -1,3 +1,3 @@ -{ - field: Many('Schema!') -} +({ + field: Many('Schema!'), +}); diff --git a/test/fixtures/ddl-unit/MemoryTable.category b/test/fixtures/ddl-unit/MemoryTable.category index 2a7015a2..0a95d4ac 100644 --- a/test/fixtures/ddl-unit/MemoryTable.category +++ b/test/fixtures/ddl-unit/MemoryTable.category @@ -1,3 +1,3 @@ Memory({ - field: { domain: 'Nomen' } -}) + field: { domain: 'Nomen' }, +}); diff --git a/test/fixtures/ddl-unit/Schema!.category b/test/fixtures/ddl-unit/Schema!.category index aed52f8b..233bc033 100644 --- a/test/fixtures/ddl-unit/Schema!.category +++ b/test/fixtures/ddl-unit/Schema!.category @@ -1,3 +1,5 @@ -{ - field: { domain: 'Nomen' } -} +({ + field: { + domain: 'Nomen', + }, +}); diff --git a/test/fixtures/ddl-unit/Table.category b/test/fixtures/ddl-unit/Table.category index aed52f8b..233bc033 100644 --- a/test/fixtures/ddl-unit/Table.category +++ b/test/fixtures/ddl-unit/Table.category @@ -1,3 +1,5 @@ -{ - field: { domain: 'Nomen' } -} +({ + field: { + domain: 'Nomen', + }, +}); diff --git a/test/fixtures/ddl-unit/ddl-unit-test.domains b/test/fixtures/ddl-unit/ddl-unit-test.domains index 074a61b7..c66c488b 100644 --- a/test/fixtures/ddl-unit/ddl-unit-test.domains +++ b/test/fixtures/ddl-unit/ddl-unit-test.domains @@ -1,4 +1,4 @@ -{ +({ Nomen: { type: 'string', length: 60 }, Integer: { type: 'number', subtype: 'int' }, CustomDate: { type: 'object', class: 'Date' }, @@ -8,5 +8,5 @@ FlagsBigInt: Flags(...Array.from({ length: 45 }, (v, i) => `value${i + 1}`)), Flags16: Flags(...Array.from({ length: 16 }, (v, i) => `value${i + 1}`)), Flags32: Flags(...Array.from({ length: 32 }, (v, i) => `value${i + 1}`)), - Flags64: Flags(...Array.from({ length: 64 }, (v, i) => `value${i + 1}`)) -} + Flags64: Flags(...Array.from({ length: 64 }, (v, i) => `value${i + 1}`)), +}); diff --git a/test/fixtures/detail-with-hierarchy/Catalog.category b/test/fixtures/detail-with-hierarchy/Catalog.category index ca039e64..254cb51d 100644 --- a/test/fixtures/detail-with-hierarchy/Catalog.category +++ b/test/fixtures/detail-with-hierarchy/Catalog.category @@ -1,3 +1,3 @@ -{ +({ Name: { domain: 'Nomen' }, -} +}); diff --git a/test/fixtures/detail-with-hierarchy/Detail.category b/test/fixtures/detail-with-hierarchy/Detail.category index d7d13d59..9593bfb9 100644 --- a/test/fixtures/detail-with-hierarchy/Detail.category +++ b/test/fixtures/detail-with-hierarchy/Detail.category @@ -1,5 +1,5 @@ -{ +({ Master: Master('Master'), Name: { domains: 'Nomen' }, Subsystem: Subsystem(), -} +}); diff --git a/test/fixtures/detail-with-hierarchy/Included.category b/test/fixtures/detail-with-hierarchy/Included.category index 196ddaeb..3278a045 100644 --- a/test/fixtures/detail-with-hierarchy/Included.category +++ b/test/fixtures/detail-with-hierarchy/Included.category @@ -1,4 +1,4 @@ -{ +({ Name: { domains: 'Nomen' }, Catalog: Catalog(), -} +}); diff --git a/test/fixtures/detail-with-hierarchy/Master.category b/test/fixtures/detail-with-hierarchy/Master.category index 84a4244d..d7e7a3b1 100644 --- a/test/fixtures/detail-with-hierarchy/Master.category +++ b/test/fixtures/detail-with-hierarchy/Master.category @@ -1,3 +1,3 @@ -{ +({ Included: Include('Included'), -} +}); diff --git a/test/fixtures/detail-with-hierarchy/Subsystem.category b/test/fixtures/detail-with-hierarchy/Subsystem.category index ca039e64..254cb51d 100644 --- a/test/fixtures/detail-with-hierarchy/Subsystem.category +++ b/test/fixtures/detail-with-hierarchy/Subsystem.category @@ -1,3 +1,3 @@ -{ +({ Name: { domain: 'Nomen' }, -} +}); diff --git a/test/fixtures/detail-with-hierarchy/custom.domains b/test/fixtures/detail-with-hierarchy/custom.domains index f395159b..a16a5cf8 100644 --- a/test/fixtures/detail-with-hierarchy/custom.domains +++ b/test/fixtures/detail-with-hierarchy/custom.domains @@ -1,3 +1,3 @@ -{ +({ Nomen: { type: 'string' }, -} +}); diff --git a/test/fixtures/incorrect-domain-definition/custom.domains b/test/fixtures/incorrect-domain-definition/custom.domains index 5c7e27a2..a0969979 100644 --- a/test/fixtures/incorrect-domain-definition/custom.domains +++ b/test/fixtures/incorrect-domain-definition/custom.domains @@ -1,3 +1,3 @@ -{ +({ IncorrectDomainDefinition: [], -} +}); diff --git a/test/fixtures/not-supported-decorator/Config.category b/test/fixtures/not-supported-decorator/Config.category index 0abc99a5..1207dcbe 100644 --- a/test/fixtures/not-supported-decorator/Config.category +++ b/test/fixtures/not-supported-decorator/Config.category @@ -1,3 +1,5 @@ -{ - Config: { domain: 'Days' } -} +({ + Config: { + domain: 'Days', + }, +}); diff --git a/test/fixtures/not-supported-decorator/Test.category b/test/fixtures/not-supported-decorator/Test.category index 0967ef42..b3bf1ddb 100644 --- a/test/fixtures/not-supported-decorator/Test.category +++ b/test/fixtures/not-supported-decorator/Test.category @@ -1 +1 @@ -{} +({}); diff --git a/test/fixtures/not-supported-decorator/custom.domains b/test/fixtures/not-supported-decorator/custom.domains index 6db2fc8a..1ca9c3a2 100644 --- a/test/fixtures/not-supported-decorator/custom.domains +++ b/test/fixtures/not-supported-decorator/custom.domains @@ -1,3 +1,3 @@ -{ +({ Days: { type: 'number', unit: 'Days', base: 'Second', mul: 86400 }, -} +}); diff --git a/test/fixtures/pg-test-schemas/Address.category b/test/fixtures/pg-test-schemas/Address.category index 0d96add7..5b5d856e 100644 --- a/test/fixtures/pg-test-schemas/Address.category +++ b/test/fixtures/pg-test-schemas/Address.category @@ -1,4 +1,4 @@ Registry({ Country: { domain: 'Nomen', required: true }, City: { domain: 'Nomen', required: true }, -}) +}); diff --git a/test/fixtures/pg-test-schemas/Company.category b/test/fixtures/pg-test-schemas/Company.category index 15d2b07c..c93e0ab9 100644 --- a/test/fixtures/pg-test-schemas/Company.category +++ b/test/fixtures/pg-test-schemas/Company.category @@ -1,4 +1,4 @@ Registry({ Name: { domain: 'Nomen', required: true }, Address: Include('Address'), -}) +}); diff --git a/test/fixtures/pg-test-schemas/LocalCategory.category b/test/fixtures/pg-test-schemas/LocalCategory.category index 508dd871..b5d9cc84 100644 --- a/test/fixtures/pg-test-schemas/LocalCategory.category +++ b/test/fixtures/pg-test-schemas/LocalCategory.category @@ -1,4 +1,4 @@ Local({ SomeData: { domain: 'Nomen' }, RequiredData: { domain: 'Nomen', required: true }, -}) +}); diff --git a/test/fixtures/pg-test-schemas/Person.category b/test/fixtures/pg-test-schemas/Person.category index 6e4258b2..beabb878 100644 --- a/test/fixtures/pg-test-schemas/Person.category +++ b/test/fixtures/pg-test-schemas/Person.category @@ -1,4 +1,4 @@ Registry({ DOB: { domain: 'DateDay' }, Name: { domain: 'Nomen', required: true }, -}) +}); diff --git a/test/fixtures/pg-test-schemas/TestMemory.category b/test/fixtures/pg-test-schemas/TestMemory.category index 118c6d1e..75463c5d 100644 --- a/test/fixtures/pg-test-schemas/TestMemory.category +++ b/test/fixtures/pg-test-schemas/TestMemory.category @@ -1,4 +1,4 @@ Memory({ Service: { domain: 'Service', required: true }, IP: { domain: 'IP' }, -}) +}); diff --git a/test/fixtures/pg-test-schemas/Work.category b/test/fixtures/pg-test-schemas/Work.category index b80ba289..821075a3 100644 --- a/test/fixtures/pg-test-schemas/Work.category +++ b/test/fixtures/pg-test-schemas/Work.category @@ -1,4 +1,4 @@ Registry({ Name: { domain: 'Nomen', required: true }, PublicationYear: { domain: 'Year', required: true }, -}) +}); diff --git a/test/fixtures/pg-test-schemas/Writer.category b/test/fixtures/pg-test-schemas/Writer.category index 867b179a..bdb36e9e 100644 --- a/test/fixtures/pg-test-schemas/Writer.category +++ b/test/fixtures/pg-test-schemas/Writer.category @@ -1,4 +1,4 @@ Registry({ FullName: { domain: 'Nomen', required: true }, Works: Many('Work'), -}) +}); diff --git a/test/fixtures/provider-execute/Category.Action.action b/test/fixtures/provider-execute/Category.Action.action index 3d012d6a..c4fa3bd3 100644 --- a/test/fixtures/provider-execute/Category.Action.action +++ b/test/fixtures/provider-execute/Category.Action.action @@ -4,4 +4,4 @@ Action({ b: { domain: 'Number', required: true }, }, Execute: async (provider, ctx, { a, b }) => a + b, -}) +}); diff --git a/test/fixtures/provider-execute/Category.category b/test/fixtures/provider-execute/Category.category index 0967ef42..b3bf1ddb 100644 --- a/test/fixtures/provider-execute/Category.category +++ b/test/fixtures/provider-execute/Category.category @@ -1 +1 @@ -{} +({}); diff --git a/test/fixtures/provider-execute/PublicAction.action b/test/fixtures/provider-execute/PublicAction.action index 4a837d16..be937ec7 100644 --- a/test/fixtures/provider-execute/PublicAction.action +++ b/test/fixtures/provider-execute/PublicAction.action @@ -5,4 +5,4 @@ Action({ b: { domain: 'Number', required: true }, }, Execute: async (provider, ctx, { a, b }) => a - b, -}) +}); diff --git a/test/fixtures/provider-execute/gs.domains b/test/fixtures/provider-execute/gs.domains index 905b9d5d..aff67730 100644 --- a/test/fixtures/provider-execute/gs.domains +++ b/test/fixtures/provider-execute/gs.domains @@ -1,3 +1,3 @@ -{ +({ Number: { type: 'number' }, -} +}); diff --git a/test/fixtures/resources/Category.Action.action b/test/fixtures/resources/Category.Action.action index 4876da48..87936a45 100644 --- a/test/fixtures/resources/Category.Action.action +++ b/test/fixtures/resources/Category.Action.action @@ -3,4 +3,4 @@ Action({ Login: { domain: 'Login' }, }, Execute: async () => {}, -}) +}); diff --git a/test/fixtures/resources/Category.AnotherAction.action b/test/fixtures/resources/Category.AnotherAction.action index 7a8bb793..fc9428ca 100644 --- a/test/fixtures/resources/Category.AnotherAction.action +++ b/test/fixtures/resources/Category.AnotherAction.action @@ -1,4 +1,4 @@ Action({ Params: {}, Execute: async () => {}, -}) +}); diff --git a/test/fixtures/resources/Category.Form.form b/test/fixtures/resources/Category.Form.form index 4d3450f7..5d89d964 100644 --- a/test/fixtures/resources/Category.Form.form +++ b/test/fixtures/resources/Category.Form.form @@ -1 +1 @@ -Form({}) +Form({}); diff --git a/test/fixtures/resources/Category.category b/test/fixtures/resources/Category.category index 484fd07a..db98f216 100644 --- a/test/fixtures/resources/Category.category +++ b/test/fixtures/resources/Category.category @@ -1,4 +1,4 @@ -{ +({ Login: { domain: 'Login' }, Password: { domain: 'PasswordHash' }, -} +}); diff --git a/test/fixtures/resources/PublicAction.action b/test/fixtures/resources/PublicAction.action index 5be7e1de..b6763679 100644 --- a/test/fixtures/resources/PublicAction.action +++ b/test/fixtures/resources/PublicAction.action @@ -4,4 +4,4 @@ Action({ Login: { domain: 'Login' }, }, Execute: async () => {}, -}) +}); diff --git a/test/fixtures/resources/gs.domains b/test/fixtures/resources/gs.domains index c124189e..d216de65 100644 --- a/test/fixtures/resources/gs.domains +++ b/test/fixtures/resources/gs.domains @@ -1,4 +1,4 @@ -{ +({ Login: { type: 'string', length: 32 }, PasswordHash: { type: 'string', length: 128 }, -} +}); diff --git a/test/fixtures/unsupported-domain-class/Test.category b/test/fixtures/unsupported-domain-class/Test.category index 61873f8e..24e6a604 100644 --- a/test/fixtures/unsupported-domain-class/Test.category +++ b/test/fixtures/unsupported-domain-class/Test.category @@ -1,3 +1,3 @@ System({ - Prop: { domain: 'Test' } -}) + Prop: { domain: 'Test' }, +}); diff --git a/test/fixtures/unsupported-domain-class/custom.domains b/test/fixtures/unsupported-domain-class/custom.domains index f91bfc09..6614ad89 100644 --- a/test/fixtures/unsupported-domain-class/custom.domains +++ b/test/fixtures/unsupported-domain-class/custom.domains @@ -1,6 +1,6 @@ -{ +({ Test: { type: 'object', - class: '__UNSUPPORTED_CLASS__' - } -} + class: '__UNSUPPORTED_CLASS__', + }, +}); diff --git a/test/fixtures/validate/Country.category b/test/fixtures/validate/Country.category index ed9db396..c2ee21d1 100644 --- a/test/fixtures/validate/Country.category +++ b/test/fixtures/validate/Country.category @@ -1,5 +1,5 @@ -{ +({ Name: { domain: 'Nomen' }, CreationDate: { domain: 'Date' }, AdditionalInfo: { domain: 'JSON' }, -} +}); diff --git a/test/fixtures/validate/FullName.category b/test/fixtures/validate/FullName.category index 93421c02..2265a9c8 100644 --- a/test/fixtures/validate/FullName.category +++ b/test/fixtures/validate/FullName.category @@ -1,4 +1,4 @@ -{ +({ FirstName: { domain: 'Nomen' }, LastName: { domain: 'Nomen' }, -} +}); diff --git a/test/fixtures/validate/Person.category b/test/fixtures/validate/Person.category index 12af6968..89badb41 100644 --- a/test/fixtures/validate/Person.category +++ b/test/fixtures/validate/Person.category @@ -1,5 +1,5 @@ -{ +({ FullName: Include('FullName'), Citizenship: { category: 'Country' }, Parents: Many('Person'), -} +}); diff --git a/test/fixtures/validate/Public.action b/test/fixtures/validate/Public.action index 69588cb9..97b782d3 100644 --- a/test/fixtures/validate/Public.action +++ b/test/fixtures/validate/Public.action @@ -4,4 +4,4 @@ Action({ }, Public: true, Execute: async () => {}, -}) +}); diff --git a/test/fixtures/validate/custom.domains b/test/fixtures/validate/custom.domains index 7eb4dfa4..b4c9dbb5 100644 --- a/test/fixtures/validate/custom.domains +++ b/test/fixtures/validate/custom.domains @@ -1,4 +1,4 @@ -{ +({ Nomen: { type: 'string' }, Date: { type: 'object', @@ -18,4 +18,4 @@ return true; }, }, -} +});