notefeed 0.33.0 → 0.34.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/README.md +2 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/generated/types.gen.d.ts +25 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ Every note has a date, now unless you give one: `client.post(text, { date: "2025
|
|
|
27
27
|
|
|
28
28
|
A note posted with `draft: true` (`notefeed post "…" --draft`) is a draft: readers don't see it, or its pictures, until `client.update(id, { draft: false })` (`notefeed update <id> --publish`) publishes it at its date; `draft: true` (`--draft`) hides it again.
|
|
29
29
|
|
|
30
|
+
Where the operator took a post down for breaking the instance's content rules, a list has a mark in its place: a note with `removed: true`, type `application/x-notefeed-removed`, the removed note's id and date, no content and `file_url` null. Getting it alone or editing it throws `NotFoundError` (code `removed`, 410), and so does the removed note's id after the mark is gone; `client.delete(id)` (`notefeed delete <id>`) takes the mark off the feed, and the note does not come back.
|
|
31
|
+
|
|
30
32
|
`Client.fromEnv()` reads `NOTEFEED_URL` / `NOTEFEED_FEED` / `NOTEFEED_PASSWORD`; so does the `notefeed` command, unless given `--url` / `--feed` / `--password`.
|
|
31
33
|
|
|
32
34
|
A feed can have its own password, which gates reading, listing and posting to it. Pass `feedPassword: "..."` to `new Client(...)` (or per call, e.g. `client.post(text, { feedPassword })`), or set `NOTEFEED_FEED_PASSWORD`, which `fromEnv()` and the `notefeed` command both read (there is deliberately no flag, so it stays out of shell history). It is sent as `X-Feed-Password`; `Authorization` stays the instance password. A feed password is 1 to 256 printable ASCII characters with no space at the start or end; an empty one is the same as none.
|
package/dist/client.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare class RateLimitedError extends NotefeedError {
|
|
|
34
34
|
readonly retryAfter: number | null;
|
|
35
35
|
constructor(message: string, status: number | null, code: ErrorCode | null, retryAfter: number | null);
|
|
36
36
|
}
|
|
37
|
-
/** No such note, or a malformed read id; also a feed the operator removed for good (`removed`, 410). */
|
|
37
|
+
/** No such note, or a malformed read id; also a feed or a note the operator removed for good (`removed`, 410). */
|
|
38
38
|
export declare class NotFoundError extends NotefeedError {
|
|
39
39
|
}
|
|
40
40
|
/** The instance's feed or note limit, or the feed's image limit, is reached. */
|
package/dist/client.js
CHANGED
|
@@ -29,7 +29,7 @@ export class RateLimitedError extends NotefeedError {
|
|
|
29
29
|
this.retryAfter = retryAfter;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
/** No such note, or a malformed read id; also a feed the operator removed for good (`removed`, 410). */
|
|
32
|
+
/** No such note, or a malformed read id; also a feed or a note the operator removed for good (`removed`, 410). */
|
|
33
33
|
export class NotFoundError extends NotefeedError {
|
|
34
34
|
}
|
|
35
35
|
/** The instance's feed or note limit, or the feed's image limit, is reached. */
|
|
@@ -7,7 +7,7 @@ export type Note = {
|
|
|
7
7
|
*/
|
|
8
8
|
id: string;
|
|
9
9
|
/**
|
|
10
|
-
* The media type of the note's file: `text/markdown`, `image/png`, `image/jpeg`, `image/gif` or `image/webp`
|
|
10
|
+
* The media type of the note's file: `text/markdown`, `image/png`, `image/jpeg`, `image/gif` or `image/webp`; `application/x-notefeed-removed` for the operator's mark (see `removed`)
|
|
11
11
|
*/
|
|
12
12
|
type: string;
|
|
13
13
|
/**
|
|
@@ -66,6 +66,10 @@ export type Note = {
|
|
|
66
66
|
* Present, and true, for a damaged note: its stored copy can't be decrypted. A list shows it in its place, with its id, file, type and time; its title and tags are empty, its size 0, it has no content, and reading it alone is a 500 with the code `unreadable`. Deleting it works. Absent for every other note
|
|
67
67
|
*/
|
|
68
68
|
unreadable?: true;
|
|
69
|
+
/**
|
|
70
|
+
* Present, and true, for the mark the operator left where a post was removed for breaking the content rules (type `application/x-notefeed-removed`): it has the removed note's id and date, no content, an empty title, size 0, and `file_url` null; getting it alone is a 410 with the code `removed`, and so is any edit. Deleting it works; the post does not come back. Absent for every other note
|
|
71
|
+
*/
|
|
72
|
+
removed?: true;
|
|
69
73
|
};
|
|
70
74
|
export type NoteList = {
|
|
71
75
|
/**
|
|
@@ -144,7 +148,7 @@ export type NoteEdited = {
|
|
|
144
148
|
*/
|
|
145
149
|
id: string;
|
|
146
150
|
/**
|
|
147
|
-
* The media type of the note's file: `text/markdown`, `image/png`, `image/jpeg`, `image/gif` or `image/webp`
|
|
151
|
+
* The media type of the note's file: `text/markdown`, `image/png`, `image/jpeg`, `image/gif` or `image/webp`; `application/x-notefeed-removed` for the operator's mark (see `removed`)
|
|
148
152
|
*/
|
|
149
153
|
type: string;
|
|
150
154
|
/**
|
|
@@ -203,6 +207,10 @@ export type NoteEdited = {
|
|
|
203
207
|
* Present, and true, for a damaged note: its stored copy can't be decrypted. A list shows it in its place, with its id, file, type and time; its title and tags are empty, its size 0, it has no content, and reading it alone is a 500 with the code `unreadable`. Deleting it works. Absent for every other note
|
|
204
208
|
*/
|
|
205
209
|
unreadable?: true;
|
|
210
|
+
/**
|
|
211
|
+
* Present, and true, for the mark the operator left where a post was removed for breaking the content rules (type `application/x-notefeed-removed`): it has the removed note's id and date, no content, an empty title, size 0, and `file_url` null; getting it alone is a 410 with the code `removed`, and so is any edit. Deleting it works; the post does not come back. Absent for every other note
|
|
212
|
+
*/
|
|
213
|
+
removed?: true;
|
|
206
214
|
/**
|
|
207
215
|
* A multipart request's pictures, one per `file` part, in their order; absent for a raw body
|
|
208
216
|
*/
|
|
@@ -310,11 +318,11 @@ export type FeedSettings = {
|
|
|
310
318
|
};
|
|
311
319
|
export type FreeTier = {
|
|
312
320
|
/**
|
|
313
|
-
* The feed's
|
|
321
|
+
* The feed's notes now: texts, images and the operator's marks alike
|
|
314
322
|
*/
|
|
315
323
|
notes: number;
|
|
316
324
|
/**
|
|
317
|
-
* How many
|
|
325
|
+
* How many notes a free feed keeps; past it, each new note drops the oldest one, of any kind
|
|
318
326
|
*/
|
|
319
327
|
cap: number;
|
|
320
328
|
};
|
|
@@ -660,6 +668,10 @@ export type GetNoteErrors = {
|
|
|
660
668
|
* No such note
|
|
661
669
|
*/
|
|
662
670
|
404: Error;
|
|
671
|
+
/**
|
|
672
|
+
* The operator removed this note (`removed`, #159): for good, also once its mark is deleted; the mark itself can't be edited
|
|
673
|
+
*/
|
|
674
|
+
410: Error;
|
|
663
675
|
/**
|
|
664
676
|
* Too many wrong passwords from this client
|
|
665
677
|
*/
|
|
@@ -715,6 +727,10 @@ export type PatchNoteErrors = {
|
|
|
715
727
|
* The note, or a picture posted with it, is the feed's title image, so it cannot become a draft (`title_image`)
|
|
716
728
|
*/
|
|
717
729
|
409: Error;
|
|
730
|
+
/**
|
|
731
|
+
* The operator removed this note (`removed`, #159): for good, also once its mark is deleted; the mark itself can't be edited
|
|
732
|
+
*/
|
|
733
|
+
410: Error;
|
|
718
734
|
/**
|
|
719
735
|
* Content-Type is not application/json
|
|
720
736
|
*/
|
|
@@ -785,6 +801,10 @@ export type EditNoteErrors = {
|
|
|
785
801
|
* No such note
|
|
786
802
|
*/
|
|
787
803
|
404: Error;
|
|
804
|
+
/**
|
|
805
|
+
* The operator removed this note (`removed`, #159): for good, also once its mark is deleted; the mark itself can't be edited
|
|
806
|
+
*/
|
|
807
|
+
410: Error;
|
|
788
808
|
/**
|
|
789
809
|
* Markdown over 102400 bytes, or an image over NOTEFEED_MAX_IMAGE_BYTES or 100 megapixels (each picture of a multipart body too), or a multipart body over 102400 bytes plus 10 images plus 64 KiB, and never over 64 MiB
|
|
790
810
|
*/
|
|
@@ -1478,7 +1498,7 @@ export type GetReadNoteErrors = {
|
|
|
1478
1498
|
*/
|
|
1479
1499
|
404: Error;
|
|
1480
1500
|
/**
|
|
1481
|
-
* The operator removed the feed this read id belonged to (`removed`)
|
|
1501
|
+
* The operator removed the feed this read id belonged to, or this note (`removed`)
|
|
1482
1502
|
*/
|
|
1483
1503
|
410: Error;
|
|
1484
1504
|
/**
|
package/package.json
CHANGED