-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCandidSpaces.did
163 lines (163 loc) · 2.92 KB
/
CandidSpaces.did
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
type ViewTargets = Targets;
type ViewPos = Position;
type ViewId_2 = ViewId;
type ViewId = text;
type ViewGathering = Gathering;
type Value =
variant {
Bool: bool;
File: File;
Float32: float64;
Func: record {
principal;
text;
};
Int: int;
Int16: int16;
Int32: int32;
Int64: int64;
Int8: int8;
Nat: nat;
Nat16: nat16;
Nat32: nat32;
Nat64: nat64;
Nat8: nat8;
None;
Null;
Number: text;
Opt: Value;
Principal: principal;
Record: vec Field;
Reserved;
Service: principal;
Text: text;
Variant: Field;
Vec: vec Value;
};
type UserId_2 = text;
type UserId = UserId_2;
type Timestamp = int;
type TimeMode =
variant {
ic;
script: Timestamp;
};
type Targets = vec Target;
type Target =
variant {
space: Path;
view: ViewId;
};
type SpacePath = Path;
type SortDir =
variant {
decreasing;
increasing;
};
type PutValues =
record {
path: Path;
time: Timestamp;
user: UserId_2;
values: vec Value;
};
type Put =
record {
caller: principal;
path: Path_2;
user: UserId_2;
values: vec Value;
};
type ProfileInfo_2 = record {userName: text;};
type ProfileInfo = ProfileInfo_2;
type Position = nat;
type Path_2 = Path;
type Path = vec text;
type NamedFile =
record {
file: File;
name: text;
};
type Label =
variant {
Id: nat32;
Named: text;
Unnamed: nat32;
};
type Image_2 =
record {
pos: Position;
putValues: vec PutValues;
size: nat;
viewId: ViewId;
viewer: opt UserId_2;
};
type Image = Image_2;
type Gathering =
variant {
multiset;
multisetSort: SortDir;
sequence;
set;
};
type File =
variant {
Args: vec Value;
Binary: vec nat8;
Directory: vec NamedFile;
Text: text;
Value: Value;
};
type Field =
record {
id: Label;
val: Value;
};
type EventKind =
variant {
createProfile: CreateProfile;
createView: CreateView;
put: Put;
reset: TimeMode;
};
type Event =
record {
id: nat;
kind: EventKind;
time: int;
};
type CreateViewResponse =
record {
putCount: record {
target: vec nat;
total: nat;
};
viewId: ViewId;
};
type CreateView =
record {
caller: principal;
createTime: int;
createUser: UserId_2;
gathering: Gathering;
targets: Targets;
ttl: opt nat;
};
type CreateProfile =
record {
caller: principal;
userName: text;
};
type CandidValue = Value;
type CandidSpaces =
service {
createProfile: (text) -> (opt ProfileInfo);
createView: (UserId, ViewTargets, ViewGathering, opt nat) ->
(opt CreateViewResponse);
getFullImage: (opt UserId, ViewId_2) -> (opt Image) query;
getProfileInfo: (opt UserId, UserId) -> (opt ProfileInfo) query;
getSubImage: (opt UserId, ViewId_2, ViewPos, nat) -> (opt Image) query;
logTail: () -> (opt vec Event) query;
put: (UserId, SpacePath, vec CandidValue) -> (opt null);
};
service : () -> CandidSpaces