@hed-hog/core 0.0.354 → 0.0.356
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/ai/ai.service.d.ts +3 -12
- package/dist/ai/ai.service.d.ts.map +1 -1
- package/dist/ai/ai.service.js +34 -125
- package/dist/ai/ai.service.js.map +1 -1
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +3 -3
- package/dist/core.module.js.map +1 -1
- package/dist/file/file.service.d.ts +1 -1
- package/dist/file/file.service.d.ts.map +1 -1
- package/dist/file/file.service.js +50 -64
- package/dist/file/file.service.js.map +1 -1
- package/dist/file/provider/provider.enum.d.ts +2 -1
- package/dist/file/provider/provider.enum.d.ts.map +1 -1
- package/dist/file/provider/provider.enum.js +1 -0
- package/dist/file/provider/provider.enum.js.map +1 -1
- package/dist/file/provider/provider.factory.d.ts.map +1 -1
- package/dist/file/provider/provider.factory.js +3 -0
- package/dist/file/provider/provider.factory.js.map +1 -1
- package/dist/file/provider/spaces.provider.d.ts +27 -0
- package/dist/file/provider/spaces.provider.d.ts.map +1 -0
- package/dist/file/provider/spaces.provider.js +218 -0
- package/dist/file/provider/spaces.provider.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/integration-profile/dto/create.dto.d.ts +9 -0
- package/dist/integration-profile/dto/create.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/create.dto.js +54 -0
- package/dist/integration-profile/dto/create.dto.js.map +1 -0
- package/dist/integration-profile/dto/export.dto.d.ts +5 -0
- package/dist/integration-profile/dto/export.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/export.dto.js +29 -0
- package/dist/integration-profile/dto/export.dto.js.map +1 -0
- package/dist/integration-profile/dto/import-confirm.dto.d.ts +17 -0
- package/dist/integration-profile/dto/import-confirm.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/import-confirm.dto.js +77 -0
- package/dist/integration-profile/dto/import-confirm.dto.js.map +1 -0
- package/dist/integration-profile/dto/update.dto.d.ts +6 -0
- package/dist/integration-profile/dto/update.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/update.dto.js +9 -0
- package/dist/integration-profile/dto/update.dto.js.map +1 -0
- package/dist/integration-profile/integration-profile.controller.d.ts +142 -0
- package/dist/integration-profile/integration-profile.controller.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.controller.js +165 -0
- package/dist/integration-profile/integration-profile.controller.js.map +1 -0
- package/dist/integration-profile/integration-profile.module.d.ts +3 -0
- package/dist/integration-profile/integration-profile.module.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.module.js +29 -0
- package/dist/integration-profile/integration-profile.module.js.map +1 -0
- package/dist/integration-profile/integration-profile.service.d.ts +160 -0
- package/dist/integration-profile/integration-profile.service.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.service.js +606 -0
- package/dist/integration-profile/integration-profile.service.js.map +1 -0
- package/dist/integration-profile/integration-profile.utils.d.ts +24 -0
- package/dist/integration-profile/integration-profile.utils.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.utils.js +147 -0
- package/dist/integration-profile/integration-profile.utils.js.map +1 -0
- package/dist/mail/mail.module.d.ts.map +1 -1
- package/dist/mail/mail.module.js +27 -19
- package/dist/mail/mail.module.js.map +1 -1
- package/dist/mail/mail.service.d.ts +3 -2
- package/dist/mail/mail.service.d.ts.map +1 -1
- package/dist/mail/mail.service.js +25 -47
- package/dist/mail/mail.service.js.map +1 -1
- package/dist/mcp/mcp.module.js +2 -2
- package/dist/mcp/mcp.module.js.map +1 -1
- package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts +3 -15
- package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts.map +1 -1
- package/dist/mcp/tools/core-mail-profile.mcp-tools.js +12 -94
- package/dist/mcp/tools/core-mail-profile.mcp-tools.js.map +1 -1
- package/dist/mcp-chat/mcp-chat.service.d.ts.map +1 -1
- package/dist/mcp-chat/mcp-chat.service.js +17 -16
- package/dist/mcp-chat/mcp-chat.service.js.map +1 -1
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +0 -2
- package/dist/setting/setting.service.js.map +1 -1
- package/dist/webhook-integration/event-webhook.controller.d.ts +1 -0
- package/dist/webhook-integration/event-webhook.controller.d.ts.map +1 -1
- package/dist/webhook-integration/event-webhook.controller.js +10 -0
- package/dist/webhook-integration/event-webhook.controller.js.map +1 -1
- package/dist/webhook-integration/event-webhook.service.d.ts +2 -0
- package/dist/webhook-integration/event-webhook.service.d.ts.map +1 -1
- package/dist/webhook-integration/event-webhook.service.js +30 -0
- package/dist/webhook-integration/event-webhook.service.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.controller.d.ts +1 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.controller.js +10 -0
- package/dist/webhook-integration/webhook-integration.controller.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts +2 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.js +62 -44
- package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
- package/dist/whatsapp-profile/dto/create.dto.d.ts +11 -0
- package/dist/whatsapp-profile/dto/create.dto.d.ts.map +1 -0
- package/dist/whatsapp-profile/dto/create.dto.js +55 -0
- package/dist/whatsapp-profile/dto/create.dto.js.map +1 -0
- package/dist/whatsapp-profile/dto/update.dto.d.ts +6 -0
- package/dist/whatsapp-profile/dto/update.dto.d.ts.map +1 -0
- package/dist/whatsapp-profile/dto/update.dto.js +9 -0
- package/dist/whatsapp-profile/dto/update.dto.js.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.controller.d.ts +54 -0
- package/dist/whatsapp-profile/whatsapp-profile.controller.d.ts.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.controller.js +85 -0
- package/dist/whatsapp-profile/whatsapp-profile.controller.js.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.module.d.ts +3 -0
- package/dist/whatsapp-profile/whatsapp-profile.module.d.ts.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.module.js +26 -0
- package/dist/whatsapp-profile/whatsapp-profile.module.js.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.service.d.ts +63 -0
- package/dist/whatsapp-profile/whatsapp-profile.service.d.ts.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.service.js +138 -0
- package/dist/whatsapp-profile/whatsapp-profile.service.js.map +1 -0
- package/hedhog/data/file_provider.yaml +9 -1
- package/hedhog/data/integration_provider.yaml +132 -0
- package/hedhog/data/integration_type.yaml +29 -0
- package/hedhog/data/menu.yaml +15 -14
- package/hedhog/data/role.yaml +8 -0
- package/hedhog/data/route.yaml +66 -15
- package/hedhog/data/setting_group.yaml +30 -191
- package/hedhog/data/setting_subgroup.yaml +5 -13
- package/hedhog/data/whatsapp_profile.yaml +6 -0
- package/hedhog/frontend/app/account/components/connected-accounts.tsx.ejs +25 -20
- package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +579 -204
- package/hedhog/frontend/app/integration/profiles/page.tsx.ejs +1662 -0
- package/hedhog/frontend/app/integrations-webhooks/page.tsx.ejs +233 -108
- package/hedhog/frontend/app/mail/profiles/page.tsx.ejs +3 -822
- package/hedhog/frontend/app/users/permissions.tsx.ejs +79 -2
- package/hedhog/frontend/app/users/user-sheet.tsx.ejs +7 -2
- package/hedhog/frontend/messages/en.json +172 -0
- package/hedhog/frontend/messages/pt.json +172 -0
- package/hedhog/table/integration_profile.yaml +34 -0
- package/hedhog/table/integration_provider.yaml +23 -0
- package/hedhog/table/integration_type.yaml +19 -0
- package/hedhog/table/webhook_action.yaml +85 -85
- package/hedhog/table/whatsapp_profile.yaml +26 -0
- package/package.json +2 -2
- package/src/ai/ai.service.ts +35 -153
- package/src/core.module.ts +3 -3
- package/src/file/file.service.ts +60 -76
- package/src/file/provider/provider.enum.ts +1 -0
- package/src/file/provider/provider.factory.ts +3 -0
- package/src/file/provider/spaces.provider.ts +261 -0
- package/src/index.ts +6 -3
- package/src/integration-profile/dto/create.dto.ts +44 -0
- package/src/integration-profile/dto/export.dto.ts +15 -0
- package/src/integration-profile/dto/import-confirm.dto.ts +61 -0
- package/src/integration-profile/dto/update.dto.ts +4 -0
- package/src/integration-profile/integration-profile.controller.ts +129 -0
- package/src/integration-profile/integration-profile.module.ts +16 -0
- package/src/integration-profile/integration-profile.service.ts +788 -0
- package/src/integration-profile/integration-profile.utils.ts +156 -0
- package/src/mail/mail.module.ts +27 -18
- package/src/mail/mail.service.ts +31 -60
- package/src/mcp/mcp.module.ts +2 -2
- package/src/mcp/tools/core-mail-profile.mcp-tools.ts +10 -69
- package/src/mcp-chat/mcp-chat.service.ts +23 -20
- package/src/setting/setting.service.ts +0 -2
- package/src/webhook-integration/event-webhook.controller.ts +55 -50
- package/src/webhook-integration/event-webhook.service.ts +422 -384
- package/src/webhook-integration/webhook-integration.controller.ts +5 -0
- package/src/webhook-integration/webhook-integration.service.ts +74 -46
- package/src/whatsapp-profile/dto/create.dto.ts +36 -0
- package/src/whatsapp-profile/dto/update.dto.ts +4 -0
- package/src/whatsapp-profile/whatsapp-profile.controller.ts +51 -0
- package/src/whatsapp-profile/whatsapp-profile.module.ts +13 -0
- package/src/whatsapp-profile/whatsapp-profile.service.ts +160 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { DeleteDTO, Role } from '@hed-hog/api';
|
|
2
|
+
import { Pagination } from '@hed-hog/api-pagination';
|
|
3
|
+
import {
|
|
4
|
+
Body,
|
|
5
|
+
Controller,
|
|
6
|
+
Delete,
|
|
7
|
+
Get,
|
|
8
|
+
Header,
|
|
9
|
+
Inject,
|
|
10
|
+
Param,
|
|
11
|
+
ParseIntPipe,
|
|
12
|
+
Patch,
|
|
13
|
+
Post,
|
|
14
|
+
Query,
|
|
15
|
+
Res,
|
|
16
|
+
UploadedFile,
|
|
17
|
+
UseInterceptors,
|
|
18
|
+
forwardRef,
|
|
19
|
+
} from '@nestjs/common';
|
|
20
|
+
import { FileInterceptor } from '@nestjs/platform-express';
|
|
21
|
+
import { Response } from 'express';
|
|
22
|
+
import { CreateDTO } from './dto/create.dto';
|
|
23
|
+
import { ExportDTO } from './dto/export.dto';
|
|
24
|
+
import { ImportConfirmDTO } from './dto/import-confirm.dto';
|
|
25
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
26
|
+
import { IntegrationProfileService } from './integration-profile.service';
|
|
27
|
+
|
|
28
|
+
@Role()
|
|
29
|
+
@Controller('integration-profile')
|
|
30
|
+
export class IntegrationProfileController {
|
|
31
|
+
constructor(
|
|
32
|
+
@Inject(forwardRef(() => IntegrationProfileService))
|
|
33
|
+
private readonly integrationProfileService: IntegrationProfileService,
|
|
34
|
+
) {}
|
|
35
|
+
|
|
36
|
+
@Get('types')
|
|
37
|
+
async listTypes() {
|
|
38
|
+
return this.integrationProfileService.listTypes();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Get('providers')
|
|
42
|
+
async listProviders(
|
|
43
|
+
@Query('typeId') typeId?: string,
|
|
44
|
+
@Query('typeSlug') typeSlug?: string,
|
|
45
|
+
) {
|
|
46
|
+
return this.integrationProfileService.listProviders(
|
|
47
|
+
typeId ? parseInt(typeId, 10) : undefined,
|
|
48
|
+
typeSlug,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Get()
|
|
53
|
+
async list(
|
|
54
|
+
@Pagination() paginationParams,
|
|
55
|
+
@Query('typeId') typeId?: string,
|
|
56
|
+
@Query('typeSlug') typeSlug?: string,
|
|
57
|
+
) {
|
|
58
|
+
return this.integrationProfileService.list(
|
|
59
|
+
paginationParams,
|
|
60
|
+
typeId ? parseInt(typeId, 10) : undefined,
|
|
61
|
+
typeSlug,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@Get('export')
|
|
66
|
+
@Header('Content-Type', 'application/octet-stream')
|
|
67
|
+
@Header(
|
|
68
|
+
'Content-Disposition',
|
|
69
|
+
'attachment; filename="integration-profiles.hedhog"',
|
|
70
|
+
)
|
|
71
|
+
async export(
|
|
72
|
+
@Query() { ids, include_secrets = false }: ExportDTO,
|
|
73
|
+
@Res() res: Response,
|
|
74
|
+
) {
|
|
75
|
+
const parsedIds = String(ids ?? '')
|
|
76
|
+
.split(',')
|
|
77
|
+
.map((value) => Number(value.trim()))
|
|
78
|
+
.filter((value) => Number.isInteger(value) && value > 0);
|
|
79
|
+
|
|
80
|
+
const file = await this.integrationProfileService.exportProfiles({
|
|
81
|
+
ids: parsedIds.length > 0 ? parsedIds : undefined,
|
|
82
|
+
includeSecrets: include_secrets,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
res.send(file);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@Get(':id')
|
|
89
|
+
async get(@Param('id', ParseIntPipe) id: number) {
|
|
90
|
+
return this.integrationProfileService.get(id);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@Post()
|
|
94
|
+
async create(@Body() data: CreateDTO) {
|
|
95
|
+
return this.integrationProfileService.create(data);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@Post('test')
|
|
99
|
+
async test(@Body() data: CreateDTO) {
|
|
100
|
+
return this.integrationProfileService.test(data);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@Patch(':id')
|
|
104
|
+
async update(
|
|
105
|
+
@Param('id', ParseIntPipe) id: number,
|
|
106
|
+
@Body() data: UpdateDTO,
|
|
107
|
+
) {
|
|
108
|
+
return this.integrationProfileService.update({ id, data });
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@Delete()
|
|
112
|
+
async delete(@Body() data: DeleteDTO) {
|
|
113
|
+
return this.integrationProfileService.delete(data);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@UseInterceptors(FileInterceptor('file'))
|
|
117
|
+
@Post('import/validate')
|
|
118
|
+
async validateImport(@UploadedFile() file: MulterFile) {
|
|
119
|
+
return this.integrationProfileService.validateImportFile(file);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@Post('import/confirm')
|
|
123
|
+
async confirmImport(@Body() data: ImportConfirmDTO) {
|
|
124
|
+
return this.integrationProfileService.confirmImport({
|
|
125
|
+
profiles: data.profiles,
|
|
126
|
+
conflictResolutions: data.conflict_resolutions,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PaginationModule } from '@hed-hog/api-pagination';
|
|
2
|
+
import { PrismaModule } from '@hed-hog/api-prisma';
|
|
3
|
+
import { forwardRef, Module } from '@nestjs/common';
|
|
4
|
+
import { IntegrationProfileController } from './integration-profile.controller';
|
|
5
|
+
import { IntegrationProfileService } from './integration-profile.service';
|
|
6
|
+
|
|
7
|
+
@Module({
|
|
8
|
+
imports: [
|
|
9
|
+
forwardRef(() => PrismaModule),
|
|
10
|
+
forwardRef(() => PaginationModule),
|
|
11
|
+
],
|
|
12
|
+
controllers: [IntegrationProfileController],
|
|
13
|
+
providers: [IntegrationProfileService],
|
|
14
|
+
exports: [IntegrationProfileService],
|
|
15
|
+
})
|
|
16
|
+
export class IntegrationProfileModule {}
|