attlaz-client 1.9.22 → 1.9.23
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/Log/LogQuery.d.ts +4 -4
- package/dist/Model/Log/LogQuery.js +4 -2
- package/dist/Model/Log/LogStreamId.d.ts +1 -0
- package/dist/Model/Log/LogStreamId.js +3 -0
- package/dist/Model/Project/ProjectDeploy.js +1 -1
- package/dist/Model/User/UserAuthProvider.js +1 -3
- package/dist/Service/Endpoint.js +6 -4
- package/dist/Service/LogEndpoint.js +6 -2
- package/dist/Utils.d.ts +1 -0
- package/dist/Utils.js +4 -0
- package/package.json +1 -1
|
@@ -5,13 +5,13 @@ export declare class LogQuery {
|
|
|
5
5
|
readonly logStreamId: LogStreamId;
|
|
6
6
|
message: string | null;
|
|
7
7
|
hidden: boolean | null;
|
|
8
|
-
logLevels: LogLevel[];
|
|
8
|
+
logLevels: LogLevel[] | null;
|
|
9
9
|
tags: Array<{
|
|
10
10
|
key: string;
|
|
11
11
|
values: DataValueValue[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
}> | null;
|
|
13
|
+
limit: number;
|
|
14
|
+
startingAfterId: string | null;
|
|
15
15
|
sort: Array<{
|
|
16
16
|
field: string;
|
|
17
17
|
direction: number;
|
|
@@ -5,8 +5,10 @@ class LogQuery {
|
|
|
5
5
|
constructor(logStreamId) {
|
|
6
6
|
this.message = null;
|
|
7
7
|
this.hidden = null;
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
8
|
+
this.logLevels = null;
|
|
9
|
+
this.tags = null;
|
|
10
|
+
this.limit = 1000;
|
|
11
|
+
this.startingAfterId = null;
|
|
10
12
|
this.logStreamId = logStreamId;
|
|
11
13
|
}
|
|
12
14
|
}
|
|
@@ -12,7 +12,7 @@ class ProjectDeploy {
|
|
|
12
12
|
static parse(rawProjectDeploy) {
|
|
13
13
|
const projectDeploy = new ProjectDeploy();
|
|
14
14
|
projectDeploy.id = rawProjectDeploy.id.toString();
|
|
15
|
-
projectDeploy.platformId = rawProjectDeploy.
|
|
15
|
+
projectDeploy.platformId = rawProjectDeploy.platform;
|
|
16
16
|
projectDeploy.buildStrategyId = rawProjectDeploy.build_strategy;
|
|
17
17
|
projectDeploy.userId = rawProjectDeploy.user;
|
|
18
18
|
projectDeploy.requested = new Date(rawProjectDeploy.requested);
|
|
@@ -15,9 +15,7 @@ class UserAuthProvider {
|
|
|
15
15
|
userAuthProvider.provider = raw.provider;
|
|
16
16
|
userAuthProvider.providerUserId = raw.provider_user;
|
|
17
17
|
userAuthProvider.providerUserEmail = raw.provider_user_email;
|
|
18
|
-
|
|
19
|
-
userAuthProvider.lastUsed = Utils_1.Utils.parseRawDate(raw.last_used);
|
|
20
|
-
}
|
|
18
|
+
userAuthProvider.lastUsed = Utils_1.Utils.parseRawDate(raw.last_used);
|
|
21
19
|
userAuthProvider.state = State_1.State.fromString(raw.state);
|
|
22
20
|
return userAuthProvider;
|
|
23
21
|
}
|
package/dist/Service/Endpoint.js
CHANGED
|
@@ -8,6 +8,7 @@ const Utils_1 = require("../Utils");
|
|
|
8
8
|
const ObjectWrapper_1 = require("../Model/Result/ObjectWrapper");
|
|
9
9
|
const DataValueCollection_1 = require("../Model/DataValueCollection");
|
|
10
10
|
const JsonSerializable_1 = require("../Model/JsonSerializable");
|
|
11
|
+
const LogStreamId_1 = require("../Model/Log/LogStreamId");
|
|
11
12
|
class Endpoint {
|
|
12
13
|
constructor(httpClient) {
|
|
13
14
|
this.httpClient = httpClient;
|
|
@@ -23,9 +24,9 @@ class Endpoint {
|
|
|
23
24
|
}
|
|
24
25
|
return result;
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
if (Utils_1.Utils.isDate(data)) {
|
|
28
|
+
return data.toISOString();
|
|
29
|
+
}
|
|
29
30
|
// tODo: this does not seem to work correclty
|
|
30
31
|
if (data instanceof JsonSerializable_1.JsonSerializable && 'jsonSerialize' in data) {
|
|
31
32
|
return data.jsonSerialize();
|
|
@@ -41,7 +42,8 @@ class Endpoint {
|
|
|
41
42
|
// data instanceof UserId ||
|
|
42
43
|
// data instanceof DataCollectionResult ||
|
|
43
44
|
// data instanceof SuccessResult ||
|
|
44
|
-
data instanceof DataValueCollection_1.DataValueCollection
|
|
45
|
+
data instanceof DataValueCollection_1.DataValueCollection ||
|
|
46
|
+
data instanceof LogStreamId_1.LogStreamId) {
|
|
45
47
|
return this.formatParameters(data.jsonSerialize());
|
|
46
48
|
}
|
|
47
49
|
const result = {};
|
|
@@ -10,8 +10,12 @@ const LogStream_1 = require("../Model/Log/LogStream");
|
|
|
10
10
|
class LogEndpoint extends Endpoint_1.Endpoint {
|
|
11
11
|
async getLogs(logQuery) {
|
|
12
12
|
const arrQuery = [];
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
if (logQuery.limit !== null) {
|
|
14
|
+
arrQuery.push('limit=' + logQuery.limit);
|
|
15
|
+
}
|
|
16
|
+
if (logQuery.startingAfterId !== null) {
|
|
17
|
+
arrQuery.push('starting_after=' + logQuery.startingAfterId);
|
|
18
|
+
}
|
|
15
19
|
// Resolved
|
|
16
20
|
if (logQuery.hidden !== null && logQuery.hidden !== undefined) {
|
|
17
21
|
if (logQuery.hidden) {
|
package/dist/Utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare class Utils {
|
|
2
2
|
static isNullOrUndefined(variable: any): boolean;
|
|
3
3
|
static isTrue(input: string | number | boolean | null | undefined): boolean;
|
|
4
|
+
static isDate(value: any): boolean;
|
|
4
5
|
static parseRawDate(input: Date): Date;
|
|
5
6
|
static parseEnum<T>(input: string, Enum: any): T | null;
|
|
6
7
|
static parseInt(input: string | number | boolean): number;
|
package/dist/Utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Utils = void 0;
|
|
4
|
+
const util_1 = require("util");
|
|
4
5
|
class Utils {
|
|
5
6
|
static isNullOrUndefined(variable) {
|
|
6
7
|
return variable === null || variable === undefined;
|
|
@@ -8,6 +9,9 @@ class Utils {
|
|
|
8
9
|
static isTrue(input) {
|
|
9
10
|
return (input === true || input === 'true' || input === 1 || input === '1');
|
|
10
11
|
}
|
|
12
|
+
static isDate(value) {
|
|
13
|
+
return value !== null && util_1.types.isDate(value) && !isNaN(value.getTime());
|
|
14
|
+
}
|
|
11
15
|
static parseRawDate(input) {
|
|
12
16
|
if (input !== null && input !== undefined) {
|
|
13
17
|
return new Date(input);
|