attlaz-client 1.9.22 → 1.9.24

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.
@@ -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
- pageSize: number;
14
- pageNum: number;
12
+ }> | null;
13
+ limit: number | null;
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.pageSize = 1000;
9
- this.pageNum = 0;
8
+ this.logLevels = null;
9
+ this.tags = null;
10
+ this.limit = null;
11
+ this.startingAfterId = null;
10
12
  this.logStreamId = logStreamId;
11
13
  }
12
14
  }
@@ -1,4 +1,5 @@
1
1
  export declare class LogStreamId {
2
2
  readonly id: string;
3
3
  constructor(id: string);
4
+ jsonSerialize(): string;
4
5
  }
@@ -5,5 +5,8 @@ class LogStreamId {
5
5
  constructor(id) {
6
6
  this.id = id;
7
7
  }
8
+ jsonSerialize() {
9
+ return this.id;
10
+ }
8
11
  }
9
12
  exports.LogStreamId = LogStreamId;
@@ -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.platformId;
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
- if (raw.lastUsed !== null && raw.lastUsed !== undefined) {
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
  }
@@ -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
- // if (DateHelper.isDate(data)) {
27
- // return DateHelper.toString(data);
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
- arrQuery.push('pageSize=' + logQuery.pageSize);
14
- arrQuery.push('pageNum=' + logQuery.pageNum);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.9.22",
3
+ "version": "1.9.24",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",