@twin.org/auditable-item-graph-service 0.0.1-next.3

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.
Files changed (39) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/cjs/index.cjs +1895 -0
  4. package/dist/esm/index.mjs +1885 -0
  5. package/dist/types/auditableItemGraphRoutes.d.ts +45 -0
  6. package/dist/types/auditableItemGraphService.d.ts +133 -0
  7. package/dist/types/entities/auditableItemGraphAlias.d.ts +30 -0
  8. package/dist/types/entities/auditableItemGraphChangeset.d.ts +34 -0
  9. package/dist/types/entities/auditableItemGraphEdge.d.ts +30 -0
  10. package/dist/types/entities/auditableItemGraphPatch.d.ts +21 -0
  11. package/dist/types/entities/auditableItemGraphResource.d.ts +26 -0
  12. package/dist/types/entities/auditableItemGraphVertex.d.ts +45 -0
  13. package/dist/types/index.d.ts +11 -0
  14. package/dist/types/models/IAuditableItemGraphServiceConfig.d.ts +21 -0
  15. package/dist/types/models/IAuditableItemGraphServiceContext.d.ts +17 -0
  16. package/dist/types/restEntryPoints.d.ts +2 -0
  17. package/dist/types/schema.d.ts +4 -0
  18. package/docs/changelog.md +5 -0
  19. package/docs/examples.md +1 -0
  20. package/docs/open-api/spec.json +1094 -0
  21. package/docs/reference/classes/AuditableItemGraphAlias.md +61 -0
  22. package/docs/reference/classes/AuditableItemGraphChangeset.md +69 -0
  23. package/docs/reference/classes/AuditableItemGraphEdge.md +61 -0
  24. package/docs/reference/classes/AuditableItemGraphPatch.md +45 -0
  25. package/docs/reference/classes/AuditableItemGraphResource.md +53 -0
  26. package/docs/reference/classes/AuditableItemGraphService.md +305 -0
  27. package/docs/reference/classes/AuditableItemGraphVertex.md +85 -0
  28. package/docs/reference/functions/auditableItemGraphCreate.md +25 -0
  29. package/docs/reference/functions/auditableItemGraphGet.md +25 -0
  30. package/docs/reference/functions/auditableItemGraphList.md +25 -0
  31. package/docs/reference/functions/auditableItemGraphUpdate.md +25 -0
  32. package/docs/reference/functions/generateRestRoutesAuditableItemGraph.md +21 -0
  33. package/docs/reference/functions/initSchema.md +9 -0
  34. package/docs/reference/index.md +29 -0
  35. package/docs/reference/interfaces/IAuditableItemGraphServiceConfig.md +46 -0
  36. package/docs/reference/variables/restEntryPoints.md +3 -0
  37. package/docs/reference/variables/tagsAuditableItemGraph.md +5 -0
  38. package/locales/en.json +19 -0
  39. package/package.json +85 -0
