@xynolog/core 0.8.0 → 0.8.1
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 +40 -37
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -4,40 +4,18 @@
|
|
|
4
4
|
[](https://app.codecov.io/gh/xynolog/sdk/components)
|
|
5
5
|
[](https://www.npmjs.com/package/@xynolog/core)
|
|
6
6
|
[](https://www.npmjs.com/package/@xynolog/core)
|
|
7
|
-
[](https://github.com/xynolog/sdk/blob/
|
|
7
|
+
[](https://github.com/xynolog/sdk/blob/v0.8.1/LICENSE)
|
|
8
8
|
|
|
9
9
|
What every TypeScript package in Xynolog stands on: the protocol's types, generated from the [spec](https://github.com/xynolog/protocol/blob/main/specs/README.md), and the logic that has to be the same wherever it runs. That is ids, the event bus and its channels, the transport contract, annotations and how they are anchored, and identities.
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
Every other TypeScript package, the Browser, and the conformance and end-to-end suites. It depends on no other Xynolog package.
|
|
14
|
-
|
|
15
|
-
**Building an application?** Use [`@xynolog/sdk`](../sdk/README.md). It re-exports what an application needs from here, the id constructors and the error types among them, and an application rarely imports this package by name.
|
|
16
|
-
|
|
17
|
-
## What is in it
|
|
18
|
-
|
|
19
|
-
| Area | What | Where |
|
|
20
|
-
|---|---|---|
|
|
21
|
-
| The protocol's types | `components`, `paths`, `operations`: every request, response and schema | `src/types.ts`, generated when the package is built and not committed |
|
|
22
|
-
| Ids | `ResourceId`, `AnnotationId`, `JobId`, `UserId`, each with a constructor that holds text to its rule and a guard that asks without throwing | [src/identifiers.ts](src/identifiers.ts), generated |
|
|
23
|
-
| The bus | `EventBus`, the `EventMap` of every channel and its payload, and `Bus`, the typed bus over a transport, whose `request` is a request and its reply | [src/event-bus.ts](src/event-bus.ts), [src/bus-protocol.ts](src/bus-protocol.ts), [src/bus.ts](src/bus.ts), [src/bus-request.ts](src/bus-request.ts) |
|
|
24
|
-
| The record's events | `PersistedEvent`, `StoredEvent`, and the list of every event type a knowledge base records | [src/persisted-events.ts](src/persisted-events.ts), [src/event-base.ts](src/event-base.ts) |
|
|
25
|
-
| The transport contract | `ITransport`, `IContentTransport`, `IGatewayOperations`: what a client needs of the wire | [src/transport.ts](src/transport.ts) |
|
|
26
|
-
| Annotations | Building one (`reconcile`, `annotationOfSpan`, `annotationOfResource`), and reading its target, its selectors and its links | [src/annotation-builders.ts](src/annotation-builders.ts), [src/web-annotation-utils.ts](src/web-annotation-utils.ts) |
|
|
27
|
-
| Anchoring | Finding an annotation again after its text changed, and the geometry of text on a PDF page (`locate`, `textUnder`) | [src/anchor-annotation.ts](src/anchor-annotation.ts), [src/pdf-anchoring.ts](src/pdf-anchoring.ts) |
|
|
28
|
-
| Identity | A knowledge base's own did and resource identifier (`kbDid`, `kbResource`). A principal's DID is the gateway's to mint and the record's to read | [src/did-utils.ts](src/did-utils.ts) |
|
|
29
|
-
| Media types | Which types a knowledge base admits, and what can be done with each | [src/media-types.ts](src/media-types.ts) |
|
|
30
|
-
| Shared rules | Error codes, timing, retry, the cache's refresh table, where jobs are kept and the API's limits, the same for every SDK | [src/error-codes.ts](src/error-codes.ts), [src/client-timing.ts](src/client-timing.ts), [src/cache-refresh.ts](src/cache-refresh.ts), [src/job-storage.ts](src/job-storage.ts), [src/protocol-limits.ts](src/protocol-limits.ts), generated; [src/retry.ts](src/retry.ts) |
|
|
31
|
-
| Languages | Every language an interface speaks, by code, with its native and English names | [src/locale-registry.ts](src/locale-registry.ts), generated; [src/locales.ts](src/locales.ts) |
|
|
11
|
+
## Install
|
|
32
12
|
|
|
33
|
-
|
|
13
|
+
```bash
|
|
14
|
+
npm install @xynolog/core
|
|
15
|
+
```
|
|
34
16
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
| `@xynolog/core/openapi` | The spec's limits |
|
|
38
|
-
| `@xynolog/core/testing` | The test doubles every layer shares |
|
|
39
|
-
| `@xynolog/core/testing/axioms` | Property-based harnesses for state units and transports. They need `fast-check` |
|
|
40
|
-
| `@xynolog/core/testing/issuer` | An OIDC issuer in one process, for tests that verify tokens |
|
|
17
|
+
Below 1.0 the minor number is the break, and the caret range npm writes into `package.json`
|
|
18
|
+
takes the releases up to the next minor and no further.
|
|
41
19
|
|
|
42
20
|
## Example
|
|
43
21
|
|
|
@@ -55,20 +33,45 @@ const did = kbDid('xynoplex.github.io:xynoplex-caselaw-kb'); // 'did:web:
|
|
|
55
33
|
const audience = kbResource('xynoplex.github.io:xynoplex-caselaw-kb'); // 'https://xynoplex.github.io/xynoplex-caselaw-kb'
|
|
56
34
|
```
|
|
57
35
|
|
|
58
|
-
##
|
|
36
|
+
## Who uses it
|
|
59
37
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
38
|
+
Every other TypeScript package, the Browser, and the conformance and end-to-end suites. It depends on no other Xynolog package.
|
|
39
|
+
|
|
40
|
+
**Building an application?** Use [`@xynolog/sdk`](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/sdk/README.md). It re-exports what an application needs from here, the id constructors and the error types among them, and an application rarely imports this package by name.
|
|
41
|
+
|
|
42
|
+
## What is in it
|
|
43
|
+
|
|
44
|
+
| Area | What | Where |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| The protocol's types | `components`, `paths`, `operations`: every request, response and schema | `src/types.ts`, generated when the package is built and not committed |
|
|
47
|
+
| Ids | `ResourceId`, `AnnotationId`, `JobId`, `UserId`, each with a constructor that holds text to its rule and a guard that asks without throwing | [src/identifiers.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/identifiers.ts), generated |
|
|
48
|
+
| The bus | `EventBus`, the `EventMap` of every channel and its payload, and `Bus`, the typed bus over a transport, whose `request` is a request and its reply | [src/event-bus.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/event-bus.ts), [src/bus-protocol.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/bus-protocol.ts), [src/bus.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/bus.ts), [src/bus-request.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/bus-request.ts) |
|
|
49
|
+
| The record's events | `PersistedEvent`, `StoredEvent`, and the list of every event type a knowledge base records | [src/persisted-events.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/persisted-events.ts), [src/event-base.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/event-base.ts) |
|
|
50
|
+
| The transport contract | `ITransport`, `IContentTransport`, `IGatewayOperations`: what a client needs of the wire | [src/transport.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/transport.ts) |
|
|
51
|
+
| Annotations | Building one (`reconcile`, `annotationOfSpan`, `annotationOfResource`), and reading its target, its selectors and its links | [src/annotation-builders.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/annotation-builders.ts), [src/web-annotation-utils.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/web-annotation-utils.ts) |
|
|
52
|
+
| Anchoring | Finding an annotation again after its text changed, and the geometry of text on a PDF page (`locate`, `textUnder`) | [src/anchor-annotation.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/anchor-annotation.ts), [src/pdf-anchoring.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/pdf-anchoring.ts) |
|
|
53
|
+
| Identity | A knowledge base's own did and resource identifier (`kbDid`, `kbResource`). A principal's DID is the gateway's to mint and the record's to read | [src/did-utils.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/did-utils.ts) |
|
|
54
|
+
| Media types | Which types a knowledge base admits, and what can be done with each | [src/media-types.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/media-types.ts) |
|
|
55
|
+
| Shared rules | Error codes, timing, retry, the cache's refresh table, where jobs are kept and the API's limits, the same for every SDK | [src/error-codes.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/error-codes.ts), [src/client-timing.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/client-timing.ts), [src/cache-refresh.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/cache-refresh.ts), [src/job-storage.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/job-storage.ts), [src/protocol-limits.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/protocol-limits.ts), generated; [src/retry.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/retry.ts) |
|
|
56
|
+
| Languages | Every language an interface speaks, by code, with its native and English names | [src/locale-registry.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/locale-registry.ts), generated; [src/locales.ts](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/src/locales.ts) |
|
|
57
|
+
|
|
58
|
+
The main import runs in a browser. What cannot is on a subpath:
|
|
59
|
+
|
|
60
|
+
| Import | |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `@xynolog/core/openapi` | The spec's limits |
|
|
63
|
+
| `@xynolog/core/testing` | The test doubles every layer shares |
|
|
64
|
+
| `@xynolog/core/testing/axioms` | Property-based harnesses for state units and transports. They need `fast-check` |
|
|
65
|
+
| `@xynolog/core/testing/issuer` | An OIDC issuer in one process, for tests that verify tokens |
|
|
65
66
|
|
|
66
67
|
## Documentation
|
|
67
68
|
|
|
68
|
-
- [API tour](docs/API.md): each area, with examples.
|
|
69
|
-
- [Utilities](docs/Utilities.md): the small helpers.
|
|
69
|
+
- [API tour](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/docs/API.md): each area, with examples.
|
|
70
|
+
- [Utilities](https://github.com/xynolog/sdk/blob/v0.8.1/typescript/core/docs/Utilities.md): the small helpers.
|
|
70
71
|
- [The spec](https://github.com/xynolog/protocol/blob/main/specs/README.md), which this package is generated from.
|
|
71
72
|
|
|
72
73
|
## License
|
|
73
74
|
|
|
74
75
|
Apache-2.0
|
|
76
|
+
|
|
77
|
+
Working on the SDK itself? See [CONTRIBUTING.md](https://github.com/xynolog/sdk/blob/main/CONTRIBUTING.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynolog/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Core types and domain logic for Xynolog - Resource, Annotation, and Graph models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
"url": "git+https://github.com/xynolog/sdk.git",
|
|
48
48
|
"directory": "typescript/core"
|
|
49
49
|
},
|
|
50
|
+
"homepage": "https://github.com/xynolog/sdk#readme",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/xynolog/sdk/issues"
|
|
53
|
+
},
|
|
50
54
|
"scripts": {
|
|
51
55
|
"typecheck": "tsc --noEmit",
|
|
52
56
|
"build": "npm run typecheck && tsup && tsc -p tsconfig.build.json && rollup -c rollup.dts.config.mjs && rm -rf dist-types",
|