@gjermundgaraba/wtf-api 0.10.1 → 0.11.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.js +1 -1
- package/dist/goals.d.ts +246 -0
- package/dist/goals.js +134 -0
- package/dist/index.d.ts +361 -2
- package/dist/index.js +3 -0
- package/dist/shared.d.ts +5 -1
- package/dist/shared.js +6 -1
- package/dist/tasks.d.ts +21 -1
- package/dist/tasks.js +9 -5
- package/package.json +2 -2
package/dist/areas.js
CHANGED
|
@@ -56,7 +56,7 @@ export const AreaActions = [
|
|
|
56
56
|
Action.make("areas_remove", {
|
|
57
57
|
caller: Action.Anyone,
|
|
58
58
|
error: [NotFound, StorageError],
|
|
59
|
-
description: "Permanently delete an area
|
|
59
|
+
description: "Permanently delete an area with all its tasks and goals.",
|
|
60
60
|
readOnly: false,
|
|
61
61
|
input: AreaRef,
|
|
62
62
|
success: AreaRef,
|
package/dist/goals.d.ts
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { NotFound, PlacementRefused, StorageError } from "./shared.ts";
|
|
4
|
+
export declare const Outcome: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
6
|
+
readonly text: Schema.String;
|
|
7
|
+
readonly achieved: Schema.Boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export type Outcome = typeof Outcome.Type;
|
|
10
|
+
export declare const Outcomes: Schema.$Array<Schema.Struct<{
|
|
11
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
12
|
+
readonly text: Schema.String;
|
|
13
|
+
readonly achieved: Schema.Boolean;
|
|
14
|
+
}>>;
|
|
15
|
+
export declare const Goal: Schema.Struct<{
|
|
16
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
17
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
18
|
+
readonly title: Schema.String;
|
|
19
|
+
readonly description: Schema.String;
|
|
20
|
+
readonly sortKey: Schema.String;
|
|
21
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
22
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
23
|
+
readonly text: Schema.String;
|
|
24
|
+
readonly achieved: Schema.Boolean;
|
|
25
|
+
}>>;
|
|
26
|
+
readonly createdAt: Schema.String;
|
|
27
|
+
readonly updatedAt: Schema.String;
|
|
28
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
29
|
+
}>;
|
|
30
|
+
export type Goal = typeof Goal.Type;
|
|
31
|
+
export declare const GoalCreate: Schema.Struct<{
|
|
32
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
33
|
+
readonly title: Schema.String;
|
|
34
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
35
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "GoalId">>>;
|
|
36
|
+
readonly outcomes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
37
|
+
}>;
|
|
38
|
+
export interface GoalCreate extends Schema.Schema.Type<typeof GoalCreate> {
|
|
39
|
+
}
|
|
40
|
+
export declare const GoalUpdate: Schema.Struct<{
|
|
41
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
42
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
43
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
44
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
45
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "GoalId">>>;
|
|
46
|
+
}>;
|
|
47
|
+
export interface GoalUpdate extends Schema.Schema.Type<typeof GoalUpdate> {
|
|
48
|
+
}
|
|
49
|
+
export declare const GoalList: Schema.Struct<{
|
|
50
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
51
|
+
readonly archived: Schema.optionalKey<Schema.Boolean>;
|
|
52
|
+
}>;
|
|
53
|
+
export interface GoalList extends Schema.Schema.Type<typeof GoalList> {
|
|
54
|
+
}
|
|
55
|
+
export declare const GoalRef: Schema.Struct<{
|
|
56
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
57
|
+
}>;
|
|
58
|
+
export interface GoalRef extends Schema.Schema.Type<typeof GoalRef> {
|
|
59
|
+
}
|
|
60
|
+
export declare const OutcomeAdd: Schema.Struct<{
|
|
61
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
62
|
+
readonly text: Schema.String;
|
|
63
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "OutcomeId">>>;
|
|
64
|
+
}>;
|
|
65
|
+
export interface OutcomeAdd extends Schema.Schema.Type<typeof OutcomeAdd> {
|
|
66
|
+
}
|
|
67
|
+
export declare const OutcomeUpdate: Schema.Struct<{
|
|
68
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
69
|
+
readonly outcomeId: Schema.brand<Schema.String, "OutcomeId">;
|
|
70
|
+
readonly text: Schema.optionalKey<Schema.String>;
|
|
71
|
+
readonly achieved: Schema.optionalKey<Schema.Boolean>;
|
|
72
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "OutcomeId">>>;
|
|
73
|
+
}>;
|
|
74
|
+
export interface OutcomeUpdate extends Schema.Schema.Type<typeof OutcomeUpdate> {
|
|
75
|
+
}
|
|
76
|
+
export declare const OutcomeRef: Schema.Struct<{
|
|
77
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
78
|
+
readonly outcomeId: Schema.brand<Schema.String, "OutcomeId">;
|
|
79
|
+
}>;
|
|
80
|
+
export interface OutcomeRef extends Schema.Schema.Type<typeof OutcomeRef> {
|
|
81
|
+
}
|
|
82
|
+
export declare const GoalActions: readonly [Action.Action<"goals_list", Schema.Struct<{
|
|
83
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
84
|
+
readonly archived: Schema.optionalKey<Schema.Boolean>;
|
|
85
|
+
}>, Schema.$Array<Schema.Struct<{
|
|
86
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
87
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
88
|
+
readonly title: Schema.String;
|
|
89
|
+
readonly description: Schema.String;
|
|
90
|
+
readonly sortKey: Schema.String;
|
|
91
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
92
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
93
|
+
readonly text: Schema.String;
|
|
94
|
+
readonly achieved: Schema.Boolean;
|
|
95
|
+
}>>;
|
|
96
|
+
readonly createdAt: Schema.String;
|
|
97
|
+
readonly updatedAt: Schema.String;
|
|
98
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
99
|
+
}>>, readonly (typeof StorageError)[], true, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_get", Schema.Struct<{
|
|
100
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
101
|
+
}>, Schema.Struct<{
|
|
102
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
103
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
104
|
+
readonly title: Schema.String;
|
|
105
|
+
readonly description: Schema.String;
|
|
106
|
+
readonly sortKey: Schema.String;
|
|
107
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
108
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
109
|
+
readonly text: Schema.String;
|
|
110
|
+
readonly achieved: Schema.Boolean;
|
|
111
|
+
}>>;
|
|
112
|
+
readonly createdAt: Schema.String;
|
|
113
|
+
readonly updatedAt: Schema.String;
|
|
114
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
115
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], true, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_create", Schema.Struct<{
|
|
116
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
117
|
+
readonly title: Schema.String;
|
|
118
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
119
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "GoalId">>>;
|
|
120
|
+
readonly outcomes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
121
|
+
}>, Schema.Struct<{
|
|
122
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
123
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
124
|
+
readonly title: Schema.String;
|
|
125
|
+
readonly description: Schema.String;
|
|
126
|
+
readonly sortKey: Schema.String;
|
|
127
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
128
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
129
|
+
readonly text: Schema.String;
|
|
130
|
+
readonly achieved: Schema.Boolean;
|
|
131
|
+
}>>;
|
|
132
|
+
readonly createdAt: Schema.String;
|
|
133
|
+
readonly updatedAt: Schema.String;
|
|
134
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
135
|
+
}>, readonly (typeof PlacementRefused | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_update", Schema.Struct<{
|
|
136
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
137
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
138
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
139
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
140
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "GoalId">>>;
|
|
141
|
+
}>, Schema.Struct<{
|
|
142
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
143
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
144
|
+
readonly title: Schema.String;
|
|
145
|
+
readonly description: Schema.String;
|
|
146
|
+
readonly sortKey: Schema.String;
|
|
147
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
148
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
149
|
+
readonly text: Schema.String;
|
|
150
|
+
readonly achieved: Schema.Boolean;
|
|
151
|
+
}>>;
|
|
152
|
+
readonly createdAt: Schema.String;
|
|
153
|
+
readonly updatedAt: Schema.String;
|
|
154
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
155
|
+
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_add_outcome", Schema.Struct<{
|
|
156
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
157
|
+
readonly text: Schema.String;
|
|
158
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "OutcomeId">>>;
|
|
159
|
+
}>, Schema.Struct<{
|
|
160
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
161
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
162
|
+
readonly title: Schema.String;
|
|
163
|
+
readonly description: Schema.String;
|
|
164
|
+
readonly sortKey: Schema.String;
|
|
165
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
166
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
167
|
+
readonly text: Schema.String;
|
|
168
|
+
readonly achieved: Schema.Boolean;
|
|
169
|
+
}>>;
|
|
170
|
+
readonly createdAt: Schema.String;
|
|
171
|
+
readonly updatedAt: Schema.String;
|
|
172
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
173
|
+
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_update_outcome", Schema.Struct<{
|
|
174
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
175
|
+
readonly outcomeId: Schema.brand<Schema.String, "OutcomeId">;
|
|
176
|
+
readonly text: Schema.optionalKey<Schema.String>;
|
|
177
|
+
readonly achieved: Schema.optionalKey<Schema.Boolean>;
|
|
178
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "OutcomeId">>>;
|
|
179
|
+
}>, Schema.Struct<{
|
|
180
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
181
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
182
|
+
readonly title: Schema.String;
|
|
183
|
+
readonly description: Schema.String;
|
|
184
|
+
readonly sortKey: Schema.String;
|
|
185
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
186
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
187
|
+
readonly text: Schema.String;
|
|
188
|
+
readonly achieved: Schema.Boolean;
|
|
189
|
+
}>>;
|
|
190
|
+
readonly createdAt: Schema.String;
|
|
191
|
+
readonly updatedAt: Schema.String;
|
|
192
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
193
|
+
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_remove_outcome", Schema.Struct<{
|
|
194
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
195
|
+
readonly outcomeId: Schema.brand<Schema.String, "OutcomeId">;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
198
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
199
|
+
readonly title: Schema.String;
|
|
200
|
+
readonly description: Schema.String;
|
|
201
|
+
readonly sortKey: Schema.String;
|
|
202
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
203
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
204
|
+
readonly text: Schema.String;
|
|
205
|
+
readonly achieved: Schema.Boolean;
|
|
206
|
+
}>>;
|
|
207
|
+
readonly createdAt: Schema.String;
|
|
208
|
+
readonly updatedAt: Schema.String;
|
|
209
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
210
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_archive", Schema.Struct<{
|
|
211
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
212
|
+
}>, Schema.Struct<{
|
|
213
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
214
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
215
|
+
readonly title: Schema.String;
|
|
216
|
+
readonly description: Schema.String;
|
|
217
|
+
readonly sortKey: Schema.String;
|
|
218
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
219
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
220
|
+
readonly text: Schema.String;
|
|
221
|
+
readonly achieved: Schema.Boolean;
|
|
222
|
+
}>>;
|
|
223
|
+
readonly createdAt: Schema.String;
|
|
224
|
+
readonly updatedAt: Schema.String;
|
|
225
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
226
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_unarchive", Schema.Struct<{
|
|
227
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
228
|
+
}>, Schema.Struct<{
|
|
229
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
230
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
231
|
+
readonly title: Schema.String;
|
|
232
|
+
readonly description: Schema.String;
|
|
233
|
+
readonly sortKey: Schema.String;
|
|
234
|
+
readonly outcomes: Schema.$Array<Schema.Struct<{
|
|
235
|
+
readonly id: Schema.brand<Schema.String, "OutcomeId">;
|
|
236
|
+
readonly text: Schema.String;
|
|
237
|
+
readonly achieved: Schema.Boolean;
|
|
238
|
+
}>>;
|
|
239
|
+
readonly createdAt: Schema.String;
|
|
240
|
+
readonly updatedAt: Schema.String;
|
|
241
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
242
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"goals_remove", Schema.Struct<{
|
|
243
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
244
|
+
}>, Schema.Struct<{
|
|
245
|
+
readonly id: Schema.brand<Schema.String, "GoalId">;
|
|
246
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>];
|
package/dist/goals.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { AreaId, Description, GoalId, NotFound, OutcomeId, PlacementRefused, StorageError, Title, } from "./shared.js";
|
|
4
|
+
export const Outcome = Schema.Struct({
|
|
5
|
+
id: OutcomeId,
|
|
6
|
+
text: Schema.String,
|
|
7
|
+
achieved: Schema.Boolean,
|
|
8
|
+
});
|
|
9
|
+
export const Outcomes = Schema.Array(Outcome).check(Schema.makeFilter((outcomes) => new Set(outcomes.map((outcome) => outcome.id)).size === outcomes.length, { expected: "outcomes with distinct ids" }));
|
|
10
|
+
export const Goal = Schema.Struct({
|
|
11
|
+
id: GoalId,
|
|
12
|
+
areaId: AreaId,
|
|
13
|
+
title: Schema.String,
|
|
14
|
+
description: Schema.String,
|
|
15
|
+
sortKey: Schema.String,
|
|
16
|
+
outcomes: Outcomes,
|
|
17
|
+
createdAt: Schema.String,
|
|
18
|
+
updatedAt: Schema.String,
|
|
19
|
+
archivedAt: Schema.NullOr(Schema.String),
|
|
20
|
+
});
|
|
21
|
+
export const GoalCreate = Schema.Struct({
|
|
22
|
+
areaId: AreaId,
|
|
23
|
+
title: Title,
|
|
24
|
+
description: Schema.optionalKey(Description),
|
|
25
|
+
beforeId: Schema.optionalKey(Schema.NullOr(GoalId)),
|
|
26
|
+
outcomes: Schema.optionalKey(Schema.Array(Title)),
|
|
27
|
+
});
|
|
28
|
+
export const GoalUpdate = Schema.Struct({
|
|
29
|
+
id: GoalId,
|
|
30
|
+
title: Schema.optionalKey(Title),
|
|
31
|
+
description: Schema.optionalKey(Description),
|
|
32
|
+
areaId: Schema.optionalKey(AreaId),
|
|
33
|
+
beforeId: Schema.optionalKey(Schema.NullOr(GoalId)),
|
|
34
|
+
});
|
|
35
|
+
export const GoalList = Schema.Struct({
|
|
36
|
+
areaId: Schema.optionalKey(AreaId),
|
|
37
|
+
archived: Schema.optionalKey(Schema.Boolean),
|
|
38
|
+
});
|
|
39
|
+
export const GoalRef = Schema.Struct({ id: GoalId });
|
|
40
|
+
export const OutcomeAdd = Schema.Struct({
|
|
41
|
+
id: GoalId,
|
|
42
|
+
text: Title,
|
|
43
|
+
beforeId: Schema.optionalKey(Schema.NullOr(OutcomeId)),
|
|
44
|
+
});
|
|
45
|
+
export const OutcomeUpdate = Schema.Struct({
|
|
46
|
+
id: GoalId,
|
|
47
|
+
outcomeId: OutcomeId,
|
|
48
|
+
text: Schema.optionalKey(Title),
|
|
49
|
+
achieved: Schema.optionalKey(Schema.Boolean),
|
|
50
|
+
beforeId: Schema.optionalKey(Schema.NullOr(OutcomeId)),
|
|
51
|
+
});
|
|
52
|
+
export const OutcomeRef = Schema.Struct({ id: GoalId, outcomeId: OutcomeId });
|
|
53
|
+
export const GoalActions = [
|
|
54
|
+
Action.make("goals_list", {
|
|
55
|
+
caller: Action.Anyone,
|
|
56
|
+
error: [StorageError],
|
|
57
|
+
description: "List goals in area order, then manual order within each area, optionally in one area. Archived goals are left out unless archived is true, which lists only archived goals.",
|
|
58
|
+
readOnly: true,
|
|
59
|
+
input: GoalList,
|
|
60
|
+
success: Schema.Array(Goal),
|
|
61
|
+
}),
|
|
62
|
+
Action.make("goals_get", {
|
|
63
|
+
caller: Action.Anyone,
|
|
64
|
+
error: [NotFound, StorageError],
|
|
65
|
+
description: "Read a goal, including an archived one, whose archivedAt is set.",
|
|
66
|
+
readOnly: true,
|
|
67
|
+
input: GoalRef,
|
|
68
|
+
success: Goal,
|
|
69
|
+
}),
|
|
70
|
+
Action.make("goals_create", {
|
|
71
|
+
caller: Action.Anyone,
|
|
72
|
+
error: [PlacementRefused, StorageError],
|
|
73
|
+
description: "Create a goal in an area before another goal of that area, with a Markdown description and initial outcomes, each unachieved. Omitted or null beforeId appends.",
|
|
74
|
+
readOnly: false,
|
|
75
|
+
input: GoalCreate,
|
|
76
|
+
success: Goal,
|
|
77
|
+
}),
|
|
78
|
+
Action.make("goals_update", {
|
|
79
|
+
caller: Action.Anyone,
|
|
80
|
+
error: [NotFound, PlacementRefused, StorageError],
|
|
81
|
+
description: "Update a goal's title, Markdown description, area, or order atomically. Outcomes change only through the outcome actions. Omitted beforeId preserves order within the same area and appends when moving to another area; null appends.",
|
|
82
|
+
readOnly: false,
|
|
83
|
+
input: GoalUpdate,
|
|
84
|
+
success: Goal,
|
|
85
|
+
}),
|
|
86
|
+
Action.make("goals_add_outcome", {
|
|
87
|
+
caller: Action.Anyone,
|
|
88
|
+
error: [NotFound, PlacementRefused, StorageError],
|
|
89
|
+
description: "Add an unachieved outcome to a goal before another of its outcomes. Omitted or null beforeId appends.",
|
|
90
|
+
readOnly: false,
|
|
91
|
+
input: OutcomeAdd,
|
|
92
|
+
success: Goal,
|
|
93
|
+
}),
|
|
94
|
+
Action.make("goals_update_outcome", {
|
|
95
|
+
caller: Action.Anyone,
|
|
96
|
+
error: [NotFound, PlacementRefused, StorageError],
|
|
97
|
+
description: "Change one outcome's text, mark it achieved or not, or move it before another outcome, leaving every other outcome as it is. Omitted beforeId preserves its position; null moves it to the end.",
|
|
98
|
+
readOnly: false,
|
|
99
|
+
input: OutcomeUpdate,
|
|
100
|
+
success: Goal,
|
|
101
|
+
}),
|
|
102
|
+
Action.make("goals_remove_outcome", {
|
|
103
|
+
caller: Action.Anyone,
|
|
104
|
+
error: [NotFound, StorageError],
|
|
105
|
+
description: "Remove one outcome from a goal.",
|
|
106
|
+
readOnly: false,
|
|
107
|
+
input: OutcomeRef,
|
|
108
|
+
success: Goal,
|
|
109
|
+
}),
|
|
110
|
+
Action.make("goals_archive", {
|
|
111
|
+
caller: Action.Anyone,
|
|
112
|
+
error: [NotFound, StorageError],
|
|
113
|
+
description: "Archive a goal, hiding it from goals_list unless archived is true. Task links to it stay. A goal already archived keeps its archivedAt.",
|
|
114
|
+
readOnly: false,
|
|
115
|
+
input: GoalRef,
|
|
116
|
+
success: Goal,
|
|
117
|
+
}),
|
|
118
|
+
Action.make("goals_unarchive", {
|
|
119
|
+
caller: Action.Anyone,
|
|
120
|
+
error: [NotFound, StorageError],
|
|
121
|
+
description: "Clear a goal's archivedAt.",
|
|
122
|
+
readOnly: false,
|
|
123
|
+
input: GoalRef,
|
|
124
|
+
success: Goal,
|
|
125
|
+
}),
|
|
126
|
+
Action.make("goals_remove", {
|
|
127
|
+
caller: Action.Anyone,
|
|
128
|
+
error: [NotFound, StorageError],
|
|
129
|
+
description: "Permanently delete a goal and its outcomes, unlinking every task from it. The tasks stay.",
|
|
130
|
+
readOnly: false,
|
|
131
|
+
input: GoalRef,
|
|
132
|
+
success: GoalRef,
|
|
133
|
+
}),
|
|
134
|
+
];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
|
|
2
2
|
export * from "./shared.ts";
|
|
3
3
|
export * from "./areas.ts";
|
|
4
|
+
export * from "./goals.ts";
|
|
4
5
|
export * from "./tasks.ts";
|
|
5
6
|
export * from "./values.ts";
|
|
6
7
|
export { InvalidInput } from "@gjermundgaraba/effect-actions/Action";
|
|
@@ -47,11 +48,176 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
47
48
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
48
49
|
}>, import("effect/Schema").Struct<{
|
|
49
50
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
51
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_list", import("effect/Schema").Struct<{
|
|
52
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
53
|
+
readonly archived: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
54
|
+
}>, import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
55
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
56
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
57
|
+
readonly title: import("effect/Schema").String;
|
|
58
|
+
readonly description: import("effect/Schema").String;
|
|
59
|
+
readonly sortKey: import("effect/Schema").String;
|
|
60
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
61
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
62
|
+
readonly text: import("effect/Schema").String;
|
|
63
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
64
|
+
}>>;
|
|
65
|
+
readonly createdAt: import("effect/Schema").String;
|
|
66
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
67
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
68
|
+
}>>, readonly typeof import("./shared.ts").StorageError[], true, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_get", import("effect/Schema").Struct<{
|
|
69
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
70
|
+
}>, import("effect/Schema").Struct<{
|
|
71
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
72
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
73
|
+
readonly title: import("effect/Schema").String;
|
|
74
|
+
readonly description: import("effect/Schema").String;
|
|
75
|
+
readonly sortKey: import("effect/Schema").String;
|
|
76
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
77
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
78
|
+
readonly text: import("effect/Schema").String;
|
|
79
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
80
|
+
}>>;
|
|
81
|
+
readonly createdAt: import("effect/Schema").String;
|
|
82
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
83
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
84
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], true, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_create", import("effect/Schema").Struct<{
|
|
85
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
86
|
+
readonly title: import("effect/Schema").String;
|
|
87
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
88
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>>;
|
|
89
|
+
readonly outcomes: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
90
|
+
}>, import("effect/Schema").Struct<{
|
|
91
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
92
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
93
|
+
readonly title: import("effect/Schema").String;
|
|
94
|
+
readonly description: import("effect/Schema").String;
|
|
95
|
+
readonly sortKey: import("effect/Schema").String;
|
|
96
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
97
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
98
|
+
readonly text: import("effect/Schema").String;
|
|
99
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
100
|
+
}>>;
|
|
101
|
+
readonly createdAt: import("effect/Schema").String;
|
|
102
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
103
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
104
|
+
}>, readonly (typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_update", import("effect/Schema").Struct<{
|
|
105
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
106
|
+
readonly title: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
107
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
108
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
109
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>>;
|
|
110
|
+
}>, import("effect/Schema").Struct<{
|
|
111
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
112
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
113
|
+
readonly title: import("effect/Schema").String;
|
|
114
|
+
readonly description: import("effect/Schema").String;
|
|
115
|
+
readonly sortKey: import("effect/Schema").String;
|
|
116
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
117
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
118
|
+
readonly text: import("effect/Schema").String;
|
|
119
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
120
|
+
}>>;
|
|
121
|
+
readonly createdAt: import("effect/Schema").String;
|
|
122
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
123
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
124
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_add_outcome", import("effect/Schema").Struct<{
|
|
125
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
126
|
+
readonly text: import("effect/Schema").String;
|
|
127
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">>>;
|
|
128
|
+
}>, import("effect/Schema").Struct<{
|
|
129
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
130
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
131
|
+
readonly title: import("effect/Schema").String;
|
|
132
|
+
readonly description: import("effect/Schema").String;
|
|
133
|
+
readonly sortKey: import("effect/Schema").String;
|
|
134
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
135
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
136
|
+
readonly text: import("effect/Schema").String;
|
|
137
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
138
|
+
}>>;
|
|
139
|
+
readonly createdAt: import("effect/Schema").String;
|
|
140
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
141
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
142
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_update_outcome", import("effect/Schema").Struct<{
|
|
143
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
144
|
+
readonly outcomeId: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
145
|
+
readonly text: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
146
|
+
readonly achieved: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
147
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">>>;
|
|
148
|
+
}>, import("effect/Schema").Struct<{
|
|
149
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
150
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
151
|
+
readonly title: import("effect/Schema").String;
|
|
152
|
+
readonly description: import("effect/Schema").String;
|
|
153
|
+
readonly sortKey: import("effect/Schema").String;
|
|
154
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
155
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
156
|
+
readonly text: import("effect/Schema").String;
|
|
157
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
158
|
+
}>>;
|
|
159
|
+
readonly createdAt: import("effect/Schema").String;
|
|
160
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
161
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
162
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_remove_outcome", import("effect/Schema").Struct<{
|
|
163
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
164
|
+
readonly outcomeId: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
165
|
+
}>, import("effect/Schema").Struct<{
|
|
166
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
167
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
168
|
+
readonly title: import("effect/Schema").String;
|
|
169
|
+
readonly description: import("effect/Schema").String;
|
|
170
|
+
readonly sortKey: import("effect/Schema").String;
|
|
171
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
172
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
173
|
+
readonly text: import("effect/Schema").String;
|
|
174
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
175
|
+
}>>;
|
|
176
|
+
readonly createdAt: import("effect/Schema").String;
|
|
177
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
178
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
179
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_archive", import("effect/Schema").Struct<{
|
|
180
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
181
|
+
}>, import("effect/Schema").Struct<{
|
|
182
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
183
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
184
|
+
readonly title: import("effect/Schema").String;
|
|
185
|
+
readonly description: import("effect/Schema").String;
|
|
186
|
+
readonly sortKey: import("effect/Schema").String;
|
|
187
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
188
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
189
|
+
readonly text: import("effect/Schema").String;
|
|
190
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
191
|
+
}>>;
|
|
192
|
+
readonly createdAt: import("effect/Schema").String;
|
|
193
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
194
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
195
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_unarchive", import("effect/Schema").Struct<{
|
|
196
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
197
|
+
}>, import("effect/Schema").Struct<{
|
|
198
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
199
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
200
|
+
readonly title: import("effect/Schema").String;
|
|
201
|
+
readonly description: import("effect/Schema").String;
|
|
202
|
+
readonly sortKey: import("effect/Schema").String;
|
|
203
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
204
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
205
|
+
readonly text: import("effect/Schema").String;
|
|
206
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
207
|
+
}>>;
|
|
208
|
+
readonly createdAt: import("effect/Schema").String;
|
|
209
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
210
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
211
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_remove", import("effect/Schema").Struct<{
|
|
212
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
213
|
+
}>, import("effect/Schema").Struct<{
|
|
214
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
50
215
|
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_list", import("effect/Schema").Struct<{
|
|
51
216
|
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
52
217
|
readonly statuses: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>>;
|
|
53
218
|
readonly focus: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
54
219
|
readonly archived: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
220
|
+
readonly goalId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
55
221
|
}>, import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
56
222
|
readonly title: import("effect/Schema").String;
|
|
57
223
|
readonly description: import("effect/Schema").String;
|
|
@@ -63,6 +229,8 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
63
229
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
64
230
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
65
231
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
232
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
233
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
66
234
|
readonly sortKey: import("effect/Schema").String;
|
|
67
235
|
readonly createdAt: import("effect/Schema").String;
|
|
68
236
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -80,6 +248,8 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
80
248
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
81
249
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
82
250
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
251
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
252
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
83
253
|
readonly sortKey: import("effect/Schema").String;
|
|
84
254
|
readonly createdAt: import("effect/Schema").String;
|
|
85
255
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -94,6 +264,7 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
94
264
|
readonly wakeOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
95
265
|
readonly dueOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
96
266
|
readonly owedTo: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
267
|
+
readonly goalIds: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>>;
|
|
97
268
|
readonly title: import("effect/Schema").String;
|
|
98
269
|
}>, import("effect/Schema").Struct<{
|
|
99
270
|
readonly title: import("effect/Schema").String;
|
|
@@ -106,11 +277,13 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
106
277
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
107
278
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
108
279
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
280
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
281
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
109
282
|
readonly sortKey: import("effect/Schema").String;
|
|
110
283
|
readonly createdAt: import("effect/Schema").String;
|
|
111
284
|
readonly updatedAt: import("effect/Schema").String;
|
|
112
285
|
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
113
|
-
}>, readonly (typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").NoArea | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_update", import("effect/Schema").Struct<{
|
|
286
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").NoArea | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_update", import("effect/Schema").Struct<{
|
|
114
287
|
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
115
288
|
readonly parentTaskId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
116
289
|
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
@@ -121,6 +294,7 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
121
294
|
readonly wakeOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
122
295
|
readonly dueOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
123
296
|
readonly owedTo: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
297
|
+
readonly goalIds: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>>;
|
|
124
298
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
125
299
|
}>, import("effect/Schema").Struct<{
|
|
126
300
|
readonly title: import("effect/Schema").String;
|
|
@@ -133,6 +307,8 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
133
307
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
134
308
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
135
309
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
310
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
311
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
136
312
|
readonly sortKey: import("effect/Schema").String;
|
|
137
313
|
readonly createdAt: import("effect/Schema").String;
|
|
138
314
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -150,6 +326,8 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
150
326
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
151
327
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
152
328
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
329
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
330
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
153
331
|
readonly sortKey: import("effect/Schema").String;
|
|
154
332
|
readonly createdAt: import("effect/Schema").String;
|
|
155
333
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -167,6 +345,8 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
|
|
|
167
345
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
168
346
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
169
347
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
348
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
349
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
170
350
|
readonly sortKey: import("effect/Schema").String;
|
|
171
351
|
readonly createdAt: import("effect/Schema").String;
|
|
172
352
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -225,11 +405,176 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
225
405
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
226
406
|
}>, import("effect/Schema").Struct<{
|
|
227
407
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
408
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_list", import("effect/Schema").Struct<{
|
|
409
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
410
|
+
readonly archived: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
411
|
+
}>, import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
412
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
413
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
414
|
+
readonly title: import("effect/Schema").String;
|
|
415
|
+
readonly description: import("effect/Schema").String;
|
|
416
|
+
readonly sortKey: import("effect/Schema").String;
|
|
417
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
418
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
419
|
+
readonly text: import("effect/Schema").String;
|
|
420
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
421
|
+
}>>;
|
|
422
|
+
readonly createdAt: import("effect/Schema").String;
|
|
423
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
424
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
425
|
+
}>>, readonly typeof import("./shared.ts").StorageError[], true, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_get", import("effect/Schema").Struct<{
|
|
426
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
427
|
+
}>, import("effect/Schema").Struct<{
|
|
428
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
429
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
430
|
+
readonly title: import("effect/Schema").String;
|
|
431
|
+
readonly description: import("effect/Schema").String;
|
|
432
|
+
readonly sortKey: import("effect/Schema").String;
|
|
433
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
434
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
435
|
+
readonly text: import("effect/Schema").String;
|
|
436
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
437
|
+
}>>;
|
|
438
|
+
readonly createdAt: import("effect/Schema").String;
|
|
439
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
440
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
441
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], true, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_create", import("effect/Schema").Struct<{
|
|
442
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
443
|
+
readonly title: import("effect/Schema").String;
|
|
444
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
445
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>>;
|
|
446
|
+
readonly outcomes: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
447
|
+
}>, import("effect/Schema").Struct<{
|
|
448
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
449
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
450
|
+
readonly title: import("effect/Schema").String;
|
|
451
|
+
readonly description: import("effect/Schema").String;
|
|
452
|
+
readonly sortKey: import("effect/Schema").String;
|
|
453
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
454
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
455
|
+
readonly text: import("effect/Schema").String;
|
|
456
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
457
|
+
}>>;
|
|
458
|
+
readonly createdAt: import("effect/Schema").String;
|
|
459
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
460
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
461
|
+
}>, readonly (typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_update", import("effect/Schema").Struct<{
|
|
462
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
463
|
+
readonly title: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
464
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
465
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
466
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>>;
|
|
467
|
+
}>, import("effect/Schema").Struct<{
|
|
468
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
469
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
470
|
+
readonly title: import("effect/Schema").String;
|
|
471
|
+
readonly description: import("effect/Schema").String;
|
|
472
|
+
readonly sortKey: import("effect/Schema").String;
|
|
473
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
474
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
475
|
+
readonly text: import("effect/Schema").String;
|
|
476
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
477
|
+
}>>;
|
|
478
|
+
readonly createdAt: import("effect/Schema").String;
|
|
479
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
480
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
481
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_add_outcome", import("effect/Schema").Struct<{
|
|
482
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
483
|
+
readonly text: import("effect/Schema").String;
|
|
484
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">>>;
|
|
485
|
+
}>, import("effect/Schema").Struct<{
|
|
486
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
487
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
488
|
+
readonly title: import("effect/Schema").String;
|
|
489
|
+
readonly description: import("effect/Schema").String;
|
|
490
|
+
readonly sortKey: import("effect/Schema").String;
|
|
491
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
492
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
493
|
+
readonly text: import("effect/Schema").String;
|
|
494
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
495
|
+
}>>;
|
|
496
|
+
readonly createdAt: import("effect/Schema").String;
|
|
497
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
498
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
499
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_update_outcome", import("effect/Schema").Struct<{
|
|
500
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
501
|
+
readonly outcomeId: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
502
|
+
readonly text: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
503
|
+
readonly achieved: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
504
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">>>;
|
|
505
|
+
}>, import("effect/Schema").Struct<{
|
|
506
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
507
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
508
|
+
readonly title: import("effect/Schema").String;
|
|
509
|
+
readonly description: import("effect/Schema").String;
|
|
510
|
+
readonly sortKey: import("effect/Schema").String;
|
|
511
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
512
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
513
|
+
readonly text: import("effect/Schema").String;
|
|
514
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
515
|
+
}>>;
|
|
516
|
+
readonly createdAt: import("effect/Schema").String;
|
|
517
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
518
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
519
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_remove_outcome", import("effect/Schema").Struct<{
|
|
520
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
521
|
+
readonly outcomeId: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
522
|
+
}>, import("effect/Schema").Struct<{
|
|
523
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
524
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
525
|
+
readonly title: import("effect/Schema").String;
|
|
526
|
+
readonly description: import("effect/Schema").String;
|
|
527
|
+
readonly sortKey: import("effect/Schema").String;
|
|
528
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
529
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
530
|
+
readonly text: import("effect/Schema").String;
|
|
531
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
532
|
+
}>>;
|
|
533
|
+
readonly createdAt: import("effect/Schema").String;
|
|
534
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
535
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
536
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_archive", import("effect/Schema").Struct<{
|
|
537
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
538
|
+
}>, import("effect/Schema").Struct<{
|
|
539
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
540
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
541
|
+
readonly title: import("effect/Schema").String;
|
|
542
|
+
readonly description: import("effect/Schema").String;
|
|
543
|
+
readonly sortKey: import("effect/Schema").String;
|
|
544
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
545
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
546
|
+
readonly text: import("effect/Schema").String;
|
|
547
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
548
|
+
}>>;
|
|
549
|
+
readonly createdAt: import("effect/Schema").String;
|
|
550
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
551
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
552
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_unarchive", import("effect/Schema").Struct<{
|
|
553
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
554
|
+
}>, import("effect/Schema").Struct<{
|
|
555
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
556
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
557
|
+
readonly title: import("effect/Schema").String;
|
|
558
|
+
readonly description: import("effect/Schema").String;
|
|
559
|
+
readonly sortKey: import("effect/Schema").String;
|
|
560
|
+
readonly outcomes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
561
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OutcomeId">;
|
|
562
|
+
readonly text: import("effect/Schema").String;
|
|
563
|
+
readonly achieved: import("effect/Schema").Boolean;
|
|
564
|
+
}>>;
|
|
565
|
+
readonly createdAt: import("effect/Schema").String;
|
|
566
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
567
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
568
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"goals_remove", import("effect/Schema").Struct<{
|
|
569
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
570
|
+
}>, import("effect/Schema").Struct<{
|
|
571
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "GoalId">;
|
|
228
572
|
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_list", import("effect/Schema").Struct<{
|
|
229
573
|
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
230
574
|
readonly statuses: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>>;
|
|
231
575
|
readonly focus: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
232
576
|
readonly archived: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
577
|
+
readonly goalId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
233
578
|
}>, import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
234
579
|
readonly title: import("effect/Schema").String;
|
|
235
580
|
readonly description: import("effect/Schema").String;
|
|
@@ -241,6 +586,8 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
241
586
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
242
587
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
243
588
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
589
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
590
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
244
591
|
readonly sortKey: import("effect/Schema").String;
|
|
245
592
|
readonly createdAt: import("effect/Schema").String;
|
|
246
593
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -258,6 +605,8 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
258
605
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
259
606
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
260
607
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
608
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
609
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
261
610
|
readonly sortKey: import("effect/Schema").String;
|
|
262
611
|
readonly createdAt: import("effect/Schema").String;
|
|
263
612
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -272,6 +621,7 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
272
621
|
readonly wakeOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
273
622
|
readonly dueOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
274
623
|
readonly owedTo: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
624
|
+
readonly goalIds: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>>;
|
|
275
625
|
readonly title: import("effect/Schema").String;
|
|
276
626
|
}>, import("effect/Schema").Struct<{
|
|
277
627
|
readonly title: import("effect/Schema").String;
|
|
@@ -284,11 +634,13 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
284
634
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
285
635
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
286
636
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
637
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
638
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
287
639
|
readonly sortKey: import("effect/Schema").String;
|
|
288
640
|
readonly createdAt: import("effect/Schema").String;
|
|
289
641
|
readonly updatedAt: import("effect/Schema").String;
|
|
290
642
|
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
291
|
-
}>, readonly (typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").NoArea | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_update", import("effect/Schema").Struct<{
|
|
643
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").NoArea | typeof import("./shared.ts").StorageError)[], false, typeof import("@gjermundgaraba/effect-actions/Action").Anyone, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_update", import("effect/Schema").Struct<{
|
|
292
644
|
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
293
645
|
readonly parentTaskId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
294
646
|
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
@@ -299,6 +651,7 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
299
651
|
readonly wakeOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
300
652
|
readonly dueOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
301
653
|
readonly owedTo: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
654
|
+
readonly goalIds: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>>;
|
|
302
655
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
303
656
|
}>, import("effect/Schema").Struct<{
|
|
304
657
|
readonly title: import("effect/Schema").String;
|
|
@@ -311,6 +664,8 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
311
664
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
312
665
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
313
666
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
667
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
668
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
314
669
|
readonly sortKey: import("effect/Schema").String;
|
|
315
670
|
readonly createdAt: import("effect/Schema").String;
|
|
316
671
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -328,6 +683,8 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
328
683
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
329
684
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
330
685
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
686
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
687
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
331
688
|
readonly sortKey: import("effect/Schema").String;
|
|
332
689
|
readonly createdAt: import("effect/Schema").String;
|
|
333
690
|
readonly updatedAt: import("effect/Schema").String;
|
|
@@ -345,6 +702,8 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
|
|
|
345
702
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
346
703
|
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
347
704
|
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
705
|
+
readonly goalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
706
|
+
readonly inheritedGoalIds: import("effect/Schema").$Array<import("effect/Schema").brand<import("effect/Schema").String, "GoalId">>;
|
|
348
707
|
readonly sortKey: import("effect/Schema").String;
|
|
349
708
|
readonly createdAt: import("effect/Schema").String;
|
|
350
709
|
readonly updatedAt: import("effect/Schema").String;
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
|
|
2
2
|
import { AreaActions } from "./areas.js";
|
|
3
|
+
import { GoalActions } from "./goals.js";
|
|
3
4
|
import { TaskActions } from "./tasks.js";
|
|
4
5
|
import { ValuesActions } from "./values.js";
|
|
5
6
|
export * from "./shared.js";
|
|
6
7
|
export * from "./areas.js";
|
|
8
|
+
export * from "./goals.js";
|
|
7
9
|
export * from "./tasks.js";
|
|
8
10
|
export * from "./values.js";
|
|
9
11
|
export { InvalidInput } from "@gjermundgaraba/effect-actions/Action";
|
|
10
12
|
export const actions = [
|
|
11
13
|
...AreaActions,
|
|
14
|
+
...GoalActions,
|
|
12
15
|
...TaskActions,
|
|
13
16
|
...ValuesActions,
|
|
14
17
|
];
|
package/dist/shared.d.ts
CHANGED
|
@@ -3,12 +3,16 @@ export declare const AreaId: Schema.brand<Schema.String, "AreaId">;
|
|
|
3
3
|
export type AreaId = typeof AreaId.Type;
|
|
4
4
|
export declare const TaskId: Schema.brand<Schema.String, "TaskId">;
|
|
5
5
|
export type TaskId = typeof TaskId.Type;
|
|
6
|
+
export declare const GoalId: Schema.brand<Schema.String, "GoalId">;
|
|
7
|
+
export type GoalId = typeof GoalId.Type;
|
|
8
|
+
export declare const OutcomeId: Schema.brand<Schema.String, "OutcomeId">;
|
|
9
|
+
export type OutcomeId = typeof OutcomeId.Type;
|
|
6
10
|
export declare const Title: Schema.String;
|
|
7
11
|
export declare const Description: Schema.String;
|
|
8
12
|
export declare const CalendarDate: Schema.brand<Schema.String, "CalendarDate">;
|
|
9
13
|
export type CalendarDate = typeof CalendarDate.Type;
|
|
10
14
|
declare const NotFound_base: Schema.Class<NotFound, Schema.TaggedStruct<"NotFound", {
|
|
11
|
-
readonly entity: Schema.Literals<readonly ["area", "task"]>;
|
|
15
|
+
readonly entity: Schema.Literals<readonly ["area", "task", "goal", "outcome"]>;
|
|
12
16
|
readonly id: Schema.String;
|
|
13
17
|
}>, import("effect/Cause").YieldableError & {
|
|
14
18
|
readonly brand: unique symbol;
|
package/dist/shared.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
export const AreaId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("AreaId"));
|
|
3
3
|
export const TaskId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("TaskId"));
|
|
4
|
+
export const GoalId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("GoalId"));
|
|
5
|
+
export const OutcomeId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("OutcomeId"));
|
|
4
6
|
const TITLE_MAX_CODE_POINTS = 1024;
|
|
5
7
|
export const Title = Schema.String.check(Schema.isMaxCodePoints(TITLE_MAX_CODE_POINTS, {
|
|
6
8
|
message: `Must be ${TITLE_MAX_CODE_POINTS.toLocaleString("en")} characters or fewer.`,
|
|
@@ -16,7 +18,10 @@ export const CalendarDate = Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\
|
|
|
16
18
|
Number.isFinite(date.getTime()) &&
|
|
17
19
|
date.toISOString().slice(0, 10) === value);
|
|
18
20
|
}, { expected: "a valid calendar date from 0001-01-01 through 9999-12-31" })).pipe(Schema.brand("CalendarDate"));
|
|
19
|
-
export class NotFound extends Schema.TaggedError()("NotFound", {
|
|
21
|
+
export class NotFound extends Schema.TaggedError()("NotFound", {
|
|
22
|
+
entity: Schema.Literals(["area", "task", "goal", "outcome"]),
|
|
23
|
+
id: Schema.String,
|
|
24
|
+
}, { httpApiStatus: 404 }) {
|
|
20
25
|
}
|
|
21
26
|
export const PlacementRefusal = Schema.Literals([
|
|
22
27
|
"MissingArea",
|
package/dist/tasks.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare const Task: Schema.Struct<{
|
|
|
14
14
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
15
15
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
16
16
|
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
17
|
+
readonly goalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
18
|
+
readonly inheritedGoalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
17
19
|
readonly sortKey: Schema.String;
|
|
18
20
|
readonly createdAt: Schema.String;
|
|
19
21
|
readonly updatedAt: Schema.String;
|
|
@@ -30,6 +32,7 @@ export declare const TaskCreate: Schema.Struct<{
|
|
|
30
32
|
readonly wakeOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
31
33
|
readonly dueOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
32
34
|
readonly owedTo: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
35
|
+
readonly goalIds: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "GoalId">>>;
|
|
33
36
|
readonly title: Schema.String;
|
|
34
37
|
}>;
|
|
35
38
|
export interface TaskCreate extends Schema.Schema.Type<typeof TaskCreate> {
|
|
@@ -45,6 +48,7 @@ export declare const TaskUpdate: Schema.Struct<{
|
|
|
45
48
|
readonly wakeOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
46
49
|
readonly dueOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
47
50
|
readonly owedTo: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
51
|
+
readonly goalIds: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "GoalId">>>;
|
|
48
52
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
49
53
|
}>;
|
|
50
54
|
export interface TaskUpdate extends Schema.Schema.Type<typeof TaskUpdate> {
|
|
@@ -54,6 +58,7 @@ export declare const TaskList: Schema.Struct<{
|
|
|
54
58
|
readonly statuses: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>>;
|
|
55
59
|
readonly focus: Schema.optionalKey<Schema.Boolean>;
|
|
56
60
|
readonly archived: Schema.optionalKey<Schema.Boolean>;
|
|
61
|
+
readonly goalId: Schema.optionalKey<Schema.brand<Schema.String, "GoalId">>;
|
|
57
62
|
}>;
|
|
58
63
|
export interface TaskList extends Schema.Schema.Type<typeof TaskList> {
|
|
59
64
|
}
|
|
@@ -67,6 +72,7 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
67
72
|
readonly statuses: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>>;
|
|
68
73
|
readonly focus: Schema.optionalKey<Schema.Boolean>;
|
|
69
74
|
readonly archived: Schema.optionalKey<Schema.Boolean>;
|
|
75
|
+
readonly goalId: Schema.optionalKey<Schema.brand<Schema.String, "GoalId">>;
|
|
70
76
|
}>, Schema.$Array<Schema.Struct<{
|
|
71
77
|
readonly title: Schema.String;
|
|
72
78
|
readonly description: Schema.String;
|
|
@@ -78,6 +84,8 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
78
84
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
79
85
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
80
86
|
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
87
|
+
readonly goalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
88
|
+
readonly inheritedGoalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
81
89
|
readonly sortKey: Schema.String;
|
|
82
90
|
readonly createdAt: Schema.String;
|
|
83
91
|
readonly updatedAt: Schema.String;
|
|
@@ -95,6 +103,8 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
95
103
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
96
104
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
97
105
|
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
106
|
+
readonly goalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
107
|
+
readonly inheritedGoalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
98
108
|
readonly sortKey: Schema.String;
|
|
99
109
|
readonly createdAt: Schema.String;
|
|
100
110
|
readonly updatedAt: Schema.String;
|
|
@@ -109,6 +119,7 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
109
119
|
readonly wakeOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
110
120
|
readonly dueOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
111
121
|
readonly owedTo: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
122
|
+
readonly goalIds: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "GoalId">>>;
|
|
112
123
|
readonly title: Schema.String;
|
|
113
124
|
}>, Schema.Struct<{
|
|
114
125
|
readonly title: Schema.String;
|
|
@@ -121,11 +132,13 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
121
132
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
122
133
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
123
134
|
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
135
|
+
readonly goalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
136
|
+
readonly inheritedGoalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
124
137
|
readonly sortKey: Schema.String;
|
|
125
138
|
readonly createdAt: Schema.String;
|
|
126
139
|
readonly updatedAt: Schema.String;
|
|
127
140
|
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
128
|
-
}>, readonly (typeof PlacementRefused | typeof NoArea | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"tasks_update", Schema.Struct<{
|
|
141
|
+
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof NoArea | typeof StorageError)[], false, typeof Action.Anyone, undefined, undefined>, Action.Action<"tasks_update", Schema.Struct<{
|
|
129
142
|
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
130
143
|
readonly parentTaskId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
131
144
|
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
@@ -136,6 +149,7 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
136
149
|
readonly wakeOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
137
150
|
readonly dueOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
138
151
|
readonly owedTo: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
152
|
+
readonly goalIds: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "GoalId">>>;
|
|
139
153
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
140
154
|
}>, Schema.Struct<{
|
|
141
155
|
readonly title: Schema.String;
|
|
@@ -148,6 +162,8 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
148
162
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
149
163
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
150
164
|
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
165
|
+
readonly goalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
166
|
+
readonly inheritedGoalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
151
167
|
readonly sortKey: Schema.String;
|
|
152
168
|
readonly createdAt: Schema.String;
|
|
153
169
|
readonly updatedAt: Schema.String;
|
|
@@ -165,6 +181,8 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
165
181
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
166
182
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
167
183
|
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
184
|
+
readonly goalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
185
|
+
readonly inheritedGoalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
168
186
|
readonly sortKey: Schema.String;
|
|
169
187
|
readonly createdAt: Schema.String;
|
|
170
188
|
readonly updatedAt: Schema.String;
|
|
@@ -182,6 +200,8 @@ export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.S
|
|
|
182
200
|
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
183
201
|
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
184
202
|
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
203
|
+
readonly goalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
204
|
+
readonly inheritedGoalIds: Schema.$Array<Schema.brand<Schema.String, "GoalId">>;
|
|
185
205
|
readonly sortKey: Schema.String;
|
|
186
206
|
readonly createdAt: Schema.String;
|
|
187
207
|
readonly updatedAt: Schema.String;
|
package/dist/tasks.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, CalendarDate, Description, NoArea, NotFound, PlacementRefused, StorageError, TaskId, Title, } from "./shared.js";
|
|
3
|
+
import { AreaId, CalendarDate, Description, GoalId, NoArea, NotFound, PlacementRefused, StorageError, TaskId, Title, } from "./shared.js";
|
|
4
4
|
export const TaskStatus = Schema.Literals([
|
|
5
5
|
"inbox",
|
|
6
6
|
"backlog",
|
|
@@ -23,6 +23,8 @@ export const Task = Schema.Struct({
|
|
|
23
23
|
areaId: AreaId,
|
|
24
24
|
parentTaskId: Schema.NullOr(TaskId),
|
|
25
25
|
...content,
|
|
26
|
+
goalIds: Schema.Array(GoalId),
|
|
27
|
+
inheritedGoalIds: Schema.Array(GoalId),
|
|
26
28
|
sortKey: Schema.String,
|
|
27
29
|
createdAt: Schema.String,
|
|
28
30
|
updatedAt: Schema.String,
|
|
@@ -41,6 +43,7 @@ const edits = {
|
|
|
41
43
|
wakeOn: Schema.optionalKey(content.wakeOn),
|
|
42
44
|
dueOn: Schema.optionalKey(content.dueOn),
|
|
43
45
|
owedTo: Schema.optionalKey(Schema.NullOr(Schema.String.check(Schema.isBetweenCodePoints(0, 256)))),
|
|
46
|
+
goalIds: Schema.optionalKey(Schema.Array(GoalId)),
|
|
44
47
|
};
|
|
45
48
|
export const TaskCreate = Schema.Struct({
|
|
46
49
|
...edits,
|
|
@@ -53,13 +56,14 @@ export const TaskList = Schema.Struct({
|
|
|
53
56
|
statuses: Schema.optionalKey(Schema.Array(TaskStatus)),
|
|
54
57
|
focus: Schema.optionalKey(Schema.Boolean),
|
|
55
58
|
archived: Schema.optionalKey(Schema.Boolean),
|
|
59
|
+
goalId: Schema.optionalKey(GoalId),
|
|
56
60
|
});
|
|
57
61
|
export const TaskRef = Schema.Struct({ id: TaskId });
|
|
58
62
|
export const TaskActions = [
|
|
59
63
|
Action.make("tasks_list", {
|
|
60
64
|
caller: Action.Anyone,
|
|
61
65
|
error: [StorageError],
|
|
62
|
-
description: "List tasks in area and outline order, optionally filtering area, status, or
|
|
66
|
+
description: "List tasks in area and outline order, optionally filtering area, status, focus, or goal. goalId keeps the tasks serving that goal, in goalIds or inheritedGoalIds. Archived tasks are left out unless archived is true, which lists only archived tasks.",
|
|
63
67
|
readOnly: true,
|
|
64
68
|
input: TaskList,
|
|
65
69
|
success: Schema.Array(Task),
|
|
@@ -74,8 +78,8 @@ export const TaskActions = [
|
|
|
74
78
|
}),
|
|
75
79
|
Action.make("tasks_create", {
|
|
76
80
|
caller: Action.Anyone,
|
|
77
|
-
error: [PlacementRefused, NoArea, StorageError],
|
|
78
|
-
description: "Capture a task, defaulting to inbox in the first area. A parent supplies its area and must not be archived.",
|
|
81
|
+
error: [NotFound, PlacementRefused, NoArea, StorageError],
|
|
82
|
+
description: "Capture a task, defaulting to inbox in the first area. A parent supplies its area and must not be archived. goalIds links it to goals in any area; it also serves every goal its ancestors link, listed in inheritedGoalIds.",
|
|
79
83
|
readOnly: false,
|
|
80
84
|
input: TaskCreate,
|
|
81
85
|
success: Task,
|
|
@@ -83,7 +87,7 @@ export const TaskActions = [
|
|
|
83
87
|
Action.make("tasks_update", {
|
|
84
88
|
caller: Action.Anyone,
|
|
85
89
|
error: [NotFound, PlacementRefused, StorageError],
|
|
86
|
-
description: "Update task content and placement atomically, carrying its subtree to the destination area. Null clears wakeOn, dueOn, or owedTo. Omitted parentTaskId preserves it, except that a move to another areaId lands at that area's root; null means area root. A parent supplies its area; an explicit area must agree with an explicit parent. Omitted beforeId preserves order within the same siblings and appends when changing groups; null explicitly appends. A task that is not archived cannot move under an archived parent.",
|
|
90
|
+
description: "Update task content, goal links, and placement atomically, carrying its subtree to the destination area. goalIds replaces the task's own links, to goals in any area, archived ones included; inheritedGoalIds is derived from its ancestors and changes when they or its place change. Null clears wakeOn, dueOn, or owedTo. Omitted parentTaskId preserves it, except that a move to another areaId lands at that area's root; null means area root. A parent supplies its area; an explicit area must agree with an explicit parent. Omitted beforeId preserves order within the same siblings and appends when changing groups; null explicitly appends. A task that is not archived cannot move under an archived parent.",
|
|
87
91
|
readOnly: false,
|
|
88
92
|
input: TaskUpdate,
|
|
89
93
|
success: Task,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjermundgaraba/wtf-api",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The wtf wire contract: the area and task actions, their inputs, records and errors, for a typed HTTP or MCP client.",
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "The wtf wire contract: the area, goal and task actions, their inputs, records and errors, for a typed HTTP or MCP client.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|