Skip to content

Commit

Permalink
chore: replace deprecated types
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Nov 16, 2023
1 parent a6c9471 commit b29bd70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const postgresColumnSchema = Type.Object({
table_id: Type.Integer(),
schema: Type.String(),
table: Type.String(),
id: Type.RegEx(/^(\d+)\.(\d+)$/),
id: Type.RegExp(/^(\d+)\.(\d+)$/),
ordinal_position: Type.Integer(),
name: Type.String(),
default_value: Type.Unknown(),
Expand Down Expand Up @@ -508,7 +508,7 @@ export const postgresTablePrivilegesRevokeSchema = Type.Object({
export type PostgresTablePrivilegesRevoke = Static<typeof postgresTablePrivilegesRevokeSchema>

export const postgresColumnPrivilegesSchema = Type.Object({
column_id: Type.RegEx(/^(\d+)\.(\d+)$/),
column_id: Type.RegExp(/^(\d+)\.(\d+)$/),
relation_schema: Type.String(),
relation_name: Type.String(),
column_name: Type.String(),
Expand All @@ -529,7 +529,7 @@ export const postgresColumnPrivilegesSchema = Type.Object({
export type PostgresColumnPrivileges = Static<typeof postgresColumnPrivilegesSchema>

export const postgresColumnPrivilegesGrantSchema = Type.Object({
column_id: Type.RegEx(/^(\d+)\.(\d+)$/),
column_id: Type.RegExp(/^(\d+)\.(\d+)$/),
grantee: Type.String(),
privilege_type: Type.Union([
Type.Literal('ALL'),
Expand All @@ -543,7 +543,7 @@ export const postgresColumnPrivilegesGrantSchema = Type.Object({
export type PostgresColumnPrivilegesGrant = Static<typeof postgresColumnPrivilegesGrantSchema>

export const postgresColumnPrivilegesRevokeSchema = Type.Object({
column_id: Type.RegEx(/^(\d+)\.(\d+)$/),
column_id: Type.RegExp(/^(\d+)\.(\d+)$/),
grantee: Type.String(),
privilege_type: Type.Union([
Type.Literal('ALL'),
Expand Down
6 changes: 3 additions & 3 deletions src/server/routes/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default async (fastify: FastifyInstance) => {
pg: Type.String(),
}),
params: Type.Object({
id: Type.RegEx(/\d+/),
id: Type.RegExp(/\d+/),
}),
response: {
200: postgresRoleSchema,
Expand Down Expand Up @@ -150,7 +150,7 @@ export default async (fastify: FastifyInstance) => {
pg: Type.String(),
}),
params: Type.Object({
id: Type.RegEx(/\d+/),
id: Type.RegExp(/\d+/),
}),
body: postgresRoleUpdateSchema,
response: {
Expand Down Expand Up @@ -195,7 +195,7 @@ export default async (fastify: FastifyInstance) => {
pg: Type.String(),
}),
params: Type.Object({
id: Type.RegEx(/\d+/),
id: Type.RegExp(/\d+/),
}),
querystring: Type.Object({
cascade: Type.Optional(Type.String()),
Expand Down

0 comments on commit b29bd70

Please sign in to comment.