NobGit
public imalexnord read

Slot

Calendar-first scheduling powered by Cloudflare Workers and Google Calendar.

Languages

Repository composition by tracked source files.

TypeScript
TypeScript 79% CSS 19% SQL 2% HTML 0%
Create file Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/slot.git
ssh://[email protected]:2222/user/imalexnord/slot.git

Trace

scripts/setup.mjs

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

setup.mjs on main
Author Date Commit Line Code
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
1
import { spawnSync } from 'node:child_process';
Open commit View diff
1 import { spawnSync } from 'node:child_process';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2
import { randomBytes } from 'node:crypto';
Open commit View diff
2 import { randomBytes } from 'node:crypto';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
3
import fs from 'node:fs';
Open commit View diff
3 import fs from 'node:fs';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
4
import path from 'node:path';
Open commit View diff
4 import path from 'node:path';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
5
import { stdin as input, stdout as output } from 'node:process';
Open commit View diff
5 import { stdin as input, stdout as output } from 'node:process';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
6
import { createInterface } from 'node:readline/promises';
Open commit View diff
6 import { createInterface } from 'node:readline/promises';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
7
Open commit View diff
7
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
8
const root = process.cwd();
Open commit View diff
8 const root = process.cwd();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
9
const workerConfigPath = path.join(root, 'wrangler.jsonc');
Open commit View diff
9 const workerConfigPath = path.join(root, 'wrangler.jsonc');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
10
const wranglerCli = path.join(root, 'node_modules', 'wrangler', 'bin', 'wrangler.js');
Open commit View diff
10 const wranglerCli = path.join(root, 'node_modules', 'wrangler', 'bin', 'wrangler.js');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
11
const viteCli = path.join(root, 'node_modules', 'vite', 'bin', 'vite.js');
Open commit View diff
11 const viteCli = path.join(root, 'node_modules', 'vite', 'bin', 'vite.js');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
12
const requiredSecrets = [
Open commit View diff
12 const requiredSecrets = [
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
13
  'APP_URL',
Open commit View diff
13 'APP_URL',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
14
  'ADMIN_EMAIL',
Open commit View diff
14 'ADMIN_EMAIL',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
15
  'GOOGLE_CLIENT_ID',
Open commit View diff
15 'GOOGLE_CLIENT_ID',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
16
  'GOOGLE_CLIENT_SECRET',
Open commit View diff
16 'GOOGLE_CLIENT_SECRET',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
17
  'SESSION_SECRET',
Open commit View diff
17 'SESSION_SECRET',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
18
  'TOKEN_ENCRYPTION_KEY',
Open commit View diff
18 'TOKEN_ENCRYPTION_KEY',
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
19
  'STRIPE_SECRET_KEY',
Open commit View diff
19 'STRIPE_SECRET_KEY',
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
20
  'STRIPE_WEBHOOK_SECRET',
Open commit View diff
20 'STRIPE_WEBHOOK_SECRET',
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
21
];
Open commit View diff
21 ];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
22
Open commit View diff
22
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
23
function fail(message) {
Open commit View diff
23 function fail(message) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
24
  console.error(`\nSetup failed: ${message}`);
Open commit View diff
24 console.error(`\nSetup failed: ${message}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
25
  process.exit(1);
Open commit View diff
25 process.exit(1);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
26
}
Open commit View diff
26 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
27
Open commit View diff
27
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
28
function ensureProjectRoot() {
Open commit View diff
28 function ensureProjectRoot() {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
29
  if (!fs.existsSync(workerConfigPath)) {
Open commit View diff
29 if (!fs.existsSync(workerConfigPath)) {
Alex Nord 3 days ago 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
30
    fail('Run npm run setup from the Slot project root.');
Open commit View diff
30 fail('Run npm run setup from the Slot project root.');
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
31
  }
Open commit View diff
31 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
32
  if (!fs.existsSync(wranglerCli) || !fs.existsSync(viteCli)) {
Open commit View diff
32 if (!fs.existsSync(wranglerCli) || !fs.existsSync(viteCli)) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
33
    fail('Dependencies are missing. Run npm install, then npm run setup again.');
Open commit View diff
33 fail('Dependencies are missing. Run npm install, then npm run setup again.');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
34
  }
Open commit View diff
34 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
35
}
Open commit View diff
35 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
36
Open commit View diff
36
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
37
function runNodeCli(label, scriptPath, args, options = {}) {
Open commit View diff
37 function runNodeCli(label, scriptPath, args, options = {}) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
38
  const { allowFailure = false, capture = false } = options;
Open commit View diff
38 const { allowFailure = false, capture = false } = options;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
39
  const result = spawnSync(process.execPath, [scriptPath, ...args], {
Open commit View diff
39 const result = spawnSync(process.execPath, [scriptPath, ...args], {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
40
    cwd: root,
Open commit View diff
40 cwd: root,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
41
    shell: false,
Open commit View diff
41 shell: false,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
42
    stdio: capture ? ['ignore', 'pipe', 'pipe'] : 'inherit',
Open commit View diff
42 stdio: capture ? ['ignore', 'pipe', 'pipe'] : 'inherit',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
43
    encoding: capture ? 'utf8' : undefined,
Open commit View diff
43 encoding: capture ? 'utf8' : undefined,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
44
    env: { ...process.env, NO_COLOR: process.env.NO_COLOR ?? '1' },
Open commit View diff
44 env: { ...process.env, NO_COLOR: process.env.NO_COLOR ?? '1' },
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
45
  });
Open commit View diff
45 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
46
Open commit View diff
46
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
47
  if (result.error) {
Open commit View diff
47 if (result.error) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
48
    if (allowFailure) return result;
Open commit View diff
48 if (allowFailure) return result;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
49
    throw result.error;
Open commit View diff
49 throw result.error;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
50
  }
Open commit View diff
50 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
51
Open commit View diff
51
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
52
  if ((result.status ?? 1) !== 0 && !allowFailure) {
Open commit View diff
52 if ((result.status ?? 1) !== 0 && !allowFailure) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
53
    process.exit(result.status ?? 1);
Open commit View diff
53 process.exit(result.status ?? 1);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
54
  }
Open commit View diff
54 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
55
Open commit View diff
55
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
56
  return result;
Open commit View diff
56 return result;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
57
}
Open commit View diff
57 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
58
Open commit View diff
58
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
59
function wrangler(args, options) {
Open commit View diff
59 function wrangler(args, options) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
60
  return runNodeCli('wrangler', wranglerCli, args, options);
Open commit View diff
60 return runNodeCli('wrangler', wranglerCli, args, options);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
61
}
Open commit View diff
61 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
62
Open commit View diff
62
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
63
function build() {
Open commit View diff
63 function build() {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
64
  runNodeCli('vite', viteCli, ['build']);
Open commit View diff
64 runNodeCli('vite', viteCli, ['build']);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
65
}
Open commit View diff
65 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
66
Open commit View diff
66
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
67
function parseJsonOutput(result, fallback) {
Open commit View diff
67 function parseJsonOutput(result, fallback) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
68
  const text = `${result.stdout ?? ''}`.trim();
Open commit View diff
68 const text = `${result.stdout ?? ''}`.trim();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
69
  if (!text) return fallback;
Open commit View diff
69 if (!text) return fallback;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
70
  try {
Open commit View diff
70 try {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
71
    return JSON.parse(text);
Open commit View diff
71 return JSON.parse(text);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
72
  } catch {
Open commit View diff
72 } catch {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
73
    return fallback;
Open commit View diff
73 return fallback;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
74
  }
Open commit View diff
74 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
75
}
Open commit View diff
75 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
76
Open commit View diff
76
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
77
function readConfig() {
Open commit View diff
77 function readConfig() {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
78
  return JSON.parse(fs.readFileSync(workerConfigPath, 'utf8'));
Open commit View diff
78 return JSON.parse(fs.readFileSync(workerConfigPath, 'utf8'));
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
79
}
Open commit View diff
79 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
80
Open commit View diff
80
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
81
function writeConfig(config) {
Open commit View diff
81 function writeConfig(config) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
82
  fs.writeFileSync(workerConfigPath, `${JSON.stringify(config, null, 2)}\n`);
Open commit View diff
82 fs.writeFileSync(workerConfigPath, `${JSON.stringify(config, null, 2)}\n`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
83
}
Open commit View diff
83 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
84
Open commit View diff
84
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
85
function dbNameFromConfig(config) {
Open commit View diff
85 function dbNameFromConfig(config) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
86
  return config.d1_databases?.find((db) => db.binding === 'DB')?.database_name ?? `${config.name}-db`;
Open commit View diff
86 return config.d1_databases?.find((db) => db.binding === 'DB')?.database_name ?? `${config.name}-db`;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
87
}
Open commit View diff
87 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
88
Open commit View diff
88
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
89
function updateD1Config(database) {
Open commit View diff
89 function updateD1Config(database) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
90
  const config = readConfig();
Open commit View diff
90 const config = readConfig();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
91
  const databases = Array.isArray(config.d1_databases) ? config.d1_databases : [];
Open commit View diff
91 const databases = Array.isArray(config.d1_databases) ? config.d1_databases : [];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
92
  const index = databases.findIndex((db) => db.binding === 'DB');
Open commit View diff
92 const index = databases.findIndex((db) => db.binding === 'DB');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
93
  const current = index >= 0 ? databases[index] : { binding: 'DB' };
Open commit View diff
93 const current = index >= 0 ? databases[index] : { binding: 'DB' };
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
94
  const next = {
Open commit View diff
94 const next = {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
95
    ...current,
Open commit View diff
95 ...current,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
96
    binding: 'DB',
Open commit View diff
96 binding: 'DB',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
97
    database_name: database.name,
Open commit View diff
97 database_name: database.name,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
98
    database_id: database.uuid,
Open commit View diff
98 database_id: database.uuid,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
99
    migrations_dir: current.migrations_dir ?? 'migrations',
Open commit View diff
99 migrations_dir: current.migrations_dir ?? 'migrations',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
100
  };
Open commit View diff
100 };
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
101
Open commit View diff
101
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
102
  if (index >= 0) databases[index] = next;
Open commit View diff
102 if (index >= 0) databases[index] = next;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
103
  else databases.push(next);
Open commit View diff
103 else databases.push(next);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
104
Open commit View diff
104
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
105
  writeConfig({ ...config, d1_databases: databases });
Open commit View diff
105 writeConfig({ ...config, d1_databases: databases });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
106
}
Open commit View diff
106 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
107
Open commit View diff
107
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
108
function ensureD1Database() {
Open commit View diff
108 function ensureD1Database() {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
109
  const config = readConfig();
Open commit View diff
109 const config = readConfig();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
110
  const configured = config.d1_databases?.find((db) => db.binding === 'DB');
Open commit View diff
110 const configured = config.d1_databases?.find((db) => db.binding === 'DB');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
111
  const databaseName = configured?.database_name ?? dbNameFromConfig(config);
Open commit View diff
111 const databaseName = configured?.database_name ?? dbNameFromConfig(config);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
112
Open commit View diff
112
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
113
  if (configured?.database_id) {
Open commit View diff
113 if (configured?.database_id) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
114
    console.log(`D1 database configured: ${databaseName}`);
Open commit View diff
114 console.log(`D1 database configured: ${databaseName}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
115
    return databaseName;
Open commit View diff
115 return databaseName;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
116
  }
Open commit View diff
116 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
117
Open commit View diff
117
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
118
  const listResult = wrangler(['d1', 'list', '--json'], { capture: true });
Open commit View diff
118 const listResult = wrangler(['d1', 'list', '--json'], { capture: true });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
119
  const databases = parseJsonOutput(listResult, []);
Open commit View diff
119 const databases = parseJsonOutput(listResult, []);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
120
  const existing = Array.isArray(databases)
Open commit View diff
120 const existing = Array.isArray(databases)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
121
    ? databases.find((db) => db.name === databaseName && db.uuid)
Open commit View diff
121 ? databases.find((db) => db.name === databaseName && db.uuid)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
122
    : null;
Open commit View diff
122 : null;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
123
Open commit View diff
123
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
124
  if (existing) {
Open commit View diff
124 if (existing) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
125
    updateD1Config(existing);
Open commit View diff
125 updateD1Config(existing);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
126
    console.log(`Reusing D1 database: ${databaseName}`);
Open commit View diff
126 console.log(`Reusing D1 database: ${databaseName}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
127
    return databaseName;
Open commit View diff
127 return databaseName;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
128
  }
Open commit View diff
128 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
129
Open commit View diff
129
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
130
  console.log(`Creating D1 database: ${databaseName}`);
Open commit View diff
130 console.log(`Creating D1 database: ${databaseName}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
131
  const createResult = wrangler(['d1', 'create', databaseName], { capture: true });
Open commit View diff
131 const createResult = wrangler(['d1', 'create', databaseName], { capture: true });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
132
  const outputText = `${createResult.stdout ?? ''}\n${createResult.stderr ?? ''}`;
Open commit View diff
132 const outputText = `${createResult.stdout ?? ''}\n${createResult.stderr ?? ''}`;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
133
  const id = outputText.match(/database_id\s*=\s*"([^"]+)"/)?.[1]
Open commit View diff
133 const id = outputText.match(/database_id\s*=\s*"([^"]+)"/)?.[1]
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
134
    ?? outputText.match(/"database_id"\s*:\s*"([^"]+)"/)?.[1]
