Skip to content

Commit

Permalink
Merge branch 'main' into improvement/tenant-removal
Browse files Browse the repository at this point in the history
  • Loading branch information
epipav committed Jan 20, 2025
2 parents 4bab0c1 + 9f8d9b0 commit 2520f5c
Show file tree
Hide file tree
Showing 126 changed files with 41 additions and 8,429 deletions.
2 changes: 1 addition & 1 deletion backend/.env.dist.local
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ CROWD_STACKEXCHANGE_KEY=
# Nango settings
CROWD_NANGO_URL=http://localhost:3003
CROWD_NANGO_SECRET_KEY=424242
CROWD_NANGO_INTEGRATIONS=reddit,linkedin,stackexchange,hubspot
CROWD_NANGO_INTEGRATIONS=reddit,linkedin,stackexchange

# Cohere settings
CROWD_COHERE_API_KEY=
Expand Down
5 changes: 0 additions & 5 deletions backend/config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@
"stackexchange": {
"key": "CROWD_STACKEXCHANGE_KEY"
},
"hubspot": {
"appId": "CROWD_HUBSPOT_APP_ID",
"clientId": "CROWD_HUBSPOT_CLIENT_ID",
"clientSecret": "CROWD_HUBSPOT_CLIENT_SECRET"
},
"reddit": {
"clientId": "CROWD_REDDIT_CLIENT_ID",
"clientSecret": "CROWD_REDDIT_CLIENT_SECRET"
Expand Down
8 changes: 4 additions & 4 deletions backend/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
"crowdAnalytics": {
"isEnabled": "false"
},
"temporal": {
"automationsTaskQueue": "automations"
},
"temporal": {},
"searchSyncApi": {},
"encryption": {},
"openStatusApi": {},
"gitlab": {}
"gitlab": {},
"jiraIssueReporter": {},
"snowflake": {}
}
4 changes: 2 additions & 2 deletions backend/id-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ paths:
description: Organization ID
source:
type: string
enum: ['ui', 'email-domain', 'enrichment', 'hubspot', 'github']
enum: ['ui', 'email-domain', 'enrichment', 'github']
example: 'ui'
description: Data source. For manual updates, always use 'ui'
title:
Expand Down Expand Up @@ -188,7 +188,7 @@ paths:
description: Organization ID
source:
type: string
enum: ['ui', 'email-domain', 'enrichment', 'hubspot', 'github']
enum: ['ui', 'email-domain', 'enrichment', 'github']
example: 'ui'
description: Data source. For manual updates, always use 'ui'
title:
Expand Down
14 changes: 0 additions & 14 deletions backend/src/api/auth/authMe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Error403 } from '@crowd/common'

import AutomationRepository from '@/database/repositories/automationRepository'

export default async (req, res) => {
if (!req.currentUser || !req.currentUser.id) {
await req.responseHandler.error(req, res, new Error403(req.language))
Expand All @@ -10,17 +8,5 @@ export default async (req, res) => {

const payload = req.currentUser

payload.tenants = await Promise.all(
payload.tenants.map(async (tenantUser) => {
tenantUser.tenant.dataValues = {
...tenantUser.tenant.dataValues,
automationCount:
Number(await AutomationRepository.countAllActive(req.database, tenantUser.tenant.id)) ||
0,
}
return tenantUser
}),
)

await req.responseHandler.success(req, res, payload)
}
11 changes: 0 additions & 11 deletions backend/src/conf/configTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { ITemporalConfig } from '@crowd/temporal'

export enum ServiceType {
API = 'api',
JOB_GENERATOR = 'job-generator',
Expand Down Expand Up @@ -101,11 +99,6 @@ export interface SlackConfiguration {
appToken?: string
}

export interface SlackNotifierConfiguration {
clientId: string
clientSecret: string
}

export interface GoogleConfiguration {
clientId: string
clientSecret: string
Expand Down Expand Up @@ -179,10 +172,6 @@ export interface CrowdAnalyticsConfiguration {
apiToken: string
}

export interface IBackendTemporalConfig extends ITemporalConfig {
automationsTaskQueue: string
}

export interface EncryptionConfiguration {
secretKey: string
initVector: string
Expand Down
9 changes: 2 additions & 7 deletions backend/src/conf/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IDatabaseConfig } from '@crowd/data-access-layer/src/database'
import { ISearchSyncApiConfig } from '@crowd/opensearch'
import { IQueueClientConfig } from '@crowd/queue'
import { IRedisConfiguration } from '@crowd/redis'
import { ITemporalConfig } from '@crowd/temporal'
import { IGithubIssueReporterConfiguration, IJiraIssueReporterConfiguration } from '@crowd/types'

import {
Expand All @@ -21,7 +22,6 @@ import {
GithubTokenConfiguration,
GitlabConfiguration,
GoogleConfiguration,
IBackendTemporalConfig,
IOpenSearchConfig,
IOpenStatusApiConfig,
IRedditConfig,
Expand All @@ -34,7 +34,6 @@ import {
ServiceType,
SlackAlertingConfiguration,
SlackConfiguration,
SlackNotifierConfiguration,
SnowflakeConfiguration,
StackExchangeConfiguration,
TenantMode,
Expand Down Expand Up @@ -100,9 +99,6 @@ export const TWITTER_CONFIG: TwitterConfiguration = config.get<TwitterConfigurat

export const SLACK_CONFIG: SlackConfiguration = config.get<SlackConfiguration>('slack')

export const SLACK_NOTIFIER_CONFIG: SlackNotifierConfiguration =
config.get<SlackNotifierConfiguration>('slackNotifier')

export const GOOGLE_CONFIG: GoogleConfiguration = config.get<GoogleConfiguration>('google')

export const DISCORD_CONFIG: DiscordConfiguration = config.get<DiscordConfiguration>('discord')
Expand Down Expand Up @@ -144,8 +140,7 @@ export const INTEGRATION_PROCESSING_CONFIG: IntegrationProcessingConfiguration =
export const CROWD_ANALYTICS_CONFIG: CrowdAnalyticsConfiguration =
config.get<CrowdAnalyticsConfiguration>('crowdAnalytics')

export const TEMPORAL_CONFIG: IBackendTemporalConfig =
config.get<IBackendTemporalConfig>('temporal')
export const TEMPORAL_CONFIG: ITemporalConfig = config.get<ITemporalConfig>('temporal')

export const SEARCH_SYNC_API_CONFIG: ISearchSyncApiConfig =
config.get<ISearchSyncApiConfig>('searchSyncApi')
Expand Down
74 changes: 0 additions & 74 deletions backend/src/database/models/automation.ts

This file was deleted.

90 changes: 0 additions & 90 deletions backend/src/database/models/automationExecution.ts

This file was deleted.

2 changes: 0 additions & 2 deletions backend/src/database/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ async function models(queryTimeoutMilliseconds: number, databaseHostnameOverride
require('./conversationSettings').default,
require('./eagleEyeContent').default,
require('./eagleEyeAction').default,
require('./automation').default,
require('./automationExecution').default,
require('./organization').default,
require('./memberAttributeSettings').default,
require('./segment').default,
Expand Down
Loading

0 comments on commit 2520f5c

Please sign in to comment.