Skip to content

Commit a50d0ce

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 823a5a0 + ea83fe8 commit a50d0ce

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

packages/backend/src/utils/database.types.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export type Database = {
5050
mock_response: Json | null
5151
mock_status_code: number | null
5252
name: string
53+
path: string | null
5354
regex_path: string | null
5455
retry_count: number
5556
retry_enabled: boolean
@@ -78,6 +79,7 @@ export type Database = {
7879
mock_response?: Json | null
7980
mock_status_code?: number | null
8081
name: string
82+
path?: string | null
8183
regex_path?: string | null
8284
retry_count?: number
8385
retry_enabled?: boolean
@@ -106,6 +108,7 @@ export type Database = {
106108
mock_response?: Json | null
107109
mock_status_code?: number | null
108110
name?: string
111+
path?: string | null
109112
regex_path?: string | null
110113
retry_count?: number
111114
retry_enabled?: boolean
@@ -135,13 +138,13 @@ export type Database = {
135138
Insert: {
136139
created_at?: string | null
137140
endpoint_id: number
138-
id?: never
141+
id?: number
139142
schema?: Json | null
140143
}
141144
Update: {
142145
created_at?: string | null
143146
endpoint_id?: number
144-
id?: never
147+
id?: number
145148
schema?: Json | null
146149
}
147150
Relationships: [
@@ -346,13 +349,24 @@ export type Database = {
346349
}
347350
Returns: Json
348351
}
352+
increment_mcp_usage: {
353+
Args: { p_user_id: string; p_max_requests: number }
354+
Returns: {
355+
allowed: boolean
356+
c_count: number
357+
}[]
358+
}
349359
increment_usage: {
350360
Args: { p_user_id: string; p_max_requests: number }
351361
Returns: {
352362
allowed: boolean
353363
c_count: number
354364
}[]
355365
}
366+
update_full_url: {
367+
Args: { p_service_id: number }
368+
Returns: undefined
369+
}
356370
}
357371
Enums: {
358372
[_ in never]: never
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
alter table public.endpoints
2+
add column path text;
3+
4+
create or replace function update_full_url(p_service_id integer)
5+
returns void
6+
security definer
7+
language plpgsql
8+
as
9+
$$
10+
begin
11+
update public.endpoints e
12+
set full_url = concat(s.base_url, e.path)
13+
from public.services s
14+
where s.id = p_service_id and e.service_id = s.id;
15+
end;
16+
$$;

0 commit comments

Comments
 (0)