@twin.org/auditable-item-stream-service 0.0.1-next.8 → 0.0.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.
Files changed (29) hide show
  1. package/dist/cjs/index.cjs +510 -305
  2. package/dist/esm/index.mjs +512 -308
  3. package/dist/types/auditableItemStreamRoutes.d.ts +9 -1
  4. package/dist/types/auditableItemStreamService.d.ts +45 -38
  5. package/dist/types/entities/auditableItemStream.d.ts +1 -1
  6. package/dist/types/index.d.ts +2 -1
  7. package/dist/types/models/IAuditableItemStreamServiceConstructorOptions.d.ts +29 -0
  8. package/docs/changelog.md +199 -1
  9. package/docs/open-api/spec.json +2272 -2123
  10. package/docs/reference/classes/AuditableItemStream.md +5 -5
  11. package/docs/reference/classes/AuditableItemStreamEntry.md +3 -3
  12. package/docs/reference/classes/AuditableItemStreamService.md +233 -95
  13. package/docs/reference/functions/auditableItemStreamCreate.md +9 -3
  14. package/docs/reference/functions/auditableItemStreamCreateEntry.md +9 -3
  15. package/docs/reference/functions/auditableItemStreamDelete.md +31 -0
  16. package/docs/reference/functions/auditableItemStreamDeleteEntry.md +9 -3
  17. package/docs/reference/functions/auditableItemStreamGet.md +9 -3
  18. package/docs/reference/functions/auditableItemStreamGetEntry.md +9 -3
  19. package/docs/reference/functions/auditableItemStreamGetEntryObject.md +9 -3
  20. package/docs/reference/functions/auditableItemStreamList.md +9 -3
  21. package/docs/reference/functions/auditableItemStreamListEntries.md +9 -3
  22. package/docs/reference/functions/auditableItemStreamListEntryObjects.md +9 -3
  23. package/docs/reference/functions/auditableItemStreamUpdate.md +9 -3
  24. package/docs/reference/functions/auditableItemStreamUpdateEntry.md +9 -3
  25. package/docs/reference/functions/generateRestRoutesAuditableItemStream.md +8 -4
  26. package/docs/reference/index.md +2 -0
  27. package/docs/reference/interfaces/IAuditableItemStreamServiceConstructorOptions.md +61 -0
  28. package/locales/en.json +3 -1
  29. package/package.json +59 -18
@@ -6,15 +6,21 @@ Create the stream entry.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamCreateEntryRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamCreateEntryRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -0,0 +1,31 @@
1
+ # Function: auditableItemStreamDelete()
2
+
3
+ > **auditableItemStreamDelete**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Delete the stream.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IAuditableItemStreamDeleteRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INoContentResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -6,15 +6,21 @@ Get the stream.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamDeleteEntryRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamDeleteEntryRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Get the stream.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamGetRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamGetRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Get a stream entry.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamGetEntryRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamGetEntryRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Get a stream entry object.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamGetEntryObjectRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamGetEntryObjectRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Query the stream.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamListRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamListRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Query the stream.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamListEntriesRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamListEntriesRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Query the stream objects.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamListEntryObjectsRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamListEntryObjectsRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Update the stream.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamUpdateRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamUpdateRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Update the stream entry.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IAuditableItemStreamUpdateEntryRequest`
21
+ ### request
22
+
23
+ `IAuditableItemStreamUpdateEntryRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -1,21 +1,25 @@
1
1
  # Function: generateRestRoutesAuditableItemStream()
2
2
 
3
- > **generateRestRoutesAuditableItemStream**(`baseRouteName`, `componentName`): `IRestRoute`[]
3
+ > **generateRestRoutesAuditableItemStream**(`baseRouteName`, `componentName`): `IRestRoute`\<`any`, `any`\>[]
4
4
 
5
5
  The REST routes for auditable item stream.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **baseRouteName**: `string`
9
+ ### baseRouteName
10
+
11
+ `string`
10
12
 
11
13
  Prefix to prepend to the paths.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes stored in the ComponentFactory.
16
20
 
17
21
  ## Returns
18
22
 
19
- `IRestRoute`[]
23
+ `IRestRoute`\<`any`, `any`\>[]
20
24
 
21
25
  The generated routes.
@@ -9,6 +9,7 @@
9
9
  ## Interfaces
10
10
 
11
11
  - [IAuditableItemStreamServiceConfig](interfaces/IAuditableItemStreamServiceConfig.md)
