@graffiti-garden/api 0.1.0 → 0.1.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.
@@ -0,0 +1,2 @@
1
+ "use strict";class r extends Error{constructor(t){super(t),this.name="GraffitiErrorUnauthorized",Object.setPrototypeOf(this,r.prototype)}}class t extends Error{constructor(r){super(r),this.name="GraffitiErrorForbidden",Object.setPrototypeOf(this,t.prototype)}}class o extends Error{constructor(r){super(r),this.name="GraffitiErrorNotFound",Object.setPrototypeOf(this,o.prototype)}}class e extends Error{constructor(r){super(r),this.name="GraffitiErrorInvalidSchema",Object.setPrototypeOf(this,e.prototype)}}class s extends Error{constructor(r){super(r),this.name="GraffitiErrorSchemaMismatch",Object.setPrototypeOf(this,s.prototype)}}class i extends Error{constructor(r){super(r),this.name="GraffitiErrorPatchTestFailed",Object.setPrototypeOf(this,i.prototype)}}class a extends Error{constructor(r){super(r),this.name="GraffitiErrorPatchError",Object.setPrototypeOf(this,a.prototype)}}class c extends Error{constructor(r){super(r),this.name="GraffitiErrorInvalidUri",Object.setPrototypeOf(this,c.prototype)}}exports.Graffiti=class{objectToUri(r){return this.locationToUri(r)}},exports.GraffitiErrorForbidden=t,exports.GraffitiErrorInvalidSchema=e,exports.GraffitiErrorInvalidUri=c,exports.GraffitiErrorNotFound=o,exports.GraffitiErrorPatchError=a,exports.GraffitiErrorPatchTestFailed=i,exports.GraffitiErrorSchemaMismatch=s,exports.GraffitiErrorUnauthorized=r;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ class r{objectToUri(r){return this.locationToUri(r)}}class t extends Error{constructor(r){super(r),this.name="GraffitiErrorUnauthorized",Object.setPrototypeOf(this,t.prototype)}}class o extends Error{constructor(r){super(r),this.name="GraffitiErrorForbidden",Object.setPrototypeOf(this,o.prototype)}}class e extends Error{constructor(r){super(r),this.name="GraffitiErrorNotFound",Object.setPrototypeOf(this,e.prototype)}}class s extends Error{constructor(r){super(r),this.name="GraffitiErrorInvalidSchema",Object.setPrototypeOf(this,s.prototype)}}class i extends Error{constructor(r){super(r),this.name="GraffitiErrorSchemaMismatch",Object.setPrototypeOf(this,i.prototype)}}class c extends Error{constructor(r){super(r),this.name="GraffitiErrorPatchTestFailed",Object.setPrototypeOf(this,c.prototype)}}class a extends Error{constructor(r){super(r),this.name="GraffitiErrorPatchError",Object.setPrototypeOf(this,a.prototype)}}class p extends Error{constructor(r){super(r),this.name="GraffitiErrorInvalidUri",Object.setPrototypeOf(this,p.prototype)}}export{r as Graffiti,o as GraffitiErrorForbidden,s as GraffitiErrorInvalidSchema,p as GraffitiErrorInvalidUri,e as GraffitiErrorNotFound,a as GraffitiErrorPatchError,c as GraffitiErrorPatchTestFailed,i as GraffitiErrorSchemaMismatch,t as GraffitiErrorUnauthorized};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,24 +1,37 @@
1
1
  {
2
2
  "name": "@graffiti-garden/api",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "The heart of Graffiti",
5
- "type": "module",
6
- "main": "src/index.ts",
5
+ "types": "src/index.ts",
6
+ "module": "dist/index.js",
7
+ "main": "dist/index.cjs.js",
7
8
  "exports": {
8
- ".": "./src/index.ts",
9
+ ".": {
10
+ "import": {
11
+ "types": "./src/index.ts",
12
+ "node": "./dist/index.cjs.js",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./src/index.ts",
17
+ "default": "./dist/index.cjs.js"
18
+ }
19
+ },
9
20
  "./tests": "./tests/index.ts"
10
21
  },
11
22
  "files": [
12
23
  "src",
24
+ "dist",
13
25
  "tests",
14
26
  "package.json",
15
- "tsconfig.json"
27
+ "README.md"
16
28
  ],
17
29
  "author": "Theia Henderson",
18
30
  "license": "GPL-3.0-or-later",
19
31
  "scripts": {
20
32
  "docs": "typedoc --options typedoc.json",
21
- "prepublishOnly": "npm install"
33
+ "build": "rollup -c rollup.config.ts --configPlugin rollup-plugin-typescript2",
34
+ "prepublishOnly": "npm install && npm run build"
22
35
  },
23
36
  "repository": {
24
37
  "type": "git",
@@ -29,6 +42,9 @@
29
42
  },
30
43
  "homepage": "https://api.graffiti.garden/classes/Graffiti.html",
31
44
  "devDependencies": {
45
+ "@rollup/plugin-terser": "^0.4.4",
46
+ "rollup": "^4.31.0",
47
+ "rollup-plugin-typescript2": "^0.36.0",
32
48
  "tslib": "^2.8.1",
33
49
  "typedoc": "^0.26.11",
34
50
  "vitest": "^2.1.8"
package/src/1-api.ts CHANGED
@@ -229,6 +229,11 @@ import type { JSONSchema4 } from "json-schema";
229
229
  * npx http-server
230
230
  * ```
231
231
  *
232
+ * ## TODO
233
+ *
234
+ * - Test for listChannels and listOrphans,
235
+ * - Implement scope.
236
+ *
232
237
  * @groupDescription CRUD Methods
233
238
  * Methods for {@link put | creating}, {@link get | reading}, {@link patch | updating},
234
239
  * and {@link delete | deleting} {@link GraffitiObjectBase | Graffiti objects}.
@@ -654,7 +659,7 @@ export abstract class Graffiti {
654
659
  /**
655
660
  * An event target that can be used to listen for `login`
656
661
  * and `logout` events. They are custom events of types
657
- * {@link GraffitiLoginEvent`} and {@link GraffitiLogoutEvent }
662
+ * {@link GraffitiLoginEvent} and {@link GraffitiLogoutEvent }
658
663
  * respectively.
659
664
  *
660
665
  * @group Session Management
package/src/2-types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type JTDDataType } from "ajv/dist/core";
1
+ import type { JTDDataType } from "ajv/dist/core";
2
2
  import type { Operation as JSONPatchOperation } from "fast-json-patch";
3
3
 
4
4
  /**
@@ -1,7 +1,6 @@
1
1
  import { it, expect, describe } from "vitest";
2
2
  import { type GraffitiFactory, type GraffitiSession } from "../src/index";
3
3
  import { randomPutObject, randomString } from "./utils";
4
- import { randomInt } from "crypto";
5
4
 
6
5
  export const graffitiSynchronizeTests = (
7
6
  useGraffiti: GraffitiFactory,
package/tsconfig.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "bundler",
6
- "strict": true,
7
- "esModuleInterop": true,
8
- "resolveJsonModule": true,
9
- "verbatimModuleSyntax": true
10
- },
11
- "include": ["src", "tests"]
12
- }