notefeed 0.2.0 → 0.5.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 +202 -21
- package/README.md +9 -6
- package/dist/bin.js +6 -0
- package/dist/cli.js +42 -15
- package/dist/client.d.ts +52 -17
- package/dist/client.js +127 -53
- package/dist/generated/client/client.gen.d.ts +2 -0
- package/dist/generated/client/client.gen.js +216 -0
- package/dist/generated/client/index.d.ts +10 -0
- package/dist/generated/client/index.js +6 -0
- package/dist/generated/client/types.gen.d.ts +120 -0
- package/dist/generated/client/types.gen.js +2 -0
- package/dist/generated/client/utils.gen.d.ts +37 -0
- package/dist/generated/client/utils.gen.js +228 -0
- package/dist/generated/client.gen.d.ts +12 -0
- package/dist/generated/client.gen.js +3 -0
- package/dist/generated/core/auth.gen.d.ts +25 -0
- package/dist/generated/core/auth.gen.js +14 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
- package/dist/generated/core/bodySerializer.gen.js +57 -0
- package/dist/generated/core/params.gen.d.ts +43 -0
- package/dist/generated/core/params.gen.js +109 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
- package/dist/generated/core/pathSerializer.gen.js +106 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/generated/core/queryKeySerializer.gen.js +92 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/generated/core/serverSentEvents.gen.js +132 -0
- package/dist/generated/core/types.gen.d.ts +83 -0
- package/dist/generated/core/types.gen.js +2 -0
- package/dist/generated/core/utils.gen.d.ts +19 -0
- package/dist/generated/core/utils.gen.js +87 -0
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/index.js +2 -0
- package/dist/generated/sdk.gen.d.ts +49 -0
- package/dist/generated/sdk.gen.js +52 -0
- package/dist/generated/types.gen.d.ts +276 -0
- package/dist/generated/types.gen.js +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +18 -5
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
export type ClientOptions = {
|
|
2
|
+
baseUrl: 'https://notefeed.me' | (string & {});
|
|
3
|
+
};
|
|
4
|
+
export type Note = {
|
|
5
|
+
/**
|
|
6
|
+
* UTC time to the second plus a slug of the title
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* The first heading, or the first non-empty line; may be empty
|
|
11
|
+
*/
|
|
12
|
+
title: string;
|
|
13
|
+
/**
|
|
14
|
+
* The note, byte-for-byte as posted
|
|
15
|
+
*/
|
|
16
|
+
markdown: string;
|
|
17
|
+
/**
|
|
18
|
+
* When the note was posted (UTC)
|
|
19
|
+
*/
|
|
20
|
+
created_at: string;
|
|
21
|
+
/**
|
|
22
|
+
* The note's page in the web UI
|
|
23
|
+
*/
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
export type NoteList = {
|
|
27
|
+
/**
|
|
28
|
+
* Newest first
|
|
29
|
+
*/
|
|
30
|
+
notes: Array<Note>;
|
|
31
|
+
/**
|
|
32
|
+
* Pass as `before` for the next (older) page; null on the last page
|
|
33
|
+
*/
|
|
34
|
+
next: string | null;
|
|
35
|
+
};
|
|
36
|
+
export type Created = {
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* The note's page in the web UI
|
|
40
|
+
*/
|
|
41
|
+
url: string;
|
|
42
|
+
/**
|
|
43
|
+
* The feed's page in the web UI
|
|
44
|
+
*/
|
|
45
|
+
feed_url: string;
|
|
46
|
+
/**
|
|
47
|
+
* The feed's read-only RSS link, safe to share
|
|
48
|
+
*/
|
|
49
|
+
read_url: string;
|
|
50
|
+
};
|
|
51
|
+
export type Error = {
|
|
52
|
+
/**
|
|
53
|
+
* A short reason, for people
|
|
54
|
+
*/
|
|
55
|
+
error: string;
|
|
56
|
+
/**
|
|
57
|
+
* Stable machine-readable code; absent only on a 500
|
|
58
|
+
*/
|
|
59
|
+
code?: 'invalid_feed' | 'reserved_feed' | 'auth' | 'rate_limited' | 'too_many_attempts' | 'feed_limit' | 'note_limit' | 'empty_note' | 'too_large' | 'unsupported_type' | 'invalid_body' | 'invalid_request' | 'not_found';
|
|
60
|
+
};
|
|
61
|
+
export type PostJson = {
|
|
62
|
+
markdown: string;
|
|
63
|
+
};
|
|
64
|
+
export type PostForm = {
|
|
65
|
+
markdown: string;
|
|
66
|
+
};
|
|
67
|
+
export type ListNotesData = {
|
|
68
|
+
body?: never;
|
|
69
|
+
path: {
|
|
70
|
+
/**
|
|
71
|
+
* The feed's name. It is the write key: anyone who knows it can post.
|
|
72
|
+
*/
|
|
73
|
+
feed: string;
|
|
74
|
+
};
|
|
75
|
+
query?: {
|
|
76
|
+
/**
|
|
77
|
+
* Notes per page, 1–100
|
|
78
|
+
*/
|
|
79
|
+
limit?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Only notes older than this id: the previous page's `next`
|
|
82
|
+
*/
|
|
83
|
+
before?: string;
|
|
84
|
+
};
|
|
85
|
+
url: '/api/v1/feeds/{feed}/notes';
|
|
86
|
+
};
|
|
87
|
+
export type ListNotesErrors = {
|
|
88
|
+
/**
|
|
89
|
+
* Invalid or reserved feed name, or a bad `limit` / `before`
|
|
90
|
+
*/
|
|
91
|
+
400: Error;
|
|
92
|
+
/**
|
|
93
|
+
* The instance has a password and it is missing or wrong
|
|
94
|
+
*/
|
|
95
|
+
401: Error;
|
|
96
|
+
/**
|
|
97
|
+
* Too many wrong passwords from this client
|
|
98
|
+
*/
|
|
99
|
+
429: Error;
|
|
100
|
+
};
|
|
101
|
+
export type ListNotesError = ListNotesErrors[keyof ListNotesErrors];
|
|
102
|
+
export type ListNotesResponses = {
|
|
103
|
+
/**
|
|
104
|
+
* A page of notes
|
|
105
|
+
*/
|
|
106
|
+
200: NoteList;
|
|
107
|
+
};
|
|
108
|
+
export type ListNotesResponse = ListNotesResponses[keyof ListNotesResponses];
|
|
109
|
+
export type PostNoteData = {
|
|
110
|
+
body: PostJson;
|
|
111
|
+
path: {
|
|
112
|
+
/**
|
|
113
|
+
* The feed's name. It is the write key: anyone who knows it can post.
|
|
114
|
+
*/
|
|
115
|
+
feed: string;
|
|
116
|
+
};
|
|
117
|
+
query?: never;
|
|
118
|
+
url: '/api/v1/feeds/{feed}/notes';
|
|
119
|
+
};
|
|
120
|
+
export type PostNoteErrors = {
|
|
121
|
+
/**
|
|
122
|
+
* Invalid or reserved feed name; empty note; bad JSON, form or UTF-8
|
|
123
|
+
*/
|
|
124
|
+
400: Error;
|
|
125
|
+
/**
|
|
126
|
+
* The instance has a password and it is missing or wrong
|
|
127
|
+
*/
|
|
128
|
+
401: Error;
|
|
129
|
+
/**
|
|
130
|
+
* Body over 102400 bytes
|
|
131
|
+
*/
|
|
132
|
+
413: Error;
|
|
133
|
+
/**
|
|
134
|
+
* Unsupported content type
|
|
135
|
+
*/
|
|
136
|
+
415: Error;
|
|
137
|
+
/**
|
|
138
|
+
* Too many posts, or wrong passwords, from this client
|
|
139
|
+
*/
|
|
140
|
+
429: Error;
|
|
141
|
+
/**
|
|
142
|
+
* NOTEFEED_MAX_FEEDS or NOTEFEED_MAX_NOTES_PER_FEED reached
|
|
143
|
+
*/
|
|
144
|
+
507: Error;
|
|
145
|
+
};
|
|
146
|
+
export type PostNoteError = PostNoteErrors[keyof PostNoteErrors];
|
|
147
|
+
export type PostNoteResponses = {
|
|
148
|
+
/**
|
|
149
|
+
* Stored
|
|
150
|
+
*/
|
|
151
|
+
201: Created;
|
|
152
|
+
};
|
|
153
|
+
export type PostNoteResponse = PostNoteResponses[keyof PostNoteResponses];
|
|
154
|
+
export type GetNoteData = {
|
|
155
|
+
body?: never;
|
|
156
|
+
path: {
|
|
157
|
+
/**
|
|
158
|
+
* The feed's name. It is the write key: anyone who knows it can post.
|
|
159
|
+
*/
|
|
160
|
+
feed: string;
|
|
161
|
+
/**
|
|
162
|
+
* The note's id
|
|
163
|
+
*/
|
|
164
|
+
id: string;
|
|
165
|
+
};
|
|
166
|
+
query?: never;
|
|
167
|
+
url: '/api/v1/feeds/{feed}/notes/{id}';
|
|
168
|
+
};
|
|
169
|
+
export type GetNoteErrors = {
|
|
170
|
+
/**
|
|
171
|
+
* Invalid or reserved feed name
|
|
172
|
+
*/
|
|
173
|
+
400: Error;
|
|
174
|
+
/**
|
|
175
|
+
* The instance has a password and it is missing or wrong
|
|
176
|
+
*/
|
|
177
|
+
401: Error;
|
|
178
|
+
/**
|
|
179
|
+
* No such note
|
|
180
|
+
*/
|
|
181
|
+
404: Error;
|
|
182
|
+
/**
|
|
183
|
+
* Too many wrong passwords from this client
|
|
184
|
+
*/
|
|
185
|
+
429: Error;
|
|
186
|
+
};
|
|
187
|
+
export type GetNoteError = GetNoteErrors[keyof GetNoteErrors];
|
|
188
|
+
export type GetNoteResponses = {
|
|
189
|
+
/**
|
|
190
|
+
* The note
|
|
191
|
+
*/
|
|
192
|
+
200: Note;
|
|
193
|
+
};
|
|
194
|
+
export type GetNoteResponse = GetNoteResponses[keyof GetNoteResponses];
|
|
195
|
+
export type ListReadNotesData = {
|
|
196
|
+
body?: never;
|
|
197
|
+
path: {
|
|
198
|
+
/**
|
|
199
|
+
* The feed's read id, from its read link. Read-only; never reveals the name.
|
|
200
|
+
*/
|
|
201
|
+
readId: string;
|
|
202
|
+
};
|
|
203
|
+
query?: {
|
|
204
|
+
/**
|
|
205
|
+
* Notes per page, 1–100
|
|
206
|
+
*/
|
|
207
|
+
limit?: number;
|
|
208
|
+
/**
|
|
209
|
+
* Only notes older than this id: the previous page's `next`
|
|
210
|
+
*/
|
|
211
|
+
before?: string;
|
|
212
|
+
};
|
|
213
|
+
url: '/api/v1/read/{readId}/notes';
|
|
214
|
+
};
|
|
215
|
+
export type ListReadNotesErrors = {
|
|
216
|
+
/**
|
|
217
|
+
* A bad `limit` / `before`
|
|
218
|
+
*/
|
|
219
|
+
400: Error;
|
|
220
|
+
/**
|
|
221
|
+
* Malformed read id
|
|
222
|
+
*/
|
|
223
|
+
404: Error;
|
|
224
|
+
};
|
|
225
|
+
export type ListReadNotesError = ListReadNotesErrors[keyof ListReadNotesErrors];
|
|
226
|
+
export type ListReadNotesResponses = {
|
|
227
|
+
/**
|
|
228
|
+
* A page of notes
|
|
229
|
+
*/
|
|
230
|
+
200: NoteList;
|
|
231
|
+
};
|
|
232
|
+
export type ListReadNotesResponse = ListReadNotesResponses[keyof ListReadNotesResponses];
|
|
233
|
+
export type GetReadNoteData = {
|
|
234
|
+
body?: never;
|
|
235
|
+
path: {
|
|
236
|
+
/**
|
|
237
|
+
* The feed's read id, from its read link. Read-only; never reveals the name.
|
|
238
|
+
*/
|
|
239
|
+
readId: string;
|
|
240
|
+
/**
|
|
241
|
+
* The note's id
|
|
242
|
+
*/
|
|
243
|
+
id: string;
|
|
244
|
+
};
|
|
245
|
+
query?: never;
|
|
246
|
+
url: '/api/v1/read/{readId}/notes/{id}';
|
|
247
|
+
};
|
|
248
|
+
export type GetReadNoteErrors = {
|
|
249
|
+
/**
|
|
250
|
+
* No such note, or a malformed or unknown read id
|
|
251
|
+
*/
|
|
252
|
+
404: Error;
|
|
253
|
+
};
|
|
254
|
+
export type GetReadNoteError = GetReadNoteErrors[keyof GetReadNoteErrors];
|
|
255
|
+
export type GetReadNoteResponses = {
|
|
256
|
+
/**
|
|
257
|
+
* The note
|
|
258
|
+
*/
|
|
259
|
+
200: Note;
|
|
260
|
+
};
|
|
261
|
+
export type GetReadNoteResponse = GetReadNoteResponses[keyof GetReadNoteResponses];
|
|
262
|
+
export type GetOpenApiData = {
|
|
263
|
+
body?: never;
|
|
264
|
+
path?: never;
|
|
265
|
+
query?: never;
|
|
266
|
+
url: '/api/v1/openapi.json';
|
|
267
|
+
};
|
|
268
|
+
export type GetOpenApiResponses = {
|
|
269
|
+
/**
|
|
270
|
+
* OpenAPI 3.1
|
|
271
|
+
*/
|
|
272
|
+
200: {
|
|
273
|
+
[key: string]: unknown;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
export type GetOpenApiResponse = GetOpenApiResponses[keyof GetOpenApiResponses];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AuthError, Client, ConfigError,
|
|
2
|
-
export type { ClientOptions, Note } from "./client.js";
|
|
1
|
+
export { AuthError, Client, ConfigError, InvalidRequestError, LimitReachedError, NotefeedError, NotFoundError, NoteTooLargeError, RateLimitedError, } from "./client.js";
|
|
2
|
+
export type { ClientOptions, Created, ErrorCode, Note } from "./client.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AuthError, Client, ConfigError,
|
|
1
|
+
export { AuthError, Client, ConfigError, InvalidRequestError, LimitReachedError, NotefeedError, NotFoundError, NoteTooLargeError, RateLimitedError, } from "./client.js";
|
package/package.json
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notefeed",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Client and CLI for notefeed, a self-hosted inbox for markdown notes that you read back as RSS.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "Marcel Bruckner",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"notefeed",
|
|
9
|
+
"notes",
|
|
10
|
+
"markdown",
|
|
11
|
+
"rss",
|
|
12
|
+
"self-hosted",
|
|
13
|
+
"homelab",
|
|
14
|
+
"cli"
|
|
15
|
+
],
|
|
6
16
|
"type": "module",
|
|
7
17
|
"exports": {
|
|
8
18
|
".": {
|
|
@@ -21,7 +31,7 @@
|
|
|
21
31
|
},
|
|
22
32
|
"scripts": {
|
|
23
33
|
"build": "tsc",
|
|
24
|
-
"test": "vitest run",
|
|
34
|
+
"test": "tsc && vitest run",
|
|
25
35
|
"prepublishOnly": "npm run build"
|
|
26
36
|
},
|
|
27
37
|
"repository": {
|
|
@@ -29,7 +39,10 @@
|
|
|
29
39
|
"url": "git+https://github.com/Marceltov/notefeed.git",
|
|
30
40
|
"directory": "packages/js"
|
|
31
41
|
},
|
|
32
|
-
"homepage": "https://
|
|
42
|
+
"homepage": "https://docs.notefeed.me/clients/",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/Marceltov/notefeed/issues"
|
|
45
|
+
},
|
|
33
46
|
"devDependencies": {
|
|
34
47
|
"@types/node": "^20",
|
|
35
48
|
"typescript": "^5.9",
|