@graffiti-garden/api 1.0.0 → 1.0.2
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/index.cjs +1 -1
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +4 -4
- package/dist/src/1-api.d.ts +66 -19
- package/dist/src/1-api.d.ts.map +1 -1
- package/dist/src/2-types.d.ts +3 -3
- package/dist/src/2-types.d.ts.map +1 -1
- package/dist/src/3-errors.d.ts +0 -9
- package/dist/src/3-errors.d.ts.map +1 -1
- package/dist/src/4-utilities.d.ts +8 -0
- package/dist/src/4-utilities.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/tests/crud.d.ts.map +1 -1
- package/dist/tests/index.d.ts +3 -0
- package/dist/tests/index.d.ts.map +1 -1
- package/dist/tests/media.d.ts +3 -0
- package/dist/tests/media.d.ts.map +1 -0
- package/dist/tests.mjs +683 -0
- package/dist/tests.mjs.map +4 -4
- package/package.json +3 -2
- package/src/1-api.ts +67 -17
- package/src/2-types.ts +4 -3
- package/src/3-errors.ts +0 -24
- package/src/4-utilities.ts +65 -0
- package/src/index.ts +1 -0
- package/tests/crud.ts +0 -15
- package/tests/index.ts +3 -2
- package/tests/media.ts +158 -0
package/dist/src/1-api.d.ts
CHANGED
|
@@ -94,7 +94,7 @@ import type { JSONSchema } from "json-schema-to-ts";
|
|
|
94
94
|
* @groupDescription 3 - Media Methods
|
|
95
95
|
* Methods for {@link postMedia | creating}, {@link getMedia | reading},
|
|
96
96
|
* and {@link deleteMedia | deleting} media data.
|
|
97
|
-
* @groupDescription 4 -
|
|
97
|
+
* @groupDescription 4 - Identity Methods
|
|
98
98
|
* Methods and properties for logging in and out.
|
|
99
99
|
*/
|
|
100
100
|
export declare abstract class Graffiti {
|
|
@@ -109,12 +109,14 @@ export declare abstract class Graffiti {
|
|
|
109
109
|
*/
|
|
110
110
|
abstract post<Schema extends JSONSchema>(
|
|
111
111
|
/**
|
|
112
|
-
* An object to post
|
|
113
|
-
*
|
|
112
|
+
* An object to post, minus its {@link GraffitiObjectBase.url | `url`} and
|
|
113
|
+
* {@link GraffitiObjectBase.actor | `actor`}, which will be assigned once posted.
|
|
114
|
+
* This object is statically type-checked against the [JSON schema](https://json-schema.org/) that can be optionally provided
|
|
115
|
+
* as the generic type parameter. It is recommended to use a schema to
|
|
114
116
|
* ensure that the posted object matches subsequent {@link get} or {@link discover}
|
|
115
117
|
* methods.
|
|
116
118
|
*/
|
|
117
|
-
|
|
119
|
+
partialObject: GraffitiPostObject<Schema>,
|
|
118
120
|
/**
|
|
119
121
|
* An implementation-specific object with information to authenticate the
|
|
120
122
|
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
@@ -262,13 +264,24 @@ export declare abstract class Graffiti {
|
|
|
262
264
|
*
|
|
263
265
|
* @group 3 - Media Methods
|
|
264
266
|
*/
|
|
265
|
-
abstract postMedia(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
abstract postMedia(media: {
|
|
268
|
+
/**
|
|
269
|
+
* The binary data of the media to be uploaded,
|
|
270
|
+
* along with its [media type](https://www.iana.org/assignments/media-types/media-types.xhtml),
|
|
271
|
+
* formatted as a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
|
|
272
|
+
*/
|
|
273
|
+
data: Blob;
|
|
274
|
+
/**
|
|
275
|
+
* An optional list, identical in function to an object's
|
|
276
|
+
* {@link GraffitiObjectBase.allowed | `allowed`} property,
|
|
277
|
+
* that specifies the {@link GraffitiObjectBase.actor | `actor`}s
|
|
278
|
+
* who are allowed to access the media. If the list is `undefined`
|
|
279
|
+
* or `null`, anyone with the URL can access the media. If the list
|
|
280
|
+
* is empty, only the {@link GraffitiObjectBase.actor | `actor`}
|
|
281
|
+
* who {@link postMedia | `post`ed} the media can access it.
|
|
282
|
+
*/
|
|
283
|
+
allowed?: string[] | null;
|
|
284
|
+
},
|
|
272
285
|
/**
|
|
273
286
|
* An implementation-specific object with information to authenticate the
|
|
274
287
|
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
@@ -316,21 +329,27 @@ export declare abstract class Graffiti {
|
|
|
316
329
|
*/
|
|
317
330
|
mediaUrl: string,
|
|
318
331
|
/**
|
|
319
|
-
*
|
|
332
|
+
* A set of requirements the retrieved media must meet.
|
|
320
333
|
*/
|
|
321
|
-
requirements
|
|
334
|
+
requirements: {
|
|
322
335
|
/**
|
|
323
336
|
* A list of acceptable media types for the retrieved media,
|
|
324
337
|
* formatted as like an [HTTP Accept header](https://httpwg.org/specs/rfc9110.html#field.accept)
|
|
325
338
|
*/
|
|
326
339
|
accept?: string;
|
|
327
340
|
/**
|
|
328
|
-
* The maximum size, in bytes, of the media.
|
|
341
|
+
* The maximum acceptable size, in bytes, of the media.
|
|
329
342
|
*/
|
|
330
343
|
maxBytes?: number;
|
|
331
|
-
}
|
|
332
|
-
|
|
344
|
+
},
|
|
345
|
+
/**
|
|
346
|
+
* An implementation-specific object with information to authenticate the
|
|
347
|
+
* {@link GraffitiObjectBase.actor | `actor`}.
|
|
348
|
+
*/
|
|
349
|
+
session?: GraffitiSession | null): Promise<{
|
|
350
|
+
data: Blob;
|
|
333
351
|
actor: string;
|
|
352
|
+
allowed?: string[] | null;
|
|
334
353
|
}>;
|
|
335
354
|
/**
|
|
336
355
|
* Begins the login process. Depending on the implementation, this may
|
|
@@ -342,7 +361,7 @@ export declare abstract class Graffiti {
|
|
|
342
361
|
* asynchronously via {@link Graffiti.sessionEvents | sessionEvents}
|
|
343
362
|
* as a {@link GraffitiLoginEvent} with event type `login`.
|
|
344
363
|
*
|
|
345
|
-
* @group 4 -
|
|
364
|
+
* @group 4 - Identity Methods
|
|
346
365
|
*/
|
|
347
366
|
abstract login(
|
|
348
367
|
/**
|
|
@@ -365,7 +384,7 @@ export declare abstract class Graffiti {
|
|
|
365
384
|
* {@link Graffiti.sessionEvents | sessionEvents}
|
|
366
385
|
* as a {@link GraffitiLogoutEvent} as event type `logout`.
|
|
367
386
|
*
|
|
368
|
-
* @group 4 -
|
|
387
|
+
* @group 4 - Identity Methods
|
|
369
388
|
*/
|
|
370
389
|
abstract logout(
|
|
371
390
|
/**
|
|
@@ -379,8 +398,36 @@ export declare abstract class Graffiti {
|
|
|
379
398
|
* - `logout` - {@link GraffitiLogoutEvent}
|
|
380
399
|
* - `initialized` - {@link GraffitiSessionInitializedEvent}
|
|
381
400
|
*
|
|
382
|
-
* @group 4 -
|
|
401
|
+
* @group 4 - Identity Methods
|
|
383
402
|
*/
|
|
384
403
|
abstract readonly sessionEvents: EventTarget;
|
|
404
|
+
/**
|
|
405
|
+
* Retrieves the human-readable handle associated
|
|
406
|
+
* with the given actor. The handle may change over time
|
|
407
|
+
* and so it should be used for display purposes only.
|
|
408
|
+
*
|
|
409
|
+
* The inverse of {@link handleToActor}.
|
|
410
|
+
*
|
|
411
|
+
* @throws {@link GraffitiErrorNotFound} if a handle cannot be
|
|
412
|
+
* found for the given actor.
|
|
413
|
+
*
|
|
414
|
+
* @returns A human-readable handle for the given actor.
|
|
415
|
+
*
|
|
416
|
+
* @group 4 - Identity Methods
|
|
417
|
+
*/
|
|
418
|
+
abstract actorToHandle(actor: string): Promise<string>;
|
|
419
|
+
/**
|
|
420
|
+
* Retrieves the actor ID associated with the given handle.
|
|
421
|
+
*
|
|
422
|
+
* The inverse of {@link actorToHandle}.
|
|
423
|
+
*
|
|
424
|
+
* @throws {@link GraffitiErrorNotFound} if there is no actor
|
|
425
|
+
* with the given handle.
|
|
426
|
+
*
|
|
427
|
+
* @returns The actor ID for the given handle.
|
|
428
|
+
*
|
|
429
|
+
* @group 4 - Identity Methods
|
|
430
|
+
*/
|
|
431
|
+
abstract handleToActor(handle: string): Promise<string>;
|
|
385
432
|
}
|
|
386
433
|
//# sourceMappingURL=1-api.d.ts.map
|
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,EAEd,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,8BAAsB,QAAQ;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,CAAC,MAAM,SAAS,UAAU;IACrC
|
|
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,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,8BAAsB,QAAQ;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,CAAC,MAAM,SAAS,UAAU;IACrC;;;;;;;OAOG;IACH,aAAa,EAAE,kBAAkB,CAAC,MAAM,CAAC;IACzC;;;OAGG;IACH,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAElC;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,GAAG,CAAC,MAAM,SAAS,UAAU;IACpC;;OAEG;IACH,GAAG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;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM;IAChB;;OAEG;IACH,YAAY,EAAE;QACZ;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IACD;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,GAC/B,OAAO,CAAC;QACT,IAAI,EAAE,IAAI,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;KAC3B,CAAC;IAEF;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK;IACZ;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAEhB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM;IACb;;OAEG;IACH,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC;IAEhB;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC;IAE7C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAEtD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CACxD"}
|
package/dist/src/2-types.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export interface GraffitiObjectBase {
|
|
|
95
95
|
*
|
|
96
96
|
* Schema-aware objects are returned by {@link Graffiti.get} and {@link Graffiti.discover}.
|
|
97
97
|
*/
|
|
98
|
-
export type GraffitiObject<Schema extends JSONSchema> = GraffitiObjectBase & FromSchema<Schema & typeof
|
|
98
|
+
export type GraffitiObject<Schema extends JSONSchema> = GraffitiObjectBase & FromSchema<Schema & typeof GraffitiPostObjectJSONSchema>;
|
|
99
99
|
/**
|
|
100
100
|
* A JSON Schema equivalent to the {@link GraffitiObjectBase} type.
|
|
101
101
|
* Needed internally for type inference of JSON Schemas, but can
|
|
@@ -148,7 +148,7 @@ export type GraffitiObjectUrl = Pick<GraffitiObjectBase, "url">;
|
|
|
148
148
|
* This local object must have a {@link GraffitiObjectBase.value | `value`} and {@link GraffitiObjectBase.channels | `channels`}
|
|
149
149
|
* and may optionally have an {@link GraffitiObjectBase.allowed | `allowed`} property.
|
|
150
150
|
*/
|
|
151
|
-
export type GraffitiPostObject<Schema extends JSONSchema> = Pick<GraffitiObjectBase, "value" | "channels" | "allowed"> &
|
|
151
|
+
export type GraffitiPostObject<Schema extends JSONSchema> = Pick<GraffitiObjectBase, "value" | "channels" | "allowed"> & FromSchema<Schema & typeof GraffitiPostObjectJSONSchema>;
|
|
152
152
|
/**
|
|
153
153
|
* A JSON Schema equivalent to the {@link GraffitiPostObject} type.
|
|
154
154
|
* Needed internally for type inference of JSON Schemas, but can
|
|
@@ -329,7 +329,7 @@ export interface GraffitiObjectStreamReturn<Schema extends JSONSchema> {
|
|
|
329
329
|
* @returns A function that creates new stream that continues from where the original stream left off.
|
|
330
330
|
* It preserves the typing of the original stream.
|
|
331
331
|
*/
|
|
332
|
-
continue: () => GraffitiObjectStreamContinue<Schema>;
|
|
332
|
+
continue: (session?: GraffitiSession | null) => GraffitiObjectStreamContinue<Schema>;
|
|
333
333
|
/**
|
|
334
334
|
* A string that can be serialized and stored to resume the stream later.
|
|
335
335
|
* It must be passed to the {@link Graffiti.continueDiscover} method
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2-types.d.ts","sourceRoot":"","sources":["../../src/2-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,KAAK,EAAE,EAAE,CA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AAM,CAAC,GACjC,qCAAqC,CAAC;AAE1C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,0BAA0B,CAAC,MAAM,SAAS,UAAU;IACnE;;;OAGG;IACH,QAAQ,EAAE,CACR,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,KAC7B,4BAA4B,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,4BAA4B,CAAC,MAAM,SAAS,UAAU,IAChE,cAAc,CACZ,yBAAyB,GAAG,iCAAiC,CAAC,MAAM,CAAC,EACrE,0BAA0B,CAAC,MAAM,CAAC,CACnC,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,CACxC;IACE,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,GACD;IACE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,eAAe,CAAC;CAC1B,CACJ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CACzC;IACE,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CACJ,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+BAA+B,GAAG,WAAW,CACrD;IACE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GACD,IAAI,GACJ,SAAS,CACZ,CAAC"}
|
package/dist/src/3-errors.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare class GraffitiErrorUnauthorized extends Error {
|
|
2
|
-
constructor(message?: string);
|
|
3
|
-
}
|
|
4
1
|
export declare class GraffitiErrorForbidden extends Error {
|
|
5
2
|
constructor(message?: string);
|
|
6
3
|
}
|
|
@@ -19,10 +16,4 @@ export declare class GraffitiErrorTooLarge extends Error {
|
|
|
19
16
|
export declare class GraffitiErrorNotAcceptable extends Error {
|
|
20
17
|
constructor(message?: string);
|
|
21
18
|
}
|
|
22
|
-
export declare class GraffitiErrorInvalidUrl extends Error {
|
|
23
|
-
constructor(message?: string);
|
|
24
|
-
}
|
|
25
|
-
export declare class GraffitiErrorUnrecognizedUrlScheme extends Error {
|
|
26
|
-
constructor(message?: string);
|
|
27
|
-
}
|
|
28
19
|
//# sourceMappingURL=3-errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3-errors.d.ts","sourceRoot":"","sources":["../../src/3-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,
|
|
1
|
+
{"version":3,"file":"3-errors.d.ts","sourceRoot":"","sources":["../../src/3-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,CAAC,EAAE,MAAM;CAK7B;AAED,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,CAAC,EAAE,MAAM;CAK7B;AAED,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,CAAC,EAAE,MAAM;CAK7B;AAED,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,OAAO,CAAC,EAAE,MAAM;CAK7B;AAED,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,CAAC,EAAE,MAAM;CAK7B;AAED,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,CAAC,EAAE,MAAM;CAK7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSONSchema } from "json-schema-to-ts";
|
|
2
|
+
import type { Ajv } from "ajv";
|
|
3
|
+
import type { GraffitiObjectBase, GraffitiObject, GraffitiObjectUrl, GraffitiSession } from "./2-types";
|
|
4
|
+
export declare function unpackObjectUrl(url: string | GraffitiObjectUrl): string;
|
|
5
|
+
export declare function compileGraffitiObjectSchema<Schema extends JSONSchema>(ajv: Ajv, schema: Schema): (data: GraffitiObjectBase) => data is GraffitiObject<Schema>;
|
|
6
|
+
export declare function isActorAllowedGraffitiObject(object: GraffitiObjectBase, session?: GraffitiSession | null): boolean;
|
|
7
|
+
export declare function maskGraffitiObject(object: GraffitiObjectBase, channels: string[], session?: GraffitiSession | null): void;
|
|
8
|
+
//# sourceMappingURL=4-utilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"4-utilities.d.ts","sourceRoot":"","sources":["../../src/4-utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,eAAe,EAChB,MAAM,WAAW,CAAC;AAEnB,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,UAE9D;AAED,wBAAgB,2BAA2B,CAAC,MAAM,SAAS,UAAU,EACnE,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,UAQJ,kBAAkB,KACrB,IAAI,IAAI,cAAc,CAAC,MAAM,CAAC,CAMtC;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,WAYjC;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,GAC/B,IAAI,CAWN"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/tests/crud.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../tests/crud.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAS9B,eAAO,MAAM,iBAAiB,GAC5B,aAAa,MAAM,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC,EAC5D,aAAa,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,EAC7D,aAAa,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../tests/crud.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAS9B,eAAO,MAAM,iBAAiB,GAC5B,aAAa,MAAM,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC,EAC5D,aAAa,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,EAC7D,aAAa,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,SAqO9D,CAAC"}
|
package/dist/tests/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tests/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tests/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type Graffiti, type GraffitiSession } from "@graffiti-garden/api";
|
|
2
|
+
export declare const graffitiMediaTests: (useGraffiti: () => Pick<Graffiti, "postMedia" | "getMedia" | "deleteMedia">, useSession1: () => GraffitiSession | Promise<GraffitiSession>, useSession2: () => GraffitiSession | Promise<GraffitiSession>) => void;
|
|
3
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../tests/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAI9B,eAAO,MAAM,kBAAkB,GAC7B,aAAa,MAAM,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC,EAC3E,aAAa,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,EAC7D,aAAa,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,SAgJ9D,CAAC"}
|