@@ -184,6 +184,13 @@ export const postgresRelationshipSchema = Type.Object({
184
184
} )
185
185
export type PostgresRelationship = Static < typeof postgresRelationshipSchema >
186
186
187
+ export const PostgresMetaRoleConfigSchema = Type . Object ( {
188
+ op : Type . Union ( [ Type . Literal ( 'remove' ) , Type . Literal ( 'add' ) , Type . Literal ( 'replace' ) ] ) ,
189
+ path : Type . String ( ) ,
190
+ value : Type . Optional ( Type . String ( ) ) ,
191
+ } )
192
+ export type PostgresMetaRoleConfig = Static < typeof PostgresMetaRoleConfigSchema >
193
+
187
194
export const postgresRoleSchema = Type . Object ( {
188
195
id : Type . Integer ( ) ,
189
196
name : Type . String ( ) ,
@@ -198,14 +205,45 @@ export const postgresRoleSchema = Type.Object({
198
205
connection_limit : Type . Integer ( ) ,
199
206
password : Type . String ( ) ,
200
207
valid_until : Type . Union ( [ Type . String ( ) , Type . Null ( ) ] ) ,
201
- config : Type . Union ( [
202
- Type . String ( ) ,
203
- Type . Null ( ) ,
204
- Type . Record ( Type . String ( ) , Type . Union ( [ Type . String ( ) ] ) ) ,
205
- ] ) ,
208
+ config : Type . Union ( [ Type . String ( ) , Type . Null ( ) , Type . Record ( Type . String ( ) , Type . String ( ) ) ] ) ,
206
209
} )
207
210
export type PostgresRole = Static < typeof postgresRoleSchema >
208
211
212
+ export const postgresRoleCreateSchema = Type . Object ( {
213
+ name : Type . String ( ) ,
214
+ password : Type . Optional ( Type . String ( ) ) ,
215
+ inherit_role : Type . Optional ( Type . Boolean ( ) ) ,
216
+ can_login : Type . Optional ( Type . Boolean ( ) ) ,
217
+ is_superuser : Type . Optional ( Type . Boolean ( ) ) ,
218
+ can_create_db : Type . Optional ( Type . Boolean ( ) ) ,
219
+ can_create_role : Type . Optional ( Type . Boolean ( ) ) ,
220
+ is_replication_role : Type . Optional ( Type . Boolean ( ) ) ,
221
+ can_bypass_rls : Type . Optional ( Type . Boolean ( ) ) ,
222
+ connection_limit : Type . Optional ( Type . Integer ( ) ) ,
223
+ member_of : Type . Optional ( Type . Array ( Type . String ( ) ) ) ,
224
+ members : Type . Optional ( Type . Array ( Type . String ( ) ) ) ,
225
+ admins : Type . Optional ( Type . Array ( Type . String ( ) ) ) ,
226
+ valid_until : Type . Optional ( Type . String ( ) ) ,
227
+ config : Type . Optional ( Type . Record ( Type . String ( ) , Type . String ( ) ) ) ,
228
+ } )
229
+ export type PostgresRoleCreate = Static < typeof postgresRoleCreateSchema >
230
+
231
+ export const postgresRoleUpdateSchema = Type . Object ( {
232
+ name : Type . Optional ( Type . String ( ) ) ,
233
+ password : Type . Optional ( Type . String ( ) ) ,
234
+ inherit_role : Type . Optional ( Type . Boolean ( ) ) ,
235
+ can_login : Type . Optional ( Type . Boolean ( ) ) ,
236
+ is_superuser : Type . Optional ( Type . Boolean ( ) ) ,
237
+ can_create_db : Type . Optional ( Type . Boolean ( ) ) ,
238
+ can_create_role : Type . Optional ( Type . Boolean ( ) ) ,
239
+ is_replication_role : Type . Optional ( Type . Boolean ( ) ) ,
240
+ can_bypass_rls : Type . Optional ( Type . Boolean ( ) ) ,
241
+ connection_limit : Type . Optional ( Type . Integer ( ) ) ,
242
+ valid_until : Type . Optional ( Type . String ( ) ) ,
243
+ config : Type . Optional ( Type . Array ( PostgresMetaRoleConfigSchema ) ) ,
244
+ } )
245
+ export type PostgresRoleUpdate = Static < typeof postgresRoleUpdateSchema >
246
+
209
247
export const postgresSchemaSchema = Type . Object ( {
210
248
id : Type . Integer ( ) ,
211
249
name : Type . String ( ) ,
0 commit comments