@things-factory/board-service 8.0.64 → 8.0.73

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": "8.0.64",
3
+ "version": "8.0.73",
4
4
  "main": "dist-server/index.js",
5
5
  "things-factory": true,
6
6
  "author": "",
@@ -33,5 +33,5 @@
33
33
  "generic-pool": "^3.8.2",
34
34
  "puppeteer": "^23.0.0"
35
35
  },
36
- "gitHead": "e7e5f6dc93f372f8ccc8aa406246f7a37795b53b"
36
+ "gitHead": "bda7f8e2ee7a18d153dc14c6b59882d441630fa7"
37
37
  }
@@ -310,6 +310,22 @@ standaloneBoardServiceRouter.get('/label-command/:id', async (context, next) =>
310
310
  context.body = await labelcommand({ id, data, orientation, mirror, upsideDown, context } as any)
311
311
  })
312
312
 
313
+ // for webpage scrap => zpl image print(grf format) command for released version board (POST)
314
+ standaloneBoardServiceRouter.post('/label-command/:id', async (context, next) => {
315
+ const { id } = context.params
316
+
317
+ const raw = context.request.body || context.query
318
+ const data = typeof raw === 'object' && raw != null ? { ...(raw as any) } : ({} as any)
319
+ delete data.access_token
320
+
321
+ const orientation = data && data.orientation
322
+ const mirror = data && data.mirror
323
+ const upsideDown = data && data.upsideDown
324
+
325
+ context.type = 'text/plain'
326
+ context.body = await labelcommand({ id, data, orientation, mirror, upsideDown, context } as any)
327
+ })
328
+
313
329
  // for webpage scrap => zpl image print(grf format) command for draft version board
314
330
  standaloneBoardServiceRouter.get('/label-command-draft/:id', async (context, next) => {
315
331
  const { id } = context.params
@@ -56,13 +56,13 @@ export class BoardHistoryEntitySubscriber extends HistoryEntitySubscriber<Board,
56
56
 
57
57
  public async afterInsert(event: InsertEvent<Board>): Promise<void> {
58
58
  if (event.entity.state == 'released') {
59
- super.afterInsert(event)
59
+ await super.afterInsert(event)
60
60
  }
61
61
  }
62
62
 
63
63
  public async afterUpdate(event: UpdateEvent<Board>): Promise<void> {
64
64
  if (event.entity.state == 'released') {
65
- super.afterUpdate(event)
65
+ await super.afterUpdate(event)
66
66
  }
67
67
  }
68
68
  }