@things-factory/board-service 6.2.86 → 7.0.0-alpha.1

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": "@things-factory/board-service",
3
- "version": "6.2.86",
3
+ "version": "7.0.0-alpha.1",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,11 +24,11 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/auth-base": "^6.2.84",
28
- "@things-factory/env": "^6.2.33",
29
- "@things-factory/fav-base": "^6.2.84",
30
- "@things-factory/font-base": "^6.2.84",
31
- "@things-factory/integration-base": "^6.2.86",
27
+ "@things-factory/auth-base": "^7.0.0-alpha.1",
28
+ "@things-factory/env": "^7.0.0-alpha.0",
29
+ "@things-factory/fav-base": "^7.0.0-alpha.1",
30
+ "@things-factory/font-base": "^7.0.0-alpha.1",
31
+ "@things-factory/integration-base": "^7.0.0-alpha.1",
32
32
  "@things-factory/operato-license-checker": "^4.0.4",
33
33
  "content-disposition": "^0.5.3",
34
34
  "generic-pool": "^3.8.2"
@@ -37,5 +37,5 @@
37
37
  "@thiagoelg/node-printer": "0.6.2",
38
38
  "puppeteer": "^20.7.3"
39
39
  },
40
- "gitHead": "f90a5c1ff2a93331bb6e375944972dc68dde8a1f"
40
+ "gitHead": "778315d165d7f15e147583a45d5079c3d7cbce38"
41
41
  }
@@ -45,8 +45,8 @@ export function getHeadlessPool() {
45
45
  )
46
46
 
47
47
  setTimeout(async () => {
48
- const it = pubsub.asyncIterator('notify-font-changed')
49
- for await (const data of it) {
48
+ const eventSource = pubsub.subscribe('notify-font-changed')
49
+ for await (const data of eventSource) {
50
50
  headlessPool.clear()
51
51
  }
52
52
  })
@@ -1,12 +1,12 @@
1
1
  import { Resolver, Subscription, Root, Arg } from 'type-graphql'
2
- import { withFilter } from 'graphql-subscriptions'
2
+ import { filter, pipe } from 'graphql-yoga'
3
3
  import { pubsub } from '@things-factory/shell'
4
4
  import { Board } from './board'
5
5
 
6
6
  @Resolver(Board)
7
7
  export class BoardSubscription {
8
8
  @Subscription({
9
- subscribe: (_, args, context, info) => {
9
+ subscribe: ({ args, context, info }) => {
10
10
  const { domain, user } = context.state
11
11
  const { id } = args
12
12
  const subdomain = domain?.subdomain
@@ -19,9 +19,9 @@ export class BoardSubscription {
19
19
  throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)
20
20
  }
21
21
 
22
- return withFilter(
23
- () => pubsub.asyncIterator('board'),
24
- (payload, variables, context, info) => {
22
+ return pipe(
23
+ pubsub.subscribe('board'),
24
+ filter((payload: { board: Board }) => {
25
25
  const { domainId, id: boardId } = payload.board
26
26
 
27
27
  if (domainId !== domain.id) {
@@ -33,8 +33,8 @@ export class BoardSubscription {
33
33
  }
34
34
 
35
35
  return true
36
- }
37
- )(_, args, context, info)
36
+ })
37
+ )
38
38
  }
39
39
  })
40
40
  board(@Root() payload: { board: Board }, @Arg('id') id: string): Board {
@@ -1,12 +1,12 @@
1
1
  import { Resolver, Subscription, Root, Arg } from 'type-graphql'
2
- import { withFilter } from 'graphql-subscriptions'
2
+ import { filter, pipe } from 'graphql-yoga'
3
3
  import { pubsub } from '@things-factory/shell'
4
4
  import { PlayGroup } from './play-group'
5
5
 
6
6
  @Resolver(PlayGroup)
7
7
  export class PlayGroupSubscription {
8
8
  @Subscription({
9
- subscribe: (_, args, context, info) => {
9
+ subscribe: ({ args, context, info }) => {
10
10
  const { domain, user } = context.state
11
11
  const { id } = args
12
12
  const subdomain = domain?.subdomain
@@ -19,9 +19,9 @@ export class PlayGroupSubscription {
19
19
  throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)
20
20
  }
21
21
 
22
- return withFilter(
23
- () => pubsub.asyncIterator('play-group'),
24
- (payload, variables, context, info) => {
22
+ return pipe(
23
+ pubsub.subscribe('play-group'),
24
+ filter((payload: { playGroup: PlayGroup }) => {
25
25
  const { id: playGroupId, domainId } = payload.playGroup
26
26
 
27
27
  if (domainId !== domain.id) {
@@ -33,8 +33,8 @@ export class PlayGroupSubscription {
33
33
  }
34
34
 
35
35
  return true
36
- }
37
- )(_, args, context, info)
36
+ })
37
+ )
38
38
  }
39
39
  })
40
40
  playGroup(@Root() payload: { playGroup: PlayGroup }, @Arg('id') id: string): PlayGroup {