@gjermundgaraba/wtf-api 0.6.0 → 0.7.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/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import * as Authentication from "@gjermundgaraba/effect-actions/Authentication";
5
5
  export * from "./shared.ts";
6
6
  export * from "./areas.ts";
7
7
  export * from "./tasks.ts";
8
+ export * from "./values.ts";
8
9
  export { Principal, signOutUrl } from "@gjermundgaraba/clankerauth-sdk/session";
9
10
  export { ProviderUnavailable } from "@gjermundgaraba/clankerauth-sdk/errors";
10
11
  export { InvalidInput, Unauthenticated, Forbidden, } from "@gjermundgaraba/effect-actions/Action";
@@ -180,7 +181,13 @@ export declare const actions: readonly [import("@gjermundgaraba/effect-actions/A
180
181
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
181
182
  }>, import("effect/Schema").Struct<{
182
183
  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, undefined, undefined>];
184
+ }>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"values_get", import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Never>, import("effect/Schema").Struct<{
185
+ readonly text: import("effect/Schema").String;
186
+ }>, readonly typeof import("./shared.ts").StorageError[], true, typeof CurrentPrincipal, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"values_update", import("effect/Schema").Struct<{
187
+ readonly text: import("effect/Schema").String;
188
+ }>, import("effect/Schema").Struct<{
189
+ readonly text: import("effect/Schema").String;
190
+ }>, readonly typeof import("./shared.ts").StorageError[], false, typeof CurrentPrincipal, undefined, undefined>];
184
191
  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
192
  readonly subject: import("effect/Schema").NonEmptyString;
186
193
  readonly issuer: import("effect/Schema").NonEmptyString;
@@ -356,4 +363,10 @@ export declare const Http: ActionHttp.Binding<readonly [import("@gjermundgaraba/
356
363
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "TaskId">;
357
364
  }>, import("effect/Schema").Struct<{
358
365
  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, undefined, undefined>], [], Authentication.Descriptor<CurrentPrincipal, import("@gjermundgaraba/clankerauth-sdk/session").Caller, import("effect/http-api/HttpApiSecurity").Http, "wtf.Login", readonly [typeof ProviderUnavailable]>, readonly []>;
366
+ }>, readonly (typeof import("./shared.ts").NotFound | typeof import("./shared.ts").StorageError)[], false, typeof CurrentPrincipal, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"values_get", import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Never>, import("effect/Schema").Struct<{
367
+ readonly text: import("effect/Schema").String;
368
+ }>, readonly typeof import("./shared.ts").StorageError[], true, typeof CurrentPrincipal, undefined, undefined>, import("@gjermundgaraba/effect-actions/Action").Action<"values_update", import("effect/Schema").Struct<{
369
+ readonly text: import("effect/Schema").String;
370
+ }>, import("effect/Schema").Struct<{
371
+ readonly text: import("effect/Schema").String;
372
+ }>, readonly typeof import("./shared.ts").StorageError[], false, typeof CurrentPrincipal, undefined, undefined>], [], Authentication.Descriptor<CurrentPrincipal, import("@gjermundgaraba/clankerauth-sdk/session").Caller, import("effect/http-api/HttpApiSecurity").Http, "wtf.Login", readonly [typeof ProviderUnavailable]>, readonly []>;
package/dist/index.js CHANGED
@@ -4,16 +4,22 @@ import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
4
4
  import * as Authentication from "@gjermundgaraba/effect-actions/Authentication";
5
5
  import { AreaActions } from "./areas.js";
6
6
  import { TaskActions } from "./tasks.js";
7
+ import { ValuesActions } from "./values.js";
7
8
  export * from "./shared.js";
8
9
  export * from "./areas.js";
9
10
  export * from "./tasks.js";
11
+ export * from "./values.js";
10
12
  export { Principal, signOutUrl } from "@gjermundgaraba/clankerauth-sdk/session";
