0.6.3 • Published 7 months ago

@graffiti-garden/api v0.6.3

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
7 months ago

Graffiti API

The Graffiti API makes it possible to build many different types of social applications that naturally interoperate each other, all using only standard client-side tools. This repository contains the abstract API and its documentation.

View the API Documentation

Implementing the API

To implement the API, first install it:

npm install @graffiti-garden/api

Then create a class that extends the Graffiti class and implement the abstract methods.

import { Graffiti } from "@graffiti-garden/api";

class MyGraffitiImplementation extends Graffiti {
  // Implement the abstract methods here
}

Testing

We have written a number of unit tests written with vitest that can be used to verify implementations of the API. To use them, create a test file in that ends in *.spec.ts and format it as follows:

import { graffitiCRUDTests } from "@graffiti-garden/api/tests";

const useGraffiti = () => new MyGraffitiImplementation();
// Fill in with implementation-specific information
// to provide to valid actor sessions for the tests
// to use as identities.
const useSession1 = () => ({ actor: "someone" });
const useSession2 = () => ({ actor: "someoneelse" });

// Run the tests
graffitiCRUDTests(useGraffiti, useSession1, useSession2);

Then run the tests in the root of your directory with:

npx vitest

Building the Documentation

To build the TypeDoc documentation, run the following commands:

npm run install
npm run build:docs

Then run a local server to view the documentation:

cd docs
npx http-server

TODO

  • Login scope?
0.6.3

7 months ago

0.6.2

7 months ago

0.6.1

7 months ago

0.5.1

7 months ago

0.6.0

7 months ago

0.5.0

7 months ago

0.4.4

8 months ago

0.4.3

8 months ago

0.4.2

8 months ago

0.4.1

8 months ago

0.4.0

8 months ago

0.3.0

8 months ago

0.2.11

8 months ago

0.2.10

8 months ago

0.2.9

8 months ago

0.2.8

9 months ago

0.2.7

9 months ago

0.2.6

9 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.11

9 months ago

0.1.10

9 months ago

0.1.9

9 months ago

0.1.8

9 months ago

0.1.7

9 months ago

0.1.6

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

10 months ago