diff --git a/main.ts b/main.ts --- a/main.ts +++ b/main.ts @@ -73,7 +73,9 @@ const now = Temporal.Now.zonedDateTimeISO(TIMEZONE); if (Temporal.ZonedDateTime.compare(now, nextDigest) >= 0) { nextDigest = nextDigestAfter(now); - console.log(`sending weekly digest; next at ${nextDigest.toString({ timeZoneName: "never" })}`); + console.log( + `sending weekly digest; next at ${nextDigest.toString({ timeZoneName: "never" })}`, + ); await notifyAll(channels, (ch) => ch.notifyMany(result.events)); } } catch (err) { @@ -102,7 +104,9 @@ const event = slug ? events.find((e) => e.slug === slug) : events[0]!; if (!event) { - throw new Error(`event with slug "${slug}" not found; available slugs: ${events.map((e) => e.slug).join(", ")}`); + throw new Error( + `event with slug "${slug}" not found; available slugs: ${events.map((e) => e.slug).join(", ")}`, + ); } for (const ch of channels) await ch.notifyOne(event); } diff --git a/package-lock.json b/package-lock.json --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,707 @@ "name": "devict-events", "devDependencies": { "@types/node": "^25.9.1", + "oxfmt": "^0.54.0", + "oxlint": "^1.69.0", "typescript": "^6.0.3" + }, + "engines": { + "node": ">=24.0.0", + "npm": ">=11.0.0" + } + }, + "node_modules/@oxfmt/binding-android-arm-eabi": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm-eabi/-/binding-android-arm-eabi-0.54.0.tgz", + "integrity": "sha512-NAtpl/SiaeU103e7/OmZw0MvUnsUUopW7hEm/ecegJg7YM0skQaA0IXEZoyTV6NUdiNPupdIUreRqUZTShbn/g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-android-arm64": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm64/-/binding-android-arm64-0.54.0.tgz", + "integrity": "sha512-B4VZfBUlKK1rmMChsssNZbkZjE8+FzG3avMjGgMDwbGxXRoXkoeXiAZ+78Oa+eyDPHvDCiUb4zH/vmCOUSafLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-darwin-arm64": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-arm64/-/binding-darwin-arm64-0.54.0.tgz", + "integrity": "sha512-i02vF75b+ePsQP3tHqSxVYI5S6b8X/xqdPu7/mDHXtpgXLTYXi3jJmfHU0j+dnZZDKaYTx/ioCK7QYJmtiJR2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-darwin-x64": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-x64/-/binding-darwin-x64-0.54.0.tgz", + "integrity": "sha512-8VMFvGvooXj7mswkbrhdVZ2/sgiDaBzWpkkbtO+qGDLV4EfJd67nQadHkQC0ZNbaWA9ajXfqI6i7PZLIeDzxEQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-freebsd-x64": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-freebsd-x64/-/binding-freebsd-x64-0.54.0.tgz", + "integrity": "sha512-0cRHnp43WN1Jrc5s0BdbdKgR1XirdvHy7TAFi3JEsoEVQVJxTXMbpVd76sxXlgRswNMDhVFSJw+y7Eb8mEavFQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm-gnueabihf": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.54.0.tgz", + "integrity": "sha512-JyQAk3hK/OEtup7Rw6kZwfdzbKqTVD5jXXb8Xpfay29suwZyfBDMVW/bj4RqEPySYWc6zCp198pOluf8n5uYzg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm-musleabihf": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.54.0.tgz", + "integrity": "sha512-qnvLatTpM8vtvjOfcckBOzJjk+n6ce/wwpP8OFeUrD5aNLYcKyWAitwj+Rk3PK9jGanbZvKsJnv14JGQ6XqFdw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm64-gnu": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.54.0.tgz", + "integrity": "sha512-SMkhnCzIYZYDk9vw3W/80eeYKmrMpGF0Giuxt4HruFlCH7jEtnPeb3SdQKMfgYi/dgtaf+hZAb5XWPYnxqCQ3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm64-musl": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.54.0.tgz", + "integrity": "sha512-QrwJlBFFKnxOd95TAaszpMbZBLzMoYMpGaQTZF8oibacnF5rv8l12IhILhQRPmksWiBqg0YSe2Mnl7ayeJAHSA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-ppc64-gnu": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.54.0.tgz", + "integrity": "sha512-WILatiol/TUHTlhod7R09+7Az/XlhKwmY1MHfLZNmewltPWNN/EwxP2rQSHahibZ/cB8gmckEBjBOByD+5bYsQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-gnu": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.54.0.tgz", + "integrity": "sha512-f05YMG4BH4G8S4ME6UM6fi1MnJ9094mrnvO5Pa4SJlMfWlUM+1/ZWMEF4NnjM7shZAvbHsHRuVYpUo0PHC4P9Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-musl": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.54.0.tgz", + "integrity": "sha512-UfL+2hj1ClNqcCRT9s8vBU4axDpjxgVxX96G+9DYAYjoc5b0u15CJtn2jgsi9iM+EbGNc5CW1HVRgwVu76UsSA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-s390x-gnu": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.54.0.tgz", + "integrity": "sha512-3/XZe931Hka+J6NjnaqJzYpsWWxDTuRdUdwSQHnOuJEgbC+SehIMFJS8hsEjV7LBhVSL2OCnRLvbVW8O97XIyw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-gnu": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.54.0.tgz", + "integrity": "sha512-Ik93RlObtu43GbxApafayFjwYE06L6Xr08cSwpBPYbDrLp2ReZx0Jm1DqwRyYRnukUJy+rK2WaEvUQOxdytU9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-musl": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.54.0.tgz", + "integrity": "sha512-yZcakmPlD86CNymknd7KfW+FH+qfbqJH+i0h69CYfV1+KMoVeM9UED+8+TDVoU4haxI0NxY7RPCvRLy3Sqd2Qg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-openharmony-arm64": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-openharmony-arm64/-/binding-openharmony-arm64-0.54.0.tgz", + "integrity": "sha512-GiVBZNnEZnKu00f1jTg49nomv187d0GQX+O+ocykoLeiaALuEO+swoTehHn9TehTfi7V8H0i0e/yvUjCqnwk1w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-arm64-msvc": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.54.0.tgz", + "integrity": "sha512-J0SSB8Z1Fre2sxRolYcW6Rl1RQmKdQ2hnHyq4YJrfBRiXTObLw4DXnIVraM/UyqGqwOi7yTrQA4VT7DPxlHVKA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-ia32-msvc": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.54.0.tgz", + "integrity": "sha512-O61UDVj8zz6yXJjkHPf05VaMLOXmEF8P5kf/N0W7AQMmd6bcQogl+KJc7rMutKTL524oE9iH32JXZClBFmEQIg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-x64-msvc": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.54.0.tgz", + "integrity": "sha512-1MDpqJPiFqxWtIHas8vkb1VZ7f7eKyTffAwmO8isxQYMaG1OFKsH666BWLeXQLO+IWNfiMssLD55hbR1lIPTqg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-android-arm-eabi": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.69.0.tgz", + "integrity": "sha512-DKQQbD5cZ/MYfDgDI7YGyGD9FSxABlsBsYFo5p26lloob543tP9+4N3guwdXIYJN+7HSZxLe8YJuwcOWw5qnHg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-android-arm64": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.69.0.tgz", + "integrity": "sha512-lEhb+I5pr4inux+JFwfCa1HRq3Os7NirEFQ0H1I35SVEHPm6byX0Ah47xmRha3qi6LAkxUcxViL8o/9PivjzBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-arm64": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.69.0.tgz", + "integrity": "sha512-GY2YE8lOZW59BW1Ia1y+1gR0XyjrZRvVWHAr8LGeGhYHE0OQJ/7cRKXTkx1P+E9/6awEc3SX8a68SFTjh/E//A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-x64": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.69.0.tgz", + "integrity": "sha512-ax1oZnOjHX3LB7myQyHEaQkDwfLb6str3/nSP6O7EVUviQGNkEGzGV0EqcBJWK+Ufwx0l4xPgyYayurvhAdl2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-freebsd-x64": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.69.0.tgz", + "integrity": "sha512-kHWeHv4g2h8NY+mpCxzCtY4uerMJWTN/TSnNj1CPbakFpHEJ6cTya2wWV0pDSYWOJ2+0UiEbhn3AtXxHtsnKjg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-gnueabihf": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.69.0.tgz", + "integrity": "sha512-gq84vM1a1oEehXo27YCDzGVcxPsZDI1yswZwz2Da1/cbnWtrL16XZZnz0G/+gIU8edtHpfjxq5c+vWEHqJfWoQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-musleabihf": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.69.0.tgz", + "integrity": "sha512-kIqEa98JQ0VRyrcncxA417m2AzasqTlD+FyVT1AksjvjkqQcvm7pBWYvoW3/mpyOP2XYvi5nSCCTIe6De1yu5g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-gnu": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.69.0.tgz", + "integrity": "sha512-j+xYiXozxGWx2cpjCrwwGR4awTxPFsRv3JZrv23RCogEPMc4R7UqjHW47p/RG0aRlbWiROCJ8coUfCwy0dvzHA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-musl": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.69.0.tgz", + "integrity": "sha512-xEPpNppTfN1l/nM7gYSf9iocscu/as+p/7vxkLeLEKnYU+09Dm+5V6IhDYDh+Uz6FajEupWwCLt5SOG0y1PCKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-ppc64-gnu": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.69.0.tgz", + "integrity": "sha512-Ug0+eU7HJBlek+SjklYH62IlOMirEJsdxpihH0kSqX0XdrDD4NdHpQc10fK1JC35yn6KrrcN+uYzlHD38XAf8Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-gnu": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.69.0.tgz", + "integrity": "sha512-iEyI3GIg0l/s3G4qy2TlaaWKdzj4PJJStwtlocpDTC00PY9hZueotf6OKUj9+yfQh0lrpBW/pLMgTztbAHKJEg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-musl": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.69.0.tgz", + "integrity": "sha512-NjHjpiI4WIKSMwuoJSZi5VToPeoYOS1FR52HLIDG6lidMdqquusgtODb4iLk0+lb1q3Z0nv2/aPRcC/olmpQGg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-s390x-gnu": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.69.0.tgz", + "integrity": "sha512-Ai/prDewoItkDXbp38gwGZi41DycZbUTZJ3UidwoHgQC0/DaqC2TGdtBTQLJ6hSD+SAxASzh8+/eSBPmxfOacA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-gnu": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.69.0.tgz", + "integrity": "sha512-Gt3KHgp46mRKz4sJeaASmKvD8ayXookRw07RMf+NowhEztGGDZ7VrXpoW96XuKJLjFukWizOFVNjmYb/u7caNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-musl": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.69.0.tgz", + "integrity": "sha512-7tQhJ2+p/oHv1zcfnjYI7YVzC/7iBaVOfIvFYtxdJ5F45mWgEdrCyXZXZGfiLey5t/5JhOhsaMnnv1kAzckd7g==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.69.0.tgz", + "integrity": "sha512-vmWz6TKp/3hfA4lksR0zHBv/6xuX1jhym6eqOjdH2DXsDDHZWcp2f0KG0VCAnlVbIrjk29G4wAWMXb/Hn1YobA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.69.0.tgz", + "integrity": "sha512-9RExaLgmaw6IoIkU9cTpT71mLfI0xZ86iZH8x518LVsOkjquJMYqb9P7KpC8lgd1t0Dxs41p2pxynq4XR3Ttzw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.69.0.tgz", + "integrity": "sha512-1907kRPF8/PrcIw1E7LMs9JbVrpgnt/MvFdss3an8oDkYNAACXzTntV3t3869ZZhMZxb2AzRGbz1pA/jdFatXA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.69.0.tgz", + "integrity": "sha512-w8SOXv3mT9Fi6jY8OXdXCfnvX/3KNLXGNr4HEz2TA7S4Mv/PYAOmpB8y/ge40mxvBMgGNaSaaDwZpAsQn7HtWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/@types/node": { @@ -18,6 +718,117 @@ "license": "MIT", "dependencies": { "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/oxfmt": { + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.54.0.tgz", + "integrity": "sha512-DjnMwn7smSLF+Mc2+pRItnuPftm/dkUFpY/d4+33y9TfKrsHZo8GLhmUg9BrOIUEy94Rlom1Q11N6vuhE+e0oQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinypool": "2.1.0" + }, + "bin": { + "oxfmt": "bin/oxfmt" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxfmt/binding-android-arm-eabi": "0.54.0", + "@oxfmt/binding-android-arm64": "0.54.0", + "@oxfmt/binding-darwin-arm64": "0.54.0", + "@oxfmt/binding-darwin-x64": "0.54.0", + "@oxfmt/binding-freebsd-x64": "0.54.0", + "@oxfmt/binding-linux-arm-gnueabihf": "0.54.0", + "@oxfmt/binding-linux-arm-musleabihf": "0.54.0", + "@oxfmt/binding-linux-arm64-gnu": "0.54.0", + "@oxfmt/binding-linux-arm64-musl": "0.54.0", + "@oxfmt/binding-linux-ppc64-gnu": "0.54.0", + "@oxfmt/binding-linux-riscv64-gnu": "0.54.0", + "@oxfmt/binding-linux-riscv64-musl": "0.54.0", + "@oxfmt/binding-linux-s390x-gnu": "0.54.0", + "@oxfmt/binding-linux-x64-gnu": "0.54.0", + "@oxfmt/binding-linux-x64-musl": "0.54.0", + "@oxfmt/binding-openharmony-arm64": "0.54.0", + "@oxfmt/binding-win32-arm64-msvc": "0.54.0", + "@oxfmt/binding-win32-ia32-msvc": "0.54.0", + "@oxfmt/binding-win32-x64-msvc": "0.54.0" + }, + "peerDependencies": { + "svelte": "^5.0.0", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/oxlint": { + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.69.0.tgz", + "integrity": "sha512-ypZkK/aDc5NQV8zIR6s2H2Tl3aNW8FmJ1m9+2qsaYuRenl8vgnHNCGwTHviWJdUQzglOlHFchgopdtGhSy17Rw==", + "dev": true, + "license": "MIT", + "bin": { + "oxlint": "bin/oxlint" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxlint/binding-android-arm-eabi": "1.69.0", + "@oxlint/binding-android-arm64": "1.69.0", + "@oxlint/binding-darwin-arm64": "1.69.0", + "@oxlint/binding-darwin-x64": "1.69.0", + "@oxlint/binding-freebsd-x64": "1.69.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.69.0", + "@oxlint/binding-linux-arm-musleabihf": "1.69.0", + "@oxlint/binding-linux-arm64-gnu": "1.69.0", + "@oxlint/binding-linux-arm64-musl": "1.69.0", + "@oxlint/binding-linux-ppc64-gnu": "1.69.0", + "@oxlint/binding-linux-riscv64-gnu": "1.69.0", + "@oxlint/binding-linux-riscv64-musl": "1.69.0", + "@oxlint/binding-linux-s390x-gnu": "1.69.0", + "@oxlint/binding-linux-x64-gnu": "1.69.0", + "@oxlint/binding-linux-x64-musl": "1.69.0", + "@oxlint/binding-openharmony-arm64": "1.69.0", + "@oxlint/binding-win32-arm64-msvc": "1.69.0", + "@oxlint/binding-win32-ia32-msvc": "1.69.0", + "@oxlint/binding-win32-x64-msvc": "1.69.0" + }, + "peerDependencies": { + "oxlint-tsgolint": ">=0.22.1", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "oxlint-tsgolint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/tinypool": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.1.0.tgz", + "integrity": "sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.0.0 || >=22.0.0" } }, "node_modules/typescript": { diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -1,19 +1,25 @@ { - "private": true, "name": "devict-events", + "private": true, "type": "module", - "engines": { - "node": ">=24.0.0", - "npm": ">=11.0.0" - }, "scripts": { "start": "node main.ts", "once": "node main.ts once", "test": "node --test", - "typecheck": "tsc" + "typecheck": "tsc", + "lint": "oxlint", + "lint:fix": "oxlint --fix", + "fmt": "oxfmt", + "fmt:check": "oxfmt --check" }, "devDependencies": { "@types/node": "^25.9.1", + "oxfmt": "^0.54.0", + "oxlint": "^1.69.0", "typescript": "^6.0.3" + }, + "engines": { + "node": ">=24.0.0", + "npm": ">=11.0.0" } } diff --git a/tsconfig.json b/tsconfig.json --- a/tsconfig.json +++ b/tsconfig.json @@ -8,17 +8,10 @@ "rewriteRelativeImportExtensions": true, "erasableSyntaxOnly": true, "verbatimModuleSyntax": true, - "lib": [ - "esnext" - ], - "types": [ - "node" - ] + "lib": ["esnext"], + "types": ["node"] }, // atproto/ and openmeet/ are the pre-Go-rewrite prototype, kept around // until deleted; exclude them from typechecking. - "include": [ - "main.ts", - "src" - ] + "include": ["main.ts", "src"] } diff --git a/src/atproto.ts b/src/atproto.ts --- a/src/atproto.ts +++ b/src/atproto.ts @@ -12,7 +12,11 @@ // Performs the full ATProto flow and returns a service-auth token scoped to // the given audience (service DID) and lexicon method. -export async function getServiceToken(login: AtprotoLogin, aud: string, lxm: string): Promise { +export async function getServiceToken( + login: AtprotoLogin, + aud: string, + lxm: string, +): Promise { const pdsUrl = login.pdsUrl ?? (await resolvePds(login.handle)); const session = await fetchJson<{ accessJwt: string }>( diff --git a/src/config.test.ts b/src/config.test.ts --- a/src/config.test.ts +++ b/src/config.test.ts @@ -12,7 +12,12 @@ }; test("loads a full config", () => { - const cfg = loadConfig({ ...baseEnv, SLACK_TOKEN: "xoxb-1", SLACK_CHANNEL: "#events", ENABLE_STDOUT: "true" }); + const cfg = loadConfig({ + ...baseEnv, + SLACK_TOKEN: "xoxb-1", + SLACK_CHANNEL: "#events", + ENABLE_STDOUT: "true", + }); assert.equal(cfg.atprotoHandle, "test.example"); assert.equal(cfg.weeklyNotifyDay, 1); assert.equal(cfg.weeklyNotifyHour, 7); @@ -37,7 +42,10 @@ test("invalid day and time throw", () => { assert.throws(() => loadConfig({ ...baseEnv, WEEKLY_NOTIFY_DAY: "Funday" }), /WEEKLY_NOTIFY_DAY/); - assert.throws(() => loadConfig({ ...baseEnv, WEEKLY_NOTIFY_TIME: "25:00" }), /WEEKLY_NOTIFY_TIME/); + assert.throws( + () => loadConfig({ ...baseEnv, WEEKLY_NOTIFY_TIME: "25:00" }), + /WEEKLY_NOTIFY_TIME/, + ); assert.throws(() => loadConfig({ ...baseEnv, WEEKLY_NOTIFY_TIME: "7:30" }), /WEEKLY_NOTIFY_TIME/); }); diff --git a/src/config.ts b/src/config.ts --- a/src/config.ts +++ b/src/config.ts @@ -26,7 +26,8 @@ const day = required("WEEKLY_NOTIFY_DAY"); const dayIndex = WEEKDAYS.indexOf(day); - if (dayIndex === -1) throw new Error(`invalid WEEKLY_NOTIFY_DAY "${day}" (expected e.g. "Monday")`); + if (dayIndex === -1) + throw new Error(`invalid WEEKLY_NOTIFY_DAY "${day}" (expected e.g. "Monday")`); const time = required("WEEKLY_NOTIFY_TIME"); const match = /^(\d{2}):(\d{2})$/.exec(time); diff --git a/src/http.ts b/src/http.ts --- a/src/http.ts +++ b/src/http.ts @@ -10,7 +10,11 @@ } } -export async function fetchJson(what: string, url: string | URL, init?: RequestInit): Promise { +export async function fetchJson( + what: string, + url: string | URL, + init?: RequestInit, +): Promise { const resp = await fetch(url, init); if (!resp.ok) throw new HttpError(what, resp.status, await resp.text()); return resp.json() as Promise; diff --git a/src/notify.test.ts b/src/notify.test.ts --- a/src/notify.test.ts +++ b/src/notify.test.ts @@ -1,7 +1,14 @@ import assert from "node:assert/strict"; import test from "node:test"; -import { slackChannel, slackMany, slackOne, stdoutChannel, stdoutMany, stdoutOne } from "./notify.ts"; +import { + slackChannel, + slackMany, + slackOne, + stdoutChannel, + stdoutMany, + stdoutOne, +} from "./notify.ts"; import type { OpenMeetEvent } from "./openmeet.ts"; const event = (name: string, slug: string): OpenMeetEvent => ({ @@ -38,7 +45,11 @@ test("slackChannel posts to chat.postMessage with auth", async (t) => { const requests: { url: string; auth: string | null; body: any }[] = []; t.mock.method(globalThis, "fetch", async (url: any, init: any) => { - requests.push({ url: String(url), auth: new Headers(init.headers).get("authorization"), body: JSON.parse(init.body) }); + requests.push({ + url: String(url), + auth: new Headers(init.headers).get("authorization"), + body: JSON.parse(init.body), + }); return Response.json({ ok: true }); }); @@ -54,6 +65,8 @@ }); test("slackChannel surfaces ok:false API errors", async (t) => { - t.mock.method(globalThis, "fetch", async () => Response.json({ ok: false, error: "channel_not_found" })); + t.mock.method(globalThis, "fetch", async () => + Response.json({ ok: false, error: "channel_not_found" }), + ); await assert.rejects(slackChannel("t", "#nope").notifyMany([]), /channel_not_found/); }); diff --git a/src/notify.ts b/src/notify.ts --- a/src/notify.ts +++ b/src/notify.ts @@ -10,12 +10,15 @@ notifyMany(events: OpenMeetEvent[]): Promise; }>; -export const slackOne = (e: OpenMeetEvent): string => `:sparkles: *New event posted:* ${formatEvent(e)}`; +export const slackOne = (e: OpenMeetEvent): string => + `:sparkles: *New event posted:* ${formatEvent(e)}`; export const slackMany = (events: OpenMeetEvent[]): string => events.length === 0 ? ":calendar: No upcoming events this week." - : [":calendar: *Upcoming events this week:*", ...events.map((e) => `• ${formatEvent(e)}`)].join("\n"); + : [":calendar: *Upcoming events this week:*", ...events.map((e) => `• ${formatEvent(e)}`)].join( + "\n", + ); export const stdoutOne = (e: OpenMeetEvent): string => `New event: ${formatEvent(e)}`; @@ -32,13 +35,24 @@ }; } -export function slackChannel(token: string, channel: string, apiBase = "https://slack.com/api"): Channel { +export function slackChannel( + token: string, + channel: string, + apiBase = "https://slack.com/api", +): Channel { const post = async (text: string): Promise => { - const result = await fetchJson<{ ok: boolean; error?: string }>("slack post", `${apiBase}/chat.postMessage`, { - method: "POST", - headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json; charset=utf-8" }, - body: JSON.stringify({ channel, text }), - }); + const result = await fetchJson<{ ok: boolean; error?: string }>( + "slack post", + `${apiBase}/chat.postMessage`, + { + method: "POST", + headers: { + Authorization: `Bearer ${token}`, + "Content-Type": "application/json; charset=utf-8", + }, + body: JSON.stringify({ channel, text }), + }, + ); // Slack returns 200 with {"ok": false, "error": "..."} for API-level // failures (bad token, channel not found, etc.). if (!result.ok) throw new Error(`slack API error: ${result.error}`); diff --git a/src/openmeet.test.ts b/src/openmeet.test.ts --- a/src/openmeet.test.ts +++ b/src/openmeet.test.ts @@ -19,7 +19,12 @@ }; const events: OpenMeetEvent[] = [ - { name: "Hack Night", slug: "hack-night", startDate: "2026-06-15T18:00:00", endDate: "2026-06-15T20:00:00" }, + { + name: "Hack Night", + slug: "hack-night", + startDate: "2026-06-15T18:00:00", + endDate: "2026-06-15T20:00:00", + }, ]; // Routes fetch calls by URL path so a test can script each endpoint's @@ -99,7 +104,11 @@ assert.deepEqual(result.events, events); assert.equal(result.tokens.token, "access-2"); - assert.deepEqual(calls, ["/api/groups/devict/events", "/api/v1/auth/refresh", "/api/groups/devict/events"]); + assert.deepEqual(calls, [ + "/api/groups/devict/events", + "/api/v1/auth/refresh", + "/api/groups/devict/events", + ]); }); test("falls back to full re-auth when the refresh token is rejected", async (t) => { @@ -107,7 +116,8 @@ routeFetch(t, { ...authRoutes, "/api/v1/auth/refresh": () => new Response("nope", { status: 401 }), - "/api/groups/devict/events": () => (++eventCalls === 1 ? new Response("expired", { status: 401 }) : Response.json(events)), + "/api/groups/devict/events": () => + ++eventCalls === 1 ? new Response("expired", { status: 401 }) : Response.json(events), }); const tokens = { token: "stale", refreshToken: "stale", tokenExpires: 0 }; @@ -120,7 +130,8 @@ test("gives up after exhausting retries on persistent 401s", async (t) => { routeFetch(t, { "/api/groups/devict/events": () => new Response("expired", { status: 401 }), - "/api/v1/auth/refresh": () => Response.json({ token: "x", refreshToken: "y", tokenExpires: 9999 }), + "/api/v1/auth/refresh": () => + Response.json({ token: "x", refreshToken: "y", tokenExpires: 9999 }), }); const tokens = { token: "access-1", refreshToken: "refresh-1", tokenExpires: 9999 }; diff --git a/src/openmeet.ts b/src/openmeet.ts --- a/src/openmeet.ts +++ b/src/openmeet.ts @@ -38,11 +38,15 @@ SERVICE_DID, LEXICON_METHOD, ); - return fetchJson("token exchange", `${cfg.openMeetBaseUrl}/api/v1/auth/atproto/service-auth`, { - method: "POST", - headers: headers(), - body: JSON.stringify({ token: serviceToken }), - }); + return fetchJson( + "token exchange", + `${cfg.openMeetBaseUrl}/api/v1/auth/atproto/service-auth`, + { + method: "POST", + headers: headers(), + body: JSON.stringify({ token: serviceToken }), + }, + ); } // Mints a new access token from the refresh token; a 401 falls back to a @@ -76,7 +80,9 @@ tokens ??= await authenticate(cfg); for (let attempt = 1; ; attempt++) { try { - const events = await fetchJson("events fetch", url, { headers: headers(tokens) }); + const events = await fetchJson("events fetch", url, { + headers: headers(tokens), + }); return { events, tokens }; } catch (err) { if (err instanceof HttpError && err.status === 401 && attempt < 3) {