12
+ - [IAuditableItemStreamServiceConstructorOptions](interfaces/IAuditableItemStreamServiceConstructorOptions.md)
12
13
 
13
14
  ## Variables
14
15
 
@@ -21,6 +22,7 @@
21
22
  - [auditableItemStreamCreate](functions/auditableItemStreamCreate.md)
22
23
  - [auditableItemStreamGet](functions/auditableItemStreamGet.md)
23
24
  - [auditableItemStreamUpdate](functions/auditableItemStreamUpdate.md)
25
+ - [auditableItemStreamDelete](functions/auditableItemStreamDelete.md)
24
26
  - [auditableItemStreamList](functions/auditableItemStreamList.md)
25
27
  - [auditableItemStreamCreateEntry](functions/auditableItemStreamCreateEntry.md)
26
28
  - [auditableItemStreamDeleteEntry](functions/auditableItemStreamDeleteEntry.md)
@@ -0,0 +1,61 @@
1
+ # Interface: IAuditableItemStreamServiceConstructorOptions
2
+
3
+ Options for the auditable item stream service constructor.
4
+
5
+ ## Properties
6
+
7
+ ### immutableProofComponentType?
8
+
9
+ > `optional` **immutableProofComponentType**: `string`
10
+
11
+ The immutable proof component type.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ immutable-proof
17
+ ```
18
+
19
+ ***
20
+
21
+ ### streamEntityStorageType?
22
+
23
+ > `optional` **streamEntityStorageType**: `string`
24
+
25
+ The entity storage for stream.
26
+
27
+ #### Default
28
+
29
+ ```ts
30
+ auditable-item-stream
31
+ ```
32
+
33
+ ***
34
+
35
+ ### streamEntryEntityStorageType?
36
+
37
+ > `optional` **streamEntryEntityStorageType**: `string`
38
+
39
+ The entity storage for stream entries.
40
+
41
+ #### Default
42
+
43
+ ```ts
44
+ auditable-item-stream-entry
45
+ ```
46
+
47
+ ***
48
+
49
+ ### eventBusComponentType?
50
+
51
+ > `optional` **eventBusComponentType**: `string`
52
+
53
+ The event bus component type, defaults to no event bus.
54
+
55
+ ***
56
+
57
+ ### config?
58
+
59
+ > `optional` **config**: [`IAuditableItemStreamServiceConfig`](IAuditableItemStreamServiceConfig.md)
60
+
61
+ The configuration for the connector.
package/locales/en.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "createFailed": "Creating the Auditable Item Stream failed",
6
6
  "getFailed": "Getting the Auditable Item Stream failed",
7
7
  "updatingFailed": "Updating the Auditable Item Stream failed",
8
+ "removingFailed": "Removing Auditable Item Stream failed",
8
9
  "queryingFailed": "Querying the Auditable Item Stream failed",
9
10
  "creatingEntryFailed": "Creating entry in the Auditable Item Stream failed",
10
11
  "updatingEntryFailed": "Updating entry in the Auditable Item Stream failed",
@@ -15,7 +16,8 @@
15
16
  "gettingEntryObjectsFailed": "Getting entry objects from the Auditable Item Stream failed",
16
17
  "removeImmutableFailed": "Removing immutable entry from the Auditable Item Stream failed",
17
18
  "streamNotFound": "The stream with the Id \"{notFoundId}\" was not found",
18
- "streamEntryNotFound": "The stream entry with the Id \"{notFoundId}\" was not found"
19
+ "streamEntryNotFound": "The stream entry with the Id \"{notFoundId}\" was not found",
20
+ "streamMismatch": "The stream Id in the entry Id \"{streamEntryNamespaceId}\" does not match the stream Id \"{streamNamespaceId}\""
19
21
  }
20
22
  }
21
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/auditable-item-stream-service",
3
- "version": "0.0.1-next.8",
3
+ "version": "0.0.1",
4
4
  "description": "Auditable Item Stream contract implementation and REST endpoint definitions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,32 +13,73 @@
13
13
  "engines": {
14
14
  "node": ">=20.0.0"
15
15
  },
16
+ "scripts": {
17
+ "clean": "rimraf dist coverage docs/reference",
18
+ "build": "tsc",
19
+ "dev": "nodemon --watch src --ext ts --exec \"npm run build && npm run bundle:esm\"",
20
+ "test": "vitest --run --config ./vitest.config.ts --no-cache",
21
+ "coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
22
+ "bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
23
+ "bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
24
+ "bundle": "npm run bundle:esm && npm run bundle:cjs",
25
+ "docs:clean": "rimraf docs/reference",
26
+ "docs:generate": "typedoc",
27
+ "docs:api": "ts-to-openapi ./ts-to-openapi.json ./docs/open-api/spec.json",
28
+ "docs": "npm run docs:clean && npm run docs:generate && npm run docs:api",
29
+ "dist": "npm run clean && npm run build && npm run test && npm run bundle && npm run docs",
30
+ "dist:no-test": "npm run clean && npm run build && npm run bundle && npm run docs",
31
+ "prepare": "ts-patch install -s"
32
+ },
16
33
  "dependencies": {
17
- "@twin.org/api-models": "next",
18
- "@twin.org/auditable-item-stream-models": "0.0.1-next.8",
19
- "@twin.org/core": "next",
20
- "@twin.org/crypto": "next",
21
- "@twin.org/data-json-ld": "next",
22
- "@twin.org/data-schema-org": "next",
23
- "@twin.org/entity": "next",
24
- "@twin.org/entity-storage-models": "next",
25
- "@twin.org/immutable-proof-models": "next",
26
- "@twin.org/nameof": "next",
27
- "@twin.org/standards-w3c-did": "next",
28
- "@twin.org/web": "next",
29
- "jsonschema": "1.4.1",
30
- "rfc6902": "5.1.1"
34
+ "@twin.org/api-models": "^0.0.2-next.1",
35
+ "@twin.org/auditable-item-stream-models": "^0.0.1",
36
+ "@twin.org/core": "^0.0.1",
37
+ "@twin.org/crypto": "^0.0.1",
38
+ "@twin.org/data-json-ld": "^0.0.1",
39
+ "@twin.org/entity": "^0.0.1",
40
+ "@twin.org/entity-storage-models": "^0.0.1",
41
+ "@twin.org/event-bus-models": "^0.0.1",
42
+ "@twin.org/immutable-proof-models": "^0.0.1",
43
+ "@twin.org/nameof": "^0.0.1",
44
+ "@twin.org/standards-schema-org": "^0.0.1",
45
+ "@twin.org/standards-w3c-did": "^0.0.1",
46
+ "@twin.org/web": "^0.0.1"
47
+ },
48
+ "devDependencies": {
49
+ "@twin.org/background-task-models": "^0.0.2-next.2",
50
+ "@twin.org/background-task-connector-entity-storage": "^0.0.2-next.2",
51
+ "@twin.org/entity-storage-connector-memory": "^0.0.1",
52
+ "@twin.org/identity-connector-entity-storage": "^0.0.1",
53
+ "@twin.org/immutable-proof-service": "^0.0.1",
54
+ "@twin.org/modules": "^0.0.1",
55
+ "@twin.org/nameof-transformer": "^0.0.1",
56
+ "@twin.org/nameof-vitest-plugin": "^0.0.1",
57
+ "@twin.org/standards-schema-org": "^0.0.1",
58
+ "@twin.org/ts-to-openapi": "^0.0.1",
59
+ "@twin.org/vault-connector-entity-storage": "^0.0.1",
60
+ "@twin.org/verifiable-storage-connector-entity-storage": "^0.0.1",
61
+ "@types/node": "24.0.1",
62
+ "@vitest/coverage-v8": "3.2.3",
63
+ "copyfiles": "2.4.1",
64
+ "nodemon": "3.1.10",
65
+ "rimraf": "6.0.1",
66
+ "rollup": "4.43.0",
67
+ "ts-patch": "3.3.0",
68
+ "typedoc": "0.28.5",
69
+ "typedoc-plugin-markdown": "4.6.4",
70
+ "typescript": "5.8.3",
71
+ "vitest": "3.2.3"
31
72
  },
32
73
  "main": "./dist/cjs/index.cjs",
33
74
  "module": "./dist/esm/index.mjs",
34
75
  "types": "./dist/types/index.d.ts",
35
76
  "exports": {
36
77
  ".": {
78
+ "types": "./dist/types/index.d.ts",
37
79
  "require": "./dist/cjs/index.cjs",
38
- "import": "./dist/esm/index.mjs",
39
- "types": "./dist/types/index.d.ts"
80
+ "import": "./dist/esm/index.mjs"
40
81
  },
41
- "./locales": "./locales"
82
+ "./locales/*.json": "./locales/*.json"
42
83
  },
43
84
  "files": [
44
85
  "dist/cjs",