@@ -0,0 +1,25 @@
1
+ # Function: auditableItemGraphGet()
2
+
3
+ > **auditableItemGraphGet**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAuditableItemGraphGetResponse`\>
4
+
5
+ Get the graph vertex.
6
+
7
+ ## Parameters
8
+
9
+ • **httpRequestContext**: `IHttpRequestContext`
10
+
11
+ The request context for the API.
12
+
13
+ • **componentName**: `string`
14
+
15
+ The name of the component to use in the routes.
16
+
17
+ • **request**: `IAuditableItemGraphGetRequest`
18
+
19
+ The request.
20
+
21
+ ## Returns
22
+
23
+ `Promise`\<`IAuditableItemGraphGetResponse`\>
24
+
25
+ The response object with additional http response properties.
@@ -0,0 +1,25 @@
1
+ # Function: auditableItemGraphList()
2
+
3
+ > **auditableItemGraphList**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAuditableItemGraphListResponse`\>
4
+
5
+ Query the graph vertices.
6
+
7
+ ## Parameters
8
+
9
+ • **httpRequestContext**: `IHttpRequestContext`
10
+
11
+ The request context for the API.
12
+
13
+ • **componentName**: `string`
14
+
15
+ The name of the component to use in the routes.
16
+
17
+ • **request**: `IAuditableItemGraphListRequest`
18
+
19
+ The request.
20
+
21
+ ## Returns
22
+
23
+ `Promise`\<`IAuditableItemGraphListResponse`\>
24
+
25
+ The response object with additional http response properties.
@@ -0,0 +1,25 @@
1
+ # Function: auditableItemGraphUpdate()
2
+
3
+ > **auditableItemGraphUpdate**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Update the graph vertex.
6
+
7
+ ## Parameters
8
+
9
+ • **httpRequestContext**: `IHttpRequestContext`
10
+
11
+ The request context for the API.
12
+
13
+ • **componentName**: `string`
14
+
15
+ The name of the component to use in the routes.
16
+
17
+ • **request**: `IAuditableItemGraphUpdateRequest`
18
+
19
+ The request.
20
+
21
+ ## Returns
22
+
23
+ `Promise`\<`INoContentResponse`\>
24
+
25
+ The response object with additional http response properties.
@@ -0,0 +1,21 @@
1
+ # Function: generateRestRoutesAuditableItemGraph()
2
+
3
+ > **generateRestRoutesAuditableItemGraph**(`baseRouteName`, `componentName`): `IRestRoute`[]
4
+
5
+ The REST routes for auditable item graph.
6
+
7
+ ## Parameters
8
+
9
+ • **baseRouteName**: `string`
10
+
11
+ Prefix to prepend to the paths.
12
+
13
+ • **componentName**: `string`
14
+
15
+ The name of the component to use in the routes stored in the ComponentFactory.
16
+
17
+ ## Returns
18
+
19
+ `IRestRoute`[]
20
+
21
+ The generated routes.
@@ -0,0 +1,9 @@
1
+ # Function: initSchema()
2
+
3
+ > **initSchema**(): `void`
4
+
5
+ Initialize the schema for the auditable item graph entity storage connector.
6
+
7
+ ## Returns
8
+
9
+ `void`
@@ -0,0 +1,29 @@
1
+ # @twin.org/auditable-item-graph-service
2
+
3
+ ## Classes
4
+
5
+ - [AuditableItemGraphService](classes/AuditableItemGraphService.md)
6
+ - [AuditableItemGraphAlias](classes/AuditableItemGraphAlias.md)
7
+ - [AuditableItemGraphChangeset](classes/AuditableItemGraphChangeset.md)
8
+ - [AuditableItemGraphEdge](classes/AuditableItemGraphEdge.md)
9
+ - [AuditableItemGraphPatch](classes/AuditableItemGraphPatch.md)
10
+ - [AuditableItemGraphResource](classes/AuditableItemGraphResource.md)
11
+ - [AuditableItemGraphVertex](classes/AuditableItemGraphVertex.md)
12
+
13
+ ## Interfaces
14
+
15
+ - [IAuditableItemGraphServiceConfig](interfaces/IAuditableItemGraphServiceConfig.md)
16
+
17
+ ## Variables
18
+
19
+ - [tagsAuditableItemGraph](variables/tagsAuditableItemGraph.md)
20
+ - [restEntryPoints](variables/restEntryPoints.md)
21
+
22
+ ## Functions
23
+
24
+ - [generateRestRoutesAuditableItemGraph](functions/generateRestRoutesAuditableItemGraph.md)
25
+ - [auditableItemGraphCreate](functions/auditableItemGraphCreate.md)
26
+ - [auditableItemGraphGet](functions/auditableItemGraphGet.md)
27
+ - [auditableItemGraphUpdate](functions/auditableItemGraphUpdate.md)
28
+ - [auditableItemGraphList](functions/auditableItemGraphList.md)
29
+ - [initSchema](functions/initSchema.md)
@@ -0,0 +1,46 @@
1
+ # Interface: IAuditableItemGraphServiceConfig
2
+
3
+ Configuration for the auditable item graph service.
4
+
5
+ ## Properties
6
+
7
+ ### vaultKeyId?
8
+
9
+ > `optional` **vaultKeyId**: `string`
10
+
11
+ The key to use for the graph.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ auditable-item-graph
17
+ ```
18
+
19
+ ***
20
+
21
+ ### enableImmutableDiffs?
22
+
23
+ > `optional` **enableImmutableDiffs**: `boolean`
24
+
25
+ Enable immutable diffs by storing the changes encrypted in immutable storage.
26
+ This will incur additional costs and should only be enabled if you require immutable integrity checking.
27
+
28
+ #### Default
29
+
30
+ ```ts
31
+ false
32
+ ```
33
+
34
+ ***
35
+
36
+ ### assertionMethodId?
37
+
38
+ > `optional` **assertionMethodId**: `string`
39
+
40
+ The assertion method id to use for the graph.
41
+
42
+ #### Default
43
+
44
+ ```ts
45
+ auditable-item-graph
46
+ ```
@@ -0,0 +1,3 @@
1
+ # Variable: restEntryPoints
2
+
3
+ > `const` **restEntryPoints**: `IRestRouteEntryPoint`[]
@@ -0,0 +1,5 @@
1
+ # Variable: tagsAuditableItemGraph
2
+
3
+ > `const` **tagsAuditableItemGraph**: `ITag`[]
4
+
5
+ The tag to associate with the routes.
@@ -0,0 +1,19 @@
1
+ {
2
+ "error": {
3
+ "auditableItemGraphService": {
4
+ "namespaceMismatch": "The namespace in the urn \"{id}\" does not match the namespace of the Auditable Item Graph service \"{namespace}\"",
5
+ "createFailed": "Creating the Auditable Item Graph vertex failed",
6
+ "getFailed": "Getting the Auditable Item Graph vertex failed",
7
+ "updatingFailed": "Updating the Auditable Item Graph vertex failed",
8
+ "queryingFailed": "Querying the Auditable Item Graph failed",
9
+ "removeImmutableFailed": "Removing the immutable data the Auditable Item Graph vertex failed",
10
+ "vertexNotFound": "The vertex with the Id \"{notFoundId}\" was not found",
11
+ "changesetCredentialRevoked": "The verification credential for the changeset has been revoked",
12
+ "invalidChangesetHash": "The changeset with epoch \"{epoch}\" and hash \"{hash}\" is invalid",
13
+ "invalidChangesetSignature": "The changeset with epoch \"{epoch}\" and hash \"{hash}\" signature does not match the changeset signature",
14
+ "immutableChangesetSignature": "The changeset with epoch \"{epoch}\" and hash \"{hash}\" signature does not match the immutable changeset signature",
15
+ "invalidChangesetCanonical": "The changeset with epoch \"{epoch}\" and hash \"{hash}\" integrity check does not match the immutable changeset integrity check"
16
+ }
17
+ },
18
+ "auditableItemGraphService": {}
19
+ }
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@twin.org/auditable-item-graph-service",
3
+ "version": "0.0.1-next.3",
4
+ "description": "Auditable Item Graph contract implementation and REST endpoint definitions",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/twinfoundation/auditable-item-graph.git",
8
+ "directory": "packages/auditable-item-graph-service"
9
+ },
10
+ "author": "martyn.janes@iota.org",
11
+ "license": "Apache-2.0",
12
+ "type": "module",
13
+ "engines": {
14
+ "node": ">=20.0.0"
15
+ },
16
+ "scripts": {
17
+ "clean": "rimraf dist coverage docs/reference",
18
+ "build": "tspc",
19
+ "test": "vitest --run --config ./vitest.config.ts --no-cache",
20
+ "coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
21
+ "bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
22
+ "bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
23
+ "bundle": "npm run bundle:esm && npm run bundle:cjs",
24
+ "docs:clean": "rimraf docs/reference",
25
+ "docs:generate": "typedoc",
26
+ "docs:api": "ts-to-openapi ./ts-to-openapi.json ./docs/open-api/spec.json",
27
+ "docs": "npm run docs:clean && npm run docs:generate && npm run docs:api",
28
+ "dist": "npm run clean && npm run build && npm run test && npm run bundle && npm run docs"
29
+ },
30
+ "dependencies": {
31
+ "@twin.org/api-models": "next",
32
+ "@twin.org/auditable-item-graph-models": "0.0.1-next.3",
33
+ "@twin.org/core": "next",
34
+ "@twin.org/crypto": "next",
35
+ "@twin.org/data-json-ld": "next",
36
+ "@twin.org/entity": "next",
37
+ "@twin.org/entity-storage-models": "next",
38
+ "@twin.org/identity-models": "next",
39
+ "@twin.org/immutable-storage-models": "next",
40
+ "@twin.org/nameof": "next",
41
+ "@twin.org/standards-w3c-did": "next",
42
+ "@twin.org/vault-models": "next",
43
+ "@twin.org/web": "next",
44
+ "jsonschema": "1.4.1",
45
+ "rfc6902": "5.1.1"
46
+ },
47
+ "devDependencies": {
48
+ "@twin.org/data-schema-org": "next",
49
+ "@twin.org/entity-storage-connector-memory": "next",
50
+ "@twin.org/identity-connector-entity-storage": "next",
51
+ "@twin.org/immutable-storage-connector-entity-storage": "next",
52
+ "@twin.org/vault-connector-entity-storage": "next",
53
+ "@twin.org/nameof-transformer": "next",
54
+ "@twin.org/ts-to-openapi": "next",
55
+ "@types/node": "22.5.5",
56
+ "@vitest/coverage-v8": "2.1.1",
57
+ "copyfiles": "2.4.1",
58
+ "rimraf": "6.0.1",
59
+ "rollup": "4.22.0",
60
+ "rollup-plugin-typescript2": "0.36.0",
61
+ "ts-patch": "3.2.1",
62
+ "typedoc": "0.26.7",
63
+ "typedoc-plugin-markdown": "4.2.7",
64
+ "typescript": "5.6.2",
65
+ "vitest": "2.1.1"
66
+ },
67
+ "main": "./dist/cjs/index.cjs",
68
+ "module": "./dist/esm/index.mjs",
69
+ "types": "./dist/types/index.d.ts",
70
+ "exports": {
71
+ ".": {
72
+ "require": "./dist/cjs/index.cjs",
73
+ "import": "./dist/esm/index.mjs",
74
+ "types": "./dist/types/index.d.ts"
75
+ },
76
+ "./locales": "./locales"
77
+ },
78
+ "files": [
79
+ "dist/cjs",
80
+ "dist/esm",
81
+ "dist/types",
82
+ "locales",
83
+ "docs"
84
+ ]
85
+ }