1- import { Plugin , Build } from "graphile-build" ;
2- import {
1+ import type { Plugin , Build } from "graphile-build" ;
2+ import type {
33 PgEntityKind ,
44 PgEntity ,
55 PgIntrospectionResultsByKind ,
@@ -36,11 +36,10 @@ export type PgSmartTagSupportedKinds =
3636const meaningByKind : {
3737 [ kind in PgSmartTagSupportedKinds ] : string ;
3838} = {
39- [ PgEntityKind . CLASS ] :
40- "for tables, composite types, views and materialized views" ,
41- [ PgEntityKind . ATTRIBUTE ] : "for columns/attributes (of any 'class' type)" ,
42- [ PgEntityKind . CONSTRAINT ] : "for table constraints" ,
43- [ PgEntityKind . PROCEDURE ] : "for functions/procedures" ,
39+ [ "class" ] : "for tables, composite types, views and materialized views" ,
40+ [ "attribute" ] : "for columns/attributes (of any 'class' type)" ,
41+ [ "constraint" ] : "for table constraints" ,
42+ [ "procedure" ] : "for functions/procedures" ,
4443} ;
4544
4645const validKinds = Object . entries ( meaningByKind )
@@ -263,7 +262,7 @@ function pgSmartTagRulesFromJSON(
263262 key : string ,
264263 deprecated = false
265264 ) : void {
266- if ( kind !== PgEntityKind . CLASS ) {
265+ if ( kind !== "class" ) {
267266 throw new Error (
268267 `makeJSONPgSmartTagsPlugin: '${ key } ' is only valid on a class; you tried to set it on a '${ kind } ' at 'config.${ kind } .${ identifier } .${ key } '`
269268 ) ;
@@ -347,7 +346,7 @@ function pgSmartTagRulesFromJSON(
347346 process (
348347 kind ,
349348 identifier ,
350- PgEntityKind . ATTRIBUTE ,
349+ "attribute" as PgEntityKind . ATTRIBUTE ,
351350 columns ,
352351 "columns" ,
353352 true
@@ -357,7 +356,7 @@ function pgSmartTagRulesFromJSON(
357356 process (
358357 kind ,
359358 identifier ,
360- PgEntityKind . ATTRIBUTE ,
359+ "attribute" as PgEntityKind . ATTRIBUTE ,
361360 attribute ,
362361 "attribute"
363362 ) ;
@@ -366,7 +365,7 @@ function pgSmartTagRulesFromJSON(
366365 process (
367366 kind ,
368367 identifier ,
369- PgEntityKind . CONSTRAINT ,
368+ "constraint" as PgEntityKind . CONSTRAINT ,
370369 constraint ,
371370 "constraint"
372371 ) ;
0 commit comments