@gjermundgaraba/wtf-api 0.0.1-stage → 0.1.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/LICENSE +21 -0
- package/dist/areas.d.ts +77 -0
- package/dist/areas.js +65 -0
- package/dist/index.d.ts +359 -0
- package/dist/index.js +19 -0
- package/dist/shared.d.ts +34 -0
- package/dist/shared.js +32 -0
- package/dist/tasks.d.ts +194 -0
- package/dist/tasks.js +112 -0
- package/package.json +35 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gjermund Garaba
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/areas.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
|
+
import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { NotFound, PlacementRefused, StorageError } from "./shared.ts";
|
|
5
|
+
export declare const Area: Schema.Struct<{
|
|
6
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
7
|
+
readonly title: Schema.String;
|
|
8
|
+
readonly description: Schema.String;
|
|
9
|
+
readonly sortKey: Schema.String;
|
|
10
|
+
readonly createdAt: Schema.String;
|
|
11
|
+
readonly updatedAt: Schema.String;
|
|
12
|
+
}>;
|
|
13
|
+
export type Area = typeof Area.Type;
|
|
14
|
+
export declare const AreaCreate: Schema.Struct<{
|
|
15
|
+
readonly title: Schema.String;
|
|
16
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
17
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "AreaId">>>;
|
|
18
|
+
}>;
|
|
19
|
+
export interface AreaCreate extends Schema.Schema.Type<typeof AreaCreate> {
|
|
20
|
+
}
|
|
21
|
+
export declare const AreaUpdate: Schema.Struct<{
|
|
22
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
23
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
24
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
25
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "AreaId">>>;
|
|
26
|
+
}>;
|
|
27
|
+
export interface AreaUpdate extends Schema.Schema.Type<typeof AreaUpdate> {
|
|
28
|
+
}
|
|
29
|
+
export declare const AreaRef: Schema.Struct<{
|
|
30
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
31
|
+
}>;
|
|
32
|
+
export interface AreaRef extends Schema.Schema.Type<typeof AreaRef> {
|
|
33
|
+
}
|
|
34
|
+
export declare const AreaActions: readonly [Action.Action<"areas_list", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
35
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
36
|
+
readonly title: Schema.String;
|
|
37
|
+
readonly description: Schema.String;
|
|
38
|
+
readonly sortKey: Schema.String;
|
|
39
|
+
readonly createdAt: Schema.String;
|
|
40
|
+
readonly updatedAt: Schema.String;
|
|
41
|
+
}>>, readonly (typeof StorageError)[], true, typeof CurrentPrincipal>, Action.Action<"areas_get", Schema.Struct<{
|
|
42
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
43
|
+
}>, Schema.Struct<{
|
|
44
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
45
|
+
readonly title: Schema.String;
|
|
46
|
+
readonly description: Schema.String;
|
|
47
|
+
readonly sortKey: Schema.String;
|
|
48
|
+
readonly createdAt: Schema.String;
|
|
49
|
+
readonly updatedAt: Schema.String;
|
|
50
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], true, typeof CurrentPrincipal>, Action.Action<"areas_create", Schema.Struct<{
|
|
51
|
+
readonly title: Schema.String;
|
|
52
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
53
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "AreaId">>>;
|
|
54
|
+
}>, Schema.Struct<{
|
|
55
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
56
|
+
readonly title: Schema.String;
|
|
57
|
+
readonly description: Schema.String;
|
|
58
|
+
readonly sortKey: Schema.String;
|
|
59
|
+
readonly createdAt: Schema.String;
|
|
60
|
+
readonly updatedAt: Schema.String;
|
|
61
|
+
}>, readonly (typeof PlacementRefused | typeof StorageError)[], false, typeof CurrentPrincipal>, Action.Action<"areas_update", Schema.Struct<{
|
|
62
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
63
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
64
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
65
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "AreaId">>>;
|
|
66
|
+
}>, Schema.Struct<{
|
|
67
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
68
|
+
readonly title: Schema.String;
|
|
69
|
+
readonly description: Schema.String;
|
|
70
|
+
readonly sortKey: Schema.String;
|
|
71
|
+
readonly createdAt: Schema.String;
|
|
72
|
+
readonly updatedAt: Schema.String;
|
|
73
|
+
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof StorageError)[], false, typeof CurrentPrincipal>, Action.Action<"areas_remove", Schema.Struct<{
|
|
74
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
75
|
+
}>, Schema.Struct<{
|
|
76
|
+
readonly id: Schema.brand<Schema.String, "AreaId">;
|
|
77
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], false, typeof CurrentPrincipal>];
|
package/dist/areas.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
|
+
import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { AreaId, Description, NotFound, PlacementRefused, StorageError, Title } from "./shared.js";
|
|
5
|
+
export const Area = Schema.Struct({
|
|
6
|
+
id: AreaId,
|
|
7
|
+
title: Schema.String,
|
|
8
|
+
description: Schema.String,
|
|
9
|
+
sortKey: Schema.String,
|
|
10
|
+
createdAt: Schema.String,
|
|
11
|
+
updatedAt: Schema.String,
|
|
12
|
+
});
|
|
13
|
+
export const AreaCreate = Schema.Struct({
|
|
14
|
+
title: Title,
|
|
15
|
+
description: Schema.optionalKey(Description),
|
|
16
|
+
beforeId: Schema.optionalKey(Schema.NullOr(AreaId)),
|
|
17
|
+
});
|
|
18
|
+
export const AreaUpdate = Schema.Struct({
|
|
19
|
+
id: AreaId,
|
|
20
|
+
title: Schema.optionalKey(Title),
|
|
21
|
+
description: Schema.optionalKey(Description),
|
|
22
|
+
beforeId: Schema.optionalKey(Schema.NullOr(AreaId)),
|
|
23
|
+
});
|
|
24
|
+
export const AreaRef = Schema.Struct({ id: AreaId });
|
|
25
|
+
export const AreaActions = [
|
|
26
|
+
Action.make("areas_list", {
|
|
27
|
+
caller: CurrentPrincipal,
|
|
28
|
+
error: [StorageError],
|
|
29
|
+
description: "List areas in manual order.",
|
|
30
|
+
readOnly: true,
|
|
31
|
+
success: Schema.Array(Area),
|
|
32
|
+
}),
|
|
33
|
+
Action.make("areas_get", {
|
|
34
|
+
caller: CurrentPrincipal,
|
|
35
|
+
error: [NotFound, StorageError],
|
|
36
|
+
description: "Read an area.",
|
|
37
|
+
readOnly: true,
|
|
38
|
+
input: AreaRef,
|
|
39
|
+
success: Area,
|
|
40
|
+
}),
|
|
41
|
+
Action.make("areas_create", {
|
|
42
|
+
caller: CurrentPrincipal,
|
|
43
|
+
error: [PlacementRefused, StorageError],
|
|
44
|
+
description: "Create an area before another area. Omitted or null beforeId appends.",
|
|
45
|
+
readOnly: false,
|
|
46
|
+
input: AreaCreate,
|
|
47
|
+
success: Area,
|
|
48
|
+
}),
|
|
49
|
+
Action.make("areas_update", {
|
|
50
|
+
caller: CurrentPrincipal,
|
|
51
|
+
error: [NotFound, PlacementRefused, StorageError],
|
|
52
|
+
description: "Update an area's title, Markdown description, or order atomically. Omitted beforeId preserves order; null appends.",
|
|
53
|
+
readOnly: false,
|
|
54
|
+
input: AreaUpdate,
|
|
55
|
+
success: Area,
|
|
56
|
+
}),
|
|
57
|
+
Action.make("areas_remove", {
|
|
58
|
+
caller: CurrentPrincipal,
|
|
59
|
+
error: [NotFound, StorageError],
|
|
60
|
+
description: "Permanently delete an area and all its tasks.",
|
|
61
|
+
readOnly: false,
|
|
62
|
+
input: AreaRef,
|
|
63
|
+
success: AreaRef,
|
|
64
|
+
}),
|
|
65
|
+
];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
|
|
2
|
+
import * as Authentication from "@gjermundgaraba/effect-actions/Authentication";
|
|
3
|
+
import { ProviderUnavailable } from "@gjermundgaraba/clankerauth-sdk/errors";
|
|
4
|
+
import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
5
|
+
export * from "./shared.ts";
|
|
6
|
+
export * from "./areas.ts";
|
|
7
|
+
export * from "./tasks.ts";
|
|
8
|
+
export { Principal, signOutUrl } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
9
|
+
export { ProviderUnavailable } from "@gjermundgaraba/clankerauth-sdk/errors";
|
|
10
|
+
export { InvalidInput, Unauthenticated, Forbidden } from "@gjermundgaraba/effect-actions/Action";
|
|
11
|
+
export declare const Login: Authentication.Descriptor<CurrentPrincipal, import("@gjermundgaraba/clankerauth-sdk/session").Caller, import("effect/http-api/HttpApiSecurity").Http, "wtf.Login", readonly [typeof ProviderUnavailable]>;
|
|
12
|
+
export declare const actions: readonly [import("@gjermundgaraba/effect-actions/Action").Action<"areas_list", import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Never>, import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
13
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
14
|
+
readonly title: import("effect/Schema").String;
|
|
15
|
+
readonly description: import("effect/Schema").String;
|
|
16
|
+
readonly sortKey: import("effect/Schema").String;
|
|
17
|
+
readonly createdAt: import("effect/Schema").String;
|
|
18
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
19
|
+
}>>, readonly typeof import("./shared.ts").StorageError[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_get", import("effect/Schema").Struct<{
|
|
20
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
21
|
+
}>, import("effect/Schema").Struct<{
|
|
22
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
23
|
+
readonly title: import("effect/Schema").String;
|
|
24
|
+
readonly description: import("effect/Schema").String;
|
|
25
|
+
readonly sortKey: import("effect/Schema").String;
|
|
26
|
+
readonly createdAt: import("effect/Schema").String;
|
|
27
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
28
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_create", import("effect/Schema").Struct<{
|
|
29
|
+
readonly title: import("effect/Schema").String;
|
|
30
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
31
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>>;
|
|
32
|
+
}>, import("effect/Schema").Struct<{
|
|
33
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
34
|
+
readonly title: import("effect/Schema").String;
|
|
35
|
+
readonly description: import("effect/Schema").String;
|
|
36
|
+
readonly sortKey: import("effect/Schema").String;
|
|
37
|
+
readonly createdAt: import("effect/Schema").String;
|
|
38
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
39
|
+
}>, readonly (typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_update", import("effect/Schema").Struct<{
|
|
40
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
41
|
+
readonly title: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
42
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
43
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>>;
|
|
44
|
+
}>, import("effect/Schema").Struct<{
|
|
45
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
46
|
+
readonly title: import("effect/Schema").String;
|
|
47
|
+
readonly description: import("effect/Schema").String;
|
|
48
|
+
readonly sortKey: import("effect/Schema").String;
|
|
49
|
+
readonly createdAt: import("effect/Schema").String;
|
|
50
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
51
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_remove", import("effect/Schema").Struct<{
|
|
52
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
53
|
+
}>, import("effect/Schema").Struct<{
|
|
54
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
55
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_list", import("effect/Schema").Struct<{
|
|
56
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
57
|
+
readonly statuses: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>>;
|
|
58
|
+
readonly committed: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
59
|
+
readonly archived: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
60
|
+
}>, import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
61
|
+
readonly title: import("effect/Schema").String;
|
|
62
|
+
readonly description: import("effect/Schema").String;
|
|
63
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
64
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
65
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
66
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
67
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
68
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
69
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
70
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
71
|
+
readonly sortKey: import("effect/Schema").String;
|
|
72
|
+
readonly createdAt: import("effect/Schema").String;
|
|
73
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
74
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
75
|
+
}>>, readonly typeof import("./shared.ts").StorageError[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_get", import("effect/Schema").Struct<{
|
|
76
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
77
|
+
}>, import("effect/Schema").Struct<{
|
|
78
|
+
readonly title: import("effect/Schema").String;
|
|
79
|
+
readonly description: import("effect/Schema").String;
|
|
80
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
81
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
82
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
83
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
84
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
85
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
86
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
87
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
88
|
+
readonly sortKey: import("effect/Schema").String;
|
|
89
|
+
readonly createdAt: import("effect/Schema").String;
|
|
90
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
91
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
92
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_create", import("effect/Schema").Struct<{
|
|
93
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
94
|
+
readonly parentTaskId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
95
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
96
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
97
|
+
readonly status: import("effect/Schema").optionalKey<import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>;
|
|
98
|
+
readonly committed: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
99
|
+
readonly wakeOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
100
|
+
readonly dueOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
101
|
+
readonly owedTo: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
102
|
+
readonly title: import("effect/Schema").String;
|
|
103
|
+
}>, import("effect/Schema").Struct<{
|
|
104
|
+
readonly title: import("effect/Schema").String;
|
|
105
|
+
readonly description: import("effect/Schema").String;
|
|
106
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
107
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
108
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
109
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
110
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
111
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
112
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
113
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
114
|
+
readonly sortKey: import("effect/Schema").String;
|
|
115
|
+
readonly createdAt: import("effect/Schema").String;
|
|
116
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
117
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
118
|
+
}>, readonly (typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").NoArea | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_update", import("effect/Schema").Struct<{
|
|
119
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
120
|
+
readonly parentTaskId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
121
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
122
|
+
readonly title: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
123
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
124
|
+
readonly status: import("effect/Schema").optionalKey<import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>;
|
|
125
|
+
readonly committed: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
126
|
+
readonly wakeOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
127
|
+
readonly dueOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
128
|
+
readonly owedTo: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
129
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
130
|
+
}>, import("effect/Schema").Struct<{
|
|
131
|
+
readonly title: import("effect/Schema").String;
|
|
132
|
+
readonly description: import("effect/Schema").String;
|
|
133
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
134
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
135
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
136
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
137
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
138
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
139
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
140
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
141
|
+
readonly sortKey: import("effect/Schema").String;
|
|
142
|
+
readonly createdAt: import("effect/Schema").String;
|
|
143
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
144
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
145
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_archive", import("effect/Schema").Struct<{
|
|
146
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
147
|
+
}>, import("effect/Schema").Struct<{
|
|
148
|
+
readonly title: import("effect/Schema").String;
|
|
149
|
+
readonly description: import("effect/Schema").String;
|
|
150
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
151
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
152
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
153
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
154
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
155
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
156
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
157
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
158
|
+
readonly sortKey: import("effect/Schema").String;
|
|
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").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_unarchive", import("effect/Schema").Struct<{
|
|
163
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
164
|
+
}>, import("effect/Schema").Struct<{
|
|
165
|
+
readonly title: import("effect/Schema").String;
|
|
166
|
+
readonly description: import("effect/Schema").String;
|
|
167
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
168
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
169
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
170
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
171
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
172
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
173
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
174
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
175
|
+
readonly sortKey: import("effect/Schema").String;
|
|
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").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_remove", import("effect/Schema").Struct<{
|
|
180
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
181
|
+
}>, import("effect/Schema").Struct<{
|
|
182
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
183
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>];
|
|
184
|
+
export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/effect-actions/Action").Action<"whoami", import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Never>, import("effect/Schema").Struct<{
|
|
185
|
+
readonly subject: import("effect/Schema").NonEmptyString;
|
|
186
|
+
readonly issuer: import("effect/Schema").NonEmptyString;
|
|
187
|
+
readonly scopes: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
188
|
+
}>, readonly never[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_list", import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Never>, import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
189
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
190
|
+
readonly title: import("effect/Schema").String;
|
|
191
|
+
readonly description: import("effect/Schema").String;
|
|
192
|
+
readonly sortKey: import("effect/Schema").String;
|
|
193
|
+
readonly createdAt: import("effect/Schema").String;
|
|
194
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
195
|
+
}>>, readonly typeof import("./shared.ts").StorageError[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_get", import("effect/Schema").Struct<{
|
|
196
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
197
|
+
}>, import("effect/Schema").Struct<{
|
|
198
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
199
|
+
readonly title: import("effect/Schema").String;
|
|
200
|
+
readonly description: import("effect/Schema").String;
|
|
201
|
+
readonly sortKey: import("effect/Schema").String;
|
|
202
|
+
readonly createdAt: import("effect/Schema").String;
|
|
203
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
204
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_create", import("effect/Schema").Struct<{
|
|
205
|
+
readonly title: import("effect/Schema").String;
|
|
206
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
207
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>>;
|
|
208
|
+
}>, import("effect/Schema").Struct<{
|
|
209
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
210
|
+
readonly title: import("effect/Schema").String;
|
|
211
|
+
readonly description: import("effect/Schema").String;
|
|
212
|
+
readonly sortKey: import("effect/Schema").String;
|
|
213
|
+
readonly createdAt: import("effect/Schema").String;
|
|
214
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
215
|
+
}>, readonly (typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_update", import("effect/Schema").Struct<{
|
|
216
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
217
|
+
readonly title: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
218
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
219
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>>;
|
|
220
|
+
}>, import("effect/Schema").Struct<{
|
|
221
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
222
|
+
readonly title: import("effect/Schema").String;
|
|
223
|
+
readonly description: import("effect/Schema").String;
|
|
224
|
+
readonly sortKey: import("effect/Schema").String;
|
|
225
|
+
readonly createdAt: import("effect/Schema").String;
|
|
226
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
227
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"areas_remove", import("effect/Schema").Struct<{
|
|
228
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
229
|
+
}>, import("effect/Schema").Struct<{
|
|
230
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
231
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_list", import("effect/Schema").Struct<{
|
|
232
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
233
|
+
readonly statuses: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>>;
|
|
234
|
+
readonly committed: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
235
|
+
readonly archived: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
236
|
+
}>, import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
237
|
+
readonly title: import("effect/Schema").String;
|
|
238
|
+
readonly description: import("effect/Schema").String;
|
|
239
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
240
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
241
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
242
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
243
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
244
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
245
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
246
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
247
|
+
readonly sortKey: import("effect/Schema").String;
|
|
248
|
+
readonly createdAt: import("effect/Schema").String;
|
|
249
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
250
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
251
|
+
}>>, readonly typeof import("./shared.ts").StorageError[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_get", import("effect/Schema").Struct<{
|
|
252
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
253
|
+
}>, import("effect/Schema").Struct<{
|
|
254
|
+
readonly title: import("effect/Schema").String;
|
|
255
|
+
readonly description: import("effect/Schema").String;
|
|
256
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
257
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
258
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
259
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
260
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
261
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
262
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
263
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
264
|
+
readonly sortKey: import("effect/Schema").String;
|
|
265
|
+
readonly createdAt: import("effect/Schema").String;
|
|
266
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
267
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
268
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], true, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_create", import("effect/Schema").Struct<{
|
|
269
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
270
|
+
readonly parentTaskId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
271
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
272
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
273
|
+
readonly status: import("effect/Schema").optionalKey<import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>;
|
|
274
|
+
readonly committed: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
275
|
+
readonly wakeOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
276
|
+
readonly dueOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
277
|
+
readonly owedTo: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
278
|
+
readonly title: import("effect/Schema").String;
|
|
279
|
+
}>, import("effect/Schema").Struct<{
|
|
280
|
+
readonly title: import("effect/Schema").String;
|
|
281
|
+
readonly description: import("effect/Schema").String;
|
|
282
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
283
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
284
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
285
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
286
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
287
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
288
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
289
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
290
|
+
readonly sortKey: import("effect/Schema").String;
|
|
291
|
+
readonly createdAt: import("effect/Schema").String;
|
|
292
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
293
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
294
|
+
}>, readonly (typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").NoArea | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_update", import("effect/Schema").Struct<{
|
|
295
|
+
readonly areaId: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "AreaId">>;
|
|
296
|
+
readonly parentTaskId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
297
|
+
readonly beforeId: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>>;
|
|
298
|
+
readonly title: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
299
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
300
|
+
readonly status: import("effect/Schema").optionalKey<import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>;
|
|
301
|
+
readonly committed: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
302
|
+
readonly wakeOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
303
|
+
readonly dueOn: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>>;
|
|
304
|
+
readonly owedTo: import("effect/Schema").optionalKey<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
305
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
306
|
+
}>, import("effect/Schema").Struct<{
|
|
307
|
+
readonly title: import("effect/Schema").String;
|
|
308
|
+
readonly description: import("effect/Schema").String;
|
|
309
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
310
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
311
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
312
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
313
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
314
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
315
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
316
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
317
|
+
readonly sortKey: import("effect/Schema").String;
|
|
318
|
+
readonly createdAt: import("effect/Schema").String;
|
|
319
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
320
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
321
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_archive", import("effect/Schema").Struct<{
|
|
322
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
323
|
+
}>, import("effect/Schema").Struct<{
|
|
324
|
+
readonly title: import("effect/Schema").String;
|
|
325
|
+
readonly description: import("effect/Schema").String;
|
|
326
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
327
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
328
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
329
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
330
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
331
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
332
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
333
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
334
|
+
readonly sortKey: import("effect/Schema").String;
|
|
335
|
+
readonly createdAt: import("effect/Schema").String;
|
|
336
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
337
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
338
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_unarchive", import("effect/Schema").Struct<{
|
|
339
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
340
|
+
}>, import("effect/Schema").Struct<{
|
|
341
|
+
readonly title: import("effect/Schema").String;
|
|
342
|
+
readonly description: import("effect/Schema").String;
|
|
343
|
+
readonly status: import("effect/Schema").Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
344
|
+
readonly committed: import("effect/Schema").Boolean;
|
|
345
|
+
readonly wakeOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
346
|
+
readonly dueOn: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "CalendarDate">>;
|
|
347
|
+
readonly owedTo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
348
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
349
|
+
readonly areaId: import("effect/Schema").brand<import("effect/Schema").String, "AreaId">;
|
|
350
|
+
readonly parentTaskId: import("effect/Schema").NullOr<import("effect/Schema").brand<import("effect/Schema").String, "TaskId">>;
|
|
351
|
+
readonly sortKey: import("effect/Schema").String;
|
|
352
|
+
readonly createdAt: import("effect/Schema").String;
|
|
353
|
+
readonly updatedAt: import("effect/Schema").String;
|
|
354
|
+
readonly archivedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
355
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").PlacementRefused | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>, import("@gjermundgaraba/effect-actions/Action").Action<"tasks_remove", import("effect/Schema").Struct<{
|
|
356
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
357
|
+
}>, import("effect/Schema").Struct<{
|
|
358
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
|
|
359
|
+
}>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal>], [], Authentication.Descriptor<CurrentPrincipal, import("@gjermundgaraba/clankerauth-sdk/session").Caller, import("effect/http-api/HttpApiSecurity").Http, "wtf.Login", readonly [typeof ProviderUnavailable]>>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
|
|
2
|
+
import * as Authentication from "@gjermundgaraba/effect-actions/Authentication";
|
|
3
|
+
import { ProviderUnavailable } from "@gjermundgaraba/clankerauth-sdk/errors";
|
|
4
|
+
import { CurrentPrincipal, Whoami } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
5
|
+
import { AreaActions } from "./areas.js";
|
|
6
|
+
import { TaskActions } from "./tasks.js";
|
|
7
|
+
export * from "./shared.js";
|
|
8
|
+
export * from "./areas.js";
|
|
9
|
+
export * from "./tasks.js";
|
|
10
|
+
export { Principal, signOutUrl } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
11
|
+
export { ProviderUnavailable } from "@gjermundgaraba/clankerauth-sdk/errors";
|
|
12
|
+
export { InvalidInput, Unauthenticated, Forbidden } from "@gjermundgaraba/effect-actions/Action";
|
|
13
|
+
export const Login = Authentication.make("wtf.Login", CurrentPrincipal, {
|
|
14
|
+
error: ProviderUnavailable,
|
|
15
|
+
});
|
|
16
|
+
export const actions = [...AreaActions, ...TaskActions];
|
|
17
|
+
export const Http = ActionHttp.make([Whoami, ...actions], {
|
|
18
|
+
authentication: Login,
|
|
19
|
+
});
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const AreaId: Schema.brand<Schema.String, "AreaId">;
|
|
3
|
+
export type AreaId = typeof AreaId.Type;
|
|
4
|
+
export declare const TaskId: Schema.brand<Schema.String, "TaskId">;
|
|
5
|
+
export type TaskId = typeof TaskId.Type;
|
|
6
|
+
export declare const Title: Schema.String;
|
|
7
|
+
export declare const Description: Schema.String;
|
|
8
|
+
export declare const CalendarDate: Schema.brand<Schema.String, "CalendarDate">;
|
|
9
|
+
export type CalendarDate = typeof CalendarDate.Type;
|
|
10
|
+
declare const NotFound_base: Schema.Class<NotFound, Schema.TaggedStruct<"NotFound", {
|
|
11
|
+
readonly entity: Schema.Literals<readonly ["area", "task"]>;
|
|
12
|
+
readonly id: Schema.String;
|
|
13
|
+
}>, import("effect/Cause").YieldableError>;
|
|
14
|
+
export declare class NotFound extends NotFound_base {
|
|
15
|
+
}
|
|
16
|
+
export declare const PlacementRefusal: Schema.Literals<readonly ["MissingArea", "MissingParent", "ParentInAnotherArea", "OwnSubtree", "MissingPosition", "ArchivedParent"]>;
|
|
17
|
+
export type PlacementRefusal = typeof PlacementRefusal.Type;
|
|
18
|
+
declare const PlacementRefused_base: Schema.Class<PlacementRefused, Schema.TaggedStruct<"PlacementRefused", {
|
|
19
|
+
readonly reason: Schema.Literals<readonly ["MissingArea", "MissingParent", "ParentInAnotherArea", "OwnSubtree", "MissingPosition", "ArchivedParent"]>;
|
|
20
|
+
readonly message: Schema.String;
|
|
21
|
+
}>, import("effect/Cause").YieldableError>;
|
|
22
|
+
export declare class PlacementRefused extends PlacementRefused_base {
|
|
23
|
+
}
|
|
24
|
+
declare const NoArea_base: Schema.Class<NoArea, Schema.TaggedStruct<"NoArea", {
|
|
25
|
+
readonly message: Schema.String;
|
|
26
|
+
}>, import("effect/Cause").YieldableError>;
|
|
27
|
+
export declare class NoArea extends NoArea_base {
|
|
28
|
+
}
|
|
29
|
+
declare const StorageError_base: Schema.Class<StorageError, Schema.TaggedStruct<"StorageError", {
|
|
30
|
+
readonly message: Schema.String;
|
|
31
|
+
}>, import("effect/Cause").YieldableError>;
|
|
32
|
+
export declare class StorageError extends StorageError_base {
|
|
33
|
+
}
|
|
34
|
+
export {};
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export const AreaId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("AreaId"));
|
|
3
|
+
export const TaskId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("TaskId"));
|
|
4
|
+
const TITLE_MAX_CODE_POINTS = 1024;
|
|
5
|
+
export const Title = Schema.String.check(Schema.isMaxCodePoints(TITLE_MAX_CODE_POINTS, {
|
|
6
|
+
message: `Must be ${TITLE_MAX_CODE_POINTS.toLocaleString("en")} characters or fewer.`,
|
|
7
|
+
}), Schema.isPattern(/\S/u, { message: "Can't be blank." }));
|
|
8
|
+
export const Description = Schema.String.check(Schema.isBetweenCodePoints(0, 65_536));
|
|
9
|
+
export const CalendarDate = Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}$/u, { expected: "a calendar date in YYYY-MM-DD format" }), Schema.makeFilter((value) => {
|
|
10
|
+
const date = new Date(`${value}T00:00:00Z`);
|
|
11
|
+
return (!value.startsWith("0000") &&
|
|
12
|
+
Number.isFinite(date.getTime()) &&
|
|
13
|
+
date.toISOString().slice(0, 10) === value);
|
|
14
|
+
}, { expected: "a valid calendar date from 0001-01-01 through 9999-12-31" })).pipe(Schema.brand("CalendarDate"));
|
|
15
|
+
export class NotFound extends Schema.TaggedError()("NotFound", { entity: Schema.Literals(["area", "task"]), id: Schema.String }, { httpApiStatus: 404 }) {
|
|
16
|
+
}
|
|
17
|
+
export const PlacementRefusal = Schema.Literals([
|
|
18
|
+
"MissingArea",
|
|
19
|
+
"MissingParent",
|
|
20
|
+
"ParentInAnotherArea",
|
|
21
|
+
"OwnSubtree",
|
|
22
|
+
"MissingPosition",
|
|
23
|
+
"ArchivedParent",
|
|
24
|
+
]).annotate({
|
|
25
|
+
description: "Why a placement was refused, so a client can name the input it concerns.",
|
|
26
|
+
});
|
|
27
|
+
export class PlacementRefused extends Schema.TaggedError()("PlacementRefused", { reason: PlacementRefusal, message: Schema.String }, { httpApiStatus: 409 }) {
|
|
28
|
+
}
|
|
29
|
+
export class NoArea extends Schema.TaggedError()("NoArea", { message: Schema.String }, { httpApiStatus: 409 }) {
|
|
30
|
+
}
|
|
31
|
+
export class StorageError extends Schema.TaggedError()("StorageError", { message: Schema.String }, { httpApiStatus: 500 }) {
|
|
32
|
+
}
|
package/dist/tasks.d.ts
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
|
+
import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { NoArea, NotFound, PlacementRefused, StorageError } from "./shared.ts";
|
|
5
|
+
export declare const TaskStatus: Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
6
|
+
export type TaskStatus = typeof TaskStatus.Type;
|
|
7
|
+
export declare const Task: Schema.Struct<{
|
|
8
|
+
readonly title: Schema.String;
|
|
9
|
+
readonly description: Schema.String;
|
|
10
|
+
readonly status: Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
11
|
+
readonly committed: Schema.Boolean;
|
|
12
|
+
readonly wakeOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
13
|
+
readonly dueOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
14
|
+
readonly owedTo: Schema.NullOr<Schema.String>;
|
|
15
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
16
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
17
|
+
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
18
|
+
readonly sortKey: Schema.String;
|
|
19
|
+
readonly createdAt: Schema.String;
|
|
20
|
+
readonly updatedAt: Schema.String;
|
|
21
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
22
|
+
}>;
|
|
23
|
+
export type Task = typeof Task.Type;
|
|
24
|
+
export declare const TaskCreate: Schema.Struct<{
|
|
25
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
26
|
+
readonly parentTaskId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
27
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
28
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
29
|
+
readonly status: Schema.optionalKey<Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>;
|
|
30
|
+
readonly committed: Schema.optionalKey<Schema.Boolean>;
|
|
31
|
+
readonly wakeOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
32
|
+
readonly dueOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
33
|
+
readonly owedTo: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
34
|
+
readonly title: Schema.String;
|
|
35
|
+
}>;
|
|
36
|
+
export interface TaskCreate extends Schema.Schema.Type<typeof TaskCreate> {
|
|
37
|
+
}
|
|
38
|
+
export declare const TaskUpdate: Schema.Struct<{
|
|
39
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
40
|
+
readonly parentTaskId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
41
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
42
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
43
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
44
|
+
readonly status: Schema.optionalKey<Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>;
|
|
45
|
+
readonly committed: Schema.optionalKey<Schema.Boolean>;
|
|
46
|
+
readonly wakeOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
47
|
+
readonly dueOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
48
|
+
readonly owedTo: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
49
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
50
|
+
}>;
|
|
51
|
+
export interface TaskUpdate extends Schema.Schema.Type<typeof TaskUpdate> {
|
|
52
|
+
}
|
|
53
|
+
export declare const TaskList: Schema.Struct<{
|
|
54
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
55
|
+
readonly statuses: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>>;
|
|
56
|
+
readonly committed: Schema.optionalKey<Schema.Boolean>;
|
|
57
|
+
readonly archived: Schema.optionalKey<Schema.Boolean>;
|
|
58
|
+
}>;
|
|
59
|
+
export interface TaskList extends Schema.Schema.Type<typeof TaskList> {
|
|
60
|
+
}
|
|
61
|
+
export declare const TaskRef: Schema.Struct<{
|
|
62
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
63
|
+
}>;
|
|
64
|
+
export interface TaskRef extends Schema.Schema.Type<typeof TaskRef> {
|
|
65
|
+
}
|
|
66
|
+
export declare const TaskActions: readonly [Action.Action<"tasks_list", Schema.Struct<{
|
|
67
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
68
|
+
readonly statuses: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>>;
|
|
69
|
+
readonly committed: Schema.optionalKey<Schema.Boolean>;
|
|
70
|
+
readonly archived: Schema.optionalKey<Schema.Boolean>;
|
|
71
|
+
}>, Schema.$Array<Schema.Struct<{
|
|
72
|
+
readonly title: Schema.String;
|
|
73
|
+
readonly description: Schema.String;
|
|
74
|
+
readonly status: Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
75
|
+
readonly committed: Schema.Boolean;
|
|
76
|
+
readonly wakeOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
77
|
+
readonly dueOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
78
|
+
readonly owedTo: Schema.NullOr<Schema.String>;
|
|
79
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
80
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
81
|
+
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
82
|
+
readonly sortKey: Schema.String;
|
|
83
|
+
readonly createdAt: Schema.String;
|
|
84
|
+
readonly updatedAt: Schema.String;
|
|
85
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
86
|
+
}>>, readonly (typeof StorageError)[], true, typeof CurrentPrincipal>, Action.Action<"tasks_get", Schema.Struct<{
|
|
87
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
88
|
+
}>, Schema.Struct<{
|
|
89
|
+
readonly title: Schema.String;
|
|
90
|
+
readonly description: Schema.String;
|
|
91
|
+
readonly status: Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
92
|
+
readonly committed: Schema.Boolean;
|
|
93
|
+
readonly wakeOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
94
|
+
readonly dueOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
95
|
+
readonly owedTo: Schema.NullOr<Schema.String>;
|
|
96
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
97
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
98
|
+
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
99
|
+
readonly sortKey: Schema.String;
|
|
100
|
+
readonly createdAt: Schema.String;
|
|
101
|
+
readonly updatedAt: Schema.String;
|
|
102
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
103
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], true, typeof CurrentPrincipal>, Action.Action<"tasks_create", Schema.Struct<{
|
|
104
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
105
|
+
readonly parentTaskId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
106
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
107
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
108
|
+
readonly status: Schema.optionalKey<Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>;
|
|
109
|
+
readonly committed: Schema.optionalKey<Schema.Boolean>;
|
|
110
|
+
readonly wakeOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
111
|
+
readonly dueOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
112
|
+
readonly owedTo: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
113
|
+
readonly title: Schema.String;
|
|
114
|
+
}>, Schema.Struct<{
|
|
115
|
+
readonly title: Schema.String;
|
|
116
|
+
readonly description: Schema.String;
|
|
117
|
+
readonly status: Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
118
|
+
readonly committed: Schema.Boolean;
|
|
119
|
+
readonly wakeOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
120
|
+
readonly dueOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
121
|
+
readonly owedTo: Schema.NullOr<Schema.String>;
|
|
122
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
123
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
124
|
+
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
125
|
+
readonly sortKey: Schema.String;
|
|
126
|
+
readonly createdAt: Schema.String;
|
|
127
|
+
readonly updatedAt: Schema.String;
|
|
128
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
129
|
+
}>, readonly (typeof PlacementRefused | typeof NoArea | typeof StorageError)[], false, typeof CurrentPrincipal>, Action.Action<"tasks_update", Schema.Struct<{
|
|
130
|
+
readonly areaId: Schema.optionalKey<Schema.brand<Schema.String, "AreaId">>;
|
|
131
|
+
readonly parentTaskId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
132
|
+
readonly beforeId: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "TaskId">>>;
|
|
133
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
134
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
135
|
+
readonly status: Schema.optionalKey<Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>>;
|
|
136
|
+
readonly committed: Schema.optionalKey<Schema.Boolean>;
|
|
137
|
+
readonly wakeOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
138
|
+
readonly dueOn: Schema.optionalKey<Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>>;
|
|
139
|
+
readonly owedTo: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
140
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
141
|
+
}>, Schema.Struct<{
|
|
142
|
+
readonly title: Schema.String;
|
|
143
|
+
readonly description: Schema.String;
|
|
144
|
+
readonly status: Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
145
|
+
readonly committed: Schema.Boolean;
|
|
146
|
+
readonly wakeOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
147
|
+
readonly dueOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
148
|
+
readonly owedTo: Schema.NullOr<Schema.String>;
|
|
149
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
150
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
151
|
+
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
152
|
+
readonly sortKey: Schema.String;
|
|
153
|
+
readonly createdAt: Schema.String;
|
|
154
|
+
readonly updatedAt: Schema.String;
|
|
155
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
156
|
+
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof StorageError)[], false, typeof CurrentPrincipal>, Action.Action<"tasks_archive", Schema.Struct<{
|
|
157
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
158
|
+
}>, Schema.Struct<{
|
|
159
|
+
readonly title: Schema.String;
|
|
160
|
+
readonly description: Schema.String;
|
|
161
|
+
readonly status: Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
162
|
+
readonly committed: Schema.Boolean;
|
|
163
|
+
readonly wakeOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
164
|
+
readonly dueOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
165
|
+
readonly owedTo: Schema.NullOr<Schema.String>;
|
|
166
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
167
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
168
|
+
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
169
|
+
readonly sortKey: Schema.String;
|
|
170
|
+
readonly createdAt: Schema.String;
|
|
171
|
+
readonly updatedAt: Schema.String;
|
|
172
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
173
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], false, typeof CurrentPrincipal>, Action.Action<"tasks_unarchive", Schema.Struct<{
|
|
174
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
175
|
+
}>, Schema.Struct<{
|
|
176
|
+
readonly title: Schema.String;
|
|
177
|
+
readonly description: Schema.String;
|
|
178
|
+
readonly status: Schema.Literals<readonly ["inbox", "backlog", "todo", "in_progress", "done", "cancelled"]>;
|
|
179
|
+
readonly committed: Schema.Boolean;
|
|
180
|
+
readonly wakeOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
181
|
+
readonly dueOn: Schema.NullOr<Schema.brand<Schema.String, "CalendarDate">>;
|
|
182
|
+
readonly owedTo: Schema.NullOr<Schema.String>;
|
|
183
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
184
|
+
readonly areaId: Schema.brand<Schema.String, "AreaId">;
|
|
185
|
+
readonly parentTaskId: Schema.NullOr<Schema.brand<Schema.String, "TaskId">>;
|
|
186
|
+
readonly sortKey: Schema.String;
|
|
187
|
+
readonly createdAt: Schema.String;
|
|
188
|
+
readonly updatedAt: Schema.String;
|
|
189
|
+
readonly archivedAt: Schema.NullOr<Schema.String>;
|
|
190
|
+
}>, readonly (typeof NotFound | typeof PlacementRefused | typeof StorageError)[], false, typeof CurrentPrincipal>, Action.Action<"tasks_remove", Schema.Struct<{
|
|
191
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
192
|
+
}>, Schema.Struct<{
|
|
193
|
+
readonly id: Schema.brand<Schema.String, "TaskId">;
|
|
194
|
+
}>, readonly (typeof NotFound | typeof StorageError)[], false, typeof CurrentPrincipal>];
|
package/dist/tasks.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
|
+
import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { AreaId, CalendarDate, Description, NoArea, NotFound, PlacementRefused, StorageError, TaskId, Title, } from "./shared.js";
|
|
5
|
+
export const TaskStatus = Schema.Literals([
|
|
6
|
+
"inbox",
|
|
7
|
+
"backlog",
|
|
8
|
+
"todo",
|
|
9
|
+
"in_progress",
|
|
10
|
+
"done",
|
|
11
|
+
"cancelled",
|
|
12
|
+
]);
|
|
13
|
+
const content = {
|
|
14
|
+
title: Schema.String,
|
|
15
|
+
description: Schema.String,
|
|
16
|
+
status: TaskStatus,
|
|
17
|
+
committed: Schema.Boolean,
|
|
18
|
+
wakeOn: Schema.NullOr(CalendarDate),
|
|
19
|
+
dueOn: Schema.NullOr(CalendarDate),
|
|
20
|
+
owedTo: Schema.NullOr(Schema.String),
|
|
21
|
+
};
|
|
22
|
+
export const Task = Schema.Struct({
|
|
23
|
+
id: TaskId,
|
|
24
|
+
areaId: AreaId,
|
|
25
|
+
parentTaskId: Schema.NullOr(TaskId),
|
|
26
|
+
...content,
|
|
27
|
+
sortKey: Schema.String,
|
|
28
|
+
createdAt: Schema.String,
|
|
29
|
+
updatedAt: Schema.String,
|
|
30
|
+
archivedAt: Schema.NullOr(Schema.String),
|
|
31
|
+
});
|
|
32
|
+
const placement = {
|
|
33
|
+
areaId: Schema.optionalKey(AreaId),
|
|
34
|
+
parentTaskId: Schema.optionalKey(Schema.NullOr(TaskId)),
|
|
35
|
+
beforeId: Schema.optionalKey(Schema.NullOr(TaskId)),
|
|
36
|
+
};
|
|
37
|
+
const edits = {
|
|
38
|
+
title: Schema.optionalKey(Title),
|
|
39
|
+
description: Schema.optionalKey(Description),
|
|
40
|
+
status: Schema.optionalKey(content.status),
|
|
41
|
+
committed: Schema.optionalKey(content.committed),
|
|
42
|
+
wakeOn: Schema.optionalKey(content.wakeOn),
|
|
43
|
+
dueOn: Schema.optionalKey(content.dueOn),
|
|
44
|
+
owedTo: Schema.optionalKey(Schema.NullOr(Schema.String.check(Schema.isBetweenCodePoints(0, 256)))),
|
|
45
|
+
};
|
|
46
|
+
export const TaskCreate = Schema.Struct({ ...edits, title: Title, ...placement });
|
|
47
|
+
export const TaskUpdate = Schema.Struct({ id: TaskId, ...edits, ...placement });
|
|
48
|
+
export const TaskList = Schema.Struct({
|
|
49
|
+
areaId: Schema.optionalKey(AreaId),
|
|
50
|
+
statuses: Schema.optionalKey(Schema.Array(TaskStatus)),
|
|
51
|
+
committed: Schema.optionalKey(Schema.Boolean),
|
|
52
|
+
archived: Schema.optionalKey(Schema.Boolean),
|
|
53
|
+
});
|
|
54
|
+
export const TaskRef = Schema.Struct({ id: TaskId });
|
|
55
|
+
export const TaskActions = [
|
|
56
|
+
Action.make("tasks_list", {
|
|
57
|
+
caller: CurrentPrincipal,
|
|
58
|
+
error: [StorageError],
|
|
59
|
+
description: "List tasks in area and outline order, optionally filtering area, status, or commitment. Archived tasks are left out unless archived is true, which lists only archived tasks.",
|
|
60
|
+
readOnly: true,
|
|
61
|
+
input: TaskList,
|
|
62
|
+
success: Schema.Array(Task),
|
|
63
|
+
}),
|
|
64
|
+
Action.make("tasks_get", {
|
|
65
|
+
caller: CurrentPrincipal,
|
|
66
|
+
error: [NotFound, StorageError],
|
|
67
|
+
description: "Read a task, including an archived one, whose archivedAt is set.",
|
|
68
|
+
readOnly: true,
|
|
69
|
+
input: TaskRef,
|
|
70
|
+
success: Task,
|
|
71
|
+
}),
|
|
72
|
+
Action.make("tasks_create", {
|
|
73
|
+
caller: CurrentPrincipal,
|
|
74
|
+
error: [PlacementRefused, NoArea, StorageError],
|
|
75
|
+
description: "Capture a task, defaulting to inbox in the first area. A parent supplies its area and must not be archived.",
|
|
76
|
+
readOnly: false,
|
|
77
|
+
input: TaskCreate,
|
|
78
|
+
success: Task,
|
|
79
|
+
}),
|
|
80
|
+
Action.make("tasks_update", {
|
|
81
|
+
caller: CurrentPrincipal,
|
|
82
|
+
error: [NotFound, PlacementRefused, StorageError],
|
|
83
|
+
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.",
|
|
84
|
+
readOnly: false,
|
|
85
|
+
input: TaskUpdate,
|
|
86
|
+
success: Task,
|
|
87
|
+
}),
|
|
88
|
+
Action.make("tasks_archive", {
|
|
89
|
+
caller: CurrentPrincipal,
|
|
90
|
+
error: [NotFound, StorageError],
|
|
91
|
+
description: "Archive a task and its subtree, hiding them from tasks_list unless archived is true. Tasks already archived keep their archivedAt.",
|
|
92
|
+
readOnly: false,
|
|
93
|
+
input: TaskRef,
|
|
94
|
+
success: Task,
|
|
95
|
+
}),
|
|
96
|
+
Action.make("tasks_unarchive", {
|
|
97
|
+
caller: CurrentPrincipal,
|
|
98
|
+
error: [NotFound, PlacementRefused, StorageError],
|
|
99
|
+
description: "Clear archivedAt across a task's whole subtree, restoring the task and every archived task under it, including when the task itself is not archived. Refused with ArchivedParent while its parent is archived; unarchive the parent instead.",
|
|
100
|
+
readOnly: false,
|
|
101
|
+
input: TaskRef,
|
|
102
|
+
success: Task,
|
|
103
|
+
}),
|
|
104
|
+
Action.make("tasks_remove", {
|
|
105
|
+
caller: CurrentPrincipal,
|
|
106
|
+
error: [NotFound, StorageError],
|
|
107
|
+
description: "Permanently delete a task and its subtree, archived tasks in it included.",
|
|
108
|
+
readOnly: false,
|
|
109
|
+
input: TaskRef,
|
|
110
|
+
success: TaskRef,
|
|
111
|
+
}),
|
|
112
|
+
];
|
package/package.json
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjermundgaraba/wtf-api",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The wtf wire contract: the area and task actions, their inputs, records and errors, for a typed HTTP or MCP client.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/gjermundgaraba/wtf.git",
|
|
9
|
+
"directory": "packages/api"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
5
22
|
"publishConfig": {
|
|
6
23
|
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@gjermundgaraba/clankerauth-sdk": "0.24.0",
|
|
27
|
+
"@gjermundgaraba/effect-actions": "0.18.2",
|
|
28
|
+
"effect": "4.0.5",
|
|
29
|
+
"typescript": "7.0.2",
|
|
30
|
+
"vite-plus": "1.3.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@gjermundgaraba/clankerauth-sdk": "^0.24.0",
|
|
34
|
+
"@gjermundgaraba/effect-actions": "^0.18.0",
|
|
35
|
+
"effect": "~4.0.4"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=26.0.0"
|
|
7
39
|
}
|
|
8
|
-
}
|
|
40
|
+
}
|
package/README.md
DELETED