@twin.org/notarization-service 0.0.3-next.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 (37) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/es/index.js +8 -0
  4. package/dist/es/index.js.map +1 -0
  5. package/dist/es/models/INotarizationServiceConfig.js +4 -0
  6. package/dist/es/models/INotarizationServiceConfig.js.map +1 -0
  7. package/dist/es/models/INotarizationServiceConstructorOptions.js +2 -0
  8. package/dist/es/models/INotarizationServiceConstructorOptions.js.map +1 -0
  9. package/dist/es/notarizationRoutes.js +318 -0
  10. package/dist/es/notarizationRoutes.js.map +1 -0
  11. package/dist/es/notarizationService.js +151 -0
  12. package/dist/es/notarizationService.js.map +1 -0
  13. package/dist/es/restEntryPoints.js +10 -0
  14. package/dist/es/restEntryPoints.js.map +1 -0
  15. package/dist/types/index.d.ts +5 -0
  16. package/dist/types/models/INotarizationServiceConfig.d.ts +9 -0
  17. package/dist/types/models/INotarizationServiceConstructorOptions.d.ts +10 -0
  18. package/dist/types/notarizationRoutes.d.ts +53 -0
  19. package/dist/types/notarizationService.d.ts +57 -0
  20. package/dist/types/restEntryPoints.d.ts +2 -0
  21. package/docs/changelog.md +19 -0
  22. package/docs/examples.md +185 -0
  23. package/docs/open-api/spec.json +712 -0
  24. package/docs/reference/classes/NotarizationService.md +219 -0
  25. package/docs/reference/functions/generateRestRoutesNotarization.md +25 -0
  26. package/docs/reference/functions/notarizationCreate.md +31 -0
  27. package/docs/reference/functions/notarizationGet.md +31 -0
  28. package/docs/reference/functions/notarizationRemove.md +31 -0
  29. package/docs/reference/functions/notarizationTransfer.md +31 -0
  30. package/docs/reference/functions/notarizationUpdate.md +31 -0
  31. package/docs/reference/index.md +24 -0
  32. package/docs/reference/interfaces/INotarizationServiceConfig.md +11 -0
  33. package/docs/reference/interfaces/INotarizationServiceConstructorOptions.md +11 -0
  34. package/docs/reference/variables/restEntryPoints.md +3 -0
  35. package/docs/reference/variables/tagsNotarization.md +5 -0
  36. package/locales/en.json +13 -0
  37. package/package.json +58 -0
