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 CHANGED
@@ -34,7 +34,7 @@ pups login tjansen.de --client tim.example.app
34
34
 
35
35
  pups whoami
36
36
  pups put photo.jpg notes.md # → /appdata/tim.example.app/photo.jpg, …
37
- pups put feed.json --to feeds/ # → /appdata/tim.example.app/feeds/feed.json
37
+ pups put data.json --to backup/ # → /appdata/tim.example.app/backup/data.json
38
38
  echo '# Hi' | pups put - --to hello.md # from stdin
39
39
  pups get hello.md
40
40
  pups rm hello.md
@@ -44,9 +44,9 @@ pups logout # forgets the credentials and rev
44
44
  Paths without a leading `/` are in the app's own directory, `/appdata/<client-domain>/`. To write elsewhere, ask for a well-known path the server declares:
45
45
 
46
46
  ```sh
47
- pups login tjansen.de -c tim.example.app -s appdata -s write:/.well-known/about.md
47
+ pups login tjansen.de -c tim.example.app -s appdata -s write:/.well-known/about.md -s write:/feed/photos.json
48
48
  pups put about.md --to /.well-known/about.md --if-match '"etag-you-read"'
49
- pups link add https://bigwide.net/ns/feed /feeds/bigwide/feed.xml --type application/rss+xml
49
+ pups link add https://bigwide.net/ns/feed /feed/photos.json --type application/feed+json
50
50
  ```
51
51
 
52
52
  Run `pups --help` for every command and option. Options can also come from `PUPS_CLIENT` and `PUPS_DOMAIN`.
@@ -99,6 +99,38 @@ Your app publishes its client metadata document on its own domain:
99
99
 
100
100
  During development, `await pups.checkClientMetadata()` reports everything a PUPS server would reject.
101
101
 
102
+ ### Feeds
103
+
104
+ `session.feed()` maintains a blog feed, or any similar stream of posts, on the owner's domain, following [RFC-7](https://github.com/bigwide-net/RFCs/blob/main/RFC-7-Feed-Publishing-with-PUPS.md): the main feed `/feed.json`, or a named feed `/feed/<name>.json`, each a JSON Feed 1.1 with its archives, icons and media in a feed directory, `/feed/` or `/feed/<name>/`. Icons go into `/feed/images/icons/` (`/feed/<name>/images/icons/`), the main feed's media into `/feed/images/` and `/feed/media/`.
105
+
106
+ ```ts
107
+ import { feedScopes } from 'pups-client'
108
+
109
+ const session = await pups.loginWithPopup(domain, { scopes: ['identify', ...feedScopes()] }) // or feedScopes('photos')
110
+ const feed = session.feed() // or session.feed('photos')
111
+
112
+ const state = await feed.load() // 'missing' | 'pups' | 'foreign' | 'invalid'
113
+ if (state.status == 'missing')
114
+ await feed.create({ title: "Tim's Notes", description: 'Short notes', icon: iconFile }) // also registers it in host-meta.json
115
+ else if (state.status == 'foreign')
116
+ showMessage('Your feed is maintained by other means.') // never written without "_pups": { "pupsControlled": true }
117
+
118
+ const photo = await feed.uploadMedia(photoFile) // → https://…/feed/images/2026/….jpg
119
+ const post = await feed.addPost({ title: 'Hello', content_html: `<p>Hi!</p><img src="${photo.url}" alt="">` })
120
+ await feed.addPost({ markdown: 'Written in *Markdown*' }) // _source.markdown, with content_text as fallback
121
+ await feed.editPost(post.id, { title: 'Hello, world' }) // wherever the post is now, sets date_modified
122
+ await feed.deletePost(post.id, { deleteMedia: true }) // also deletes media no other post uses
123
+ await feed.updateSettings({ description: 'Longer notes', _podcast: { explicit: false } })
124
+
125
+ for await (const item of feed.posts()) console.log(item.id) // newest first, through all archives
126
+ const feeds = await session.listFeeds() // the feeds registered in host-meta.json
127
+ ```
128
+
129
+ - **Archives.** Every post goes into the newest archive, `feed.000000.json`, `feed.000001.json`, … in the feed directory, 20 posts each, linked with `next_url`; posts never move. The feed file holds a copy of the newest 30 posts and points to the newest archive with `_pups.archive_url`; archives point back with `_pups.updates_url`. `session.feed(name, { maxItems, archiveSize, maxBytes })` changes the sizes. Archives are optional in RFC-7: with `{ startArchives: false }`, a feed without archives stays a plain feed file with the newest posts; a feed that has archives always keeps them.
130
+ - **Concurrency.** Every change is a read-modify-write with ETags, repeated when another app or the owner wrote in between. The archive is always written before the feed file, so no post is ever lost, and the next post repairs a feed file that an interrupted post didn't reach.
131
+ - **Post URLs.** `addPost()` returns `url`, the post's archive URL plus `#<id>`. It never changes, so it can be the `source` of an RFC-4 webmention.
132
+ - Errors: `not_pups_controlled` for feeds without the marker, `invalid_feed` for files that aren't JSON Feeds, `not_found` for a missing feed or post.
133
+
102
134
  ### What the library does for you
