otomato-sdk 1.5.74 → 1.7.75

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,4 +1,4 @@
1
- export const SDK_VERSION = '1.5.74';
1
+ export const SDK_VERSION = '1.7.75';
2
2
  export function compareVersions(v1, v2) {
3
3
  // Split the version strings into parts
4
4
  const v1Parts = v1.split('.').map(Number);
@@ -12,12 +12,12 @@ import { ACTIONS } from '../constants/Blocks.js';
12
12
  import { typeIsNumber } from '../utils/typeValidator.js';
13
13
  export class Action extends Node {
14
14
  constructor(action) {
15
- super(Object.assign(Object.assign({}, action), { class: 'action', parentInfo: findActionByBlockId(action.blockId).parentInfo }));
15
+ super(Object.assign(Object.assign({}, action), { class: 'action', parentInfo: findActionByBlockId(action.blockId).parentInfo, frontendHelpers: action.frontendHelpers || {} }));
16
16
  }
17
17
  static fromJSON(json) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  const enriched = findActionByBlockId(json.blockId);
20
- const action = new Action(Object.assign(Object.assign({}, enriched.block), { ref: json.ref, position: json.position, parentInfo: enriched.parentInfo, state: json.state }));
20
+ const action = new Action(Object.assign(Object.assign({}, enriched.block), { ref: json.ref, position: json.position, parentInfo: enriched.parentInfo, state: json.state, frontendHelpers: json.frontendHelpers || {} }));
21
21
  for (const [key, value] of Object.entries(json.parameters)) {
22
22
  if (!value) {
23
23
  continue;
@@ -25,6 +25,7 @@ export class Node {
25
25
  this.class = node.class;
26
26
  this.parentInfo = node.parentInfo;
27
27
  this.state = node.state || 'inactive';
28
+ this.frontendHelpers = node.frontendHelpers || {};
28
29
  if (node.ref) {
29
30
  this.ref = node.ref;
30
31
  }
@@ -165,7 +166,8 @@ export class Node {
165
166
  blockId: this.blockId,
166
167
  type: this.class,
167
168
  state: this.state,
168
- parameters: Object.assign({}, this.getParameters())
169
+ parameters: Object.assign({}, this.getParameters()),
170
+ frontendHelpers: this.frontendHelpers
169
171
  };
170
172
  if (this.position) {
171
173
  json.position = this.position;
@@ -12,7 +12,8 @@ import { TRIGGERS } from '../constants/Blocks.js';
12
12
  import { typeIsNumber } from '../utils/typeValidator.js';
13
13
  export class Trigger extends Node {
14
14
  constructor(trigger) {
15
- super(Object.assign(Object.assign({}, trigger), { class: 'trigger', parentInfo: findTriggerByBlockId(trigger.blockId).parentInfo }));
15
+ super(Object.assign(Object.assign({}, trigger), { class: 'trigger', parentInfo: findTriggerByBlockId(trigger.blockId).parentInfo, frontendHelpers: trigger.frontendHelpers || {} // Pass frontendHelpers
16
+ }));
16
17
  this.type = trigger.type;
17
18
  }
18
19
  notAPollingTrigger() {
@@ -33,7 +34,7 @@ export class Trigger extends Node {
33
34
  static fromJSON(json) {
34
35
  return __awaiter(this, void 0, void 0, function* () {
35
36
  const enriched = findTriggerByBlockId(json.blockId);
36
- const trigger = new Trigger(Object.assign(Object.assign({}, enriched.block), { ref: json.ref, position: json.position, parentInfo: enriched.parentInfo, state: json.state }));
37
+ const trigger = new Trigger(Object.assign(Object.assign({}, enriched.block), { ref: json.ref, position: json.position, parentInfo: enriched.parentInfo, state: json.state, frontendHelpers: json.frontendHelpers || {} }));
37
38
  for (const [key, value] of Object.entries(json.parameters)) {
38
39
  if (!value) {
39
40
  continue;
@@ -138,7 +138,6 @@ export class Workflow {
138
138
  this.name = response.name;
139
139
  this.state = response.state;
140
140
  this.dateCreated = response.dateCreated;
141
- console.log(response.executionId);
142
141
  this.executionId = response.executionId;
143
142
  this.dateModified = response.dateModified;
144
143
  this.nodes = yield Promise.all(response.nodes.map((nodeData) => __awaiter(this, void 0, void 0, function* () { return yield Node.fromJSON(nodeData); })));
@@ -18,7 +18,6 @@ class RPCServices {
18
18
  this.rpcUrls = Object.assign(Object.assign({}, this.rpcUrls), rpcs);
19
19
  }
20
20
  setRPCsFromTMS(env) {
21
- console.log(CHAINS);
22
21
  if (env.MODE_HTTPS_PROVIDER) {
23
22
  this.rpcUrls[CHAINS.MODE] = env.MODE_HTTPS_PROVIDER;
24
23
  }
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "1.5.74";
1
+ export declare const SDK_VERSION = "1.7.75";
2
2
  export declare function compareVersions(v1: string, v2: string): number;
@@ -14,6 +14,7 @@ export declare class Action extends Node {
14
14
  position?: Position;
15
15
  parentInfo?: ParentInfo;
16
16
  state?: NodeState;
17
+ frontendHelpers?: Record<string, any>;
17
18
  });
18
19
  static fromJSON(json: {
19
20
  [key: string]: any;
@@ -29,6 +29,7 @@ export declare abstract class Node {
29
29
  image: string;
30
30
  parentInfo?: ParentInfo;
31
31
  state: NodeState;
32
+ frontendHelpers: Record<string, any>;
32
33
  constructor(node: {
33
34
  blockId: number;
34
35
  name: string;
@@ -43,6 +44,7 @@ export declare abstract class Node {
43
44
  image: string;
44
45
  parentInfo?: ParentInfo;
45
46
  state?: NodeState;
47
+ frontendHelpers?: Record<string, any>;
46
48
  });
47
49
  setId(id: string): void;
48
50
  setChainId(value: number): void;
@@ -16,6 +16,7 @@ export declare class Trigger extends Node {
16
16
  position?: Position;
17
17
  parentInfo?: ParentInfo;
18
18
  state?: NodeState;
19
+ frontendHelpers?: Record<string, any>;
19
20
  });
20
21
  private notAPollingTrigger;
21
22
  setCondition(value: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "1.5.74",
3
+ "version": "1.7.75",
4
4
  "description": "An SDK for building and managing automations on Otomato",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/types/src/index.d.ts",