pups-client 0.1.0 → 0.2.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 +35 -3
- package/dist/errors.d.ts +4 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/feed.d.ts +314 -0
- package/dist/feed.d.ts.map +1 -0
- package/dist/feed.js +805 -0
- package/dist/feed.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/session.d.ts +11 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +13 -0
- package/dist/session.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/errors.ts +5 -0
- package/src/feed.ts +1007 -0
- package/src/index.ts +19 -0
- package/src/session.ts +15 -0
- package/src/version.ts +1 -1
package/src/index.ts
CHANGED
|
@@ -16,6 +16,25 @@ export type {
|
|
|
16
16
|
} from './client.js'
|
|
17
17
|
export { PupsSession } from './session.js'
|
|
18
18
|
export type { Body, JsonBody, SessionChangeEvent, StoredFile, WriteOptions, WriteResult } from './session.js'
|
|
19
|
+
export { FEED_REL, PUPS_FEED_SPEC, PupsFeed, feedScopes } from './feed.js'
|
|
20
|
+
export type {
|
|
21
|
+
FeedAttachment,
|
|
22
|
+
FeedAuthor,
|
|
23
|
+
FeedDocument,
|
|
24
|
+
FeedItem,
|
|
25
|
+
FeedLink,
|
|
26
|
+
FeedOptions,
|
|
27
|
+
FeedSettings,
|
|
28
|
+
FeedSettingsChanges,
|
|
29
|
+
FeedSetup,
|
|
30
|
+
FeedState,
|
|
31
|
+
MediaInput,
|
|
32
|
+
MediaResult,
|
|
33
|
+
PostChanges,
|
|
34
|
+
PostInput,
|
|
35
|
+
PostResult,
|
|
36
|
+
PupsMarker,
|
|
37
|
+
} from './feed.js'
|
|
19
38
|
export { HostMetaEditor } from './host-meta.js'
|
|
20
39
|
export type { HostMetaDocument, HostMetaLink } from './host-meta.js'
|
|
21
40
|
export { PupsError, isPupsError } from './errors.js'
|
package/src/session.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { discover, type PupsServer } from './discovery.js'
|
|
2
2
|
import { errorFromResponse, isPupsError, PupsError } from './errors.js'
|
|
3
|
+
import { listFeeds, PupsFeed, type FeedLink, type FeedOptions } from './feed.js'
|
|
3
4
|
import { fileTypeOf, uploadContentType } from './file-types.js'
|
|
4
5
|
import { HostMetaEditor } from './host-meta.js'
|
|
5
6
|
import { revokeToken } from './oauth.js'
|
|
@@ -258,6 +259,20 @@ export class PupsSession {
|
|
|
258
259
|
await this.#write('DELETE', absolute, options.ifMatch ? { 'If-Match': quoteEtag(options.ifMatch) } : {}, undefined, options.signal)
|
|
259
260
|
}
|
|
260
261
|
|
|
262
|
+
/**
|
|
263
|
+
* A feed on the owner's domain, maintained according to RFC-7: the main feed `/feed.json` without a name, or the
|
|
264
|
+
* named feed `/feed/<name>.json`. The session needs the feed's scopes, see `feedScopes()`.
|
|
265
|
+
* @throws {PupsError} `invalid_request` for an invalid name.
|
|
266
|
+
*/
|
|
267
|
+
feed(name?: string, options: FeedOptions = {}): PupsFeed {
|
|
268
|
+
return new PupsFeed(this, name, options)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** The feeds registered in the owner's `host-meta.json`, e.g. to let the owner choose one to post to. */
|
|
272
|
+
listFeeds(options: { signal?: AbortSignal } & FeedOptions = {}): Promise<FeedLink[]> {
|
|
273
|
+
return listFeeds(this, options)
|
|
274
|
+
}
|
|
275
|
+
|
|
261
276
|
/**
|
|
262
277
|
* Fetches the configuration document again, e.g. after the owner changed allowed paths. Accepted only if the
|
|
263
278
|
* issuer is unchanged; a different issuer means the user has to connect again.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.2.0'
|