@@ -0,0 +1,219 @@
1
+ # Class: NotarizationService
2
+
3
+ Service for notarization operations.
4
+
5
+ ## Implements
6
+
7
+ - `INotarizationComponent`
8
+
9
+ ## Constructors
10
+
11
+ ### Constructor
12
+
13
+ > **new NotarizationService**(`options?`): `NotarizationService`
14
+
15
+ Create a new instance of NotarizationService.
16
+
17
+ #### Parameters
18
+
19
+ ##### options?
20
+
21
+ [`INotarizationServiceConstructorOptions`](../interfaces/INotarizationServiceConstructorOptions.md)
22
+
23
+ The constructor options.
24
+
25
+ #### Returns
26
+
27
+ `NotarizationService`
28
+
29
+ ## Properties
30
+
31
+ ### CLASS\_NAME {#class_name}
32
+
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
34
+
35
+ Runtime name for the class.
36
+
37
+ ## Methods
38
+
39
+ ### className() {#classname}
40
+
41
+ > **className**(): `string`
42
+
43
+ Returns the class name of the component.
44
+
45
+ #### Returns
46
+
47
+ `string`
48
+
49
+ The class name of the component.
50
+
51
+ #### Implementation of
52
+
53
+ `INotarizationComponent.className`
54
+
55
+ ***
56
+
57
+ ### create() {#create}
58
+
59
+ > **create**(`notarization`, `namespace?`, `controllerIdentity?`): `Promise`\<`string`\>
60
+
61
+ Create a new notarization.
62
+
63
+ #### Parameters
64
+
65
+ ##### notarization
66
+
67
+ `Omit`\<`INotarization`, `"id"` \| `"dateCreated"`\>
68
+
69
+ The notarization data without generated fields.
70
+
71
+ ##### namespace?
72
+
73
+ `string`
74
+
75
+ The namespace of the connector to use for the notarization, defaults to service configured namespace.
76
+
77
+ ##### controllerIdentity?
78
+
79
+ `string`
80
+
81
+ The identity to perform the notarization operation with.
82
+
83
+ #### Returns
84
+
85
+ `Promise`\<`string`\>
86
+
87
+ The generated notarization id.
88
+
89
+ #### Implementation of
90
+
91
+ `INotarizationComponent.create`
92
+
93
+ ***
94
+
95
+ ### get() {#get}
96
+
97
+ > **get**(`id`): `Promise`\<`INotarization`\>
98
+
99
+ Get an existing notarization.
100
+
101
+ #### Parameters
102
+
103
+ ##### id
104
+
105
+ `string`
106
+
107
+ The id of the notarization to get.
108
+
109
+ #### Returns
110
+
111
+ `Promise`\<`INotarization`\>
112
+
113
+ The notarization.
114
+
115
+ #### Implementation of
116
+
117
+ `INotarizationComponent.get`
118
+
119
+ ***
120
+
121
+ ### remove() {#remove}
122
+
123
+ > **remove**(`id`, `controllerIdentity?`): `Promise`\<`void`\>
124
+
125
+ Remove an existing notarization.
126
+
127
+ #### Parameters
128
+
129
+ ##### id
130
+
131
+ `string`
132
+
133
+ The id of the notarization to remove.
134
+
135
+ ##### controllerIdentity?
136
+
137
+ `string`
138
+
139
+ The identity to perform the notarization operation with.
140
+
141
+ #### Returns
142
+
143
+ `Promise`\<`void`\>
144
+
145
+ Nothing.
146
+
147
+ #### Implementation of
148
+
149
+ `INotarizationComponent.remove`
150
+
151
+ ***
152
+
153
+ ### update() {#update}
154
+
155
+ > **update**(`notarization`, `controllerIdentity?`): `Promise`\<`void`\>
156
+
157
+ Update an existing notarization.
158
+
159
+ #### Parameters
160
+
161
+ ##### notarization
162
+
163
+ `INotarization`
164
+
165
+ The notarization to update.
166
+
167
+ ##### controllerIdentity?
168
+
169
+ `string`
170
+
171
+ The identity to perform the notarization operation with.
172
+
173
+ #### Returns
174
+
175
+ `Promise`\<`void`\>
176
+
177
+ Nothing.
178
+
179
+ #### Implementation of
180
+
181
+ `INotarizationComponent.update`
182
+
183
+ ***
184
+
185
+ ### transfer() {#transfer}
186
+
187
+ > **transfer**(`id`, `recipientAddress`, `controllerIdentity?`): `Promise`\<`void`\>
188
+
189
+ Transfer an existing notarization.
190
+
191
+ #### Parameters
192
+
193
+ ##### id
194
+
195
+ `string`
196
+
197
+ The id of the notarization to transfer.
198
+
199
+ ##### recipientAddress
200
+
201
+ `string`
202
+
203
+ The recipient address.
204
+
205
+ ##### controllerIdentity?
206
+
207
+ `string`
208
+
209
+ The identity to perform the notarization operation with.
210
+
211
+ #### Returns
212
+
213
+ `Promise`\<`void`\>
214
+
215
+ Nothing.
216
+
217
+ #### Implementation of
218
+
219
+ `INotarizationComponent.transfer`
@@ -0,0 +1,25 @@
1
+ # Function: generateRestRoutesNotarization()
2
+
3
+ > **generateRestRoutesNotarization**(`baseRouteName`, `componentName`): `IRestRoute`\<`any`, `any`\>[]
4
+
5
+ The REST routes for notarization.
6
+
7
+ ## Parameters
8
+
9
+ ### baseRouteName
10
+
11
+ `string`
12
+
13
+ Prefix to prepend to the paths.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes stored in the ComponentFactory.
20
+
21
+ ## Returns
22
+
23
+ `IRestRoute`\<`any`, `any`\>[]
24
+
25
+ The generated routes.
@@ -0,0 +1,31 @@
1
+ # Function: notarizationCreate()
2
+
3
+ > **notarizationCreate**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`ICreatedResponse`\>
4
+
5
+ Perform the create notarization operation.
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
+ `INotarizationCreateRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`ICreatedResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: notarizationGet()
2
+
3
+ > **notarizationGet**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INotarizationGetResponse`\>
4
+
5
+ Perform the get notarization operation.
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
+ `INotarizationGetRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INotarizationGetResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: notarizationRemove()
2
+
3
+ > **notarizationRemove**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Perform the remove notarization operation.
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
+ `INotarizationRemoveRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INoContentResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: notarizationTransfer()
2
+
3
+ > **notarizationTransfer**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Perform the transfer notarization operation.
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
+ `INotarizationTransferRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INoContentResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: notarizationUpdate()
2
+
3
+ > **notarizationUpdate**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Perform the update notarization operation.
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
+ `INotarizationUpdateRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INoContentResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,24 @@
1
+ # @twin.org/notarization-service
2
+
3
+ ## Classes
4
+
5
+ - [NotarizationService](classes/NotarizationService.md)
6
+
7
+ ## Interfaces
8
+
9
+ - [INotarizationServiceConfig](interfaces/INotarizationServiceConfig.md)
10
+ - [INotarizationServiceConstructorOptions](interfaces/INotarizationServiceConstructorOptions.md)
11
+
12
+ ## Variables
13
+
14
+ - [tagsNotarization](variables/tagsNotarization.md)
15
+ - [restEntryPoints](variables/restEntryPoints.md)
16
+
17
+ ## Functions
18
+
19
+ - [generateRestRoutesNotarization](functions/generateRestRoutesNotarization.md)
20
+ - [notarizationCreate](functions/notarizationCreate.md)
21
+ - [notarizationRemove](functions/notarizationRemove.md)
22
+ - [notarizationGet](functions/notarizationGet.md)
23
+ - [notarizationUpdate](functions/notarizationUpdate.md)
24
+ - [notarizationTransfer](functions/notarizationTransfer.md)
@@ -0,0 +1,11 @@
1
+ # Interface: INotarizationServiceConfig
2
+
3
+ Configuration for the Notarization Service.
4
+
5
+ ## Properties
6
+
7
+ ### defaultNamespace? {#defaultnamespace}
8
+
9
+ > `optional` **defaultNamespace?**: `string`
10
+
11
+ What is the default connector to use for notarization. If not provided the first connector from the factory will be used.
@@ -0,0 +1,11 @@
1
+ # Interface: INotarizationServiceConstructorOptions
2
+
3
+ Options for the notarization service constructor.
4
+
5
+ ## Properties
6
+
7
+ ### config? {#config}
8
+
9
+ > `optional` **config?**: [`INotarizationServiceConfig`](INotarizationServiceConfig.md)
10
+
11
+ The configuration for the service.
@@ -0,0 +1,3 @@
1
+ # Variable: restEntryPoints
2
+
3
+ > `const` **restEntryPoints**: `IRestRouteEntryPoint`[]
@@ -0,0 +1,5 @@
1
+ # Variable: tagsNotarization
2
+
3
+ > `const` **tagsNotarization**: `ITag`[]
4
+
5
+ The tag to associate with the routes.
@@ -0,0 +1,13 @@
1
+ {
2
+ "error": {
3
+ "notarizationService": {
4
+ "namespaceMismatch": "The namespace in the urn \"{id}\" does not match the namespace of the notarization service \"{namespace}\"",
5
+ "noConnectors": "There are no connectors registered with the notarization factory",
6
+ "createFailed": "The creation of the notarization failed",
7
+ "getFailed": "The retrieval of the notarization failed",
8
+ "removeFailed": "The removal of the notarization failed",
9
+ "updateFailed": "The update of the notarization failed",
10
+ "transferFailed": "The transfer of the notarization failed"
11
+ }
12
+ }
13
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@twin.org/notarization-service",
3
+ "version": "0.0.3-next.1",
4
+ "description": "Notarization service orchestration with REST route generation.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/twinfoundation/notarization.git",
8
+ "directory": "packages/notarization-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
+ "dependencies": {
17
+ "@twin.org/api-models": "next",
18
+ "@twin.org/context": "next",
19
+ "@twin.org/core": "next",
20
+ "@twin.org/entity": "next",
21
+ "@twin.org/nameof": "next",
22
+ "@twin.org/notarization-models": "0.0.3-next.1",
23
+ "@twin.org/web": "next"
24
+ },
25
+ "main": "./dist/es/index.js",
26
+ "types": "./dist/types/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/types/index.d.ts",
30
+ "import": "./dist/es/index.js",
31
+ "default": "./dist/es/index.js"
32
+ },
33
+ "./locales/*.json": "./locales/*.json"
34
+ },
35
+ "files": [
36
+ "dist/es",
37
+ "dist/types",
38
+ "locales",
39
+ "docs"
40
+ ],
41
+ "keywords": [
42
+ "twin",
43
+ "trade",
44
+ "iota",
45
+ "framework",
46
+ "blockchain",
47
+ "notarization",
48
+ "tokens",
49
+ "assets",
50
+ "service",
51
+ "microservice",
52
+ "business-logic"
53
+ ],
54
+ "bugs": {
55
+ "url": "git+https://github.com/twinfoundation/notarization/issues"
56
+ },
57
+ "homepage": "https://twindev.org"
58
+ }