@live-change/relations-plugin 0.9.1 → 0.9.3
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 +3 -3
- package/pluralRelationUtils.js +2 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/relations-plugin",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@live-change/framework": "^0.9.
|
|
25
|
+
"@live-change/framework": "^0.9.3",
|
|
26
26
|
"pluralize": "^8.0.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "79f98e67cb1a52a38ced5deb20b0d62d395313cb"
|
|
29
29
|
}
|
package/pluralRelationUtils.js
CHANGED
|
@@ -156,7 +156,7 @@ function getUpdateFunction( validators, validationContext, config, context) {
|
|
|
156
156
|
service, app, model, modelPropertyName, modelRuntime, objectType,
|
|
157
157
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
158
158
|
} = context
|
|
159
|
-
const eventName =
|
|
159
|
+
const eventName = modelName + 'Updated'
|
|
160
160
|
return async function execute(properties, { client, service }, emit) {
|
|
161
161
|
const id = properties[modelPropertyName]
|
|
162
162
|
const entity = await modelRuntime().get(id)
|
|
@@ -272,7 +272,6 @@ function defineDeleteAction(config, context) {
|
|
|
272
272
|
service, app, model, modelRuntime, modelPropertyName, objectType,
|
|
273
273
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
274
274
|
} = context
|
|
275
|
-
const eventName = joinedOthersPropertyName + context.reverseRelationWord + modelName + 'Deleted'
|
|
276
275
|
const actionName = 'delete' + modelName
|
|
277
276
|
const accessControl = config.deleteAccessControl || config.writeAccessControl
|
|
278
277
|
prepareAccessControl(accessControl, otherPropertyNames, others)
|
|
@@ -304,7 +303,6 @@ function defineDeleteTrigger(config, context) {
|
|
|
304
303
|
service, app, model, modelPropertyName, modelRuntime, objectType,
|
|
305
304
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
306
305
|
} = context
|
|
307
|
-
const eventName = modelName + 'Deleted'
|
|
308
306
|
const actionName = 'delete' + modelName
|
|
309
307
|
const triggerName = `${service.name}_${actionName}`
|
|
310
308
|
const trigger = new TriggerDefinition({
|
|
@@ -332,7 +330,7 @@ function getCopyFunction( validators, validationContext, config, context) {
|
|
|
332
330
|
service, app, model, modelPropertyName, modelRuntime, objectType,
|
|
333
331
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
334
332
|
} = context
|
|
335
|
-
const eventName =
|
|
333
|
+
const eventName = modelName + 'Copied'
|
|
336
334
|
return async function execute(properties, { client, service }, emit) {
|
|
337
335
|
const id = properties[modelPropertyName]
|
|
338
336
|
const entity = await modelRuntime().get(id)
|
|
@@ -388,7 +386,6 @@ function defineCopyAction(config, context) {
|
|
|
388
386
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others,
|
|
389
387
|
identifiers
|
|
390
388
|
} = context
|
|
391
|
-
const eventName = modelName + 'Copied'
|
|
392
389
|
const actionName = 'copy' + modelName
|
|
393
390
|
const accessControl = config.copyAccessControl
|
|
394
391
|
prepareAccessControl(accessControl, otherPropertyNames, others)
|
|
@@ -425,7 +422,6 @@ function defineCopyTrigger(config, context) {
|
|
|
425
422
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others,
|
|
426
423
|
identifiers
|
|
427
424
|
} = context
|
|
428
|
-
const eventName = joinedOthersPropertyName + context.reverseRelationWord + modelName + 'Copied'
|
|
429
425
|
const actionName = 'copy' + joinedOthersClassName + context.reverseRelationWord + modelName
|
|
430
426
|
const triggerName = `${service.name}_${actionName}`
|
|
431
427
|
const trigger = new TriggerDefinition({
|