Open commit View diff
134 ?? outputText.match(/"database_id"\s*:\s*"([^"]+)"/)?.[1]
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
135
    ?? outputText.match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i)?.[1];
Open commit View diff
135 ?? outputText.match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i)?.[1];
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
136
Open commit View diff
136
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
137
  if (!id) {
Open commit View diff
137 if (!id) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
138
    console.log(outputText.trim());
Open commit View diff
138 console.log(outputText.trim());
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
139
    fail('Could not read the new D1 database ID from Wrangler output.');
Open commit View diff
139 fail('Could not read the new D1 database ID from Wrangler output.');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
140
  }
Open commit View diff
140 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
141
Open commit View diff
141
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
142
  updateD1Config({ name: databaseName, uuid: id });
Open commit View diff
142 updateD1Config({ name: databaseName, uuid: id });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
143
  return databaseName;
Open commit View diff
143 return databaseName;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
144
}
Open commit View diff
144 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
145
Open commit View diff
145
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
146
function listExistingSecrets() {
Open commit View diff
146 function listExistingSecrets() {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
147
  const result = wrangler(['secret', 'list', '--format', 'json'], {
Open commit View diff
147 const result = wrangler(['secret', 'list', '--format', 'json'], {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
148
    allowFailure: true,
Open commit View diff
148 allowFailure: true,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
149
    capture: true,
Open commit View diff
149 capture: true,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
150
  });
Open commit View diff
150 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
151
  if ((result.status ?? 1) !== 0) return null;
Open commit View diff
151 if ((result.status ?? 1) !== 0) return null;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
152
Open commit View diff
152
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
153
  const parsed = parseJsonOutput(result, []);
Open commit View diff
153 const parsed = parseJsonOutput(result, []);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
154
  if (!Array.isArray(parsed)) return new Set();
Open commit View diff
154 if (!Array.isArray(parsed)) return new Set();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
155
  return new Set(parsed.map((secret) => secret.name).filter(Boolean));
Open commit View diff
155 return new Set(parsed.map((secret) => secret.name).filter(Boolean));
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
156
}
Open commit View diff
156 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
157
Open commit View diff
157
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
158
async function promptForConfiguration() {
Open commit View diff
158 async function promptForConfiguration() {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
159
  const rl = createInterface({ input, output });
Open commit View diff
159 const rl = createInterface({ input, output });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
160
  try {
Open commit View diff
160 try {
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
161
    console.log('\nGoogle + app + Stripe configuration\n');
Open commit View diff
161 console.log('\nGoogle + app + Stripe configuration\n');
Alex Nord 3 days ago 56fdb61

Remove personal domain defaults

Full commit hash
56fdb6196bb38f86706331fa1d085936c70c7ac8
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
162
    const appUrl = (await rl.question('Public URL, for example https://book.example.com: ')).trim().replace(/\/+$/, '');
Open commit View diff
162 const appUrl = (await rl.question('Public URL, for example https://book.example.com: ')).trim().replace(/\/+$/, '');
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
163
    const adminEmail = (await rl.question('Google account allowed to administer this calendar: ')).trim();
Open commit View diff
163 const adminEmail = (await rl.question('Google account allowed to administer this calendar: ')).trim();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
164
    const clientId = (await rl.question('Google OAuth Client ID: ')).trim();
Open commit View diff
164 const clientId = (await rl.question('Google OAuth Client ID: ')).trim();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
165
    const clientSecret = (await rl.question('Google OAuth Client Secret: ')).trim();
Open commit View diff
165 const clientSecret = (await rl.question('Google OAuth Client Secret: ')).trim();
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
166
    console.log('\nStripe configuration');
Open commit View diff
166 console.log('\nStripe configuration');
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
167
    console.log('Use Stripe test-mode values while testing.');
Open commit View diff
167 console.log('Use Stripe test-mode values while testing.');
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
168
    const stripeSecretKey = (await rl.question('Stripe Secret Key (sk_test_... or sk_live_...): ')).trim();
Open commit View diff
168 const stripeSecretKey = (await rl.question('Stripe Secret Key (sk_test_... or sk_live_...): ')).trim();
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
169
    const stripeWebhookSecret = (await rl.question('Stripe Webhook Signing Secret (whsec_...): ')).trim();
Open commit View diff
169 const stripeWebhookSecret = (await rl.question('Stripe Webhook Signing Secret (whsec_...): ')).trim();
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
170
Open commit View diff
170
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
171
    if (!/^https?:\/\//.test(appUrl)) {
Open commit View diff
171 if (!/^https?:\/\//.test(appUrl)) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
172
      throw new Error('Public URL must begin with https:// (or http:// for local development).');
Open commit View diff
172 throw new Error('Public URL must begin with https:// (or http:// for local development).');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
173
    }
Open commit View diff
173 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
174
    if (!adminEmail || !clientId || !clientSecret) {
Open commit View diff
174 if (!adminEmail || !clientId || !clientSecret) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
175
      throw new Error('Admin email and Google OAuth credentials are required.');
Open commit View diff
175 throw new Error('Admin email and Google OAuth credentials are required.');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
176
    }
Open commit View diff
176 }
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
177
    if (!/^sk_(test|live)_/.test(stripeSecretKey)) {
Open commit View diff
177 if (!/^sk_(test|live)_/.test(stripeSecretKey)) {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
178
      throw new Error('Stripe Secret Key must begin with sk_test_ or sk_live_.');
Open commit View diff
178 throw new Error('Stripe Secret Key must begin with sk_test_ or sk_live_.');
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
179
    }
Open commit View diff
179 }
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
180
    if (!/^whsec_/.test(stripeWebhookSecret)) {
Open commit View diff
180 if (!/^whsec_/.test(stripeWebhookSecret)) {
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
181
      throw new Error('Stripe Webhook Signing Secret must begin with whsec_.');
Open commit View diff
181 throw new Error('Stripe Webhook Signing Secret must begin with whsec_.');
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
182
    }
Open commit View diff
182 }
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
183
Open commit View diff
183
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
184
    console.log(`\nGoogle Authorized redirect URI (required):\n  ${appUrl}/auth/google/callback`);
Open commit View diff
184 console.log(`\nGoogle Authorized redirect URI (required):\n ${appUrl}/auth/google/callback`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
185
    console.log(`Google Authorized JavaScript origin (optional here):\n  ${appUrl}\n`);
Open commit View diff
185 console.log(`Google Authorized JavaScript origin (optional here):\n ${appUrl}\n`);
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
186
    return { appUrl, adminEmail, clientId, clientSecret, stripeSecretKey, stripeWebhookSecret };
Open commit View diff
186 return { appUrl, adminEmail, clientId, clientSecret, stripeSecretKey, stripeWebhookSecret };
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
187
  } finally {
Open commit View diff
187 } finally {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
188
    rl.close();
Open commit View diff
188 rl.close();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
189
  }
Open commit View diff
189 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
190
}
Open commit View diff
190 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
191
Open commit View diff
191
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
192
function uploadSecrets(answers, existingSecrets) {
Open commit View diff
192 function uploadSecrets(answers, existingSecrets) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
193
  const secrets = {
Open commit View diff
193 const secrets = {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
194
    APP_URL: answers.appUrl,
Open commit View diff
194 APP_URL: answers.appUrl,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
195
    ADMIN_EMAIL: answers.adminEmail,
Open commit View diff
195 ADMIN_EMAIL: answers.adminEmail,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
196
    GOOGLE_CLIENT_ID: answers.clientId,
Open commit View diff
196 GOOGLE_CLIENT_ID: answers.clientId,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
197
    GOOGLE_CLIENT_SECRET: answers.clientSecret,
Open commit View diff
197 GOOGLE_CLIENT_SECRET: answers.clientSecret,
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
198
    STRIPE_SECRET_KEY: answers.stripeSecretKey,
Open commit View diff
198 STRIPE_SECRET_KEY: answers.stripeSecretKey,
same change 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
199
    STRIPE_WEBHOOK_SECRET: answers.stripeWebhookSecret,
Open commit View diff
199 STRIPE_WEBHOOK_SECRET: answers.stripeWebhookSecret,
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
200
  };
Open commit View diff
200 };
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
201
Open commit View diff
201
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
202
  if (!existingSecrets.has('SESSION_SECRET')) {
Open commit View diff
202 if (!existingSecrets.has('SESSION_SECRET')) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
203
    secrets.SESSION_SECRET = randomBytes(48).toString('base64url');
Open commit View diff
203 secrets.SESSION_SECRET = randomBytes(48).toString('base64url');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
204
  }
Open commit View diff
204 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
205
Open commit View diff
205
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
206
  if (!existingSecrets.has('TOKEN_ENCRYPTION_KEY')) {
Open commit View diff
206 if (!existingSecrets.has('TOKEN_ENCRYPTION_KEY')) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
207
    secrets.TOKEN_ENCRYPTION_KEY = randomBytes(32).toString('base64');
Open commit View diff
207 secrets.TOKEN_ENCRYPTION_KEY = randomBytes(32).toString('base64');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
208
  }
Open commit View diff
208 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
209
Open commit View diff
209
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
210
  const secretFile = path.join(root, `.meet-secrets-${process.pid}.json`);
Open commit View diff
210 const secretFile = path.join(root, `.meet-secrets-${process.pid}.json`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
211
  try {
Open commit View diff
211 try {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
212
    fs.writeFileSync(secretFile, JSON.stringify(secrets), { mode: 0o600 });
Open commit View diff
212 fs.writeFileSync(secretFile, JSON.stringify(secrets), { mode: 0o600 });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
213
    const result = wrangler(['secret', 'bulk', secretFile], { allowFailure: true, capture: true });
Open commit View diff
213 const result = wrangler(['secret', 'bulk', secretFile], { allowFailure: true, capture: true });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
214
    if ((result.status ?? 1) === 0) {
Open commit View diff
214 if ((result.status ?? 1) === 0) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
215
      process.stdout.write(result.stdout ?? '');
Open commit View diff
215 process.stdout.write(result.stdout ?? '');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
216
      process.stderr.write(result.stderr ?? '');
Open commit View diff
216 process.stderr.write(result.stderr ?? '');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
217
      return;
Open commit View diff
217 return;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
218
    }
Open commit View diff
218 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
219
Open commit View diff
219
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
220
    const outputText = `${result.stdout ?? ''}\n${result.stderr ?? ''}`;
Open commit View diff
220 const outputText = `${result.stdout ?? ''}\n${result.stderr ?? ''}`;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
221
    if (!/Worker ".+" not found|run `wrangler deploy` first/i.test(outputText)) {
Open commit View diff
221 if (!/Worker ".+" not found|run `wrangler deploy` first/i.test(outputText)) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
222
      process.stdout.write(result.stdout ?? '');
Open commit View diff
222 process.stdout.write(result.stdout ?? '');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
223
      process.stderr.write(result.stderr ?? '');
Open commit View diff
223 process.stderr.write(result.stderr ?? '');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
224
      process.exit(result.status ?? 1);
Open commit View diff
224 process.exit(result.status ?? 1);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
225
    }
Open commit View diff
225 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
226
Open commit View diff
226
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
227
    console.log('Creating the Worker shell so secrets can be attached...');
Open commit View diff
227 console.log('Creating the Worker shell so secrets can be attached...');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
228
    wrangler(['deploy']);
Open commit View diff
228 wrangler(['deploy']);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
229
    wrangler(['secret', 'bulk', secretFile]);
Open commit View diff
229 wrangler(['secret', 'bulk', secretFile]);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
230
  } finally {
Open commit View diff
230 } finally {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
231
    fs.rmSync(secretFile, { force: true });
Open commit View diff
231 fs.rmSync(secretFile, { force: true });
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
232
  }
Open commit View diff
232 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
233
}
Open commit View diff
233 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
234
Open commit View diff
234
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
235
function assertSecrets(existingSecrets) {
Open commit View diff
235 function assertSecrets(existingSecrets) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
236
  const missing = requiredSecrets.filter((key) => !existingSecrets.has(key));
Open commit View diff
236 const missing = requiredSecrets.filter((key) => !existingSecrets.has(key));
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
237
  if (missing.length) {
Open commit View diff
237 if (missing.length) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
238
    fail(`Missing Worker secrets after upload: ${missing.join(', ')}`);
Open commit View diff
238 fail(`Missing Worker secrets after upload: ${missing.join(', ')}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
239
  }
Open commit View diff
239 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
240
}
Open commit View diff
240 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
241
Open commit View diff
241
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
242
ensureProjectRoot();
Open commit View diff
242 ensureProjectRoot();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
243
Open commit View diff
243
Alex Nord 3 days ago 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
244
console.log('\nSlot setup\n==========');
Open commit View diff
244 console.log('\nSlot setup\n==========');
Alex Nord 1 day ago 9abcc27

Added Stripe payments

Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
245
console.log('Cloudflare + Google Calendar + Stripe. No GitHub Actions, no Pages project, no API token.\n');
Open commit View diff
245 console.log('Cloudflare + Google Calendar + Stripe. No GitHub Actions, no Pages project, no API token.\n');
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
246
Open commit View diff
246
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
247
if ((wrangler(['whoami'], { allowFailure: true, capture: true }).status ?? 1) !== 0) {
Open commit View diff
247 if ((wrangler(['whoami'], { allowFailure: true, capture: true }).status ?? 1) !== 0) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
248
  console.log('Opening Cloudflare login...');
Open commit View diff
248 console.log('Opening Cloudflare login...');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
249
  wrangler(['login']);
Open commit View diff
249 wrangler(['login']);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
250
}
Open commit View diff
250 }
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
251
Open commit View diff
251
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
252
console.log('\n1/6  Building the Worker and static assets...');
Open commit View diff
252 console.log('\n1/6 Building the Worker and static assets...');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
253
build();
Open commit View diff
253 build();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
254
Open commit View diff
254
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
255
console.log('\n2/6  Provisioning or reusing the D1 database...');
Open commit View diff
255 console.log('\n2/6 Provisioning or reusing the D1 database...');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
256
const databaseName = ensureD1Database();
Open commit View diff
256 const databaseName = ensureD1Database();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
257
Open commit View diff
257
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
258
console.log('\n3/6  Preparing Worker secrets...');
Open commit View diff
258 console.log('\n3/6 Preparing Worker secrets...');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
259
const existingSecrets = listExistingSecrets() ?? new Set();
Open commit View diff
259 const existingSecrets = listExistingSecrets() ?? new Set();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
260
const answers = await promptForConfiguration();
Open commit View diff
260 const answers = await promptForConfiguration();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
261
uploadSecrets(answers, existingSecrets);
Open commit View diff
261 uploadSecrets(answers, existingSecrets);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
262
Open commit View diff
262
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
263
console.log('\n4/6  Applying D1 migrations...');
Open commit View diff
263 console.log('\n4/6 Applying D1 migrations...');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
264
wrangler(['d1', 'migrations', 'apply', databaseName, '--remote']);
Open commit View diff
264 wrangler(['d1', 'migrations', 'apply', databaseName, '--remote']);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
265
Open commit View diff
265
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
266
console.log('\n5/6  Verifying Worker secrets...');
Open commit View diff
266 console.log('\n5/6 Verifying Worker secrets...');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
267
assertSecrets(listExistingSecrets() ?? new Set());
Open commit View diff
267 assertSecrets(listExistingSecrets() ?? new Set());
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
268
Open commit View diff
268
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
269
console.log('\n6/6  Deploying the Worker and static assets...');
Open commit View diff
269 console.log('\n6/6 Deploying the Worker and static assets...');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
270
wrangler(['deploy']);
Open commit View diff
270 wrangler(['deploy']);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
271
Open commit View diff
271
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
272
console.log('\nDone.\n');
Open commit View diff
272 console.log('\nDone.\n');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
273
console.log(`Booking page: ${answers.appUrl}`);
Open commit View diff
273 console.log(`Booking page: ${answers.appUrl}`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
274
console.log(`Admin:        ${answers.appUrl}/admin`);
Open commit View diff
274 console.log(`Admin: ${answers.appUrl}/admin`);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
275
console.log(`OAuth route:  ${answers.appUrl}/auth/google/callback`);
Open commit View diff
275 console.log(`OAuth route: ${answers.appUrl}/auth/google/callback`);
Alex Nord 3 days ago 56fdb61

Remove personal domain defaults

Full commit hash
56fdb6196bb38f86706331fa1d085936c70c7ac8
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
276
console.log('\nAttach a custom domain in Cloudflare Workers & Pages -> your Worker -> Settings -> Domains & Routes if you have not already done so.');
Open commit View diff
276 console.log('\nAttach a custom domain in Cloudflare Workers & Pages -> your Worker -> Settings -> Domains & Routes if you have not already done so.');
Alex Nord 3 days ago 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
277
console.log('Then open /admin and connect the configured Google account.\n');
Open commit View diff
277 console.log('Then open /admin and connect the configured Google account.\n');