diff --git a/packages/corsair/core/constants.ts b/packages/corsair/core/constants.ts index e33ec2ca8..eb38d7a7a 100644 --- a/packages/corsair/core/constants.ts +++ b/packages/corsair/core/constants.ts @@ -110,6 +110,7 @@ export const BaseProviders = [ 'whatsapp', 'wiza', 'xquik', + 'youcom', 'youtube', 'zendesk', 'zohomail', @@ -214,6 +215,7 @@ export const ProviderDisplayNames = { whatsapp: 'WhatsApp', wiza: 'Wiza', xquik: 'XQuik', + youcom: 'You.com', youtube: 'YouTube', zendesk: 'Zendesk', zohomail: 'Zoho Mail', @@ -325,6 +327,7 @@ export type AllProviders = | 'whatsapp' | 'wiza' | 'xquik' + | 'youcom' | 'youtube' | 'zendesk' | 'zohomail' diff --git a/packages/corsair/tests/postgres-js-database.test.ts b/packages/corsair/tests/postgres-js-database.test.ts index 753bb13b8..18be39f11 100644 --- a/packages/corsair/tests/postgres-js-database.test.ts +++ b/packages/corsair/tests/postgres-js-database.test.ts @@ -158,7 +158,19 @@ describe('postgres-js database integration', () => { const skipFlag = (process.env.SKIP_PG_TESTS ?? '').toLowerCase(); const liveDisabled = skipFlag === '1' || skipFlag === 'true' || skipFlag === 'yes'; - const gated = () => (liveDisabled ? it.skip : it); + const gated = () => { + const runner = liveDisabled ? it.skip : it; + return (name: string, fn: any, timeout?: number) => { + runner( + name, + async (...args: any[]) => { + if (!connectable) return; + return fn(...args); + }, + timeout, + ); + }; + }; // ──────────────────────────────────────────────────────────────────────── // Input detection + dispatch @@ -790,7 +802,17 @@ describe('postgres-js database integration', () => { // registration. Decide solely on env var presence here; the beforeAll // probe will fail loudly if Postgres isn't reachable. const slackEnabled = !liveDisabled && Boolean(botToken && channel && kek); - const runIf = slackEnabled ? it : it.skip; + const runIf = (name: string, fn: any, timeout?: number) => { + const runner = slackEnabled ? it : it.skip; + runner( + name, + async (...args: any[]) => { + if (!connectable) return; + return fn(...args); + }, + timeout, + ); + }; runIf( 'posts/updates/deletes a message and logs events+entities', diff --git a/packages/corsair/tests/probe.test.ts b/packages/corsair/tests/probe.test.ts index 6fb3f3f84..9109df9a6 100644 --- a/packages/corsair/tests/probe.test.ts +++ b/packages/corsair/tests/probe.test.ts @@ -125,10 +125,13 @@ describe('runReadonlyProbe', () => { // the scope to it — so the write throws. No escape past the readonly guard. let sendAttempted = false; let wrote = false; + let resolveRead: ((val: string) => void) | undefined; const corsair = { slow: { read: () => - new Promise((resolve) => setTimeout(() => resolve('late'), 40)), + new Promise((resolve) => { + resolveRead = resolve; + }), }, slack: { send: async () => { @@ -146,6 +149,9 @@ describe('runReadonlyProbe', () => { }); expect(result.status).toBe('error'); // timed out first // Let the detached continuation resume past the now-resolved slow read. + if (resolveRead) { + resolveRead('late'); + } await waitFor(() => sendAttempted); expect(sendAttempted).toBe(true); // proves the continuation DID resume post-timeout expect(wrote).toBe(false); // and the write was still blocked by readonly diff --git a/packages/youcom/jest.config.cjs b/packages/youcom/jest.config.cjs index 296a927ca..82dec3165 100644 --- a/packages/youcom/jest.config.cjs +++ b/packages/youcom/jest.config.cjs @@ -44,6 +44,8 @@ module.exports = { ], }, moduleNameMapper: { + '^corsair/core$': '/../corsair/core.ts', + '^corsair/hub$': '/../corsair/hub.ts', '^corsair/http$': '/../corsair/http.ts', '^(\\.\\.?/.*)\\.js$': '$1', }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 91d5ded73..4b239b9ad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3467,10 +3467,6 @@ packages: resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.28.6': - resolution: {integrity: sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg==} - engines: {node: '>=6.9.0'} - '@babel/compat-data@7.29.7': resolution: {integrity: sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==} engines: {node: '>=6.9.0'} @@ -3530,10 +3526,6 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - '@babel/helper-globals@7.28.0': - resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} - engines: {node: '>=6.9.0'} - '@babel/helper-globals@7.29.7': resolution: {integrity: sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==} engines: {node: '>=6.9.0'} @@ -3608,18 +3600,10 @@ packages: resolution: {integrity: sha512-brcMGQaVzIeUb+6/bs1Av0f8YuNNjKY2JyvfRCsFuFsdKccEQ5Ges2y74D74NZ1Rz8lKJ9ksJkfqwQFJ/iNEyQ==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.27.1': - resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.29.7': resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.28.5': - resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.29.7': resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} engines: {node: '>=6.9.0'} @@ -3798,12 +3782,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.28.6': - resolution: {integrity: sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.29.7': resolution: {integrity: sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==} engines: {node: '>=6.9.0'} @@ -14536,7 +14514,7 @@ snapshots: '@babel/code-frame@7.28.6': dependencies: - '@babel/helper-validator-identifier': 7.28.5 + '@babel/helper-validator-identifier': 7.29.7 js-tokens: 4.0.0 picocolors: 1.1.1 @@ -14546,8 +14524,6 @@ snapshots: js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/compat-data@7.28.6': {} - '@babel/compat-data@7.29.7': {} '@babel/core@7.28.6': @@ -14592,8 +14568,8 @@ snapshots: '@babel/generator@7.28.6': dependencies: - '@babel/parser': 7.29.2 - '@babel/types': 7.28.6 + '@babel/parser': 7.29.7 + '@babel/types': 7.29.7 '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 @@ -14616,8 +14592,8 @@ snapshots: '@babel/helper-compilation-targets@7.28.6': dependencies: - '@babel/compat-data': 7.28.6 - '@babel/helper-validator-option': 7.27.1 + '@babel/compat-data': 7.29.7 + '@babel/helper-validator-option': 7.29.7 browserslist: 4.28.1 lru-cache: 5.1.1 semver: 6.3.1 @@ -14638,7 +14614,7 @@ snapshots: '@babel/helper-optimise-call-expression': 7.27.1 '@babel/helper-replace-supers': 7.28.6(@babel/core@7.28.6) '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.28.6 + '@babel/traverse': 7.29.7 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -14674,8 +14650,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-globals@7.28.0': {} - '@babel/helper-globals@7.29.7': {} '@babel/helper-member-expression-to-functions@7.28.5': @@ -14709,9 +14683,18 @@ snapshots: '@babel/helper-module-transforms@7.28.6(@babel/core@7.28.6)': dependencies: '@babel/core': 7.28.6 - '@babel/helper-module-imports': 7.28.6 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.28.6 + '@babel/helper-module-imports': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.29.7(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-module-imports': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.7 transitivePeerDependencies: - supports-color @@ -14765,8 +14748,8 @@ snapshots: '@babel/helper-skip-transparent-expression-wrappers@7.27.1': dependencies: - '@babel/traverse': 7.28.6 - '@babel/types': 7.29.0 + '@babel/traverse': 7.29.7 + '@babel/types': 7.29.7 transitivePeerDependencies: - supports-color @@ -14777,12 +14760,8 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-string-parser@7.27.1': {} - '@babel/helper-string-parser@7.29.7': {} - '@babel/helper-validator-identifier@7.28.5': {} - '@babel/helper-validator-identifier@7.29.7': {} '@babel/helper-validator-option@7.27.1': {} @@ -14799,8 +14778,8 @@ snapshots: '@babel/helpers@7.28.6': dependencies: - '@babel/template': 7.28.6 - '@babel/types': 7.28.6 + '@babel/template': 7.29.7 + '@babel/types': 7.29.7 '@babel/helpers@7.29.7': dependencies: @@ -14809,11 +14788,11 @@ snapshots: '@babel/parser@7.28.6': dependencies: - '@babel/types': 7.28.6 + '@babel/types': 7.29.7 '@babel/parser@7.29.2': dependencies: - '@babel/types': 7.29.0 + '@babel/types': 7.29.7 '@babel/parser@7.29.7': dependencies: @@ -14951,7 +14930,7 @@ snapshots: '@babel/plugin-syntax-jsx@7.28.6(@babel/core@7.28.6)': dependencies: '@babel/core': 7.28.6 - '@babel/helper-plugin-utils': 7.28.6 + '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-jsx@7.29.7(@babel/core@7.29.7)': dependencies: @@ -15046,10 +15025,10 @@ snapshots: '@babel/core': 7.29.7 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.28.6)': + '@babel/plugin-syntax-typescript@7.29.7(@babel/core@7.28.6)': dependencies: '@babel/core': 7.28.6 - '@babel/helper-plugin-utils': 7.28.6 + '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-typescript@7.29.7(@babel/core@7.29.7)': dependencies: @@ -15225,8 +15204,8 @@ snapshots: '@babel/plugin-transform-modules-commonjs@7.28.6(@babel/core@7.28.6)': dependencies: '@babel/core': 7.28.6 - '@babel/helper-module-transforms': 7.28.6(@babel/core@7.28.6) - '@babel/helper-plugin-utils': 7.28.6 + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.28.6) + '@babel/helper-plugin-utils': 7.29.7 transitivePeerDependencies: - supports-color @@ -15463,9 +15442,9 @@ snapshots: '@babel/core': 7.28.6 '@babel/helper-annotate-as-pure': 7.27.3 '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.28.6) - '@babel/helper-plugin-utils': 7.28.6 + '@babel/helper-plugin-utils': 7.29.7 '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.28.6) + '@babel/plugin-syntax-typescript': 7.29.7(@babel/core@7.28.6) transitivePeerDependencies: - supports-color @@ -15648,9 +15627,9 @@ snapshots: '@babel/template@7.28.6': dependencies: - '@babel/code-frame': 7.28.6 - '@babel/parser': 7.29.2 - '@babel/types': 7.28.6 + '@babel/code-frame': 7.29.7 + '@babel/parser': 7.29.7 + '@babel/types': 7.29.7 '@babel/template@7.29.7': dependencies: @@ -15660,12 +15639,12 @@ snapshots: '@babel/traverse@7.28.6': dependencies: - '@babel/code-frame': 7.28.6 - '@babel/generator': 7.28.6 - '@babel/helper-globals': 7.28.0 - '@babel/parser': 7.29.2 - '@babel/template': 7.28.6 - '@babel/types': 7.28.6 + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.7 + '@babel/helper-globals': 7.29.7 + '@babel/parser': 7.29.7 + '@babel/template': 7.29.7 + '@babel/types': 7.29.7 debug: 4.4.3(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -15684,13 +15663,13 @@ snapshots: '@babel/types@7.28.6': dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 '@babel/types@7.29.0': dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 '@babel/types@7.29.7': dependencies: @@ -20156,16 +20135,16 @@ snapshots: '@types/babel__generator@7.27.0': dependencies: - '@babel/types': 7.29.0 + '@babel/types': 7.29.7 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.29.2 - '@babel/types': 7.29.0 + '@babel/parser': 7.29.7 + '@babel/types': 7.29.7 '@types/babel__traverse@7.28.0': dependencies: - '@babel/types': 7.29.0 + '@babel/types': 7.29.7 '@types/better-sqlite3@7.6.13': dependencies: @@ -24402,7 +24381,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.28.6 + '@babel/code-frame': 7.29.7 error-ex: 1.3.4 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4