103
135
 
104
136
  - **Discovery** through `/.well-known/host-meta.json` and the configuration document.
package/dist/errors.d.ts CHANGED
@@ -31,6 +31,10 @@ export type PupsErrorCode =
31
31
  | 'authorization_failed'
32
32
  /** The session ended: the grant was revoked, the refresh token expired, or the user logged out. Log in again. */
33
33
  | 'session_expired' | 'invalid_path' | 'invalid_token' | 'insufficient_scope' | 'not_found' | 'precondition_failed' | 'too_large' | 'unsupported_type' | 'insufficient_storage'
34
+ /** A feed file or archive has no `_pups.pupsControlled` marker: it is maintained by other means and never written. */
35
+ | 'not_pups_controlled'
36
+ /** A feed file or archive is not a JSON Feed. */
37
+ | 'invalid_feed'
34
38
  /** `409` from the host-meta endpoint: a single-valued rel is taken, or `host-meta.json` is not valid JSON. */
35
39
  | 'conflict'
36
40
  /** `429`: the server limits the write rate of this grant. See {@link PupsError.retryAfter}. */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,aAAa;AAEvB,wEAAwE;AACtE,gBAAgB;AAClB,mFAAmF;GACjF,gBAAgB;AAClB,mFAAmF;GACjF,uBAAuB;AACzB,2EAA2E;GACzE,4BAA4B;AAE9B,yEAAyE;GACvE,eAAe;AACjB,4DAA4D;GAC1D,eAAe;AACjB,kGAAkG;GAChG,gBAAgB;AAClB,uGAAuG;GACrG,iBAAiB;AACnB,8GAA8G;GAC5G,mBAAmB;AACrB,mEAAmE;GACjE,eAAe;AACjB,4CAA4C;GAC1C,eAAe;AACjB,mEAAmE;GACjE,sBAAsB;AAExB,iHAAiH;GAC/G,iBAAiB,GAEjB,cAAc,GACd,eAAe,GACf,oBAAoB,GACpB,WAAW,GACX,qBAAqB,GACrB,WAAW,GACX,kBA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AAC,CAAC,WAAW,IAAI,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,iBAAiB;QACpE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,cAAc,CAAA;IACzC,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAA;IACpE,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,qBAAqB,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE;QAC3G,MAAM;QACN,aAAa;QACb,UAAU,EAAE,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;KAChE,CAAC,CAAA;AACJ,CAAC"}
