INNER CODE UNIT · JavaScript

req

bostrot/wsl2-distro-manager · n8n/licensing/seat_check_test.js:27

function req(query, headers) {
  return {
    query: Object.assign({ license: 'WSLM-AAAAA-BBBBB-CCCCC-DDDDD' }, query),
    headers: Object.assign({ 'user-agent': 'Dart/3.9 (dart:io)', 'x-forwarded-for': '203.0.113.5' }, headers),
    now: NOW,
  };
}

// Runs a sequence of requests against one row, threading the devices column
// through like the workflow does. Each step is [daysBeforeNow, query, headers].
function replay(startRow, steps) {
  let devices = startRow.devices;
  const out = [];
  for (const [days, query, headers] of steps) {
    const r = decide(Object.assign(req(query, headers), {
      row: row(Object.assign({}, startRow, { devices })),
      now: new Date(NOW.getTime() - days * 86400000),
    }));

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…