-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtype-showcase.wit
More file actions
95 lines (78 loc) · 2.04 KB
/
Copy pathtype-showcase.wit
File metadata and controls
95 lines (78 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package temporal:type-showcase@1.0.0;
world system {
export type-showcase;
}
/// @nexus.endpoint "type-showcase"
interface type-showcase {
enum user-status {
active,
suspended,
deleted,
}
flags user-capability {
read-profile,
update-email,
deactivate,
}
variant notification-target {
email(string),
sms(string),
none,
}
record postal-address {
street: string,
city: string,
country: string,
coordinates: option<tuple<f64, f64>>,
}
record user-profile {
tags: list<string>,
metadata: map<string, string>,
capabilities: user-capability,
sync-state: result<string, string>,
notification-target: notification-target,
address: option<postal-address>,
}
resource user {
constructor(user-id: string, email: string, display-name: string, status: user-status, profile: user-profile);
update-email: func(email: string) -> user-result;
rename: func(display-name: string) -> user-result;
deactivate: func(reason: option<string>);
}
record get-user-request {
user-id: string,
consistency-token: option<string>,
}
type user-result = own<user>;
record update-email-request {
user-id: string,
email: string,
}
record rename-request {
user-id: string,
display-name: string,
}
record set-profile-request {
user-id: string,
profile: user-profile,
}
record sync-report {
route: list<tuple<f64, f64>>,
attempts: list<result<string, string>>,
region-status: map<string, result<string, string>>,
}
record record-sync-request {
user-id: string,
report: sync-report,
}
record deactivate-request {
user-id: string,
reason: option<string>,
}
get-user: func(request: get-user-request) -> user-result;
update-email: func(request: update-email-request) -> user-result;
rename: func(request: rename-request) -> user-result;
set-profile: func(request: set-profile-request) -> user-result;
record-sync: func(request: record-sync-request);
deactivate: func(request: deactivate-request);
}