@hedhog/admin 0.46.39 → 0.46.41
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 +960 -960
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +6 -4
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/auth/consts/body.js +24 -24
- package/dist/emails/templates.d.ts.map +1 -1
- package/dist/emails/templates.js +48 -48
- package/dist/emails/templates.js.map +1 -1
- package/frontend/menu/components/create-panel.tsx.ejs +55 -55
- package/frontend/menu/components/update-panel.tsx.ejs +67 -67
- package/frontend/menu/locales/en/admin.menu.json +11 -11
- package/frontend/menu/locales/pt/admin.menu.json +11 -11
- package/frontend/menu/react-query/handlers.ts.ejs +28 -28
- package/frontend/menu/react-query/requests.ts.ejs +56 -56
- package/frontend/menu-locale/locales/en/admin.menu-locale.json +11 -11
- package/frontend/menu-locale/locales/pt/admin.menu-locale.json +11 -11
- package/frontend/menu-screen/locales/en/admin.menu-screen.json +11 -11
- package/frontend/menu-screen/locales/pt/admin.menu-screen.json +11 -11
- package/frontend/multifactor/components/create-panel.tsx.ejs +55 -55
- package/frontend/multifactor/components/update-panel.tsx.ejs +70 -70
- package/frontend/multifactor/locales/en/admin.multifactor.json +11 -11
- package/frontend/multifactor/locales/pt/admin.multifactor.json +11 -11
- package/frontend/multifactor/react-query/handlers.ts.ejs +28 -28
- package/frontend/multifactor/react-query/requests.ts.ejs +59 -59
- package/frontend/multifactor-locale/locales/en/admin.multifactor-locale.json +11 -11
- package/frontend/multifactor-locale/locales/pt/admin.multifactor-locale.json +11 -11
- package/frontend/screen/components/create-panel.tsx.ejs +55 -55
- package/frontend/screen/components/update-panel.tsx.ejs +67 -67
- package/frontend/screen/locales/en/admin.screen.json +11 -11
- package/frontend/screen/locales/pt/admin.screen.json +11 -11
- package/frontend/screen/react-query/handlers.ts.ejs +28 -28
- package/frontend/screen/react-query/requests.ts.ejs +56 -56
- package/frontend/screen-locale/locales/en/admin.screen-locale.json +11 -11
- package/frontend/screen-locale/locales/pt/admin.screen-locale.json +11 -11
- package/frontend/translation/components/create-panel.tsx.ejs +52 -52
- package/frontend/translation/components/update-panel.tsx.ejs +67 -67
- package/frontend/translation/locales/en/admin.translation.json +11 -11
- package/frontend/translation/locales/pt/admin.translation.json +11 -11
- package/frontend/translation/react-query/handlers.ts.ejs +28 -28
- package/frontend/translation/react-query/requests.ts.ejs +58 -58
- package/frontend/translation-namespace/components/create-panel.tsx.ejs +53 -53
- package/frontend/translation-namespace/components/update-panel.tsx.ejs +70 -70
- package/frontend/translation-namespace/locales/en/admin.translation-namespace.json +11 -11
- package/frontend/translation-namespace/locales/pt/admin.translation-namespace.json +11 -11
- package/frontend/translation-namespace/react-query/handlers.ts.ejs +28 -28
- package/frontend/translation-namespace/react-query/requests.ts.ejs +60 -60
- package/frontend/user/components/create-panel.tsx.ejs +52 -52
- package/frontend/user/components/update-panel.tsx.ejs +64 -64
- package/frontend/user/locales/en/admin.user.json +11 -11
- package/frontend/user/locales/pt/admin.user.json +11 -11
- package/frontend/user/react-query/handlers.ts.ejs +28 -28
- package/frontend/user/react-query/requests.ts.ejs +55 -55
- package/hedhog.yaml +783 -783
- package/package.json +45 -45
- package/src/admin.module.ts +39 -39
- package/src/auth/auth.controller.ts +88 -88
- package/src/auth/auth.module.ts +41 -41
- package/src/auth/auth.service.spec.ts +196 -196
- package/src/auth/auth.service.ts +355 -349
- package/src/auth/consts/body.ts +27 -27
- package/src/auth/dto/change.dto.ts +19 -19
- package/src/auth/dto/email.dto.ts +15 -15
- package/src/auth/dto/forget.dto.ts +6 -6
- package/src/auth/dto/login.dto.ts +21 -21
- package/src/auth/dto/otp.dto.ts +11 -11
- package/src/auth/dto/reset.dto.ts +14 -14
- package/src/auth/enums/multifactor-type.enum.ts +4 -4
- package/src/auth/guards/auth.guard.ts +54 -54
- package/src/auth/types/user.type.ts +8 -8
- package/src/dto/delete.dto.ts +8 -8
- package/src/dto/update-ids.dto.ts +9 -9
- package/src/emails/index.ts +2 -2
- package/src/emails/lib.ts +40 -40
- package/src/emails/templates.ts +62 -60
- package/src/index.ts +20 -20
- package/src/menu/dto/create.dto.ts +25 -25
- package/src/menu/dto/order.dto.ts +8 -8
- package/src/menu/dto/update.dto.ts +19 -19
- package/src/menu/menu.controller.ts +105 -105
- package/src/menu/menu.module.ts +18 -18
- package/src/menu/menu.service.spec.ts +247 -247
- package/src/menu/menu.service.ts +263 -263
- package/src/role/dto/create.dto.ts +7 -7
- package/src/role/dto/update.dto.ts +4 -4
- package/src/role/guards/role.guard.ts +121 -121
- package/src/role/role.controller.ts +126 -126
- package/src/role/role.module.ts +28 -28
- package/src/role/role.service.spec.ts +417 -417
- package/src/role/role.service.ts +289 -289
- package/src/route/dto/create.dto.ts +13 -13
- package/src/route/dto/update.dto.ts +15 -15
- package/src/route/route.controller.ts +91 -91
- package/src/route/route.module.ts +18 -18
- package/src/route/route.service.spec.ts +300 -300
- package/src/route/route.service.ts +164 -164
- package/src/screen/dto/create.dto.ts +11 -11
- package/src/screen/dto/update.dto.ts +19 -19
- package/src/screen/screen.controller.ts +93 -93
- package/src/screen/screen.module.ts +18 -18
- package/src/screen/screen.service.spec.ts +298 -298
- package/src/screen/screen.service.ts +179 -179
- package/src/types/http-method.ts +8 -8
- package/src/user/constants/user.constants.ts +1 -1
- package/src/user/dto/create.dto.ts +24 -24
- package/src/user/dto/update.dto.ts +41 -41
- package/src/user/user.controller.ts +75 -75
- package/src/user/user.module.ts +18 -18
- package/src/user/user.service.spec.ts +294 -294
- package/src/user/user.service.ts +129 -129
- package/tsconfig.lib.json +9 -9
- package/tsconfig.production.json +20 -20
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,C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E,EAAE,SAAS;;;IA4C3B,cAAc,CAAC,EACnB,KAAK,EACL,eAAe,EACf,WAAW,EACX,kBAAkB,GACnB,EAAE,SAAS;;;IAkCN,WAAW,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,QAAQ;;;IAyD1D,aAAa,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,EAAE,QAAQ;;;IAkDjE,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,MAAM;;;IA0B3B,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,QAAQ;;;;;;;;IAWnC,MAAM,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;CAKxB"}
|
@@ -19,8 +19,8 @@ const common_1 = require("@nestjs/common");
|
|
19
19
|
const config_1 = require("@nestjs/config");
|
20
20
|
const jwt_1 = require("@nestjs/jwt");
|
21
21
|
const bcrypt_1 = require("bcrypt");
|
22
|
-
const multifactor_type_enum_1 = require("./enums/multifactor-type.enum");
|
23
22
|
const emails_1 = require("../emails");
|
23
|
+
const multifactor_type_enum_1 = require("./enums/multifactor-type.enum");
|
24
24
|
let AuthService = class AuthService {
|
25
25
|
constructor(configService, prisma, jwt, mail) {
|
26
26
|
this.configService = configService;
|
@@ -263,11 +263,13 @@ let AuthService = class AuthService {
|
|
263
263
|
return this.getToken(user);
|
264
264
|
}
|
265
265
|
async login({ email, password }) {
|
266
|
+
/*
|
266
267
|
await this.mail.send({
|
267
|
-
|
268
|
-
|
269
|
-
|
268
|
+
to: email,
|
269
|
+
subject: `Novo login no CoinBitClub`,
|
270
|
+
body: getUserLoginEmail(),
|
270
271
|
});
|
272
|
+
*/
|
271
273
|
return this.loginWithEmailAndPassword(email, password);
|
272
274
|
}
|
273
275
|
async verify(id) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;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AAI,0BAAiB,CAAC,iBAAiB,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YAC5B,KAAK,EAAE;gBACL,EAAE,EAAE,IAAI,CAAC,EAAE;aACZ;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,IAAI;aACX;SACF,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAY;QACvC;;;;;;UAME;QACF,OAAO,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;YACjC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAtUY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAIR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,gBAAU,CAAC,CAAC,CAAA;IAEpC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kBAAW,CAAC,CAAC,CAAA;qCALN,sBAAa;QAEpB,sBAAa;QAEhB,gBAAU;QAET,kBAAW;GARzB,WAAW,CAsUvB"}
|
package/dist/auth/consts/body.js
CHANGED
@@ -2,30 +2,30 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getBody = void 0;
|
4
4
|
const getBody = (url) => {
|
5
|
-
return `
|
6
|
-
<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 0;">
|
7
|
-
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
8
|
-
<div style="text-align: center; margin-bottom: 30px;">
|
9
|
-
<img style="margin-bottom: 16px" src="https://coinbitclub.vip/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoinbitclub-logo.b29de722.png&w=640&q=75" alt="Coinbitclub Logo" />
|
10
|
-
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">Recuperação de Senha - CoinBitClub</h1>
|
11
|
-
</div>
|
12
|
-
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
13
|
-
<p>Olá,</p>
|
14
|
-
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
15
|
-
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
16
|
-
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
17
|
-
</div>
|
18
|
-
<div style="text-align: center; margin: 30px 0;">
|
19
|
-
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
20
|
-
</div>
|
21
|
-
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
22
|
-
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
23
|
-
<p>Agradecemos por escolher nossa plataforma!</p>
|
24
|
-
</div>
|
25
|
-
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
26
|
-
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
27
|
-
</div>
|
28
|
-
</div>
|
5
|
+
return `
|
6
|
+
<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 0;">
|
7
|
+
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
8
|
+
<div style="text-align: center; margin-bottom: 30px;">
|
9
|
+
<img style="margin-bottom: 16px" src="https://coinbitclub.vip/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoinbitclub-logo.b29de722.png&w=640&q=75" alt="Coinbitclub Logo" />
|
10
|
+
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">Recuperação de Senha - CoinBitClub</h1>
|
11
|
+
</div>
|
12
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
13
|
+
<p>Olá,</p>
|
14
|
+
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
15
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
16
|
+
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
17
|
+
</div>
|
18
|
+
<div style="text-align: center; margin: 30px 0;">
|
19
|
+
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
20
|
+
</div>
|
21
|
+
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
22
|
+
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
23
|
+
<p>Agradecemos por escolher nossa plataforma!</p>
|
24
|
+
</div>
|
25
|
+
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
26
|
+
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
29
|
</body>`;
|
30
30
|
};
|
31
31
|
exports.getBody = getBody;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/emails/templates.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;oBACH,MAAM;
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/emails/templates.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;oBACH,MAAM;4BAOX,MAAM,EAAE;;CAWpB,CAAC;AAEF,eAAO,MAAM,MAAM;gCACW,MAAM;;;;;CAuCnC,CAAC"}
|
package/dist/emails/templates.js
CHANGED
@@ -2,62 +2,62 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.bodies = exports.defaults = void 0;
|
4
4
|
exports.defaults = {
|
5
|
-
header: (title) => `
|
6
|
-
<div style="text-align: center; margin-bottom: 30px;">
|
7
|
-
<img style="margin-bottom: 16px" src="https://coinbitclub.vip/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoinbitclub-logo.b29de722.png&w=640&q=75" alt="Coinbitclub Logo" />
|
8
|
-
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">${title}</h1>
|
9
|
-
</div>
|
5
|
+
header: (title) => `
|
6
|
+
<div style="text-align: center; margin-bottom: 30px;">
|
7
|
+
<img style="margin-bottom: 16px" src="https://coinbitclub.vip/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoinbitclub-logo.b29de722.png&w=640&q=75" alt="Coinbitclub Logo" />
|
8
|
+
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">${title}</h1>
|
9
|
+
</div>
|
10
10
|
`,
|
11
|
-
default_body: (content) => `<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding:
|
12
|
-
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
13
|
-
${content.join(
|
14
|
-
</div>
|
11
|
+
default_body: (content) => `<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 1px;">
|
12
|
+
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
13
|
+
${content.join('')}
|
14
|
+
</div>
|
15
15
|
</body>`,
|
16
|
-
footer: () => `
|
17
|
-
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
18
|
-
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
19
|
-
</div>
|
20
|
-
|
16
|
+
footer: () => `
|
17
|
+
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
18
|
+
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
19
|
+
</div>
|
20
|
+
`,
|
21
21
|
};
|
22
22
|
exports.bodies = {
|
23
|
-
user_forget_password: (url) => `
|
24
|
-
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
25
|
-
<p>Olá,</p>
|
26
|
-
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
27
|
-
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
28
|
-
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
29
|
-
</div>
|
30
|
-
<div style="text-align: center; margin: 30px 0;">
|
31
|
-
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
32
|
-
</div>
|
33
|
-
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
34
|
-
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
35
|
-
<p>Agradecemos por escolher nossa plataforma!</p>
|
36
|
-
</div>
|
23
|
+
user_forget_password: (url) => `
|
24
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
25
|
+
<p>Olá,</p>
|
26
|
+
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
27
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
28
|
+
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
29
|
+
</div>
|
30
|
+
<div style="text-align: center; margin: 30px 0;">
|
31
|
+
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
32
|
+
</div>
|
33
|
+
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
34
|
+
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
35
|
+
<p>Agradecemos por escolher nossa plataforma!</p>
|
36
|
+
</div>
|
37
37
|
`,
|
38
|
-
user_change_password: () => `
|
39
|
-
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
40
|
-
<p>Sua senha no CoinBitClub foi alterada recentemente.</p>
|
41
|
-
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
42
|
-
</div>
|
38
|
+
user_change_password: () => `
|
39
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
40
|
+
<p>Sua senha no CoinBitClub foi alterada recentemente.</p>
|
41
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
42
|
+
</div>
|
43
43
|
`,
|
44
|
-
user_change_email: () => `
|
45
|
-
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
46
|
-
<p>Seu endereço de e-mail foi alterado com sucesso. Se você realizou essa alteração, nenhuma ação adicional é necessária.</p>
|
47
|
-
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
48
|
-
</div>
|
44
|
+
user_change_email: () => `
|
45
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
46
|
+
<p>Seu endereço de e-mail foi alterado com sucesso. Se você realizou essa alteração, nenhuma ação adicional é necessária.</p>
|
47
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
48
|
+
</div>
|
49
49
|
`,
|
50
|
-
user_reset_password: () => `
|
51
|
-
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
52
|
-
<p>Sua senha foi redefinida com sucesso. Agora você já pode acessar sua conta normalmente utilizando a nova senha.</p>
|
53
|
-
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
54
|
-
</div>
|
50
|
+
user_reset_password: () => `
|
51
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
52
|
+
<p>Sua senha foi redefinida com sucesso. Agora você já pode acessar sua conta normalmente utilizando a nova senha.</p>
|
53
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
54
|
+
</div>
|
55
55
|
`,
|
56
|
-
user_login: () => `
|
57
|
-
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
58
|
-
<p>Um novo login foi realizado recentemente na sua conta do CoinBitClub.</p>
|
59
|
-
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
60
|
-
</div>
|
56
|
+
user_login: () => `
|
57
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
58
|
+
<p>Um novo login foi realizado recentemente na sua conta do CoinBitClub.</p>
|
59
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
60
|
+
</div>
|
61
61
|
`,
|
62
62
|
};
|
63
63
|
//# sourceMappingURL=templates.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/emails/templates.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC;;;gEAGmC,KAAK;;GAElE;IACD,YAAY,EAAE,
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/emails/templates.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC;;;gEAGmC,KAAK;;GAElE;IACD,YAAY,EAAE,CACZ,OAAiB,EACjB,EAAE,CAAC;;UAEG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;;YAEd;IACV,MAAM,EAAE,GAAG,EAAE,CAAC;;;;GAIb;CACF,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,oBAAoB,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC;;;;;;;;mBAQtB,GAAG;;;;;;GAMnB;IACD,oBAAoB,EAAE,GAAG,EAAE,CAAC;;;;;GAK3B;IACD,iBAAiB,EAAE,GAAG,EAAE,CAAC;;;;;GAKxB;IACD,mBAAmB,EAAE,GAAG,EAAE,CAAC;;;;;GAK1B;IACD,UAAU,EAAE,GAAG,EAAE,CAAC;;;;;GAKjB;CACF,CAAC"}
|
@@ -1,55 +1,55 @@
|
|
1
|
-
import FormPanel, {
|
2
|
-
FormPanelRef,
|
3
|
-
getFieldsLocale,
|
4
|
-
} from "@/components/panels/form-panel";
|
5
|
-
|
6
|
-
import { useMenuCreate } from "@/features/admin/menu";
|
7
|
-
import { Menu } from "@/types/models";
|
8
|
-
import { forwardRef, useImperativeHandle, useRef } from "react";
|
9
|
-
import { useTranslation } from "react-i18next";
|
10
|
-
|
11
|
-
export type MenuCreatePanelRef = {
|
12
|
-
submit: () => void;
|
13
|
-
};
|
14
|
-
|
15
|
-
export type MenuCreatePanelProps = {
|
16
|
-
onCreated?: (data: Menu) => void;
|
17
|
-
};
|
18
|
-
|
19
|
-
const MenuCreatePanel = forwardRef(
|
20
|
-
({ onCreated }: MenuCreatePanelProps, ref) => {
|
21
|
-
const formRef = useRef<FormPanelRef>(null);
|
22
|
-
const { t } = useTranslation(["actions", "fields", "translations"]);
|
23
|
-
const { mutateAsync: createMenu } = useMenuCreate();
|
24
|
-
|
25
|
-
useImperativeHandle(
|
26
|
-
ref,
|
27
|
-
() => ({
|
28
|
-
submit: () => {
|
29
|
-
formRef.current?.submit();
|
30
|
-
},
|
31
|
-
}),
|
32
|
-
[formRef],
|
33
|
-
);
|
34
|
-
|
35
|
-
return (
|
36
|
-
<FormPanel
|
37
|
-
ref={formRef}
|
38
|
-
fields={[...getFieldsLocale([{ name: "name" }])]}
|
39
|
-
button={{ text: t("create", { ns: "actions" }) }}
|
40
|
-
onSubmit={async (data) => {
|
41
|
-
const createdData = await createMenu({
|
42
|
-
data,
|
43
|
-
});
|
44
|
-
if (typeof onCreated === "function") {
|
45
|
-
onCreated(createdData as any);
|
46
|
-
}
|
47
|
-
}}
|
48
|
-
/>
|
49
|
-
);
|
50
|
-
},
|
51
|
-
);
|
52
|
-
|
53
|
-
MenuCreatePanel.displayName = "MenuCreatePanel";
|
54
|
-
|
55
|
-
export default MenuCreatePanel;
|
1
|
+
import FormPanel, {
|
2
|
+
FormPanelRef,
|
3
|
+
getFieldsLocale,
|
4
|
+
} from "@/components/panels/form-panel";
|
5
|
+
|
6
|
+
import { useMenuCreate } from "@/features/admin/menu";
|
7
|
+
import { Menu } from "@/types/models";
|
8
|
+
import { forwardRef, useImperativeHandle, useRef } from "react";
|
9
|
+
import { useTranslation } from "react-i18next";
|
10
|
+
|
11
|
+
export type MenuCreatePanelRef = {
|
12
|
+
submit: () => void;
|
13
|
+
};
|
14
|
+
|
15
|
+
export type MenuCreatePanelProps = {
|
16
|
+
onCreated?: (data: Menu) => void;
|
17
|
+
};
|
18
|
+
|
19
|
+
const MenuCreatePanel = forwardRef(
|
20
|
+
({ onCreated }: MenuCreatePanelProps, ref) => {
|
21
|
+
const formRef = useRef<FormPanelRef>(null);
|
22
|
+
const { t } = useTranslation(["actions", "fields", "translations"]);
|
23
|
+
const { mutateAsync: createMenu } = useMenuCreate();
|
24
|
+
|
25
|
+
useImperativeHandle(
|
26
|
+
ref,
|
27
|
+
() => ({
|
28
|
+
submit: () => {
|
29
|
+
formRef.current?.submit();
|
30
|
+
},
|
31
|
+
}),
|
32
|
+
[formRef],
|
33
|
+
);
|
34
|
+
|
35
|
+
return (
|
36
|
+
<FormPanel
|
37
|
+
ref={formRef}
|
38
|
+
fields={[...getFieldsLocale([{ name: "name" }])]}
|
39
|
+
button={{ text: t("create", { ns: "actions" }) }}
|
40
|
+
onSubmit={async (data) => {
|
41
|
+
const createdData = await createMenu({
|
42
|
+
data,
|
43
|
+
});
|
44
|
+
if (typeof onCreated === "function") {
|
45
|
+
onCreated(createdData as any);
|
46
|
+
}
|
47
|
+
}}
|
48
|
+
/>
|
49
|
+
);
|
50
|
+
},
|
51
|
+
);
|
52
|
+
|
53
|
+
MenuCreatePanel.displayName = "MenuCreatePanel";
|
54
|
+
|
55
|
+
export default MenuCreatePanel;
|
@@ -1,67 +1,67 @@
|
|
1
|
-
import FormPanel, {
|
2
|
-
FormPanelRef,
|
3
|
-
getFieldsLocale,
|
4
|
-
} from "@/components/panels/form-panel";
|
5
|
-
import { Overlay } from "@/components/custom/overlay";
|
6
|
-
import { TabPanel } from "@/components/panels/tab-panel";
|
7
|
-
import { useMenuGet, useMenuUpdate } from "@/features/admin/menu";
|
8
|
-
import useEffectAfterFirstUpdate from "@/hooks/use-effect-after-first-update";
|
9
|
-
import { Menu } from "@/types/models";
|
10
|
-
import { useState, forwardRef, useImperativeHandle, useRef } from "react";
|
11
|
-
import { useTranslation } from "react-i18next";
|
12
|
-
import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
|
13
|
-
|
14
|
-
export type MenuUpdatePanelProps = {
|
15
|
-
data: Menu;
|
16
|
-
onUpdated?: (data: Menu) => void;
|
17
|
-
};
|
18
|
-
|
19
|
-
const MenuUpdatePanel = forwardRef(
|
20
|
-
({ data, onUpdated }: MenuUpdatePanelProps, ref) => {
|
21
|
-
const { t } = useTranslation(["actions", "fields", "translations"]);
|
22
|
-
const { data: item, isLoading } = useMenuGet(data.id as number);
|
23
|
-
const { mutate: menuUpdate } = useMenuUpdate();
|
24
|
-
const formRef = useRef<FormPanelRef>(null);
|
25
|
-
|
26
|
-
useEffectAfterFirstUpdate(() => {
|
27
|
-
if (item && formRef.current) {
|
28
|
-
formRef.current.setValuesFromItem(item);
|
29
|
-
}
|
30
|
-
}, [item]);
|
31
|
-
|
32
|
-
useImperativeHandle(ref, () => ({}));
|
33
|
-
|
34
|
-
return (
|
35
|
-
<TabPanel
|
36
|
-
activeTabIndex={0}
|
37
|
-
tabs={[
|
38
|
-
{
|
39
|
-
title: t("details", { ns: "actions" }),
|
40
|
-
children: (
|
41
|
-
<Overlay loading={isLoading}>
|
42
|
-
<FormPanel
|
43
|
-
ref={formRef}
|
44
|
-
fields={[...getFieldsLocale([{ name: "name" }], item)]}
|
45
|
-
button={{ text: t("save", { ns: "actions" }) }}
|
46
|
-
onSubmit={(data) => {
|
47
|
-
menuUpdate({
|
48
|
-
id: data.id,
|
49
|
-
data,
|
50
|
-
});
|
51
|
-
if (typeof onUpdated === "function") {
|
52
|
-
onUpdated(data);
|
53
|
-
}
|
54
|
-
}}
|
55
|
-
/>
|
56
|
-
</Overlay>
|
57
|
-
),
|
58
|
-
},
|
59
|
-
]}
|
60
|
-
/>
|
61
|
-
);
|
62
|
-
},
|
63
|
-
);
|
64
|
-
|
65
|
-
MenuUpdatePanel.displayName = "MenuUpdatePanel";
|
66
|
-
|
67
|
-
export default MenuUpdatePanel;
|
1
|
+
import FormPanel, {
|
2
|
+
FormPanelRef,
|
3
|
+
getFieldsLocale,
|
4
|
+
} from "@/components/panels/form-panel";
|
5
|
+
import { Overlay } from "@/components/custom/overlay";
|
6
|
+
import { TabPanel } from "@/components/panels/tab-panel";
|
7
|
+
import { useMenuGet, useMenuUpdate } from "@/features/admin/menu";
|
8
|
+
import useEffectAfterFirstUpdate from "@/hooks/use-effect-after-first-update";
|
9
|
+
import { Menu } from "@/types/models";
|
10
|
+
import { useState, forwardRef, useImperativeHandle, useRef } from "react";
|
11
|
+
import { useTranslation } from "react-i18next";
|
12
|
+
import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
|
13
|
+
|
14
|
+
export type MenuUpdatePanelProps = {
|
15
|
+
data: Menu;
|
16
|
+
onUpdated?: (data: Menu) => void;
|
17
|
+
};
|
18
|
+
|
19
|
+
const MenuUpdatePanel = forwardRef(
|
20
|
+
({ data, onUpdated }: MenuUpdatePanelProps, ref) => {
|
21
|
+
const { t } = useTranslation(["actions", "fields", "translations"]);
|
22
|
+
const { data: item, isLoading } = useMenuGet(data.id as number);
|
23
|
+
const { mutate: menuUpdate } = useMenuUpdate();
|
24
|
+
const formRef = useRef<FormPanelRef>(null);
|
25
|
+
|
26
|
+
useEffectAfterFirstUpdate(() => {
|
27
|
+
if (item && formRef.current) {
|
28
|
+
formRef.current.setValuesFromItem(item);
|
29
|
+
}
|
30
|
+
}, [item]);
|
31
|
+
|
32
|
+
useImperativeHandle(ref, () => ({}));
|
33
|
+
|
34
|
+
return (
|
35
|
+
<TabPanel
|
36
|
+
activeTabIndex={0}
|
37
|
+
tabs={[
|
38
|
+
{
|
39
|
+
title: t("details", { ns: "actions" }),
|
40
|
+
children: (
|
41
|
+
<Overlay loading={isLoading}>
|
42
|
+
<FormPanel
|
43
|
+
ref={formRef}
|
44
|
+
fields={[...getFieldsLocale([{ name: "name" }], item)]}
|
45
|
+
button={{ text: t("save", { ns: "actions" }) }}
|
46
|
+
onSubmit={(data) => {
|
47
|
+
menuUpdate({
|
48
|
+
id: data.id,
|
49
|
+
data,
|
50
|
+
});
|
51
|
+
if (typeof onUpdated === "function") {
|
52
|
+
onUpdated(data);
|
53
|
+
}
|
54
|
+
}}
|
55
|
+
/>
|
56
|
+
</Overlay>
|
57
|
+
),
|
58
|
+
},
|
59
|
+
]}
|
60
|
+
/>
|
61
|
+
);
|
62
|
+
},
|
63
|
+
);
|
64
|
+
|
65
|
+
MenuUpdatePanel.displayName = "MenuUpdatePanel";
|
66
|
+
|
67
|
+
export default MenuUpdatePanel;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
{
|
2
|
-
"create": "Create menu",
|
3
|
-
"createText": "Fill the menu informations.",
|
4
|
-
"createTooltip": "Create new menu",
|
5
|
-
"delete": "Delete menu",
|
6
|
-
"deleteText": "Are you sure to delete these menu?",
|
7
|
-
"deleteTooltip": "Delete the selected menu",
|
8
|
-
"edit": "Edit menu",
|
9
|
-
"editText": "View and edit menu information.",
|
10
|
-
"editTooltip": "Edit the selected menu"
|
11
|
-
}
|
1
|
+
{
|
2
|
+
"create": "Create menu",
|
3
|
+
"createText": "Fill the menu informations.",
|
4
|
+
"createTooltip": "Create new menu",
|
5
|
+
"delete": "Delete menu",
|
6
|
+
"deleteText": "Are you sure to delete these menu?",
|
7
|
+
"deleteTooltip": "Delete the selected menu",
|
8
|
+
"edit": "Edit menu",
|
9
|
+
"editText": "View and edit menu information.",
|
10
|
+
"editTooltip": "Edit the selected menu"
|
11
|
+
}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
{
|
2
|
-
"create": "Criar menu",
|
3
|
-
"createText": "Preencha as informações do menu.",
|
4
|
-
"createTooltip": "Criar novo menu",
|
5
|
-
"delete": "Excluir menu",
|
6
|
-
"deleteText": "Você tem certeza de que deseja excluir este menu?",
|
7
|
-
"deleteTooltip": "Excluir o menu selecionado",
|
8
|
-
"edit": "Editar menu",
|
9
|
-
"editText": "Ver e editar informações do menu.",
|
10
|
-
"editTooltip": "Editar o menu selecionado"
|
11
|
-
}
|
1
|
+
{
|
2
|
+
"create": "Criar menu",
|
3
|
+
"createText": "Preencha as informações do menu.",
|
4
|
+
"createTooltip": "Criar novo menu",
|
5
|
+
"delete": "Excluir menu",
|
6
|
+
"deleteText": "Você tem certeza de que deseja excluir este menu?",
|
7
|
+
"deleteTooltip": "Excluir o menu selecionado",
|
8
|
+
"edit": "Editar menu",
|
9
|
+
"editText": "Ver e editar informações do menu.",
|
10
|
+
"editTooltip": "Editar o menu selecionado"
|
11
|
+
}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import { useDefaultMutation } from "@/hooks/use-default-mutation";
|
2
|
-
import { useQuery } from "@tanstack/react-query";
|
3
|
-
import { requests } from "./requests";
|
4
|
-
|
5
|
-
const scope = "menu";
|
6
|
-
|
7
|
-
export function useMenuCreate() {
|
8
|
-
const { menuCreate } = requests();
|
9
|
-
return useDefaultMutation(scope, "create", menuCreate);
|
10
|
-
}
|
11
|
-
|
12
|
-
export function useMenuDelete() {
|
13
|
-
const { menuDelete } = requests();
|
14
|
-
return useDefaultMutation(scope, "delete", menuDelete);
|
15
|
-
}
|
16
|
-
|
17
|
-
export function useMenuUpdate() {
|
18
|
-
const { menuUpdate } = requests();
|
19
|
-
return useDefaultMutation(scope, "update", menuUpdate);
|
20
|
-
}
|
21
|
-
|
22
|
-
export function useMenuGet(id: number) {
|
23
|
-
const { menuGet } = requests();
|
24
|
-
return useQuery({
|
25
|
-
queryKey: [scope, "get"],
|
26
|
-
queryFn: () => menuGet(id),
|
27
|
-
});
|
28
|
-
}
|
1
|
+
import { useDefaultMutation } from "@/hooks/use-default-mutation";
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
3
|
+
import { requests } from "./requests";
|
4
|
+
|
5
|
+
const scope = "menu";
|
6
|
+
|
7
|
+
export function useMenuCreate() {
|
8
|
+
const { menuCreate } = requests();
|
9
|
+
return useDefaultMutation(scope, "create", menuCreate);
|
10
|
+
}
|
11
|
+
|
12
|
+
export function useMenuDelete() {
|
13
|
+
const { menuDelete } = requests();
|
14
|
+
return useDefaultMutation(scope, "delete", menuDelete);
|
15
|
+
}
|
16
|
+
|
17
|
+
export function useMenuUpdate() {
|
18
|
+
const { menuUpdate } = requests();
|
19
|
+
return useDefaultMutation(scope, "update", menuUpdate);
|
20
|
+
}
|
21
|
+
|
22
|
+
export function useMenuGet(id: number) {
|
23
|
+
const { menuGet } = requests();
|
24
|
+
return useQuery({
|
25
|
+
queryKey: [scope, "get"],
|
26
|
+
queryFn: () => menuGet(id),
|
27
|
+
});
|
28
|
+
}
|