@@ -12,17 +12,17 @@ import { convertFilter, convertParam } from './utils/converters.js';
12
12
import { getEnums } from './utils/get-enums.js' ;
13
13
14
14
export class Resource extends BaseResource {
15
- private client : PrismaClient ;
15
+ protected client : PrismaClient ;
16
16
17
- private model : DMMF . Model ;
17
+ protected model : DMMF . Model ;
18
18
19
- private enums : Enums ;
19
+ protected enums : Enums ;
20
20
21
- private manager : ModelManager ;
21
+ protected manager : ModelManager ;
22
22
23
- private propertiesObject : Record < string , Property > ;
23
+ protected propertiesObject : Record < string , Property > ;
24
24
25
- private idProperty : Property ;
25
+ protected idProperty : Property ;
26
26
27
27
constructor ( args : {
28
28
model : DMMF . Model ;
@@ -96,7 +96,7 @@ export class Resource extends BaseResource {
96
96
) ;
97
97
}
98
98
99
- private buildSortBy ( sort : { sortBy ?: string ; direction ?: 'asc' | 'desc' } = { } ) {
99
+ protected buildSortBy ( sort : { sortBy ?: string ; direction ?: 'asc' | 'desc' } = { } ) {
100
100
let { sortBy : path } = sort ;
101
101
const { direction = 'desc' } = sort ;
102
102
@@ -208,7 +208,7 @@ export class Resource extends BaseResource {
208
208
) ;
209
209
}
210
210
211
- private prepareProperties ( ) : { [ propertyPath : string ] : Property } {
211
+ protected prepareProperties ( ) : { [ propertyPath : string ] : Property } {
212
212
const { fields = [ ] } = this . model ;
213
213
214
214
const properties = fields . reduce ( ( memo , field ) => {
@@ -232,7 +232,7 @@ export class Resource extends BaseResource {
232
232
return properties ;
233
233
}
234
234
235
- private prepareParams ( params : Record < string , any > ) : Record < string , any > {
235
+ protected prepareParams ( params : Record < string , any > ) : Record < string , any > {
236
236
const preparedParams : Record < string , any > = { } ;
237
237
238
238
for ( const property of this . properties ( ) ) {
@@ -268,7 +268,7 @@ export class Resource extends BaseResource {
268
268
return preparedParams ;
269
269
}
270
270
271
- private prepareReturnValues (
271
+ protected prepareReturnValues (
272
272
params : Record < string , any > ,
273
273
) : Record < string , any > {
274
274
const preparedValues : Record < string , any > = { } ;
0 commit comments