gemi 0.36.1 → 0.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../email/Email.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE,UAAU,aAAa,CAAC,CAAC,CAAE,SAAQ,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACvE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,KAAK;IAChB,IAAI,SAAM;IACV,EAAE,QAAM;IACR,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAgB;IACxD,EAAE,QAAM;IACR,GAAG,QAAM;IACT,WAAW,QAAM;IACjB,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;WAExB,IAAI,CAAC,CAAC,SAAS,KAAK,EAC/B,IAAI,EAAE,UAAU,CAAC,EACjB,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../email/Email.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE,UAAU,aAAa,CAAC,CAAC,CAAE,SA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fefr.js";import"../chunk-2vpsbhpm.js";import{render as G}from"jsx-email";import{jsx as H}from"react/jsx-runtime";class K{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;headers={};static async send(q){let k=new this,M=J.use().service.defaultLocale,y=w.use().service,{to:z=k.to,from:O=k.from,subject:A=typeof k.subject==="string"?k.subject:k.subject[q.locale||M],cc:P=k.cc,bcc:Q=k.bcc,attachments:R=k.attachments,data:B,headers:U={}}=q,V={...y.headers??{},...k.headers??{},...U??{}};if(!(await y.filterRecipients(z)).length)return;let[D,W]=await Promise.all([k.render({...B,locale:q.locale}),k.renderText({...B,locale:q.locale})]);if(process.env.EMAIL_DEBUG==="true"){let F=`${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${A}.html`;await Bun.write(F,D),Bun.spawnSync(["open",F]);return}await w.use().service.driver.send({bcc:Q,cc:P,from:O,subject:A,to:z,attachments:R,html:D,headers:V,text:W})}static async preview(q){return await new this().render({...q.data,locale:q.locale})}async render(q){let k=this.template;return await G(H(k,{...q}))}async renderText(q){let k=this.template;return await G(H(k,{...q}),{plainText:!0})}}export{K as Email};
|
|
2
|
+
import{W as w}from"../chunk-y5h3n5t8.js";import{X as J}from"../chunk-e4vawn5g.js";import"../chunk-8ty8fefr.js";import"../chunk-2vpsbhpm.js";import{render as G}from"jsx-email";import{jsx as H}from"react/jsx-runtime";class K{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;headers={};static async send(q){let k=new this,M=J.use().service.defaultLocale,y=w.use().service,{to:z=k.to,from:O=k.from,subject:A=typeof k.subject==="string"?k.subject:k.subject[q.locale||M],cc:P=k.cc,bcc:Q=k.bcc,attachments:R=k.attachments,data:B,headers:U={}}=q,V={...y.headers??{},...k.headers??{},...U??{}};if(!(await y.filterRecipients(z)).length)return;let[D,W]=await Promise.all([k.render({...B,locale:q.locale}),k.renderText({...B,locale:q.locale})]);if(process.env.EMAIL_DEBUG==="true"){let F=`${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${A}.html`;await Bun.write(F,D),Bun.spawnSync(["open",F]);return}await w.use().service.driver.send({bcc:Q,cc:P,from:O,subject:A,to:z,attachments:R,html:D,headers:V,text:W,scheduledAt:q.scheduledAt})}static async preview(q){return await new this().render({...q.data,locale:q.locale})}async render(q){let k=this.template;return await G(H(k,{...q}))}async renderText(q){let k=this.template;return await G(H(k,{...q}),{plainText:!0})}}export{K as Email};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=B2AE0B07CAC958F264756E2164756E21
|
package/dist/email/index.js.map
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../email/Email.tsx"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { ComponentType } from \"react\";\nimport { render } from \"jsx-email\";\nimport { EmailServiceContainer } from \"../services/email/EmailServiceContainer\";\nimport type { SendEmailParams } from \"../services/email/drivers/types\";\nimport { I18nServiceContainer } from \"../i18n/I18nServiceContainer\";\n\ninterface SendEmailArgs<T> extends Partial<Omit<SendEmailParams, \"html\">> {\n data: Omit<T, \"locale\">;\n locale?: string;\n}\n\nexport class Email {\n from = \"\";\n to = [];\n subject: string | Record<string, string> = \"No Subject\";\n cc = [];\n bcc = [];\n attachments = [];\n template: ComponentType<any>;\n headers: Record<string, string> = {};\n\n static async send<T extends Email>(\n this: new () => T,\n args: SendEmailArgs<T[\"template\"] extends (p: infer P) => any ? P : never>,\n ) {\n const instance = new this();\n\n const defaultLocale = I18nServiceContainer.use().service.defaultLocale;\n const emailService = EmailServiceContainer.use().service;\n\n const {\n to = instance.to,\n from = instance.from,\n subject = typeof instance.subject === \"string\"\n ? instance.subject\n : instance.subject[args.locale || defaultLocale],\n cc = instance.cc,\n bcc = instance.bcc,\n attachments = instance.attachments,\n data,\n headers = {},\n } = args;\n\n const _headers = {\n ...(emailService.headers ?? {}),\n ...(instance.headers ?? {}),\n ...(headers ?? {}),\n };\n\n const recipients = await emailService.filterRecipients(to);\n\n if (!recipients.length) {\n return;\n }\n\n const [html, text] = await Promise.all([\n instance.render({\n ...(data as any),\n locale: args.locale,\n }),\n instance.renderText({\n ...(data as any),\n locale: args.locale,\n }),\n ]);\n\n if (process.env.EMAIL_DEBUG === \"true\") {\n const fileName = `${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${subject}.html`;\n await Bun.write(fileName, html);\n Bun.spawnSync([\"open\", fileName]);\n return;\n }\n\n await EmailServiceContainer.use().service.driver.send({\n bcc,\n cc,\n from,\n subject,\n to,\n attachments,\n html,\n headers: _headers,\n text,\n });\n }\n\n static async preview<T extends Email>(\n this: new () => T,\n args: Pick<SendEmailArgs<T[\"template\"] extends (p: infer P) => any ? P : never>, \"data\" | \"locale\">,\n ) {\n\n const instance = new this();\n\n return await instance.render({\n ...args.data,\n locale: args.locale,\n })\n }\n\n protected async render<T extends Record<string, any>>(props: T) {\n const Template = this.template;\n return await render(<Template {...props} />);\n }\n\n protected async renderText<T extends Record<string, any>>(props: T) {\n const Template = this.template;\n return await render(<Template {...props} />, { plainText: true });\n }\n}\n"
|
|
5
|
+
"import type { ComponentType } from \"react\";\nimport { render } from \"jsx-email\";\nimport { EmailServiceContainer } from \"../services/email/EmailServiceContainer\";\nimport type { SendEmailParams } from \"../services/email/drivers/types\";\nimport { I18nServiceContainer } from \"../i18n/I18nServiceContainer\";\n\ninterface SendEmailArgs<T> extends Partial<Omit<SendEmailParams, \"html\">> {\n data: Omit<T, \"locale\">;\n locale?: string;\n}\n\nexport class Email {\n from = \"\";\n to = [];\n subject: string | Record<string, string> = \"No Subject\";\n cc = [];\n bcc = [];\n attachments = [];\n template: ComponentType<any>;\n headers: Record<string, string> = {};\n\n static async send<T extends Email>(\n this: new () => T,\n args: SendEmailArgs<T[\"template\"] extends (p: infer P) => any ? P : never>,\n ) {\n const instance = new this();\n\n const defaultLocale = I18nServiceContainer.use().service.defaultLocale;\n const emailService = EmailServiceContainer.use().service;\n\n const {\n to = instance.to,\n from = instance.from,\n subject = typeof instance.subject === \"string\"\n ? instance.subject\n : instance.subject[args.locale || defaultLocale],\n cc = instance.cc,\n bcc = instance.bcc,\n attachments = instance.attachments,\n data,\n headers = {},\n } = args;\n\n const _headers = {\n ...(emailService.headers ?? {}),\n ...(instance.headers ?? {}),\n ...(headers ?? {}),\n };\n\n const recipients = await emailService.filterRecipients(to);\n\n if (!recipients.length) {\n return;\n }\n\n const [html, text] = await Promise.all([\n instance.render({\n ...(data as any),\n locale: args.locale,\n }),\n instance.renderText({\n ...(data as any),\n locale: args.locale,\n }),\n ]);\n\n if (process.env.EMAIL_DEBUG === \"true\") {\n const fileName = `${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${subject}.html`;\n await Bun.write(fileName, html);\n Bun.spawnSync([\"open\", fileName]);\n return;\n }\n\n await EmailServiceContainer.use().service.driver.send({\n bcc,\n cc,\n from,\n subject,\n to,\n attachments,\n html,\n headers: _headers,\n text,\n scheduledAt: args.scheduledAt,\n });\n }\n\n static async preview<T extends Email>(\n this: new () => T,\n args: Pick<SendEmailArgs<T[\"template\"] extends (p: infer P) => any ? P : never>, \"data\" | \"locale\">,\n ) {\n\n const instance = new this();\n\n return await instance.render({\n ...args.data,\n locale: args.locale,\n })\n }\n\n protected async render<T extends Record<string, any>>(props: T) {\n const Template = this.template;\n return await render(<Template {...props} />);\n }\n\n protected async renderText<T extends Record<string, any>>(props: T) {\n const Template = this.template;\n return await render(<Template {...props} />, { plainText: true });\n }\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";2JACA,YAAS,qDAUF,CAAM,CAAM,CACjB,KAAO,GACP,GAAK,CAAC,EACN,QAA2C,aAC3C,GAAK,CAAC,EACN,IAAM,CAAC,EACP,YAAc,CAAC,EACf,SACA,QAAkC,CAAC,cAEtB,KAAqB,CAEhC,EACA,CACA,IAAM,EAAW,IAAI,KAEf,EAAgB,EAAqB,IAAI,EAAE,QAAQ,cACnD,EAAe,EAAsB,IAAI,E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GACd,MAAM,EAAS,IACf,cAAc,EAAS,YACvB,OACA,UAAU,CAAC,GACT,EAEE,EAAW,IACX,EAAa,SAAW,CAAC,KACzB,EAAS,SAAW,CAAC,KACrB,GAAW,CAAC,CAClB,EAIA,GAAI,EAFe,MAAM,EAAa,iBAAiB,CAAE,GAEzC,OACd,OAGF,IAAO,EAAM,GAAQ,MAAM,QAAQ,IAAI,CACrC,EAAS,OAAO,IACV,EACJ,OAAQ,EAAK,MACf,CAAC,EACD,EAAS,WAAW,IACd,EACJ,OAAQ,EAAK,MACf,CAAC,CACH,CAAC,EAED,GAAI,QAAQ,IAAI,cAAgB,OAAQ,CACtC,IAAM,EAAW,GAAG,QAAQ,IAAI,0BAA0B,IAAI,KAAK,EAAE,YAAY,IAAI,SACrF,MAAM,IAAI,MAAM,EAAU,CAAI,EAC9B,IAAI,UAAU,CAAC,OAAQ,CAAQ,CAAC,EAChC,OAGF,MAAM,EAAsB,IAAI,EAAE,QAAQ,OAAO,KAAK,CACpD,MACA,KACA,OACA,UACA,KACA,cACA,OACA,QAAS,EACT,OACA,YAAa,EAAK,WACpB,CAAC,cAGU,QAAwB,CAEnC,EACA,CAIA,OAAO,MAFU,IAAI,KAAK,EAEJ,OAAO,IACxB,EAAK,KACR,OAAQ,EAAK,MACf,CAAC,OAGa,OAAqC,CAAC,EAAU,CAC9D,IAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,EAAC,EAAD,IAAc,EAAO,CAAE,OAG7B,WAAyC,CAAC,EAAU,CAClE,IAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,EAAC,EAAD,IAAc,EAAO,EAAI,CAAE,UAAW,EAAK,CAAC,EAEpE",
|
|
8
|
+
"debugId": "B2AE0B07CAC958F264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../services/email/drivers/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../services/email/drivers/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|