@twin.org/auditable-item-stream-rest-client 0.0.2-next.3 → 0.0.2-next.5
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/dist/cjs/index.cjs +32 -30
- package/dist/esm/index.mjs +32 -30
- package/dist/types/{auditableItemStreamClient.d.ts → auditableItemStreamRestClient.d.ts} +10 -10
- package/dist/types/index.d.ts +1 -1
- package/docs/changelog.md +28 -0
- package/docs/reference/classes/{AuditableItemStreamClient.md → AuditableItemStreamRestClient.md} +11 -15
- package/docs/reference/index.md +1 -1
- package/locales/en.json +7 -1
- package/package.json +15 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -10,17 +10,17 @@ var web = require('@twin.org/web');
|
|
|
10
10
|
/**
|
|
11
11
|
* Client for performing auditable item stream through to REST endpoints.
|
|
12
12
|
*/
|
|
13
|
-
class
|
|
13
|
+
class AuditableItemStreamRestClient extends apiCore.BaseRestClient {
|
|
14
14
|
/**
|
|
15
15
|
* Runtime name for the class.
|
|
16
16
|
*/
|
|
17
|
-
CLASS_NAME = "
|
|
17
|
+
static CLASS_NAME = "AuditableItemStreamRestClient";
|
|
18
18
|
/**
|
|
19
|
-
* Create a new instance of
|
|
19
|
+
* Create a new instance of AuditableItemStreamRestClient.
|
|
20
20
|
* @param config The configuration for the client.
|
|
21
21
|
*/
|
|
22
22
|
constructor(config) {
|
|
23
|
-
super("
|
|
23
|
+
super("AuditableItemStreamRestClient", config, "auditable-item-stream");
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Create a new stream.
|
|
@@ -33,7 +33,7 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
33
33
|
* @returns The id of the new stream item.
|
|
34
34
|
*/
|
|
35
35
|
async create(stream, options) {
|
|
36
|
-
core.Guards.object(
|
|
36
|
+
core.Guards.object(AuditableItemStreamRestClient.CLASS_NAME, "stream", stream);
|
|
37
37
|
const response = await this.fetch("/", "POST", {
|
|
38
38
|
body: {
|
|
39
39
|
...stream,
|
|
@@ -54,7 +54,7 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
54
54
|
* @throws NotFoundError if the stream is not found
|
|
55
55
|
*/
|
|
56
56
|
async get(id, options) {
|
|
57
|
-
core.Guards.stringValue(
|
|
57
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
58
58
|
const response = await this.fetch("/:id", "GET", {
|
|
59
59
|
headers: {
|
|
60
60
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
@@ -79,8 +79,8 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
79
79
|
* @returns Nothing.
|
|
80
80
|
*/
|
|
81
81
|
async update(stream) {
|
|
82
|
-
core.Guards.object(
|
|
83
|
-
core.Guards.stringValue(
|
|
82
|
+
core.Guards.object(AuditableItemStreamRestClient.CLASS_NAME, "stream", stream);
|
|
83
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "stream.id", stream.id);
|
|
84
84
|
const { id, annotationObject } = stream;
|
|
85
85
|
await this.fetch("/:id", "PUT", {
|
|
86
86
|
pathParams: {
|
|
@@ -97,7 +97,7 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
97
97
|
* @returns Nothing.
|
|
98
98
|
*/
|
|
99
99
|
async remove(id) {
|
|
100
|
-
core.Guards.stringValue(
|
|
100
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
101
101
|
await this.fetch("/:id", "DELETE", {
|
|
102
102
|
pathParams: {
|
|
103
103
|
id
|
|
@@ -110,11 +110,11 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
110
110
|
* @param orderBy The order for the results, defaults to created.
|
|
111
111
|
* @param orderByDirection The direction for the order, defaults to descending.
|
|
112
112
|
* @param properties The properties to return, if not provided defaults to id, created and object.
|
|
113
|
-
* @param cursor The cursor to request the next
|
|
114
|
-
* @param
|
|
113
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
114
|
+
* @param limit Limit the number of entities to return.
|
|
115
115
|
* @returns The entities, which can be partial if a limited keys list was provided.
|
|
116
116
|
*/
|
|
117
|
-
async query(conditions, orderBy, orderByDirection, properties, cursor,
|
|
117
|
+
async query(conditions, orderBy, orderByDirection, properties, cursor, limit) {
|
|
118
118
|
const response = await this.fetch("/", "GET", {
|
|
119
119
|
headers: {
|
|
120
120
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
@@ -125,7 +125,7 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
125
125
|
orderByDirection,
|
|
126
126
|
properties: apiModels.HttpParameterHelper.arrayToString(properties),
|
|
127
127
|
cursor,
|
|
128
|
-
|
|
128
|
+
limit: core.Coerce.string(limit)
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
return response.body;
|
|
@@ -137,7 +137,7 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
137
137
|
* @returns The id of the created entry, if not provided.
|
|
138
138
|
*/
|
|
139
139
|
async createEntry(id, entryObject) {
|
|
140
|
-
core.Guards.stringValue(
|
|
140
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
141
141
|
const response = await this.fetch("/:id", "POST", {
|
|
142
142
|
pathParams: {
|
|
143
143
|
id
|
|
@@ -158,8 +158,8 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
158
158
|
* @throws NotFoundError if the stream is not found.
|
|
159
159
|
*/
|
|
160
160
|
async getEntry(id, entryId, options) {
|
|
161
|
-
core.Guards.stringValue(
|
|
162
|
-
core.Guards.stringValue(
|
|
161
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
162
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
|
|
163
163
|
const response = await this.fetch("/:id/:entryId", "GET", {
|
|
164
164
|
headers: {
|
|
165
165
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
@@ -182,8 +182,8 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
182
182
|
* @throws NotFoundError if the stream is not found.
|
|
183
183
|
*/
|
|
184
184
|
async getEntryObject(id, entryId) {
|
|
185
|
-
core.Guards.stringValue(
|
|
186
|
-
core.Guards.stringValue(
|
|
185
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
186
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
|
|
187
187
|
const response = await this.fetch("/:id/:entryId/object", "GET", {
|
|
188
188
|
headers: {
|
|
189
189
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
@@ -203,8 +203,8 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
203
203
|
* @returns Nothing.
|
|
204
204
|
*/
|
|
205
205
|
async updateEntry(id, entryId, entryObject) {
|
|
206
|
-
core.Guards.stringValue(
|
|
207
|
-
core.Guards.stringValue(
|
|
206
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
207
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
|
|
208
208
|
await this.fetch("/:id/:entryId", "PUT", {
|
|
209
209
|
pathParams: {
|
|
210
210
|
id,
|
|
@@ -222,8 +222,8 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
222
222
|
* @returns Nothing.
|
|
223
223
|
*/
|
|
224
224
|
async removeEntry(id, entryId) {
|
|
225
|
-
core.Guards.stringValue(
|
|
226
|
-
core.Guards.stringValue(
|
|
225
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
226
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
|
|
227
227
|
await this.fetch("/:id/:entryId", "DELETE", {
|
|
228
228
|
pathParams: {
|
|
229
229
|
id,
|
|
@@ -238,14 +238,14 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
238
238
|
* @param options.conditions The conditions to filter the stream.
|
|
239
239
|
* @param options.includeDeleted Whether to include deleted entries, defaults to false.
|
|
240
240
|
* @param options.verifyEntries Should the entries be verified, defaults to false.
|
|
241
|
-
* @param options.
|
|
241
|
+
* @param options.limit How many entries to return.
|
|
242
242
|
* @param options.cursor Cursor to use for next chunk of data.
|
|
243
243
|
* @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.
|
|
244
244
|
* @returns The stream and entries if found.
|
|
245
245
|
* @throws NotFoundError if the stream is not found.
|
|
246
246
|
*/
|
|
247
247
|
async getEntries(id, options) {
|
|
248
|
-
core.Guards.stringValue(
|
|
248
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
249
249
|
const response = await this.fetch("/:id/entries", "GET", {
|
|
250
250
|
headers: {
|
|
251
251
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
@@ -257,7 +257,7 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
257
257
|
conditions: apiModels.HttpParameterHelper.objectToString(options?.conditions),
|
|
258
258
|
includeDeleted: core.Coerce.string(options?.includeDeleted),
|
|
259
259
|
verifyEntries: core.Coerce.string(options?.verifyEntries),
|
|
260
|
-
|
|
260
|
+
limit: core.Coerce.string(options?.limit),
|
|
261
261
|
cursor: options?.cursor,
|
|
262
262
|
order: options?.order
|
|
263
263
|
}
|
|
@@ -270,14 +270,14 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
270
270
|
* @param options Additional options for the get operation.
|
|
271
271
|
* @param options.conditions The conditions to filter the stream.
|
|
272
272
|
* @param options.includeDeleted Whether to include deleted entries, defaults to false.
|
|
273
|
-
* @param options.
|
|
273
|
+
* @param options.limit How many entries to return.
|
|
274
274
|
* @param options.cursor Cursor to use for next chunk of data.
|
|
275
275
|
* @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.
|
|
276
276
|
* @returns The stream and entries if found.
|
|
277
277
|
* @throws NotFoundError if the stream is not found.
|
|
278
278
|
*/
|
|
279
279
|
async getEntryObjects(id, options) {
|
|
280
|
-
core.Guards.stringValue(
|
|
280
|
+
core.Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
281
281
|
const response = await this.fetch("/:id/entries/objects", "GET", {
|
|
282
282
|
headers: {
|
|
283
283
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
@@ -288,7 +288,7 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
288
288
|
query: {
|
|
289
289
|
conditions: apiModels.HttpParameterHelper.objectToString(options?.conditions),
|
|
290
290
|
includeDeleted: core.Coerce.string(options?.includeDeleted),
|
|
291
|
-
|
|
291
|
+
limit: core.Coerce.string(options?.limit),
|
|
292
292
|
cursor: core.Coerce.string(options?.cursor),
|
|
293
293
|
order: options?.order
|
|
294
294
|
}
|
|
@@ -302,8 +302,10 @@ class AuditableItemStreamClient extends apiCore.BaseRestClient {
|
|
|
302
302
|
* @throws NotFoundError if the vertex is not found.
|
|
303
303
|
*/
|
|
304
304
|
async removeVerifiable(id) {
|
|
305
|
-
throw new core.NotSupportedError(
|
|
305
|
+
throw new core.NotSupportedError(AuditableItemStreamRestClient.CLASS_NAME, "notSupportedOnClient", {
|
|
306
|
+
methodName: "removeVerifiable"
|
|
307
|
+
});
|
|
306
308
|
}
|
|
307
309
|
}
|
|
308
310
|
|
|
309
|
-
exports.
|
|
311
|
+
exports.AuditableItemStreamRestClient = AuditableItemStreamRestClient;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -8,17 +8,17 @@ import { HeaderTypes, MimeTypes } from '@twin.org/web';
|
|
|
8
8
|
/**
|
|
9
9
|
* Client for performing auditable item stream through to REST endpoints.
|
|
10
10
|
*/
|
|
11
|
-
class
|
|
11
|
+
class AuditableItemStreamRestClient extends BaseRestClient {
|
|
12
12
|
/**
|
|
13
13
|
* Runtime name for the class.
|
|
14
14
|
*/
|
|
15
|
-
CLASS_NAME = "
|
|
15
|
+
static CLASS_NAME = "AuditableItemStreamRestClient";
|
|
16
16
|
/**
|
|
17
|
-
* Create a new instance of
|
|
17
|
+
* Create a new instance of AuditableItemStreamRestClient.
|
|
18
18
|
* @param config The configuration for the client.
|
|
19
19
|
*/
|
|
20
20
|
constructor(config) {
|
|
21
|
-
super("
|
|
21
|
+
super("AuditableItemStreamRestClient", config, "auditable-item-stream");
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Create a new stream.
|
|
@@ -31,7 +31,7 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
31
31
|
* @returns The id of the new stream item.
|
|
32
32
|
*/
|
|
33
33
|
async create(stream, options) {
|
|
34
|
-
Guards.object(
|
|
34
|
+
Guards.object(AuditableItemStreamRestClient.CLASS_NAME, "stream", stream);
|
|
35
35
|
const response = await this.fetch("/", "POST", {
|
|
36
36
|
body: {
|
|
37
37
|
...stream,
|
|
@@ -52,7 +52,7 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
52
52
|
* @throws NotFoundError if the stream is not found
|
|
53
53
|
*/
|
|
54
54
|
async get(id, options) {
|
|
55
|
-
Guards.stringValue(
|
|
55
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
56
56
|
const response = await this.fetch("/:id", "GET", {
|
|
57
57
|
headers: {
|
|
58
58
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
@@ -77,8 +77,8 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
77
77
|
* @returns Nothing.
|
|
78
78
|
*/
|
|
79
79
|
async update(stream) {
|
|
80
|
-
Guards.object(
|
|
81
|
-
Guards.stringValue(
|
|
80
|
+
Guards.object(AuditableItemStreamRestClient.CLASS_NAME, "stream", stream);
|
|
81
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "stream.id", stream.id);
|
|
82
82
|
const { id, annotationObject } = stream;
|
|
83
83
|
await this.fetch("/:id", "PUT", {
|
|
84
84
|
pathParams: {
|
|
@@ -95,7 +95,7 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
95
95
|
* @returns Nothing.
|
|
96
96
|
*/
|
|
97
97
|
async remove(id) {
|
|
98
|
-
Guards.stringValue(
|
|
98
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
99
99
|
await this.fetch("/:id", "DELETE", {
|
|
100
100
|
pathParams: {
|
|
101
101
|
id
|
|
@@ -108,11 +108,11 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
108
108
|
* @param orderBy The order for the results, defaults to created.
|
|
109
109
|
* @param orderByDirection The direction for the order, defaults to descending.
|
|
110
110
|
* @param properties The properties to return, if not provided defaults to id, created and object.
|
|
111
|
-
* @param cursor The cursor to request the next
|
|
112
|
-
* @param
|
|
111
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
112
|
+
* @param limit Limit the number of entities to return.
|
|
113
113
|
* @returns The entities, which can be partial if a limited keys list was provided.
|
|
114
114
|
*/
|
|
115
|
-
async query(conditions, orderBy, orderByDirection, properties, cursor,
|
|
115
|
+
async query(conditions, orderBy, orderByDirection, properties, cursor, limit) {
|
|
116
116
|
const response = await this.fetch("/", "GET", {
|
|
117
117
|
headers: {
|
|
118
118
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
@@ -123,7 +123,7 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
123
123
|
orderByDirection,
|
|
124
124
|
properties: HttpParameterHelper.arrayToString(properties),
|
|
125
125
|
cursor,
|
|
126
|
-
|
|
126
|
+
limit: Coerce.string(limit)
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
return response.body;
|
|
@@ -135,7 +135,7 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
135
135
|
* @returns The id of the created entry, if not provided.
|
|
136
136
|
*/
|
|
137
137
|
async createEntry(id, entryObject) {
|
|
138
|
-
Guards.stringValue(
|
|
138
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
139
139
|
const response = await this.fetch("/:id", "POST", {
|
|
140
140
|
pathParams: {
|
|
141
141
|
id
|
|
@@ -156,8 +156,8 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
156
156
|
* @throws NotFoundError if the stream is not found.
|
|
157
157
|
*/
|
|
158
158
|
async getEntry(id, entryId, options) {
|
|
159
|
-
Guards.stringValue(
|
|
160
|
-
Guards.stringValue(
|
|
159
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
160
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
|
|
161
161
|
const response = await this.fetch("/:id/:entryId", "GET", {
|
|
162
162
|
headers: {
|
|
163
163
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
@@ -180,8 +180,8 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
180
180
|
* @throws NotFoundError if the stream is not found.
|
|
181
181
|
*/
|
|
182
182
|
async getEntryObject(id, entryId) {
|
|
183
|
-
Guards.stringValue(
|
|
184
|
-
Guards.stringValue(
|
|
183
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
184
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
|
|
185
185
|
const response = await this.fetch("/:id/:entryId/object", "GET", {
|
|
186
186
|
headers: {
|
|
187
187
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
@@ -201,8 +201,8 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
201
201
|
* @returns Nothing.
|
|
202
202
|
*/
|
|
203
203
|
async updateEntry(id, entryId, entryObject) {
|
|
204
|
-
Guards.stringValue(
|
|
205
|
-
Guards.stringValue(
|
|
204
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
205
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
|
|
206
206
|
await this.fetch("/:id/:entryId", "PUT", {
|
|
207
207
|
pathParams: {
|
|
208
208
|
id,
|
|
@@ -220,8 +220,8 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
220
220
|
* @returns Nothing.
|
|
221
221
|
*/
|
|
222
222
|
async removeEntry(id, entryId) {
|
|
223
|
-
Guards.stringValue(
|
|
224
|
-
Guards.stringValue(
|
|
223
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
224
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
|
|
225
225
|
await this.fetch("/:id/:entryId", "DELETE", {
|
|
226
226
|
pathParams: {
|
|
227
227
|
id,
|
|
@@ -236,14 +236,14 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
236
236
|
* @param options.conditions The conditions to filter the stream.
|
|
237
237
|
* @param options.includeDeleted Whether to include deleted entries, defaults to false.
|
|
238
238
|
* @param options.verifyEntries Should the entries be verified, defaults to false.
|
|
239
|
-
* @param options.
|
|
239
|
+
* @param options.limit How many entries to return.
|
|
240
240
|
* @param options.cursor Cursor to use for next chunk of data.
|
|
241
241
|
* @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.
|
|
242
242
|
* @returns The stream and entries if found.
|
|
243
243
|
* @throws NotFoundError if the stream is not found.
|
|
244
244
|
*/
|
|
245
245
|
async getEntries(id, options) {
|
|
246
|
-
Guards.stringValue(
|
|
246
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
247
247
|
const response = await this.fetch("/:id/entries", "GET", {
|
|
248
248
|
headers: {
|
|
249
249
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
@@ -255,7 +255,7 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
255
255
|
conditions: HttpParameterHelper.objectToString(options?.conditions),
|
|
256
256
|
includeDeleted: Coerce.string(options?.includeDeleted),
|
|
257
257
|
verifyEntries: Coerce.string(options?.verifyEntries),
|
|
258
|
-
|
|
258
|
+
limit: Coerce.string(options?.limit),
|
|
259
259
|
cursor: options?.cursor,
|
|
260
260
|
order: options?.order
|
|
261
261
|
}
|
|
@@ -268,14 +268,14 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
268
268
|
* @param options Additional options for the get operation.
|
|
269
269
|
* @param options.conditions The conditions to filter the stream.
|
|
270
270
|
* @param options.includeDeleted Whether to include deleted entries, defaults to false.
|
|
271
|
-
* @param options.
|
|
271
|
+
* @param options.limit How many entries to return.
|
|
272
272
|
* @param options.cursor Cursor to use for next chunk of data.
|
|
273
273
|
* @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.
|
|
274
274
|
* @returns The stream and entries if found.
|
|
275
275
|
* @throws NotFoundError if the stream is not found.
|
|
276
276
|
*/
|
|
277
277
|
async getEntryObjects(id, options) {
|
|
278
|
-
Guards.stringValue(
|
|
278
|
+
Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
|
|
279
279
|
const response = await this.fetch("/:id/entries/objects", "GET", {
|
|
280
280
|
headers: {
|
|
281
281
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
@@ -286,7 +286,7 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
286
286
|
query: {
|
|
287
287
|
conditions: HttpParameterHelper.objectToString(options?.conditions),
|
|
288
288
|
includeDeleted: Coerce.string(options?.includeDeleted),
|
|
289
|
-
|
|
289
|
+
limit: Coerce.string(options?.limit),
|
|
290
290
|
cursor: Coerce.string(options?.cursor),
|
|
291
291
|
order: options?.order
|
|
292
292
|
}
|
|
@@ -300,8 +300,10 @@ class AuditableItemStreamClient extends BaseRestClient {
|
|
|
300
300
|
* @throws NotFoundError if the vertex is not found.
|
|
301
301
|
*/
|
|
302
302
|
async removeVerifiable(id) {
|
|
303
|
-
throw new NotSupportedError(
|
|
303
|
+
throw new NotSupportedError(AuditableItemStreamRestClient.CLASS_NAME, "notSupportedOnClient", {
|
|
304
|
+
methodName: "removeVerifiable"
|
|
305
|
+
});
|
|
304
306
|
}
|
|
305
307
|
}
|
|
306
308
|
|
|
307
|
-
export {
|
|
309
|
+
export { AuditableItemStreamRestClient };
|
|
@@ -6,13 +6,13 @@ import type { IComparator, SortDirection } from "@twin.org/entity";
|
|
|
6
6
|
/**
|
|
7
7
|
* Client for performing auditable item stream through to REST endpoints.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class AuditableItemStreamRestClient extends BaseRestClient implements IAuditableItemStreamComponent {
|
|
10
10
|
/**
|
|
11
11
|
* Runtime name for the class.
|
|
12
12
|
*/
|
|
13
|
-
readonly CLASS_NAME: string;
|
|
13
|
+
static readonly CLASS_NAME: string;
|
|
14
14
|
/**
|
|
15
|
-
* Create a new instance of
|
|
15
|
+
* Create a new instance of AuditableItemStreamRestClient.
|
|
16
16
|
* @param config The configuration for the client.
|
|
17
17
|
*/
|
|
18
18
|
constructor(config: IBaseRestClientConfig);
|
|
@@ -74,11 +74,11 @@ export declare class AuditableItemStreamClient extends BaseRestClient implements
|
|
|
74
74
|
* @param orderBy The order for the results, defaults to created.
|
|
75
75
|
* @param orderByDirection The direction for the order, defaults to descending.
|
|
76
76
|
* @param properties The properties to return, if not provided defaults to id, created and object.
|
|
77
|
-
* @param cursor The cursor to request the next
|
|
78
|
-
* @param
|
|
77
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
78
|
+
* @param limit Limit the number of entities to return.
|
|
79
79
|
* @returns The entities, which can be partial if a limited keys list was provided.
|
|
80
80
|
*/
|
|
81
|
-
query(conditions?: IComparator[], orderBy?: keyof Pick<IAuditableItemStream, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, properties?: (keyof IAuditableItemStream)[], cursor?: string,
|
|
81
|
+
query(conditions?: IComparator[], orderBy?: keyof Pick<IAuditableItemStream, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, properties?: (keyof IAuditableItemStream)[], cursor?: string, limit?: number): Promise<IAuditableItemStreamList>;
|
|
82
82
|
/**
|
|
83
83
|
* Create an entry in the stream.
|
|
84
84
|
* @param id The id of the stream to update.
|
|
@@ -128,7 +128,7 @@ export declare class AuditableItemStreamClient extends BaseRestClient implements
|
|
|
128
128
|
* @param options.conditions The conditions to filter the stream.
|
|
129
129
|
* @param options.includeDeleted Whether to include deleted entries, defaults to false.
|
|
130
130
|
* @param options.verifyEntries Should the entries be verified, defaults to false.
|
|
131
|
-
* @param options.
|
|
131
|
+
* @param options.limit How many entries to return.
|
|
132
132
|
* @param options.cursor Cursor to use for next chunk of data.
|
|
133
133
|
* @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.
|
|
134
134
|
* @returns The stream and entries if found.
|
|
@@ -138,7 +138,7 @@ export declare class AuditableItemStreamClient extends BaseRestClient implements
|
|
|
138
138
|
conditions?: IComparator[];
|
|
139
139
|
includeDeleted?: boolean;
|
|
140
140
|
verifyEntries?: boolean;
|
|
141
|
-
|
|
141
|
+
limit?: number;
|
|
142
142
|
cursor?: string;
|
|
143
143
|
order?: SortDirection;
|
|
144
144
|
}): Promise<IAuditableItemStreamEntryList>;
|
|
@@ -148,7 +148,7 @@ export declare class AuditableItemStreamClient extends BaseRestClient implements
|
|
|
148
148
|
* @param options Additional options for the get operation.
|
|
149
149
|
* @param options.conditions The conditions to filter the stream.
|
|
150
150
|
* @param options.includeDeleted Whether to include deleted entries, defaults to false.
|
|
151
|
-
* @param options.
|
|
151
|
+
* @param options.limit How many entries to return.
|
|
152
152
|
* @param options.cursor Cursor to use for next chunk of data.
|
|
153
153
|
* @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.
|
|
154
154
|
* @returns The stream and entries if found.
|
|
@@ -157,7 +157,7 @@ export declare class AuditableItemStreamClient extends BaseRestClient implements
|
|
|
157
157
|
getEntryObjects(id: string, options?: {
|
|
158
158
|
conditions?: IComparator[];
|
|
159
159
|
includeDeleted?: boolean;
|
|
160
|
-
|
|
160
|
+
limit?: number;
|
|
161
161
|
cursor?: string;
|
|
162
162
|
order?: SortDirection;
|
|
163
163
|
}): Promise<IAuditableItemStreamEntryObjectList>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./auditableItemStreamRestClient";
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @twin.org/auditable-item-stream-rest-client - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.5](https://github.com/twinfoundation/auditable-item-stream/compare/auditable-item-stream-rest-client-v0.0.2-next.4...auditable-item-stream-rest-client-v0.0.2-next.5) (2025-10-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add validate-locales ([4babc73](https://github.com/twinfoundation/auditable-item-stream/commit/4babc7331f7fed61450fe2e2d8eccee52367f2be))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/auditable-item-stream-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
16
|
+
|
|
17
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/auditable-item-stream/compare/auditable-item-stream-rest-client-v0.0.2-next.3...auditable-item-stream-rest-client-v0.0.2-next.4) (2025-09-29)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* use new nameof operators ([d1a3bf8](https://github.com/twinfoundation/auditable-item-stream/commit/d1a3bf8369f899fff8fd9d7b3b068f270fd8603d))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/auditable-item-stream-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
30
|
+
|
|
3
31
|
## [0.0.2-next.3](https://github.com/twinfoundation/auditable-item-stream/compare/auditable-item-stream-rest-client-v0.0.2-next.2...auditable-item-stream-rest-client-v0.0.2-next.3) (2025-08-29)
|
|
4
32
|
|
|
5
33
|
|
package/docs/reference/classes/{AuditableItemStreamClient.md → AuditableItemStreamRestClient.md}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Class:
|
|
1
|
+
# Class: AuditableItemStreamRestClient
|
|
2
2
|
|
|
3
3
|
Client for performing auditable item stream through to REST endpoints.
|
|
4
4
|
|
|
@@ -14,9 +14,9 @@ Client for performing auditable item stream through to REST endpoints.
|
|
|
14
14
|
|
|
15
15
|
### Constructor
|
|
16
16
|
|
|
17
|
-
> **new
|
|
17
|
+
> **new AuditableItemStreamRestClient**(`config`): `AuditableItemStreamRestClient`
|
|
18
18
|
|
|
19
|
-
Create a new instance of
|
|
19
|
+
Create a new instance of AuditableItemStreamRestClient.
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
@@ -28,7 +28,7 @@ The configuration for the client.
|
|
|
28
28
|
|
|
29
29
|
#### Returns
|
|
30
30
|
|
|
31
|
-
`
|
|
31
|
+
`AuditableItemStreamRestClient`
|
|
32
32
|
|
|
33
33
|
#### Overrides
|
|
34
34
|
|
|
@@ -38,14 +38,10 @@ The configuration for the client.
|
|
|
38
38
|
|
|
39
39
|
### CLASS\_NAME
|
|
40
40
|
|
|
41
|
-
> `readonly` **CLASS\_NAME**: `string`
|
|
41
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
42
|
|
|
43
43
|
Runtime name for the class.
|
|
44
44
|
|
|
45
|
-
#### Implementation of
|
|
46
|
-
|
|
47
|
-
`IAuditableItemStreamComponent.CLASS_NAME`
|
|
48
|
-
|
|
49
45
|
## Methods
|
|
50
46
|
|
|
51
47
|
### create()
|
|
@@ -217,7 +213,7 @@ Nothing.
|
|
|
217
213
|
|
|
218
214
|
### query()
|
|
219
215
|
|
|
220
|
-
> **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `properties?`, `cursor?`, `
|
|
216
|
+
> **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `properties?`, `cursor?`, `limit?`): `Promise`\<`IAuditableItemStreamList`\>
|
|
221
217
|
|
|
222
218
|
Query all the streams, will not return entries.
|
|
223
219
|
|
|
@@ -251,13 +247,13 @@ The properties to return, if not provided defaults to id, created and object.
|
|
|
251
247
|
|
|
252
248
|
`string`
|
|
253
249
|
|
|
254
|
-
The cursor to request the next
|
|
250
|
+
The cursor to request the next chunk of entities.
|
|
255
251
|
|
|
256
|
-
#####
|
|
252
|
+
##### limit?
|
|
257
253
|
|
|
258
254
|
`number`
|
|
259
255
|
|
|
260
|
-
|
|
256
|
+
Limit the number of entities to return.
|
|
261
257
|
|
|
262
258
|
#### Returns
|
|
263
259
|
|
|
@@ -491,7 +487,7 @@ Whether to include deleted entries, defaults to false.
|
|
|
491
487
|
|
|
492
488
|
Should the entries be verified, defaults to false.
|
|
493
489
|
|
|
494
|
-
######
|
|
490
|
+
###### limit?
|
|
495
491
|
|
|
496
492
|
`number`
|
|
497
493
|
|
|
@@ -555,7 +551,7 @@ The conditions to filter the stream.
|
|
|
555
551
|
|
|
556
552
|
Whether to include deleted entries, defaults to false.
|
|
557
553
|
|
|
558
|
-
######
|
|
554
|
+
###### limit?
|
|
559
555
|
|
|
560
556
|
`number`
|
|
561
557
|
|
package/docs/reference/index.md
CHANGED
package/locales/en.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/auditable-item-stream-rest-client",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.5",
|
|
4
4
|
"description": "Auditable Item Stream contract implementation which can connect to REST endpoints",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/api-core": "next",
|
|
18
18
|
"@twin.org/api-models": "next",
|
|
19
|
-
"@twin.org/auditable-item-stream-models": "0.0.2-next.
|
|
19
|
+
"@twin.org/auditable-item-stream-models": "0.0.2-next.5",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/data-json-ld": "next",
|
|
22
22
|
"@twin.org/entity": "next",
|
|
@@ -40,5 +40,17 @@
|
|
|
40
40
|
"dist/types",
|
|
41
41
|
"locales",
|
|
42
42
|
"docs"
|
|
43
|
-
]
|
|
43
|
+
],
|
|
44
|
+
"keywords": [
|
|
45
|
+
"twin",
|
|
46
|
+
"trade",
|
|
47
|
+
"iota",
|
|
48
|
+
"framework",
|
|
49
|
+
"blockchain",
|
|
50
|
+
"auditable-item-stream"
|
|
51
|
+
],
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "git+https://github.com/twinfoundation/auditable-item-stream/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://twindev.org"
|
|
44
56
|
}
|