nexus-backend 1.0.4 → 1.0.6

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/dist/index.d.mts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
2
  import NodeCache from 'node-cache';
3
+ import { Resend } from 'resend';
4
+ import multer from 'multer';
3
5
 
4
6
  interface SuccessResponse<T = any> {
5
7
  success: true;
@@ -91,4 +93,27 @@ declare const cacheMemory: Cache;
91
93
  */
92
94
  declare function random(digit: number): string;
93
95
 
94
- export { ApiError, BadRequestError, Cache, type ErrorResponse, ForbiddenError, type MongoConfig, NotFoundError, type SuccessResponse, UnauthorizedError, ValidationError, cacheMemory, connectMongoDb, errorHandler as errorMiddleware, errorResponse, random, requiredEnv, successResponse };
96
+ interface MailerConfig {
97
+ brandName: string;
98
+ smtpProvider: Resend;
99
+ fromEmail: string;
100
+ }
101
+ interface EmailOptions {
102
+ to: string;
103
+ subject: string;
104
+ body: string;
105
+ }
106
+
107
+ declare class Mailer {
108
+ private config;
109
+ constructor(mailerConfig: MailerConfig);
110
+ sendMail(options: EmailOptions): Promise<boolean>;
111
+ }
112
+
113
+ declare const uploader: {
114
+ upload: multer.Multer;
115
+ uploadToNexusCloud: (file: Express.Multer.File | undefined, label: string) => Promise<string | undefined>;
116
+ getNexusDownloadUrl: (fileId: string) => Promise<string>;
117
+ };
118
+
119
+ export { ApiError, BadRequestError, Cache, type EmailOptions, type ErrorResponse, ForbiddenError, Mailer, type MailerConfig, type MongoConfig, NotFoundError, type SuccessResponse, UnauthorizedError, ValidationError, cacheMemory, connectMongoDb, errorHandler as errorMiddleware, errorResponse, random, requiredEnv, successResponse, uploader };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
2
  import NodeCache from 'node-cache';
3
+ import { Resend } from 'resend';
4
+ import multer from 'multer';
3
5
 
4
6
  interface SuccessResponse<T = any> {
5
7
  success: true;
@@ -91,4 +93,27 @@ declare const cacheMemory: Cache;
91
93
  */
92
94
  declare function random(digit: number): string;
93
95
 
94
- export { ApiError, BadRequestError, Cache, type ErrorResponse, ForbiddenError, type MongoConfig, NotFoundError, type SuccessResponse, UnauthorizedError, ValidationError, cacheMemory, connectMongoDb, errorHandler as errorMiddleware, errorResponse, random, requiredEnv, successResponse };
96
+ interface MailerConfig {
97
+ brandName: string;
98
+ smtpProvider: Resend;
99
+ fromEmail: string;
100
+ }
101
+ interface EmailOptions {
102
+ to: string;
103
+ subject: string;
104
+ body: string;
105
+ }
106
+
107
+ declare class Mailer {
108
+ private config;
109
+ constructor(mailerConfig: MailerConfig);
110
+ sendMail(options: EmailOptions): Promise<boolean>;
111
+ }
112
+
113
+ declare const uploader: {
114
+ upload: multer.Multer;
115
+ uploadToNexusCloud: (file: Express.Multer.File | undefined, label: string) => Promise<string | undefined>;
116
+ getNexusDownloadUrl: (fileId: string) => Promise<string>;
117
+ };
118
+
119
+ export { ApiError, BadRequestError, Cache, type EmailOptions, type ErrorResponse, ForbiddenError, Mailer, type MailerConfig, type MongoConfig, NotFoundError, type SuccessResponse, UnauthorizedError, ValidationError, cacheMemory, connectMongoDb, errorHandler as errorMiddleware, errorResponse, random, requiredEnv, successResponse, uploader };