@things-factory/edge 7.0.0-alpha.18

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/images/hatiolab-logo.png +0 -0
  3. package/client/bootstrap.ts +1 -0
  4. package/client/index.ts +0 -0
  5. package/client/pages/edge-status-page.ts +180 -0
  6. package/client/route.ts +7 -0
  7. package/client/tsconfig.json +11 -0
  8. package/config/config.development.js +7 -0
  9. package/config/config.production.js +7 -0
  10. package/dist-client/bootstrap.d.ts +1 -0
  11. package/dist-client/bootstrap.js +2 -0
  12. package/dist-client/bootstrap.js.map +1 -0
  13. package/dist-client/index.d.ts +0 -0
  14. package/dist-client/index.js +2 -0
  15. package/dist-client/index.js.map +1 -0
  16. package/dist-client/pages/edge-status-page.d.ts +39 -0
  17. package/dist-client/pages/edge-status-page.js +187 -0
  18. package/dist-client/pages/edge-status-page.js.map +1 -0
  19. package/dist-client/route.d.ts +1 -0
  20. package/dist-client/route.js +8 -0
  21. package/dist-client/route.js.map +1 -0
  22. package/dist-client/tsconfig.tsbuildinfo +1 -0
  23. package/dist-server/controllers/connect-connections.js +71 -0
  24. package/dist-server/controllers/connect-connections.js.map +1 -0
  25. package/dist-server/controllers/disconnect-connections.js +66 -0
  26. package/dist-server/controllers/disconnect-connections.js.map +1 -0
  27. package/dist-server/controllers/log-aggregator.js +20 -0
  28. package/dist-server/controllers/log-aggregator.js.map +1 -0
  29. package/dist-server/controllers/operato-client.js +89 -0
  30. package/dist-server/controllers/operato-client.js.map +1 -0
  31. package/dist-server/controllers/run-task.js +87 -0
  32. package/dist-server/controllers/run-task.js.map +1 -0
  33. package/dist-server/controllers/sync-connections.js +74 -0
  34. package/dist-server/controllers/sync-connections.js.map +1 -0
  35. package/dist-server/index.js +20 -0
  36. package/dist-server/index.js.map +1 -0
  37. package/dist-server/service/connection/connection-query.js +29 -0
  38. package/dist-server/service/connection/connection-query.js.map +1 -0
  39. package/dist-server/service/connection/index.js +6 -0
  40. package/dist-server/service/connection/index.js.map +1 -0
  41. package/dist-server/service/index.js +19 -0
  42. package/dist-server/service/index.js.map +1 -0
  43. package/dist-server/tsconfig.tsbuildinfo +1 -0
  44. package/package.json +39 -0
  45. package/server/controllers/connect-connections.ts +84 -0
  46. package/server/controllers/disconnect-connections.ts +77 -0
  47. package/server/controllers/log-aggregator.ts +14 -0
  48. package/server/controllers/operato-client.ts +108 -0
  49. package/server/controllers/run-task.ts +104 -0
  50. package/server/controllers/sync-connections.ts +89 -0
  51. package/server/index.ts +17 -0
  52. package/server/service/connection/connection-query.ts +21 -0
  53. package/server/service/connection/index.ts +3 -0
  54. package/server/service/index.ts +19 -0
  55. package/server/tsconfig.json +10 -0
  56. package/things-factory.config.js +8 -0
  57. package/translations/en.json +4 -0
  58. package/translations/ja.json +4 -0
  59. package/translations/ko.json +4 -0
  60. package/translations/ms.json +4 -0
  61. package/translations/zh.json +4 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ <!-- ## [Unreleased] -->
