@things-factory/reference-app 4.0.10 → 4.0.14
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/attachments/03176f83-6c50-4850-ab43-e6765b259afd.png +0 -0
- package/attachments/2b963bee-3ca5-4a86-95b7-e557b7eba8eb.html +5695 -0
- package/attachments/4880d6fb-7045-4c50-bfb9-daf83ecf6cc1.png +0 -0
- package/attachments/5bcde766-32e5-4cdc-ad9b-9e0139c122f4.txt +673 -0
- package/attachments/6f9d5fd4-6546-40c6-90c0-0207233ad12f.json +145 -0
- package/attachments/a1aaa123-4c8d-485e-9975-5b5b4add6a30.png +0 -0
- package/attachments/b2331d78-f55d-4b9e-8aae-34f80c1252b3.jpeg +0 -0
- package/attachments/b9a3e2fd-fe83-4394-8fc8-66478443f65e.png +0 -0
- package/attachments/be3d2cd7-d236-45af-b512-4f141c8e2cfc.pptx +0 -0
- package/attachments/d211b356-1619-4f2b-9b10-ed46b4fd82de.png +0 -0
- package/attachments/d445e1a1-a048-49d7-96f2-284ac00fe96a.png +0 -0
- package/attachments/d462b12b-d519-4d6c-861a-f56d2494b135.png +0 -0
- package/attachments/f63986fb-bef5-4b55-a342-6fd4abf26739.png +0 -0
- package/client/components/camera-capturer.js +2 -2
- package/client/components/ocr-viewpart.js +26 -6
- package/client/pages/context-menu-page.js +5 -6
- package/client/pages/grist-mode-page.js +1 -1
- package/client/pages/label-scan-page.js +6 -8
- package/db.sqlite +0 -0
- package/dist-server/service/reference/lambda-call.js +14 -12
- package/dist-server/service/reference/lambda-call.js.map +1 -1
- package/dist-server/service/reference/reference-query.js +3 -3
- package/dist-server/service/reference/reference-query.js.map +1 -1
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +3 -8
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +12 -12
- package/logs/application-2021-12-04-12.log +4 -0
- package/logs/{connections-2021-11-02-11.log → connections-2021-11-29-20.log} +0 -0
- package/logs/{connections-2021-11-03-11.log → connections-2021-11-29-21.log} +0 -0
- package/logs/{connections-2021-11-04-14.log → connections-2021-11-29-23.log} +0 -0
- package/logs/{connections-2021-11-05-18.log → connections-2021-12-04-12.log} +0 -0
- package/package.json +43 -42
- package/server/service/reference/lambda-call.ts +12 -10
- package/server/service/reference/reference-query.ts +3 -3
- package/attachments/69808491-8e6b-45e2-9bf8-dccea1c5b52e.png +0 -0
- package/attachments/7927fe8e-2246-453d-9869-7072b983437c.png +0 -0
- package/attachments/7d150574-01b8-4439-96a0-d57299f3ffcf.png +0 -0
- package/attachments/a1cf142c-f3c2-442c-b8d5-a7f9cc6a59b3.png +0 -0
- package/attachments/cb3ac834-ece0-4802-bef0-dfdc0fcd93bd.png +0 -0
- package/logs/application-2021-11-04-14.log +0 -4
- package/logs/application-2021-11-05-18.log +0 -6
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "simple-switch",
|
|
4
|
+
"left": 119.16099773242632,
|
|
5
|
+
"top": 38.95691609977326,
|
|
6
|
+
"width": 99.99999999999974,
|
|
7
|
+
"height": 40.00000000000001,
|
|
8
|
+
"thumbnailColor": "#ffffff",
|
|
9
|
+
"onColor": "#2196f3",
|
|
10
|
+
"offColor": "#cccccc",
|
|
11
|
+
"rotation": 0,
|
|
12
|
+
"id": "input1"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "input-text",
|
|
16
|
+
"top": 91.57596371882084,
|
|
17
|
+
"left": 119.72789115646258,
|
|
18
|
+
"width": 255.64625850340076,
|
|
19
|
+
"height": 30,
|
|
20
|
+
"paddingLeft": 7,
|
|
21
|
+
"paddingRight": 7,
|
|
22
|
+
"fontSize": 14,
|
|
23
|
+
"fillStyle": "white",
|
|
24
|
+
"fontColor": "#585858",
|
|
25
|
+
"strokeStyle": "rgba(0,0,0,.4)",
|
|
26
|
+
"lineWidth": 1,
|
|
27
|
+
"lineDash": "solid",
|
|
28
|
+
"textAlign": "left",
|
|
29
|
+
"rotation": 0,
|
|
30
|
+
"id": "input2",
|
|
31
|
+
"mappings": [
|
|
32
|
+
{
|
|
33
|
+
"rule": "value",
|
|
34
|
+
"target": "(self)",
|
|
35
|
+
"property": "value"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "text",
|
|
41
|
+
"left": 7.4829931972789225,
|
|
42
|
+
"top": 43.934240362811806,
|
|
43
|
+
"width": 95.91836734693874,
|
|
44
|
+
"height": 50,
|
|
45
|
+
"text": "Input 1",
|
|
46
|
+
"fillStyle": "#fff",
|
|
47
|
+
"strokeStyle": "#000",
|
|
48
|
+
"alpha": 1,
|
|
49
|
+
"hidden": false,
|
|
50
|
+
"lineWidth": 5,
|
|
51
|
+
"lineDash": "solid",
|
|
52
|
+
"lineCap": "butt",
|
|
53
|
+
"textAlign": "left",
|
|
54
|
+
"textBaseline": "top",
|
|
55
|
+
"textWrap": false,
|
|
56
|
+
"fontFamily": "serif",
|
|
57
|
+
"fontSize": 30,
|
|
58
|
+
"rotation": 0
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "text",
|
|
62
|
+
"left": 7.4829931972789225,
|
|
63
|
+
"top": 94.72789115646262,
|
|
64
|
+
"width": 95.91836734693874,
|
|
65
|
+
"height": 50,
|
|
66
|
+
"text": "Input 2",
|
|
67
|
+
"fillStyle": "#fff",
|
|
68
|
+
"strokeStyle": "#000",
|
|
69
|
+
"alpha": 1,
|
|
70
|
+
"hidden": false,
|
|
71
|
+
"lineWidth": 5,
|
|
72
|
+
"lineDash": "solid",
|
|
73
|
+
"lineCap": "butt",
|
|
74
|
+
"textAlign": "left",
|
|
75
|
+
"textBaseline": "top",
|
|
76
|
+
"textWrap": false,
|
|
77
|
+
"fontFamily": "serif",
|
|
78
|
+
"fontSize": 30,
|
|
79
|
+
"rotation": 0
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"type": "rect",
|
|
83
|
+
"left": 251.70068027210883,
|
|
84
|
+
"top": 252.4943310657596,
|
|
85
|
+
"width": 120.29478458049894,
|
|
86
|
+
"height": 32.42630385487533,
|
|
87
|
+
"fillStyle": "#fff",
|
|
88
|
+
"strokeStyle": "#000",
|
|
89
|
+
"alpha": 1,
|
|
90
|
+
"hidden": false,
|
|
91
|
+
"lineWidth": 1,
|
|
92
|
+
"lineDash": "solid",
|
|
93
|
+
"lineCap": "butt",
|
|
94
|
+
"rotation": 0,
|
|
95
|
+
"text": "OK",
|
|
96
|
+
"shadow": {
|
|
97
|
+
"left": 5,
|
|
98
|
+
"top": 5,
|
|
99
|
+
"blurSize": 5,
|
|
100
|
+
"color": "rgb(217, 13, 75)"
|
|
101
|
+
},
|
|
102
|
+
"event": {
|
|
103
|
+
"tap": {
|
|
104
|
+
"pressed": true,
|
|
105
|
+
"action": "close-scene"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"data": {
|
|
109
|
+
"result1": true,
|
|
110
|
+
"result2": "성공했습니다."
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "rect",
|
|
115
|
+
"left": 119.72789115646259,
|
|
116
|
+
"top": 252.4943310657596,
|
|
117
|
+
"width": 120.29478458049883,
|
|
118
|
+
"height": 32.42630385487533,
|
|
119
|
+
"fillStyle": "#fff",
|
|
120
|
+
"strokeStyle": "#000",
|
|
121
|
+
"alpha": 1,
|
|
122
|
+
"hidden": false,
|
|
123
|
+
"lineWidth": 1,
|
|
124
|
+
"lineDash": "solid",
|
|
125
|
+
"lineCap": "butt",
|
|
126
|
+
"rotation": 0,
|
|
127
|
+
"text": "NOT OK",
|
|
128
|
+
"shadow": {
|
|
129
|
+
"left": 5,
|
|
130
|
+
"top": 5,
|
|
131
|
+
"blurSize": 5,
|
|
132
|
+
"color": "rgb(5, 61, 55)"
|
|
133
|
+
},
|
|
134
|
+
"event": {
|
|
135
|
+
"tap": {
|
|
136
|
+
"pressed": true,
|
|
137
|
+
"action": "close-scene"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"data": {
|
|
141
|
+
"result1": false,
|
|
142
|
+
"result2": "실패했습니다."
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css, html, LitElement } from 'lit-element'
|
|
2
2
|
|
|
3
3
|
import { FileDropHelper } from '@things-factory/utils'
|
|
4
4
|
|
|
@@ -90,7 +90,7 @@ export class CameraCapturer extends LitElement {
|
|
|
90
90
|
accept=${this.accept}
|
|
91
91
|
?multiple=${this.multiple}
|
|
92
92
|
hidden
|
|
93
|
-
capture="
|
|
93
|
+
capture="environment"
|
|
94
94
|
@change=${e => {
|
|
95
95
|
const fileInput = e.currentTarget
|
|
96
96
|
|
|
@@ -55,6 +55,30 @@ class OCRViewPart extends LitElement {
|
|
|
55
55
|
`
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
extractInfosResultParser(response) {
|
|
59
|
+
const ocrResult = response.ocr?.result || []
|
|
60
|
+
const barcodeResult = response.barcode?.result || []
|
|
61
|
+
// const results = ocrResult.concat(barcodeResult)
|
|
62
|
+
if (ocrResult.length != barcodeResult.length) {
|
|
63
|
+
console.warn('ocr and barcode result size are different. It could be loss of information.')
|
|
64
|
+
}
|
|
65
|
+
const resultSize = Math.min(ocrResult.length, barcodeResult.length)
|
|
66
|
+
|
|
67
|
+
let results = []
|
|
68
|
+
for (let i = 0; i < resultSize; i++) {
|
|
69
|
+
try {
|
|
70
|
+
let boundaries = JSON.parse(ocrResult[i].boundaries)
|
|
71
|
+
boundaries = boundaries.concat(JSON.parse(barcodeResult[i].boundaries))
|
|
72
|
+
let texts = ocrResult[i].texts.concat(barcodeResult[i].texts)
|
|
73
|
+
results.push({ boundaries, texts })
|
|
74
|
+
} catch(err) {
|
|
75
|
+
console.error(err)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return results
|
|
80
|
+
}
|
|
81
|
+
|
|
58
82
|
async upload(e) {
|
|
59
83
|
FILES = this._files = e.detail
|
|
60
84
|
|
|
@@ -72,12 +96,8 @@ class OCRViewPart extends LitElement {
|
|
|
72
96
|
|
|
73
97
|
if (!response.errors) {
|
|
74
98
|
const helper = this.shadowRoot.querySelector('ox-ocr-helper')
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
...result,
|
|
78
|
-
boundaries: JSON.parse(result.boundaries)
|
|
79
|
-
}
|
|
80
|
-
})
|
|
99
|
+
helper.result = this.extractInfosResultParser(response.data.ocrRequest)
|
|
100
|
+
// console.log('helper.result', helper.result)
|
|
81
101
|
} else {
|
|
82
102
|
document.dispatchEvent(
|
|
83
103
|
new CustomEvent('notify', {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
2
|
import '@operato/popup'
|
|
3
3
|
|
|
4
|
-
import { css, html } from 'lit-element'
|
|
5
|
-
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
6
|
-
|
|
7
|
-
import { PopupMenu } from '@operato/popup'
|
|
8
4
|
import { PageView, store } from '@things-factory/shell'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
9
6
|
|
|
7
|
+
import { OxPopupMenu } from '@operato/popup'
|
|
8
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
10
9
|
import { referencePageStyles } from './reference-page-styles'
|
|
11
10
|
|
|
12
11
|
class ContextMenuPage extends connect(store)(PageView) {
|
|
@@ -36,7 +35,7 @@ class ContextMenuPage extends connect(store)(PageView) {
|
|
|
36
35
|
return html`
|
|
37
36
|
<p>여기서는 Context Menu 등의 용도로 사용될 수 있는 팝업 메뉴 기능을 설명합니다.</p>
|
|
38
37
|
<p>
|
|
39
|
-
|
|
38
|
+
OxPopupMenu는 미리 hidden element로 위치하고 있을 수도 있으며, 동적으로 생성될 수도 있습니다. 여기서는 미리
|
|
40
39
|
페이지내에 엘리먼트를 위치시키고 open method로 활성화 시키는 방법을 예시합니다. 데스크톱 브라우저 페이지 내 어느
|
|
41
40
|
위치에서든 마우스 우측버튼을 클릭하고, 모바일 디바이스에서는 탭을 오래누르면(longpress) 팝업메뉴가 동작합니다.
|
|
42
41
|
</p>
|
|
@@ -47,7 +46,7 @@ class ContextMenuPage extends connect(store)(PageView) {
|
|
|
47
46
|
this.addEventListener('contextmenu', e => {
|
|
48
47
|
e.preventDefault()
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
OxPopupMenu.open({
|
|
51
50
|
template: html`
|
|
52
51
|
<ox-popup-menuitem
|
|
53
52
|
label="article - click me"
|
|
@@ -2,8 +2,8 @@ import '@operato/popup'
|
|
|
2
2
|
import '@operato/data-grist'
|
|
3
3
|
|
|
4
4
|
import { css, html } from 'lit-element'
|
|
5
|
-
|
|
6
5
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
6
|
+
|
|
7
7
|
import { PageView } from '@things-factory/shell'
|
|
8
8
|
|
|
9
9
|
class GristModePage extends localize(i18next)(PageView) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '@things-factory/barcode-ui'
|
|
2
|
-
|
|
3
|
-
import { css, html } from 'lit-element'
|
|
4
|
-
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
2
|
+
import '@operato/input/dist/src/ox-input-barcode.js'
|
|
5
3
|
|
|
6
4
|
import { PageView, store } from '@things-factory/shell'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
7
6
|
|
|
7
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
8
|
import { referencePageStyles } from './reference-page-styles'
|
|
9
9
|
|
|
10
10
|
class LabelScanPage extends connect(store)(PageView) {
|
|
@@ -51,10 +51,8 @@ class LabelScanPage extends connect(store)(PageView) {
|
|
|
51
51
|
return html`
|
|
52
52
|
<section>
|
|
53
53
|
<h2>Barcode Scanable Input</h2>
|
|
54
|
-
<p>
|
|
55
|
-
|
|
56
|
-
</p>
|
|
57
|
-
<barcode-scanable-input
|
|
54
|
+
<p>ox-input-barcode 컴포넌트는 카메라 입력을 통해서 바코드를 스캔하고, 스캔한 결과를 입력 필드에 적용한다.</p>
|
|
55
|
+
<ox-input-barcode
|
|
58
56
|
name="barcode-input"
|
|
59
57
|
custom-input
|
|
60
58
|
@keypress=${e => {
|
|
@@ -64,7 +62,7 @@ class LabelScanPage extends connect(store)(PageView) {
|
|
|
64
62
|
console.log('input completed.', e.target.value)
|
|
65
63
|
}
|
|
66
64
|
}}
|
|
67
|
-
></
|
|
65
|
+
></ox-input-barcode>
|
|
68
66
|
</section>
|
|
69
67
|
|
|
70
68
|
<section>
|
package/db.sqlite
CHANGED
|
Binary file
|
|
@@ -3,25 +3,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.extractInfos = void 0;
|
|
7
7
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
8
8
|
const env_1 = require("@things-factory/env");
|
|
9
9
|
const utils_1 = require("@things-factory/utils");
|
|
10
10
|
const appSyncConfig = env_1.config.get('awsAppSync');
|
|
11
|
-
async function
|
|
11
|
+
async function extractInfos(images) {
|
|
12
|
+
const extraction = {
|
|
13
|
+
success_count: true,
|
|
14
|
+
failure_count: true,
|
|
15
|
+
result: {
|
|
16
|
+
boundaries: true,
|
|
17
|
+
texts: true
|
|
18
|
+
}
|
|
19
|
+
};
|
|
12
20
|
const query = utils_1.gqlBuilder.jsonToGraphQLQuery({
|
|
13
21
|
mutation: {
|
|
14
|
-
|
|
22
|
+
extractInfos: {
|
|
15
23
|
__args: {
|
|
16
24
|
images
|
|
17
25
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
result: {
|
|
21
|
-
key_values: true,
|
|
22
|
-
boundaries: true,
|
|
23
|
-
texts: true
|
|
24
|
-
}
|
|
26
|
+
ocr: extraction,
|
|
27
|
+
barcode: extraction
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
});
|
|
@@ -37,7 +40,7 @@ async function interpretImages(images) {
|
|
|
37
40
|
const jsonRes = await response.json();
|
|
38
41
|
return jsonRes;
|
|
39
42
|
}
|
|
40
|
-
exports.
|
|
43
|
+
exports.extractInfos = extractInfos;
|
|
41
44
|
// @deprecated
|
|
42
45
|
function getRequestBody(images) {
|
|
43
46
|
// @things-factory/utils gqlBuilder.buildArgs 와 유사
|
|
@@ -56,7 +59,6 @@ function getRequestBody(images) {
|
|
|
56
59
|
success_count
|
|
57
60
|
failure_count
|
|
58
61
|
results {
|
|
59
|
-
key_values
|
|
60
62
|
boundaries
|
|
61
63
|
texts
|
|
62
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lambda-call.js","sourceRoot":"","sources":["../../../server/service/reference/lambda-call.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAE9B,6CAA4C;AAC5C,iDAAkD;AAElD,MAAM,aAAa,GAAG,YAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;AAEvC,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"lambda-call.js","sourceRoot":"","sources":["../../../server/service/reference/lambda-call.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAE9B,6CAA4C;AAC5C,iDAAkD;AAElD,MAAM,aAAa,GAAG,YAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;AAEvC,KAAK,UAAU,YAAY,CAAC,MAAM;IACvC,MAAM,UAAU,GAAG;QACjB,aAAa,EAAE,IAAI;QACnB,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE;YACN,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,IAAI;SACZ;KACF,CAAA;I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./lambda-call");
|
|
|
22
22
|
const debug = require('debug')('things-factory:reference-app');
|
|
23
23
|
let ReferenceQuery = class ReferenceQuery {
|
|
24
24
|
async ocrRequest(_, images, context) {
|
|
25
|
-
var _a
|
|
25
|
+
var _a;
|
|
26
26
|
const { domain, user, tx } = context.state;
|
|
27
27
|
const all = Promise.all(images);
|
|
28
28
|
if ((images === null || images === void 0 ? void 0 : images.length) > 0) {
|
|
@@ -42,9 +42,9 @@ let ReferenceQuery = class ReferenceQuery {
|
|
|
42
42
|
const formatArr = mimetype.split('/');
|
|
43
43
|
return { data: image, name: filename, format: formatArr[formatArr.length - 1] };
|
|
44
44
|
}));
|
|
45
|
-
const res = await (0, lambda_call_1.
|
|
45
|
+
const res = await (0, lambda_call_1.extractInfos)(files);
|
|
46
46
|
console.log('interpretImages response', JSON.stringify(res, null, ' '));
|
|
47
|
-
return (
|
|
47
|
+
return (_a = res.data) === null || _a === void 0 ? void 0 : _a.extractInfos;
|
|
48
48
|
}
|
|
49
49
|
return [];
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-query.js","sourceRoot":"","sources":["../../../server/service/reference/reference-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,+CAA8D;AAE9D,qEAA+E;AAC/E,iDAAkE;AAClE,iDAA6C;AAE7C,+
|
|
1
|
+
{"version":3,"file":"reference-query.js","sourceRoot":"","sources":["../../../server/service/reference/reference-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,+CAA8D;AAE9D,qEAA+E;AAC/E,iDAAkE;AAClE,iDAA6C;AAE7C,+CAA4C;AAE5C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,8BAA8B,CAAC,CAAA;AAG9D,IAAa,cAAc,GAA3B,MAAa,cAAc;IAEzB,KAAK,CAAC,UAAU,CACN,CAAC,EAET,MAAoB,EACb,OAAY;;QAEnB,MAAM,EA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6B,EAAE,CAAC;IAEzE,WAAA,IAAA,mBAAI,GAAE,CAAA;IACN,WAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,8BAAa,CAAC,CAAC,CAAA;IAEpC,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDA+BP;AAYD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;IAC7D,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAK,WAAA,IAAA,kBAAG,EAAC,KAAK,CAAC,CAAA;IAAe,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;mDAe7D;AAhEU,cAAc;IAD1B,IAAA,uBAAQ,GAAE;GACE,cAAc,CAiE1B;AAjEY,wCAAc"}
|
|
@@ -6,14 +6,9 @@
|
|
|
6
6
|
"auditLog": "logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json",
|
|
7
7
|
"files": [
|
|
8
8
|
{
|
|
9
|
-
"date":
|
|
10
|
-
"name": "logs/application-2021-
|
|
11
|
-
"hash": "
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"date": 1636103946107,
|
|
15
|
-
"name": "logs/application-2021-11-05-18.log",
|
|
16
|
-
"hash": "dca379ac4e315b99f4a38f1350437523"
|
|
9
|
+
"date": 1638588022375,
|
|
10
|
+
"name": "logs/application-2021-12-04-12.log",
|
|
11
|
+
"hash": "52490522244a68a53c9234b890500fb1"
|
|
17
12
|
}
|
|
18
13
|
]
|
|
19
14
|
}
|
|
@@ -6,24 +6,24 @@
|
|
|
6
6
|
"auditLog": "logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json",
|
|
7
7
|
"files": [
|
|
8
8
|
{
|
|
9
|
-
"date":
|
|
10
|
-
"name": "logs/connections-2021-11-
|
|
11
|
-
"hash": "
|
|
9
|
+
"date": 1638185239795,
|
|
10
|
+
"name": "logs/connections-2021-11-29-20.log",
|
|
11
|
+
"hash": "e28d199b30bde6b88967362fb318a103"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"date":
|
|
15
|
-
"name": "logs/connections-2021-11-
|
|
16
|
-
"hash": "
|
|
14
|
+
"date": 1638189721660,
|
|
15
|
+
"name": "logs/connections-2021-11-29-21.log",
|
|
16
|
+
"hash": "679163fc1c530a8fd14dcbfc617300a4"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
"date":
|
|
20
|
-
"name": "logs/connections-2021-11-
|
|
21
|
-
"hash": "
|
|
19
|
+
"date": 1638194624575,
|
|
20
|
+
"name": "logs/connections-2021-11-29-23.log",
|
|
21
|
+
"hash": "92bf1c2c4738bc05921cefe0e860c4fa"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"date":
|
|
25
|
-
"name": "logs/connections-2021-
|
|
26
|
-
"hash": "
|
|
24
|
+
"date": 1638588025596,
|
|
25
|
+
"name": "logs/connections-2021-12-04-12.log",
|
|
26
|
+
"hash": "db210c324f72a98be8b697f2793027f1"
|
|
27
27
|
}
|
|
28
28
|
]
|
|
29
29
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
2021-12-04T03:20:24.579Z info: File Storage is Ready.
|
|
2
|
+
2021-12-04T03:20:28.501Z info: Database connection established
|
|
3
|
+
2021-12-04T03:20:29.570Z info: 🚀 Server ready at http://0.0.0.0:3000/graphql
|
|
4
|
+
2021-12-04T03:20:29.570Z info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/subscriptions
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/reference-app",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.14",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -37,50 +37,51 @@
|
|
|
37
37
|
"docker:run": "docker run -it -p 4000:3000 hatiolab/reference-app:latest"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@hatiolab/things-scene": "^2.7.
|
|
40
|
+
"@hatiolab/things-scene": "^2.7.27",
|
|
41
41
|
"@material/mwc-checkbox": "^0.25.3",
|
|
42
|
-
"@operato/data-grist": "^0.2.
|
|
43
|
-
"@operato/ghost-print": "^0.2.
|
|
44
|
-
"@operato/
|
|
45
|
-
"@operato/
|
|
46
|
-
"@operato/
|
|
47
|
-
"@operato/
|
|
48
|
-
"@operato/scene-
|
|
49
|
-
"@operato/scene-
|
|
50
|
-
"@operato/scene-
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@things-factory/
|
|
56
|
-
"@things-factory/
|
|
57
|
-
"@things-factory/
|
|
58
|
-
"@things-factory/
|
|
59
|
-
"@things-factory/
|
|
60
|
-
"@things-factory/
|
|
61
|
-
"@things-factory/
|
|
62
|
-
"@things-factory/
|
|
63
|
-
"@things-factory/
|
|
64
|
-
"@things-factory/
|
|
65
|
-
"@things-factory/
|
|
66
|
-
"@things-factory/
|
|
67
|
-
"@things-factory/
|
|
68
|
-
"@things-factory/
|
|
69
|
-
"@things-factory/
|
|
70
|
-
"@things-factory/
|
|
71
|
-
"@things-factory/
|
|
72
|
-
"@things-factory/
|
|
42
|
+
"@operato/data-grist": "^0.2.46",
|
|
43
|
+
"@operato/ghost-print": "^0.2.46",
|
|
44
|
+
"@operato/input": "^0.2.46",
|
|
45
|
+
"@operato/ocr": "^0.2.46",
|
|
46
|
+
"@operato/popup": "^0.2.46",
|
|
47
|
+
"@operato/pull-to-refresh": "^0.2.46",
|
|
48
|
+
"@operato/scene-chartjs": "^0.0.19",
|
|
49
|
+
"@operato/scene-clock": "^0.0.19",
|
|
50
|
+
"@operato/scene-gauge": "^0.0.19",
|
|
51
|
+
"@operato/scene-indoor-map": "^0.0.19",
|
|
52
|
+
"@operato/scene-progressbar": "^0.0.19",
|
|
53
|
+
"@operato/scene-random": "^0.0.19",
|
|
54
|
+
"@operato/scene-switch": "^0.0.19",
|
|
55
|
+
"@things-factory/api": "^4.0.14",
|
|
56
|
+
"@things-factory/apptool-ui": "^4.0.14",
|
|
57
|
+
"@things-factory/auth-ui": "^4.0.14",
|
|
58
|
+
"@things-factory/board-service": "^4.0.14",
|
|
59
|
+
"@things-factory/board-ui": "^4.0.14",
|
|
60
|
+
"@things-factory/context-ui": "^4.0.14",
|
|
61
|
+
"@things-factory/dashboard": "^4.0.14",
|
|
62
|
+
"@things-factory/export-ui": "^4.0.14",
|
|
63
|
+
"@things-factory/export-ui-excel": "^4.0.14",
|
|
64
|
+
"@things-factory/grist-ui": "^4.0.14",
|
|
65
|
+
"@things-factory/help": "^4.0.14",
|
|
66
|
+
"@things-factory/i18n-ui": "^4.0.14",
|
|
67
|
+
"@things-factory/integration-ui": "^4.0.14",
|
|
68
|
+
"@things-factory/lite-menu": "^4.0.14",
|
|
69
|
+
"@things-factory/more-ui": "^4.0.14",
|
|
70
|
+
"@things-factory/notification": "^4.0.14",
|
|
71
|
+
"@things-factory/oauth2-client": "^4.0.14",
|
|
72
|
+
"@things-factory/print-ui": "^4.0.14",
|
|
73
|
+
"@things-factory/resource-ui": "^4.0.14",
|
|
74
|
+
"@things-factory/scene-form": "^4.0.14",
|
|
73
75
|
"@things-factory/scene-half-roundrect": "^4.0.9",
|
|
74
|
-
"@things-factory/scene-
|
|
75
|
-
"@things-factory/scene-
|
|
76
|
-
"@things-factory/
|
|
77
|
-
"@things-factory/setting-
|
|
78
|
-
"@things-factory/
|
|
79
|
-
"@things-factory/
|
|
80
|
-
"@things-factory/system-ui": "^4.0.10"
|
|
76
|
+
"@things-factory/scene-news-ticker": "^4.0.14",
|
|
77
|
+
"@things-factory/scene-tab": "^4.0.14",
|
|
78
|
+
"@things-factory/setting-base": "^4.0.14",
|
|
79
|
+
"@things-factory/setting-ui": "^4.0.14",
|
|
80
|
+
"@things-factory/shell": "^4.0.14",
|
|
81
|
+
"@things-factory/system-ui": "^4.0.14"
|
|
81
82
|
},
|
|
82
83
|
"devDependencies": {
|
|
83
|
-
"@things-factory/builder": "^4.0.
|
|
84
|
+
"@things-factory/builder": "^4.0.14"
|
|
84
85
|
},
|
|
85
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "956c782b5b2a6ff4c4e18f4a1bdcf778814f1b52"
|
|
86
87
|
}
|
|
@@ -5,20 +5,23 @@ import { gqlBuilder } from '@things-factory/utils'
|
|
|
5
5
|
|
|
6
6
|
const appSyncConfig = config.get('awsAppSync')
|
|
7
7
|
|
|
8
|
-
export async function
|
|
8
|
+
export async function extractInfos(images) {
|
|
9
|
+
const extraction = {
|
|
10
|
+
success_count: true,
|
|
11
|
+
failure_count: true,
|
|
12
|
+
result: {
|
|
13
|
+
boundaries: true,
|
|
14
|
+
texts: true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
9
17
|
const query = gqlBuilder.jsonToGraphQLQuery({
|
|
10
18
|
mutation: {
|
|
11
|
-
|
|
19
|
+
extractInfos: {
|
|
12
20
|
__args: {
|
|
13
21
|
images
|
|
14
22
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
result: {
|
|
18
|
-
key_values: true,
|
|
19
|
-
boundaries: true,
|
|
20
|
-
texts: true
|
|
21
|
-
}
|
|
23
|
+
ocr: extraction,
|
|
24
|
+
barcode: extraction
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
})
|
|
@@ -57,7 +60,6 @@ function getRequestBody(images) {
|
|
|
57
60
|
success_count
|
|
58
61
|
failure_count
|
|
59
62
|
results {
|
|
60
|
-
key_values
|
|
61
63
|
boundaries
|
|
62
64
|
texts
|
|
63
65
|
}
|