aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/xtext/xtextMessages.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-02-04 20:18:20 +0100
committerLibravatar GitHub <noreply@github.com>2022-02-04 20:18:20 +0100
commit42db1e8b4dcff3667c5f14e8dd464309c3c2f23e (patch)
treef5f5efe86fb352980cf144cceb68d1a1101b274f /subprojects/frontend/src/xtext/xtextMessages.ts
parentchore(web): fix Sonar issue (diff)
parentchore(frontend): bump frontend dependencies (diff)
downloadrefinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.tar.gz
refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.tar.zst
refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.zip
Merge pull request #18 from kris7t/releng-docs
Restructure project
Diffstat (limited to 'subprojects/frontend/src/xtext/xtextMessages.ts')
-rw-r--r--subprojects/frontend/src/xtext/xtextMessages.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/subprojects/frontend/src/xtext/xtextMessages.ts b/subprojects/frontend/src/xtext/xtextMessages.ts
new file mode 100644
index 00000000..c4305fcf
--- /dev/null
+++ b/subprojects/frontend/src/xtext/xtextMessages.ts
@@ -0,0 +1,40 @@
1import { z } from 'zod';
2
3export const xtextWebRequest = z.object({
4 id: z.string().nonempty(),
5 request: z.unknown(),
6});
7
8export type XtextWebRequest = z.infer<typeof xtextWebRequest>;
9
10export const xtextWebOkResponse = z.object({
11 id: z.string().nonempty(),
12 response: z.unknown(),
13});
14
15export type XtextWebOkResponse = z.infer<typeof xtextWebOkResponse>;
16
17export const xtextWebErrorKind = z.enum(['request', 'server']);
18
19export type XtextWebErrorKind = z.infer<typeof xtextWebErrorKind>;
20
21export const xtextWebErrorResponse = z.object({
22 id: z.string().nonempty(),
23 error: xtextWebErrorKind,
24 message: z.string(),
25});
26
27export type XtextWebErrorResponse = z.infer<typeof xtextWebErrorResponse>;
28
29export const xtextWebPushService = z.enum(['highlight', 'validate']);
30
31export type XtextWebPushService = z.infer<typeof xtextWebPushService>;
32
33export const xtextWebPushMessage = z.object({
34 resource: z.string().nonempty(),
35 stateId: z.string().nonempty(),
36 service: xtextWebPushService,
37 push: z.unknown(),
38});
39
40export type XtextWebPushMessage = z.infer<typeof xtextWebPushMessage>;