@things-factory/shell 4.0.1 → 4.0.7
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/scene/scene-components.js +0 -1
- package/client/scene/scene-player.js +3 -0
- package/client/scene/scene-viewer.js +58 -0
- package/dist-server/service/common-types/scalar-date.js.map +1 -1
- package/package.json +20 -21
- package/server/service/common-types/scalar-date.ts +2 -2
- package/db.test.sqlite +0 -0
- package/dist-server/service/directive-transaction/transaction-type.js +0 -11
- package/dist-server/service/directive-transaction/transaction-type.js.map +0 -1
@@ -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.7",
|
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.14",
|
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.7",
|
47
|
+
"@things-factory/env": "^4.0.7",
|
48
|
+
"@things-factory/styles": "^4.0.7",
|
49
|
+
"@things-factory/utils": "^4.0.7",
|
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,9 +103,8 @@
|
|
103
103
|
"scrollbooster": "^3.0.2",
|
104
104
|
"subscriptions-transport-ws": "^0.11.0",
|
105
105
|
"sweetalert2": "^10.9.0",
|
106
|
-
"
|
107
|
-
"
|
108
|
-
"typeorm": "0.2.38",
|
106
|
+
"type-graphql": "^1.2.0-rc.1",
|
107
|
+
"typeorm": "^0.2.41",
|
109
108
|
"web-animations-js": "^2.3.2",
|
110
109
|
"web-push": "^3.4.5",
|
111
110
|
"webfontloader": "^1.6.28"
|
@@ -120,5 +119,5 @@
|
|
120
119
|
"resolutions": {
|
121
120
|
"core-js": "^3.16.0"
|
122
121
|
},
|
123
|
-
"gitHead": "
|
122
|
+
"gitHead": "035fa60359aefa9b9111f807fc7e8db6a15a4a6e"
|
124
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) {
|
package/db.test.sqlite
DELETED
Binary file
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.directiveTransactionType = void 0;
|
7
|
-
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
8
|
-
exports.directiveTransactionType = graphql_tag_1.default `
|
9
|
-
directive @transaction on FIELD_DEFINITION
|
10
|
-
`;
|
11
|
-
//# sourceMappingURL=transaction-type.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"transaction-type.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/transaction-type.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,wBAAwB,GAAG,qBAAG,CAAA;;CAE1C,CAAA"}
|