@live-change/relations-plugin 0.9.198 → 0.9.199
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/relations-plugin",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.199",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@live-change/framework": "^0.9.
|
|
25
|
+
"@live-change/framework": "^0.9.199",
|
|
26
26
|
"pluralize": "^8.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"typedoc-plugin-markdown": "^4.6.3",
|
|
31
31
|
"typedoc-plugin-rename-defaults": "^0.7.3"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "1900043a10cf9ad49b9cc33a539fb973706de962"
|
|
34
34
|
}
|
package/src/entityUtils.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function entityAccessControl({service, modelName, modelPropertyName}, acc
|
|
|
65
65
|
export function defineView(config, context, external) {
|
|
66
66
|
const { service, modelRuntime, modelPropertyName, modelName, model } = context
|
|
67
67
|
const viewName = (config.prefix || '' ) + (config.prefix ? modelName : modelPropertyName) + (config.suffix || '')
|
|
68
|
-
if(external) model.crud.read
|
|
68
|
+
if(external) model.crud.read ??= viewName
|
|
69
69
|
const view = service.view({
|
|
70
70
|
name: viewName,
|
|
71
71
|
properties: {
|
|
@@ -186,7 +186,7 @@ export function defineCreateAction(config, context) {
|
|
|
186
186
|
modelName, writeableProperties
|
|
187
187
|
} = context
|
|
188
188
|
const actionName = 'create' + modelName
|
|
189
|
-
model.crud.create
|
|
189
|
+
model.crud.create ??= actionName
|
|
190
190
|
const action = (service as ServiceDefinition<ServiceDefinitionSpecification>).action<ActionDefinitionSpecificationAC>({
|
|
191
191
|
name: actionName,
|
|
192
192
|
properties: { ...model.properties },
|
|
@@ -255,7 +255,7 @@ export function defineUpdateAction(config, context) {
|
|
|
255
255
|
modelName, writeableProperties
|
|
256
256
|
} = context
|
|
257
257
|
const actionName = 'update' + modelName
|
|
258
|
-
model.crud.update
|
|
258
|
+
model.crud.update ??= actionName
|
|
259
259
|
const action = new ActionDefinition({
|
|
260
260
|
name: actionName,
|
|
261
261
|
properties: {
|
|
@@ -328,7 +328,7 @@ export function defineDeleteAction(config, context) {
|
|
|
328
328
|
modelName, writeableProperties
|
|
329
329
|
} = context
|
|
330
330
|
const actionName = 'delete' + modelName
|
|
331
|
-
model.crud.delete
|
|
331
|
+
model.crud.delete ??= actionName
|
|
332
332
|
service.actions[actionName] = new ActionDefinition({
|
|
333
333
|
name: actionName,
|
|
334
334
|
properties: {
|
|
@@ -75,7 +75,7 @@ function defineSingleView(config, context, external = true) {
|
|
|
75
75
|
sourceAccessControl, [modelPropertyName], [objectType]
|
|
76
76
|
)
|
|
77
77
|
const viewName = modelName[0].toLowerCase() + modelName.slice(1)
|
|
78
|
-
model.crud.read
|
|
78
|
+
model.crud.read ??= viewName
|
|
79
79
|
service.view({
|
|
80
80
|
name: viewName,
|
|
81
81
|
properties: {
|
|
@@ -125,7 +125,7 @@ function defineCreateAction(config, context) {
|
|
|
125
125
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName
|
|
126
126
|
} = context
|
|
127
127
|
const actionName = 'create' + modelName
|
|
128
|
-
model.crud.create
|
|
128
|
+
model.crud.create ??= actionName
|
|
129
129
|
const sourceAccessControl = config.createAccessControl || config.writeAccessControl
|
|
130
130
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames)
|
|
131
131
|
const action = new ActionDefinition({
|
|
@@ -225,7 +225,7 @@ function defineUpdateAction(config, context) {
|
|
|
225
225
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName
|
|
226
226
|
} = context
|
|
227
227
|
const actionName = 'update' + modelName
|
|
228
|
-
model.crud.update
|
|
228
|
+
model.crud.update ??= actionName
|
|
229
229
|
const sourceAccessControl = config.updateAccessControl || config.writeAccessControl
|
|
230
230
|
const accessControl = cloneAndPrepareSingleAccessControl(
|
|
231
231
|
sourceAccessControl, [modelPropertyName], [objectType]
|
|
@@ -313,7 +313,7 @@ function defineDeleteAction(config, context) {
|
|
|
313
313
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName
|
|
314
314
|
} = context
|
|
315
315
|
const actionName = 'delete' + modelName
|
|
316
|
-
model.crud.delete
|
|
316
|
+
model.crud.delete ??= actionName
|
|
317
317
|
const sourceAccessControl = config.deleteAccessControl || config.writeAccessControl
|
|
318
318
|
const accessControl = cloneAndPrepareSingleAccessControl(
|
|
319
319
|
sourceAccessControl, [modelPropertyName], [objectType]
|
|
@@ -66,7 +66,7 @@ function defineSingleView(config, context, external = true) {
|
|
|
66
66
|
validation: ['nonEmpty']
|
|
67
67
|
})
|
|
68
68
|
const viewName = modelName[0].toLowerCase() + modelName.slice(1)
|
|
69
|
-
model.crud.read
|
|
69
|
+
model.crud.read ??= viewName
|
|
70
70
|
const sourceAccessControl = external && (config.readAccessControl || config.writeAccessControl)
|
|
71
71
|
const accessControl = cloneAndPrepareAccessControl(
|
|
72
72
|
sourceAccessControl, [modelPropertyName], [objectType]
|
|
@@ -120,7 +120,7 @@ function defineCreateAction(config, context) {
|
|
|
120
120
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
121
121
|
} = context
|
|
122
122
|
const actionName = 'create' + modelName
|
|
123
|
-
model.crud.create
|
|
123
|
+
model.crud.create ??= actionName
|
|
124
124
|
const sourceAccessControl = config.createAccessControl || config.writeAccessControl
|
|
125
125
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames, others)
|
|
126
126
|
const action = new ActionDefinition({
|
|
@@ -204,7 +204,7 @@ function defineUpdateAction(config, context) {
|
|
|
204
204
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
205
205
|
} = context
|
|
206
206
|
const actionName = 'update' + modelName
|
|
207
|
-
model.crud.update
|
|
207
|
+
model.crud.update ??= actionName
|
|
208
208
|
const sourceAccessControl = config.updateAccessControl || config.writeAccessControl
|
|
209
209
|
const accessControl = cloneAndPrepareAccessControl(
|
|
210
210
|
sourceAccessControl, [modelPropertyName], [objectType]
|
|
@@ -290,7 +290,7 @@ function defineDeleteAction(config, context) {
|
|
|
290
290
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
291
291
|
} = context
|
|
292
292
|
const actionName = 'delete' + modelName
|
|
293
|
-
model.crud.delete
|
|
293
|
+
model.crud.delete ??= actionName
|
|
294
294
|
const sourceAccessControl = config.deleteAccessControl || config.writeAccessControl
|
|
295
295
|
const accessControl = cloneAndPrepareAccessControl(
|
|
296
296
|
sourceAccessControl, [modelPropertyName], [objectType]
|
|
@@ -40,7 +40,7 @@ function defineObjectView(config, context, external = true) {
|
|
|
40
40
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames)
|
|
41
41
|
const viewName = config.name
|
|
42
42
|
|| ((config.prefix ? config.prefix + modelName : modelName[0].toLowerCase() + modelName.slice(1)) + (config.suffix || ''))
|
|
43
|
-
model.crud.read
|
|
43
|
+
model.crud.read ??= viewName
|
|
44
44
|
service.view({
|
|
45
45
|
name: viewName,
|
|
46
46
|
properties: {
|
|
@@ -126,7 +126,7 @@ function defineSetAction(config, context) {
|
|
|
126
126
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName
|
|
127
127
|
} = context
|
|
128
128
|
const actionName = 'set' + modelName
|
|
129
|
-
model.crud.create
|
|
129
|
+
model.crud.create ??= actionName
|
|
130
130
|
const sourceAccessControl = config.setAccessControl || config.writeAccessControl
|
|
131
131
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames)
|
|
132
132
|
const action = new ActionDefinition({
|
|
@@ -201,7 +201,7 @@ function defineUpdateAction(config, context) {
|
|
|
201
201
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName
|
|
202
202
|
} = context
|
|
203
203
|
const actionName = 'update' + modelName
|
|
204
|
-
model.crud.update
|
|
204
|
+
model.crud.update ??= actionName
|
|
205
205
|
const sourceAccessControl = config.updateAccessControl || config.writeAccessControl
|
|
206
206
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames)
|
|
207
207
|
const action = new ActionDefinition({
|
|
@@ -280,7 +280,7 @@ function defineSetOrUpdateAction(config, context) {
|
|
|
280
280
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName
|
|
281
281
|
} = context
|
|
282
282
|
const actionName = 'setOrUpdate' + modelName
|
|
283
|
-
model.crud.createOrUpdate
|
|
283
|
+
model.crud.createOrUpdate ??= actionName
|
|
284
284
|
const sourceAccessControl = config.setOrUpdateAccessControl || config.writeAccessControl
|
|
285
285
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames)
|
|
286
286
|
const action = new ActionDefinition({
|
|
@@ -378,7 +378,7 @@ function defineResetTrigger(config, context) {
|
|
|
378
378
|
otherPropertyNames, joinedOthersPropertyName, modelName, joinedOthersClassName, model
|
|
379
379
|
} = context
|
|
380
380
|
const actionName = 'reset' + modelName
|
|
381
|
-
model.crud.reset
|
|
381
|
+
model.crud.reset ??= actionName
|
|
382
382
|
const triggerName = `${service.name}_${actionName}`
|
|
383
383
|
service.triggers[triggerName] = [new TriggerDefinition({
|
|
384
384
|
name: triggerName,
|
|
@@ -397,7 +397,7 @@ function defineDeleteAction(config, context) {
|
|
|
397
397
|
otherPropertyNames, joinedOthersPropertyName, modelName, joinedOthersClassName, model
|
|
398
398
|
} = context
|
|
399
399
|
const actionName = 'delete' + modelName
|
|
400
|
-
model.crud.delete
|
|
400
|
+
model.crud.delete ??= actionName
|
|
401
401
|
const sourceAccessControl = config.resetAccessControl || config.writeAccessControl
|
|
402
402
|
const accessControl = cloneAndPrepareAccessControl(
|
|
403
403
|
sourceAccessControl, [modelPropertyName], [objectType]
|
|
@@ -39,7 +39,7 @@ export function defineObjectView(config, context, external = true) {
|
|
|
39
39
|
const viewProperties = createIdentifiersProperties(otherPropertyNames, others, modelPropertyName)
|
|
40
40
|
const viewName = config.name
|
|
41
41
|
|| ((config.prefix ? config.prefix + modelName : modelName[0].toLowerCase() + modelName.slice(1)) + (config.suffix || ''))
|
|
42
|
-
model.crud.read
|
|
42
|
+
model.crud.read ??= viewName
|
|
43
43
|
const sourceAccessControl = external && (config.singleAccessControl || config.readAccessControl || config.writeAccessControl)
|
|
44
44
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl,
|
|
45
45
|
otherPropertyNames.concat(modelPropertyName),
|
|
@@ -174,7 +174,7 @@ export function defineSetAction(config, context) {
|
|
|
174
174
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
175
175
|
} = context
|
|
176
176
|
const actionName = 'set' + modelName
|
|
177
|
-
model.crud.create
|
|
177
|
+
model.crud.create ??= actionName
|
|
178
178
|
const sourceAccessControl = config.setAccessControl || config.writeAccessControl
|
|
179
179
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames, others)
|
|
180
180
|
const action = new ActionDefinition({
|
|
@@ -250,7 +250,7 @@ export function defineUpdateAction(config, context) {
|
|
|
250
250
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
251
251
|
} = context
|
|
252
252
|
const actionName = 'update' + modelName
|
|
253
|
-
model.crud.update
|
|
253
|
+
model.crud.update ??= actionName
|
|
254
254
|
const sourceAccessControl = config.updateAccessControl || config.writeAccessControl
|
|
255
255
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames, others)
|
|
256
256
|
const action = new ActionDefinition({
|
|
@@ -328,7 +328,7 @@ export function defineSetOrUpdateAction(config, context) {
|
|
|
328
328
|
otherPropertyNames, joinedOthersPropertyName, modelName, writeableProperties, joinedOthersClassName, others
|
|
329
329
|
} = context
|
|
330
330
|
const actionName = 'setOrUpdate' + modelName
|
|
331
|
-
model.crud.createOrUpdate
|
|
331
|
+
model.crud.createOrUpdate ??= actionName
|
|
332
332
|
const sourceAccessControl = config.updateAccessControl || config.writeAccessControl
|
|
333
333
|
const accessControl = cloneAndPrepareAccessControl(sourceAccessControl, otherPropertyNames, others)
|
|
334
334
|
const action = new ActionDefinition({
|
|
@@ -464,7 +464,7 @@ export function defineResetAction(config, context) {
|
|
|
464
464
|
joinedOthersClassName, model, others, writeableProperties
|
|
465
465
|
} = context
|
|
466
466
|
const actionName = 'reset' + modelName
|
|
467
|
-
model.crud.delete
|
|
467
|
+
model.crud.delete ??= actionName
|
|
468
468
|
const properties = {}
|
|
469
469
|
for (let i = 0; i < others.length; i++) {
|
|
470
470
|
properties[otherPropertyNames[i]] = new PropertyDefinition({
|
package/src/utils.ts
CHANGED
|
@@ -349,7 +349,7 @@ export function defineGlobalRangeView(config: {
|
|
|
349
349
|
prefix
|
|
350
350
|
+ pluralize(prefix ? modelName : modelPropertyName)
|
|
351
351
|
+ (config.suffix || '')
|
|
352
|
-
if(external) model.crud.range
|
|
352
|
+
if(external) model.crud.range ??= viewName
|
|
353
353
|
service.views[viewName] = new ViewDefinition({
|
|
354
354
|
name: viewName,
|
|
355
355
|
properties: {
|