velocious 1.0.100 → 1.0.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/spec/dummy/src/model-bases/authentication-token.js +3 -4
- package/spec/dummy/src/model-bases/project-detail.js +3 -4
- package/spec/dummy/src/model-bases/project-translation.js +3 -4
- package/spec/dummy/src/model-bases/project.js +10 -16
- package/spec/dummy/src/model-bases/task.js +3 -4
- package/spec/dummy/src/model-bases/user.js +7 -12
- package/src/cli/base-command.js +1 -1
- package/src/configuration-types.js +7 -1
- package/src/configuration.js +2 -2
- package/src/database/drivers/base-column.js +8 -7
- package/src/database/drivers/base-columns-index.js +1 -1
- package/src/database/drivers/base-foreign-key.js +5 -5
- package/src/database/drivers/base-table.js +4 -4
- package/src/database/drivers/base.js +45 -23
- package/src/database/pool/base.js +5 -5
- package/src/database/query/base.js +1 -1
- package/src/database/query/from-base.js +2 -4
- package/src/database/query/index.js +31 -18
- package/src/database/query/order-base.js +1 -1
- package/src/database/query/select-base.js +1 -1
- package/src/database/query/where-base.js +1 -1
- package/src/database/record/index.js +444 -172
- package/src/database/record/instance-relationships/base.js +41 -44
- package/src/database/record/instance-relationships/belongs-to.js +15 -3
- package/src/database/record/instance-relationships/has-many.js +49 -28
- package/src/database/record/instance-relationships/has-one.js +22 -7
- package/src/database/record/relationships/base.js +35 -45
- package/src/database/record/relationships/belongs-to.js +13 -3
- package/src/database/record/relationships/has-many.js +8 -2
- package/src/database/record/relationships/has-one.js +8 -2
- package/src/database/record/validators/base.js +15 -3
- package/src/database/record/validators/presence.js +7 -0
- package/src/environment-handlers/base.js +7 -7
- package/src/environment-handlers/node/cli/commands/generate/base-models.js +5 -8
- package/src/environment-handlers/node.js +1 -2
- package/src/initializer.js +1 -1
- package/src/routes/base-route.js +1 -1
|
@@ -72,13 +72,13 @@ export default class VelociousEnvironmentHandlerBase {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
|
-
* @
|
|
75
|
+
* @abstract
|
|
76
76
|
* @returns {Promise<CommandFileObjectType[]>}
|
|
77
77
|
*/
|
|
78
78
|
async findCommands() { throw new Error("findCommands not implemented") }
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* @
|
|
81
|
+
* @abstract
|
|
82
82
|
* @returns {Promise<Array<MigrationObjectType>>}
|
|
83
83
|
*/
|
|
84
84
|
async findMigrations() { throw new Error("findMigrations not implemneted") }
|
|
@@ -97,26 +97,26 @@ export default class VelociousEnvironmentHandlerBase {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* @
|
|
100
|
+
* @abstract
|
|
101
101
|
* @returns {Promise<string>}
|
|
102
102
|
*/
|
|
103
103
|
getVelociousPath() { throw new Error("getVelociousPath not implemented") }
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
* @
|
|
106
|
+
* @abstract
|
|
107
107
|
* @returns {Promise<import("../routes/index.js").default>}
|
|
108
108
|
*/
|
|
109
109
|
async importApplicationRoutes() { throw new Error("importApplicationRoutes not implemented") }
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
|
-
* @
|
|
112
|
+
* @abstract
|
|
113
113
|
* @param {string[]} _testFiles
|
|
114
114
|
* @returns {Promise<void>}
|
|
115
115
|
*/
|
|
116
116
|
importTestFiles(_testFiles) { throw new Error("'importTestFiles' not implemented") } // eslint-disable-line no-unused-vars
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* @
|
|
119
|
+
* @abstract
|
|
120
120
|
* @returns {Promise<void>}
|
|
121
121
|
*/
|
|
122
122
|
importTestingConfigPath() { throw new Error(`'importTestingConfigPath' not implemented`) }
|
|
@@ -125,7 +125,7 @@ export default class VelociousEnvironmentHandlerBase {
|
|
|
125
125
|
* @param {object} args
|
|
126
126
|
* @param {string[]} args.commandParts
|
|
127
127
|
* @returns {Promise<import ("../cli/base-command.js").default>}
|
|
128
|
-
* @
|
|
128
|
+
* @abstract
|
|
129
129
|
*/
|
|
130
130
|
async requireCommand({commandParts}) { throw new Error("'requireCommand' not implemented") } // eslint-disable-line no-unused-vars
|
|
131
131
|
|
|
@@ -139,14 +139,13 @@ export default class DbGenerateModel extends BaseCommand {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
fileContent += " /**\n"
|
|
142
|
-
fileContent += " * @interface\n"
|
|
143
142
|
fileContent += ` * @returns {import("${modelFilePath}").default}\n`
|
|
144
143
|
fileContent += " */\n"
|
|
145
144
|
fileContent += ` ${relationship.getRelationshipName()}() { return this.getRelationshipByName("${relationship.getRelationshipName()}").loaded() }\n`
|
|
146
145
|
|
|
147
146
|
fileContent += "\n"
|
|
148
147
|
fileContent += " /**\n"
|
|
149
|
-
fileContent += " * @
|
|
148
|
+
fileContent += " * @abstract\n"
|
|
150
149
|
fileContent += " * @param {Record<string, any>} attributes\n"
|
|
151
150
|
fileContent += ` * @returns {import("${modelFilePath}").default}\n`
|
|
152
151
|
fileContent += " */\n"
|
|
@@ -154,14 +153,14 @@ export default class DbGenerateModel extends BaseCommand {
|
|
|
154
153
|
|
|
155
154
|
fileContent += "\n"
|
|
156
155
|
fileContent += " /**\n"
|
|
157
|
-
fileContent += " * @
|
|
156
|
+
fileContent += " * @abstract\n"
|
|
158
157
|
fileContent += " * @returns {Promise<void>}\n"
|
|
159
158
|
fileContent += " */\n"
|
|
160
159
|
fileContent += ` load${inflection.camelize(relationship.getRelationshipName())}() { throw new Error("Not implemented") }\n`
|
|
161
160
|
|
|
162
161
|
fileContent += "\n"
|
|
163
162
|
fileContent += " /**\n"
|
|
164
|
-
fileContent += " * @
|
|
163
|
+
fileContent += " * @abstract\n"
|
|
165
164
|
fileContent += ` * @param {import("${modelFilePath}").default} newModel\n`
|
|
166
165
|
fileContent += ` * @returns {void}\n`
|
|
167
166
|
fileContent += " */\n"
|
|
@@ -176,28 +175,26 @@ export default class DbGenerateModel extends BaseCommand {
|
|
|
176
175
|
}
|
|
177
176
|
|
|
178
177
|
fileContent += " /**\n"
|
|
179
|
-
fileContent += " * @interface\n"
|
|
180
178
|
fileContent += ` * @returns {import("velocious/src/database/query/index.js").default<import("${recordImport}").default>}\n`
|
|
181
179
|
fileContent += " */\n"
|
|
182
180
|
fileContent += ` ${relationship.getRelationshipName()}() { return this.getRelationshipByName("${relationship.getRelationshipName()}") }\n`
|
|
183
181
|
|
|
184
182
|
fileContent += "\n"
|
|
185
183
|
fileContent += " /**\n"
|
|
186
|
-
fileContent += " * @interface\n"
|
|
187
184
|
fileContent += ` * @returns {Array<import("${recordImport}").default>}\n`
|
|
188
185
|
fileContent += " */\n"
|
|
189
186
|
fileContent += ` ${relationship.getRelationshipName()}Loaded() { return this.getRelationshipByName("${relationship.getRelationshipName()}").loaded() }\n`
|
|
190
187
|
|
|
191
188
|
fileContent += "\n"
|
|
192
189
|
fileContent += " /**\n"
|
|
193
|
-
fileContent += " * @
|
|
190
|
+
fileContent += " * @abstract\n"
|
|
194
191
|
fileContent += " * @returns {Promise<void>}\n"
|
|
195
192
|
fileContent += " */\n"
|
|
196
193
|
fileContent += ` load${inflection.camelize(relationship.getRelationshipName())}() { throw new Error("Not implemented") }\n`
|
|
197
194
|
|
|
198
195
|
fileContent += "\n"
|
|
199
196
|
fileContent += " /**\n"
|
|
200
|
-
fileContent += " * @
|
|
197
|
+
fileContent += " * @abstract\n"
|
|
201
198
|
fileContent += ` * @param {Array<import("${recordImport}").default>} newModels\n`
|
|
202
199
|
fileContent += " * @returns {void}\n"
|
|
203
200
|
fileContent += " */\n"
|
|
@@ -206,8 +206,7 @@ export default class VelociousEnvironmentHandlerNode extends Base{
|
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
208
|
* @param {string} filePath
|
|
209
|
-
* @
|
|
210
|
-
* @returns {Promise<T>}
|
|
209
|
+
* @returns {Promise<import("../database/migration/index.js").default>}
|
|
211
210
|
*/
|
|
212
211
|
async requireMigration(filePath) {
|
|
213
212
|
const migrationImport = await import(filePath)
|
package/src/initializer.js
CHANGED