Binary file
@@ -0,0 +1 @@
1
+ export default function bootstrap() {}
File without changes
@@ -0,0 +1,180 @@
1
+ import '@operato/data-grist'
2
+ import '@operato/context/ox-context-page-toolbar.js'
3
+ import '@operato/input/ox-input-select-buttons.js'
4
+
5
+ import { PropertyValues, css, html } from 'lit'
6
+ import { customElement, property, query, state } from 'lit/decorators.js'
7
+ import { connect } from 'pwa-helpers/connect-mixin.js'
8
+ import gql from 'graphql-tag'
9
+
10
+ import { store, PageView } from '@operato/shell'
11
+ import { client } from '@operato/graphql'
12
+ import { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'
13
+ import { i18next, localize } from '@operato/i18n'
14
+ import { openPopup } from '@operato/layout'
15
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
16
+ import { isMobileDevice } from '@operato/utils'
17
+
18
+ @customElement('edge-status-page')
19
+ export class EdgeStatusPage extends connect(store)(localize(i18next)(PageView)) {
20
+ static styles = [
21
+ ScrollbarStyles,
22
+ CommonHeaderStyles,
23
+ css`
24
+ :host {
25
+ display: flex;
26
+ flex-direction: column;
27
+
28
+ overflow: hidden;
29
+
30
+ --grid-header-padding: 2px 0 2px 9px;
31
+ }
32
+
33
+ ox-grist {
34
+ overflow-y: auto;
35
+ flex: 1;
36
+ }
37
+ `
38
+ ]
39
+
40
+ @state() private gristConfig: any
41
+ @state() private mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
42
+ @state() private state?: string[]
43
+
44
+ @query('ox-grist') private grist!: DataGrist
45
+
46
+ get context() {
47
+ return {
48
+ title: i18next.t('title.edge-status'),
49
+ search: {
50
+ handler: (search: string) => {
51
+ this.grist.searchText = search
52
+ },
53
+ value: this.grist?.searchText || ''
54
+ },
55
+ filter: {
56
+ handler: () => {
57
+ this.grist.toggleHeadroom()
58
+ }
59
+ },
60
+ help: 'edge/edge-status',
61
+ actions: [],
62
+ toolbar: false
63
+ }
64
+ }
65
+
66
+ render() {
67
+ const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')
68
+
69
+ return html`
70
+ <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
71
+ <div slot="headroom" class="header">
72
+ <div class="title">
73
+ <mwc-icon>summarize</mwc-icon>
74
+ ${i18next.t('label.connections')}
75
+ </div>
76
+
77
+ <ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
78
+ </div>
79
+ </ox-grist>
80
+ `
81
+ }
82
+
83
+ async pageInitialized(lifecycle) {
84
+ this.gristConfig = {
85
+ list: {
86
+ fields: ['name', 'description'],
87
+ details: ['active', 'updatedAt']
88
+ },
89
+ columns: [
90
+ { type: 'gutter', gutterName: 'sequence' },
91
+ {
92
+ type: 'string',
93
+ name: 'domain',
94
+ header: i18next.t('field.domain'),
95
+ record: {
96
+ renderer: value => value.name
97
+ },
98
+ width: 200
99
+ },
100
+ {
101
+ type: 'string',
102
+ name: 'type',
103
+ header: i18next.t('field.type'),
104
+ width: 150
105
+ },
106
+ {
107
+ type: 'string',
108
+ name: 'name',
109
+ header: i18next.t('field.name'),
110
+ width: 150
111
+ },
112
+ {
113
+ type: 'string',
114
+ name: 'description',
115
+ header: i18next.t('field.description'),
116
+ width: 200
117
+ },
118
+ {
119
+ type: 'checkbox',
120
+ name: 'active',
121
+ label: true,
122
+ header: i18next.t('field.active'),
123
+ width: 60
124
+ },
125
+ {
126
+ type: 'string',
127
+ name: 'state',
128
+ label: true,
129
+ header: i18next.t('field.status'),
130
+ width: 100
131
+ }
132
+ ],
133
+ rows: {
134
+ appendable: false,
135
+ selectable: false,
136
+ handlers: {}
137
+ },
138
+ pagination: { infinite: true },
139
+ sorters: []
140
+ }
141
+
142
+ await this.updateComplete
143
+
144
+ this.grist.fetch()
145
+ }
146
+
147
+ async pageUpdated(changes: any, lifecycle: any) {
148
+ if (this.active) {
149
+ // do something here when this page just became as active
150
+ }
151
+ }
152
+
153
+ async fetchHandler() {
154
+ const response = await client.query({
155
+ query: gql`
156
+ query {
157
+ responses: connectionsOnEdge {
158
+ domain {
159
+ id
160
+ name
161
+ subdomain
162
+ }
163
+ id
164
+ type
165
+ name
166
+ description
167
+ endpoint
168
+ active
169
+ state
170
+ }
171
+ }
172
+ `
173
+ })
174
+
175
+ return {
176
+ total: response.data.responses.length || 0,
177
+ records: response.data.responses || []
178
+ }
179
+ }
180
+ }
@@ -0,0 +1,7 @@
1
+ export default function route(page: string) {
2
+ switch (page) {
3
+ case 'edge-status-page':
4
+ import('./pages/edge-status-page')
5
+ return page
6
+ }
7
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../../tsconfig-base.json",
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "declaration": true,
6
+ "module": "esnext",
7
+ "outDir": "../dist-client",
8
+ "baseUrl": "./"
9
+ },
10
+ "include": ["./**/*"]
11
+ }
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ operato: {
3
+ endpoint: 'http://127.0.0.1:3000',
4
+ domain: 'system',
5
+ authKey: ''
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ operato: {
3
+ endpoint: 'http://127.0.0.1:3000',
4
+ domain: 'system',
5
+ authKey: ''
6
+ }
7
+ }
@@ -0,0 +1 @@
1
+ export default function bootstrap(): void;
@@ -0,0 +1,2 @@
1
+ export default function bootstrap() { }
2
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,SAAS,KAAI,CAAC","sourcesContent":["export default function bootstrap() {}\n"]}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -0,0 +1,39 @@
1
+ import '@operato/data-grist';
2
+ import '@operato/context/ox-context-page-toolbar.js';
3
+ import '@operato/input/ox-input-select-buttons.js';
4
+ import { PageView } from '@operato/shell';
5
+ declare const EdgeStatusPage_base: (new (...args: any[]) => {
6
+ _storeUnsubscribe: import("redux").Unsubscribe;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ stateChanged(_state: unknown): void;
10
+ readonly isConnected: boolean;
11
+ }) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
12
+ export declare class EdgeStatusPage extends EdgeStatusPage_base {
13
+ static styles: import("lit").CSSResult[];
14
+ private gristConfig;
15
+ private mode;
16
+ private state?;
17
+ private grist;
18
+ get context(): {
19
+ title: string;
20
+ search: {
21
+ handler: (search: string) => void;
22
+ value: string;
23
+ };
24
+ filter: {
25
+ handler: () => void;
26
+ };
27
+ help: string;
28
+ actions: never[];
29
+ toolbar: boolean;
30
+ };
31
+ render(): import("lit-html").TemplateResult<1>;
32
+ pageInitialized(lifecycle: any): Promise<void>;
33
+ pageUpdated(changes: any, lifecycle: any): Promise<void>;
34
+ fetchHandler(): Promise<{
35
+ total: any;
36
+ records: any;
37
+ }>;
38
+ }
39
+ export {};
@@ -0,0 +1,187 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@operato/data-grist';
3
+ import '@operato/context/ox-context-page-toolbar.js';
4
+ import '@operato/input/ox-input-select-buttons.js';
5
+ import { css, html } from 'lit';
6
+ import { customElement, query, state } from 'lit/decorators.js';
7
+ import { connect } from 'pwa-helpers/connect-mixin.js';
8
+ import gql from 'graphql-tag';
9
+ import { store, PageView } from '@operato/shell';
10
+ import { client } from '@operato/graphql';
11
+ import { DataGrist } from '@operato/data-grist';
12
+ import { i18next, localize } from '@operato/i18n';
13
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
14
+ import { isMobileDevice } from '@operato/utils';
15
+ let EdgeStatusPage = class EdgeStatusPage extends connect(store)(localize(i18next)(PageView)) {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.mode = isMobileDevice() ? 'CARD' : 'GRID';
19
+ }
20
+ get context() {
21
+ var _a;
22
+ return {
23
+ title: i18next.t('title.edge-status'),
24
+ search: {
25
+ handler: (search) => {
26
+ this.grist.searchText = search;
27
+ },
28
+ value: ((_a = this.grist) === null || _a === void 0 ? void 0 : _a.searchText) || ''
29
+ },
30
+ filter: {
31
+ handler: () => {
32
+ this.grist.toggleHeadroom();
33
+ }
34
+ },
35
+ help: 'edge/edge-status',
36
+ actions: [],
37
+ toolbar: false
38
+ };
39
+ }
40
+ render() {
41
+ const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID');
42
+ return html `
43
+ <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
44
+ <div slot="headroom" class="header">
45
+ <div class="title">
46
+ <mwc-icon>summarize</mwc-icon>
47
+ ${i18next.t('label.connections')}
48
+ </div>
49
+
50
+ <ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
51
+ </div>
52
+ </ox-grist>
53
+ `;
54
+ }
55
+ async pageInitialized(lifecycle) {
56
+ this.gristConfig = {
57
+ list: {
58
+ fields: ['name', 'description'],
59
+ details: ['active', 'updatedAt']
60
+ },
61
+ columns: [
62
+ { type: 'gutter', gutterName: 'sequence' },
63
+ {
64
+ type: 'string',
65
+ name: 'domain',
66
+ header: i18next.t('field.domain'),
67
+ record: {
68
+ renderer: value => value.name
69
+ },
70
+ width: 200
71
+ },
72
+ {
73
+ type: 'string',
74
+ name: 'type',
75
+ header: i18next.t('field.type'),
76
+ width: 150
77
+ },
78
+ {
79
+ type: 'string',
80
+ name: 'name',
81
+ header: i18next.t('field.name'),
82
+ width: 150
83
+ },
84
+ {
85
+ type: 'string',
86
+ name: 'description',
87
+ header: i18next.t('field.description'),
88
+ width: 200
89
+ },
90
+ {
91
+ type: 'checkbox',
92
+ name: 'active',
93
+ label: true,
94
+ header: i18next.t('field.active'),
95
+ width: 60
96
+ },
97
+ {
98
+ type: 'string',
99
+ name: 'state',
100
+ label: true,
101
+ header: i18next.t('field.status'),
102
+ width: 100
103
+ }
104
+ ],
105
+ rows: {
106
+ appendable: false,
107
+ selectable: false,
108
+ handlers: {}
109
+ },
110
+ pagination: { infinite: true },
111
+ sorters: []
112
+ };
113
+ await this.updateComplete;
114
+ this.grist.fetch();
115
+ }
116
+ async pageUpdated(changes, lifecycle) {
117
+ if (this.active) {
118
+ // do something here when this page just became as active
119
+ }
120
+ }
121
+ async fetchHandler() {
122
+ const response = await client.query({
123
+ query: gql `
124
+ query {
125
+ responses: connectionsOnEdge {
126
+ domain {
127
+ id
128
+ name
129
+ subdomain
130
+ }
131
+ id
132
+ type
133
+ name
134
+ description
135
+ endpoint
136
+ active
137
+ state
138
+ }
139
+ }
140
+ `
141
+ });
142
+ return {
143
+ total: response.data.responses.length || 0,
144
+ records: response.data.responses || []
145
+ };
146
+ }
147
+ };
148
+ EdgeStatusPage.styles = [
149
+ ScrollbarStyles,
150
+ CommonHeaderStyles,
151
+ css `
152
+ :host {
153
+ display: flex;
154
+ flex-direction: column;
155
+
156
+ overflow: hidden;
157
+
158
+ --grid-header-padding: 2px 0 2px 9px;
159
+ }
160
+
161
+ ox-grist {
162
+ overflow-y: auto;
163
+ flex: 1;
164
+ }
165
+ `
166
+ ];
167
+ __decorate([
168
+ state(),
169
+ __metadata("design:type", Object)
170
+ ], EdgeStatusPage.prototype, "gristConfig", void 0);
171
+ __decorate([
172
+ state(),
173
+ __metadata("design:type", String)
174
+ ], EdgeStatusPage.prototype, "mode", void 0);
175
+ __decorate([
176
+ state(),
177
+ __metadata("design:type", Array)
178
+ ], EdgeStatusPage.prototype, "state", void 0);
179
+ __decorate([
180
+ query('ox-grist'),
181
+ __metadata("design:type", DataGrist)
182
+ ], EdgeStatusPage.prototype, "grist", void 0);
183
+ EdgeStatusPage = __decorate([
184
+ customElement('edge-status-page')
185
+ ], EdgeStatusPage);
186
+ export { EdgeStatusPage };
187
+ //# sourceMappingURL=edge-status-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-status-page.js","sourceRoot":"","sources":["../../client/pages/edge-status-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,6CAA6C,CAAA;AACpD,OAAO,2CAA2C,CAAA;AAElD,OAAO,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAA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aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAiK1B;SAjKY,cAAc","sourcesContent":["import '@operato/data-grist'\nimport '@operato/context/ox-context-page-toolbar.js'\nimport '@operato/input/ox-input-select-buttons.js'\n\nimport { PropertyValues, css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport gql from 'graphql-tag'\n\nimport { store, PageView } from '@operato/shell'\nimport { client } from '@operato/graphql'\nimport { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\n\n@customElement('edge-status-page')\nexport class EdgeStatusPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n\n --grid-header-padding: 2px 0 2px 9px;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @state() private gristConfig: any\n @state() private mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n @state() private state?: string[]\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.edge-status'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'edge/edge-status',\n actions: [],\n toolbar: false\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"title\">\n <mwc-icon>summarize</mwc-icon>\n ${i18next.t('label.connections')}\n </div>\n\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}></ox-context-page-toolbar>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'string',\n name: 'domain',\n header: i18next.t('field.domain'),\n record: {\n renderer: value => value.name\n },\n width: 200\n },\n {\n type: 'string',\n name: 'type',\n header: i18next.t('field.type'),\n width: 150\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n width: 60\n },\n {\n type: 'string',\n name: 'state',\n label: true,\n header: i18next.t('field.status'),\n width: 100\n }\n ],\n rows: {\n appendable: false,\n selectable: false,\n handlers: {}\n },\n pagination: { infinite: true },\n sorters: []\n }\n\n await this.updateComplete\n\n this.grist.fetch()\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler() {\n const response = await client.query({\n query: gql`\n query {\n responses: connectionsOnEdge {\n domain {\n id\n name\n subdomain\n }\n id\n type\n name\n description\n endpoint\n active\n state\n }\n }\n `\n })\n\n return {\n total: response.data.responses.length || 0,\n records: response.data.responses || []\n }\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export default function route(page: string): "edge-status-page" | undefined;
@@ -0,0 +1,8 @@
1
+ export default function route(page) {
2
+ switch (page) {
3
+ case 'edge-status-page':
4
+ import('./pages/edge-status-page');
5
+ return page;
6
+ }
7
+ }
8
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE;QACZ,KAAK,kBAAkB;YACrB,MAAM,CAAC,0BAA0B,CAAC,CAAA;YAClC,OAAO,IAAI,CAAA;KACd;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n case 'edge-status-page':\n import('./pages/edge-status-page')\n return page\n }\n}\n"]}