@miguelmorales13/nestkit 0.24.0 → 0.25.0
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.
- package/README.md +11 -3
- package/dist/auth/index.cjs +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/oauth/index.cjs +1 -1
- package/dist/auth/oauth/index.js +1 -1
- package/dist/bootstrap/index.cjs +4 -4
- package/dist/bootstrap/index.js +3 -3
- package/dist/{chunk-ALIKVFOV.cjs → chunk-FNUZGYUF.cjs} +2 -2
- package/dist/{chunk-PFHHLB7B.js → chunk-UNEVXCFW.js} +1 -1
- package/dist/email/adapters/zeptomail.email.d.ts +27 -0
- package/dist/email/email.module.d.ts +2 -1
- package/dist/email/email.options.d.ts +10 -1
- package/dist/email/index.cjs +90 -10
- package/dist/email/index.d.ts +2 -1
- package/dist/email/index.js +89 -9
- package/dist/errors/index.cjs +5 -5
- package/dist/errors/index.js +4 -4
- package/dist/index.cjs +17 -17
- package/dist/index.js +19 -19
- package/package.json +1 -1
- package/dist/{chunk-2DUEQKOI.js → chunk-A2DGK4ZL.js} +3 -3
- package/dist/{chunk-LSDY6ETG.cjs → chunk-MSTXS3MU.cjs} +3 -3
package/README.md
CHANGED
|
@@ -1807,7 +1807,7 @@ suscripción que `PushManager.subscribe()` devuelve.
|
|
|
1807
1807
|
### `email` — correo transaccional con el proveedor como configuración
|
|
1808
1808
|
|
|
1809
1809
|
Un puerto, `EmailPort`, y el proveedor detrás se elige en una línea: **Resend**, **Brevo** (antes
|
|
1810
|
-
Sendinblue) o **cualquier servidor SMTP** vía Nodemailer. Mismo patrón que `storage`: nada en la
|
|
1810
|
+
Sendinblue), **ZeptoMail** (Zoho) o **cualquier servidor SMTP** vía Nodemailer. Mismo patrón que `storage`: nada en la
|
|
1811
1811
|
app depende de un cliente concreto, así que cambiar de proveedor no toca ninguna llamada.
|
|
1812
1812
|
|
|
1813
1813
|
```ts
|
|
@@ -1817,6 +1817,7 @@ import { EmailModule } from '@miguelmorales13/nestkit/email';
|
|
|
1817
1817
|
imports: [
|
|
1818
1818
|
EmailModule.forRoot({ provider: 'brevo' }), // lee BREVO_API_KEY y EMAIL_FROM
|
|
1819
1819
|
// EmailModule.forRoot({ provider: 'resend', from: 'Mi App <hola@miapp.mx>' }),
|
|
1820
|
+
// EmailModule.forRoot({ provider: 'zeptomail' }), // lee ZEPTOMAIL_API_KEY y EMAIL_FROM
|
|
1820
1821
|
// EmailModule.forRoot({ provider: 'smtp', smtp: { host, port: 587, user, password } }),
|
|
1821
1822
|
// EmailModule.forRoot({ provider: 'memory' }), // pruebas y desarrollo: nadie recibe nada
|
|
1822
1823
|
],
|
|
@@ -1846,7 +1847,7 @@ export class NotificationsService {
|
|
|
1846
1847
|
|
|
1847
1848
|
Lo que no pases en código sale del entorno: `EMAIL_PROVIDER`, `EMAIL_FROM`, `EMAIL_REPLY_TO`;
|
|
1848
1849
|
`RESEND_API_KEY`; `SMTP_HOST`, `SMTP_PORT`, `SMTP_SECURE`, `SMTP_USER`, `SMTP_PASSWORD`;
|
|
1849
|
-
`BREVO_API_KEY`. **No hay proveedor por defecto**: sin `provider` ni `EMAIL_PROVIDER` el módulo
|
|
1850
|
+
`BREVO_API_KEY`; `ZEPTOMAIL_API_KEY`, `ZEPTOMAIL_BASE_URL`. **No hay proveedor por defecto**: sin `provider` ni `EMAIL_PROVIDER` el módulo
|
|
1850
1851
|
falla al cablear, no en el primer envío. Lo mismo si el proveedor elegido no tiene credenciales.
|
|
1851
1852
|
|
|
1852
1853
|
El mensaje es el mismo para los tres —`from`, `to`/`cc`/`bcc`, `replyTo`, `subject`, `text`/`html`,
|
|
@@ -1862,6 +1863,13 @@ de su lista** (pdf, docx, xlsx, csv, png, jpg, zip… — un `.exe` o un `.json`
|
|
|
1862
1863
|
SMTP (`smtp-relay.brevo.com:587`, login + clave SMTP) también funciona con `provider: 'smtp'`, por
|
|
1863
1864
|
si se prefiere.
|
|
1864
1865
|
|
|
1866
|
+
**ZeptoMail** (el servicio transaccional de Zoho, centavos por correo) también va por REST con
|
|
1867
|
+
`fetch`: un `POST /email` con el token del Mail Agent en `Authorization: Zoho-enczapikey <token>`.
|
|
1868
|
+
Cosas a saber: el dominio del `from` debe estar verificado en ZeptoMail (SPF + DKIM) o responde 4xx;
|
|
1869
|
+
el token vive en un centro de datos, así que una cuenta `.eu`, `.in` o `.com.au` debe poner su host
|
|
1870
|
+
en `ZEPTOMAIL_BASE_URL` (`https://api.zeptomail.eu/v1.1`) o todo envío da 401; no tiene campo de
|
|
1871
|
+
etiquetas, por lo que los `tags` salen como cabeceras `X-Tag-<nombre>` como en SMTP.
|
|
1872
|
+
|
|
1865
1873
|
Los SDKs de Resend y Nodemailer se cargan **perezosamente en el primer envío**: una app en Brevo no
|
|
1866
1874
|
instala ninguno de los dos. `memory` guarda cada mensaje en `MemoryEmail.sent` — el buzón de salida
|
|
1867
1875
|
de las pruebas.
|
|
@@ -2055,7 +2063,7 @@ trae los datos.
|
|
|
2055
2063
|
| `@miguelmorales13/nestkit/payments` | `PaymentsModule`, `TERMINAL_PAYMENTS`, `TerminalPaymentsPort`, adaptadores `MercadoPagoTerminalPayments`/`ClipTerminalPayments`, `MercadoPagoConnect` (OAuth marketplace), `isIntegrableTerminalModel`, `createTerminalPaymentsWebhookController` |
|
|
2056
2064
|
| `@miguelmorales13/nestkit/storage` | `StorageModule`, `STORAGE`, `StoragePort`, adaptadores `LocalStorage`/`S3Storage`/`BunnyStorage` |
|
|
2057
2065
|
| `@miguelmorales13/nestkit/push` | `PushModule`, `PUSH`, `PushPort`, `PUSH_DEVICE_STORE`, `PushDeviceStorePort`, canales `FcmChannel`/`WebPushChannel`, `toFcmMessage` |
|
|
2058
|
-
| `@miguelmorales13/nestkit/email` | `EmailModule`, `EMAIL`, `EmailPort`, adaptadores `ResendEmail`/`SmtpEmail`/`BrevoEmail`/`MemoryEmail` |
|
|
2066
|
+
| `@miguelmorales13/nestkit/email` | `EmailModule`, `EMAIL`, `EmailPort`, adaptadores `ResendEmail`/`SmtpEmail`/`BrevoEmail`/`ZeptoMailEmail`/`MemoryEmail` |
|
|
2059
2067
|
| `@miguelmorales13/nestkit/email/resend` | `ResendModule`, `RESEND_CLIENT` |
|
|
2060
2068
|
| `@miguelmorales13/nestkit/email/nodemailer` | `NodemailerModule`, `NODEMAILER_TRANSPORT` |
|
|
2061
2069
|
| `@miguelmorales13/nestkit/i18n` | `I18nModule`, `t`, `translate`, `currentLanguage`, `I18nInterceptor`, `TranslatorPort`, `NestI18nTranslator`, `translateOr` |
|
package/dist/auth/index.cjs
CHANGED
|
@@ -8,8 +8,8 @@ var _chunkFH5UNWWWcjs = require('../chunk-FH5UNWWW.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkHDFPSA2Vcjs = require('../chunk-HDFPSA2V.cjs');
|
|
11
|
-
require('../chunk-Q5Y33L7B.cjs');
|
|
12
11
|
require('../chunk-SDWHKPXI.cjs');
|
|
12
|
+
require('../chunk-Q5Y33L7B.cjs');
|
|
13
13
|
require('../chunk-PNK5WMPP.cjs');
|
|
14
14
|
|
|
15
15
|
|
package/dist/auth/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
ForbiddenAppException,
|
|
9
9
|
UnauthorizedAppException
|
|
10
10
|
} from "../chunk-ZFIDAX7K.js";
|
|
11
|
-
import "../chunk-M3GQDRWR.js";
|
|
12
11
|
import "../chunk-ETRUVZTJ.js";
|
|
12
|
+
import "../chunk-M3GQDRWR.js";
|
|
13
13
|
import "../chunk-VVMRZEIW.js";
|
|
14
14
|
import {
|
|
15
15
|
__decorateClass,
|
|
@@ -7,8 +7,8 @@ var _chunkFH5UNWWWcjs = require('../../chunk-FH5UNWWW.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkHDFPSA2Vcjs = require('../../chunk-HDFPSA2V.cjs');
|
|
10
|
-
require('../../chunk-Q5Y33L7B.cjs');
|
|
11
10
|
require('../../chunk-SDWHKPXI.cjs');
|
|
11
|
+
require('../../chunk-Q5Y33L7B.cjs');
|
|
12
12
|
require('../../chunk-PNK5WMPP.cjs');
|
|
13
13
|
|
|
14
14
|
|
package/dist/auth/oauth/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
UnauthorizedAppException,
|
|
8
8
|
ValidationAppException
|
|
9
9
|
} from "../../chunk-ZFIDAX7K.js";
|
|
10
|
-
import "../../chunk-M3GQDRWR.js";
|
|
11
10
|
import "../../chunk-ETRUVZTJ.js";
|
|
11
|
+
import "../../chunk-M3GQDRWR.js";
|
|
12
12
|
import "../../chunk-VVMRZEIW.js";
|
|
13
13
|
import {
|
|
14
14
|
__decorateClass,
|
package/dist/bootstrap/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFNUZGYUFcjs = require('../chunk-FNUZGYUF.cjs');
|
|
4
4
|
require('../chunk-3AUOOEQO.cjs');
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-Q5Y33L7B.cjs');
|
|
5
|
+
require('../chunk-MSTXS3MU.cjs');
|
|
7
6
|
require('../chunk-AXMW5JF7.cjs');
|
|
8
7
|
require('../chunk-Y72D5L6I.cjs');
|
|
9
8
|
require('../chunk-SDWHKPXI.cjs');
|
|
9
|
+
require('../chunk-Q5Y33L7B.cjs');
|
|
10
10
|
require('../chunk-PNK5WMPP.cjs');
|
|
11
11
|
require('../chunk-2REOCMUD.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.applyNestKitDefaults =
|
|
14
|
+
exports.applyNestKitDefaults = _chunkFNUZGYUFcjs.applyNestKitDefaults;
|
package/dist/bootstrap/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyNestKitDefaults
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-UNEVXCFW.js";
|
|
4
4
|
import "../chunk-DYHSOULW.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-M3GQDRWR.js";
|
|
5
|
+
import "../chunk-A2DGK4ZL.js";
|
|
7
6
|
import "../chunk-X4PQJZ4G.js";
|
|
8
7
|
import "../chunk-TCAMLNUZ.js";
|
|
9
8
|
import "../chunk-ETRUVZTJ.js";
|
|
9
|
+
import "../chunk-M3GQDRWR.js";
|
|
10
10
|
import "../chunk-VVMRZEIW.js";
|
|
11
11
|
import "../chunk-4MGIQFAJ.js";
|
|
12
12
|
export {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk3AUOOEQOcjs = require('./chunk-3AUOOEQO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkMSTXS3MUcjs = require('./chunk-MSTXS3MU.cjs');
|
|
7
7
|
|
|
8
8
|
// src/bootstrap/apply-defaults.ts
|
|
9
9
|
|
|
@@ -17,7 +17,7 @@ function applyNestKitDefaults(app, options = {}) {
|
|
|
17
17
|
app.useGlobalPipes(
|
|
18
18
|
new (0, _common.ValidationPipe)({ whitelist: true, transform: true, ...options.validation })
|
|
19
19
|
);
|
|
20
|
-
app.useGlobalFilters(new (0,
|
|
20
|
+
app.useGlobalFilters(new (0, _chunkMSTXS3MUcjs.GlobalExceptionFilter)());
|
|
21
21
|
app.useGlobalInterceptors(new (0, _chunk3AUOOEQOcjs.ResponseInterceptor)());
|
|
22
22
|
if (options.swagger !== false) {
|
|
23
23
|
const swaggerOptions = _nullishCoalesce(options.swagger, () => ( { title: "API" }));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ZeptoMailEmailOptions } from '../email.options.js';
|
|
2
|
+
import { type EmailMessage, type EmailPort, type SentEmail } from '../email.port.js';
|
|
3
|
+
/**
|
|
4
|
+
* ZeptoMail (Zoho's transactional service) over its REST API — one `POST
|
|
5
|
+
* /email` with the Send Mail token in `Authorization: Zoho-enczapikey <token>`.
|
|
6
|
+
* No SDK, for the same reason as `brevo`: the call is a dozen lines of `fetch`.
|
|
7
|
+
*
|
|
8
|
+
* The token is per Mail Agent and lives in a data centre: a `.eu`, `.in` or
|
|
9
|
+
* `.com.au` account must point `baseUrl` at its own host
|
|
10
|
+
* (`https://api.zeptomail.eu/v1.1`), or every send answers 401.
|
|
11
|
+
*
|
|
12
|
+
* The `from` domain has to be verified in ZeptoMail (SPF + DKIM) before it
|
|
13
|
+
* sends; until then the API answers 4xx and this adapter raises it.
|
|
14
|
+
* Attachments travel base64-encoded inside the JSON. `tags` have no field
|
|
15
|
+
* here, so they go out as `X-Tag-<name>` headers, as in the SMTP adapter.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ZeptoMailEmail implements EmailPort {
|
|
18
|
+
private readonly options;
|
|
19
|
+
private readonly defaults;
|
|
20
|
+
private readonly baseUrl;
|
|
21
|
+
private readonly fetchImpl;
|
|
22
|
+
constructor(options: ZeptoMailEmailOptions, defaults?: {
|
|
23
|
+
from?: string;
|
|
24
|
+
replyTo?: string;
|
|
25
|
+
});
|
|
26
|
+
send(input: EmailMessage): Promise<SentEmail>;
|
|
27
|
+
}
|
|
@@ -8,7 +8,8 @@ import { type EmailPort } from './email.port.js';
|
|
|
8
8
|
*
|
|
9
9
|
* Recognised vars: `EMAIL_PROVIDER`, `EMAIL_FROM`, `EMAIL_REPLY_TO`; resend
|
|
10
10
|
* `RESEND_API_KEY`; smtp `SMTP_HOST`, `SMTP_PORT`, `SMTP_SECURE`, `SMTP_USER`,
|
|
11
|
-
* `SMTP_PASSWORD`; brevo `BREVO_API_KEY`, `BREVO_BASE_URL
|
|
11
|
+
* `SMTP_PASSWORD`; brevo `BREVO_API_KEY`, `BREVO_BASE_URL`; zeptomail `ZEPTOMAIL_API_KEY`,
|
|
12
|
+
* `ZEPTOMAIL_BASE_URL`.
|
|
12
13
|
*/
|
|
13
14
|
export declare function resolveEmailOptions(options?: EmailOptions): EmailOptions;
|
|
14
15
|
/** Constructs the adapter the options select, failing loudly on missing config. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** DI token carrying the resolved {@link EmailOptions}. */
|
|
2
2
|
export declare const EMAIL_OPTIONS: unique symbol;
|
|
3
3
|
/** Which adapter backs the {@link EmailPort}. */
|
|
4
|
-
export type EmailProvider = 'resend' | 'smtp' | 'brevo' | 'memory';
|
|
4
|
+
export type EmailProvider = 'resend' | 'smtp' | 'brevo' | 'zeptomail' | 'memory';
|
|
5
5
|
export interface ResendEmailOptions {
|
|
6
6
|
apiKey: string;
|
|
7
7
|
}
|
|
@@ -26,6 +26,14 @@ export interface BrevoEmailOptions {
|
|
|
26
26
|
/** For tests. Defaults to the global `fetch`. */
|
|
27
27
|
fetchImpl?: typeof fetch;
|
|
28
28
|
}
|
|
29
|
+
export interface ZeptoMailEmailOptions {
|
|
30
|
+
/** The Mail Agent's Send Mail token (the value after `Zoho-enczapikey`). */
|
|
31
|
+
apiKey: string;
|
|
32
|
+
/** Defaults to `https://api.zeptomail.com/v1.1`; other data centres use `.eu`, `.in`, `.com.au`… */
|
|
33
|
+
baseUrl?: string;
|
|
34
|
+
/** For tests. Defaults to the global `fetch`. */
|
|
35
|
+
fetchImpl?: typeof fetch;
|
|
36
|
+
}
|
|
29
37
|
export interface EmailOptions {
|
|
30
38
|
/** Read from `EMAIL_PROVIDER` when omitted. There is no default: a misconfigured app must not send nowhere in silence. */
|
|
31
39
|
provider?: EmailProvider;
|
|
@@ -36,4 +44,5 @@ export interface EmailOptions {
|
|
|
36
44
|
resend?: ResendEmailOptions;
|
|
37
45
|
smtp?: SmtpEmailOptions;
|
|
38
46
|
brevo?: BrevoEmailOptions;
|
|
47
|
+
zeptomail?: ZeptoMailEmailOptions;
|
|
39
48
|
}
|
package/dist/email/index.cjs
CHANGED
|
@@ -28,19 +28,19 @@ var EMAIL_OPTIONS = /* @__PURE__ */ Symbol("EMAIL_OPTIONS");
|
|
|
28
28
|
|
|
29
29
|
// src/email/address.ts
|
|
30
30
|
var NAMED = /^\s*(?:"?([^"]*)"?\s*)?<\s*([^<>\s]+)\s*>\s*$/;
|
|
31
|
-
function parseAddress(
|
|
32
|
-
if (typeof
|
|
33
|
-
return
|
|
31
|
+
function parseAddress(address2) {
|
|
32
|
+
if (typeof address2 !== "string") {
|
|
33
|
+
return address2.name ? { email: address2.email.trim(), name: address2.name } : { email: address2.email.trim() };
|
|
34
34
|
}
|
|
35
|
-
const match = NAMED.exec(
|
|
35
|
+
const match = NAMED.exec(address2);
|
|
36
36
|
if (match) {
|
|
37
37
|
const name = _optionalChain([match, 'access', _ => _[1], 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]);
|
|
38
38
|
return name ? { email: match[2], name } : { email: match[2] };
|
|
39
39
|
}
|
|
40
|
-
return { email:
|
|
40
|
+
return { email: address2.trim() };
|
|
41
41
|
}
|
|
42
|
-
function formatAddress(
|
|
43
|
-
const { email, name } = parseAddress(
|
|
42
|
+
function formatAddress(address2) {
|
|
43
|
+
const { email, name } = parseAddress(address2);
|
|
44
44
|
if (!name) return email;
|
|
45
45
|
const safe = /[(),:;<>@[\]"]/.test(name) ? `"${name.replace(/"/g, '\\"')}"` : name;
|
|
46
46
|
return `${safe} <${email}>`;
|
|
@@ -239,6 +239,81 @@ var SmtpEmail = class {
|
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
|
|
242
|
+
// src/email/adapters/zeptomail.email.ts
|
|
243
|
+
var PROVIDER4 = "zeptomail";
|
|
244
|
+
var DEFAULT_BASE_URL2 = "https://api.zeptomail.com/v1.1";
|
|
245
|
+
var address = (value) => {
|
|
246
|
+
const { email, name } = parseAddress(value);
|
|
247
|
+
return name ? { address: email, name } : { address: email };
|
|
248
|
+
};
|
|
249
|
+
var recipient = (value) => ({ email_address: address(value) });
|
|
250
|
+
var ZeptoMailEmail = class {
|
|
251
|
+
constructor(options, defaults = {}) {
|
|
252
|
+
this.options = options;
|
|
253
|
+
this.defaults = defaults;
|
|
254
|
+
if (!options.apiKey) {
|
|
255
|
+
throw new Error('EmailModule: provider "zeptomail" selected but no apiKey / ZEPTOMAIL_API_KEY set.');
|
|
256
|
+
}
|
|
257
|
+
this.baseUrl = (_nullishCoalesce(options.baseUrl, () => ( DEFAULT_BASE_URL2))).replace(/\/$/, "");
|
|
258
|
+
this.fetchImpl = _nullishCoalesce(options.fetchImpl, () => ( globalThis.fetch));
|
|
259
|
+
}
|
|
260
|
+
async send(input) {
|
|
261
|
+
const message = completeMessage(input, this.defaults);
|
|
262
|
+
const body = {
|
|
263
|
+
from: address(message.from),
|
|
264
|
+
to: toList(message.to).map(recipient),
|
|
265
|
+
subject: message.subject
|
|
266
|
+
};
|
|
267
|
+
const cc = toList(message.cc).map(recipient);
|
|
268
|
+
const bcc = toList(message.bcc).map(recipient);
|
|
269
|
+
if (cc.length) body.cc = cc;
|
|
270
|
+
if (bcc.length) body.bcc = bcc;
|
|
271
|
+
if (message.replyTo) body.reply_to = [address(message.replyTo)];
|
|
272
|
+
if (message.html) body.htmlbody = message.html;
|
|
273
|
+
if (message.text) body.textbody = message.text;
|
|
274
|
+
const headers = {
|
|
275
|
+
...message.headers,
|
|
276
|
+
...Object.fromEntries(Object.entries(_nullishCoalesce(message.tags, () => ( {}))).map(([k, v]) => [`X-Tag-${k}`, v]))
|
|
277
|
+
};
|
|
278
|
+
if (Object.keys(headers).length) body.mime_headers = headers;
|
|
279
|
+
if (_optionalChain([message, 'access', _15 => _15.attachments, 'optionalAccess', _16 => _16.length])) {
|
|
280
|
+
body.attachments = message.attachments.map((a) => ({
|
|
281
|
+
name: a.filename,
|
|
282
|
+
content: attachmentBuffer(a.content).toString("base64"),
|
|
283
|
+
mime_type: _nullishCoalesce(a.contentType, () => ( "application/octet-stream"))
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
let response;
|
|
287
|
+
try {
|
|
288
|
+
response = await this.fetchImpl(`${this.baseUrl}/email`, {
|
|
289
|
+
method: "POST",
|
|
290
|
+
headers: {
|
|
291
|
+
authorization: `Zoho-enczapikey ${this.options.apiKey}`,
|
|
292
|
+
"content-type": "application/json",
|
|
293
|
+
accept: "application/json"
|
|
294
|
+
},
|
|
295
|
+
body: JSON.stringify(body)
|
|
296
|
+
});
|
|
297
|
+
} catch (cause) {
|
|
298
|
+
throw new EmailProviderException(
|
|
299
|
+
PROVIDER4,
|
|
300
|
+
0,
|
|
301
|
+
{ error: cause instanceof Error ? cause.message : String(cause) },
|
|
302
|
+
`${PROVIDER4} is unreachable`
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
const text = await response.text();
|
|
306
|
+
let parsed = text;
|
|
307
|
+
try {
|
|
308
|
+
parsed = text ? JSON.parse(text) : void 0;
|
|
309
|
+
} catch (e2) {
|
|
310
|
+
}
|
|
311
|
+
if (!response.ok) throw new EmailProviderException(PROVIDER4, response.status, parsed);
|
|
312
|
+
const id = _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _17 => _17.request_id]), () => ( null));
|
|
313
|
+
return { id, provider: PROVIDER4 };
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
242
317
|
// src/email/email.module.ts
|
|
243
318
|
var env = (k) => process.env[k] || void 0;
|
|
244
319
|
function resolveEmailOptions(options = {}) {
|
|
@@ -254,7 +329,8 @@ function resolveEmailOptions(options = {}) {
|
|
|
254
329
|
user: env("SMTP_USER"),
|
|
255
330
|
password: env("SMTP_PASSWORD")
|
|
256
331
|
} : void 0))),
|
|
257
|
-
brevo: _nullishCoalesce(options.brevo, () => ( (env("BREVO_API_KEY") ? { apiKey: env("BREVO_API_KEY"), baseUrl: env("BREVO_BASE_URL") } : void 0)))
|
|
332
|
+
brevo: _nullishCoalesce(options.brevo, () => ( (env("BREVO_API_KEY") ? { apiKey: env("BREVO_API_KEY"), baseUrl: env("BREVO_BASE_URL") } : void 0))),
|
|
333
|
+
zeptomail: _nullishCoalesce(options.zeptomail, () => ( (env("ZEPTOMAIL_API_KEY") ? { apiKey: env("ZEPTOMAIL_API_KEY"), baseUrl: env("ZEPTOMAIL_BASE_URL") } : void 0)))
|
|
258
334
|
};
|
|
259
335
|
}
|
|
260
336
|
function createEmailAdapter(options = {}) {
|
|
@@ -270,10 +346,13 @@ function createEmailAdapter(options = {}) {
|
|
|
270
346
|
case "brevo":
|
|
271
347
|
if (!resolved.brevo) throw new Error('EmailModule: provider "brevo" selected but no brevo options / BREVO_API_KEY set.');
|
|
272
348
|
return new BrevoEmail(resolved.brevo, defaults);
|
|
349
|
+
case "zeptomail":
|
|
350
|
+
if (!resolved.zeptomail) throw new Error('EmailModule: provider "zeptomail" selected but no zeptomail options / ZEPTOMAIL_API_KEY set.');
|
|
351
|
+
return new ZeptoMailEmail(resolved.zeptomail, defaults);
|
|
273
352
|
case "memory":
|
|
274
353
|
return new MemoryEmail(defaults);
|
|
275
354
|
case void 0:
|
|
276
|
-
throw new Error("EmailModule: no provider selected. Pass `provider` or set EMAIL_PROVIDER (resend | smtp | brevo | memory).");
|
|
355
|
+
throw new Error("EmailModule: no provider selected. Pass `provider` or set EMAIL_PROVIDER (resend | smtp | brevo | zeptomail | memory).");
|
|
277
356
|
default:
|
|
278
357
|
throw new Error(`EmailModule: unknown provider "${String(resolved.provider)}".`);
|
|
279
358
|
}
|
|
@@ -311,4 +390,5 @@ EmailModule = exports.EmailModule = _chunk2REOCMUDcjs.__decorateClass.call(void
|
|
|
311
390
|
|
|
312
391
|
|
|
313
392
|
|
|
314
|
-
|
|
393
|
+
|
|
394
|
+
exports.BrevoEmail = BrevoEmail; exports.EMAIL = EMAIL; exports.EMAIL_OPTIONS = EMAIL_OPTIONS; exports.EmailModule = EmailModule; exports.EmailProviderException = EmailProviderException; exports.MemoryEmail = MemoryEmail; exports.ResendEmail = ResendEmail; exports.SmtpEmail = SmtpEmail; exports.ZeptoMailEmail = ZeptoMailEmail; exports.createEmailAdapter = createEmailAdapter; exports.formatAddress = formatAddress; exports.parseAddress = parseAddress; exports.resolveEmailOptions = resolveEmailOptions;
|
package/dist/email/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export { EMAIL, EmailProviderException } from './email.port.js';
|
|
2
2
|
export type { EmailPort, EmailMessage, EmailAddress, EmailAttachment, SentEmail } from './email.port.js';
|
|
3
3
|
export { EMAIL_OPTIONS } from './email.options.js';
|
|
4
|
-
export type { EmailOptions, EmailProvider, ResendEmailOptions, SmtpEmailOptions, BrevoEmailOptions, } from './email.options.js';
|
|
4
|
+
export type { EmailOptions, EmailProvider, ResendEmailOptions, SmtpEmailOptions, BrevoEmailOptions, ZeptoMailEmailOptions, } from './email.options.js';
|
|
5
5
|
export { EmailModule, createEmailAdapter, resolveEmailOptions } from './email.module.js';
|
|
6
6
|
export { parseAddress, formatAddress } from './address.js';
|
|
7
7
|
export { BrevoEmail } from './adapters/brevo.email.js';
|
|
8
8
|
export { ResendEmail } from './adapters/resend.email.js';
|
|
9
9
|
export type { ResendLike } from './adapters/resend.email.js';
|
|
10
|
+
export { ZeptoMailEmail } from './adapters/zeptomail.email.js';
|
|
10
11
|
export { SmtpEmail } from './adapters/smtp.email.js';
|
|
11
12
|
export type { TransporterLike } from './adapters/smtp.email.js';
|
|
12
13
|
export { MemoryEmail } from './adapters/memory.email.js';
|
package/dist/email/index.js
CHANGED
|
@@ -28,19 +28,19 @@ import { Global, Module } from "@nestjs/common";
|
|
|
28
28
|
|
|
29
29
|
// src/email/address.ts
|
|
30
30
|
var NAMED = /^\s*(?:"?([^"]*)"?\s*)?<\s*([^<>\s]+)\s*>\s*$/;
|
|
31
|
-
function parseAddress(
|
|
32
|
-
if (typeof
|
|
33
|
-
return
|
|
31
|
+
function parseAddress(address2) {
|
|
32
|
+
if (typeof address2 !== "string") {
|
|
33
|
+
return address2.name ? { email: address2.email.trim(), name: address2.name } : { email: address2.email.trim() };
|
|
34
34
|
}
|
|
35
|
-
const match = NAMED.exec(
|
|
35
|
+
const match = NAMED.exec(address2);
|
|
36
36
|
if (match) {
|
|
37
37
|
const name = match[1]?.trim();
|
|
38
38
|
return name ? { email: match[2], name } : { email: match[2] };
|
|
39
39
|
}
|
|
40
|
-
return { email:
|
|
40
|
+
return { email: address2.trim() };
|
|
41
41
|
}
|
|
42
|
-
function formatAddress(
|
|
43
|
-
const { email, name } = parseAddress(
|
|
42
|
+
function formatAddress(address2) {
|
|
43
|
+
const { email, name } = parseAddress(address2);
|
|
44
44
|
if (!name) return email;
|
|
45
45
|
const safe = /[(),:;<>@[\]"]/.test(name) ? `"${name.replace(/"/g, '\\"')}"` : name;
|
|
46
46
|
return `${safe} <${email}>`;
|
|
@@ -239,6 +239,81 @@ var SmtpEmail = class {
|
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
|
|
242
|
+
// src/email/adapters/zeptomail.email.ts
|
|
243
|
+
var PROVIDER4 = "zeptomail";
|
|
244
|
+
var DEFAULT_BASE_URL2 = "https://api.zeptomail.com/v1.1";
|
|
245
|
+
var address = (value) => {
|
|
246
|
+
const { email, name } = parseAddress(value);
|
|
247
|
+
return name ? { address: email, name } : { address: email };
|
|
248
|
+
};
|
|
249
|
+
var recipient = (value) => ({ email_address: address(value) });
|
|
250
|
+
var ZeptoMailEmail = class {
|
|
251
|
+
constructor(options, defaults = {}) {
|
|
252
|
+
this.options = options;
|
|
253
|
+
this.defaults = defaults;
|
|
254
|
+
if (!options.apiKey) {
|
|
255
|
+
throw new Error('EmailModule: provider "zeptomail" selected but no apiKey / ZEPTOMAIL_API_KEY set.');
|
|
256
|
+
}
|
|
257
|
+
this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL2).replace(/\/$/, "");
|
|
258
|
+
this.fetchImpl = options.fetchImpl ?? globalThis.fetch;
|
|
259
|
+
}
|
|
260
|
+
async send(input) {
|
|
261
|
+
const message = completeMessage(input, this.defaults);
|
|
262
|
+
const body = {
|
|
263
|
+
from: address(message.from),
|
|
264
|
+
to: toList(message.to).map(recipient),
|
|
265
|
+
subject: message.subject
|
|
266
|
+
};
|
|
267
|
+
const cc = toList(message.cc).map(recipient);
|
|
268
|
+
const bcc = toList(message.bcc).map(recipient);
|
|
269
|
+
if (cc.length) body.cc = cc;
|
|
270
|
+
if (bcc.length) body.bcc = bcc;
|
|
271
|
+
if (message.replyTo) body.reply_to = [address(message.replyTo)];
|
|
272
|
+
if (message.html) body.htmlbody = message.html;
|
|
273
|
+
if (message.text) body.textbody = message.text;
|
|
274
|
+
const headers = {
|
|
275
|
+
...message.headers,
|
|
276
|
+
...Object.fromEntries(Object.entries(message.tags ?? {}).map(([k, v]) => [`X-Tag-${k}`, v]))
|
|
277
|
+
};
|
|
278
|
+
if (Object.keys(headers).length) body.mime_headers = headers;
|
|
279
|
+
if (message.attachments?.length) {
|
|
280
|
+
body.attachments = message.attachments.map((a) => ({
|
|
281
|
+
name: a.filename,
|
|
282
|
+
content: attachmentBuffer(a.content).toString("base64"),
|
|
283
|
+
mime_type: a.contentType ?? "application/octet-stream"
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
let response;
|
|
287
|
+
try {
|
|
288
|
+
response = await this.fetchImpl(`${this.baseUrl}/email`, {
|
|
289
|
+
method: "POST",
|
|
290
|
+
headers: {
|
|
291
|
+
authorization: `Zoho-enczapikey ${this.options.apiKey}`,
|
|
292
|
+
"content-type": "application/json",
|
|
293
|
+
accept: "application/json"
|
|
294
|
+
},
|
|
295
|
+
body: JSON.stringify(body)
|
|
296
|
+
});
|
|
297
|
+
} catch (cause) {
|
|
298
|
+
throw new EmailProviderException(
|
|
299
|
+
PROVIDER4,
|
|
300
|
+
0,
|
|
301
|
+
{ error: cause instanceof Error ? cause.message : String(cause) },
|
|
302
|
+
`${PROVIDER4} is unreachable`
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
const text = await response.text();
|
|
306
|
+
let parsed = text;
|
|
307
|
+
try {
|
|
308
|
+
parsed = text ? JSON.parse(text) : void 0;
|
|
309
|
+
} catch {
|
|
310
|
+
}
|
|
311
|
+
if (!response.ok) throw new EmailProviderException(PROVIDER4, response.status, parsed);
|
|
312
|
+
const id = parsed?.request_id ?? null;
|
|
313
|
+
return { id, provider: PROVIDER4 };
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
242
317
|
// src/email/email.module.ts
|
|
243
318
|
var env = (k) => process.env[k] || void 0;
|
|
244
319
|
function resolveEmailOptions(options = {}) {
|
|
@@ -254,7 +329,8 @@ function resolveEmailOptions(options = {}) {
|
|
|
254
329
|
user: env("SMTP_USER"),
|
|
255
330
|
password: env("SMTP_PASSWORD")
|
|
256
331
|
} : void 0),
|
|
257
|
-
brevo: options.brevo ?? (env("BREVO_API_KEY") ? { apiKey: env("BREVO_API_KEY"), baseUrl: env("BREVO_BASE_URL") } : void 0)
|
|
332
|
+
brevo: options.brevo ?? (env("BREVO_API_KEY") ? { apiKey: env("BREVO_API_KEY"), baseUrl: env("BREVO_BASE_URL") } : void 0),
|
|
333
|
+
zeptomail: options.zeptomail ?? (env("ZEPTOMAIL_API_KEY") ? { apiKey: env("ZEPTOMAIL_API_KEY"), baseUrl: env("ZEPTOMAIL_BASE_URL") } : void 0)
|
|
258
334
|
};
|
|
259
335
|
}
|
|
260
336
|
function createEmailAdapter(options = {}) {
|
|
@@ -270,10 +346,13 @@ function createEmailAdapter(options = {}) {
|
|
|
270
346
|
case "brevo":
|
|
271
347
|
if (!resolved.brevo) throw new Error('EmailModule: provider "brevo" selected but no brevo options / BREVO_API_KEY set.');
|
|
272
348
|
return new BrevoEmail(resolved.brevo, defaults);
|
|
349
|
+
case "zeptomail":
|
|
350
|
+
if (!resolved.zeptomail) throw new Error('EmailModule: provider "zeptomail" selected but no zeptomail options / ZEPTOMAIL_API_KEY set.');
|
|
351
|
+
return new ZeptoMailEmail(resolved.zeptomail, defaults);
|
|
273
352
|
case "memory":
|
|
274
353
|
return new MemoryEmail(defaults);
|
|
275
354
|
case void 0:
|
|
276
|
-
throw new Error("EmailModule: no provider selected. Pass `provider` or set EMAIL_PROVIDER (resend | smtp | brevo | memory).");
|
|
355
|
+
throw new Error("EmailModule: no provider selected. Pass `provider` or set EMAIL_PROVIDER (resend | smtp | brevo | zeptomail | memory).");
|
|
277
356
|
default:
|
|
278
357
|
throw new Error(`EmailModule: unknown provider "${String(resolved.provider)}".`);
|
|
279
358
|
}
|
|
@@ -307,6 +386,7 @@ export {
|
|
|
307
386
|
MemoryEmail,
|
|
308
387
|
ResendEmail,
|
|
309
388
|
SmtpEmail,
|
|
389
|
+
ZeptoMailEmail,
|
|
310
390
|
createEmailAdapter,
|
|
311
391
|
formatAddress,
|
|
312
392
|
parseAddress,
|
package/dist/errors/index.cjs
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
var _chunkHDFPSA2Vcjs = require('../chunk-HDFPSA2V.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _chunkQ5Y33L7Bcjs = require('../chunk-Q5Y33L7B.cjs');
|
|
11
|
+
var _chunkMSTXS3MUcjs = require('../chunk-MSTXS3MU.cjs');
|
|
15
12
|
require('../chunk-AXMW5JF7.cjs');
|
|
16
13
|
require('../chunk-Y72D5L6I.cjs');
|
|
17
14
|
require('../chunk-SDWHKPXI.cjs');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunkQ5Y33L7Bcjs = require('../chunk-Q5Y33L7B.cjs');
|
|
18
18
|
require('../chunk-PNK5WMPP.cjs');
|
|
19
19
|
require('../chunk-2REOCMUD.cjs');
|
|
20
20
|
|
|
@@ -25,4 +25,4 @@ require('../chunk-2REOCMUD.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
exports.AppException = _chunkQ5Y33L7Bcjs.AppException; exports.ConflictAppException = _chunkHDFPSA2Vcjs.ConflictAppException; exports.ForbiddenAppException = _chunkHDFPSA2Vcjs.ForbiddenAppException; exports.GlobalExceptionFilter =
|
|
28
|
+
exports.AppException = _chunkQ5Y33L7Bcjs.AppException; exports.ConflictAppException = _chunkHDFPSA2Vcjs.ConflictAppException; exports.ForbiddenAppException = _chunkHDFPSA2Vcjs.ForbiddenAppException; exports.GlobalExceptionFilter = _chunkMSTXS3MUcjs.GlobalExceptionFilter; exports.NotFoundAppException = _chunkHDFPSA2Vcjs.NotFoundAppException; exports.UnauthorizedAppException = _chunkHDFPSA2Vcjs.UnauthorizedAppException; exports.ValidationAppException = _chunkHDFPSA2Vcjs.ValidationAppException;
|
package/dist/errors/index.js
CHANGED
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
} from "../chunk-ZFIDAX7K.js";
|
|
9
9
|
import {
|
|
10
10
|
GlobalExceptionFilter
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import {
|
|
13
|
-
AppException
|
|
14
|
-
} from "../chunk-M3GQDRWR.js";
|
|
11
|
+
} from "../chunk-A2DGK4ZL.js";
|
|
15
12
|
import "../chunk-X4PQJZ4G.js";
|
|
16
13
|
import "../chunk-TCAMLNUZ.js";
|
|
17
14
|
import "../chunk-ETRUVZTJ.js";
|
|
15
|
+
import {
|
|
16
|
+
AppException
|
|
17
|
+
} from "../chunk-M3GQDRWR.js";
|
|
18
18
|
import "../chunk-VVMRZEIW.js";
|
|
19
19
|
import "../chunk-4MGIQFAJ.js";
|
|
20
20
|
export {
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkSPTDXUEDcjs = require('./chunk-SPTDXUED.cjs');
|
|
6
|
+
require('./chunk-KVBQBT3D.cjs');
|
|
2
7
|
|
|
3
8
|
|
|
4
9
|
|
|
@@ -8,15 +13,14 @@ var _chunkRF75KC63cjs = require('./chunk-RF75KC63.cjs');
|
|
|
8
13
|
|
|
9
14
|
|
|
10
15
|
|
|
11
|
-
var
|
|
16
|
+
var _chunkHVHYZXBBcjs = require('./chunk-HVHYZXBB.cjs');
|
|
12
17
|
|
|
13
18
|
|
|
14
19
|
|
|
15
20
|
|
|
16
|
-
var _chunkHVHYZXBBcjs = require('./chunk-HVHYZXBB.cjs');
|
|
17
21
|
|
|
18
22
|
|
|
19
|
-
var
|
|
23
|
+
var _chunkAPUFKA4Kcjs = require('./chunk-APUFKA4K.cjs');
|
|
20
24
|
require('./chunk-H2EHN366.cjs');
|
|
21
25
|
|
|
22
26
|
|
|
@@ -26,31 +30,24 @@ var _chunk52IOOHNXcjs = require('./chunk-52IOOHNX.cjs');
|
|
|
26
30
|
require('./chunk-W2T2VFLC.cjs');
|
|
27
31
|
|
|
28
32
|
|
|
29
|
-
var
|
|
33
|
+
var _chunkFNUZGYUFcjs = require('./chunk-FNUZGYUF.cjs');
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
var _chunk3AUOOEQOcjs = require('./chunk-3AUOOEQO.cjs');
|
|
33
|
-
require('./chunk-7SOM7EZP.cjs');
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var _chunkLSDY6ETGcjs = require('./chunk-LSDY6ETG.cjs');
|
|
39
|
+
var _chunkQS2W5XCQcjs = require('./chunk-QS2W5XCQ.cjs');
|
|
40
|
+
require('./chunk-7SOM7EZP.cjs');
|
|
44
41
|
|
|
45
42
|
|
|
46
|
-
var _chunkQ5Y33L7Bcjs = require('./chunk-Q5Y33L7B.cjs');
|
|
47
43
|
|
|
48
44
|
|
|
49
45
|
|
|
50
46
|
|
|
47
|
+
var _chunkHDFPSA2Vcjs = require('./chunk-HDFPSA2V.cjs');
|
|
51
48
|
|
|
52
49
|
|
|
53
|
-
var
|
|
50
|
+
var _chunkMSTXS3MUcjs = require('./chunk-MSTXS3MU.cjs');
|
|
54
51
|
|
|
55
52
|
|
|
56
53
|
|
|
@@ -66,6 +63,9 @@ var _chunkY72D5L6Icjs = require('./chunk-Y72D5L6I.cjs');
|
|
|
66
63
|
var _chunkSDWHKPXIcjs = require('./chunk-SDWHKPXI.cjs');
|
|
67
64
|
|
|
68
65
|
|
|
66
|
+
var _chunkQ5Y33L7Bcjs = require('./chunk-Q5Y33L7B.cjs');
|
|
67
|
+
|
|
68
|
+
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
var _chunkPNK5WMPPcjs = require('./chunk-PNK5WMPP.cjs');
|
|
@@ -108,4 +108,4 @@ require('./chunk-2REOCMUD.cjs');
|
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
exports.AppException = _chunkQ5Y33L7Bcjs.AppException; exports.BaseCrudService = _chunk52IOOHNXcjs.BaseCrudService; exports.BaseResponseDto = _chunkQS2W5XCQcjs.BaseResponseDto; exports.ConflictAppException = _chunkHDFPSA2Vcjs.ConflictAppException; exports.ForbiddenAppException = _chunkHDFPSA2Vcjs.ForbiddenAppException; exports.GlobalExceptionFilter =
|
|
111
|
+
exports.AppException = _chunkQ5Y33L7Bcjs.AppException; exports.BaseCrudService = _chunk52IOOHNXcjs.BaseCrudService; exports.BaseResponseDto = _chunkQS2W5XCQcjs.BaseResponseDto; exports.ConflictAppException = _chunkHDFPSA2Vcjs.ConflictAppException; exports.ForbiddenAppException = _chunkHDFPSA2Vcjs.ForbiddenAppException; exports.GlobalExceptionFilter = _chunkMSTXS3MUcjs.GlobalExceptionFilter; exports.I18nInterceptor = _chunkAPUFKA4Kcjs.I18nInterceptor; exports.I18nMessage = _chunkPNK5WMPPcjs.I18nMessage; exports.I18nModule = _chunkAPUFKA4Kcjs.I18nModule; exports.ListQuery = _chunk52IOOHNXcjs.ListQuery; exports.NestI18nTranslator = _chunkAPUFKA4Kcjs.NestI18nTranslator; exports.NotFoundAppException = _chunkHDFPSA2Vcjs.NotFoundAppException; exports.PG_POOL = _chunkRF75KC63cjs.PG_POOL; exports.PgModule = _chunkRF75KC63cjs.PgModule; exports.REQUEST_ID_HEADER = _chunkHVHYZXBBcjs.REQUEST_ID_HEADER; exports.RequestContext = _chunkSDWHKPXIcjs.RequestContext; exports.RequestIdMiddleware = _chunkHVHYZXBBcjs.RequestIdMiddleware; exports.ResponseInterceptor = _chunk3AUOOEQOcjs.ResponseInterceptor; exports.SUPABASE_ANON_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_ANON_CLIENT; exports.SUPABASE_SERVICE_ROLE_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_SERVICE_ROLE_CLIENT; exports.SupabaseModule = _chunkSPTDXUEDcjs.SupabaseModule; exports.TrackingModule = _chunkHVHYZXBBcjs.TrackingModule; exports.UnauthorizedAppException = _chunkHDFPSA2Vcjs.UnauthorizedAppException; exports.ValidationAppException = _chunkHDFPSA2Vcjs.ValidationAppException; exports.applyNestKitDefaults = _chunkFNUZGYUFcjs.applyNestKitDefaults; exports.buildPageMeta = _chunkY72D5L6Icjs.buildPageMeta; exports.createCrudController = _chunk52IOOHNXcjs.createCrudController; exports.currentLanguage = _chunkAXMW5JF7cjs.currentLanguage; exports.isI18nMessage = _chunkPNK5WMPPcjs.isI18nMessage; exports.isPaginated = _chunkY72D5L6Icjs.isPaginated; exports.matchLanguage = _chunkAPUFKA4Kcjs.matchLanguage; exports.paginated = _chunkY72D5L6Icjs.paginated; exports.t = _chunkPNK5WMPPcjs.t; exports.translate = _chunkAXMW5JF7cjs.translate; exports.translateDeep = _chunkAXMW5JF7cjs.translateDeep; exports.translateOr = _chunkAPUFKA4Kcjs.translateOr; exports.withTenantScope = _chunkRF75KC63cjs.withTenantScope;
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SUPABASE_ANON_CLIENT,
|
|
3
|
+
SUPABASE_SERVICE_ROLE_CLIENT,
|
|
4
|
+
SupabaseModule
|
|
5
|
+
} from "./chunk-PA24P76K.js";
|
|
1
6
|
import "./chunk-EPVKCBPT.js";
|
|
2
7
|
import {
|
|
3
8
|
PG_POOL,
|
|
4
9
|
PgModule,
|
|
5
10
|
withTenantScope
|
|
6
11
|
} from "./chunk-VKOPDDCC.js";
|
|
7
|
-
import {
|
|
8
|
-
SUPABASE_ANON_CLIENT,
|
|
9
|
-
SUPABASE_SERVICE_ROLE_CLIENT,
|
|
10
|
-
SupabaseModule
|
|
11
|
-
} from "./chunk-PA24P76K.js";
|
|
12
12
|
import {
|
|
13
13
|
REQUEST_ID_HEADER,
|
|
14
14
|
RequestIdMiddleware,
|
|
15
15
|
TrackingModule
|
|
16
16
|
} from "./chunk-4PFAKLT3.js";
|
|
17
17
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
I18nInterceptor,
|
|
19
|
+
I18nModule,
|
|
20
|
+
NestI18nTranslator,
|
|
21
|
+
matchLanguage,
|
|
22
|
+
translateOr
|
|
23
|
+
} from "./chunk-6RAPVLJM.js";
|
|
20
24
|
import "./chunk-ODPSIFOB.js";
|
|
21
25
|
import {
|
|
22
26
|
BaseCrudService,
|
|
@@ -26,10 +30,13 @@ import {
|
|
|
26
30
|
import "./chunk-ZJMLEP5H.js";
|
|
27
31
|
import {
|
|
28
32
|
applyNestKitDefaults
|
|
29
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-UNEVXCFW.js";
|
|
30
34
|
import {
|
|
31
35
|
ResponseInterceptor
|
|
32
36
|
} from "./chunk-DYHSOULW.js";
|
|
37
|
+
import {
|
|
38
|
+
BaseResponseDto
|
|
39
|
+
} from "./chunk-XX2HPTRU.js";
|
|
33
40
|
import "./chunk-DQYAIQQ5.js";
|
|
34
41
|
import {
|
|
35
42
|
ConflictAppException,
|
|
@@ -40,17 +47,7 @@ import {
|
|
|
40
47
|
} from "./chunk-ZFIDAX7K.js";
|
|
41
48
|
import {
|
|
42
49
|
GlobalExceptionFilter
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import {
|
|
45
|
-
AppException
|
|
46
|
-
} from "./chunk-M3GQDRWR.js";
|
|
47
|
-
import {
|
|
48
|
-
I18nInterceptor,
|
|
49
|
-
I18nModule,
|
|
50
|
-
NestI18nTranslator,
|
|
51
|
-
matchLanguage,
|
|
52
|
-
translateOr
|
|
53
|
-
} from "./chunk-6RAPVLJM.js";
|
|
50
|
+
} from "./chunk-A2DGK4ZL.js";
|
|
54
51
|
import {
|
|
55
52
|
currentLanguage,
|
|
56
53
|
translate,
|
|
@@ -64,6 +61,9 @@ import {
|
|
|
64
61
|
import {
|
|
65
62
|
RequestContext
|
|
66
63
|
} from "./chunk-ETRUVZTJ.js";
|
|
64
|
+
import {
|
|
65
|
+
AppException
|
|
66
|
+
} from "./chunk-M3GQDRWR.js";
|
|
67
67
|
import {
|
|
68
68
|
I18nMessage,
|
|
69
69
|
isI18nMessage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AppException
|
|
3
|
-
} from "./chunk-M3GQDRWR.js";
|
|
4
1
|
import {
|
|
5
2
|
getI18nRuntime,
|
|
6
3
|
translate,
|
|
@@ -9,6 +6,9 @@ import {
|
|
|
9
6
|
import {
|
|
10
7
|
RequestContext
|
|
11
8
|
} from "./chunk-ETRUVZTJ.js";
|
|
9
|
+
import {
|
|
10
|
+
AppException
|
|
11
|
+
} from "./chunk-M3GQDRWR.js";
|
|
12
12
|
import {
|
|
13
13
|
__decorateClass
|
|
14
14
|
} from "./chunk-4MGIQFAJ.js";
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var _chunkQ5Y33L7Bcjs = require('./chunk-Q5Y33L7B.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
|
|
7
4
|
|
|
8
5
|
var _chunkAXMW5JF7cjs = require('./chunk-AXMW5JF7.cjs');
|
|
@@ -11,6 +8,9 @@ var _chunkAXMW5JF7cjs = require('./chunk-AXMW5JF7.cjs');
|
|
|
11
8
|
var _chunkSDWHKPXIcjs = require('./chunk-SDWHKPXI.cjs');
|
|
12
9
|
|
|
13
10
|
|
|
11
|
+
var _chunkQ5Y33L7Bcjs = require('./chunk-Q5Y33L7B.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
14
|
var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
|
|
15
15
|
|
|
16
16
|
// src/errors/global-exception.filter.ts
|