-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
145 lines (75 loc) · 2.41 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
var fs = require("fs");
const { validateHeaderName } = require("http");
const { fileURLToPath } = require("url");
const { Z_ASCII } = require("zlib");
const {
config: authentication,
befores = [],
afters = [],
} = require("./authentication");
//const near_hidden = require("./triggers/near");
//--DECLARED_VARIABLES--//
const syndicate_action = require("./creates/syndicate")
const syndicate = require("./triggers/syndicate")
const safeTriggers = require("./triggers/safeTriggers")
const nftmint_action = require("./creates/nftmint")
const evmWallet_action = require("./creates/evmWallet")
const evmWallet = require("./triggers/evmWallet")
const erc20_action = require("./creates/erc20")
const erc20 = require("./triggers/erc20")
module.exports = {
// This is just shorthand to reference the installed dependencies you have.
// Zapier will need to know these before we can upload.
version: require("./package.json").version,
platformVersion: require("zapier-platform-core").version,
authentication,
beforeRequest: [...befores],
afterResponse: [...afters],
// If you want your trigger to show up, you better include it here!
triggers: triggers(),
// If you want your searches to show up, you better include it here!
searches: {},
// If you want your creates to show up, you better include it here!
creates: creates(),
resources: {},
};
function creates() {
let creates = {};
//read contents of creates folder, return objects
try {
fs.readdirSync("./creates/").forEach((file) => {
var temp = require(`./creates/${file}`);
//console.log(temp.key);
creates = {
[temp.key]: temp,
...creates,
};
});
} catch (error) {}
//console.log("Creates Object: ", creates);
return creates;
}
function triggers() {
let triggers = {};
//read contents of triggers folder, return objects
try {
fs.readdirSync("./triggers/").forEach((file) => {
var temp = require(`./triggers/${file}`);
console.log(temp);
//console.log(temp.key);
triggers = {
[temp.key]: temp,
...triggers,
};
});
} catch (error) {
console.log("error with trigger: ", error.message);
}
/*triggers = {
[list_driver_triggers.key]: list_driver_triggers,
...triggers
}*/
//console.log("TRIGGER Object: ", triggers);
//console.log("Trigger: ", triggers);
return triggers;
}