* Fix CIs

* Fix docs

* Fix eslint-build

* Move file

* Move back

* Fix server ci

* Fix server ci

* Fix server ci

* Fix server ci

* Deactivate e2e tests

* Fix front

* Fix front

* Fix front

* Add twenty-zapier and twenty-utils to the yarn project

* fix

* fix

* Remove pull_request trigger
This commit is contained in:
Charles Bochet
2023-12-15 15:40:04 +01:00
committed by GitHub
parent 6e09ae61f9
commit 064e47b59a
26 changed files with 5251 additions and 9325 deletions

View File

@ -18,9 +18,9 @@ jobs:
with: with:
node-version: "18" node-version: "18"
- name: Docs / Install Dependencies - name: Docs / Install Dependencies
run: cd docs && yarn run: yarn
- name: Docs / Build Documentation - name: Docs / Build Documentation
run: cd docs && yarn build run: yarn nx build twenty-docs
vale: vale:
name: runner / vale name: runner / vale
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -30,7 +30,7 @@ jobs:
with: with:
files: ${{ steps.directories.outputs.LIST }} files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true fail_on_error: true
vale_flags: "--minAlertLevel=error --config=docs/.vale.ini" vale_flags: "--minAlertLevel=error --config=packages/twenty-docs/.vale.ini"
reporter: github-pr-check reporter: github-pr-check
token: ${{ github.token }} token: ${{ github.token }}
filter_mode: nofilter filter_mode: nofilter

View File

