attlaz-client 1.15.7 → 1.16.0
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/Model/Adapter/AdapterConnection.js +2 -1
- package/dist/Model/EntityId.d.ts +9 -0
- package/dist/Model/EntityId.js +27 -0
- package/dist/Model/Log/LogStreamId.d.ts +3 -3
- package/dist/Model/Log/LogStreamId.js +3 -5
- package/dist/Service/LogEndpoint.js +5 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AdapterConnectionStatus } from './AdapterConnectionStatus.js';
|
|
1
2
|
export class AdapterConnection {
|
|
2
3
|
id;
|
|
3
4
|
key;
|
|
@@ -12,7 +13,7 @@ export class AdapterConnection {
|
|
|
12
13
|
adapterConnection.adapter = rawAdapterConnection.adapter;
|
|
13
14
|
adapterConnection.name = rawAdapterConnection.name;
|
|
14
15
|
adapterConnection.projectId = rawAdapterConnection.project;
|
|
15
|
-
adapterConnection.status = rawAdapterConnection.status;
|
|
16
|
+
adapterConnection.status = AdapterConnectionStatus.fromString(rawAdapterConnection.status);
|
|
16
17
|
return adapterConnection;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare abstract class EntityId {
|
|
2
|
+
protected readonly id: string;
|
|
3
|
+
protected readonly abstract TYPE: string;
|
|
4
|
+
constructor(id: string);
|
|
5
|
+
getIdType(): string;
|
|
6
|
+
toString(): string;
|
|
7
|
+
jsonSerialize(): any;
|
|
8
|
+
isEqual<T extends this>(entityId: T): boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class EntityId {
|
|
2
|
+
id;
|
|
3
|
+
constructor(id) {
|
|
4
|
+
this.id = id;
|
|
5
|
+
if (id === null || id === undefined || (id + '').length < 1) {
|
|
6
|
+
throw new Error('Invalid id');
|
|
7
|
+
}
|
|
8
|
+
if ((id + '').length !== 27) {
|
|
9
|
+
// console.error('Id `' + id + '` does not seem a valid KSUID (type `' + this.getIdType() + '`)');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
getIdType() {
|
|
13
|
+
return this.TYPE;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
return this.id;
|
|
17
|
+
}
|
|
18
|
+
jsonSerialize() {
|
|
19
|
+
return this.toString();
|
|
20
|
+
}
|
|
21
|
+
isEqual(entityId) {
|
|
22
|
+
if (this.getIdType() !== entityId.getIdType()) {
|
|
23
|
+
throw new Error('Types are not the same');
|
|
24
|
+
}
|
|
25
|
+
return this.getIdType() !== '' && entityId.getIdType() !== '' && this.getIdType() === entityId.getIdType() && this.toString() === entityId.toString();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -37,12 +37,12 @@ export class LogEndpoint extends Endpoint {
|
|
|
37
37
|
const strTags = arrTags.join(',');
|
|
38
38
|
arrQuery.push('tags=' + strTags);
|
|
39
39
|
}
|
|
40
|
-
const cmd = '/logstreams/' + Utils.base64encode(logQuery.logStreamId.
|
|
40
|
+
const cmd = '/logstreams/' + Utils.base64encode(logQuery.logStreamId.toString()) + '/logs/?' + arrQuery.join('&');
|
|
41
41
|
const result = await this.requestCollection(cmd, Log.parse);
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
async getCursoredLogEntries(logStreamId, pagination, filter) {
|
|
45
|
-
const queryString = new QueryString('/logstreams/' + Utils.base64encode(logStreamId.
|
|
45
|
+
const queryString = new QueryString('/logstreams/' + Utils.base64encode(logStreamId.toString()) + '/logs');
|
|
46
46
|
queryString.addPagination(pagination);
|
|
47
47
|
if (filter !== null && filter !== undefined) {
|
|
48
48
|
if (filter.tags !== null && filter.tags.length > 0) {
|
|
@@ -64,7 +64,7 @@ export class LogEndpoint extends Endpoint {
|
|
|
64
64
|
}
|
|
65
65
|
async save(log) {
|
|
66
66
|
try {
|
|
67
|
-
const cmd = '/logstreams/' + Utils.base64encode(log.logStream.
|
|
67
|
+
const cmd = '/logstreams/' + Utils.base64encode(log.logStream.toString()) + '/logs';
|
|
68
68
|
const result = await this.requestObject(cmd, log, Log.parse, 'POST');
|
|
69
69
|
const updatedLogEntry = result.getData();
|
|
70
70
|
if (updatedLogEntry === null) {
|
|
@@ -99,7 +99,7 @@ export class LogEndpoint extends Endpoint {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
async clear(logStreamId) {
|
|
102
|
-
const cmd = '/logstreams/' + Utils.base64encode(logStreamId.
|
|
102
|
+
const cmd = '/logstreams/' + Utils.base64encode(logStreamId.toString()) + '/clear';
|
|
103
103
|
try {
|
|
104
104
|
const parser = (raw) => ({ cleared: raw.cleared });
|
|
105
105
|
const result = await this.requestObject(cmd, null, parser, 'POST');
|
|
@@ -119,7 +119,7 @@ export class LogEndpoint extends Endpoint {
|
|
|
119
119
|
}
|
|
120
120
|
async getInformation(logStreamId) {
|
|
121
121
|
try {
|
|
122
|
-
const url = '/logstreams/' + Utils.base64encode(logStreamId.
|
|
122
|
+
const url = '/logstreams/' + Utils.base64encode(logStreamId.toString()) + '/info';
|
|
123
123
|
const result = await this.requestObject(url, null, LogStreamInformation.parse);
|
|
124
124
|
return result.getData();
|
|
125
125
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ export { WorkspaceMemberRole } from './Model/Workspace/WorkspaceMemberRole.js';
|
|
|
93
93
|
/** * */
|
|
94
94
|
export { Config } from './Model/Config.js';
|
|
95
95
|
export { DataValue, DataValueValue } from './Model/DataValue.js';
|
|
96
|
+
export { EntityId } from './Model/EntityId.js';
|
|
96
97
|
export { DataValueCollection } from './Model/DataValueCollection.js';
|
|
97
98
|
export { EntityType } from './Model/EntityType.js';
|
|
98
99
|
export { InboxMessage } from './Model/Inbox/InboxMessage.js';
|
package/dist/index.js
CHANGED
|
@@ -88,6 +88,7 @@ export { WorkspaceMemberRole } from './Model/Workspace/WorkspaceMemberRole.js';
|
|
|
88
88
|
/** * */
|
|
89
89
|
export { Config } from './Model/Config.js';
|
|
90
90
|
export { DataValue } from './Model/DataValue.js';
|
|
91
|
+
export { EntityId } from './Model/EntityId.js';
|
|
91
92
|
export { DataValueCollection } from './Model/DataValueCollection.js';
|
|
92
93
|
export { EntityType } from './Model/EntityType.js';
|
|
93
94
|
export { InboxMessage } from './Model/Inbox/InboxMessage.js';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.16.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.16.0";
|