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

worker/google.ts

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

google.ts 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 { decryptToken, encryptToken } from './crypto';
Open commit View diff
1 import { decryptToken, encryptToken } from './crypto';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
2
import type { AppSettings, Env, MeetingMode } from './types';
Open commit View diff
2 import type { AppSettings, Env, MeetingMode } from './types';
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
8
  'https://www.googleapis.com/auth/calendar.events',
Open commit View diff
8 'https://www.googleapis.com/auth/calendar.events',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
9
  'https://www.googleapis.com/auth/calendar.events.freebusy',
Open commit View diff
9 'https://www.googleapis.com/auth/calendar.events.freebusy',
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
20
}
Open commit View diff
20 }
same change 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
interface GoogleUser {
Open commit View diff
22 interface GoogleUser {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
25
  picture?: string;
Open commit View diff
25 picture?: string;
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
interface GoogleEventResponse {
Open commit View diff
28 interface GoogleEventResponse {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
33
    entryPoints?: Array<{ entryPointType: string; uri: string }>;
Open commit View diff
33 entryPoints?: Array<{ entryPointType: string; uri: string }>;
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
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
37
export class GoogleCalendarError extends Error {
Open commit View diff
37 export class GoogleCalendarError extends Error {
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
38
  public readonly publicMessage: string;
Open commit View diff
38 public readonly publicMessage: string;
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
39
  public readonly status: number;
Open commit View diff
39 public readonly status: number;
same change 7bda237

Brand app as Slot and sanitize calendar errors

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

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
41
  constructor(operation: string, status: number, details: string) {
Open commit View diff
41 constructor(operation: string, status: number, details: string) {
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
42
    super(`${operation} failed (${status})`);
Open commit View diff
42 super(`${operation} failed (${status})`);
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
43
    this.name = 'GoogleCalendarError';
Open commit View diff
43 this.name = 'GoogleCalendarError';
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
44
    this.status = status;
Open commit View diff
44 this.status = status;
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
45
    this.publicMessage = status === 403
Open commit View diff
45 this.publicMessage = status === 403
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
46
      ? 'Calendar setup needs attention. The owner needs to enable the Google Calendar API, then reconnect Google Calendar.'
Open commit View diff
46 ? 'Calendar setup needs attention. The owner needs to enable the Google Calendar API, then reconnect Google Calendar.'
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
47
      : 'Calendar setup needs attention. The owner needs to reconnect Google Calendar or check the calendar settings.';
Open commit View diff
47 : 'Calendar setup needs attention. The owner needs to reconnect Google Calendar or check the calendar settings.';
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
48
    console.warn(`${operation} failed (${status}): ${details.slice(0, 1000)}`);
Open commit View diff
48 console.warn(`${operation} failed (${status}): ${details.slice(0, 1000)}`);
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
49
  }
Open commit View diff
49 }
same change 7bda237

Brand app as Slot and sanitize calendar errors

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

Brand app as Slot and sanitize calendar errors

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

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
52
async function throwGoogleCalendarError(response: Response, operation: string): Promise<never> {
Open commit View diff
52 async function throwGoogleCalendarError(response: Response, operation: string): Promise<never> {
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
53
  const details = await response.text().catch(() => '');
Open commit View diff
53 const details = await response.text().catch(() => '');
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
54
  throw new GoogleCalendarError(operation, response.status, details);
Open commit View diff
54 throw new GoogleCalendarError(operation, response.status, details);
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
55
}
Open commit View diff
55 }
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
56
Open commit View diff
56
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
57
function redirectUri(env: Env): string {
Open commit View diff
57 function redirectUri(env: Env): string {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
58
  return `${env.APP_URL.replace(/\/$/, '')}/auth/google/callback`;
Open commit View diff
58 return `${env.APP_URL.replace(/\/$/, '')}/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
59
}
Open commit View diff
59 }
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
61
export async function hasGoogleConnection(env: Env): Promise<boolean> {
Open commit View diff
61 export async function hasGoogleConnection(env: Env): Promise<boolean> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
62
  const row = await env.DB.prepare('SELECT 1 AS ok FROM oauth_tokens WHERE provider = ?1')
Open commit View diff
62 const row = await env.DB.prepare('SELECT 1 AS ok FROM oauth_tokens WHERE provider = ?1')
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
64
    .first<{ ok: number }>();
Open commit View diff
64 .first<{ ok: number }>();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
65
  return Boolean(row?.ok);
Open commit View diff
65 return Boolean(row?.ok);
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
Open commit View diff
67
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
68
export async function createGoogleAuthUrl(env: Env, forceConsent = false): Promise<string> {
Open commit View diff
68 export async function createGoogleAuthUrl(env: Env, forceConsent = false): Promise<string> {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
70
  const expires = Date.now() + 10 * 60_000;
Open commit View diff
70 const expires = Date.now() + 10 * 60_000;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
71
  await env.DB.prepare('INSERT INTO oauth_states (state, expires_at) VALUES (?1, ?2)')
Open commit View diff
71 await env.DB.prepare('INSERT INTO oauth_states (state, expires_at) VALUES (?1, ?2)')
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
72
    .bind(state, expires)
Open commit View diff
72 .bind(state, expires)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
73
    .run();
Open commit View diff
73 .run();
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
  const connected = await hasGoogleConnection(env);
Open commit View diff
75 const connected = await hasGoogleConnection(env);
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
77
    client_id: env.GOOGLE_CLIENT_ID,
Open commit View diff
77 client_id: env.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
78
    redirect_uri: redirectUri(env),
Open commit View diff
78 redirect_uri: redirectUri(env),
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
80
    scope: GOOGLE_SCOPES.join(' '),
Open commit View diff
80 scope: GOOGLE_SCOPES.join(' '),
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
83
    state,
Open commit View diff
83 state,
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
Open commit View diff
85
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
86
  params.set('prompt', forceConsent || !connected ? 'consent' : 'select_account');
Open commit View diff
86 params.set('prompt', forceConsent || !connected ? 'consent' : 'select_account');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
87
  if (env.ADMIN_EMAIL) params.set('login_hint', env.ADMIN_EMAIL);
Open commit View diff
87 if (env.ADMIN_EMAIL) params.set('login_hint', env.ADMIN_EMAIL);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
88
  return `https://accounts.google.com/o/oauth2/v2/auth?${params.toString()}`;
Open commit View diff
88 return `https://accounts.google.com/o/oauth2/v2/auth?${params.toString()}`;
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
91
async function exchangeCode(env: Env, code: string): Promise<TokenResponse> {
Open commit View diff
91 async function exchangeCode(env: Env, code: string): Promise<TokenResponse> {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
94
    client_id: env.GOOGLE_CLIENT_ID,
Open commit View diff
94 client_id: env.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
95
    client_secret: env.GOOGLE_CLIENT_SECRET,
Open commit View diff
95 client_secret: env.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
96
    redirect_uri: redirectUri(env),
Open commit View diff
96 redirect_uri: redirectUri(env),
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
100
  const response = await fetch('https://oauth2.googleapis.com/token', {
Open commit View diff
100 const response = await fetch('https://oauth2.googleapis.com/token', {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
102
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
Open commit View diff
102 headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
103
    body,
Open commit View diff
103 body,
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
  const data = (await response.json()) as TokenResponse;
Open commit View diff
105 const data = (await response.json()) as TokenResponse;
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
107
    throw new Error(data.error_description || data.error || `Google token exchange failed (${response.status})`);
Open commit View diff
107 throw new Error(data.error_description || data.error || `Google token exchange failed (${response.status})`);
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
112
async function fetchGoogleUser(accessToken: string): Promise<GoogleUser> {
Open commit View diff
112 async function fetchGoogleUser(accessToken: string): Promise<GoogleUser> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
113
  const response = await fetch('https://www.googleapis.com/oauth2/v2/userinfo', {
Open commit View diff
113 const response = await fetch('https://www.googleapis.com/oauth2/v2/userinfo', {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
114
    headers: { Authorization: `Bearer ${accessToken}` },
Open commit View diff
114 headers: { Authorization: `Bearer ${accessToken}` },
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
116
  if (!response.ok) throw new Error('Could not read Google account identity');
Open commit View diff
116 if (!response.ok) throw new Error('Could not read Google account identity');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
117
  return (await response.json()) as GoogleUser;
Open commit View diff
117 return (await response.json()) as GoogleUser;
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
125
  const stateRow = await env.DB.prepare('SELECT expires_at FROM oauth_states WHERE state = ?1')
Open commit View diff
125 const stateRow = await env.DB.prepare('SELECT expires_at FROM oauth_states WHERE state = ?1')
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
127
    .first<{ expires_at: number }>();
Open commit View diff
127 .first<{ expires_at: number }>();
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
  await env.DB.prepare('DELETE FROM oauth_states WHERE state = ?1').bind(state).run();
Open commit View diff
129 await env.DB.prepare('DELETE FROM oauth_states WHERE state = ?1').bind(state).run();
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
130
  if (!stateRow || stateRow.expires_at < Date.now()) throw new Error('OAuth state expired or invalid');
Open commit View diff
130 if (!stateRow || stateRow.expires_at < Date.now()) throw new Error('OAuth state expired or invalid');
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
132
  const token = await exchangeCode(env, code);
Open commit View diff
132 const token = await exchangeCode(env, code);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
133
  const user = await fetchGoogleUser(token.access_token);
Open commit View diff
133 const user = await fetchGoogleUser(token.access_token);
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
135
  if (user.email.toLowerCase() !== env.ADMIN_EMAIL.toLowerCase()) {
Open commit View diff
135 if (user.email.toLowerCase() !== env.ADMIN_EMAIL.toLowerCase()) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
136
    throw new Error(`This Google account is not the configured admin (${env.ADMIN_EMAIL})`);
Open commit View diff
136 throw new Error(`This Google account is not the configured admin (${env.ADMIN_EMAIL})`);
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
140
    const encrypted = await encryptToken(env, token.refresh_token);
Open commit View diff
140 const encrypted = await encryptToken(env, token.refresh_token);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
141
    await env.DB.prepare(`
Open commit View diff
141 await env.DB.prepare(`
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
142
      INSERT INTO oauth_tokens (provider, refresh_token_enc, account_email, updated_at)
Open commit View diff
142 INSERT INTO oauth_tokens (provider, refresh_token_enc, account_email, updated_at)
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
143
      VALUES ('google', ?1, ?2, datetime('now'))
Open commit View diff
143 VALUES ('google', ?1, ?2, datetime('now'))
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
144
      ON CONFLICT(provider) DO UPDATE SET
Open commit View diff
144 ON CONFLICT(provider) DO UPDATE SET
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
148
    `).bind(encrypted, user.email).run();
Open commit View diff
148 `).bind(encrypted, user.email).run();
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
152
      throw new Error('Google did not return a refresh token. Revoke app access and connect again.');
Open commit View diff
152 throw new Error('Google did not return a refresh token. Revoke app access and connect again.');
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
156
  return user.email;
Open commit View diff
156 return user.email;
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
Open commit View diff
158
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
159
async function accessToken(env: Env): Promise<string> {
Open commit View diff
159 async function accessToken(env: Env): Promise<string> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
160
  const row = await env.DB.prepare(
Open commit View diff
160 const row = await env.DB.prepare(
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
161
    'SELECT refresh_token_enc FROM oauth_tokens WHERE provider = ?1',
Open commit View diff
161 'SELECT refresh_token_enc FROM oauth_tokens WHERE provider = ?1',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
162
  ).bind('google').first<{ refresh_token_enc: string }>();
Open commit View diff
162 ).bind('google').first<{ refresh_token_enc: string }>();
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
164
  if (!row?.refresh_token_enc) throw new Error('Google Calendar is not connected');
Open commit View diff
164 if (!row?.refresh_token_enc) throw new Error('Google Calendar is not connected');
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
165
  const refreshToken = await decryptToken(env, row.refresh_token_enc);
Open commit View diff
165 const refreshToken = await decryptToken(env, row.refresh_token_enc);
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
167
  const response = await fetch('https://oauth2.googleapis.com/token', {
Open commit View diff
167 const response = await fetch('https://oauth2.googleapis.com/token', {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
169
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
Open commit View diff
169 headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
171
      client_id: env.GOOGLE_CLIENT_ID,
Open commit View diff
171 client_id: env.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
172
      client_secret: env.GOOGLE_CLIENT_SECRET,
Open commit View diff
172 client_secret: env.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
173
      refresh_token: refreshToken,
Open commit View diff
173 refresh_token: refreshToken,
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
175
    }),
Open commit View diff
175 }),
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 });
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
178
  const data = (await response.json()) as TokenResponse;
Open commit View diff
178 const data = (await response.json()) as TokenResponse;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
179
  if (!response.ok || !data.access_token) {
Open commit View diff
179 if (!response.ok || !data.access_token) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
180
    throw new Error(data.error_description || data.error || 'Google refresh token failed');
Open commit View diff
180 throw new Error(data.error_description || data.error || 'Google refresh token failed');
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
182
  return data.access_token;
Open commit View diff
182 return data.access_token;
same change 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
Open commit View diff
184
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
190
): Promise<Array<{ start: string; end: string }>> {
Open commit View diff
190 ): Promise<Array<{ start: string; end: string }>> {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
192
  const calendars = settings.busyCalendarIds.length ? settings.busyCalendarIds : [settings.calendarId];
Open commit View diff
192 const calendars = settings.busyCalendarIds.length ? settings.busyCalendarIds : [settings.calendarId];
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
194
  const response = await fetch('https://www.googleapis.com/calendar/v3/freeBusy', {
Open commit View diff
194 const response = await fetch('https://www.googleapis.com/calendar/v3/freeBusy', {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
197
      Authorization: `Bearer ${token}`,
Open commit View diff
197 Authorization: `Bearer ${token}`,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
198
      'Content-Type': 'application/json',
Open commit View diff
198 'Content-Type': 'application/json',
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
200
    body: JSON.stringify({
Open commit View diff
200 body: JSON.stringify({
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
204
      items: calendars.map((id) => ({ id })),
Open commit View diff
204 items: calendars.map((id) => ({ id })),
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
  });
Open commit View diff
206 });
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
208
  if (!response.ok) {
Open commit View diff
208 if (!response.ok) {
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
209
    await throwGoogleCalendarError(response, 'Google FreeBusy');
Open commit View diff
209 await throwGoogleCalendarError(response, 'Google FreeBusy');
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
210
  }
Open commit View diff
210 }
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
212
  const data = (await response.json()) as {
Open commit View diff
212 const data = (await response.json()) as {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
213
    calendars?: Record<string, { busy?: Array<{ start: string; end: string }> }>;
Open commit View diff
213 calendars?: Record<string, { busy?: Array<{ start: string; end: string }> }>;
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
216
  return Object.values(data.calendars ?? {}).flatMap((calendar) => calendar.busy ?? []);
Open commit View diff
216 return Object.values(data.calendars ?? {}).flatMap((calendar) => calendar.busy ?? []);
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
217
}
Open commit View diff
217 }
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
export async function createCalendarEvent(
Open commit View diff
219 export async function createCalendarEvent(
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
223
    id: string;
Open commit View diff
223 id: string;
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
224
    publicBookingId: string;
Open commit View diff
224 publicBookingId: string;
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
225
    name: string;
Open commit View diff
225 name: string;
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
231
    meetingMode: MeetingMode;
Open commit View diff
231 meetingMode: MeetingMode;
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
): Promise<{ eventId: string; meetUrl: string | null; htmlLink: string | null }> {
Open commit View diff
233 ): Promise<{ eventId: string; meetUrl: string | null; htmlLink: string | null }> {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
239
  const calendarId = encodeURIComponent(settings.calendarId || 'primary');
Open commit View diff
239 const calendarId = encodeURIComponent(settings.calendarId || 'primary');
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
  const descriptionLines = [
Open commit View diff
241 const descriptionLines = [
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
242
    `Booked through ${env.APP_URL}`,
Open commit View diff
242 `Booked through ${env.APP_URL}`,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
243
    `Booking ID: ${booking.publicBookingId}`,
Open commit View diff
243 `Booking ID: ${booking.publicBookingId}`,
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
244
    booking.phone ? `Phone: ${booking.phone}` : '',
Open commit View diff
244 booking.phone ? `Phone: ${booking.phone}` : '',
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
245
    booking.message ? `Message: ${booking.message}` : '',
Open commit View diff
245 booking.message ? `Message: ${booking.message}` : '',
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
248
  const event: Record<string, unknown> = {
Open commit View diff
248 const event: Record<string, unknown> = {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
249
    summary: `Meeting with ${booking.name}`,
Open commit View diff
249 summary: `Meeting with ${booking.name}`,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
250
    description: descriptionLines.join('\n\n'),
Open commit View diff
250 description: descriptionLines.join('\n\n'),
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
251
    start: { dateTime: booking.start, timeZone: settings.timezone },
Open commit View diff
251 start: { dateTime: booking.start, timeZone: settings.timezone },
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
252
    end: { dateTime: booking.end, timeZone: settings.timezone },
Open commit View diff
252 end: { dateTime: booking.end, timeZone: settings.timezone },
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
253
    attendees: [{ email: booking.email, displayName: booking.name }],
Open commit View diff
253 attendees: [{ email: booking.email, displayName: booking.name }],
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
Open commit View diff
255
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
256
  if (booking.meetingMode === 'google_meet') {
Open commit View diff
256 if (booking.meetingMode === 'google_meet') {
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
260
        conferenceSolutionKey: { type: 'hangoutsMeet' },
Open commit View diff
260 conferenceSolutionKey: { type: 'hangoutsMeet' },
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
261
      },
Open commit View diff
261 },
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
  } else if (booking.meetingMode === 'in_person' && settings.inPersonLocation) {
Open commit View diff
263 } else if (booking.meetingMode === 'in_person' && settings.inPersonLocation) {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
264
    event.location = settings.inPersonLocation;
Open commit View diff
264 event.location = settings.inPersonLocation;
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
265
  } else if (booking.meetingMode === 'phone') {
Open commit View diff
265 } else if (booking.meetingMode === 'phone') {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
266
    event.location = 'Phone call';
Open commit View diff
266 event.location = 'Phone call';
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
267
  }
Open commit View diff
267 }
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
  const response = await fetch(
Open commit View diff
269 const response = await fetch(
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
270
    `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events?${params.toString()}`,
Open commit View diff
270 `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events?${params.toString()}`,
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
      method: 'POST',
Open commit View diff
272 method: 'POST',
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
274
        Authorization: `Bearer ${token}`,
Open commit View diff
274 Authorization: `Bearer ${token}`,
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
275
        'Content-Type': 'application/json',
Open commit View diff
275 'Content-Type': 'application/json',
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
277
      body: JSON.stringify(event),
Open commit View diff
277 body: JSON.stringify(event),
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
280
Open commit View diff
280
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
281
  if (!response.ok) {
Open commit View diff
281 if (!response.ok) {
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
282
    await throwGoogleCalendarError(response, 'Google event creation');
Open commit View diff
282 await throwGoogleCalendarError(response, 'Google event creation');
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
283
  }
Open commit View diff
283 }
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
284
Open commit View diff
284
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
285
  const data = (await response.json()) as GoogleEventResponse & { error?: { message?: string } };
Open commit View diff
285 const data = (await response.json()) as GoogleEventResponse & { error?: { message?: string } };
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
286
  if (!data.id) {
Open commit View diff
286 if (!data.id) {
same change 7bda237

Brand app as Slot and sanitize calendar errors

Full commit hash
7bda2375c94992d8bd86dc0ea0b320d0f23dfa86
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
287
    throw new GoogleCalendarError('Google event creation', 502, data.error?.message ?? 'Missing event id');
Open commit View diff
287 throw new GoogleCalendarError('Google event creation', 502, data.error?.message ?? 'Missing event id');
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
288
  }
Open commit View diff
288 }
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
292
    data.conferenceData?.entryPoints?.find((entry) => entry.entryPointType === 'video')?.uri ??
Open commit View diff
292 data.conferenceData?.entryPoints?.find((entry) => entry.entryPointType === 'video')?.uri ??
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
295
  return { eventId: data.id, meetUrl, htmlLink: data.htmlLink ?? null };
Open commit View diff
295 return { eventId: data.id, meetUrl, htmlLink: data.htmlLink ?? null };
same change 45c38c3

Prepare Slot booking worker

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

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
297
Open commit View diff
297
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
298
Open commit View diff
298
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
299
export async function createCalendarHold(
Open commit View diff
299 export async function createCalendarHold(
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
300
  env: Env,
Open commit View diff
300 env: Env,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
301
  settings: AppSettings,
Open commit View diff
301 settings: AppSettings,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
302
  booking: {
Open commit View diff
302 booking: {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
303
    id: string;
Open commit View diff
303 id: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
304
    start: string;
Open commit View diff
304 start: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
305
    end: string;
Open commit View diff
305 end: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
306
    meetingMode: MeetingMode;
Open commit View diff
306 meetingMode: MeetingMode;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
307
  },
Open commit View diff
307 },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
308
): Promise<{ eventId: string; meetUrl: string | null }> {
Open commit View diff
308 ): Promise<{ eventId: string; meetUrl: string | null }> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
309
  const token = await accessToken(env);
Open commit View diff
309 const token = await accessToken(env);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
310
  const params = new URLSearchParams({
Open commit View diff
310 const params = new URLSearchParams({
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
311
    sendUpdates: 'none',
Open commit View diff
311 sendUpdates: 'none',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
312
    conferenceDataVersion: '1',
Open commit View diff
312 conferenceDataVersion: '1',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
313
  });
Open commit View diff
313 });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
314
  const calendarId = encodeURIComponent(settings.calendarId || 'primary');
Open commit View diff
314 const calendarId = encodeURIComponent(settings.calendarId || 'primary');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
315
Open commit View diff
315
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
316
  const event: Record<string, unknown> = {
Open commit View diff
316 const event: Record<string, unknown> = {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
317
    summary: 'Pending booking payment',
Open commit View diff
317 summary: 'Pending booking payment',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
318
    description: `Temporary hold created by ${env.APP_URL}. No invitation is sent until payment succeeds.`,
Open commit View diff
318 description: `Temporary hold created by ${env.APP_URL}. No invitation is sent until payment succeeds.`,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
319
    start: { dateTime: booking.start, timeZone: settings.timezone },
Open commit View diff
319 start: { dateTime: booking.start, timeZone: settings.timezone },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
320
    end: { dateTime: booking.end, timeZone: settings.timezone },
Open commit View diff
320 end: { dateTime: booking.end, timeZone: settings.timezone },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
321
    visibility: 'private',
Open commit View diff
321 visibility: 'private',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
322
    transparency: 'opaque',
Open commit View diff
322 transparency: 'opaque',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
323
  };
Open commit View diff
323 };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
324
Open commit View diff
324
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
325
  if (booking.meetingMode === 'google_meet') {
Open commit View diff
325 if (booking.meetingMode === 'google_meet') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
326
    event.conferenceData = {
Open commit View diff
326 event.conferenceData = {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
327
      createRequest: {
Open commit View diff
327 createRequest: {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
328
        requestId: `hold-${booking.id}`,
Open commit View diff
328 requestId: `hold-${booking.id}`,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
329
        conferenceSolutionKey: { type: 'hangoutsMeet' },
Open commit View diff
329 conferenceSolutionKey: { type: 'hangoutsMeet' },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
330
      },
Open commit View diff
330 },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
331
    };
Open commit View diff
331 };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
332
  }
Open commit View diff
332 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
333
Open commit View diff
333
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
334
  const response = await fetch(
Open commit View diff
334 const response = await fetch(
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
335
    `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events?${params.toString()}`,
Open commit View diff
335 `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events?${params.toString()}`,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
336
    {
Open commit View diff
336 {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
337
      method: 'POST',
Open commit View diff
337 method: 'POST',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
338
      headers: {
Open commit View diff
338 headers: {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
339
        Authorization: `Bearer ${token}`,
Open commit View diff
339 Authorization: `Bearer ${token}`,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
340
        'Content-Type': 'application/json',
Open commit View diff
340 'Content-Type': 'application/json',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
341
      },
Open commit View diff
341 },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
342
      body: JSON.stringify(event),
Open commit View diff
342 body: JSON.stringify(event),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
343
    },
Open commit View diff
343 },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
344
  );
Open commit View diff
344 );
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
345
Open commit View diff
345
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
346
  if (!response.ok) await throwGoogleCalendarError(response, 'Google payment hold creation');
Open commit View diff
346 if (!response.ok) await throwGoogleCalendarError(response, 'Google payment hold creation');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
347
  const data = (await response.json()) as GoogleEventResponse & { error?: { message?: string } };
Open commit View diff
347 const data = (await response.json()) as GoogleEventResponse & { error?: { message?: string } };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
348
  if (!data.id) throw new GoogleCalendarError('Google payment hold creation', 502, data.error?.message ?? 'Missing event id');
Open commit View diff
348 if (!data.id) throw new GoogleCalendarError('Google payment hold creation', 502, data.error?.message ?? 'Missing event id');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
349
Open commit View diff
349
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
350
  const meetUrl = data.hangoutLink
Open commit View diff
350 const meetUrl = data.hangoutLink
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
351
    ?? data.conferenceData?.entryPoints?.find((entry) => entry.entryPointType === 'video')?.uri
Open commit View diff
351 ?? data.conferenceData?.entryPoints?.find((entry) => entry.entryPointType === 'video')?.uri
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
352
    ?? null;
Open commit View diff
352 ?? null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
353
  return { eventId: data.id, meetUrl };
Open commit View diff
353 return { eventId: data.id, meetUrl };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
354
}
Open commit View diff
354 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
355
Open commit View diff
355
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
356
export async function confirmCalendarHold(
Open commit View diff
356 export async function confirmCalendarHold(
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
357
  env: Env,
Open commit View diff
357 env: Env,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
358
  settings: AppSettings,
Open commit View diff
358 settings: AppSettings,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
359
  eventId: string,
Open commit View diff
359 eventId: string,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
360
  booking: {
Open commit View diff
360 booking: {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
361
    id: string;
Open commit View diff
361 id: string;
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
362
    publicBookingId: string;
Open commit View diff
362 publicBookingId: string;
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
363
    name: string;
Open commit View diff
363 name: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
364
    email: string;
Open commit View diff
364 email: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
365
    phone?: string;
Open commit View diff
365 phone?: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
366
    message?: string;
Open commit View diff
366 message?: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
367
    start: string;
Open commit View diff
367 start: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
368
    end: string;
Open commit View diff
368 end: string;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
369
    meetingMode: MeetingMode;
Open commit View diff
369 meetingMode: MeetingMode;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
370
  },
Open commit View diff
370 },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
371
): Promise<{ eventId: string; meetUrl: string | null; htmlLink: string | null }> {
Open commit View diff
371 ): Promise<{ eventId: string; meetUrl: string | null; htmlLink: string | null }> {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
372
  const token = await accessToken(env);
Open commit View diff
372 const token = await accessToken(env);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
373
  const calendarId = encodeURIComponent(settings.calendarId || 'primary');
Open commit View diff
373 const calendarId = encodeURIComponent(settings.calendarId || 'primary');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
374
  const encodedEventId = encodeURIComponent(eventId);
Open commit View diff
374 const encodedEventId = encodeURIComponent(eventId);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
375
  const params = new URLSearchParams({ sendUpdates: 'all', conferenceDataVersion: '1' });
Open commit View diff
375 const params = new URLSearchParams({ sendUpdates: 'all', conferenceDataVersion: '1' });
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
376
Open commit View diff
376
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
377
  const descriptionLines = [
Open commit View diff
377 const descriptionLines = [
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
378
    `Booked through ${env.APP_URL}`,
Open commit View diff
378 `Booked through ${env.APP_URL}`,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
379
    `Booking ID: ${booking.publicBookingId}`,
Open commit View diff
379 `Booking ID: ${booking.publicBookingId}`,
Alex Nord 1 day ago 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
380
    booking.phone ? `Phone: ${booking.phone}` : '',
Open commit View diff
380 booking.phone ? `Phone: ${booking.phone}` : '',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
381
    booking.message ? `Message: ${booking.message}` : '',
Open commit View diff
381 booking.message ? `Message: ${booking.message}` : '',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
382
    'Payment received via Stripe.',
Open commit View diff
382 'Payment received via Stripe.',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
383
  ].filter(Boolean);
Open commit View diff
383 ].filter(Boolean);
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
384
Open commit View diff
384
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
385
  const event: Record<string, unknown> = {
Open commit View diff
385 const event: Record<string, unknown> = {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
386
    summary: `Meeting with ${booking.name}`,
Open commit View diff
386 summary: `Meeting with ${booking.name}`,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
387
    description: descriptionLines.join('\n\n'),
Open commit View diff
387 description: descriptionLines.join('\n\n'),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
388
    start: { dateTime: booking.start, timeZone: settings.timezone },
Open commit View diff
388 start: { dateTime: booking.start, timeZone: settings.timezone },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
389
    end: { dateTime: booking.end, timeZone: settings.timezone },
Open commit View diff
389 end: { dateTime: booking.end, timeZone: settings.timezone },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
390
    attendees: [{ email: booking.email, displayName: booking.name }],
Open commit View diff
390 attendees: [{ email: booking.email, displayName: booking.name }],
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
391
    visibility: 'default',
Open commit View diff
391 visibility: 'default',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
392
    transparency: 'opaque',
Open commit View diff
392 transparency: 'opaque',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
393
  };
Open commit View diff
393 };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
394
Open commit View diff
394
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
395
  // Google Meet was created on the private hold already. Omitting conferenceData
Open commit View diff
395 // Google Meet was created on the private hold already. Omitting conferenceData
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
396
  // here preserves that conference while the PATCH adds the attendee and sends the invite.
Open commit View diff
396 // here preserves that conference while the PATCH adds the attendee and sends the invite.
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
397
  if (booking.meetingMode === 'in_person' && settings.inPersonLocation) {
Open commit View diff
397 if (booking.meetingMode === 'in_person' && settings.inPersonLocation) {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
398
    event.location = settings.inPersonLocation;
Open commit View diff
398 event.location = settings.inPersonLocation;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
399
  } else if (booking.meetingMode === 'phone') {
Open commit View diff
399 } else if (booking.meetingMode === 'phone') {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
400
    event.location = 'Phone call';
Open commit View diff
400 event.location = 'Phone call';
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
401
  }
Open commit View diff
401 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
402
Open commit View diff
402
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
403
  const response = await fetch(
Open commit View diff
403 const response = await fetch(
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
404
    `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${encodedEventId}?${params.toString()}`,
Open commit View diff
404 `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${encodedEventId}?${params.toString()}`,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
405
    {
Open commit View diff
405 {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
406
      method: 'PATCH',
Open commit View diff
406 method: 'PATCH',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
407
      headers: {
Open commit View diff
407 headers: {
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
408
        Authorization: `Bearer ${token}`,
Open commit View diff
408 Authorization: `Bearer ${token}`,
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
409
        'Content-Type': 'application/json',
Open commit View diff
409 'Content-Type': 'application/json',
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
410
      },
Open commit View diff
410 },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
411
      body: JSON.stringify(event),
Open commit View diff
411 body: JSON.stringify(event),
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
412
    },
Open commit View diff
412 },
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
413
  );
Open commit View diff
413 );
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
414
Open commit View diff
414
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
415
  if (!response.ok) await throwGoogleCalendarError(response, 'Google paid booking confirmation');
Open commit View diff
415 if (!response.ok) await throwGoogleCalendarError(response, 'Google paid booking confirmation');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
416
  const data = (await response.json()) as GoogleEventResponse & { error?: { message?: string } };
Open commit View diff
416 const data = (await response.json()) as GoogleEventResponse & { error?: { message?: string } };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
417
  if (!data.id) throw new GoogleCalendarError('Google paid booking confirmation', 502, data.error?.message ?? 'Missing event id');
Open commit View diff
417 if (!data.id) throw new GoogleCalendarError('Google paid booking confirmation', 502, data.error?.message ?? 'Missing event id');
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
418
Open commit View diff
418
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
419
  const meetUrl = data.hangoutLink
Open commit View diff
419 const meetUrl = data.hangoutLink
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
420
    ?? data.conferenceData?.entryPoints?.find((entry) => entry.entryPointType === 'video')?.uri
Open commit View diff
420 ?? data.conferenceData?.entryPoints?.find((entry) => entry.entryPointType === 'video')?.uri
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
421
    ?? null;
Open commit View diff
421 ?? null;
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
422
  return { eventId: data.id, meetUrl, htmlLink: data.htmlLink ?? null };
Open commit View diff
422 return { eventId: data.id, meetUrl, htmlLink: data.htmlLink ?? null };
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
423
}
Open commit View diff
423 }
same change 110f91e

Adding indication for test/live key

Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
424
Open commit View diff
424
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
425
Open commit View diff
425
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
426
function managedBookingDescription(
Open commit View diff
426 function managedBookingDescription(
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
427
  env: Env,
Open commit View diff
427 env: Env,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
428
  booking: { phone?: string; message?: string; paid?: boolean; publicBookingId?: string },
Open commit View diff
428 booking: { phone?: string; message?: string; paid?: boolean; publicBookingId?: string },
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
429
  extraLines: string[] = [],
Open commit View diff
429 extraLines: string[] = [],
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
430
): string {
Open commit View diff
430 ): string {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
431
  return [
Open commit View diff
431 return [
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
432
    `Booked through ${env.APP_URL}`,
Open commit View diff
432 `Booked through ${env.APP_URL}`,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
433
    booking.publicBookingId ? `Booking ID: ${booking.publicBookingId}` : '',
Open commit View diff
433 booking.publicBookingId ? `Booking ID: ${booking.publicBookingId}` : '',
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
434
    booking.phone ? `Phone: ${booking.phone}` : '',
Open commit View diff
434 booking.phone ? `Phone: ${booking.phone}` : '',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
435
    booking.message ? `Message: ${booking.message}` : '',
Open commit View diff
435 booking.message ? `Message: ${booking.message}` : '',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
436
    booking.paid ? 'Payment received via Stripe.' : '',
Open commit View diff
436 booking.paid ? 'Payment received via Stripe.' : '',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
437
    ...extraLines,
Open commit View diff
437 ...extraLines,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
438
  ].filter(Boolean).join('\n\n');
Open commit View diff
438 ].filter(Boolean).join('\n\n');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

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

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
440
Open commit View diff
440
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
441
export async function rescheduleCalendarEvent(
Open commit View diff
441 export async function rescheduleCalendarEvent(
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
442
  env: Env,
Open commit View diff
442 env: Env,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
443
  settings: AppSettings,
Open commit View diff
443 settings: AppSettings,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
444
  eventId: string,
Open commit View diff
444 eventId: string,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
445
  booking: {
Open commit View diff
445 booking: {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
446
    phone?: string;
Open commit View diff
446 phone?: string;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
447
    message?: string;
Open commit View diff
447 message?: string;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
448
    paid?: boolean;
Open commit View diff
448 paid?: boolean;
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
449
    publicBookingId?: string;
Open commit View diff
449 publicBookingId?: string;
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
450
    start: string;
Open commit View diff
450 start: string;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
451
    end: string;
Open commit View diff
451 end: string;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
452
  },
Open commit View diff
452 },
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
453
): Promise<{ eventId: string; meetUrl: string | null }> {
Open commit View diff
453 ): Promise<{ eventId: string; meetUrl: string | null }> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
454
  const token = await accessToken(env);
Open commit View diff
454 const token = await accessToken(env);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
455
  const calendarId = encodeURIComponent(settings.calendarId || 'primary');
Open commit View diff
455 const calendarId = encodeURIComponent(settings.calendarId || 'primary');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
456
  const encodedEventId = encodeURIComponent(eventId);
Open commit View diff
456 const encodedEventId = encodeURIComponent(eventId);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
457
  const params = new URLSearchParams({ sendUpdates: 'all', conferenceDataVersion: '1' });
Open commit View diff
457 const params = new URLSearchParams({ sendUpdates: 'all', conferenceDataVersion: '1' });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
458
  const response = await fetch(
Open commit View diff
458 const response = await fetch(
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
459
    `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${encodedEventId}?${params.toString()}`,
Open commit View diff
459 `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${encodedEventId}?${params.toString()}`,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
460
    {
Open commit View diff
460 {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
461
      method: 'PATCH',
Open commit View diff
461 method: 'PATCH',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
462
      headers: {
Open commit View diff
462 headers: {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
463
        Authorization: `Bearer ${token}`,
Open commit View diff
463 Authorization: `Bearer ${token}`,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
464
        'Content-Type': 'application/json',
Open commit View diff
464 'Content-Type': 'application/json',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
465
      },
Open commit View diff
465 },
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
466
      body: JSON.stringify({
Open commit View diff
466 body: JSON.stringify({
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
467
        start: { dateTime: booking.start, timeZone: settings.timezone },
Open commit View diff
467 start: { dateTime: booking.start, timeZone: settings.timezone },
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
468
        end: { dateTime: booking.end, timeZone: settings.timezone },
Open commit View diff
468 end: { dateTime: booking.end, timeZone: settings.timezone },
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
469
        description: managedBookingDescription(env, booking),
Open commit View diff
469 description: managedBookingDescription(env, booking),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
470
      }),
Open commit View diff
470 }),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
471
    },
Open commit View diff
471 },
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
472
  );
Open commit View diff
472 );
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
473
  if (!response.ok) await throwGoogleCalendarError(response, 'Google event reschedule');
Open commit View diff
473 if (!response.ok) await throwGoogleCalendarError(response, 'Google event reschedule');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
474
  const data = (await response.json()) as GoogleEventResponse & { error?: { message?: string } };
Open commit View diff
474 const data = (await response.json()) as GoogleEventResponse & { error?: { message?: string } };
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
475
  if (!data.id) throw new GoogleCalendarError('Google event reschedule', 502, data.error?.message ?? 'Missing event id');
Open commit View diff
475 if (!data.id) throw new GoogleCalendarError('Google event reschedule', 502, data.error?.message ?? 'Missing event id');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
476
  const meetUrl = data.hangoutLink
Open commit View diff
476 const meetUrl = data.hangoutLink
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
477
    ?? data.conferenceData?.entryPoints?.find((entry) => entry.entryPointType === 'video')?.uri
Open commit View diff
477 ?? data.conferenceData?.entryPoints?.find((entry) => entry.entryPointType === 'video')?.uri
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
478
    ?? null;
Open commit View diff
478 ?? null;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
479
  return { eventId: data.id, meetUrl };
Open commit View diff
479 return { eventId: data.id, meetUrl };
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

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

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
481
Open commit View diff
481
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
482
export async function sendRescheduleSuggestion(
Open commit View diff
482 export async function sendRescheduleSuggestion(
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
483
  env: Env,
Open commit View diff
483 env: Env,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
484
  settings: AppSettings,
Open commit View diff
484 settings: AppSettings,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
485
  eventId: string,
Open commit View diff
485 eventId: string,
Alex Nord about 23 hours ago 92deb90

feat: add public booking IDs and self-service cancellation

Full commit hash
92deb90d0872b02f6bac0f855281cdb9a73596db
Author
Alex Nord <[email protected]>
Date
about 23 hours ago
Selected line
486
  booking: { phone?: string; message?: string; paid?: boolean; publicBookingId?: string },
Open commit View diff
486 booking: { phone?: string; message?: string; paid?: boolean; publicBookingId?: string },
Alex Nord 1 day ago 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
487
  proposal: { start: string; end: string; url: string },
Open commit View diff
487 proposal: { start: string; end: string; url: string },
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
488
): Promise<void> {
Open commit View diff
488 ): Promise<void> {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
489
  const token = await accessToken(env);
Open commit View diff
489 const token = await accessToken(env);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
490
  const calendarId = encodeURIComponent(settings.calendarId || 'primary');
Open commit View diff
490 const calendarId = encodeURIComponent(settings.calendarId || 'primary');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
491
  const encodedEventId = encodeURIComponent(eventId);
Open commit View diff
491 const encodedEventId = encodeURIComponent(eventId);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
492
  const params = new URLSearchParams({ sendUpdates: 'all' });
Open commit View diff
492 const params = new URLSearchParams({ sendUpdates: 'all' });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
493
  const formatter = new Intl.DateTimeFormat('en-US', {
Open commit View diff
493 const formatter = new Intl.DateTimeFormat('en-US', {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
494
    timeZone: settings.timezone,
Open commit View diff
494 timeZone: settings.timezone,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
495
    weekday: 'long',
Open commit View diff
495 weekday: 'long',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
496
    month: 'long',
Open commit View diff
496 month: 'long',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
497
    day: 'numeric',
Open commit View diff
497 day: 'numeric',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
498
    hour: '2-digit',
Open commit View diff
498 hour: '2-digit',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
499
    minute: '2-digit',
Open commit View diff
499 minute: '2-digit',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
500
    hourCycle: 'h23',
Open commit View diff
500 hourCycle: 'h23',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
501
  });
Open commit View diff
501 });
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
502
  const proposedText = `${formatter.format(new Date(proposal.start))} – ${new Intl.DateTimeFormat('en-US', {
Open commit View diff
502 const proposedText = `${formatter.format(new Date(proposal.start))} – ${new Intl.DateTimeFormat('en-US', {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
503
    timeZone: settings.timezone,
Open commit View diff
503 timeZone: settings.timezone,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
504
    hour: '2-digit',
Open commit View diff
504 hour: '2-digit',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
505
    minute: '2-digit',
Open commit View diff
505 minute: '2-digit',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
506
    hourCycle: 'h23',
Open commit View diff
506 hourCycle: 'h23',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
507
  }).format(new Date(proposal.end))} (${settings.timezone})`;
Open commit View diff
507 }).format(new Date(proposal.end))} (${settings.timezone})`;
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
508
  const description = managedBookingDescription(env, booking, [
Open commit View diff
508 const description = managedBookingDescription(env, booking, [
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
509
    'Slot reschedule suggestion',
Open commit View diff
509 'Slot reschedule suggestion',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
510
    `Suggested new time: ${proposedText}`,
Open commit View diff
510 `Suggested new time: ${proposedText}`,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
511
    `Review and accept: ${proposal.url}`,
Open commit View diff
511 `Review and accept: ${proposal.url}`,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
512
    'The existing meeting time stays confirmed until the suggestion is accepted.',
Open commit View diff
512 'The existing meeting time stays confirmed until the suggestion is accepted.',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
513
  ]);
Open commit View diff
513 ]);
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
514
  const response = await fetch(
Open commit View diff
514 const response = await fetch(
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
515
    `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${encodedEventId}?${params.toString()}`,
Open commit View diff
515 `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${encodedEventId}?${params.toString()}`,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
516
    {
Open commit View diff
516 {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
517
      method: 'PATCH',
Open commit View diff
517 method: 'PATCH',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
518
      headers: {
Open commit View diff
518 headers: {
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
519
        Authorization: `Bearer ${token}`,
Open commit View diff
519 Authorization: `Bearer ${token}`,
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
520
        'Content-Type': 'application/json',
Open commit View diff
520 'Content-Type': 'application/json',
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
521
      },
Open commit View diff
521 },
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
522
      body: JSON.stringify({ description }),
Open commit View diff
522 body: JSON.stringify({ description }),
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
523
    },
Open commit View diff
523 },
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
524
  );
Open commit View diff
524 );
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
525
  if (!response.ok) await throwGoogleCalendarError(response, 'Google reschedule suggestion');
Open commit View diff
525 if (!response.ok) await throwGoogleCalendarError(response, 'Google reschedule suggestion');
same change 9aa588b

feat: add rescheduling, time proposals and Stripe cancellation refunds

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

feat: add rescheduling, time proposals and Stripe cancellation refunds

Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927
Author
Alex Nord <[email protected]>
Date
1 day ago
Selected line
527
Open commit View diff
527
Alex Nord 3 days ago 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
528
export async function deleteCalendarEvent(
Open commit View diff
528 export async function deleteCalendarEvent(
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
529
  env: Env,
Open commit View diff
529 env: Env,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
530
  settings: AppSettings,
Open commit View diff
530 settings: AppSettings,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
531
  eventId: string,
Open commit View diff
531 eventId: string,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
532
): Promise<void> {
Open commit View diff
532 ): Promise<void> {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
533
  const token = await accessToken(env);
Open commit View diff
533 const token = await accessToken(env);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
534
  const calendarId = encodeURIComponent(settings.calendarId || 'primary');
Open commit View diff
534 const calendarId = encodeURIComponent(settings.calendarId || 'primary');
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
535
  const encodedEventId = encodeURIComponent(eventId);
Open commit View diff
535 const encodedEventId = encodeURIComponent(eventId);
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
536
  const params = new URLSearchParams({ sendUpdates: 'all' });
Open commit View diff
536 const params = new URLSearchParams({ sendUpdates: 'all' });
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
537
Open commit View diff
537
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
538
  const response = await fetch(
Open commit View diff
538 const response = await fetch(
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
539
    `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${encodedEventId}?${params.toString()}`,
Open commit View diff
539 `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${encodedEventId}?${params.toString()}`,
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
540
    {
Open commit View diff
540 {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
541
      method: 'DELETE',
Open commit View diff
541 method: 'DELETE',
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
542
      headers: { Authorization: `Bearer ${token}` },
Open commit View diff
542 headers: { Authorization: `Bearer ${token}` },
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
543
    },
Open commit View diff
543 },
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
544
  );
Open commit View diff
544 );
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
545
Open commit View diff
545
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
546
  if (response.status === 410 || response.status === 404) return;
Open commit View diff
546 if (response.status === 410 || response.status === 404) return;
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
547
  if (!response.ok) {
Open commit View diff
547 if (!response.ok) {
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
548
    await throwGoogleCalendarError(response, 'Google event cancellation');
Open commit View diff
548 await throwGoogleCalendarError(response, 'Google event cancellation');
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
549
  }
Open commit View diff
549 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
550
}
Open commit View diff
550 }
same change 5562973

Add cancellation and availability blocks

Full commit hash
556297329383149d17cc0ffa9568836eeae97d2c
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
551
Open commit View diff
551
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
552
export async function disconnectGoogle(env: Env): Promise<void> {
Open commit View diff
552 export async function disconnectGoogle(env: Env): Promise<void> {
same change 45c38c3

Prepare Slot booking worker

Full commit hash
45c38c3ae5284118e8d65aa9d49e90850b1209f5
Author
Alex Nord <[email protected]>
Date
3 days ago
Selected line
553
  await env.DB.prepare("DELETE FROM oauth_tokens WHERE provider = 'google'").run();
Open commit View diff
553 await env.DB.prepare("DELETE FROM oauth_tokens WHERE provider = 'google'").run();
same change 45c38c3

Prepare Slot booking worker

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