package/dist/feed.d.ts ADDED
@@ -0,0 +1,314 @@
1
+ import type { Scope } from './scopes.js';
2
+ import type { Body, PupsSession } from './session.js';
3
+ /** The link relation that registers a feed in `host-meta.json` (RFC-7). A placeholder in RFC-7. */
4
+ export declare const FEED_REL = "https://bigwide.net/ns/feed";
5
+ /** The `about` of the `_pups` object: RFC-7. Not its final location; readers must not rely on it. */
6
+ export declare const PUPS_FEED_SPEC = "https://github.com/bigwide-net/RFCs/blob/main/RFC-7-Feed-Publishing-with-PUPS.md";
7
+ export interface FeedAuthor {
8
+ name?: string;
9
+ url?: string;
10
+ avatar?: string;
11
+ [field: string]: unknown;
12
+ }
13
+ export interface FeedAttachment {
14
+ url: string;
15
+ mime_type: string;
16
+ title?: string;
17
+ size_in_bytes?: number;
18
+ duration_in_seconds?: number;
19
+ [field: string]: unknown;
20
+ }
21
+ /** A JSON Feed 1.1 item. */
22
+ export interface FeedItem {
23
+ id: string;
24
+ url?: string;
25
+ external_url?: string;
26
+ title?: string;
27
+ content_html?: string;
28
+ content_text?: string;
29
+ summary?: string;
30
+ image?: string;
31
+ banner_image?: string;
32
+ date_published?: string;
33
+ date_modified?: string;
34
+ authors?: FeedAuthor[];
35
+ tags?: string[];
36
+ language?: string;
37
+ attachments?: FeedAttachment[];
38
+ [field: string]: unknown;
39
+ }
40
+ /** The `_pups` object of a feed file or archive. */
41
+ export interface PupsMarker {
42
+ about?: string;
43
+ pupsControlled?: boolean;
44
+ /** In the feed file: the public URL of the newest archive. */
45
+ archive_url?: string;
46
+ /** In an archive: the public URL of the feed file, which readers poll. */
47
+ updates_url?: string;
48
+ [field: string]: unknown;
49
+ }
50
+ /** A JSON Feed 1.1 document, as stored in a feed file or archive. */
51
+ export interface FeedDocument {
52
+ version: string;
53
+ title: string;
54
+ home_page_url?: string;
55
+ feed_url?: string;
56
+ description?: string;
57
+ user_comment?: string;
58
+ next_url?: string;
59
+ icon?: string;
60
+ favicon?: string;
61
+ authors?: FeedAuthor[];
62
+ language?: string;
63
+ expired?: boolean;
64
+ hubs?: unknown[];
65
+ items: FeedItem[];
66
+ _pups?: PupsMarker;
67
+ [field: string]: unknown;
68
+ }
69
+ /**
70
+ * The fields of a feed that belong to the owner (RFC-7 "Fields"). Extensions such as `_podcast` (RFC-3) or
71
+ * `_source` (RFC-1) are allowed too. Icons are set with `setIcon()` and `setFavicon()`.
72
+ */
73
+ export interface FeedSettings {
74
+ title?: string;
75
+ description?: string;
76
+ authors?: FeedAuthor[];
77
+ language?: string;
78
+ expired?: boolean;
79
+ [extension: `_${string}`]: unknown;
80
+ }
81
+ /** Changes to the settings: a value sets the field, `null` removes it, `undefined` leaves it unchanged. */
82
+ export type FeedSettingsChanges = {
83
+ [K in keyof FeedSettings]?: FeedSettings[K] | null;
84
+ };
85
+ /**
86
+ * An image, audio or video file to upload: a `Blob` (or `File`) with a type or name, or a body with its type or
87
+ * extension. The extension must be on the RFC-6 allowlist.
88
+ */
89
+ export type MediaInput = Blob | {
90
+ body: Body;
91
+ type?: string;
92
+ extension?: string;
93
+ };
94
+ /** The settings of a new feed. */
95
+ export interface FeedSetup extends FeedSettings {
96
+ title: string;
97
+ /** 512 × 512 pixels, stored in `images/icons/` in the feed directory. */
98
+ icon?: MediaInput;
99
+ /** 64 × 64 pixels, stored in `images/icons/` in the feed directory. */
100
+ favicon?: MediaInput;
101
+ }
102
+ /** A new post: a JSON Feed item without `id` (generated unless given) and with a few conveniences. */
103
+ export interface PostInput {
104
+ /** Generated if missing: 16 random URL-safe characters. Must be unique across the feed and its archives. */
105
+ id?: string;
106
+ title?: string;
107
+ content_html?: string;
108
+ content_text?: string;
109
+ /**
110
+ * The text as Markdown, stored in `_source.markdown` (RFC-1). If neither `content_html` nor `content_text` is
111
+ * given, the Markdown is also used as `content_text`, since JSON Feed requires one of them.
112
+ */
113
+ markdown?: string;
114
+ summary?: string;
115
+ url?: string;
116
+ external_url?: string;
117
+ image?: string;
118
+ banner_image?: string;
119
+ /** Default: now. */
120
+ date_published?: string | Date;
121
+ authors?: FeedAuthor[];
122
+ tags?: string[];
123
+ language?: string;
124
+ attachments?: FeedAttachment[];
125
+ [extension: `_${string}`]: unknown;
126
+ }
127
+ /** Changes to a post: a value sets the field, `null` removes it, `undefined` leaves it unchanged. */
128
+ export type PostChanges = {
129
+ [K in Exclude<keyof PostInput, 'id'>]?: PostInput[K] | null;
130
+ };
131
+ export interface PostResult {
132
+ id: string;
133
+ /** The item as stored. */
134
+ item: FeedItem;
135
+ /**
136
+ * The URL of the item's archive plus `#<id>`. Items never leave their archive, so it never changes; use it e.g.
137
+ * as the `source` of an RFC-4 webmention. In a feed without archives, the feed file's URL plus `#<id>`.
138
+ */
139
+ url: string;
140
+ }
141
+ export interface MediaResult {
142
+ path: string;
143
+ /** The public URL, to reference from items. */
144
+ url: string;
145
+ /** The served type, e.g. for `attachments[].mime_type`. */
146
+ type: string;
147
+ size: number;
148
+ }
149
+ export type FeedState =
150
+ /** There is no feed file yet. `create()` sets it up. */
151
+ {
152
+ status: 'missing';
153
+ }
154
+ /** A feed maintained by PUPS clients, ready to write. */
155
+ | {
156
+ status: 'pups';
157
+ feed: FeedDocument;
158
+ etag: string;
159
+ }
160
+ /** A JSON Feed without `_pups.pupsControlled`: maintained by other means, and never written (RFC-7). */
161
+ | {
162
+ status: 'foreign';
163
+ feed: FeedDocument;
164
+ }
165
+ /** The file exists but is not a JSON Feed. */
166
+ | {
167
+ status: 'invalid';
168
+ };
169
+ export interface FeedOptions {
170
+ /** How many of the newest items the feed file holds. Default 30 (RFC-7 "Feed size"). */
171
+ maxItems?: number;
172
+ /** How many items an archive holds. Default 20 (RFC-7 "Archives"); other clients expect 20. */
173
+ archiveSize?: number;
174
+ /**
175
+ * Whether to start archives for a feed that has none, on its next post (RFC-7 "Starting the archives").
176
+ * Default true. With false, posts to such a feed only go into the feed file, and items beyond `maxItems` are
177
+ * dropped. Feeds that have archives always keep them.
178
+ */
179
+ startArchives?: boolean;
180
+ /**
181
+ * Optional: keep fewer items in the feed file when it would be larger than this many bytes, but at least 10
182
+ * (RFC-7 "Size in bytes").
183
+ */
184
+ maxBytes?: number;
185
+ /** How often an operation is repeated when another client changed the feed in between. Default 8. */
186
+ maxAttempts?: number;
187
+ }
188
+ /** A feed registered in `host-meta.json`. */
189
+ export interface FeedLink {
190
+ /** The public URL of the feed file. */
191
+ url: string;
192
+ type?: string;
193
+ /** Set if the feed is a main or named feed on this PUPS server, in the layout of RFC-7. */
194
+ feed?: PupsFeed;
195
+ }
196
+ type Signal = {
197
+ signal?: AbortSignal;
198
+ };
199
+ /** The scopes an app needs to write a feed: the feed file and the feed directory (RFC-7 "Server requirements"). */
200
+ export declare function feedScopes(name?: string): Scope[];
201
+ /**
202
+ * A feed on the owner's domain, maintained according to RFC-7: the main feed `/feed.json`, or a named feed
203
+ * `/feed/<name>.json`, each with its feed directory for archives, icons and media: `/feed/`, or `/feed/<name>/`.
204
+ * The main feed keeps its media in `/feed/images/` and `/feed/media/`, since the rest of `/feed/` belongs to the
205
+ * named feeds.
206
+ *
207
+ * Get one from `session.feed()` or `session.feed('photos')`. The session needs the feed's scopes, see
208
+ * {@link feedScopes}. All writes are safe against concurrent changes by other apps and the owner: they are
209
+ * read-modify-write cycles with ETags, repeated when another client wrote in between.
210
+ */
211
+ export declare class PupsFeed {
212
+ #private;
213
+ /** The name of a named feed; undefined for the main feed. */
214
+ readonly name?: string;
215
+ /** The feed file, e.g. `/feed.json` or `/feed/photos.json`. */
216
+ readonly path: string;
217
+ /** The feed directory, e.g. `/feed/` or `/feed/photos/`. */
218
+ readonly directory: string;
219
+ /** @internal Use `session.feed()`. */
220
+ constructor(session: PupsSession, name?: string, options?: FeedOptions);
221
+ /** The public URL of the feed file, its `feed_url`. */
222
+ get url(): string;
223
+ /** The scopes needed to write this feed. */
224
+ get scopes(): Scope[];
225
+ /** Whether the session may write the feed file and the feed directory. */
226
+ get writable(): boolean;
227
+ /** Reads the feed file and tells whether it exists, and whether PUPS clients may write it. */
228
+ load(options?: Signal): Promise<FeedState>;
229
+ /**
230
+ * Sets up a new feed (RFC-7 "Setting up a feed"): uploads the icons, writes the feed file with the fixed fields
231
+ * and the `_pups` marker, and registers the feed in `host-meta.json` (unless `register` is false).
232
+ * @returns `registered`: false if the feed couldn't be registered; call `register()` again later, or tell the owner
233
+ * to add the link to `host-meta.json` by hand.
234
+ * @throws {PupsError} `precondition_failed` if the feed file exists already; `insufficient_scope`.
235
+ */
236
+ create(setup: FeedSetup, options?: Signal & {
237
+ register?: boolean;
238
+ }): Promise<{
239
+ url: string;
240
+ registered: boolean;
241
+ }>;
242
+ /**
243
+ * Registers the feed in `host-meta.json` (RFC-7 "Registering feeds"), unless a link with the feed relation and
244
+ * this feed's URL exists already.
245
+ * @returns false if the server has no host-meta endpoint, or doesn't allow the feed relation for this path.
246
+ */
247
+ register(options?: Signal): Promise<boolean>;
248
+ /**
249
+ * Changes the owner's fields of the feed (RFC-7 "Editing a feed"): a value sets a field, `null` removes it.
250
+ * @returns the feed as written.
251
+ */
252
+ updateSettings(changes: FeedSettingsChanges, options?: Signal): Promise<FeedDocument>;
253
+ /**
254
+ * Uploads a new icon (512 × 512) to `/feed/images/icons/` (`/feed/<name>/images/icons/` for a named feed) and
255
+ * deletes the old one, or removes it with `null`.
256
+ */
257
+ setIcon(media: MediaInput | null, options?: Signal): Promise<FeedDocument>;
258
+ /** Uploads a new favicon (64 × 64) to the icons directory, like `setIcon()`, or removes it with `null`. */
259
+ setFavicon(media: MediaInput | null, options?: Signal): Promise<FeedDocument>;
260
+ /**
261
+ * Uploads an image, audio or video file into the feed directory under a new, unique name, by default
262
+ * `images/<year>/…` for images and `media/<year>/…` for everything else. Reference it from a post by its `url`.
263
+ * For the main feed, `folder` must be inside `images/` or `media/`: the rest of `/feed/` belongs to named feeds.
264
+ */
265
+ uploadMedia(media: MediaInput, options?: Signal & {
266
+ folder?: string;
267
+ }): Promise<MediaResult>;
268
+ /**
269
+ * Adds a post (RFC-7 "Posting with archives"): first to the newest archive, or to a new archive once the newest
270
+ * holds `archiveSize` items, then to the top of the feed file, which keeps the newest `maxItems`. A feed without
271
+ * archives gets them now, unless `startArchives` is false; then the post only goes into the feed file. Upload
272
+ * media with `uploadMedia()` before posting.
273
+ * @returns the post, with `url`: its archive's URL plus `#<id>`, which never changes; for a feed without
274
+ * archives, the feed file's URL plus `#<id>`, valid while the post is among the newest.
275
+ */
276
+ addPost(input: PostInput, options?: Signal): Promise<PostResult>;
277
+ /**
278
+ * Finds a post by id in the archives (or, for a handed-over feed without archives yet, in the feed file).
279
+ * @returns undefined if there is no such post.
280
+ */
281
+ getPost(id: string, options?: Signal): Promise<PostResult | undefined>;
282
+ /**
283
+ * All posts, newest first: the archives from `_pups.archive_url` along `next_url` (for a feed without archives,
284
+ * the feed file and its `next_url` chain). Each post is returned once.
285
+ */
286
+ posts(options?: Signal): AsyncGenerator<FeedItem>;
287
+ /**
288
+ * Edits a post in its archive, and in the feed file if it is among the newest items (RFC-7 "Editing and deleting
289
+ * items"), and sets `date_modified`. `changes` is either an object (a value sets a field, `null` removes it), or
290
+ * a function that gets a copy of the item and returns the new item, or `undefined` to leave it unchanged. The
291
+ * function may run more than once.
292
+ *
293
+ * Apps should edit posts only when the owner asks them to, whichever app created them.
294
+ * @throws {PupsError} `not_found`
295
+ */
296
+ editPost(id: string, changes: PostChanges | ((item: FeedItem) => FeedItem | undefined | Promise<FeedItem | undefined>), options?: Signal): Promise<PostResult>;
297
+ /**
298
+ * Deletes a post from its archive and from the feed file, which is then filled up again with the newest items
299
+ * from the archives. With `deleteMedia`, it also deletes the files in the feed directory that the post references
300
+ * and no other post does; this reads all archives.
301
+ * @returns the deleted item, and the public URLs of the deleted media files.
302
+ * @throws {PupsError} `not_found`
303
+ */
304
+ deletePost(id: string, options?: Signal & {
305
+ deleteMedia?: boolean;
306
+ }): Promise<{
307
+ item: FeedItem;
308
+ deletedMedia: string[];
309
+ }>;
310
+ }
311
+ /** The feeds registered in the owner's `host-meta.json` (RFC-7 "Registering feeds"). */
312
+ export declare function listFeeds(session: PupsSession, options?: Signal & FeedOptions): Promise<FeedLink[]>;
313
+ export {};
314
+ //# sourceMappingURL=feed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../src/feed.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAGrD,mGAAmG;AACnG,eAAO,MAAM,QAAQ,gCAAgC,CAAA;AAErD,qGAAqG;AACrG,eAAO,MAAM,cAAc,qFAAqF,CAAA;AAsBhH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE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