attlaz-client 1.9.47 → 1.9.49

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.
@@ -1,5 +1,5 @@
1
1
  export declare class QueryString {
2
2
  private parameters;
3
- set(parameter: string, value: string | number | boolean): void;
3
+ set(parameter: string, value: string | number | boolean | string[]): void;
4
4
  build(): string;
5
5
  }
@@ -11,7 +11,11 @@ class QueryString {
11
11
  build() {
12
12
  const output = [];
13
13
  for (const parameter of this.parameters) {
14
- output.push(parameter.parameter + '=' + parameter.value);
14
+ let value = parameter.value;
15
+ if (Array.isArray(value)) {
16
+ value = value.join(',');
17
+ }
18
+ output.push(parameter.parameter + '=' + value);
15
19
  }
16
20
  return output.join('&');
17
21
  }
@@ -1,4 +1,5 @@
1
1
  export declare class CursorPagination {
2
2
  limit: number | null;
3
3
  startingAfter: string | null;
4
+ endingBefore: string | null;
4
5
  }
@@ -5,6 +5,7 @@ class CursorPagination {
5
5
  constructor() {
6
6
  this.limit = null;
7
7
  this.startingAfter = null;
8
+ this.endingBefore = null;
8
9
  }
9
10
  }
10
11
  exports.CursorPagination = CursorPagination;
@@ -23,7 +23,7 @@ class ConfigEndpoint extends Endpoint_1.Endpoint {
23
23
  }
24
24
  async getByProjectEnvironment(projectEnvironmentId = null) {
25
25
  try {
26
- const result = await this.requestCollection('/projectEnvironment/' + projectEnvironmentId + '/configvalues', null, Config_1.Config.parse);
26
+ const result = await this.requestCollection('/projectenvironments/' + projectEnvironmentId + '/configvalues', null, Config_1.Config.parse);
27
27
  return result;
28
28
  }
29
29
  catch (e) {
@@ -4,9 +4,10 @@ import { FlowRunStatus } from '../Model/Flow/FlowRunStatus';
4
4
  import { FlowRunSummary } from '../Model/Flow/FlowRunSummary';
5
5
  import { FlowRunHistory } from '../Model/Flow/FlowRunHistory';
6
6
  import { CollectionResult } from '../Model/Result/CollectionResult';
7
+ import { CursorPagination } from '../Model/Pagination/CursorPagination';
7
8
  export declare class FlowRunEndpoint extends Endpoint {
8
9
  getFlowRuns(flowId: string): Promise<CollectionResult<FlowRun>>;
9
- getFlowRunSummaries(flowId: string, from?: Date | null, to?: Date | null, flowRunStatuses?: FlowRunStatus[] | null, projectEnvironmentId?: string | null): Promise<CollectionResult<FlowRunSummary>>;
10
+ getFlowRunSummaries(flowId: string, flowRunStatuses?: FlowRunStatus[] | null, pagination?: CursorPagination | null, projectEnvironmentId?: string | null): Promise<CollectionResult<FlowRunSummary>>;
10
11
  getFlowRunSummary(flowRunId: string): Promise<FlowRunSummary | null>;
11
12
  getFlowRunHistory(flowRunId: string): Promise<CollectionResult<FlowRunHistory>>;
12
13
  updateFlowRun(taskExecutionId: string, status: FlowRunStatus, time?: Date | null): Promise<FlowRun>;
@@ -2,20 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowRunEndpoint = void 0;
4
4
  const Endpoint_1 = require("./Endpoint");
5
- const Utils_1 = require("../Utils");
6
5
  const ClientError_1 = require("../Model/Error/ClientError");
7
6
  const HttpClient_1 = require("../Http/HttpClient");
8
7
  const FlowRun_1 = require("../Model/Flow/FlowRun");
9
8
  const FlowRunSummary_1 = require("../Model/Flow/FlowRunSummary");
10
9
  const FlowRunHistory_1 = require("../Model/Flow/FlowRunHistory");
10
+ const QueryString_1 = require("../Http/Data/QueryString");
11
11
  class FlowRunEndpoint extends Endpoint_1.Endpoint {
12
12
  async getFlowRuns(flowId) {
13
13
  const result = await this.requestCollection('/flows/' + flowId + '/runs', null, FlowRun_1.FlowRun.parse);
14
14
  return result;
15
15
  }
16
- async getFlowRunSummaries(flowId, from = null, to = null, flowRunStatuses = null, projectEnvironmentId = null) {
16
+ async getFlowRunSummaries(flowId, flowRunStatuses = null, pagination = null, projectEnvironmentId = null) {
17
17
  try {
18
- let params = null;
18
+ const queryString = new QueryString_1.QueryString();
19
19
  // if (from !== null && from !== undefined) {
20
20
  //
21
21
  // params = {};
@@ -28,8 +28,11 @@ class FlowRunEndpoint extends Endpoint_1.Endpoint {
28
28
  // }
29
29
  // params.to = to.toISOString();
30
30
  // }
31
- if (!Utils_1.Utils.isNullOrUndefined(projectEnvironmentId)) {
32
- params = { project_environment: projectEnvironmentId };
31
+ if (projectEnvironmentId !== null && projectEnvironmentId !== undefined) {
32
+ queryString.set('project_environment', projectEnvironmentId);
33
+ }
34
+ if (flowRunStatuses !== null && flowRunStatuses !== undefined && flowRunStatuses.length > 0) {
35
+ queryString.set('statuses', flowRunStatuses.map(status => status.toString()));
33
36
  }
34
37
  // if (flowRunStatuses !== null && flowRunStatuses.length > 0) {
35
38
  // if (params === null || params === undefined) {
@@ -37,7 +40,8 @@ class FlowRunEndpoint extends Endpoint_1.Endpoint {
37
40
  // }
38
41
  // params.statuses = flowRunStatuses;
39
42
  // }
40
- const result = await this.requestCollection('/flows/' + flowId + '/runsummaries', params, FlowRunSummary_1.FlowRunSummary.parse);
43
+ const params = queryString.build();
44
+ const result = await this.requestCollection('/flows/' + flowId + '/runsummaries', queryString, FlowRunSummary_1.FlowRunSummary.parse);
41
45
  return result;
42
46
  }
43
47
  catch (error) {
@@ -123,7 +123,7 @@ class LogEndpoint extends Endpoint_1.Endpoint {
123
123
  }
124
124
  async getByProject(projectId) {
125
125
  const parser = (raw) => {
126
- return new LogStream_1.LogStream(new LogStreamId_1.LogStreamId(raw['id']['id']), raw['name']);
126
+ return new LogStream_1.LogStream(new LogStreamId_1.LogStreamId(raw['id']), raw['name']);
127
127
  };
128
128
  const result = await this.requestCollection('projects/' + projectId + '/logstreams', null, parser);
129
129
  return result;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.9.7";
1
+ export declare const VERSION = "1.9.48";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "1.9.7";
4
+ exports.VERSION = "1.9.48";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.9.47",
3
+ "version": "1.9.49",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",