@aw-webflow/workflow-automation 1.0.8 → 1.0.10
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/package.json +1 -1
- package/script.js +28 -7
package/package.json
CHANGED
package/script.js
CHANGED
|
@@ -273,20 +273,41 @@
|
|
|
273
273
|
}
|
|
274
274
|
var STEPS_SKILLS = [[700, function (c) { c.tgs[0]._set(true); }], [1500, function (c) { c.tgs[1]._set(true); }], [2300, function (c) { c.tgs[2]._set(true); }]];
|
|
275
275
|
|
|
276
|
-
var
|
|
276
|
+
var CODE2 = [['c', '/*'], '\n', ['c', ' *@title: Auto-close resolved tickets'], '\n', ['c', ' */'], '\n', ['k', 'export default async '], ['', 'function main(input) {'], '\n', ['', ' const requestId = input.trigger_context.id;'], '\n', ['c', ' /* @title: Close the resolved request */'], '\n', ['k', ' await '], ['v', 'MCP'], ['', '.Atomicwork.update\u2026'], '\n', ['', '}']];
|
|
277
|
+
var C2COL = { k: '#9D4EDD', c: '#2E8B3E', s: '#C2410C', v: '#2563EB' };
|
|
278
|
+
function code2HTML(upto) {
|
|
279
|
+
var num = function (n) { return '<span style="display:inline-block;width:22px;color:#B3B0BB">' + n + '</span>'; };
|
|
280
|
+
var out = num(1), line = 1, count = 0;
|
|
281
|
+
for (var i = 0; i < CODE2.length; i++) {
|
|
282
|
+
var t = CODE2[i];
|
|
283
|
+
if (t === '\n') { line++; out += '\n' + num(line); continue; }
|
|
284
|
+
if (count++ >= upto) break;
|
|
285
|
+
out += t[0] ? '<span style="color:' + C2COL[t[0]] + '">' + esc(t[1]) + '</span>' : esc(t[1]);
|
|
286
|
+
}
|
|
287
|
+
return out;
|
|
288
|
+
}
|
|
289
|
+
var FILE_SVG = '<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m10 13-2 2 2 2M14 17l2-2-2-2"/></svg>';
|
|
277
290
|
function buildMini(stage) {
|
|
291
|
+
var logoUrl = AWC_CSS.match(/\.routine \.bar \.mk\{[^}]*?url\((data:image[^)]+)\)/)[1];
|
|
278
292
|
var names = ['Auto-close resolved tickets', 'Check app seats', 'Pull app info via API', 'Revoke app access', 'Rotate API keys'], rows = [];
|
|
279
293
|
for (var i = 0; i < names.length; i++) {
|
|
280
|
-
rows.push(E('div', 'display:flex;align-items:center;gap:
|
|
281
|
-
'<span style="
|
|
294
|
+
rows.push(E('div', 'display:flex;align-items:center;gap:10px;padding:10px 12px;position:relative;border-bottom:1px solid rgba(0,0,0,.05);background:' + (i === 0 ? '#F7F4FD' : '#fff'),
|
|
295
|
+
(i === 0 ? '<span style="position:absolute;left:0;top:0;bottom:0;width:3px;background:#7C3AED"></span>' : '') +
|
|
296
|
+
'<span style="flex:none;width:24px;height:24px;border-radius:7px;background:#E9EEF8;color:#325EE0;display:inline-flex;align-items:center;justify-content:center">' + FILE_SVG + '</span><b style="font:500 12px Inter,sans-serif;color:' + INK + ';white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0">' + names[i] + '</b>'));
|
|
282
297
|
}
|
|
283
|
-
var code =
|
|
284
|
-
var right = E('div', 'padding:10px 12px;min-width:0', [E('div', 'font:600 11px
|
|
285
|
-
var
|
|
298
|
+
var code = E('pre', 'margin:0;white-space:pre;overflow:hidden;font:400 9.5px/1.75 ' + MONO + ';color:#0A0A0B;min-height:130px');
|
|
299
|
+
var right = E('div', 'padding:10px 12px;min-width:0;border-left:1px solid rgba(0,0,0,.06)', [E('div', 'font:600 11px Inter,sans-serif;margin-bottom:6px;color:' + INK, 'auto-close-resolved-tickets.ts'), code]);
|
|
300
|
+
var bar = E('div', 'display:flex;align-items:center;gap:10px;height:44px;padding:0 16px;border-bottom:1px solid rgba(0,0,0,.06);font:500 11px Inter,sans-serif;letter-spacing:.4px;text-transform:uppercase;color:#3F3F46;flex:none',
|
|
301
|
+
'<span style="width:16px;height:16px;flex:none;display:inline-block;background:url(' + logoUrl + ') center/contain no-repeat"></span>Atomicwork<span style="flex:1"></span>Code library');
|
|
302
|
+
var w = E('div', 'background:#fff;border:.7px solid #E3DFE7;border-radius:12px;box-shadow:0 3.7px 11px rgba(31,21,40,.05),0 -1px 24px rgba(0,0,0,.08);overflow:hidden;display:flex;flex-direction:column;margin:16px', [bar, E('div', 'display:grid;grid-template-columns:46% 54%', [E('div', 'background:#fff;min-width:0', rows), right])]);
|
|
286
303
|
stage.appendChild(w);
|
|
287
304
|
return { root: w, code: code };
|
|
288
305
|
}
|
|
289
|
-
var STEPS_MINI =
|
|
306
|
+
var STEPS_MINI = (function () {
|
|
307
|
+
var s = [], n = 0; for (var i = 0; i < CODE2.length; i++) if (CODE2[i] !== '\n') n++;
|
|
308
|
+
for (var k = 1; k <= 3; k++) (function (j) { s.push([650 * j, function (c) { c.code.innerHTML = code2HTML(Math.round(n * j / 3)); }]); })(k);
|
|
309
|
+
return s;
|
|
310
|
+
})();
|
|
290
311
|
|
|
291
312
|
var CODE_DARK = '// Pull seats, then reclaim anything unused for 30 days\nconst seats = await http.get("https://api.vendor.com/seats");\nconst idle = seats.filter(function (s) { return daysSince(s.lastActive) > 30; });\nfor (const s of idle) {\n await http.delete("/seats/" + s.id);\n}\nreturn { reclaimed: idle.length };';
|
|
292
313
|
function buildDark(stage) {
|