@hed-hog/core 0.0.356 → 0.0.359
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/auth/guards/auth.guard.d.ts +6 -1
- package/dist/auth/guards/auth.guard.d.ts.map +1 -1
- package/dist/auth/guards/auth.guard.js +33 -2
- package/dist/auth/guards/auth.guard.js.map +1 -1
- package/dist/file/file.controller.d.ts +4 -2
- package/dist/file/file.controller.d.ts.map +1 -1
- package/dist/file/file.controller.js +44 -38
- package/dist/file/file.controller.js.map +1 -1
- package/dist/file/file.service.d.ts +2 -2
- package/dist/file/file.service.d.ts.map +1 -1
- package/dist/file/file.service.js +25 -42
- package/dist/file/file.service.js.map +1 -1
- package/dist/file/provider/azure.provider.d.ts.map +1 -1
- package/dist/file/provider/azure.provider.js +10 -15
- package/dist/file/provider/azure.provider.js.map +1 -1
- package/dist/file/provider/gcs.provider.d.ts.map +1 -1
- package/dist/file/provider/gcs.provider.js +8 -9
- package/dist/file/provider/gcs.provider.js.map +1 -1
- package/dist/file/provider/local.provider.d.ts.map +1 -1
- package/dist/file/provider/local.provider.js +11 -10
- package/dist/file/provider/local.provider.js.map +1 -1
- package/dist/file/provider/provider.factory.d.ts +1 -1
- package/dist/file/provider/provider.factory.d.ts.map +1 -1
- package/dist/file/provider/provider.factory.js +16 -6
- package/dist/file/provider/provider.factory.js.map +1 -1
- package/dist/file/provider/s3.provider.d.ts.map +1 -1
- package/dist/file/provider/s3.provider.js +4 -20
- package/dist/file/provider/s3.provider.js.map +1 -1
- package/dist/file/provider/spaces.provider.d.ts.map +1 -1
- package/dist/file/provider/spaces.provider.js +4 -19
- package/dist/file/provider/spaces.provider.js.map +1 -1
- package/dist/integration-profile/integration-profile.controller.d.ts +1 -1
- package/dist/integration-profile/integration-profile.controller.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.controller.js +4 -3
- package/dist/integration-profile/integration-profile.controller.js.map +1 -1
- package/dist/integration-profile/integration-profile.service.d.ts +1 -1
- package/dist/integration-profile/integration-profile.service.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.service.js +7 -4
- package/dist/integration-profile/integration-profile.service.js.map +1 -1
- package/dist/integration-profile/integration-profile.utils.d.ts +6 -0
- package/dist/integration-profile/integration-profile.utils.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.utils.js +9 -0
- package/dist/integration-profile/integration-profile.utils.js.map +1 -1
- package/dist/mail/mail.module.d.ts.map +1 -1
- package/dist/mail/mail.module.js +9 -4
- package/dist/mail/mail.module.js.map +1 -1
- package/dist/mail/mail.service.d.ts +2 -1
- package/dist/mail/mail.service.d.ts.map +1 -1
- package/dist/mail/mail.service.js +11 -7
- package/dist/mail/mail.service.js.map +1 -1
- package/dist/mcp/guards/mcp-auth.guard.js +1 -1
- package/dist/mcp/guards/mcp-auth.guard.js.map +1 -1
- package/dist/mcp/mcp-api-key.controller.d.ts +2 -0
- package/dist/mcp/mcp-api-key.controller.d.ts.map +1 -1
- package/dist/mcp/mcp-api-key.controller.js +1 -1
- package/dist/mcp/mcp-api-key.controller.js.map +1 -1
- package/dist/mcp/mcp-api-key.service.d.ts +2 -1
- package/dist/mcp/mcp-api-key.service.d.ts.map +1 -1
- package/dist/mcp/mcp-api-key.service.js +6 -2
- package/dist/mcp/mcp-api-key.service.js.map +1 -1
- package/dist/mcp/mcp.module.d.ts.map +1 -1
- package/dist/mcp/mcp.module.js +1 -3
- package/dist/mcp/mcp.module.js.map +1 -1
- package/dist/oauth/interfaces/OAuthProvider.d.ts +1 -1
- package/dist/oauth/interfaces/OAuthProvider.d.ts.map +1 -1
- package/dist/oauth/oauth.controller.d.ts +4 -1
- package/dist/oauth/oauth.controller.d.ts.map +1 -1
- package/dist/oauth/oauth.controller.js +31 -5
- package/dist/oauth/oauth.controller.js.map +1 -1
- package/dist/oauth/oauth.service.d.ts +12 -1
- package/dist/oauth/oauth.service.d.ts.map +1 -1
- package/dist/oauth/oauth.service.js +125 -23
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/oauth/providers/abstract.provider.d.ts +1 -1
- package/dist/oauth/providers/abstract.provider.d.ts.map +1 -1
- package/dist/oauth/providers/facebook.provider.d.ts +5 -2
- package/dist/oauth/providers/facebook.provider.d.ts.map +1 -1
- package/dist/oauth/providers/facebook.provider.js +34 -19
- package/dist/oauth/providers/facebook.provider.js.map +1 -1
- package/dist/oauth/providers/github.provider.d.ts +6 -2
- package/dist/oauth/providers/github.provider.d.ts.map +1 -1
- package/dist/oauth/providers/github.provider.js +43 -20
- package/dist/oauth/providers/github.provider.js.map +1 -1
- package/dist/oauth/providers/google.provider.d.ts +5 -2
- package/dist/oauth/providers/google.provider.d.ts.map +1 -1
- package/dist/oauth/providers/google.provider.js +34 -19
- package/dist/oauth/providers/google.provider.js.map +1 -1
- package/dist/oauth/providers/microsoft-entra-id.provider.d.ts +5 -2
- package/dist/oauth/providers/microsoft-entra-id.provider.d.ts.map +1 -1
- package/dist/oauth/providers/microsoft-entra-id.provider.js +43 -40
- package/dist/oauth/providers/microsoft-entra-id.provider.js.map +1 -1
- package/dist/oauth/providers/microsoft.provider.d.ts +5 -2
- package/dist/oauth/providers/microsoft.provider.d.ts.map +1 -1
- package/dist/oauth/providers/microsoft.provider.js +34 -19
- package/dist/oauth/providers/microsoft.provider.js.map +1 -1
- package/dist/profile/profile.controller.js +1 -1
- package/dist/profile/profile.controller.js.map +1 -1
- package/dist/security/security.service.d.ts +2 -0
- package/dist/security/security.service.d.ts.map +1 -1
- package/dist/security/security.service.js +21 -0
- package/dist/security/security.service.js.map +1 -1
- package/dist/setting/setting.service.d.ts +26 -1
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +240 -5
- package/dist/setting/setting.service.js.map +1 -1
- package/dist/user/user.controller.d.ts +2 -1
- package/dist/user/user.controller.d.ts.map +1 -1
- package/dist/user/user.controller.js +5 -4
- package/dist/user/user.controller.js.map +1 -1
- package/dist/user/user.service.d.ts +4 -2
- package/dist/user/user.service.d.ts.map +1 -1
- package/dist/user/user.service.js +19 -4
- package/dist/user/user.service.js.map +1 -1
- package/dist/webhook-integration/dto/webhook-action.dto.d.ts +17 -2
- package/dist/webhook-integration/dto/webhook-action.dto.d.ts.map +1 -1
- package/dist/webhook-integration/dto/webhook-action.dto.js +93 -2
- package/dist/webhook-integration/dto/webhook-action.dto.js.map +1 -1
- package/dist/webhook-integration/webhook-command.registry.d.ts +15 -0
- package/dist/webhook-integration/webhook-command.registry.d.ts.map +1 -0
- package/dist/webhook-integration/webhook-command.registry.js +36 -0
- package/dist/webhook-integration/webhook-command.registry.js.map +1 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts +19 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.controller.js +38 -0
- package/dist/webhook-integration/webhook-integration.controller.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.module.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.module.js +5 -0
- package/dist/webhook-integration/webhook-integration.module.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts +25 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.js +332 -23
- package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
- package/hedhog/data/integration_provider.yaml +16 -0
- package/hedhog/data/menu.yaml +0 -16
- package/hedhog/data/route.yaml +32 -383
- package/hedhog/data/setting_group.yaml +179 -174
- package/hedhog/data/setting_subgroup.yaml +16 -0
- package/hedhog/frontend/app/account/components/tokens.tsx.ejs +421 -0
- package/hedhog/frontend/app/account/layout.tsx.ejs +6 -3
- package/hedhog/frontend/app/account/mcp-tokens/page.tsx.ejs +2 -2
- package/hedhog/frontend/app/account/tokens/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +414 -76
- package/hedhog/frontend/app/configurations/layout.tsx.ejs +1 -1
- package/hedhog/frontend/app/dashboard/dashboard-home-tabs.tsx.ejs +3 -1
- package/hedhog/frontend/app/integration/profiles/page.tsx.ejs +186 -18
- package/hedhog/frontend/app/integrations-webhooks/page.tsx.ejs +597 -21
- package/hedhog/frontend/app/mail/profiles/page.tsx.ejs +2 -2
- package/hedhog/frontend/app/setting-list/page.tsx.ejs +229 -395
- package/hedhog/frontend/messages/en.json +67 -3
- package/hedhog/frontend/messages/pt.json +67 -3
- package/hedhog/table/file.yaml +1 -1
- package/hedhog/table/mcp_api_key.yaml +4 -0
- package/hedhog/table/webhook_action.yaml +57 -1
- package/package.json +5 -4
- package/src/auth/guards/auth.guard.ts +32 -0
- package/src/file/file.controller.ts +51 -42
- package/src/file/file.service.ts +31 -52
- package/src/file/provider/azure.provider.ts +14 -28
- package/src/file/provider/gcs.provider.ts +9 -9
- package/src/file/provider/local.provider.ts +10 -13
- package/src/file/provider/provider.factory.ts +19 -7
- package/src/file/provider/s3.provider.ts +4 -20
- package/src/file/provider/spaces.provider.ts +4 -19
- package/src/integration-profile/integration-profile.controller.ts +2 -0
- package/src/integration-profile/integration-profile.service.ts +7 -2
- package/src/integration-profile/integration-profile.utils.ts +17 -0
- package/src/mail/mail.module.ts +14 -4
- package/src/mail/mail.service.ts +12 -7
- package/src/mcp/guards/mcp-auth.guard.ts +1 -1
- package/src/mcp/mcp-api-key.controller.ts +2 -2
- package/src/mcp/mcp-api-key.service.ts +6 -2
- package/src/mcp/mcp.module.ts +1 -3
- package/src/oauth/interfaces/OAuthProvider.ts +1 -1
- package/src/oauth/oauth.controller.ts +30 -2
- package/src/oauth/oauth.service.ts +194 -35
- package/src/oauth/providers/abstract.provider.ts +1 -1
- package/src/oauth/providers/facebook.provider.ts +36 -20
- package/src/oauth/providers/github.provider.ts +46 -23
- package/src/oauth/providers/google.provider.ts +36 -20
- package/src/oauth/providers/microsoft-entra-id.provider.ts +42 -46
- package/src/oauth/providers/microsoft.provider.ts +36 -21
- package/src/profile/profile.controller.ts +2 -2
- package/src/security/security.service.ts +34 -1
- package/src/setting/setting.service.ts +307 -7
- package/src/user/user.controller.ts +4 -1
- package/src/user/user.service.ts +20 -2
- package/src/webhook-integration/dto/webhook-action.dto.ts +85 -4
- package/src/webhook-integration/webhook-command.registry.ts +42 -0
- package/src/webhook-integration/webhook-integration.controller.ts +20 -0
- package/src/webhook-integration/webhook-integration.module.ts +50 -45
- package/src/webhook-integration/webhook-integration.service.ts +374 -11
- package/dist/mail-profile/dto/create.dto.d.ts +0 -23
- package/dist/mail-profile/dto/create.dto.d.ts.map +0 -1
- package/dist/mail-profile/dto/create.dto.js +0 -139
- package/dist/mail-profile/dto/create.dto.js.map +0 -1
- package/dist/mail-profile/dto/update.dto.d.ts +0 -6
- package/dist/mail-profile/dto/update.dto.d.ts.map +0 -1
- package/dist/mail-profile/dto/update.dto.js +0 -9
- package/dist/mail-profile/dto/update.dto.js.map +0 -1
- package/dist/mail-profile/mail-profile.controller.d.ts +0 -94
- package/dist/mail-profile/mail-profile.controller.d.ts.map +0 -1
- package/dist/mail-profile/mail-profile.controller.js +0 -95
- package/dist/mail-profile/mail-profile.controller.js.map +0 -1
- package/dist/mail-profile/mail-profile.module.d.ts +0 -3
- package/dist/mail-profile/mail-profile.module.d.ts.map +0 -1
- package/dist/mail-profile/mail-profile.module.js +0 -31
- package/dist/mail-profile/mail-profile.module.js.map +0 -1
- package/dist/mail-profile/mail-profile.service.d.ts +0 -109
- package/dist/mail-profile/mail-profile.service.d.ts.map +0 -1
- package/dist/mail-profile/mail-profile.service.js +0 -278
- package/dist/mail-profile/mail-profile.service.js.map +0 -1
- package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts +0 -20
- package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts.map +0 -1
- package/dist/mcp/tools/core-mail-profile.mcp-tools.js +0 -96
- package/dist/mcp/tools/core-mail-profile.mcp-tools.js.map +0 -1
- package/dist/whatsapp-profile/dto/create.dto.d.ts +0 -11
- package/dist/whatsapp-profile/dto/create.dto.d.ts.map +0 -1
- package/dist/whatsapp-profile/dto/create.dto.js +0 -55
- package/dist/whatsapp-profile/dto/create.dto.js.map +0 -1
- package/dist/whatsapp-profile/dto/update.dto.d.ts +0 -6
- package/dist/whatsapp-profile/dto/update.dto.d.ts.map +0 -1
- package/dist/whatsapp-profile/dto/update.dto.js +0 -9
- package/dist/whatsapp-profile/dto/update.dto.js.map +0 -1
- package/dist/whatsapp-profile/whatsapp-profile.controller.d.ts +0 -54
- package/dist/whatsapp-profile/whatsapp-profile.controller.d.ts.map +0 -1
- package/dist/whatsapp-profile/whatsapp-profile.controller.js +0 -85
- package/dist/whatsapp-profile/whatsapp-profile.controller.js.map +0 -1
- package/dist/whatsapp-profile/whatsapp-profile.module.d.ts +0 -3
- package/dist/whatsapp-profile/whatsapp-profile.module.d.ts.map +0 -1
- package/dist/whatsapp-profile/whatsapp-profile.module.js +0 -26
- package/dist/whatsapp-profile/whatsapp-profile.module.js.map +0 -1
- package/dist/whatsapp-profile/whatsapp-profile.service.d.ts +0 -63
- package/dist/whatsapp-profile/whatsapp-profile.service.d.ts.map +0 -1
- package/dist/whatsapp-profile/whatsapp-profile.service.js +0 -138
- package/dist/whatsapp-profile/whatsapp-profile.service.js.map +0 -1
- package/hedhog/data/mail_profile.yaml +0 -18
- package/hedhog/data/whatsapp_profile.yaml +0 -6
- package/hedhog/table/mail_profile.yaml +0 -75
- package/hedhog/table/whatsapp_profile.yaml +0 -26
- package/src/mail-profile/dto/create.dto.ts +0 -145
- package/src/mail-profile/dto/update.dto.ts +0 -4
- package/src/mail-profile/mail-profile.controller.ts +0 -56
- package/src/mail-profile/mail-profile.module.ts +0 -18
- package/src/mail-profile/mail-profile.service.ts +0 -308
- package/src/mcp/tools/core-mail-profile.mcp-tools.ts +0 -69
- package/src/whatsapp-profile/dto/create.dto.ts +0 -36
- package/src/whatsapp-profile/dto/update.dto.ts +0 -4
- package/src/whatsapp-profile/whatsapp-profile.controller.ts +0 -51
- package/src/whatsapp-profile/whatsapp-profile.module.ts +0 -13
- package/src/whatsapp-profile/whatsapp-profile.service.ts +0 -160
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.WhatsAppProfileController = void 0;
|
|
16
|
-
const api_1 = require("@hed-hog/api");
|
|
17
|
-
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
18
|
-
const common_1 = require("@nestjs/common");
|
|
19
|
-
const create_dto_1 = require("./dto/create.dto");
|
|
20
|
-
const update_dto_1 = require("./dto/update.dto");
|
|
21
|
-
const whatsapp_profile_service_1 = require("./whatsapp-profile.service");
|
|
22
|
-
let WhatsAppProfileController = class WhatsAppProfileController {
|
|
23
|
-
constructor(whatsappProfileService) {
|
|
24
|
-
this.whatsappProfileService = whatsappProfileService;
|
|
25
|
-
}
|
|
26
|
-
async list(paginationParams) {
|
|
27
|
-
return this.whatsappProfileService.list(paginationParams);
|
|
28
|
-
}
|
|
29
|
-
async get(id) {
|
|
30
|
-
return this.whatsappProfileService.get(id);
|
|
31
|
-
}
|
|
32
|
-
async create(data) {
|
|
33
|
-
return this.whatsappProfileService.create(data);
|
|
34
|
-
}
|
|
35
|
-
async update(id, data) {
|
|
36
|
-
return this.whatsappProfileService.update({ id, data });
|
|
37
|
-
}
|
|
38
|
-
async delete(data) {
|
|
39
|
-
return this.whatsappProfileService.delete(data);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.WhatsAppProfileController = WhatsAppProfileController;
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, common_1.Get)(),
|
|
45
|
-
__param(0, (0, api_pagination_1.Pagination)()),
|
|
46
|
-
__metadata("design:type", Function),
|
|
47
|
-
__metadata("design:paramtypes", [Object]),
|
|
48
|
-
__metadata("design:returntype", Promise)
|
|
49
|
-
], WhatsAppProfileController.prototype, "list", null);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, common_1.Get)(':id'),
|
|
52
|
-
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
53
|
-
__metadata("design:type", Function),
|
|
54
|
-
__metadata("design:paramtypes", [Number]),
|
|
55
|
-
__metadata("design:returntype", Promise)
|
|
56
|
-
], WhatsAppProfileController.prototype, "get", null);
|
|
57
|
-
__decorate([
|
|
58
|
-
(0, common_1.Post)(),
|
|
59
|
-
__param(0, (0, common_1.Body)()),
|
|
60
|
-
__metadata("design:type", Function),
|
|
61
|
-
__metadata("design:paramtypes", [create_dto_1.CreateDTO]),
|
|
62
|
-
__metadata("design:returntype", Promise)
|
|
63
|
-
], WhatsAppProfileController.prototype, "create", null);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, common_1.Patch)(':id'),
|
|
66
|
-
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
67
|
-
__param(1, (0, common_1.Body)()),
|
|
68
|
-
__metadata("design:type", Function),
|
|
69
|
-
__metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
|
|
70
|
-
__metadata("design:returntype", Promise)
|
|
71
|
-
], WhatsAppProfileController.prototype, "update", null);
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, common_1.Delete)(),
|
|
74
|
-
__param(0, (0, common_1.Body)()),
|
|
75
|
-
__metadata("design:type", Function),
|
|
76
|
-
__metadata("design:paramtypes", [api_1.DeleteDTO]),
|
|
77
|
-
__metadata("design:returntype", Promise)
|
|
78
|
-
], WhatsAppProfileController.prototype, "delete", null);
|
|
79
|
-
exports.WhatsAppProfileController = WhatsAppProfileController = __decorate([
|
|
80
|
-
(0, api_1.Role)(),
|
|
81
|
-
(0, common_1.Controller)('whatsapp-profile'),
|
|
82
|
-
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => whatsapp_profile_service_1.WhatsAppProfileService))),
|
|
83
|
-
__metadata("design:paramtypes", [whatsapp_profile_service_1.WhatsAppProfileService])
|
|
84
|
-
], WhatsAppProfileController);
|
|
85
|
-
//# sourceMappingURL=whatsapp-profile.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp-profile.controller.js","sourceRoot":"","sources":["../../src/whatsapp-profile/whatsapp-profile.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA+C;AAC/C,4DAAqD;AACrD,2CAWwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,yEAAoE;AAI7D,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAEmB,sBAA8C;QAA9C,2BAAsB,GAAtB,sBAAsB,CAAwB;IAC9D,CAAC;IAGE,AAAN,KAAK,CAAC,IAAI,CAAe,gBAAgB;QACvC,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC5D,CAAC;IAGK,AAAN,KAAK,CAAC,GAAG,CAA4B,EAAU;QAC7C,OAAO,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,IAAe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p-profile/whatsapp-profile.module.ts"],"names":[],"mappings":"AAMA,qBAMa,qBAAqB;CAAG"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.WhatsAppProfileModule = void 0;
|
|
10
|
-
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
11
|
-
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
12
|
-
const common_1 = require("@nestjs/common");
|
|
13
|
-
const whatsapp_profile_controller_1 = require("./whatsapp-profile.controller");
|
|
14
|
-
const whatsapp_profile_service_1 = require("./whatsapp-profile.service");
|
|
15
|
-
let WhatsAppProfileModule = class WhatsAppProfileModule {
|
|
16
|
-
};
|
|
17
|
-
exports.WhatsAppProfileModule = WhatsAppProfileModule;
|
|
18
|
-
exports.WhatsAppProfileModule = WhatsAppProfileModule = __decorate([
|
|
19
|
-
(0, common_1.Module)({
|
|
20
|
-
imports: [(0, common_1.forwardRef)(() => api_prisma_1.PrismaModule), (0, common_1.forwardRef)(() => api_pagination_1.PaginationModule)],
|
|
21
|
-
controllers: [whatsapp_profile_controller_1.WhatsAppProfileController],
|
|
22
|
-
providers: [whatsapp_profile_service_1.WhatsAppProfileService],
|
|
23
|
-
exports: [whatsapp_profile_service_1.WhatsAppProfileService],
|
|
24
|
-
})
|
|
25
|
-
], WhatsAppProfileModule);
|
|
26
|
-
//# sourceMappingURL=whatsapp-profile.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp-profile.module.js","sourceRoot":"","sources":["../../src/whatsapp-profile/whatsapp-profile.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,4DAA2D;AAC3D,oDAAmD;AACnD,2CAAoD;AACpD,+EAA0E;AAC1E,yEAAoE;AAQ7D,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IANjC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC,CAAC;QAC7E,WAAW,EAAE,CAAC,uDAAyB,CAAC;QACxC,SAAS,EAAE,CAAC,iDAAsB,CAAC;QACnC,OAAO,EAAE,CAAC,iDAAsB,CAAC;KAClC,CAAC;GACW,qBAAqB,CAAG"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { DeleteDTO } from '@hed-hog/api';
|
|
2
|
-
import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
|
|
3
|
-
import { PrismaService } from '@hed-hog/api-prisma';
|
|
4
|
-
import { CreateDTO } from './dto/create.dto';
|
|
5
|
-
import { UpdateDTO } from './dto/update.dto';
|
|
6
|
-
export declare class WhatsAppProfileService {
|
|
7
|
-
private readonly prismaService;
|
|
8
|
-
private readonly paginationService;
|
|
9
|
-
constructor(prismaService: PrismaService, paginationService: PaginationService);
|
|
10
|
-
list(paginationParams: PaginationDTO): Promise<{
|
|
11
|
-
total: any;
|
|
12
|
-
lastPage: number;
|
|
13
|
-
page: number;
|
|
14
|
-
pageSize: number;
|
|
15
|
-
prev: number;
|
|
16
|
-
next: number;
|
|
17
|
-
data: any[];
|
|
18
|
-
}>;
|
|
19
|
-
get(id: number): Promise<{
|
|
20
|
-
name: string;
|
|
21
|
-
id: number;
|
|
22
|
-
host: string;
|
|
23
|
-
provider: import("@prisma/client").$Enums.whatsapp_profile_provider_enum;
|
|
24
|
-
created_at: Date;
|
|
25
|
-
updated_at: Date;
|
|
26
|
-
slug: string;
|
|
27
|
-
token: string;
|
|
28
|
-
instance_name: string;
|
|
29
|
-
}>;
|
|
30
|
-
create(data: CreateDTO): Promise<{
|
|
31
|
-
name: string;
|
|
32
|
-
id: number;
|
|
33
|
-
host: string;
|
|
34
|
-
provider: import("@prisma/client").$Enums.whatsapp_profile_provider_enum;
|
|
35
|
-
created_at: Date;
|
|
36
|
-
updated_at: Date;
|
|
37
|
-
slug: string;
|
|
38
|
-
token: string;
|
|
39
|
-
instance_name: string;
|
|
40
|
-
}>;
|
|
41
|
-
update({ id, data }: {
|
|
42
|
-
id: number;
|
|
43
|
-
data: UpdateDTO;
|
|
44
|
-
}): Promise<{
|
|
45
|
-
name: string;
|
|
46
|
-
id: number;
|
|
47
|
-
host: string;
|
|
48
|
-
provider: import("@prisma/client").$Enums.whatsapp_profile_provider_enum;
|
|
49
|
-
created_at: Date;
|
|
50
|
-
updated_at: Date;
|
|
51
|
-
slug: string;
|
|
52
|
-
token: string;
|
|
53
|
-
instance_name: string;
|
|
54
|
-
}>;
|
|
55
|
-
delete({ ids }: DeleteDTO): Promise<{
|
|
56
|
-
count: number;
|
|
57
|
-
}>;
|
|
58
|
-
private ensureSlugIsAvailable;
|
|
59
|
-
private validateProviderFields;
|
|
60
|
-
private normalizeData;
|
|
61
|
-
private normalizeString;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=whatsapp-profile.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp-profile.service.d.ts","sourceRoot":"","sources":["../../src/whatsapp-profile/whatsapp-profile.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,sBAAsB;IAG/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,IAAI,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAyBpC,GAAG,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;IAYd,MAAM,CAAC,IAAI,EAAE,SAAS;;;;;;;;;;;IAStB,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;;;;;;;;;;;IA0BpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;YAc9C,qBAAqB;IAanC,OAAO,CAAC,sBAAsB;IAwB9B,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,eAAe;CAGxB"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.WhatsAppProfileService = void 0;
|
|
16
|
-
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
17
|
-
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
18
|
-
const common_1 = require("@nestjs/common");
|
|
19
|
-
let WhatsAppProfileService = class WhatsAppProfileService {
|
|
20
|
-
constructor(prismaService, paginationService) {
|
|
21
|
-
this.prismaService = prismaService;
|
|
22
|
-
this.paginationService = paginationService;
|
|
23
|
-
}
|
|
24
|
-
async list(paginationParams) {
|
|
25
|
-
const fields = ['slug', 'name', 'host', 'instance_name'];
|
|
26
|
-
const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
|
|
27
|
-
return this.paginationService.paginate(this.prismaService.whatsapp_profile, paginationParams, {
|
|
28
|
-
where: OR.length > 0 ? { OR } : {},
|
|
29
|
-
select: {
|
|
30
|
-
id: true,
|
|
31
|
-
slug: true,
|
|
32
|
-
name: true,
|
|
33
|
-
provider: true,
|
|
34
|
-
host: true,
|
|
35
|
-
token: true,
|
|
36
|
-
instance_name: true,
|
|
37
|
-
created_at: true,
|
|
38
|
-
updated_at: true,
|
|
39
|
-
},
|
|
40
|
-
orderBy: [{ updated_at: 'desc' }, { id: 'desc' }],
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
async get(id) {
|
|
44
|
-
const profile = await this.prismaService.whatsapp_profile.findUnique({
|
|
45
|
-
where: { id },
|
|
46
|
-
});
|
|
47
|
-
if (!profile) {
|
|
48
|
-
throw new common_1.NotFoundException(`WhatsApp profile with id ${id} not found.`);
|
|
49
|
-
}
|
|
50
|
-
return profile;
|
|
51
|
-
}
|
|
52
|
-
async create(data) {
|
|
53
|
-
await this.ensureSlugIsAvailable(data.slug);
|
|
54
|
-
this.validateProviderFields(data);
|
|
55
|
-
return this.prismaService.whatsapp_profile.create({
|
|
56
|
-
data: this.normalizeData(data),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
async update({ id, data }) {
|
|
60
|
-
const existing = await this.prismaService.whatsapp_profile.findUnique({
|
|
61
|
-
where: { id },
|
|
62
|
-
});
|
|
63
|
-
if (!existing) {
|
|
64
|
-
throw new common_1.NotFoundException(`WhatsApp profile with id ${id} not found.`);
|
|
65
|
-
}
|
|
66
|
-
if (data.slug && data.slug !== existing.slug) {
|
|
67
|
-
await this.ensureSlugIsAvailable(data.slug);
|
|
68
|
-
}
|
|
69
|
-
const merged = Object.assign(Object.assign({}, existing), data);
|
|
70
|
-
this.validateProviderFields(merged);
|
|
71
|
-
return this.prismaService.whatsapp_profile.update({
|
|
72
|
-
where: { id },
|
|
73
|
-
data: this.normalizeData(merged),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
async delete({ ids }) {
|
|
77
|
-
if (!(ids === null || ids === void 0 ? void 0 : ids.length)) {
|
|
78
|
-
throw new common_1.BadRequestException('You must select at least one item to delete.');
|
|
79
|
-
}
|
|
80
|
-
return this.prismaService.whatsapp_profile.deleteMany({
|
|
81
|
-
where: {
|
|
82
|
-
id: {
|
|
83
|
-
in: ids,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
async ensureSlugIsAvailable(slug) {
|
|
89
|
-
const existing = await this.prismaService.whatsapp_profile.findUnique({
|
|
90
|
-
where: { slug },
|
|
91
|
-
select: { id: true },
|
|
92
|
-
});
|
|
93
|
-
if (existing) {
|
|
94
|
-
throw new common_1.BadRequestException(`WhatsApp profile with slug "${slug}" already exists.`);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
validateProviderFields(input) {
|
|
98
|
-
var _a, _b, _c, _d;
|
|
99
|
-
const provider = String((_a = input.provider) !== null && _a !== void 0 ? _a : '').toUpperCase();
|
|
100
|
-
if (!provider) {
|
|
101
|
-
throw new common_1.BadRequestException('Provider is required.');
|
|
102
|
-
}
|
|
103
|
-
if (provider !== 'WHATSAPP_API') {
|
|
104
|
-
throw new common_1.BadRequestException(`Invalid provider: ${provider}`);
|
|
105
|
-
}
|
|
106
|
-
if (!String((_b = input.host) !== null && _b !== void 0 ? _b : '').trim()) {
|
|
107
|
-
throw new common_1.BadRequestException('WhatsApp host is required.');
|
|
108
|
-
}
|
|
109
|
-
if (!String((_c = input.token) !== null && _c !== void 0 ? _c : '').trim()) {
|
|
110
|
-
throw new common_1.BadRequestException('WhatsApp token is required.');
|
|
111
|
-
}
|
|
112
|
-
if (!String((_d = input.instance_name) !== null && _d !== void 0 ? _d : '').trim()) {
|
|
113
|
-
throw new common_1.BadRequestException('WhatsApp instance name is required.');
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
normalizeData(input) {
|
|
117
|
-
return {
|
|
118
|
-
slug: this.normalizeString(input.slug),
|
|
119
|
-
name: this.normalizeString(input.name),
|
|
120
|
-
provider: 'WHATSAPP_API',
|
|
121
|
-
host: this.normalizeString(input.host),
|
|
122
|
-
token: this.normalizeString(input.token),
|
|
123
|
-
instance_name: this.normalizeString(input.instance_name),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
normalizeString(value) {
|
|
127
|
-
return String(value !== null && value !== void 0 ? value : '').trim();
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
exports.WhatsAppProfileService = WhatsAppProfileService;
|
|
131
|
-
exports.WhatsAppProfileService = WhatsAppProfileService = __decorate([
|
|
132
|
-
(0, common_1.Injectable)(),
|
|
133
|
-
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
|
|
134
|
-
__param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_pagination_1.PaginationService))),
|
|
135
|
-
__metadata("design:paramtypes", [api_prisma_1.PrismaService,
|
|
136
|
-
api_pagination_1.PaginationService])
|
|
137
|
-
], WhatsAppProfileService);
|
|
138
|
-
//# sourceMappingURL=whatsapp-profile.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp-profile.service.js","sourceRoot":"","sources":["../../src/whatsapp-profile/whatsapp-profile.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,4DAA2E;AAC3E,oDAAoD;AACpD,2CAMwB;AAKjB,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,gBAA+B;QACxC,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QACzD,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAEhF,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CACpC,IAAI,CAAC,aAAa,CAAC,gBAAgB,EACnC,gBAAgB,EAChB;YACE,KAAK,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;YAClC,MAAM,EAAE;gBACN,EAAE,EAAE,IAAI;gBACR,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,IAAI;gBACX,aAAa,EAAE,IAAI;gBACnB,UAAU,EAAE,IAAI;gBAChB,UAAU,EAAE,IAAI;aACjB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ADlC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kCAAiB,CAAC,CAAC,CAAA;qCADZ,0BAAa;QAET,kCAAiB;GAL5C,sBAAsB,CAiJlC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
- slug: default
|
|
2
|
-
name: default
|
|
3
|
-
provider: SMTP
|
|
4
|
-
from_name: Hedhog
|
|
5
|
-
from_email: noreply@hedhog.local
|
|
6
|
-
reply_to_name: null
|
|
7
|
-
reply_to_email: null
|
|
8
|
-
smtp_host: localhost
|
|
9
|
-
smtp_port: 1025
|
|
10
|
-
smtp_secure: false
|
|
11
|
-
smtp_username: null
|
|
12
|
-
smtp_password: null
|
|
13
|
-
gmail_client_id: null
|
|
14
|
-
gmail_client_secret: null
|
|
15
|
-
gmail_refresh_token: null
|
|
16
|
-
ses_access_key_id: null
|
|
17
|
-
ses_secret_access_key: null
|
|
18
|
-
ses_region: null
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- type: slug
|
|
4
|
-
- name: name
|
|
5
|
-
type: varchar
|
|
6
|
-
length: 127
|
|
7
|
-
- name: provider
|
|
8
|
-
type: enum
|
|
9
|
-
enum:
|
|
10
|
-
- SMTP
|
|
11
|
-
- GMAIL
|
|
12
|
-
- SES
|
|
13
|
-
default: SMTP
|
|
14
|
-
- name: from_name
|
|
15
|
-
type: varchar
|
|
16
|
-
length: 127
|
|
17
|
-
isNullable: true
|
|
18
|
-
- name: from_email
|
|
19
|
-
type: varchar
|
|
20
|
-
length: 255
|
|
21
|
-
- name: reply_to_name
|
|
22
|
-
type: varchar
|
|
23
|
-
length: 127
|
|
24
|
-
isNullable: true
|
|
25
|
-
- name: reply_to_email
|
|
26
|
-
type: varchar
|
|
27
|
-
length: 255
|
|
28
|
-
isNullable: true
|
|
29
|
-
- name: smtp_host
|
|
30
|
-
type: varchar
|
|
31
|
-
length: 255
|
|
32
|
-
isNullable: true
|
|
33
|
-
- name: smtp_port
|
|
34
|
-
type: int
|
|
35
|
-
isNullable: true
|
|
36
|
-
- name: smtp_secure
|
|
37
|
-
type: boolean
|
|
38
|
-
default: false
|
|
39
|
-
- name: smtp_username
|
|
40
|
-
type: varchar
|
|
41
|
-
length: 255
|
|
42
|
-
isNullable: true
|
|
43
|
-
- name: smtp_password
|
|
44
|
-
type: varchar
|
|
45
|
-
length: 255
|
|
46
|
-
isNullable: true
|
|
47
|
-
- name: gmail_client_id
|
|
48
|
-
type: varchar
|
|
49
|
-
length: 255
|
|
50
|
-
isNullable: true
|
|
51
|
-
- name: gmail_client_secret
|
|
52
|
-
type: varchar
|
|
53
|
-
length: 255
|
|
54
|
-
isNullable: true
|
|
55
|
-
- name: gmail_refresh_token
|
|
56
|
-
type: text
|
|
57
|
-
isNullable: true
|
|
58
|
-
- name: ses_access_key_id
|
|
59
|
-
type: varchar
|
|
60
|
-
length: 255
|
|
61
|
-
isNullable: true
|
|
62
|
-
- name: ses_secret_access_key
|
|
63
|
-
type: varchar
|
|
64
|
-
length: 255
|
|
65
|
-
isNullable: true
|
|
66
|
-
- name: ses_region
|
|
67
|
-
type: varchar
|
|
68
|
-
length: 127
|
|
69
|
-
isNullable: true
|
|
70
|
-
- type: created_at
|
|
71
|
-
- type: updated_at
|
|
72
|
-
indices:
|
|
73
|
-
- columns:
|
|
74
|
-
- slug
|
|
75
|
-
isUnique: true
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- type: slug
|
|
4
|
-
- name: name
|
|
5
|
-
type: varchar
|
|
6
|
-
length: 127
|
|
7
|
-
- name: provider
|
|
8
|
-
type: enum
|
|
9
|
-
enum:
|
|
10
|
-
- WHATSAPP_API
|
|
11
|
-
default: WHATSAPP_API
|
|
12
|
-
- name: host
|
|
13
|
-
type: varchar
|
|
14
|
-
length: 255
|
|
15
|
-
- name: token
|
|
16
|
-
type: varchar
|
|
17
|
-
length: 255
|
|
18
|
-
- name: instance_name
|
|
19
|
-
type: varchar
|
|
20
|
-
length: 127
|
|
21
|
-
- type: created_at
|
|
22
|
-
- type: updated_at
|
|
23
|
-
indices:
|
|
24
|
-
- columns:
|
|
25
|
-
- slug
|
|
26
|
-
isUnique: true
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { getLocaleText } from '@hed-hog/api-locale';
|
|
2
|
-
import { Transform } from 'class-transformer';
|
|
3
|
-
import {
|
|
4
|
-
IsBoolean,
|
|
5
|
-
IsEmail,
|
|
6
|
-
IsIn,
|
|
7
|
-
IsInt,
|
|
8
|
-
IsOptional,
|
|
9
|
-
IsString,
|
|
10
|
-
MaxLength,
|
|
11
|
-
Min,
|
|
12
|
-
} from 'class-validator';
|
|
13
|
-
|
|
14
|
-
const providerOptions = ['SMTP', 'GMAIL', 'SES'] as const;
|
|
15
|
-
|
|
16
|
-
export class CreateDTO {
|
|
17
|
-
@IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
|
|
18
|
-
@MaxLength(127)
|
|
19
|
-
@Transform(({ value }) => String(value ?? '').trim())
|
|
20
|
-
slug: string;
|
|
21
|
-
|
|
22
|
-
@IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
|
|
23
|
-
@MaxLength(127)
|
|
24
|
-
@Transform(({ value }) => String(value ?? '').trim())
|
|
25
|
-
name: string;
|
|
26
|
-
|
|
27
|
-
@IsIn(providerOptions)
|
|
28
|
-
@Transform(({ value }) => String(value ?? '').trim().toUpperCase())
|
|
29
|
-
provider: (typeof providerOptions)[number];
|
|
30
|
-
|
|
31
|
-
@IsOptional()
|
|
32
|
-
@IsString()
|
|
33
|
-
@MaxLength(127)
|
|
34
|
-
@Transform(({ value }) =>
|
|
35
|
-
value === undefined || value === null || value === '' ? undefined : String(value).trim(),
|
|
36
|
-
)
|
|
37
|
-
from_name?: string;
|
|
38
|
-
|
|
39
|
-
@IsEmail({}, { message: 'Invalid email address.' })
|
|
40
|
-
@MaxLength(255)
|
|
41
|
-
@Transform(({ value }) => String(value ?? '').trim())
|
|
42
|
-
from_email: string;
|
|
43
|
-
|
|
44
|
-
@IsOptional()
|
|
45
|
-
@IsString()
|
|
46
|
-
@MaxLength(127)
|
|
47
|
-
@Transform(({ value }) =>
|
|
48
|
-
value === undefined || value === null || value === '' ? undefined : String(value).trim(),
|
|
49
|
-
)
|
|
50
|
-
reply_to_name?: string;
|
|
51
|
-
|
|
52
|
-
@IsOptional()
|
|
53
|
-
@IsEmail({}, { message: 'Invalid email address.' })
|
|
54
|
-
@MaxLength(255)
|
|
55
|
-
@Transform(({ value }) =>
|
|
56
|
-
value === undefined || value === null || value === '' ? undefined : String(value).trim(),
|
|
57
|
-
)
|
|
58
|
-
reply_to_email?: string;
|
|
59
|
-
|
|
60
|
-
@IsOptional()
|
|
61
|
-
@IsString()
|
|
62
|
-
@MaxLength(255)
|
|
63
|
-
@Transform(({ value }) =>
|
|
64
|
-
value === undefined || value === null || value === '' ? undefined : String(value).trim(),
|
|
65
|
-
)
|
|
66
|
-
smtp_host?: string;
|
|
67
|
-
|
|
68
|
-
@IsOptional()
|
|
69
|
-
@Transform(({ value }) =>
|
|
70
|
-
value === undefined || value === null || value === '' ? undefined : Number(value),
|
|
71
|
-
)
|
|
72
|
-
@IsInt()
|
|
73
|
-
@Min(1)
|
|
74
|
-
smtp_port?: number;
|
|
75
|
-
|
|
76
|
-
@IsOptional()
|
|
77
|
-
@Transform(({ value }) =>
|
|
78
|
-
value === true || value === 'true' || value === 1 || value === '1',
|
|
79
|
-
)
|
|
80
|
-
@IsBoolean()
|
|
81
|
-
smtp_secure?: boolean;
|
|
82
|
-
|
|
83
|
-
@IsOptional()
|
|
84
|
-
@IsString()
|
|
85
|
-
@MaxLength(255)
|
|
86
|
-
@Transform(({ value }) =>
|
|
87
|
-
value === undefined || value === null || value === '' ? undefined : String(value).trim(),
|
|
88
|
-
)
|
|
89
|
-
smtp_username?: string;
|
|
90
|
-
|
|
91
|
-
@IsOptional()
|
|
92
|
-
@IsString()
|
|
93
|
-
@MaxLength(255)
|
|
94
|
-
@Transform(({ value }) =>
|
|
95
|
-
value === undefined || value === null || value === '' ? undefined : String(value),
|
|
96
|
-
)
|
|
97
|
-
smtp_password?: string;
|
|
98
|
-
|
|
99
|
-
@IsOptional()
|
|
100
|
-
@IsString()
|
|
101
|
-
@MaxLength(255)
|
|
102
|
-
@Transform(({ value }) =>
|
|
103
|
-
value === undefined || value === null || value === '' ? undefined : String(value).trim(),
|
|
104
|
-
)
|
|
105
|
-
gmail_client_id?: string;
|
|
106
|
-
|
|
107
|
-
@IsOptional()
|
|
108
|
-
@IsString()
|
|
109
|
-
@MaxLength(255)
|
|
110
|
-
@Transform(({ value }) =>
|
|
111
|
-
value === undefined || value === null || value === '' ? undefined : String(value),
|
|
112
|
-
)
|
|
113
|
-
gmail_client_secret?: string;
|
|
114
|
-
|
|
115
|
-
@IsOptional()
|
|
116
|
-
@IsString()
|
|
117
|
-
@Transform(({ value }) =>
|
|
118
|
-
value === undefined || value === null || value === '' ? undefined : String(value),
|
|
119
|
-
)
|
|
120
|
-
gmail_refresh_token?: string;
|
|
121
|
-
|
|
122
|
-
@IsOptional()
|
|
123
|
-
@IsString()
|
|
124
|
-
@MaxLength(255)
|
|
125
|
-
@Transform(({ value }) =>
|
|
126
|
-
value === undefined || value === null || value === '' ? undefined : String(value).trim(),
|
|
127
|
-
)
|
|
128
|
-
ses_access_key_id?: string;
|
|
129
|
-
|
|
130
|
-
@IsOptional()
|
|
131
|
-
@IsString()
|
|
132
|
-
@MaxLength(255)
|
|
133
|
-
@Transform(({ value }) =>
|
|
134
|
-
value === undefined || value === null || value === '' ? undefined : String(value),
|
|
135
|
-
)
|
|
136
|
-
ses_secret_access_key?: string;
|
|
137
|
-
|
|
138
|
-
@IsOptional()
|
|
139
|
-
@IsString()
|
|
140
|
-
@MaxLength(127)
|
|
141
|
-
@Transform(({ value }) =>
|
|
142
|
-
value === undefined || value === null || value === '' ? undefined : String(value).trim(),
|
|
143
|
-
)
|
|
144
|
-
ses_region?: string;
|
|
145
|
-
}
|