@graffiti-garden/api 0.6.4 → 1.0.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 +0 -7
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +3 -3
- package/dist/src/1-api.d.ts +121 -177
- package/dist/src/1-api.d.ts.map +1 -1
- package/dist/src/2-types.d.ts +38 -151
- package/dist/src/2-types.d.ts.map +1 -1
- package/dist/src/3-errors.d.ts +2 -2
- package/dist/src/3-errors.d.ts.map +1 -1
- package/dist/tests/crud.d.ts +1 -1
- package/dist/tests/crud.d.ts.map +1 -1
- package/dist/tests/discover.d.ts +1 -1
- package/dist/tests/discover.d.ts.map +1 -1
- package/dist/tests/index.d.ts +0 -4
- package/dist/tests/index.d.ts.map +1 -1
- package/dist/tests/utils.d.ts +3 -3
- package/dist/tests/utils.d.ts.map +1 -1
- package/dist/tests.mjs +3 -1269
- package/dist/tests.mjs.map +4 -4
- package/package.json +4 -5
- package/src/1-api.ts +126 -185
- package/src/2-types.ts +39 -156
- package/src/3-errors.ts +6 -6
- package/tests/crud.ts +42 -320
- package/tests/discover.ts +51 -349
- package/tests/index.ts +2 -4
- package/tests/utils.ts +4 -4
- package/dist/tests/channel-stats.d.ts +0 -3
- package/dist/tests/channel-stats.d.ts.map +0 -1
- package/dist/tests/orphans.d.ts +0 -3
- package/dist/tests/orphans.d.ts.map +0 -1
- package/tests/channel-stats.ts +0 -129
- package/tests/orphans.ts +0 -128
package/dist/src/1-api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraffitiObjectUrl, GraffitiObject,
|
|
1
|
+
import type { GraffitiObjectUrl, GraffitiObject, GraffitiSession, GraffitiPostObject, GraffitiObjectStream, GraffitiObjectStreamContinue } from "./2-types";
|
|
2
2
|
import type { JSONSchema } from "json-schema-to-ts";
|
|
3
3
|
/**
|
|
4
4
|
* This API describes a small but powerful set of methods that
|
|
@@ -32,14 +32,13 @@ import type { JSONSchema } from "json-schema-to-ts";
|
|
|
32
32
|
* ## API Overview
|
|
33
33
|
*
|
|
34
34
|
* The Graffiti API provides applications with methods for {@link login} and {@link logout},
|
|
35
|
-
* methods to
|
|
36
|
-
* and a method to {@link discover} data objects
|
|
35
|
+
* methods to interact with data objects using standard database operations ({@link post}, {@link get}, and {@link delete}),
|
|
36
|
+
* and a method to {@link discover} data objects created by others.
|
|
37
37
|
* These data objects have a couple structured properties:
|
|
38
38
|
* - {@link GraffitiObjectBase.url | `url`} (string): A globally unique identifier and locator for the object.
|
|
39
39
|
* - {@link GraffitiObjectBase.actor | `actor`} (string): An unforgeable identifier for the creator of the object.
|
|
40
|
-
* - {@link GraffitiObjectBase.allowed | `allowed`} (string[] | undefined): An array of the
|
|
40
|
+
* - {@link GraffitiObjectBase.allowed | `allowed`} (string[] | undefined): An array of the actors who are allowed to access the object (undefined for public objects).
|
|
41
41
|
* - {@link GraffitiObjectBase.channels | `channels`} (string[]): An array of the *contexts* in which the object should appear.
|
|
42
|
-
* - {@link GraffitiObjectBase.lastModified | `revision`} (number): A number to compare different versions of an object.
|
|
43
42
|
*
|
|
44
43
|
* All other data is stored in the object's unstructured {@link GraffitiObjectBase.value | `value`} property.
|
|
45
44
|
* This data can be used to represent social artifacts (e.g. posts, profiles) and activities (e.g. likes, follows).
|
|
@@ -87,57 +86,43 @@ import type { JSONSchema } from "json-schema-to-ts";
|
|
|
87
86
|
* which are Graffiti's means of organizing data contextually, and a concept called "total reification",
|
|
88
87
|
* which handles explains how moderation, collaboration, and other interactions are managed.
|
|
89
88
|
*
|
|
90
|
-
* @groupDescription
|
|
91
|
-
* Methods for {@link
|
|
89
|
+
* @groupDescription 1 - Single-Object Methods
|
|
90
|
+
* Methods for {@link post | creating}, {@link get | reading},
|
|
92
91
|
* and {@link delete | deleting} {@link GraffitiObjectBase | Graffiti objects}.
|
|
93
|
-
* @groupDescription
|
|
92
|
+
* @groupDescription 2 - Multi-Object Methods
|
|
94
93
|
* Methods that retrieve or accumulate information about multiple {@link GraffitiObjectBase | Graffiti objects} at a time.
|
|
95
|
-
* @groupDescription
|
|
94
|
+
* @groupDescription 3 - Media Methods
|
|
95
|
+
* Methods for {@link postMedia | creating}, {@link getMedia | reading},
|
|
96
|
+
* and {@link deleteMedia | deleting} media data.
|
|
97
|
+
* @groupDescription 4 - Session Management
|
|
96
98
|
* Methods and properties for logging in and out.
|
|
97
99
|
*/
|
|
98
100
|
export declare abstract class Graffiti {
|
|
99
101
|
/**
|
|
100
|
-
* Creates a new {@link GraffitiObjectBase | object}
|
|
101
|
-
* An object can only be replaced by the same {@link GraffitiObjectBase.actor | `actor`}
|
|
102
|
-
* that created it.
|
|
102
|
+
* Creates a new {@link GraffitiObjectBase | object}.
|
|
103
103
|
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* @throws {@link GraffitiErrorNotFound} if a {@link GraffitiObjectBase.url | `url`}
|
|
108
|
-
* is provided that has not been created yet or the {@link GraffitiObjectBase.actor | `actor`}
|
|
109
|
-
* is not {@link GraffitiObjectBase.allowed | `allowed`} to see it.
|
|
110
|
-
*
|
|
111
|
-
* @throws {@link GraffitiErrorForbidden} if the {@link GraffitiObjectBase.actor | `actor`}
|
|
112
|
-
* is not the same `actor` as the one who created the object.
|
|
113
|
-
*
|
|
114
|
-
* @returns Returns the object that was replaced if one one exists, otherwise returns an object with
|
|
115
|
-
* with an empty {@link GraffitiObjectBase.value | `value`},
|
|
116
|
-
* {@link GraffitiObjectBase.channels | `channels`}, and {@link GraffitiObjectBase.allowed | `allowed`}
|
|
117
|
-
* list.
|
|
118
|
-
* The {@link GraffitiObjectBase.lastModified | `lastModified`} property of the returned object
|
|
119
|
-
* will be updated to the time of replacement/creation.
|
|
104
|
+
* @returns Returns the object that has been posted, complete with its
|
|
105
|
+
* assigned {@link GraffitiObjectBase.url | `url`} and
|
|
106
|
+
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
120
107
|
*
|
|
121
|
-
* @group
|
|
108
|
+
* @group 1 - Single-Object Methods
|
|
122
109
|
*/
|
|
123
|
-
abstract
|
|
110
|
+
abstract post<Schema extends JSONSchema>(
|
|
124
111
|
/**
|
|
125
|
-
*
|
|
126
|
-
* as the generic type parameter.
|
|
127
|
-
* ensure that the
|
|
112
|
+
* An object to post. This object is statically type-checked against the [JSON schema](https://json-schema.org/) that can be optionally provided
|
|
113
|
+
* as the generic type parameter. It is recommended to a schema to
|
|
114
|
+
* ensure that the posted object matches subsequent {@link get} or {@link discover}
|
|
128
115
|
* methods.
|
|
129
116
|
*/
|
|
130
|
-
object:
|
|
117
|
+
object: GraffitiPostObject<Schema>,
|
|
131
118
|
/**
|
|
132
119
|
* An implementation-specific object with information to authenticate the
|
|
133
120
|
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
134
121
|
*/
|
|
135
|
-
session: GraffitiSession): Promise<
|
|
122
|
+
session: GraffitiSession): Promise<GraffitiObject<Schema>>;
|
|
136
123
|
/**
|
|
137
|
-
* Retrieves an object from a given {@link GraffitiObjectBase.url | `url`}
|
|
138
|
-
*
|
|
139
|
-
* The retrieved object is type-checked against the provided [JSON schema](https://json-schema.org/)
|
|
140
|
-
* otherwise a {@link GraffitiErrorSchemaMismatch} is thrown.
|
|
124
|
+
* Retrieves an object from a given {@link GraffitiObjectBase.url | `url`} matching
|
|
125
|
+
* the provided `schema`.
|
|
141
126
|
*
|
|
142
127
|
* If the retreiving {@link GraffitiObjectBase.actor | `actor`} is not
|
|
143
128
|
* the object's `actor`,
|
|
@@ -152,7 +137,7 @@ export declare abstract class Graffiti {
|
|
|
152
137
|
*
|
|
153
138
|
* @throws {@link GraffitiErrorSchemaMismatch} if the retrieved object does not match the provided schema.
|
|
154
139
|
*
|
|
155
|
-
* @group
|
|
140
|
+
* @group 1 - Single-Object Methods
|
|
156
141
|
*/
|
|
157
142
|
abstract get<Schema extends JSONSchema>(
|
|
158
143
|
/**
|
|
@@ -171,59 +156,18 @@ export declare abstract class Graffiti {
|
|
|
171
156
|
*/
|
|
172
157
|
session?: GraffitiSession | null): Promise<GraffitiObject<Schema>>;
|
|
173
158
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* `actor` that created the object.
|
|
177
|
-
*
|
|
178
|
-
* @returns Returns the original object prior to the patch with its
|
|
179
|
-
* {@link GraffitiObjectBase.lastModified | `lastModified`}
|
|
180
|
-
* property updated to the time of patching.
|
|
181
|
-
*
|
|
182
|
-
* @throws {@link GraffitiErrorNotFound} if the object does not exist, has already been deleted,
|
|
183
|
-
* or the actor is not {@link GraffitiObjectBase.allowed | `allowed`} to access it.
|
|
184
|
-
*
|
|
185
|
-
* @throws {@link GraffitiErrorForbidden} if the {@link GraffitiObjectBase.actor | `actor`}
|
|
186
|
-
* is not the same `actor` as the one who created the object.
|
|
187
|
-
*
|
|
188
|
-
* @group CRUD Methods
|
|
189
|
-
*/
|
|
190
|
-
abstract patch(
|
|
191
|
-
/**
|
|
192
|
-
* A collection of [JSON Patch](https://jsonpatch.com) operations
|
|
193
|
-
* to apply to the object. See {@link GraffitiPatch} for more information.
|
|
194
|
-
*/
|
|
195
|
-
patch: GraffitiPatch,
|
|
196
|
-
/**
|
|
197
|
-
* The location of the object to patch.
|
|
198
|
-
*/
|
|
199
|
-
url: string | GraffitiObjectUrl,
|
|
200
|
-
/**
|
|
201
|
-
* An implementation-specific object with information to authenticate the
|
|
202
|
-
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
203
|
-
*/
|
|
204
|
-
session: GraffitiSession): Promise<GraffitiObjectBase>;
|
|
205
|
-
/**
|
|
206
|
-
* Deletes an object from a given {@link GraffitiObjectBase.url | `url`}.
|
|
159
|
+
* Deletes an object from a given {@link GraffitiObjectBase.url | `url`}
|
|
160
|
+
* that had previously been {@link post | `post`ed}.
|
|
207
161
|
* The deleting {@link GraffitiObjectBase.actor | `actor`} must be the same as the
|
|
208
162
|
* `actor` that created the object.
|
|
209
163
|
*
|
|
210
|
-
*
|
|
211
|
-
* to ensure a person's [right to be forgotten](https://en.wikipedia.org/wiki/Right_to_be_forgotten).
|
|
212
|
-
* In cases where deleting and restoring an object is useful, an object's
|
|
213
|
-
* {@link GraffitiObjectBase.allowed | `allowed`} property can be set to
|
|
214
|
-
* an empty list to hide it from all actors except the creator.
|
|
215
|
-
*
|
|
216
|
-
* @returns Returns the object that was deleted with its
|
|
217
|
-
* {@link GraffitiObjectBase.lastModified | `lastModified`}
|
|
218
|
-
* property updated to the time of deletion.
|
|
219
|
-
*
|
|
220
|
-
* @throws {@link GraffitiErrorNotFound} if the object does not exist, has already been deleted,
|
|
164
|
+
* @throws {@link GraffitiErrorNotFound} if the object does not exist, has already been deleted,
|
|
221
165
|
* or the actor is not {@link GraffitiObjectBase.allowed | `allowed`} to access it.
|
|
222
166
|
*
|
|
223
167
|
* @throws {@link GraffitiErrorForbidden} if the {@link GraffitiObjectBase.actor | `actor`}
|
|
224
168
|
* is not the same `actor` as the one who created the object.
|
|
225
169
|
*
|
|
226
|
-
* @group
|
|
170
|
+
* @group 1 - Single-Object Methods
|
|
227
171
|
*/
|
|
228
172
|
abstract delete(
|
|
229
173
|
/**
|
|
@@ -234,7 +178,7 @@ export declare abstract class Graffiti {
|
|
|
234
178
|
* An implementation-specific object with information to authenticate the
|
|
235
179
|
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
236
180
|
*/
|
|
237
|
-
session: GraffitiSession): Promise<
|
|
181
|
+
session: GraffitiSession): Promise<void>;
|
|
238
182
|
/**
|
|
239
183
|
* Discovers objects created by any actor that are contained
|
|
240
184
|
* in at least one of the given {@link GraffitiObjectBase.channels | `channels`}
|
|
@@ -250,7 +194,7 @@ export declare abstract class Graffiti {
|
|
|
250
194
|
* string can be serialized to continue the stream after an application is closed
|
|
251
195
|
* and reopened.
|
|
252
196
|
*
|
|
253
|
-
* `discover` will not return objects that the {@link GraffitiObjectBase.actor | `actor`}
|
|
197
|
+
* `discover` will not return objects that the querying {@link GraffitiObjectBase.actor | `actor`}
|
|
254
198
|
* is not {@link GraffitiObjectBase.allowed | `allowed`} to access.
|
|
255
199
|
* If the `actor` is not the creator of a discovered object,
|
|
256
200
|
* the allowed list will be masked to only contain the querying actor if the
|
|
@@ -261,14 +205,11 @@ export declare abstract class Graffiti {
|
|
|
261
205
|
*
|
|
262
206
|
* Since different implementations may fetch data from multiple sources there is
|
|
263
207
|
* no guarentee on the order that objects are returned in.
|
|
264
|
-
* It is also possible that duplicate objects are returned and their
|
|
265
|
-
* {@link GraffitiObjectBase.lastModified | `lastModified`} fields must be used
|
|
266
|
-
* to determine which object is the most recent.
|
|
267
208
|
*
|
|
268
209
|
* @returns Returns a stream of objects that match the given {@link GraffitiObjectBase.channels | `channels`}
|
|
269
210
|
* and [JSON Schema](https://json-schema.org).
|
|
270
211
|
*
|
|
271
|
-
* @group
|
|
212
|
+
* @group 2 - Multi-Object Methods
|
|
272
213
|
*/
|
|
273
214
|
abstract discover<Schema extends JSONSchema>(
|
|
274
215
|
/**
|
|
@@ -287,88 +228,110 @@ export declare abstract class Graffiti {
|
|
|
287
228
|
*/
|
|
288
229
|
session?: GraffitiSession | null): GraffitiObjectStream<Schema>;
|
|
289
230
|
/**
|
|
290
|
-
*
|
|
291
|
-
* {@link
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
231
|
+
* Continues a {@link GraffitiObjectStream} from a given
|
|
232
|
+
* {@link GraffitiObjectStreamReturn.cursor | `cursor`} string.
|
|
233
|
+
* The continuation will return new objects that have been {@link post | `post`ed}
|
|
234
|
+
* that match the original stream, and also returns the
|
|
235
|
+
* {@link GraffitiObjectBase.url | `url`}s of objects that
|
|
236
|
+
* have been {@link delete | `delete`d}, as marked by a `tombstone`.
|
|
295
237
|
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
238
|
+
* The `cursor` allows the client to
|
|
239
|
+
* serialize the state of the stream and continue it later.
|
|
240
|
+
* However this method loses any typing information that was
|
|
241
|
+
* present in the original stream. For better type safety
|
|
242
|
+
* and when serializing is not necessary, use the
|
|
243
|
+
* {@link GraffitiObjectStreamReturn.continue | `continue`} method
|
|
244
|
+
* instead, which is returned along with the `cursor` at the
|
|
245
|
+
* end of the original stream.
|
|
299
246
|
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
* method or {@link GraffitiObjectStreamReturn.cursor | `cursor`} string.
|
|
247
|
+
* @throws {@link GraffitiErrorForbidden} if the {@link GraffitiObjectBase.actor | `actor`}
|
|
248
|
+
* provided in the `session` is not the same as the `actor`
|
|
249
|
+
* that initiated the original stream.
|
|
304
250
|
*
|
|
305
|
-
* @
|
|
306
|
-
|
|
307
|
-
|
|
251
|
+
* @group 2 - Multi-Object Methods
|
|
252
|
+
*/
|
|
253
|
+
abstract continueDiscover(cursor: string, session?: GraffitiSession | null): GraffitiObjectStreamContinue<{}>;
|
|
254
|
+
/**
|
|
255
|
+
* Uploads media data, such as an image or video.
|
|
308
256
|
*
|
|
309
|
-
* @
|
|
257
|
+
* Unlike structured {@link GraffitiObjectBase | objects},
|
|
258
|
+
* media is not indexed for {@link discover | `discover`y} and
|
|
259
|
+
* must be retrieved by its exact URL using {@link getMedia}
|
|
260
|
+
*
|
|
261
|
+
* @returns The URL that the media was posted to.
|
|
262
|
+
*
|
|
263
|
+
* @group 3 - Media Methods
|
|
310
264
|
*/
|
|
311
|
-
abstract
|
|
265
|
+
abstract postMedia(
|
|
312
266
|
/**
|
|
313
|
-
*
|
|
267
|
+
* The binary data of the media to be uploaded,
|
|
268
|
+
* along with its [media type](https://www.iana.org/assignments/media-types/media-types.xhtml),
|
|
269
|
+
* formatted as a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
|
|
314
270
|
*/
|
|
315
|
-
|
|
271
|
+
media: Blob,
|
|
316
272
|
/**
|
|
317
273
|
* An implementation-specific object with information to authenticate the
|
|
318
274
|
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
319
275
|
*/
|
|
320
|
-
session: GraffitiSession):
|
|
276
|
+
session: GraffitiSession): Promise<string>;
|
|
321
277
|
/**
|
|
322
|
-
*
|
|
323
|
-
* that an {@link GraffitiObjectBase.actor | `actor`} has posted to.
|
|
324
|
-
* This method will not return statistics related to any other actor's channel usage.
|
|
278
|
+
* Deletes media previously {@link postMedia | `post`ed} to a given URL.
|
|
325
279
|
*
|
|
326
|
-
*
|
|
327
|
-
* but necessary for getting a global view of all an actor's Graffiti data
|
|
328
|
-
* to implement something like Facebook's Activity Log or a debugging interface.
|
|
280
|
+
* @throws {@link GraffitiErrorNotFound} if no media at that URL exists.
|
|
329
281
|
*
|
|
330
|
-
*
|
|
331
|
-
* the
|
|
332
|
-
*
|
|
333
|
-
* @group Query Methods
|
|
282
|
+
* @throws {@link GraffitiErrorForbidden} if the {@link GraffitiObjectBase.actor | `actor`}
|
|
283
|
+
* provided in the `session` is not the same as the `actor` that {@link postMedia | `post`ed}
|
|
284
|
+
* the media.
|
|
334
285
|
*
|
|
335
|
-
* @
|
|
336
|
-
* that the {@link GraffitiObjectBase.actor | `actor`} has posted to.
|
|
286
|
+
* @group 3 - Media Methods
|
|
337
287
|
*/
|
|
338
|
-
abstract
|
|
288
|
+
abstract deleteMedia(
|
|
289
|
+
/**
|
|
290
|
+
* A globally unique identifier and locator for the media.
|
|
291
|
+
*/
|
|
292
|
+
mediaUrl: string,
|
|
339
293
|
/**
|
|
340
294
|
* An implementation-specific object with information to authenticate the
|
|
341
295
|
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
342
296
|
*/
|
|
343
|
-
session: GraffitiSession):
|
|
297
|
+
session: GraffitiSession): Promise<void>;
|
|
344
298
|
/**
|
|
345
|
-
*
|
|
346
|
-
* {@link GraffitiObjectStreamReturn.cursor | `cursor`} string.
|
|
347
|
-
* The continuation will return new objects that have been created
|
|
348
|
-
* that match the original stream, and also returns the
|
|
349
|
-
* {@link GraffitiObjectBase.url | `url`}s of objects that
|
|
350
|
-
* have been deleted, as marked by a `tombstone`.
|
|
299
|
+
* Retrieves media from the given media URL, adhering to the given requirements.
|
|
351
300
|
*
|
|
352
|
-
*
|
|
353
|
-
* were already returned by the original stream. This is dependent
|
|
354
|
-
* on how much state the underlying implementation maintains.
|
|
301
|
+
* @throws {@link GraffitiErrorNotFound} if no media at that URL exists.
|
|
355
302
|
*
|
|
356
|
-
*
|
|
357
|
-
* serialize the state of the stream and continue it later.
|
|
358
|
-
* However this method loses any typing information that was
|
|
359
|
-
* present in the original stream. For better type safety
|
|
360
|
-
* and when serializing is not necessary, use the
|
|
361
|
-
* {@link GraffitiObjectStreamReturn.continue | `continue`} method
|
|
362
|
-
* instead, which is returned along with the `cursor` at the
|
|
363
|
-
* end of the original stream.
|
|
303
|
+
* @throws {@link GraffitiErrorTooLarge} if the media exceeds the given `maxBytes`.
|
|
364
304
|
*
|
|
365
|
-
* @throws {@link
|
|
366
|
-
*
|
|
367
|
-
*
|
|
305
|
+
* @throws {@link GraffitiErrorNotAcceptable} if the media does not match the given
|
|
306
|
+
* `accept` specification.
|
|
307
|
+
*
|
|
308
|
+
* @returns The URL of the retrieved media, as a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
|
|
309
|
+
* and the {@link GraffitiObjectBase.actor | `actor`} that posted it.
|
|
368
310
|
*
|
|
369
|
-
* @group
|
|
311
|
+
* @group 3 - Media Methods
|
|
370
312
|
*/
|
|
371
|
-
abstract
|
|
313
|
+
abstract getMedia(
|
|
314
|
+
/**
|
|
315
|
+
* A globally unique identifier and locator for the media.
|
|
316
|
+
*/
|
|
317
|
+
mediaUrl: string,
|
|
318
|
+
/**
|
|
319
|
+
* An optional set of requirements the retrieved media must meet.
|
|
320
|
+
*/
|
|
321
|
+
requirements?: {
|
|
322
|
+
/**
|
|
323
|
+
* A list of acceptable media types for the retrieved media,
|
|
324
|
+
* formatted as like an [HTTP Accept header](https://httpwg.org/specs/rfc9110.html#field.accept)
|
|
325
|
+
*/
|
|
326
|
+
accept?: string;
|
|
327
|
+
/**
|
|
328
|
+
* The maximum size, in bytes, of the media.
|
|
329
|
+
*/
|
|
330
|
+
maxBytes?: number;
|
|
331
|
+
}): Promise<{
|
|
332
|
+
media: Blob;
|
|
333
|
+
actor: string;
|
|
334
|
+
}>;
|
|
372
335
|
/**
|
|
373
336
|
* Begins the login process. Depending on the implementation, this may
|
|
374
337
|
* involve redirecting to a login page or opening a popup,
|
|
@@ -379,38 +342,19 @@ export declare abstract class Graffiti {
|
|
|
379
342
|
* asynchronously via {@link Graffiti.sessionEvents | sessionEvents}
|
|
380
343
|
* as a {@link GraffitiLoginEvent} with event type `login`.
|
|
381
344
|
*
|
|
382
|
-
* @group Session Management
|
|
345
|
+
* @group 4 - Session Management
|
|
383
346
|
*/
|
|
384
347
|
abstract login(
|
|
385
348
|
/**
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
349
|
+
* A suggested actor to login as. For example, if a user tries to
|
|
350
|
+
* edit a post but are not logged in, the interface can infer that
|
|
351
|
+
* they might want to log in as the actor who created the post
|
|
352
|
+
* they are attempting to edit.
|
|
353
|
+
*
|
|
354
|
+
* Even if provided, the implementation should allow the user
|
|
355
|
+
* to log in as a different actor if they choose.
|
|
389
356
|
*/
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* A suggested actor to login as. For example, if a user tries to
|
|
393
|
-
* edit a post but are not logged in, the interface can infer that
|
|
394
|
-
* they might want to log in as the actor who created the post
|
|
395
|
-
* they are attempting to edit.
|
|
396
|
-
*
|
|
397
|
-
* Even if provided, the implementation should allow the user
|
|
398
|
-
* to log in as a different actor if they choose.
|
|
399
|
-
*/
|
|
400
|
-
actor?: string;
|
|
401
|
-
/**
|
|
402
|
-
* A yet to be defined permissions scope. An application may use
|
|
403
|
-
* this to indicate the minimum necessary scope needed to
|
|
404
|
-
* operate. For example, it may need to be able read private
|
|
405
|
-
* messages from a certain set of channels, or write messages that
|
|
406
|
-
* follow a particular schema.
|
|
407
|
-
*
|
|
408
|
-
* The login process should make it clear what scope an application
|
|
409
|
-
* is requesting and allow the user to enhance or reduce that
|
|
410
|
-
* scope as necessary.
|
|
411
|
-
*/
|
|
412
|
-
scope?: {};
|
|
413
|
-
}): Promise<void>;
|
|
357
|
+
actor?: string): Promise<void>;
|
|
414
358
|
/**
|
|
415
359
|
* Begins the logout process for a particular {@link GraffitiSession | session}. Depending on the implementation, this may
|
|
416
360
|
* involve redirecting the user to a logout page or opening a popup,
|
|
@@ -421,7 +365,7 @@ export declare abstract class Graffiti {
|
|
|
421
365
|
* {@link Graffiti.sessionEvents | sessionEvents}
|
|
422
366
|
* as a {@link GraffitiLogoutEvent} as event type `logout`.
|
|
423
367
|
*
|
|
424
|
-
* @group Session Management
|
|
368
|
+
* @group 4 - Session Management
|
|
425
369
|
*/
|
|
426
370
|
abstract logout(
|
|
427
371
|
/**
|
|
@@ -435,7 +379,7 @@ export declare abstract class Graffiti {
|
|
|
435
379
|
* - `logout` - {@link GraffitiLogoutEvent}
|
|
436
380
|
* - `initialized` - {@link GraffitiSessionInitializedEvent}
|
|
437
381
|
*
|
|
438
|
-
* @group Session Management
|
|
382
|
+
* @group 4 - Session Management
|
|
439
383
|
*/
|
|
440
384
|
abstract readonly sessionEvents: EventTarget;
|
|
441
385
|
}
|
package/dist/src/1-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1-api.d.ts","sourceRoot":"","sources":["../../src/1-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,
|
|
1
|
+
{"version":3,"file":"1-api.d.ts","sourceRoot":"","sources":["../../src/1-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EAEd,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBA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