-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebBlocks.js
254 lines (228 loc) · 25.5 KB
/
webBlocks.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
var lastHTTPcode = ""
class WebBlocks {
constructor() {
}
getInfo() {
return {
"id": "WebBlocks",
"name": "Web Blocks",
"menuIconURI": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABqxSURBVHhe7Z29liQ3coU5NPQA69KRobPu+PI4Pg0+iN5gjDX4PjLG53jyaa6O3PXE9WWQVNyuQDM7O6sqEREAAsj7nYPT1TOV+AkELiKQ2VUfviGX4I8//vh3+fHT7beHfJTyl9vLJvxTyi+3l4d8/vDhw3/pa7I4FKDFeCA0rYUlikcCRXFaDArQ5BwIzixCY2EvThSkyaEATcSd6GZlwXnGUbREUZoIClBydqJzZbE5y1aUKEbJoQAl42IpVWuYsiWHApQARjndYHSUDArQ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VAXpR5Wx4n17jBXWYHVyu7SpAcm33ceN9UnqJTsE1L2QB4ABSRjjeKSHCe/T9XszOLtd1EyC5rut48R4paeefXAQ4gzpGT4ojPnRG/J++1wvqqHZ6uaaLAMk1XcaJ/5NS7B7RXg2mOSAXAI4hZYRTArRZFsU7B9V/j6B6Acj7LW1bzl6i7P6ubfm3kaIDyvxSfMhj4CTqLCMcFRRnfXVY/NR/j6BqMeh7azktQPLe6LFtbVbsGFV/LVW2vhof9Cc5QJ0GX/OLD72K/jCps+BDp8qHln0n5V+l/MvLb35OfaAVFpD8+P7222m+Sr2f9PUhDeyL8fxNyo8vv+WYt8/8wDDiAgtFyqgddM//Sfnt9jKEpzu0/n8tdyMg+b8WESZs8ncpGeYJfWDEc4JpP5K1J7qD4eNfv0rBzjYSRD+R84YIAdENPoa2+aLRNvDxpGgzMjqBTf4qZVTEA+Ab8BF+TOpJKEAngUNpSpFFiKLBwi2fhR1+ZoH6UK+8bPHZyKPZCs8nis95eAZkRBfo6POhlryeYUjBOKvPgKSUa8GKdnq1EUXHBgXIyUWECNSOzXrdDFB4gqAABXEBISIUnnAoQMFshAhQjOaniA6g8ARDAWoIo6KpYbTTAQpQBxgVTQOjnc5QgDrDqCgljHYGQQEaBKOi4TDaSQAFKAEUo25QdJJBAUrGTowABcnOVnAARScZFKDkMDqqgoIzGRSgiTiIjsCVRYmCMzkUoMm5WMpGwVkMCtBi3ImSwEzCtBeaAgVnMShAF+GBMO1pKVT3hGUPheYSfPPN/wPG+309cfj1pwAAAABJRU5ErkJggg==",
"docsURI": "https://github.com/kloodi2020/web-blocks-extension/blob/main/README.md",
"blocks": [{
"opcode": "fetch",
"blockType": Scratch.BlockType.REPORTER,
"text": "fetch from url [url]",
"arguments": {
"url": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": "https://jsonplaceholder.typicode.com/todos/1"
}
}
},
{
"opcode": "http",
"blockType": Scratch.BlockType.REPORTER,
"text": "send [method] request to [url] with body [body]",
"arguments": {
"url": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": "https://jsonplaceholder.typicode.com/todos/1"
},
"method": {
"type": Scratch.ArgumentType.STRING,
"menu": "httpMethods"
},
"body": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": ""
}
}
},
{
"opcode": "httpCode",
"blockType": Scratch.BlockType.REPORTER,
"text": "last request http code",
"arguments": {}
},
"---",
{
"opcode": "extract",
"blockType": Scratch.BlockType.REPORTER,
"text": "extract [key] from [json]",
"arguments": {
"key": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": "example"
},
"json": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": '{"example": 15}'
}
}
},
{
"opcode": "makeJson",
"blockType": Scratch.BlockType.REPORTER,
"text": "json with key [key] value [value]",
"arguments": {
"key": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": "example"
},
"value": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": "15"
}
}
},
{
"opcode": "joinJson",
"blockType": Scratch.BlockType.REPORTER,
"text": "merge json [json1] [json2]",
"arguments": {
"json1": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": '{"yourKey": 5}'
},
"json2": {
"type": Scratch.ArgumentType.STRING,
"defaultValue": '{"myKey": 5}'
}
}
}
],
"menus": {
"httpMethods": {
"acceptReporters": true,
"items": ["GET", "POST", "PUT", "DELETE"]
}
}
}
}
fetch({url}) {
var result = ""
try {
result = fetch(url).then(response => response.text()).catch(() => {
result = ""
})
} catch (error) {
result = ""
}
return result
}
extract({key, json}) {
var parsed = JSON.parse(json)
if (key in parsed) {
var out = parsed[key]
var t = typeof(out)
if (t == "string" || t == "number")
return out
if (t == "boolean")
return t ? 1 : 0
return JSON.stringify(out)
}
else {
return ""
}
}
async http({method, url, body}) {
let promise = new Promise((resolve, reject) => {
const request = new XMLHttpRequest()
request.addEventListener("readystatechange", () => {
if (request.readyState === 4) {
if (request.status === 200) {
resolve(request.responseText)
} else {
resolve("")
}
lastHTTPcode = request.status
}
})
request.addEventListener("error", () => {
resolve("error")
})
try {
body = body === "" ? null : JSON.parse(body)
} catch (error) {
body = null
}
request.open(method, url)
request.send(body)
})
let result = "error"
await promise.then((message) => {
result = message
})
return result
}
convertBool(value) {
if (typeof(value) === "boolean") {
return value
}
if (typeof(value) === "string" && (value.toLowerCase() === "true" || value.toLowerCase() === "false")) {
return value.toLowerCase() === "true" ? true : false
}
if (typeof(value) === "number") {
return value > 0
}
return "error"
}
makeJson({key, value}) {
var result = {}
result[key] = value
try {
result = JSON.stringify(result)
if (isNaN(value)) {
if (!(this.convertBool(value) === "error")) {
result = '{"' + key + '":' + this.convertBool(value) + "}"
}
}
} catch (error) {
result = "{}"
}
return result
}
joinJson({json1, json2}) {
var parse1 = {}
try {
parse1 = JSON.parse(json1)
} catch (error) {
var tmpParse2 = {}
try {
tmpParse2 = JSON.parse(json2)
} catch (error) {
tmpParse2 = parse1
}
parse1 = Array.isArray(tmpParse2) ? [] : {}
}
var parse2 = {}
try {
parse2 = JSON.parse(json2)
} catch (error) {
parse2 = Array.isArray(parse1) ? [] : {}
}
if (((!Array.isArray(parse1)) && (Array.isArray(parse2))) || ((Array.isArray(parse1)) && (!Array.isArray(parse2)))) {
return "error"
}
if ((!Array.isArray(parse1)) && (!Array.isArray(parse2))) {
const keys = Object.keys(parse2)
var out = parse1
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
out[key] = parse2[key]
}
return JSON.stringify(out)
} else {
var out = parse1
for (let i = 0; i < parse2.length; i++) {
out.push(parse2[i])
}
return JSON.stringify(out)
}
}
httpCode({}) {
return lastHTTPcode
}
}
Scratch.extensions.register(new WebBlocks())