11
13
  export { ProviderUnavailable } from "@gjermundgaraba/clankerauth-sdk/errors";
12
14
  export { InvalidInput, Unauthenticated, Forbidden, } from "@gjermundgaraba/effect-actions/Action";
13
15
  export const Login = Authentication.make("wtf.Login", CurrentPrincipal, {
14
16
  error: ProviderUnavailable,
15
17
  });
16
- export const actions = [...AreaActions, ...TaskActions];
18
+ export const actions = [
19
+ ...AreaActions,
20
+ ...TaskActions,
21
+ ...ValuesActions,
22
+ ];
17
23
  export const Http = ActionHttp.make([Whoami, ...actions], {
18
24
  authentication: Login,
19
25
  });
package/dist/shared.js CHANGED
@@ -5,7 +5,9 @@ const TITLE_MAX_CODE_POINTS = 1024;
5
5
  export const Title = Schema.String.check(Schema.isMaxCodePoints(TITLE_MAX_CODE_POINTS, {
6
6
  message: `Must be ${TITLE_MAX_CODE_POINTS.toLocaleString("en")} characters or fewer.`,
7
7
  }), Schema.isPattern(/\S/u, { message: "Can't be blank." }));
8
- export const Description = Schema.String.check(Schema.isBetweenCodePoints(0, 65_536));
8
+ export const Description = Schema.String.check(Schema.isBetweenCodePoints(0, 65_536, {
9
+ message: "Must be 65,536 characters or fewer.",
10
+ }));
9
11
  export const CalendarDate = Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}$/u, {
10
12
  expected: "a calendar date in YYYY-MM-DD format",
11
13
  }), Schema.makeFilter((value) => {
@@ -0,0 +1,19 @@
1
+ import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
2
+ import * as Action from "@gjermundgaraba/effect-actions/Action";
3
+ import { Schema } from "effect";
4
+ import { StorageError } from "./shared.ts";
5
+ export declare const Values: Schema.Struct<{
6
+ readonly text: Schema.String;
7
+ }>;
8
+ export type Values = typeof Values.Type;
9
+ export declare const ValuesUpdate: Schema.Struct<{
10
+ readonly text: Schema.String;
11
+ }>;
12
+ export type ValuesUpdate = typeof ValuesUpdate.Type;
13
+ export declare const ValuesActions: readonly [Action.Action<"values_get", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
14
+ readonly text: Schema.String;
15
+ }>, readonly (typeof StorageError)[], true, typeof CurrentPrincipal, undefined, undefined>, Action.Action<"values_update", Schema.Struct<{
16
+ readonly text: Schema.String;
17
+ }>, Schema.Struct<{
18
+ readonly text: Schema.String;
19
+ }>, readonly (typeof StorageError)[], false, typeof CurrentPrincipal, undefined, undefined>];
package/dist/values.js ADDED
@@ -0,0 +1,23 @@
1
+ import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
2
+ import * as Action from "@gjermundgaraba/effect-actions/Action";
3
+ import { Schema } from "effect";
4
+ import { Description, StorageError } from "./shared.js";
5
+ export const Values = Schema.Struct({ text: Schema.String });
6
+ export const ValuesUpdate = Schema.Struct({ text: Description });
7
+ export const ValuesActions = [
8
+ Action.make("values_get", {
9
+ caller: CurrentPrincipal,
10
+ error: [StorageError],
11
+ description: "Read the values document.",
12
+ readOnly: true,
13
+ success: Values,
14
+ }),
15
+ Action.make("values_update", {
16
+ caller: CurrentPrincipal,
17
+ error: [StorageError],
18
+ description: "Replace the values document. The last save wins.",
19
+ readOnly: false,
20
+ input: ValuesUpdate,
21
+ success: Values,
22
+ }),
23
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjermundgaraba/wtf-api",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "The wtf wire contract: the area and task actions, their inputs, records and errors, for a typed HTTP or MCP client.",
5
5
  "license": "MIT",
6
6
  "repository": {