Skip to content

Commit 0024602

Browse files
authored
Merge pull request #5 from fabrix-app/v1.1
[feat] check against events
2 parents 38b90d6 + 8289ed0 commit 0024602

File tree

9 files changed

+95
-428
lines changed

9 files changed

+95
-428
lines changed

.circleci/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ jobs:
3131
- run:
3232
name: install-npm-wee
3333
command: npm install
34-
- run:
35-
name: install-npm-sqlite
36-
command: npm install [email protected]
3734
- save_cache:
3835
key: dependency-cache-{{ checksum "package.json" }}
3936
paths:

lib/api/services/PermissionsService.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { FabrixService as Service } from '@fabrix/fabrix/dist/common'
22

33
export class PermissionsService extends Service {
4-
publish(type, event, options: {save?: boolean, transaction?: any} = {}) {
5-
if (this.app.services.EngineService) {
6-
return this.app.services.EngineService.publish(type, event, options)
4+
publish(type, event, options: {save?: boolean, transaction?: any, include?: any} = {}) {
5+
if (this.app.services.EventsService) {
6+
options.include = options.include || [{
7+
model: this.app.models.EventItem.instance,
8+
as: 'objects'
9+
}]
10+
return this.app.services.EventsService.publish(type, event, options)
711
}
8-
this.app.log.debug('Spool-engine is not installed, please install it to use publish')
12+
this.app.log.debug('spool-events is not installed, please install it to use publish')
913
return Promise.resolve()
1014
}
1115

lib/api/services/UserCsvService.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import { readFileSync } from 'fs'
1111
* @description User CSV Service
1212
*/
1313
export class UserCsvService extends Service {
14-
publish(type, event, options: {save?: boolean, transaction?: any} = {}) {
15-
if (this.app.services.EngineService) {
16-
return this.app.services.EngineService.publish(type, event, options)
17-
}
18-
else {
19-
this.app.log.debug('Spool-engine is not installed, please install it to use publish')
14+
publish(type, event, options: {save?: boolean, transaction?: any, include?: any} = {}) {
15+
if (this.app.services.EventsService) {
16+
options.include = options.include || [{
17+
model: this.app.models.EventItem.instance,
18+
as: 'objects'
19+
}]
20+
return this.app.services.EventsService.publish(type, event, options)
2021
}
22+
this.app.log.debug('spool-events is not installed, please install it to use publish')
2123
return Promise.resolve()
2224
}
2325

lib/config/permissions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@ export const permissions = {
1818
// The default super admin username
1919
defaultAdminUsername: 'admin',
2020
// The default super admin password
21-
defaultAdminPassword: 'admin1234'
21+
defaultAdminPassword: 'admin1234',
22+
// Send Emails
23+
emails: {},
24+
// Allow Events
25+
events: {}
2226
}

lib/schemas/permissions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ export const permissions = joi.object().keys({
1212
permissions: joi.array()
1313
}).required(),
1414
defaultAdminUsername: joi.string().required(),
15-
defaultAdminPassword: joi.string().required()
15+
defaultAdminPassword: joi.string().required(),
16+
emails: joi.object(),
17+
events: joi.object()
1618
})

0 commit comments

Comments
 (0)