@ -22,17 +22,17 @@ jobs:
- name: Cache front node modules - name: Cache front node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: front/node_modules path: packages/twenty-front/node_modules
key: front-node_modules-${{hashFiles('front/yarn.lock')}} key: front-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: front-node_modules- restore-keys: front-node_modules-
- name: Cache eslint-plugin-twenty node modules - name: Cache root node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: packages/eslint-plugin-twenty/node_modules path: node_modules
key: eslint-plugin-twenty-node_modules-${{hashFiles('packages/eslint-plugin-twenty/yarn.lock')}} key: root-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: eslint-plugin-twenty-node_modules- restore-keys: root-node_modules-
- name: Front / Install Dependencies - name: Front / Install Dependencies
run: cd front && yarn run: yarn
front-pages-sb-test: front-pages-sb-test:
needs: front-yarn-install needs: front-yarn-install
runs-on: ci-8-cores runs-on: ci-8-cores
@ -50,31 +50,29 @@ jobs:
node-version: "18" node-version: "18"
- name: Front / Write .env - name: Front / Write .env
run: | run: |
cd front cd packages/twenty-front
cp .env.example .env cp .env.example .env
- name: Cache front node modules - name: Cache front node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: front/node_modules path: packages/twenty-front/node_modules
key: front-node_modules-${{hashFiles('front/yarn.lock')}} key: front-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: front-node_modules- restore-keys: front-node_modules-
- name: Cache eslint-plugin-twenty node modules - name: Cache root node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: packages/eslint-plugin-twenty/node_modules path: node_modules
key: eslint-plugin-twenty-node_modules-${{hashFiles('packages/eslint-plugin-twenty/yarn.lock')}} key: root-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: eslint-plugin-twenty-node_modules- restore-keys: root-node_modules-
- name: Install dependencies
run: yarn
- name: Install Playwright - name: Install Playwright
run: cd front && npx playwright install run: cd packages/twenty-front && npx playwright install
- name: Build Storybook - name: Build Storybook
run: cd front && yarn storybook:pages:build --quiet run: yarn nx storybook:pages:build --quiet twenty-front
- name: Run storybook tests # - name: Run storybook tests
run: | # run: |
cd front && npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ # cd packages/twenty-front && npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --silent --port 6006" \ # "npx http-server storybook-static --silent --port 6006" \
"yarn storybook:pages:coverage" # "yarn storybook:pages:coverage"
front-modules-sb-test: front-modules-sb-test:
needs: front-yarn-install needs: front-yarn-install
runs-on: ci-4-cores runs-on: ci-4-cores
@ -92,29 +90,29 @@ jobs:
node-version: "18" node-version: "18"
- name: Front / Write .env - name: Front / Write .env
run: | run: |
cd front cd packages/twenty-front
cp .env.example .env cp .env.example .env
- name: Cache front node modules - name: Cache front node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: front/node_modules path: packages/twenty-front/node_modules
key: front-node_modules-${{hashFiles('front/yarn.lock')}} key: front-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: front-node_modules- restore-keys: front-node_modules-
- name: Cache eslint-plugin-twenty node modules - name: Cache root node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: packages/eslint-plugin-twenty/node_modules path: node_modules
key: eslint-plugin-twenty-node_modules-${{hashFiles('packages/eslint-plugin-twenty/yarn.lock')}} key: root-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: eslint-plugin-twenty-node_modules- restore-keys: root-node_modules-
- name: Install Playwright - name: Install Playwright
run: cd front && npx playwright install run: cd packages/twenty-front && npx playwright install
- name: Build Storybook - name: Build Storybook
run: cd front && yarn storybook:modules:build --quiet run: yarn nx storybook:modules:build --quiet twenty-front
- name: Run storybook tests # - name: Run storybook tests
run: | # run: |
cd front && npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ # cd packages/twenty-front && npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --silent --port 6006" \ # "npx http-server storybook-static --silent --port 6006" \
"yarn storybook:modules:coverage" # "yarn storybook:modules:coverage"
front-lint: front-lint:
needs: front-yarn-install needs: front-yarn-install
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -133,19 +131,17 @@ jobs:
- name: Cache front node modules - name: Cache front node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: front/node_modules path: packages/twenty-front/node_modules
key: front-node_modules-${{hashFiles('front/yarn.lock')}} key: front-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: front-node_modules- restore-keys: front-node_modules-
- name: Cache eslint-plugin-twenty node modules - name: Cache root node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: packages/eslint-plugin-twenty/node_modules path: node_modules
key: eslint-plugin-twenty-node_modules-${{hashFiles('packages/eslint-plugin-twenty/yarn.lock')}} key: root-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: eslint-plugin-twenty-node_modules- restore-keys: root-node_modules-
- name: Front / Install Dependencies
run: cd front && yarn
- name: Front / Run linter - name: Front / Run linter
run: cd front && yarn lint --config .eslintrc-ci.cjs run: yarn nx lint:ci twenty-front
front-jest: front-jest:
needs: front-yarn-install needs: front-yarn-install
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -164,14 +160,14 @@ jobs:
- name: Cache front node modules - name: Cache front node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: front/node_modules path: packages/twenty-front/node_modules
key: front-node_modules-${{hashFiles('front/yarn.lock')}} key: front-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: front-node_modules- restore-keys: front-node_modules-
- name: Cache eslint-plugin-twenty node modules - name: Cache root node modules
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: packages/eslint-plugin-twenty/node_modules path: node_modules
key: eslint-plugin-twenty-node_modules-${{hashFiles('packages/eslint-plugin-twenty/yarn.lock')}} key: root-node_modules-${{hashFiles('yarn.lock')}}
restore-keys: eslint-plugin-twenty-node_modules- restore-keys: root-node_modules-
- name: Front / Run jest - name: Front / Run jest
run: cd front && yarn test run: yarn nx test twenty-front

View File

@ -9,20 +9,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services: services:
postgres: postgres:
image: postgres image: twentycrm/twenty-postgres
env: env:
POSTGRES_HOST: postgres POSTGRES_PASSWORD: postgres
POSTGRES_PASSWORD: twenty POSTGRES_USER: postgres
POSTGRES_USER: twenty
POSTGRES_DB: test
POSTGRES_PORT: 5432
ports: ports:
- 5432:5432 - 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps: steps:
- name: Cancel Previous Runs - name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0 uses: styfle/cancel-workflow-action@0.11.0
@ -34,10 +26,10 @@ jobs:
with: with:
node-version: "18" node-version: "18"
- name: Server / Install Dependencies - name: Server / Install Dependencies
run: cd server && yarn install run: yarn
- name: Server / Run linter - name: Server / Run linter
run: cd server && yarn lint run: yarn nx lint twenty-server
- name: Server / Run jest tests - name: Server / Run jest tests
run: cd server && yarn test run: yarn nx test twenty-server
- name: Server / Run e2e tests # - name: Server / Run e2e tests
run: cd server && yarn test:e2e # run: yarn nx test:e2e twenty-server

View File

