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.
- package/dist/src/constants/version.js +1 -1
- package/dist/src/models/Action.js +2 -2
- package/dist/src/models/Node.js +3 -1
- package/dist/src/models/Trigger.js +3 -2
- package/dist/src/models/Workflow.js +0 -1
- package/dist/src/services/RpcServices.js +0 -1
- package/dist/types/src/constants/version.d.ts +1 -1
- package/dist/types/src/models/Action.d.ts +1 -0
- package/dist/types/src/models/Node.d.ts +2 -0
- package/dist/types/src/models/Trigger.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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;
|
package/dist/src/models/Node.js
CHANGED
|
@@ -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); })));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.7.75";
|
|
2
2
|
export declare function compareVersions(v1: string, v2: string): number;
|
|
@@ -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;
|