attlaz-client 1.13.39 → 1.13.41

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.
@@ -0,0 +1,10 @@
1
+ export declare class FlowTemplate {
2
+ id: string;
3
+ name: string;
4
+ icon: string;
5
+ description: string;
6
+ source: string;
7
+ requiredTriggers: string[];
8
+ requiredAdapters: string[];
9
+ requiredChannels: string[];
10
+ }
@@ -0,0 +1,10 @@
1
+ export class FlowTemplate {
2
+ id;
3
+ name;
4
+ icon;
5
+ description;
6
+ source;
7
+ requiredTriggers;
8
+ requiredAdapters;
9
+ requiredChannels;
10
+ }
@@ -8,11 +8,10 @@ export declare class Subscriber extends MetaDataAware implements StateAware {
8
8
  eventTypes: EventType[];
9
9
  projectEnvironmentId: string;
10
10
  flowId: string;
11
- flowRunId: string;
12
11
  channelIds: string[];
13
12
  logLevelThreshold: LogLevel;
14
13
  state: State;
15
- constructor(id: string, eventTypes: EventType[], projectEnvironmentId: string, flowId: string, flowRunId: string, channelIds: string[], logLevelThreshold?: LogLevel);
14
+ constructor(id: string, eventTypes: EventType[], projectEnvironmentId: string, flowId: string, channelIds: string[], logLevelThreshold?: LogLevel);
16
15
  static parseRaw(rawSubscriber: any): Subscriber;
17
16
  getLogLevelThreshold(): LogLevel;
18
17
  hasLogLevelThreshold(): boolean;
@@ -7,22 +7,22 @@ export class Subscriber extends MetaDataAware {
7
7
  eventTypes;
8
8
  projectEnvironmentId;
9
9
  flowId;
10
- flowRunId;
10
+ // public flowRunId: string;
11
11
  channelIds;
12
12
  logLevelThreshold;
13
13
  state = State.Active;
14
- constructor(id, eventTypes, projectEnvironmentId, flowId, flowRunId, channelIds, logLevelThreshold = LogLevel.Debug) {
14
+ constructor(id, eventTypes, projectEnvironmentId, flowId, channelIds, logLevelThreshold = LogLevel.Debug) {
15
15
  super();
16
16
  this.id = id;
17
17
  this.eventTypes = eventTypes;
18
18
  this.projectEnvironmentId = projectEnvironmentId;
19
19
  this.flowId = flowId;
20
- this.flowRunId = flowRunId;
20
+ // this.flowRunId = flowRunId;
21
21
  this.channelIds = channelIds;
22
22
  this.logLevelThreshold = logLevelThreshold;
23
23
  }
24
24
  static parseRaw(rawSubscriber) {
25
- const subscriber = new Subscriber(rawSubscriber.id, rawSubscriber.event_types, rawSubscriber.project_environment, rawSubscriber.flow, rawSubscriber.flow_run, rawSubscriber.channels, rawSubscriber.log_level_threshold);
25
+ const subscriber = new Subscriber(rawSubscriber.id, rawSubscriber.event_types, rawSubscriber.project_environment, rawSubscriber.flow, rawSubscriber.channels, rawSubscriber.log_level_threshold);
26
26
  subscriber.state = State.fromString(rawSubscriber.state);
27
27
  if (Object.prototype.hasOwnProperty.call(rawSubscriber, 'metadata')) {
28
28
  subscriber.metadata = DataValueCollection.fromObject(rawSubscriber.metadata);
@@ -1,10 +1,27 @@
1
1
  import { Endpoint } from './Endpoint.js';
2
+ export type BlockedIp = {
3
+ ip: string;
4
+ from: Date;
5
+ to: Date;
6
+ reason: string;
7
+ };
8
+ export type FlaggedIp = {
9
+ ip: string;
10
+ date: Date;
11
+ reason: string;
12
+ };
13
+ export type IpRule = {
14
+ ip: string;
15
+ action: string;
16
+ description: string;
17
+ };
18
+ export type FirewallInfo = {
19
+ blockedIps: BlockedIp[];
20
+ flaggedIps: FlaggedIp[];
21
+ ipRules: IpRule[];
22
+ };
2
23
  export declare class FirewallEndpoint extends Endpoint {
3
- getInformation(): Promise<{
4
- blocked_ips: any[];
5
- flagged_ips: any[];
6
- ip_rules: [];
7
- } | null>;
24
+ getInformation(): Promise<FirewallInfo | null>;
8
25
  createIpRule(ip: string, action: string, description?: string): Promise<boolean>;
9
26
  unblockIP(ip: string): Promise<boolean>;
10
27
  }
@@ -1,14 +1,27 @@
1
1
  import { Endpoint } from './Endpoint.js';
2
+ import { Utils } from '../Utils.js';
2
3
  export class FirewallEndpoint extends Endpoint {
3
4
  async getInformation() {
4
5
  const cmd = '/system/firewall/';
5
6
  try {
6
7
  const parser = (raw) => {
7
8
  const info = {
8
- blocked_ips: raw.blocked_ips,
9
- flagged_ips: raw.flagged_ips,
10
- ip_rules: raw.ip_rules,
9
+ blockedIps: [],
10
+ flaggedIps: [],
11
+ ipRules: [],
11
12
  };
13
+ for (const blockedIp of raw.blocked_ips) {
14
+ blockedIp.from = Utils.parseRawDate(blockedIp.from);
15
+ blockedIp.to = Utils.parseRawDate(blockedIp.to);
16
+ info.blockedIps.push(blockedIp);
17
+ }
18
+ for (const flaggedIp of raw.flagged_ips) {
19
+ flaggedIp.date = Utils.parseRawDate(flaggedIp.date);
20
+ info.flaggedIps.push(flaggedIp);
21
+ }
22
+ for (const ipRule of raw.ip_rules) {
23
+ info.ipRules.push(ipRule);
24
+ }
12
25
  return info;
13
26
  };
14
27
  const result = await this.requestObject(cmd, null, parser, 'GET');
@@ -25,7 +38,9 @@ export class FirewallEndpoint extends Endpoint {
25
38
  const cmd = '/system/firewall/ip_rules';
26
39
  try {
27
40
  const parser = (raw) => raw.success;
28
- const result = await this.requestObject(cmd, { ip, action, description }, parser, 'PUT');
41
+ const result = await this.requestObject(cmd, {
42
+ ip, action, description,
43
+ }, parser, 'PUT');
29
44
  const re = result.getData();
30
45
  if (re === null) {
31
46
  console.log('createIPRule wrong result', { result, parsed: re });
package/dist/index.d.ts CHANGED
@@ -106,6 +106,7 @@ export { FlowRunStatus } from './Model/Flow/FlowRunStatus.js';
106
106
  export { FlowRunSummary } from './Model/Flow/FlowRunSummary.js';
107
107
  export { FlowRunStats } from './Model/Flow/FlowRunStats.js';
108
108
  export { FlowSummary } from './Model/Flow/FlowSummary.js';
109
+ export { FlowTemplate } from './Model/Flow/FlowTemplate.js';
109
110
  export { User } from './Model/User/User.js';
110
111
  export { UserAuthProvider } from './Model/User/UserAuthProvider.js';
111
112
  export { UserAction } from './Model/User/UserAction.js';
package/dist/index.js CHANGED
@@ -100,6 +100,7 @@ export { FlowRunStatus } from './Model/Flow/FlowRunStatus.js';
100
100
  export { FlowRunSummary } from './Model/Flow/FlowRunSummary.js';
101
101
  export { FlowRunStats } from './Model/Flow/FlowRunStats.js';
102
102
  export { FlowSummary } from './Model/Flow/FlowSummary.js';
103
+ export { FlowTemplate } from './Model/Flow/FlowTemplate.js';
103
104
  export { User } from './Model/User/User.js';
104
105
  export { UserAuthProvider } from './Model/User/UserAuthProvider.js';
105
106
  export { UserAction } from './Model/User/UserAction.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.13.37";
1
+ export declare const VERSION = "1.13.39";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.13.37";
1
+ export const VERSION = "1.13.39";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.13.39",
3
+ "version": "1.13.41",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",