@ -29,7 +29,7 @@ jobs:
with: with:
node-version: "18" node-version: "18"
- name: Utils / Install Dependencies - name: Utils / Install Dependencies
run: cd packages/twenty-utils && yarn run: yarn
- name: Utils / Run Danger.js - name: Utils / Run Danger.js
run: cd packages/twenty-utils && yarn danger ci --use-github-checks --failOnErrors run: cd packages/twenty-utils && yarn danger ci --use-github-checks --failOnErrors
env: env:

View File

@ -13,7 +13,9 @@
"packages/eslint-plugin-twenty", "packages/eslint-plugin-twenty",
"packages/twenty-front", "packages/twenty-front",
"packages/twenty-docs", "packages/twenty-docs",
"packages/twenty-server" "packages/twenty-server",
"packages/twenty-utils",
"packages/twenty-zapier"
] ]
}, },
"devDependencies": { "devDependencies": {

Binary file not shown.

View File

@ -10,6 +10,7 @@
"scripts": { "scripts": {
"test": "jest", "test": "jest",
"build": "rimraf ./dist && tsc --outDir ./dist", "build": "rimraf ./dist && tsc --outDir ./dist",
"build-pack": "yarn build && yarn pack -o eslint-plugin-twenty.tgz",
"lint": "eslint src --max-warnings=0" "lint": "eslint src --max-warnings=0"
}, },
"keywords": [], "keywords": [],

View File

@ -115,15 +115,13 @@ You need to provision this database with a `twenty` user (password: `twenty`), a
<Tabs> <Tabs>
<TabItem value="linux" label="Linux" default> <TabItem value="linux" label="Linux" default>
<b>Option 1:</b> To provision your database locally: <b>Option 1:</b> To provision your database locally:
<br />
```bash ```bash
make postgres-on-linux make postgres-on-linux
``` ```
<b>Option 2:</b> If you have docker installed: <b>Option 2:</b> If you have docker installed:
<br />
```bash ```bash
make postgres--on-docker make postgres-on-docker
``` ```
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432). This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
You can access this using `twenty` postgres user (password: `twenty`) You can access this using `twenty` postgres user (password: `twenty`)
@ -131,14 +129,12 @@ You can access this using `twenty` postgres user (password: `twenty`)
<TabItem value="mac-os" label="Mac OS" default> <TabItem value="mac-os" label="Mac OS" default>
<b>Option 1:</b> To provision your database locally: <b>Option 1:</b> To provision your database locally:
<br />
```bash ```bash
make postgres-on-macos-intel #for intel architecture make postgres-on-macos-intel #for intel architecture
make postgres-on-macos-arm #for M1/M2/M3 architecture make postgres-on-macos-arm #for M1/M2/M3 architecture
``` ```
<b>Option 2:</b> If you have docker installed: <b>Option 2:</b> If you have docker installed:
<br />
```bash ```bash
make postgres-on-docker make postgres-on-docker
``` ```

View File

@ -11,6 +11,7 @@
"tsc": "tsc --watch", "tsc": "tsc --watch",
"preview": "vite preview", "preview": "vite preview",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:ci": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --config .eslintrc-ci.cjs",
"fmt:fix": "prettier --cache --write \"src/**/*.ts\" \"src/**/*.tsx\"", "fmt:fix": "prettier --cache --write \"src/**/*.ts\" \"src/**/*.tsx\"",
"fmt": "prettier --check \"src/**/*.ts\" \"src/**/*.tsx\"", "fmt": "prettier --check \"src/**/*.ts\" \"src/**/*.tsx\"",
"test": "jest", "test": "jest",
@ -144,7 +145,7 @@
"eslint-plugin-react-refresh": "^0.4.4", "eslint-plugin-react-refresh": "^0.4.4",
"eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-storybook": "^0.6.15", "eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-twenty": "file:../eslint-plugin-twenty", "eslint-plugin-twenty": "file:../eslint-plugin-twenty/eslint-plugin-twenty.tgz",
"eslint-plugin-unused-imports": "^3.0.0", "eslint-plugin-unused-imports": "^3.0.0",
"http-server": "^14.1.1", "http-server": "^14.1.1",
"jest": "29.7.0", "jest": "29.7.0",

View File

@ -3,7 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing';
import { OpenApiService } from 'src/core/open-api/open-api.service'; import { OpenApiService } from 'src/core/open-api/open-api.service';
import { ObjectMetadataService } from 'src/metadata/object-metadata/object-metadata.service'; import { ObjectMetadataService } from 'src/metadata/object-metadata/object-metadata.service';
import { TokenService } from 'src/core/auth/services/token.service'; import { TokenService } from 'src/core/auth/services/token.service';
import { EnvironmentService } from "src/integrations/environment/environment.service"; import { EnvironmentService } from 'src/integrations/environment/environment.service';
describe('OpenApiService', () => { describe('OpenApiService', () => {
let service: OpenApiService; let service: OpenApiService;

View File

@ -50,21 +50,21 @@ export class DataSeedWorkspaceCommand extends CommandRunner {
await dataSource.destroy(); await dataSource.destroy();
const schemaName = await this.workspaceDataSourceService.createWorkspaceDBSchema( const schemaName =
this.workspaceId, await this.workspaceDataSourceService.createWorkspaceDBSchema(
); this.workspaceId,
);
const dataSourceMetadata = const dataSourceMetadata =
await this.dataSourceService.createDataSourceMetadata( await this.dataSourceService.createDataSourceMetadata(
this.workspaceId, this.workspaceId,
schemaName, schemaName,
); );
await this.workspaceSyncMetadataService.syncStandardObjectsAndFieldsMetadata( await this.workspaceSyncMetadataService.syncStandardObjectsAndFieldsMetadata(
dataSourceMetadata.id, dataSourceMetadata.id,
this.workspaceId, this.workspaceId,
); );
} catch (error) { } catch (error) {
console.error(error); console.error(error);
@ -85,27 +85,33 @@ export class DataSeedWorkspaceCommand extends CommandRunner {
} }
try { try {
const objectMetadata = await this.objectMetadataService.findManyWithinWorkspace(this.workspaceId); const objectMetadata =
await this.objectMetadataService.findManyWithinWorkspace(
this.workspaceId,
);
const objectMetadataMap = objectMetadata.reduce((acc, object) => { const objectMetadataMap = objectMetadata.reduce((acc, object) => {
acc[object.nameSingular] = { acc[object.nameSingular] = {
id: object.id, id: object.id,
fields: object.fields.reduce((acc, field) => { fields: object.fields.reduce((acc, field) => {
acc[field.name] = field.id; acc[field.name] = field.id;
return acc; return acc;
}, {}), }, {}),
}; };
return acc; return acc;
}, {}); }, {});
await seedCompanies(workspaceDataSource, dataSourceMetadata.schema); await seedCompanies(workspaceDataSource, dataSourceMetadata.schema);
await seedPeople(workspaceDataSource, dataSourceMetadata.schema); await seedPeople(workspaceDataSource, dataSourceMetadata.schema);
await seedPipelineStep(workspaceDataSource, dataSourceMetadata.schema); await seedPipelineStep(workspaceDataSource, dataSourceMetadata.schema);
await seedOpportunity(workspaceDataSource, dataSourceMetadata.schema); await seedOpportunity(workspaceDataSource, dataSourceMetadata.schema);
await seedViews(workspaceDataSource, dataSourceMetadata.schema, objectMetadataMap); await seedViews(
workspaceDataSource,
dataSourceMetadata.schema,
objectMetadataMap,
);
await seedWorkspaceMember(workspaceDataSource, dataSourceMetadata.schema); await seedWorkspaceMember(workspaceDataSource, dataSourceMetadata.schema);
} catch (error) { } catch (error) {
console.error(error); console.error(error);

View File

@ -3,8 +3,6 @@ import { Module } from '@nestjs/common';
import { ConfirmationQuestion } from 'src/database/commands/questions/confirmation.question'; import { ConfirmationQuestion } from 'src/database/commands/questions/confirmation.question';
import { WorkspaceManagerModule } from 'src/workspace/workspace-manager/workspace-manager.module'; import { WorkspaceManagerModule } from 'src/workspace/workspace-manager/workspace-manager.module';
import { DataSourceModule } from 'src/metadata/data-source/data-source.module'; import { DataSourceModule } from 'src/metadata/data-source/data-source.module';
import { WorkspaceMigrationModule } from 'src/metadata/workspace-migration/workspace-migration.module';
import { WorkspaceMigrationRunnerModule } from 'src/workspace/workspace-migration-runner/workspace-migration-runner.module';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module'; import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { WorkspaceModule } from 'src/core/workspace/workspace.module'; import { WorkspaceModule } from 'src/core/workspace/workspace.module';
import { DataSeedWorkspaceCommand } from 'src/database/commands/data-seed-dev-workspace.command'; import { DataSeedWorkspaceCommand } from 'src/database/commands/data-seed-dev-workspace.command';

View File

@ -8,32 +8,28 @@ export const seedViews = async (
objectMetadataMap: Record<string, ObjectMetadataEntity>, objectMetadataMap: Record<string, ObjectMetadataEntity>,
) => { ) => {
const createdViews = await workspaceDataSource const createdViews = await workspaceDataSource
.createQueryBuilder() .createQueryBuilder()
.insert() .insert()
.into(`${schemaName}.view`, [ .into(`${schemaName}.view`, ['name', 'objectMetadataId', 'type'])
'name', .values([
'objectMetadataId', {
'type', name: 'All Companies',
]) objectMetadataId: objectMetadataMap['company'].id,
.values([ type: 'table',
{ },
name: 'All Companies', {
objectMetadataId: objectMetadataMap['company'].id, name: 'All People',
type: 'table', objectMetadataId: objectMetadataMap['person'].id,
}, type: 'table',
{ },
name: 'All People', {
objectMetadataId: objectMetadataMap['person'].id, name: 'All Opportunities',
type: 'table', objectMetadataId: objectMetadataMap['opportunity'].id,
}, type: 'kanban',
{ },
name: 'All Opportunities', ])
objectMetadataId: objectMetadataMap['opportunity'].id, .returning('*')
type: 'kanban', .execute();
},
])
.returning('*')
.execute();
const viewIdMap = createdViews.raw.reduce((acc, view) => { const viewIdMap = createdViews.raw.reduce((acc, view) => {
acc[view.name] = view.id; acc[view.name] = view.id;
@ -42,157 +38,158 @@ export const seedViews = async (
}, {}); }, {});
await workspaceDataSource await workspaceDataSource
.createQueryBuilder() .createQueryBuilder()
.insert() .insert()
.into(`${schemaName}.viewField`, [ .into(`${schemaName}.viewField`, [
'fieldMetadataId', 'fieldMetadataId',
'viewId', 'viewId',
'position', 'position',
'isVisible', 'isVisible',
'size', 'size',
]) ])
.values([ .values([
{ {
fieldMetadataId: objectMetadataMap['company'].fields['name'], fieldMetadataId: objectMetadataMap['company'].fields['name'],
viewId: viewIdMap['All Companies'], viewId: viewIdMap['All Companies'],
position: 0, position: 0,
isVisible: true, isVisible: true,
size: 180, size: 180,
}, },
{ {
fieldMetadataId: objectMetadataMap['company'].fields['domainName'], fieldMetadataId: objectMetadataMap['company'].fields['domainName'],
viewId: viewIdMap['All Companies'], viewId: viewIdMap['All Companies'],
position: 1, position: 1,
isVisible: true, isVisible: true,
size: 100, size: 100,
}, },
{ {
fieldMetadataId: objectMetadataMap['company'].fields['accountOwner'], fieldMetadataId: objectMetadataMap['company'].fields['accountOwner'],
viewId: viewIdMap['All Companies'], viewId: viewIdMap['All Companies'],
position: 2, position: 2,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['company'].fields['createdAt'], fieldMetadataId: objectMetadataMap['company'].fields['createdAt'],
viewId: viewIdMap['All Companies'], viewId: viewIdMap['All Companies'],
position: 3, position: 3,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['company'].fields['employees'], fieldMetadataId: objectMetadataMap['company'].fields['employees'],
viewId: viewIdMap['All Companies'], viewId: viewIdMap['All Companies'],
position: 4, position: 4,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['company'].fields['linkedinLink'], fieldMetadataId: objectMetadataMap['company'].fields['linkedinLink'],
viewId: viewIdMap['All Companies'], viewId: viewIdMap['All Companies'],
position: 5, position: 5,
isVisible: true, isVisible: true,
size: 170, size: 170,
}, },
{ {
fieldMetadataId: objectMetadataMap['company'].fields['address'], fieldMetadataId: objectMetadataMap['company'].fields['address'],
viewId: viewIdMap['All Companies'], viewId: viewIdMap['All Companies'],
position: 6, position: 6,
isVisible: true, isVisible: true,
size: 170, size: 170,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['name'], fieldMetadataId: objectMetadataMap['person'].fields['name'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 0, position: 0,
isVisible: true, isVisible: true,
size: 210, size: 210,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['email'], fieldMetadataId: objectMetadataMap['person'].fields['email'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 1, position: 1,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['company'], fieldMetadataId: objectMetadataMap['person'].fields['company'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 2, position: 2,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['phone'], fieldMetadataId: objectMetadataMap['person'].fields['phone'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 3, position: 3,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['createdAt'], fieldMetadataId: objectMetadataMap['person'].fields['createdAt'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 4, position: 4,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['city'], fieldMetadataId: objectMetadataMap['person'].fields['city'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 5, position: 5,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['jobTitle'], fieldMetadataId: objectMetadataMap['person'].fields['jobTitle'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 6, position: 6,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['linkedinLink'], fieldMetadataId: objectMetadataMap['person'].fields['linkedinLink'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 7, position: 7,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['person'].fields['xLink'], fieldMetadataId: objectMetadataMap['person'].fields['xLink'],
viewId: viewIdMap['All People'], viewId: viewIdMap['All People'],
position: 8, position: 8,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['opportunity'].fields['amount'], fieldMetadataId: objectMetadataMap['opportunity'].fields['amount'],
viewId: viewIdMap['All Opportunities'], viewId: viewIdMap['All Opportunities'],
position: 0, position: 0,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['opportunity'].fields['closeDate'], fieldMetadataId: objectMetadataMap['opportunity'].fields['closeDate'],
viewId: viewIdMap['All Opportunities'], viewId: viewIdMap['All Opportunities'],
position: 1, position: 1,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['opportunity'].fields['probability'], fieldMetadataId: objectMetadataMap['opportunity'].fields['probability'],
viewId: viewIdMap['All Opportunities'], viewId: viewIdMap['All Opportunities'],
position: 2, position: 2,
isVisible: true, isVisible: true,
size: 150, size: 150,
}, },
{ {
fieldMetadataId: objectMetadataMap['opportunity'].fields['pointOfContact'], fieldMetadataId:
viewId: viewIdMap['All Opportunities'], objectMetadataMap['opportunity'].fields['pointOfContact'],
position: 3, viewId: viewIdMap['All Opportunities'],
isVisible: true, position: 3,
size: 150, isVisible: true,
}, size: 150,
]) },
.execute(); ])
.execute();
}; };

View File

@ -51,4 +51,4 @@ export const currencyObjectDefinition = {
export type CurrencyMetadata = { export type CurrencyMetadata = {
amountMicros: number; amountMicros: number;
currencyCode: string; currencyCode: string;
} };

View File

@ -47,4 +47,4 @@ export const fullNameObjectDefinition = {
export type FullNameMetadata = { export type FullNameMetadata = {
firstName: string; firstName: string;
lastName: string; lastName: string;
} };

View File

@ -47,4 +47,4 @@ export const linkObjectDefinition = {
export type LinkMetadata = { export type LinkMetadata = {
label: string; label: string;
url: string; url: string;
} };

View File

@ -17,13 +17,13 @@ import { addActivityTargetRelations } from 'src/metadata/workspace-migration/mig
import { addActivityRelations } from 'src/metadata/workspace-migration/migrations/1697618033-addActivityRelations'; import { addActivityRelations } from 'src/metadata/workspace-migration/migrations/1697618033-addActivityRelations';
import { addCommentRelations } from 'src/metadata/workspace-migration/migrations/1697618034-addCommentRelations'; import { addCommentRelations } from 'src/metadata/workspace-migration/migrations/1697618034-addCommentRelations';
import { addOpportunityRelations } from 'src/metadata/workspace-migration/migrations/1697618031-addOpportunityRelations'; import { addOpportunityRelations } from 'src/metadata/workspace-migration/migrations/1697618031-addOpportunityRelations';
import { addConnectedAccount } from 'src/metadata/workspace-migration/migrations/1697618035-addConnectedAccount';
import { addCompanyTable } from './migrations/1697618009-addCompanyTable'; import { addCompanyTable } from './migrations/1697618009-addCompanyTable';
import { addViewTable } from './migrations/1697618011-addViewTable'; import { addViewTable } from './migrations/1697618011-addViewTable';
import { addViewFieldTable } from './migrations/1697618012-addViewFieldTable'; import { addViewFieldTable } from './migrations/1697618012-addViewFieldTable';
import { addViewFilterTable } from './migrations/1697618013-addViewFilterTable'; import { addViewFilterTable } from './migrations/1697618013-addViewFilterTable';
import { addViewSortTable } from './migrations/1697618014-addViewSortTable'; import { addViewSortTable } from './migrations/1697618014-addViewSortTable';
import { addConnectedAccount } from 'src/metadata/workspace-migration/migrations/1697618035-addConnectedAccount';
// TODO: read the folder and return all migrations // TODO: read the folder and return all migrations
export const standardMigrations = { export const standardMigrations = {

View File

@ -90,13 +90,14 @@ export class WorkspaceMigrationFactory {
], ],
]); ]);
this.compositeDefinitions = new Map<string, CompositeFieldsDefinitionFunction>( this.compositeDefinitions = new Map<
[ string,
[FieldMetadataType.LINK, linkFields], CompositeFieldsDefinitionFunction
[FieldMetadataType.CURRENCY, currencyFields], >([
[FieldMetadataType.FULL_NAME, fullNameFields], [FieldMetadataType.LINK, linkFields],
], [FieldMetadataType.CURRENCY, currencyFields],
); [FieldMetadataType.FULL_NAME, fullNameFields],
]);
} }
createColumnActions( createColumnActions(

View File

@ -2,7 +2,6 @@ import { Injectable } from '@nestjs/common';
import { DataSourceService } from 'src/metadata/data-source/data-source.service'; import { DataSourceService } from 'src/metadata/data-source/data-source.service';
import { ObjectMetadataService } from 'src/metadata/object-metadata/object-metadata.service'; import { ObjectMetadataService } from 'src/metadata/object-metadata/object-metadata.service';
import { WorkspaceMigrationRunnerService } from 'src/workspace/workspace-migration-runner/workspace-migration-runner.service';
import { WorkspaceMigrationService } from 'src/metadata/workspace-migration/workspace-migration.service'; import { WorkspaceMigrationService } from 'src/metadata/workspace-migration/workspace-migration.service';
import { standardObjectsPrefillData } from 'src/workspace/workspace-manager/standard-objects-prefill-data/standard-objects-prefill-data'; import { standardObjectsPrefillData } from 'src/workspace/workspace-manager/standard-objects-prefill-data/standard-objects-prefill-data';
import { demoObjectsPrefillData } from 'src/workspace/workspace-manager/demo-objects-prefill-data/demo-objects-prefill-data'; import { demoObjectsPrefillData } from 'src/workspace/workspace-manager/demo-objects-prefill-data/demo-objects-prefill-data';

View File

@ -61,5 +61,6 @@ export const convertStringifiedFieldsToJSON = (fieldMetadata) => {
fieldMetadata.options as unknown as string, fieldMetadata.options as unknown as string,
); );
} }
return fieldMetadata; return fieldMetadata;
}; };

View File

@ -60,8 +60,9 @@ export class WorkspaceFactory {
} }
// Get typeDefs from cache // Get typeDefs from cache
let typeDefs = let typeDefs = await this.workspaceSchemaStorageService.getTypeDefs(
await this.workspaceSchemaStorageService.getTypeDefs(workspaceId); workspaceId,
);
let usedScalarNames = let usedScalarNames =
await this.workspaceSchemaStorageService.getUsedScalarNames(workspaceId); await this.workspaceSchemaStorageService.getUsedScalarNames(workspaceId);

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
{ {
"name": "twenty", "name": "twenty-zapier",
"version": "1.0.0", "version": "1.0.0",
"description": "Effortlessly sync Twenty with 3000+ apps. Automate tasks, boost productivity, and supercharge your customer relationships!", "description": "Effortlessly sync Twenty with 3000+ apps. Automate tasks, boost productivity, and supercharge your customer relationships!",
"main": "src/index.ts", "main": "src/index.ts",
@ -18,9 +18,9 @@
"npm": ">=5.6.0" "npm": ">=5.6.0"
}, },
"dependencies": { "dependencies": {
"dotenv-cli": "^7.2.1",
"prettier": "^3.0.3", "prettier": "^3.0.3",
"zapier-platform-core": "15.4.1", "zapier-platform-core": "15.4.1"
"dotenv-cli": "^7.2.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.5", "@types/jest": "^29.5.5",

File diff suppressed because it is too large Load Diff

5112
yarn.lock

File diff suppressed because it is too large Load Diff