Skip to content

Commit bf99db4

Browse files
committed
fix(email): type the metadata slot lookup so the ratchet holds (#4509)
CI's slot-lookup ratchet caught the bridge's `ctx.getService('metadata')`: email-plugin.ts is grandfathered for its three existing erasures, and a new untyped lookup pushed it to four. Pass the slot's contract type (`IMetadataService`) as #4251 asks — which also gives the subscribe/get calls a real type instead of `any`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E5CYr5SDwe85gH2Jr5KSgu
1 parent 224d1f3 commit bf99db4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/plugins/plugin-email/src/email-plugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { IDataEngine } from '@objectstack/spec/contracts';
55
import type {
66
IEmailTransport,
77
EmailAddress,
8+
IMetadataService,
89
} from '@objectstack/spec/contracts';
910
import { SysEmail, SysEmailTemplate } from '@objectstack/platform-objects/audit';
1011
import { EmailService, LogTransport, type EmailPersistence, type TemplateLoader, type EmailTemplateRow } from './email-service.js';
@@ -415,8 +416,8 @@ export class EmailServicePlugin implements Plugin {
415416
ctx.logger.warn('EmailServicePlugin: template provenance stamp not bound: ' + (err?.message ?? err));
416417
}
417418

418-
let metadataService: any;
419-
try { metadataService = ctx.getService('metadata'); } catch { /* optional */ }
419+
let metadataService: IMetadataService | undefined;
420+
try { metadataService = ctx.getService<IMetadataService>('metadata'); } catch { /* optional */ }
420421

421422
try {
422423
await bootstrapDeclaredEmailTemplates(engine, metadataService, ctx.logger as any);

0 commit comments

Comments
 (0)