mirror of
https://github.com/lingble/twenty.git
synced 2025-11-25 18:34:56 +00:00
Fix CIs (#3004)
* 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:
6
.github/workflows/ci-docs.yaml
vendored
6
.github/workflows/ci-docs.yaml
vendored
@@ -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
|
||||||
|
|||||||
102
.github/workflows/ci-front.yaml
vendored
102
.github/workflows/ci-front.yaml
vendored
@@ -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
|
||||||
24
.github/workflows/ci-server.yaml
vendored
24
.github/workflows/ci-server.yaml
vendored
@@ -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
|
||||||
|
|||||||
2
.github/workflows/ci-utils.yaml
vendored
2
.github/workflows/ci-utils.yaml
vendored
@@ -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:
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
BIN
packages/eslint-plugin-twenty/eslint-plugin-twenty.tgz
Normal file
BIN
packages/eslint-plugin-twenty/eslint-plugin-twenty.tgz
Normal file
Binary file not shown.
@@ -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": [],
|
||||||
|
|||||||
@@ -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
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ export class DataSeedWorkspaceCommand extends CommandRunner {
|
|||||||
|
|
||||||
await dataSource.destroy();
|
await dataSource.destroy();
|
||||||
|
|
||||||
const schemaName = await this.workspaceDataSourceService.createWorkspaceDBSchema(
|
const schemaName =
|
||||||
|
await this.workspaceDataSourceService.createWorkspaceDBSchema(
|
||||||
this.workspaceId,
|
this.workspaceId,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -64,7 +65,6 @@ export class DataSeedWorkspaceCommand extends CommandRunner {
|
|||||||
dataSourceMetadata.id,
|
dataSourceMetadata.id,
|
||||||
this.workspaceId,
|
this.workspaceId,
|
||||||
);
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
@@ -85,7 +85,10 @@ 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,
|
||||||
@@ -99,13 +102,16 @@ export class DataSeedWorkspaceCommand extends CommandRunner {
|
|||||||
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);
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|||||||
@@ -10,11 +10,7 @@ export const seedViews = async (
|
|||||||
const createdViews = await workspaceDataSource
|
const createdViews = await workspaceDataSource
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.insert()
|
.insert()
|
||||||
.into(`${schemaName}.view`, [
|
.into(`${schemaName}.view`, ['name', 'objectMetadataId', 'type'])
|
||||||
'name',
|
|
||||||
'objectMetadataId',
|
|
||||||
'type',
|
|
||||||
])
|
|
||||||
.values([
|
.values([
|
||||||
{
|
{
|
||||||
name: 'All Companies',
|
name: 'All Companies',
|
||||||
@@ -187,7 +183,8 @@ export const seedViews = async (
|
|||||||
size: 150,
|
size: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId: objectMetadataMap['opportunity'].fields['pointOfContact'],
|
fieldMetadataId:
|
||||||
|
objectMetadataMap['opportunity'].fields['pointOfContact'],
|
||||||
viewId: viewIdMap['All Opportunities'],
|
viewId: viewIdMap['All Opportunities'],
|
||||||
position: 3,
|
position: 3,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
|
|||||||
@@ -51,4 +51,4 @@ export const currencyObjectDefinition = {
|
|||||||
export type CurrencyMetadata = {
|
export type CurrencyMetadata = {
|
||||||
amountMicros: number;
|
amountMicros: number;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -47,4 +47,4 @@ export const fullNameObjectDefinition = {
|
|||||||
export type FullNameMetadata = {
|
export type FullNameMetadata = {
|
||||||
firstName: string;
|
firstName: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -47,4 +47,4 @@ export const linkObjectDefinition = {
|
|||||||
export type LinkMetadata = {
|
export type LinkMetadata = {
|
||||||
label: string;
|
label: string;
|
||||||
url: string;
|
url: string;
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
@@ -90,13 +90,14 @@ export class WorkspaceMigrationFactory {
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
this.compositeDefinitions = new Map<string, CompositeFieldsDefinitionFunction>(
|
this.compositeDefinitions = new Map<
|
||||||
[
|
string,
|
||||||
|
CompositeFieldsDefinitionFunction
|
||||||
|
>([
|
||||||
[FieldMetadataType.LINK, linkFields],
|
[FieldMetadataType.LINK, linkFields],
|
||||||
[FieldMetadataType.CURRENCY, currencyFields],
|
[FieldMetadataType.CURRENCY, currencyFields],
|
||||||
[FieldMetadataType.FULL_NAME, fullNameFields],
|
[FieldMetadataType.FULL_NAME, fullNameFields],
|
||||||
],
|
]);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
createColumnActions(
|
createColumnActions(
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|||||||
@@ -61,5 +61,6 @@ export const convertStringifiedFieldsToJSON = (fieldMetadata) => {
|
|||||||
fieldMetadata.options as unknown as string,
|
fieldMetadata.options as unknown as string,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return fieldMetadata;
|
return fieldMetadata;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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
@@ -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
Reference in New Issue
Block a user