Skip to content

Commit ffe75b0

Browse files
committed
make some more db types public
1 parent 31efe7e commit ffe75b0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gateway/src/db.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ ON CONFLICT (id) DO UPDATE SET status = excluded.status, expiresAt = null`,
4747

4848
export type EntityType = 'project' | 'user' | 'key'
4949

50-
const entityTypeLookup: Record<EntityType, number> = { project: 1, user: 2, key: 3 }
51-
const reverseEntityTypeLookup: Record<1 | 2 | 3, EntityType> = { 1: 'project', 2: 'user', 3: 'key' }
50+
export const entityTypeLookup: Record<EntityType, number> = { project: 1, user: 2, key: 3 }
51+
export const reverseEntityTypeLookup: Record<1 | 2 | 3, EntityType> = { 1: 'project', 2: 'user', 3: 'key' }
5252

5353
export type Scope = 'daily' | 'weekly' | 'monthly' | 'total'
5454

55-
const scopeLookup: Record<Scope, number> = { daily: 1, weekly: 2, monthly: 3, total: 4 }
56-
const reverseScopeLookup: Record<1 | 2 | 3 | 4, Scope> = { 1: 'daily', 2: 'weekly', 3: 'monthly', 4: 'total' }
55+
export const scopeLookup: Record<Scope, number> = { daily: 1, weekly: 2, monthly: 3, total: 4 }
56+
export const reverseScopeLookup: Record<1 | 2 | 3 | 4, Scope> = { 1: 'daily', 2: 'weekly', 3: 'monthly', 4: 'total' }
5757

5858
export interface SpendScope {
5959
entityType: EntityType
@@ -79,7 +79,7 @@ export interface LimitUpdate {
7979

8080
export type KeyLimitUpdate = LimitUpdate & { total?: number | null }
8181
// 65536 equates to 2149-06-07
82-
const DISTANT_FUTURE = 65536
82+
export const DISTANT_FUTURE = 65536
8383

8484
export interface SpendStatus {
8585
entityId: number

0 commit comments

Comments
 (0)