335 workflow implement workflow cron triggers backend (#9988)
[Backend side] Add cron triggers to workflow Closes https://github.com/twentyhq/core-team-issues/issues/335
This commit is contained in:
5
packages/twenty-shared/src/constants/index.ts
Normal file
5
packages/twenty-shared/src/constants/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export * from './FieldForTotalCountAggregateOperation';
|
||||
export * from './Locales';
|
||||
export * from './TwentyCompaniesBaseUrl';
|
||||
export * from './TwentyIconsBaseUrl';
|
||||
export * from './SettingsFeatures';
|
||||
@ -1,13 +1,4 @@
|
||||
export * from './constants/FieldForTotalCountAggregateOperation';
|
||||
export * from './constants/Locales';
|
||||
export * from './constants/SettingsFeatures';
|
||||
export * from './constants/TwentyCompaniesBaseUrl';
|
||||
export * from './constants/TwentyIconsBaseUrl';
|
||||
export * from './types/ConnectedAccountProvider';
|
||||
export * from './types/FieldMetadataType';
|
||||
export * from './utils/fieldMetadata/isFieldMetadataDateKind';
|
||||
export * from './utils/image/getImageAbsoluteURI';
|
||||
export * from './utils/isDefined';
|
||||
export * from './utils/isValidLocale';
|
||||
export * from './utils/strings';
|
||||
export * from './constants';
|
||||
export * from './types';
|
||||
export * from './utils';
|
||||
export * from './workspace';
|
||||
|
||||
2
packages/twenty-shared/src/types/index.ts
Normal file
2
packages/twenty-shared/src/types/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './ConnectedAccountProvider';
|
||||
export * from './FieldMetadataType';
|
||||
1
packages/twenty-shared/src/utils/fieldMetadata/index.ts
Normal file
1
packages/twenty-shared/src/utils/fieldMetadata/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './isFieldMetadataDateKind';
|
||||
1
packages/twenty-shared/src/utils/image/index.ts
Normal file
1
packages/twenty-shared/src/utils/image/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './getImageAbsoluteURI';
|
||||
5
packages/twenty-shared/src/utils/index.ts
Normal file
5
packages/twenty-shared/src/utils/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export * from './fieldMetadata';
|
||||
export * from './image';
|
||||
export * from './strings';
|
||||
export * from './validation';
|
||||
export * from './validation';
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '../capitalize.util';
|
||||
import { capitalize } from '../capitalize';
|
||||
describe('capitalize', () => {
|
||||
it('should capitalize a string', () => {
|
||||
expect(capitalize('test')).toBe('Test');
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
import { isValidUuid } from '../isValidUuid.util';
|
||||
|
||||
describe('isValidUuid', () => {
|
||||
it('should return true for a valid UUID', () => {
|
||||
expect(isValidUuid('123e4567-e89b-12d3-a456-426614174000')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for an invalid UUID', () => {
|
||||
expect(isValidUuid('123e4567-e89b-12d3-a456-426614174000')).toBe(false);
|
||||
});
|
||||
});
|
||||
@ -1,2 +1 @@
|
||||
export * from './capitalize.util';
|
||||
export * from './isValidUuid.util';
|
||||
export * from './capitalize';
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
export const isValidUuid = (value: string) => {
|
||||
return /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(
|
||||
value,
|
||||
);
|
||||
};
|
||||
@ -0,0 +1,19 @@
|
||||
import { isValidUuid } from '../isValidUuid';
|
||||
|
||||
describe('isValidUuid', () => {
|
||||
it('should return true for a valid UUID', () => {
|
||||
expect(isValidUuid('123e4567-e89b-12d3-a456-426614174000')).toBe(true);
|
||||
expect(isValidUuid('550e8400-e29b-41d4-a716-446655440000')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for an invalid UUID', () => {
|
||||
expect(isValidUuid('invalid-uuid')).toBe(false);
|
||||
expect(isValidUuid('12345')).toBe(false);
|
||||
expect(isValidUuid('550e8400e29b41d4a716446655440000')).toBe(false);
|
||||
expect(isValidUuid('')).toBe(false);
|
||||
expect(isValidUuid('123e4567-e89b-12d3-a456-42661417400-')).toBe(false);
|
||||
expect(isValidUuid('123e4567-e89b-12d3-a456-42661417400')).toBe(false);
|
||||
expect(isValidUuid('123e4567-e89b-12d3-a456-42661417400)')).toBe(false);
|
||||
expect(isValidUuid('123e4567-e89b-12d3-a456-4266141740001')).toBe(false);
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,15 @@
|
||||
import { isValidLocale } from '../isValidLocale';
|
||||
import { APP_LOCALES } from 'src/constants/Locales';
|
||||
|
||||
describe('isValidLocale', () => {
|
||||
it('should return true for valid locales', () => {
|
||||
Object.keys(APP_LOCALES).forEach((locale) => {
|
||||
expect(isValidLocale(locale)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('should return false for invalid locales', () => {
|
||||
expect(isValidLocale('invalidLocale')).toBe(false);
|
||||
expect(isValidLocale(null)).toBe(false);
|
||||
});
|
||||
});
|
||||
3
packages/twenty-shared/src/utils/validation/index.ts
Normal file
3
packages/twenty-shared/src/utils/validation/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export * from './isValidUuid';
|
||||
export * from './isDefined';
|
||||
export * from './isValidLocale';
|
||||
@ -0,0 +1,5 @@
|
||||
export const isValidUuid = (value: string): boolean => {
|
||||
const uuidRegex =
|
||||
/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
||||
return uuidRegex.test(value);
|
||||
};
|
||||
@ -1,2 +1,2 @@
|
||||
export * from './types/WorkspaceActivationStatus';
|
||||
export * from './utils/isWorkspaceActiveOrSuspended';
|
||||
export * from './types';
|
||||
export * from './utils';
|
||||
|
||||
1
packages/twenty-shared/src/workspace/types/index.ts
Normal file
1
packages/twenty-shared/src/workspace/types/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './WorkspaceActivationStatus';
|
||||
1
packages/twenty-shared/src/workspace/utils/index.ts
Normal file
1
packages/twenty-shared/src/workspace/utils/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './isWorkspaceActiveOrSuspended';
|
||||
Reference in New Issue
Block a user