create-anywherescada-app 0.0.3 → 0.0.4

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": "create-anywherescada-app",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Create a SvelteKit app connected to AnywhereScada",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,3 +2,5 @@ node_modules/
2
2
  .svelte-kit/
3
3
  build/
4
4
  .env
5
+ pnpm-lock.yaml
6
+ pnpm-workspace.yaml
@@ -15,6 +15,7 @@
15
15
  "@sveltejs/vite-plugin-svelte": "^6.0.0",
16
16
  "svelte": "^5.35.0",
17
17
  "svelte-check": "^4.2.0",
18
+ "@types/d3": "^7.4.0",
18
19
  "@types/ws": "^8.18.0",
19
20
  "typescript": "^5.8.0",
20
21
  "vite": "^7.0.0"
@@ -22,6 +23,7 @@
22
23
  "dependencies": {
23
24
  "@fontsource/space-grotesk": "^5.2.8",
24
25
  "@joyautomation/salt": "^0.0.21",
26
+ "d3": "^7.9.0",
25
27
  "graphql": "^16.9.0",
26
28
  "graphql-ws": "^6.0.0",
27
29
  "sass": "^1.89.0",
@@ -1,9 +1,9 @@
1
1
  import type { Handle } from '@sveltejs/kit';
2
2
 
3
3
  export const handle: Handle = async ({ event, resolve }) => {
4
- const theme = event.cookies.get('theme') ?? 'themeLight';
5
- const validThemes = ['themeLight', 'themeDark'];
6
- const safeTheme = validThemes.includes(theme) ? theme : 'themeLight';
4
+ const theme = event.cookies.get('theme') ?? 'themeSystem';
5
+ const validThemes = ['themeSystem', 'themeLight', 'themeDark'];
6
+ const safeTheme = validThemes.includes(theme) ? theme : 'themeSystem';
7
7
 
8
8
  return resolve(event, {
9
9
  transformPageChunk: ({ html }) => html.replace('%theme%', safeTheme)
@@ -43,6 +43,20 @@ export const QUERIES = {
43
43
  }
44
44
  }
45
45
  }
46
+ `,
47
+ history: `
48
+ query GetHistory($start: Date!, $end: Date!, $metrics: [MetricHistoryEntry!]!, $interval: String, $samples: Int, $raw: Boolean) {
49
+ history(start: $start, end: $end, metrics: $metrics, interval: $interval, samples: $samples, raw: $raw) {
50
+ groupId
51
+ nodeId
52
+ deviceId
53
+ metricId
54
+ history {
55
+ value
56
+ timestamp
57
+ }
58
+ }
59
+ }
46
60
  `
47
61
  };
48
62