@aw-webflow/workflow-automation 1.0.8 → 1.0.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/script.js +24 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aw-webflow/workflow-automation",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "start": "parcel script.js",
package/script.js CHANGED
@@ -273,20 +273,37 @@
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 CODE_MINI = 'export async function run(ctx) {\n const list = await ctx.tickets.find({ status: "Resolved" });\n for (const t of list) {\n if (daysSince(t.resolvedAt) >= 3) {\n await ctx.tickets.close(t.id);\n }\n }\n}';
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
+ }
277
289
  function buildMini(stage) {
278
290
  var names = ['Auto-close resolved tickets', 'Check app seats', 'Pull app info via API', 'Revoke app access', 'Rotate API keys'], rows = [];
279
291
  for (var i = 0; i < names.length; i++) {
280
- rows.push(E('div', 'display:flex;align-items:center;gap:8px;padding:8px 10px;font-size:12px;color:' + INK + ';background:' + (i === 0 ? '#F4F4F5' : 'transparent'),
281
- '<span style="font:600 9px ' + MONO + ';background:#DCE8FD;color:#2F5BD0;border-radius:4px;padding:2px 4px">TS</span><b style="font-weight:500">' + names[i] + '</b>'));
292
+ 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'),
293
+ (i === 0 ? '<span style="position:absolute;left:0;top:0;bottom:0;width:3px;background:#7C3AED"></span>' : '') +
294
+ '<span style="flex:none;font:600 9.5px ' + MONO + ';background:#E9EEF8;color:#325EE0;border-radius:4px;padding:3px 5px">TS</span><b style="font:500 12px Inter,sans-serif;color:' + INK + '">' + names[i] + '</b>'));
282
295
  }
283
- var code = codeBox(false, 10, 130);
284
- var right = E('div', 'padding:10px 12px;min-width:0', [E('div', 'font:600 11px ' + MONO + ';margin-bottom:6px;color:' + INK, 'auto-close-resolved-tickets.ts'), code]);
285
- var w = win('Atomicwork', 'Code library', E('div', 'display:grid;grid-template-columns:1fr 1.2fr', [E('div', 'border-right:1px solid ' + LINE, rows), right]), 'margin:16px');
296
+ var code = E('pre', 'margin:0;white-space:pre;overflow:hidden;font:400 9.5px/1.75 ' + MONO + ';color:#0A0A0B;min-height:130px');
297
+ 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]);
298
+ var w = win('Atomicwork', 'Code library', E('div', 'display:grid;grid-template-columns:1.15fr 1fr', [E('div', 'background:#fff', rows), right]), 'margin:16px');
286
299
  stage.appendChild(w);
287
300
  return { root: w, code: code };
288
301
  }
289
- var STEPS_MINI = [[600, function (c, i) { typeTo(c, c.code, CODE_MINI, i, 3, 16); }]];
302
+ var STEPS_MINI = (function () {
303
+ var s = [], n = 0; for (var i = 0; i < CODE2.length; i++) if (CODE2[i] !== '\n') n++;
304
+ 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);
305
+ return s;
306
+ })();
290
307
 
291
308
  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
309
  function buildDark(stage) {