lint: migrate prettier to oxfmt (#20783)

Most changes are `implements` being unwrapped this is not a oxfmt
regression
Prettier in 3.7 (we're on 3.1) changed this behaviour prettier blog
[post](https://prettier.io/blog/2025/11/27/3.7.0#change-18094)

This unifies our linting tooling

---------

Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
neo773
2026-05-22 03:51:33 +05:30
committed by GitHub
parent e2ee4ffdff
commit 323e66433e
421 changed files with 1362 additions and 2042 deletions
+27
View File
@@ -0,0 +1,27 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "lf",
"printWidth": 80,
"sortPackageJson": false,
"ignorePatterns": [
"**/dist/**",
"**/build/**",
"**/lib/**",
"**/.next/**",
"**/coverage/**",
"**/generated/**",
"**/generated-admin/**",
"**/generated-metadata/**",
"**/.cache/**",
"**/node_modules/**",
"**/*.min.js",
"**/*.snap",
"**/*.md",
"**/*.mdx",
"**/seed-project/**/*.mjs",
"packages/twenty-zapier/build/**",
"**/upgrade-version-command/**"
]
}
+9 -13
View File
@@ -44,12 +44,12 @@
"cache": true,
"options": {
"cwd": "{projectRoot}",
"command": "npx oxlint -c .oxlintrc.json . && (prettier . --check --cache --cache-location ../../.cache/prettier/{projectRoot} --cache-strategy metadata || (echo 'ERROR: Prettier formatting check failed! Fix with: npx nx lint --configuration=fix' && false))"
"command": "npx oxlint -c .oxlintrc.json . && (npx oxfmt --check . || (echo 'ERROR: oxfmt formatting check failed! Fix with: npx nx lint --configuration=fix' && false))"
},
"configurations": {
"ci": {},
"fix": {
"command": "npx oxlint --fix -c .oxlintrc.json . && prettier . --write --cache --cache-location ../../.cache/prettier/{projectRoot} --cache-strategy metadata"
"command": "npx oxlint --fix -c .oxlintrc.json . && npx oxfmt ."
}
},
"dependsOn": ["^build", "twenty-oxlint-rules:build"]
@@ -59,12 +59,12 @@
"cache": false,
"dependsOn": ["twenty-oxlint-rules:build"],
"options": {
"command": "FILES=$(git diff --name-only --diff-filter=d main -- {projectRoot}/ | grep -E '{args.pattern}'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint -c {projectRoot}/.oxlintrc.json $FILES && (prettier --check $FILES || (echo 'ERROR: Prettier formatting check failed! Fix with: npx nx lint:diff-with-main --configuration=fix' && false)))",
"command": "FILES=$(git diff --name-only --diff-filter=d main -- {projectRoot}/ | grep -E '{args.pattern}'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint -c {projectRoot}/.oxlintrc.json $FILES && (npx oxfmt --check $FILES || (echo 'ERROR: oxfmt formatting check failed! Fix with: npx nx lint:diff-with-main --configuration=fix' && false)))",
"pattern": "\\.(ts|tsx|js|jsx)$"
},
"configurations": {
"fix": {
"command": "FILES=$(git diff --name-only --diff-filter=d main -- {projectRoot}/ | grep -E '{args.pattern}'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --fix -c {projectRoot}/.oxlintrc.json $FILES && prettier --write $FILES)"
"command": "FILES=$(git diff --name-only --diff-filter=d main -- {projectRoot}/ | grep -E '{args.pattern}'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --fix -c {projectRoot}/.oxlintrc.json $FILES && npx oxfmt $FILES)"
}
}
},
@@ -73,18 +73,14 @@
"cache": true,
"options": {
"cwd": "{projectRoot}",
"command": "prettier {args.files} --check --cache {args.cache} --cache-location {args.cacheLocation} --write {args.write} --cache-strategy {args.cacheStrategy}",
"cache": true,
"cacheLocation": "../../.cache/prettier/{projectRoot}",
"cacheStrategy": "metadata",
"write": false
"command": "npx oxfmt --check {args.files} {args.write}",
"files": ".",
"write": ""
},
"configurations": {
"ci": {
"cacheStrategy": "content"
},
"ci": {},
"fix": {
"write": true
"command": "npx oxfmt {args.files}"
}
},
"dependsOn": ["^build"]
+1
View File
@@ -13,6 +13,7 @@
"concurrently": "^8.2.2",
"http-server": "^14.1.1",
"nx": "22.5.4",
"oxfmt": "0.50.0",
"tsx": "^4.17.0",
"verdaccio": "^6.3.1"
},
+26 -14
View File
@@ -4,7 +4,10 @@
"ignorePatterns": ["node_modules", ".next", "storybook-static"],
"rules": {
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
"no-console": [
"warn",
{ "allow": ["group", "groupCollapsed", "groupEnd"] }
],
"no-control-regex": "off",
"no-debugger": "error",
"no-duplicate-imports": "error",
@@ -13,22 +16,31 @@
"no-redeclare": "off",
"import/no-duplicates": "error",
"typescript/no-redeclare": "error",
"typescript/consistent-type-imports": ["error", {
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}],
"typescript/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"typescript/explicit-function-return-type": "off",
"typescript/explicit-module-boundary-types": "off",
"typescript/no-empty-object-type": ["error", {
"allowInterfaces": "with-single-extends"
}],
"typescript/no-empty-object-type": [
"error",
{
"allowInterfaces": "with-single-extends"
}
],
"typescript/no-empty-function": "off",
"typescript/no-explicit-any": "off",
"typescript/no-unused-vars": ["warn", {
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}]
"typescript/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
]
}
}
+6 -6
View File
@@ -12,8 +12,8 @@
opacity: 0.85 !important;
}
:is(.dark, [data-theme="dark"]) #topbar-cta-button a,
:is(.dark, [data-theme="dark"]) #topbar-cta-button a span {
:is(.dark, [data-theme='dark']) #topbar-cta-button a,
:is(.dark, [data-theme='dark']) #topbar-cta-button a span {
background-color: #ffffff !important;
color: #141414 !important;
}
@@ -35,14 +35,14 @@
* We use :has() to scope the rule to only the sidebar group that contains
* the developers/introduction link, so other tabs are unaffected.
*/
div:has(> .sidebar-group a[href="/developers/introduction"]),
div:has(> .sidebar-group a[href="/user-guide/introduction"]) {
div:has(> .sidebar-group a[href='/developers/introduction']),
div:has(> .sidebar-group a[href='/user-guide/introduction']) {
display: none;
}
/* Remove the top margin on the group that follows the hidden overview group,
so it sits flush at the top of the sidebar without a gap. */
div:has(> .sidebar-group a[href="/developers/introduction"]) + div,
div:has(> .sidebar-group a[href="/user-guide/introduction"]) + div {
div:has(> .sidebar-group a[href='/developers/introduction']) + div,
div:has(> .sidebar-group a[href='/user-guide/introduction']) + div {
margin-top: 0 !important;
}
@@ -36,9 +36,7 @@
{
"key": "userGuideOverview",
"label": "Overview",
"pages": [
"user-guide/introduction"
]
"pages": ["user-guide/introduction"]
},
{
"key": "dataModel",
@@ -220,9 +218,7 @@
{
"key": "aiHowTos",
"label": "How-Tos",
"pages": [
"user-guide/ai/how-tos/ai-faq"
]
"pages": ["user-guide/ai/how-tos/ai-faq"]
}
]
},
@@ -309,9 +305,7 @@
{
"key": "permissionsAccessHowTos",
"label": "How-Tos",
"pages": [
"user-guide/permissions-access/how-tos/permissions-faq"
]
"pages": ["user-guide/permissions-access/how-tos/permissions-faq"]
}
]
},
@@ -332,9 +326,7 @@
{
"key": "billingHowTos",
"label": "How-Tos",
"pages": [
"user-guide/billing/how-tos/billing-faq"
]
"pages": ["user-guide/billing/how-tos/billing-faq"]
}
]
},
@@ -359,9 +351,7 @@
{
"key": "settingsHowTos",
"label": "How-Tos",
"pages": [
"user-guide/settings/how-tos/settings-faq"
]
"pages": ["user-guide/settings/how-tos/settings-faq"]
}
]
}
@@ -374,9 +364,7 @@
{
"key": "developersOverview",
"label": "Overview",
"pages": [
"developers/introduction"
]
"pages": ["developers/introduction"]
},
{
"key": "apps",
@@ -209,9 +209,7 @@
{
"key": "aiHowTos",
"label": "How-Tos",
"pages": [
"user-guide/ai/how-tos/ai-faq"
]
"pages": ["user-guide/ai/how-tos/ai-faq"]
}
]
},
@@ -290,9 +288,7 @@
{
"key": "permissionsAccessHowTos",
"label": "How-Tos",
"pages": [
"user-guide/permissions-access/how-tos/permissions-faq"
]
"pages": ["user-guide/permissions-access/how-tos/permissions-faq"]
}
]
},
@@ -313,9 +309,7 @@
{
"key": "billingHowTos",
"label": "How-Tos",
"pages": [
"user-guide/billing/how-tos/billing-faq"
]
"pages": ["user-guide/billing/how-tos/billing-faq"]
}
]
},
@@ -340,9 +334,7 @@
{
"key": "settingsHowTos",
"label": "How-Tos",
"pages": [
"user-guide/settings/how-tos/settings-faq"
]
"pages": ["user-guide/settings/how-tos/settings-faq"]
}
]
}
@@ -355,9 +347,7 @@
{
"key": "developersGroup",
"label": "Developers",
"pages": [
"developers/introduction"
]
"pages": ["developers/introduction"]
},
{
"key": "extend",
@@ -433,9 +423,7 @@
{
"key": "feedback",
"label": "Feedback",
"pages": [
"twenty-ui/progress-bar"
]
"pages": ["twenty-ui/progress-bar"]
},
{
"key": "input",
+8 -2
View File
@@ -21,11 +21,17 @@
},
"lint": {},
"fmt": {
"executor": "nx:run-commands",
"cache": true,
"options": {
"files": "."
"cwd": "{projectRoot}",
"command": "prettier . --check --cache --cache-location ../../.cache/prettier/{projectRoot} --cache-strategy metadata"
},
"configurations": {
"fix": {}
"ci": {},
"fix": {
"command": "prettier . --write --cache --cache-location ../../.cache/prettier/{projectRoot} --cache-strategy metadata"
}
}
}
}
@@ -2,8 +2,8 @@ import fs from 'fs';
import path from 'path';
import {
DEFAULT_LANGUAGE,
SUPPORTED_LANGUAGES,
DEFAULT_LANGUAGE,
SUPPORTED_LANGUAGES,
} from '../navigation/supported-languages';
type BasePage = string | BaseGroup;
@@ -71,15 +71,11 @@ const baseStructure: BaseStructure = JSON.parse(
const docsConfig = JSON.parse(fs.readFileSync(docsPath, 'utf8'));
const collectTranslations = (
file: TranslationFile | null,
): TranslationMaps => {
const collectTranslations = (file: TranslationFile | null): TranslationMaps => {
const tabLabels = new Map<string, string>();
const groupLabels = new Map<string, string>();
const collectGroups = (
groups?: Record<string, TranslationGroupEntry>,
) => {
const collectGroups = (groups?: Record<string, TranslationGroupEntry>) => {
if (!groups) {
return;
}
@@ -99,17 +95,15 @@ const collectTranslations = (
};
const loadTranslationFile = (language: string): TranslationFile | null => {
const translationPath = path.join(
localesRoot,
language,
'navigation.json',
);
const translationPath = path.join(localesRoot, language, 'navigation.json');
if (!fs.existsSync(translationPath)) {
return null;
}
return JSON.parse(fs.readFileSync(translationPath, 'utf8')) as TranslationFile;
return JSON.parse(
fs.readFileSync(translationPath, 'utf8'),
) as TranslationFile;
};
const buildLanguageEntry = (language: string): GeneratedLanguage => {
@@ -161,9 +155,8 @@ const hasLocaleContent = (language: string): boolean => {
return fs.existsSync(localeDir);
};
const languages = SUPPORTED_LANGUAGES.filter(hasLocaleContent).map(
buildLanguageEntry,
);
const languages =
SUPPORTED_LANGUAGES.filter(hasLocaleContent).map(buildLanguageEntry);
if (!docsConfig.navigation) {
docsConfig.navigation = {};
@@ -53,75 +53,81 @@ async function main() {
const base64 = imageBytes.toString('base64');
const mime = sourcePath.endsWith('.png') ? 'image/png' : 'image/jpeg';
const resultBase64 = await page.evaluate(async ({ b64, m }) => {
const LINE_SPACING = 8;
const MIN_LINE_WIDTH = 0.5;
const MAX_LINE_WIDTH = 6;
const COLOR = { r: 74, g: 56, b: 245 }; // #4A38F5
const TRANSPARENT_BG = true;
const resultBase64 = await page.evaluate(
async ({ b64, m }) => {
const LINE_SPACING = 8;
const MIN_LINE_WIDTH = 0.5;
const MAX_LINE_WIDTH = 6;
const COLOR = { r: 74, g: 56, b: 245 }; // #4A38F5
const TRANSPARENT_BG = true;
const img = new Image();
await new Promise((res, rej) => {
img.onload = res;
img.onerror = rej;
img.src = `data:${m};base64,${b64}`;
});
const img = new Image();
await new Promise((res, rej) => {
img.onload = res;
img.onerror = rej;
img.src = `data:${m};base64,${b64}`;
});
const { width, height } = img;
const scale = 2;
const outW = width * scale;
const outH = height * scale;
const { width, height } = img;
const scale = 2;
const outW = width * scale;
const outH = height * scale;
// Read source pixels
const tmp = document.createElement('canvas');
tmp.width = width;
tmp.height = height;
const tmpCtx = tmp.getContext('2d');
tmpCtx.drawImage(img, 0, 0);
const px = tmpCtx.getImageData(0, 0, width, height).data;
// Read source pixels
const tmp = document.createElement('canvas');
tmp.width = width;
tmp.height = height;
const tmpCtx = tmp.getContext('2d');
tmpCtx.drawImage(img, 0, 0);
const px = tmpCtx.getImageData(0, 0, width, height).data;
// Output canvas
const out = document.createElement('canvas');
out.width = outW;
out.height = outH;
const ctx = out.getContext('2d');
// Transparent background — adapts to both light and dark mode
// Output canvas
const out = document.createElement('canvas');
out.width = outW;
out.height = outH;
const ctx = out.getContext('2d');
// Transparent background — adapts to both light and dark mode
const sp = LINE_SPACING * scale;
const sp = LINE_SPACING * scale;
for (let y = sp / 2; y < outH; y += sp) {
const srcY = Math.min(Math.floor(y / scale), height - 1);
let x = 0;
for (let y = sp / 2; y < outH; y += sp) {
const srcY = Math.min(Math.floor(y / scale), height - 1);
let x = 0;
while (x < outW) {
const srcX = Math.min(Math.floor(x / scale), width - 1);
const i = (srcY * width + srcX) * 4;
const lum = (0.299 * px[i] + 0.587 * px[i+1] + 0.114 * px[i+2]) / 255;
const a = px[i+3] / 255;
const dark = (1 - lum) * a;
while (x < outW) {
const srcX = Math.min(Math.floor(x / scale), width - 1);
const i = (srcY * width + srcX) * 4;
const lum =
(0.299 * px[i] + 0.587 * px[i + 1] + 0.114 * px[i + 2]) / 255;
const a = px[i + 3] / 255;
const dark = (1 - lum) * a;
if (dark > 0.2) {
const w = (MIN_LINE_WIDTH + (MAX_LINE_WIDTH - MIN_LINE_WIDTH) * dark) * scale;
const dashLen = sp * (0.3 + 0.7 * dark);
const gap = sp * (0.1 + 0.4 * (1 - dark));
const alpha = 0.3 + 0.7 * dark;
if (dark > 0.2) {
const w =
(MIN_LINE_WIDTH + (MAX_LINE_WIDTH - MIN_LINE_WIDTH) * dark) *
scale;
const dashLen = sp * (0.3 + 0.7 * dark);
const gap = sp * (0.1 + 0.4 * (1 - dark));
const alpha = 0.3 + 0.7 * dark;
ctx.strokeStyle = `rgba(${COLOR.r},${COLOR.g},${COLOR.b},${alpha})`;
ctx.lineWidth = w;
ctx.lineCap = 'round';
ctx.beginPath();
ctx.moveTo(x, y);
ctx.lineTo(Math.min(x + dashLen, outW), y);
ctx.stroke();
x += dashLen + gap;
} else {
x += sp * 0.5;
ctx.strokeStyle = `rgba(${COLOR.r},${COLOR.g},${COLOR.b},${alpha})`;
ctx.lineWidth = w;
ctx.lineCap = 'round';
ctx.beginPath();
ctx.moveTo(x, y);
ctx.lineTo(Math.min(x + dashLen, outW), y);
ctx.stroke();
x += dashLen + gap;
} else {
x += sp * 0.5;
}
}
}
}
return out.toDataURL('image/png').split(',')[1];
}, { b64: base64, m: mime });
return out.toDataURL('image/png').split(',')[1];
},
{ b64: base64, m: mime },
);
const outputPath = join(OUTPUT_DIR, `${illust.name}.png`);
writeFileSync(outputPath, Buffer.from(resultBase64, 'base64'));
@@ -46,9 +46,7 @@ const baseStructure: BaseStructure = JSON.parse(
fs.readFileSync(baseStructurePath, 'utf8'),
);
const buildGroupMap = (
groups: BaseGroup[],
): Record<string, TemplateGroup> =>
const buildGroupMap = (groups: BaseGroup[]): Record<string, TemplateGroup> =>
groups.reduce<Record<string, TemplateGroup>>((acc, group) => {
const nestedGroups = group.pages.filter(
(page): page is BaseGroup => typeof page !== 'string',
@@ -78,4 +76,3 @@ const template: TemplateFile = {
};
fs.writeFileSync(templatePath, `${JSON.stringify(template, null, 2)}\n`);
+74 -53
View File
@@ -21,7 +21,10 @@
],
"rules": {
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
"no-console": [
"warn",
{ "allow": ["group", "groupCollapsed", "groupEnd"] }
],
"no-script-url": "error",
"no-control-regex": "off",
"no-debugger": "error",
@@ -29,27 +32,30 @@
"no-undef": "off",
"no-unused-vars": "off",
"no-redeclare": "off",
"no-restricted-imports": ["error", {
"patterns": [
{
"group": ["../*"],
"message": "Relative parent imports are not allowed. Use @/ alias instead."
},
{
"group": ["@tabler/icons-react"],
"message": "Please import icons from `twenty-ui`"
},
{
"group": ["react-hotkeys-web-hook"],
"importNames": ["useHotkeys"],
"message": "Please use the custom wrapper: `useScopedHotkeys` from `twenty-ui`"
},
{
"group": ["lodash"],
"message": "Please use the standalone lodash package (for instance: `import groupBy from 'lodash.groupby'` instead of `import { groupBy } from 'lodash'`)"
}
]
}],
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": ["../*"],
"message": "Relative parent imports are not allowed. Use @/ alias instead."
},
{
"group": ["@tabler/icons-react"],
"message": "Please import icons from `twenty-ui`"
},
{
"group": ["react-hotkeys-web-hook"],
"importNames": ["useHotkeys"],
"message": "Please use the custom wrapper: `useScopedHotkeys` from `twenty-ui`"
},
{
"group": ["lodash"],
"message": "Please use the standalone lodash package (for instance: `import groupBy from 'lodash.groupby'` instead of `import { groupBy } from 'lodash'`)"
}
]
}
],
"import/no-duplicates": "error",
@@ -68,34 +74,46 @@
"typescript/no-redeclare": "error",
"typescript/ban-ts-comment": "error",
"typescript/consistent-type-imports": ["error", {
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}],
"typescript/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"typescript/explicit-function-return-type": "off",
"typescript/explicit-module-boundary-types": "off",
"typescript/no-empty-object-type": ["error", {
"allowInterfaces": "with-single-extends"
}],
"typescript/no-empty-object-type": [
"error",
{
"allowInterfaces": "with-single-extends"
}
],
"typescript/no-empty-function": "off",
"typescript/no-explicit-any": "off",
"typescript/no-unused-vars": ["warn", {
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}],
"typescript/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"typescript/strict-boolean-expressions": ["error", {
"allowNullableBoolean": true,
"allowNullableObject": true,
"allowString": true,
"allowNumber": true,
"allowNullableString": true,
"allowNullableNumber": true,
"allowNullableEnum": true,
"allowAny": true
}],
"typescript/strict-boolean-expressions": [
"error",
{
"allowNullableBoolean": true,
"allowNullableObject": true,
"allowString": true,
"allowNumber": true,
"allowNullableString": true,
"allowNullableNumber": true,
"allowNullableEnum": true,
"allowAny": true
}
],
"twenty/effect-components": "error",
"twenty/no-hardcoded-colors": "error",
@@ -108,14 +126,17 @@
"twenty/no-jotai-store-in-selector": "error",
"twenty/no-direct-atom-family-in-selector": "error",
"twenty/folder-structure": "error",
"twenty/enforce-module-boundaries": ["error", {
"depConstraints": [
{
"sourceTag": "scope:frontend",
"onlyDependOnLibsWithTags": ["scope:shared", "scope:frontend"]
}
]
}]
"twenty/enforce-module-boundaries": [
"error",
{
"depConstraints": [
{
"sourceTag": "scope:frontend",
"onlyDependOnLibsWithTags": ["scope:shared", "scope:frontend"]
}
]
}
]
},
"overrides": [
{
@@ -1,8 +1,8 @@
<style>
[data-is-storybook="true"] {
background-color: transparent!important;
}
:has(#storybook-panel-root) {
z-index: 100;
}
[data-is-storybook='true'] {
background-color: transparent !important;
}
:has(#storybook-panel-root) {
z-index: 100;
}
</style>
@@ -6,19 +6,19 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.7/iframeResizer.contentWindow.min.js"></script>
<style type="text/css">
body {
margin: 0;
font-family: 'Inter', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
html {
font-size: 13px;
}
.sbdocs-wrapper {
padding: 0 !important;
}
*::-webkit-scrollbar {
body {
margin: 0;
font-family: 'Inter', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
html {
font-size: 13px;
}
.sbdocs-wrapper {
padding: 0 !important;
}
*::-webkit-scrollbar {
height: 4px;
width: 4px;
}
@@ -31,4 +31,4 @@ html {
background-color: transparent;
border-radius: 2px;
}
</style>
</style>
+1 -5
View File
@@ -19,11 +19,7 @@ module.exports = {
overwrite: true,
generates: {
'./src/generated/graphql.ts': {
plugins: [
'typescript',
'typescript-operations',
'typed-document-node',
],
plugins: ['typescript', 'typescript-operations', 'typed-document-node'],
config: {
skipTypename: false,
scalars: {
+4 -2
View File
@@ -73,13 +73,15 @@
}
@media (prefers-color-scheme: dark) {
html, body {
html,
body {
background-color: var(--theme-dark-background-tertiary);
}
}
@media (prefers-color-scheme: light) {
html, body {
html,
body {
background-color: var(--theme-light-background-tertiary);
}
}
+11 -25
View File
@@ -2,31 +2,21 @@
"name": "twenty-front",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"tags": [
"scope:frontend"
],
"tags": ["scope:frontend"],
"targets": {
"build": {
"outputs": [
"{options.outputPath}"
],
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/build"
},
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
},
"build:sourcemaps": {
"outputs": [
"{options.outputPath}"
],
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/build"
},
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
},
"serve": {
"executor": "nx:run-commands",
@@ -51,12 +41,8 @@
},
"reset:env": {
"executor": "nx:run-commands",
"inputs": [
"{projectRoot}/.env.example"
],
"outputs": [
"{projectRoot}/.env"
],
"inputs": ["{projectRoot}/.env.example"],
"outputs": ["{projectRoot}/.env"],
"cache": true,
"options": {
"cwd": "{projectRoot}",
@@ -77,11 +63,11 @@
],
"options": {
"cwd": "{projectRoot}",
"command": "npx oxlint --type-aware -c .oxlintrc.json src/ && (prettier src/ --check --cache --cache-location ../../.cache/prettier/{projectRoot} --cache-strategy metadata || (echo 'ERROR: Prettier formatting check failed! Fix with: npx nx lint twenty-front --configuration=fix' && false))"
"command": "npx oxlint --type-aware -c .oxlintrc.json src/ && (npx oxfmt --check src/ || (echo 'ERROR: oxfmt formatting check failed! Fix with: npx nx lint twenty-front --configuration=fix' && false))"
},
"configurations": {
"fix": {
"command": "npx oxlint --type-aware --fix -c .oxlintrc.json src/ && prettier src/ --write --cache --cache-location ../../.cache/prettier/{projectRoot} --cache-strategy metadata"
"command": "npx oxlint --type-aware --fix -c .oxlintrc.json src/ && npx oxfmt src/"
}
}
},
@@ -90,11 +76,11 @@
"dependsOn": ["twenty-oxlint-rules:build"],
"options": {
"cwd": "{projectRoot}",
"command": "FILES=$(git diff --name-only --relative --diff-filter=d main...HEAD -- src/ | grep -E '\\.(ts|tsx)$'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --type-aware -c .oxlintrc.json $FILES && (prettier --check $FILES || (echo 'ERROR: Prettier formatting check failed! Fix with: npx nx lint:diff-with-main twenty-front --configuration=fix' && false)))"
"command": "FILES=$(git diff --name-only --relative --diff-filter=d main...HEAD -- src/ | grep -E '\\.(ts|tsx)$'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --type-aware -c .oxlintrc.json $FILES && (npx oxfmt --check $FILES || (echo 'ERROR: oxfmt formatting check failed! Fix with: npx nx lint:diff-with-main twenty-front --configuration=fix' && false)))"
},
"configurations": {
"fix": {
"command": "FILES=$(git diff --name-only --relative --diff-filter=d main...HEAD -- src/ | grep -E '\\.(ts|tsx)$'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --type-aware --fix -c .oxlintrc.json $FILES && prettier --write $FILES)"
"command": "FILES=$(git diff --name-only --relative --diff-filter=d main...HEAD -- src/ | grep -E '\\.(ts|tsx)$'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --type-aware --fix -c .oxlintrc.json $FILES && npx oxfmt $FILES)"
}
}
},
@@ -7,42 +7,42 @@
* - Please do NOT modify this file.
*/
const PACKAGE_VERSION = '2.12.7'
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()
const PACKAGE_VERSION = '2.12.7';
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82';
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse');
const activeClientIds = new Set();
addEventListener('install', function () {
self.skipWaiting()
})
self.skipWaiting();
});
addEventListener('activate', function (event) {
event.waitUntil(self.clients.claim())
})
event.waitUntil(self.clients.claim());
});
addEventListener('message', async function (event) {
const clientId = Reflect.get(event.source || {}, 'id')
const clientId = Reflect.get(event.source || {}, 'id');
if (!clientId || !self.clients) {
return
return;
}
const client = await self.clients.get(clientId)
const client = await self.clients.get(clientId);
if (!client) {
return
return;
}
const allClients = await self.clients.matchAll({
type: 'window',
})
});
switch (event.data) {
case 'KEEPALIVE_REQUEST': {
sendToClient(client, {
type: 'KEEPALIVE_RESPONSE',
})
break
});
break;
}
case 'INTEGRITY_CHECK_REQUEST': {
@@ -52,12 +52,12 @@ addEventListener('message', async function (event) {
packageVersion: PACKAGE_VERSION,
checksum: INTEGRITY_CHECKSUM,
},
})
break
});
break;
}
case 'MOCK_ACTIVATE': {
activeClientIds.add(clientId)
activeClientIds.add(clientId);
sendToClient(client, {
type: 'MOCKING_ENABLED',
@@ -67,33 +67,33 @@ addEventListener('message', async function (event) {
frameType: client.frameType,
},
},
})
break
});
break;
}
case 'CLIENT_CLOSED': {
activeClientIds.delete(clientId)
activeClientIds.delete(clientId);
const remainingClients = allClients.filter((client) => {
return client.id !== clientId
})
return client.id !== clientId;
});
// Unregister itself when there are no more clients
if (remainingClients.length === 0) {
self.registration.unregister()
self.registration.unregister();
}
break
break;
}
}
})
});
addEventListener('fetch', function (event) {
const requestInterceptedAt = Date.now()
const requestInterceptedAt = Date.now();
// Bypass navigation requests.
if (event.request.mode === 'navigate') {
return
return;
}
// Opening the DevTools triggers the "only-if-cached" request
@@ -102,19 +102,19 @@ addEventListener('fetch', function (event) {
event.request.cache === 'only-if-cached' &&
event.request.mode !== 'same-origin'
) {
return
return;
}
// Bypass all requests when there are no active clients.
// Prevents the self-unregistered worked from handling requests
// after it's been terminated (still remains active until the next reload).
if (activeClientIds.size === 0) {
return
return;
}
const requestId = crypto.randomUUID()
event.respondWith(handleRequest(event, requestId, requestInterceptedAt))
})
const requestId = crypto.randomUUID();
event.respondWith(handleRequest(event, requestId, requestInterceptedAt));
});
/**
* @param {FetchEvent} event
@@ -122,23 +122,23 @@ addEventListener('fetch', function (event) {
* @param {number} requestInterceptedAt
*/
async function handleRequest(event, requestId, requestInterceptedAt) {
const client = await resolveMainClient(event)
const requestCloneForEvents = event.request.clone()
const client = await resolveMainClient(event);
const requestCloneForEvents = event.request.clone();
const response = await getResponse(
event,
client,
requestId,
requestInterceptedAt,
)
);
// Send back the response clone for the "response:*" life-cycle events.
// Ensure MSW is active and ready to handle the message, otherwise
// this message will pend indefinitely.
if (client && activeClientIds.has(client.id)) {
const serializedRequest = await serializeRequest(requestCloneForEvents)
const serializedRequest = await serializeRequest(requestCloneForEvents);
// Clone the response so both the client and the library could consume it.
const responseClone = response.clone()
const responseClone = response.clone();
sendToClient(
client,
@@ -160,10 +160,10 @@ async function handleRequest(event, requestId, requestInterceptedAt) {
},
},
responseClone.body ? [serializedRequest.body, responseClone.body] : [],
)
);
}
return response
return response;
}
/**
@@ -175,30 +175,30 @@ async function handleRequest(event, requestId, requestInterceptedAt) {
* @returns {Promise<Client | undefined>}
*/
async function resolveMainClient(event) {
const client = await self.clients.get(event.clientId)
const client = await self.clients.get(event.clientId);
if (activeClientIds.has(event.clientId)) {
return client
return client;
}
if (client?.frameType === 'top-level') {
return client
return client;
}
const allClients = await self.clients.matchAll({
type: 'window',
})
});
return allClients
.filter((client) => {
// Get only those clients that are currently visible.
return client.visibilityState === 'visible'
return client.visibilityState === 'visible';
})
.find((client) => {
// Find the client ID that's recorded in the
// set of clients that have registered the worker.
return activeClientIds.has(client.id)
})
return activeClientIds.has(client.id);
});
}
/**
@@ -211,36 +211,36 @@ async function resolveMainClient(event) {
async function getResponse(event, client, requestId, requestInterceptedAt) {
// Clone the request because it might've been already used
// (i.e. its body has been read and sent to the client).
const requestClone = event.request.clone()
const requestClone = event.request.clone();
function passthrough() {
// Cast the request headers to a new Headers instance
// so the headers can be manipulated with.
const headers = new Headers(requestClone.headers)
const headers = new Headers(requestClone.headers);
// Remove the "accept" header value that marked this request as passthrough.
// This prevents request alteration and also keeps it compliant with the
// user-defined CORS policies.
const acceptHeader = headers.get('accept')
const acceptHeader = headers.get('accept');
if (acceptHeader) {
const values = acceptHeader.split(',').map((value) => value.trim())
const values = acceptHeader.split(',').map((value) => value.trim());
const filteredValues = values.filter(
(value) => value !== 'msw/passthrough',
)
);
if (filteredValues.length > 0) {
headers.set('accept', filteredValues.join(', '))
headers.set('accept', filteredValues.join(', '));
} else {
headers.delete('accept')
headers.delete('accept');
}
}
return fetch(requestClone, { headers })
return fetch(requestClone, { headers });
}
// Bypass mocking when the client is not active.
if (!client) {
return passthrough()
return passthrough();
}
// Bypass initial page load requests (i.e. static assets).
@@ -248,11 +248,11 @@ async function getResponse(event, client, requestId, requestInterceptedAt) {
// means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
// and is not ready to handle requests.
if (!activeClientIds.has(client.id)) {
return passthrough()
return passthrough();
}
// Notify the client that a request has been intercepted.
const serializedRequest = await serializeRequest(event.request)
const serializedRequest = await serializeRequest(event.request);
const clientMessage = await sendToClient(
client,
{
@@ -264,19 +264,19 @@ async function getResponse(event, client, requestId, requestInterceptedAt) {
},
},
[serializedRequest.body],
)
);
switch (clientMessage.type) {
case 'MOCK_RESPONSE': {
return respondWithMock(clientMessage.data)
return respondWithMock(clientMessage.data);
}
case 'PASSTHROUGH': {
return passthrough()
return passthrough();
}
}
return passthrough()
return passthrough();
}
/**
@@ -287,21 +287,21 @@ async function getResponse(event, client, requestId, requestInterceptedAt) {
*/
function sendToClient(client, message, transferrables = []) {
return new Promise((resolve, reject) => {
const channel = new MessageChannel()
const channel = new MessageChannel();
channel.port1.onmessage = (event) => {
if (event.data && event.data.error) {
return reject(event.data.error)
return reject(event.data.error);
}
resolve(event.data)
}
resolve(event.data);
};
client.postMessage(message, [
channel.port2,
...transferrables.filter(Boolean),
])
})
]);
});
}
/**
@@ -314,17 +314,17 @@ function respondWithMock(response) {
// instance will have status code set to 0. Since it's not possible to create
// a Response instance with status code 0, handle that use-case separately.
if (response.status === 0) {
return Response.error()
return Response.error();
}
const mockedResponse = new Response(response.body, response)
const mockedResponse = new Response(response.body, response);
Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, {
value: true,
enumerable: true,
})
});
return mockedResponse
return mockedResponse;
}
/**
@@ -345,5 +345,5 @@ async function serializeRequest(request) {
referrerPolicy: request.referrerPolicy,
body: await request.arrayBuffer(),
keepalive: request.keepalive,
}
};
}
@@ -38,7 +38,9 @@ export const generateNavigationMenuItems = async (token: string) => {
navigationMenuItems: Record<string, unknown>[];
};
console.log(` Got ${data.navigationMenuItems.length} navigation menu items.`);
console.log(
` Got ${data.navigationMenuItems.length} navigation menu items.`,
);
writeGeneratedFile(
'metadata/navigation-menu-items/mock-navigation-menu-items-data.ts',
@@ -1,39 +0,0 @@
On v1.16
"settings": {"input": {"serverlessFunctionId": "e8a6a1c8-3e63-4d8b-aaa7-d8c932a6b314", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "draft"}, "outputSchema": {"message": {"type": "string", "label": "message", "value": "Hello, input: null and null", "isLeaf": true}}
"settings": {"input": {"serverlessFunctionId": "84d3e16c-10bb-4eed-ae15-714f657a2726", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "draft"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
"settings": {"input": {"serverlessFunctionId": "cfc3c41f-5520-41f5-a83e-6a56ca6b90ba", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "1"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
"settings": {"input": {"serverlessFunctionId": "42b11c8c-0238-4044-a5d3-9cc662066de4", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "1"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
"settings": {"input": {"serverlessFunctionId": "42b11c8c-0238-4044-a5d3-9cc662066de4", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "draft"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
"settings": {"input": {"serverlessFunctionId": "a7d07444-092f-4a96-8e3c-b379bc49f6e3", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "draft"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
"settings": {"input": {"serverlessFunctionId": "a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "1"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
"settings": {"input": {"serverlessFunctionId": "8fdff250-0b7d-4d20-ae5f-8defe4ff9d37", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "1"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
"settings": {"input": {"serverlessFunctionId": "a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "1"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
"settings": {"input": {"serverlessFunctionId": "798f33e3-04ee-453f-94a1-ddc1518e4618", "serverlessFunctionInput": {"a": null, "b": null}, "serverlessFunctionVersion": "1"}, "outputSchema": {"link": {"tab": "test", "icon": "IconVariable", "label": "Generate Function Output", "isLeaf": true}, "_outputSchemaType": "LINK"}
built-function/42b11c8c-0238-4044-a5d3-9cc662066de4/1/index.mjs
built-function/42b11c8c-0238-4044-a5d3-9cc662066de4/draft/index.mjs
built-function/798f33e3-04ee-453f-94a1-ddc1518e4618/1/index.mjs
built-function/798f33e3-04ee-453f-94a1-ddc1518e4618/draft/index.mjs
built-function/84d3e16c-10bb-4eed-ae15-714f657a2726/draft/index.mjs
built-function/8fdff250-0b7d-4d20-ae5f-8defe4ff9d37/1/index.mjs
built-function/8fdff250-0b7d-4d20-ae5f-8defe4ff9d37/draft/index.mjs
built-function/a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6/1/index.mjs
built-function/a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6/draft/index.mjs
built-function/a7d07444-092f-4a96-8e3c-b379bc49f6e3/draft/index.mjs
built-function/cfc3c41f-5520-41f5-a83e-6a56ca6b90ba/1/index.mjs
built-function/cfc3c41f-5520-41f5-a83e-6a56ca6b90ba/draft/index.mjs
built-function/e8a6a1c8-3e63-4d8b-aaa7-d8c932a6b314/draft/index.mjs
serverless-function/42b11c8c-0238-4044-a5d3-9cc662066de4/1/src/index.ts
serverless-function/42b11c8c-0238-4044-a5d3-9cc662066de4/draft/src/index.ts
serverless-function/798f33e3-04ee-453f-94a1-ddc1518e4618/1/src/index.ts
serverless-function/798f33e3-04ee-453f-94a1-ddc1518e4618/draft/src/index.ts
serverless-function/84d3e16c-10bb-4eed-ae15-714f657a2726/draft/src/index.ts
serverless-function/8fdff250-0b7d-4d20-ae5f-8defe4ff9d37/1/src/index.ts
serverless-function/8fdff250-0b7d-4d20-ae5f-8defe4ff9d37/draft/src/index.ts
serverless-function/a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6/1/src/index.ts
serverless-function/a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6/draft/src/index.ts
serverless-function/a7d07444-092f-4a96-8e3c-b379bc49f6e3/draft/src/index.ts
serverless-function/cfc3c41f-5520-41f5-a83e-6a56ca6b90ba/1/src/index.ts
serverless-function/cfc3c41f-5520-41f5-a83e-6a56ca6b90ba/draft/src/index.ts
serverless-function/e8a6a1c8-3e63-4d8b-aaa7-d8c932a6b314/draft/src/index.ts
@@ -1,208 +0,0 @@
On v1.17
"settings": {
"input": {
"logicFunctionId": "fa1d4f4c-b0b6-43cd-8ab9-c87ac3b233d1",
"logicFunctionInput": {
"a": null,
"b": null
}
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "84d3e16c-10bb-4eed-ae15-714f657a2726",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "draft"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "cfc3c41f-5520-41f5-a83e-6a56ca6b90ba",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "1"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "42b11c8c-0238-4044-a5d3-9cc662066de4",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "1"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "42b11c8c-0238-4044-a5d3-9cc662066de4",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "draft"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "a7d07444-092f-4a96-8e3c-b379bc49f6e3",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "draft"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "1"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "8fdff250-0b7d-4d20-ae5f-8defe4ff9d37",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "1"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "1"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
"settings": {
"input": {
"serverlessFunctionId": "798f33e3-04ee-453f-94a1-ddc1518e4618",
"serverlessFunctionInput": {
"a": null,
"b": null
},
"serverlessFunctionVersion": "1"
},
"outputSchema": {
"link": {
"tab": "test",
"icon": "IconVariable",
"label": "Generate Function Output",
"isLeaf": true
},
"_outputSchemaType": "LINK"
}
built-function/42b11c8c-0238-4044-a5d3-9cc662066de4/1/index.mjs
built-function/42b11c8c-0238-4044-a5d3-9cc662066de4/draft/index.mjs
built-function/798f33e3-04ee-453f-94a1-ddc1518e4618/1/index.mjs
built-function/798f33e3-04ee-453f-94a1-ddc1518e4618/draft/index.mjs
built-function/84d3e16c-10bb-4eed-ae15-714f657a2726/draft/index.mjs
built-function/8fdff250-0b7d-4d20-ae5f-8defe4ff9d37/1/index.mjs
built-function/8fdff250-0b7d-4d20-ae5f-8defe4ff9d37/draft/index.mjs
built-function/a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6/1/index.mjs
built-function/a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6/draft/index.mjs
built-function/a7d07444-092f-4a96-8e3c-b379bc49f6e3/draft/index.mjs
built-function/cfc3c41f-5520-41f5-a83e-6a56ca6b90ba/1/index.mjs
built-function/cfc3c41f-5520-41f5-a83e-6a56ca6b90ba/draft/index.mjs
built-function/e8a6a1c8-3e63-4d8b-aaa7-d8c932a6b314/draft/index.mjs
serverless-function/42b11c8c-0238-4044-a5d3-9cc662066de4/1/src/index.ts
serverless-function/42b11c8c-0238-4044-a5d3-9cc662066de4/draft/src/index.ts
serverless-function/798f33e3-04ee-453f-94a1-ddc1518e4618/1/src/index.ts
serverless-function/798f33e3-04ee-453f-94a1-ddc1518e4618/draft/src/index.ts
serverless-function/84d3e16c-10bb-4eed-ae15-714f657a2726/draft/src/index.ts
serverless-function/8fdff250-0b7d-4d20-ae5f-8defe4ff9d37/1/src/index.ts
serverless-function/8fdff250-0b7d-4d20-ae5f-8defe4ff9d37/draft/src/index.ts
serverless-function/a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6/1/src/index.ts
serverless-function/a3d42cb4-a5bd-4eb1-b564-5a207fa98dc6/draft/src/index.ts
serverless-function/a7d07444-092f-4a96-8e3c-b379bc49f6e3/draft/src/index.ts
serverless-function/cfc3c41f-5520-41f5-a83e-6a56ca6b90ba/1/src/index.ts
serverless-function/cfc3c41f-5520-41f5-a83e-6a56ca6b90ba/draft/src/index.ts
serverless-function/e8a6a1c8-3e63-4d8b-aaa7-d8c932a6b314/draft/src/index.ts
@@ -9,11 +9,11 @@ import { getSettingsPath } from 'twenty-shared/utils';
import { PermissionFlagType } from '~/generated-metadata/graphql';
const SettingsGraphQLPlayground = lazy(() =>
import(
'~/pages/settings/developers/playground/SettingsGraphQLPlayground'
).then((module) => ({
default: module.SettingsGraphQLPlayground,
})),
import('~/pages/settings/developers/playground/SettingsGraphQLPlayground').then(
(module) => ({
default: module.SettingsGraphQLPlayground,
}),
),
);
const SettingsRestPlayground = lazy(() =>
@@ -59,27 +59,27 @@ const SettingsNewObject = lazy(() =>
);
const SettingsNewImapSmtpCaldavConnection = lazy(() =>
import(
'@/settings/accounts/components/SettingsAccountsNewImapSmtpCaldavConnection'
).then((module) => ({
default: module.SettingsAccountsNewImapSmtpCaldavConnection,
})),
import('@/settings/accounts/components/SettingsAccountsNewImapSmtpCaldavConnection').then(
(module) => ({
default: module.SettingsAccountsNewImapSmtpCaldavConnection,
}),
),
);
const SettingsEditImapSmtpCaldavConnection = lazy(() =>
import(
'@/settings/accounts/components/SettingsAccountsEditImapSmtpCaldavConnection'
).then((module) => ({
default: module.SettingsAccountsEditImapSmtpCaldavConnection,
})),
import('@/settings/accounts/components/SettingsAccountsEditImapSmtpCaldavConnection').then(
(module) => ({
default: module.SettingsAccountsEditImapSmtpCaldavConnection,
}),
),
);
const SettingsNewEmailGroupChannel = lazy(() =>
import(
'@/settings/accounts/components/SettingsAccountsNewEmailGroupChannel'
).then((module) => ({
default: module.SettingsAccountsNewEmailGroupChannel,
})),
import('@/settings/accounts/components/SettingsAccountsNewEmailGroupChannel').then(
(module) => ({
default: module.SettingsAccountsNewEmailGroupChannel,
}),
),
);
const SettingsObjectDetailPage = lazy(() =>
@@ -99,19 +99,19 @@ const SettingsObjectOverview = lazy(() =>
);
const SettingsDevelopersApiKeyDetail = lazy(() =>
import(
'~/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail'
).then((module) => ({
default: module.SettingsDevelopersApiKeyDetail,
})),
import('~/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail').then(
(module) => ({
default: module.SettingsDevelopersApiKeyDetail,
}),
),
);
const SettingsDevelopersApiKeysNew = lazy(() =>
import(
'~/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew'
).then((module) => ({
default: module.SettingsDevelopersApiKeysNew,
})),
import('~/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew').then(
(module) => ({
default: module.SettingsDevelopersApiKeysNew,
}),
),
);
const SettingsLogicFunctionDetail = lazy(() =>
@@ -129,11 +129,11 @@ const SettingsWorkspace = lazy(() =>
);
const SettingsWorkspaceEmailGroupChannelDetail = lazy(() =>
import(
'~/pages/settings/workspace/SettingsWorkspaceEmailGroupChannelDetail'
).then((module) => ({
default: module.SettingsWorkspaceEmailGroupChannelDetail,
})),
import('~/pages/settings/workspace/SettingsWorkspaceEmailGroupChannelDetail').then(
(module) => ({
default: module.SettingsWorkspaceEmailGroupChannelDetail,
}),
),
);
const SettingsSubdomainPage = lazy(() =>
@@ -191,27 +191,27 @@ const SettingsApplicationDetails = lazy(() =>
);
const SettingsApplicationConnectionDetail = lazy(() =>
import(
'~/pages/settings/applications/SettingsApplicationConnectionDetail'
).then((module) => ({
default: module.SettingsApplicationConnectionDetail,
})),
import('~/pages/settings/applications/SettingsApplicationConnectionDetail').then(
(module) => ({
default: module.SettingsApplicationConnectionDetail,
}),
),
);
const SettingsApplicationFrontComponentDetail = lazy(() =>
import(
'~/pages/settings/applications/SettingsApplicationFrontComponentDetail'
).then((module) => ({
default: module.SettingsApplicationFrontComponentDetail,
})),
import('~/pages/settings/applications/SettingsApplicationFrontComponentDetail').then(
(module) => ({
default: module.SettingsApplicationFrontComponentDetail,
}),
),
);
const SettingsApplicationCommandMenuItemDetail = lazy(() =>
import(
'~/pages/settings/applications/SettingsApplicationCommandMenuItemDetail'
).then((module) => ({
default: module.SettingsApplicationCommandMenuItemDetail,
})),
import('~/pages/settings/applications/SettingsApplicationCommandMenuItemDetail').then(
(module) => ({
default: module.SettingsApplicationCommandMenuItemDetail,
}),
),
);
const SettingsLayoutViewDetail = lazy(() =>
@@ -229,35 +229,35 @@ const SettingsLayoutPageLayoutDetail = lazy(() =>
);
const SettingsAdminApplicationRegistrationDetail = lazy(() =>
import(
'~/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDetail'
).then((module) => ({
default: module.SettingsAdminApplicationRegistrationDetail,
})),
import('~/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDetail').then(
(module) => ({
default: module.SettingsAdminApplicationRegistrationDetail,
}),
),
);
const SettingsAvailableApplicationDetails = lazy(() =>
import(
'~/pages/settings/applications/SettingsAvailableApplicationDetails'
).then((module) => ({
default: module.SettingsAvailableApplicationDetails,
})),
import('~/pages/settings/applications/SettingsAvailableApplicationDetails').then(
(module) => ({
default: module.SettingsAvailableApplicationDetails,
}),
),
);
const SettingsApplicationRegistrationDetails = lazy(() =>
import(
'~/pages/settings/applications/SettingsApplicationRegistrationDetails'
).then((module) => ({
default: module.SettingsApplicationRegistrationDetails,
})),
import('~/pages/settings/applications/SettingsApplicationRegistrationDetails').then(
(module) => ({
default: module.SettingsApplicationRegistrationDetails,
}),
),
);
const SettingsApplicationRegistrationConfigVariableDetail = lazy(() =>
import(
'~/pages/settings/applications/components/SettingsApplicationRegistrationConfigVariableDetail'
).then((module) => ({
default: module.SettingsApplicationRegistrationConfigVariableDetail,
})),
import('~/pages/settings/applications/components/SettingsApplicationRegistrationConfigVariableDetail').then(
(module) => ({
default: module.SettingsApplicationRegistrationConfigVariableDetail,
}),
),
);
const SettingsAgentForm = lazy(() =>
@@ -313,11 +313,11 @@ const SettingsTwoFactorAuthenticationMethod = lazy(() =>
);
const SettingsExperience = lazy(() =>
import(
'~/pages/settings/profile/appearance/components/SettingsExperience'
).then((module) => ({
default: module.SettingsExperience,
})),
import('~/pages/settings/profile/appearance/components/SettingsExperience').then(
(module) => ({
default: module.SettingsExperience,
}),
),
);
const SettingsAccounts = lazy(() =>
@@ -351,35 +351,35 @@ const SettingsObjects = lazy(() =>
);
const SettingsDevelopersWebhookNew = lazy(() =>
import(
'~/pages/settings/developers/webhooks/components/SettingsDevelopersWebhookNew'
).then((module) => ({
default: module.SettingsDevelopersWebhookNew,
})),
import('~/pages/settings/developers/webhooks/components/SettingsDevelopersWebhookNew').then(
(module) => ({
default: module.SettingsDevelopersWebhookNew,
}),
),
);
const SettingsDevelopersWebhookDetail = lazy(() =>
import(
'~/pages/settings/developers/webhooks/components/SettingsDevelopersWebhookDetail'
).then((module) => ({
default: module.SettingsDevelopersWebhookDetail,
})),
import('~/pages/settings/developers/webhooks/components/SettingsDevelopersWebhookDetail').then(
(module) => ({
default: module.SettingsDevelopersWebhookDetail,
}),
),
);
const SettingsObjectNewFieldSelect = lazy(() =>
import(
'~/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect'
).then((module) => ({
default: module.SettingsObjectNewFieldSelect,
})),
import('~/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect').then(
(module) => ({
default: module.SettingsObjectNewFieldSelect,
}),
),
);
const SettingsObjectNewFieldConfigure = lazy(() =>
import(
'~/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure'
).then((module) => ({
default: module.SettingsObjectNewFieldConfigure,
})),
import('~/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure').then(
(module) => ({
default: module.SettingsObjectNewFieldConfigure,
}),
),
);
const SettingsObjectFieldEdit = lazy(() =>
import('~/pages/settings/data-model/SettingsObjectFieldEdit').then(
@@ -442,11 +442,11 @@ const SettingsAdmin = lazy(() =>
);
const SettingsAdminIndicatorHealthStatus = lazy(() =>
import(
'~/pages/settings/admin-panel/SettingsAdminIndicatorHealthStatus'
).then((module) => ({
default: module.SettingsAdminIndicatorHealthStatus,
})),
import('~/pages/settings/admin-panel/SettingsAdminIndicatorHealthStatus').then(
(module) => ({
default: module.SettingsAdminIndicatorHealthStatus,
}),
),
);
const SettingsAdminInferredVersion = lazy(() =>
@@ -482,11 +482,11 @@ const SettingsAdminQueueDetail = lazy(() =>
);
const SettingsAdminConfigVariableDetails = lazy(() =>
import(
'~/pages/settings/admin-panel/SettingsAdminConfigVariableDetails'
).then((module) => ({
default: module.SettingsAdminConfigVariableDetails,
})),
import('~/pages/settings/admin-panel/SettingsAdminConfigVariableDetails').then(
(module) => ({
default: module.SettingsAdminConfigVariableDetails,
}),
),
);
const SettingsAdminNewAiProvider = lazy(() =>
@@ -33,9 +33,8 @@ export const ExportNoteSingleRecordCommand = () => {
console.warn(initialBody);
}
const { exportBlockNoteEditorToPdf } = await import(
'@/command-menu-item/record/single-record/utils/exportBlockNoteEditorToPdf'
);
const { exportBlockNoteEditorToPdf } =
await import('@/command-menu-item/record/single-record/utils/exportBlockNoteEditorToPdf');
await exportBlockNoteEditorToPdf(parsedBody, filename);
};
@@ -1,12 +1,8 @@
let preloadScheduled = false;
const preload = () => {
void import(
'@/navigation-menu-item/display/dnd/providers/NavigationMenuItemDndKitProvider'
);
void import(
'@/navigation-menu-item/display/sections/workspace/components/WorkspaceSectionListDndKit'
);
void import('@/navigation-menu-item/display/dnd/providers/NavigationMenuItemDndKitProvider');
void import('@/navigation-menu-item/display/sections/workspace/components/WorkspaceSectionListDndKit');
};
export const preloadNavigationMenuItemDndKit = (): void => {
@@ -4,11 +4,11 @@ import { NavigationSections } from '@/navigation-menu-item/common/constants/Navi
import { PageDragDropProviderMountEffect } from '@/navigation-menu-item/display/dnd/providers/PageDragDropProviderMountEffect';
const LazyNavigationMenuItemDndKitProvider = lazy(() =>
import(
'@/navigation-menu-item/display/dnd/providers/NavigationMenuItemDndKitProvider'
).then((m) => ({
default: m.NavigationMenuItemDndKitProvider,
})),
import('@/navigation-menu-item/display/dnd/providers/NavigationMenuItemDndKitProvider').then(
(m) => ({
default: m.NavigationMenuItemDndKitProvider,
}),
),
);
type PageDragDropProviderProps = {
@@ -14,9 +14,9 @@ import type { NavigationMenuItemSectionContentProps } from '@/navigation-menu-it
import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';
const LazyNavigationMenuItemFolderDnd = lazy(() =>
import(
'@/navigation-menu-item/display/folder/components/NavigationMenuItemFolderDnd'
).then((module) => ({ default: module.NavigationMenuItemFolderDnd })),
import('@/navigation-menu-item/display/folder/components/NavigationMenuItemFolderDnd').then(
(module) => ({ default: module.NavigationMenuItemFolderDnd }),
),
);
type NavigationMenuItemFolderProps = Pick<
@@ -23,9 +23,9 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { viewsSelector } from '@/views/states/selectors/viewsSelector';
const LazyWorkspaceSectionListDndKit = lazy(() =>
import(
'@/navigation-menu-item/display/sections/workspace/components/WorkspaceSectionListDndKit'
).then((m) => ({ default: m.WorkspaceSectionListDndKit })),
import('@/navigation-menu-item/display/sections/workspace/components/WorkspaceSectionListDndKit').then(
(m) => ({ default: m.WorkspaceSectionListDndKit }),
),
);
const StyledWorkspaceSectionContentGapOffset = styled.div`
@@ -10,19 +10,19 @@ import { lazy, Suspense } from 'react';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const FavoritesSectionDispatcher = lazy(() =>
import(
'@/navigation-menu-item/display/sections/favorites/components/FavoritesSectionDispatcher'
).then((module) => ({
default: module.FavoritesSectionDispatcher,
})),
import('@/navigation-menu-item/display/sections/favorites/components/FavoritesSectionDispatcher').then(
(module) => ({
default: module.FavoritesSectionDispatcher,
}),
),
);
const WorkspaceSectionDispatcher = lazy(() =>
import(
'@/navigation-menu-item/display/sections/workspace/components/WorkspaceSectionDispatcher'
).then((module) => ({
default: module.WorkspaceSectionDispatcher,
})),
import('@/navigation-menu-item/display/sections/workspace/components/WorkspaceSectionDispatcher').then(
(module) => ({
default: module.WorkspaceSectionDispatcher,
}),
),
);
const StyledScrollableItemsContainer = styled.div`
@@ -17,10 +17,7 @@ import { isUndefined } from '@sniptt/guards';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { isDefined, isPlainObject } from 'twenty-shared/utils';
const mergeCompositeValues = (
existingValue: unknown,
incomingValue: unknown,
) =>
const mergeCompositeValues = (existingValue: unknown, incomingValue: unknown) =>
isPlainObject(existingValue) && isPlainObject(incomingValue)
? { ...existingValue, ...incomingValue }
: incomingValue;
@@ -23,11 +23,11 @@ const ActivityRichTextEditor = lazy(() =>
);
const RichTextFieldEditor = lazy(() =>
import(
'@/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor'
).then((module) => ({
default: module.RichTextFieldEditor,
})),
import('@/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor').then(
(module) => ({
default: module.RichTextFieldEditor,
}),
),
);
const StyledContainer = styled.div`
@@ -3,11 +3,11 @@ import { WidgetSkeletonLoader } from '@/page-layout/widgets/components/WidgetSke
import { lazy, Suspense } from 'react';
const FieldRichTextWidget = lazy(() =>
import(
'@/page-layout/widgets/field-rich-text/components/FieldRichTextWidget'
).then((module) => ({
default: module.FieldRichTextWidget,
})),
import('@/page-layout/widgets/field-rich-text/components/FieldRichTextWidget').then(
(module) => ({
default: module.FieldRichTextWidget,
}),
),
);
type FieldRichTextWidgetRendererProps = {
@@ -11,11 +11,11 @@ import { isUndefined } from '@sniptt/guards';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
const RichTextFieldEditor = lazy(() =>
import(
'@/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor'
).then((module) => ({
default: module.RichTextFieldEditor,
})),
import('@/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor').then(
(module) => ({
default: module.RichTextFieldEditor,
}),
),
);
const StyledContainer = styled.div`
@@ -5,11 +5,11 @@ import { useCurrentWidget } from '@/page-layout/widgets/hooks/useCurrentWidget';
import { lazy, Suspense } from 'react';
const GraphWidgetAggregateChart = lazy(() =>
import(
'@/page-layout/widgets/graph/graph-widget-aggregate-chart/components/GraphWidgetAggregateChart'
).then((module) => ({
default: module.GraphWidgetAggregateChart,
})),
import('@/page-layout/widgets/graph/graph-widget-aggregate-chart/components/GraphWidgetAggregateChart').then(
(module) => ({
default: module.GraphWidgetAggregateChart,
}),
),
);
export const GraphWidgetAggregateChartRenderer = () => {
@@ -19,11 +19,11 @@ import { getAppPath } from 'twenty-shared/utils';
import { AxisNameDisplay } from '~/generated-metadata/graphql';
const GraphWidgetBarChart = lazy(() =>
import(
'@/page-layout/widgets/graph/graph-widget-bar-chart/components/GraphWidgetBarChart'
).then((module) => ({
default: module.GraphWidgetBarChart,
})),
import('@/page-layout/widgets/graph/graph-widget-bar-chart/components/GraphWidgetBarChart').then(
(module) => ({
default: module.GraphWidgetBarChart,
}),
),
);
export const GraphWidgetBarChartRenderer = () => {
@@ -23,11 +23,11 @@ import {
} from '~/generated-metadata/graphql';
const GraphWidgetLineChart = lazy(() =>
import(
'@/page-layout/widgets/graph/graph-widget-line-chart/components/GraphWidgetLineChart'
).then((module) => ({
default: module.GraphWidgetLineChart,
})),
import('@/page-layout/widgets/graph/graph-widget-line-chart/components/GraphWidgetLineChart').then(
(module) => ({
default: module.GraphWidgetLineChart,
}),
),
);
export const GraphWidgetLineChartRenderer = () => {
@@ -17,11 +17,11 @@ import { AppPath } from 'twenty-shared/types';
import { getAppPath } from 'twenty-shared/utils';
const GraphWidgetPieChart = lazy(() =>
import(
'@/page-layout/widgets/graph/graph-widget-pie-chart/components/GraphWidgetPieChart'
).then((module) => ({
default: module.GraphWidgetPieChart,
})),
import('@/page-layout/widgets/graph/graph-widget-pie-chart/components/GraphWidgetPieChart').then(
(module) => ({
default: module.GraphWidgetPieChart,
}),
),
);
export const GraphWidgetPieChartRenderer = () => {
@@ -3,11 +3,11 @@ import { WidgetSkeletonLoader } from '@/page-layout/widgets/components/WidgetSke
import { lazy, Suspense } from 'react';
const StandaloneRichTextWidget = lazy(() =>
import(
'@/page-layout/widgets/standalone-rich-text/components/StandaloneRichTextWidget'
).then((module) => ({
default: module.StandaloneRichTextWidget,
})),
import('@/page-layout/widgets/standalone-rich-text/components/StandaloneRichTextWidget').then(
(module) => ({
default: module.StandaloneRichTextWidget,
}),
),
);
type StandaloneRichTextWidgetRendererProps = {
@@ -18,11 +18,11 @@ const StyledContainer = styled.div`
width: 480px;
`;
interface SettingsOptionCardContentSelectProps
extends React.ComponentProps<typeof SettingsOptionCardContentSelect> {}
interface SettingsOptionCardContentSelectProps extends React.ComponentProps<
typeof SettingsOptionCardContentSelect
> {}
interface SettingsOptionCardContentSelectWrapperProps
extends SettingsOptionCardContentSelectProps {
interface SettingsOptionCardContentSelectWrapperProps extends SettingsOptionCardContentSelectProps {
onChange: any;
options: any;
value: any;
@@ -1,2 +1 @@
export const SETTINGS_OBJECT_MODEL_IS_LABEL_SYNCED_WITH_NAME_LABEL_DEFAULT_VALUE =
true;
export const SETTINGS_OBJECT_MODEL_IS_LABEL_SYNCED_WITH_NAME_LABEL_DEFAULT_VALUE = true;
@@ -11,11 +11,11 @@ import type { AddToNavigationDragPayload } from '@/navigation-menu-item/common/t
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
const CommandMenuItemWithAddToNavigationDragDndKit = lazy(() =>
import(
'@/command-menu/components/CommandMenuItemWithAddToNavigationDragDndKit'
).then((m) => ({
default: m.CommandMenuItemWithAddToNavigationDragDndKit,
})),
import('@/command-menu/components/CommandMenuItemWithAddToNavigationDragDndKit').then(
(m) => ({
default: m.CommandMenuItemWithAddToNavigationDragDndKit,
}),
),
);
type SidePanelItemWithAddToNavigationDragProps = {
@@ -14,11 +14,11 @@ const ActivityRichTextEditor = lazy(() =>
);
const RichTextFieldEditor = lazy(() =>
import(
'@/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor'
).then((module) => ({
default: module.RichTextFieldEditor,
})),
import('@/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor').then(
(module) => ({
default: module.RichTextFieldEditor,
}),
),
);
const StyledContainer = styled.div`
@@ -15,7 +15,8 @@ import { MainButton } from 'twenty-ui/input';
const StyledContainer = styled.div`
align-items: center;
background: repeating-linear-gradient(
background:
repeating-linear-gradient(
0deg,
${themeCssVariables.font.color.primary},
${themeCssVariables.font.color.primary} 10px,
@@ -15,19 +15,19 @@ type WorkflowActionCodeProps = {
};
const WorkflowEditActionCode = lazy(() =>
import(
'@/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionCode'
).then((module) => ({
default: module.WorkflowEditActionCode,
})),
import('@/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionCode').then(
(module) => ({
default: module.WorkflowEditActionCode,
}),
),
);
const WorkflowReadonlyActionCode = lazy(() =>
import(
'@/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowReadonlyActionCode'
).then((module) => ({
default: module.WorkflowReadonlyActionCode,
})),
import('@/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowReadonlyActionCode').then(
(module) => ({
default: module.WorkflowReadonlyActionCode,
}),
),
);
export const WorkflowActionCode = ({
@@ -34,13 +34,9 @@ export const preloadMockedMetadata =
{ mockedViews },
{ mockedNavigationMenuItems },
] = await Promise.all([
import(
'~/testing/mock-data/generated/metadata/objects/mock-objects-metadata'
),
import('~/testing/mock-data/generated/metadata/objects/mock-objects-metadata'),
import('~/testing/mock-data/generated/metadata/views/mock-views-data'),
import(
'~/testing/mock-data/generated/metadata/navigation-menu-items/mock-navigation-menu-items-data'
),
import('~/testing/mock-data/generated/metadata/navigation-menu-items/mock-navigation-menu-items-data'),
]);
const { flatObjects, flatFields, flatIndexes } =
@@ -84,9 +84,7 @@ const addAction = async (options: {
test?: boolean;
}) => {
if (options.apiUrl) {
console.warn(
chalk.yellow('⚠ --api-url is deprecated. Use --url instead.'),
);
console.warn(chalk.yellow('⚠ --api-url is deprecated. Use --url instead.'));
}
const configPath = options.test ? getConfigPath(true) : undefined;
const configService = new ConfigService(
+51 -31
View File
@@ -24,25 +24,31 @@
],
"rules": {
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
"no-console": [
"warn",
{ "allow": ["group", "groupCollapsed", "groupEnd"] }
],
"no-control-regex": "off",
"no-debugger": "error",
"no-duplicate-imports": "error",
"no-undef": "off",
"no-unused-vars": "off",
"no-redeclare": "off",
"no-restricted-imports": ["error", {
"patterns": [
{
"group": ["**../"],
"message": "Relative imports are not allowed."
},
{
"group": ["lodash"],
"message": "Please use the standalone lodash package (for instance: `import groupBy from 'lodash.groupby'` instead of `import { groupBy } from 'lodash'`)"
}
]
}],
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": ["**../"],
"message": "Relative imports are not allowed."
},
{
"group": ["lodash"],
"message": "Please use the standalone lodash package (for instance: `import groupBy from 'lodash.groupby'` instead of `import { groupBy } from 'lodash'`)"
}
]
}
],
"import/no-duplicates": "error",
@@ -51,36 +57,50 @@
"typescript/consistent-type-imports": "off",
"typescript/explicit-function-return-type": "off",
"typescript/explicit-module-boundary-types": "off",
"typescript/no-empty-object-type": ["error", {
"allowInterfaces": "with-single-extends"
}],
"typescript/no-empty-object-type": [
"error",
{
"allowInterfaces": "with-single-extends"
}
],
"typescript/no-empty-function": "off",
"typescript/no-explicit-any": "warn",
"typescript/no-floating-promises": "error",
"typescript/no-misused-promises": "error",
"typescript/no-unused-vars": ["warn", {
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}],
"typescript/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"twenty/inject-workspace-repository": "warn",
"twenty/rest-api-methods-should-be-guarded": "error",
"twenty/graphql-resolvers-should-be-guarded": "error",
"twenty/upgrade-command-filename": "error",
"twenty/enforce-module-boundaries": ["error", {
"depConstraints": [
{
"sourceTag": "scope:backend",
"onlyDependOnLibsWithTags": ["scope:shared", "scope:backend"]
}
]
}]
"twenty/enforce-module-boundaries": [
"error",
{
"depConstraints": [
{
"sourceTag": "scope:backend",
"onlyDependOnLibsWithTags": ["scope:shared", "scope:backend"]
}
]
}
]
},
"overrides": [
{
"files": ["**/*.spec.ts", "**/*.integration-spec.ts", "**/__tests__/**", "**/test/**"],
"files": [
"**/*.spec.ts",
"**/*.integration-spec.ts",
"**/__tests__/**",
"**/test/**"
],
"rules": {
"typescript/no-explicit-any": "off"
}
+6 -3
View File
@@ -10,9 +10,12 @@
"baseUrl": "./../../",
"experimental": {
"plugins": [
["@lingui/swc-plugin", {
"stripNonEssentialFields": false
}]
[
"@lingui/swc-plugin",
{
"stripNonEssentialFields": false
}
]
]
}
},
+4 -4
View File
@@ -158,12 +158,12 @@
],
"options": {
"cwd": "{projectRoot}",
"command": "npx oxlint --type-aware -c .oxlintrc.json src/ && (prettier src/ --check --cache --cache-location ../../.cache/prettier/{projectRoot} --cache-strategy metadata || (echo 'ERROR: Prettier formatting check failed! Fix with: npx nx lint twenty-server --configuration=fix' && false))"
"command": "npx oxlint --type-aware -c .oxlintrc.json src/ && (npx oxfmt --check src/ || (echo 'ERROR: oxfmt formatting check failed! Fix with: npx nx lint twenty-server --configuration=fix' && false))"
},
"configurations": {
"ci": {},
"fix": {
"command": "npx oxlint --type-aware --fix -c .oxlintrc.json src/ && prettier src/ --write --cache --cache-location ../../.cache/prettier/{projectRoot} --cache-strategy metadata"
"command": "npx oxlint --type-aware --fix -c .oxlintrc.json src/ && npx oxfmt src/"
}
}
},
@@ -172,11 +172,11 @@
"dependsOn": ["twenty-oxlint-rules:build"],
"options": {
"cwd": "{projectRoot}",
"command": "FILES=$(git diff --name-only --relative --diff-filter=d main...HEAD -- src/ | grep -E '\\.(ts|tsx)$'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --type-aware -c .oxlintrc.json $FILES && (prettier --check $FILES || (echo 'ERROR: Prettier formatting check failed! Fix with: npx nx lint:diff-with-main twenty-server --configuration=fix' && false)))"
"command": "FILES=$(git diff --name-only --relative --diff-filter=d main...HEAD -- src/ | grep -E '\\.(ts|tsx)$'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --type-aware -c .oxlintrc.json $FILES && (npx oxfmt --check $FILES || (echo 'ERROR: oxfmt formatting check failed! Fix with: npx nx lint:diff-with-main twenty-server --configuration=fix' && false)))"
},
"configurations": {
"fix": {
"command": "FILES=$(git diff --name-only --relative --diff-filter=d main...HEAD -- src/ | grep -E '\\.(ts|tsx)$'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --type-aware --fix -c .oxlintrc.json $FILES && prettier --write $FILES)"
"command": "FILES=$(git diff --name-only --relative --diff-filter=d main...HEAD -- src/ | grep -E '\\.(ts|tsx)$'); [ -z \"$FILES\" ] && echo 'No changed files.' || (npx oxlint --type-aware --fix -c .oxlintrc.json $FILES && npx oxfmt $FILES)"
}
}
},
@@ -142,9 +142,7 @@ const extractCost = (
model.cacheCreationCostPerMillionTokens = cost.cache_write;
}
const longCtx = cost.context_over_200k as
| Record<string, unknown>
| undefined;
const longCtx = cost.context_over_200k as Record<string, unknown> | undefined;
if (longCtx && typeof longCtx.input === 'number') {
model.longContextCost = {
@@ -9,8 +9,8 @@ import { type WorkspaceIteratorService } from 'src/database/commands/command-run
export type ActiveOrSuspendedWorkspaceCommandOptions = WorkspaceCommandOptions;
export abstract class ActiveOrSuspendedWorkspaceCommandRunner<
Options extends
ActiveOrSuspendedWorkspaceCommandOptions = ActiveOrSuspendedWorkspaceCommandOptions,
Options extends ActiveOrSuspendedWorkspaceCommandOptions =
ActiveOrSuspendedWorkspaceCommandOptions,
> extends WorkspaceCommandRunner<Options> {
constructor(
protected readonly workspaceIteratorService: WorkspaceIteratorService,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.21.0', 1775129420309)
export class AddViewFieldGroupIdIndexOnViewFieldFastInstanceCommand
implements FastInstanceCommand
{
export class AddViewFieldGroupIdIndexOnViewFieldFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE INDEX IF NOT EXISTS "IDX_VIEW_FIELD_VIEW_FIELD_GROUP_ID" ON "core"."viewField" ("viewFieldGroupId")`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.21.0', 1775165049548)
export class MigrateMessagingCalendarToCoreFastInstanceCommand
implements FastInstanceCommand
{
export class MigrateMessagingCalendarToCoreFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."messageFolder" ALTER COLUMN "parentFolderId" TYPE character varying`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.21.0', 1775200000000)
export class AddEmailThreadWidgetTypeFastInstanceCommand
implements FastInstanceCommand
{
export class AddEmailThreadWidgetTypeFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TYPE "core"."pageLayoutWidget_type_enum" RENAME TO "pageLayoutWidget_type_enum_old"`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.22.0', 1775749486425)
export class AddPermissionFlagRoleIdIndexFastInstanceCommand
implements FastInstanceCommand
{
export class AddPermissionFlagRoleIdIndexFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'CREATE INDEX IF NOT EXISTS "IDX_PERMISSION_FLAG_ROLE_ID" ON "core"."permissionFlag" ("roleId") ',
@@ -15,9 +15,7 @@ const TABLES = [
];
@RegisteredInstanceCommand('1.22.0', 1775758621017)
export class AddWorkspaceIdToIndirectEntitiesFastInstanceCommand
implements FastInstanceCommand
{
export class AddWorkspaceIdToIndirectEntitiesFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
for (const table of TABLES) {
await queryRunner.query(
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.22.0', 1775761294897)
export class AddWorkspaceIdIndexesAndFksFastInstanceCommand
implements FastInstanceCommand
{
export class AddWorkspaceIdIndexesAndFksFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'CREATE INDEX IF NOT EXISTS "IDX_78ae6cfe5f49a76c4bf842ad58" ON "core"."applicationVariable" ("workspaceId") ',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.22.0', 1775804361516)
export class DropObjectMetadataDataSourceFkFastInstanceCommand
implements FastInstanceCommand
{
export class DropObjectMetadataDataSourceFkFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE "core"."objectMetadata" DROP CONSTRAINT "FK_0b19dd17369574578bc18c405b2"',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.22.0', 1776078919203)
export class AddCreditBalanceToBillingCustomerFastInstanceCommand
implements FastInstanceCommand
{
export class AddCreditBalanceToBillingCustomerFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
const tableExists = await queryRunner.query(
`SELECT 1 FROM pg_tables WHERE schemaname = 'core' AND tablename = 'billingCustomer'`,
@@ -56,9 +56,7 @@ const BACKFILL_DEFINITIONS: BackfillDefinition[] = [
const TABLES = BACKFILL_DEFINITIONS.map((definition) => definition.table);
@RegisteredInstanceCommand('1.22.0', 1775758621018, { type: 'slow' })
export class BackfillWorkspaceIdOnIndirectEntitiesSlowInstanceCommand
implements SlowInstanceCommand
{
export class BackfillWorkspaceIdOnIndirectEntitiesSlowInstanceCommand implements SlowInstanceCommand {
async runDataMigration(dataSource: DataSource): Promise<void> {
for (const { table, parentTable, foreignKey } of BACKFILL_DEFINITIONS) {
await dataSource.query(
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.23.0', 1775654781000)
export class AddConditionalAvailabilityExpressionToPageLayoutWidgetFastInstanceCommand
implements FastInstanceCommand
{
export class AddConditionalAvailabilityExpressionToPageLayoutWidgetFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."pageLayoutWidget" ADD COLUMN IF NOT EXISTS "conditionalAvailabilityExpression" varchar`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.23.0', 1775752190522)
export class AddTableWidgetViewTypeFastInstanceCommand
implements FastInstanceCommand
{
export class AddTableWidgetViewTypeFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TYPE "core"."view_type_enum" ADD VALUE IF NOT EXISTS 'TABLE_WIDGET' AFTER 'FIELDS_WIDGET'`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.23.0', 1775752781995)
export class AddStandalonePageFastInstanceCommand
implements FastInstanceCommand
{
export class AddStandalonePageFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE "core"."navigationMenuItem" ADD "pageLayoutId" uuid',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.23.0', 1776090711153)
export class AddGlobalObjectContextToCommandMenuItemAvailabilityTypeFastInstanceCommand
implements FastInstanceCommand
{
export class AddGlobalObjectContextToCommandMenuItemAvailabilityTypeFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TYPE "core"."commandMenuItem_availabilitytype_enum" RENAME TO "commandMenuItem_availabilitytype_enum_old"',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.23.0', 1776168404836)
export class AddPageLayoutIdToCommandMenuItemFastInstanceCommand
implements FastInstanceCommand
{
export class AddPageLayoutIdToCommandMenuItemFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE "core"."commandMenuItem" ADD "pageLayoutId" uuid',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('1.23.0', 1785000000000)
export class DropWorkspaceVersionColumnFastInstanceCommand
implements FastInstanceCommand
{
export class DropWorkspaceVersionColumnFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."workspace" DROP COLUMN IF EXISTS "version"`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.1.0', 1776886452831)
export class AddIsPreInstalledToApplicationRegistrationFastInstanceCommand
implements FastInstanceCommand
{
export class AddIsPreInstalledToApplicationRegistrationFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE "core"."applicationRegistration" ADD "isPreInstalled" boolean NOT NULL DEFAULT false',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.1.0', 1777012800000)
export class AddProviderExecutedToAgentMessagePartFastInstanceCommand
implements FastInstanceCommand
{
export class AddProviderExecutedToAgentMessagePartFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE "core"."agentMessagePart" ADD "providerExecuted" boolean',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { SlowInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/slow-instance-command.interface';
@RegisteredInstanceCommand('2.1.0', 1795000002000, { type: 'slow' })
export class BackfillPageLayoutWidgetPositionSlowInstanceCommand
implements SlowInstanceCommand
{
export class BackfillPageLayoutWidgetPositionSlowInstanceCommand implements SlowInstanceCommand {
async runDataMigration(dataSource: DataSource): Promise<void> {
await dataSource.query(
`UPDATE "core"."pageLayoutWidget"
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.2.0', 1777455269302)
export class AddCacheTokensToAgentChatThreadFastInstanceCommand
implements FastInstanceCommand
{
export class AddCacheTokensToAgentChatThreadFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."agentChatThread" ADD "totalCacheReadTokens" bigint NOT NULL DEFAULT 0`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.2.0', 1777539664664)
export class AddLogoToApplicationFastInstanceCommand
implements FastInstanceCommand
{
export class AddLogoToApplicationFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('ALTER TABLE "core"."application" ADD "logo" text');
}
@@ -20,9 +20,7 @@ import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/
// `IF NOT EXISTS`), so cross-upgrade callers see it as a no-op while
// fresh-from-2.5 install paths still create the column there as before.
@RegisteredInstanceCommand('2.3.0', 1747234200000)
export class AddSubFieldNameToViewSortEarlyFastInstanceCommand
implements FastInstanceCommand
{
export class AddSubFieldNameToViewSortEarlyFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."viewSort" ADD COLUMN IF NOT EXISTS "subFieldName" character varying`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.3.0', 1747234300000)
export class AddRelationTargetFieldMetadataIdToViewFilterEarlyFastInstanceCommand
implements FastInstanceCommand
{
export class AddRelationTargetFieldMetadataIdToViewFilterEarlyFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."viewFilter" ADD COLUMN IF NOT EXISTS "relationTargetFieldMetadataId" uuid`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.3.0', 1777308014234)
export class AddUpgradeMigrationWorkspaceIdIndexFastInstanceCommand
implements FastInstanceCommand
{
export class AddUpgradeMigrationWorkspaceIdIndexFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'CREATE INDEX IF NOT EXISTS "IDX_UPGRADE_MIGRATION_WORKSPACE_ID_NAME_ATTEMPT" ON "core"."upgradeMigration" ("workspaceId", "name", "attempt") WHERE "workspaceId" IS NOT NULL',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.3.0', 1777682000000)
export class AddDeletedAtToAgentChatThreadFastInstanceCommand
implements FastInstanceCommand
{
export class AddDeletedAtToAgentChatThreadFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."agentChatThread" ADD "deletedAt" TIMESTAMP WITH TIME ZONE`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.3.0', 1777896012579)
export class ConnectionProviderSyncableEntityFastInstanceCommand
implements FastInstanceCommand
{
export class ConnectionProviderSyncableEntityFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "core"."connectionProvider" (
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.3.0', 1777915958318)
export class RemoveUserDefaultAvatarUrlFastInstanceCommand
implements FastInstanceCommand
{
export class RemoveUserDefaultAvatarUrlFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE "core"."user" DROP COLUMN "defaultAvatarUrl"',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.3.0', 1777966965587)
export class TransformApplicationVariableToSyncableEntityFastInstanceCommand
implements FastInstanceCommand
{
export class TransformApplicationVariableToSyncableEntityFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'DROP INDEX "core"."IDX_78ae6cfe5f49a76c4bf842ad58"',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.3.0', 1797000001000)
export class AddToolAndWorkflowActionTriggerSettingsFastInstanceCommand
implements FastInstanceCommand
{
export class AddToolAndWorkflowActionTriggerSettingsFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."logicFunction" ADD "toolTriggerSettings" jsonb`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { SlowInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/slow-instance-command.interface';
@RegisteredInstanceCommand('2.3.0', 1777966965588, { type: 'slow' })
export class BackfillApplicationVariableUniversalIdentifierSlowInstanceCommand
implements SlowInstanceCommand
{
export class BackfillApplicationVariableUniversalIdentifierSlowInstanceCommand implements SlowInstanceCommand {
async runDataMigration(dataSource: DataSource): Promise<void> {
await dataSource.query(
'DELETE FROM "core"."applicationVariable" WHERE "applicationId" IS NULL',
@@ -6,9 +6,7 @@ import { SlowInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/
// isTool=true previously exposed a function on both surfaces (AI tool and
// workflow node), so we populate both new triggers when migrating.
@RegisteredInstanceCommand('2.3.0', 1797000002000, { type: 'slow' })
export class MigrateToolTriggerSettingsSlowInstanceCommand
implements SlowInstanceCommand
{
export class MigrateToolTriggerSettingsSlowInstanceCommand implements SlowInstanceCommand {
async runDataMigration(dataSource: DataSource): Promise<void> {
const defaultJsonSchema = `'{"type":"object","properties":{}}'::jsonb`;
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.4.0', 1747234400000)
export class AddRelationTargetFieldMetadataIdToViewFilterEarly2_4FastInstanceCommand
implements FastInstanceCommand
{
export class AddRelationTargetFieldMetadataIdToViewFilterEarly2_4FastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."viewFilter" ADD COLUMN IF NOT EXISTS "relationTargetFieldMetadataId" uuid`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.4.0', 1777100000000)
export class AddMetadataToBillingPriceFastInstanceCommand
implements FastInstanceCommand
{
export class AddMetadataToBillingPriceFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
const tableExists = await queryRunner.query(
`SELECT 1 FROM pg_tables WHERE schemaname = 'core' AND tablename = 'billingPrice'`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.4.0', 1778256809018)
export class AddEmailGroupChannelTypeFastInstanceCommand
implements FastInstanceCommand
{
export class AddEmailGroupChannelTypeFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TYPE "core"."messageChannel_type_enum" RENAME TO "messageChannel_type_enum_old"',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.4.0', 1798000003000)
export class AddApplicationIdToPublicDomainFastInstanceCommand
implements FastInstanceCommand
{
export class AddApplicationIdToPublicDomainFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."publicDomain" ADD "applicationId" uuid`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.5.0', 1747234500000)
export class AddRelationTargetFieldMetadataIdToViewFilterEarly2_5FastInstanceCommand
implements FastInstanceCommand
{
export class AddRelationTargetFieldMetadataIdToViewFilterEarly2_5FastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."viewFilter" ADD COLUMN IF NOT EXISTS "relationTargetFieldMetadataId" uuid`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.5.0', 1778502963794)
export class AddSubFieldNameToViewSortFastInstanceCommand
implements FastInstanceCommand
{
export class AddSubFieldNameToViewSortFastInstanceCommand implements FastInstanceCommand {
// Idempotent so it can coexist with the early 2.3 instance command
// `1747234200000-add-sub-field-name-to-view-sort` (see that file for context).
public async up(queryRunner: QueryRunner): Promise<void> {
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.5.0', 1778525104406)
export class AddIsInternalMessagesImportEnabledFastInstanceCommand
implements FastInstanceCommand
{
export class AddIsInternalMessagesImportEnabledFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE "core"."workspace" ADD COLUMN IF NOT EXISTS "isInternalMessagesImportEnabled" boolean NOT NULL DEFAULT false',
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.5.0', 1778550000000)
export class CreateSigningKeyTableFastInstanceCommand
implements FastInstanceCommand
{
export class CreateSigningKeyTableFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE IF NOT EXISTS "core"."signingKey" (
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.5.0', 1798500000000)
export class DropPostgresCredentialsTableFastInstanceCommand
implements FastInstanceCommand
{
export class DropPostgresCredentialsTableFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE IF EXISTS "core"."postgresCredentials" DROP CONSTRAINT IF EXISTS "FK_9494639abc06f9c8c3691bf5d22"`,
@@ -26,9 +26,7 @@ const isPlaintext = (value: string | null): value is string =>
isDefined(value) && !value.startsWith(SECRET_ENCRYPTION_ENVELOPE_V2_PREFIX);
@RegisteredInstanceCommand('2.5.0', 1798000004000, { type: 'slow' })
export class EncryptConnectedAccountTokensSlowInstanceCommand
implements SlowInstanceCommand
{
export class EncryptConnectedAccountTokensSlowInstanceCommand implements SlowInstanceCommand {
constructor(
private readonly connectedAccountTokenEncryptionService: ConnectedAccountTokenEncryptionService,
) {}
@@ -34,9 +34,7 @@ const looksLikeLegacyCtrCiphertext = (value: string): boolean =>
LEGACY_CTR_LOOKS_LIKE_BASE64_RE.test(value);
@RegisteredInstanceCommand('2.5.0', 1798000005000, { type: 'slow' })
export class EncryptApplicationVariableSlowInstanceCommand
implements SlowInstanceCommand
{
export class EncryptApplicationVariableSlowInstanceCommand implements SlowInstanceCommand {
private readonly logger = new Logger(
EncryptApplicationVariableSlowInstanceCommand.name,
);
@@ -19,9 +19,7 @@ type ApplicationRegistrationVariableRow = {
};
@RegisteredInstanceCommand('2.5.0', 1798000006000, { type: 'slow' })
export class EncryptApplicationRegistrationVariableSlowInstanceCommand
implements SlowInstanceCommand
{
export class EncryptApplicationRegistrationVariableSlowInstanceCommand implements SlowInstanceCommand {
constructor(
private readonly secretEncryptionService: SecretEncryptionService,
) {}
@@ -18,9 +18,7 @@ type SigningKeyRow = {
};
@RegisteredInstanceCommand('2.5.0', 1798000007000, { type: 'slow' })
export class EncryptSigningKeyPrivateKeysSlowInstanceCommand
implements SlowInstanceCommand
{
export class EncryptSigningKeyPrivateKeysSlowInstanceCommand implements SlowInstanceCommand {
constructor(
private readonly secretEncryptionService: SecretEncryptionService,
) {}
@@ -14,9 +14,7 @@ import { TypedReflect } from 'src/utils/typed-reflect';
type SensitiveConfigRow = { id: string; value: unknown };
@RegisteredInstanceCommand('2.5.0', 1798000008000, { type: 'slow' })
export class EncryptSensitiveConfigStorageSlowInstanceCommand
implements SlowInstanceCommand
{
export class EncryptSensitiveConfigStorageSlowInstanceCommand implements SlowInstanceCommand {
constructor(
private readonly secretEncryptionService: SecretEncryptionService,
) {}
@@ -22,9 +22,7 @@ type TwoFactorMethodRow = {
};
@RegisteredInstanceCommand('2.5.0', 1798000009000, { type: 'slow' })
export class EncryptTotpSecretsSlowInstanceCommand
implements SlowInstanceCommand
{
export class EncryptTotpSecretsSlowInstanceCommand implements SlowInstanceCommand {
constructor(
private readonly secretEncryptionService: SecretEncryptionService,
private readonly simpleSecretEncryptionUtil: SimpleSecretEncryptionUtil,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.6.0', 1778235340020)
export class RenamePermissionFlagToRolePermissionFlagFastInstanceCommand
implements FastInstanceCommand
{
export class RenamePermissionFlagToRolePermissionFlagFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."permissionFlag" RENAME TO "rolePermissionFlag"`,
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.6.0', 1778235340021)
export class PermissionFlagSyncableEntityFastInstanceCommand
implements FastInstanceCommand
{
export class PermissionFlagSyncableEntityFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "core"."permissionFlag" (
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.6.0', 1778235340022)
export class LinkRolePermissionFlagToPermissionFlagFastInstanceCommand
implements FastInstanceCommand
{
export class LinkRolePermissionFlagToPermissionFlagFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."rolePermissionFlag"
@@ -4,9 +4,7 @@ import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decor
import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
@RegisteredInstanceCommand('2.6.0', 1798000005000)
export class AddRelationTargetFieldMetadataIdToViewFilterFastInstanceCommand
implements FastInstanceCommand
{
export class AddRelationTargetFieldMetadataIdToViewFilterFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."viewFilter" ADD COLUMN IF NOT EXISTS "relationTargetFieldMetadataId" uuid`,
@@ -9,9 +9,7 @@ const CALENDAR_CHANNEL_INDEX_NAME =
'IDX_CALENDAR_CHANNEL_WORKSPACE_ID_SYNC_ENABLED_SYNC_STAGE';
@RegisteredInstanceCommand('2.6.0', 1798000010000)
export class AddChannelSyncStageIndexesFastInstanceCommand
implements FastInstanceCommand
{
export class AddChannelSyncStageIndexesFastInstanceCommand implements FastInstanceCommand {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE INDEX IF NOT EXISTS "${MESSAGE_CHANNEL_INDEX_NAME}" ON "core"."messageChannel" ("workspaceId", "isSyncEnabled", "syncStage")`,

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