diff --git a/apps/api-gateway/src/main.ts b/apps/api-gateway/src/main.ts index f8ea92a8..417a1901 100644 --- a/apps/api-gateway/src/main.ts +++ b/apps/api-gateway/src/main.ts @@ -26,7 +26,7 @@ async function bootstrap() { ) const configService = app.get(ConfigService) - const frontendUrl = configService.get('FRONTEND_HOST') + const frontendUrl = configService.getOrThrow('FRONTEND_HOST') app.enableCors({ origin: [frontendUrl], diff --git a/apps/web/modules/flows/flows/defaultColumns.tsx b/apps/web/modules/flows/flows/defaultColumns.tsx index 362a212d..b6cf1ebd 100644 --- a/apps/web/modules/flows/flows/defaultColumns.tsx +++ b/apps/web/modules/flows/flows/defaultColumns.tsx @@ -7,8 +7,10 @@ import { FlowStatus, TriggerType, assertNotNullOrUndefined, + builImageUrlFromConnectorPacakgeName, flowHelper, isCustomHttpExceptionAxios, + isStepBaseSettings, isTrigger, } from '@linkerry/shared' import { @@ -37,6 +39,7 @@ import { import { Button, Icons } from '@linkerry/ui-components/server' import { ColumnDef } from '@tanstack/react-table' import dayjs from 'dayjs' +import Image from 'next/image' import Link from 'next/link' import { useCallback, useState } from 'react' import { getBrowserQueryCllient } from '../../../libs/react-query' @@ -73,11 +76,44 @@ export const columns: ColumnDef[] = [
- {/* {`${row.original.version.stepsCount} ${flowVersionChainMap[0].map((step) => step.settings.connectorName).join(', ')}`} */} - - {row.original.version.stepsCount}: - {isEmptyFlow ? 'Empty Trigger' : flowVersionChainMap[0].map((step) => step.settings.connectorName).join(', ')} + {isEmptyFlow ? ( + 'Empty Trigger' + ) : ( + <> + {flowVersionChainMap[0].slice(0, 4).map((step, index) => { + if (!isStepBaseSettings(step.settings)) + return ( + + ? + + ) + return ( + {step.displayName} + ) + })} + {flowVersionChainMap[0].length > 4 ? ( + + +{flowVersionChainMap[0].length - 4} + + ) : null} + + )}
@@ -97,6 +133,42 @@ export const columns: ColumnDef[] = [ }, }, // { + // id: 'steps', + // accessorFn: (row) => row.version.stepsCount, + // header: ({ column }) => , + // cell: ({ row }) => { + // const flowVersionChainMap = flowHelper.transformFlowVersionToChainMap(row.original.version) + // const isEmptyFlow = flowVersionChainMap[0][0].type === TriggerType.EMPTY + + // return ( + // + // + // + //
+ // {/* {`${row.original.version.stepsCount} ${flowVersionChainMap[0].map((step) => step.settings.connectorName).join(', ')}`} */} + + // {row.original.version.stepsCount}: + // + // {isEmptyFlow ? 'Empty Trigger' : flowVersionChainMap[0].map((step) => step.settings.connectorName).join(', ')} + // + //
+ //
+ // {isEmptyFlow ? null : ( + // + // {flowVersionChainMap[0].map((step) => ( + //
+ // {!isTrigger(step) && } + //

{`${isTrigger(step) ? 'Trigger' : 'Action'}: ${step.settings.connectorName} - ${step.displayName}`}

+ //
+ // ))} + //
+ // )} + //
+ //
+ // ) + // }, + // }, + // { // id: 'steps', // accessorFn: (row) => row.version.stepsCount, // header: ({ column }) => , diff --git a/apps/web/public/images/connectors/binance.png b/apps/web/public/images/connectors/binance.png index d4014f27..3c01aca3 100644 Binary files a/apps/web/public/images/connectors/binance.png and b/apps/web/public/images/connectors/binance.png differ diff --git a/apps/web/public/images/connectors/telegram.png b/apps/web/public/images/connectors/telegram-bot.png similarity index 100% rename from apps/web/public/images/connectors/telegram.png rename to apps/web/public/images/connectors/telegram-bot.png diff --git a/libs/connectors/telegram-bot/src/index.ts b/libs/connectors/telegram-bot/src/index.ts index 37cb68d4..093f597a 100644 --- a/libs/connectors/telegram-bot/src/index.ts +++ b/libs/connectors/telegram-bot/src/index.ts @@ -12,7 +12,7 @@ export const telegramBot = createConnector({ displayName: 'Telegram Bot', description: 'Build chatbots for Telegram', minimumSupportedRelease: '0.0.0', - logoUrl: '/images/connectors/telegram.png', + logoUrl: '/images/connectors/telegram-bot.png', tags: ['communication', 'bots', 'cryptocurrency'], auth: telegramBotAuth, actions: [ diff --git a/libs/nest-core/src/core.module.ts b/libs/nest-core/src/core.module.ts index fc983ec5..29a276b7 100644 --- a/libs/nest-core/src/core.module.ts +++ b/libs/nest-core/src/core.module.ts @@ -91,28 +91,29 @@ import { QUEUES } from './modules/workers/flow-worker/queues/types' export class CoreModule implements NestModule, OnApplicationBootstrap { async onApplicationBootstrap() { - // Clear env - setTimeout(() => { - delete process.env['LINKERRY_API_KEY'] - delete process.env['APPS_SECRET'] - delete process.env['MONGO_PROTOCOL'] - delete process.env['MONGO_USERNAME'] - delete process.env['MONGO_PASSWORD'] - delete process.env['MONGO_HOST'] - delete process.env['MONGO_DATABASE'] - delete process.env['APP_WEBHOOK_SECRETS'] - delete process.env['TAWK_API_KEY'] - delete process.env['STRIPE_WEBHOOK_SECRET'] - delete process.env['STRIPE_API_KEY'] - delete process.env['REDIS_PASSWORD'] - delete process.env['JWT_SECRET'] - delete process.env['COOKIES_SIGNATURE'] - delete process.env['ENCRYPTION_KEY'] - delete process.env['ENCRYPTION_ALG'] - delete process.env['IV_LENGTH'] + // TODO update it to delete only few keys + // // Clear env + // setTimeout(() => { + // delete process.env['LINKERRY_API_KEY'] + // delete process.env['APPS_SECRET'] + // delete process.env['MONGO_PROTOCOL'] + // delete process.env['MONGO_USERNAME'] + // delete process.env['MONGO_PASSWORD'] + // delete process.env['MONGO_HOST'] + // delete process.env['MONGO_DATABASE'] + // delete process.env['APP_WEBHOOK_SECRETS'] + // delete process.env['TAWK_API_KEY'] + // delete process.env['STRIPE_WEBHOOK_SECRET'] + // delete process.env['STRIPE_API_KEY'] + // delete process.env['REDIS_PASSWORD'] + // delete process.env['JWT_SECRET'] + // delete process.env['COOKIES_SIGNATURE'] + // delete process.env['ENCRYPTION_KEY'] + // delete process.env['ENCRYPTION_ALG'] + // delete process.env['IV_LENGTH'] - console.log('CLEARED') - }, 15_000) + // console.log('CLEARED') + // }, 15_000) } // Add a middleware on all routes configure(consumer: MiddlewareConsumer) { diff --git a/libs/shared/src/lib/modules/connectors/utils.ts b/libs/shared/src/lib/modules/connectors/utils.ts index 6e7b3b67..292f40d0 100644 --- a/libs/shared/src/lib/modules/connectors/utils.ts +++ b/libs/shared/src/lib/modules/connectors/utils.ts @@ -33,6 +33,11 @@ export const getConnectorAppNameFromConnectorPacakgeName = (pacakgeName: string) return pacakgeName.slice(10) } +export const builImageUrlFromConnectorPacakgeName = (pacakgeName: string): string => { + const name = pacakgeName.slice(10) + return `/images/connectors/${name}.png` +} + export const extractConnectorFromModule = (params: ExtractConnectorFromModuleParams): T => { const { module, connectorName, connectorVersion } = params const exports = Object.values(module)