@things-factory/shell 4.0.4 → 4.0.9
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.
@@ -0,0 +1,58 @@
|
|
1
|
+
import './scene-components'
|
2
|
+
|
3
|
+
import gql from 'graphql-tag'
|
4
|
+
|
5
|
+
import { create, error, ReferenceMap } from '@hatiolab/things-scene'
|
6
|
+
import { client, gqlContext } from '@things-factory/shell'
|
7
|
+
|
8
|
+
export { BoardViewer } from '@operato/board'
|
9
|
+
|
10
|
+
export const provider = new ReferenceMap(
|
11
|
+
async (boardId, resolve, reject) => {
|
12
|
+
try {
|
13
|
+
const response = await client.query({
|
14
|
+
query: gql`
|
15
|
+
query FetchBoardById($id: String!) {
|
16
|
+
board(id: $id) {
|
17
|
+
model
|
18
|
+
}
|
19
|
+
}
|
20
|
+
`,
|
21
|
+
variables: { id: boardId },
|
22
|
+
context: gqlContext()
|
23
|
+
})
|
24
|
+
|
25
|
+
const board = response.data.board
|
26
|
+
|
27
|
+
var model = JSON.parse(board.model)
|
28
|
+
|
29
|
+
var scene
|
30
|
+
|
31
|
+
try {
|
32
|
+
scene = await provider.get(boardId)
|
33
|
+
console.warn('Board fetched more than twice.', boardId)
|
34
|
+
} catch (e) {
|
35
|
+
scene = create({
|
36
|
+
model,
|
37
|
+
mode: 0,
|
38
|
+
refProvider: provider
|
39
|
+
})
|
40
|
+
|
41
|
+
// s.app.baseUrl = undefined;
|
42
|
+
}
|
43
|
+
|
44
|
+
resolve(scene, {
|
45
|
+
...board,
|
46
|
+
model
|
47
|
+
})
|
48
|
+
} catch (e) {
|
49
|
+
error(e)
|
50
|
+
reject(e)
|
51
|
+
}
|
52
|
+
},
|
53
|
+
async (id, ref) => {
|
54
|
+
ref.dispose()
|
55
|
+
}
|
56
|
+
)
|
57
|
+
|
58
|
+
window['headlessSceneProvider'] = provider
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scalar-date.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-date.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEpC,QAAA,UAAU,GAAG,IAAI,2BAAiB,CAAC;IAC9C,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,yBAAyB;IACtC,UAAU,CAAC,KAAK;QACd,OAAO,IAAI,IAAI,CAAC,
|
1
|
+
{"version":3,"file":"scalar-date.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-date.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEpC,QAAA,UAAU,GAAG,IAAI,2BAAiB,CAAC;IAC9C,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,yBAAyB;IACtC,UAAU,CAAC,KAAK;QACd,OAAO,IAAI,IAAI,CAAC,KAAwB,CAAC,CAAA,CAAC,wBAAwB;IACpE,CAAC;IACD,SAAS,CAAC,KAAW;QACnB,OAAO,KAAK,CAAC,OAAO,EAAE,CAAA,CAAC,2BAA2B;IACpD,CAAC;IACD,YAAY,CAAC,GAAG;QACd,IAAI,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,GAAG,EAAE;YACzB,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA,CAAC,uCAAuC;SACpE;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/shell",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.9",
|
4
4
|
"description": "Core module for framework",
|
5
5
|
"bin": {
|
6
6
|
"things-factory": "bin/things-factory",
|
@@ -35,21 +35,21 @@
|
|
35
35
|
"@graphql-tools/merge": "^7.0.0",
|
36
36
|
"@graphql-tools/schema": "^8.2.0",
|
37
37
|
"@graphql-tools/utils": "^8.3.0",
|
38
|
-
"@hatiolab/things-scene": "^2.7.
|
38
|
+
"@hatiolab/things-scene": "^2.7.20",
|
39
39
|
"@koa/cors": "^3.1.0",
|
40
|
-
"@material/mwc-button": "^0.
|
41
|
-
"@material/mwc-fab": "^0.
|
42
|
-
"@material/mwc-icon": "^0.
|
43
|
-
"@material/mwc-icon-button": "^0.
|
44
|
-
"@material/mwc-slider": "^0.
|
45
|
-
"@material/mwc-textfield": "^0.
|
46
|
-
"@things-factory/ejs-remote": "^4.0.
|
47
|
-
"@things-factory/env": "^4.0.
|
48
|
-
"@things-factory/styles": "^4.0.
|
49
|
-
"@things-factory/utils": "^4.0.
|
40
|
+
"@material/mwc-button": "^0.25.3",
|
41
|
+
"@material/mwc-fab": "^0.25.3",
|
42
|
+
"@material/mwc-icon": "^0.25.3",
|
43
|
+
"@material/mwc-icon-button": "^0.25.3",
|
44
|
+
"@material/mwc-slider": "^0.25.3",
|
45
|
+
"@material/mwc-textfield": "^0.25.3",
|
46
|
+
"@things-factory/ejs-remote": "^4.0.9",
|
47
|
+
"@things-factory/env": "^4.0.9",
|
48
|
+
"@things-factory/styles": "^4.0.9",
|
49
|
+
"@things-factory/utils": "^4.0.9",
|
50
50
|
"@webcomponents/webcomponentsjs": "^2.6.0",
|
51
|
-
"apollo-server-core": "^3.
|
52
|
-
"apollo-server-koa": "^3.
|
51
|
+
"apollo-server-core": "^3.5.0",
|
52
|
+
"apollo-server-koa": "^3.5.0",
|
53
53
|
"apollo-server-types": "^3.4.0",
|
54
54
|
"apollo-upload-client": "^16.0.0",
|
55
55
|
"args": "^5.0.0",
|
@@ -62,9 +62,9 @@
|
|
62
62
|
"firebase": "^8.0.1",
|
63
63
|
"fs-extra": "^9.0.1",
|
64
64
|
"glob": "^7.1.6",
|
65
|
-
"graphql": "^15.
|
65
|
+
"graphql": "^15.7.2",
|
66
66
|
"graphql-mqtt-subscriptions": "^1.2.0",
|
67
|
-
"graphql-redis-subscriptions": "^2.4.
|
67
|
+
"graphql-redis-subscriptions": "^2.4.2",
|
68
68
|
"graphql-subscriptions": "^2.0.0",
|
69
69
|
"graphql-tag": "^2.12.6",
|
70
70
|
"graphql-upload": "^12.0.0",
|
@@ -84,7 +84,7 @@
|
|
84
84
|
"koa-unless": "^1.0.7",
|
85
85
|
"koa-webpack": "^6.0.0",
|
86
86
|
"koa2-connect-history-api-fallback": "^0.1.2",
|
87
|
-
"lit
|
87
|
+
"lit": "^2.0.2",
|
88
88
|
"loader-utils": "^2.0.0",
|
89
89
|
"lodash": "^4.17.15",
|
90
90
|
"mkdirp": "^1.0.3",
|
@@ -103,8 +103,8 @@
|
|
103
103
|
"scrollbooster": "^3.0.2",
|
104
104
|
"subscriptions-transport-ws": "^0.11.0",
|
105
105
|
"sweetalert2": "^10.9.0",
|
106
|
-
"type-graphql": "^1.
|
107
|
-
"typeorm": "0.2.
|
106
|
+
"type-graphql": "^1.2.0-rc.1",
|
107
|
+
"typeorm": "^0.2.41",
|
108
108
|
"web-animations-js": "^2.3.2",
|
109
109
|
"web-push": "^3.4.5",
|
110
110
|
"webfontloader": "^1.6.28"
|
@@ -119,5 +119,5 @@
|
|
119
119
|
"resolutions": {
|
120
120
|
"core-js": "^3.16.0"
|
121
121
|
},
|
122
|
-
"gitHead": "
|
122
|
+
"gitHead": "81c8ae24487cfe79da62717f12bb6752761911ae"
|
123
123
|
}
|
@@ -4,9 +4,9 @@ export const ScalarDate = new GraphQLScalarType({
|
|
4
4
|
name: 'Date',
|
5
5
|
description: 'Date custom scalar type',
|
6
6
|
parseValue(value) {
|
7
|
-
return new Date(value) // value from the client
|
7
|
+
return new Date(value as string | number) // value from the client
|
8
8
|
},
|
9
|
-
serialize(value) {
|
9
|
+
serialize(value: Date) {
|
10
10
|
return value.getTime() // value sent to the client
|
11
11
|
},
|
12
12
|
parseLiteral(ast) {
|