From 93885dfc54aef3a23d42c32549e95244d23873e7 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Fri, 11 Sep 2026 13:58:53 -0700 Subject: [PATCH] fix: email driver rename (#3853) --- src/puter-js/src/modules/Email.js | 9 +++++---- src/puter-js/tests/api/suites/system.suite.ts | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/puter-js/src/modules/Email.js b/src/puter-js/src/modules/Email.js index 6142e2137..0663fb0da 100644 --- a/src/puter-js/src/modules/Email.js +++ b/src/puter-js/src/modules/Email.js @@ -72,7 +72,8 @@ const preprocessSendArgs = (args) => { }; /** - * Transactional email from your app (the `puter-email` driver interface). + * Transactional email from your app (the `puter-transactional-email` driver + * interface). * * Every send must be authorized by a worker: either the worker calls * directly (`me.puter.email.sendTransactional(...)`), or a user calls with @@ -119,7 +120,7 @@ export class EmailModule extends PuterModule { * @type {EmailSendMethod} */ sendTransactional = utils.makeDriverMethod({ - iface: 'puter-email', + iface: 'puter-transactional-email', method: 'sendTransactional', argNames: ['to', 'subject', 'body'], preprocess: preprocessSendArgs, @@ -133,8 +134,8 @@ export class EmailModule extends PuterModule { * @type {EmailSendMethod} */ send = utils.makeDriverMethod({ - iface: 'puter-email', - method: 'send', + iface: 'puter-transactional-email', + method: 'sendTransactional', argNames: ['to', 'subject', 'body'], preprocess: preprocessSendArgs, }); diff --git a/src/puter-js/tests/api/suites/system.suite.ts b/src/puter-js/tests/api/suites/system.suite.ts index 50f0289c4..361f4f8df 100644 --- a/src/puter-js/tests/api/suites/system.suite.ts +++ b/src/puter-js/tests/api/suites/system.suite.ts @@ -167,7 +167,7 @@ export default suite('system', { t.assert.equal(error.code, 'not_found'); t.assert.equal( error.message, - 'Driver not found: puter-email:(no default)', + 'Driver not found: puter-transactional-email:(no default)', ); }, @@ -184,11 +184,12 @@ export default suite('system', { t.assert.equal(error.code, 'not_found'); t.assert.equal( error.message, - 'Driver not found: puter-email:(no default)', + 'Driver not found: puter-transactional-email:(no default)', ); }, - // `send` is the pre-rename alias: same wire shape, same error path. + // `send` is the deprecated alias that now targets `sendTransactional` + // directly, so both hit the same iface+method and the same error path. 'email.send and email.sendTransactional reject identically': async (t) => { const options = { to: 'nobody@example.com',