@superforge/infra 0.2.0 → 0.3.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/output/client.js
CHANGED
|
@@ -116,7 +116,7 @@ export function infraClient({ key, url = INFRA_URL, send = fetch, paths = APP_PA
|
|
|
116
116
|
return answered(ask("POST", call, proof), call, { status: 200, schema: verified_login }, verify_refused);
|
|
117
117
|
},
|
|
118
118
|
async fileComment(comment) {
|
|
119
|
-
const call = "/comments";
|
|
119
|
+
const call = "/board/comments";
|
|
120
120
|
const filed = await answered(ask("POST", call, comment), call, { status: 201, schema: kept_comment }, comment_refused);
|
|
121
121
|
if (!filed.ok && filed.error.reason !== "unavailable") {
|
|
122
122
|
// What the app sent is wrong, which only a change to it
|
|
@@ -4,7 +4,7 @@ export declare const LONGEST_COMMENT = 5000;
|
|
|
4
4
|
/** How big one comment's body can be, in bytes */
|
|
5
5
|
export declare const COMMENT_BODY_LIMIT: number;
|
|
6
6
|
/**
|
|
7
|
-
* `POST /v1/comments`: what was written, the page's path and title, the
|
|
7
|
+
* `POST /v1/board/comments`: what was written, the page's path and title, the
|
|
8
8
|
* element it's about (a CSS selector from the page's body, its tag, the
|
|
9
9
|
* text it shows or null, its `class`, and its box on the page) or null for
|
|
10
10
|
* the page as a whole, the window's size, who filed it (the app's ID for
|
|
@@ -36,7 +36,7 @@ export declare const filed_comment: z.ZodObject<{
|
|
|
36
36
|
user_agent: z.ZodNullable<z.ZodString>;
|
|
37
37
|
}, z.core.$strip>;
|
|
38
38
|
export type FiledComment = z.input<typeof filed_comment>;
|
|
39
|
-
/** What `POST /v1/comments` answers: the comment's ID, and when */
|
|
39
|
+
/** What `POST /v1/board/comments` answers: the comment's ID, and when */
|
|
40
40
|
export declare const kept_comment: z.ZodPipe<z.ZodObject<{
|
|
41
41
|
comment: z.ZodObject<{
|
|
42
42
|
id: z.ZodString;
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { invalid_refusal, too_large_refusal } from "./errors.js";
|
|
3
3
|
import { user_id } from "./people.js";
|
|
4
4
|
// What an app's people say about it, from the toolbar on its pages: the app's
|
|
5
|
-
// server sends each comment to `POST /v1/comments` with who filed it, and
|
|
5
|
+
// server sends each comment to `POST /v1/board/comments` with who filed it, and
|
|
6
6
|
// Infra keeps it and files it on the app's board. Infra's README,
|
|
7
7
|
// "Comments", has the call.
|
|
8
8
|
/** The most a comment says, in characters */
|
|
@@ -14,7 +14,7 @@ export const COMMENT_BODY_LIMIT = 32 * 1024;
|
|
|
14
14
|
const coordinate = z.number().int().min(-1_000_000).max(10_000_000);
|
|
15
15
|
const length = z.number().int().min(0).max(10_000_000);
|
|
16
16
|
/**
|
|
17
|
-
* `POST /v1/comments`: what was written, the page's path and title, the
|
|
17
|
+
* `POST /v1/board/comments`: what was written, the page's path and title, the
|
|
18
18
|
* element it's about (a CSS selector from the page's body, its tag, the
|
|
19
19
|
* text it shows or null, its `class`, and its box on the page) or null for
|
|
20
20
|
* the page as a whole, the window's size, who filed it (the app's ID for
|
|
@@ -50,7 +50,7 @@ export const filed_comment = z.object({
|
|
|
50
50
|
user_name: z.string().trim().min(1).max(80),
|
|
51
51
|
user_agent: z.string().max(1024).nullable()
|
|
52
52
|
});
|
|
53
|
-
/** What `POST /v1/comments` answers: the comment's ID, and when */
|
|
53
|
+
/** What `POST /v1/board/comments` answers: the comment's ID, and when */
|
|
54
54
|
export const kept_comment = z
|
|
55
55
|
.object({
|
|
56
56
|
comment: z.object({
|
|
@@ -33,6 +33,6 @@ export declare const infra_project: z.ZodObject<{
|
|
|
33
33
|
export type InfraProject = z.output<typeof infra_project>;
|
|
34
34
|
/**
|
|
35
35
|
* The header every call carries, saying which release of @superforge/infra
|
|
36
|
-
* made it (`@superforge/infra/0.
|
|
36
|
+
* made it (`@superforge/infra/0.3.0`), which Infra logs and keeps per key
|
|
37
37
|
*/
|
|
38
38
|
export declare const CLIENT_HEADER = "Infra-Client";
|
|
@@ -31,6 +31,6 @@ export const infra_project = z.object({
|
|
|
31
31
|
});
|
|
32
32
|
/**
|
|
33
33
|
* The header every call carries, saying which release of @superforge/infra
|
|
34
|
-
* made it (`@superforge/infra/0.
|
|
34
|
+
* made it (`@superforge/infra/0.3.0`), which Infra logs and keeps per key
|
|
35
35
|
*/
|
|
36
36
|
export const CLIENT_HEADER = "Infra-Client";
|
package/output/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** The package's version, as package.json says it */
|
|
2
|
-
export declare const PACKAGE_VERSION = "0.
|
|
3
|
-
/** What it says: the package and its version, `@superforge/infra/0.
|
|
4
|
-
export declare const CLIENT = "@superforge/infra/0.
|
|
2
|
+
export declare const PACKAGE_VERSION = "0.3.0";
|
|
3
|
+
/** What it says: the package and its version, `@superforge/infra/0.3.0` */
|
|
4
|
+
export declare const CLIENT = "@superforge/infra/0.3.0";
|
package/output/version.js
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
// package away from its package.json; a test checks the two agree, so a
|
|
6
6
|
// release that bumps one and not the other fails `pnpm check`.
|
|
7
7
|
/** The package's version, as package.json says it */
|
|
8
|
-
export const PACKAGE_VERSION = "0.
|
|
9
|
-
/** What it says: the package and its version, `@superforge/infra/0.
|
|
8
|
+
export const PACKAGE_VERSION = "0.3.0";
|
|
9
|
+
/** What it says: the package and its version, `@superforge/infra/0.3.0` */
|
|
10
10
|
export const CLIENT = `@superforge/infra/${PACKAGE_VERSION}`;
|
package/package.json
CHANGED