mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-23 03:51:36 +03:00
6658 workflows add a first twenty piece email sender (#6965)
This commit is contained in:
parent
f8e5b333d9
commit
3190f4a87b
29
packages/twenty-emails/src/emails/workflow-action.email.tsx
Normal file
29
packages/twenty-emails/src/emails/workflow-action.email.tsx
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { BaseEmail } from 'src/components/BaseEmail';
|
||||||
|
import { Title } from 'src/components/Title';
|
||||||
|
import { CallToAction } from 'src/components/CallToAction';
|
||||||
|
|
||||||
|
type WorkflowActionEmailProps = {
|
||||||
|
dangerousHTML?: string;
|
||||||
|
title?: string;
|
||||||
|
callToAction?: {
|
||||||
|
value: string;
|
||||||
|
href: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export const WorkflowActionEmail = ({
|
||||||
|
dangerousHTML,
|
||||||
|
title,
|
||||||
|
callToAction,
|
||||||
|
}: WorkflowActionEmailProps) => {
|
||||||
|
return (
|
||||||
|
<BaseEmail>
|
||||||
|
{title && <Title value={title} />}
|
||||||
|
{dangerousHTML && (
|
||||||
|
<div dangerouslySetInnerHTML={{ __html: dangerousHTML }} />
|
||||||
|
)}
|
||||||
|
{callToAction && (
|
||||||
|
<CallToAction value={callToAction.value} href={callToAction.href} />
|
||||||
|
)}
|
||||||
|
</BaseEmail>
|
||||||
|
);
|
||||||
|
};
|
@ -3,3 +3,4 @@ export * from './emails/delete-inactive-workspaces.email';
|
|||||||
export * from './emails/password-reset-link.email';
|
export * from './emails/password-reset-link.email';
|
||||||
export * from './emails/password-update-notify.email';
|
export * from './emails/password-update-notify.email';
|
||||||
export * from './emails/send-invite-link.email';
|
export * from './emails/send-invite-link.email';
|
||||||
|
export * from './emails/workflow-action.email';
|
||||||
|
@ -8,7 +8,7 @@ export const ACTIONS: Array<{
|
|||||||
}> = [
|
}> = [
|
||||||
{
|
{
|
||||||
label: 'Serverless Function',
|
label: 'Serverless Function',
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
icon: IconSettingsAutomation,
|
icon: IconSettingsAutomation,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -13,7 +13,7 @@ export type WorkflowCodeSettingsType = WorkflowBaseSettingsType & {
|
|||||||
serverlessFunctionId: string;
|
serverlessFunctionId: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type WorkflowActionType = 'CODE_ACTION';
|
export type WorkflowActionType = 'CODE';
|
||||||
|
|
||||||
type CommonWorkflowAction = {
|
type CommonWorkflowAction = {
|
||||||
id: string;
|
id: string;
|
||||||
@ -22,7 +22,7 @@ type CommonWorkflowAction = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type WorkflowCodeAction = CommonWorkflowAction & {
|
type WorkflowCodeAction = CommonWorkflowAction & {
|
||||||
type: 'CODE_ACTION';
|
type: 'CODE';
|
||||||
settings: WorkflowCodeSettingsType;
|
settings: WorkflowCodeSettingsType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ describe('addCreateStepNodes', () => {
|
|||||||
{
|
{
|
||||||
id: 'step1',
|
id: 'step1',
|
||||||
name: 'Step 1',
|
name: 'Step 1',
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
settings: {
|
settings: {
|
||||||
errorHandlingOptions: {
|
errorHandlingOptions: {
|
||||||
@ -27,7 +27,7 @@ describe('addCreateStepNodes', () => {
|
|||||||
{
|
{
|
||||||
id: 'step2',
|
id: 'step2',
|
||||||
name: 'Step 2',
|
name: 'Step 2',
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
settings: {
|
settings: {
|
||||||
errorHandlingOptions: {
|
errorHandlingOptions: {
|
||||||
|
@ -35,7 +35,7 @@ describe('generateWorkflowDiagram', () => {
|
|||||||
{
|
{
|
||||||
id: 'step1',
|
id: 'step1',
|
||||||
name: 'Step 1',
|
name: 'Step 1',
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
settings: {
|
settings: {
|
||||||
errorHandlingOptions: {
|
errorHandlingOptions: {
|
||||||
@ -48,7 +48,7 @@ describe('generateWorkflowDiagram', () => {
|
|||||||
{
|
{
|
||||||
id: 'step2',
|
id: 'step2',
|
||||||
name: 'Step 2',
|
name: 'Step 2',
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
settings: {
|
settings: {
|
||||||
errorHandlingOptions: {
|
errorHandlingOptions: {
|
||||||
@ -88,7 +88,7 @@ describe('generateWorkflowDiagram', () => {
|
|||||||
{
|
{
|
||||||
id: 'step1',
|
id: 'step1',
|
||||||
name: 'Step 1',
|
name: 'Step 1',
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
settings: {
|
settings: {
|
||||||
errorHandlingOptions: {
|
errorHandlingOptions: {
|
||||||
@ -101,7 +101,7 @@ describe('generateWorkflowDiagram', () => {
|
|||||||
{
|
{
|
||||||
id: 'step2',
|
id: 'step2',
|
||||||
name: 'Step 2',
|
name: 'Step 2',
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
settings: {
|
settings: {
|
||||||
errorHandlingOptions: {
|
errorHandlingOptions: {
|
||||||
|
@ -60,7 +60,7 @@ describe('getWorkflowVersionDiagram', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -27,7 +27,7 @@ describe('insertStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ describe('insertStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ describe('insertStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -110,7 +110,7 @@ describe('insertStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -131,7 +131,7 @@ describe('insertStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ describe('insertStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -180,7 +180,7 @@ describe('insertStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -201,7 +201,7 @@ describe('insertStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ describe('replaceStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'first',
|
serverlessFunctionId: 'first',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
} satisfies WorkflowStep;
|
} satisfies WorkflowStep;
|
||||||
const workflowVersionInitial = {
|
const workflowVersionInitial = {
|
||||||
@ -59,7 +59,7 @@ describe('replaceStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
};
|
};
|
||||||
const workflowVersionInitial = {
|
const workflowVersionInitial = {
|
||||||
@ -79,7 +79,7 @@ describe('replaceStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
},
|
},
|
||||||
stepToBeReplaced,
|
stepToBeReplaced,
|
||||||
@ -93,7 +93,7 @@ describe('replaceStep', () => {
|
|||||||
},
|
},
|
||||||
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
|
||||||
},
|
},
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: true,
|
valid: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -50,13 +50,6 @@ export const generateWorkflowDiagram = ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Recursively generate flow for the next action if it exists
|
|
||||||
if (step.type !== 'CODE_ACTION') {
|
|
||||||
// processNode(action.nextAction, nodeId, xPos + 150, yPos + 100);
|
|
||||||
|
|
||||||
throw new Error('Other types as code actions are not supported yet.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return nodeId;
|
return nodeId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@ export const getStepDefaultDefinition = (
|
|||||||
const newStepId = v4();
|
const newStepId = v4();
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'CODE_ACTION': {
|
case 'CODE': {
|
||||||
return {
|
return {
|
||||||
id: newStepId,
|
id: newStepId,
|
||||||
name: 'Code',
|
name: 'Code',
|
||||||
type: 'CODE_ACTION',
|
type: 'CODE',
|
||||||
valid: false,
|
valid: false,
|
||||||
settings: {
|
settings: {
|
||||||
serverlessFunctionId: '',
|
serverlessFunctionId: '',
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
"cache-manager-redis-yet": "^4.1.2",
|
"cache-manager-redis-yet": "^4.1.2",
|
||||||
"class-validator": "patch:class-validator@0.14.0#./patches/class-validator+0.14.0.patch",
|
"class-validator": "patch:class-validator@0.14.0#./patches/class-validator+0.14.0.patch",
|
||||||
"graphql-middleware": "^6.1.35",
|
"graphql-middleware": "^6.1.35",
|
||||||
|
"handlebars": "^4.7.8",
|
||||||
"jsdom": "~22.1.0",
|
"jsdom": "~22.1.0",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"langchain": "^0.2.6",
|
"langchain": "^0.2.6",
|
||||||
|
@ -18,15 +18,14 @@ import { GraphQLConfigModule } from 'src/engine/api/graphql/graphql-config/graph
|
|||||||
import { GraphQLConfigService } from 'src/engine/api/graphql/graphql-config/graphql-config.service';
|
import { GraphQLConfigService } from 'src/engine/api/graphql/graphql-config/graphql-config.service';
|
||||||
import { MetadataGraphQLApiModule } from 'src/engine/api/graphql/metadata-graphql-api.module';
|
import { MetadataGraphQLApiModule } from 'src/engine/api/graphql/metadata-graphql-api.module';
|
||||||
import { RestApiModule } from 'src/engine/api/rest/rest-api.module';
|
import { RestApiModule } from 'src/engine/api/rest/rest-api.module';
|
||||||
import { MessageQueueDriverType } from 'src/engine/integrations/message-queue/interfaces';
|
import { MessageQueueDriverType } from 'src/engine/core-modules/message-queue/interfaces';
|
||||||
import { MessageQueueModule } from 'src/engine/integrations/message-queue/message-queue.module';
|
import { MessageQueueModule } from 'src/engine/core-modules/message-queue/message-queue.module';
|
||||||
import { WorkspaceMetadataVersionModule } from 'src/engine/metadata-modules/workspace-metadata-version/workspace-metadata-version.module';
|
import { WorkspaceMetadataVersionModule } from 'src/engine/metadata-modules/workspace-metadata-version/workspace-metadata-version.module';
|
||||||
import { GraphQLHydrateRequestFromTokenMiddleware } from 'src/engine/middlewares/graphql-hydrate-request-from-token.middleware';
|
import { GraphQLHydrateRequestFromTokenMiddleware } from 'src/engine/middlewares/graphql-hydrate-request-from-token.middleware';
|
||||||
import { TwentyORMModule } from 'src/engine/twenty-orm/twenty-orm.module';
|
import { TwentyORMModule } from 'src/engine/twenty-orm/twenty-orm.module';
|
||||||
import { ModulesModule } from 'src/modules/modules.module';
|
import { ModulesModule } from 'src/modules/modules.module';
|
||||||
|
|
||||||
import { CoreEngineModule } from './engine/core-modules/core-engine.module';
|
import { CoreEngineModule } from './engine/core-modules/core-engine.module';
|
||||||
import { IntegrationsModule } from './engine/integrations/integrations.module';
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@ -47,8 +46,6 @@ import { IntegrationsModule } from './engine/integrations/integrations.module';
|
|||||||
useClass: GraphQLConfigService,
|
useClass: GraphQLConfigService,
|
||||||
}),
|
}),
|
||||||
TwentyORMModule,
|
TwentyORMModule,
|
||||||
// Integrations module, contains all the integrations with other services
|
|
||||||
IntegrationsModule,
|
|
||||||
// Core engine module, contains all the core modules
|
// Core engine module, contains all the core modules
|
||||||
CoreEngineModule,
|
CoreEngineModule,
|
||||||
// Modules module, contains all business logic modules
|
// Modules module, contains all business logic modules
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { CommandFactory } from 'nest-commander';
|
import { CommandFactory } from 'nest-commander';
|
||||||
|
|
||||||
import { ExceptionHandlerService } from 'src/engine/integrations/exception-handler/exception-handler.service';
|
import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service';
|
||||||
import { LoggerService } from 'src/engine/integrations/logger/logger.service';
|
import { LoggerService } from 'src/engine/core-modules/logger/logger.service';
|
||||||
import { shouldFilterException } from 'src/engine/utils/global-exception-handler.util';
|
import { shouldFilterException } from 'src/engine/utils/global-exception-handler.util';
|
||||||
|
|
||||||
import { CommandModule } from './command.module';
|
import { CommandModule } from './command.module';
|
||||||
|
@ -2,9 +2,9 @@ import { Command, CommandRunner } from 'nest-commander';
|
|||||||
|
|
||||||
import { dataSeedDemoWorkspaceCronPattern } from 'src/database/commands/data-seed-demo-workspace/crons/data-seed-demo-workspace-cron-pattern';
|
import { dataSeedDemoWorkspaceCronPattern } from 'src/database/commands/data-seed-demo-workspace/crons/data-seed-demo-workspace-cron-pattern';
|
||||||
import { DataSeedDemoWorkspaceJob } from 'src/database/commands/data-seed-demo-workspace/jobs/data-seed-demo-workspace.job';
|
import { DataSeedDemoWorkspaceJob } from 'src/database/commands/data-seed-demo-workspace/jobs/data-seed-demo-workspace.job';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
|
|
||||||
@Command({
|
@Command({
|
||||||
name: 'workspace-seed-demo:cron:start',
|
name: 'workspace-seed-demo:cron:start',
|
||||||
|
@ -2,9 +2,9 @@ import { Command, CommandRunner } from 'nest-commander';
|
|||||||
|
|
||||||
import { dataSeedDemoWorkspaceCronPattern } from 'src/database/commands/data-seed-demo-workspace/crons/data-seed-demo-workspace-cron-pattern';
|
import { dataSeedDemoWorkspaceCronPattern } from 'src/database/commands/data-seed-demo-workspace/crons/data-seed-demo-workspace-cron-pattern';
|
||||||
import { DataSeedDemoWorkspaceJob } from 'src/database/commands/data-seed-demo-workspace/jobs/data-seed-demo-workspace.job';
|
import { DataSeedDemoWorkspaceJob } from 'src/database/commands/data-seed-demo-workspace/jobs/data-seed-demo-workspace.job';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
|
|
||||||
@Command({
|
@Command({
|
||||||
name: 'workspace-seed-demo:cron:stop',
|
name: 'workspace-seed-demo:cron:stop',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
|
|
||||||
import { EnvironmentModule } from 'src/engine/integrations/environment/environment.module';
|
import { EnvironmentModule } from 'src/engine/core-modules/environment/environment.module';
|
||||||
import { WorkspaceManagerModule } from 'src/engine/workspace-manager/workspace-manager.module';
|
import { WorkspaceManagerModule } from 'src/engine/workspace-manager/workspace-manager.module';
|
||||||
import { DataSeedDemoWorkspaceService } from 'src/database/commands/data-seed-demo-workspace/services/data-seed-demo-workspace.service';
|
import { DataSeedDemoWorkspaceService } from 'src/database/commands/data-seed-demo-workspace/services/data-seed-demo-workspace.service';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { DataSeedDemoWorkspaceService } from 'src/database/commands/data-seed-demo-workspace/services/data-seed-demo-workspace.service';
|
import { DataSeedDemoWorkspaceService } from 'src/database/commands/data-seed-demo-workspace/services/data-seed-demo-workspace.service';
|
||||||
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
|
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
|
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
|
||||||
|
|
||||||
@Processor(MessageQueue.cronQueue)
|
@Processor(MessageQueue.cronQueue)
|
||||||
export class DataSeedDemoWorkspaceJob {
|
export class DataSeedDemoWorkspaceJob {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { WorkspaceManagerService } from 'src/engine/workspace-manager/workspace-manager.service';
|
import { WorkspaceManagerService } from 'src/engine/workspace-manager/workspace-manager.service';
|
||||||
import {
|
import {
|
||||||
deleteCoreSchema,
|
deleteCoreSchema,
|
||||||
|
@ -32,9 +32,9 @@ import { rawDataSource } from 'src/database/typeorm/raw/raw.datasource';
|
|||||||
import { TypeORMService } from 'src/database/typeorm/typeorm.service';
|
import { TypeORMService } from 'src/database/typeorm/typeorm.service';
|
||||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||||
import { CacheStorageService } from 'src/engine/integrations/cache-storage/cache-storage.service';
|
import { CacheStorageService } from 'src/engine/core-modules/cache-storage/cache-storage.service';
|
||||||
import { InjectCacheStorage } from 'src/engine/integrations/cache-storage/decorators/cache-storage.decorator';
|
import { InjectCacheStorage } from 'src/engine/core-modules/cache-storage/decorators/cache-storage.decorator';
|
||||||
import { CacheStorageNamespace } from 'src/engine/integrations/cache-storage/types/cache-storage-namespace.enum';
|
import { CacheStorageNamespace } from 'src/engine/core-modules/cache-storage/types/cache-storage-namespace.enum';
|
||||||
import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service';
|
import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service';
|
||||||
import { FieldMetadataService } from 'src/engine/metadata-modules/field-metadata/field-metadata.service';
|
import { FieldMetadataService } from 'src/engine/metadata-modules/field-metadata/field-metadata.service';
|
||||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||||
|
@ -8,7 +8,7 @@ import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
|||||||
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
||||||
import { OnboardingModule } from 'src/engine/core-modules/onboarding/onboarding.module';
|
import { OnboardingModule } from 'src/engine/core-modules/onboarding/onboarding.module';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { FileStorageModule } from 'src/engine/integrations/file-storage/file-storage.module';
|
import { FileStorageModule } from 'src/engine/core-modules/file-storage/file-storage.module';
|
||||||
import { DataSourceModule } from 'src/engine/metadata-modules/data-source/data-source.module';
|
import { DataSourceModule } from 'src/engine/metadata-modules/data-source/data-source.module';
|
||||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||||
import { FieldMetadataModule } from 'src/engine/metadata-modules/field-metadata/field-metadata.module';
|
import { FieldMetadataModule } from 'src/engine/metadata-modules/field-metadata/field-metadata.module';
|
||||||
|
@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
|||||||
import { TypeOrmModule, TypeOrmModuleOptions } from '@nestjs/typeorm';
|
import { TypeOrmModule, TypeOrmModuleOptions } from '@nestjs/typeorm';
|
||||||
|
|
||||||
import { typeORMCoreModuleOptions } from 'src/database/typeorm/core/core.datasource';
|
import { typeORMCoreModuleOptions } from 'src/database/typeorm/core/core.datasource';
|
||||||
import { EnvironmentModule } from 'src/engine/integrations/environment/environment.module';
|
import { EnvironmentModule } from 'src/engine/core-modules/environment/environment.module';
|
||||||
|
|
||||||
import { TypeORMService } from './typeorm.service';
|
import { TypeORMService } from './typeorm.service';
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|||||||
|
|
||||||
import { DataSource } from 'typeorm';
|
import { DataSource } from 'typeorm';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity';
|
import { DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
|
@ -20,9 +20,9 @@ import { CoreEngineModule } from 'src/engine/core-modules/core-engine.module';
|
|||||||
import { useGraphQLErrorHandlerHook } from 'src/engine/core-modules/graphql/hooks/use-graphql-error-handler.hook';
|
import { useGraphQLErrorHandlerHook } from 'src/engine/core-modules/graphql/hooks/use-graphql-error-handler.hook';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { ExceptionHandlerService } from 'src/engine/integrations/exception-handler/exception-handler.service';
|
import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service';
|
||||||
import { useSentryTracing } from 'src/engine/integrations/exception-handler/hooks/use-sentry-tracing';
|
import { useSentryTracing } from 'src/engine/core-modules/exception-handler/hooks/use-sentry-tracing';
|
||||||
import { handleExceptionAndConvertToGraphQLError } from 'src/engine/utils/global-exception-handler.util';
|
import { handleExceptionAndConvertToGraphQLError } from 'src/engine/utils/global-exception-handler.util';
|
||||||
import { renderApolloPlayground } from 'src/engine/utils/render-apollo-playground.util';
|
import { renderApolloPlayground } from 'src/engine/utils/render-apollo-playground.util';
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@ import { GraphQLConfigModule } from 'src/engine/api/graphql/graphql-config/graph
|
|||||||
import { metadataModuleFactory } from 'src/engine/api/graphql/metadata.module-factory';
|
import { metadataModuleFactory } from 'src/engine/api/graphql/metadata.module-factory';
|
||||||
import { DataloaderModule } from 'src/engine/dataloaders/dataloader.module';
|
import { DataloaderModule } from 'src/engine/dataloaders/dataloader.module';
|
||||||
import { DataloaderService } from 'src/engine/dataloaders/dataloader.service';
|
import { DataloaderService } from 'src/engine/dataloaders/dataloader.service';
|
||||||
import { CacheStorageNamespace } from 'src/engine/integrations/cache-storage/types/cache-storage-namespace.enum';
|
import { CacheStorageNamespace } from 'src/engine/core-modules/cache-storage/types/cache-storage-namespace.enum';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { ExceptionHandlerService } from 'src/engine/integrations/exception-handler/exception-handler.service';
|
import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service';
|
||||||
import { MetadataEngineModule } from 'src/engine/metadata-modules/metadata-engine.module';
|
import { MetadataEngineModule } from 'src/engine/metadata-modules/metadata-engine.module';
|
||||||
import { WorkspaceMigrationModule } from 'src/engine/metadata-modules/workspace-migration/workspace-migration.module';
|
import { WorkspaceMigrationModule } from 'src/engine/metadata-modules/workspace-migration/workspace-migration.module';
|
||||||
import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.module';
|
import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.module';
|
||||||
|
@ -6,9 +6,9 @@ import { useThrottler } from 'src/engine/api/graphql/graphql-config/hooks/use-th
|
|||||||
import { MetadataGraphQLApiModule } from 'src/engine/api/graphql/metadata-graphql-api.module';
|
import { MetadataGraphQLApiModule } from 'src/engine/api/graphql/metadata-graphql-api.module';
|
||||||
import { useGraphQLErrorHandlerHook } from 'src/engine/core-modules/graphql/hooks/use-graphql-error-handler.hook';
|
import { useGraphQLErrorHandlerHook } from 'src/engine/core-modules/graphql/hooks/use-graphql-error-handler.hook';
|
||||||
import { DataloaderService } from 'src/engine/dataloaders/dataloader.service';
|
import { DataloaderService } from 'src/engine/dataloaders/dataloader.service';
|
||||||
import { CacheStorageService } from 'src/engine/integrations/cache-storage/cache-storage.service';
|
import { CacheStorageService } from 'src/engine/core-modules/cache-storage/cache-storage.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { ExceptionHandlerService } from 'src/engine/integrations/exception-handler/exception-handler.service';
|
import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service';
|
||||||
import { renderApolloPlayground } from 'src/engine/utils/render-apollo-playground.util';
|
import { renderApolloPlayground } from 'src/engine/utils/render-apollo-playground.util';
|
||||||
|
|
||||||
export const metadataModuleFactory = async (
|
export const metadataModuleFactory = async (
|
||||||
|
@ -4,9 +4,9 @@ import {
|
|||||||
RecordPositionBackfillJob,
|
RecordPositionBackfillJob,
|
||||||
RecordPositionBackfillJobData,
|
RecordPositionBackfillJobData,
|
||||||
} from 'src/engine/api/graphql/workspace-query-runner/jobs/record-position-backfill.job';
|
} from 'src/engine/api/graphql/workspace-query-runner/jobs/record-position-backfill.job';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
|
|
||||||
export type RecordPositionBackfillCommandOptions = {
|
export type RecordPositionBackfillCommandOptions = {
|
||||||
workspaceId: string;
|
workspaceId: string;
|
||||||
|
@ -8,11 +8,11 @@ import {
|
|||||||
CallWebhookJob,
|
CallWebhookJob,
|
||||||
CallWebhookJobData,
|
CallWebhookJobData,
|
||||||
} from 'src/engine/api/graphql/workspace-query-runner/jobs/call-webhook.job';
|
} from 'src/engine/api/graphql/workspace-query-runner/jobs/call-webhook.job';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
|
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
|
||||||
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
|
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||||
import { WebhookWorkspaceEntity } from 'src/modules/webhook/standard-objects/webhook.workspace-entity';
|
import { WebhookWorkspaceEntity } from 'src/modules/webhook/standard-objects/webhook.workspace-entity';
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { HttpService } from '@nestjs/axios';
|
import { HttpService } from '@nestjs/axios';
|
||||||
import { Logger } from '@nestjs/common';
|
import { Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
|
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
|
||||||
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
|
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
|
|
||||||
export type CallWebhookJobData = {
|
export type CallWebhookJobData = {
|
||||||
targetUrl: string;
|
targetUrl: string;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RecordPositionBackfillService } from 'src/engine/api/graphql/workspace-query-runner/services/record-position-backfill-service';
|
import { RecordPositionBackfillService } from 'src/engine/api/graphql/workspace-query-runner/services/record-position-backfill-service';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
|
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
|
||||||
import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
|
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
|
||||||
|
|
||||||
export type RecordPositionBackfillJobData = {
|
export type RecordPositionBackfillJobData = {
|
||||||
workspaceId: string;
|
workspaceId: string;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
|
|
||||||
import { ObjectRecordCreateEvent } from 'src/engine/integrations/event-emitter/types/object-record-create.event';
|
import { ObjectRecordCreateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-create.event';
|
||||||
import { ObjectRecordUpdateEvent } from 'src/engine/integrations/event-emitter/types/object-record-update.event';
|
import { ObjectRecordUpdateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-update.event';
|
||||||
import { ObjectRecordBaseEvent } from 'src/engine/integrations/event-emitter/types/object-record.base.event';
|
import { ObjectRecordBaseEvent } from 'src/engine/core-modules/event-emitter/types/object-record.base.event';
|
||||||
import { objectRecordChangedValues } from 'src/engine/integrations/event-emitter/utils/object-record-changed-values';
|
import { objectRecordChangedValues } from 'src/engine/core-modules/event-emitter/utils/object-record-changed-values';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
import { WorkspaceEventBatch } from 'src/engine/workspace-event-emitter/workspace-event.type';
|
import { WorkspaceEventBatch } from 'src/engine/workspace-event-emitter/workspace-event.type';
|
||||||
import { CreateAuditLogFromInternalEvent } from 'src/modules/timeline/jobs/create-audit-log-from-internal-event';
|
import { CreateAuditLogFromInternalEvent } from 'src/modules/timeline/jobs/create-audit-log-from-internal-event';
|
||||||
import { UpsertTimelineActivityFromInternalEvent } from 'src/modules/timeline/jobs/upsert-timeline-activity-from-internal-event.job';
|
import { UpsertTimelineActivityFromInternalEvent } from 'src/modules/timeline/jobs/upsert-timeline-activity-from-internal-event.job';
|
||||||
|
@ -2,8 +2,8 @@ import { Injectable } from '@nestjs/common';
|
|||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
|
|
||||||
import { AnalyticsService } from 'src/engine/core-modules/analytics/analytics.service';
|
import { AnalyticsService } from 'src/engine/core-modules/analytics/analytics.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { ObjectRecordCreateEvent } from 'src/engine/integrations/event-emitter/types/object-record-create.event';
|
import { ObjectRecordCreateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-create.event';
|
||||||
import { WorkspaceEventBatch } from 'src/engine/workspace-event-emitter/workspace-event.type';
|
import { WorkspaceEventBatch } from 'src/engine/workspace-event-emitter/workspace-event.type';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import isEmpty from 'lodash.isempty';
|
import isEmpty from 'lodash.isempty';
|
||||||
import { DataSource } from 'typeorm';
|
import { DataSource, In } from 'typeorm';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Record as IRecord,
|
Record as IRecord,
|
||||||
@ -45,13 +45,13 @@ import {
|
|||||||
import { DuplicateService } from 'src/engine/core-modules/duplicate/duplicate.service';
|
import { DuplicateService } from 'src/engine/core-modules/duplicate/duplicate.service';
|
||||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { ObjectRecordCreateEvent } from 'src/engine/integrations/event-emitter/types/object-record-create.event';
|
import { ObjectRecordCreateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-create.event';
|
||||||
import { ObjectRecordDeleteEvent } from 'src/engine/integrations/event-emitter/types/object-record-delete.event';
|
import { ObjectRecordDeleteEvent } from 'src/engine/core-modules/event-emitter/types/object-record-delete.event';
|
||||||
import { ObjectRecordUpdateEvent } from 'src/engine/integrations/event-emitter/types/object-record-update.event';
|
import { ObjectRecordUpdateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-update.event';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
import { assertMutationNotOnRemoteObject } from 'src/engine/metadata-modules/object-metadata/utils/assert-mutation-not-on-remote-object.util';
|
import { assertMutationNotOnRemoteObject } from 'src/engine/metadata-modules/object-metadata/utils/assert-mutation-not-on-remote-object.util';
|
||||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||||
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
|
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
|
||||||
@ -505,7 +505,7 @@ export class WorkspaceQueryRunnerService {
|
|||||||
args.filter?.id?.in?.forEach((id) => assertIsValidUuid(id));
|
args.filter?.id?.in?.forEach((id) => assertIsValidUuid(id));
|
||||||
|
|
||||||
const existingRecords = await repository.find({
|
const existingRecords = await repository.find({
|
||||||
where: { id: { in: args.filter?.id?.in } },
|
where: { id: In(args.filter?.id?.in) },
|
||||||
});
|
});
|
||||||
const mappedRecords = new Map(
|
const mappedRecords = new Map(
|
||||||
existingRecords.map((record) => [record.id, record]),
|
existingRecords.map((record) => [record.id, record]),
|
||||||
@ -625,6 +625,19 @@ export class WorkspaceQueryRunnerService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const repository =
|
||||||
|
await this.twentyORMGlobalManager.getRepositoryForWorkspace(
|
||||||
|
authContext.workspace.id,
|
||||||
|
objectMetadataItem.nameSingular,
|
||||||
|
);
|
||||||
|
|
||||||
|
const existingRecords = await repository.find({
|
||||||
|
where: { id: In(args.filter?.id?.in) },
|
||||||
|
});
|
||||||
|
const mappedRecords = new Map(
|
||||||
|
existingRecords.map((record) => [record.id, record]),
|
||||||
|
);
|
||||||
|
|
||||||
const result = await this.execute(query, authContext.workspace.id);
|
const result = await this.execute(query, authContext.workspace.id);
|
||||||
|
|
||||||
const parsedResults = (
|
const parsedResults = (
|
||||||
@ -644,17 +657,21 @@ export class WorkspaceQueryRunnerService {
|
|||||||
|
|
||||||
this.workspaceEventEmitter.emit(
|
this.workspaceEventEmitter.emit(
|
||||||
`${objectMetadataItem.nameSingular}.deleted`,
|
`${objectMetadataItem.nameSingular}.deleted`,
|
||||||
parsedResults.map(
|
parsedResults.map((record) => {
|
||||||
(record) =>
|
const existingRecord = mappedRecords.get(record.id);
|
||||||
({
|
|
||||||
userId: authContext.user?.id,
|
return {
|
||||||
recordId: record.id,
|
userId: authContext.user?.id,
|
||||||
objectMetadata: objectMetadataItem,
|
recordId: record.id,
|
||||||
properties: {
|
objectMetadata: objectMetadataItem,
|
||||||
before: this.removeNestedProperties(record),
|
properties: {
|
||||||
},
|
before: this.removeNestedProperties({
|
||||||
}) satisfies ObjectRecordDeleteEvent<any>,
|
...existingRecord,
|
||||||
),
|
...record,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
} satisfies ObjectRecordDeleteEvent<any>;
|
||||||
|
}),
|
||||||
authContext.workspace.id,
|
authContext.workspace.id,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import { parseCoreBatchPath } from 'src/engine/api/rest/core/query-builder/utils
|
|||||||
import { parseCorePath } from 'src/engine/api/rest/core/query-builder/utils/path-parsers/parse-core-path.utils';
|
import { parseCorePath } from 'src/engine/api/rest/core/query-builder/utils/path-parsers/parse-core-path.utils';
|
||||||
import { Query } from 'src/engine/api/rest/core/types/query.type';
|
import { Query } from 'src/engine/api/rest/core/types/query.type';
|
||||||
import { TokenService } from 'src/engine/core-modules/auth/services/token.service';
|
import { TokenService } from 'src/engine/core-modules/auth/services/token.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||||
import { ObjectMetadataService } from 'src/engine/metadata-modules/object-metadata/object-metadata.service';
|
import { ObjectMetadataService } from 'src/engine/metadata-modules/object-metadata/object-metadata.service';
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import { AxiosResponse } from 'axios';
|
|||||||
|
|
||||||
import { Query } from 'src/engine/api/rest/core/types/query.type';
|
import { Query } from 'src/engine/api/rest/core/types/query.type';
|
||||||
import { getServerUrl } from 'src/utils/get-server-url';
|
import { getServerUrl } from 'src/utils/get-server-url';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { RestApiException } from 'src/engine/api/rest/errors/RestApiException';
|
import { RestApiException } from 'src/engine/api/rest/errors/RestApiException';
|
||||||
|
|
||||||
export enum GraphqlApiType {
|
export enum GraphqlApiType {
|
||||||
|
@ -7,9 +7,9 @@ import { AISQLQueryResolver } from 'src/engine/core-modules/ai-sql-query/ai-sql-
|
|||||||
import { AISQLQueryService } from 'src/engine/core-modules/ai-sql-query/ai-sql-query.service';
|
import { AISQLQueryService } from 'src/engine/core-modules/ai-sql-query/ai-sql-query.service';
|
||||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||||
import { WorkspaceQueryRunnerModule } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-runner.module';
|
import { WorkspaceQueryRunnerModule } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-runner.module';
|
||||||
import { LLMChatModelModule } from 'src/engine/integrations/llm-chat-model/llm-chat-model.module';
|
import { LLMChatModelModule } from 'src/engine/core-modules/llm-chat-model/llm-chat-model.module';
|
||||||
import { EnvironmentModule } from 'src/engine/integrations/environment/environment.module';
|
import { EnvironmentModule } from 'src/engine/core-modules/environment/environment.module';
|
||||||
import { LLMTracingModule } from 'src/engine/integrations/llm-tracing/llm-tracing.module';
|
import { LLMTracingModule } from 'src/engine/core-modules/llm-tracing/llm-tracing.module';
|
||||||
import { ObjectMetadataModule } from 'src/engine/metadata-modules/object-metadata/object-metadata.module';
|
import { ObjectMetadataModule } from 'src/engine/metadata-modules/object-metadata/object-metadata.module';
|
||||||
import { WorkspaceSyncMetadataModule } from 'src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.module';
|
import { WorkspaceSyncMetadataModule } from 'src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.module';
|
||||||
@Module({
|
@Module({
|
||||||
|
@ -11,8 +11,8 @@ import { zodToJsonSchema } from 'zod-to-json-schema';
|
|||||||
import { WorkspaceQueryRunnerService } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service';
|
import { WorkspaceQueryRunnerService } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service';
|
||||||
import { sqlGenerationPromptTemplate } from 'src/engine/core-modules/ai-sql-query/ai-sql-query.prompt-templates';
|
import { sqlGenerationPromptTemplate } from 'src/engine/core-modules/ai-sql-query/ai-sql-query.prompt-templates';
|
||||||
import { AISQLQueryResult } from 'src/engine/core-modules/ai-sql-query/dtos/ai-sql-query-result.dto';
|
import { AISQLQueryResult } from 'src/engine/core-modules/ai-sql-query/dtos/ai-sql-query-result.dto';
|
||||||
import { LLMChatModelService } from 'src/engine/integrations/llm-chat-model/llm-chat-model.service';
|
import { LLMChatModelService } from 'src/engine/core-modules/llm-chat-model/llm-chat-model.service';
|
||||||
import { LLMTracingService } from 'src/engine/integrations/llm-tracing/llm-tracing.service';
|
import { LLMTracingService } from 'src/engine/core-modules/llm-tracing/llm-tracing.service';
|
||||||
import { DEFAULT_LABEL_IDENTIFIER_FIELD_NAME } from 'src/engine/metadata-modules/object-metadata/object-metadata.constants';
|
import { DEFAULT_LABEL_IDENTIFIER_FIELD_NAME } from 'src/engine/metadata-modules/object-metadata/object-metadata.constants';
|
||||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Test, TestingModule } from '@nestjs/testing';
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
import { HttpService } from '@nestjs/axios';
|
import { HttpService } from '@nestjs/axios';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
import { AnalyticsResolver } from './analytics.resolver';
|
import { AnalyticsResolver } from './analytics.resolver';
|
||||||
import { AnalyticsService } from './analytics.service';
|
import { AnalyticsService } from './analytics.service';
|
||||||
|
@ -8,7 +8,7 @@ import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorat
|
|||||||
import { AuthUser } from 'src/engine/decorators/auth/auth-user.decorator';
|
import { AuthUser } from 'src/engine/decorators/auth/auth-user.decorator';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
import { AnalyticsService } from './analytics.service';
|
import { AnalyticsService } from './analytics.service';
|
||||||
import { Analytics } from './analytics.entity';
|
import { Analytics } from './analytics.entity';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Test, TestingModule } from '@nestjs/testing';
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
import { HttpService } from '@nestjs/axios';
|
import { HttpService } from '@nestjs/axios';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
import { AnalyticsService } from './analytics.service';
|
import { AnalyticsService } from './analytics.service';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { HttpService } from '@nestjs/axios';
|
import { HttpService } from '@nestjs/axios';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
type CreateEventInput = {
|
type CreateEventInput = {
|
||||||
type: string;
|
type: string;
|
||||||
|
@ -6,7 +6,7 @@ import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
|||||||
import { UserService } from 'src/engine/core-modules/user/services/user.service';
|
import { UserService } from 'src/engine/core-modules/user/services/user.service';
|
||||||
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
|
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { CaptchaGuard } from 'src/engine/integrations/captcha/captcha.guard';
|
import { CaptchaGuard } from 'src/engine/core-modules/captcha/captcha.guard';
|
||||||
|
|
||||||
import { AuthResolver } from './auth.resolver';
|
import { AuthResolver } from './auth.resolver';
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
|||||||
import { AuthUser } from 'src/engine/decorators/auth/auth-user.decorator';
|
import { AuthUser } from 'src/engine/decorators/auth/auth-user.decorator';
|
||||||
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
|
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
|
||||||
import { JwtAuthGuard } from 'src/engine/guards/jwt.auth.guard';
|
import { JwtAuthGuard } from 'src/engine/guards/jwt.auth.guard';
|
||||||
import { CaptchaGuard } from 'src/engine/integrations/captcha/captcha.guard';
|
import { CaptchaGuard } from 'src/engine/core-modules/captcha/captcha.guard';
|
||||||
|
|
||||||
import { ChallengeInput } from './dto/challenge.input';
|
import { ChallengeInput } from './dto/challenge.input';
|
||||||
import { ImpersonateInput } from './dto/impersonate.input';
|
import { ImpersonateInput } from './dto/impersonate.input';
|
||||||
|
@ -20,7 +20,7 @@ import { GoogleAPIsService } from 'src/engine/core-modules/auth/services/google-
|
|||||||
import { TokenService } from 'src/engine/core-modules/auth/services/token.service';
|
import { TokenService } from 'src/engine/core-modules/auth/services/token.service';
|
||||||
import { GoogleAPIsRequest } from 'src/engine/core-modules/auth/types/google-api-request.type';
|
import { GoogleAPIsRequest } from 'src/engine/core-modules/auth/types/google-api-request.type';
|
||||||
import { OnboardingService } from 'src/engine/core-modules/onboarding/onboarding.service';
|
import { OnboardingService } from 'src/engine/core-modules/onboarding/onboarding.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
@Controller('auth/google-apis')
|
@Controller('auth/google-apis')
|
||||||
@UseFilters(AuthRestApiExceptionFilter)
|
@UseFilters(AuthRestApiExceptionFilter)
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
} from 'src/engine/core-modules/auth/auth.exception';
|
} from 'src/engine/core-modules/auth/auth.exception';
|
||||||
import { GoogleAPIsOauthExchangeCodeForTokenStrategy } from 'src/engine/core-modules/auth/strategies/google-apis-oauth-exchange-code-for-token.auth.strategy';
|
import { GoogleAPIsOauthExchangeCodeForTokenStrategy } from 'src/engine/core-modules/auth/strategies/google-apis-oauth-exchange-code-for-token.auth.strategy';
|
||||||
import { setRequestExtraParams } from 'src/engine/core-modules/auth/utils/google-apis-set-request-extra-params.util';
|
import { setRequestExtraParams } from 'src/engine/core-modules/auth/utils/google-apis-set-request-extra-params.util';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GoogleAPIsOauthExchangeCodeForTokenGuard extends AuthGuard(
|
export class GoogleAPIsOauthExchangeCodeForTokenGuard extends AuthGuard(
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
} from 'src/engine/core-modules/auth/auth.exception';
|
} from 'src/engine/core-modules/auth/auth.exception';
|
||||||
import { GoogleAPIsOauthRequestCodeStrategy } from 'src/engine/core-modules/auth/strategies/google-apis-oauth-request-code.auth.strategy';
|
import { GoogleAPIsOauthRequestCodeStrategy } from 'src/engine/core-modules/auth/strategies/google-apis-oauth-request-code.auth.strategy';
|
||||||
import { setRequestExtraParams } from 'src/engine/core-modules/auth/utils/google-apis-set-request-extra-params.util';
|
import { setRequestExtraParams } from 'src/engine/core-modules/auth/utils/google-apis-set-request-extra-params.util';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GoogleAPIsOauthRequestCodeGuard extends AuthGuard('google-apis') {
|
export class GoogleAPIsOauthRequestCodeGuard extends AuthGuard('google-apis') {
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
AuthExceptionCode,
|
AuthExceptionCode,
|
||||||
} from 'src/engine/core-modules/auth/auth.exception';
|
} from 'src/engine/core-modules/auth/auth.exception';
|
||||||
import { GoogleStrategy } from 'src/engine/core-modules/auth/strategies/google.auth.strategy';
|
import { GoogleStrategy } from 'src/engine/core-modules/auth/strategies/google.auth.strategy';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GoogleProviderEnabledGuard implements CanActivate {
|
export class GoogleProviderEnabledGuard implements CanActivate {
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
AuthExceptionCode,
|
AuthExceptionCode,
|
||||||
} from 'src/engine/core-modules/auth/auth.exception';
|
} from 'src/engine/core-modules/auth/auth.exception';
|
||||||
import { MicrosoftStrategy } from 'src/engine/core-modules/auth/strategies/microsoft.auth.strategy';
|
import { MicrosoftStrategy } from 'src/engine/core-modules/auth/strategies/microsoft.auth.strategy';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MicrosoftProviderEnabledGuard implements CanActivate {
|
export class MicrosoftProviderEnabledGuard implements CanActivate {
|
||||||
|
@ -5,8 +5,8 @@ import { UserService } from 'src/engine/core-modules/user/services/user.service'
|
|||||||
import { WorkspaceManagerService } from 'src/engine/workspace-manager/workspace-manager.service';
|
import { WorkspaceManagerService } from 'src/engine/workspace-manager/workspace-manager.service';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { EmailService } from 'src/engine/integrations/email/email.service';
|
import { EmailService } from 'src/engine/core-modules/email/email.service';
|
||||||
import { SignInUpService } from 'src/engine/core-modules/auth/services/sign-in-up.service';
|
import { SignInUpService } from 'src/engine/core-modules/auth/services/sign-in-up.service';
|
||||||
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import ms from 'ms';
|
|||||||
import { PasswordUpdateNotifyEmail } from 'twenty-emails';
|
import { PasswordUpdateNotifyEmail } from 'twenty-emails';
|
||||||
import { Repository } from 'typeorm';
|
import { Repository } from 'typeorm';
|
||||||
|
|
||||||
import { NodeEnvironment } from 'src/engine/integrations/environment/interfaces/node-environment.interface';
|
import { NodeEnvironment } from 'src/engine/core-modules/environment/interfaces/node-environment.interface';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AppToken,
|
AppToken,
|
||||||
@ -36,8 +36,8 @@ import { WorkspaceMember } from 'src/engine/core-modules/user/dtos/workspace-mem
|
|||||||
import { UserService } from 'src/engine/core-modules/user/services/user.service';
|
import { UserService } from 'src/engine/core-modules/user/services/user.service';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EmailService } from 'src/engine/integrations/email/email.service';
|
import { EmailService } from 'src/engine/core-modules/email/email.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
import { TokenService } from './token.service';
|
import { TokenService } from './token.service';
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@ import { Injectable } from '@nestjs/common';
|
|||||||
import { EntityManager } from 'typeorm';
|
import { EntityManager } from 'typeorm';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
import { InjectObjectMetadataRepository } from 'src/engine/object-metadata-repository/object-metadata-repository.decorator';
|
import { InjectObjectMetadataRepository } from 'src/engine/object-metadata-repository/object-metadata-repository.decorator';
|
||||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||||
import {
|
import {
|
||||||
|
@ -8,7 +8,7 @@ import { OnboardingService } from 'src/engine/core-modules/onboarding/onboarding
|
|||||||
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
|
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
describe('SignInUpService', () => {
|
describe('SignInUpService', () => {
|
||||||
let service: SignInUpService;
|
let service: SignInUpService;
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
Workspace,
|
Workspace,
|
||||||
WorkspaceActivationStatus,
|
WorkspaceActivationStatus,
|
||||||
} from 'src/engine/core-modules/workspace/workspace.entity';
|
} from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { getImageBufferFromUrl } from 'src/utils/image';
|
import { getImageBufferFromUrl } from 'src/utils/image';
|
||||||
|
|
||||||
export type SignInUpServiceInput = {
|
export type SignInUpServiceInput = {
|
||||||
|
@ -14,8 +14,8 @@ import { JwtAuthStrategy } from 'src/engine/core-modules/auth/strategies/jwt.aut
|
|||||||
import { JwtWrapperService } from 'src/engine/core-modules/jwt/services/jwt-wrapper.service';
|
import { JwtWrapperService } from 'src/engine/core-modules/jwt/services/jwt-wrapper.service';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EmailService } from 'src/engine/integrations/email/email.service';
|
import { EmailService } from 'src/engine/core-modules/email/email.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||||
|
|
||||||
import { TokenService } from './token.service';
|
import { TokenService } from './token.service';
|
||||||
|
@ -42,8 +42,8 @@ import {
|
|||||||
Workspace,
|
Workspace,
|
||||||
WorkspaceActivationStatus,
|
WorkspaceActivationStatus,
|
||||||
} from 'src/engine/core-modules/workspace/workspace.entity';
|
} from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EmailService } from 'src/engine/integrations/email/email.service';
|
import { EmailService } from 'src/engine/core-modules/email/email.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||||
import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { PassportStrategy } from '@nestjs/passport';
|
|||||||
|
|
||||||
import { Strategy } from 'passport-google-oauth20';
|
import { Strategy } from 'passport-google-oauth20';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
export type GoogleAPIScopeConfig = {
|
export type GoogleAPIScopeConfig = {
|
||||||
isCalendarEnabled?: boolean;
|
isCalendarEnabled?: boolean;
|
||||||
|
@ -4,7 +4,7 @@ import { VerifyCallback } from 'passport-google-oauth20';
|
|||||||
|
|
||||||
import { GoogleAPIsOauthCommonStrategy } from 'src/engine/core-modules/auth/strategies/google-apis-oauth-common.auth.strategy';
|
import { GoogleAPIsOauthCommonStrategy } from 'src/engine/core-modules/auth/strategies/google-apis-oauth-common.auth.strategy';
|
||||||
import { GoogleAPIsRequest } from 'src/engine/core-modules/auth/types/google-api-request.type';
|
import { GoogleAPIsRequest } from 'src/engine/core-modules/auth/types/google-api-request.type';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
export type GoogleAPIScopeConfig = {
|
export type GoogleAPIScopeConfig = {
|
||||||
isCalendarEnabled?: boolean;
|
isCalendarEnabled?: boolean;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
import { GoogleAPIsOauthCommonStrategy } from 'src/engine/core-modules/auth/strategies/google-apis-oauth-common.auth.strategy';
|
import { GoogleAPIsOauthCommonStrategy } from 'src/engine/core-modules/auth/strategies/google-apis-oauth-common.auth.strategy';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
export type GoogleAPIScopeConfig = {
|
export type GoogleAPIScopeConfig = {
|
||||||
isCalendarEnabled?: boolean;
|
isCalendarEnabled?: boolean;
|
||||||
|
@ -4,7 +4,7 @@ import { PassportStrategy } from '@nestjs/passport';
|
|||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import { Strategy, VerifyCallback } from 'passport-google-oauth20';
|
import { Strategy, VerifyCallback } from 'passport-google-oauth20';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
export type GoogleRequest = Omit<
|
export type GoogleRequest = Omit<
|
||||||
Request,
|
Request,
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
import { AuthContext } from 'src/engine/core-modules/auth/types/auth-context.type';
|
import { AuthContext } from 'src/engine/core-modules/auth/types/auth-context.type';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service';
|
import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service';
|
||||||
import { ApiKeyWorkspaceEntity } from 'src/modules/api-key/standard-objects/api-key.workspace-entity';
|
import { ApiKeyWorkspaceEntity } from 'src/modules/api-key/standard-objects/api-key.workspace-entity';
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
AuthException,
|
AuthException,
|
||||||
AuthExceptionCode,
|
AuthExceptionCode,
|
||||||
} from 'src/engine/core-modules/auth/auth.exception';
|
} from 'src/engine/core-modules/auth/auth.exception';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
export type MicrosoftRequest = Omit<
|
export type MicrosoftRequest = Omit<
|
||||||
Request,
|
Request,
|
||||||
|
@ -3,9 +3,9 @@ import { Logger, Scope } from '@nestjs/common';
|
|||||||
import { BillingSubscriptionService } from 'src/engine/core-modules/billing/services/billing-subscription.service';
|
import { BillingSubscriptionService } from 'src/engine/core-modules/billing/services/billing-subscription.service';
|
||||||
import { StripeService } from 'src/engine/core-modules/billing/stripe/stripe.service';
|
import { StripeService } from 'src/engine/core-modules/billing/stripe/stripe.service';
|
||||||
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
|
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
|
||||||
import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
|
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
|
||||||
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
|
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
export type UpdateSubscriptionJobData = { workspaceId: string };
|
export type UpdateSubscriptionJobData = { workspaceId: string };
|
||||||
|
|
||||||
@Processor({
|
@Processor({
|
||||||
|
@ -5,11 +5,11 @@ import {
|
|||||||
UpdateSubscriptionJob,
|
UpdateSubscriptionJob,
|
||||||
UpdateSubscriptionJobData,
|
UpdateSubscriptionJobData,
|
||||||
} from 'src/engine/core-modules/billing/jobs/update-subscription.job';
|
} from 'src/engine/core-modules/billing/jobs/update-subscription.job';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { ObjectRecordCreateEvent } from 'src/engine/integrations/event-emitter/types/object-record-create.event';
|
import { ObjectRecordCreateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-create.event';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
import { WorkspaceEventBatch } from 'src/engine/workspace-event-emitter/workspace-event.type';
|
import { WorkspaceEventBatch } from 'src/engine/workspace-event-emitter/workspace-event.type';
|
||||||
import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import { StripeService } from 'src/engine/core-modules/billing/stripe/stripe.ser
|
|||||||
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
|
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { assert } from 'src/utils/assert';
|
import { assert } from 'src/utils/assert';
|
||||||
|
|
||||||
export enum WebhookEvent {
|
export enum WebhookEvent {
|
||||||
|
@ -18,7 +18,7 @@ import { StripeService } from 'src/engine/core-modules/billing/stripe/stripe.ser
|
|||||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BillingSubscriptionService {
|
export class BillingSubscriptionService {
|
||||||
|
@ -6,7 +6,7 @@ import { SubscriptionStatus } from 'src/engine/core-modules/billing/entities/bil
|
|||||||
import { BillingSubscriptionService } from 'src/engine/core-modules/billing/services/billing-subscription.service';
|
import { BillingSubscriptionService } from 'src/engine/core-modules/billing/services/billing-subscription.service';
|
||||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BillingService {
|
export class BillingService {
|
||||||
|
@ -7,7 +7,7 @@ import { AvailableProduct } from 'src/engine/core-modules/billing/interfaces/ava
|
|||||||
import { ProductPriceEntity } from 'src/engine/core-modules/billing/dto/product-price.entity';
|
import { ProductPriceEntity } from 'src/engine/core-modules/billing/dto/product-price.entity';
|
||||||
import { BillingSubscriptionItem } from 'src/engine/core-modules/billing/entities/billing-subscription-item.entity';
|
import { BillingSubscriptionItem } from 'src/engine/core-modules/billing/entities/billing-subscription-item.entity';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class StripeService {
|
export class StripeService {
|
||||||
|
@ -2,8 +2,8 @@ import { CacheModuleOptions } from '@nestjs/common';
|
|||||||
|
|
||||||
import { redisStore } from 'cache-manager-redis-yet';
|
import { redisStore } from 'cache-manager-redis-yet';
|
||||||
|
|
||||||
import { CacheStorageType } from 'src/engine/integrations/cache-storage/types/cache-storage-type.enum';
|
import { CacheStorageType } from 'src/engine/core-modules/cache-storage/types/cache-storage-type.enum';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
export const cacheStorageModuleFactory = (
|
export const cacheStorageModuleFactory = (
|
||||||
environmentService: EnvironmentService,
|
environmentService: EnvironmentService,
|
@ -2,10 +2,10 @@ import { Module, Global, Inject, OnModuleDestroy } from '@nestjs/common';
|
|||||||
import { CacheModule, CACHE_MANAGER, Cache } from '@nestjs/cache-manager';
|
import { CacheModule, CACHE_MANAGER, Cache } from '@nestjs/cache-manager';
|
||||||
import { ConfigModule } from '@nestjs/config';
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
|
||||||
import { CacheStorageService } from 'src/engine/integrations/cache-storage/cache-storage.service';
|
import { CacheStorageService } from 'src/engine/core-modules/cache-storage/cache-storage.service';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
import { cacheStorageModuleFactory } from 'src/engine/integrations/cache-storage/cache-storage.module-factory';
|
import { cacheStorageModuleFactory } from 'src/engine/core-modules/cache-storage/cache-storage.module-factory';
|
||||||
import { CacheStorageNamespace } from 'src/engine/integrations/cache-storage/types/cache-storage-namespace.enum';
|
import { CacheStorageNamespace } from 'src/engine/core-modules/cache-storage/types/cache-storage-namespace.enum';
|
||||||
|
|
||||||
@Global()
|
@Global()
|
||||||
@Module({
|
@Module({
|
@ -3,7 +3,7 @@ import { CACHE_MANAGER, Cache } from '@nestjs/cache-manager';
|
|||||||
|
|
||||||
import { RedisCache } from 'cache-manager-redis-yet';
|
import { RedisCache } from 'cache-manager-redis-yet';
|
||||||
|
|
||||||
import { CacheStorageNamespace } from 'src/engine/integrations/cache-storage/types/cache-storage-namespace.enum';
|
import { CacheStorageNamespace } from 'src/engine/core-modules/cache-storage/types/cache-storage-namespace.enum';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CacheStorageService {
|
export class CacheStorageService {
|
@ -1,6 +1,6 @@
|
|||||||
import { Inject } from '@nestjs/common';
|
import { Inject } from '@nestjs/common';
|
||||||
|
|
||||||
import { CacheStorageNamespace } from 'src/engine/integrations/cache-storage/types/cache-storage-namespace.enum';
|
import { CacheStorageNamespace } from 'src/engine/core-modules/cache-storage/types/cache-storage-namespace.enum';
|
||||||
|
|
||||||
export const InjectCacheStorage = (
|
export const InjectCacheStorage = (
|
||||||
cacheStorageNamespace: CacheStorageNamespace,
|
cacheStorageNamespace: CacheStorageNamespace,
|
@ -6,7 +6,7 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { GqlExecutionContext } from '@nestjs/graphql';
|
import { GqlExecutionContext } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { CaptchaService } from 'src/engine/integrations/captcha/captcha.service';
|
import { CaptchaService } from 'src/engine/core-modules/captcha/captcha.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CaptchaGuard implements CanActivate {
|
export class CaptchaGuard implements CanActivate {
|
@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
CaptchaDriverOptions,
|
CaptchaDriverOptions,
|
||||||
CaptchaModuleOptions,
|
CaptchaModuleOptions,
|
||||||
} from 'src/engine/integrations/captcha/interfaces';
|
} from 'src/engine/core-modules/captcha/interfaces';
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
export const captchaModuleFactory = (
|
export const captchaModuleFactory = (
|
||||||
environmentService: EnvironmentService,
|
environmentService: EnvironmentService,
|
@ -1,13 +1,13 @@
|
|||||||
import { DynamicModule, Global } from '@nestjs/common';
|
import { DynamicModule, Global } from '@nestjs/common';
|
||||||
|
|
||||||
import { CAPTCHA_DRIVER } from 'src/engine/integrations/captcha/captcha.constants';
|
import { CAPTCHA_DRIVER } from 'src/engine/core-modules/captcha/captcha.constants';
|
||||||
import { CaptchaService } from 'src/engine/integrations/captcha/captcha.service';
|
import { CaptchaService } from 'src/engine/core-modules/captcha/captcha.service';
|
||||||
import { GoogleRecaptchaDriver } from 'src/engine/integrations/captcha/drivers/google-recaptcha.driver';
|
import { GoogleRecaptchaDriver } from 'src/engine/core-modules/captcha/drivers/google-recaptcha.driver';
|
||||||
import { TurnstileDriver } from 'src/engine/integrations/captcha/drivers/turnstile.driver';
|
import { TurnstileDriver } from 'src/engine/core-modules/captcha/drivers/turnstile.driver';
|
||||||
import {
|
import {
|
||||||
CaptchaDriverType,
|
CaptchaDriverType,
|
||||||
CaptchaModuleAsyncOptions,
|
CaptchaModuleAsyncOptions,
|
||||||
} from 'src/engine/integrations/captcha/interfaces';
|
} from 'src/engine/core-modules/captcha/interfaces';
|
||||||
|
|
||||||
@Global()
|
@Global()
|
||||||
export class CaptchaModule {
|
export class CaptchaModule {
|
@ -1,9 +1,9 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
import { CaptchaDriver } from 'src/engine/integrations/captcha/drivers/interfaces/captcha-driver.interface';
|
import { CaptchaDriver } from 'src/engine/core-modules/captcha/drivers/interfaces/captcha-driver.interface';
|
||||||
|
|
||||||
import { CAPTCHA_DRIVER } from 'src/engine/integrations/captcha/captcha.constants';
|
import { CAPTCHA_DRIVER } from 'src/engine/core-modules/captcha/captcha.constants';
|
||||||
import { CaptchaValidateResult } from 'src/engine/integrations/captcha/interfaces';
|
import { CaptchaValidateResult } from 'src/engine/core-modules/captcha/interfaces';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CaptchaService implements CaptchaDriver {
|
export class CaptchaService implements CaptchaDriver {
|
@ -1,12 +1,12 @@
|
|||||||
import axios, { AxiosInstance } from 'axios';
|
import axios, { AxiosInstance } from 'axios';
|
||||||
|
|
||||||
import { CaptchaDriver } from 'src/engine/integrations/captcha/drivers/interfaces/captcha-driver.interface';
|
import { CaptchaDriver } from 'src/engine/core-modules/captcha/drivers/interfaces/captcha-driver.interface';
|
||||||
import { CaptchaServerResponse } from 'src/engine/integrations/captcha/drivers/interfaces/captcha-server-response';
|
import { CaptchaServerResponse } from 'src/engine/core-modules/captcha/drivers/interfaces/captcha-server-response';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CaptchaDriverOptions,
|
CaptchaDriverOptions,
|
||||||
CaptchaValidateResult,
|
CaptchaValidateResult,
|
||||||
} from 'src/engine/integrations/captcha/interfaces';
|
} from 'src/engine/core-modules/captcha/interfaces';
|
||||||
|
|
||||||
export class GoogleRecaptchaDriver implements CaptchaDriver {
|
export class GoogleRecaptchaDriver implements CaptchaDriver {
|
||||||
private readonly siteKey: string;
|
private readonly siteKey: string;
|
@ -1,4 +1,4 @@
|
|||||||
import { CaptchaValidateResult } from 'src/engine/integrations/captcha/interfaces';
|
import { CaptchaValidateResult } from 'src/engine/core-modules/captcha/interfaces';
|
||||||
|
|
||||||
export interface CaptchaDriver {
|
export interface CaptchaDriver {
|
||||||
validate(token: string): Promise<CaptchaValidateResult>;
|
validate(token: string): Promise<CaptchaValidateResult>;
|
@ -1,12 +1,12 @@
|
|||||||
import axios, { AxiosInstance } from 'axios';
|
import axios, { AxiosInstance } from 'axios';
|
||||||
|
|
||||||
import { CaptchaDriver } from 'src/engine/integrations/captcha/drivers/interfaces/captcha-driver.interface';
|
import { CaptchaDriver } from 'src/engine/core-modules/captcha/drivers/interfaces/captcha-driver.interface';
|
||||||
import { CaptchaServerResponse } from 'src/engine/integrations/captcha/drivers/interfaces/captcha-server-response';
|
import { CaptchaServerResponse } from 'src/engine/core-modules/captcha/drivers/interfaces/captcha-server-response';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CaptchaDriverOptions,
|
CaptchaDriverOptions,
|
||||||
CaptchaValidateResult,
|
CaptchaValidateResult,
|
||||||
} from 'src/engine/integrations/captcha/interfaces';
|
} from 'src/engine/core-modules/captcha/interfaces';
|
||||||
|
|
||||||
export class TurnstileDriver implements CaptchaDriver {
|
export class TurnstileDriver implements CaptchaDriver {
|
||||||
private readonly siteKey: string;
|
private readonly siteKey: string;
|
@ -0,0 +1 @@
|
|||||||
|
export * from 'src/engine/core-modules/captcha/interfaces/captcha.interface';
|
@ -1,6 +1,6 @@
|
|||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { CaptchaDriverType } from 'src/engine/integrations/captcha/interfaces';
|
import { CaptchaDriverType } from 'src/engine/core-modules/captcha/interfaces';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
class AuthProviders {
|
class AuthProviders {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Test, TestingModule } from '@nestjs/testing';
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
import { ClientConfigResolver } from './client-config.resolver';
|
import { ClientConfigResolver } from './client-config.resolver';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Resolver, Query } from '@nestjs/graphql';
|
import { Resolver, Query } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
import { ClientConfig } from './client-config.entity';
|
import { ClientConfig } from './client-config.entity';
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
|
import { HttpAdapterHost } from '@nestjs/core';
|
||||||
|
import { EventEmitterModule } from '@nestjs/event-emitter';
|
||||||
|
|
||||||
import { ActorModule } from 'src/engine/core-modules/actor/actor.module';
|
import { ActorModule } from 'src/engine/core-modules/actor/actor.module';
|
||||||
import { AISQLQueryModule } from 'src/engine/core-modules/ai-sql-query/ai-sql-query.module';
|
import { AISQLQueryModule } from 'src/engine/core-modules/ai-sql-query/ai-sql-query.module';
|
||||||
@ -15,10 +17,32 @@ import { UserModule } from 'src/engine/core-modules/user/user.module';
|
|||||||
import { WorkflowTriggerApiModule } from 'src/engine/core-modules/workflow/workflow-trigger-api.module';
|
import { WorkflowTriggerApiModule } from 'src/engine/core-modules/workflow/workflow-trigger-api.module';
|
||||||
import { WorkspaceModule } from 'src/engine/core-modules/workspace/workspace.module';
|
import { WorkspaceModule } from 'src/engine/core-modules/workspace/workspace.module';
|
||||||
import { WorkspaceEventEmitterModule } from 'src/engine/workspace-event-emitter/workspace-event-emitter.module';
|
import { WorkspaceEventEmitterModule } from 'src/engine/workspace-event-emitter/workspace-event-emitter.module';
|
||||||
|
import { EnvironmentModule } from 'src/engine/core-modules/environment/environment.module';
|
||||||
|
import { FileStorageModule } from 'src/engine/core-modules/file-storage/file-storage.module';
|
||||||
|
import { fileStorageModuleFactory } from 'src/engine/core-modules/file-storage/file-storage.module-factory';
|
||||||
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
import { LoggerModule } from 'src/engine/core-modules/logger/logger.module';
|
||||||
|
import { loggerModuleFactory } from 'src/engine/core-modules/logger/logger.module-factory';
|
||||||
|
import { MessageQueueModule } from 'src/engine/core-modules/message-queue/message-queue.module';
|
||||||
|
import { messageQueueModuleFactory } from 'src/engine/core-modules/message-queue/message-queue.module-factory';
|
||||||
|
import { ExceptionHandlerModule } from 'src/engine/core-modules/exception-handler/exception-handler.module';
|
||||||
|
import { exceptionHandlerModuleFactory } from 'src/engine/core-modules/exception-handler/exception-handler.module-factory';
|
||||||
|
import { EmailModule } from 'src/engine/core-modules/email/email.module';
|
||||||
|
import { emailModuleFactory } from 'src/engine/core-modules/email/email.module-factory';
|
||||||
|
import { CaptchaModule } from 'src/engine/core-modules/captcha/captcha.module';
|
||||||
|
import { captchaModuleFactory } from 'src/engine/core-modules/captcha/captcha.module-factory';
|
||||||
|
import { CacheStorageModule } from 'src/engine/core-modules/cache-storage/cache-storage.module';
|
||||||
|
import { LLMChatModelModule } from 'src/engine/core-modules/llm-chat-model/llm-chat-model.module';
|
||||||
|
import { llmChatModelModuleFactory } from 'src/engine/core-modules/llm-chat-model/llm-chat-model.module-factory';
|
||||||
|
import { LLMTracingModule } from 'src/engine/core-modules/llm-tracing/llm-tracing.module';
|
||||||
|
import { llmTracingModuleFactory } from 'src/engine/core-modules/llm-tracing/llm-tracing.module-factory';
|
||||||
|
import { ServerlessModule } from 'src/engine/core-modules/serverless/serverless.module';
|
||||||
|
import { serverlessModuleFactory } from 'src/engine/core-modules/serverless/serverless-module.factory';
|
||||||
|
import { FileStorageService } from 'src/engine/core-modules/file-storage/file-storage.service';
|
||||||
|
|
||||||
import { AnalyticsModule } from './analytics/analytics.module';
|
|
||||||
import { ClientConfigModule } from './client-config/client-config.module';
|
|
||||||
import { FileModule } from './file/file.module';
|
import { FileModule } from './file/file.module';
|
||||||
|
import { ClientConfigModule } from './client-config/client-config.module';
|
||||||
|
import { AnalyticsModule } from './analytics/analytics.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@ -40,6 +64,47 @@ import { FileModule } from './file/file.module';
|
|||||||
WorkflowTriggerApiModule,
|
WorkflowTriggerApiModule,
|
||||||
WorkspaceEventEmitterModule,
|
WorkspaceEventEmitterModule,
|
||||||
ActorModule,
|
ActorModule,
|
||||||
|
EnvironmentModule.forRoot({}),
|
||||||
|
FileStorageModule.forRootAsync({
|
||||||
|
useFactory: fileStorageModuleFactory,
|
||||||
|
inject: [EnvironmentService],
|
||||||
|
}),
|
||||||
|
LoggerModule.forRootAsync({
|
||||||
|
useFactory: loggerModuleFactory,
|
||||||
|
inject: [EnvironmentService],
|
||||||
|
}),
|
||||||
|
MessageQueueModule.registerAsync({
|
||||||
|
useFactory: messageQueueModuleFactory,
|
||||||
|
inject: [EnvironmentService],
|
||||||
|
}),
|
||||||
|
ExceptionHandlerModule.forRootAsync({
|
||||||
|
useFactory: exceptionHandlerModuleFactory,
|
||||||
|
inject: [EnvironmentService, HttpAdapterHost],
|
||||||
|
}),
|
||||||
|
EmailModule.forRoot({
|
||||||
|
useFactory: emailModuleFactory,
|
||||||
|
inject: [EnvironmentService],
|
||||||
|
}),
|
||||||
|
CaptchaModule.forRoot({
|
||||||
|
useFactory: captchaModuleFactory,
|
||||||
|
inject: [EnvironmentService],
|
||||||
|
}),
|
||||||
|
EventEmitterModule.forRoot({
|
||||||
|
wildcard: true,
|
||||||
|
}),
|
||||||
|
CacheStorageModule,
|
||||||
|
LLMChatModelModule.forRoot({
|
||||||
|
useFactory: llmChatModelModuleFactory,
|
||||||
|
inject: [EnvironmentService],
|
||||||
|
}),
|
||||||
|
LLMTracingModule.forRoot({
|
||||||
|
useFactory: llmTracingModuleFactory,
|
||||||
|
inject: [EnvironmentService],
|
||||||
|
}),
|
||||||
|
ServerlessModule.forRootAsync({
|
||||||
|
useFactory: serverlessModuleFactory,
|
||||||
|
inject: [EnvironmentService, FileStorageService],
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AnalyticsModule,
|
AnalyticsModule,
|
||||||
|
@ -2,7 +2,7 @@ import { Logger } from '@nestjs/common';
|
|||||||
|
|
||||||
import { SendMailOptions } from 'nodemailer';
|
import { SendMailOptions } from 'nodemailer';
|
||||||
|
|
||||||
import { EmailDriver } from 'src/engine/integrations/email/drivers/interfaces/email-driver.interface';
|
import { EmailDriver } from 'src/engine/core-modules/email/drivers/interfaces/email-driver.interface';
|
||||||
|
|
||||||
export class LoggerDriver implements EmailDriver {
|
export class LoggerDriver implements EmailDriver {
|
||||||
private readonly logger = new Logger(LoggerDriver.name);
|
private readonly logger = new Logger(LoggerDriver.name);
|
@ -3,7 +3,7 @@ import { Logger } from '@nestjs/common';
|
|||||||
import { createTransport, Transporter, SendMailOptions } from 'nodemailer';
|
import { createTransport, Transporter, SendMailOptions } from 'nodemailer';
|
||||||
import SMTPConnection from 'nodemailer/lib/smtp-connection';
|
import SMTPConnection from 'nodemailer/lib/smtp-connection';
|
||||||
|
|
||||||
import { EmailDriver } from 'src/engine/integrations/email/drivers/interfaces/email-driver.interface';
|
import { EmailDriver } from 'src/engine/core-modules/email/drivers/interfaces/email-driver.interface';
|
||||||
|
|
||||||
export class SmtpDriver implements EmailDriver {
|
export class SmtpDriver implements EmailDriver {
|
||||||
private readonly logger = new Logger(SmtpDriver.name);
|
private readonly logger = new Logger(SmtpDriver.name);
|
@ -1,9 +1,9 @@
|
|||||||
import { SendMailOptions } from 'nodemailer';
|
import { SendMailOptions } from 'nodemailer';
|
||||||
|
|
||||||
import { EmailSenderService } from 'src/engine/integrations/email/email-sender.service';
|
import { EmailSenderService } from 'src/engine/core-modules/email/email-sender.service';
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
|
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
|
||||||
import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
|
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
|
||||||
|
|
||||||
@Processor(MessageQueue.emailQueue)
|
@Processor(MessageQueue.emailQueue)
|
||||||
export class EmailSenderJob {
|
export class EmailSenderJob {
|
@ -2,9 +2,9 @@ import { Inject, Injectable } from '@nestjs/common';
|
|||||||
|
|
||||||
import { SendMailOptions } from 'nodemailer';
|
import { SendMailOptions } from 'nodemailer';
|
||||||
|
|
||||||
import { EmailDriver } from 'src/engine/integrations/email/drivers/interfaces/email-driver.interface';
|
import { EmailDriver } from 'src/engine/core-modules/email/drivers/interfaces/email-driver.interface';
|
||||||
|
|
||||||
import { EMAIL_DRIVER } from 'src/engine/integrations/email/email.constants';
|
import { EMAIL_DRIVER } from 'src/engine/core-modules/email/email.constants';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EmailSenderService implements EmailDriver {
|
export class EmailSenderService implements EmailDriver {
|
@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
EmailDriver,
|
EmailDriver,
|
||||||
EmailModuleOptions,
|
EmailModuleOptions,
|
||||||
} from 'src/engine/integrations/email/interfaces/email.interface';
|
} from 'src/engine/core-modules/email/interfaces/email.interface';
|
||||||
|
|
||||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||||
|
|
||||||
export const emailModuleFactory = (
|
export const emailModuleFactory = (
|
||||||
environmentService: EnvironmentService,
|
environmentService: EnvironmentService,
|
@ -1,12 +1,12 @@
|
|||||||
import { DynamicModule, Global } from '@nestjs/common';
|
import { DynamicModule, Global } from '@nestjs/common';
|
||||||
|
|
||||||
import { EmailModuleAsyncOptions } from 'src/engine/integrations/email/interfaces/email.interface';
|
import { EmailModuleAsyncOptions } from 'src/engine/core-modules/email/interfaces/email.interface';
|
||||||
|
|
||||||
import { EMAIL_DRIVER } from 'src/engine/integrations/email/email.constants';
|
import { EMAIL_DRIVER } from 'src/engine/core-modules/email/email.constants';
|
||||||
import { LoggerDriver } from 'src/engine/integrations/email/drivers/logger.driver';
|
import { LoggerDriver } from 'src/engine/core-modules/email/drivers/logger.driver';
|
||||||
import { SmtpDriver } from 'src/engine/integrations/email/drivers/smtp.driver';
|
import { SmtpDriver } from 'src/engine/core-modules/email/drivers/smtp.driver';
|
||||||
import { EmailService } from 'src/engine/integrations/email/email.service';
|
import { EmailService } from 'src/engine/core-modules/email/email.service';
|
||||||
import { EmailSenderService } from 'src/engine/integrations/email/email-sender.service';
|
import { EmailSenderService } from 'src/engine/core-modules/email/email-sender.service';
|
||||||
|
|
||||||
@Global()
|
@Global()
|
||||||
export class EmailModule {
|
export class EmailModule {
|
@ -2,10 +2,10 @@ import { Injectable } from '@nestjs/common';
|
|||||||
|
|
||||||
import { SendMailOptions } from 'nodemailer';
|
import { SendMailOptions } from 'nodemailer';
|
||||||
|
|
||||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||||
import { EmailSenderJob } from 'src/engine/integrations/email/email-sender.job';
|
import { EmailSenderJob } from 'src/engine/core-modules/email/email-sender.job';
|
||||||
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
|
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EmailService {
|
export class EmailService {
|
@ -1,6 +1,6 @@
|
|||||||
import { plainToClass } from 'class-transformer';
|
import { plainToClass } from 'class-transformer';
|
||||||
|
|
||||||
import { CastToLogLevelArray } from 'src/engine/integrations/environment/decorators/cast-to-log-level-array.decorator';
|
import { CastToLogLevelArray } from 'src/engine/core-modules/environment/decorators/cast-to-log-level-array.decorator';
|
||||||
|
|
||||||
class TestClass {
|
class TestClass {
|
||||||
@CastToLogLevelArray()
|
@CastToLogLevelArray()
|
@ -1,6 +1,6 @@
|
|||||||
import { plainToClass } from 'class-transformer';
|
import { plainToClass } from 'class-transformer';
|
||||||
|
|
||||||
import { CastToPositiveNumber } from 'src/engine/integrations/environment/decorators/cast-to-positive-number.decorator';
|
import { CastToPositiveNumber } from 'src/engine/core-modules/environment/decorators/cast-to-positive-number.decorator';
|
||||||
|
|
||||||
class TestClass {
|
class TestClass {
|
||||||
@CastToPositiveNumber()
|
@CastToPositiveNumber()
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user