feat: refactor folder structure (#4498)

* feat: wip refactor folder structure

* Fix

* fix position

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Jérémy M 2024-03-15 14:40:58 +01:00 committed by GitHub
parent 52f1b3ac98
commit 94487f6737
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
760 changed files with 3215 additions and 3155 deletions

View File

@ -34,6 +34,7 @@
"dependencies": {
"@graphql-yoga/nestjs": "patch:@graphql-yoga/nestjs@2.1.0#./patches/@graphql-yoga+nestjs+2.1.0.patch",
"@nestjs/cache-manager": "^2.2.1",
"@nestjs/devtools-integration": "^0.1.6",
"@nestjs/graphql": "patch:@nestjs/graphql@12.0.8#./patches/@nestjs+graphql+12.0.8.patch",
"@ptc-org/nestjs-query-graphql": "patch:@ptc-org/nestjs-query-graphql@4.2.0#./patches/@ptc-org+nestjs-query-graphql+4.2.0.patch",
"cache-manager": "^5.4.0",

View File

@ -0,0 +1,46 @@
import { Test, TestingModule } from '@nestjs/testing';
import { ApiRestQueryBuilderFactory } from 'src/api/rest/api-rest-query-builder/api-rest-query-builder.factory';
import { DeleteQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/delete-query.factory';
import { CreateQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/create-query.factory';
import { UpdateQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/update-query.factory';
import { FindOneQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/find-one-query.factory';
import { FindManyQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/find-many-query.factory';
import { DeleteVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/delete-variables.factory';
import { CreateVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/create-variables.factory';
import { UpdateVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/update-variables.factory';
import { GetVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/get-variables.factory';
import { ObjectMetadataService } from 'src/engine-metadata/object-metadata/object-metadata.service';
import { TokenService } from 'src/engine/modules/auth/services/token.service';
import { EnvironmentService } from 'src/integrations/environment/environment.service';
describe('ApiRestQueryBuilderFactory', () => {
let service: ApiRestQueryBuilderFactory;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [
ApiRestQueryBuilderFactory,
{ provide: DeleteQueryFactory, useValue: {} },
{ provide: CreateQueryFactory, useValue: {} },
{ provide: UpdateQueryFactory, useValue: {} },
{ provide: FindOneQueryFactory, useValue: {} },
{ provide: FindManyQueryFactory, useValue: {} },
{ provide: DeleteVariablesFactory, useValue: {} },
{ provide: CreateVariablesFactory, useValue: {} },
{ provide: UpdateVariablesFactory, useValue: {} },
{ provide: GetVariablesFactory, useValue: {} },
{ provide: ObjectMetadataService, useValue: {} },
{ provide: TokenService, useValue: {} },
{ provide: EnvironmentService, useValue: {} },
],
}).compile();
service = module.get<ApiRestQueryBuilderFactory>(
ApiRestQueryBuilderFactory,
);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@ -2,21 +2,21 @@ import { BadRequestException, Injectable } from '@nestjs/common';
import { Request } from 'express';
import { DeleteQueryFactory } from 'src/core/api-rest/api-rest-query-builder/factories/delete-query.factory';
import { ObjectMetadataService } from 'src/metadata/object-metadata/object-metadata.service';
import { TokenService } from 'src/core/auth/services/token.service';
import { CreateQueryFactory } from 'src/core/api-rest/api-rest-query-builder/factories/create-query.factory';
import { UpdateQueryFactory } from 'src/core/api-rest/api-rest-query-builder/factories/update-query.factory';
import { FindOneQueryFactory } from 'src/core/api-rest/api-rest-query-builder/factories/find-one-query.factory';
import { FindManyQueryFactory } from 'src/core/api-rest/api-rest-query-builder/factories/find-many-query.factory';
import { DeleteVariablesFactory } from 'src/core/api-rest/api-rest-query-builder/factories/delete-variables.factory';
import { CreateVariablesFactory } from 'src/core/api-rest/api-rest-query-builder/factories/create-variables.factory';
import { UpdateVariablesFactory } from 'src/core/api-rest/api-rest-query-builder/factories/update-variables.factory';
import { GetVariablesFactory } from 'src/core/api-rest/api-rest-query-builder/factories/get-variables.factory';
import { parsePath } from 'src/core/api-rest/api-rest-query-builder/utils/parse-path.utils';
import { computeDepth } from 'src/core/api-rest/api-rest-query-builder/utils/compute-depth.utils';
import { ObjectMetadataEntity } from 'src/metadata/object-metadata/object-metadata.entity';
import { ApiRestQuery } from 'src/core/api-rest/types/api-rest-query.type';
import { DeleteQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/delete-query.factory';
import { ObjectMetadataService } from 'src/engine-metadata/object-metadata/object-metadata.service';
import { TokenService } from 'src/engine/modules/auth/services/token.service';
import { CreateQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/create-query.factory';
import { UpdateQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/update-query.factory';
import { FindOneQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/find-one-query.factory';
import { FindManyQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/find-many-query.factory';
import { DeleteVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/delete-variables.factory';
import { CreateVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/create-variables.factory';
import { UpdateVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/update-variables.factory';
import { GetVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/get-variables.factory';
import { parsePath } from 'src/api/rest/api-rest-query-builder/utils/parse-path.utils';
import { computeDepth } from 'src/api/rest/api-rest-query-builder/utils/compute-depth.utils';
import { ObjectMetadataEntity } from 'src/engine-metadata/object-metadata/object-metadata.entity';
import { ApiRestQuery } from 'src/api/rest/types/api-rest-query.type';
import { EnvironmentService } from 'src/integrations/environment/environment.service';
@Injectable()
@ -47,7 +47,9 @@ export class ApiRestQueryBuilderFactory {
if (!objectMetadataItems.length) {
throw new BadRequestException(
`No object was found for the workspace associated with this API key. You may generate a new one here ${this.environmentService.get('FRONT_BASE_URL')}/settings/developers`,
`No object was found for the workspace associated with this API key. You may generate a new one here ${this.environmentService.get(
'FRONT_BASE_URL',
)}/settings/developers`,
);
}

View File

@ -1,9 +1,9 @@
import { Module } from '@nestjs/common';
import { ApiRestQueryBuilderFactory } from 'src/core/api-rest/api-rest-query-builder/api-rest-query-builder.factory';
import { apiRestQueryBuilderFactories } from 'src/core/api-rest/api-rest-query-builder/factories/factories';
import { ObjectMetadataModule } from 'src/metadata/object-metadata/object-metadata.module';
import { AuthModule } from 'src/core/auth/auth.module';
import { ApiRestQueryBuilderFactory } from 'src/api/rest/api-rest-query-builder/api-rest-query-builder.factory';
import { apiRestQueryBuilderFactories } from 'src/api/rest/api-rest-query-builder/factories/factories';
import { ObjectMetadataModule } from 'src/engine-metadata/object-metadata/object-metadata.module';
import { AuthModule } from 'src/engine/modules/auth/auth.module';
@Module({
imports: [ObjectMetadataModule, AuthModule],

View File

@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { capitalize } from 'src/utils/capitalize';
import { mapFieldMetadataToGraphqlQuery } from 'src/core/api-rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
import { mapFieldMetadataToGraphqlQuery } from 'src/api/rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
@Injectable()
export class CreateQueryFactory {

View File

@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { ApiRestQueryVariables } from 'src/core/api-rest/types/api-rest-query-variables.type';
import { ApiRestQueryVariables } from 'src/api/rest/types/api-rest-query-variables.type';
@Injectable()
export class CreateVariablesFactory {

View File

@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { ApiRestQueryVariables } from 'src/core/api-rest/types/api-rest-query-variables.type';
import { ApiRestQueryVariables } from 'src/api/rest/types/api-rest-query-variables.type';
@Injectable()
export class DeleteVariablesFactory {

View File

@ -0,0 +1,29 @@
import { DeleteQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/delete-query.factory';
import { CreateQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/create-query.factory';
import { UpdateQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/update-query.factory';
import { FindOneQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/find-one-query.factory';
import { FindManyQueryFactory } from 'src/api/rest/api-rest-query-builder/factories/find-many-query.factory';
import { DeleteVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/delete-variables.factory';
import { CreateVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/create-variables.factory';
import { UpdateVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/update-variables.factory';
import { GetVariablesFactory } from 'src/api/rest/api-rest-query-builder/factories/get-variables.factory';
import { LastCursorInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/last-cursor-input.factory';
import { LimitInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/limit-input.factory';
import { OrderByInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/order-by-input.factory';
import { FilterInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-input.factory';
export const apiRestQueryBuilderFactories = [
DeleteQueryFactory,
CreateQueryFactory,
UpdateQueryFactory,
FindOneQueryFactory,
FindManyQueryFactory,
DeleteVariablesFactory,
CreateVariablesFactory,
UpdateVariablesFactory,
GetVariablesFactory,
LastCursorInputFactory,
LimitInputFactory,
OrderByInputFactory,
FilterInputFactory,
];

View File

@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { capitalize } from 'src/utils/capitalize';
import { mapFieldMetadataToGraphqlQuery } from 'src/core/api-rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
import { mapFieldMetadataToGraphqlQuery } from 'src/api/rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
@Injectable()
export class FindManyQueryFactory {

View File

@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { capitalize } from 'src/utils/capitalize';
import { mapFieldMetadataToGraphqlQuery } from 'src/core/api-rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
import { mapFieldMetadataToGraphqlQuery } from 'src/api/rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
@Injectable()
export class FindOneQueryFactory {

View File

@ -2,11 +2,11 @@ import { Injectable } from '@nestjs/common';
import { Request } from 'express';
import { LastCursorInputFactory } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/last-cursor-input.factory';
import { LimitInputFactory } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/limit-input.factory';
import { OrderByInputFactory } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/order-by-input.factory';
import { FilterInputFactory } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-input.factory';
import { ApiRestQueryVariables } from 'src/core/api-rest/types/api-rest-query-variables.type';
import { LastCursorInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/last-cursor-input.factory';
import { LimitInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/limit-input.factory';
import { OrderByInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/order-by-input.factory';
import { FilterInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-input.factory';
import { ApiRestQueryVariables } from 'src/api/rest/types/api-rest-query-variables.type';
@Injectable()
export class GetVariablesFactory {

View File

@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing';
import { objectMetadataItem } from 'src/utils/utils-test/object-metadata-item';
import { FilterInputFactory } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-input.factory';
import { FilterInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-input.factory';
describe('FilterInputFactory', () => {
const objectMetadata = { objectMetadataItem: objectMetadataItem };

View File

@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing';
import { LastCursorInputFactory } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/last-cursor-input.factory';
import { LastCursorInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/last-cursor-input.factory';
describe('LastCursorInputFactory', () => {
let service: LastCursorInputFactory;

View File

@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing';
import { LimitInputFactory } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/limit-input.factory';
import { LimitInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/limit-input.factory';
describe('LimitInputFactory', () => {
let service: LimitInputFactory;

View File

@ -1,9 +1,9 @@
import { Test, TestingModule } from '@nestjs/testing';
import { OrderByDirection } from 'src/workspace/workspace-query-builder/interfaces/record.interface';
import { OrderByDirection } from 'src/engine/graphql/workspace-query-builder/interfaces/record.interface';
import { objectMetadataItem } from 'src/utils/utils-test/object-metadata-item';
import { OrderByInputFactory } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/order-by-input.factory';
import { OrderByInputFactory } from 'src/api/rest/api-rest-query-builder/factories/input-factories/order-by-input.factory';
describe('OrderByInputFactory', () => {
const objectMetadata = { objectMetadataItem: objectMetadataItem };

View File

@ -0,0 +1,25 @@
import { Injectable } from '@nestjs/common';
import { Request } from 'express';
import { addDefaultConjunctionIfMissing } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/add-default-conjunction.utils';
import { checkFilterQuery } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/check-filter-query.utils';
import { parseFilter } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter.utils';
import { FieldValue } from 'src/api/rest/types/api-rest-field-value.type';
@Injectable()
export class FilterInputFactory {
create(request: Request, objectMetadata): Record<string, FieldValue> {
let filterQuery = request.query.filter;
if (typeof filterQuery !== 'string') {
return {};
}
checkFilterQuery(filterQuery);
filterQuery = addDefaultConjunctionIfMissing(filterQuery);
return parseFilter(filterQuery, objectMetadata.objectMetadataItem);
}
}

View File

@ -1,4 +1,4 @@
import { addDefaultConjunctionIfMissing } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/add-default-conjunction.utils';
import { addDefaultConjunctionIfMissing } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/add-default-conjunction.utils';
describe('addDefaultConjunctionIfMissing', () => {
it('should add default conjunction if missing', () => {

View File

@ -1,4 +1,4 @@
import { checkFilterQuery } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/check-filter-query.utils';
import { checkFilterQuery } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/check-filter-query.utils';
describe('checkFilterQuery', () => {
it('should check filter query', () => {

View File

@ -1,5 +1,5 @@
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { formatFieldValue } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/format-field-values.utils';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { formatFieldValue } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/format-field-values.utils';
describe('formatFieldValue', () => {
it('should format fieldNumber value', () => {

View File

@ -1,4 +1,4 @@
import { parseBaseFilter } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-base-filter.utils';
import { parseBaseFilter } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-base-filter.utils';
describe('parseBaseFilter', () => {
it('should parse simple filter string test 1', () => {

View File

@ -1,4 +1,4 @@
import { parseFilterContent } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter-content.utils';
import { parseFilterContent } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter-content.utils';
describe('parseFilterContent', () => {
it('should parse query filter test 1', () => {

View File

@ -1,5 +1,5 @@
import { objectMetadataItem } from 'src/utils/utils-test/object-metadata-item';
import { parseFilter } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter.utils';
import { parseFilter } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter.utils';
describe('parseFilter', () => {
it('should parse string filter test 1', () => {

View File

@ -1,4 +1,4 @@
import { Conjunctions } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter.utils';
import { Conjunctions } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter.utils';
export const DEFAULT_CONJUNCTION = Conjunctions.and;

View File

@ -1,7 +1,7 @@
import { BadRequestException } from '@nestjs/common';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { FieldValue } from 'src/core/api-rest/types/api-rest-field-value.type';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { FieldValue } from 'src/api/rest/types/api-rest-field-value.type';
export const formatFieldValue = (
value: string,

View File

@ -1,13 +1,13 @@
import { BadRequestException } from '@nestjs/common';
import { parseFilterContent } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter-content.utils';
import { parseBaseFilter } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-base-filter.utils';
import { parseFilterContent } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-filter-content.utils';
import { parseBaseFilter } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/parse-base-filter.utils';
import {
checkFields,
getFieldType,
} from 'src/core/api-rest/api-rest-query-builder/utils/fields.utils';
import { formatFieldValue } from 'src/core/api-rest/api-rest-query-builder/factories/input-factories/filter-utils/format-field-values.utils';
import { FieldValue } from 'src/core/api-rest/types/api-rest-field-value.type';
} from 'src/api/rest/api-rest-query-builder/utils/fields.utils';
import { formatFieldValue } from 'src/api/rest/api-rest-query-builder/factories/input-factories/filter-utils/format-field-values.utils';
import { FieldValue } from 'src/api/rest/types/api-rest-field-value.type';
export enum Conjunctions {
or = 'or',

View File

@ -5,9 +5,9 @@ import { Request } from 'express';
import {
OrderByDirection,
RecordOrderBy,
} from 'src/workspace/workspace-query-builder/interfaces/record.interface';
} from 'src/engine/graphql/workspace-query-builder/interfaces/record.interface';
import { checkFields } from 'src/core/api-rest/api-rest-query-builder/utils/fields.utils';
import { checkFields } from 'src/api/rest/api-rest-query-builder/utils/fields.utils';
export const DEFAULT_ORDER_DIRECTION = OrderByDirection.AscNullsFirst;

View File

@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { capitalize } from 'src/utils/capitalize';
import { mapFieldMetadataToGraphqlQuery } from 'src/core/api-rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
import { mapFieldMetadataToGraphqlQuery } from 'src/api/rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
@Injectable()
export class UpdateQueryFactory {

View File

@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { ApiRestQueryVariables } from 'src/core/api-rest/types/api-rest-query-variables.type';
import { ApiRestQueryVariables } from 'src/api/rest/types/api-rest-query-variables.type';
@Injectable()
export class UpdateVariablesFactory {

View File

@ -1,4 +1,4 @@
import { computeDepth } from 'src/core/api-rest/api-rest-query-builder/utils/compute-depth.utils';
import { computeDepth } from 'src/api/rest/api-rest-query-builder/utils/compute-depth.utils';
describe('computeDepth', () => {
it('should compute depth from query', () => {

View File

@ -2,8 +2,8 @@ import { objectMetadataItem } from 'src/utils/utils-test/object-metadata-item';
import {
checkFields,
getFieldType,
} from 'src/core/api-rest/api-rest-query-builder/utils/fields.utils';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
} from 'src/api/rest/api-rest-query-builder/utils/fields.utils';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
describe('FieldUtils', () => {
describe('getFieldType', () => {

View File

@ -5,7 +5,7 @@ import {
fieldString,
objectMetadataItem,
} from 'src/utils/utils-test/object-metadata-item';
import { mapFieldMetadataToGraphqlQuery } from 'src/core/api-rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
import { mapFieldMetadataToGraphqlQuery } from 'src/api/rest/api-rest-query-builder/utils/map-field-metadata-to-graphql-query.utils';
describe('mapFieldMetadataToGraphqlQuery', () => {
it('should map properly', () => {

View File

@ -1,4 +1,4 @@
import { parsePath } from 'src/core/api-rest/api-rest-query-builder/utils/parse-path.utils';
import { parsePath } from 'src/api/rest/api-rest-query-builder/utils/parse-path.utils';
describe('parsePath', () => {
it('should parse object from request path', () => {

View File

@ -1,7 +1,7 @@
import { BadRequestException } from '@nestjs/common';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { computeObjectTargetTable } from 'src/workspace/utils/compute-object-target-table.util';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { computeObjectTargetTable } from 'src/engine-workspace/utils/compute-object-target-table.util';
export const getFieldType = (
objectMetadataItem,

View File

@ -1,5 +1,5 @@
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { RelationMetadataType } from 'src/engine-metadata/relation-metadata/relation-metadata.entity';
const DEFAULT_DEPTH_VALUE = 2;

View File

@ -2,8 +2,8 @@ import { Controller, Delete, Get, Post, Put, Req, Res } from '@nestjs/common';
import { Request, Response } from 'express';
import { ApiRestService } from 'src/core/api-rest/api-rest.service';
import { handleResult } from 'src/core/api-rest/api-rest.controller.utils';
import { ApiRestService } from 'src/api/rest/api-rest.service';
import { handleResult } from 'src/api/rest/api-rest.controller.utils';
@Controller('rest/*')
export class ApiRestController {

View File

@ -1,4 +1,4 @@
import { cleanGraphQLResponse } from 'src/core/api-rest/api-rest.controller.utils';
import { cleanGraphQLResponse } from 'src/api/rest/api-rest.controller.utils';
describe('cleanGraphQLResponse', () => {
it('should remove edges/node from results', () => {

View File

@ -1,6 +1,6 @@
import { Response } from 'express';
import { ApiRestResponse } from 'src/core/api-rest/types/api-rest-response.type';
import { ApiRestResponse } from 'src/api/rest/types/api-rest-response.type';
// https://gist.github.com/ManUtopiK/469aec75b655d6a4d912aeb3b75af3c9
export const cleanGraphQLResponse = (input) => {

View File

@ -0,0 +1,17 @@
import { Module } from '@nestjs/common';
import { HttpModule } from '@nestjs/axios';
import { ApiRestController } from 'src/api/rest/api-rest.controller';
import { ApiRestService } from 'src/api/rest/api-rest.service';
import { ApiRestQueryBuilderModule } from 'src/api/rest/api-rest-query-builder/api-rest-query-builder.module';
import { AuthModule } from 'src/engine/modules/auth/auth.module';
import { ApiRestMetadataController } from 'src/api/rest/metadata-rest.controller';
import { ApiRestMetadataService } from 'src/api/rest/metadata-rest.service';
@Module({
imports: [ApiRestQueryBuilderModule, AuthModule, HttpModule],
controllers: [ApiRestMetadataController, ApiRestController],
providers: [ApiRestMetadataService, ApiRestService],
exports: [ApiRestMetadataService],
})
export class ApiRestModule {}

View File

@ -1,10 +1,10 @@
import { Test, TestingModule } from '@nestjs/testing';
import { HttpService } from '@nestjs/axios';
import { ApiRestService } from 'src/core/api-rest/api-rest.service';
import { ApiRestService } from 'src/api/rest/api-rest.service';
import { EnvironmentService } from 'src/integrations/environment/environment.service';
import { TokenService } from 'src/core/auth/services/token.service';
import { ApiRestQueryBuilderFactory } from 'src/core/api-rest/api-rest-query-builder/api-rest-query-builder.factory';
import { TokenService } from 'src/engine/modules/auth/services/token.service';
import { ApiRestQueryBuilderFactory } from 'src/api/rest/api-rest-query-builder/api-rest-query-builder.factory';
describe('ApiRestService', () => {
let service: ApiRestService;

View File

@ -4,10 +4,10 @@ import { HttpService } from '@nestjs/axios';
import { Request } from 'express';
import { EnvironmentService } from 'src/integrations/environment/environment.service';
import { ApiRestQueryBuilderFactory } from 'src/core/api-rest/api-rest-query-builder/api-rest-query-builder.factory';
import { TokenService } from 'src/core/auth/services/token.service';
import { ApiRestResponse } from 'src/core/api-rest/types/api-rest-response.type';
import { ApiRestQuery } from 'src/core/api-rest/types/api-rest-query.type';
import { ApiRestQueryBuilderFactory } from 'src/api/rest/api-rest-query-builder/api-rest-query-builder.factory';
import { TokenService } from 'src/engine/modules/auth/services/token.service';
import { ApiRestResponse } from 'src/api/rest/types/api-rest-response.type';
import { ApiRestQuery } from 'src/api/rest/types/api-rest-query.type';
@Injectable()
export class ApiRestService {

View File

@ -2,8 +2,8 @@ import { Controller, Get, Delete, Post, Put, Req, Res } from '@nestjs/common';
import { Request, Response } from 'express';
import { handleResult } from 'src/core/api-rest/api-rest.controller.utils';
import { ApiRestMetadataService } from 'src/core/api-rest/metadata-rest.service';
import { handleResult } from 'src/api/rest/api-rest.controller.utils';
import { ApiRestMetadataService } from 'src/api/rest/metadata-rest.service';
@Controller('rest/metadata/*')
export class ApiRestMetadataController {

View File

@ -2,10 +2,10 @@ import { BadRequestException, Injectable } from '@nestjs/common';
import { HttpService } from '@nestjs/axios';
import { EnvironmentService } from 'src/integrations/environment/environment.service';
import { ApiRestQueryBuilderFactory } from 'src/core/api-rest/api-rest-query-builder/api-rest-query-builder.factory';
import { ApiRestQuery } from 'src/core/api-rest/types/api-rest-query.type';
import { TokenService } from 'src/core/auth/services/token.service';
import { parseMetadataPath } from 'src/core/api-rest/api-rest-query-builder/utils/parse-path.utils';
import { ApiRestQueryBuilderFactory } from 'src/api/rest/api-rest-query-builder/api-rest-query-builder.factory';
import { ApiRestQuery } from 'src/api/rest/types/api-rest-query.type';
import { TokenService } from 'src/engine/modules/auth/services/token.service';
import { parseMetadataPath } from 'src/api/rest/api-rest-query-builder/utils/parse-path.utils';
import { capitalize } from 'src/utils/capitalize';
@Injectable()

View File

@ -8,27 +8,32 @@ import { join } from 'path';
import { YogaDriver, YogaDriverConfig } from '@graphql-yoga/nestjs';
import { GraphQLConfigService } from 'src/graphql-config/graphql-config.service';
import { GraphQLConfigService } from 'src/engine-graphql-config/graphql-config.service';
import { ApiRestModule } from 'src/api/rest/api-rest.module';
import { BusinessModule } from 'src/business/modules/business.module';
import { CoreModule } from './core/core.module';
import { FoundationModule } from './engine/modules/foundation.module';
import { IntegrationsModule } from './integrations/integrations.module';
import { HealthModule } from './health/health.module';
import { WorkspaceModule } from './workspace/workspace.module';
import { GraphQLConfigModule } from './graphql-config/graphql-config.module';
import { WorkspaceModule } from './engine/graphql/workspace.module';
import { GraphQLConfigModule } from './engine-graphql-config/graphql-config.module';
@Module({
imports: [
// DevtoolsModule.register({
// http: process.env.NODE_ENV !== 'production',
// }),
ConfigModule.forRoot({
isGlobal: true,
}),
GraphQLModule.forRootAsync<YogaDriverConfig>({
driver: YogaDriver,
imports: [CoreModule, GraphQLConfigModule],
imports: [FoundationModule, GraphQLConfigModule],
useClass: GraphQLConfigService,
}),
HealthModule,
IntegrationsModule,
CoreModule,
FoundationModule,
BusinessModule,
ApiRestModule,
WorkspaceModule,
...AppModule.getConditionalModules(),
],

View File

@ -1,17 +1,17 @@
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { activityTargetStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { CustomObjectMetadata } from 'src/workspace/workspace-sync-metadata/custom-objects/custom.object-metadata';
import { DynamicRelationFieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/dynamic-field-metadata.interface';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { ActivityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity.object-metadata';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { activityTargetStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { CustomObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/custom-objects/custom.object-metadata';
import { DynamicRelationFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/dynamic-field-metadata.interface';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { ActivityObjectMetadata } from 'src/business/modules/activity/activity.object-metadata';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CompanyObjectMetadata } from 'src/business/modules/company/company.object-metadata';
import { OpportunityObjectMetadata } from 'src/business/modules/opportunity/opportunity.object-metadata';
import { PersonObjectMetadata } from 'src/business/modules/person/person.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.activityTarget,

View File

@ -1,17 +1,17 @@
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
import { activityStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
import { ActivityTargetObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity-target.object-metadata';
import { AttachmentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/attachment.object-metadata';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CommentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/comment.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { RelationMetadataType } from 'src/engine-metadata/relation-metadata/relation-metadata.entity';
import { activityStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { RelationMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/relation-metadata.decorator';
import { ActivityTargetObjectMetadata } from 'src/business/modules/activity/activity-target.object-metadata';
import { AttachmentObjectMetadata } from 'src/business/modules/attachment/attachment.object-metadata';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CommentObjectMetadata } from 'src/business/modules/comment/comment.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/business/modules/workspace/workspace-member.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.activity,

View File

@ -1,11 +1,11 @@
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { apiKeyStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { apiKeyStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.apiKey,

View File

@ -1,18 +1,18 @@
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { attachmentStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { CustomObjectMetadata } from 'src/workspace/workspace-sync-metadata/custom-objects/custom.object-metadata';
import { DynamicRelationFieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/dynamic-field-metadata.interface';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { ActivityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity.object-metadata';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { attachmentStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { CustomObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/custom-objects/custom.object-metadata';
import { DynamicRelationFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/dynamic-field-metadata.interface';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { ActivityObjectMetadata } from 'src/business/modules/activity/activity.object-metadata';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CompanyObjectMetadata } from 'src/business/modules/company/company.object-metadata';
import { OpportunityObjectMetadata } from 'src/business/modules/opportunity/opportunity.object-metadata';
import { PersonObjectMetadata } from 'src/business/modules/person/person.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/business/modules/workspace/workspace-member.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.attachment,

View File

@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { CalendarModule } from 'src/business/modules/calendar/calendar.module';
import { MessagingModule } from 'src/business/modules/message/messaging.module';
@Module({
imports: [MessagingModule, CalendarModule],
providers: [],
exports: [],
})
export class BusinessModule {}

View File

@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { BlocklistService } from 'src/business/modules/calendar-and-messaging/repositories/blocklist/blocklist.service';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
@Module({
imports: [WorkspaceDataSourceModule],
providers: [BlocklistService],
exports: [BlocklistService],
})
export class BlocklistModule {}

View File

@ -2,9 +2,9 @@ import { Injectable } from '@nestjs/common';
import { EntityManager } from 'typeorm';
import { WorkspaceDataSourceService } from 'src/workspace/workspace-datasource/workspace-datasource.service';
import { ObjectRecord } from 'src/workspace/workspace-sync-metadata/types/object-record';
import { BlocklistObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/blocklist.object-metadata';
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
import { BlocklistObjectMetadata } from 'src/business/modules/calendar/blocklist.object-metadata';
@Injectable()
export class BlocklistService {

View File

@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { ConnectedAccountService } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.service';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
@Module({
imports: [WorkspaceDataSourceModule],
providers: [ConnectedAccountService],
exports: [ConnectedAccountService],
})
export class ConnectedAccountModule {}

View File

@ -2,9 +2,9 @@ import { Injectable, NotFoundException } from '@nestjs/common';
import { EntityManager } from 'typeorm';
import { WorkspaceDataSourceService } from 'src/workspace/workspace-datasource/workspace-datasource.service';
import { ConnectedAccountObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/connected-account.object-metadata';
import { ObjectRecord } from 'src/workspace/workspace-sync-metadata/types/object-record';
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
import { ConnectedAccountObjectMetadata } from 'src/business/modules/connected-account/connected-account.object-metadata';
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
@Injectable()
export class ConnectedAccountService {

View File

@ -3,7 +3,7 @@ import { Injectable } from '@nestjs/common';
import axios from 'axios';
import { EnvironmentService } from 'src/integrations/environment/environment.service';
import { ConnectedAccountService } from 'src/workspace/calendar-and-messaging/repositories/connected-account/connected-account.service';
import { ConnectedAccountService } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.service';
@Injectable()
export class GoogleAPIsRefreshAccessTokenService {

View File

@ -0,0 +1,38 @@
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { blocklistStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/business/modules/workspace/workspace-member.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.blocklist,
namePlural: 'blocklists',
labelSingular: 'Blocklist',
labelPlural: 'Blocklists',
description: 'Blocklist',
icon: 'IconForbid2',
})
@IsSystem()
export class BlocklistObjectMetadata extends BaseObjectMetadata {
@FieldMetadata({
standardId: blocklistStandardFieldIds.handle,
type: FieldMetadataType.TEXT,
label: 'Handle',
description: 'Handle',
icon: 'IconAt',
})
handle: string;
@FieldMetadata({
standardId: blocklistStandardFieldIds.workspaceMember,
type: FieldMetadataType.RELATION,
label: 'WorkspaceMember',
description: 'WorkspaceMember',
icon: 'IconCircleUser',
joinColumn: 'workspaceMemberId',
})
workspaceMember: WorkspaceMemberObjectMetadata;
}

View File

@ -1,13 +1,13 @@
import { FeatureFlagKeys } from 'src/core/feature-flag/feature-flag.entity';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { calendarChannelEventAssociationStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/workspace/workspace-sync-metadata/decorators/gate.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CalendarEventObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event.object-metadata';
import { FeatureFlagKeys } from 'src/engine/modules/feature-flag/feature-flag.entity';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { calendarChannelEventAssociationStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CalendarEventObjectMetadata } from 'src/business/modules/calendar/calendar-event.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.calendarChannelEventAssociation,

View File

@ -1,19 +1,19 @@
import {
RelationMetadataType,
RelationOnDeleteAction,
} from 'src/metadata/relation-metadata/relation-metadata.entity';
import { FeatureFlagKeys } from 'src/core/feature-flag/feature-flag.entity';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { calendarChannelStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/workspace/workspace-sync-metadata/decorators/gate.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { ConnectedAccountObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/connected-account.object-metadata';
import { CalendarChannelEventAssociationObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-channel-event-association.object-metadata';
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
} from 'src/engine-metadata/relation-metadata/relation-metadata.entity';
import { FeatureFlagKeys } from 'src/engine/modules/feature-flag/feature-flag.entity';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { calendarChannelStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { ConnectedAccountObjectMetadata } from 'src/business/modules/connected-account/connected-account.object-metadata';
import { CalendarChannelEventAssociationObjectMetadata } from 'src/business/modules/calendar/calendar-channel-event-association.object-metadata';
import { RelationMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/relation-metadata.decorator';
export enum CalendarChannelVisibility {
METADATA = 'METADATA',

View File

@ -1,15 +1,15 @@
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { calendarEventAttendeeStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/workspace/workspace-sync-metadata/decorators/gate.decorator';
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CalendarEventObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event.object-metadata';
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { calendarEventAttendeeStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator';
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CalendarEventObjectMetadata } from 'src/business/modules/calendar/calendar-event.object-metadata';
import { PersonObjectMetadata } from 'src/business/modules/person/person.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/business/modules/workspace/workspace-member.object-metadata';
export enum CalendarEventAttendeeResponseStatus {
NEEDS_ACTION = 'NEEDS_ACTION',

View File

@ -1,20 +1,20 @@
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
import { FeatureFlagKeys } from 'src/core/feature-flag/feature-flag.entity';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { RelationMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/relation-metadata.decorator';
import { FeatureFlagKeys } from 'src/engine/modules/feature-flag/feature-flag.entity';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import {
RelationMetadataType,
RelationOnDeleteAction,
} from 'src/metadata/relation-metadata/relation-metadata.entity';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/workspace/workspace-sync-metadata/decorators/gate.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CalendarChannelEventAssociationObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-channel-event-association.object-metadata';
import { CalendarEventAttendeeObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event-attendee.object-metadata';
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { calendarEventStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
} from 'src/engine-metadata/relation-metadata/relation-metadata.entity';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CalendarChannelEventAssociationObjectMetadata } from 'src/business/modules/calendar/calendar-channel-event-association.object-metadata';
import { CalendarEventAttendeeObjectMetadata } from 'src/business/modules/calendar/calendar-event-attendee.object-metadata';
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { calendarEventStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
@ObjectMetadata({
standardId: standardObjectIds.calendarEvent,

View File

@ -0,0 +1,41 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { FeatureFlagEntity } from 'src/engine/modules/feature-flag/feature-flag.entity';
import { EnvironmentModule } from 'src/integrations/environment/environment.module';
import { CreateCompaniesAndContactsModule } from 'src/engine-workspace/auto-companies-and-contacts-creation/create-company-and-contact/create-company-and-contact.module';
import { BlocklistModule } from 'src/business/modules/calendar-and-messaging/repositories/blocklist/blocklist.module';
import { ConnectedAccountModule } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.module';
import { CalendarChannelEventAssociationModule } from 'src/business/modules/calendar/repositories/calendar-channel-event-association/calendar-channel-event-assocation.module';
import { CalendarChannelModule } from 'src/business/modules/calendar/repositories/calendar-channel/calendar-channel.module';
import { CalendarEventAttendeeModule } from 'src/business/modules/calendar/repositories/calendar-event-attendee/calendar-event-attendee.module';
import { CalendarEventModule } from 'src/business/modules/calendar/repositories/calendar-event/calendar-event.module';
import { CalendarEventCleanerModule } from 'src/business/modules/calendar/services/calendar-event-cleaner/calendar-event-cleaner.module';
import { GoogleCalendarFullSyncService } from 'src/business/modules/calendar/services/google-calendar-full-sync.service';
import { GoogleCalendarClientProvider } from 'src/business/modules/calendar/services/providers/google-calendar/google-calendar.provider';
import { CompanyModule } from 'src/business/modules/message/repositories/company/company.module';
import { PersonModule } from 'src/engine-workspace/repositories/person/person.module';
import { WorkspaceMemberModule } from 'src/engine-workspace/repositories/workspace-member/workspace-member.module';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
@Module({
imports: [
EnvironmentModule,
WorkspaceDataSourceModule,
ConnectedAccountModule,
CalendarChannelModule,
CalendarChannelEventAssociationModule,
CalendarEventModule,
CalendarEventAttendeeModule,
CreateCompaniesAndContactsModule,
WorkspaceMemberModule,
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
CompanyModule,
PersonModule,
BlocklistModule,
CalendarEventCleanerModule,
],
providers: [GoogleCalendarFullSyncService, GoogleCalendarClientProvider],
exports: [GoogleCalendarFullSyncService],
})
export class CalendarModule {}

View File

@ -4,11 +4,11 @@ import { Command, CommandRunner, Option } from 'nest-commander';
import { MessageQueue } from 'src/integrations/message-queue/message-queue.constants';
import { MessageQueueService } from 'src/integrations/message-queue/services/message-queue.service';
import { ConnectedAccountService } from 'src/workspace/calendar-and-messaging/repositories/connected-account/connected-account.service';
import { ConnectedAccountService } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.service';
import {
GoogleCalendarFullSyncJobData,
GoogleCalendarFullSyncJob,
} from 'src/workspace/calendar/jobs/google-calendar-full-sync.job';
} from 'src/business/modules/calendar/jobs/google-calendar-full-sync.job';
interface GoogleCalendarFullSyncOptions {
workspaceId: string;

View File

@ -0,0 +1,19 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { FeatureFlagEntity } from 'src/engine/modules/feature-flag/feature-flag.entity';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { DataSourceModule } from 'src/engine-metadata/data-source/data-source.module';
import { ConnectedAccountModule } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.module';
import { GoogleCalendarFullSyncCommand } from 'src/business/modules/calendar/commands/google-calendar-full-sync.command';
@Module({
imports: [
DataSourceModule,
TypeORMModule,
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
ConnectedAccountModule,
],
providers: [GoogleCalendarFullSyncCommand],
})
export class WorkspaceCalendarSyncCommandsModule {}

View File

@ -2,8 +2,8 @@ import { Injectable, Logger } from '@nestjs/common';
import { MessageQueueJob } from 'src/integrations/message-queue/interfaces/message-queue-job.interface';
import { GoogleAPIsRefreshAccessTokenService } from 'src/workspace/calendar-and-messaging/services/google-apis-refresh-access-token.service';
import { GoogleCalendarFullSyncService } from 'src/workspace/calendar/services/google-calendar-full-sync.service';
import { GoogleAPIsRefreshAccessTokenService } from 'src/business/modules/calendar-and-messaging/services/google-apis-refresh-access-token.service';
import { GoogleCalendarFullSyncService } from 'src/business/modules/calendar/services/google-calendar-full-sync.service';
export type GoogleCalendarFullSyncJobData = {
workspaceId: string;

View File

@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { CalendarChannelEventAssociationService } from 'src/business/modules/calendar/repositories/calendar-channel-event-association/calendar-channel-event-association.service';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
@Module({
imports: [WorkspaceDataSourceModule],
providers: [CalendarChannelEventAssociationService],
exports: [CalendarChannelEventAssociationService],
})
export class CalendarChannelEventAssociationModule {}

View File

@ -2,10 +2,10 @@ import { Injectable } from '@nestjs/common';
import { EntityManager } from 'typeorm';
import { WorkspaceDataSourceService } from 'src/workspace/workspace-datasource/workspace-datasource.service';
import { ObjectRecord } from 'src/workspace/workspace-sync-metadata/types/object-record';
import { CalendarChannelEventAssociationObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-channel-event-association.object-metadata';
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/workspace/calendar-and-messaging/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
import { CalendarChannelEventAssociationObjectMetadata } from 'src/business/modules/calendar/calendar-channel-event-association.object-metadata';
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/business/modules/calendar-and-messaging/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
@Injectable()
export class CalendarChannelEventAssociationService {

View File

@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { CalendarChannelService } from 'src/business/modules/calendar/repositories/calendar-channel/calendar-channel.service';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
@Module({
imports: [WorkspaceDataSourceModule],
providers: [CalendarChannelService],
exports: [CalendarChannelService],
})
export class CalendarChannelModule {}

View File

@ -2,9 +2,9 @@ import { Injectable } from '@nestjs/common';
import { EntityManager } from 'typeorm';
import { WorkspaceDataSourceService } from 'src/workspace/workspace-datasource/workspace-datasource.service';
import { CalendarChannelObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-channel.object-metadata';
import { ObjectRecord } from 'src/workspace/workspace-sync-metadata/types/object-record';
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
import { CalendarChannelObjectMetadata } from 'src/business/modules/calendar/calendar-channel.object-metadata';
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
@Injectable()
export class CalendarChannelService {

View File

@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { CalendarEventAttendeeService } from 'src/business/modules/calendar/repositories/calendar-event-attendee/calendar-event-attendee.service';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
@Module({
imports: [WorkspaceDataSourceModule],
providers: [CalendarEventAttendeeService],
exports: [CalendarEventAttendeeService],
})
export class CalendarEventAttendeeModule {}

View File

@ -2,11 +2,11 @@ import { Injectable } from '@nestjs/common';
import { EntityManager } from 'typeorm';
import { WorkspaceDataSourceService } from 'src/workspace/workspace-datasource/workspace-datasource.service';
import { ObjectRecord } from 'src/workspace/workspace-sync-metadata/types/object-record';
import { CalendarEventAttendeeObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event-attendee.object-metadata';
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/workspace/calendar-and-messaging/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
import { CalendarEventAttendee } from 'src/workspace/calendar/types/calendar-event';
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
import { CalendarEventAttendeeObjectMetadata } from 'src/business/modules/calendar/calendar-event-attendee.object-metadata';
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/business/modules/calendar-and-messaging/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
import { CalendarEventAttendee } from 'src/business/modules/calendar/types/calendar-event';
@Injectable()
export class CalendarEventAttendeeService {

View File

@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { CalendarEventService } from 'src/business/modules/calendar/repositories/calendar-event/calendar-event.service';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
@Module({
imports: [WorkspaceDataSourceModule],
providers: [CalendarEventService],
exports: [CalendarEventService],
})
export class CalendarEventModule {}

View File

@ -2,12 +2,12 @@ import { Injectable } from '@nestjs/common';
import { EntityManager } from 'typeorm';
import { WorkspaceDataSourceService } from 'src/workspace/workspace-datasource/workspace-datasource.service';
import { ObjectRecord } from 'src/workspace/workspace-sync-metadata/types/object-record';
import { CalendarEventObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event.object-metadata';
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/workspace/calendar-and-messaging/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
import { CalendarEvent } from 'src/workspace/calendar/types/calendar-event';
import { CalendarEventAttendeeObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event-attendee.object-metadata';
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
import { CalendarEventObjectMetadata } from 'src/business/modules/calendar/calendar-event.object-metadata';
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/business/modules/calendar-and-messaging/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
import { CalendarEvent } from 'src/business/modules/calendar/types/calendar-event';
import { CalendarEventAttendeeObjectMetadata } from 'src/business/modules/calendar/calendar-event-attendee.object-metadata';
@Injectable()
export class CalendarEventService {

View File

@ -0,0 +1,13 @@
import { Module } from '@nestjs/common';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { DataSourceModule } from 'src/engine-metadata/data-source/data-source.module';
import { CalendarEventModule } from 'src/business/modules/calendar/repositories/calendar-event/calendar-event.module';
import { CalendarEventCleanerService } from 'src/business/modules/calendar/services/calendar-event-cleaner/calendar-event-cleaner.service';
@Module({
imports: [DataSourceModule, TypeORMModule, CalendarEventModule],
providers: [CalendarEventCleanerService],
exports: [CalendarEventCleanerService],
})
export class CalendarEventCleanerModule {}

View File

@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { CalendarEventService } from 'src/workspace/calendar/repositories/calendar-event/calendar-event.service';
import { deleteUsingPagination } from 'src/workspace/messaging/services/thread-cleaner/utils/delete-using-pagination.util';
import { CalendarEventService } from 'src/business/modules/calendar/repositories/calendar-event/calendar-event.service';
import { deleteUsingPagination } from 'src/business/modules/message/services/thread-cleaner/utils/delete-using-pagination.util';
@Injectable()
export class CalendarEventCleanerService {

View File

@ -3,23 +3,23 @@ import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { ConnectedAccountService } from 'src/workspace/calendar-and-messaging/repositories/connected-account/connected-account.service';
import { BlocklistService } from 'src/workspace/calendar-and-messaging/repositories/blocklist/blocklist.service';
import { ConnectedAccountService } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.service';
import { BlocklistService } from 'src/business/modules/calendar-and-messaging/repositories/blocklist/blocklist.service';
import {
FeatureFlagEntity,
FeatureFlagKeys,
} from 'src/core/feature-flag/feature-flag.entity';
import { GoogleCalendarClientProvider } from 'src/workspace/calendar/services/providers/google-calendar/google-calendar.provider';
import { googleCalendarSearchFilterExcludeEmails } from 'src/workspace/calendar/utils/google-calendar-search-filter.util';
import { CalendarChannelEventAssociationService } from 'src/workspace/calendar/repositories/calendar-channel-event-association/calendar-channel-event-association.service';
import { CalendarChannelService } from 'src/workspace/calendar/repositories/calendar-channel/calendar-channel.service';
} from 'src/engine/modules/feature-flag/feature-flag.entity';
import { GoogleCalendarClientProvider } from 'src/business/modules/calendar/services/providers/google-calendar/google-calendar.provider';
import { googleCalendarSearchFilterExcludeEmails } from 'src/business/modules/calendar/utils/google-calendar-search-filter.util';
import { CalendarChannelEventAssociationService } from 'src/business/modules/calendar/repositories/calendar-channel-event-association/calendar-channel-event-association.service';
import { CalendarChannelService } from 'src/business/modules/calendar/repositories/calendar-channel/calendar-channel.service';
import { MessageQueue } from 'src/integrations/message-queue/message-queue.constants';
import { MessageQueueService } from 'src/integrations/message-queue/services/message-queue.service';
import { WorkspaceDataSourceService } from 'src/workspace/workspace-datasource/workspace-datasource.service';
import { CalendarEventService } from 'src/workspace/calendar/repositories/calendar-event/calendar-event.service';
import { formatGoogleCalendarEvent } from 'src/workspace/calendar/utils/format-google-calendar-event.util';
import { GoogleCalendarFullSyncJobData } from 'src/workspace/calendar/jobs/google-calendar-full-sync.job';
import { CalendarEventAttendeeService } from 'src/workspace/calendar/repositories/calendar-event-attendee/calendar-event-attendee.service';
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
import { CalendarEventService } from 'src/business/modules/calendar/repositories/calendar-event/calendar-event.service';
import { formatGoogleCalendarEvent } from 'src/business/modules/calendar/utils/format-google-calendar-event.util';
import { GoogleCalendarFullSyncJobData } from 'src/business/modules/calendar/jobs/google-calendar-full-sync.job';
import { CalendarEventAttendeeService } from 'src/business/modules/calendar/repositories/calendar-event-attendee/calendar-event-attendee.service';
@Injectable()
export class GoogleCalendarFullSyncService {

View File

@ -1,7 +1,7 @@
import { Module } from '@nestjs/common';
import { EnvironmentModule } from 'src/integrations/environment/environment.module';
import { GoogleCalendarClientProvider } from 'src/workspace/calendar/services/providers/google-calendar/google-calendar.provider';
import { GoogleCalendarClientProvider } from 'src/business/modules/calendar/services/providers/google-calendar/google-calendar.provider';
@Module({
imports: [EnvironmentModule],

View File

@ -1,6 +1,6 @@
import { CalendarEventAttendeeObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event-attendee.object-metadata';
import { CalendarEventObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event.object-metadata';
import { ObjectRecord } from 'src/workspace/workspace-sync-metadata/types/object-record';
import { CalendarEventAttendeeObjectMetadata } from 'src/business/modules/calendar/calendar-event-attendee.object-metadata';
import { CalendarEventObjectMetadata } from 'src/business/modules/calendar/calendar-event.object-metadata';
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
export type CalendarEvent = Omit<
ObjectRecord<CalendarEventObjectMetadata>,

View File

@ -1,8 +1,8 @@
import { calendar_v3 } from 'googleapis';
import { v4 } from 'uuid';
import { CalendarEventWithAttendees } from 'src/workspace/calendar/types/calendar-event';
import { CalendarEventAttendeeResponseStatus } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-event-attendee.object-metadata';
import { CalendarEventWithAttendees } from 'src/business/modules/calendar/types/calendar-event';
import { CalendarEventAttendeeResponseStatus } from 'src/business/modules/calendar/calendar-event-attendee.object-metadata';
export const formatGoogleCalendarEvent = (
event: calendar_v3.Schema$Event,

View File

@ -0,0 +1,49 @@
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { commentStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { ActivityObjectMetadata } from 'src/business/modules/activity/activity.object-metadata';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/business/modules/workspace/workspace-member.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.comment,
namePlural: 'comments',
labelSingular: 'Comment',
labelPlural: 'Comments',
description: 'A comment',
icon: 'IconMessageCircle',
})
@IsSystem()
export class CommentObjectMetadata extends BaseObjectMetadata {
@FieldMetadata({
standardId: commentStandardFieldIds.body,
type: FieldMetadataType.TEXT,
label: 'Body',
description: 'Comment body',
icon: 'IconLink',
})
body: string;
@FieldMetadata({
standardId: commentStandardFieldIds.author,
type: FieldMetadataType.RELATION,
label: 'Author',
description: 'Comment author',
icon: 'IconCircleUser',
joinColumn: 'authorId',
})
author: WorkspaceMemberObjectMetadata;
@FieldMetadata({
standardId: commentStandardFieldIds.activity,
type: FieldMetadataType.RELATION,
label: 'Activity',
description: 'Comment activity',
icon: 'IconNotes',
joinColumn: 'activityId',
})
activity: ActivityObjectMetadata;
}

View File

@ -1,24 +1,24 @@
import { CurrencyMetadata } from 'src/metadata/field-metadata/composite-types/currency.composite-type';
import { LinkMetadata } from 'src/metadata/field-metadata/composite-types/link.composite-type';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { CurrencyMetadata } from 'src/engine-metadata/field-metadata/composite-types/currency.composite-type';
import { LinkMetadata } from 'src/engine-metadata/field-metadata/composite-types/link.composite-type';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import {
RelationMetadataType,
RelationOnDeleteAction,
} from 'src/metadata/relation-metadata/relation-metadata.entity';
import { companyStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
import { ActivityTargetObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity-target.object-metadata';
import { AttachmentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/attachment.object-metadata';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
} from 'src/engine-metadata/relation-metadata/relation-metadata.entity';
import { companyStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { RelationMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/relation-metadata.decorator';
import { ActivityTargetObjectMetadata } from 'src/business/modules/activity/activity-target.object-metadata';
import { AttachmentObjectMetadata } from 'src/business/modules/attachment/attachment.object-metadata';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { FavoriteObjectMetadata } from 'src/business/modules/favorite/favorite.object-metadata';
import { OpportunityObjectMetadata } from 'src/business/modules/opportunity/opportunity.object-metadata';
import { PersonObjectMetadata } from 'src/business/modules/person/person.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/business/modules/workspace/workspace-member.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.company,

View File

@ -1,20 +1,20 @@
import { FeatureFlagKeys } from 'src/core/feature-flag/feature-flag.entity';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { FeatureFlagKeys } from 'src/engine/modules/feature-flag/feature-flag.entity';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import {
RelationMetadataType,
RelationOnDeleteAction,
} from 'src/metadata/relation-metadata/relation-metadata.entity';
import { connectedAccountStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/workspace/workspace-sync-metadata/decorators/gate.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CalendarChannelObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/calendar-channel.object-metadata';
import { MessageChannelObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-channel.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
} from 'src/engine-metadata/relation-metadata/relation-metadata.entity';
import { connectedAccountStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { RelationMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/relation-metadata.decorator';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CalendarChannelObjectMetadata } from 'src/business/modules/calendar/calendar-channel.object-metadata';
import { MessageChannelObjectMetadata } from 'src/business/modules/message/message-channel.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/business/modules/workspace/workspace-member.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.connectedAccount,

View File

@ -1,17 +1,17 @@
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import { favoriteStandardFieldIds } from 'src/workspace/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/workspace/workspace-sync-metadata/constants/standard-object-ids';
import { CustomObjectMetadata } from 'src/workspace/workspace-sync-metadata/custom-objects/custom.object-metadata';
import { DynamicRelationFieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/dynamic-field-metadata.interface';
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
import { FieldMetadataType } from 'src/engine-metadata/field-metadata/field-metadata.entity';
import { favoriteStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { CustomObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/custom-objects/custom.object-metadata';
import { DynamicRelationFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/dynamic-field-metadata.interface';
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator';
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
import { CompanyObjectMetadata } from 'src/business/modules/company/company.object-metadata';
import { OpportunityObjectMetadata } from 'src/business/modules/opportunity/opportunity.object-metadata';
import { PersonObjectMetadata } from 'src/business/modules/person/person.object-metadata';
import { WorkspaceMemberObjectMetadata } from 'src/business/modules/workspace/workspace-member.object-metadata';
@ObjectMetadata({
standardId: standardObjectIds.favorite,

View File

@ -7,13 +7,13 @@ import { MessageQueueJob } from 'src/integrations/message-queue/interfaces/messa
import { MessageQueue } from 'src/integrations/message-queue/message-queue.constants';
import { MessageQueueService } from 'src/integrations/message-queue/services/message-queue.service';
import { ConnectedAccountService } from 'src/workspace/calendar-and-messaging/repositories/connected-account/connected-account.service';
import { Workspace } from 'src/core/workspace/workspace.entity';
import { ConnectedAccountService } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.service';
import { Workspace } from 'src/engine/modules/workspace/workspace.entity';
import {
GmailPartialSyncJobData,
GmailPartialSyncJob,
} from 'src/workspace/messaging/jobs/gmail-partial-sync.job';
import { DataSourceEntity } from 'src/metadata/data-source/data-source.entity';
} from 'src/business/modules/message/jobs/gmail-partial-sync.job';
import { DataSourceEntity } from 'src/engine-metadata/data-source/data-source.entity';
@Injectable()
export class FetchAllWorkspacesMessagesJob

View File

@ -0,0 +1,27 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { FeatureFlagEntity } from 'src/engine/modules/feature-flag/feature-flag.entity';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { DataSourceModule } from 'src/engine-metadata/data-source/data-source.module';
import { GmailFullSyncCommand } from 'src/business/modules/message/commands/gmail-full-sync.command';
import { GmailPartialSyncCommand } from 'src/business/modules/message/commands/gmail-partial-sync.command';
import { ConnectedAccountModule } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.module';
import { StartFetchAllWorkspacesMessagesCronCommand } from 'src/business/modules/message/commands/start-fetch-all-workspaces-messages.cron.command';
import { StopFetchAllWorkspacesMessagesCronCommand } from 'src/business/modules/message/commands/stop-fetch-all-workspaces-messages.cron.command';
@Module({
imports: [
DataSourceModule,
TypeORMModule,
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
ConnectedAccountModule,
],
providers: [
GmailFullSyncCommand,
GmailPartialSyncCommand,
StartFetchAllWorkspacesMessagesCronCommand,
StopFetchAllWorkspacesMessagesCronCommand,
],
})
export class FetchWorkspaceMessagesCommandsModule {}

View File

@ -7,8 +7,8 @@ import { MessageQueueService } from 'src/integrations/message-queue/services/mes
import {
GmailFullSyncJobData,
GmailFullSyncJob,
} from 'src/workspace/messaging/jobs/gmail-full-sync.job';
import { ConnectedAccountService } from 'src/workspace/calendar-and-messaging/repositories/connected-account/connected-account.service';
} from 'src/business/modules/message/jobs/gmail-full-sync.job';
import { ConnectedAccountService } from 'src/business/modules/calendar-and-messaging/repositories/connected-account/connected-account.service';
interface GmailFullSyncOptions {
workspaceId: string;

Some files were not shown because too many files have changed in this diff Show More