-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
index.js
70 lines (70 loc) · 2.47 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
import r from "@swc/helpers/src/_async_to_generator.mjs";
import n from "@swc/helpers/src/_ts_generator.mjs";
import t from "@swc/helpers/src/_ts_values.mjs";
Promise.all(assignAll).then(function() {
var e = r(function(r) {
var e, s, i, c, o, u;
return n(this, function(a) {
switch(a.label){
case 0:
for(c in e = function(u) {
var t;
return n(this, function(n) {
switch(n.label){
case 0:
return t = r[u], s += "'".concat(t.id, "', "), [
4,
listOfUser(t.id)
];
case 1:
return n.sent().forEach(function(r) {
insertQuery += 'INSERT INTO "TABLE"("UUID", id, other_ids_here) VALUES (\''.concat(uuidv4(), "', '").concat(t.id, "', now());");
}), [
2
];
}
});
}, s = 'DELETE FROM "TABLE" WHERE "UUID" IN ( ', i = [], r);
o = 0, a.label = 1;
case 1:
if (!(o < i.length)) return [
3,
4
];
return [
5,
t(e(u = i[o]))
];
case 2:
a.label = 3;
case 3:
return o++, [
3,
1
];
case 4:
return [
2
];
}
});
});
return function(r) {
return e.apply(this, arguments);
};
}());
export var listOfUser = function(t) {
var e;
return new Promise((e = r(function(r, e) {
var s;
return n(this, function(n) {
return s = 'Select Distinct id from "TABLE" Where id = \''.concat(t, "' And user_id IS not null"), postgreSQL.query(s, null, function(n, t) {
n ? e(n) : r(t.rows);
}), [
2
];
});
}), function(r, n) {
return e.apply(this, arguments);
}));
};