Skip to content

Commit fb2c99d

Browse files
committed
remove some unused functions
1 parent e1342f6 commit fb2c99d

File tree

3 files changed

+0
-261
lines changed

3 files changed

+0
-261
lines changed

common/knowledge.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ This package contains code shared between the `web` (Next.js frontend/backend) a
1010
- **Constants (`src/constants`)**: Shared constant values
1111
- **API Keys (`src/api-keys`)**: Encryption/decryption utilities for sensitive data
1212

13-
## API Key Encryption (`src/api-keys/crypto.ts`)
14-
15-
- Provides functions for encrypting/decrypting API keys (`encryptAndStoreApiKey`, `retrieveAndDecryptApiKey`, `clearApiKey`)
16-
- **Security**: Functions require the 32-byte `API_KEY_ENCRYPTION_SECRET` from environment variables
17-
- The secret must **never** be stored in the `common` package - calling environments retrieve it from their respective `env` files
18-
1913
## Database Migrations
2014

2115
- Schema defined in `common/src/db/schema.ts`

common/src/analytics.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { env } from '@codebuff/internal'
22
import { PostHog } from 'posthog-node'
33

4-
import { logger } from './util/logger'
5-
64
import type { AnalyticsEvent } from './constants/analytics-events'
75
import type { Logger } from '@codebuff/types/logger'
86

@@ -70,23 +68,3 @@ export function trackEvent({
7068
logger.error({ error }, 'Failed to track event')
7169
}
7270
}
73-
74-
export function logError(
75-
error: Error,
76-
userId?: string,
77-
properties?: Record<string, any>,
78-
) {
79-
if (!client) {
80-
logger.warn(
81-
{ error: error.message, userId },
82-
'Analytics client not initialized, skipping error logging',
83-
)
84-
return
85-
}
86-
87-
try {
88-
client.captureException(error, userId ?? 'unknown', properties)
89-
} catch (error) {
90-
logger.error({ error }, 'Failed to log error')
91-
}
92-
}

common/src/api-keys/crypto.ts

Lines changed: 0 additions & 233 deletions
This file was deleted.

0 commit comments

Comments
 (0)