notefeed 0.29.0 → 0.30.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/client.d.ts +11 -0
- package/dist/client.js +12 -1
- package/dist/generated/client/utils.gen.d.ts +2 -2
- package/dist/generated/core/pathSerializer.gen.d.ts +3 -3
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +13 -1
- package/dist/generated/sdk.gen.js +28 -0
- package/dist/generated/types.gen.d.ts +118 -0
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -142,6 +142,17 @@ export declare class Client {
|
|
|
142
142
|
feed?: string;
|
|
143
143
|
feedPassword?: string;
|
|
144
144
|
}): Promise<void>;
|
|
145
|
+
/** Create the feed without posting a note, to reserve its name: `password` protects it from its first moment, `readId` gives it that read link. Where licenses are sold `licenseKey` is required and goes on the new feed. A feed that exists is refused (409). */
|
|
146
|
+
createFeed(options?: {
|
|
147
|
+
feed?: string;
|
|
148
|
+
password?: string;
|
|
149
|
+
licenseKey?: string;
|
|
150
|
+
readId?: string;
|
|
151
|
+
}): Promise<Feed>;
|
|
152
|
+
/** For a lost password, only on an instance that sells licenses: the key of the license on the feed proves ownership instead of the current password. `password` becomes the feed's password (needs an active license); left out or empty, the password is removed, which a lapsed license's key may do too. A key that is not the feed's license is refused and counts as a failed attempt. */
|
|
153
|
+
recoverFeedPassword(key: string, password?: string, options?: {
|
|
154
|
+
feed?: string;
|
|
155
|
+
}): Promise<void>;
|
|
145
156
|
/** Delete the feed with all its notes, settings and password, for good; its name is free again. Same options as post(). */
|
|
146
157
|
deleteFeed(options?: {
|
|
147
158
|
feed?: string;
|
package/dist/client.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* OpenAPI description (./generated, `npm run generate` in the repo). No runtime dependencies.
|
|
4
4
|
*/
|
|
5
5
|
import { createClient, createConfig } from "./generated/client/index.js";
|
|
6
|
-
import { changeFeedPassword, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getReadNote, listNotes, listReadNotes, patchNote, postNote, putFeedLicense, updateFeed } from "./generated/sdk.gen.js";
|
|
6
|
+
import { changeFeedPassword, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getReadNote, listNotes, listReadNotes, patchNote, postNote, putFeedLicense, recoverFeedPassword, updateFeed } from "./generated/sdk.gen.js";
|
|
7
7
|
/** Any failure talking to notefeed. `status` and `code` are null when there was no API answer. */
|
|
8
8
|
export class NotefeedError extends Error {
|
|
9
9
|
status;
|
|
@@ -227,6 +227,17 @@ export class Client {
|
|
|
227
227
|
const feed = this.feedFor(options.feed);
|
|
228
228
|
await this.call(changeFeedPassword({ client: this.api, path: { feed }, body: { password }, ...this.opts(options.feedPassword) }));
|
|
229
229
|
}
|
|
230
|
+
/** Create the feed without posting a note, to reserve its name: `password` protects it from its first moment, `readId` gives it that read link. Where licenses are sold `licenseKey` is required and goes on the new feed. A feed that exists is refused (409). */
|
|
231
|
+
async createFeed(options = {}) {
|
|
232
|
+
const feed = this.feedFor(options.feed);
|
|
233
|
+
const body = { ...(options.password ? { password: options.password } : {}), ...(options.licenseKey ? { license_key: options.licenseKey } : {}), ...(options.readId ? { read_id: options.readId } : {}) };
|
|
234
|
+
return this.call(createFeed({ client: this.api, path: { feed }, body, signal: AbortSignal.timeout(this.timeoutMs) }));
|
|
235
|
+
}
|
|
236
|
+
/** For a lost password, only on an instance that sells licenses: the key of the license on the feed proves ownership instead of the current password. `password` becomes the feed's password (needs an active license); left out or empty, the password is removed, which a lapsed license's key may do too. A key that is not the feed's license is refused and counts as a failed attempt. */
|
|
237
|
+
async recoverFeedPassword(key, password = "", options = {}) {
|
|
238
|
+
const feed = this.feedFor(options.feed);
|
|
239
|
+
await this.call(recoverFeedPassword({ client: this.api, path: { feed }, body: { key, password }, signal: AbortSignal.timeout(this.timeoutMs) })); // the key instead of the (lost) feed password
|
|
240
|
+
}
|
|
230
241
|
/** Delete the feed with all its notes, settings and password, for good; its name is free again. Same options as post(). */
|
|
231
242
|
async deleteFeed(options = {}) {
|
|
232
243
|
const feed = this.feedFor(options.feed);
|
|
@@ -4,13 +4,13 @@ export declare const createQuerySerializer: <T = unknown>({ parameters, ...args
|
|
|
4
4
|
/**
|
|
5
5
|
* Infers parseAs value from provided Content-Type header.
|
|
6
6
|
*/
|
|
7
|
-
export declare const getParseAs: (contentType: string | null) => Exclude<Config[
|
|
7
|
+
export declare const getParseAs: (contentType: string | null) => Exclude<Config['parseAs'], 'auto'>;
|
|
8
8
|
export declare function setAuthParams(options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {
|
|
9
9
|
headers: Headers;
|
|
10
10
|
}): Promise<void>;
|
|
11
11
|
export declare const buildUrl: Client['buildUrl'];
|
|
12
12
|
export declare const mergeConfigs: (a: Config, b: Config) => Config;
|
|
13
|
-
export declare const mergeHeaders: (...headers: Array<Required<Config>[
|
|
13
|
+
export declare const mergeHeaders: (...headers: Array<Required<Config>['headers'] | undefined>) => Headers;
|
|
14
14
|
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
15
15
|
/** response may be undefined due to a network error where no response object is produced */
|
|
16
16
|
response: Res | undefined,
|
|
@@ -19,9 +19,9 @@ type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
|
|
19
19
|
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
|
20
20
|
value: string;
|
|
21
21
|
}
|
|
22
|
-
export declare const separatorArrayExplode: (style: ArraySeparatorStyle) =>
|
|
23
|
-
export declare const separatorArrayNoExplode: (style: ArraySeparatorStyle) =>
|
|
24
|
-
export declare const separatorObjectExplode: (style: ObjectSeparatorStyle) =>
|
|
22
|
+
export declare const separatorArrayExplode: (style: ArraySeparatorStyle) => '.' | ';' | ',' | '&';
|
|
23
|
+
export declare const separatorArrayNoExplode: (style: ArraySeparatorStyle) => ',' | '|' | '%20';
|
|
24
|
+
export declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => '.' | ';' | ',' | '&';
|
|
25
25
|
export declare const serializeArrayParam: ({ allowReserved, explode, name, style, value, }: SerializeOptions<ArraySeparatorStyle> & {
|
|
26
26
|
value: unknown[];
|
|
27
27
|
}) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { changeFeedPassword, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getOpenApi, getReadFeed, getReadNote, listNotes, listReadNotes, type Options, patchNote, postNote, putFeedLicense, removeFeedPassword, updateFeed } from './sdk.gen.js';
|
|
2
|
-
export type { ChangeFeedPasswordData, ChangeFeedPasswordError, ChangeFeedPasswordErrors, ChangeFeedPasswordResponse, ChangeFeedPasswordResponses, ClientOptions, Created, DeleteFeedData, DeleteFeedError, DeleteFeedErrors, DeleteFeedLicenseData, DeleteFeedLicenseError, DeleteFeedLicenseErrors, DeleteFeedLicenseResponse, DeleteFeedLicenseResponses, DeleteFeedResponse, DeleteFeedResponses, DeleteNoteData, DeleteNoteError, DeleteNoteErrors, DeleteNoteResponse, DeleteNoteResponses, EditNoteData, EditNoteError, EditNoteErrors, EditNoteResponse, EditNoteResponses, Error, Feed, FeedSettings, FreeTier, GetFeedData, GetFeedError, GetFeedErrors, GetFeedResponse, GetFeedResponses, GetNoteData, GetNoteError, GetNoteErrors, GetNoteResponse, GetNoteResponses, GetOpenApiData, GetOpenApiResponse, GetOpenApiResponses, GetReadFeedData, GetReadFeedError, GetReadFeedErrors, GetReadFeedResponse, GetReadFeedResponses, GetReadNoteData, GetReadNoteError, GetReadNoteErrors, GetReadNoteResponse, GetReadNoteResponses, LicenseKey, ListNotesData, ListNotesError, ListNotesErrors, ListNotesResponse, ListNotesResponses, ListReadNotesData, ListReadNotesError, ListReadNotesErrors, ListReadNotesResponse, ListReadNotesResponses, MultipartNote, Note, NoteEdited, NoteList, NoteMeta, PasswordJson, PatchNoteData, PatchNoteError, PatchNoteErrors, PatchNoteResponse, PatchNoteResponses, Posted, PostNoteData, PostNoteError, PostNoteErrors, PostNoteResponse, PostNoteResponses, PutFeedLicenseData, PutFeedLicenseError, PutFeedLicenseErrors, PutFeedLicenseResponse, PutFeedLicenseResponses, ReadFeed, RemoveFeedPasswordData, RemoveFeedPasswordError, RemoveFeedPasswordErrors, RemoveFeedPasswordResponse, RemoveFeedPasswordResponses, UpdateFeedData, UpdateFeedError, UpdateFeedErrors, UpdateFeedResponse, UpdateFeedResponses } from './types.gen.js';
|
|
1
|
+
export { changeFeedPassword, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getOpenApi, getReadFeed, getReadNote, listNotes, listReadNotes, type Options, patchNote, postNote, putFeedLicense, recoverFeedPassword, removeFeedPassword, updateFeed } from './sdk.gen.js';
|
|
2
|
+
export type { ChangeFeedPasswordData, ChangeFeedPasswordError, ChangeFeedPasswordErrors, ChangeFeedPasswordResponse, ChangeFeedPasswordResponses, ClientOptions, Created, CreateFeedData, CreateFeedError, CreateFeedErrors, CreateFeedJson, CreateFeedResponse, CreateFeedResponses, DeleteFeedData, DeleteFeedError, DeleteFeedErrors, DeleteFeedLicenseData, DeleteFeedLicenseError, DeleteFeedLicenseErrors, DeleteFeedLicenseResponse, DeleteFeedLicenseResponses, DeleteFeedResponse, DeleteFeedResponses, DeleteNoteData, DeleteNoteError, DeleteNoteErrors, DeleteNoteResponse, DeleteNoteResponses, EditNoteData, EditNoteError, EditNoteErrors, EditNoteResponse, EditNoteResponses, Error, Feed, FeedSettings, FreeTier, GetFeedData, GetFeedError, GetFeedErrors, GetFeedResponse, GetFeedResponses, GetNoteData, GetNoteError, GetNoteErrors, GetNoteResponse, GetNoteResponses, GetOpenApiData, GetOpenApiResponse, GetOpenApiResponses, GetReadFeedData, GetReadFeedError, GetReadFeedErrors, GetReadFeedResponse, GetReadFeedResponses, GetReadNoteData, GetReadNoteError, GetReadNoteErrors, GetReadNoteResponse, GetReadNoteResponses, LicenseKey, ListNotesData, ListNotesError, ListNotesErrors, ListNotesResponse, ListNotesResponses, ListReadNotesData, ListReadNotesError, ListReadNotesErrors, ListReadNotesResponse, ListReadNotesResponses, MultipartNote, Note, NoteEdited, NoteList, NoteMeta, PasswordJson, PatchNoteData, PatchNoteError, PatchNoteErrors, PatchNoteResponse, PatchNoteResponses, Posted, PostNoteData, PostNoteError, PostNoteErrors, PostNoteResponse, PostNoteResponses, PutFeedLicenseData, PutFeedLicenseError, PutFeedLicenseErrors, PutFeedLicenseResponse, PutFeedLicenseResponses, ReadFeed, RecoverFeedPasswordData, RecoverFeedPasswordError, RecoverFeedPasswordErrors, RecoverFeedPasswordResponse, RecoverFeedPasswordResponses, RecoveryJson, RemoveFeedPasswordData, RemoveFeedPasswordError, RemoveFeedPasswordErrors, RemoveFeedPasswordResponse, RemoveFeedPasswordResponses, UpdateFeedData, UpdateFeedError, UpdateFeedErrors, UpdateFeedResponse, UpdateFeedResponses } from './types.gen.js';
|
package/dist/generated/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
export { changeFeedPassword, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getOpenApi, getReadFeed, getReadNote, listNotes, listReadNotes, patchNote, postNote, putFeedLicense, removeFeedPassword, updateFeed } from './sdk.gen.js';
|
|
2
|
+
export { changeFeedPassword, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getOpenApi, getReadFeed, getReadNote, listNotes, listReadNotes, patchNote, postNote, putFeedLicense, recoverFeedPassword, removeFeedPassword, updateFeed } from './sdk.gen.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
|
|
2
|
-
import type { ChangeFeedPasswordData, ChangeFeedPasswordErrors, ChangeFeedPasswordResponses, DeleteFeedData, DeleteFeedErrors, DeleteFeedLicenseData, DeleteFeedLicenseErrors, DeleteFeedLicenseResponses, DeleteFeedResponses, DeleteNoteData, DeleteNoteErrors, DeleteNoteResponses, EditNoteData, EditNoteErrors, EditNoteResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetNoteData, GetNoteErrors, GetNoteResponses, GetOpenApiData, GetOpenApiResponses, GetReadFeedData, GetReadFeedErrors, GetReadFeedResponses, GetReadNoteData, GetReadNoteErrors, GetReadNoteResponses, ListNotesData, ListNotesErrors, ListNotesResponses, ListReadNotesData, ListReadNotesErrors, ListReadNotesResponses, PatchNoteData, PatchNoteErrors, PatchNoteResponses, PostNoteData, PostNoteErrors, PostNoteResponses, PutFeedLicenseData, PutFeedLicenseErrors, PutFeedLicenseResponses, RemoveFeedPasswordData, RemoveFeedPasswordErrors, RemoveFeedPasswordResponses, UpdateFeedData, UpdateFeedErrors, UpdateFeedResponses } from './types.gen.js';
|
|
2
|
+
import type { ChangeFeedPasswordData, ChangeFeedPasswordErrors, ChangeFeedPasswordResponses, CreateFeedData, CreateFeedErrors, CreateFeedResponses, DeleteFeedData, DeleteFeedErrors, DeleteFeedLicenseData, DeleteFeedLicenseErrors, DeleteFeedLicenseResponses, DeleteFeedResponses, DeleteNoteData, DeleteNoteErrors, DeleteNoteResponses, EditNoteData, EditNoteErrors, EditNoteResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetNoteData, GetNoteErrors, GetNoteResponses, GetOpenApiData, GetOpenApiResponses, GetReadFeedData, GetReadFeedErrors, GetReadFeedResponses, GetReadNoteData, GetReadNoteErrors, GetReadNoteResponses, ListNotesData, ListNotesErrors, ListNotesResponses, ListReadNotesData, ListReadNotesErrors, ListReadNotesResponses, PatchNoteData, PatchNoteErrors, PatchNoteResponses, PostNoteData, PostNoteErrors, PostNoteResponses, PutFeedLicenseData, PutFeedLicenseErrors, PutFeedLicenseResponses, RecoverFeedPasswordData, RecoverFeedPasswordErrors, RecoverFeedPasswordResponses, RemoveFeedPasswordData, RemoveFeedPasswordErrors, RemoveFeedPasswordResponses, UpdateFeedData, UpdateFeedErrors, UpdateFeedResponses } from './types.gen.js';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -59,6 +59,12 @@ export declare const deleteFeed: <ThrowOnError extends boolean = false>(options:
|
|
|
59
59
|
* The title and description, the title image, whether the feed is protected, and its read link (null while it has no notes). A feed exists once its first note is posted.
|
|
60
60
|
*/
|
|
61
61
|
export declare const getFeed: <ThrowOnError extends boolean = false>(options: Options<GetFeedData, ThrowOnError>) => RequestResult<GetFeedResponses, GetFeedErrors, ThrowOnError>;
|
|
62
|
+
/**
|
|
63
|
+
* Create a feed without posting a note
|
|
64
|
+
*
|
|
65
|
+
* Reserves the feed name now (ADR 0047): with a password it is protected from its first moment, with a read id it gets that read link. Where licenses are sold a license key is required and goes on the new feed; free feeds start with their first note. A feed that exists is 409. Counts against the post rate limit and the instance's feed cap, like a first post. After it, change the title and description with updateFeed.
|
|
66
|
+
*/
|
|
67
|
+
export declare const createFeed: <ThrowOnError extends boolean = false>(options: Options<CreateFeedData, ThrowOnError>) => RequestResult<CreateFeedResponses, CreateFeedErrors, ThrowOnError>;
|
|
62
68
|
/**
|
|
63
69
|
* Change a feed's settings
|
|
64
70
|
*
|
|
@@ -77,6 +83,12 @@ export declare const removeFeedPassword: <ThrowOnError extends boolean = false>(
|
|
|
77
83
|
* On a protected feed: changes the password, with the current one in `X-Feed-Password`. On an open feed: sets one, with no current password, for whoever calls it. An open feed's name is all that protects it, so whoever knows the name may claim the feed this way. From then on everyone who posts to the feed, reads it by its name or changes it needs the password; the read link and RSS stay open.
|
|
78
84
|
*/
|
|
79
85
|
export declare const changeFeedPassword: <ThrowOnError extends boolean = false>(options: Options<ChangeFeedPasswordData, ThrowOnError>) => RequestResult<ChangeFeedPasswordResponses, ChangeFeedPasswordErrors, ThrowOnError>;
|
|
86
|
+
/**
|
|
87
|
+
* Recover a feed's password with its license key
|
|
88
|
+
*
|
|
89
|
+
* Only on an instance that sells licenses (404 elsewhere). For a lost password: the key of the license on this feed proves ownership instead of the current password (ADR 0037). With a new password the feed gets it (needs an active license, like any password change); with none, or an empty one, the password is removed, which a lapsed license's key may do too. A key that is not this feed's license is 401 and counts as a failed attempt, like a wrong password; a bad new password is refused before the key is tried.
|
|
90
|
+
*/
|
|
91
|
+
export declare const recoverFeedPassword: <ThrowOnError extends boolean = false>(options: Options<RecoverFeedPasswordData, ThrowOnError>) => RequestResult<RecoverFeedPasswordResponses, RecoverFeedPasswordErrors, ThrowOnError>;
|
|
80
92
|
/**
|
|
81
93
|
* Take a feed's license off
|
|
82
94
|
*
|
|
@@ -92,6 +92,20 @@ export const getFeed = (options) => (options.client ?? client).get({
|
|
|
92
92
|
url: '/api/v1/feeds/{feed}',
|
|
93
93
|
...options
|
|
94
94
|
});
|
|
95
|
+
/**
|
|
96
|
+
* Create a feed without posting a note
|
|
97
|
+
*
|
|
98
|
+
* Reserves the feed name now (ADR 0047): with a password it is protected from its first moment, with a read id it gets that read link. Where licenses are sold a license key is required and goes on the new feed; free feeds start with their first note. A feed that exists is 409. Counts against the post rate limit and the instance's feed cap, like a first post. After it, change the title and description with updateFeed.
|
|
99
|
+
*/
|
|
100
|
+
export const createFeed = (options) => (options.client ?? client).post({
|
|
101
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
102
|
+
url: '/api/v1/feeds/{feed}',
|
|
103
|
+
...options,
|
|
104
|
+
headers: {
|
|
105
|
+
'Content-Type': 'application/json',
|
|
106
|
+
...options.headers
|
|
107
|
+
}
|
|
108
|
+
});
|
|
95
109
|
/**
|
|
96
110
|
* Change a feed's settings
|
|
97
111
|
*
|
|
@@ -130,6 +144,20 @@ export const changeFeedPassword = (options) => (options.client ?? client).put({
|
|
|
130
144
|
...options.headers
|
|
131
145
|
}
|
|
132
146
|
});
|
|
147
|
+
/**
|
|
148
|
+
* Recover a feed's password with its license key
|
|
149
|
+
*
|
|
150
|
+
* Only on an instance that sells licenses (404 elsewhere). For a lost password: the key of the license on this feed proves ownership instead of the current password (ADR 0037). With a new password the feed gets it (needs an active license, like any password change); with none, or an empty one, the password is removed, which a lapsed license's key may do too. A key that is not this feed's license is 401 and counts as a failed attempt, like a wrong password; a bad new password is refused before the key is tried.
|
|
151
|
+
*/
|
|
152
|
+
export const recoverFeedPassword = (options) => (options.client ?? client).post({
|
|
153
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
154
|
+
url: '/api/v1/feeds/{feed}/password/recover',
|
|
155
|
+
...options,
|
|
156
|
+
headers: {
|
|
157
|
+
'Content-Type': 'application/json',
|
|
158
|
+
...options.headers
|
|
159
|
+
}
|
|
160
|
+
});
|
|
133
161
|
/**
|
|
134
162
|
* Take a feed's license off
|
|
135
163
|
*
|
|
@@ -236,6 +236,30 @@ export type PasswordJson = {
|
|
|
236
236
|
*/
|
|
237
237
|
password: string;
|
|
238
238
|
};
|
|
239
|
+
export type RecoveryJson = {
|
|
240
|
+
/**
|
|
241
|
+
* The license key on this feed, as the checkout or the receipt gave it
|
|
242
|
+
*/
|
|
243
|
+
key: string;
|
|
244
|
+
/**
|
|
245
|
+
* The new password: 1 to 256 printable ASCII characters, with no space at the start or end. Empty or left out removes the password
|
|
246
|
+
*/
|
|
247
|
+
password?: string;
|
|
248
|
+
};
|
|
249
|
+
export type CreateFeedJson = {
|
|
250
|
+
/**
|
|
251
|
+
* A password that protects the new feed: 1 to 256 printable ASCII characters, with no space at the start or end. Empty or left out: an open feed
|
|
252
|
+
*/
|
|
253
|
+
password?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Where licenses are sold, required: the key of the license to put on the new feed
|
|
256
|
+
*/
|
|
257
|
+
license_key?: string;
|
|
258
|
+
/**
|
|
259
|
+
* The read id to give the feed (3 to 64 characters of a-z, 0-9, - and _); left out: a random one
|
|
260
|
+
*/
|
|
261
|
+
read_id?: string;
|
|
262
|
+
};
|
|
239
263
|
export type LicenseKey = {
|
|
240
264
|
/**
|
|
241
265
|
* The license key, as the checkout or the receipt gave it
|
|
@@ -817,6 +841,55 @@ export type GetFeedResponses = {
|
|
|
817
841
|
200: Feed;
|
|
818
842
|
};
|
|
819
843
|
export type GetFeedResponse = GetFeedResponses[keyof GetFeedResponses];
|
|
844
|
+
export type CreateFeedData = {
|
|
845
|
+
body: CreateFeedJson;
|
|
846
|
+
path: {
|
|
847
|
+
/**
|
|
848
|
+
* The feed's name. It is the write key: anyone who knows it can post.
|
|
849
|
+
*/
|
|
850
|
+
feed: string;
|
|
851
|
+
};
|
|
852
|
+
query?: never;
|
|
853
|
+
url: '/api/v1/feeds/{feed}';
|
|
854
|
+
};
|
|
855
|
+
export type CreateFeedErrors = {
|
|
856
|
+
/**
|
|
857
|
+
* Invalid or reserved feed name, bad JSON, a password that is not 1 to 256 printable ASCII characters, with no space at the start or end, a read id that is invalid, or a key that is none
|
|
858
|
+
*/
|
|
859
|
+
400: Error;
|
|
860
|
+
/**
|
|
861
|
+
* A license key is needed to create a feed without a note here, or its license has lapsed (`license_required`)
|
|
862
|
+
*/
|
|
863
|
+
402: Error;
|
|
864
|
+
/**
|
|
865
|
+
* The feed exists already (`feed_exists`), or the read id is taken (`taken`)
|
|
866
|
+
*/
|
|
867
|
+
409: Error;
|
|
868
|
+
/**
|
|
869
|
+
* The operator removed this feed for good (`removed`): its name cannot be used again
|
|
870
|
+
*/
|
|
871
|
+
410: Error;
|
|
872
|
+
/**
|
|
873
|
+
* Too many posts, or wrong keys, from this client
|
|
874
|
+
*/
|
|
875
|
+
429: Error;
|
|
876
|
+
/**
|
|
877
|
+
* The key service is unreachable: the instance is down for maintenance; try again after Retry-After
|
|
878
|
+
*/
|
|
879
|
+
503: Error;
|
|
880
|
+
/**
|
|
881
|
+
* NOTEFEED_MAX_FEEDS reached
|
|
882
|
+
*/
|
|
883
|
+
507: Error;
|
|
884
|
+
};
|
|
885
|
+
export type CreateFeedError = CreateFeedErrors[keyof CreateFeedErrors];
|
|
886
|
+
export type CreateFeedResponses = {
|
|
887
|
+
/**
|
|
888
|
+
* The new feed
|
|
889
|
+
*/
|
|
890
|
+
201: Feed;
|
|
891
|
+
};
|
|
892
|
+
export type CreateFeedResponse = CreateFeedResponses[keyof CreateFeedResponses];
|
|
820
893
|
export type UpdateFeedData = {
|
|
821
894
|
body: FeedSettings;
|
|
822
895
|
headers?: {
|
|
@@ -966,6 +1039,51 @@ export type ChangeFeedPasswordResponses = {
|
|
|
966
1039
|
204: void;
|
|
967
1040
|
};
|
|
968
1041
|
export type ChangeFeedPasswordResponse = ChangeFeedPasswordResponses[keyof ChangeFeedPasswordResponses];
|
|
1042
|
+
export type RecoverFeedPasswordData = {
|
|
1043
|
+
body: RecoveryJson;
|
|
1044
|
+
path: {
|
|
1045
|
+
/**
|
|
1046
|
+
* The feed's name. It is the write key: anyone who knows it can post.
|
|
1047
|
+
*/
|
|
1048
|
+
feed: string;
|
|
1049
|
+
};
|
|
1050
|
+
query?: never;
|
|
1051
|
+
url: '/api/v1/feeds/{feed}/password/recover';
|
|
1052
|
+
};
|
|
1053
|
+
export type RecoverFeedPasswordErrors = {
|
|
1054
|
+
/**
|
|
1055
|
+
* Invalid or reserved feed name, bad JSON, or a new password that is not 1 to 256 printable ASCII characters, with no space at the start or end
|
|
1056
|
+
*/
|
|
1057
|
+
400: Error;
|
|
1058
|
+
/**
|
|
1059
|
+
* The key is not this feed's license, or the feed has no password
|
|
1060
|
+
*/
|
|
1061
|
+
401: Error;
|
|
1062
|
+
/**
|
|
1063
|
+
* The key's license has lapsed, and a new password needs an active one (`license_required`)
|
|
1064
|
+
*/
|
|
1065
|
+
402: Error;
|
|
1066
|
+
/**
|
|
1067
|
+
* Licenses are not sold on this instance, or the feed was deleted meanwhile
|
|
1068
|
+
*/
|
|
1069
|
+
404: Error;
|
|
1070
|
+
/**
|
|
1071
|
+
* Too many wrong passwords or keys from this client
|
|
1072
|
+
*/
|
|
1073
|
+
429: Error;
|
|
1074
|
+
/**
|
|
1075
|
+
* The key service is unreachable: the instance is down for maintenance; try again after Retry-After
|
|
1076
|
+
*/
|
|
1077
|
+
503: Error;
|
|
1078
|
+
};
|
|
1079
|
+
export type RecoverFeedPasswordError = RecoverFeedPasswordErrors[keyof RecoverFeedPasswordErrors];
|
|
1080
|
+
export type RecoverFeedPasswordResponses = {
|
|
1081
|
+
/**
|
|
1082
|
+
* Set or removed; the old password and unlock cookies stop working
|
|
1083
|
+
*/
|
|
1084
|
+
204: void;
|
|
1085
|
+
};
|
|
1086
|
+
export type RecoverFeedPasswordResponse = RecoverFeedPasswordResponses[keyof RecoverFeedPasswordResponses];
|
|
969
1087
|
export type DeleteFeedLicenseData = {
|
|
970
1088
|
body?: never;
|
|
971
1089
|
headers?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notefeed",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Client and CLI for notefeed, a self-hosted inbox for markdown notes that you read back as RSS.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Marcel Bruckner",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^20",
|
|
48
|
-
"typescript": "^
|
|
48
|
+
"typescript": "^7.0",
|
|
49
49
|
"vitest": "^4.1"
|
|
50
50
|
}
|
|
51
51
|
}
|