@things-factory/process 7.0.0-alpha.0 → 7.0.0-alpha.10
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/client/pages/process/process-list-page.ts +1 -1
- package/dist-client/pages/process/process-list-page.js +1 -1
- package/dist-client/pages/process/process-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/process-instance/process-instance-subscription.js +6 -11
- package/dist-server/service/process-instance/process-instance-subscription.js.map +1 -1
- package/dist-server/service/process-thread/process-thread-subscription.js +6 -5
- package/dist-server/service/process-thread/process-thread-subscription.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/server/service/process-instance/process-instance-subscription.ts +9 -15
- package/server/service/process-thread/process-thread-subscription.ts +9 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/process",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.10",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"@operato/graphql": "^2.0.0-alpha.0",
|
|
32
32
|
"@operato/grist-editor": "^2.0.0-alpha.0",
|
|
33
33
|
"@operato/shell": "^2.0.0-alpha.0",
|
|
34
|
-
"@things-factory/attachment-base": "^7.0.0-alpha.
|
|
35
|
-
"@things-factory/auth-base": "^7.0.0-alpha.
|
|
36
|
-
"@things-factory/board-service": "^7.0.0-alpha.
|
|
37
|
-
"@things-factory/context-ui": "^7.0.0-alpha.
|
|
38
|
-
"@things-factory/organization": "^7.0.0-alpha.
|
|
39
|
-
"@things-factory/scheduler-client": "^7.0.0-alpha.
|
|
40
|
-
"@things-factory/shell": "^7.0.0-alpha.
|
|
41
|
-
"@things-factory/worklist": "^7.0.0-alpha.
|
|
34
|
+
"@things-factory/attachment-base": "^7.0.0-alpha.9",
|
|
35
|
+
"@things-factory/auth-base": "^7.0.0-alpha.9",
|
|
36
|
+
"@things-factory/board-service": "^7.0.0-alpha.9",
|
|
37
|
+
"@things-factory/context-ui": "^7.0.0-alpha.9",
|
|
38
|
+
"@things-factory/organization": "^7.0.0-alpha.9",
|
|
39
|
+
"@things-factory/scheduler-client": "^7.0.0-alpha.9",
|
|
40
|
+
"@things-factory/shell": "^7.0.0-alpha.9",
|
|
41
|
+
"@things-factory/worklist": "^7.0.0-alpha.9",
|
|
42
42
|
"moment-timezone": "^0.5.40"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "487d77650ab9e7aa4e84542afafe23df31638bcc"
|
|
45
45
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { filter, pipe } from 'graphql-yoga'
|
|
2
2
|
import { Resolver, Root, Subscription } from 'type-graphql'
|
|
3
3
|
|
|
4
|
+
import { pubsub } from '@things-factory/shell'
|
|
4
5
|
import { User } from '@things-factory/auth-base'
|
|
5
|
-
import { getRepository, pubsub } from '@things-factory/shell'
|
|
6
6
|
|
|
7
7
|
import { ProcessInstance } from './process-instance'
|
|
8
8
|
|
|
9
9
|
@Resolver(ProcessInstance)
|
|
10
10
|
export class ProcessInstanceSubscription {
|
|
11
11
|
@Subscription({
|
|
12
|
-
subscribe: (
|
|
12
|
+
subscribe: ({ args, context, info }) => {
|
|
13
13
|
const { domain, user } = context.state
|
|
14
14
|
const subdomain = domain?.subdomain
|
|
15
15
|
|
|
@@ -21,9 +21,9 @@ export class ProcessInstanceSubscription {
|
|
|
21
21
|
throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
async (payload
|
|
24
|
+
return pipe(
|
|
25
|
+
pubsub.subscribe('process-instance'),
|
|
26
|
+
filter(async (payload: { processInstance: ProcessInstance }) => {
|
|
27
27
|
const { processInstance } = payload
|
|
28
28
|
const { domainId } = processInstance
|
|
29
29
|
|
|
@@ -35,15 +35,9 @@ export class ProcessInstanceSubscription {
|
|
|
35
35
|
return true
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
relations: ['roles']
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
return !!userWithRoles.roles.find(role => role.id === processInstance.assigneeRoleId)
|
|
45
|
-
}
|
|
46
|
-
)(_, args, context, info)
|
|
38
|
+
return await User.hasPrivilege('query', 'process-instance', domain, user)
|
|
39
|
+
})
|
|
40
|
+
)
|
|
47
41
|
}
|
|
48
42
|
})
|
|
49
43
|
processInstance(@Root() payload: { processInstance: ProcessInstance }): ProcessInstance {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { filter, pipe } from 'graphql-yoga'
|
|
2
2
|
import { Resolver, Root, Subscription } from 'type-graphql'
|
|
3
3
|
|
|
4
4
|
import { pubsub } from '@things-factory/shell'
|
|
5
|
+
import { User } from '@things-factory/auth-base'
|
|
5
6
|
|
|
6
7
|
import { ProcessThread } from './process-thread'
|
|
7
8
|
|
|
8
9
|
@Resolver(ProcessThread)
|
|
9
10
|
export class ProcessThreadSubscription {
|
|
10
11
|
@Subscription({
|
|
11
|
-
subscribe: (
|
|
12
|
+
subscribe: ({ args, context, info }) => {
|
|
12
13
|
const { domain, user } = context.state
|
|
13
14
|
const subdomain = domain?.subdomain
|
|
14
15
|
|
|
@@ -20,9 +21,9 @@ export class ProcessThreadSubscription {
|
|
|
20
21
|
throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
async (payload
|
|
24
|
+
return pipe(
|
|
25
|
+
pubsub.subscribe('process-thread'),
|
|
26
|
+
filter(async (payload: { processThread: ProcessThread }) => {
|
|
26
27
|
const { processThread } = payload
|
|
27
28
|
const { domainId } = processThread
|
|
28
29
|
|
|
@@ -30,9 +31,9 @@ export class ProcessThreadSubscription {
|
|
|
30
31
|
return false
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
)
|
|
34
|
+
return await User.hasPrivilege('query', 'process-thread', domain, user)
|
|
35
|
+
})
|
|
36
|
+
)
|
|
36
37
|
}
|
|
37
38
|
})
|
|
38
39
|
processThread(@Root() payload: { processThread: ProcessThread }): ProcessThread {
|