notefeed 0.31.1 → 0.32.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 CHANGED
@@ -1,7 +1,7 @@
1
- import type { Created, Error as ApiError, Feed, FeedSettings, Note } from "./generated/types.gen.js";
1
+ import type { Created, Error as ApiError, Feed, FeedSettings, Licenses, Note } from "./generated/types.gen.js";
2
2
  /** The stable error codes the API answers with. */
3
3
  export type ErrorCode = NonNullable<ApiError["code"]>;
4
- export type { Created, Feed, FeedSettings, Note };
4
+ export type { Created, Feed, FeedSettings, Licenses, Note };
5
5
  /** A picture posted with a note: `![](name)` in the markdown refers to it. `type` as for post(). */
6
6
  export type Attachment = {
7
7
  name: string;
@@ -184,6 +184,9 @@ export declare class Client {
184
184
  pageSize?: number;
185
185
  tag?: string;
186
186
  }): AsyncGenerator<Note>;
187
+ /** What licenses are sold (plans, amounts in cents), where a person buys one (`buy_url`) and where buyers manage their purchases
188
+ * at the payment provider, signed in by e-mail (`manage_url`); no key opens that page. Only where licenses are sold. */
189
+ licenses(): Promise<Licenses>;
187
190
  readNote(readId: string, id: string): Promise<Note>;
188
191
  private feedFor;
