@gjermundgaraba/wtf-api 0.12.2 → 0.14.0
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/dist/areas.d.ts +24 -9
- package/dist/areas.js +5 -6
- package/dist/goals.d.ts +48 -18
- package/dist/goals.js +9 -10
- package/dist/index.d.ts +128 -62
- package/dist/shared.d.ts +30 -2
- package/dist/shared.js +7 -1
- package/dist/tasks.d.ts +65 -19
- package/dist/tasks.js +14 -10
- package/dist/values.d.ts +2 -1
- package/package.json +4 -4
package/dist/areas.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export declare const Area: Schema.Struct<{
|
|
|
5
5
|
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
6
6
|
readonly title: Schema.String;
|
|
7
7
|
readonly description: Schema.String;
|
|
8
|
-
readonly sortKey: Schema.String;
|
|
9
8
|
readonly createdAt: Schema.String;
|
|
10
9
|
readonly updatedAt: Schema.String;
|
|
11
10
|
}>;
|
|
@@ -13,7 +12,12 @@ export type Area = typeof Area.Type;
|
|
|
13
12
|
export declare const AreaCreate: Schema.Struct<{
|
|
14
13
|
readonly title: Schema.String;
|
|
15
14
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
16
|
-
readonly
|
|
15
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
16
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
17
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
18
|
+
}>;
|
|
19
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
20
|
+
}>>;
|
|
17
21
|
}>;
|
|
18
22
|
export interface AreaCreate extends Schema.Schema.Type<typeof AreaCreate> {
|
|
19
23
|
}
|
|
@@ -21,7 +25,12 @@ export declare const AreaUpdate: Schema.Struct<{
|
|
|
21
25
|
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
22
26
|
readonly title: Schema.optionalKey<Schema.String>;
|
|
23
27
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
24
|
-
readonly
|
|
28
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
29
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
30
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
31
|
+
}>;
|
|
32
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
33
|
+
}>>;
|
|
25
34
|
}>;
|
|
26
35
|
export interface AreaUpdate extends Schema.Schema.Type<typeof AreaUpdate> {
|
|
27
36
|
}
|
|
@@ -34,7 +43,6 @@ export declare const AreaActions: readonly [Action.Action<"areas_list", Schema.$
|
|
|
34
43
|
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
35
44
|
readonly title: Schema.String;
|
|
36
45
|
readonly description: Schema.String;
|
|
37
|
-
readonly sortKey: Schema.String;
|
|
38
46
|
readonly createdAt: Schema.String;
|
|
39
47
|
readonly updatedAt: Schema.String;
|
|
40
48
|
}>>, readonly (typeof StorageError)[], true, typeof Action.Anyone, undefined, undefined>, Action.Action<"areas_get", Schema.Struct<{
|
|
@@ -43,30 +51,37 @@ export declare const AreaActions: readonly [Action.Action<"areas_list", Schema.$
|
|
|
43
51
|
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
44
52
|
readonly title: Schema.String;
|
|
45
53
|
readonly description: Schema.String;
|
|
46
|
-
readonly sortKey: Schema.String;
|
|
47
54
|
readonly createdAt: Schema.String;
|
|
48
55
|
readonly updatedAt: Schema.String;
|
|
49
56
|
}>, readonly (typeof NotFound | typeof StorageError)[], true, typeof Action.Anyone, undefined, undefined>, Action.Action<"areas_create", Schema.Struct<{
|
|
50
57
|
readonly title: Schema.String;
|
|
51
58
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
52
|
-
readonly
|
|
59
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
60
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
61
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
62
|
+
}>;
|
|
63
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
64
|
+
}>>;
|
|
53
65
|
}>, Schema.Struct<{
|
|
54
66
|
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
55
67
|
readonly title: Schema.String;
|
|
56
68
|
readonly description: Schema.String;
|
|
57
|
-
readonly sortKey: Schema.String;
|
|
58
69
|
readonly createdAt: Schema.String;
|
|
59
70
|
readonly updatedAt: Schema.String;
|
|
60
71
|
}>, readonly (typeof PlacementRefused | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"areas_update", Schema.Struct<{
|
|
61
72
|
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
62
73
|
readonly title: Schema.optionalKey<Schema.String>;
|
|
63
74
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
64
|
-
readonly
|
|
75
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
76
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
77
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
78
|
+
}>;
|
|
79
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
80
|
+
}>>;
|
|
65
81
|
}>, Schema.Struct<{
|
|
66
82
|
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
67
83
|
readonly title: Schema.String;
|
|
68
84
|
readonly description: Schema.String;
|
|
69
|
-
readonly sortKey: Schema.String;
|
|
70
85
|
readonly createdAt: Schema.String;
|
|
71
86
|
readonly updatedAt: Schema.String;
|
|
72
87
|
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"areas_remove", Schema.Struct<{
|
package/dist/areas.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
import { AreaId, Description, NotFound, PlacementRefused, StorageError, Title, } from "./shared.js";
|
|
3
|
+
import { AreaId, AreaPosition, Description, NotFound, PlacementRefused, StorageError, Title, } from "./shared.js";
|
|
4
4
|
export const Area = Schema.Struct({
|
|
5
5
|
id: AreaId,
|
|
6
6
|
title: Schema.String,
|
|
7
7
|
description: Schema.String,
|
|
8
|
-
sortKey: Schema.String,
|
|
9
8
|
createdAt: Schema.String,
|
|
10
9
|
updatedAt: Schema.String,
|
|
11
10
|
});
|
|
12
11
|
export const AreaCreate = Schema.Struct({
|
|
13
12
|
title: Title,
|
|
14
13
|
description: Schema.optionalKey(Description),
|
|
15
|
-
|
|
14
|
+
position: Schema.optionalKey(AreaPosition),
|
|
16
15
|
});
|
|
17
16
|
export const AreaUpdate = Schema.Struct({
|
|
18
17
|
id: AreaId,
|
|
19
18
|
title: Schema.optionalKey(Title),
|
|
20
19
|
description: Schema.optionalKey(Description),
|
|
21
|
-
|
|
20
|
+
position: Schema.optionalKey(AreaPosition),
|
|
22
21
|
});
|
|
23
22
|
export const AreaRef = Schema.Struct({ id: AreaId });
|
|
24
23
|
export const AreaActions = [
|
|
@@ -40,7 +39,7 @@ export const AreaActions = [
|
|
|
40
39
|
Action.make("areas_create", {
|
|
41
40
|
caller: Action.Anyone,
|
|
42
41
|
error: [PlacementRefused, StorageError],
|
|
43
|
-
description: "Create an area
|
|
42
|
+
description: "Create an area at a position among the areas. Omitted position appends it at the End.",
|
|
44
43
|
readOnly: false,
|
|
45
44
|
input: AreaCreate,
|
|
46
45
|
success: Area,
|
|
@@ -48,7 +47,7 @@ export const AreaActions = [
|
|
|
48
47
|
Action.make("areas_update", {
|
|
49
48
|
caller: Action.Anyone,
|
|
50
49
|
error: [NotFound, PlacementRefused, StorageError],
|
|
51
|
-
description: "Update an area's title, Markdown description, or
|
|
50
|
+
description: "Update an area's title, Markdown description, or position atomically. Omitted position keeps its place.",
|
|
52
51
|
readOnly: false,
|
|
53
52
|
input: AreaUpdate,
|
|
54
53
|
success: Area,
|
package/dist/goals.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export declare const Goal: Schema.Struct<{
|
|
|
17
17
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
18
18
|
readonly title: Schema.String;
|
|
19
19
|
readonly description: Schema.String;
|
|
20
|
-
readonly sortKey: Schema.String;
|
|
21
20
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
22
21
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
23
22
|
readonly text: Schema.String;
|
|
@@ -32,7 +31,12 @@ export declare const GoalCreate: Schema.Struct<{
|
|
|
32
31
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
33
32
|
readonly title: Schema.String;
|
|
34
33
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
35
|
-
readonly
|
|
34
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
35
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
36
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
37
|
+
}>;
|
|
38
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
39
|
+
}>>;
|
|
36
40
|
readonly outcomes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
37
41
|
}>;
|
|
38
42
|
export interface GoalCreate extends Schema.Schema.Type<typeof GoalCreate> {
|
|
@@ -42,7 +46,12 @@ export declare const GoalUpdate: Schema.Struct<{
|
|
|
42
46
|
readonly title: Schema.optionalKey<Schema.String>;
|
|
43
47
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
44
48
|
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
45
|
-
readonly
|
|
49
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
50
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
51
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
52
|
+
}>;
|
|
53
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
54
|
+
}>>;
|
|
46
55
|
}>;
|
|
47
56
|
export interface GoalUpdate extends Schema.Schema.Type<typeof GoalUpdate> {
|
|
48
57
|
}
|
|
@@ -60,7 +69,12 @@ export interface GoalRef extends Schema.Schema.Type<typeof GoalRef> {
|
|
|
60
69
|
export declare const OutcomeAdd: Schema.Struct<{
|
|
61
70
|
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
62
71
|
readonly text: Schema.String;
|
|
63
|
-
readonly
|
|
72
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
73
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
74
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
75
|
+
}>;
|
|
76
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
77
|
+
}>>;
|
|
64
78
|
}>;
|
|
65
79
|
export interface OutcomeAdd extends Schema.Schema.Type<typeof OutcomeAdd> {
|
|
66
80
|
}
|
|
@@ -69,7 +83,12 @@ export declare const OutcomeUpdate: Schema.Struct<{
|
|
|
69
83
|
readonly outcomeId: Schema.brand<Schema.String, "OutcomeId">;
|
|
70
84
|
readonly text: Schema.optionalKey<Schema.String>;
|
|
71
85
|
readonly achieved: Schema.optionalKey<Schema.Boolean>;
|
|
72
|
-
readonly
|
|
86
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
87
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
88
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
89
|
+
}>;
|
|
90
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
91
|
+
}>>;
|
|
73
92
|
}>;
|
|
74
93
|
export interface OutcomeUpdate extends Schema.Schema.Type<typeof OutcomeUpdate> {
|
|
75
94
|
}
|
|
@@ -87,7 +106,6 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
87
106
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
88
107
|
readonly title: Schema.String;
|
|
89
108
|
readonly description: Schema.String;
|
|
90
|
-
readonly sortKey: Schema.String;
|
|
91
109
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
92
110
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
93
111
|
readonly text: Schema.String;
|
|
@@ -103,7 +121,6 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
103
121
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
104
122
|
readonly title: Schema.String;
|
|
105
123
|
readonly description: Schema.String;
|
|
106
|
-
readonly sortKey: Schema.String;
|
|
107
124
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
108
125
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
109
126
|
readonly text: Schema.String;
|
|
@@ -116,14 +133,18 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
116
133
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
117
134
|
readonly title: Schema.String;
|
|
118
135
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
119
|
-
readonly
|
|
136
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
137
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
138
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
139
|
+
}>;
|
|
140
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
141
|
+
}>>;
|
|
120
142
|
readonly outcomes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
121
143
|
}>, Schema.Struct<{
|
|
122
144
|
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
123
145
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
124
146
|
readonly title: Schema.String;
|
|
125
147
|
readonly description: Schema.String;
|
|
126
|
-
readonly sortKey: Schema.String;
|
|
127
148
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
128
149
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
129
150
|
readonly text: Schema.String;
|
|
@@ -137,13 +158,17 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
137
158
|
readonly title: Schema.optionalKey<Schema.String>;
|
|
138
159
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
139
160
|
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
140
|
-
readonly
|
|
161
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
162
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
163
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
164
|
+
}>;
|
|
165
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
166
|
+
}>>;
|
|
141
167
|
}>, Schema.Struct<{
|
|
142
168
|
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
143
169
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
144
170
|
readonly title: Schema.String;
|
|
145
171
|
readonly description: Schema.String;
|
|
146
|
-
readonly sortKey: Schema.String;
|
|
147
172
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
148
173
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
149
174
|
readonly text: Schema.String;
|
|
@@ -155,13 +180,17 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
155
180
|
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_add_outcome", Schema.Struct<{
|
|
156
181
|
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
157
182
|
readonly text: Schema.String;
|
|
158
|
-
readonly
|
|
183
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
184
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
185
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
186
|
+
}>;
|
|
187
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
188
|
+
}>>;
|
|
159
189
|
}>, Schema.Struct<{
|
|
160
190
|
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
161
191
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
162
192
|
readonly title: Schema.String;
|
|
163
193
|
readonly description: Schema.String;
|
|
164
|
-
readonly sortKey: Schema.String;
|
|
165
194
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
166
195
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
167
196
|
readonly text: Schema.String;
|
|
@@ -175,13 +204,17 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
175
204
|
readonly outcomeId: Schema.brand<Schema.String, "OutcomeId">;
|
|
176
205
|
readonly text: Schema.optionalKey<Schema.String>;
|
|
177
206
|
readonly achieved: Schema.optionalKey<Schema.Boolean>;
|
|
178
|
-
readonly
|
|
207
|
+
readonly position: Schema.optionalKey<Schema.TaggedUnion<{
|
|
208
|
+
readonly Before: Schema.TaggedStruct<"Before", {
|
|
209
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
210
|
+
}>;
|
|
211
|
+
readonly End: Schema.TaggedStruct<"End", {}>;
|
|
212
|
+
}>>;
|
|
179
213
|
}>, Schema.Struct<{
|
|
180
214
|
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
181
215
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
182
216
|
readonly title: Schema.String;
|
|
183
217
|
readonly description: Schema.String;
|
|
184
|
-
readonly sortKey: Schema.String;
|
|
185
218
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
186
219
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
187
220
|
readonly text: Schema.String;
|
|
@@ -198,7 +231,6 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
198
231
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
199
232
|
readonly title: Schema.String;
|
|
200
233
|
readonly description: Schema.String;
|
|
201
|
-
readonly sortKey: Schema.String;
|
|
202
234
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
203
235
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
204
236
|
readonly text: Schema.String;
|
|
@@ -214,7 +246,6 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
214
246
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
215
247
|
readonly title: Schema.String;
|
|
216
248
|
readonly description: Schema.String;
|
|
217
|
-
readonly sortKey: Schema.String;
|
|
218
249
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
219
250
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
220
251
|
readonly text: Schema.String;
|
|
@@ -230,7 +261,6 @@ export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.S
|
|
|
230
261
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
231
262
|
readonly title: Schema.String;
|
|
232
263
|
readonly description: Schema.String;
|
|
233
|
-
readonly sortKey: Schema.String;
|
|
234
264
|
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
235
265
|
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
236
266
|
readonly text: Schema.String;
|
package/dist/goals.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
import { AreaId, Description, GoalId, NotFound, OutcomeId, PlacementRefused, StorageError, Title, } from "./shared.js";
|
|
3
|
+
import { AreaId, Description, GoalId, GoalPosition, NotFound, OutcomeId, OutcomePosition, PlacementRefused, StorageError, Title, } from "./shared.js";
|
|
4
4
|
export const Outcome = Schema.Struct({
|
|
5
5
|
id: OutcomeId,
|
|
6
6
|
text: Schema.String,
|
|
@@ -12,7 +12,6 @@ export const Goal = Schema.Struct({
|
|
|
12
12
|
areaId: AreaId,
|
|
13
13
|
title: Schema.String,
|
|
14
14
|
description: Schema.String,
|
|
15
|
-
sortKey: Schema.String,
|
|
16
15
|
outcomes: Outcomes,
|
|
17
16
|
createdAt: Schema.String,
|
|
18
17
|
updatedAt: Schema.String,
|
|
@@ -22,7 +21,7 @@ export const GoalCreate = Schema.Struct({
|
|
|
22
21
|
areaId: AreaId,
|
|
23
22
|
title: Title,
|
|
24
23
|
description: Schema.optionalKey(Description),
|
|
25
|
-
|
|
24
|
+
position: Schema.optionalKey(GoalPosition),
|
|
26
25
|
outcomes: Schema.optionalKey(Schema.Array(Title)),
|
|
27
26
|
});
|
|
28
27
|
export const GoalUpdate = Schema.Struct({
|
|
@@ -30,7 +29,7 @@ export const GoalUpdate = Schema.Struct({
|
|
|
30
29
|
title: Schema.optionalKey(Title),
|
|
31
30
|
description: Schema.optionalKey(Description),
|
|
32
31
|
areaId: Schema.optionalKey(AreaId),
|
|
33
|
-
|
|
32
|
+
position: Schema.optionalKey(GoalPosition),
|
|
34
33
|
});
|
|
35
34
|
export const GoalList = Schema.Struct({
|
|
36
35
|
areaId: Schema.optionalKey(AreaId),
|
|
@@ -40,14 +39,14 @@ export const GoalRef = Schema.Struct({ id: GoalId });
|
|
|
40
39
|
export const OutcomeAdd = Schema.Struct({
|
|
41
40
|
id: GoalId,
|
|
42
41
|
text: Title,
|
|
43
|
-
|
|
42
|
+
position: Schema.optionalKey(OutcomePosition),
|
|
44
43
|
});
|
|
45
44
|
export const OutcomeUpdate = Schema.Struct({
|
|
46
45
|
id: GoalId,
|
|
47
46
|
outcomeId: OutcomeId,
|
|
48
47
|
text: Schema.optionalKey(Title),
|
|
49
48
|
achieved: Schema.optionalKey(Schema.Boolean),
|
|
50
|
-
|
|
49
|
+
position: Schema.optionalKey(OutcomePosition),
|
|
51
50
|
});
|
|
52
51
|
export const OutcomeRef = Schema.Struct({ id: GoalId, outcomeId: OutcomeId });
|
|
53
52
|
export const GoalActions = [
|
|
@@ -70,7 +69,7 @@ export const GoalActions = [
|
|
|
70
69
|
Action.make("goals_create", {
|
|
71
70
|
caller: Action.Anyone,
|
|
72
71
|
error: [PlacementRefused, StorageError],
|
|
73
|
-
description: "Create a goal in an area
|
|
72
|
+
description: "Create a goal in an area at a position among that area's goals, with a Markdown description and initial outcomes, each unachieved. Omitted position appends it at the End.",
|
|
74
73
|
readOnly: false,
|
|
75
74
|
input: GoalCreate,
|
|
76
75
|
success: Goal,
|
|
@@ -78,7 +77,7 @@ export const GoalActions = [
|
|
|
78
77
|
Action.make("goals_update", {
|
|
79
78
|
caller: Action.Anyone,
|
|
80
79
|
error: [NotFound, PlacementRefused, StorageError],
|
|
81
|
-
description: "Update a goal's title, Markdown description, area, or
|
|
80
|
+
description: "Update a goal's title, Markdown description, area, or position atomically. Outcomes change only through the outcome actions. Omitted position keeps its place within the same area, and appends it at the End when areaId moves it to another area.",
|
|
82
81
|
readOnly: false,
|
|
83
82
|
input: GoalUpdate,
|
|
84
83
|
success: Goal,
|
|
@@ -86,7 +85,7 @@ export const GoalActions = [
|
|
|
86
85
|
Action.make("goals_add_outcome", {
|
|
87
86
|
caller: Action.Anyone,
|
|
88
87
|
error: [NotFound, PlacementRefused, StorageError],
|
|
89
|
-
description: "Add an unachieved outcome to a goal
|
|
88
|
+
description: "Add an unachieved outcome to a goal at a position among its outcomes. Omitted position appends it at the End.",
|
|
90
89
|
readOnly: false,
|
|
91
90
|
input: OutcomeAdd,
|
|
92
91
|
success: Goal,
|
|
@@ -94,7 +93,7 @@ export const GoalActions = [
|
|
|
94
93
|
Action.make("goals_update_outcome", {
|
|
95
94
|
caller: Action.Anyone,
|
|
96
95
|
error: [NotFound, PlacementRefused, StorageError],
|
|
97
|
-
description: "Change one outcome's text, mark it achieved or not, or move it
|
|
96
|
+
description: "Change one outcome's text, mark it achieved or not, or move it to a position among the goal's outcomes, leaving every other outcome as it is. Omitted position keeps its place.",
|
|
98
97
|
readOnly: false,
|
|
99
98
|
input: OutcomeUpdate,
|
|
100
99
|
success: Goal,
|