189
192
  private opts;
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, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getReadNote, listNotes, listReadNotes, patchNote, postNote, putFeedLicense, recoverFeedPassword, removeFeedImage, setFeedImage, updateFeed } from "./generated/sdk.gen.js";
6
+ import { changeFeedPassword, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getLicenses, getNote, getReadNote, listNotes, listReadNotes, patchNote, postNote, putFeedLicense, recoverFeedPassword, removeFeedImage, setFeedImage, 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;
@@ -267,6 +267,11 @@ export class Client {
267
267
  readNotes(readId, options = {}) {
268
268
  return this.pages((before) => listReadNotes({ client: this.api, path: { readId }, query: { limit: options.pageSize, before, tag: options.tag }, ...this.opts() }));
269
269
  }
270
+ /** What licenses are sold (plans, amounts in cents), where a person buys one (`buy_url`) and where buyers manage their purchases
271
+ * at the payment provider, signed in by e-mail (`manage_url`); no key opens that page. Only where licenses are sold. */
272
+ async licenses() {
273
+ return this.call(getLicenses({ client: this.api, signal: AbortSignal.timeout(this.timeoutMs) }));
274
+ }
270
275
  async readNote(readId, id) {
271
276
  return this.call(getReadNote({ client: this.api, path: { readId, id }, ...this.opts() }));
272
277
  }
@@ -1,2 +1,2 @@
1
- export { changeFeedPassword, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getOpenApi, getReadFeed, getReadNote, listNotes, listReadNotes, type Options, patchNote, postNote, putFeedLicense, recoverFeedPassword, removeFeedImage, removeFeedPassword, setFeedImage, 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, RemoveFeedImageData, RemoveFeedImageError, RemoveFeedImageErrors, RemoveFeedImageResponse, RemoveFeedImageResponses, RemoveFeedPasswordData, RemoveFeedPasswordError, RemoveFeedPasswordErrors, RemoveFeedPasswordResponse, RemoveFeedPasswordResponses, SetFeedImageData, SetFeedImageError, SetFeedImageErrors, SetFeedImageResponse, SetFeedImageResponses, UpdateFeedData, UpdateFeedError, UpdateFeedErrors, UpdateFeedResponse, UpdateFeedResponses } from './types.gen.js';
1
+ export { changeFeedPassword, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getLicenses, getNote, getOpenApi, getReadFeed, getReadNote, listNotes, listReadNotes, type Options, patchNote, postNote, putFeedLicense, recoverFeedPassword, removeFeedImage, removeFeedPassword, setFeedImage, 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, GetLicensesData, GetLicensesError, GetLicensesErrors, GetLicensesResponse, GetLicensesResponses, GetNoteData, GetNoteError, GetNoteErrors, GetNoteResponse, GetNoteResponses, GetOpenApiData, GetOpenApiResponse, GetOpenApiResponses, GetReadFeedData, GetReadFeedError, GetReadFeedErrors, GetReadFeedResponse, GetReadFeedResponses, GetReadNoteData, GetReadNoteError, GetReadNoteErrors, GetReadNoteResponse, GetReadNoteResponses, LicenseKey, Licenses, 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, RemoveFeedImageData, RemoveFeedImageError, RemoveFeedImageErrors, RemoveFeedImageResponse, RemoveFeedImageResponses, RemoveFeedPasswordData, RemoveFeedPasswordError, RemoveFeedPasswordErrors, RemoveFeedPasswordResponse, RemoveFeedPasswordResponses, SetFeedImageData, SetFeedImageError, SetFeedImageErrors, SetFeedImageResponse, SetFeedImageResponses, UpdateFeedData, UpdateFeedError, UpdateFeedErrors, UpdateFeedResponse, UpdateFeedResponses } from './types.gen.js';
@@ -1,2 +1,2 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- export { changeFeedPassword, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getNote, getOpenApi, getReadFeed, getReadNote, listNotes, listReadNotes, patchNote, postNote, putFeedLicense, recoverFeedPassword, removeFeedImage, removeFeedPassword, setFeedImage, updateFeed } from './sdk.gen.js';
2
+ export { changeFeedPassword, createFeed, deleteFeed, deleteFeedLicense, deleteNote, editNote, getFeed, getLicenses, getNote, getOpenApi, getReadFeed, getReadNote, listNotes, listReadNotes, patchNote, postNote, putFeedLicense, recoverFeedPassword, removeFeedImage, removeFeedPassword, setFeedImage, 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, 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, RemoveFeedImageData, RemoveFeedImageErrors, RemoveFeedImageResponses, RemoveFeedPasswordData, RemoveFeedPasswordErrors, RemoveFeedPasswordResponses, SetFeedImageData, SetFeedImageErrors, SetFeedImageResponses, 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, GetLicensesData, GetLicensesErrors, GetLicensesResponses, 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, RemoveFeedImageData, RemoveFeedImageErrors, RemoveFeedImageResponses, RemoveFeedPasswordData, RemoveFeedPasswordErrors, RemoveFeedPasswordResponses, SetFeedImageData, SetFeedImageErrors, SetFeedImageResponses, 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
@@ -131,6 +131,12 @@ export declare const listReadNotes: <ThrowOnError extends boolean = false>(optio
131
131
  * Public, like the read link. A read id the operator removed is `410`.
132
132
  */
133
133
  export declare const getReadNote: <ThrowOnError extends boolean = false>(options: Options<GetReadNoteData, ThrowOnError>) => RequestResult<GetReadNoteResponses, GetReadNoteErrors, ThrowOnError>;
134
+ /**
135
+ * What licenses are sold, where to buy them and where to manage them
136
+ *
137
+ * Only on an instance that sells licenses (404 elsewhere). Public, like the license page. A license lifts a feed's free tier; a person buys it on `buy_url` and gets a key to put on a feed. Cancelling, the payment method and invoices are at the payment provider, where buyers sign in with the e-mail address they bought with (`manage_url`); no license key opens it (ADR 0050).
138
+ */
139
+ export declare const getLicenses: <ThrowOnError extends boolean = false>(options?: Options<GetLicensesData, ThrowOnError>) => RequestResult<GetLicensesResponses, GetLicensesErrors, ThrowOnError>;
134
140
  /**
135
141
  * This API's OpenAPI document
136
142
  *
@@ -225,6 +225,12 @@ export const listReadNotes = (options) => (options.client ?? client).get({ url:
225
225
  * Public, like the read link. A read id the operator removed is `410`.
226
226
  */
227
227
  export const getReadNote = (options) => (options.client ?? client).get({ url: '/api/v1/read/{readId}/notes/{id}', ...options });
228
+ /**
229
+ * What licenses are sold, where to buy them and where to manage them
230
+ *
231
+ * Only on an instance that sells licenses (404 elsewhere). Public, like the license page. A license lifts a feed's free tier; a person buys it on `buy_url` and gets a key to put on a feed. Cancelling, the payment method and invoices are at the payment provider, where buyers sign in with the e-mail address they bought with (`manage_url`); no license key opens it (ADR 0050).
232
+ */
233
+ export const getLicenses = (options) => (options?.client ?? client).get({ url: '/api/v1/licenses', ...options });
228
234
  /**
229
235
  * This API's OpenAPI document
230
236
  *
@@ -346,6 +346,49 @@ export type ReadFeed = {
346
346
  */
347
347
  image_url: string | null;
348
348
  };
349
+ export type Licenses = {
350
+ /**
351
+ * What is sold right now, monthly then yearly; empty while the payment provider can't be read
352
+ */
353
+ plans: Array<{
354
+ /**
355
+ * How long one payment lasts; the license renews until cancelled
356
+ */
357
+ period: 'month' | 'year';
358
+ /**
359
+ * The plan's name, as the payment provider holds it
360
+ */
361
+ name: string;
362
+ /**
363
+ * The plan's description from the payment provider, possibly empty
364
+ */
365
+ description: string;
366
+ /**
367
+ * The price per period in the currency's smallest unit (cents)
368
+ */
369
+ amount: number;
370
+ /**
371
+ * ISO 4217 code, e.g. EUR
372
+ */
373
+ currency: string;
374
+ /**
375
+ * Whether the amount includes VAT
376
+ */
377
+ tax_included: boolean;
378
+ }>;
379
+ /**
380
+ * The license page: a person buys there, and gets the key after paying
381
+ */
382
+ buy_url: string;
383
+ /**
384
+ * The payment provider's sign-in for buyers, by the e-mail address bought with: cancelling, the payment method, invoices, keys. No license key opens it
385
+ */
386
+ manage_url: string;
387
+ /**
388
+ * How managing a purchase works, in a sentence to show a person
389
+ */
390
+ manage: string;
391
+ };
349
392
  export type ListNotesData = {
350
393
  body?: never;
351
394
  headers?: {
@@ -1423,6 +1466,26 @@ export type GetReadNoteResponses = {
1423
1466
  200: Note;
1424
1467
  };
1425
1468
  export type GetReadNoteResponse = GetReadNoteResponses[keyof GetReadNoteResponses];
1469
+ export type GetLicensesData = {
1470
+ body?: never;
1471
+ path?: never;
1472
+ query?: never;
1473
+ url: '/api/v1/licenses';
1474
+ };
1475
+ export type GetLicensesErrors = {
1476
+ /**
1477
+ * Licenses are not sold on this instance
1478
+ */
1479
+ 404: Error;
1480
+ };
1481
+ export type GetLicensesError = GetLicensesErrors[keyof GetLicensesErrors];
1482
+ export type GetLicensesResponses = {
1483
+ /**
1484
+ * The plans, the license page and the provider's sign-in for buyers
1485
+ */
1486
+ 200: Licenses;
1487
+ };
1488
+ export type GetLicensesResponse = GetLicensesResponses[keyof GetLicensesResponses];
1426
1489
  export type GetOpenApiData = {
1427
1490
  body?: never;
1428
1491
  path?: never;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { AuthError, Client, ConfigError, ImagesOffError, InvalidRequestError, LimitReachedError, NotefeedError, NotFoundError, NoteTooLargeError, RateLimitedError, } from "./client.js";
2
- export type { Attachment, ClientOptions, Created, ErrorCode, Feed, FeedSettings, Note } from "./client.js";
2
+ export type { Attachment, ClientOptions, Created, ErrorCode, Feed, FeedSettings, Licenses, Note } from "./client.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notefeed",
3
- "version": "0.31.1",
3
+ "version": "0.32.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",